@open-amt-cloud-toolkit/ui-toolkit-react 3.1.0 → 3.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-amt-cloud-toolkit/ui-toolkit-react",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.2",
|
|
4
4
|
"description": "React UI controls for Intel AMT features",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@fortawesome/fontawesome-svg-core": "^6.2.1",
|
|
30
30
|
"@fortawesome/free-solid-svg-icons": "^6.2.1",
|
|
31
31
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
32
|
-
"@open-amt-cloud-toolkit/ui-toolkit": "^
|
|
32
|
+
"@open-amt-cloud-toolkit/ui-toolkit": "^3.1.2",
|
|
33
33
|
"i18next": "^23.2.1",
|
|
34
34
|
"i18next-browser-languagedetector": "^7.0.1",
|
|
35
35
|
"md5": "^2.2.1",
|
|
@@ -51,13 +51,13 @@
|
|
|
51
51
|
"@types/react": "^18.0.25",
|
|
52
52
|
"@types/react-dom": "^18.0.9",
|
|
53
53
|
"@types/ws": "^8.2.0",
|
|
54
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
55
|
-
"@typescript-eslint/parser": "^
|
|
54
|
+
"@typescript-eslint/eslint-plugin": "^6.11.0",
|
|
55
|
+
"@typescript-eslint/parser": "^6.11.0",
|
|
56
56
|
"canvas": "^2.10.2",
|
|
57
57
|
"css-loader": "^6.7.2",
|
|
58
58
|
"eslint": "^8.27.0",
|
|
59
59
|
"eslint-config-standard": "^17.0.0",
|
|
60
|
-
"eslint-config-standard-with-typescript": "^
|
|
60
|
+
"eslint-config-standard-with-typescript": "^40.0.0",
|
|
61
61
|
"eslint-plugin-import": "^2.26.0",
|
|
62
62
|
"eslint-plugin-node": "^11.1.0",
|
|
63
63
|
"eslint-plugin-promise": "^6.1.1",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-amt-cloud-toolkit/ui-toolkit-react",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.2",
|
|
4
4
|
"description": "React UI controls for Intel AMT features",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@fortawesome/fontawesome-svg-core": "^6.2.1",
|
|
30
30
|
"@fortawesome/free-solid-svg-icons": "^6.2.1",
|
|
31
31
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
32
|
-
"@open-amt-cloud-toolkit/ui-toolkit": "^
|
|
32
|
+
"@open-amt-cloud-toolkit/ui-toolkit": "^3.1.2",
|
|
33
33
|
"i18next": "^23.2.1",
|
|
34
34
|
"i18next-browser-languagedetector": "^7.0.1",
|
|
35
35
|
"md5": "^2.2.1",
|
|
@@ -51,13 +51,13 @@
|
|
|
51
51
|
"@types/react": "^18.0.25",
|
|
52
52
|
"@types/react-dom": "^18.0.9",
|
|
53
53
|
"@types/ws": "^8.2.0",
|
|
54
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
55
|
-
"@typescript-eslint/parser": "^
|
|
54
|
+
"@typescript-eslint/eslint-plugin": "^6.11.0",
|
|
55
|
+
"@typescript-eslint/parser": "^6.11.0",
|
|
56
56
|
"canvas": "^2.10.2",
|
|
57
57
|
"css-loader": "^6.7.2",
|
|
58
58
|
"eslint": "^8.27.0",
|
|
59
59
|
"eslint-config-standard": "^17.0.0",
|
|
60
|
-
"eslint-config-standard-with-typescript": "^
|
|
60
|
+
"eslint-config-standard-with-typescript": "^40.0.0",
|
|
61
61
|
"eslint-plugin-import": "^2.26.0",
|
|
62
62
|
"eslint-plugin-node": "^11.1.0",
|
|
63
63
|
"eslint-plugin-promise": "^6.1.1",
|
package/reactjs/KVM/UI.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
* Author : Ramu Bachala
|
|
5
5
|
**********************************************************************/
|
|
6
|
-
import { IDataProcessor, IKvmDataCommunicator,
|
|
6
|
+
import { IDataProcessor, IKvmDataCommunicator, Desktop, MouseHelper, KeyBoardHelper } from '@open-amt-cloud-toolkit/ui-toolkit/core';
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import './UI.scss';
|
|
9
9
|
export interface KVMProps {
|
|
@@ -23,7 +23,6 @@ export declare class KVM extends React.Component<KVMProps, {
|
|
|
23
23
|
dataProcessor: IDataProcessor | any;
|
|
24
24
|
redirector: IKvmDataCommunicator | any;
|
|
25
25
|
mouseHelper: MouseHelper | any;
|
|
26
|
-
logger: ILogger;
|
|
27
26
|
keyboard: KeyBoardHelper | any;
|
|
28
27
|
desktopSettingsChange: boolean;
|
|
29
28
|
ctx: CanvasRenderingContext2D;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["React"],e):"object"==typeof exports?exports["ui-toolkit/reactjs/kvm"]=e(require("react")):t["ui-toolkit/reactjs/kvm"]=e(t.React)}(self,(__WEBPACK_EXTERNAL_MODULE__639__=>(()=>{var __webpack_modules__={869:module=>{var e;self,e=()=>(()=>{var __webpack_modules__={487:t=>{var e={utf8:{stringToBytes:function(t){return e.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(e.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],s=0;s<t.length;s++)e.push(255&t.charCodeAt(s));return e},bytesToString:function(t){for(var e=[],s=0;s<t.length;s++)e.push(String.fromCharCode(t[s]));return e.join("")}}};t.exports=e},12:t=>{var e,s;e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s={rotl:function(t,e){return t<<e|t>>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&s.rotl(t,8)|4278255360&s.rotl(t,24);for(var e=0;e<t.length;e++)t[e]=s.endian(t[e]);return t},randomBytes:function(t){for(var e=[];t>0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],s=0,a=0;s<t.length;s++,a+=8)e[a>>>5]|=t[s]<<24-a%32;return e},wordsToBytes:function(t){for(var e=[],s=0;s<32*t.length;s+=8)e.push(t[s>>>5]>>>24-s%32&255);return e},bytesToHex:function(t){for(var e=[],s=0;s<t.length;s++)e.push((t[s]>>>4).toString(16)),e.push((15&t[s]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],s=0;s<t.length;s+=2)e.push(parseInt(t.substr(s,2),16));return e},bytesToBase64:function(t){for(var s=[],a=0;a<t.length;a+=3)for(var o=t[a]<<16|t[a+1]<<8|t[a+2],i=0;i<4;i++)8*a+6*i<=8*t.length?s.push(e.charAt(o>>>6*(3-i)&63)):s.push("=");return s.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var s=[],a=0,o=0;a<t.length;o=++a%4)0!=o&&s.push((e.indexOf(t.charAt(a-1))&Math.pow(2,-2*o+8)-1)<<2*o|e.indexOf(t.charAt(a))>>>6-2*o);return s}},t.exports=s},738:t=>{function e(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}t.exports=function(t){return null!=t&&(e(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&e(t.slice(0,0))}(t)||!!t._isBuffer)}},568:(t,e,s)=>{var a,o,i,r,n;a=s(12),o=s(487).utf8,i=s(738),r=s(487).bin,(n=function(t,e){t.constructor==String?t=e&&"binary"===e.encoding?r.stringToBytes(t):o.stringToBytes(t):i(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||t.constructor===Uint8Array||(t=t.toString());for(var s=a.bytesToWords(t),l=8*t.length,h=1732584193,c=-271733879,p=-1732584194,d=271733878,u=0;u<s.length;u++)s[u]=16711935&(s[u]<<8|s[u]>>>24)|4278255360&(s[u]<<24|s[u]>>>8);s[l>>>5]|=128<<l%32,s[14+(l+64>>>9<<4)]=l;var v=n._ff,b=n._gg,f=n._hh,g=n._ii;for(u=0;u<s.length;u+=16){var m=h,_=c,S=p,C=d;h=v(h,c,p,d,s[u+0],7,-680876936),d=v(d,h,c,p,s[u+1],12,-389564586),p=v(p,d,h,c,s[u+2],17,606105819),c=v(c,p,d,h,s[u+3],22,-1044525330),h=v(h,c,p,d,s[u+4],7,-176418897),d=v(d,h,c,p,s[u+5],12,1200080426),p=v(p,d,h,c,s[u+6],17,-1473231341),c=v(c,p,d,h,s[u+7],22,-45705983),h=v(h,c,p,d,s[u+8],7,1770035416),d=v(d,h,c,p,s[u+9],12,-1958414417),p=v(p,d,h,c,s[u+10],17,-42063),c=v(c,p,d,h,s[u+11],22,-1990404162),h=v(h,c,p,d,s[u+12],7,1804603682),d=v(d,h,c,p,s[u+13],12,-40341101),p=v(p,d,h,c,s[u+14],17,-1502002290),h=b(h,c=v(c,p,d,h,s[u+15],22,1236535329),p,d,s[u+1],5,-165796510),d=b(d,h,c,p,s[u+6],9,-1069501632),p=b(p,d,h,c,s[u+11],14,643717713),c=b(c,p,d,h,s[u+0],20,-373897302),h=b(h,c,p,d,s[u+5],5,-701558691),d=b(d,h,c,p,s[u+10],9,38016083),p=b(p,d,h,c,s[u+15],14,-660478335),c=b(c,p,d,h,s[u+4],20,-405537848),h=b(h,c,p,d,s[u+9],5,568446438),d=b(d,h,c,p,s[u+14],9,-1019803690),p=b(p,d,h,c,s[u+3],14,-187363961),c=b(c,p,d,h,s[u+8],20,1163531501),h=b(h,c,p,d,s[u+13],5,-1444681467),d=b(d,h,c,p,s[u+2],9,-51403784),p=b(p,d,h,c,s[u+7],14,1735328473),h=f(h,c=b(c,p,d,h,s[u+12],20,-1926607734),p,d,s[u+5],4,-378558),d=f(d,h,c,p,s[u+8],11,-2022574463),p=f(p,d,h,c,s[u+11],16,1839030562),c=f(c,p,d,h,s[u+14],23,-35309556),h=f(h,c,p,d,s[u+1],4,-1530992060),d=f(d,h,c,p,s[u+4],11,1272893353),p=f(p,d,h,c,s[u+7],16,-155497632),c=f(c,p,d,h,s[u+10],23,-1094730640),h=f(h,c,p,d,s[u+13],4,681279174),d=f(d,h,c,p,s[u+0],11,-358537222),p=f(p,d,h,c,s[u+3],16,-722521979),c=f(c,p,d,h,s[u+6],23,76029189),h=f(h,c,p,d,s[u+9],4,-640364487),d=f(d,h,c,p,s[u+12],11,-421815835),p=f(p,d,h,c,s[u+15],16,530742520),h=g(h,c=f(c,p,d,h,s[u+2],23,-995338651),p,d,s[u+0],6,-198630844),d=g(d,h,c,p,s[u+7],10,1126891415),p=g(p,d,h,c,s[u+14],15,-1416354905),c=g(c,p,d,h,s[u+5],21,-57434055),h=g(h,c,p,d,s[u+12],6,1700485571),d=g(d,h,c,p,s[u+3],10,-1894986606),p=g(p,d,h,c,s[u+10],15,-1051523),c=g(c,p,d,h,s[u+1],21,-2054922799),h=g(h,c,p,d,s[u+8],6,1873313359),d=g(d,h,c,p,s[u+15],10,-30611744),p=g(p,d,h,c,s[u+6],15,-1560198380),c=g(c,p,d,h,s[u+13],21,1309151649),h=g(h,c,p,d,s[u+4],6,-145523070),d=g(d,h,c,p,s[u+11],10,-1120210379),p=g(p,d,h,c,s[u+2],15,718787259),c=g(c,p,d,h,s[u+9],21,-343485551),h=h+m>>>0,c=c+_>>>0,p=p+S>>>0,d=d+C>>>0}return a.endian([h,c,p,d])})._ff=function(t,e,s,a,o,i,r){var n=t+(e&s|~e&a)+(o>>>0)+r;return(n<<i|n>>>32-i)+e},n._gg=function(t,e,s,a,o,i,r){var n=t+(e&a|s&~a)+(o>>>0)+r;return(n<<i|n>>>32-i)+e},n._hh=function(t,e,s,a,o,i,r){var n=t+(e^s^a)+(o>>>0)+r;return(n<<i|n>>>32-i)+e},n._ii=function(t,e,s,a,o,i,r){var n=t+(s^(e|~a))+(o>>>0)+r;return(n<<i|n>>>32-i)+e},n._blocksize=16,n._digestsize=16,t.exports=function(t,e){if(null==t)throw new Error("Illegal argument "+t);var s=a.wordsToBytes(n(t,e));return e&&e.asBytes?s:e&&e.asString?r.bytesToString(s):a.bytesToHex(s)}},166:(t,e,s)=>{"use strict";s.d(e,{r:()=>l});var a=s(46),o=s(565),i=s(611),r=s(305),n=s.n(r);class l extends a.H{constructor(t,e){super(),this.protocol=2,this.inflate=n().inflateInit(15),this.bpp=1,this.state=0,this.focusMode=0,this.useZRLE=!0,this.frameRateDelay=2,this.canvasCtx=e,this.sparecache={},this.buttonmask=0,this.canvasControl=this.canvasCtx.canvas,this.lastMouseMoveTime=(new Date).getTime(),this.logger=t,this.setDeskFocus=(t,e)=>{},this.getDeskFocus=t=>{}}processData(t){this.onProcessData(t)}onStateChange(t){this.logger.verbose(`state change in AMTDesktop: ${t}`),0===t&&(this.canvasCtx.fillStyle="#FFFFFF",this.canvasCtx.fillRect(0,0,this.canvasCtx.canvas.width,this.canvasCtx.canvas.width))}start(){this.logger.verbose("Starting desktop here"),this.state=0,this.inflate.inflateReset(),this.onKvmDataPending=[],this.onKvmDataAck=-1,this.kvmDataSupported=!1;for(const t in this.sparecache)delete this.sparecache[t]}onSendKvmData(t){!0!==this.onKvmDataAck?this.onKvmDataPending.push(t):((0,i.f)(this.urlvars)&&(0,i.f)(this.urlvars.kvmdatatrace)&&console.log(`KVM-Send (${t.length}) data`),t="\0KvmDataChannel\0"+t,this.onSend(String.fromCharCode(6,0,0,0)+o.r.IntToStr(t.length)+t),this.onKvmDataAck=!1)}}},59:(t,e,s)=>{"use strict";s.d(e,{N:()=>o});var a=s(503);class o extends a.K{constructor(t,e,s,a,o,i,r,n,l,h,c){super(t,e,s,a,o,i,r,n,l,h,c)}}},503:(t,e,s)=>{"use strict";s.d(e,{K:()=>l,b:()=>a});var a,o=s(565),i=s(568),r=s.n(i),n=s(611);!function(t){t[t.SOL=1]="SOL",t[t.KVM=2]="KVM",t[t.IDER=3]="IDER"}(a||(a={}));class l{constructor(t,e,s,a,o,i,r,n,l,h,c){this.fileReader=s,this.fileReaderInUse=!1,this.fileReaderAcc=[],this.randomNonceChars="abcdef0123456789",this.host=a,this.port=o,this.user=i,this.pass=r,this.tls=n,this.tlsv1only=l,this.protocol=e,this.RedirectStartSol=String.fromCharCode(16,0,0,0,83,79,76,32),this.RedirectStartKvm=String.fromCharCode(16,1,0,0,75,86,77,82),this.RedirectStartIder=String.fromCharCode(16,0,0,0,73,68,69,82),this.urlvars={},this.server=c,this.amtAccumulator="",this.authUri="",this.logger=t,this.authToken=h}getWsLocation(){return this.isBrowser()&&!(0,n.f)(this.server)?`${window.location.protocol.replace("http","ws")}//\n ${window.location.host}\n ${window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))}\n /webrelay.ashx?p=2&host=${this.host}&port=${this.port}&tls=${this.tls}${"*"===this.user?"&serverauth=1":""}${void 0===this.pass?"&serverauth=1&user="+this.user:""}&tls1only=${this.tlsv1only}`:`${String(this.server)}/webrelay.ashx?p=2&host=${this.host}&port=${this.port}&tls=${this.tls}${"*"===this.user?"&serverauth=1":""}${void 0===this.pass?"&serverauth=1&user="+this.user:""}&tls1only=${this.tlsv1only}`}isBrowser(){try{const t="undefined"!=typeof window;return t&&this.logger.debug("!!!!!BROWSER!!!!!"),t}catch(t){return!1}}start(t){this.connectState=0,this.socket=new t(this.getWsLocation(),this.authToken),this.socket.onopen=this.onSocketConnected.bind(this),this.socket.onmessage=this.onMessage.bind(this),this.socket.onclose=this.onSocketClosed.bind(this),(0,n.f)(this.fileReader)&&(0,n.f)(this.fileReader.readAsBinaryString)?this.fileReader.onload=(t=>{this.onSocketData(t.target.result),0===this.fileReaderAcc.length?this.fileReaderInUse=!1:this.fileReader.readAsBinaryString(new Blob([this.fileReaderAcc.shift()]))}).bind(this):(0,n.f)(this.fileReader)&&(0,n.f)(this.fileReader.readAsArrayBuffer)&&(this.fileReader.onloadend=(t=>{this.onSocketData(t.target.result),0===this.fileReaderAcc.length?this.fileReaderInUse=!1:this.fileReader.readAsArrayBuffer(this.fileReaderAcc.shift())}).bind(this)),this.logger.verbose("Connecting to websocket"),this.onStateChange(1)}onSocketConnected(){(0,n.f)(this.urlvars)&&(0,n.f)(this.urlvars.redirtrace)&&console.log("REDIR-CONNECT"),this.onStateChange(2),this.logger.verbose(`Connected to websocket server. With protocol ${this.protocol} (2 = KVM)`),this.logger.info(`Start Redirect Session for protocol. ${this.protocol}`),this.protocol===a.SOL&&this.socketSend(this.RedirectStartSol),this.protocol===a.KVM&&this.socketSend(this.RedirectStartKvm),this.protocol===a.IDER&&this.socketSend(this.RedirectStartIder)}onMessage(t){try{if(this.inDataCount++,"object"==typeof t.data){if(this.fileReaderInUse)return void this.fileReaderAcc.push(t.data);if(null!=this.fileReader.readAsBinaryString)this.fileReaderInUse=!0,this.fileReader.readAsBinaryString(new Blob([t.data]));else if(null!=this.fileReader.readAsArrayBuffer)this.fileReaderInUse=!0,this.fileReader.readAsArrayBuffer(t.data);else{let e="";const s=new Uint8Array(t.data),a=s.byteLength;for(let t=0;t<a;t++)e+=String.fromCharCode(s[t]);this.onSocketData(e)}}else this.onSocketData(t.data)}catch(t){this.logger.error(t),this.stop(),this.onError()}}onSocketData(t){if((0,n.f)(t)&&-1!==this.connectState){if("object"==typeof t){let e="";const s=new Uint8Array(t),a=s.byteLength;for(let t=0;t<a;t++)e+=String.fromCharCode(s[t]);t=e}else if("string"!=typeof t)return;if(this.protocol!==a.KVM&&this.protocol!==a.IDER||1!==this.connectState)for(this.amtAccumulator+=t;this.amtAccumulator.length>=1;){let t=0;switch(this.amtAccumulator.charCodeAt(0)){case 17:if(this.logger.verbose(`Start Redirection Session reply received for ${this.protocol}`),this.amtAccumulator.length<4)return;switch(this.amtAccumulator.charCodeAt(1)){case 0:{if(this.logger.verbose("Session status success. Start handshake"),this.amtAccumulator.length<13)return;const e=this.amtAccumulator.charCodeAt(12);if(this.amtAccumulator.length<13+e)return;this.logger.verbose("Query for available authentication"),this.socketSend(String.fromCharCode(19,0,0,0,0,0,0,0,0)),t=13+e;break}default:this.stop()}break;case 20:{if(this.logger.verbose("Available Authentications reply received."),this.amtAccumulator.length<9)return;const e=o.r.ReadIntX(this.amtAccumulator,5);if(this.amtAccumulator.length<9+e)return;const s=this.amtAccumulator.charCodeAt(1),a=this.amtAccumulator.charCodeAt(4),i=[];for(let t=0;t<e;t++)i.push(this.amtAccumulator.charCodeAt(9+t));const r=this.amtAccumulator.substring(9,9+e);if(t=9+e,0===a)(0,n.f)(i.includes(4))?(this.logger.verbose("Good Digest Auth (With cnonce and all)"),this.socketSend(String.fromCharCode(19,0,0,0,4)+o.r.IntToStrX(this.user.length+this.authUri.length+8)+String.fromCharCode(this.user.length)+this.user+String.fromCharCode(0,0)+String.fromCharCode(this.authUri.length)+this.authUri+String.fromCharCode(0,0,0,0))):(0,n.f)(i.includes(3))?(this.logger.warn("Bad Digest Auth"),this.socketSend(String.fromCharCode(19,0,0,0,3)+o.r.IntToStrX(this.user.length+this.authUri.length+7)+String.fromCharCode(this.user.length)+this.user+String.fromCharCode(0,0)+String.fromCharCode(this.authUri.length)+this.authUri+String.fromCharCode(0,0,0))):(0,n.f)(i.includes(1))?(this.logger.verbose("Basic Auth"),this.socketSend(String.fromCharCode(19,0,0,0,1)+o.r.IntToStrX(this.user.length+this.pass.length+2)+String.fromCharCode(this.user.length)+this.user+String.fromCharCode(this.pass.length)+this.pass)):(this.logger.error("Auth Type not recognized. Stopping."),this.stop());else if(3!==a&&4!==a||1!==s)if(0===s){if(1===this.protocol){const t=1e4,e=100,s=0,a=1e4,i=100,r=0;this.socketSend(String.fromCharCode(32,0,0,0)+o.r.IntToStrX(this.amtSequence++)+o.r.ShortToStrX(t)+o.r.ShortToStrX(e)+o.r.ShortToStrX(s)+o.r.ShortToStrX(a)+o.r.ShortToStrX(i)+o.r.ShortToStrX(r)+o.r.IntToStrX(0))}2===this.protocol&&this.socketSend(String.fromCharCode(64,0,0,0,0,0,0,0)),3===this.protocol&&(this.connectState=1,this.onStateChange(3))}else this.stop();else{let t=0;const e=r.charCodeAt(t),s=r.substring(t+1,t+1+e);t+=e+1;const i=r.charCodeAt(t),n=r.substring(t+1,t+1+i);t+=i+1;let l=0,h=null;const c=this.generateRandomNonce(32),p="00000002";let d="";4===a&&(l=r.charCodeAt(t),h=r.substring(t+1,t+1+l),t+=l+1,d=`${p}:${c}:${String(h)} :`);const u=this.hex_md5(this.hex_md5(this.user+":"+s+":"+this.pass)+":"+n+":"+d+this.hex_md5("POST:"+this.authUri));let v=this.user.length+s.length+n.length+this.authUri.length+c.length+p.length+u.length+7;4===a&&(v+=parseInt(h.length)+1);let b=String.fromCharCode(19,0,0,0,a)+o.r.IntToStrX(v)+String.fromCharCode(this.user.length)+this.user+String.fromCharCode(s.length)+s+String.fromCharCode(n.length)+n+String.fromCharCode(this.authUri.length)+this.authUri+String.fromCharCode(c.length)+c+String.fromCharCode(p.length)+p+String.fromCharCode(u.length)+u;4===a&&(b=String(b)+(String.fromCharCode(h.length)+String(h))),this.socketSend(b)}break}case 33:if(this.amtAccumulator.length<23)break;this.logger.verbose("Response to settings"),t=23,this.socketSend(String.fromCharCode(39,0,0,0)+o.r.IntToStrX(this.amtSequence++)+String.fromCharCode(0,0,27,0,0,0)),1===this.protocol&&(this.amtKeepAliveTimer=setInterval(this.sendAmtKeepAlive.bind(this),2e3)),this.connectState=1,this.onStateChange(3);break;case 41:if(this.amtAccumulator.length<10)break;this.logger.verbose("Serial Settings"),t=10;break;case 42:{if(this.amtAccumulator.length<10)break;this.logger.verbose("Incoming display data");const e=10+((255&this.amtAccumulator.charCodeAt(9))<<8)+(255&this.amtAccumulator.charCodeAt(8));if(this.amtAccumulator.length<e)break;this.onProcessData(this.amtAccumulator.substring(10,e)),t=e;break}case 43:if(this.amtAccumulator.length<8)break;this.logger.verbose("Keep Alve message"),t=8;break;case 65:if(this.amtAccumulator.length<8)break;this.logger.verbose("KVM traffic. Call onStart handler. And forward rest of acc directly."),this.connectState=1,this.onStart(),this.amtAccumulator.length>8&&this.onProcessData(this.amtAccumulator.substring(8)),t=this.amtAccumulator.length;break;default:return this.logger.error(`Unknown Intel AMT command: ${this.amtAccumulator.charCodeAt(0)} acclen=${this.amtAccumulator.length}`),void this.stop()}if(0===t)return;this.amtAccumulator=this.amtAccumulator.substring(t)}else this.onProcessData(t)}}hex_md5(t){return this.logger.verbose("MD5 the string"),r()(t)}socketSend(t){(0,n.f)(this.urlvars)&&(0,n.f)(this.urlvars.redirtrace)&&this.logger.verbose(`REDIR-SEND(${t.length}): ${o.r.rstr2hex(t)}`);try{if(null!=this.socket&&1===this.socket.readyState){const e=new Uint8Array(t.length);this.logger.verbose(`Redir Send( ${t.length}): ${o.r.rstr2hex(t)}`);for(let s=0;s<t.length;++s)e[s]=t.charCodeAt(s);this.socket.send(e.buffer)}}catch(t){this.logger.error(`Socket send error: ${String(t)}`)}}send(t){this.logger.verbose("Send called "+t),null!=this.socket&&1===this.connectState&&(this.protocol===a.SOL?this.socketSend(String.fromCharCode(40,0,0,0)+o.r.IntToStrX(this.amtSequence++)+o.r.ShortToStrX(t.length)+t):this.socketSend(t))}sendAmtKeepAlive(){null!=this.socket&&this.socketSend(String.fromCharCode(43,0,0,0)+o.r.IntToStrX(this.amtSequence++))}generateRandomNonce(t){let e="";for(let s=0;s<t;s++)e+=this.randomNonceChars.charAt(Math.floor(Math.random()*this.randomNonceChars.length));return e}onSocketClosed(t){(0,n.f)(this.urlvars)&&(0,n.f)(this.urlvars.redirtrace)&&console.log("REDIR-CLOSED"),this.logger.warn("Redir Socket Closed"),this.stop()}onStateChange(t){console.info("onstatechange",t),this.state!==t&&(this.state=t,this.onNewState(this.state),null!=this.onStateChanged&&this.onStateChanged(this,this.state))}stop(){this.logger.warn("Stop called on Redirector. Change state to 0 and close Socket."),this.onStateChange(0),this.connectState=-1,this.amtAccumulator="",null!=this.socket&&(this.socket.close(),this.socket=null),null!=this.amtKeepAliveTimer&&(clearInterval(this.amtKeepAliveTimer),this.amtKeepAliveTimer=null)}}},277:(t,e,s)=>{"use strict";s.d(e,{r:()=>a});class a{constructor(){this.terminalEmulation=1,this.fxEmulation=0,this.fxLineBreak=0,this.AsciiToUnicode=[199,252,233,226,228,224,229,231,234,235,232,239,238,236,196,197,201,230,198,244,246,242,251,249,255,214,220,162,163,165,8359,402,225,237,243,250,241,209,170,218,191,8976,172,189,188,161,171,187,9619,9618,9617,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488,9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575,9576,9572,9573,9576,9560,9554,9555,9579,9578,9496,9484,9608,9604,9611,9616,9600,945,223,915,960,931,963,181,964,966,952,8486,948,8734,248,949,8719,8801,177,8805,8806,8992,8993,247,8776,176,8226,183,8730,8319,178,8718,160],this.AsciiToUnicodeIntel=[199,252,233,226,228,224,229,231,234,235,232,239,238,236,196,197,201,230,198,244,246,242,251,249,255,214,220,162,163,165,8359,402,225,237,243,250,241,209,170,218,191,8976,172,189,188,161,174,187,9619,9618,9617,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488,9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575,9576,9572,9573,9576,9560,9554,9555,9579,9578,9496,9484,9608,9604,9611,9616,9600,945,223,915,960,931,963,181,964,966,952,8486,948,8734,248,949,8719,8801,177,8805,8806,8992,8993,247,8776,176,8226,183,8730,8319,178,8718,160],this.StateChange=t=>{},this.TermSendKeys=t=>{this.onSend(t)}}}},237:(t,e,s)=>{"use strict";s.d(e,{k:()=>o});var a=s(201);class o{constructor(t){this.minLevel=t}log(t,e){switch(t){case a.i.VERBOSE:this.verbose(e);break;case a.i.INFO:this.info(e);break;case a.i.DEBUG:this.debug(e);break;case a.i.WARNING:this.warn(e);break;case a.i.ERROR:this.error(e)}}debug(t){this.minLevel>=a.i.DEBUG&&console.debug(t)}info(t){this.minLevel>=a.i.INFO&&console.info(t)}error(t){this.minLevel>=a.i.ERROR&&console.error(t)}warn(t){this.minLevel>=a.i.WARNING&&console.warn(t)}verbose(t){this.minLevel>=a.i.VERBOSE&&console.log(t)}}},565:(t,e,s)=>{"use strict";s.d(e,{r:()=>o});var a=s(611);const o={ReadShort:(t,e)=>(t.charCodeAt(e)<<8)+t.charCodeAt(e+1),ReadShortX:(t,e)=>(t.charCodeAt(e+1)<<8)+t.charCodeAt(e),ReadInt:(t,e)=>16777216*t.charCodeAt(e)+(t.charCodeAt(e+1)<<16)+(t.charCodeAt(e+2)<<8)+t.charCodeAt(e+3),ReadSInt:(t,e)=>(t.charCodeAt(e)<<24)+(t.charCodeAt(e+1)<<16)+(t.charCodeAt(e+2)<<8)+t.charCodeAt(e+3),ReadIntX:(t,e)=>16777216*t.charCodeAt(e+3)+(t.charCodeAt(e+2)<<16)+(t.charCodeAt(e+1)<<8)+t.charCodeAt(e),ShortToStr:t=>String.fromCharCode(t>>8&255,255&t),ShortToStrX:t=>String.fromCharCode(255&t,t>>8&255),IntToStr:t=>String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t),IntToStrX:t=>String.fromCharCode(255&t,t>>8&255,t>>16&255,t>>24&255),SplitArray:t=>t.split(","),Clone:t=>JSON.parse(JSON.stringify(t)),EscapeHtml:t=>"string"==typeof t?t.replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/"/g,""").replace(/'/g,"'"):"boolean"==typeof t||"number"==typeof t?t:void 0,ArrayElementMove(t,e,s){t.splice(s,0,t.splice(e,1)[0])},ObjectToStringEx(t,e){let s="";if(0!==t&&(!(0,a.f)(t)||null==t))return"(Null)";if(t instanceof Array)for(const a in t)s=s+"<br />"+String(this.gap(e))+"Item #"+String(a)+": "+String(this.ObjectToStringEx(t[a],e+1));else if(t instanceof Object)for(const a in t)s=s+"<br />"+String(this.gap(e))+String(a)+" = "+String(this.ObjectToStringEx(t[a],e+1));else s+=String(this.EscapeHtml(t));return s},ObjectToStringEx2(t,e){let s="";if(0!==t&&(!(0,a.f)(t)||null==t))return"(Null)";if(t instanceof Array)for(const a in t)s=s+"\r\n"+String(this.gap2(e))+"Item #"+String(a)+": "+String(this.ObjectToStringEx2(t[a],e+1));else if(t instanceof Object)for(const a in t)s=s+"\r\n"+String(this.gap2(e))+String(a)+" = "+String(this.ObjectToStringEx2(t[a],e+1));else s+=String(this.EscapeHtml(t));return s},gap(t){let e="";for(let s=0;s<4*t;s++)e+=" ";return e},gap2(t){let e="";for(let s=0;s<4*t;s++)e+=" ";return e},ObjectToString(t){return this.ObjectToStringEx(t,0)},ObjectToString2(t){return this.ObjectToStringEx2(t,0)},char2hex:t=>(t+256).toString(16).substr(-2).toUpperCase(),rstr2hex(t){let e,s="";for(e=0;e<t.length;e++)s+=String(this.char2hex(t.charCodeAt(e)));return s},encode_utf8:t=>unescape(encodeURIComponent(t)),decode_utf8:t=>decodeURIComponent(escape(t)),data2blob(t){const e=new Array(t.length);for(let s=0;s<t.length;s++)e[s]=t.charCodeAt(s);return new Blob([new Uint8Array(e)])},random:t=>Math.floor(Math.random()*t),trademarks:t=>t.replace(/\(R\)/g,"®").replace(/\(TM\)/g,"™")}},46:(t,e,s)=>{"use strict";s.d(e,{H:()=>a});class a{processData(t){}onStateChange(t){}start(){}onSendKvmData(t){}}},784:(t,e,s)=>{"use strict";s.d(e,{$:()=>i});var a=s(989),o=s(611);class i{constructor(t,e,s){this.acc="",this.stateProcessorFac=new a.v(e,s,this.updateRFBState.bind(this)),this.parent=s,this.logger=t}processData(t){if(!(0,o.f)(t))return;this.acc+=t;let e=0;for(this.logger.verbose(`Process Data ACC length: ${this.acc.length}`);this.acc.length>0;){const t=this.stateProcessorFac.getProcessor(this.parent.state),s=this.parent.state;if(e=t.processState(this.acc),this.logger.verbose(`State ${s} Processed. cmdSize returned ${e}`),0===e)return;this.acc=this.acc.substring(e),this.logger.verbose(`remaining acc ${this.acc.length} command size: ${e} new parent state: ${this.parent.state}`)}}updateRFBState(t){this.parent.state=t}}},679:(t,e,s)=>{"use strict";s.d(e,{X:()=>o});var a=s(644);class o{constructor(t){this.parent=t}Decode(t,e,s,o,i,r,n,l){const h=t.charCodeAt(e++);let c,p,d;const u={};let v,b=0,f=0;if(0===h){for(this.parent.logger.verbose("Raw encoding"),v=0;v<n;v++)a.j.setPixel(this.parent,t.charCodeAt(e++)+(2===this.parent.bpp?t.charCodeAt(e++)<<8:0),v);a.j.putImage(this.parent,s,o)}else if(1===h){p=t.charCodeAt(e++)+(2===this.parent.bpp?t.charCodeAt(e++)<<8:0),this.parent.canvasCtx.fillStyle="rgb("+(1===this.parent.bpp?`${224&p}, ${(28&p)<<3}, ${a.j.fixColor((3&p)<<6)}`:`${p>>8&248}, ${p>>3&252},${(31&p)<<3}`)+")",this.parent.logger.verbose("fillstyle: "+this.parent.canvasCtx.fillStyle);const n=a.j.rotX(this.parent,s,o);o=a.j.rotY(this.parent,s,o),s=n,this.parent.canvasCtx.fillRect(s,o,i,r)}else if(h>1&&h<17){this.parent.logger.verbose("Read the packed palette");let i=4,r=15;for(v=0;v<h;v++)u[v]=t.charCodeAt(e++)+(2===this.parent.bpp?t.charCodeAt(e++)<<8:0);for(2===h?(i=1,r=1):h<=4&&(i=2,r=3);b<n&&e<t.length;)for(p=t.charCodeAt(e++),v=8-i;v>=0;v-=i)a.j.setPixel(this.parent,u[p>>v&r],b++);a.j.putImage(this.parent,s,o)}else if(128===h){for(this.parent.logger.verbose("RLE encoded tile");b<n&&e<t.length;){p=t.charCodeAt(e++)+(2===this.parent.bpp?t.charCodeAt(e++)<<8:0),f=1;do{f+=d=t.charCodeAt(e++)}while(255===d);for(;--f>=0;)a.j.setPixel(this.parent,p,b++)}a.j.putImage(this.parent,s,o)}else if(h>129){for(this.parent.logger.verbose("Read the RLE palette"),v=0;v<h-128;v++)u[v]=t.charCodeAt(e++)+(2===this.parent.bpp?t.charCodeAt(e++)<<8:0);for(this.parent.logger.verbose("Decode RLE on palette");b<n&&e<t.length;){if(f=1,c=t.charCodeAt(e++),p=u[c%128],c>127)do{f+=d=t.charCodeAt(e++)}while(255===d);for(;--f>=0;)a.j.setPixel(this.parent,p,b++)}a.j.putImage(this.parent,s,o)}}}},646:(t,e,s)=>{"use strict";s.d(e,{$:()=>a.$,X:()=>o.X});var a=s(784),o=s(679)},663:(t,e,s)=>{"use strict";var a;s.d(e,{i:()=>a}),function(t){t[t.VERBOSE=5]="VERBOSE",t[t.INFO=4]="INFO",t[t.DEBUG=3]="DEBUG",t[t.WARNING=2]="WARNING",t[t.ERROR=1]="ERROR"}(a||(a={}))},201:(t,e,s)=>{"use strict";s.d(e,{i:()=>a.i});var a=s(663)},725:(t,e,s)=>{"use strict";s.d(e,{e:()=>i});var a=s(565),o=s(8);class i{constructor(t,e,s,a){this.wsSocket=t,this.parent=e,this.rleDecoder=s,this.updateRFBState=a}processState(t){let e=0;if(t.length>=12){const s=a.r.ReadShort(t,0),i=a.r.ReadShort(t,2),r=a.r.ReadShort(t,4),n=a.r.ReadShort(t,6),l=r*n,h=a.r.ReadInt(t,8);if(h<17){if(r<1||r>64||n<1||n>64)throw this.parent.logger.error(`Invalid tile size (${r},${n}), disconnecting.`),new Error("Invalid tile size");if(this.parent.sparew!==r||this.parent.spareh!==n){this.parent.sparew=this.parent.sparew2=r,this.parent.spareh=this.parent.spareh2=n,1!==this.parent.rotation&&3!==this.parent.rotation||(this.parent.sparew2=n,this.parent.spareh2=r);const t=`${this.parent.sparew2}x${this.parent.spareh2}`;this.parent.spare=this.parent.sparecache[t],(0,o.fQ)(this.parent.spare)||(this.parent.sparecache[t]=this.parent.spare=this.parent.canvasCtx.createImageData(this.parent.sparew2,this.parent.spareh2))}}if(4294967073===h)this.parent.logger.verbose("Desktop size"),this.parent.canvasCtx.canvas.width=this.parent.ScreenWidth=this.parent.rwidth=this.parent.width=r,this.parent.canvasCtx.canvas.height=this.parent.ScreenHeight=this.parent.rheight=this.parent.height=n,this.wsSocket.send(String.fromCharCode(3,0,0,0,0,0)+a.r.ShortToStr(this.parent.width)+a.r.ShortToStr(this.parent.height)),e=12,null!=this.parent.onScreenSizeChange&&this.parent.onScreenSizeChange(this.parent.ScreenWidth,this.parent.ScreenHeight);else if(0===h){let a=12;const r=12+l*this.parent.bpp;if(t.length<r)return 0;e=r;for(let e=0;e<l;e++)o.jw.setPixel(this.parent,t.charCodeAt(a++)+(2===this.parent.bpp?t.charCodeAt(a++)<<8:0),e);o.jw.putImage(this.parent,s,i)}else{if(16!==h)throw this.parent.logger.error(`Unknown Encoding: ${h} , HEX: ${a.r.rstr2hex(t)}`),new Error(`Unknown Encoding: ${h}`);{if(t.length<16)return 0;const o=a.r.ReadInt(t,12);if(t.length<16+o)return 0;const h=16,c=5,p=0;if(o>5&&0===t.charCodeAt(h)&&a.r.ReadShortX(t,h+1)===o-c)this.rleDecoder.Decode(t,h+5,s,i,r,n,l,o);else{const e=t.substring(h,h+o-p),a=this.parent.inflate.inflate(e);if(!(a.length>0))throw this.parent.logger.error("Invalid deflate data."),new Error("invalid deflate data");this.rleDecoder.Decode(a,0,s,i,r,n,l,a.length)}e=16+o}}if(100==--this.parent.state){this.parent.logger.debug("Frame completed. Update state and request new frame"),this.updateRFBState(4);const t=()=>{o.Xn.sendRefresh(this.parent,this.wsSocket)};0===this.parent.frameRateDelay?o.Xn.sendRefresh(this.parent,this.wsSocket):setTimeout(t,this.parent.frameRateDelay)}}return e}}},70:(t,e,s)=>{"use strict";s.d(e,{U:()=>o});var a=s(565);class o{constructor(t,e,s){this.wsSocket=t,this.serverCutTextHandler=e,this.updateRFBState=s}processState(t){let e=0,s=0;switch(t.charCodeAt(0)){case 0:if(t.length<4)return 0;this.updateRFBState(100+a.r.ReadShort(t,2)),e=4;break;case 2:e=1;break;case 3:if(t.length<8)return 0;if(s=a.r.ReadInt(t,4)+8,t.length<s)return 0;e=this.serverCutTextHandler.handleServerCutText(t)}return e}}},212:(t,e,s)=>{"use strict";s.d(e,{w:()=>a});class a{constructor(t,e){this.wsSocket=t,this.updateRFBState=e}processState(t){let e=0;return t.length>=12?(e=12,this.updateRFBState(1),this.wsSocket.send("RFB 003.008\n"),e):0}}},26:(t,e,s)=>{"use strict";s.d(e,{l:()=>a});class a{constructor(t,e){this.wsSocket=t,this.updateRFBState=e}processState(t){let e=0;return t.length>=1?(e=t.charCodeAt(0)+1,this.wsSocket.send(String.fromCharCode(1)),this.updateRFBState(2),e):0}}},724:(t,e,s)=>{"use strict";s.d(e,{m:()=>o});var a=s(565);class o{constructor(t,e){this.wsSocket=t,this.updateRFBState=e}processState(t){let e=0;if(t.length>=4){if(e=4,0!==a.r.ReadInt(t,0))throw new Error("Error. Stopping. Security response not None.");return this.wsSocket.send(String.fromCharCode(1)),this.updateRFBState(3),e}return 0}}},256:(t,e,s)=>{"use strict";s.d(e,{I:()=>i});var a=s(565),o=s(611);class i{constructor(t,e){this.wsSocket=t,this.parent=e}handleServerCutText(t){if(t.length<8)return 0;const e=a.r.ReadInt(t,4)+8;if(t.length<e)return 0;if(null!=this.parent.onKvmData){const s=t.substring(8,e);s.length>=16&&"\0KvmDataChannel"===s.substring(0,15)&&(this.parent.kvmDataSupported||(this.parent.kvmDataSupported=!0,console.log("KVM Data Channel Supported.")),(-1===this.parent.onKvmDataAck&&16===s.length||0!==s.charCodeAt(15))&&(this.parent.onKvmDataAck=!0),(0,o.f)(this.parent.urlvars)&&(0,o.f)(this.parent.urlvars.kvmdatatrace)&&console.log(`KVM-Recv((${s.length-16})): ${s.substring(16)}`),s.length>16&&this.parent.onKvmData(s.substring(16)),!0===this.parent.onKvmDataAck&&this.parent.onKvmDataPending.length>0&&this.wsSocket.onSendKvmData(this.parent.onKvmDataPending.shift()))}return e}}},946:(t,e,s)=>{"use strict";s.d(e,{C:()=>i});var a=s(565),o=s(173);class i{constructor(t,e,s){this.wsSocket=t,this.parent=e,this.updateRFBState=s}processState(t){let e=0;if(t.length>=24){this.parent.rotation=0;const s=a.r.ReadInt(t,20);if(t.length<24+s)return 0;e=24+s,null!=this.parent.updateScreenDimensions&&this.parent.updateScreenDimensions(a.r.ReadShort(t,0),a.r.ReadShort(t,2)),this.parent.canvasCtx.canvas.width=this.parent.ScreenWidth=this.parent.rwidth=this.parent.width=a.r.ReadShort(t,0),this.parent.canvasCtx.canvas.height=this.parent.ScreenHeight=this.parent.rheight=this.parent.height=a.r.ReadShort(t,2);let i="";return this.parent.useZRLE&&(i+=a.r.IntToStr(16)),i+=a.r.IntToStr(0),i+=a.r.IntToStr(1092),this.parent.logger.verbose("Send supported encodings"),this.wsSocket.send(String.fromCharCode(2,0)+a.r.ShortToStr(i.length/4+1)+i+a.r.IntToStr(-223)),1===this.parent.bpp&&this.wsSocket.send(String.fromCharCode(0,0,0,0,8,8,0,1)+a.r.ShortToStr(7)+a.r.ShortToStr(7)+a.r.ShortToStr(3)+String.fromCharCode(5,2,0,0,0,0)),this.updateRFBState(4),this.parent.onStateChange(3),this.parent.logger.info("Start new frame."),o.X.sendRefresh(this.parent,this.wsSocket),this.parent.oldMouseX=-1,e}return 0}}},389:(t,e,s)=>{"use strict";s.d(e,{Cu:()=>l.C,Ut:()=>i.U,ez:()=>a.e,ll:()=>r.l,mC:()=>n.m,wW:()=>o.w});var a=s(725),o=s(212),i=s(70),r=s(26),n=s(724),l=s(946)},989:(t,e,s)=>{"use strict";s.d(e,{v:()=>r});var a=s(389),o=s(256),i=s(679);class r{constructor(t,e,s){this.stateProcessors={},this.stateProcessors[0]=new a.wW(t,s),this.stateProcessors[1]=new a.ll(t,s),this.stateProcessors[2]=new a.mC(t,s),this.stateProcessors[3]=new a.Cu(t,e,s);const r=new o.I(t,e);this.stateProcessors[4]=new a.Ut(t,r,s),this.stateProcessors["100plus"]=new a.ez(t,e,new i.X(e),s)}getProcessor(t){return t<=100?this.stateProcessors[t]:this.stateProcessors["100plus"]}}},155:(t,e,s)=>{"use strict";s.d(e,{Q:()=>a});class a{constructor(t){this.processData=t=>{null!=this.terminal.capture&&(this.terminal.capture=String(this.terminal.capture)+t);let e="";for(let s=0;s<t.length;s++){const a=t.charCodeAt(s);"J"===t[s]?this.clearTerminal():e+=0!=(128&a)?String.fromCharCode(this.terminal.AsciiToUnicode[127&a]):`${t[s]}`}this.processDataToXterm(e)},this.terminal=t}}},38:(t,e,s)=>{"use strict";s.d(e,{q:()=>i});var a=s(923),o=s(611);const i={convertAMTKeyCode:t=>(0,o.f)(t.code.startsWith("Key"))&&4===t.code.length?t.code.charCodeAt(3)+(!1===t.shiftKey?32:0):(0,o.f)(t.code.startsWith("Digit"))&&6===t.code.length?t.code.charCodeAt(5):(0,o.f)(t.code.startsWith("Numpad"))&&7===t.code.length?t.code.charCodeAt(6):a.Z[t.code]}},923:(t,e,s)=>{"use strict";s.d(e,{Z:()=>a});const a={Pause:19,CapsLock:20,Space:32,Quote:39,Minus:45,NumpadMultiply:42,NumpadAdd:43,PrintScreen:44,Comma:44,NumpadSubtract:45,NumpadDecimal:46,Period:46,Slash:47,NumpadDivide:47,Semicolon:59,Equal:61,OSLeft:91,BracketLeft:91,OSRight:91,Backslash:92,BracketRight:93,ContextMenu:93,Backquote:96,NumLock:144,ScrollLock:145,Backspace:65288,Tab:65289,Enter:65293,NumpadEnter:65293,Escape:65307,Delete:65535,Home:65360,PageUp:65365,PageDown:65366,ArrowLeft:65361,ArrowUp:65362,ArrowRight:65363,ArrowDown:65364,End:65367,Insert:65379,F1:65470,F2:65471,F3:65472,F4:65473,F5:65474,F6:65475,F7:65476,F8:65477,F9:65478,F10:65479,F11:65480,F12:65481,ShiftLeft:65505,ShiftRight:65506,ControlLeft:65507,ControlRight:65508,AltLeft:65513,AltRight:65514,MetaLeft:65511,MetaRight:65512}},173:(t,e,s)=>{"use strict";s.d(e,{X:()=>i});var a=s(565),o=s(611);const i={sendRefresh(t,e){if(!t.holding)if(t.focusMode>0){const s=2*t.focusMode;e.send(String.fromCharCode(3,1)+a.r.ShortToStr(Math.max(Math.min(t.oldMouseX,t.lastMouseX)-t.focusMode,0))+a.r.ShortToStr(Math.max(Math.min(t.oldMouseY,t.lastMouseY)-t.focusMode,0))+a.r.ShortToStr(s+Math.abs(t.oldMouseX-t.lastMouseX))+a.r.ShortToStr(s+Math.abs(t.oldMouseY-t.lastMouseY))),t.oldMouseX=t.lastMouseX,t.oldMouseY=t.lastMouseY}else e.send(String.fromCharCode(3,1,0,0,0,0)+a.r.ShortToStr(t.rwidth)+a.r.ShortToStr(t.rheight))},sendKey(t,e,s){if("object"==typeof e)for(const s in e)this.sendKey(t,e[s][0],e[s][1]);else t.send(String.fromCharCode(4,s,0,0)+a.r.IntToStr(e))},sendKvmData(t,e,s){!0!==t.onKvmDataAck?t.onKvmDataPending.push(s):((0,o.f)(t.urlvars)&&(0,o.f)(t.urlvars.kvmdatatrace)&&console.log(`KVM-Send(${String(s.length)}): ${String(s)}`),s="\0KvmDataChannel\0"+String(s),e.send(`${String.fromCharCode(6,0,0,0)}${a.r.IntToStr(s.length)}${String(s)}`),t.onKvmDataAck=!1)},sendKeepAlive(t,e){t.lastKeepAlive<Date.now()-5e3&&(t.lastKeepAlive=Date.now(),e.send(String.fromCharCode(6,0,0,0)+a.r.IntToStr(16)+"\0KvmDataChannel\0"))},sendCtrlAltDelMsg(t){this.sendCad(t)},sendCad(t){this.sendKey(t,65507,1),this.sendKey(t,65513,1),this.sendKey(t,65535,1),this.sendKey(t,65535,0),this.sendKey(t,65513,0),this.sendKey(t,65507,0)}}},644:(t,e,s)=>{"use strict";s.d(e,{j:()=>a});const a={putImage(t,e,s){if(t.holding)return;const o=a.arotX(t,e,s);s=a.arotY(t,e,s),e=o,t.canvasCtx.putImageData(t.spare,e,s)},setPixel(t,e,s){let o,i,r=4*s;t.rotation>0&&(1===t.rotation?(o=s%t.sparew,i=Math.floor(s/t.sparew),r=4*(s=o*t.sparew2+(t.sparew2-1-i))):2===t.rotation?r=t.sparew*t.spareh*4-4-r:3===t.rotation&&(o=s%t.sparew,i=Math.floor(s/t.sparew),r=4*(s=(t.sparew2-1-o)*t.sparew2+i))),1===t.bpp?(t.spare.data[r++]=224&e,t.spare.data[r++]=(28&e)<<3,t.spare.data[r++]=a.fixColor((3&e)<<6)):(t.spare.data[r++]=e>>8&248,t.spare.data[r++]=e>>3&252,t.spare.data[r++]=(31&e)<<3),t.spare.data[r]=255},arotX:(t,e,s)=>0===t.rotation?e:1===t.rotation?t.canvasCtx.canvas.width-t.sparew2-s:2===t.rotation?t.canvasCtx.canvas.width-t.sparew2-e:3===t.rotation?s:0,arotY:(t,e,s)=>0===t.rotation?s:1===t.rotation?e:2===t.rotation?t.canvasCtx.canvas.height-t.spareh2-s:3===t.rotation?t.canvasCtx.canvas.height-t.spareh-e:0,crotX:(t,e,s)=>0===t.rotation?e:1===t.rotation?s:2===t.rotation?t.canvasCtx.canvas.width-e:3===t.rotation?t.canvasCtx.canvas.height-s:0,crotY:(t,e,s)=>0===t.rotation?s:1===t.rotation?t.canvasCtx.canvas.width-e:2===t.rotation?t.canvasCtx.canvas.height-s:3===t.rotation?e:0,rotX:(t,e,s)=>0===t.rotation||1===t.rotation?e:2===t.rotation?e-t.canvasCtx.canvas.width:3===t.rotation?e-t.canvasCtx.canvas.height:0,rotY:(t,e,s)=>0===t.rotation?s:1===t.rotation?s-t.canvasCtx.canvas.width:2===t.rotation?s-t.canvasCtx.canvas.height:3===t.rotation?s:0,setRotation(t,e){for(;e<0;)e+=4;const s=e%4;if(t.holding)return t.rotation=s,!1;if(s===t.rotation)return!0;let o=t.canvasCtx.canvas.width,i=t.canvasCtx.canvas.height;1!==t.rotation&&3!==t.rotation||(o=t.canvasCtx.canvas.height,i=t.canvasCtx.canvas.width),null==t.tcanvas&&(t.tcanvas=document.createElement("canvas"));const r=t.tcanvas.getContext("2d");return r.setTransform(1,0,0,1,0,0),r.canvas.width=o,r.canvas.height=i,r.rotate(-90*t.rotation*Math.PI/180),0===t.rotation&&r.drawImage(t.canvasCtx.canvas,0,0),1===t.rotation&&r.drawImage(t.canvasCtx.canvas,-t.canvasCtx.canvas.width,0),2===t.rotation&&r.drawImage(t.canvasCtx.canvas,-t.canvasCtx.canvas.width,-t.canvasCtx.canvas.height),3===t.rotation&&r.drawImage(t.canvasCtx.canvas,0,-t.canvasCtx.canvas.height),0!==t.rotation&&2!==t.rotation||(t.canvasCtx.canvas.height=o,t.canvasCtx.canvas.width=i),1!==t.rotation&&3!==t.rotation||(t.canvasCtx.canvas.height=i,t.canvasCtx.canvas.width=o),t.canvasCtx.setTransform(1,0,0,1,0,0),t.canvasCtx.rotate(90*s*Math.PI/180),t.rotation=s,t.canvasCtx.drawImage(t.tcanvas,a.rotX(t,0,0),a.rotY(t,0,0)),t.width=t.canvasCtx.canvas.width,t.height=t.canvasCtx.canvas.height,null!=t.onScreenResize&&t.onScreenResize(t.width,t.height,t.canvasId),!0},fixColor:t=>t>127?t+32:t}},717:(t,e,s)=>{"use strict";s.d(e,{E:()=>n});var a,o=s(38),i=s(173),r=s(611);!function(t){t[t.Up=0]="Up",t[t.Down=1]="Down"}(a||(a={}));class n{constructor(t,e){this.Comms=e,this.parent=t}GrabKeyInput(){this.KeyInputGrab||(document.onkeyup=this.handleKeyUp.bind(this),document.onkeydown=this.handleKeyDown.bind(this),document.onkeypress=this.handleKeys.bind(this),this.KeyInputGrab=!0)}UnGrabKeyInput(){this.KeyInputGrab&&(document.onkeyup=null,document.onkeydown=null,document.onkeypress=null,this.KeyInputGrab=!1)}handleKeys(t){return this.haltEvent(t)}haltEvent(t){return(0,r.f)(t.preventDefault)&&t.preventDefault(),(0,r.f)(t.stopPropagation)&&t.stopPropagation(),!1}handleKeyUp(t){return this.handleKeyEvent(a.Up,t)}handleKeyDown(t){return this.handleKeyEvent(a.Down,t)}handleKeyEvent(t,e){let s=e;if((0,r.f)(s)||(s=window.event),(0,r.f)(s.code)){const e=o.q.convertAMTKeyCode(s);this.parent.logger.verbose(`Key ${t} : ${String(e)}`),null!=e&&i.X.sendKey(this.Comms,e,t)}else{let e=s.keyCode;173===e&&(e=189),61===e&&(e=187);let a=e;!1===s.shiftKey&&e>=65&&e<=90&&(a=e+32),e>=112&&e<=124&&(a=e+65358),8===e&&(a=65288),9===e&&(a=65289),13===e&&(a=65293),16===e&&(a=65505),17===e&&(a=65507),18===e&&(a=65513),27===e&&(a=65307),33===e&&(a=65365),34===e&&(a=65366),35===e&&(a=65367),36===e&&(a=65360),37===e&&(a=65361),38===e&&(a=65362),39===e&&(a=65363),40===e&&(a=65364),45===e&&(a=65379),46===e&&(a=65535),e>=96&&e<=105&&(a=e-48),106===e&&(a=42),107===e&&(a=43),109===e&&(a=45),110===e&&(a=46),111===e&&(a=47),186===e&&(a=59),187===e&&(a=61),188===e&&(a=44),189===e&&(a=45),190===e&&(a=46),191===e&&(a=47),192===e&&(a=96),219===e&&(a=91),220===e&&(a=92),221===e&&(a=93),222===e&&(a=39),this.parent.logger.verbose(`Key ${t}: ${e} = ${a}`),i.X.sendKey(this.Comms,a,t)}return this.haltEvent(s)}}},33:(t,e,s)=>{"use strict";s.d(e,{x:()=>r});var a=s(565),o=s(644),i=s(611);class r{constructor(t,e,s){this.topposition=0,this.leftposition=0,this.parent=t,this.comm=e,this.debounceTime=s,this.mouseClickCompleted=!0,this.lastEvent=null}GrabMouseInput(){this.MouseInputGrab||(this.MouseInputGrab=!0)}UnGrabMouseInput(){if(!this.MouseInputGrab)return;const t=this.parent.canvasCtx.canvas;t.onmousemove=null,t.onmouseup=null,t.onmousedown=null,this.MouseInputGrab=!1}mousedown(t){return this.parent.buttonmask|=1<<t.button,this.mousemove(t)}mouseup(t){return this.parent.buttonmask&=65535-(1<<t.button),this.mousemove(t)}mousemove(t){if(4!==this.parent.state)return!0;const e=this.getPositionOfControl(this.parent.canvasControl),s=this.parent.canvasControl.getBoundingClientRect();(0===this.topposition||s.top>this.topposition)&&(this.topposition=s.top),(0===this.leftposition||s.left>this.leftposition)&&(this.leftposition=s.left);const r=this.topposition-s.top,n=this.leftposition-s.left;if(this.parent.lastMouseX=(t.pageX-e[0]+n)*(this.parent.canvasControl.height/this.parent.canvasControl.offsetHeight),this.parent.lastMouseY=(t.pageY-e[1]+r)*(this.parent.canvasControl.width/this.parent.canvasControl.offsetWidth),(0,i.f)(this.parent.noMouseRotate)||(this.parent.lastMouseX2=o.j.crotX(this.parent,this.parent.lastMouseX,this.parent.lastMouseY),this.parent.lastMouseY=o.j.crotY(this.parent,this.parent.lastMouseX,this.parent.lastMouseY),this.parent.lastMouseX=this.parent.lastMouseX2),this.comm.send(String.fromCharCode(5,this.parent.buttonmask)+a.r.ShortToStr(this.parent.lastMouseX)+a.r.ShortToStr(this.parent.lastMouseY)),this.parent.setDeskFocus("DeskFocus",this.parent.focusMode),0!==this.parent.focusMode){const t=Math.min(this.parent.lastMouseX,this.parent.canvasControl.width-this.parent.focusMode),s=Math.min(this.parent.lastMouseY,this.parent.canvasControl.height-this.parent.focusMode),a=2*this.parent.focusMode,o=this.parent.canvasControl,i=o.offsetHeight/this.parent.canvasControl.height,r=o.offsetWidth/this.parent.canvasControl.width,n=this.parent.getDeskFocus("DeskFocus"),l=this.getPositionOfControl(this.parent.canvasControl.parentElement);n.left=`${Math.max((t-this.parent.focusMode)*i,0)+(e[0]-l[0])}px`,n.top=`${Math.max((s-this.parent.focusMode)*r,0)+(e[1]-l[1])}px`,n.width=a*i-6+"px",n.height=a*i-6+"px"}return this.haltEvent(t)}haltEvent(t){return(0,i.f)(t.preventDefault)&&t.preventDefault(),(0,i.f)(t.stopPropagation)&&t.stopPropagation(),!1}getPositionOfControl(t){const e=[0,0];let s=t;for(;null!=s;)e[0]=Number(e[0])+Number(s.offsetLeft),e[1]=Number(e[1])+Number(s.offsetTop),s=s.offsetParent;return e}}},611:(t,e,s)=>{"use strict";s.d(e,{f:()=>a});const a=t=>null!=t&&""!==t&&!1!==t&&0!==t},8:(t,e,s)=>{"use strict";s.d(e,{EB:()=>r.E,Xn:()=>o.X,fQ:()=>l.f,jw:()=>i.j,qD:()=>a.q,xx:()=>n.x});var a=s(38),o=s(173),i=s(644),r=s(717),n=s(33),l=s(611)},305:module=>{var ZLIB=ZLIB||{},BASE,NMAX;void 0===ZLIB.common_initialized&&(ZLIB.Z_NO_FLUSH=0,ZLIB.Z_PARTIAL_FLUSH=1,ZLIB.Z_SYNC_FLUSH=2,ZLIB.Z_FULL_FLUSH=3,ZLIB.Z_FINISH=4,ZLIB.Z_BLOCK=5,ZLIB.Z_TREES=6,ZLIB.Z_OK=0,ZLIB.Z_STREAM_END=1,ZLIB.Z_NEED_DICT=2,ZLIB.Z_ERRNO=-1,ZLIB.Z_STREAM_ERROR=-2,ZLIB.Z_DATA_ERROR=-3,ZLIB.Z_MEM_ERROR=-4,ZLIB.Z_BUF_ERROR=-5,ZLIB.Z_VERSION_ERROR=-6,ZLIB.Z_DEFLATED=8,ZLIB.z_stream=function(){this.next_in=0,this.avail_in=0,this.total_in=0,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=null,this.state=null,this.data_type=0,this.adler=0,this.input_data="",this.output_data="",this.error=0,this.checksum_function=null},ZLIB.gz_header=function(){this.text=0,this.time=0,this.xflags=0,this.os=255,this.extra=null,this.extra_len=0,this.extra_max=0,this.name=null,this.name_max=0,this.comment=null,this.comm_max=0,this.hcrc=0,this.done=0},ZLIB.common_initialized=!0),void 0===ZLIB&&alert("ZLIB is not defined. SRC zlib.js before zlib-inflate.js"),function(){var DEF_WBITS=15,HEAD=0,FLAGS=1,TIME=2,OS=3,EXLEN=4,EXTRA=5,NAME=6,COMMENT=7,HCRC=8,DICTID=9,DICT=10,TYPE=11,TYPEDO=12,STORED=13,COPY_=14,COPY=15,TABLE=16,LENLENS=17,CODELENS=18,LEN_=19,LEN=20,LENEXT=21,DIST=22,DISTEXT=23,MATCH=24,LIT=25,CHECK=26,LENGTH=27,DONE=28,BAD=29,MEM=30,SYNC=31,ENOUGH_LENS=852,ENOUGH_DISTS=592,ENOUGH=ENOUGH_LENS+ENOUGH_DISTS,CODES=0,LENS=1,DISTS=2,inflate_table_lbase=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],inflate_table_lext=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,203,69],inflate_table_dbase=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],inflate_table_dext=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];function inflate_table(t,e){var s,a,o,i,r,n,l,h,c,p,d,u,v,b,f,g,m,_,S,C,k,E,A=t.next,w=e==DISTS?t.distbits:t.lenbits,I=t.work,T=t.lens,B=e==DISTS?t.nlen:0,R=t.codes;s=e==LENS?t.nlen:e==DISTS?t.ndist:19;var x=new Array(16),D=new Array(16);for(a=0;a<=15;a++)x[a]=0;for(o=0;o<s;o++)x[T[B+o]]++;for(n=w,r=15;r>=1&&0==x[r];r--);if(n>r&&(n=r),0==r)return g={op:64,bits:1,val:0},R[A++]=g,R[A++]=g,e==DISTS?t.distbits=1:t.lenbits=1,t.next=A,0;for(i=1;i<r&&0==x[i];i++);for(n<i&&(n=i),c=1,a=1;a<=15;a++)if(c<<=1,(c-=x[a])<0)return-1;if(c>0&&(e==CODES||1!=r))return t.next=A,-1;for(D[1]=0,a=1;a<15;a++)D[a+1]=D[a]+x[a];for(o=0;o<s;o++)0!=T[B+o]&&(I[D[T[B+o]]++]=o);switch(e){case CODES:_=C=I,S=0,k=0,E=19;break;case LENS:_=inflate_table_lbase,S=-257,C=inflate_table_lext,k=-257,E=256;break;default:_=inflate_table_dbase,C=inflate_table_dext,S=0,k=0,E=-1}if(d=0,o=0,a=i,m=A,l=n,h=0,b=-1,f=(p=1<<n)-1,e==LENS&&p>=ENOUGH_LENS||e==DISTS&&p>=ENOUGH_DISTS)return t.next=A,1;for(;;){g={op:0,bits:a-h,val:0},I[o]<E?g.val=I[o]:I[o]>E?(g.op=C[k+I[o]],g.val=_[S+I[o]]):g.op=96,u=1<<a-h,i=v=1<<l;do{R[m+(d>>>h)+(v-=u)]=g}while(0!=v);for(u=1<<a-1;d&u;)u>>>=1;if(0!=u?(d&=u-1,d+=u):d=0,o++,0==--x[a]){if(a==r)break;a=T[B+I[o]]}if(a>n&&(d&f)!=b){for(0==h&&(h=n),m+=i,c=1<<(l=a-h);l+h<r&&!((c-=x[l+h])<=0);)l++,c<<=1;if(p+=1<<l,e==LENS&&p>=ENOUGH_LENS||e==DISTS&&p>=ENOUGH_DISTS)return t.next=A,1;R[A+(b=d&f)]={op:l,bits:n,val:m-A}}}return 0!=d&&(R[m+d]={op:64,bits:a-h,val:0}),t.next=A+p,e==DISTS?t.distbits=n:t.lenbits=n,0}function inflate_fast(t,e){var s,a,o,i,r,n,l,h,c,p,d,u,v,b,f,g,m,_,S,C,k,E,A=-1,w=-1;s=t.state,a=t.input_data,i=(o=t.next_in)+t.avail_in-5,n=(r=t.next_out)-(e-t.avail_out),l=r+(t.avail_out-257),h=s.wsize,c=s.whave,p=s.wnext,d=s.window,u=s.hold,v=s.bits,b=s.codes,f=s.lencode,g=s.distcode,m=(1<<s.lenbits)-1,_=(1<<s.distbits)-1;t:do{v<15&&(u+=(255&a.charCodeAt(o++))<<v,v+=8,u+=(255&a.charCodeAt(o++))<<v,v+=8),S=b[f+(u&m)];e:for(;;){if(u>>>=C=S.bits,v-=C,0==(C=S.op))t.output_data+=String.fromCharCode(S.val),r++;else{if(!(16&C)){if(0==(64&C)){S=b[f+(S.val+(u&(1<<C)-1))];continue e}if(32&C){s.mode=TYPE;break t}t.msg="invalid literal/length code",s.mode=BAD;break t}k=S.val,(C&=15)&&(v<C&&(u+=(255&a.charCodeAt(o++))<<v,v+=8),k+=u&(1<<C)-1,u>>>=C,v-=C),v<15&&(u+=(255&a.charCodeAt(o++))<<v,v+=8,u+=(255&a.charCodeAt(o++))<<v,v+=8),S=b[g+(u&_)];s:for(;;){if(u>>>=C=S.bits,v-=C,!(16&(C=S.op))){if(0==(64&C)){S=b[g+(S.val+(u&(1<<C)-1))];continue s}t.msg="invalid distance code",s.mode=BAD;break t}if(E=S.val,v<(C&=15)&&(u+=(255&a.charCodeAt(o++))<<v,(v+=8)<C&&(u+=(255&a.charCodeAt(o++))<<v,v+=8)),E+=u&(1<<C)-1,u>>>=C,v-=C,E>(C=r-n)){if((C=E-C)>c&&s.sane){t.msg="invalid distance too far back",s.mode=BAD;break t}A=0,w=-1,0==p?(A+=h-C,C<k&&(k-=C,t.output_data+=d.substring(A,A+C),r+=C,C=0,A=-1,w=r-E)):(A+=p-C,C<k&&(k-=C,t.output_data+=d.substring(A,A+C),A=-1,w=(r+=C)-E))}else A=-1,w=r-E;if(A>=0)t.output_data+=d.substring(A,A+k),r+=k,A+=k;else{var I=k;for(I>r-w&&(I=r-w),t.output_data+=t.output_data.substring(w,w+I),r+=I,w+=I,r+=k-=I;k>2;)t.output_data+=t.output_data.charAt(w++),t.output_data+=t.output_data.charAt(w++),t.output_data+=t.output_data.charAt(w++),k-=3;k&&(t.output_data+=t.output_data.charAt(w++),k>1&&(t.output_data+=t.output_data.charAt(w++)))}break s}}break e}}while(o<i&&r<l);o-=k=v>>>3,u&=(1<<(v-=k<<3))-1,t.next_in=o,t.next_out=r,t.avail_in=o<i?i-o+5:5-(o-i),t.avail_out=r<l?l-r+257:257-(r-l),s.hold=u,s.bits=v}function new_array(t){var e,s=new Array(t);for(e=0;e<t;e++)s[e]=0;return s}function getarg(t,e,s){return t&&e in t?t[e]:s}function checksum_none(){return 0}function inflate_state(){var t;this.mode=0,this.last=0,this.wrap=0,this.havedict=0,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=0,this.distcode=0,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=0,this.lens=new_array(320),this.work=new_array(288),this.codes=new Array(ENOUGH);var e={op:0,bits:0,val:0};for(t=0;t<ENOUGH;t++)this.codes[t]=e;this.sane=0,this.back=0,this.was=0}ZLIB.inflate_copyright=" inflate 1.2.6 Copyright 1995-2012 Mark Adler ",ZLIB.inflateResetKeep=function(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg=null,e.wrap&&(t.adler=1&e.wrap),e.mode=HEAD,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=0,e.distcode=0,e.next=0,e.sane=1,e.back=-1,ZLIB.Z_OK):ZLIB.Z_STREAM_ERROR},ZLIB.inflateReset=function(t,e){var s,a;return t&&t.state?(a=t.state,void 0===e&&(e=DEF_WBITS),e<0?(s=0,e=-e):(s=1+(e>>>4),e<48&&(e&=15)),1==s&&"function"==typeof ZLIB.adler32?t.checksum_function=ZLIB.adler32:2==s&&"function"==typeof ZLIB.crc32?t.checksum_function=ZLIB.crc32:t.checksum_function=checksum_none,e&&(e<8||e>15)?ZLIB.Z_STREAM_ERROR:(a.window&&a.wbits!=e&&(a.window=null),a.wrap=s,a.wbits=e,a.wsize=0,a.whave=0,a.wnext=0,ZLIB.inflateResetKeep(t))):ZLIB.Z_STREAM_ERROR},ZLIB.inflateInit=function(t){var e=new ZLIB.z_stream;return e.state=new inflate_state,ZLIB.inflateReset(e,t),e},ZLIB.inflatePrime=function(t,e,s){var a;return t&&t.state?(a=t.state,e<0?(a.hold=0,a.bits=0,ZLIB.Z_OK):e>16||a.bits+e>32?ZLIB.Z_STREAM_ERROR:(s&=(1<<e)-1,a.hold+=s<<a.bits,a.bits+=e,ZLIB.Z_OK)):ZLIB.Z_STREAM_ERROR};var lenfix_ary=null,lenfix_def="([ {op:96,bits:7,val:0},{op:0,bits:8,val:80},{op:0,bits:8,val:16},{op:20,bits:8,val:115},{op:18,bits:7,val:31},{op:0,bits:8,val:112},{op:0,bits:8,val:48}, {op:0,bits:9,val:192},{op:16,bits:7,val:10},{op:0,bits:8,val:96},{op:0,bits:8,val:32},{op:0,bits:9,val:160},{op:0,bits:8,val:0},{op:0,bits:8,val:128}, {op:0,bits:8,val:64},{op:0,bits:9,val:224},{op:16,bits:7,val:6},{op:0,bits:8,val:88},{op:0,bits:8,val:24},{op:0,bits:9,val:144},{op:19,bits:7,val:59}, {op:0,bits:8,val:120},{op:0,bits:8,val:56},{op:0,bits:9,val:208},{op:17,bits:7,val:17},{op:0,bits:8,val:104},{op:0,bits:8,val:40},{op:0,bits:9,val:176}, {op:0,bits:8,val:8},{op:0,bits:8,val:136},{op:0,bits:8,val:72},{op:0,bits:9,val:240},{op:16,bits:7,val:4},{op:0,bits:8,val:84},{op:0,bits:8,val:20}, {op:21,bits:8,val:227},{op:19,bits:7,val:43},{op:0,bits:8,val:116},{op:0,bits:8,val:52},{op:0,bits:9,val:200},{op:17,bits:7,val:13},{op:0,bits:8,val:100}, {op:0,bits:8,val:36},{op:0,bits:9,val:168},{op:0,bits:8,val:4},{op:0,bits:8,val:132},{op:0,bits:8,val:68},{op:0,bits:9,val:232},{op:16,bits:7,val:8}, {op:0,bits:8,val:92},{op:0,bits:8,val:28},{op:0,bits:9,val:152},{op:20,bits:7,val:83},{op:0,bits:8,val:124},{op:0,bits:8,val:60},{op:0,bits:9,val:216}, {op:18,bits:7,val:23},{op:0,bits:8,val:108},{op:0,bits:8,val:44},{op:0,bits:9,val:184},{op:0,bits:8,val:12},{op:0,bits:8,val:140},{op:0,bits:8,val:76}, {op:0,bits:9,val:248},{op:16,bits:7,val:3},{op:0,bits:8,val:82},{op:0,bits:8,val:18},{op:21,bits:8,val:163},{op:19,bits:7,val:35},{op:0,bits:8,val:114}, {op:0,bits:8,val:50},{op:0,bits:9,val:196},{op:17,bits:7,val:11},{op:0,bits:8,val:98},{op:0,bits:8,val:34},{op:0,bits:9,val:164},{op:0,bits:8,val:2}, {op:0,bits:8,val:130},{op:0,bits:8,val:66},{op:0,bits:9,val:228},{op:16,bits:7,val:7},{op:0,bits:8,val:90},{op:0,bits:8,val:26},{op:0,bits:9,val:148}, {op:20,bits:7,val:67},{op:0,bits:8,val:122},{op:0,bits:8,val:58},{op:0,bits:9,val:212},{op:18,bits:7,val:19},{op:0,bits:8,val:106},{op:0,bits:8,val:42}, {op:0,bits:9,val:180},{op:0,bits:8,val:10},{op:0,bits:8,val:138},{op:0,bits:8,val:74},{op:0,bits:9,val:244},{op:16,bits:7,val:5},{op:0,bits:8,val:86}, {op:0,bits:8,val:22},{op:64,bits:8,val:0},{op:19,bits:7,val:51},{op:0,bits:8,val:118},{op:0,bits:8,val:54},{op:0,bits:9,val:204},{op:17,bits:7,val:15}, {op:0,bits:8,val:102},{op:0,bits:8,val:38},{op:0,bits:9,val:172},{op:0,bits:8,val:6},{op:0,bits:8,val:134},{op:0,bits:8,val:70},{op:0,bits:9,val:236}, {op:16,bits:7,val:9},{op:0,bits:8,val:94},{op:0,bits:8,val:30},{op:0,bits:9,val:156},{op:20,bits:7,val:99},{op:0,bits:8,val:126},{op:0,bits:8,val:62}, {op:0,bits:9,val:220},{op:18,bits:7,val:27},{op:0,bits:8,val:110},{op:0,bits:8,val:46},{op:0,bits:9,val:188},{op:0,bits:8,val:14},{op:0,bits:8,val:142}, {op:0,bits:8,val:78},{op:0,bits:9,val:252},{op:96,bits:7,val:0},{op:0,bits:8,val:81},{op:0,bits:8,val:17},{op:21,bits:8,val:131},{op:18,bits:7,val:31}, {op:0,bits:8,val:113},{op:0,bits:8,val:49},{op:0,bits:9,val:194},{op:16,bits:7,val:10},{op:0,bits:8,val:97},{op:0,bits:8,val:33},{op:0,bits:9,val:162}, {op:0,bits:8,val:1},{op:0,bits:8,val:129},{op:0,bits:8,val:65},{op:0,bits:9,val:226},{op:16,bits:7,val:6},{op:0,bits:8,val:89},{op:0,bits:8,val:25}, {op:0,bits:9,val:146},{op:19,bits:7,val:59},{op:0,bits:8,val:121},{op:0,bits:8,val:57},{op:0,bits:9,val:210},{op:17,bits:7,val:17},{op:0,bits:8,val:105}, {op:0,bits:8,val:41},{op:0,bits:9,val:178},{op:0,bits:8,val:9},{op:0,bits:8,val:137},{op:0,bits:8,val:73},{op:0,bits:9,val:242},{op:16,bits:7,val:4}, {op:0,bits:8,val:85},{op:0,bits:8,val:21},{op:16,bits:8,val:258},{op:19,bits:7,val:43},{op:0,bits:8,val:117},{op:0,bits:8,val:53},{op:0,bits:9,val:202}, {op:17,bits:7,val:13},{op:0,bits:8,val:101},{op:0,bits:8,val:37},{op:0,bits:9,val:170},{op:0,bits:8,val:5},{op:0,bits:8,val:133},{op:0,bits:8,val:69}, {op:0,bits:9,val:234},{op:16,bits:7,val:8},{op:0,bits:8,val:93},{op:0,bits:8,val:29},{op:0,bits:9,val:154},{op:20,bits:7,val:83},{op:0,bits:8,val:125}, {op:0,bits:8,val:61},{op:0,bits:9,val:218},{op:18,bits:7,val:23},{op:0,bits:8,val:109},{op:0,bits:8,val:45},{op:0,bits:9,val:186},{op:0,bits:8,val:13}, {op:0,bits:8,val:141},{op:0,bits:8,val:77},{op:0,bits:9,val:250},{op:16,bits:7,val:3},{op:0,bits:8,val:83},{op:0,bits:8,val:19},{op:21,bits:8,val:195}, {op:19,bits:7,val:35},{op:0,bits:8,val:115},{op:0,bits:8,val:51},{op:0,bits:9,val:198},{op:17,bits:7,val:11},{op:0,bits:8,val:99},{op:0,bits:8,val:35}, {op:0,bits:9,val:166},{op:0,bits:8,val:3},{op:0,bits:8,val:131},{op:0,bits:8,val:67},{op:0,bits:9,val:230},{op:16,bits:7,val:7},{op:0,bits:8,val:91}, {op:0,bits:8,val:27},{op:0,bits:9,val:150},{op:20,bits:7,val:67},{op:0,bits:8,val:123},{op:0,bits:8,val:59},{op:0,bits:9,val:214},{op:18,bits:7,val:19}, {op:0,bits:8,val:107},{op:0,bits:8,val:43},{op:0,bits:9,val:182},{op:0,bits:8,val:11},{op:0,bits:8,val:139},{op:0,bits:8,val:75},{op:0,bits:9,val:246}, {op:16,bits:7,val:5},{op:0,bits:8,val:87},{op:0,bits:8,val:23},{op:64,bits:8,val:0},{op:19,bits:7,val:51},{op:0,bits:8,val:119},{op:0,bits:8,val:55}, {op:0,bits:9,val:206},{op:17,bits:7,val:15},{op:0,bits:8,val:103},{op:0,bits:8,val:39},{op:0,bits:9,val:174},{op:0,bits:8,val:7},{op:0,bits:8,val:135}, {op:0,bits:8,val:71},{op:0,bits:9,val:238},{op:16,bits:7,val:9},{op:0,bits:8,val:95},{op:0,bits:8,val:31},{op:0,bits:9,val:158},{op:20,bits:7,val:99}, {op:0,bits:8,val:127},{op:0,bits:8,val:63},{op:0,bits:9,val:222},{op:18,bits:7,val:27},{op:0,bits:8,val:111},{op:0,bits:8,val:47},{op:0,bits:9,val:190}, {op:0,bits:8,val:15},{op:0,bits:8,val:143},{op:0,bits:8,val:79},{op:0,bits:9,val:254},{op:96,bits:7,val:0},{op:0,bits:8,val:80},{op:0,bits:8,val:16}, {op:20,bits:8,val:115},{op:18,bits:7,val:31},{op:0,bits:8,val:112},{op:0,bits:8,val:48},{op:0,bits:9,val:193},{op:16,bits:7,val:10},{op:0,bits:8,val:96}, {op:0,bits:8,val:32},{op:0,bits:9,val:161},{op:0,bits:8,val:0},{op:0,bits:8,val:128},{op:0,bits:8,val:64},{op:0,bits:9,val:225},{op:16,bits:7,val:6}, {op:0,bits:8,val:88},{op:0,bits:8,val:24},{op:0,bits:9,val:145},{op:19,bits:7,val:59},{op:0,bits:8,val:120},{op:0,bits:8,val:56},{op:0,bits:9,val:209}, {op:17,bits:7,val:17},{op:0,bits:8,val:104},{op:0,bits:8,val:40},{op:0,bits:9,val:177},{op:0,bits:8,val:8},{op:0,bits:8,val:136},{op:0,bits:8,val:72}, {op:0,bits:9,val:241},{op:16,bits:7,val:4},{op:0,bits:8,val:84},{op:0,bits:8,val:20},{op:21,bits:8,val:227},{op:19,bits:7,val:43},{op:0,bits:8,val:116}, {op:0,bits:8,val:52},{op:0,bits:9,val:201},{op:17,bits:7,val:13},{op:0,bits:8,val:100},{op:0,bits:8,val:36},{op:0,bits:9,val:169},{op:0,bits:8,val:4}, {op:0,bits:8,val:132},{op:0,bits:8,val:68},{op:0,bits:9,val:233},{op:16,bits:7,val:8},{op:0,bits:8,val:92},{op:0,bits:8,val:28},{op:0,bits:9,val:153}, {op:20,bits:7,val:83},{op:0,bits:8,val:124},{op:0,bits:8,val:60},{op:0,bits:9,val:217},{op:18,bits:7,val:23},{op:0,bits:8,val:108},{op:0,bits:8,val:44}, {op:0,bits:9,val:185},{op:0,bits:8,val:12},{op:0,bits:8,val:140},{op:0,bits:8,val:76},{op:0,bits:9,val:249},{op:16,bits:7,val:3},{op:0,bits:8,val:82}, {op:0,bits:8,val:18},{op:21,bits:8,val:163},{op:19,bits:7,val:35},{op:0,bits:8,val:114},{op:0,bits:8,val:50},{op:0,bits:9,val:197},{op:17,bits:7,val:11}, {op:0,bits:8,val:98},{op:0,bits:8,val:34},{op:0,bits:9,val:165},{op:0,bits:8,val:2},{op:0,bits:8,val:130},{op:0,bits:8,val:66},{op:0,bits:9,val:229}, {op:16,bits:7,val:7},{op:0,bits:8,val:90},{op:0,bits:8,val:26},{op:0,bits:9,val:149},{op:20,bits:7,val:67},{op:0,bits:8,val:122},{op:0,bits:8,val:58}, {op:0,bits:9,val:213},{op:18,bits:7,val:19},{op:0,bits:8,val:106},{op:0,bits:8,val:42},{op:0,bits:9,val:181},{op:0,bits:8,val:10},{op:0,bits:8,val:138}, {op:0,bits:8,val:74},{op:0,bits:9,val:245},{op:16,bits:7,val:5},{op:0,bits:8,val:86},{op:0,bits:8,val:22},{op:64,bits:8,val:0},{op:19,bits:7,val:51}, {op:0,bits:8,val:118},{op:0,bits:8,val:54},{op:0,bits:9,val:205},{op:17,bits:7,val:15},{op:0,bits:8,val:102},{op:0,bits:8,val:38},{op:0,bits:9,val:173}, {op:0,bits:8,val:6},{op:0,bits:8,val:134},{op:0,bits:8,val:70},{op:0,bits:9,val:237},{op:16,bits:7,val:9},{op:0,bits:8,val:94},{op:0,bits:8,val:30}, {op:0,bits:9,val:157},{op:20,bits:7,val:99},{op:0,bits:8,val:126},{op:0,bits:8,val:62},{op:0,bits:9,val:221},{op:18,bits:7,val:27},{op:0,bits:8,val:110}, {op:0,bits:8,val:46},{op:0,bits:9,val:189},{op:0,bits:8,val:14},{op:0,bits:8,val:142},{op:0,bits:8,val:78},{op:0,bits:9,val:253},{op:96,bits:7,val:0}, {op:0,bits:8,val:81},{op:0,bits:8,val:17},{op:21,bits:8,val:131},{op:18,bits:7,val:31},{op:0,bits:8,val:113},{op:0,bits:8,val:49},{op:0,bits:9,val:195}, {op:16,bits:7,val:10},{op:0,bits:8,val:97},{op:0,bits:8,val:33},{op:0,bits:9,val:163},{op:0,bits:8,val:1},{op:0,bits:8,val:129},{op:0,bits:8,val:65}, {op:0,bits:9,val:227},{op:16,bits:7,val:6},{op:0,bits:8,val:89},{op:0,bits:8,val:25},{op:0,bits:9,val:147},{op:19,bits:7,val:59},{op:0,bits:8,val:121}, {op:0,bits:8,val:57},{op:0,bits:9,val:211},{op:17,bits:7,val:17},{op:0,bits:8,val:105},{op:0,bits:8,val:41},{op:0,bits:9,val:179},{op:0,bits:8,val:9}, {op:0,bits:8,val:137},{op:0,bits:8,val:73},{op:0,bits:9,val:243},{op:16,bits:7,val:4},{op:0,bits:8,val:85},{op:0,bits:8,val:21},{op:16,bits:8,val:258}, {op:19,bits:7,val:43},{op:0,bits:8,val:117},{op:0,bits:8,val:53},{op:0,bits:9,val:203},{op:17,bits:7,val:13},{op:0,bits:8,val:101},{op:0,bits:8,val:37}, {op:0,bits:9,val:171},{op:0,bits:8,val:5},{op:0,bits:8,val:133},{op:0,bits:8,val:69},{op:0,bits:9,val:235},{op:16,bits:7,val:8},{op:0,bits:8,val:93}, {op:0,bits:8,val:29},{op:0,bits:9,val:155},{op:20,bits:7,val:83},{op:0,bits:8,val:125},{op:0,bits:8,val:61},{op:0,bits:9,val:219},{op:18,bits:7,val:23}, {op:0,bits:8,val:109},{op:0,bits:8,val:45},{op:0,bits:9,val:187},{op:0,bits:8,val:13},{op:0,bits:8,val:141},{op:0,bits:8,val:77},{op:0,bits:9,val:251}, {op:16,bits:7,val:3},{op:0,bits:8,val:83},{op:0,bits:8,val:19},{op:21,bits:8,val:195},{op:19,bits:7,val:35},{op:0,bits:8,val:115},{op:0,bits:8,val:51}, {op:0,bits:9,val:199},{op:17,bits:7,val:11},{op:0,bits:8,val:99},{op:0,bits:8,val:35},{op:0,bits:9,val:167},{op:0,bits:8,val:3},{op:0,bits:8,val:131}, {op:0,bits:8,val:67},{op:0,bits:9,val:231},{op:16,bits:7,val:7},{op:0,bits:8,val:91},{op:0,bits:8,val:27},{op:0,bits:9,val:151},{op:20,bits:7,val:67}, {op:0,bits:8,val:123},{op:0,bits:8,val:59},{op:0,bits:9,val:215},{op:18,bits:7,val:19},{op:0,bits:8,val:107},{op:0,bits:8,val:43},{op:0,bits:9,val:183}, {op:0,bits:8,val:11},{op:0,bits:8,val:139},{op:0,bits:8,val:75},{op:0,bits:9,val:247},{op:16,bits:7,val:5},{op:0,bits:8,val:87},{op:0,bits:8,val:23}, {op:64,bits:8,val:0},{op:19,bits:7,val:51},{op:0,bits:8,val:119},{op:0,bits:8,val:55},{op:0,bits:9,val:207},{op:17,bits:7,val:15},{op:0,bits:8,val:103}, {op:0,bits:8,val:39},{op:0,bits:9,val:175},{op:0,bits:8,val:7},{op:0,bits:8,val:135},{op:0,bits:8,val:71},{op:0,bits:9,val:239},{op:16,bits:7,val:9}, {op:0,bits:8,val:95},{op:0,bits:8,val:31},{op:0,bits:9,val:159},{op:20,bits:7,val:99},{op:0,bits:8,val:127},{op:0,bits:8,val:63},{op:0,bits:9,val:223}, {op:18,bits:7,val:27},{op:0,bits:8,val:111},{op:0,bits:8,val:47},{op:0,bits:9,val:191},{op:0,bits:8,val:15},{op:0,bits:8,val:143},{op:0,bits:8,val:79}, {op:0,bits:9,val:255}])",distfix_ary=null,distfix_def="([ {op:16,bits:5,val:1},{op:23,bits:5,val:257},{op:19,bits:5,val:17},{op:27,bits:5,val:4097},{op:17,bits:5,val:5},{op:25,bits:5,val:1025}, {op:21,bits:5,val:65},{op:29,bits:5,val:16385},{op:16,bits:5,val:3},{op:24,bits:5,val:513},{op:20,bits:5,val:33},{op:28,bits:5,val:8193}, {op:18,bits:5,val:9},{op:26,bits:5,val:2049},{op:22,bits:5,val:129},{op:64,bits:5,val:0},{op:16,bits:5,val:2},{op:23,bits:5,val:385}, {op:19,bits:5,val:25},{op:27,bits:5,val:6145},{op:17,bits:5,val:7},{op:25,bits:5,val:1537},{op:21,bits:5,val:97},{op:29,bits:5,val:24577}, {op:16,bits:5,val:4},{op:24,bits:5,val:769},{op:20,bits:5,val:49},{op:28,bits:5,val:12289},{op:18,bits:5,val:13},{op:26,bits:5,val:3073}, {op:22,bits:5,val:193},{op:64,bits:5,val:0}])";function fixedtables(state){var i;for(lenfix_ary||(lenfix_ary=eval(lenfix_def)),distfix_ary||(distfix_ary=eval(distfix_def)),state.lencode=0,state.distcode=512,i=0;i<512;i++)state.codes[i]=lenfix_ary[i];for(i=0;i<32;i++)state.codes[i+512]=distfix_ary[i];state.lenbits=9,state.distbits=5}function updatewindow(t){var e=t.state,s=t.output_data.length;return null===e.window&&(e.window=""),0==e.wsize&&(e.wsize=1<<e.wbits),s>=e.wsize?e.window=t.output_data.substring(s-e.wsize):e.whave+s<e.wsize?e.window+=t.output_data:e.window=e.window.substring(e.whave-(e.wsize-s))+t.output_data,e.whave=e.window.length,e.whave<e.wsize?e.wnext=e.whave:e.wnext=0,0}function CRC2(t,e){var s=[255&e,e>>>8&255];t.state.check=t.checksum_function(t.state.check,s,0,2)}function CRC4(t,e){var s=[255&e,e>>>8&255,e>>>16&255,e>>>24&255];t.state.check=t.checksum_function(t.state.check,s,0,4)}function LOAD(t,e){return e.strm=t,e.left=t.avail_out,e.next=t.next_in,e.have=t.avail_in,e.hold=t.state.hold,e.bits=t.state.bits,e}function RESTORE(t){var e=t.strm;e.next_in=t.next,e.avail_out=t.left,e.avail_in=t.have,e.state.hold=t.hold,e.state.bits=t.bits}function INITBITS(t){t.hold=0,t.bits=0}function PULLBYTE(t){return 0!=t.have&&(t.have--,t.hold+=(255&t.strm.input_data.charCodeAt(t.next++))<<t.bits,t.bits+=8,!0)}function NEEDBITS(t,e){for(;t.bits<e;)if(!PULLBYTE(t))return!1;return!0}function BITS(t,e){return t.hold&(1<<e)-1}function DROPBITS(t,e){t.hold>>>=e,t.bits-=e}function BYTEBITS(t){t.hold>>>=7&t.bits,t.bits-=7&t.bits}function REVERSE(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}var inflate_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];ZLIB.inflate=function(t,e){var s,a,o,i,r,n,l,h,c,p=-1,d=-1;if(!t||!t.state||!t.input_data&&0!=t.avail_in)return ZLIB.Z_STREAM_ERROR;(s=t.state).mode==TYPE&&(s.mode=TYPEDO),LOAD(t,a={}),o=a.have,i=a.left,c=ZLIB.Z_OK;t:for(;;)switch(s.mode){case HEAD:if(0==s.wrap){s.mode=TYPEDO;break}if(!NEEDBITS(a,16))break t;if(2&s.wrap&&35615==a.hold){s.check=t.checksum_function(0,null,0,0),CRC2(t,a.hold),INITBITS(a),s.mode=FLAGS;break}if(s.flags=0,null!==s.head&&(s.head.done=-1),!(1&s.wrap)||((BITS(a,8)<<8)+(a.hold>>>8))%31){t.msg="incorrect header check",s.mode=BAD;break}if(BITS(a,4)!=ZLIB.Z_DEFLATED){t.msg="unknown compression method",s.mode=BAD;break}if(DROPBITS(a,4),h=BITS(a,4)+8,0==s.wbits)s.wbits=h;else if(h>s.wbits){t.msg="invalid window size",s.mode=BAD;break}s.dmax=1<<h,t.adler=s.check=t.checksum_function(0,null,0,0),s.mode=512&a.hold?DICTID:TYPE,INITBITS(a);break;case FLAGS:if(!NEEDBITS(a,16))break t;if(s.flags=a.hold,(255&s.flags)!=ZLIB.Z_DEFLATED){t.msg="unknown compression method",s.mode=BAD;break}if(57344&s.flags){t.msg="unknown header flags set",s.mode=BAD;break}null!==s.head&&(s.head.text=a.hold>>>8&1),512&s.flags&&CRC2(t,a.hold),INITBITS(a),s.mode=TIME;case TIME:if(!NEEDBITS(a,32))break t;null!==s.head&&(s.head.time=a.hold),512&s.flags&&CRC4(t,a.hold),INITBITS(a),s.mode=OS;case OS:if(!NEEDBITS(a,16))break t;null!==s.head&&(s.head.xflags=255&a.hold,s.head.os=a.hold>>>8),512&s.flags&&CRC2(t,a.hold),INITBITS(a),s.mode=EXLEN;case EXLEN:if(1024&s.flags){if(!NEEDBITS(a,16))break t;s.length=a.hold,null!==s.head&&(s.head.extra_len=a.hold),512&s.flags&&CRC2(t,a.hold),INITBITS(a),s.head.extra=""}else null!==s.head&&(s.head.extra=null);s.mode=EXTRA;case EXTRA:if(1024&s.flags&&((r=s.length)>a.have&&(r=a.have),r&&(null!==s.head&&null!==s.head.extra&&(h=s.head.extra_len-s.length,s.head.extra+=t.input_data.substring(a.next,a.next+(h+r>s.head.extra_max?s.head.extra_max-h:r))),512&s.flags&&(s.check=t.checksum_function(s.check,t.input_data,a.next,r)),a.have-=r,a.next+=r,s.length-=r),s.length))break t;s.length=0,s.mode=NAME;case NAME:if(2048&s.flags){if(0==a.have)break t;null!==s.head&&null===s.head.name&&(s.head.name=""),r=0;do{if(h=t.input_data.charAt(a.next+r),r++,"\0"===h)break;null!==s.head&&s.length<s.head.name_max&&(s.head.name+=h,s.length++)}while(r<a.have);if(512&s.flags&&(s.check=t.checksum_function(s.check,t.input_data,a.next,r)),a.have-=r,a.next+=r,"\0"!==h)break t}else null!==s.head&&(s.head.name=null);s.length=0,s.mode=COMMENT;case COMMENT:if(4096&s.flags){if(0==a.have)break t;r=0,null!==s.head&&null===s.head.comment&&(s.head.comment="");do{if(h=t.input_data.charAt(a.next+r),r++,"\0"===h)break;null!==s.head&&s.length<s.head.comm_max&&(s.head.comment+=h,s.length++)}while(r<a.have);if(512&s.flags&&(s.check=t.checksum_function(s.check,t.input_data,a.next,r)),a.have-=r,a.next+=r,"\0"!==h)break t}else null!==s.head&&(s.head.comment=null);s.mode=HCRC;case HCRC:if(512&s.flags){if(!NEEDBITS(a,16))break t;if(a.hold!=(65535&s.check)){t.msg="header crc mismatch",s.mode=BAD;break}INITBITS(a)}null!==s.head&&(s.head.hcrc=s.flags>>>9&1,s.head.done=1),t.adler=s.check=t.checksum_function(0,null,0,0),s.mode=TYPE;break;case DICTID:if(!NEEDBITS(a,32))break t;t.adler=s.check=REVERSE(a.hold),INITBITS(a),s.mode=DICT;case DICT:if(0==s.havedict)return RESTORE(a),ZLIB.Z_NEED_DICT;t.adler=s.check=t.checksum_function(0,null,0,0),s.mode=TYPE;case TYPE:if(e==ZLIB.Z_BLOCK||e==ZLIB.Z_TREES)break t;case TYPEDO:if(s.last){BYTEBITS(a),s.mode=CHECK;break}if(!NEEDBITS(a,3))break t;switch(s.last=BITS(a,1),DROPBITS(a,1),BITS(a,2)){case 0:s.mode=STORED;break;case 1:if(fixedtables(s),s.mode=LEN_,e==ZLIB.Z_TREES){DROPBITS(a,2);break t}break;case 2:s.mode=TABLE;break;case 3:t.msg="invalid block type",s.mode=BAD}DROPBITS(a,2);break;case STORED:if(BYTEBITS(a),!NEEDBITS(a,32))break t;if((65535&a.hold)!=(a.hold>>>16&65535^65535)){t.msg="invalid stored block lengths",s.mode=BAD;break}if(s.length=65535&a.hold,INITBITS(a),s.mode=COPY_,e==ZLIB.Z_TREES)break t;case COPY_:s.mode=COPY;case COPY:if(r=s.length){if(r>a.have&&(r=a.have),r>a.left&&(r=a.left),0==r)break t;t.output_data+=t.input_data.substring(a.next,a.next+r),t.next_out+=r,a.have-=r,a.next+=r,a.left-=r,s.length-=r;break}s.mode=TYPE;break;case TABLE:if(!NEEDBITS(a,14))break t;if(s.nlen=BITS(a,5)+257,DROPBITS(a,5),s.ndist=BITS(a,5)+1,DROPBITS(a,5),s.ncode=BITS(a,4)+4,DROPBITS(a,4),s.nlen>286||s.ndist>30){t.msg="too many length or distance symbols",s.mode=BAD;break}s.have=0,s.mode=LENLENS;case LENLENS:for(;s.have<s.ncode;){if(!NEEDBITS(a,3))break t;var u=BITS(a,3);s.lens[inflate_order[s.have++]]=u,DROPBITS(a,3)}for(;s.have<19;)s.lens[inflate_order[s.have++]]=0;if(s.next=0,s.lencode=0,s.lenbits=7,c=inflate_table(s,CODES)){t.msg="invalid code lengths set",s.mode=BAD;break}s.have=0,s.mode=CODELENS;case CODELENS:for(;s.have<s.nlen+s.ndist;){for(;!((n=s.codes[s.lencode+BITS(a,s.lenbits)]).bits<=a.bits);)if(!PULLBYTE(a))break t;if(n.val<16)DROPBITS(a,n.bits),s.lens[s.have++]=n.val;else{if(16==n.val){if(!NEEDBITS(a,n.bits+2))break t;if(DROPBITS(a,n.bits),0==s.have){t.msg="invalid bit length repeat",s.mode=BAD;break}h=s.lens[s.have-1],r=3+BITS(a,2),DROPBITS(a,2)}else if(17==n.val){if(!NEEDBITS(a,n.bits+3))break t;DROPBITS(a,n.bits),h=0,r=3+BITS(a,3),DROPBITS(a,3)}else{if(!NEEDBITS(a,n.bits+7))break t;DROPBITS(a,n.bits),h=0,r=11+BITS(a,7),DROPBITS(a,7)}if(s.have+r>s.nlen+s.ndist){t.msg="invalid bit length repeat",s.mode=BAD;break}for(;r--;)s.lens[s.have++]=h}}if(s.mode==BAD)break;if(0==s.lens[256]){t.msg="invalid code -- missing end-of-block",s.mode=BAD;break}if(s.next=0,s.lencode=s.next,s.lenbits=9,c=inflate_table(s,LENS)){t.msg="invalid literal/lengths set",s.mode=BAD;break}if(s.distcode=s.next,s.distbits=6,c=inflate_table(s,DISTS)){t.msg="invalid distances set",s.mode=BAD;break}if(s.mode=LEN_,e==ZLIB.Z_TREES)break t;case LEN_:s.mode=LEN;case LEN:if(a.have>=6&&a.left>=258){RESTORE(a),inflate_fast(t,i),LOAD(t,a),s.mode==TYPE&&(s.back=-1);break}for(s.back=0;!((n=s.codes[s.lencode+BITS(a,s.lenbits)]).bits<=a.bits);)if(!PULLBYTE(a))break t;if(n.op&&0==(240&n.op)){for(l=n;n=s.codes[s.lencode+l.val+(BITS(a,l.bits+l.op)>>>l.bits)],!(l.bits+n.bits<=a.bits);)if(!PULLBYTE(a))break t;DROPBITS(a,l.bits),s.back+=l.bits}if(DROPBITS(a,n.bits),s.back+=n.bits,s.length=n.val,0==n.op){s.mode=LIT;break}if(32&n.op){s.back=-1,s.mode=TYPE;break}if(64&n.op){t.msg="invalid literal/length code",s.mode=BAD;break}s.extra=15&n.op,s.mode=LENEXT;case LENEXT:if(s.extra){if(!NEEDBITS(a,s.extra))break t;s.length+=BITS(a,s.extra),DROPBITS(a,s.extra),s.back+=s.extra}s.was=s.length,s.mode=DIST;case DIST:for(;!((n=s.codes[s.distcode+BITS(a,s.distbits)]).bits<=a.bits);)if(!PULLBYTE(a))break t;if(0==(240&n.op)){for(l=n;n=s.codes[s.distcode+l.val+(BITS(a,l.bits+l.op)>>>l.bits)],!(l.bits+n.bits<=a.bits);)if(!PULLBYTE(a))break t;DROPBITS(a,l.bits),s.back+=l.bits}if(DROPBITS(a,n.bits),s.back+=n.bits,64&n.op){t.msg="invalid distance code",s.mode=BAD;break}s.offset=n.val,s.extra=15&n.op,s.mode=DISTEXT;case DISTEXT:if(s.extra){if(!NEEDBITS(a,s.extra))break t;s.offset+=BITS(a,s.extra),DROPBITS(a,s.extra),s.back+=s.extra}s.mode=MATCH;case MATCH:if(0==a.left)break t;if(r=i-a.left,s.offset>r){if((r=s.offset-r)>s.whave&&s.sane){t.msg="invalid distance too far back",s.mode=BAD;break}r>s.wnext?(r-=s.wnext,p=s.wsize-r,d=-1):(p=s.wnext-r,d=-1),r>s.length&&(r=s.length)}else p=-1,d=t.next_out-s.offset,r=s.length;if(r>a.left&&(r=a.left),a.left-=r,s.length-=r,p>=0)t.output_data+=s.window.substring(p,p+r),t.next_out+=r,r=0;else{t.next_out+=r;do{t.output_data+=t.output_data.charAt(d++)}while(--r)}0==s.length&&(s.mode=LEN);break;case LIT:if(0==a.left)break t;t.output_data+=String.fromCharCode(s.length),t.next_out++,a.left--,s.mode=LEN;break;case CHECK:if(s.wrap){if(!NEEDBITS(a,32))break t;if(i-=a.left,t.total_out+=i,s.total+=i,i&&(t.adler=s.check=t.checksum_function(s.check,t.output_data,t.output_data.length-i,i)),i=a.left,(s.flags?a.hold:REVERSE(a.hold))!=s.check){t.msg="incorrect data check",s.mode=BAD;break}INITBITS(a)}s.mode=LENGTH;case LENGTH:if(s.wrap&&s.flags){if(!NEEDBITS(a,32))break t;if(a.hold!=(4294967295&s.total)){t.msg="incorrect length check",s.mode=BAD;break}INITBITS(a)}s.mode=DONE;case DONE:c=ZLIB.Z_STREAM_END;break t;case BAD:c=ZLIB.Z_DATA_ERROR;break t;case MEM:return ZLIB.Z_MEM_ERROR;default:return ZLIB.Z_STREAM_ERROR}return RESTORE(a),(s.wsize||i!=t.avail_out&&s.mode<BAD&&(s.mode<CHECK||e!=ZLIB.Z_FINISH))&&updatewindow(t)?(s.mode=MEM,ZLIB.Z_MEM_ERROR):(o-=t.avail_in,i-=t.avail_out,t.total_in+=o,t.total_out+=i,s.total+=i,s.wrap&&i&&(t.adler=s.check=t.checksum_function(s.check,t.output_data,0,t.output_data.length)),t.data_type=s.bits+(s.last?64:0)+(s.mode==TYPE?128:0)+(s.mode==LEN_||s.mode==COPY_?256:0),(0==o&&0==i||e==ZLIB.Z_FINISH)&&c==ZLIB.Z_OK&&(c=ZLIB.Z_BUF_ERROR),c)},ZLIB.inflateEnd=function(t){return t&&t.state?(t.state.window=null,t.state=null,ZLIB.Z_OK):ZLIB.Z_STREAM_ERROR},ZLIB.z_stream.prototype.inflate=function(t,e){var s,a;this.input_data=t,this.next_in=getarg(e,"next_in",0),this.avail_in=getarg(e,"avail_in",t.length-this.next_in),s=getarg(e,"flush",ZLIB.Z_SYNC_FLUSH),a=getarg(e,"avail_out",-1);var o="";do{if(this.avail_out=a>=0?a:16384,this.output_data="",this.next_out=0,this.error=ZLIB.inflate(this,s),0!=this.error&&console.log("zlib error",this.error),a>=0)return this.output_data;if(o+=this.output_data,this.avail_out>0)break}while(this.error==ZLIB.Z_OK);return o},ZLIB.z_stream.prototype.inflateReset=function(t){return ZLIB.inflateReset(this,t)}}(),void 0===ZLIB&&alert("ZLIB is not defined. SRC zlib.js before zlib-adler32.js"),BASE=65521,NMAX=5552,ZLIB.adler32=function(t,e,s,a){return"string"==typeof e?function(t,e,s,a){var o,i;if(o=t>>>16&65535,t&=65535,1==a)return(t+=255&e.charCodeAt(s))>=BASE&&(t-=BASE),(o+=t)>=BASE&&(o-=BASE),t|o<<16;if(null===e)return 1;if(a<16){for(;a--;)o+=t+=255&e.charCodeAt(s++);return t>=BASE&&(t-=BASE),t|(o%=BASE)<<16}for(;a>=NMAX;){a-=NMAX,i=347;do{o+=t+=255&e.charCodeAt(s++),o+=t+=255&e.charCodeAt(s++),o+=t+=255&e.charCodeAt(s++),o+=t+=255&e.charCodeAt(s++),o+=t+=255&e.charCodeAt(s++),o+=t+=255&e.charCodeAt(s++),o+=t+=255&e.charCodeAt(s++),o+=t+=255&e.charCodeAt(s++),o+=t+=255&e.charCodeAt(s++),o+=t+=255&e.charCodeAt(s++),o+=t+=255&e.charCodeAt(s++),o+=t+=255&e.charCodeAt(s++),o+=t+=255&e.charCodeAt(s++),o+=t+=255&e.charCodeAt(s++),o+=t+=255&e.charCodeAt(s++),o+=t+=255&e.charCodeAt(s++)}while(--i);t%=BASE,o%=BASE}if(a){for(;a>=16;)a-=16,o+=t+=255&e.charCodeAt(s++),o+=t+=255&e.charCodeAt(s++),o+=t+=255&e.charCodeAt(s++),o+=t+=255&e.charCodeAt(s++),o+=t+=255&e.charCodeAt(s++),o+=t+=255&e.charCodeAt(s++),o+=t+=255&e.charCodeAt(s++),o+=t+=255&e.charCodeAt(s++),o+=t+=255&e.charCodeAt(s++),o+=t+=255&e.charCodeAt(s++),o+=t+=255&e.charCodeAt(s++),o+=t+=255&e.charCodeAt(s++),o+=t+=255&e.charCodeAt(s++),o+=t+=255&e.charCodeAt(s++),o+=t+=255&e.charCodeAt(s++),o+=t+=255&e.charCodeAt(s++);for(;a--;)o+=t+=255&e.charCodeAt(s++);t%=BASE,o%=BASE}return t|o<<16}(t,e,s,a):function(t,e,s,a){var o,i;if(o=t>>>16&65535,t&=65535,1==a)return(t+=e[s])>=BASE&&(t-=BASE),(o+=t)>=BASE&&(o-=BASE),t|o<<16;if(null===e)return 1;if(a<16){for(;a--;)o+=t+=e[s++];return t>=BASE&&(t-=BASE),t|(o%=BASE)<<16}for(;a>=NMAX;){a-=NMAX,i=347;do{o+=t+=e[s++],o+=t+=e[s++],o+=t+=e[s++],o+=t+=e[s++],o+=t+=e[s++],o+=t+=e[s++],o+=t+=e[s++],o+=t+=e[s++],o+=t+=e[s++],o+=t+=e[s++],o+=t+=e[s++],o+=t+=e[s++],o+=t+=e[s++],o+=t+=e[s++],o+=t+=e[s++],o+=t+=e[s++]}while(--i);t%=BASE,o%=BASE}if(a){for(;a>=16;)a-=16,o+=t+=e[s++],o+=t+=e[s++],o+=t+=e[s++],o+=t+=e[s++],o+=t+=e[s++],o+=t+=e[s++],o+=t+=e[s++],o+=t+=e[s++],o+=t+=e[s++],o+=t+=e[s++],o+=t+=e[s++],o+=t+=e[s++],o+=t+=e[s++],o+=t+=e[s++],o+=t+=e[s++],o+=t+=e[s++];for(;a--;)o+=t+=e[s++];t%=BASE,o%=BASE}return t|o<<16}(t,e,s,a)},ZLIB.adler32_combine=function(t,e,s){var a,o,i;return s<0?4294967295:(o=(i=s%=BASE)*(a=65535&t),o%=BASE,(a+=(65535&e)+BASE-1)>=BASE&&(a-=BASE),a>=BASE&&(a-=BASE),(o+=(t>>16&65535)+(e>>16&65535)+BASE-i)>=131042&&(o-=131042),o>=BASE&&(o-=BASE),a|o<<16)},void 0===ZLIB&&alert("ZLIB is not defined. SRC zlib.js before zlib-crc32.js"),function(){var t=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];function e(t,e){var s,a=0;for(s=0;e;)1&e&&(s^=t[a]),e>>=1,a++;return s}function s(t,s){var a;for(a=0;a<32;a++)t[a]=e(s,s[a])}ZLIB.crc32=function(e,s,a,o){return"string"==typeof s?function(e,s,a,o){if(null==s)return 0;for(e^=4294967295;o>=8;)e=t[255&(e^s.charCodeAt(a++))]^e>>>8,e=t[255&(e^s.charCodeAt(a++))]^e>>>8,e=t[255&(e^s.charCodeAt(a++))]^e>>>8,e=t[255&(e^s.charCodeAt(a++))]^e>>>8,e=t[255&(e^s.charCodeAt(a++))]^e>>>8,e=t[255&(e^s.charCodeAt(a++))]^e>>>8,e=t[255&(e^s.charCodeAt(a++))]^e>>>8,e=t[255&(e^s.charCodeAt(a++))]^e>>>8,o-=8;if(o)do{e=t[255&(e^s.charCodeAt(a++))]^e>>>8}while(--o);return 4294967295^e}(e,s,a,o):function(e,s,a,o){if(null==s)return 0;for(e^=4294967295;o>=8;)e=t[255&(e^s[a++])]^e>>>8,e=t[255&(e^s[a++])]^e>>>8,e=t[255&(e^s[a++])]^e>>>8,e=t[255&(e^s[a++])]^e>>>8,e=t[255&(e^s[a++])]^e>>>8,e=t[255&(e^s[a++])]^e>>>8,e=t[255&(e^s[a++])]^e>>>8,e=t[255&(e^s[a++])]^e>>>8,o-=8;if(o)do{e=t[255&(e^s[a++])]^e>>>8}while(--o);return 4294967295^e}(e,s,a,o)},ZLIB.crc32_combine=function(t,a,o){var i,r,n,l;if(o<=0)return t;for(n=new Array(32),(l=new Array(32))[0]=3988292384,r=1,i=1;i<32;i++)l[i]=r,r<<=1;s(n,l),s(l,n);do{if(s(n,l),1&o&&(t=e(n,t)),0==(o>>=1))break;s(l,n),1&o&&(t=e(l,t)),o>>=1}while(0!=o);return t^a}}(),module.exports=ZLIB}},__webpack_module_cache__={};function __nested_webpack_require_78641__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var s=__webpack_module_cache__[t]={exports:{}};return __webpack_modules__[t](s,s.exports,__nested_webpack_require_78641__),s.exports}__nested_webpack_require_78641__.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return __nested_webpack_require_78641__.d(e,{a:e}),e},__nested_webpack_require_78641__.d=(t,e)=>{for(var s in e)__nested_webpack_require_78641__.o(e,s)&&!__nested_webpack_require_78641__.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},__nested_webpack_require_78641__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),__nested_webpack_require_78641__.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var __nested_webpack_exports__={};return(()=>{"use strict";__nested_webpack_require_78641__.r(__nested_webpack_exports__),__nested_webpack_require_78641__.d(__nested_webpack_exports__,{AMTDesktop:()=>t.r,AMTKeyCodeConverter:()=>d.qD,AMTKvmDataRedirector:()=>e.N,AMTRedirector:()=>s.K,AmtTerminal:()=>a.r,CommsHelper:()=>d.Xn,ConsoleLogger:()=>o.k,DataProcessor:()=>c.$,Desktop:()=>r.H,Encoding:()=>p.ez,FrameBufferBellServerCutText:()=>p.Ut,HandshakeState:()=>p.wW,ImageHelper:()=>d.jw,KeyBoardHelper:()=>d.EB,LogLevel:()=>h.i,MouseHelper:()=>d.xx,Protocol:()=>s.b,RLEDecoder:()=>c.X,SecurityOptions:()=>p.ll,SecurityResponse:()=>p.mC,ServerInit:()=>p.Cu,StateProcessorFactory:()=>n.v,TerminalDataProcessor:()=>l.Q,TypeConverter:()=>i.r,isTruthy:()=>d.fQ});var t=__nested_webpack_require_78641__(166),e=__nested_webpack_require_78641__(59),s=__nested_webpack_require_78641__(503),a=__nested_webpack_require_78641__(277),o=__nested_webpack_require_78641__(237),i=__nested_webpack_require_78641__(565),r=__nested_webpack_require_78641__(46),n=__nested_webpack_require_78641__(989),l=__nested_webpack_require_78641__(155),h=__nested_webpack_require_78641__(201),c=__nested_webpack_require_78641__(646),p=__nested_webpack_require_78641__(389),d=__nested_webpack_require_78641__(8)})(),__nested_webpack_exports__})(),module.exports=e()},648:(t,e,s)=>{"use strict";s.d(e,{Z:()=>n});var a=s(213),o=s.n(a),i=s(645),r=s.n(i)()(o());r.push([t.id,".button{margin-right:3px;padding:2px;min-width:90px}",""]);const n=r},625:(t,e,s)=>{"use strict";s.d(e,{Z:()=>n});var a=s(213),o=s.n(a),i=s(645),r=s.n(i)()(o());r.push([t.id,".encoding{margin-left:10px}.encoding label{padding:2px;font-size:15px}.encoding select{padding:2px 0}.reldisabled{opacity:.5}",""]);const n=r},734:(t,e,s)=>{"use strict";s.d(e,{Z:()=>n});var a=s(213),o=s.n(a),i=s(645),r=s.n(i)()(o());r.push([t.id,".header{background-color:#a9a9a9;padding:5px;font-size:13px}",""]);const n=r},250:(t,e,s)=>{"use strict";s.d(e,{Z:()=>n});var a=s(213),o=s.n(a),i=s(645),r=s.n(i)()(o());r.push([t.id,".canvas{max-height:90%;max-width:100%}",""]);const n=r},917:(t,e,s)=>{"use strict";s.d(e,{Z:()=>n});var a=s(213),o=s.n(a),i=s(645),r=s.n(i)()(o());r.push([t.id,"*{margin:0;padding:0;box-sizing:border-box}.canvas-container{height:100vh;text-align:center;background-color:#fff}",""]);const n=r},645:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var s="",a=void 0!==e[5];return e[4]&&(s+="@supports (".concat(e[4],") {")),e[2]&&(s+="@media ".concat(e[2]," {")),a&&(s+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),s+=t(e),a&&(s+="}"),e[2]&&(s+="}"),e[4]&&(s+="}"),s})).join("")},e.i=function(t,s,a,o,i){"string"==typeof t&&(t=[[null,t,void 0]]);var r={};if(a)for(var n=0;n<this.length;n++){var l=this[n][0];null!=l&&(r[l]=!0)}for(var h=0;h<t.length;h++){var c=[].concat(t[h]);a&&r[c[0]]||(void 0!==i&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=i),s&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=s):c[2]=s),o&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=o):c[4]="".concat(o)),e.push(c))}},e}},213:t=>{"use strict";t.exports=function(t){return t[1]}},81:(t,e,s)=>{"use strict";var a=s(379),o=s.n(a),i=s(795),r=s.n(i),n=s(569),l=s.n(n),h=s(565),c=s.n(h),p=s(216),d=s.n(p),u=s(589),v=s.n(u),b=s(648),f={};f.styleTagTransform=v(),f.setAttributes=c(),f.insert=l().bind(null,"head"),f.domAPI=r(),f.insertStyleElement=d(),o()(b.Z,f),b.Z&&b.Z.locals&&b.Z.locals},943:(t,e,s)=>{"use strict";var a=s(379),o=s.n(a),i=s(795),r=s.n(i),n=s(569),l=s.n(n),h=s(565),c=s.n(h),p=s(216),d=s.n(p),u=s(589),v=s.n(u),b=s(625),f={};f.styleTagTransform=v(),f.setAttributes=c(),f.insert=l().bind(null,"head"),f.domAPI=r(),f.insertStyleElement=d(),o()(b.Z,f),b.Z&&b.Z.locals&&b.Z.locals},22:(t,e,s)=>{"use strict";var a=s(379),o=s.n(a),i=s(795),r=s.n(i),n=s(569),l=s.n(n),h=s(565),c=s.n(h),p=s(216),d=s.n(p),u=s(589),v=s.n(u),b=s(734),f={};f.styleTagTransform=v(),f.setAttributes=c(),f.insert=l().bind(null,"head"),f.domAPI=r(),f.insertStyleElement=d(),o()(b.Z,f),b.Z&&b.Z.locals&&b.Z.locals},651:(t,e,s)=>{"use strict";var a=s(379),o=s.n(a),i=s(795),r=s.n(i),n=s(569),l=s.n(n),h=s(565),c=s.n(h),p=s(216),d=s.n(p),u=s(589),v=s.n(u),b=s(250),f={};f.styleTagTransform=v(),f.setAttributes=c(),f.insert=l().bind(null,"head"),f.domAPI=r(),f.insertStyleElement=d(),o()(b.Z,f),b.Z&&b.Z.locals&&b.Z.locals},461:(t,e,s)=>{"use strict";var a=s(379),o=s.n(a),i=s(795),r=s.n(i),n=s(569),l=s.n(n),h=s(565),c=s.n(h),p=s(216),d=s.n(p),u=s(589),v=s.n(u),b=s(917),f={};f.styleTagTransform=v(),f.setAttributes=c(),f.insert=l().bind(null,"head"),f.domAPI=r(),f.insertStyleElement=d(),o()(b.Z,f),b.Z&&b.Z.locals&&b.Z.locals},379:t=>{"use strict";var e=[];function s(t){for(var s=-1,a=0;a<e.length;a++)if(e[a].identifier===t){s=a;break}return s}function a(t,a){for(var i={},r=[],n=0;n<t.length;n++){var l=t[n],h=a.base?l[0]+a.base:l[0],c=i[h]||0,p="".concat(h," ").concat(c);i[h]=c+1;var d=s(p),u={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==d)e[d].references++,e[d].updater(u);else{var v=o(u,a);a.byIndex=n,e.splice(n,0,{identifier:p,updater:v,references:1})}r.push(p)}return r}function o(t,e){var s=e.domAPI(e);return s.update(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;s.update(t=e)}else s.remove()}}t.exports=function(t,o){var i=a(t=t||[],o=o||{});return function(t){t=t||[];for(var r=0;r<i.length;r++){var n=s(i[r]);e[n].references--}for(var l=a(t,o),h=0;h<i.length;h++){var c=s(i[h]);0===e[c].references&&(e[c].updater(),e.splice(c,1))}i=l}}},569:t=>{"use strict";var e={};t.exports=function(t,s){var a=function(t){if(void 0===e[t]){var s=document.querySelector(t);if(window.HTMLIFrameElement&&s instanceof window.HTMLIFrameElement)try{s=s.contentDocument.head}catch(t){s=null}e[t]=s}return e[t]}(t);if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(s)}},216:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},565:(t,e,s)=>{"use strict";t.exports=function(t){var e=s.nc;e&&t.setAttribute("nonce",e)}},795:t=>{"use strict";t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(s){!function(t,e,s){var a="";s.supports&&(a+="@supports (".concat(s.supports,") {")),s.media&&(a+="@media ".concat(s.media," {"));var o=void 0!==s.layer;o&&(a+="@layer".concat(s.layer.length>0?" ".concat(s.layer):""," {")),a+=s.css,o&&(a+="}"),s.media&&(a+="}"),s.supports&&(a+="}");var i=s.sourceMap;i&&"undefined"!=typeof btoa&&(a+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleTagTransform(a,t,e.options)}(e,t,s)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},589:t=>{"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},866:(t,e,s)=>{"use strict";s.d(e,{N:()=>i});var a=s(639),o=s.n(a);s(81);class i extends o().Component{render(){return o().createElement("button",{className:"button",onClick:this.props.handleConnectClick},1===this.props.kvmstate?"Connecting KVM":2===this.props.kvmstate?"Disconnect KVM":"Connect KVM")}}},116:(t,e,s)=>{"use strict";s.d(e,{m:()=>r});var a=s(639),o=s.n(a),i=s(572);class r extends o().Component{constructor(t){super(t),this.desktopsettings={encoding:1},this.changeEncoding=this.changeEncoding.bind(this)}changeEncoding(t){this.desktopsettings.encoding=t,this.props.changeDesktopSettings(this.desktopsettings)}render(){return o().createElement(i.S,{changeEncoding:this.changeEncoding,getConnectState:this.props.getConnectState})}}},572:(t,e,s)=>{"use strict";s.d(e,{S:()=>i});var a=s(639),o=s.n(a);s(943);class i extends o().Component{constructor(t){super(t),this.state={value:1},this.onEncodingChange=this.onEncodingChange.bind(this)}onEncodingChange(t){this.setState({value:t.target.value}),this.props.changeEncoding(t.target.value)}render(){return o().createElement("span",{className:"encoding"},o().createElement("label",null,"Encoding:"),o().createElement("select",{value:this.state.value,className:2===this.props.getConnectState()?"reldisabled":"",onChange:this.onEncodingChange,disabled:2===this.props.getConnectState()},o().createElement("option",{value:"1"},"RLE 8"),o().createElement("option",{value:"2"},"RLE 16")))}}},9:(t,e,s)=>{"use strict";s.d(e,{h:()=>n});var a=s(639),o=s.n(a),i=s(866),r=s(116);s(22);class n extends o().Component{render(){return o().createElement(o().Fragment,null,o().createElement("div",{className:"header"},o().createElement(i.N,{handleConnectClick:this.props.handleConnectClick,kvmstate:this.props.kvmstate}),o().createElement(r.m,{changeDesktopSettings:this.props.changeDesktopSettings,getConnectState:this.props.getConnectState})))}}},568:(t,e,s)=>{"use strict";s.d(e,{U:()=>r});var a=s(639),o=s.n(a),i=s(518);s(651);class r extends o().Component{shouldComponentUpdate(){return!1}render(){const t={width:"1366",height:"768",onContextMenu:t=>(t.preventDefault(),!1),onMouseDown:this.props.mouseDown,onMouseUp:this.props.mouseUp,onMouseMove:this.props.mouseMove};return o().createElement("canvas",Object.assign({},t,{"data-testid":"pure-canvas-testid",className:"canvas",ref:t=>(0,i.X0)(t)?this.props.contextRef(t.getContext("2d")):null}))}}},518:(t,e,s)=>{"use strict";s.d(e,{X0:()=>a});const a=t=>null!=t&&""!==t&&!1!==t&&0!==t},639:t=>{"use strict";t.exports=__WEBPACK_EXTERNAL_MODULE__639__}},__webpack_module_cache__={};function __webpack_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var s=__webpack_module_cache__[t]={id:t,exports:{}};return __webpack_modules__[t](s,s.exports,__webpack_require__),s.exports}__webpack_require__.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return __webpack_require__.d(e,{a:e}),e},__webpack_require__.d=(t,e)=>{for(var s in e)__webpack_require__.o(e,s)&&!__webpack_require__.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},__webpack_require__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),__webpack_require__.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},__webpack_require__.nc=void 0;var __webpack_exports__={};return(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{KVM:()=>r});var t=__webpack_require__(869),e=__webpack_require__(9),s=__webpack_require__(568),a=__webpack_require__(518),o=__webpack_require__(639),i=__webpack_require__.n(o);__webpack_require__(461);class r extends i().Component{constructor(e){super(e),this.desktopSettingsChange=!1,this.state={kvmstate:0,encodingOption:1},this.logger=new t.ConsoleLogger(t.LogLevel.ERROR),this.saveContext=this.saveContext.bind(this),this.startKVM=this.startKVM.bind(this),this.stopKVM=this.stopKVM.bind(this),this.handleConnectClick=this.handleConnectClick.bind(this),this.getRenderStatus=this.getRenderStatus.bind(this),this.OnConnectionStateChange=this.OnConnectionStateChange.bind(this),this.changeDesktopSettings=this.changeDesktopSettings.bind(this)}saveContext(t){this.logger.debug("save context called"),this.ctx=t,this.init()}init(){const e=null!=this.props.deviceId?this.props.deviceId:"",s=null!=this.props.mpsServer?this.props.mpsServer.replace("http","ws"):"";this.module=new t.AMTDesktop(this.logger,this.ctx),this.redirector=new t.AMTKvmDataRedirector(this.logger,t.Protocol.KVM,new FileReader,e,16994,"","",0,0,this.props.authToken,s),this.dataProcessor=new t.DataProcessor(this.logger,this.redirector,this.module),this.mouseHelper=new t.MouseHelper(this.module,this.redirector,this.props.mouseDebounceTime<200?200:this.props.mouseDebounceTime),this.keyboard=new t.KeyBoardHelper(this.module,this.redirector),this.redirector.onProcessData=this.module.processData.bind(this.module),this.redirector.onStart=this.module.start.bind(this.module),this.redirector.onNewState=this.module.onStateChange.bind(this.module),this.redirector.onSendKvmData=this.module.onSendKvmData.bind(this.module),this.redirector.onStateChanged=this.OnConnectionStateChange.bind(this),this.redirector.onError=this.onRedirectorError.bind(this),this.module.onSend=this.redirector.send.bind(this.redirector),this.module.onProcessData=this.dataProcessor.processData.bind(this.dataProcessor),this.module.bpp=this.state.encodingOption}cleanUp(){this.module=null,this.redirector=null,this.dataProcessor=null,this.mouseHelper=null,this.keyboard=null,this.ctx.clearRect(0,0,this.ctx.canvas.height,this.ctx.canvas.width)}componentWillUnmount(){this.stopKVM()}onRedirectorError(){this.reset()}reset(){this.cleanUp(),this.init()}OnConnectionStateChange(t,e){this.setState({kvmstate:e}),this.desktopSettingsChange&&0===e&&(this.desktopSettingsChange=!1,setTimeout((()=>this.startKVM()),2e3))}changeDesktopSettings(t){2===this.state.kvmstate?(this.desktopSettingsChange=!0,this.module.bpp=t.encoding,this.stopKVM()):(this.setState({encodingOption:parseInt(t.encoding)}),this.module.bpp=parseInt(t.encoding))}startKVM(){void 0!==this.redirector&&this.redirector.start(WebSocket),void 0!==this.keyboard&&this.keyboard.GrabKeyInput()}stopKVM(){void 0!==this.redirector&&this.redirector.stop(),void 0!==this.keyboard&&this.keyboard.UnGrabKeyInput(),this.reset()}getRenderStatus(){return this.module.state}handleConnectClick(t){t.persist(),0===this.state.kvmstate?this.startKVM():1===this.state.kvmstate||2===this.state.kvmstate&&this.stopKVM()}componentDidUpdate(t){t.deviceId!==this.props.deviceId&&this.stopKVM()}render(){return i().createElement("div",{className:"canvas-container"},(0,a.X0)(this.props.autoConnect)?"":i().createElement(e.h,{key:"kvm_header",handleConnectClick:this.handleConnectClick,getConnectState:()=>this.state.kvmstate,kvmstate:this.state.kvmstate,changeDesktopSettings:this.changeDesktopSettings,deviceId:this.props.deviceId,server:this.props.mpsServer}),i().createElement(s.U,{key:"kvm_comp",contextRef:t=>this.saveContext(t),canvasHeight:this.props.canvasHeight,canvasWidth:this.props.canvasWidth,mouseMove:t=>{void 0!==this.mouseHelper&&this.mouseHelper.mousemove(t)},mouseDown:t=>{void 0!==this.mouseHelper&&this.mouseHelper.mousedown(t)},mouseUp:t=>{void 0!==this.mouseHelper&&this.mouseHelper.mouseup(t)}}))}}})(),__webpack_exports__})()));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["React"],e):"object"==typeof exports?exports["ui-toolkit/reactjs/kvm"]=e(require("react")):t["ui-toolkit/reactjs/kvm"]=e(t.React)}(self,(__WEBPACK_EXTERNAL_MODULE__639__=>(()=>{var __webpack_modules__={869:module=>{var e;self,e=()=>(()=>{var __webpack_modules__={40:(t,e,s)=>{"use strict";s.d(e,{r:()=>h});var a=s(512),i=s(995),r=s(932),o=s(305),n=s.n(o);class h extends a.H{constructor(t){super(),this.protocol=2,this.inflate=n().inflateInit(15),this.bpp=1,this.state=0,this.focusMode=0,this.useZRLE=!0,this.frameRateDelay=2,this.canvasCtx=t,this.sparecache={},this.buttonmask=0,this.canvasControl=this.canvasCtx.canvas,this.lastMouseMoveTime=(new Date).getTime(),this.setDeskFocus=(t,e)=>{},this.getDeskFocus=t=>{}}processData(t){this.onProcessData(t)}onStateChange(t){0===t&&(this.canvasCtx.fillStyle="#FFFFFF",this.canvasCtx.fillRect(0,0,this.canvasCtx.canvas.width,this.canvasCtx.canvas.width))}start(){this.state=0,this.inflate.inflateReset(),this.onKvmDataPending=[],this.onKvmDataAck=-1,this.kvmDataSupported=!1;for(const t in this.sparecache)delete this.sparecache[t]}onSendKvmData(t){!0!==this.onKvmDataAck?this.onKvmDataPending.push(t):((0,r.f)(this.urlvars)&&(0,r.f)(this.urlvars.kvmdatatrace),t="\0KvmDataChannel\0"+t,this.onSend(String.fromCharCode(6,0,0,0)+i.r.IntToStr(t.length)+t),this.onKvmDataAck=!1)}}},382:(t,e,s)=>{"use strict";s.d(e,{i:()=>o});var a=s(995),i=s(609),r=s(77);class o{constructor(t,e,s){this.protocol=3,this.bytesToAmt=0,this.bytesFromAmt=0,this.floppyRead=0,this.floppyWrite=0,this.cdromRead=0,this.cdromWrite=0,this.rx_timeout=3e4,this.tx_timeout=0,this.heartbeat=2e4,this.version=1,this.acc="",this.inSequence=0,this.outSequence=0,this.enabled=!1,this.iderStart=0,this.floppyReady=!1,this.cdromReady=!1,this.sectorStats=null,this.g_readQueue=[],this.g_reset=!1,this.g_media=null,this.amtRedirector=t,this.floppy=s,this.cdrom=e,this.dataProcessor=new i.S(this)}stateChange(t){0===t&&this.stop(),3===t&&this.start()}start(){this.bytesToAmt=0,this.bytesFromAmt=0,this.floppyRead=0,this.floppyWrite=0,this.cdromRead=0,this.cdromWrite=0,this.inSequence=0,this.outSequence=0,this.g_readQueue=[],this.sendCommand(64,a.r.ShortToStrX(this.rx_timeout)+a.r.ShortToStrX(this.tx_timeout)+a.r.ShortToStrX(this.heartbeat)+a.r.IntToStrX(this.version)),"function"==typeof this.sectorStats&&(this.sectorStats(0,0,null!=this.floppy?this.floppy.size>>9:0,0,0),this.sectorStats(0,1,null!=this.cdrom?this.cdrom.size>>11:0,0,0))}stop(){this.amtRedirector.stop()}processData(t){for(this.bytesFromAmt+=t.length,this.acc+=t;;){if(this.acc.length<8)return;const t=this.acc.charCodeAt(0),e=this.dataProcessor.interpretCommandData(t);if(0===e)return;if(this.inSequence!==a.r.ReadIntX(this.acc,4))return void this.stop();this.inSequence++,this.acc=this.acc.substring(e)}}sendCommand(t,e="",s,i){let r=t>50&&!0===s?2:0;null!=i&&(r+=1);const o=String.fromCharCode(t,0,0,r)+a.r.IntToStrX(this.outSequence++)+e;this.amtRedirector.socketSend(o),this.bytesToAmt+=o.length}sendCommandEndResponse(t,e,s,a=0,i=0){t?this.sendCommand(81,String.fromCharCode(0,0,0,0,0,0,0,0,0,0,0,0,197,0,3,0,0,0,s,80,0,0,0),!0):this.sendCommand(81,String.fromCharCode(0,0,0,0,0,0,0,0,0,0,0,0,135,e<<4,3,0,0,0,s,81,e,a,i),!0)}sendDataToHost(t,e,s,a){const i=0!==a?0:s.length;e?this.sendCommand(84,String.fromCharCode(0,255&s.length,s.length>>8,0,0!==a?180:181,0,2,0,255&i,i>>8,t,88,133,0,3,0,0,0,t,80,0,0,0,0,0,0)+s,e,a):this.sendCommand(84,String.fromCharCode(0,255&s.length,s.length>>8,0,0!==a?180:181,0,2,0,255&i,i>>8,t,88,0,0,0,0,0,0,0,0,0,0,0,0,0,0)+s,e,a)}sendGetDataFromHost(t,e){this.sendCommand(82,String.fromCharCode(0,255&e,e>>8,0,181,0,0,0,255&e,e>>8,t,88,0,0,0,0,0,0,0,0,0,0,0),!1)}sendDisableEnableFeatures(t=""){this.sendCommand(72,String.fromCharCode(r.rw)+t)}sendDiskData(t,e,s,a){let i,r=0;160===t?(i=this.floppy,null!=this.floppy&&(r=this.floppy.size>>9)):(i=this.cdrom,null!=this.cdrom&&(r=this.cdrom.size>>11)),s<0||e+s>r?this.sendCommandEndResponse(!0,5,t,33,0):0!==s?("function"==typeof this.sectorStats&&this.sectorStats(1,160===t?0:1,r,e,s),160===t?(e<<=9,s<<=9):(e<<=11,s<<=11),null!==this.g_media?this.g_readQueue.push({media:i,dev:t,lba:e,len:s,fr:a}):(this.g_media=i,this.g_dev=t,this.g_lba=e,this.g_len=s,this.sendDiskDataEx(a))):this.sendCommandEndResponse(!0,0,t,0,0)}sendDiskDataEx(t){let e=this.g_len;const s=this.g_lba;this.g_len>this.iderinfo.readbfr&&(e=this.iderinfo.readbfr),this.g_len-=e,this.g_lba+=e;const i=new FileReader;i.onload=()=>{let e=i.result;if("object"==typeof e&&(e=a.r.arrToStr(new Uint8Array(e))),this.sendDataToHost(this.g_dev,0===this.g_len,e,1&t),this.g_len>0&&!this.g_reset)this.sendDiskDataEx(t);else if(this.g_media=null,this.g_reset)this.sendCommand(71),this.g_readQueue=[],this.g_reset=!1;else if(this.g_readQueue.length>0){const t=this.g_readQueue.shift();this.g_media=t.media,this.g_dev=t.dev,this.g_lba=t.lba,this.g_len=t.len,this.sendDiskDataEx(t.fr)}},null!=i.readAsBinaryString?i.readAsBinaryString(this.g_media.slice(s,s+e)):i.readAsArrayBuffer(this.g_media.slice(s,s+e))}}},986:(t,e,s)=>{"use strict";s.d(e,{N:()=>i});var a=s(198);class i extends a.K{constructor(t){super(t)}}},198:(t,e,s)=>{"use strict";s.d(e,{K:()=>h,b:()=>a});var a,i=s(995),r=s(568),o=s.n(r),n=s(932);!function(t){t[t.SOL=1]="SOL",t[t.KVM=2]="KVM",t[t.IDER=3]="IDER"}(a||(a={}));class h{constructor(t){var e;this.fileReader=t.fr,this.fileReaderInUse=!1,this.fileReaderAcc=[],this.randomNonceChars="abcdef0123456789",this.host=t.host,this.port=t.port,this.user=t.user,this.pass=t.pass,this.tls=t.tls,this.mode=null!==(e=t.mode)&&void 0!==e?e:"",this.tlsv1only=t.tls1only,this.protocol=t.protocol,this.RedirectStartSol=String.fromCharCode(16,0,0,0,83,79,76,32),this.RedirectStartKvm=String.fromCharCode(16,1,0,0,75,86,77,82),this.RedirectStartIder=String.fromCharCode(16,0,0,0,73,68,69,82),this.urlvars={},this.server=t.server,this.amtAccumulator="",this.authUri="",this.authToken=t.authToken}getWsLocation(){return this.isBrowser()&&!(0,n.f)(this.server)?`${window.location.protocol.replace("http","ws")}//\n ${window.location.host}\n ${window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))}\n /webrelay.ashx?p=2&host=${this.host}&port=${this.port}&tls=${this.tls}${"*"===this.user?"&serverauth=1":""}${void 0===this.pass?"&serverauth=1&user="+this.user:""}&tls1only=${this.tlsv1only}&mode=${this.mode}`:`${String(this.server)}/webrelay.ashx?p=2&host=${this.host}&port=${this.port}&tls=${this.tls}${"*"===this.user?"&serverauth=1":""}${void 0===this.pass?"&serverauth=1&user="+this.user:""}&tls1only=${this.tlsv1only}&mode=${this.mode}`}isBrowser(){try{return"undefined"!=typeof window}catch(t){return!1}}start(t){this.connectState=0,this.socket=new t(this.getWsLocation(),this.authToken),this.socket.onopen=this.onSocketConnected.bind(this),this.socket.onmessage=this.onMessage.bind(this),this.socket.onclose=this.onSocketClosed.bind(this),(0,n.f)(this.fileReader)&&(0,n.f)((()=>this.fileReader.readAsBinaryString.bind(this)))?this.fileReader.onload=(t=>{this.onSocketData(t.target.result),0===this.fileReaderAcc.length?this.fileReaderInUse=!1:this.fileReader.readAsBinaryString(new Blob([this.fileReaderAcc.shift()]))}).bind(this):(0,n.f)(this.fileReader)&&(0,n.f)((()=>this.fileReader.readAsArrayBuffer.bind(this)))&&(this.fileReader.onloadend=(t=>{this.onSocketData(t.target.result),0===this.fileReaderAcc.length?this.fileReaderInUse=!1:this.fileReader.readAsArrayBuffer(this.fileReaderAcc.shift())}).bind(this)),this.onStateChange(1)}onSocketConnected(){(0,n.f)(this.urlvars)&&(0,n.f)(this.urlvars.redirtrace),this.onStateChange(2),this.protocol===a.SOL&&this.socketSend(this.RedirectStartSol),this.protocol===a.KVM&&this.socketSend(this.RedirectStartKvm),this.protocol===a.IDER&&this.socketSend(this.RedirectStartIder)}onMessage(t){try{if(this.inDataCount++,"object"==typeof t.data){if(this.fileReaderInUse)return void this.fileReaderAcc.push(t.data);if(null!=this.fileReader.readAsBinaryString)this.fileReaderInUse=!0,this.fileReader.readAsBinaryString(new Blob([t.data]));else if(null!=this.fileReader.readAsArrayBuffer)this.fileReaderInUse=!0,this.fileReader.readAsArrayBuffer(t.data);else{let e="";const s=new Uint8Array(t.data),a=s.byteLength;for(let t=0;t<a;t++)e+=String.fromCharCode(s[t]);this.onSocketData(e)}}else this.onSocketData(t.data)}catch(t){console.error(t),this.stop(),this.onError()}}onSocketData(t){if((0,n.f)(t)&&-1!==this.connectState){if("object"==typeof t){let e="";const s=new Uint8Array(t),a=s.byteLength;for(let t=0;t<a;t++)e+=String.fromCharCode(s[t]);t=e}else if("string"!=typeof t)return;if(this.protocol!==a.KVM&&this.protocol!==a.IDER||1!==this.connectState)for(this.amtAccumulator+=t;this.amtAccumulator.length>=1;){let t=0;switch(this.amtAccumulator.charCodeAt(0)){case 17:if(this.amtAccumulator.length<4)return;switch(this.amtAccumulator.charCodeAt(1)){case 0:{if(this.amtAccumulator.length<13)return;const e=this.amtAccumulator.charCodeAt(12);if(this.amtAccumulator.length<13+e)return;this.socketSend(String.fromCharCode(19,0,0,0,0,0,0,0,0)),t=13+e;break}default:this.stop()}break;case 20:{if(this.amtAccumulator.length<9)return;const e=i.r.ReadIntX(this.amtAccumulator,5);if(this.amtAccumulator.length<9+e)return;const s=this.amtAccumulator.charCodeAt(1),a=this.amtAccumulator.charCodeAt(4),r=[];for(let t=0;t<e;t++)r.push(this.amtAccumulator.charCodeAt(9+t));const o=this.amtAccumulator.substring(9,9+e);if(t=9+e,0===a)(0,n.f)(r.includes(4))?this.socketSend(String.fromCharCode(19,0,0,0,4)+i.r.IntToStrX(this.user.length+this.authUri.length+8)+String.fromCharCode(this.user.length)+this.user+String.fromCharCode(0,0)+String.fromCharCode(this.authUri.length)+this.authUri+String.fromCharCode(0,0,0,0)):(0,n.f)(r.includes(3))?(console.warn("Bad Digest Auth"),this.socketSend(String.fromCharCode(19,0,0,0,3)+i.r.IntToStrX(this.user.length+this.authUri.length+7)+String.fromCharCode(this.user.length)+this.user+String.fromCharCode(0,0)+String.fromCharCode(this.authUri.length)+this.authUri+String.fromCharCode(0,0,0))):(0,n.f)(r.includes(1))?this.socketSend(String.fromCharCode(19,0,0,0,1)+i.r.IntToStrX(this.user.length+this.pass.length+2)+String.fromCharCode(this.user.length)+this.user+String.fromCharCode(this.pass.length)+this.pass):(console.error("Auth Type not recognized. Stopping."),this.stop());else if(3!==a&&4!==a||1!==s)if(0===s){if(1===this.protocol){const t=1e4,e=100,s=0,a=1e4,r=100,o=0;this.socketSend(String.fromCharCode(32,0,0,0)+i.r.IntToStrX(this.amtSequence++)+i.r.ShortToStrX(t)+i.r.ShortToStrX(e)+i.r.ShortToStrX(s)+i.r.ShortToStrX(a)+i.r.ShortToStrX(r)+i.r.ShortToStrX(o)+i.r.IntToStrX(0))}2===this.protocol&&this.socketSend(String.fromCharCode(64,0,0,0,0,0,0,0)),3===this.protocol&&(this.connectState=1,this.onStateChange(3))}else this.stop();else{let t=0;const e=o.charCodeAt(t),s=o.substring(t+1,t+1+e);t+=e+1;const r=o.charCodeAt(t),n=o.substring(t+1,t+1+r);t+=r+1;let h=0,l=null;const d=this.generateRandomNonce(32),c="00000002";let p="";4===a&&(h=o.charCodeAt(t),l=o.substring(t+1,t+1+h),t+=h+1,p=`${c}:${d}:${String(l)} :`);const u=this.hex_md5(this.hex_md5(this.user+":"+s+":"+this.pass)+":"+n+":"+p+this.hex_md5("POST:"+this.authUri));let b=this.user.length+s.length+n.length+this.authUri.length+d.length+c.length+u.length+7;4===a&&(b+=parseInt(l.length)+1);let v=String.fromCharCode(19,0,0,0,a)+i.r.IntToStrX(b)+String.fromCharCode(this.user.length)+this.user+String.fromCharCode(s.length)+s+String.fromCharCode(n.length)+n+String.fromCharCode(this.authUri.length)+this.authUri+String.fromCharCode(d.length)+d+String.fromCharCode(c.length)+c+String.fromCharCode(u.length)+u;4===a&&(v=String(v)+(String.fromCharCode(l.length)+String(l))),this.socketSend(v)}break}case 33:if(this.amtAccumulator.length<23)break;t=23,this.socketSend(String.fromCharCode(39,0,0,0)+i.r.IntToStrX(this.amtSequence++)+String.fromCharCode(0,0,27,0,0,0)),1===this.protocol&&(this.amtKeepAliveTimer=setInterval(this.sendAmtKeepAlive.bind(this),2e3)),this.connectState=1,this.onStateChange(3);break;case 41:if(this.amtAccumulator.length<10)break;t=10;break;case 42:{if(this.amtAccumulator.length<10)break;const e=10+((255&this.amtAccumulator.charCodeAt(9))<<8)+(255&this.amtAccumulator.charCodeAt(8));if(this.amtAccumulator.length<e)break;this.onProcessData(this.amtAccumulator.substring(10,e)),t=e;break}case 43:if(this.amtAccumulator.length<8)break;t=8;break;case 65:if(this.amtAccumulator.length<8)break;this.connectState=1,this.onStart(),this.amtAccumulator.length>8&&this.onProcessData(this.amtAccumulator.substring(8)),t=this.amtAccumulator.length;break;default:return console.error(`Unknown Intel AMT command: ${this.amtAccumulator.charCodeAt(0)} acclen=${this.amtAccumulator.length}`),void this.stop()}if(0===t)return;this.amtAccumulator=this.amtAccumulator.substring(t)}else this.onProcessData(t)}}hex_md5(t){return o()(t)}socketSend(t){(0,n.f)(this.urlvars)&&(0,n.f)(this.urlvars.redirtrace);try{if(null!=this.socket&&1===this.socket.readyState){const e=new Uint8Array(t.length);for(let s=0;s<t.length;++s)e[s]=t.charCodeAt(s);this.socket.send(e.buffer)}}catch(t){console.error(`Socket send error: ${String(t)}`)}}send(t){null!=this.socket&&1===this.connectState&&(this.protocol===a.SOL?this.socketSend(String.fromCharCode(40,0,0,0)+i.r.IntToStrX(this.amtSequence++)+i.r.ShortToStrX(t.length)+t):this.socketSend(t))}sendAmtKeepAlive(){null!=this.socket&&this.socketSend(String.fromCharCode(43,0,0,0)+i.r.IntToStrX(this.amtSequence++))}generateRandomNonce(t){let e="";for(let s=0;s<t;s++)e+=this.randomNonceChars.charAt(Math.floor(Math.random()*this.randomNonceChars.length));return e}onSocketClosed(t){(0,n.f)(this.urlvars)&&(0,n.f)(this.urlvars.redirtrace),console.warn("Redir Socket Closed"),this.stop()}onStateChange(t){this.state!==t&&(this.state=t,this.onNewState(this.state),null!=this.onStateChanged&&this.onStateChanged(this,this.state))}stop(){console.warn("Stop called on Redirector. Change state to 0 and close Socket."),this.onStateChange(0),this.connectState=-1,this.amtAccumulator="",null!=this.socket&&(this.socket.close(),this.socket=null),null!=this.amtKeepAliveTimer&&(clearInterval(this.amtKeepAliveTimer),this.amtKeepAliveTimer=null)}}},567:(t,e,s)=>{"use strict";s.d(e,{r:()=>a});class a{constructor(){this.terminalEmulation=1,this.fxEmulation=0,this.fxLineBreak=0,this.AsciiToUnicode=[199,252,233,226,228,224,229,231,234,235,232,239,238,236,196,197,201,230,198,244,246,242,251,249,255,214,220,162,163,165,8359,402,225,237,243,250,241,209,170,218,191,8976,172,189,188,161,171,187,9619,9618,9617,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488,9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575,9576,9572,9573,9576,9560,9554,9555,9579,9578,9496,9484,9608,9604,9611,9616,9600,945,223,915,960,931,963,181,964,966,952,8486,948,8734,248,949,8719,8801,177,8805,8806,8992,8993,247,8776,176,8226,183,8730,8319,178,8718,160],this.AsciiToUnicodeIntel=[199,252,233,226,228,224,229,231,234,235,232,239,238,236,196,197,201,230,198,244,246,242,251,249,255,214,220,162,163,165,8359,402,225,237,243,250,241,209,170,218,191,8976,172,189,188,161,174,187,9619,9618,9617,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488,9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575,9576,9572,9573,9576,9560,9554,9555,9579,9578,9496,9484,9608,9604,9611,9616,9600,945,223,915,960,931,963,181,964,966,952,8486,948,8734,248,949,8719,8801,177,8805,8806,8992,8993,247,8776,176,8226,183,8730,8319,178,8718,160],this.StateChange=t=>{},this.TermSendKeys=t=>{this.onSend(t)}}}},77:(t,e,s)=>{"use strict";s.d(e,{$9:()=>i,A_:()=>o,dv:()=>r,lq:()=>n,nX:()=>h,rw:()=>a});const a=3,i={MSLS120DiskPage:()=>String.fromCharCode(0,38,49,128,0,0,0,0,5,30,16,169,8,32,2,0,3,195,0,0,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,2,208,0,0),MS3FLS120:()=>String.fromCharCode(0,92,36,128,0,0,0,0,1,10,0,1,0,0,0,0,2,0,0,0,3,22,0,160,0,0,0,0,0,18,2,0,0,0,0,0,0,0,160,0,0,0,5,30,16,169,8,32,2,0,3,195,0,0,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,2,208,0,0,8,10,0,0,0,0,0,0,0,0,0,0,11,6,0,0,0,17,36,49),MSFloppyDiskPage:()=>String.fromCharCode(0,38,36,128,0,0,0,0,5,30,4,176,2,18,2,0,0,80,0,0,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,2,208,0,0),MS3FFloppy:()=>String.fromCharCode(0,92,36,128,0,0,0,0,1,10,0,1,0,0,0,0,2,0,0,0,3,22,0,160,0,0,0,0,0,18,2,0,0,0,0,0,0,0,160,0,0,0,5,30,4,176,2,18,2,0,0,80,0,0,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,2,208,0,0,8,10,0,0,0,0,0,0,0,0,0,0,11,6,0,0,0,17,36,49),MSCD1A:()=>String.fromCharCode(0,18,1,128,0,0,0,0,26,10,0,0,0,0,0,0,0,0,0,0),MSCD1D:()=>String.fromCharCode(0,18,1,128,0,0,0,0,29,10,0,0,0,0,0,0,0,0,0,0),MSCD2A:()=>String.fromCharCode(0,32,1,128,0,0,0,0,42,24,0,0,0,0,32,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0),MS3FCD:()=>String.fromCharCode(0,40,1,128,0,0,0,0,1,6,0,255,0,0,0,0,42,24,0,0,0,0,2,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0)},r={Header:()=>String.fromCharCode(0,0,0,40,0,0,0,8),ProfileList:()=>String.fromCharCode(0,0,3,4,0,8,1,0),Core:()=>String.fromCharCode(0,1,3,4,0,0,0,2),Removable:()=>String.fromCharCode(0,3,3,4,41,0,0,2),Random:()=>String.fromCharCode(0,16,1,8,0,0,8,0,0,1,0,0)},o={Morphing:()=>String.fromCharCode(0,2,3,4,0,0,0,0),Read:()=>String.fromCharCode(0,30,3,0),PowerManagement:()=>String.fromCharCode(1,0,3,0),Timeout:()=>String.fromCharCode(1,5,3,0)},n={FloppyError:()=>String.fromCharCode(0,18,36,128,0,0,0,0,1,10,0,1,0,0,0,0,2,0,0,0),Ls120Error:()=>String.fromCharCode(0,18,49,128,0,0,0,0,1,10,0,1,0,0,0,0,2,0,0,0),CDError:()=>String.fromCharCode(0,14,1,128,0,0,0,0,1,6,0,255,0,0,0,0)},h={DiskInfo:()=>String.fromCharCode(0,32,14,1,1,1,1,32,255,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0),Performance:()=>String.fromCharCode(0,0,0,4,2,0,0,0)}},995:(t,e,s)=>{"use strict";s.d(e,{r:()=>i});var a=s(932);const i={ReadShort:(t,e)=>(t.charCodeAt(e)<<8)+t.charCodeAt(e+1),ReadShortX:(t,e)=>(t.charCodeAt(e+1)<<8)+t.charCodeAt(e),ReadInt:(t,e)=>16777216*t.charCodeAt(e)+(t.charCodeAt(e+1)<<16)+(t.charCodeAt(e+2)<<8)+t.charCodeAt(e+3),ReadSInt:(t,e)=>(t.charCodeAt(e)<<24)+(t.charCodeAt(e+1)<<16)+(t.charCodeAt(e+2)<<8)+t.charCodeAt(e+3),ReadIntX:(t,e)=>16777216*t.charCodeAt(e+3)+(t.charCodeAt(e+2)<<16)+(t.charCodeAt(e+1)<<8)+t.charCodeAt(e),ShortToStr:t=>String.fromCharCode(t>>8&255,255&t),ShortToStrX:t=>String.fromCharCode(255&t,t>>8&255),IntToStr:t=>String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t),IntToStrX:t=>String.fromCharCode(255&t,t>>8&255,t>>16&255,t>>24&255),SplitArray:t=>t.split(","),Clone:t=>JSON.parse(JSON.stringify(t)),EscapeHtml:t=>"string"==typeof t?t.replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/"/g,""").replace(/'/g,"'"):"boolean"==typeof t||"number"==typeof t?t:void 0,ArrayElementMove(t,e,s){t.splice(s,0,t.splice(e,1)[0])},ObjectToStringEx(t,e){let s="";if(0!==t&&(!(0,a.f)(t)||null==t))return"(Null)";if(t instanceof Array)for(const a in t)s=s+"<br />"+String(this.gap(e))+"Item #"+String(a)+": "+String(this.ObjectToStringEx(t[a],e+1));else if(t instanceof Object)for(const a in t)s=s+"<br />"+String(this.gap(e))+String(a)+" = "+String(this.ObjectToStringEx(t[a],e+1));else s+=String(this.EscapeHtml(t));return s},ObjectToStringEx2(t,e){let s="";if(0!==t&&(!(0,a.f)(t)||null==t))return"(Null)";if(t instanceof Array)for(const a in t)s=s+"\r\n"+String(this.gap2(e))+"Item #"+String(a)+": "+String(this.ObjectToStringEx2(t[a],e+1));else if(t instanceof Object)for(const a in t)s=s+"\r\n"+String(this.gap2(e))+String(a)+" = "+String(this.ObjectToStringEx2(t[a],e+1));else s+=String(this.EscapeHtml(t));return s},gap(t){let e="";for(let s=0;s<4*t;s++)e+=" ";return e},gap2(t){let e="";for(let s=0;s<4*t;s++)e+=" ";return e},ObjectToString(t){return this.ObjectToStringEx(t,0)},ObjectToString2(t){return this.ObjectToStringEx2(t,0)},char2hex:t=>(t+256).toString(16).substr(-2).toUpperCase(),rstr2hex(t){let e,s="";for(e=0;e<t.length;e++)s+=String(this.char2hex(t.charCodeAt(e)));return s},encode_utf8:t=>unescape(encodeURIComponent(t)),decode_utf8:t=>decodeURIComponent(escape(t)),data2blob(t){const e=new Array(t.length);for(let s=0;s<t.length;s++)e[s]=t.charCodeAt(s);return new Blob([new Uint8Array(e)])},random:t=>Math.floor(Math.random()*t),trademarks:t=>t.replace(/\(R\)/g,"®").replace(/\(TM\)/g,"™"),arrToStr:t=>String.fromCharCode.apply(null,t)}},512:(t,e,s)=>{"use strict";s.d(e,{H:()=>a});class a{processData(t){}onStateChange(t){}start(){}onSendKvmData(t){}}},609:(t,e,s)=>{"use strict";s.d(e,{S:()=>r});var a=s(995),i=s(77);class r{constructor(t){this.ider=t}interpretCommandData(t){switch(t){case 65:return this.processOpenSessionCommand();case 67:return this.processCloseCommand();case 68:return this.ider.sendCommand(69),8;case 69:return this.processPongCommand();case 70:return this.processResetOccurredCommand();case 73:return this.processStatusDataCommand();case 74:return this.processErrorOccurredCommand();case 75:return this.processHeartbeatCommand();case 80:return this.processWrittenCommand();case 83:return this.processDataFromHostCommand();default:return console.error("Unknown IDER command",t),this.ider.stop(),0}}processOpenSessionCommand(){if(this.ider.acc.length<30)return 0;const t=this.ider.acc.charCodeAt(29);return this.ider.acc.length<30+t?0:(this.ider.iderinfo={major:this.ider.acc.charCodeAt(8),minor:this.ider.acc.charCodeAt(9),fwmajor:this.ider.acc.charCodeAt(10),fwminor:this.ider.acc.charCodeAt(11),readbfr:a.r.ReadShortX(this.ider.acc,16),writebfr:a.r.ReadShortX(this.ider.acc,18),proto:this.ider.acc.charCodeAt(21),iana:a.r.ReadIntX(this.ider.acc,25)},0!==this.ider.iderinfo.proto&&this.ider.stop(),this.ider.iderinfo.readbfr>8192&&this.ider.stop(),this.ider.iderinfo.writebfr>8192&&this.ider.stop(),0===this.ider.iderStart?this.ider.sendDisableEnableFeatures(a.r.IntToStrX(9)):1===this.ider.iderStart?this.ider.sendDisableEnableFeatures(a.r.IntToStrX(17)):2===this.ider.iderStart&&this.ider.sendDisableEnableFeatures(a.r.IntToStrX(25)),30+t)}processCloseCommand(){return this.ider.stop(),8}processPongCommand(){return 8}processResetOccurredCommand(){return this.ider.acc.length<9?0:(this.ider.acc.charCodeAt(8),null===this.ider.g_media?this.ider.sendCommand(71):this.ider.g_reset=!0,9)}processStatusDataCommand(){if(this.ider.acc.length<13)return 0;const t=this.ider.acc.charCodeAt(8),e=a.r.ReadIntX(this.ider.acc,9);switch(t){case 1:0!=(1&e)&&(0===this.ider.iderStart?this.ider.sendDisableEnableFeatures(a.r.IntToStrX(9)):1===this.ider.iderStart?this.ider.sendDisableEnableFeatures(a.r.IntToStrX(17)):2===this.ider.iderStart&&this.ider.sendDisableEnableFeatures(a.r.IntToStrX(25)));break;case 2:this.ider.enabled=!(0==(2&e))}return 13}processErrorOccurredCommand(){return this.ider.acc.length<11?0:11}processHeartbeatCommand(){return 8}processWrittenCommand(){if(this.ider.acc.length<28)return 0;const t=0!=(16&this.ider.acc.charCodeAt(14))?176:160,e=this.ider.acc.charCodeAt(14),s=this.ider.acc.substring(16,28),a=this.ider.acc.charCodeAt(9),i=s.charCodeAt(0);return this.handleSCSI(i,t,s,a,e),28}processDataFromHostCommand(){if(this.ider.acc.length<14)return 0;const t=a.r.ReadShortX(this.ider.acc,9);return this.ider.acc.length<14+t?0:(this.ider.sendCommand(81,String.fromCharCode(0,0,0,0,0,0,0,0,0,0,0,0,135,112,3,0,0,0,160,81,7,39,0),!0),14+t)}handleSCSI(t,e,s,r,o){switch(t){case 0:return this.handleTestUnitReady(e);case 8:this.handleRead6(e,s,r);break;case 10:return this.handleWrite6(e,s);case 26:return this.handleModeSense6(e,s,r);case 27:this.handleStartStop(e);break;case 30:return this.handleAllowMediumRemoval(e);case 35:return this.handleReadFormatCapacities(e,s,r);case 37:return this.handleReadCapacity(e,r,o);case 40:this.handleRead10(e,s,r);break;case 42:case 46:this.handleWrite10(e,s);break;case 67:return this.handleReadTOC(e,s,r);case 70:return this.handleGetConfiguration(e,s,r);case 74:this.handleGetEventStatusNotification(e,s,r);break;case 76:this.ider.sendCommand(81,a.r.IntToStrX(0)+a.r.IntToStrX(0)+a.r.IntToStrX(0)+String.fromCharCode(135,80,3,0,0,0,176,81,5,32,0),!0);break;case 81:return this.handleReadDiscInfo(e);case 85:return this.handleModeSelect10(e);case 90:return this.handleModeSense10(e,s,r);case 172:this.ider.sendDataToHost(e,!0,i.nX.Performance(),1&r);break;default:return this.ider.sendCommandEndResponse(!1,5,e,32,0),-1}return 0}handleTestUnitReady(t){switch(t){case 160:if(null==this.ider.floppy)return this.ider.sendCommandEndResponse(!0,2,t,58,0),-1;if(!this.ider.floppyReady)return this.ider.floppyReady=!0,this.ider.sendCommandEndResponse(!0,6,t,40,0),-1;break;case 176:if(null==this.ider.cdrom)return this.ider.sendCommandEndResponse(!0,2,t,58,0),-1;if(!this.ider.cdromReady)return this.ider.cdromReady=!0,this.ider.sendCommandEndResponse(!0,6,t,40,0),-1;break;default:return-1}return this.ider.sendCommandEndResponse(!0,0,t,0,0),0}handleRead6(t,e,s){const a=((31&e.charCodeAt(1))<<16)+(e.charCodeAt(2)<<8)+e.charCodeAt(3);let i=e.charCodeAt(4);0===i&&(i=256),this.ider.sendDiskData(t,a,i,s)}handleWrite6(t,e){e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3);let s=e.charCodeAt(4);return 0===s&&(s=256),this.ider.sendCommandEndResponse(!0,2,t,58,0),-1}handleModeSense6(t,e,s){if(63===e.charCodeAt(2)&&0===e.charCodeAt(3)){let e=0,a=0;switch(t){case 160:if(null==this.ider.floppy)return this.ider.sendCommandEndResponse(!0,2,t,58,0),-1;e=0,a=128;break;case 176:if(null==this.ider.cdrom)return this.ider.sendCommandEndResponse(!0,2,t,58,0),-1;e=5,a=128;break;default:return-1}return this.ider.sendDataToHost(t,!0,String.fromCharCode(0,e,a,0),1&s),0}return this.ider.sendCommandEndResponse(!0,5,t,36,0),0}handleStartStop(t){this.ider.sendCommandEndResponse(!0,0,t)}handleAllowMediumRemoval(t){return 160===t&&null==this.ider.floppy||176===t&&null==this.ider.cdrom?(this.ider.sendCommandEndResponse(!0,2,t,58,0),-1):(this.ider.sendCommandEndResponse(!0,0,t,0,0),0)}handleReadFormatCapacities(t,e,s){switch(t){case 160:if(null==this.ider.floppy||0===this.ider.floppy.size)return this.ider.sendCommandEndResponse(!1,5,t,36,0),-1;break;case 176:if(null==this.ider.cdrom||0===this.ider.cdrom.size)return this.ider.sendCommandEndResponse(!1,5,t,36,0),-1;break;default:return-1}return this.ider.sendDataToHost(t,!0,a.r.IntToStr(8)+String.fromCharCode(0,0,11,64,2,0,2,0),1&s),0}handleReadCapacity(t,e,s){let i=0;switch(t){case 160:if(null==this.ider.floppy||0===this.ider.floppy.size)return this.ider.sendCommandEndResponse(!1,2,t,58,0),-1;null!=this.ider.floppy&&(i=(this.ider.floppy.size>>9)-1);break;case 176:if(null==this.ider.cdrom||0===this.ider.cdrom.size)return this.ider.sendCommandEndResponse(!1,2,t,58,0),-1;null!=this.ider.cdrom&&(i=(this.ider.cdrom.size>>11)-1);break;default:return-1}return this.ider.sendDataToHost(s,!0,a.r.IntToStr(i)+String.fromCharCode(0,0,176===t?8:2,0),1&e),0}handleRead10(t,e,s){const i=a.r.ReadInt(e,2),r=a.r.ReadShort(e,7);this.ider.sendDiskData(t,i,r,s)}handleWrite10(t,e){a.r.ReadInt(e,2);const s=a.r.ReadShort(e,7);this.ider.sendGetDataFromHost(t,512*s)}handleReadTOC(t,e,s){a.r.ReadShort(e,7);const i=0!=(2&e.charCodeAt(1));let r=7&e.charCodeAt(2);switch(0===r&&(r=e.charCodeAt(9)>>6),t){case 160:return this.ider.sendCommandEndResponse(!0,5,t,32,0),-1;case 176:break;default:return-1}return 1===r?this.ider.sendDataToHost(t,!0,String.fromCharCode(0,10,1,1,0,20,1,0,0,0,0,0),1&s):0===r&&(i?this.ider.sendDataToHost(t,!0,String.fromCharCode(0,18,1,1,0,20,1,0,0,0,2,0,0,20,170,0,0,0,52,19),1&s):this.ider.sendDataToHost(t,!0,String.fromCharCode(0,18,1,1,0,20,1,0,0,0,0,0,0,20,170,0,0,0,0,0),1&s)),0}handleGetConfiguration(t,e,s){const r=2!==e.charCodeAt(1),o=a.r.ReadShort(e,2),n=a.r.ReadShort(e,7);if(0===n)return this.ider.sendDataToHost(t,!0,a.r.IntToStr(60)+a.r.IntToStr(8),1&s),-1;let h=a.r.IntToStr(8);return 0===o&&(h+=i.dv.ProfileList()),(1===o||r&&o<1)&&(h+=i.dv.Core()),(2===o||r&&o<2)&&(h+=i.A_.Morphing()),(3===o||r&&o<3)&&(h+=i.dv.Removable()),(16===o||r&&o<16)&&(h+=i.dv.Random()),(30===o||r&&o<30)&&(h+=i.A_.Read()),(256===o||r&&o<256)&&(h+=i.A_.PowerManagement()),(261===o||r&&o<261)&&(h+=i.A_.Timeout()),h=a.r.IntToStr(h.length)+h,h.length>n&&(h=h.substring(0,n)),this.ider.sendDataToHost(t,!0,h,1&s),-1}handleGetEventStatusNotification(t,e,s){if(1!==e.charCodeAt(1)&&16!==e.charCodeAt(4))return console.error("SCSI ERROR"),void this.ider.sendCommandEndResponse(!0,5,t,38,1);let a=0;(160===t&&null!=this.ider.floppy||176===t&&null!=this.ider.cdrom)&&(a=2),this.ider.sendDataToHost(t,!0,String.fromCharCode(0,a,128,0),1&s)}handleReadDiscInfo(t){return this.ider.sendCommandEndResponse(!1,5,t,32,0),-1}handleModeSelect10(t){return this.ider.sendCommandEndResponse(!0,5,t,32,0),-1}handleModeSense10(t,e,s){let r;if(0===a.r.ReadShort(e,7))return this.ider.sendDataToHost(t,!0,a.r.IntToStr(60)+a.r.IntToStr(8),1&s),-1;let o=0;switch(160===t?null!=this.ider.floppy&&(o=this.ider.floppy.size>>9):null!=this.ider.cdrom&&(o=this.ider.cdrom.size>>11),63&e.charCodeAt(2)){case 1:r=160===t?o<=2880?i.lq.FloppyError():i.lq.Ls120Error():i.lq.CDError();break;case 5:160===t&&(r=o<=2880?i.$9.MSFloppyDiskPage():i.$9.MSLS120DiskPage());break;case 63:r=160===t?o<=2880?i.$9.MS3FFloppy():i.$9.MS3FLS120():i.$9.MS3FCD();break;case 26:176===t&&(r=i.$9.MSCD1A());break;case 29:176===t&&(r=i.$9.MSCD1D());break;case 42:176===t&&(r=i.$9.MSCD2A())}return null==r?this.ider.sendCommandEndResponse(!1,5,t,32,0):this.ider.sendDataToHost(t,!0,r,1&s),0}}},824:(t,e,s)=>{"use strict";s.d(e,{$:()=>r});var a=s(354),i=s(932);class r{constructor(t,e){this.acc="",this.stateProcessorFac=new a.v(t,e,this.updateRFBState.bind(this)),this.parent=e}processData(t){if(!(0,i.f)(t))return;this.acc+=t;let e=0;for(;this.acc.length>0;){const t=this.stateProcessorFac.getProcessor(this.parent.state);if(this.parent.state,e=t.processState(this.acc),0===e)return;this.acc=this.acc.substring(e)}}updateRFBState(t){this.parent.state=t}}},48:(t,e,s)=>{"use strict";s.d(e,{X:()=>i});var a=s(303);class i{constructor(t){this.parent=t}Decode(t,e,s,i,r,o,n,h){const l=t.charCodeAt(e++);let d,c,p;const u={};let b,v=0,f=0;if(0===l){for(b=0;b<n;b++)a.j.setPixel(this.parent,t.charCodeAt(e++)+(2===this.parent.bpp?t.charCodeAt(e++)<<8:0),b);a.j.putImage(this.parent,s,i)}else if(1===l){c=t.charCodeAt(e++)+(2===this.parent.bpp?t.charCodeAt(e++)<<8:0),this.parent.canvasCtx.fillStyle="rgb("+(1===this.parent.bpp?`${224&c}, ${(28&c)<<3}, ${a.j.fixColor((3&c)<<6)}`:`${c>>8&248}, ${c>>3&252},${(31&c)<<3}`)+")";const n=a.j.rotX(this.parent,s,i);i=a.j.rotY(this.parent,s,i),s=n,this.parent.canvasCtx.fillRect(s,i,r,o)}else if(l>1&&l<17){let r=4,o=15;for(b=0;b<l;b++)u[b]=t.charCodeAt(e++)+(2===this.parent.bpp?t.charCodeAt(e++)<<8:0);for(2===l?(r=1,o=1):l<=4&&(r=2,o=3);v<n&&e<t.length;)for(c=t.charCodeAt(e++),b=8-r;b>=0;b-=r)a.j.setPixel(this.parent,u[c>>b&o],v++);a.j.putImage(this.parent,s,i)}else if(128===l){for(;v<n&&e<t.length;){c=t.charCodeAt(e++)+(2===this.parent.bpp?t.charCodeAt(e++)<<8:0),f=1;do{f+=p=t.charCodeAt(e++)}while(255===p);for(;--f>=0;)a.j.setPixel(this.parent,c,v++)}a.j.putImage(this.parent,s,i)}else if(l>129){for(b=0;b<l-128;b++)u[b]=t.charCodeAt(e++)+(2===this.parent.bpp?t.charCodeAt(e++)<<8:0);for(;v<n&&e<t.length;){if(f=1,d=t.charCodeAt(e++),c=u[d%128],d>127)do{f+=p=t.charCodeAt(e++)}while(255===p);for(;--f>=0;)a.j.setPixel(this.parent,c,v++)}a.j.putImage(this.parent,s,i)}}}},569:(t,e,s)=>{"use strict";s.d(e,{$:()=>a.$,X:()=>i.X});var a=s(824),i=s(48)},159:(t,e,s)=>{"use strict";s.d(e,{e:()=>r});var a=s(995),i=s(708);class r{constructor(t,e,s,a){this.wsSocket=t,this.parent=e,this.rleDecoder=s,this.updateRFBState=a}processState(t){let e=0;if(t.length>=12){const s=a.r.ReadShort(t,0),r=a.r.ReadShort(t,2),o=a.r.ReadShort(t,4),n=a.r.ReadShort(t,6),h=o*n,l=a.r.ReadInt(t,8);if(l<17){if(o<1||o>64||n<1||n>64)throw console.error(`Invalid tile size (${o},${n}), disconnecting.`),new Error("Invalid tile size");if(this.parent.sparew!==o||this.parent.spareh!==n){this.parent.sparew=this.parent.sparew2=o,this.parent.spareh=this.parent.spareh2=n,1!==this.parent.rotation&&3!==this.parent.rotation||(this.parent.sparew2=n,this.parent.spareh2=o);const t=`${this.parent.sparew2}x${this.parent.spareh2}`;this.parent.spare=this.parent.sparecache[t],(0,i.fQ)(this.parent.spare)||(this.parent.sparecache[t]=this.parent.spare=this.parent.canvasCtx.createImageData(this.parent.sparew2,this.parent.spareh2))}}if(4294967073===l)this.parent.canvasCtx.canvas.width=this.parent.ScreenWidth=this.parent.rwidth=this.parent.width=o,this.parent.canvasCtx.canvas.height=this.parent.ScreenHeight=this.parent.rheight=this.parent.height=n,this.wsSocket.send(String.fromCharCode(3,0,0,0,0,0)+a.r.ShortToStr(this.parent.width)+a.r.ShortToStr(this.parent.height)),e=12,null!=this.parent.onScreenSizeChange&&this.parent.onScreenSizeChange(this.parent.ScreenWidth,this.parent.ScreenHeight);else if(0===l){let a=12;const o=12+h*this.parent.bpp;if(t.length<o)return 0;e=o;for(let e=0;e<h;e++)i.jw.setPixel(this.parent,t.charCodeAt(a++)+(2===this.parent.bpp?t.charCodeAt(a++)<<8:0),e);i.jw.putImage(this.parent,s,r)}else{if(16!==l)throw console.error(`Unknown Encoding: ${l} , HEX: ${a.r.rstr2hex(t)}`),new Error(`Unknown Encoding: ${l}`);{if(t.length<16)return 0;const i=a.r.ReadInt(t,12);if(t.length<16+i)return 0;const l=16,d=5,c=0;if(i>5&&0===t.charCodeAt(l)&&a.r.ReadShortX(t,l+1)===i-d)this.rleDecoder.Decode(t,l+5,s,r,o,n,h,i);else{const e=t.substring(l,l+i-c),a=this.parent.inflate.inflate(e);if(!(a.length>0))throw console.error("Invalid deflate data."),new Error("invalid deflate data");this.rleDecoder.Decode(a,0,s,r,o,n,h,a.length)}e=16+i}}if(100==--this.parent.state){this.updateRFBState(4);const t=()=>{i.Xn.sendRefresh(this.parent,this.wsSocket)};0===this.parent.frameRateDelay?i.Xn.sendRefresh(this.parent,this.wsSocket):setTimeout(t,this.parent.frameRateDelay)}}return e}}},280:(t,e,s)=>{"use strict";s.d(e,{U:()=>i});var a=s(995);class i{constructor(t,e,s){this.wsSocket=t,this.serverCutTextHandler=e,this.updateRFBState=s}processState(t){let e=0,s=0;switch(t.charCodeAt(0)){case 0:if(t.length<4)return 0;this.updateRFBState(100+a.r.ReadShort(t,2)),e=4;break;case 2:e=1;break;case 3:if(t.length<8)return 0;if(s=a.r.ReadInt(t,4)+8,t.length<s)return 0;e=this.serverCutTextHandler.handleServerCutText(t)}return e}}},881:(t,e,s)=>{"use strict";s.d(e,{w:()=>a});class a{constructor(t,e){this.wsSocket=t,this.updateRFBState=e}processState(t){let e=0;return t.length>=12?(e=12,this.updateRFBState(1),this.wsSocket.send("RFB 003.008\n"),e):0}}},253:(t,e,s)=>{"use strict";s.d(e,{l:()=>a});class a{constructor(t,e){this.wsSocket=t,this.updateRFBState=e}processState(t){let e=0;return t.length>=1?(e=t.charCodeAt(0)+1,this.wsSocket.send(String.fromCharCode(1)),this.updateRFBState(2),e):0}}},286:(t,e,s)=>{"use strict";s.d(e,{m:()=>i});var a=s(995);class i{constructor(t,e){this.wsSocket=t,this.updateRFBState=e}processState(t){let e=0;if(t.length>=4){if(e=4,0!==a.r.ReadInt(t,0))throw new Error("Error. Stopping. Security response not None.");return this.wsSocket.send(String.fromCharCode(1)),this.updateRFBState(3),e}return 0}}},437:(t,e,s)=>{"use strict";s.d(e,{I:()=>r});var a=s(995),i=s(932);class r{constructor(t,e){this.wsSocket=t,this.parent=e}handleServerCutText(t){if(t.length<8)return 0;const e=a.r.ReadInt(t,4)+8;if(t.length<e)return 0;if(null!=this.parent.onKvmData){const s=t.substring(8,e);s.length>=16&&"\0KvmDataChannel"===s.substring(0,15)&&(this.parent.kvmDataSupported||(this.parent.kvmDataSupported=!0),(-1===this.parent.onKvmDataAck&&16===s.length||0!==s.charCodeAt(15))&&(this.parent.onKvmDataAck=!0),(0,i.f)(this.parent.urlvars)&&(0,i.f)(this.parent.urlvars.kvmdatatrace),s.length>16&&this.parent.onKvmData(s.substring(16)),!0===this.parent.onKvmDataAck&&this.parent.onKvmDataPending.length>0&&this.wsSocket.onSendKvmData(this.parent.onKvmDataPending.shift()))}return e}}},563:(t,e,s)=>{"use strict";s.d(e,{C:()=>r});var a=s(995),i=s(464);class r{constructor(t,e,s){this.wsSocket=t,this.parent=e,this.updateRFBState=s}processState(t){let e=0;if(t.length>=24){this.parent.rotation=0;const s=a.r.ReadInt(t,20);if(t.length<24+s)return 0;e=24+s,null!=this.parent.updateScreenDimensions&&this.parent.updateScreenDimensions(a.r.ReadShort(t,0),a.r.ReadShort(t,2)),this.parent.canvasCtx.canvas.width=this.parent.ScreenWidth=this.parent.rwidth=this.parent.width=a.r.ReadShort(t,0),this.parent.canvasCtx.canvas.height=this.parent.ScreenHeight=this.parent.rheight=this.parent.height=a.r.ReadShort(t,2);let r="";return this.parent.useZRLE&&(r+=a.r.IntToStr(16)),r+=a.r.IntToStr(0),r+=a.r.IntToStr(1092),this.wsSocket.send(String.fromCharCode(2,0)+a.r.ShortToStr(r.length/4+1)+r+a.r.IntToStr(-223)),1===this.parent.bpp&&this.wsSocket.send(String.fromCharCode(0,0,0,0,8,8,0,1)+a.r.ShortToStr(7)+a.r.ShortToStr(7)+a.r.ShortToStr(3)+String.fromCharCode(5,2,0,0,0,0)),this.updateRFBState(4),this.parent.onStateChange(3),i.X.sendRefresh(this.parent,this.wsSocket),this.parent.oldMouseX=-1,e}return 0}}},421:(t,e,s)=>{"use strict";s.d(e,{Cu:()=>h.C,Ut:()=>r.U,ez:()=>a.e,ll:()=>o.l,mC:()=>n.m,wW:()=>i.w});var a=s(159),i=s(881),r=s(280),o=s(253),n=s(286),h=s(563)},354:(t,e,s)=>{"use strict";s.d(e,{v:()=>o});var a=s(421),i=s(437),r=s(48);class o{constructor(t,e,s){this.stateProcessors={},this.stateProcessors[0]=new a.wW(t,s),this.stateProcessors[1]=new a.ll(t,s),this.stateProcessors[2]=new a.mC(t,s),this.stateProcessors[3]=new a.Cu(t,e,s);const o=new i.I(t,e);this.stateProcessors[4]=new a.Ut(t,o,s),this.stateProcessors["100plus"]=new a.ez(t,e,new r.X(e),s)}getProcessor(t){return t<=100?this.stateProcessors[t]:this.stateProcessors["100plus"]}}},467:(t,e,s)=>{"use strict";s.d(e,{Q:()=>a});class a{constructor(t){this.processData=t=>{null!=this.terminal.capture&&(this.terminal.capture=String(this.terminal.capture)+t);let e="";for(let s=0;s<t.length;s++){const a=t.charCodeAt(s);"J"===t[s]?this.clearTerminal():e+=0!=(128&a)?String.fromCharCode(this.terminal.AsciiToUnicode[127&a]):`${t[s]}`}this.processDataToXterm(e)},this.terminal=t}}},840:(t,e,s)=>{"use strict";s.d(e,{q:()=>r});var a=s(261),i=s(932);const r={convertAMTKeyCode:t=>(0,i.f)(t.code.startsWith("Key"))&&4===t.code.length?t.code.charCodeAt(3)+(!1===t.shiftKey?32:0):(0,i.f)(t.code.startsWith("Digit"))&&6===t.code.length?t.code.charCodeAt(5):(0,i.f)(t.code.startsWith("Numpad"))&&7===t.code.length?t.code.charCodeAt(6):a.Z[t.code]}},261:(t,e,s)=>{"use strict";s.d(e,{Z:()=>a});const a={Pause:19,CapsLock:20,Space:32,Quote:39,Minus:45,NumpadMultiply:42,NumpadAdd:43,PrintScreen:44,Comma:44,NumpadSubtract:45,NumpadDecimal:46,Period:46,Slash:47,NumpadDivide:47,Semicolon:59,Equal:61,OSLeft:91,BracketLeft:91,OSRight:91,Backslash:92,BracketRight:93,ContextMenu:93,Backquote:96,NumLock:144,ScrollLock:145,Backspace:65288,Tab:65289,Enter:65293,NumpadEnter:65293,Escape:65307,Delete:65535,Home:65360,PageUp:65365,PageDown:65366,ArrowLeft:65361,ArrowUp:65362,ArrowRight:65363,ArrowDown:65364,End:65367,Insert:65379,F1:65470,F2:65471,F3:65472,F4:65473,F5:65474,F6:65475,F7:65476,F8:65477,F9:65478,F10:65479,F11:65480,F12:65481,ShiftLeft:65505,ShiftRight:65506,ControlLeft:65507,ControlRight:65508,AltLeft:65513,AltRight:65514,MetaLeft:65511,MetaRight:65512}},464:(t,e,s)=>{"use strict";s.d(e,{X:()=>r});var a=s(995),i=s(932);const r={sendRefresh(t,e){if(!t.holding)if(t.focusMode>0){const s=2*t.focusMode;e.send(String.fromCharCode(3,1)+a.r.ShortToStr(Math.max(Math.min(t.oldMouseX,t.lastMouseX)-t.focusMode,0))+a.r.ShortToStr(Math.max(Math.min(t.oldMouseY,t.lastMouseY)-t.focusMode,0))+a.r.ShortToStr(s+Math.abs(t.oldMouseX-t.lastMouseX))+a.r.ShortToStr(s+Math.abs(t.oldMouseY-t.lastMouseY))),t.oldMouseX=t.lastMouseX,t.oldMouseY=t.lastMouseY}else e.send(String.fromCharCode(3,1,0,0,0,0)+a.r.ShortToStr(t.rwidth)+a.r.ShortToStr(t.rheight))},sendKey(t,e,s){if("object"==typeof e)for(const s in e)this.sendKey(t,e[s][0],e[s][1]);else t.send(String.fromCharCode(4,s,0,0)+a.r.IntToStr(e))},sendKvmData(t,e,s){!0!==t.onKvmDataAck?t.onKvmDataPending.push(s):((0,i.f)(t.urlvars)&&(0,i.f)(t.urlvars.kvmdatatrace),s="\0KvmDataChannel\0"+String(s),e.send(`${String.fromCharCode(6,0,0,0)}${a.r.IntToStr(s.length)}${String(s)}`),t.onKvmDataAck=!1)},sendKeepAlive(t,e){t.lastKeepAlive<Date.now()-5e3&&(t.lastKeepAlive=Date.now(),e.send(String.fromCharCode(6,0,0,0)+a.r.IntToStr(16)+"\0KvmDataChannel\0"))},sendCtrlAltDelMsg(t){this.sendCad(t)},sendCad(t){this.sendKey(t,65507,1),this.sendKey(t,65513,1),this.sendKey(t,65535,1),this.sendKey(t,65535,0),this.sendKey(t,65513,0),this.sendKey(t,65507,0)}}},303:(t,e,s)=>{"use strict";s.d(e,{j:()=>a});const a={putImage(t,e,s){if(t.holding)return;const i=a.arotX(t,e,s);s=a.arotY(t,e,s),e=i,t.canvasCtx.putImageData(t.spare,e,s)},setPixel(t,e,s){let i,r,o=4*s;t.rotation>0&&(1===t.rotation?(i=s%t.sparew,r=Math.floor(s/t.sparew),o=4*(s=i*t.sparew2+(t.sparew2-1-r))):2===t.rotation?o=t.sparew*t.spareh*4-4-o:3===t.rotation&&(i=s%t.sparew,r=Math.floor(s/t.sparew),o=4*(s=(t.sparew2-1-i)*t.sparew2+r))),1===t.bpp?(t.spare.data[o++]=224&e,t.spare.data[o++]=(28&e)<<3,t.spare.data[o++]=a.fixColor((3&e)<<6)):(t.spare.data[o++]=e>>8&248,t.spare.data[o++]=e>>3&252,t.spare.data[o++]=(31&e)<<3),t.spare.data[o]=255},arotX:(t,e,s)=>0===t.rotation?e:1===t.rotation?t.canvasCtx.canvas.width-t.sparew2-s:2===t.rotation?t.canvasCtx.canvas.width-t.sparew2-e:3===t.rotation?s:0,arotY:(t,e,s)=>0===t.rotation?s:1===t.rotation?e:2===t.rotation?t.canvasCtx.canvas.height-t.spareh2-s:3===t.rotation?t.canvasCtx.canvas.height-t.spareh-e:0,crotX:(t,e,s)=>0===t.rotation?e:1===t.rotation?s:2===t.rotation?t.canvasCtx.canvas.width-e:3===t.rotation?t.canvasCtx.canvas.height-s:0,crotY:(t,e,s)=>0===t.rotation?s:1===t.rotation?t.canvasCtx.canvas.width-e:2===t.rotation?t.canvasCtx.canvas.height-s:3===t.rotation?e:0,rotX:(t,e,s)=>0===t.rotation||1===t.rotation?e:2===t.rotation?e-t.canvasCtx.canvas.width:3===t.rotation?e-t.canvasCtx.canvas.height:0,rotY:(t,e,s)=>0===t.rotation?s:1===t.rotation?s-t.canvasCtx.canvas.width:2===t.rotation?s-t.canvasCtx.canvas.height:3===t.rotation?s:0,setRotation(t,e){for(;e<0;)e+=4;const s=e%4;if(t.holding)return t.rotation=s,!1;if(s===t.rotation)return!0;let i=t.canvasCtx.canvas.width,r=t.canvasCtx.canvas.height;1!==t.rotation&&3!==t.rotation||(i=t.canvasCtx.canvas.height,r=t.canvasCtx.canvas.width),null==t.tcanvas&&(t.tcanvas=document.createElement("canvas"));const o=t.tcanvas.getContext("2d");return o.setTransform(1,0,0,1,0,0),o.canvas.width=i,o.canvas.height=r,o.rotate(-90*t.rotation*Math.PI/180),0===t.rotation&&o.drawImage(t.canvasCtx.canvas,0,0),1===t.rotation&&o.drawImage(t.canvasCtx.canvas,-t.canvasCtx.canvas.width,0),2===t.rotation&&o.drawImage(t.canvasCtx.canvas,-t.canvasCtx.canvas.width,-t.canvasCtx.canvas.height),3===t.rotation&&o.drawImage(t.canvasCtx.canvas,0,-t.canvasCtx.canvas.height),0!==t.rotation&&2!==t.rotation||(t.canvasCtx.canvas.height=i,t.canvasCtx.canvas.width=r),1!==t.rotation&&3!==t.rotation||(t.canvasCtx.canvas.height=r,t.canvasCtx.canvas.width=i),t.canvasCtx.setTransform(1,0,0,1,0,0),t.canvasCtx.rotate(90*s*Math.PI/180),t.rotation=s,t.canvasCtx.drawImage(t.tcanvas,a.rotX(t,0,0),a.rotY(t,0,0)),t.width=t.canvasCtx.canvas.width,t.height=t.canvasCtx.canvas.height,null!=t.onScreenResize&&t.onScreenResize(t.width,t.height,t.canvasId),!0},fixColor:t=>t>127?t+32:t}},166:(t,e,s)=>{"use strict";s.d(e,{E:()=>n});var a,i=s(840),r=s(464),o=s(932);!function(t){t[t.Up=0]="Up",t[t.Down=1]="Down"}(a||(a={}));class n{constructor(t,e){this.Comms=e,this.parent=t}GrabKeyInput(){this.KeyInputGrab||(document.onkeyup=this.handleKeyUp.bind(this),document.onkeydown=this.handleKeyDown.bind(this),document.onkeypress=this.handleKeys.bind(this),this.KeyInputGrab=!0)}UnGrabKeyInput(){this.KeyInputGrab&&(document.onkeyup=null,document.onkeydown=null,document.onkeypress=null,this.KeyInputGrab=!1)}handleKeys(t){return this.haltEvent(t)}haltEvent(t){return(0,o.f)(t.preventDefault)&&t.preventDefault(),(0,o.f)(t.stopPropagation)&&t.stopPropagation(),!1}handleKeyUp(t){return this.handleKeyEvent(a.Up,t)}handleKeyDown(t){return this.handleKeyEvent(a.Down,t)}handleKeyEvent(t,e){let s=e;if((0,o.f)(s)||(s=window.event),(0,o.f)(s.code)){const e=i.q.convertAMTKeyCode(s);null!=e&&r.X.sendKey(this.Comms,e,t)}else{let e=s.keyCode;173===e&&(e=189),61===e&&(e=187);let a=e;!1===s.shiftKey&&e>=65&&e<=90&&(a=e+32),e>=112&&e<=124&&(a=e+65358),8===e&&(a=65288),9===e&&(a=65289),13===e&&(a=65293),16===e&&(a=65505),17===e&&(a=65507),18===e&&(a=65513),27===e&&(a=65307),33===e&&(a=65365),34===e&&(a=65366),35===e&&(a=65367),36===e&&(a=65360),37===e&&(a=65361),38===e&&(a=65362),39===e&&(a=65363),40===e&&(a=65364),45===e&&(a=65379),46===e&&(a=65535),e>=96&&e<=105&&(a=e-48),106===e&&(a=42),107===e&&(a=43),109===e&&(a=45),110===e&&(a=46),111===e&&(a=47),186===e&&(a=59),187===e&&(a=61),188===e&&(a=44),189===e&&(a=45),190===e&&(a=46),191===e&&(a=47),192===e&&(a=96),219===e&&(a=91),220===e&&(a=92),221===e&&(a=93),222===e&&(a=39),r.X.sendKey(this.Comms,a,t)}return this.haltEvent(s)}}},993:(t,e,s)=>{"use strict";s.d(e,{x:()=>o});var a=s(995),i=s(303),r=s(932);class o{constructor(t,e,s){this.topposition=0,this.leftposition=0,this.parent=t,this.comm=e,this.debounceTime=s,this.mouseClickCompleted=!0,this.lastEvent=null}GrabMouseInput(){this.MouseInputGrab||(this.MouseInputGrab=!0)}UnGrabMouseInput(){if(!this.MouseInputGrab)return;const t=this.parent.canvasCtx.canvas;t.onmousemove=null,t.onmouseup=null,t.onmousedown=null,this.MouseInputGrab=!1}mousedown(t){return this.parent.buttonmask|=1<<t.button,this.mousemove(t)}mouseup(t){return this.parent.buttonmask&=65535-(1<<t.button),this.mousemove(t)}mousemove(t){if(4!==this.parent.state)return!0;const e=this.getPositionOfControl(this.parent.canvasControl),s=this.parent.canvasControl.getBoundingClientRect();(0===this.topposition||s.top>this.topposition)&&(this.topposition=s.top),(0===this.leftposition||s.left>this.leftposition)&&(this.leftposition=s.left);const o=this.topposition-s.top,n=this.leftposition-s.left;if(this.parent.lastMouseX=(t.pageX-e[0]+n)*(this.parent.canvasControl.height/this.parent.canvasControl.offsetHeight),this.parent.lastMouseY=(t.pageY-e[1]+o)*(this.parent.canvasControl.width/this.parent.canvasControl.offsetWidth),(0,r.f)(this.parent.noMouseRotate)||(this.parent.lastMouseX2=i.j.crotX(this.parent,this.parent.lastMouseX,this.parent.lastMouseY),this.parent.lastMouseY=i.j.crotY(this.parent,this.parent.lastMouseX,this.parent.lastMouseY),this.parent.lastMouseX=this.parent.lastMouseX2),this.comm.send(String.fromCharCode(5,this.parent.buttonmask)+a.r.ShortToStr(this.parent.lastMouseX)+a.r.ShortToStr(this.parent.lastMouseY)),this.parent.setDeskFocus("DeskFocus",this.parent.focusMode),0!==this.parent.focusMode){const t=Math.min(this.parent.lastMouseX,this.parent.canvasControl.width-this.parent.focusMode),s=Math.min(this.parent.lastMouseY,this.parent.canvasControl.height-this.parent.focusMode),a=2*this.parent.focusMode,i=this.parent.canvasControl,r=i.offsetHeight/this.parent.canvasControl.height,o=i.offsetWidth/this.parent.canvasControl.width,n=this.parent.getDeskFocus("DeskFocus"),h=this.getPositionOfControl(this.parent.canvasControl.parentElement);n.left=`${Math.max((t-this.parent.focusMode)*r,0)+(e[0]-h[0])}px`,n.top=`${Math.max((s-this.parent.focusMode)*o,0)+(e[1]-h[1])}px`,n.width=a*r-6+"px",n.height=a*r-6+"px"}return this.haltEvent(t)}haltEvent(t){return(0,r.f)(t.preventDefault)&&t.preventDefault(),(0,r.f)(t.stopPropagation)&&t.stopPropagation(),!1}getPositionOfControl(t){const e=[0,0];let s=t;for(;null!=s;)e[0]=Number(e[0])+Number(s.offsetLeft),e[1]=Number(e[1])+Number(s.offsetTop),s=s.offsetParent;return e}}},932:(t,e,s)=>{"use strict";s.d(e,{f:()=>a});const a=t=>null!=t&&""!==t&&!1!==t&&0!==t},708:(t,e,s)=>{"use strict";s.d(e,{EB:()=>o.E,Xn:()=>i.X,fQ:()=>h.f,jw:()=>r.j,qD:()=>a.q,xx:()=>n.x});var a=s(840),i=s(464),r=s(303),o=s(166),n=s(993),h=s(932)},487:t=>{var e={utf8:{stringToBytes:function(t){return e.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(e.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],s=0;s<t.length;s++)e.push(255&t.charCodeAt(s));return e},bytesToString:function(t){for(var e=[],s=0;s<t.length;s++)e.push(String.fromCharCode(t[s]));return e.join("")}}};t.exports=e},12:t=>{var e,s;e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s={rotl:function(t,e){return t<<e|t>>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&s.rotl(t,8)|4278255360&s.rotl(t,24);for(var e=0;e<t.length;e++)t[e]=s.endian(t[e]);return t},randomBytes:function(t){for(var e=[];t>0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],s=0,a=0;s<t.length;s++,a+=8)e[a>>>5]|=t[s]<<24-a%32;return e},wordsToBytes:function(t){for(var e=[],s=0;s<32*t.length;s+=8)e.push(t[s>>>5]>>>24-s%32&255);return e},bytesToHex:function(t){for(var e=[],s=0;s<t.length;s++)e.push((t[s]>>>4).toString(16)),e.push((15&t[s]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],s=0;s<t.length;s+=2)e.push(parseInt(t.substr(s,2),16));return e},bytesToBase64:function(t){for(var s=[],a=0;a<t.length;a+=3)for(var i=t[a]<<16|t[a+1]<<8|t[a+2],r=0;r<4;r++)8*a+6*r<=8*t.length?s.push(e.charAt(i>>>6*(3-r)&63)):s.push("=");return s.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var s=[],a=0,i=0;a<t.length;i=++a%4)0!=i&&s.push((e.indexOf(t.charAt(a-1))&Math.pow(2,-2*i+8)-1)<<2*i|e.indexOf(t.charAt(a))>>>6-2*i);return s}},t.exports=s},738:t=>{function e(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}t.exports=function(t){return null!=t&&(e(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&e(t.slice(0,0))}(t)||!!t._isBuffer)}},568:(t,e,s)=>{var a,i,r,o,n;a=s(12),i=s(487).utf8,r=s(738),o=s(487).bin,(n=function(t,e){t.constructor==String?t=e&&"binary"===e.encoding?o.stringToBytes(t):i.stringToBytes(t):r(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||t.constructor===Uint8Array||(t=t.toString());for(var s=a.bytesToWords(t),h=8*t.length,l=1732584193,d=-271733879,c=-1732584194,p=271733878,u=0;u<s.length;u++)s[u]=16711935&(s[u]<<8|s[u]>>>24)|4278255360&(s[u]<<24|s[u]>>>8);s[h>>>5]|=128<<h%32,s[14+(h+64>>>9<<4)]=h;var b=n._ff,v=n._gg,f=n._hh,m=n._ii;for(u=0;u<s.length;u+=16){var S=l,g=d,_=c,C=p;l=b(l,d,c,p,s[u+0],7,-680876936),p=b(p,l,d,c,s[u+1],12,-389564586),c=b(c,p,l,d,s[u+2],17,606105819),d=b(d,c,p,l,s[u+3],22,-1044525330),l=b(l,d,c,p,s[u+4],7,-176418897),p=b(p,l,d,c,s[u+5],12,1200080426),c=b(c,p,l,d,s[u+6],17,-1473231341),d=b(d,c,p,l,s[u+7],22,-45705983),l=b(l,d,c,p,s[u+8],7,1770035416),p=b(p,l,d,c,s[u+9],12,-1958414417),c=b(c,p,l,d,s[u+10],17,-42063),d=b(d,c,p,l,s[u+11],22,-1990404162),l=b(l,d,c,p,s[u+12],7,1804603682),p=b(p,l,d,c,s[u+13],12,-40341101),c=b(c,p,l,d,s[u+14],17,-1502002290),l=v(l,d=b(d,c,p,l,s[u+15],22,1236535329),c,p,s[u+1],5,-165796510),p=v(p,l,d,c,s[u+6],9,-1069501632),c=v(c,p,l,d,s[u+11],14,643717713),d=v(d,c,p,l,s[u+0],20,-373897302),l=v(l,d,c,p,s[u+5],5,-701558691),p=v(p,l,d,c,s[u+10],9,38016083),c=v(c,p,l,d,s[u+15],14,-660478335),d=v(d,c,p,l,s[u+4],20,-405537848),l=v(l,d,c,p,s[u+9],5,568446438),p=v(p,l,d,c,s[u+14],9,-1019803690),c=v(c,p,l,d,s[u+3],14,-187363961),d=v(d,c,p,l,s[u+8],20,1163531501),l=v(l,d,c,p,s[u+13],5,-1444681467),p=v(p,l,d,c,s[u+2],9,-51403784),c=v(c,p,l,d,s[u+7],14,1735328473),l=f(l,d=v(d,c,p,l,s[u+12],20,-1926607734),c,p,s[u+5],4,-378558),p=f(p,l,d,c,s[u+8],11,-2022574463),c=f(c,p,l,d,s[u+11],16,1839030562),d=f(d,c,p,l,s[u+14],23,-35309556),l=f(l,d,c,p,s[u+1],4,-1530992060),p=f(p,l,d,c,s[u+4],11,1272893353),c=f(c,p,l,d,s[u+7],16,-155497632),d=f(d,c,p,l,s[u+10],23,-1094730640),l=f(l,d,c,p,s[u+13],4,681279174),p=f(p,l,d,c,s[u+0],11,-358537222),c=f(c,p,l,d,s[u+3],16,-722521979),d=f(d,c,p,l,s[u+6],23,76029189),l=f(l,d,c,p,s[u+9],4,-640364487),p=f(p,l,d,c,s[u+12],11,-421815835),c=f(c,p,l,d,s[u+15],16,530742520),l=m(l,d=f(d,c,p,l,s[u+2],23,-995338651),c,p,s[u+0],6,-198630844),p=m(p,l,d,c,s[u+7],10,1126891415),c=m(c,p,l,d,s[u+14],15,-1416354905),d=m(d,c,p,l,s[u+5],21,-57434055),l=m(l,d,c,p,s[u+12],6,1700485571),p=m(p,l,d,c,s[u+3],10,-1894986606),c=m(c,p,l,d,s[u+10],15,-1051523),d=m(d,c,p,l,s[u+1],21,-2054922799),l=m(l,d,c,p,s[u+8],6,1873313359),p=m(p,l,d,c,s[u+15],10,-30611744),c=m(c,p,l,d,s[u+6],15,-1560198380),d=m(d,c,p,l,s[u+13],21,1309151649),l=m(l,d,c,p,s[u+4],6,-145523070),p=m(p,l,d,c,s[u+11],10,-1120210379),c=m(c,p,l,d,s[u+2],15,718787259),d=m(d,c,p,l,s[u+9],21,-343485551),l=l+S>>>0,d=d+g>>>0,c=c+_>>>0,p=p+C>>>0}return a.endian([l,d,c,p])})._ff=function(t,e,s,a,i,r,o){var n=t+(e&s|~e&a)+(i>>>0)+o;return(n<<r|n>>>32-r)+e},n._gg=function(t,e,s,a,i,r,o){var n=t+(e&a|s&~a)+(i>>>0)+o;return(n<<r|n>>>32-r)+e},n._hh=function(t,e,s,a,i,r,o){var n=t+(e^s^a)+(i>>>0)+o;return(n<<r|n>>>32-r)+e},n._ii=function(t,e,s,a,i,r,o){var n=t+(s^(e|~a))+(i>>>0)+o;return(n<<r|n>>>32-r)+e},n._blocksize=16,n._digestsize=16,t.exports=function(t,e){if(null==t)throw new Error("Illegal argument "+t);var s=a.wordsToBytes(n(t,e));return e&&e.asBytes?s:e&&e.asString?o.bytesToString(s):a.bytesToHex(s)}},305:module=>{var ZLIB=ZLIB||{},BASE,NMAX;void 0===ZLIB.common_initialized&&(ZLIB.Z_NO_FLUSH=0,ZLIB.Z_PARTIAL_FLUSH=1,ZLIB.Z_SYNC_FLUSH=2,ZLIB.Z_FULL_FLUSH=3,ZLIB.Z_FINISH=4,ZLIB.Z_BLOCK=5,ZLIB.Z_TREES=6,ZLIB.Z_OK=0,ZLIB.Z_STREAM_END=1,ZLIB.Z_NEED_DICT=2,ZLIB.Z_ERRNO=-1,ZLIB.Z_STREAM_ERROR=-2,ZLIB.Z_DATA_ERROR=-3,ZLIB.Z_MEM_ERROR=-4,ZLIB.Z_BUF_ERROR=-5,ZLIB.Z_VERSION_ERROR=-6,ZLIB.Z_DEFLATED=8,ZLIB.z_stream=function(){this.next_in=0,this.avail_in=0,this.total_in=0,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=null,this.state=null,this.data_type=0,this.adler=0,this.input_data="",this.output_data="",this.error=0,this.checksum_function=null},ZLIB.gz_header=function(){this.text=0,this.time=0,this.xflags=0,this.os=255,this.extra=null,this.extra_len=0,this.extra_max=0,this.name=null,this.name_max=0,this.comment=null,this.comm_max=0,this.hcrc=0,this.done=0},ZLIB.common_initialized=!0),void 0===ZLIB&&alert("ZLIB is not defined. SRC zlib.js before zlib-inflate.js"),function(){var DEF_WBITS=15,HEAD=0,FLAGS=1,TIME=2,OS=3,EXLEN=4,EXTRA=5,NAME=6,COMMENT=7,HCRC=8,DICTID=9,DICT=10,TYPE=11,TYPEDO=12,STORED=13,COPY_=14,COPY=15,TABLE=16,LENLENS=17,CODELENS=18,LEN_=19,LEN=20,LENEXT=21,DIST=22,DISTEXT=23,MATCH=24,LIT=25,CHECK=26,LENGTH=27,DONE=28,BAD=29,MEM=30,SYNC=31,ENOUGH_LENS=852,ENOUGH_DISTS=592,ENOUGH=ENOUGH_LENS+ENOUGH_DISTS,CODES=0,LENS=1,DISTS=2,inflate_table_lbase=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],inflate_table_lext=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,203,69],inflate_table_dbase=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],inflate_table_dext=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];function inflate_table(t,e){var s,a,i,r,o,n,h,l,d,c,p,u,b,v,f,m,S,g,_,C,k,E,A=t.next,T=e==DISTS?t.distbits:t.lenbits,I=t.work,w=t.lens,R=e==DISTS?t.nlen:0,D=t.codes;s=e==LENS?t.nlen:e==DISTS?t.ndist:19;var B=new Array(16),x=new Array(16);for(a=0;a<=15;a++)B[a]=0;for(i=0;i<s;i++)B[w[R+i]]++;for(n=T,o=15;o>=1&&0==B[o];o--);if(n>o&&(n=o),0==o)return m={op:64,bits:1,val:0},D[A++]=m,D[A++]=m,e==DISTS?t.distbits=1:t.lenbits=1,t.next=A,0;for(r=1;r<o&&0==B[r];r++);for(n<r&&(n=r),d=1,a=1;a<=15;a++)if(d<<=1,(d-=B[a])<0)return-1;if(d>0&&(e==CODES||1!=o))return t.next=A,-1;for(x[1]=0,a=1;a<15;a++)x[a+1]=x[a]+B[a];for(i=0;i<s;i++)0!=w[R+i]&&(I[x[w[R+i]]++]=i);switch(e){case CODES:g=C=I,_=0,k=0,E=19;break;case LENS:g=inflate_table_lbase,_=-257,C=inflate_table_lext,k=-257,E=256;break;default:g=inflate_table_dbase,C=inflate_table_dext,_=0,k=0,E=-1}if(p=0,i=0,a=r,S=A,h=n,l=0,v=-1,f=(c=1<<n)-1,e==LENS&&c>=ENOUGH_LENS||e==DISTS&&c>=ENOUGH_DISTS)return t.next=A,1;for(;;){m={op:0,bits:a-l,val:0},I[i]<E?m.val=I[i]:I[i]>E?(m.op=C[k+I[i]],m.val=g[_+I[i]]):m.op=96,u=1<<a-l,r=b=1<<h;do{D[S+(p>>>l)+(b-=u)]=m}while(0!=b);for(u=1<<a-1;p&u;)u>>>=1;if(0!=u?(p&=u-1,p+=u):p=0,i++,0==--B[a]){if(a==o)break;a=w[R+I[i]]}if(a>n&&(p&f)!=v){for(0==l&&(l=n),S+=r,d=1<<(h=a-l);h+l<o&&!((d-=B[h+l])<=0);)h++,d<<=1;if(c+=1<<h,e==LENS&&c>=ENOUGH_LENS||e==DISTS&&c>=ENOUGH_DISTS)return t.next=A,1;D[A+(v=p&f)]={op:h,bits:n,val:S-A}}}return 0!=p&&(D[S+p]={op:64,bits:a-l,val:0}),t.next=A+c,e==DISTS?t.distbits=n:t.lenbits=n,0}function inflate_fast(t,e){var s,a,i,r,o,n,h,l,d,c,p,u,b,v,f,m,S,g,_,C,k,E,A=-1,T=-1;s=t.state,a=t.input_data,r=(i=t.next_in)+t.avail_in-5,n=(o=t.next_out)-(e-t.avail_out),h=o+(t.avail_out-257),l=s.wsize,d=s.whave,c=s.wnext,p=s.window,u=s.hold,b=s.bits,v=s.codes,f=s.lencode,m=s.distcode,S=(1<<s.lenbits)-1,g=(1<<s.distbits)-1;t:do{b<15&&(u+=(255&a.charCodeAt(i++))<<b,b+=8,u+=(255&a.charCodeAt(i++))<<b,b+=8),_=v[f+(u&S)];e:for(;;){if(u>>>=C=_.bits,b-=C,0==(C=_.op))t.output_data+=String.fromCharCode(_.val),o++;else{if(!(16&C)){if(0==(64&C)){_=v[f+(_.val+(u&(1<<C)-1))];continue e}if(32&C){s.mode=TYPE;break t}t.msg="invalid literal/length code",s.mode=BAD;break t}k=_.val,(C&=15)&&(b<C&&(u+=(255&a.charCodeAt(i++))<<b,b+=8),k+=u&(1<<C)-1,u>>>=C,b-=C),b<15&&(u+=(255&a.charCodeAt(i++))<<b,b+=8,u+=(255&a.charCodeAt(i++))<<b,b+=8),_=v[m+(u&g)];s:for(;;){if(u>>>=C=_.bits,b-=C,!(16&(C=_.op))){if(0==(64&C)){_=v[m+(_.val+(u&(1<<C)-1))];continue s}t.msg="invalid distance code",s.mode=BAD;break t}if(E=_.val,b<(C&=15)&&(u+=(255&a.charCodeAt(i++))<<b,(b+=8)<C&&(u+=(255&a.charCodeAt(i++))<<b,b+=8)),E+=u&(1<<C)-1,u>>>=C,b-=C,E>(C=o-n)){if((C=E-C)>d&&s.sane){t.msg="invalid distance too far back",s.mode=BAD;break t}A=0,T=-1,0==c?(A+=l-C,C<k&&(k-=C,t.output_data+=p.substring(A,A+C),o+=C,C=0,A=-1,T=o-E)):(A+=c-C,C<k&&(k-=C,t.output_data+=p.substring(A,A+C),A=-1,T=(o+=C)-E))}else A=-1,T=o-E;if(A>=0)t.output_data+=p.substring(A,A+k),o+=k,A+=k;else{var I=k;for(I>o-T&&(I=o-T),t.output_data+=t.output_data.substring(T,T+I),o+=I,T+=I,o+=k-=I;k>2;)t.output_data+=t.output_data.charAt(T++),t.output_data+=t.output_data.charAt(T++),t.output_data+=t.output_data.charAt(T++),k-=3;k&&(t.output_data+=t.output_data.charAt(T++),k>1&&(t.output_data+=t.output_data.charAt(T++)))}break s}}break e}}while(i<r&&o<h);i-=k=b>>>3,u&=(1<<(b-=k<<3))-1,t.next_in=i,t.next_out=o,t.avail_in=i<r?r-i+5:5-(i-r),t.avail_out=o<h?h-o+257:257-(o-h),s.hold=u,s.bits=b}function new_array(t){var e,s=new Array(t);for(e=0;e<t;e++)s[e]=0;return s}function getarg(t,e,s){return t&&e in t?t[e]:s}function checksum_none(){return 0}function inflate_state(){var t;this.mode=0,this.last=0,this.wrap=0,this.havedict=0,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=0,this.distcode=0,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=0,this.lens=new_array(320),this.work=new_array(288),this.codes=new Array(ENOUGH);var e={op:0,bits:0,val:0};for(t=0;t<ENOUGH;t++)this.codes[t]=e;this.sane=0,this.back=0,this.was=0}ZLIB.inflate_copyright=" inflate 1.2.6 Copyright 1995-2012 Mark Adler ",ZLIB.inflateResetKeep=function(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg=null,e.wrap&&(t.adler=1&e.wrap),e.mode=HEAD,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=0,e.distcode=0,e.next=0,e.sane=1,e.back=-1,ZLIB.Z_OK):ZLIB.Z_STREAM_ERROR},ZLIB.inflateReset=function(t,e){var s,a;return t&&t.state?(a=t.state,void 0===e&&(e=DEF_WBITS),e<0?(s=0,e=-e):(s=1+(e>>>4),e<48&&(e&=15)),1==s&&"function"==typeof ZLIB.adler32?t.checksum_function=ZLIB.adler32:2==s&&"function"==typeof ZLIB.crc32?t.checksum_function=ZLIB.crc32:t.checksum_function=checksum_none,e&&(e<8||e>15)?ZLIB.Z_STREAM_ERROR:(a.window&&a.wbits!=e&&(a.window=null),a.wrap=s,a.wbits=e,a.wsize=0,a.whave=0,a.wnext=0,ZLIB.inflateResetKeep(t))):ZLIB.Z_STREAM_ERROR},ZLIB.inflateInit=function(t){var e=new ZLIB.z_stream;return e.state=new inflate_state,ZLIB.inflateReset(e,t),e},ZLIB.inflatePrime=function(t,e,s){var a;return t&&t.state?(a=t.state,e<0?(a.hold=0,a.bits=0,ZLIB.Z_OK):e>16||a.bits+e>32?ZLIB.Z_STREAM_ERROR:(s&=(1<<e)-1,a.hold+=s<<a.bits,a.bits+=e,ZLIB.Z_OK)):ZLIB.Z_STREAM_ERROR};var lenfix_ary=null,lenfix_def="([ {op:96,bits:7,val:0},{op:0,bits:8,val:80},{op:0,bits:8,val:16},{op:20,bits:8,val:115},{op:18,bits:7,val:31},{op:0,bits:8,val:112},{op:0,bits:8,val:48}, {op:0,bits:9,val:192},{op:16,bits:7,val:10},{op:0,bits:8,val:96},{op:0,bits:8,val:32},{op:0,bits:9,val:160},{op:0,bits:8,val:0},{op:0,bits:8,val:128}, {op:0,bits:8,val:64},{op:0,bits:9,val:224},{op:16,bits:7,val:6},{op:0,bits:8,val:88},{op:0,bits:8,val:24},{op:0,bits:9,val:144},{op:19,bits:7,val:59}, {op:0,bits:8,val:120},{op:0,bits:8,val:56},{op:0,bits:9,val:208},{op:17,bits:7,val:17},{op:0,bits:8,val:104},{op:0,bits:8,val:40},{op:0,bits:9,val:176}, {op:0,bits:8,val:8},{op:0,bits:8,val:136},{op:0,bits:8,val:72},{op:0,bits:9,val:240},{op:16,bits:7,val:4},{op:0,bits:8,val:84},{op:0,bits:8,val:20}, {op:21,bits:8,val:227},{op:19,bits:7,val:43},{op:0,bits:8,val:116},{op:0,bits:8,val:52},{op:0,bits:9,val:200},{op:17,bits:7,val:13},{op:0,bits:8,val:100}, {op:0,bits:8,val:36},{op:0,bits:9,val:168},{op:0,bits:8,val:4},{op:0,bits:8,val:132},{op:0,bits:8,val:68},{op:0,bits:9,val:232},{op:16,bits:7,val:8}, {op:0,bits:8,val:92},{op:0,bits:8,val:28},{op:0,bits:9,val:152},{op:20,bits:7,val:83},{op:0,bits:8,val:124},{op:0,bits:8,val:60},{op:0,bits:9,val:216}, {op:18,bits:7,val:23},{op:0,bits:8,val:108},{op:0,bits:8,val:44},{op:0,bits:9,val:184},{op:0,bits:8,val:12},{op:0,bits:8,val:140},{op:0,bits:8,val:76}, {op:0,bits:9,val:248},{op:16,bits:7,val:3},{op:0,bits:8,val:82},{op:0,bits:8,val:18},{op:21,bits:8,val:163},{op:19,bits:7,val:35},{op:0,bits:8,val:114}, {op:0,bits:8,val:50},{op:0,bits:9,val:196},{op:17,bits:7,val:11},{op:0,bits:8,val:98},{op:0,bits:8,val:34},{op:0,bits:9,val:164},{op:0,bits:8,val:2}, {op:0,bits:8,val:130},{op:0,bits:8,val:66},{op:0,bits:9,val:228},{op:16,bits:7,val:7},{op:0,bits:8,val:90},{op:0,bits:8,val:26},{op:0,bits:9,val:148}, {op:20,bits:7,val:67},{op:0,bits:8,val:122},{op:0,bits:8,val:58},{op:0,bits:9,val:212},{op:18,bits:7,val:19},{op:0,bits:8,val:106},{op:0,bits:8,val:42}, {op:0,bits:9,val:180},{op:0,bits:8,val:10},{op:0,bits:8,val:138},{op:0,bits:8,val:74},{op:0,bits:9,val:244},{op:16,bits:7,val:5},{op:0,bits:8,val:86}, {op:0,bits:8,val:22},{op:64,bits:8,val:0},{op:19,bits:7,val:51},{op:0,bits:8,val:118},{op:0,bits:8,val:54},{op:0,bits:9,val:204},{op:17,bits:7,val:15}, {op:0,bits:8,val:102},{op:0,bits:8,val:38},{op:0,bits:9,val:172},{op:0,bits:8,val:6},{op:0,bits:8,val:134},{op:0,bits:8,val:70},{op:0,bits:9,val:236}, {op:16,bits:7,val:9},{op:0,bits:8,val:94},{op:0,bits:8,val:30},{op:0,bits:9,val:156},{op:20,bits:7,val:99},{op:0,bits:8,val:126},{op:0,bits:8,val:62}, {op:0,bits:9,val:220},{op:18,bits:7,val:27},{op:0,bits:8,val:110},{op:0,bits:8,val:46},{op:0,bits:9,val:188},{op:0,bits:8,val:14},{op:0,bits:8,val:142}, {op:0,bits:8,val:78},{op:0,bits:9,val:252},{op:96,bits:7,val:0},{op:0,bits:8,val:81},{op:0,bits:8,val:17},{op:21,bits:8,val:131},{op:18,bits:7,val:31}, {op:0,bits:8,val:113},{op:0,bits:8,val:49},{op:0,bits:9,val:194},{op:16,bits:7,val:10},{op:0,bits:8,val:97},{op:0,bits:8,val:33},{op:0,bits:9,val:162}, {op:0,bits:8,val:1},{op:0,bits:8,val:129},{op:0,bits:8,val:65},{op:0,bits:9,val:226},{op:16,bits:7,val:6},{op:0,bits:8,val:89},{op:0,bits:8,val:25}, {op:0,bits:9,val:146},{op:19,bits:7,val:59},{op:0,bits:8,val:121},{op:0,bits:8,val:57},{op:0,bits:9,val:210},{op:17,bits:7,val:17},{op:0,bits:8,val:105}, {op:0,bits:8,val:41},{op:0,bits:9,val:178},{op:0,bits:8,val:9},{op:0,bits:8,val:137},{op:0,bits:8,val:73},{op:0,bits:9,val:242},{op:16,bits:7,val:4}, {op:0,bits:8,val:85},{op:0,bits:8,val:21},{op:16,bits:8,val:258},{op:19,bits:7,val:43},{op:0,bits:8,val:117},{op:0,bits:8,val:53},{op:0,bits:9,val:202}, {op:17,bits:7,val:13},{op:0,bits:8,val:101},{op:0,bits:8,val:37},{op:0,bits:9,val:170},{op:0,bits:8,val:5},{op:0,bits:8,val:133},{op:0,bits:8,val:69}, {op:0,bits:9,val:234},{op:16,bits:7,val:8},{op:0,bits:8,val:93},{op:0,bits:8,val:29},{op:0,bits:9,val:154},{op:20,bits:7,val:83},{op:0,bits:8,val:125}, {op:0,bits:8,val:61},{op:0,bits:9,val:218},{op:18,bits:7,val:23},{op:0,bits:8,val:109},{op:0,bits:8,val:45},{op:0,bits:9,val:186},{op:0,bits:8,val:13}, {op:0,bits:8,val:141},{op:0,bits:8,val:77},{op:0,bits:9,val:250},{op:16,bits:7,val:3},{op:0,bits:8,val:83},{op:0,bits:8,val:19},{op:21,bits:8,val:195}, {op:19,bits:7,val:35},{op:0,bits:8,val:115},{op:0,bits:8,val:51},{op:0,bits:9,val:198},{op:17,bits:7,val:11},{op:0,bits:8,val:99},{op:0,bits:8,val:35}, {op:0,bits:9,val:166},{op:0,bits:8,val:3},{op:0,bits:8,val:131},{op:0,bits:8,val:67},{op:0,bits:9,val:230},{op:16,bits:7,val:7},{op:0,bits:8,val:91}, {op:0,bits:8,val:27},{op:0,bits:9,val:150},{op:20,bits:7,val:67},{op:0,bits:8,val:123},{op:0,bits:8,val:59},{op:0,bits:9,val:214},{op:18,bits:7,val:19}, {op:0,bits:8,val:107},{op:0,bits:8,val:43},{op:0,bits:9,val:182},{op:0,bits:8,val:11},{op:0,bits:8,val:139},{op:0,bits:8,val:75},{op:0,bits:9,val:246}, {op:16,bits:7,val:5},{op:0,bits:8,val:87},{op:0,bits:8,val:23},{op:64,bits:8,val:0},{op:19,bits:7,val:51},{op:0,bits:8,val:119},{op:0,bits:8,val:55}, {op:0,bits:9,val:206},{op:17,bits:7,val:15},{op:0,bits:8,val:103},{op:0,bits:8,val:39},{op:0,bits:9,val:174},{op:0,bits:8,val:7},{op:0,bits:8,val:135}, {op:0,bits:8,val:71},{op:0,bits:9,val:238},{op:16,bits:7,val:9},{op:0,bits:8,val:95},{op:0,bits:8,val:31},{op:0,bits:9,val:158},{op:20,bits:7,val:99}, {op:0,bits:8,val:127},{op:0,bits:8,val:63},{op:0,bits:9,val:222},{op:18,bits:7,val:27},{op:0,bits:8,val:111},{op:0,bits:8,val:47},{op:0,bits:9,val:190}, {op:0,bits:8,val:15},{op:0,bits:8,val:143},{op:0,bits:8,val:79},{op:0,bits:9,val:254},{op:96,bits:7,val:0},{op:0,bits:8,val:80},{op:0,bits:8,val:16}, {op:20,bits:8,val:115},{op:18,bits:7,val:31},{op:0,bits:8,val:112},{op:0,bits:8,val:48},{op:0,bits:9,val:193},{op:16,bits:7,val:10},{op:0,bits:8,val:96}, {op:0,bits:8,val:32},{op:0,bits:9,val:161},{op:0,bits:8,val:0},{op:0,bits:8,val:128},{op:0,bits:8,val:64},{op:0,bits:9,val:225},{op:16,bits:7,val:6}, {op:0,bits:8,val:88},{op:0,bits:8,val:24},{op:0,bits:9,val:145},{op:19,bits:7,val:59},{op:0,bits:8,val:120},{op:0,bits:8,val:56},{op:0,bits:9,val:209}, {op:17,bits:7,val:17},{op:0,bits:8,val:104},{op:0,bits:8,val:40},{op:0,bits:9,val:177},{op:0,bits:8,val:8},{op:0,bits:8,val:136},{op:0,bits:8,val:72}, {op:0,bits:9,val:241},{op:16,bits:7,val:4},{op:0,bits:8,val:84},{op:0,bits:8,val:20},{op:21,bits:8,val:227},{op:19,bits:7,val:43},{op:0,bits:8,val:116}, {op:0,bits:8,val:52},{op:0,bits:9,val:201},{op:17,bits:7,val:13},{op:0,bits:8,val:100},{op:0,bits:8,val:36},{op:0,bits:9,val:169},{op:0,bits:8,val:4}, {op:0,bits:8,val:132},{op:0,bits:8,val:68},{op:0,bits:9,val:233},{op:16,bits:7,val:8},{op:0,bits:8,val:92},{op:0,bits:8,val:28},{op:0,bits:9,val:153}, {op:20,bits:7,val:83},{op:0,bits:8,val:124},{op:0,bits:8,val:60},{op:0,bits:9,val:217},{op:18,bits:7,val:23},{op:0,bits:8,val:108},{op:0,bits:8,val:44}, {op:0,bits:9,val:185},{op:0,bits:8,val:12},{op:0,bits:8,val:140},{op:0,bits:8,val:76},{op:0,bits:9,val:249},{op:16,bits:7,val:3},{op:0,bits:8,val:82}, {op:0,bits:8,val:18},{op:21,bits:8,val:163},{op:19,bits:7,val:35},{op:0,bits:8,val:114},{op:0,bits:8,val:50},{op:0,bits:9,val:197},{op:17,bits:7,val:11}, {op:0,bits:8,val:98},{op:0,bits:8,val:34},{op:0,bits:9,val:165},{op:0,bits:8,val:2},{op:0,bits:8,val:130},{op:0,bits:8,val:66},{op:0,bits:9,val:229}, {op:16,bits:7,val:7},{op:0,bits:8,val:90},{op:0,bits:8,val:26},{op:0,bits:9,val:149},{op:20,bits:7,val:67},{op:0,bits:8,val:122},{op:0,bits:8,val:58}, {op:0,bits:9,val:213},{op:18,bits:7,val:19},{op:0,bits:8,val:106},{op:0,bits:8,val:42},{op:0,bits:9,val:181},{op:0,bits:8,val:10},{op:0,bits:8,val:138}, {op:0,bits:8,val:74},{op:0,bits:9,val:245},{op:16,bits:7,val:5},{op:0,bits:8,val:86},{op:0,bits:8,val:22},{op:64,bits:8,val:0},{op:19,bits:7,val:51}, {op:0,bits:8,val:118},{op:0,bits:8,val:54},{op:0,bits:9,val:205},{op:17,bits:7,val:15},{op:0,bits:8,val:102},{op:0,bits:8,val:38},{op:0,bits:9,val:173}, {op:0,bits:8,val:6},{op:0,bits:8,val:134},{op:0,bits:8,val:70},{op:0,bits:9,val:237},{op:16,bits:7,val:9},{op:0,bits:8,val:94},{op:0,bits:8,val:30}, {op:0,bits:9,val:157},{op:20,bits:7,val:99},{op:0,bits:8,val:126},{op:0,bits:8,val:62},{op:0,bits:9,val:221},{op:18,bits:7,val:27},{op:0,bits:8,val:110}, {op:0,bits:8,val:46},{op:0,bits:9,val:189},{op:0,bits:8,val:14},{op:0,bits:8,val:142},{op:0,bits:8,val:78},{op:0,bits:9,val:253},{op:96,bits:7,val:0}, {op:0,bits:8,val:81},{op:0,bits:8,val:17},{op:21,bits:8,val:131},{op:18,bits:7,val:31},{op:0,bits:8,val:113},{op:0,bits:8,val:49},{op:0,bits:9,val:195}, {op:16,bits:7,val:10},{op:0,bits:8,val:97},{op:0,bits:8,val:33},{op:0,bits:9,val:163},{op:0,bits:8,val:1},{op:0,bits:8,val:129},{op:0,bits:8,val:65}, {op:0,bits:9,val:227},{op:16,bits:7,val:6},{op:0,bits:8,val:89},{op:0,bits:8,val:25},{op:0,bits:9,val:147},{op:19,bits:7,val:59},{op:0,bits:8,val:121}, {op:0,bits:8,val:57},{op:0,bits:9,val:211},{op:17,bits:7,val:17},{op:0,bits:8,val:105},{op:0,bits:8,val:41},{op:0,bits:9,val:179},{op:0,bits:8,val:9}, {op:0,bits:8,val:137},{op:0,bits:8,val:73},{op:0,bits:9,val:243},{op:16,bits:7,val:4},{op:0,bits:8,val:85},{op:0,bits:8,val:21},{op:16,bits:8,val:258}, {op:19,bits:7,val:43},{op:0,bits:8,val:117},{op:0,bits:8,val:53},{op:0,bits:9,val:203},{op:17,bits:7,val:13},{op:0,bits:8,val:101},{op:0,bits:8,val:37}, {op:0,bits:9,val:171},{op:0,bits:8,val:5},{op:0,bits:8,val:133},{op:0,bits:8,val:69},{op:0,bits:9,val:235},{op:16,bits:7,val:8},{op:0,bits:8,val:93}, {op:0,bits:8,val:29},{op:0,bits:9,val:155},{op:20,bits:7,val:83},{op:0,bits:8,val:125},{op:0,bits:8,val:61},{op:0,bits:9,val:219},{op:18,bits:7,val:23}, {op:0,bits:8,val:109},{op:0,bits:8,val:45},{op:0,bits:9,val:187},{op:0,bits:8,val:13},{op:0,bits:8,val:141},{op:0,bits:8,val:77},{op:0,bits:9,val:251}, {op:16,bits:7,val:3},{op:0,bits:8,val:83},{op:0,bits:8,val:19},{op:21,bits:8,val:195},{op:19,bits:7,val:35},{op:0,bits:8,val:115},{op:0,bits:8,val:51}, {op:0,bits:9,val:199},{op:17,bits:7,val:11},{op:0,bits:8,val:99},{op:0,bits:8,val:35},{op:0,bits:9,val:167},{op:0,bits:8,val:3},{op:0,bits:8,val:131}, {op:0,bits:8,val:67},{op:0,bits:9,val:231},{op:16,bits:7,val:7},{op:0,bits:8,val:91},{op:0,bits:8,val:27},{op:0,bits:9,val:151},{op:20,bits:7,val:67}, {op:0,bits:8,val:123},{op:0,bits:8,val:59},{op:0,bits:9,val:215},{op:18,bits:7,val:19},{op:0,bits:8,val:107},{op:0,bits:8,val:43},{op:0,bits:9,val:183}, {op:0,bits:8,val:11},{op:0,bits:8,val:139},{op:0,bits:8,val:75},{op:0,bits:9,val:247},{op:16,bits:7,val:5},{op:0,bits:8,val:87},{op:0,bits:8,val:23}, {op:64,bits:8,val:0},{op:19,bits:7,val:51},{op:0,bits:8,val:119},{op:0,bits:8,val:55},{op:0,bits:9,val:207},{op:17,bits:7,val:15},{op:0,bits:8,val:103}, {op:0,bits:8,val:39},{op:0,bits:9,val:175},{op:0,bits:8,val:7},{op:0,bits:8,val:135},{op:0,bits:8,val:71},{op:0,bits:9,val:239},{op:16,bits:7,val:9}, {op:0,bits:8,val:95},{op:0,bits:8,val:31},{op:0,bits:9,val:159},{op:20,bits:7,val:99},{op:0,bits:8,val:127},{op:0,bits:8,val:63},{op:0,bits:9,val:223}, {op:18,bits:7,val:27},{op:0,bits:8,val:111},{op:0,bits:8,val:47},{op:0,bits:9,val:191},{op:0,bits:8,val:15},{op:0,bits:8,val:143},{op:0,bits:8,val:79}, {op:0,bits:9,val:255}])",distfix_ary=null,distfix_def="([ {op:16,bits:5,val:1},{op:23,bits:5,val:257},{op:19,bits:5,val:17},{op:27,bits:5,val:4097},{op:17,bits:5,val:5},{op:25,bits:5,val:1025}, {op:21,bits:5,val:65},{op:29,bits:5,val:16385},{op:16,bits:5,val:3},{op:24,bits:5,val:513},{op:20,bits:5,val:33},{op:28,bits:5,val:8193}, {op:18,bits:5,val:9},{op:26,bits:5,val:2049},{op:22,bits:5,val:129},{op:64,bits:5,val:0},{op:16,bits:5,val:2},{op:23,bits:5,val:385}, {op:19,bits:5,val:25},{op:27,bits:5,val:6145},{op:17,bits:5,val:7},{op:25,bits:5,val:1537},{op:21,bits:5,val:97},{op:29,bits:5,val:24577}, {op:16,bits:5,val:4},{op:24,bits:5,val:769},{op:20,bits:5,val:49},{op:28,bits:5,val:12289},{op:18,bits:5,val:13},{op:26,bits:5,val:3073}, {op:22,bits:5,val:193},{op:64,bits:5,val:0}])";function fixedtables(state){var i;for(lenfix_ary||(lenfix_ary=eval(lenfix_def)),distfix_ary||(distfix_ary=eval(distfix_def)),state.lencode=0,state.distcode=512,i=0;i<512;i++)state.codes[i]=lenfix_ary[i];for(i=0;i<32;i++)state.codes[i+512]=distfix_ary[i];state.lenbits=9,state.distbits=5}function updatewindow(t){var e=t.state,s=t.output_data.length;return null===e.window&&(e.window=""),0==e.wsize&&(e.wsize=1<<e.wbits),s>=e.wsize?e.window=t.output_data.substring(s-e.wsize):e.whave+s<e.wsize?e.window+=t.output_data:e.window=e.window.substring(e.whave-(e.wsize-s))+t.output_data,e.whave=e.window.length,e.whave<e.wsize?e.wnext=e.whave:e.wnext=0,0}function CRC2(t,e){var s=[255&e,e>>>8&255];t.state.check=t.checksum_function(t.state.check,s,0,2)}function CRC4(t,e){var s=[255&e,e>>>8&255,e>>>16&255,e>>>24&255];t.state.check=t.checksum_function(t.state.check,s,0,4)}function LOAD(t,e){return e.strm=t,e.left=t.avail_out,e.next=t.next_in,e.have=t.avail_in,e.hold=t.state.hold,e.bits=t.state.bits,e}function RESTORE(t){var e=t.strm;e.next_in=t.next,e.avail_out=t.left,e.avail_in=t.have,e.state.hold=t.hold,e.state.bits=t.bits}function INITBITS(t){t.hold=0,t.bits=0}function PULLBYTE(t){return 0!=t.have&&(t.have--,t.hold+=(255&t.strm.input_data.charCodeAt(t.next++))<<t.bits,t.bits+=8,!0)}function NEEDBITS(t,e){for(;t.bits<e;)if(!PULLBYTE(t))return!1;return!0}function BITS(t,e){return t.hold&(1<<e)-1}function DROPBITS(t,e){t.hold>>>=e,t.bits-=e}function BYTEBITS(t){t.hold>>>=7&t.bits,t.bits-=7&t.bits}function REVERSE(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}var inflate_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];ZLIB.inflate=function(t,e){var s,a,i,r,o,n,h,l,d,c=-1,p=-1;if(!t||!t.state||!t.input_data&&0!=t.avail_in)return ZLIB.Z_STREAM_ERROR;(s=t.state).mode==TYPE&&(s.mode=TYPEDO),LOAD(t,a={}),i=a.have,r=a.left,d=ZLIB.Z_OK;t:for(;;)switch(s.mode){case HEAD:if(0==s.wrap){s.mode=TYPEDO;break}if(!NEEDBITS(a,16))break t;if(2&s.wrap&&35615==a.hold){s.check=t.checksum_function(0,null,0,0),CRC2(t,a.hold),INITBITS(a),s.mode=FLAGS;break}if(s.flags=0,null!==s.head&&(s.head.done=-1),!(1&s.wrap)||((BITS(a,8)<<8)+(a.hold>>>8))%31){t.msg="incorrect header check",s.mode=BAD;break}if(BITS(a,4)!=ZLIB.Z_DEFLATED){t.msg="unknown compression method",s.mode=BAD;break}if(DROPBITS(a,4),l=BITS(a,4)+8,0==s.wbits)s.wbits=l;else if(l>s.wbits){t.msg="invalid window size",s.mode=BAD;break}s.dmax=1<<l,t.adler=s.check=t.checksum_function(0,null,0,0),s.mode=512&a.hold?DICTID:TYPE,INITBITS(a);break;case FLAGS:if(!NEEDBITS(a,16))break t;if(s.flags=a.hold,(255&s.flags)!=ZLIB.Z_DEFLATED){t.msg="unknown compression method",s.mode=BAD;break}if(57344&s.flags){t.msg="unknown header flags set",s.mode=BAD;break}null!==s.head&&(s.head.text=a.hold>>>8&1),512&s.flags&&CRC2(t,a.hold),INITBITS(a),s.mode=TIME;case TIME:if(!NEEDBITS(a,32))break t;null!==s.head&&(s.head.time=a.hold),512&s.flags&&CRC4(t,a.hold),INITBITS(a),s.mode=OS;case OS:if(!NEEDBITS(a,16))break t;null!==s.head&&(s.head.xflags=255&a.hold,s.head.os=a.hold>>>8),512&s.flags&&CRC2(t,a.hold),INITBITS(a),s.mode=EXLEN;case EXLEN:if(1024&s.flags){if(!NEEDBITS(a,16))break t;s.length=a.hold,null!==s.head&&(s.head.extra_len=a.hold),512&s.flags&&CRC2(t,a.hold),INITBITS(a),s.head.extra=""}else null!==s.head&&(s.head.extra=null);s.mode=EXTRA;case EXTRA:if(1024&s.flags&&((o=s.length)>a.have&&(o=a.have),o&&(null!==s.head&&null!==s.head.extra&&(l=s.head.extra_len-s.length,s.head.extra+=t.input_data.substring(a.next,a.next+(l+o>s.head.extra_max?s.head.extra_max-l:o))),512&s.flags&&(s.check=t.checksum_function(s.check,t.input_data,a.next,o)),a.have-=o,a.next+=o,s.length-=o),s.length))break t;s.length=0,s.mode=NAME;case NAME:if(2048&s.flags){if(0==a.have)break t;null!==s.head&&null===s.head.name&&(s.head.name=""),o=0;do{if(l=t.input_data.charAt(a.next+o),o++,"\0"===l)break;null!==s.head&&s.length<s.head.name_max&&(s.head.name+=l,s.length++)}while(o<a.have);if(512&s.flags&&(s.check=t.checksum_function(s.check,t.input_data,a.next,o)),a.have-=o,a.next+=o,"\0"!==l)break t}else null!==s.head&&(s.head.name=null);s.length=0,s.mode=COMMENT;case COMMENT:if(4096&s.flags){if(0==a.have)break t;o=0,null!==s.head&&null===s.head.comment&&(s.head.comment="");do{if(l=t.input_data.charAt(a.next+o),o++,"\0"===l)break;null!==s.head&&s.length<s.head.comm_max&&(s.head.comment+=l,s.length++)}while(o<a.have);if(512&s.flags&&(s.check=t.checksum_function(s.check,t.input_data,a.next,o)),a.have-=o,a.next+=o,"\0"!==l)break t}else null!==s.head&&(s.head.comment=null);s.mode=HCRC;case HCRC:if(512&s.flags){if(!NEEDBITS(a,16))break t;if(a.hold!=(65535&s.check)){t.msg="header crc mismatch",s.mode=BAD;break}INITBITS(a)}null!==s.head&&(s.head.hcrc=s.flags>>>9&1,s.head.done=1),t.adler=s.check=t.checksum_function(0,null,0,0),s.mode=TYPE;break;case DICTID:if(!NEEDBITS(a,32))break t;t.adler=s.check=REVERSE(a.hold),INITBITS(a),s.mode=DICT;case DICT:if(0==s.havedict)return RESTORE(a),ZLIB.Z_NEED_DICT;t.adler=s.check=t.checksum_function(0,null,0,0),s.mode=TYPE;case TYPE:if(e==ZLIB.Z_BLOCK||e==ZLIB.Z_TREES)break t;case TYPEDO:if(s.last){BYTEBITS(a),s.mode=CHECK;break}if(!NEEDBITS(a,3))break t;switch(s.last=BITS(a,1),DROPBITS(a,1),BITS(a,2)){case 0:s.mode=STORED;break;case 1:if(fixedtables(s),s.mode=LEN_,e==ZLIB.Z_TREES){DROPBITS(a,2);break t}break;case 2:s.mode=TABLE;break;case 3:t.msg="invalid block type",s.mode=BAD}DROPBITS(a,2);break;case STORED:if(BYTEBITS(a),!NEEDBITS(a,32))break t;if((65535&a.hold)!=(a.hold>>>16&65535^65535)){t.msg="invalid stored block lengths",s.mode=BAD;break}if(s.length=65535&a.hold,INITBITS(a),s.mode=COPY_,e==ZLIB.Z_TREES)break t;case COPY_:s.mode=COPY;case COPY:if(o=s.length){if(o>a.have&&(o=a.have),o>a.left&&(o=a.left),0==o)break t;t.output_data+=t.input_data.substring(a.next,a.next+o),t.next_out+=o,a.have-=o,a.next+=o,a.left-=o,s.length-=o;break}s.mode=TYPE;break;case TABLE:if(!NEEDBITS(a,14))break t;if(s.nlen=BITS(a,5)+257,DROPBITS(a,5),s.ndist=BITS(a,5)+1,DROPBITS(a,5),s.ncode=BITS(a,4)+4,DROPBITS(a,4),s.nlen>286||s.ndist>30){t.msg="too many length or distance symbols",s.mode=BAD;break}s.have=0,s.mode=LENLENS;case LENLENS:for(;s.have<s.ncode;){if(!NEEDBITS(a,3))break t;var u=BITS(a,3);s.lens[inflate_order[s.have++]]=u,DROPBITS(a,3)}for(;s.have<19;)s.lens[inflate_order[s.have++]]=0;if(s.next=0,s.lencode=0,s.lenbits=7,d=inflate_table(s,CODES)){t.msg="invalid code lengths set",s.mode=BAD;break}s.have=0,s.mode=CODELENS;case CODELENS:for(;s.have<s.nlen+s.ndist;){for(;!((n=s.codes[s.lencode+BITS(a,s.lenbits)]).bits<=a.bits);)if(!PULLBYTE(a))break t;if(n.val<16)DROPBITS(a,n.bits),s.lens[s.have++]=n.val;else{if(16==n.val){if(!NEEDBITS(a,n.bits+2))break t;if(DROPBITS(a,n.bits),0==s.have){t.msg="invalid bit length repeat",s.mode=BAD;break}l=s.lens[s.have-1],o=3+BITS(a,2),DROPBITS(a,2)}else if(17==n.val){if(!NEEDBITS(a,n.bits+3))break t;DROPBITS(a,n.bits),l=0,o=3+BITS(a,3),DROPBITS(a,3)}else{if(!NEEDBITS(a,n.bits+7))break t;DROPBITS(a,n.bits),l=0,o=11+BITS(a,7),DROPBITS(a,7)}if(s.have+o>s.nlen+s.ndist){t.msg="invalid bit length repeat",s.mode=BAD;break}for(;o--;)s.lens[s.have++]=l}}if(s.mode==BAD)break;if(0==s.lens[256]){t.msg="invalid code -- missing end-of-block",s.mode=BAD;break}if(s.next=0,s.lencode=s.next,s.lenbits=9,d=inflate_table(s,LENS)){t.msg="invalid literal/lengths set",s.mode=BAD;break}if(s.distcode=s.next,s.distbits=6,d=inflate_table(s,DISTS)){t.msg="invalid distances set",s.mode=BAD;break}if(s.mode=LEN_,e==ZLIB.Z_TREES)break t;case LEN_:s.mode=LEN;case LEN:if(a.have>=6&&a.left>=258){RESTORE(a),inflate_fast(t,r),LOAD(t,a),s.mode==TYPE&&(s.back=-1);break}for(s.back=0;!((n=s.codes[s.lencode+BITS(a,s.lenbits)]).bits<=a.bits);)if(!PULLBYTE(a))break t;if(n.op&&0==(240&n.op)){for(h=n;n=s.codes[s.lencode+h.val+(BITS(a,h.bits+h.op)>>>h.bits)],!(h.bits+n.bits<=a.bits);)if(!PULLBYTE(a))break t;DROPBITS(a,h.bits),s.back+=h.bits}if(DROPBITS(a,n.bits),s.back+=n.bits,s.length=n.val,0==n.op){s.mode=LIT;break}if(32&n.op){s.back=-1,s.mode=TYPE;break}if(64&n.op){t.msg="invalid literal/length code",s.mode=BAD;break}s.extra=15&n.op,s.mode=LENEXT;case LENEXT:if(s.extra){if(!NEEDBITS(a,s.extra))break t;s.length+=BITS(a,s.extra),DROPBITS(a,s.extra),s.back+=s.extra}s.was=s.length,s.mode=DIST;case DIST:for(;!((n=s.codes[s.distcode+BITS(a,s.distbits)]).bits<=a.bits);)if(!PULLBYTE(a))break t;if(0==(240&n.op)){for(h=n;n=s.codes[s.distcode+h.val+(BITS(a,h.bits+h.op)>>>h.bits)],!(h.bits+n.bits<=a.bits);)if(!PULLBYTE(a))break t;DROPBITS(a,h.bits),s.back+=h.bits}if(DROPBITS(a,n.bits),s.back+=n.bits,64&n.op){t.msg="invalid distance code",s.mode=BAD;break}s.offset=n.val,s.extra=15&n.op,s.mode=DISTEXT;case DISTEXT:if(s.extra){if(!NEEDBITS(a,s.extra))break t;s.offset+=BITS(a,s.extra),DROPBITS(a,s.extra),s.back+=s.extra}s.mode=MATCH;case MATCH:if(0==a.left)break t;if(o=r-a.left,s.offset>o){if((o=s.offset-o)>s.whave&&s.sane){t.msg="invalid distance too far back",s.mode=BAD;break}o>s.wnext?(o-=s.wnext,c=s.wsize-o,p=-1):(c=s.wnext-o,p=-1),o>s.length&&(o=s.length)}else c=-1,p=t.next_out-s.offset,o=s.length;if(o>a.left&&(o=a.left),a.left-=o,s.length-=o,c>=0)t.output_data+=s.window.substring(c,c+o),t.next_out+=o,o=0;else{t.next_out+=o;do{t.output_data+=t.output_data.charAt(p++)}while(--o)}0==s.length&&(s.mode=LEN);break;case LIT:if(0==a.left)break t;t.output_data+=String.fromCharCode(s.length),t.next_out++,a.left--,s.mode=LEN;break;case CHECK:if(s.wrap){if(!NEEDBITS(a,32))break t;if(r-=a.left,t.total_out+=r,s.total+=r,r&&(t.adler=s.check=t.checksum_function(s.check,t.output_data,t.output_data.length-r,r)),r=a.left,(s.flags?a.hold:REVERSE(a.hold))!=s.check){t.msg="incorrect data check",s.mode=BAD;break}INITBITS(a)}s.mode=LENGTH;case LENGTH:if(s.wrap&&s.flags){if(!NEEDBITS(a,32))break t;if(a.hold!=(4294967295&s.total)){t.msg="incorrect length check",s.mode=BAD;break}INITBITS(a)}s.mode=DONE;case DONE:d=ZLIB.Z_STREAM_END;break t;case BAD:d=ZLIB.Z_DATA_ERROR;break t;case MEM:return ZLIB.Z_MEM_ERROR;default:return ZLIB.Z_STREAM_ERROR}return RESTORE(a),(s.wsize||r!=t.avail_out&&s.mode<BAD&&(s.mode<CHECK||e!=ZLIB.Z_FINISH))&&updatewindow(t)?(s.mode=MEM,ZLIB.Z_MEM_ERROR):(i-=t.avail_in,r-=t.avail_out,t.total_in+=i,t.total_out+=r,s.total+=r,s.wrap&&r&&(t.adler=s.check=t.checksum_function(s.check,t.output_data,0,t.output_data.length)),t.data_type=s.bits+(s.last?64:0)+(s.mode==TYPE?128:0)+(s.mode==LEN_||s.mode==COPY_?256:0),(0==i&&0==r||e==ZLIB.Z_FINISH)&&d==ZLIB.Z_OK&&(d=ZLIB.Z_BUF_ERROR),d)},ZLIB.inflateEnd=function(t){return t&&t.state?(t.state.window=null,t.state=null,ZLIB.Z_OK):ZLIB.Z_STREAM_ERROR},ZLIB.z_stream.prototype.inflate=function(t,e){var s,a;this.input_data=t,this.next_in=getarg(e,"next_in",0),this.avail_in=getarg(e,"avail_in",t.length-this.next_in),s=getarg(e,"flush",ZLIB.Z_SYNC_FLUSH),a=getarg(e,"avail_out",-1);var i="";do{if(this.avail_out=a>=0?a:16384,this.output_data="",this.next_out=0,this.error=ZLIB.inflate(this,s),0!=this.error&&console.error("zlib error",this.error),a>=0)return this.output_data;if(i+=this.output_data,this.avail_out>0)break}while(this.error==ZLIB.Z_OK);return i},ZLIB.z_stream.prototype.inflateReset=function(t){return ZLIB.inflateReset(this,t)}}(),void 0===ZLIB&&alert("ZLIB is not defined. SRC zlib.js before zlib-adler32.js"),BASE=65521,NMAX=5552,ZLIB.adler32=function(t,e,s,a){return"string"==typeof e?function(t,e,s,a){var i,r;if(i=t>>>16&65535,t&=65535,1==a)return(t+=255&e.charCodeAt(s))>=BASE&&(t-=BASE),(i+=t)>=BASE&&(i-=BASE),t|i<<16;if(null===e)return 1;if(a<16){for(;a--;)i+=t+=255&e.charCodeAt(s++);return t>=BASE&&(t-=BASE),t|(i%=BASE)<<16}for(;a>=NMAX;){a-=NMAX,r=347;do{i+=t+=255&e.charCodeAt(s++),i+=t+=255&e.charCodeAt(s++),i+=t+=255&e.charCodeAt(s++),i+=t+=255&e.charCodeAt(s++),i+=t+=255&e.charCodeAt(s++),i+=t+=255&e.charCodeAt(s++),i+=t+=255&e.charCodeAt(s++),i+=t+=255&e.charCodeAt(s++),i+=t+=255&e.charCodeAt(s++),i+=t+=255&e.charCodeAt(s++),i+=t+=255&e.charCodeAt(s++),i+=t+=255&e.charCodeAt(s++),i+=t+=255&e.charCodeAt(s++),i+=t+=255&e.charCodeAt(s++),i+=t+=255&e.charCodeAt(s++),i+=t+=255&e.charCodeAt(s++)}while(--r);t%=BASE,i%=BASE}if(a){for(;a>=16;)a-=16,i+=t+=255&e.charCodeAt(s++),i+=t+=255&e.charCodeAt(s++),i+=t+=255&e.charCodeAt(s++),i+=t+=255&e.charCodeAt(s++),i+=t+=255&e.charCodeAt(s++),i+=t+=255&e.charCodeAt(s++),i+=t+=255&e.charCodeAt(s++),i+=t+=255&e.charCodeAt(s++),i+=t+=255&e.charCodeAt(s++),i+=t+=255&e.charCodeAt(s++),i+=t+=255&e.charCodeAt(s++),i+=t+=255&e.charCodeAt(s++),i+=t+=255&e.charCodeAt(s++),i+=t+=255&e.charCodeAt(s++),i+=t+=255&e.charCodeAt(s++),i+=t+=255&e.charCodeAt(s++);for(;a--;)i+=t+=255&e.charCodeAt(s++);t%=BASE,i%=BASE}return t|i<<16}(t,e,s,a):function(t,e,s,a){var i,r;if(i=t>>>16&65535,t&=65535,1==a)return(t+=e[s])>=BASE&&(t-=BASE),(i+=t)>=BASE&&(i-=BASE),t|i<<16;if(null===e)return 1;if(a<16){for(;a--;)i+=t+=e[s++];return t>=BASE&&(t-=BASE),t|(i%=BASE)<<16}for(;a>=NMAX;){a-=NMAX,r=347;do{i+=t+=e[s++],i+=t+=e[s++],i+=t+=e[s++],i+=t+=e[s++],i+=t+=e[s++],i+=t+=e[s++],i+=t+=e[s++],i+=t+=e[s++],i+=t+=e[s++],i+=t+=e[s++],i+=t+=e[s++],i+=t+=e[s++],i+=t+=e[s++],i+=t+=e[s++],i+=t+=e[s++],i+=t+=e[s++]}while(--r);t%=BASE,i%=BASE}if(a){for(;a>=16;)a-=16,i+=t+=e[s++],i+=t+=e[s++],i+=t+=e[s++],i+=t+=e[s++],i+=t+=e[s++],i+=t+=e[s++],i+=t+=e[s++],i+=t+=e[s++],i+=t+=e[s++],i+=t+=e[s++],i+=t+=e[s++],i+=t+=e[s++],i+=t+=e[s++],i+=t+=e[s++],i+=t+=e[s++],i+=t+=e[s++];for(;a--;)i+=t+=e[s++];t%=BASE,i%=BASE}return t|i<<16}(t,e,s,a)},ZLIB.adler32_combine=function(t,e,s){var a,i,r;return s<0?4294967295:(i=(r=s%=BASE)*(a=65535&t),i%=BASE,(a+=(65535&e)+BASE-1)>=BASE&&(a-=BASE),a>=BASE&&(a-=BASE),(i+=(t>>16&65535)+(e>>16&65535)+BASE-r)>=131042&&(i-=131042),i>=BASE&&(i-=BASE),a|i<<16)},void 0===ZLIB&&alert("ZLIB is not defined. SRC zlib.js before zlib-crc32.js"),function(){var t=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];function e(t,e){var s,a=0;for(s=0;e;)1&e&&(s^=t[a]),e>>=1,a++;return s}function s(t,s){var a;for(a=0;a<32;a++)t[a]=e(s,s[a])}ZLIB.crc32=function(e,s,a,i){return"string"==typeof s?function(e,s,a,i){if(null==s)return 0;for(e^=4294967295;i>=8;)e=t[255&(e^s.charCodeAt(a++))]^e>>>8,e=t[255&(e^s.charCodeAt(a++))]^e>>>8,e=t[255&(e^s.charCodeAt(a++))]^e>>>8,e=t[255&(e^s.charCodeAt(a++))]^e>>>8,e=t[255&(e^s.charCodeAt(a++))]^e>>>8,e=t[255&(e^s.charCodeAt(a++))]^e>>>8,e=t[255&(e^s.charCodeAt(a++))]^e>>>8,e=t[255&(e^s.charCodeAt(a++))]^e>>>8,i-=8;if(i)do{e=t[255&(e^s.charCodeAt(a++))]^e>>>8}while(--i);return 4294967295^e}(e,s,a,i):function(e,s,a,i){if(null==s)return 0;for(e^=4294967295;i>=8;)e=t[255&(e^s[a++])]^e>>>8,e=t[255&(e^s[a++])]^e>>>8,e=t[255&(e^s[a++])]^e>>>8,e=t[255&(e^s[a++])]^e>>>8,e=t[255&(e^s[a++])]^e>>>8,e=t[255&(e^s[a++])]^e>>>8,e=t[255&(e^s[a++])]^e>>>8,e=t[255&(e^s[a++])]^e>>>8,i-=8;if(i)do{e=t[255&(e^s[a++])]^e>>>8}while(--i);return 4294967295^e}(e,s,a,i)},ZLIB.crc32_combine=function(t,a,i){var r,o,n,h;if(i<=0)return t;for(n=new Array(32),(h=new Array(32))[0]=3988292384,o=1,r=1;r<32;r++)h[r]=o,o<<=1;s(n,h),s(h,n);do{if(s(n,h),1&i&&(t=e(n,t)),0==(i>>=1))break;s(h,n),1&i&&(t=e(h,t)),i>>=1}while(0!=i);return t^a}}(),module.exports=ZLIB}},__webpack_module_cache__={};function __nested_webpack_require_90230__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var s=__webpack_module_cache__[t]={exports:{}};return __webpack_modules__[t](s,s.exports,__nested_webpack_require_90230__),s.exports}__nested_webpack_require_90230__.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return __nested_webpack_require_90230__.d(e,{a:e}),e},__nested_webpack_require_90230__.d=(t,e)=>{for(var s in e)__nested_webpack_require_90230__.o(e,s)&&!__nested_webpack_require_90230__.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},__nested_webpack_require_90230__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),__nested_webpack_require_90230__.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var __nested_webpack_exports__={};return(()=>{"use strict";__nested_webpack_require_90230__.r(__nested_webpack_exports__),__nested_webpack_require_90230__.d(__nested_webpack_exports__,{AMTDesktop:()=>e.r,AMTIDER:()=>t.i,AMTKeyCodeConverter:()=>c.qD,AMTKvmDataRedirector:()=>s.N,AMTRedirector:()=>a.K,AmtTerminal:()=>i.r,CommsHelper:()=>c.Xn,DataProcessor:()=>l.$,Desktop:()=>o.H,Encoding:()=>d.ez,FrameBufferBellServerCutText:()=>d.Ut,HandshakeState:()=>d.wW,ImageHelper:()=>c.jw,KeyBoardHelper:()=>c.EB,MouseHelper:()=>c.xx,Protocol:()=>a.b,RLEDecoder:()=>l.X,SecurityOptions:()=>d.ll,SecurityResponse:()=>d.mC,ServerInit:()=>d.Cu,StateProcessorFactory:()=>n.v,TerminalDataProcessor:()=>h.Q,TypeConverter:()=>r.r,isTruthy:()=>c.fQ});var t=__nested_webpack_require_90230__(382),e=__nested_webpack_require_90230__(40),s=__nested_webpack_require_90230__(986),a=__nested_webpack_require_90230__(198),i=__nested_webpack_require_90230__(567),r=__nested_webpack_require_90230__(995),o=__nested_webpack_require_90230__(512),n=__nested_webpack_require_90230__(354),h=__nested_webpack_require_90230__(467),l=__nested_webpack_require_90230__(569),d=__nested_webpack_require_90230__(421),c=__nested_webpack_require_90230__(708)})(),__nested_webpack_exports__})(),module.exports=e()},648:(t,e,s)=>{"use strict";s.d(e,{Z:()=>n});var a=s(213),i=s.n(a),r=s(645),o=s.n(r)()(i());o.push([t.id,".button{margin-right:3px;padding:2px;min-width:90px}",""]);const n=o},625:(t,e,s)=>{"use strict";s.d(e,{Z:()=>n});var a=s(213),i=s.n(a),r=s(645),o=s.n(r)()(i());o.push([t.id,".encoding{margin-left:10px}.encoding label{padding:2px;font-size:15px}.encoding select{padding:2px 0}.reldisabled{opacity:.5}",""]);const n=o},734:(t,e,s)=>{"use strict";s.d(e,{Z:()=>n});var a=s(213),i=s.n(a),r=s(645),o=s.n(r)()(i());o.push([t.id,".header{background-color:#a9a9a9;padding:5px;font-size:13px}",""]);const n=o},250:(t,e,s)=>{"use strict";s.d(e,{Z:()=>n});var a=s(213),i=s.n(a),r=s(645),o=s.n(r)()(i());o.push([t.id,".canvas{max-height:90%;max-width:100%}",""]);const n=o},917:(t,e,s)=>{"use strict";s.d(e,{Z:()=>n});var a=s(213),i=s.n(a),r=s(645),o=s.n(r)()(i());o.push([t.id,"*{margin:0;padding:0;box-sizing:border-box}.canvas-container{height:100vh;text-align:center;background-color:#fff}",""]);const n=o},645:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var s="",a=void 0!==e[5];return e[4]&&(s+="@supports (".concat(e[4],") {")),e[2]&&(s+="@media ".concat(e[2]," {")),a&&(s+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),s+=t(e),a&&(s+="}"),e[2]&&(s+="}"),e[4]&&(s+="}"),s})).join("")},e.i=function(t,s,a,i,r){"string"==typeof t&&(t=[[null,t,void 0]]);var o={};if(a)for(var n=0;n<this.length;n++){var h=this[n][0];null!=h&&(o[h]=!0)}for(var l=0;l<t.length;l++){var d=[].concat(t[l]);a&&o[d[0]]||(void 0!==r&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=r),s&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=s):d[2]=s),i&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=i):d[4]="".concat(i)),e.push(d))}},e}},213:t=>{"use strict";t.exports=function(t){return t[1]}},81:(t,e,s)=>{"use strict";var a=s(379),i=s.n(a),r=s(795),o=s.n(r),n=s(569),h=s.n(n),l=s(565),d=s.n(l),c=s(216),p=s.n(c),u=s(589),b=s.n(u),v=s(648),f={};f.styleTagTransform=b(),f.setAttributes=d(),f.insert=h().bind(null,"head"),f.domAPI=o(),f.insertStyleElement=p(),i()(v.Z,f),v.Z&&v.Z.locals&&v.Z.locals},943:(t,e,s)=>{"use strict";var a=s(379),i=s.n(a),r=s(795),o=s.n(r),n=s(569),h=s.n(n),l=s(565),d=s.n(l),c=s(216),p=s.n(c),u=s(589),b=s.n(u),v=s(625),f={};f.styleTagTransform=b(),f.setAttributes=d(),f.insert=h().bind(null,"head"),f.domAPI=o(),f.insertStyleElement=p(),i()(v.Z,f),v.Z&&v.Z.locals&&v.Z.locals},22:(t,e,s)=>{"use strict";var a=s(379),i=s.n(a),r=s(795),o=s.n(r),n=s(569),h=s.n(n),l=s(565),d=s.n(l),c=s(216),p=s.n(c),u=s(589),b=s.n(u),v=s(734),f={};f.styleTagTransform=b(),f.setAttributes=d(),f.insert=h().bind(null,"head"),f.domAPI=o(),f.insertStyleElement=p(),i()(v.Z,f),v.Z&&v.Z.locals&&v.Z.locals},651:(t,e,s)=>{"use strict";var a=s(379),i=s.n(a),r=s(795),o=s.n(r),n=s(569),h=s.n(n),l=s(565),d=s.n(l),c=s(216),p=s.n(c),u=s(589),b=s.n(u),v=s(250),f={};f.styleTagTransform=b(),f.setAttributes=d(),f.insert=h().bind(null,"head"),f.domAPI=o(),f.insertStyleElement=p(),i()(v.Z,f),v.Z&&v.Z.locals&&v.Z.locals},461:(t,e,s)=>{"use strict";var a=s(379),i=s.n(a),r=s(795),o=s.n(r),n=s(569),h=s.n(n),l=s(565),d=s.n(l),c=s(216),p=s.n(c),u=s(589),b=s.n(u),v=s(917),f={};f.styleTagTransform=b(),f.setAttributes=d(),f.insert=h().bind(null,"head"),f.domAPI=o(),f.insertStyleElement=p(),i()(v.Z,f),v.Z&&v.Z.locals&&v.Z.locals},379:t=>{"use strict";var e=[];function s(t){for(var s=-1,a=0;a<e.length;a++)if(e[a].identifier===t){s=a;break}return s}function a(t,a){for(var r={},o=[],n=0;n<t.length;n++){var h=t[n],l=a.base?h[0]+a.base:h[0],d=r[l]||0,c="".concat(l," ").concat(d);r[l]=d+1;var p=s(c),u={css:h[1],media:h[2],sourceMap:h[3],supports:h[4],layer:h[5]};if(-1!==p)e[p].references++,e[p].updater(u);else{var b=i(u,a);a.byIndex=n,e.splice(n,0,{identifier:c,updater:b,references:1})}o.push(c)}return o}function i(t,e){var s=e.domAPI(e);return s.update(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;s.update(t=e)}else s.remove()}}t.exports=function(t,i){var r=a(t=t||[],i=i||{});return function(t){t=t||[];for(var o=0;o<r.length;o++){var n=s(r[o]);e[n].references--}for(var h=a(t,i),l=0;l<r.length;l++){var d=s(r[l]);0===e[d].references&&(e[d].updater(),e.splice(d,1))}r=h}}},569:t=>{"use strict";var e={};t.exports=function(t,s){var a=function(t){if(void 0===e[t]){var s=document.querySelector(t);if(window.HTMLIFrameElement&&s instanceof window.HTMLIFrameElement)try{s=s.contentDocument.head}catch(t){s=null}e[t]=s}return e[t]}(t);if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(s)}},216:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},565:(t,e,s)=>{"use strict";t.exports=function(t){var e=s.nc;e&&t.setAttribute("nonce",e)}},795:t=>{"use strict";t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(s){!function(t,e,s){var a="";s.supports&&(a+="@supports (".concat(s.supports,") {")),s.media&&(a+="@media ".concat(s.media," {"));var i=void 0!==s.layer;i&&(a+="@layer".concat(s.layer.length>0?" ".concat(s.layer):""," {")),a+=s.css,i&&(a+="}"),s.media&&(a+="}"),s.supports&&(a+="}");var r=s.sourceMap;r&&"undefined"!=typeof btoa&&(a+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),e.styleTagTransform(a,t,e.options)}(e,t,s)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},589:t=>{"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},866:(t,e,s)=>{"use strict";s.d(e,{N:()=>r});var a=s(639),i=s.n(a);s(81);class r extends i().Component{render(){return i().createElement("button",{className:"button",onClick:this.props.handleConnectClick},1===this.props.kvmstate?"Connecting KVM":2===this.props.kvmstate?"Disconnect KVM":"Connect KVM")}}},116:(t,e,s)=>{"use strict";s.d(e,{m:()=>o});var a=s(639),i=s.n(a),r=s(572);class o extends i().Component{constructor(t){super(t),this.desktopsettings={encoding:1},this.changeEncoding=this.changeEncoding.bind(this)}changeEncoding(t){this.desktopsettings.encoding=t,this.props.changeDesktopSettings(this.desktopsettings)}render(){return i().createElement(r.S,{changeEncoding:this.changeEncoding,getConnectState:this.props.getConnectState})}}},572:(t,e,s)=>{"use strict";s.d(e,{S:()=>r});var a=s(639),i=s.n(a);s(943);class r extends i().Component{constructor(t){super(t),this.state={value:1},this.onEncodingChange=this.onEncodingChange.bind(this)}onEncodingChange(t){this.setState({value:t.target.value}),this.props.changeEncoding(t.target.value)}render(){return i().createElement("span",{className:"encoding"},i().createElement("label",null,"Encoding:"),i().createElement("select",{value:this.state.value,className:2===this.props.getConnectState()?"reldisabled":"",onChange:this.onEncodingChange,disabled:2===this.props.getConnectState()},i().createElement("option",{value:"1"},"RLE 8"),i().createElement("option",{value:"2"},"RLE 16")))}}},9:(t,e,s)=>{"use strict";s.d(e,{h:()=>n});var a=s(639),i=s.n(a),r=s(866),o=s(116);s(22);class n extends i().Component{render(){return i().createElement(i().Fragment,null,i().createElement("div",{className:"header"},i().createElement(r.N,{handleConnectClick:this.props.handleConnectClick,kvmstate:this.props.kvmstate}),i().createElement(o.m,{changeDesktopSettings:this.props.changeDesktopSettings,getConnectState:this.props.getConnectState})))}}},568:(t,e,s)=>{"use strict";s.d(e,{U:()=>o});var a=s(639),i=s.n(a),r=s(518);s(651);class o extends i().Component{shouldComponentUpdate(){return!1}render(){const t={width:"1366",height:"768",onContextMenu:t=>(t.preventDefault(),!1),onMouseDown:this.props.mouseDown,onMouseUp:this.props.mouseUp,onMouseMove:this.props.mouseMove};return i().createElement("canvas",Object.assign({},t,{"data-testid":"pure-canvas-testid",className:"canvas",ref:t=>(0,r.X0)(t)?this.props.contextRef(t.getContext("2d")):null}))}}},518:(t,e,s)=>{"use strict";s.d(e,{X0:()=>a});const a=t=>null!=t&&""!==t&&!1!==t&&0!==t},639:t=>{"use strict";t.exports=__WEBPACK_EXTERNAL_MODULE__639__}},__webpack_module_cache__={};function __webpack_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var s=__webpack_module_cache__[t]={id:t,exports:{}};return __webpack_modules__[t](s,s.exports,__webpack_require__),s.exports}__webpack_require__.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return __webpack_require__.d(e,{a:e}),e},__webpack_require__.d=(t,e)=>{for(var s in e)__webpack_require__.o(e,s)&&!__webpack_require__.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},__webpack_require__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),__webpack_require__.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},__webpack_require__.nc=void 0;var __webpack_exports__={};return(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{KVM:()=>o});var t=__webpack_require__(869),e=__webpack_require__(9),s=__webpack_require__(568),a=__webpack_require__(518),i=__webpack_require__(639),r=__webpack_require__.n(i);__webpack_require__(461);class o extends r().Component{constructor(t){super(t),this.desktopSettingsChange=!1,this.state={kvmstate:0,encodingOption:1},this.saveContext=this.saveContext.bind(this),this.startKVM=this.startKVM.bind(this),this.stopKVM=this.stopKVM.bind(this),this.handleConnectClick=this.handleConnectClick.bind(this),this.getRenderStatus=this.getRenderStatus.bind(this),this.OnConnectionStateChange=this.OnConnectionStateChange.bind(this),this.changeDesktopSettings=this.changeDesktopSettings.bind(this)}saveContext(t){this.ctx=t,this.init()}init(){const e=null!=this.props.deviceId?this.props.deviceId:"",s=null!=this.props.mpsServer?this.props.mpsServer.replace("http","ws"):"",a={mode:"kvm",protocol:t.Protocol.KVM,fr:new FileReader,host:e,port:16994,user:"",pass:"",tls:0,tls1only:0,authToken:this.props.authToken,server:s};this.module=new t.AMTDesktop(this.ctx),this.redirector=new t.AMTKvmDataRedirector(a),this.dataProcessor=new t.DataProcessor(this.redirector,this.module),this.mouseHelper=new t.MouseHelper(this.module,this.redirector,this.props.mouseDebounceTime<200?200:this.props.mouseDebounceTime),this.keyboard=new t.KeyBoardHelper(this.module,this.redirector),this.redirector.onProcessData=this.module.processData.bind(this.module),this.redirector.onStart=this.module.start.bind(this.module),this.redirector.onNewState=this.module.onStateChange.bind(this.module),this.redirector.onSendKvmData=this.module.onSendKvmData.bind(this.module),this.redirector.onStateChanged=this.OnConnectionStateChange.bind(this),this.redirector.onError=this.onRedirectorError.bind(this),this.module.onSend=this.redirector.send.bind(this.redirector),this.module.onProcessData=this.dataProcessor.processData.bind(this.dataProcessor),this.module.bpp=this.state.encodingOption}cleanUp(){this.module=null,this.redirector=null,this.dataProcessor=null,this.mouseHelper=null,this.keyboard=null,this.ctx.clearRect(0,0,this.ctx.canvas.height,this.ctx.canvas.width)}componentWillUnmount(){this.stopKVM()}onRedirectorError(){this.reset()}reset(){this.cleanUp(),this.init()}OnConnectionStateChange(t,e){this.setState({kvmstate:e}),this.desktopSettingsChange&&0===e&&(this.desktopSettingsChange=!1,setTimeout((()=>this.startKVM()),2e3))}changeDesktopSettings(t){2===this.state.kvmstate?(this.desktopSettingsChange=!0,this.module.bpp=t.encoding,this.stopKVM()):(this.setState({encodingOption:parseInt(t.encoding)}),this.module.bpp=parseInt(t.encoding))}startKVM(){void 0!==this.redirector&&this.redirector.start(WebSocket),void 0!==this.keyboard&&this.keyboard.GrabKeyInput()}stopKVM(){void 0!==this.redirector&&this.redirector.stop(),void 0!==this.keyboard&&this.keyboard.UnGrabKeyInput(),this.reset()}getRenderStatus(){return this.module.state}handleConnectClick(t){t.persist(),0===this.state.kvmstate?this.startKVM():1===this.state.kvmstate||2===this.state.kvmstate&&this.stopKVM()}componentDidUpdate(t){t.deviceId!==this.props.deviceId&&this.stopKVM()}render(){return r().createElement("div",{className:"canvas-container"},(0,a.X0)(this.props.autoConnect)?"":r().createElement(e.h,{key:"kvm_header",handleConnectClick:this.handleConnectClick,getConnectState:()=>this.state.kvmstate,kvmstate:this.state.kvmstate,changeDesktopSettings:this.changeDesktopSettings,deviceId:this.props.deviceId,server:this.props.mpsServer}),r().createElement(s.U,{key:"kvm_comp",contextRef:t=>this.saveContext(t),canvasHeight:this.props.canvasHeight,canvasWidth:this.props.canvasWidth,mouseMove:t=>{void 0!==this.mouseHelper&&this.mouseHelper.mousemove(t)},mouseDown:t=>{void 0!==this.mouseHelper&&this.mouseHelper.mousedown(t)},mouseUp:t=>{void 0!==this.mouseHelper&&this.mouseHelper.mouseup(t)}}))}}})(),__webpack_exports__})()));
|