(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[753],{366:function(e,t,n){"use strict";var r=n(5318),o=n(862);t.Z=void 0;var i=o(n(7294)),s=(0,r(n(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=s},306:function(e,t,n){"use strict";var r=n(5318),o=n(862);t.Z=void 0;var i=o(n(7294)),s=(0,r(n(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=s},2617:function(e,t,n){"use strict";var r=n(5318),o=n(862);t.Z=void 0;var i=o(n(7294)),s=(0,r(n(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=s},5358:function(e,t,n){"use strict";var r=n(5318),o=n(862);t.Z=void 0;var i=o(n(7294)),s=(0,r(n(2108)).default)(i.createElement("path",{d:"M10 3H8v1.88l2 2zm6 6v3.88l1.8 1.8.2-.2V9c0-1.1-.9-2-2-2V3h-2v4h-3.88l2 2H16zM4.12 3.84L2.71 5.25 6 8.54v5.96L9.5 18v3h5v-3l.48-.48 4.47 4.47 1.41-1.41L4.12 3.84zm8.38 13.33V19h-1v-1.83L8 13.65v-3.11l5.57 5.57-1.07 1.06z"}),"PowerOffOutlined");t.Z=s},210:function(e,t,n){"use strict";n.d(t,{Z:function(){return C}});var r=n(4942),o=n(7294),i=n(5258),s=n(1120),a=n(9956),c=n(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"}],l={width:"40em",height:"40em"},d=n(9753),f=n(7159),p=n(2822),h=n(998),m=n(5517),v=n(7623),g=n(442),b=n(964),x=n(5893);function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function j(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[r++]}},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,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,i=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw i}}}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:[];return new Promise((function(t){var n=function(){return v=!0,t()};y(m,e).then(n,n)}))},window.__NEXT_PRELOADREADY=x.preloadReady;var j=x;t.default=j},5782:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return V}});var r=n(4942),o=n(7294),i=n(1163),s=n(9008),a=n(9956),c=n(1120);function u(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(u){return void n(u)}a.done?t(c):Promise.resolve(c).then(r,o)}function l(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){u(i,r,o,s,a,"next",e)}function a(e){u(i,r,o,s,a,"throw",e)}s(void 0)}))}}var d=n(7757),f=n.n(d),p=n(5152),h=n(5675),m=n(5639),v=n(2318),g=n(282),b=n(366),x=n(2617),y=n(7812),j=n(6638),w=n(9753),_="0xffe3",O="0xffe9",k=[{keys:"Ctrl + Alt + Delete",scans:[]},{keys:"Ctrl + Alt + F1",scans:[_,O,"0xffbe"]},{keys:"Ctrl + Alt + F2",scans:[_,O,"0xffbf"]},{keys:"Ctrl + Alt + F3",scans:[_,O,"0xffc0"]},{keys:"Ctrl + Alt + F4",scans:[_,O,"0xffc1"]},{keys:"Ctrl + Alt + F5",scans:[_,O,"0xffc2"]},{keys:"Ctrl + Alt + F6",scans:[_,O,"0xffc3"]},{keys:"Ctrl + Alt + F7",scans:[_,O,"0xffc4"]},{keys:"Ctrl + Alt + F8",scans:[_,O,"0xffc5"]},{keys:"Ctrl + Alt + F9",scans:[_,O,"0xffc6"]}],Z=n(9386),C=function(){var e=l(f().mark((function e(t,n,r){var o,i,s;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=new AbortController,i=setTimeout((function(){return o.abort()}),r),e.next=4,fetch(t,{method:"PUT",headers:{"Content-Type":"application/json","Keep-Alive":"timeout=120"},signal:o.signal,body:JSON.stringify(n)});case 4:return s=e.sent,clearTimeout(i),e.abrupt("return",s);case 7:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),P=n(964),D=n(8382),N=n(5893),S=(0,p.default)((function(){return Promise.all([n.e(204),n.e(97)]).then(n.bind(n,7097))}),{ssr:!1,loadableGenerated:{webpack:function(){return[7097]},modules:["../components/Display/FullSize.tsx -> ./VncDisplay"]}}),E=(0,c.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:w.hM,"&:hover":{backgroundColor:w.hM}},keyboardButton:{borderRadius:8,backgroundColor:w.lD,"&:hover":{backgroundColor:w.lD}},closeBox:{paddingBottom:"1em",paddingLeft:".7em",paddingRight:0},buttonsBox:{paddingTop:0},keysItem:{backgroundColor:w.lD,paddingRight:"3em","&:hover":{backgroundColor:w.lD}},buttonText:{color:w.E5}}})),B=function(e){var t=e.setMode,n=e.uuid,r=e.serverName,i=(0,o.useState)(null),s=i[0],c=i[1],u=(0,o.useRef)(),d=(0,o.useRef)(void 0),p=(0,o.useState)(void 0),_=p[0],O=p[1],B=(0,o.useState)(!1),z=B[0],T=B[1],A=E();(0,o.useEffect)((function(){d.current=window.location.hostname,_||l(f().mark((function e(){var t;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,C("".concat("/cgi-bin","/manage_vnc_pipes"),{server_uuid:n,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),T(!0);case 14:case"end":return e.stop()}}),e,null,[[0,11]])})))()}),[n,_,z]);var L=function(){var e=l(f().mark((function e(){return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Z.Z)("".concat("/cgi-bin","/manage_vnc_pipes"),{server_uuid:n,is_open:!1});case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,N.jsxs)(j.s_,{children:[(0,N.jsx)(a.Z,{flexGrow:1,children:(0,N.jsx)(P.z,{text:"Server: ".concat(r)})}),_?(0,N.jsxs)(a.Z,{display:"flex",className:A.displayBox,children:[(0,N.jsx)(S,{rfb:u,url:"".concat(_.protocol,"://").concat(d.current,":").concat(_.forward_port),viewOnly:!1,focusOnClick:!1,clipViewport:!1,dragViewport:!1,scaleViewport:!0,resizeSession:!0,showDotCursor:!1,background:"",qualityLevel:6,compressionLevel:2}),(0,N.jsxs)(a.Z,{children:[(0,N.jsx)(a.Z,{className:A.closeBox,children:(0,N.jsx)(y.Z,{className:A.closeButton,style:{color:w.lD},component:"span",onClick:function(){L(),t(!0)},children:(0,N.jsx)(b.Z,{})})}),(0,N.jsxs)(a.Z,{className:A.closeBox,children:[(0,N.jsx)(y.Z,{className:A.keyboardButton,style:{color:w.E5},component:"span",onClick:function(e){c(e.currentTarget)},children:(0,N.jsx)(x.Z,{})}),(0,N.jsx)(h.Z,{anchorEl:s,keepMounted:!0,open:Boolean(s),onClose:function(){return c(null)},children:k.map((function(e){var t=e.keys,n=e.scans;return(0,N.jsx)(m.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 n=e.length-1;n>=0;n-=1)u.current.sendKey(e[n],0)}else u.current.sendCtrlAltDel();c(null)}}(n)},className:A.keysItem,children:(0,N.jsx)(v.Z,{variant:"subtitle1",children:t})},t)}))})]})]})]}):(0,N.jsx)(a.Z,{display:"flex",className:A.spinnerBox,children:z?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(a.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(){T(!1)},style:{textTransform:"none"},children:(0,N.jsx)(v.Z,{className:A.buttonText,variant:"subtitle1",children:"Reconnect"})})]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(P.z,{text:"Establishing connection with ".concat(r)}),(0,N.jsx)(P.z,{text:"This may take a few minutes"}),(0,N.jsx)(D.Z,{})]})})]})},z=n(306),T=n(5358),A=(0,c.Z)((function(){return{displayBox:{padding:0,paddingTop:".7em",width:"100%"},fullScreenButton:{borderRadius:8,backgroundColor:w.lD,"&:hover":{backgroundColor:w.lD}},fullScreenBox:{paddingLeft:"1em",padding:0},imageButton:{padding:0,color:w.lD},powerOffIcon:{borderRadius:8,padding:0,color:w.s7,width:"100%",height:"100%"},previewImage:{width:"100%",height:"100%"}}})),L=function(e){var t=e.setMode,n=e.uuid,r=e.serverName,i=A(),s=(0,o.useState)(),c=s[0],u=s[1];return(0,o.useEffect)((function(){l(f().mark((function e(){var t,r,o;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch("".concat("/cgi-bin","/get_server_screenshot?server_uuid=").concat(n),{method:"GET",headers:{"Content-Type":"application/json"}});case 3:return t=e.sent,e.next=6,t.json();case 6:r=e.sent,o=r.screenshot,u(o),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(0),u("");case 14:case"end":return e.stop()}}),e,null,[[0,11]])})))()}),[n]),(0,N.jsxs)(j.s_,{children:[(0,N.jsx)(a.Z,{flexGrow:1,children:(0,N.jsx)(P.z,{text:"Server: ".concat(r)})}),(0,N.jsxs)(a.Z,{display:"flex",className:i.displayBox,children:[(0,N.jsx)(a.Z,{children:(0,N.jsx)(y.Z,{className:i.imageButton,style:{color:w.E5},component:"span",onClick:function(){return t(!1)},children:c?(0,N.jsx)("img",{alt:"",src:"data:image/png;base64,".concat(c),className:i.previewImage},"preview"):(0,N.jsx)(T.Z,{className:i.powerOffIcon})})}),(0,N.jsx)(a.Z,{className:i.fullScreenBox,children:(0,N.jsx)(y.Z,{className:i.fullScreenButton,style:{color:w.E5},component:"span",onClick:function(){return t(!1)},children:(0,N.jsx)(z.Z,{})})})]})]})},R=n(210),M=(0,c.Z)((function(e){return{preview:(0,r.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,o.useState)(!0),t=e[0],n=e[1],r=M(),c=(0,i.useRouter)().query,u=c.uuid,l=c.server_name;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(s.default,{children:(0,N.jsx)("title",{children:l})}),(0,N.jsx)(R.Z,{}),"string"===typeof u&&(t?(0,N.jsx)(a.Z,{className:r.preview,children:(0,N.jsx)(L,{setMode:n,uuid:u,serverName:l})}):(0,N.jsx)(a.Z,{className:r.fullView,children:(0,N.jsx)(B,{setMode:n,uuid:u,serverName:l})}))]})}},8954:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/server",function(){return n(5782)}])},5152:function(e,t,n){e.exports=n(8771)},1163:function(e,t,n){e.exports=n(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}]);