(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[753],{366:function(e,t,r){"use strict";var n=r(5318),o=r(862);t.Z=void 0;var i=o(r(7294)),a=(0,n(r(2108)).default)(i.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");t.Z=a},306:function(e,t,r){"use strict";var n=r(5318),o=r(862);t.Z=void 0;var i=o(r(7294)),a=(0,n(r(2108)).default)(i.createElement("path",{d:"M21 2H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h7v2H8v2h8v-2h-2v-2h7c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H3V4h18v12z"}),"DesktopWindows");t.Z=a},4849:function(e,t,r){"use strict";var n=r(5318),o=r(862);t.Z=void 0;var i=o(r(7294)),a=(0,n(r(2108)).default)(i.createElement("path",{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"}),"Image");t.Z=a},2617:function(e,t,r){"use strict";var n=r(5318),o=r(862);t.Z=void 0;var i=o(r(7294)),a=(0,n(r(2108)).default)(i.createElement("path",{d:"M20 5H4c-1.1 0-1.99.9-1.99 2L2 17c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm-9 3h2v2h-2V8zm0 3h2v2h-2v-2zM8 8h2v2H8V8zm0 3h2v2H8v-2zm-1 2H5v-2h2v2zm0-3H5V8h2v2zm9 7H8v-2h8v2zm0-4h-2v-2h2v2zm0-3h-2V8h2v2zm3 3h-2v-2h2v2zm0-3h-2V8h2v2z"}),"Keyboard");t.Z=a},210:function(e,t,r){"use strict";r.d(t,{Z:function(){return C}});var n=r(5893),o=r(2809),i=r(7294),a=r(5258),s=r(1120),c=r(9956),l=r(282),u=[{text:"Files",image:"/pngs/files_on.png",uri:"/striker?files=true"},{text:"Tasks",image:"/pngs/tasks_no-jobs_icon.png",uri:"/striker?jobs=true"},{text:"Configure",image:"/pngs/configure_icon_on.png",uri:"/striker?configure=true"},{text:"Striker",image:"/pngs/striker_icon_on.png",uri:"/striker?striker=true"},{text:"Anvil",image:"/pngs/anvil_icon_on.png",uri:"/striker?anvil=true"},{text:"Email",image:"/pngs/email_on.png",uri:"/striker?email=true"},{text:"Logout",image:"/pngs/users_icon_on.png",uri:"/striker?logout=true"},{text:"Help",image:"/pngs/help_icon_on.png",uri:"https://alteeve.com/w/Support"}],d={width:"40em",height:"40em"},f=r(9753),p=r(7159),h=r(2822),m=r(998),v=r(5517),b=r(7623),g=r(442),x=r(964);function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function j(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&void 0!==arguments[0]?arguments[0]:[];return new Promise((function(t){var r=function(){return v=!0,t()};y(m,e).then(r,r)}))},window.__NEXT_PRELOADREADY=x.preloadReady;var j=x;t.default=j},8379:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return V}});var n=r(5893),o=r(2809),i=r(7294),a=r(1163),s=r(9008),c=r(9956),l=r(1120),u=r(809),d=r.n(u);function f(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(l){return void r(l)}s.done?t(c):Promise.resolve(c).then(n,o)}function p(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){f(i,n,o,a,s,"next",e)}function s(e){f(i,n,o,a,s,"throw",e)}a(void 0)}))}}var h=r(5152),m=r(5675),v=r(5639),b=r(2318),g=r(282),x=r(366),y=r(2617),j=r(7812),w=r(6638),_=r(9753),k="0xffe3",O="0xffe9",Z=[{keys:"Ctrl + Alt + Delete",scans:[]},{keys:"Ctrl + Alt + F1",scans:[k,O,"0xffbe"]},{keys:"Ctrl + Alt + F2",scans:[k,O,"0xffbf"]},{keys:"Ctrl + Alt + F3",scans:[k,O,"0xffc0"]},{keys:"Ctrl + Alt + F4",scans:[k,O,"0xffc1"]},{keys:"Ctrl + Alt + F5",scans:[k,O,"0xffc2"]},{keys:"Ctrl + Alt + F6",scans:[k,O,"0xffc3"]},{keys:"Ctrl + Alt + F7",scans:[k,O,"0xffc4"]},{keys:"Ctrl + Alt + F8",scans:[k,O,"0xffc5"]},{keys:"Ctrl + Alt + F9",scans:[k,O,"0xffc6"]}],C=r(9386),D=function(){var e=p(d().mark((function e(t,r,n){var o,i,a;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=new AbortController,i=setTimeout((function(){return o.abort()}),n),e.next=4,fetch(t,{method:"PUT",headers:{"Content-Type":"application/json","Keep-Alive":"timeout=120"},signal:o.signal,body:JSON.stringify(r)});case 4:return a=e.sent,clearTimeout(i),e.abrupt("return",a);case 7:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}(),P=r(964),N=r(8382),S=(0,h.default)((function(){return Promise.all([r.e(204),r.e(97)]).then(r.bind(r,7097))}),{ssr:!1,loadableGenerated:{webpack:function(){return[7097]},modules:["../components/Display/FullSize.tsx -> ./VncDisplay"]}}),B=(0,l.Z)((function(){return{displayBox:{width:"75vw",height:"75vh",paddingTop:"1em",paddingBottom:0,paddingLeft:0,paddingRight:0},spinnerBox:{flexDirection:"column",width:"75vw",height:"75vh",alignItems:"center",justifyContent:"center"},closeButton:{borderRadius:8,backgroundColor:_.hM,"&:hover":{backgroundColor:_.hM}},keyboardButton:{borderRadius:8,backgroundColor:_.lD,"&:hover":{backgroundColor:_.lD}},closeBox:{paddingBottom:"1em",paddingLeft:".7em",paddingRight:0},buttonsBox:{paddingTop:0},keysItem:{backgroundColor:_.lD,paddingRight:"3em","&:hover":{backgroundColor:_.lD}},buttonText:{color:_.E5}}})),E=function(e){var t=e.setMode,r=e.uuid,o=e.serverName,a=(0,i.useState)(null),s=a[0],l=a[1],u=(0,i.useRef)(),f=(0,i.useRef)(void 0),h=(0,i.useState)(void 0),k=h[0],O=h[1],E=(0,i.useState)(!1),T=E[0],z=E[1],A=B();(0,i.useEffect)((function(){f.current=window.location.hostname,k||p(d().mark((function e(){var t;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,D("".concat("/cgi-bin","/manage_vnc_pipes"),{server_uuid:r,is_open:!0},12e4);case 3:return t=e.sent,e.t0=O,e.next=7,t.json();case 7:e.t1=e.sent,(0,e.t0)(e.t1),e.next=14;break;case 11:e.prev=11,e.t2=e.catch(0),z(!0);case 14:case"end":return e.stop()}}),e,null,[[0,11]])})))()}),[r,k,T]);var R=function(){var e=p(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,C.Z)("".concat("/cgi-bin","/manage_vnc_pipes"),{server_uuid:r,is_open:!1});case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,n.jsxs)(w.s_,{children:[(0,n.jsx)(c.Z,{flexGrow:1,children:(0,n.jsx)(P.z,{text:"Server: ".concat(o)})}),k?(0,n.jsxs)(c.Z,{display:"flex",className:A.displayBox,children:[(0,n.jsx)(S,{rfb:u,url:"".concat(k.protocol,"://").concat(f.current,":").concat(k.forward_port),viewOnly:!1,focusOnClick:!1,clipViewport:!1,dragViewport:!1,scaleViewport:!0,resizeSession:!0,showDotCursor:!1,background:"",qualityLevel:6,compressionLevel:2}),(0,n.jsxs)(c.Z,{children:[(0,n.jsx)(c.Z,{className:A.closeBox,children:(0,n.jsx)(j.Z,{className:A.closeButton,style:{color:_.lD},component:"span",onClick:function(){R(),t(!0)},children:(0,n.jsx)(x.Z,{})})}),(0,n.jsxs)(c.Z,{className:A.closeBox,children:[(0,n.jsx)(j.Z,{className:A.keyboardButton,style:{color:_.E5},component:"span",onClick:function(e){l(e.currentTarget)},children:(0,n.jsx)(y.Z,{})}),(0,n.jsx)(m.Z,{anchorEl:s,keepMounted:!0,open:Boolean(s),onClose:function(){return l(null)},children:Z.map((function(e){var t=e.keys,r=e.scans;return(0,n.jsx)(v.Z,{onClick:function(){return function(e){if(u.current){if(e.length){for(var t=0;t<=e.length-1;t+=1)u.current.sendKey(e[t],1);for(var r=e.length-1;r>=0;r-=1)u.current.sendKey(e[r],0)}else u.current.sendCtrlAltDel();l(null)}}(r)},className:A.keysItem,children:(0,n.jsx)(b.Z,{variant:"subtitle1",children:t})},t)}))})]})]})]}):(0,n.jsx)(c.Z,{display:"flex",className:A.spinnerBox,children:T?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c.Z,{style:{paddingBottom:"2em"},children:(0,n.jsx)(P.z,{text:"There was a problem connecting to the server, please try again"})}),(0,n.jsx)(g.Z,{variant:"contained",onClick:function(){z(!1)},style:{textTransform:"none"},children:(0,n.jsx)(b.Z,{className:A.buttonText,variant:"subtitle1",children:"Reconnect"})})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(P.z,{text:"Establishing connection with ".concat(o)}),(0,n.jsx)(P.z,{text:"This may take a few minutes"}),(0,n.jsx)(N.Z,{})]})})]})},T=r(306),z=r(4849),A=(0,l.Z)((function(){return{displayBox:{padding:0,paddingTop:".7em",width:"100%"},fullScreenButton:{borderRadius:8,backgroundColor:_.lD,"&:hover":{backgroundColor:_.lD}},fullScreenBox:{paddingLeft:"1em",padding:0},imageButton:{padding:0,color:_.lD},imageIcon:{borderRadius:8,padding:0,backgroundColor:_.s7,fontSize:"8em"}}})),R=function(e){var t=e.setMode,r=e.serverName,o=A();return(0,n.jsxs)(w.s_,{children:[(0,n.jsx)(c.Z,{flexGrow:1,children:(0,n.jsx)(P.z,{text:"Server: ".concat(r)})}),(0,n.jsxs)(c.Z,{display:"flex",className:o.displayBox,children:[(0,n.jsx)(c.Z,{children:(0,n.jsx)(j.Z,{className:o.imageButton,style:{color:_.E5},component:"span",onClick:function(){return t(!1)},children:(0,n.jsx)(z.Z,{className:o.imageIcon})})}),(0,n.jsx)(c.Z,{className:o.fullScreenBox,children:(0,n.jsx)(j.Z,{className:o.fullScreenButton,style:{color:_.E5},component:"span",onClick:function(){return t(!1)},children:(0,n.jsx)(T.Z,{})})})]})]})},L=r(210),M=(0,l.Z)((function(e){return{preview:(0,o.Z)({width:"25%",height:"100%"},e.breakpoints.down("md"),{width:"100%"}),fullView:{display:"flex",flexDirection:"row",width:"100%",justifyContent:"center"}}})),V=function(){var e=(0,i.useState)(!0),t=e[0],r=e[1],o=M(),l=(0,a.useRouter)().query,u=l.uuid,d=l.server_name;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.default,{children:(0,n.jsx)("title",{children:d})}),(0,n.jsx)(L.Z,{}),"string"===typeof u&&(t?(0,n.jsx)(c.Z,{className:o.preview,children:(0,n.jsx)(R,{setMode:r,serverName:d})}):(0,n.jsx)(c.Z,{className:o.fullView,children:(0,n.jsx)(E,{setMode:r,uuid:u,serverName:d})}))]})}},8954:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/server",function(){return r(8379)}])},5152:function(e,t,r){e.exports=r(8771)},1163:function(e,t,r){e.exports=r(4651)}},function(e){e.O(0,[774,322,888,179],(function(){return t=8954,e(e.s=t);var t}));var t=e.O();_N_E=t}]);