Local modifications to ClusterLabs/Anvil by Alteeve
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1 lines
139 KiB

"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[460],{94460:function(e,t,s){let i,r,n,a,o,h;s.d(t,{Z:function(){return tk}});let l="warn",_=()=>{},d=()=>{},c=()=>{},u=()=>{};function f(e,t=!1){try{return decodeURIComponent(escape(e))}catch(s){if(s instanceof URIError&&t)return e;throw s}}function p(e){return unescape(encodeURIComponent(e))}!function(e){if(void 0===e?e=l:l=e,_=d=c=u=()=>{},void 0!==window.console)switch(e){case"debug":_=console.debug.bind(window.console);case"info":d=console.info.bind(window.console);case"warn":c=console.warn.bind(window.console);case"error":u=console.error.bind(window.console);case"none":break;default:throw new window.Error("invalid logging type '"+e+"'")}}();let g="ontouchstart"in document.documentElement||void 0!==document.ontouchstart||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;window.addEventListener("touchstart",function e(){g=!0,window.removeEventListener("touchstart",e,!1)},!1);let m=10*(window.devicePixelRatio||1),w=!1;try{let e=document.createElement("canvas");e.style.cursor='url("data:image/x-icon;base64,AAACAAEACAgAAAIAAgA4AQAAFgAAACgAAAAIAAAAEAAAAAEAIAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAA==") 2 2, default',0===e.style.cursor.indexOf("url")?(d("Data URI scheme cursor supported"),w=!0):c("Data URI scheme cursor not supported")}catch(e){u("Data URI scheme cursor test exception: "+e)}let b=w;try{let e=document.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",document.body.appendChild(e);let t=document.createElement("div");e.appendChild(t),e.offsetWidth,t.offsetWidth,e.parentNode.removeChild(e)}catch(e){u("Scrollbar test exception: "+e)}function v(){return navigator&&!!/mac/i.exec(navigator.platform)}function k(){return navigator&&!!/win/i.exec(navigator.platform)}function y(){return navigator&&(!!/ipad/i.exec(navigator.platform)||!!/iphone/i.exec(navigator.platform)||!!/ipod/i.exec(navigator.platform))}function X(e,t,s){let i=s.getBoundingClientRect(),r={x:0,y:0};return e<i.left?r.x=0:e>=i.right?r.x=i.width-1:r.x=e-i.left,t<i.top?r.y=0:t>=i.bottom?r.y=i.height-1:r.y=t-i.top,r}function K(e){e.stopPropagation(),e.preventDefault()}let C=!1,F=null;function S(e){if(C)return;let t=new e.constructor(e.type,e);C=!0,document.captureElement?document.captureElement.dispatchEvent(t):F.dispatchEvent(t),C=!1,e.stopPropagation(),t.defaultPrevented&&e.preventDefault(),"mouseup"===e.type&&M()}function x(){document.getElementById("noVNC_mouse_capture_elem").style.cursor=window.getComputedStyle(document.captureElement).cursor}document.captureElement=null;let E=new MutationObserver(x);function M(){if(document.releaseCapture)document.releaseCapture(),document.captureElement=null;else{if(!document.captureElement)return;F=document.captureElement,document.captureElement=null,E.disconnect(),document.getElementById("noVNC_mouse_capture_elem").style.display="none",window.removeEventListener("mousemove",S),window.removeEventListener("mouseup",S)}}class A{constructor(){this._listeners=new Map}addEventListener(e,t){this._listeners.has(e)||this._listeners.set(e,new Set),this._listeners.get(e).add(t)}removeEventListener(e,t){this._listeners.has(e)&&this._listeners.get(e).delete(t)}dispatchEvent(e){return!this._listeners.has(e.type)||(this._listeners.get(e.type).forEach(t=>t.call(this,e)),!e.defaultPrevented)}}var Q,L,T,D,B,P,R={toBase64Table:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),base64Pad:"=",encode(e){let t="",s=e.length,i=s%3;for(let i=0;i<s-2;i+=3)t+=this.toBase64Table[e[i]>>2]+this.toBase64Table[((3&e[i])<<4)+(e[i+1]>>4)]+this.toBase64Table[((15&e[i+1])<<2)+(e[i+2]>>6)]+this.toBase64Table[63&e[i+2]];let r=s-i;return 2===i?t+=this.toBase64Table[e[r]>>2]+this.toBase64Table[((3&e[r])<<4)+(e[r+1]>>4)]+this.toBase64Table[(15&e[r+1])<<2]+this.toBase64Table[64]:1===i&&(t+=this.toBase64Table[e[r]>>2]+this.toBase64Table[(3&e[r])<<4]+this.toBase64Table[64]+this.toBase64Table[64]),t},toBinaryTable:[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,0,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1],decode(e,t=0){let s=e.indexOf("=")-t;s<0&&(s=e.length-t);let i=Array((s>>2)*3+Math.floor(s%4/1.5)),r=0,n=0;for(let s=0,a=t;a<e.length;a++){let t=this.toBinaryTable[127&e.charCodeAt(a)],o=e.charAt(a)===this.base64Pad;if(-1===t){u("Illegal character code "+e.charCodeAt(a)+" at position "+a);continue}n=n<<6|t,(r+=6)>=8&&(r-=8,o||(i[s++]=n>>r&255),n&=(1<<r)-1)}if(r){let e=Error("Corrupted base64 string");throw e.name="Base64-Error",e}return i}};class z{constructor(e){if(this._drawCtx=null,this._renderQ=[],this._flushing=!1,this._fbWidth=0,this._fbHeight=0,this._prevDrawStyle="",_(">> Display.constructor"),this._target=e,!this._target)throw Error("Target must be set");if("string"==typeof this._target)throw Error("target must be a DOM element");if(!this._target.getContext)throw Error("no getContext method");this._targetCtx=this._target.getContext("2d"),this._viewportLoc={x:0,y:0,w:this._target.width,h:this._target.height},this._backbuffer=document.createElement("canvas"),this._drawCtx=this._backbuffer.getContext("2d"),this._damageBounds={left:0,top:0,right:this._backbuffer.width,bottom:this._backbuffer.height},_("User Agent: "+navigator.userAgent),_("<< Display.constructor"),this._scale=1,this._clipViewport=!1,this.onflush=()=>{}}get scale(){return this._scale}set scale(e){this._rescale(e)}get clipViewport(){return this._clipViewport}set clipViewport(e){this._clipViewport=e;let t=this._viewportLoc;this.viewportChangeSize(t.w,t.h),this.viewportChangePos(0,0)}get width(){return this._fbWidth}get height(){return this._fbHeight}viewportChangePos(e,t){let s=this._viewportLoc;e=Math.floor(e),t=Math.floor(t),this._clipViewport||(e=-s.w,t=-s.h);let i=s.x+s.w-1,r=s.y+s.h-1;e<0&&s.x+e<0&&(e=-s.x),i+e>=this._fbWidth&&(e-=i+e-this._fbWidth+1),s.y+t<0&&(t=-s.y),r+t>=this._fbHeight&&(t-=r+t-this._fbHeight+1),(0!==e||0!==t)&&(_("viewportChange deltaX: "+e+", deltaY: "+t),s.x+=e,s.y+=t,this._damage(s.x,s.y,s.w,s.h),this.flip())}viewportChangeSize(e,t){this._clipViewport&&void 0!==e&&void 0!==t||(_("Setting viewport to full display region"),e=this._fbWidth,t=this._fbHeight),e=Math.floor(e),t=Math.floor(t),e>this._fbWidth&&(e=this._fbWidth),t>this._fbHeight&&(t=this._fbHeight);let s=this._viewportLoc;if(s.w!==e||s.h!==t){s.w=e,s.h=t;let i=this._target;i.width=e,i.height=t,this.viewportChangePos(0,0),this._damage(s.x,s.y,s.w,s.h),this.flip(),this._rescale(this._scale)}}absX(e){return 0===this._scale?0:0|e/this._scale+this._viewportLoc.x}absY(e){return 0===this._scale?0:0|e/this._scale+this._viewportLoc.y}resize(e,t){this._prevDrawStyle="",this._fbWidth=e,this._fbHeight=t;let s=this._backbuffer;if(s.width!==e||s.height!==t){let i=null;s.width>0&&s.height>0&&(i=this._drawCtx.getImageData(0,0,s.width,s.height)),s.width!==e&&(s.width=e),s.height!==t&&(s.height=t),i&&this._drawCtx.putImageData(i,0,0)}let i=this._viewportLoc;this.viewportChangeSize(i.w,i.h),this.viewportChangePos(0,0)}_damage(e,t,s,i){e<this._damageBounds.left&&(this._damageBounds.left=e),t<this._damageBounds.top&&(this._damageBounds.top=t),e+s>this._damageBounds.right&&(this._damageBounds.right=e+s),t+i>this._damageBounds.bottom&&(this._damageBounds.bottom=t+i)}flip(e){if(0===this._renderQ.length||e){let e=this._damageBounds.left,t=this._damageBounds.top,s=this._damageBounds.right-e,i=this._damageBounds.bottom-t,r=e-this._viewportLoc.x,n=t-this._viewportLoc.y;r<0&&(s+=r,e-=r,r=0),n<0&&(i+=n,t-=n,n=0),r+s>this._viewportLoc.w&&(s=this._viewportLoc.w-r),n+i>this._viewportLoc.h&&(i=this._viewportLoc.h-n),s>0&&i>0&&this._targetCtx.drawImage(this._backbuffer,e,t,s,i,r,n,s,i),this._damageBounds.left=this._damageBounds.top=65535,this._damageBounds.right=this._damageBounds.bottom=0}else this._renderQPush({type:"flip"})}pending(){return this._renderQ.length>0}flush(){0===this._renderQ.length?this.onflush():this._flushing=!0}fillRect(e,t,s,i,r,n){0===this._renderQ.length||n?(this._setFillColor(r),this._drawCtx.fillRect(e,t,s,i),this._damage(e,t,s,i)):this._renderQPush({type:"fill",x:e,y:t,width:s,height:i,color:r})}copyImage(e,t,s,i,r,n,a){0===this._renderQ.length||a?(this._drawCtx.mozImageSmoothingEnabled=!1,this._drawCtx.webkitImageSmoothingEnabled=!1,this._drawCtx.msImageSmoothingEnabled=!1,this._drawCtx.imageSmoothingEnabled=!1,this._drawCtx.drawImage(this._backbuffer,e,t,r,n,s,i,r,n),this._damage(s,i,r,n)):this._renderQPush({type:"copy",oldX:e,oldY:t,x:s,y:i,width:r,height:n})}imageRect(e,t,s,i,r,n){if(0===s||0===i)return;let a=new Image;a.src="data: "+r+";base64,"+R.encode(n),this._renderQPush({type:"img",img:a,x:e,y:t,width:s,height:i})}blitImage(e,t,s,i,r,n,a){if(0===this._renderQ.length||a){let a=new ImageData(new Uint8ClampedArray(r.buffer,r.byteOffset+n,s*i*4),s,i);this._drawCtx.putImageData(a,e,t),this._damage(e,t,s,i)}else{let n=new Uint8Array(s*i*4);n.set(new Uint8Array(r.buffer,0,n.length)),this._renderQPush({type:"blit",data:n,x:e,y:t,width:s,height:i})}}drawImage(e,t,s){this._drawCtx.drawImage(e,t,s),this._damage(t,s,e.width,e.height)}autoscale(e,t){let s;if(0===e||0===t)s=0;else{let i=this._viewportLoc;s=i.w/i.h>=e/t?e/i.w:t/i.h}this._rescale(s)}_rescale(e){this._scale=e;let t=this._viewportLoc,s=e*t.w+"px",i=e*t.h+"px";(this._target.style.width!==s||this._target.style.height!==i)&&(this._target.style.width=s,this._target.style.height=i)}_setFillColor(e){let t="rgb("+e[0]+","+e[1]+","+e[2]+")";t!==this._prevDrawStyle&&(this._drawCtx.fillStyle=t,this._prevDrawStyle=t)}_renderQPush(e){this._renderQ.push(e),1===this._renderQ.length&&this._scanRenderQ()}_resumeRenderQ(){this.removeEventListener("load",this._noVNCDisplay._resumeRenderQ),this._noVNCDisplay._scanRenderQ()}_scanRenderQ(){let e=!0;for(;e&&this._renderQ.length>0;){let t=this._renderQ[0];switch(t.type){case"flip":this.flip(!0);break;case"copy":this.copyImage(t.oldX,t.oldY,t.x,t.y,t.width,t.height,!0);break;case"fill":this.fillRect(t.x,t.y,t.width,t.height,t.color,!0);break;case"blit":this.blitImage(t.x,t.y,t.width,t.height,t.data,0,!0);break;case"img":if(t.img.complete){if(t.img.width!==t.width||t.img.height!==t.height){u("Decoded image has incorrect dimensions. Got "+t.img.width+"x"+t.img.height+". Expected "+t.width+"x"+t.height+".");return}this.drawImage(t.img,t.x,t.y)}else t.img._noVNCDisplay=this,t.img.addEventListener("load",this._resumeRenderQ),e=!1}e&&this._renderQ.shift()}0===this._renderQ.length&&this._flushing&&(this._flushing=!1,this.onflush())}}function U(e,t,s,i,r){if(t.subarray&&e.subarray){e.set(t.subarray(s,s+i),r);return}for(var n=0;n<i;n++)e[r+n]=t[s+n]}var N=Uint8Array,I=Uint16Array,H=Int32Array;function V(e,t,s,i){for(var r=65535&e|0,n=e>>>16&65535|0,a=0;0!==s;){a=s>2e3?2e3:s,s-=a;do n=n+(r=r+t[i++]|0)|0;while(--a);r%=65521,n%=65521}return r|n<<16|0}function O(){for(var e,t=[],s=0;s<256;s++){e=s;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[s]=e}return t}O();var G=[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],W=[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,72,78],Y=[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],q=[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 j(e,t,s,i,r,n,a,o){var h,l,_,d,c,u,f,p,g,m=o.bits,w=0,b=0,v=0,k=0,y=0,X=0,K=0,C=0,F=0,S=0,x=null,E=0,M=new I(16),A=new I(16),Q=null,L=0;for(w=0;w<=15;w++)M[w]=0;for(b=0;b<i;b++)M[t[s+b]]++;for(k=15,y=m;k>=1&&0===M[k];k--);if(y>k&&(y=k),0===k)return r[n++]=20971520,r[n++]=20971520,o.bits=1,0;for(v=1;v<k&&0===M[v];v++);for(y<v&&(y=v),C=1,w=1;w<=15;w++)if(C<<=1,(C-=M[w])<0)return -1;if(C>0&&(0===e||1!==k))return -1;for(w=1,A[1]=0;w<15;w++)A[w+1]=A[w]+M[w];for(b=0;b<i;b++)0!==t[s+b]&&(a[A[t[s+b]]++]=b);if(0===e?(x=Q=a,u=19):1===e?(x=G,E-=257,Q=W,L-=257,u=256):(x=Y,Q=q,u=-1),S=0,b=0,w=v,c=n,X=y,K=0,_=-1,d=(F=1<<y)-1,1===e&&F>852||2===e&&F>592)return 1;for(;;){f=w-K,a[b]<u?(p=0,g=a[b]):a[b]>u?(p=Q[L+a[b]],g=x[E+a[b]]):(p=96,g=0),h=1<<w-K,v=l=1<<X;do r[c+(S>>K)+(l-=h)]=f<<24|p<<16|g|0;while(0!==l);for(h=1<<w-1;S&h;)h>>=1;if(0!==h?(S&=h-1,S+=h):S=0,b++,0==--M[w]){if(w===k)break;w=t[s+a[b]]}if(w>y&&(S&d)!==_){for(0===K&&(K=y),c+=v,C=1<<(X=w-K);X+K<k&&!((C-=M[X+K])<=0);)X++,C<<=1;if(F+=1<<X,1===e&&F>852||2===e&&F>592)return 1;r[_=S&d]=y<<24|X<<16|c-n|0}}return 0!==S&&(r[c+S]=w-K<<24|4194304),o.bits=y,0}function Z(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function J(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,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=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new I(320),this.work=new I(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function $(e){var t,s;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,e&&e.state?(s=e.state,e.total_in=e.total_out=s.total=0,e.msg="",s.wrap&&(e.adler=1&s.wrap),s.mode=1,s.last=0,s.havedict=0,s.dmax=32768,s.head=null,s.hold=0,s.bits=0,s.lencode=s.lendyn=new H(852),s.distcode=s.distdyn=new H(592),s.sane=1,s.back=-1,0):-2):-2}var ee=!0;function et(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}class es{constructor(){var e,t,s,i,r,n,a;this.strm=new et,this.chunkSize=102400,this.strm.output=new Uint8Array(this.chunkSize),this.windowBits=5,e=this.strm,this.windowBits,s=0,!(t=e)||(i=new J,t.state=i,i.window=null,r=15,0===(t&&t.state?(a=t.state,r<0?(n=0,r=-r):(n=(r>>4)+1,r<48&&(r&=15)),r&&(r<8||r>15))?-2:(null!==a.window&&a.wbits!==r&&(a.window=null),a.wrap=n,a.wbits=r,$(t)):-2)||(t.state=null))}setInput(e){e?(this.strm.input=e,this.strm.avail_in=this.strm.input.length):(this.strm.input=null,this.strm.avail_in=0),this.strm.next_in=0}inflate(e){if(e>this.chunkSize&&(this.chunkSize=e,this.strm.output=new Uint8Array(this.chunkSize)),this.strm.next_out=0,this.strm.avail_out=e,0>function(e,t){var s,i,r,n,a,o,h,l,_,d,c,u,f,p,g,m,w,b,v,k,y,X,K,C,F,S,x,E,M,A=0,T=new N(4),D=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return -2;12===(o=e.state).mode&&(o.mode=13),d=e.next_out,l=e.output,u=e.avail_out,_=e.next_in,h=e.input,c=e.avail_in,f=o.hold,p=o.bits,g=c,m=u,x=0;e:for(;;)switch(o.mode){case 1:if(0===o.wrap){o.mode=13;break}for(;p<16;){if(0===c)break e;c--,f+=h[_++]<<p,p+=8}if(2&o.wrap&&35615===f){o.check=0,T[0]=255&f,T[1]=f>>>8&255,o.check=O(o.check,T,2,0),f=0,p=0,o.mode=2;break}if(o.flags=0,o.head&&(o.head.done=!1),!(1&o.wrap)||(((255&f)<<8)+(f>>8))%31){e.msg="incorrect header check",o.mode=30;break}if((15&f)!=8){e.msg="unknown compression method",o.mode=30;break}if(f>>>=4,p-=4,S=(15&f)+8,0===o.wbits)o.wbits=S;else if(S>o.wbits){e.msg="invalid window size",o.mode=30;break}o.dmax=1<<S,e.adler=o.check=1,o.mode=512&f?10:12,f=0,p=0;break;case 2:for(;p<16;){if(0===c)break e;c--,f+=h[_++]<<p,p+=8}if(o.flags=f,(255&o.flags)!=8){e.msg="unknown compression method",o.mode=30;break}if(57344&o.flags){e.msg="unknown header flags set",o.mode=30;break}o.head&&(o.head.text=f>>8&1),512&o.flags&&(T[0]=255&f,T[1]=f>>>8&255,o.check=O(o.check,T,2,0)),f=0,p=0,o.mode=3;case 3:for(;p<32;){if(0===c)break e;c--,f+=h[_++]<<p,p+=8}o.head&&(o.head.time=f),512&o.flags&&(T[0]=255&f,T[1]=f>>>8&255,T[2]=f>>>16&255,T[3]=f>>>24&255,o.check=O(o.check,T,4,0)),f=0,p=0,o.mode=4;case 4:for(;p<16;){if(0===c)break e;c--,f+=h[_++]<<p,p+=8}o.head&&(o.head.xflags=255&f,o.head.os=f>>8),512&o.flags&&(T[0]=255&f,T[1]=f>>>8&255,o.check=O(o.check,T,2,0)),f=0,p=0,o.mode=5;case 5:if(1024&o.flags){for(;p<16;){if(0===c)break e;c--,f+=h[_++]<<p,p+=8}o.length=f,o.head&&(o.head.extra_len=f),512&o.flags&&(T[0]=255&f,T[1]=f>>>8&255,o.check=O(o.check,T,2,0)),f=0,p=0}else o.head&&(o.head.extra=null);o.mode=6;case 6:if(1024&o.flags&&((w=o.length)>c&&(w=c),w&&(o.head&&(S=o.head.extra_len-o.length,o.head.extra||(o.head.extra=Array(o.head.extra_len)),U(o.head.extra,h,_,w,S)),512&o.flags&&(o.check=O(o.check,h,w,_)),c-=w,_+=w,o.length-=w),o.length))break e;o.length=0,o.mode=7;case 7:if(2048&o.flags){if(0===c)break e;w=0;do S=h[_+w++],o.head&&S&&o.length<65536&&(o.head.name+=String.fromCharCode(S));while(S&&w<c);if(512&o.flags&&(o.check=O(o.check,h,w,_)),c-=w,_+=w,S)break e}else o.head&&(o.head.name=null);o.length=0,o.mode=8;case 8:if(4096&o.flags){if(0===c)break e;w=0;do S=h[_+w++],o.head&&S&&o.length<65536&&(o.head.comment+=String.fromCharCode(S));while(S&&w<c);if(512&o.flags&&(o.check=O(o.check,h,w,_)),c-=w,_+=w,S)break e}else o.head&&(o.head.comment=null);o.mode=9;case 9:if(512&o.flags){for(;p<16;){if(0===c)break e;c--,f+=h[_++]<<p,p+=8}if(f!==(65535&o.check)){e.msg="header crc mismatch",o.mode=30;break}f=0,p=0}o.head&&(o.head.hcrc=o.flags>>9&1,o.head.done=!0),e.adler=o.check=0,o.mode=12;break;case 10:for(;p<32;){if(0===c)break e;c--,f+=h[_++]<<p,p+=8}e.adler=o.check=Z(f),f=0,p=0,o.mode=11;case 11:if(0===o.havedict)return e.next_out=d,e.avail_out=u,e.next_in=_,e.avail_in=c,o.hold=f,o.bits=p,2;e.adler=o.check=1,o.mode=12;case 12:case 13:if(o.last){f>>>=7&p,p-=7&p,o.mode=27;break}for(;p<3;){if(0===c)break e;c--,f+=h[_++]<<p,p+=8}switch(o.last=1&f,p-=1,3&(f>>>=1)){case 0:o.mode=14;break;case 1:(function(e){if(ee){var t;for(Q=new H(512),L=new H(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(j(1,e.lens,0,288,Q,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;j(2,e.lens,0,32,L,0,e.work,{bits:5}),ee=!1}e.lencode=Q,e.lenbits=9,e.distcode=L,e.distbits=5})(o),o.mode=20;break;case 2:o.mode=17;break;case 3:e.msg="invalid block type",o.mode=30}f>>>=2,p-=2;break;case 14:for(f>>>=7&p,p-=7&p;p<32;){if(0===c)break e;c--,f+=h[_++]<<p,p+=8}if((65535&f)!=(f>>>16^65535)){e.msg="invalid stored block lengths",o.mode=30;break}if(o.length=65535&f,f=0,p=0,o.mode=15,6===t)break e;case 15:o.mode=16;case 16:if(w=o.length){if(w>c&&(w=c),w>u&&(w=u),0===w)break e;U(l,h,_,w,d),c-=w,_+=w,u-=w,d+=w,o.length-=w;break}o.mode=12;break;case 17:for(;p<14;){if(0===c)break e;c--,f+=h[_++]<<p,p+=8}if(o.nlen=(31&f)+257,f>>>=5,p-=5,o.ndist=(31&f)+1,f>>>=5,p-=5,o.ncode=(15&f)+4,f>>>=4,p-=4,o.nlen>286||o.ndist>30){e.msg="too many length or distance symbols",o.mode=30;break}o.have=0,o.mode=18;case 18:for(;o.have<o.ncode;){for(;p<3;){if(0===c)break e;c--,f+=h[_++]<<p,p+=8}o.lens[D[o.have++]]=7&f,f>>>=3,p-=3}for(;o.have<19;)o.lens[D[o.have++]]=0;if(o.lencode=o.lendyn,o.lenbits=7,E={bits:o.lenbits},x=j(0,o.lens,0,19,o.lencode,0,o.work,E),o.lenbits=E.bits,x){e.msg="invalid code lengths set",o.mode=30;break}o.have=0,o.mode=19;case 19:for(;o.have<o.nlen+o.ndist;){for(;k=(A=o.lencode[f&(1<<o.lenbits)-1])>>>24,y=A>>>16&255,X=65535&A,!(k<=p);){if(0===c)break e;c--,f+=h[_++]<<p,p+=8}if(X<16)f>>>=k,p-=k,o.lens[o.have++]=X;else{if(16===X){for(M=k+2;p<M;){if(0===c)break e;c--,f+=h[_++]<<p,p+=8}if(f>>>=k,p-=k,0===o.have){e.msg="invalid bit length repeat",o.mode=30;break}S=o.lens[o.have-1],w=3+(3&f),f>>>=2,p-=2}else if(17===X){for(M=k+3;p<M;){if(0===c)break e;c--,f+=h[_++]<<p,p+=8}f>>>=k,p-=k,S=0,w=3+(7&f),f>>>=3,p-=3}else{for(M=k+7;p<M;){if(0===c)break e;c--,f+=h[_++]<<p,p+=8}f>>>=k,p-=k,S=0,w=11+(127&f),f>>>=7,p-=7}if(o.have+w>o.nlen+o.ndist){e.msg="invalid bit length repeat",o.mode=30;break}for(;w--;)o.lens[o.have++]=S}}if(30===o.mode)break;if(0===o.lens[256]){e.msg="invalid code -- missing end-of-block",o.mode=30;break}if(o.lenbits=9,E={bits:o.lenbits},x=j(1,o.lens,0,o.nlen,o.lencode,0,o.work,E),o.lenbits=E.bits,x){e.msg="invalid literal/lengths set",o.mode=30;break}if(o.distbits=6,o.distcode=o.distdyn,E={bits:o.distbits},x=j(2,o.lens,o.nlen,o.ndist,o.distcode,0,o.work,E),o.distbits=E.bits,x){e.msg="invalid distances set",o.mode=30;break}if(o.mode=20,6===t)break e;case 20:o.mode=21;case 21:if(c>=6&&u>=258){e.next_out=d,e.avail_out=u,e.next_in=_,e.avail_in=c,o.hold=f,o.bits=p,function(e,t){var s,i,r,n,a,o,h,l,_,d,c,u,f,p,g,m,w,b,v,k,y,X,K,C,F;s=e.state,i=e.next_in,C=e.input,r=i+(e.avail_in-5),n=e.next_out,F=e.output,a=n-(t-e.avail_out),o=n+(e.avail_out-257),h=s.dmax,l=s.wsize,_=s.whave,d=s.wnext,c=s.window,u=s.hold,f=s.bits,p=s.lencode,g=s.distcode,m=(1<<s.lenbits)-1,w=(1<<s.distbits)-1;t:do for(f<15&&(u+=C[i++]<<f,f+=8,u+=C[i++]<<f,f+=8),b=p[u&m];;){if(u>>>=v=b>>>24,f-=v,0==(v=b>>>16&255))F[n++]=65535&b;else if(16&v)for(k=65535&b,(v&=15)&&(f<v&&(u+=C[i++]<<f,f+=8),k+=u&(1<<v)-1,u>>>=v,f-=v),f<15&&(u+=C[i++]<<f,f+=8,u+=C[i++]<<f,f+=8),b=g[u&w];;){if(u>>>=v=b>>>24,f-=v,16&(v=b>>>16&255)){if(y=65535&b,f<(v&=15)&&(u+=C[i++]<<f,(f+=8)<v&&(u+=C[i++]<<f,f+=8)),(y+=u&(1<<v)-1)>h){e.msg="invalid distance too far back",s.mode=30;break t}if(u>>>=v,f-=v,y>(v=n-a)){if((v=y-v)>_&&s.sane){e.msg="invalid distance too far back",s.mode=30;break t}if(X=0,K=c,0===d){if(X+=l-v,v<k){k-=v;do F[n++]=c[X++];while(--v);X=n-y,K=F}}else if(d<v){if(X+=l+d-v,(v-=d)<k){k-=v;do F[n++]=c[X++];while(--v);if(X=0,d<k){k-=v=d;do F[n++]=c[X++];while(--v);X=n-y,K=F}}}else if(X+=d-v,v<k){k-=v;do F[n++]=c[X++];while(--v);X=n-y,K=F}for(;k>2;)F[n++]=K[X++],F[n++]=K[X++],F[n++]=K[X++],k-=3;k&&(F[n++]=K[X++],k>1&&(F[n++]=K[X++]))}else{X=n-y;do F[n++]=F[X++],F[n++]=F[X++],F[n++]=F[X++],k-=3;while(k>2);k&&(F[n++]=F[X++],k>1&&(F[n++]=F[X++]))}}else if((64&v)==0){b=g[(65535&b)+(u&(1<<v)-1)];continue}else{e.msg="invalid distance code",s.mode=30;break t}break}else if((64&v)==0){b=p[(65535&b)+(u&(1<<v)-1)];continue}else if(32&v){s.mode=12;break t}else{e.msg="invalid literal/length code",s.mode=30;break t}break}while(i<r&&n<o);i-=k=f>>3,f-=k<<3,u&=(1<<f)-1,e.next_in=i,e.next_out=n,e.avail_in=i<r?5+(r-i):5-(i-r),e.avail_out=n<o?257+(o-n):257-(n-o),s.hold=u,s.bits=f}(e,m),d=e.next_out,l=e.output,u=e.avail_out,_=e.next_in,h=e.input,c=e.avail_in,f=o.hold,p=o.bits,12===o.mode&&(o.back=-1);break}for(o.back=0;k=(A=o.lencode[f&(1<<o.lenbits)-1])>>>24,y=A>>>16&255,X=65535&A,!(k<=p);){if(0===c)break e;c--,f+=h[_++]<<p,p+=8}if(y&&(240&y)==0){for(K=k,C=y,F=X;k=(A=o.lencode[F+((f&(1<<K+C)-1)>>K)])>>>24,y=A>>>16&255,X=65535&A,!(K+k<=p);){if(0===c)break e;c--,f+=h[_++]<<p,p+=8}f>>>=K,p-=K,o.back+=K}if(f>>>=k,p-=k,o.back+=k,o.length=X,0===y){o.mode=26;break}if(32&y){o.back=-1,o.mode=12;break}if(64&y){e.msg="invalid literal/length code",o.mode=30;break}o.extra=15&y,o.mode=22;case 22:if(o.extra){for(M=o.extra;p<M;){if(0===c)break e;c--,f+=h[_++]<<p,p+=8}o.length+=f&(1<<o.extra)-1,f>>>=o.extra,p-=o.extra,o.back+=o.extra}o.was=o.length,o.mode=23;case 23:for(;k=(A=o.distcode[f&(1<<o.distbits)-1])>>>24,y=A>>>16&255,X=65535&A,!(k<=p);){if(0===c)break e;c--,f+=h[_++]<<p,p+=8}if((240&y)==0){for(K=k,C=y,F=X;k=(A=o.distcode[F+((f&(1<<K+C)-1)>>K)])>>>24,y=A>>>16&255,X=65535&A,!(K+k<=p);){if(0===c)break e;c--,f+=h[_++]<<p,p+=8}f>>>=K,p-=K,o.back+=K}if(f>>>=k,p-=k,o.back+=k,64&y){e.msg="invalid distance code",o.mode=30;break}o.offset=X,o.extra=15&y,o.mode=24;case 24:if(o.extra){for(M=o.extra;p<M;){if(0===c)break e;c--,f+=h[_++]<<p,p+=8}o.offset+=f&(1<<o.extra)-1,f>>>=o.extra,p-=o.extra,o.back+=o.extra}if(o.offset>o.dmax){e.msg="invalid distance too far back",o.mode=30;break}o.mode=25;case 25:if(0===u)break e;if(w=m-u,o.offset>w){if((w=o.offset-w)>o.whave&&o.sane){e.msg="invalid distance too far back",o.mode=30;break}w>o.wnext?(w-=o.wnext,b=o.wsize-w):b=o.wnext-w,w>o.length&&(w=o.length),v=o.window}else v=l,b=d-o.offset,w=o.length;w>u&&(w=u),u-=w,o.length-=w;do l[d++]=v[b++];while(--w);0===o.length&&(o.mode=21);break;case 26:if(0===u)break e;l[d++]=o.length,u--,o.mode=21;break;case 27:if(o.wrap){for(;p<32;){if(0===c)break e;c--,f|=h[_++]<<p,p+=8}if(m-=u,e.total_out+=m,o.total+=m,m&&(e.adler=o.check=o.flags?O(o.check,l,m,d-m):V(o.check,l,m,d-m)),m=u,(o.flags?f:Z(f))!==o.check){e.msg="incorrect data check",o.mode=30;break}f=0,p=0}o.mode=28;case 28:if(o.wrap&&o.flags){for(;p<32;){if(0===c)break e;c--,f+=h[_++]<<p,p+=8}if(f!==(4294967295&o.total)){e.msg="incorrect length check",o.mode=30;break}f=0,p=0}o.mode=29;case 29:x=1;break e;case 30:x=-3;break e;case 31:return -4;default:return -2}return e.next_out=d,e.avail_out=u,e.next_in=_,e.avail_in=c,o.hold=f,o.bits=p,(o.wsize||m!==e.avail_out&&o.mode<30&&(o.mode<27||4!==t))&&(s=e.output,i=e.next_out,r=m-e.avail_out,null===(a=e.state).window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new N(a.wsize)),r>=a.wsize?(U(a.window,s,i-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((n=a.wsize-a.wnext)>r&&(n=r),U(a.window,s,i-r,n,a.wnext),(r-=n)?(U(a.window,s,i-r,r,0),a.wnext=r,a.whave=a.wsize):(a.wnext+=n,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=n)))),g-=e.avail_in,m-=e.avail_out,e.total_in+=g,e.total_out+=m,o.total+=m,o.wrap&&m&&(e.adler=o.check=o.flags?O(o.check,l,m,e.next_out-m):V(o.check,l,m,e.next_out-m)),e.data_type=o.bits+(o.last?64:0)+(12===o.mode?128:0)+(20===o.mode||15===o.mode?256:0),(0===g&&0===m||4===t)&&0===x&&(x=-5),x}(this.strm,0))throw Error("zlib inflate failed");if(this.strm.next_out!=e)throw Error("Incomplete zlib block");return new Uint8Array(this.strm.output.buffer,0,this.strm.next_out)}reset(){$(this.strm)}}function ei(e){for(var t=e.length;--t>=0;)e[t]=0}var er=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],en=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],ea=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],eo=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],eh=Array(576);ei(eh);var el=Array(60);ei(el);var e_=Array(512);ei(e_);var ed=Array(256);ei(ed);var ec=Array(29);ei(ec);var eu=Array(30);function ef(e,t,s,i,r){this.static_tree=e,this.extra_bits=t,this.extra_base=s,this.elems=i,this.max_length=r,this.has_stree=e&&e.length}function ep(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function eg(e){return e<256?e_[e]:e_[256+(e>>>7)]}function em(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function ew(e,t,s){e.bi_valid>16-s?(e.bi_buf|=t<<e.bi_valid&65535,em(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=s-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=s)}function eb(e,t,s){ew(e,s[2*t],s[2*t+1])}function ev(e,t){var s=0;do s|=1&e,e>>>=1,s<<=1;while(--t>0);return s>>>1}function ek(e,t,s){var i,r,n=Array(16),a=0;for(i=1;i<=15;i++)n[i]=a=a+s[i-1]<<1;for(r=0;r<=t;r++){var o=e[2*r+1];0!==o&&(e[2*r]=ev(n[o]++,o))}}function ey(e){var t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function eX(e){e.bi_valid>8?em(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function eK(e,t,s,i){var r=2*t,n=2*s;return e[r]<e[n]||e[r]===e[n]&&i[t]<=i[s]}function eC(e,t,s){for(var i=e.heap[s],r=s<<1;r<=e.heap_len&&(r<e.heap_len&&eK(t,e.heap[r+1],e.heap[r],e.depth)&&r++,!eK(t,i,e.heap[r],e.depth));)e.heap[s]=e.heap[r],s=r,r<<=1;e.heap[s]=i}function eF(e,t,s){var i,r,n,a,o=0;if(0!==e.last_lit)do i=e.pending_buf[e.d_buf+2*o]<<8|e.pending_buf[e.d_buf+2*o+1],r=e.pending_buf[e.l_buf+o],o++,0===i?eb(e,r,t):(eb(e,(n=ed[r])+256+1,t),0!==(a=er[n])&&ew(e,r-=ec[n],a),eb(e,n=eg(--i),s),0!==(a=en[n])&&ew(e,i-=eu[n],a));while(o<e.last_lit);eb(e,256,t)}function eS(e,t){var s,i,r,n=t.dyn_tree,a=t.stat_desc.static_tree,o=t.stat_desc.has_stree,h=t.stat_desc.elems,l=-1;for(s=0,e.heap_len=0,e.heap_max=573;s<h;s++)0!==n[2*s]?(e.heap[++e.heap_len]=l=s,e.depth[s]=0):n[2*s+1]=0;for(;e.heap_len<2;)n[2*(r=e.heap[++e.heap_len]=l<2?++l:0)]=1,e.depth[r]=0,e.opt_len--,o&&(e.static_len-=a[2*r+1]);for(t.max_code=l,s=e.heap_len>>1;s>=1;s--)eC(e,n,s);r=h;do s=e.heap[1],e.heap[1]=e.heap[e.heap_len--],eC(e,n,1),i=e.heap[1],e.heap[--e.heap_max]=s,e.heap[--e.heap_max]=i,n[2*r]=n[2*s]+n[2*i],e.depth[r]=(e.depth[s]>=e.depth[i]?e.depth[s]:e.depth[i])+1,n[2*s+1]=n[2*i+1]=r,e.heap[1]=r++,eC(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var s,i,r,n,a,o,h=t.dyn_tree,l=t.max_code,_=t.stat_desc.static_tree,d=t.stat_desc.has_stree,c=t.stat_desc.extra_bits,u=t.stat_desc.extra_base,f=t.stat_desc.max_length,p=0;for(n=0;n<=15;n++)e.bl_count[n]=0;for(h[2*e.heap[e.heap_max]+1]=0,s=e.heap_max+1;s<573;s++)(n=h[2*h[2*(i=e.heap[s])+1]+1]+1)>f&&(n=f,p++),h[2*i+1]=n,!(i>l)&&(e.bl_count[n]++,a=0,i>=u&&(a=c[i-u]),o=h[2*i],e.opt_len+=o*(n+a),d&&(e.static_len+=o*(_[2*i+1]+a)));if(0!==p){do{for(n=f-1;0===e.bl_count[n];)n--;e.bl_count[n]--,e.bl_count[n+1]+=2,e.bl_count[f]--,p-=2}while(p>0);for(n=f;0!==n;n--)for(i=e.bl_count[n];0!==i;)!((r=e.heap[--s])>l)&&(h[2*r+1]!==n&&(e.opt_len+=(n-h[2*r+1])*h[2*r],h[2*r+1]=n),i--)}}(e,t),ek(n,l,e.bl_count)}function ex(e,t,s){var i,r,n=-1,a=t[1],o=0,h=7,l=4;for(0===a&&(h=138,l=3),t[(s+1)*2+1]=65535,i=0;i<=s;i++)r=a,a=t[(i+1)*2+1],++o<h&&r===a||(o<l?e.bl_tree[2*r]+=o:0!==r?(r!==n&&e.bl_tree[2*r]++,e.bl_tree[32]++):o<=10?e.bl_tree[34]++:e.bl_tree[36]++,o=0,n=r,0===a?(h=138,l=3):r===a?(h=6,l=3):(h=7,l=4))}function eE(e,t,s){var i,r,n=-1,a=t[1],o=0,h=7,l=4;for(0===a&&(h=138,l=3),i=0;i<=s;i++)if(r=a,a=t[(i+1)*2+1],!(++o<h)||r!==a){if(o<l)do eb(e,r,e.bl_tree);while(0!=--o);else 0!==r?(r!==n&&(eb(e,r,e.bl_tree),o--),eb(e,16,e.bl_tree),ew(e,o-3,2)):o<=10?(eb(e,17,e.bl_tree),ew(e,o-3,3)):(eb(e,18,e.bl_tree),ew(e,o-11,7));o=0,n=r,0===a?(h=138,l=3):r===a?(h=6,l=3):(h=7,l=4)}}ei(eu);var eM=!1;function eA(e,t,s,i){ew(e,0+(i?1:0),3),eX(e),em(e,s),em(e,~s),U(e.pending_buf,e.window,t,s,e.pending),e.pending+=s}function eQ(e,t,s){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&s,e.last_lit++,0===t?e.dyn_ltree[2*s]++:(e.matches++,t--,e.dyn_ltree[(ed[s]+256+1)*2]++,e.dyn_dtree[2*eg(t)]++),e.last_lit===e.lit_bufsize-1}var eL={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};function eT(e,t){return e.msg=eL[t],t}function eD(e){return(e<<1)-(e>4?9:0)}function eB(e){for(var t=e.length;--t>=0;)e[t]=0}function eP(e){var t=e.state,s=t.pending;s>e.avail_out&&(s=e.avail_out),0!==s&&(U(e.output,t.pending_buf,t.pending_out,s,e.next_out),e.next_out+=s,t.pending_out+=s,e.total_out+=s,e.avail_out-=s,t.pending-=s,0===t.pending&&(t.pending_out=0))}function eR(e,t){var s,i,r,n,a;s=e.block_start>=0?e.block_start:-1,i=e.strstart-e.block_start,a=0,e.level>0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,s=4093624447;for(t=0;t<=31;t++,s>>>=1)if(1&s&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),eS(e,e.l_desc),eS(e,e.d_desc),a=function(e){var t;for(ex(e,e.dyn_ltree,e.l_desc.max_code),ex(e,e.dyn_dtree,e.d_desc.max_code),eS(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*eo[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),r=e.opt_len+3+7>>>3,(n=e.static_len+3+7>>>3)<=r&&(r=n)):r=n=i+5,i+4<=r&&-1!==s?eA(e,s,i,t):4===e.strategy||n===r?(ew(e,2+(t?1:0),3),eF(e,eh,el)):(ew(e,4+(t?1:0),3),function(e,t,s,i){var r;for(ew(e,t-257,5),ew(e,s-1,5),ew(e,i-4,4),r=0;r<i;r++)ew(e,e.bl_tree[2*eo[r]+1],3);eE(e,e.dyn_ltree,t-1),eE(e,e.dyn_dtree,s-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),eF(e,e.dyn_ltree,e.dyn_dtree)),ey(e),t&&eX(e),e.block_start=e.strstart,eP(e.strm)}function ez(e,t){e.pending_buf[e.pending++]=t}function eU(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function eN(e,t){var s,i,r=e.max_chain_length,n=e.strstart,a=e.prev_length,o=e.nice_match,h=e.strstart>e.w_size-262?e.strstart-(e.w_size-262):0,l=e.window,_=e.w_mask,d=e.prev,c=e.strstart+258,u=l[n+a-1],f=l[n+a];e.prev_length>=e.good_match&&(r>>=2),o>e.lookahead&&(o=e.lookahead);do{if(l[(s=t)+a]!==f||l[s+a-1]!==u||l[s]!==l[n]||l[++s]!==l[n+1])continue;n+=2,s++;do;while(l[++n]===l[++s]&&l[++n]===l[++s]&&l[++n]===l[++s]&&l[++n]===l[++s]&&l[++n]===l[++s]&&l[++n]===l[++s]&&l[++n]===l[++s]&&l[++n]===l[++s]&&n<c);if(i=258-(c-n),n=c-258,i>a){if(e.match_start=t,a=i,i>=o)break;u=l[n+a-1],f=l[n+a]}}while((t=d[t&_])>h&&0!=--r);return a<=e.lookahead?a:e.lookahead}function eI(e){var t,s,i,r,n,a=e.w_size;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=a+(a-262)){U(e.window,e.window,a,a,0),e.match_start-=a,e.strstart-=a,e.block_start-=a,t=s=e.hash_size;do i=e.head[--t],e.head[t]=i>=a?i-a:0;while(--s);t=s=a;do i=e.prev[--t],e.prev[t]=i>=a?i-a:0;while(--s);r+=a}if(0===e.strm.avail_in)break;if(s=function(e,t,s,i){var r=e.avail_in;return(r>i&&(r=i),0===r)?0:(e.avail_in-=r,U(t,e.input,e.next_in,r,s),1===e.state.wrap?e.adler=V(e.adler,t,r,s):2===e.state.wrap&&(e.adler=O(e.adler,t,r,s)),e.next_in+=r,e.total_in+=r,r)}(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=s,e.lookahead+e.insert>=3)for(n=e.strstart-e.insert,e.ins_h=e.window[n],e.ins_h=(e.ins_h<<e.hash_shift^e.window[n+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[n+3-1])&e.hash_mask,e.prev[n&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=n,n++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<262&&0!==e.strm.avail_in)}function eH(e,t){for(var s,i;;){if(e.lookahead<262){if(eI(e),e.lookahead<262&&0===t)return 1;if(0===e.lookahead)break}if(s=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,s=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==s&&e.strstart-s<=e.w_size-262&&(e.match_length=eN(e,s)),e.match_length>=3){if(i=eQ(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,s=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask}else i=eQ(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(i&&(eR(e,!1),0===e.strm.avail_out))return 1}return(e.insert=e.strstart<2?e.strstart:2,4===t)?(eR(e,!0),0===e.strm.avail_out)?3:4:e.last_lit&&(eR(e,!1),0===e.strm.avail_out)?1:2}function eV(e,t){for(var s,i,r;;){if(e.lookahead<262){if(eI(e),e.lookahead<262&&0===t)return 1;if(0===e.lookahead)break}if(s=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,s=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==s&&e.prev_length<e.max_lazy_match&&e.strstart-s<=e.w_size-262&&(e.match_length=eN(e,s),e.match_length<=5&&(1===e.strategy||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){r=e.strstart+e.lookahead-3,i=eQ(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=r&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,s=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,i&&(eR(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((i=eQ(e,0,e.window[e.strstart-1]))&&eR(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return(e.match_available&&(i=eQ(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,4===t)?(eR(e,!0),0===e.strm.avail_out)?3:4:e.last_lit&&(eR(e,!1),0===e.strm.avail_out)?1:2}function eO(e,t,s,i,r){this.good_length=e,this.max_lazy=t,this.nice_length=s,this.max_chain=i,this.func=r}function eG(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new I(1146),this.dyn_dtree=new I(122),this.bl_tree=new I(78),eB(this.dyn_ltree),eB(this.dyn_dtree),eB(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new I(16),this.heap=new I(573),eB(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new I(573),eB(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function eW(e,t){if(!e||!e.state||t>5||t<0)return e?eT(e,-2):-2;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||666===i.status&&4!==t)return eT(e,0===e.avail_out?-5:-2);if(i.strm=e,s=i.last_flush,i.last_flush=t,42===i.status){if(2===i.wrap)e.adler=0,ez(i,31),ez(i,139),ez(i,8),i.gzhead?(ez(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),ez(i,255&i.gzhead.time),ez(i,i.gzhead.time>>8&255),ez(i,i.gzhead.time>>16&255),ez(i,i.gzhead.time>>24&255),ez(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),ez(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(ez(i,255&i.gzhead.extra.length),ez(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=O(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(ez(i,0),ez(i,0),ez(i,0),ez(i,0),ez(i,0),ez(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),ez(i,3),i.status=113);else{var s,i,r,n,a=8+(i.w_bits-8<<4)<<8;a|=(i.strategy>=2||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(a|=32),a+=31-a%31,i.status=113,eU(i,a),0!==i.strstart&&(eU(i,e.adler>>>16),eU(i,65535&e.adler)),e.adler=1}}if(69===i.status){if(i.gzhead.extra){for(r=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>r&&(e.adler=O(e.adler,i.pending_buf,i.pending-r,r)),eP(e),r=i.pending,i.pending!==i.pending_buf_size));)ez(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>r&&(e.adler=O(e.adler,i.pending_buf,i.pending-r,r)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73}if(73===i.status){if(i.gzhead.name){r=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>r&&(e.adler=O(e.adler,i.pending_buf,i.pending-r,r)),eP(e),r=i.pending,i.pending===i.pending_buf_size)){n=1;break}n=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,ez(i,n)}while(0!==n);i.gzhead.hcrc&&i.pending>r&&(e.adler=O(e.adler,i.pending_buf,i.pending-r,r)),0===n&&(i.gzindex=0,i.status=91)}else i.status=91}if(91===i.status){if(i.gzhead.comment){r=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>r&&(e.adler=O(e.adler,i.pending_buf,i.pending-r,r)),eP(e),r=i.pending,i.pending===i.pending_buf_size)){n=1;break}n=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,ez(i,n)}while(0!==n);i.gzhead.hcrc&&i.pending>r&&(e.adler=O(e.adler,i.pending_buf,i.pending-r,r)),0===n&&(i.status=103)}else i.status=103}if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&eP(e),i.pending+2<=i.pending_buf_size&&(ez(i,255&e.adler),ez(i,e.adler>>8&255),e.adler=0,i.status=113)):i.status=113),0!==i.pending){if(eP(e),0===e.avail_out)return i.last_flush=-1,0}else if(0===e.avail_in&&eD(t)<=eD(s)&&4!==t)return eT(e,-5);if(666===i.status&&0!==e.avail_in)return eT(e,-5);if(0!==e.avail_in||0!==i.lookahead||0!==t&&666!==i.status){var o=2===i.strategy?function(e,t){for(var s;;){if(0===e.lookahead&&(eI(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,s=eQ(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,s&&(eR(e,!1),0===e.strm.avail_out))return 1}return(e.insert=0,4===t)?(eR(e,!0),0===e.strm.avail_out)?3:4:e.last_lit&&(eR(e,!1),0===e.strm.avail_out)?1:2}(i,t):3===i.strategy?function(e,t){for(var s,i,r,n,a=e.window;;){if(e.lookahead<=258){if(eI(e),e.lookahead<=258&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(i=a[r=e.strstart-1])===a[++r]&&i===a[++r]&&i===a[++r]){n=e.strstart+258;do;while(i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&r<n);e.match_length=258-(n-r),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(s=eQ(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(s=eQ(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),s&&(eR(e,!1),0===e.strm.avail_out))return 1}return(e.insert=0,4===t)?(eR(e,!0),0===e.strm.avail_out)?3:4:e.last_lit&&(eR(e,!1),0===e.strm.avail_out)?1:2}(i,t):P[i.level].func(i,t);if((3===o||4===o)&&(i.status=666),1===o||3===o)return 0===e.avail_out&&(i.last_flush=-1),0;if(2===o&&(1===t?(ew(i,2,3),eb(i,256,eh),16===i.bi_valid?(em(i,i.bi_buf),i.bi_buf=0,i.bi_valid=0):i.bi_valid>=8&&(i.pending_buf[i.pending++]=255&i.bi_buf,i.bi_buf>>=8,i.bi_valid-=8)):5!==t&&(eA(i,0,0,!1),3===t&&(eB(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),eP(e),0===e.avail_out))return i.last_flush=-1,0}return 4!==t?0:i.wrap<=0?1:(2===i.wrap?(ez(i,255&e.adler),ez(i,e.adler>>8&255),ez(i,e.adler>>16&255),ez(i,e.adler>>24&255),ez(i,255&e.total_in),ez(i,e.total_in>>8&255),ez(i,e.total_in>>16&255),ez(i,e.total_in>>24&255)):(eU(i,e.adler>>>16),eU(i,65535&e.adler)),eP(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?0:1)}P=[new eO(0,0,0,0,function(e,t){var s=65535;for(65535>e.pending_buf_size-5&&(s=e.pending_buf_size-5);;){if(e.lookahead<=1){if(eI(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var i=e.block_start+s;if((0===e.strstart||e.strstart>=i)&&(e.lookahead=e.strstart-i,e.strstart=i,eR(e,!1),0===e.strm.avail_out)||e.strstart-e.block_start>=e.w_size-262&&(eR(e,!1),0===e.strm.avail_out))return 1}return(e.insert=0,4===t)?(eR(e,!0),0===e.strm.avail_out)?3:4:(e.strstart>e.block_start&&(eR(e,!1),e.strm.avail_out),1)}),new eO(4,4,8,4,eH),new eO(4,5,16,8,eH),new eO(4,6,32,32,eH),new eO(4,4,16,16,eV),new eO(8,16,32,32,eV),new eO(8,16,128,128,eV),new eO(8,32,128,256,eV),new eO(32,128,258,1024,eV),new eO(32,258,258,4096,eV)];class eY{constructor(){this.strm=new et,this.chunkSize=102400,this.outputBuffer=new Uint8Array(this.chunkSize),this.windowBits=5,function(e,t,s,i,r,n){if(e){var a,o,h,l=1;if(-1===t&&(t=6),i<0?(l=0,i=-i):i>15&&(l=2,i-=16),i<8||i>15||t<0||t>9)return eT(e,-2);8===i&&(i=9);var _=new eG;e.state=_,_.strm=e,_.wrap=l,_.gzhead=null,_.w_bits=i,_.w_size=1<<_.w_bits,_.w_mask=_.w_size-1,_.hash_bits=15,_.hash_size=1<<_.hash_bits,_.hash_mask=_.hash_size-1,_.hash_shift=~~((_.hash_bits+3-1)/3),_.window=new N(2*_.w_size),_.head=new I(_.hash_size),_.prev=new I(_.w_size),_.lit_bufsize=1<<r+6,_.pending_buf_size=4*_.lit_bufsize,_.pending_buf=new N(_.pending_buf_size),_.d_buf=1*_.lit_bufsize,_.l_buf=3*_.lit_bufsize,_.level=t,_.strategy=0,_.method=8,0===((a=e)&&a.state?(a.total_in=a.total_out=0,a.data_type=2,(o=a.state).pending=0,o.pending_out=0,o.wrap<0&&(o.wrap=-o.wrap),o.status=o.wrap?42:113,a.adler=2===o.wrap?0:1,o.last_flush=0,eM||(function(){var e,t,s,i,r,n=Array(16);for(i=0,s=0;i<28;i++)for(e=0,ec[i]=s;e<1<<er[i];e++)ed[s++]=i;for(ed[s-1]=i,r=0,i=0;i<16;i++)for(e=0,eu[i]=r;e<1<<en[i];e++)e_[r++]=i;for(r>>=7;i<30;i++)for(e=0,eu[i]=r<<7;e<1<<en[i]-7;e++)e_[256+r++]=i;for(t=0;t<=15;t++)n[t]=0;for(e=0;e<=143;)eh[2*e+1]=8,e++,n[8]++;for(;e<=255;)eh[2*e+1]=9,e++,n[9]++;for(;e<=279;)eh[2*e+1]=7,e++,n[7]++;for(;e<=287;)eh[2*e+1]=8,e++,n[8]++;for(ek(eh,287,n),e=0;e<30;e++)el[2*e+1]=5,el[2*e]=ev(e,5);T=new ef(eh,er,257,286,15),D=new ef(el,en,0,30,15),B=new ef([],ea,0,19,7)}(),eM=!0),o.l_desc=new ep(o.dyn_ltree,T),o.d_desc=new ep(o.dyn_dtree,D),o.bl_desc=new ep(o.bl_tree,B),o.bi_buf=0,o.bi_valid=0,ey(o),0):eT(a,-2))&&((h=e.state).window_size=2*h.w_size,eB(h.head),h.max_lazy_match=P[h.level].max_lazy,h.good_match=P[h.level].good_length,h.nice_match=P[h.level].nice_length,h.max_chain_length=P[h.level].max_chain,h.strstart=0,h.block_start=0,h.lookahead=0,h.insert=0,h.match_length=h.prev_length=2,h.match_available=0,h.ins_h=0)}}(this.strm,this.windowBits,0,15,8,0)}deflate(e){this.strm.input=e,this.strm.avail_in=this.strm.input.length,this.strm.next_in=0,this.strm.output=this.outputBuffer,this.strm.avail_out=this.chunkSize,this.strm.next_out=0;let t=eW(this.strm,3),s=new Uint8Array(this.strm.output.buffer,0,this.strm.next_out);if(t<0)throw Error("zlib deflate failed");if(this.strm.avail_in>0){let e=[s],i=s.length;do{if(this.strm.output=new Uint8Array(this.chunkSize),this.strm.next_out=0,this.strm.avail_out=this.chunkSize,(t=eW(this.strm,3))<0)throw Error("zlib deflate failed");let s=new Uint8Array(this.strm.output.buffer,0,this.strm.next_out);i+=s.length,e.push(s)}while(this.strm.avail_in>0);let r=new Uint8Array(i),n=0;for(let t=0;t<e.length;t++)r.set(e[t],n),n+=e[t].length;s=r}return this.strm.input=null,this.strm.avail_in=0,this.strm.next_in=0,s}}var eq={XK_BackSpace:65288,XK_Tab:65289,XK_Clear:65291,XK_Return:65293,XK_Pause:65299,XK_Scroll_Lock:65300,XK_Escape:65307,XK_Delete:65535,XK_Multi_key:65312,XK_Codeinput:65335,XK_SingleCandidate:65340,XK_MultipleCandidate:65341,XK_PreviousCandidate:65342,XK_Kanji:65313,XK_Muhenkan:65314,XK_Henkan:65315,XK_Romaji:65316,XK_Hiragana:65317,XK_Katakana:65318,XK_Hiragana_Katakana:65319,XK_Zenkaku:65320,XK_Hankaku:65321,XK_Zenkaku_Hankaku:65322,XK_Kana_Shift:65326,XK_Eisu_toggle:65328,XK_Home:65360,XK_Left:65361,XK_Up:65362,XK_Right:65363,XK_Down:65364,XK_Prior:65365,XK_Next:65366,XK_End:65367,XK_Select:65376,XK_Print:65377,XK_Execute:65378,XK_Insert:65379,XK_Undo:65381,XK_Redo:65382,XK_Menu:65383,XK_Find:65384,XK_Cancel:65385,XK_Help:65386,XK_Mode_switch:65406,XK_Num_Lock:65407,XK_KP_Space:65408,XK_KP_Enter:65421,XK_KP_Home:65429,XK_KP_Left:65430,XK_KP_Up:65431,XK_KP_Right:65432,XK_KP_Down:65433,XK_KP_Prior:65434,XK_KP_Next:65435,XK_KP_End:65436,XK_KP_Begin:65437,XK_KP_Insert:65438,XK_KP_Delete:65439,XK_KP_Equal:65469,XK_KP_Multiply:65450,XK_KP_Add:65451,XK_KP_Separator:65452,XK_KP_Subtract:65453,XK_KP_Decimal:65454,XK_KP_Divide:65455,XK_KP_0:65456,XK_KP_1:65457,XK_KP_2:65458,XK_KP_3:65459,XK_KP_4:65460,XK_KP_5:65461,XK_KP_6:65462,XK_KP_7:65463,XK_KP_8:65464,XK_KP_9:65465,XK_F1:65470,XK_F2:65471,XK_F3:65472,XK_F4:65473,XK_F5:65474,XK_F6:65475,XK_F7:65476,XK_F8:65477,XK_F9:65478,XK_F10:65479,XK_F11:65480,XK_F12:65481,XK_F13:65482,XK_F14:65483,XK_F15:65484,XK_F16:65485,XK_F17:65486,XK_F18:65487,XK_F19:65488,XK_F20:65489,XK_F21:65490,XK_F22:65491,XK_F23:65492,XK_F24:65493,XK_F25:65494,XK_F26:65495,XK_F27:65496,XK_F28:65497,XK_F29:65498,XK_F30:65499,XK_F31:65500,XK_F32:65501,XK_F33:65502,XK_F34:65503,XK_F35:65504,XK_Shift_L:65505,XK_Shift_R:65506,XK_Control_L:65507,XK_Control_R:65508,XK_Caps_Lock:65509,XK_Meta_L:65511,XK_Meta_R:65512,XK_Alt_L:65513,XK_Alt_R:65514,XK_Super_L:65515,XK_Super_R:65516,XK_ISO_Level3_Shift:65027,XK_ISO_Next_Group:65032,XK_ISO_Prev_Group:65034,XK_ISO_First_Group:65036,XK_ISO_Last_Group:65038,XK_space:32,XK_asterisk:42,XK_plus:43,XK_comma:44,XK_minus:45,XK_period:46,XK_slash:47,XK_0:48,XK_1:49,XK_2:50,XK_3:51,XK_4:52,XK_5:53,XK_6:54,XK_7:55,XK_8:56,XK_9:57,XK_equal:61,XK_Hangul:65329,XK_Hangul_Hanja:65332,XK_Hangul_Jeonja:65336,XF86XK_MonBrightnessUp:269025026,XF86XK_MonBrightnessDown:269025027,XF86XK_Standby:269025040,XF86XK_AudioLowerVolume:269025041,XF86XK_AudioMute:269025042,XF86XK_AudioRaiseVolume:269025043,XF86XK_AudioPlay:269025044,XF86XK_AudioStop:269025045,XF86XK_AudioPrev:269025046,XF86XK_AudioNext:269025047,XF86XK_HomePage:269025048,XF86XK_Mail:269025049,XF86XK_Search:269025051,XF86XK_AudioRecord:269025052,XF86XK_Calculator:269025053,XF86XK_Calendar:269025056,XF86XK_PowerDown:269025057,XF86XK_Back:269025062,XF86XK_Forward:269025063,XF86XK_Stop:269025064,XF86XK_Refresh:269025065,XF86XK_PowerOff:269025066,XF86XK_WakeUp:269025067,XF86XK_Eject:269025068,XF86XK_ScreenSaver:269025069,XF86XK_WWW:269025070,XF86XK_Favorites:269025072,XF86XK_AudioPause:269025073,XF86XK_AudioMedia:269025074,XF86XK_MyComputer:269025075,XF86XK_BrightnessAdjust:269025083,XF86XK_AudioRewind:269025086,XF86XK_Close:269025110,XF86XK_Copy:269025111,XF86XK_Cut:269025112,XF86XK_Excel:269025116,XF86XK_LogOff:269025121,XF86XK_New:269025128,XF86XK_Open:269025131,XF86XK_Paste:269025133,XF86XK_Phone:269025134,XF86XK_Reply:269025138,XF86XK_Save:269025143,XF86XK_Send:269025147,XF86XK_Spell:269025148,XF86XK_SplitScreen:269025149,XF86XK_Word:269025161,XF86XK_ZoomIn:269025163,XF86XK_ZoomOut:269025164,XF86XK_WebCam:269025167,XF86XK_MailForward:269025168,XF86XK_Music:269025170,XF86XK_AudioForward:269025175,XF86XK_AudioRandomPlay:269025177,XF86XK_Subtitle:269025178,XF86XK_AudioCycleTrack:269025179,XF86XK_Hibernate:269025192,XF86XK_AudioMicMute:269025202,XF86XK_Next_VMode:269024802};let ej={256:960,257:992,258:451,259:483,260:417,261:433,262:454,263:486,264:710,265:742,266:709,267:741,268:456,269:488,270:463,271:495,272:464,273:496,274:938,275:954,278:972,279:1004,280:458,281:490,282:460,283:492,284:728,285:760,286:683,287:699,288:725,289:757,290:939,291:955,292:678,293:694,294:673,295:689,296:933,297:949,298:975,299:1007,302:967,303:999,304:681,305:697,308:684,309:700,310:979,311:1011,312:930,313:453,314:485,315:934,316:950,317:421,318:437,321:419,322:435,323:465,324:497,325:977,326:1009,327:466,328:498,330:957,331:959,332:978,333:1010,336:469,337:501,338:5052,339:5053,340:448,341:480,342:931,343:947,344:472,345:504,346:422,347:438,348:734,349:766,350:426,351:442,352:425,353:441,354:478,355:510,356:427,357:443,358:940,359:956,360:989,361:1021,362:990,363:1022,364:733,365:765,366:473,367:505,368:475,369:507,370:985,371:1017,376:5054,377:428,378:444,379:431,380:447,381:430,382:446,402:2294,466:16777681,711:439,728:418,729:511,731:434,733:445,901:1966,902:1953,904:1954,905:1955,906:1956,908:1959,910:1960,911:1963,912:1974,913:1985,914:1986,915:1987,916:1988,917:1989,918:1990,919:1991,920:1992,921:1993,922:1994,923:1995,924:1996,925:1997,926:1998,927:1999,928:2e3,929:2001,931:2002,932:2004,933:2005,934:2006,935:2007,936:2008,937:2009,938:1957,939:1961,940:1969,941:1970,942:1971,943:1972,944:1978,945:2017,946:2018,947:2019,948:2020,949:2021,950:2022,951:2023,952:2024,953:2025,954:2026,955:2027,956:2028,957:2029,958:2030,959:2031,960:2032,961:2033,962:2035,963:2034,964:2036,965:2037,966:2038,967:2039,968:2040,969:2041,970:1973,971:1977,972:1975,973:1976,974:1979,1025:1715,1026:1713,1027:1714,1028:1716,1029:1717,1030:1718,1031:1719,1032:1720,1033:1721,1034:1722,1035:1723,1036:1724,1038:1726,1039:1727,1040:1761,1041:1762,1042:1783,1043:1767,1044:1764,1045:1765,1046:1782,1047:1786,1048:1769,1049:1770,1050:1771,1051:1772,1052:1773,1053:1774,1054:1775,1055:1776,1056:1778,1057:1779,1058:1780,1059:1781,1060:1766,1061:1768,1062:1763,1063:1790,1064:1787,1065:1789,1066:1791,1067:1785,1068:1784,1069:1788,1070:1760,1071:1777,1072:1729,1073:1730,1074:1751,1075:1735,1076:1732,1077:1733,1078:1750,1079:1754,1080:1737,1081:1738,1082:1739,1083:1740,1084:1741,1085:1742,1086:1743,1087:1744,1088:1746,1089:1747,1090:1748,1091:1749,1092:1734,1093:1736,1094:1731,1095:1758,1096:1755,1097:1757,1098:1759,1099:1753,1100:1752,1101:1756,1102:1728,1103:1745,1105:1699,1106:1697,1107:1698,1108:1700,1109:1701,1110:1702,1111:1703,1112:1704,1113:1705,1114:1706,1115:1707,1116:1708,1118:1710,1119:1711,1168:1725,1169:1709,1488:3296,1489:3297,1490:3298,1491:3299,1492:3300,1493:3301,1494:3302,1495:3303,1496:3304,1497:3305,1498:3306,1499:3307,1500:3308,1501:3309,1502:3310,1503:3311,1504:3312,1505:3313,1506:3314,1507:3315,1508:3316,1509:3317,1510:3318,1511:3319,1512:3320,1513:3321,1514:3322,1548:1452,1563:1467,1567:1471,1569:1473,1570:1474,1571:1475,1572:1476,1573:1477,1574:1478,1575:1479,1576:1480,1577:1481,1578:1482,1579:1483,1580:1484,1581:1485,1582:1486,1583:1487,1584:1488,1585:1489,1586:1490,1587:1491,1588:1492,1589:1493,1590:1494,1591:1495,1592:1496,1593:1497,1594:1498,1600:1504,1601:1505,1602:1506,1603:1507,1604:1508,1605:1509,1606:1510,1607:1511,1608:1512,1609:1513,1610:1514,1611:1515,1612:1516,1613:1517,1614:1518,1615:1519,1616:1520,1617:1521,1618:1522,3585:3489,3586:3490,3587:3491,3588:3492,3589:3493,3590:3494,3591:3495,3592:3496,3593:3497,3594:3498,3595:3499,3596:3500,3597:3501,3598:3502,3599:3503,3600:3504,3601:3505,3602:3506,3603:3507,3604:3508,3605:3509,3606:3510,3607:3511,3608:3512,3609:3513,3610:3514,3611:3515,3612:3516,3613:3517,3614:3518,3615:3519,3616:3520,3617:3521,3618:3522,3619:3523,3620:3524,3621:3525,3622:3526,3623:3527,3624:3528,3625:3529,3626:3530,3627:3531,3628:3532,3629:3533,3630:3534,3631:3535,3632:3536,3633:3537,3634:3538,3635:3539,3636:3540,3637:3541,3638:3542,3639:3543,3640:3544,3641:3545,3642:3546,3647:3551,3648:3552,3649:3553,3650:3554,3651:3555,3652:3556,3653:3557,3654:3558,3655:3559,3656:3560,3657:3561,3658:3562,3659:3563,3660:3564,3661:3565,3664:3568,3665:3569,3666:3570,3667:3571,3668:3572,3669:3573,3670:3574,3671:3575,3672:3576,3673:3577,8194:2722,8195:2721,8196:2723,8197:2724,8199:2725,8200:2726,8201:2727,8202:2728,8210:2747,8211:2730,8212:2729,8213:1967,8215:3295,8216:2768,8217:2769,8218:2813,8220:2770,8221:2771,8222:2814,8224:2801,8225:2802,8226:2790,8229:2735,8230:2734,8240:2773,8242:2774,8243:2775,8248:2812,8254:1150,8361:3839,8364:8364,8453:2744,8470:1712,8471:2811,8478:2772,8482:2761,8531:2736,8532:2737,8533:2738,8534:2739,8535:2740,8536:2741,8537:2742,8538:2743,8539:2755,8540:2756,8541:2757,8542:2758,8592:2299,8593:2300,8594:2301,8595:2302,8658:2254,8660:2253,8706:2287,8711:2245,8728:3018,8730:2262,8733:2241,8734:2242,8743:2270,8744:2271,8745:2268,8746:2269,8747:2239,8756:2240,8764:2248,8771:2249,8773:16785992,8800:2237,8801:2255,8804:2236,8805:2238,8834:2266,8835:2267,8866:3068,8867:3036,8868:3010,8869:3022,8968:3027,8970:3012,8981:2810,8992:2212,8993:2213,9109:3020,9115:2219,9117:2220,9118:2221,9120:2222,9121:2215,9123:2216,9124:2217,9126:2218,9128:2223,9132:2224,9143:2209,9146:2543,9147:2544,9148:2546,9149:2547,9225:2530,9226:2533,9227:2537,9228:2531,9229:2532,9251:2732,9252:2536,9472:2211,9474:2214,9484:2210,9488:2539,9492:2541,9496:2538,9500:2548,9508:2549,9516:2551,9524:2550,9532:2542,9618:2529,9642:2791,9643:2785,9644:2779,9645:2786,9646:2783,9647:2767,9650:2792,9651:2787,9654:2781,9655:2765,9660:2793,9661:2788,9664:2780,9665:2764,9670:2528,9675:2766,9679:2782,9702:2784,9734:2789,9742:2809,9747:2762,9756:2794,9758:2795,9792:2808,9794:2807,9827:2796,9829:2798,9830:2797,9837:2806,9839:2805,10003:2803,10007:2804,10013:2777,10016:2800,10216:2748,10217:2750,12289:1188,12290:1185,12300:1186,12301:1187,12443:1246,12444:1247,12449:1191,12450:1201,12451:1192,12452:1202,12453:1193,12454:1203,12455:1194,12456:1204,12457:1195,12458:1205,12459:1206,12461:1207,12463:1208,12465:1209,12467:1210,12469:1211,12471:1212,12473:1213,12475:1214,12477:1215,12479:1216,12481:1217,12483:1199,12484:1218,12486:1219,12488:1220,12490:1221,12491:1222,12492:1223,12493:1224,12494:1225,12495:1226,12498:1227,12501:1228,12504:1229,12507:1230,12510:1231,12511:1232,12512:1233,12513:1234,12514:1235,12515:1196,12516:1236,12517:1197,12518:1237,12519:1198,12520:1238,12521:1239,12522:1240,12523:1241,12524:1242,12525:1243,12527:1244,12530:1190,12531:1245,12539:1189,12540:1200};var eZ={lookup(e){if(e>=32&&e<=255)return e;let t=ej[e];return void 0!==t?t:16777216|e}},eJ={8:"Backspace",9:"Tab",10:"NumpadClear",13:"Enter",16:"ShiftLeft",17:"ControlLeft",18:"AltLeft",19:"Pause",20:"CapsLock",21:"Lang1",25:"Lang2",27:"Escape",28:"Convert",29:"NonConvert",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",41:"Select",44:"PrintScreen",45:"Insert",46:"Delete",47:"Help",48:"Digit0",49:"Digit1",50:"Digit2",51:"Digit3",52:"Digit4",53:"Digit5",54:"Digit6",55:"Digit7",56:"Digit8",57:"Digit9",91:"MetaLeft",92:"MetaRight",93:"ContextMenu",95:"Sleep",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9",106:"NumpadMultiply",107:"NumpadAdd",108:"NumpadDecimal",109:"NumpadSubtract",110:"NumpadDecimal",111:"NumpadDivide",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",124:"F13",125:"F14",126:"F15",127:"F16",128:"F17",129:"F18",130:"F19",131:"F20",132:"F21",133:"F22",134:"F23",135:"F24",144:"NumLock",145:"ScrollLock",166:"BrowserBack",167:"BrowserForward",168:"BrowserRefresh",169:"BrowserStop",170:"BrowserSearch",171:"BrowserFavorites",172:"BrowserHome",173:"AudioVolumeMute",174:"AudioVolumeDown",175:"AudioVolumeUp",176:"MediaTrackNext",177:"MediaTrackPrevious",178:"MediaStop",179:"MediaPlayPause",180:"LaunchMail",181:"MediaSelect",182:"LaunchApp1",183:"LaunchApp2",225:"AltRight"},e$={Backspace:"Backspace",AltLeft:"Alt",AltRight:"Alt",CapsLock:"CapsLock",ContextMenu:"ContextMenu",ControlLeft:"Control",ControlRight:"Control",Enter:"Enter",MetaLeft:"Meta",MetaRight:"Meta",ShiftLeft:"Shift",ShiftRight:"Shift",Tab:"Tab",Delete:"Delete",End:"End",Help:"Help",Home:"Home",Insert:"Insert",PageDown:"PageDown",PageUp:"PageUp",ArrowDown:"ArrowDown",ArrowLeft:"ArrowLeft",ArrowRight:"ArrowRight",ArrowUp:"ArrowUp",NumLock:"NumLock",NumpadBackspace:"Backspace",NumpadClear:"Clear",Escape:"Escape",F1:"F1",F2:"F2",F3:"F3",F4:"F4",F5:"F5",F6:"F6",F7:"F7",F8:"F8",F9:"F9",F10:"F10",F11:"F11",F12:"F12",F13:"F13",F14:"F14",F15:"F15",F16:"F16",F17:"F17",F18:"F18",F19:"F19",F20:"F20",F21:"F21",F22:"F22",F23:"F23",F24:"F24",F25:"F25",F26:"F26",F27:"F27",F28:"F28",F29:"F29",F30:"F30",F31:"F31",F32:"F32",F33:"F33",F34:"F34",F35:"F35",PrintScreen:"PrintScreen",ScrollLock:"ScrollLock",Pause:"Pause",BrowserBack:"BrowserBack",BrowserFavorites:"BrowserFavorites",BrowserForward:"BrowserForward",BrowserHome:"BrowserHome",BrowserRefresh:"BrowserRefresh",BrowserSearch:"BrowserSearch",BrowserStop:"BrowserStop",Eject:"Eject",LaunchApp1:"LaunchMyComputer",LaunchApp2:"LaunchCalendar",LaunchMail:"LaunchMail",MediaPlayPause:"MediaPlay",MediaStop:"MediaStop",MediaTrackNext:"MediaTrackNext",MediaTrackPrevious:"MediaTrackPrevious",Power:"Power",Sleep:"Sleep",AudioVolumeDown:"AudioVolumeDown",AudioVolumeMute:"AudioVolumeMute",AudioVolumeUp:"AudioVolumeUp",WakeUp:"WakeUp"};let e1={};function e0(e,t){if(void 0===t)throw Error('Undefined keysym for key "'+e+'"');if(e in e1)throw Error('Duplicate entry for key "'+e+'"');e1[e]=[t,t,t,t]}function e2(e,t,s){if(void 0===t||void 0===s)throw Error('Undefined keysym for key "'+e+'"');if(e in e1)throw Error('Duplicate entry for key "'+e+'"');e1[e]=[t,t,s,t]}function e5(e,t,s){if(void 0===t||void 0===s)throw Error('Undefined keysym for key "'+e+'"');if(e in e1)throw Error('Duplicate entry for key "'+e+'"');e1[e]=[t,t,t,s]}function e3(e){if(e.code){switch(e.code){case"OSLeft":return"MetaLeft";case"OSRight":return"MetaRight"}return e.code}if(e.keyCode in eJ){let t=eJ[e.keyCode];if(v()&&"ContextMenu"===t&&(t="MetaRight"),2===e.location)switch(t){case"ShiftLeft":return"ShiftRight";case"ControlLeft":return"ControlRight";case"AltLeft":return"AltRight"}if(3===e.location)switch(t){case"Delete":return"NumpadDecimal";case"Insert":return"Numpad0";case"End":return"Numpad1";case"ArrowDown":return"Numpad2";case"PageDown":return"Numpad3";case"ArrowLeft":return"Numpad4";case"ArrowRight":return"Numpad6";case"Home":return"Numpad7";case"ArrowUp":return"Numpad8";case"PageUp":return"Numpad9";case"Enter":return"NumpadEnter"}return t}return"Unidentified"}e2("Alt",eq.XK_Alt_L,eq.XK_Alt_R),e0("AltGraph",eq.XK_ISO_Level3_Shift),e0("CapsLock",eq.XK_Caps_Lock),e2("Control",eq.XK_Control_L,eq.XK_Control_R),e2("Meta",eq.XK_Super_L,eq.XK_Super_R),e0("NumLock",eq.XK_Num_Lock),e0("ScrollLock",eq.XK_Scroll_Lock),e2("Shift",eq.XK_Shift_L,eq.XK_Shift_R),e5("Enter",eq.XK_Return,eq.XK_KP_Enter),e0("Tab",eq.XK_Tab),e5(" ",eq.XK_space,eq.XK_KP_Space),e5("ArrowDown",eq.XK_Down,eq.XK_KP_Down),e5("ArrowLeft",eq.XK_Left,eq.XK_KP_Left),e5("ArrowRight",eq.XK_Right,eq.XK_KP_Right),e5("ArrowUp",eq.XK_Up,eq.XK_KP_Up),e5("End",eq.XK_End,eq.XK_KP_End),e5("Home",eq.XK_Home,eq.XK_KP_Home),e5("PageDown",eq.XK_Next,eq.XK_KP_Next),e5("PageUp",eq.XK_Prior,eq.XK_KP_Prior),e0("Backspace",eq.XK_BackSpace),e5("Clear",eq.XK_Clear,eq.XK_KP_Begin),e0("Copy",eq.XF86XK_Copy),e0("Cut",eq.XF86XK_Cut),e5("Delete",eq.XK_Delete,eq.XK_KP_Delete),e5("Insert",eq.XK_Insert,eq.XK_KP_Insert),e0("Paste",eq.XF86XK_Paste),e0("Redo",eq.XK_Redo),e0("Undo",eq.XK_Undo),e0("Cancel",eq.XK_Cancel),e0("ContextMenu",eq.XK_Menu),e0("Escape",eq.XK_Escape),e0("Execute",eq.XK_Execute),e0("Find",eq.XK_Find),e0("Help",eq.XK_Help),e0("Pause",eq.XK_Pause),e0("Select",eq.XK_Select),e0("ZoomIn",eq.XF86XK_ZoomIn),e0("ZoomOut",eq.XF86XK_ZoomOut),e0("BrightnessDown",eq.XF86XK_MonBrightnessDown),e0("BrightnessUp",eq.XF86XK_MonBrightnessUp),e0("Eject",eq.XF86XK_Eject),e0("LogOff",eq.XF86XK_LogOff),e0("Power",eq.XF86XK_PowerOff),e0("PowerOff",eq.XF86XK_PowerDown),e0("PrintScreen",eq.XK_Print),e0("Hibernate",eq.XF86XK_Hibernate),e0("Standby",eq.XF86XK_Standby),e0("WakeUp",eq.XF86XK_WakeUp),e0("AllCandidates",eq.XK_MultipleCandidate),e0("Alphanumeric",eq.XK_Eisu_toggle),e0("CodeInput",eq.XK_Codeinput),e0("Compose",eq.XK_Multi_key),e0("Convert",eq.XK_Henkan),e0("GroupFirst",eq.XK_ISO_First_Group),e0("GroupLast",eq.XK_ISO_Last_Group),e0("GroupNext",eq.XK_ISO_Next_Group),e0("GroupPrevious",eq.XK_ISO_Prev_Group),e0("NonConvert",eq.XK_Muhenkan),e0("PreviousCandidate",eq.XK_PreviousCandidate),e0("SingleCandidate",eq.XK_SingleCandidate),e0("HangulMode",eq.XK_Hangul),e0("HanjaMode",eq.XK_Hangul_Hanja),e0("JunjaMode",eq.XK_Hangul_Jeonja),e0("Eisu",eq.XK_Eisu_toggle),e0("Hankaku",eq.XK_Hankaku),e0("Hiragana",eq.XK_Hiragana),e0("HiraganaKatakana",eq.XK_Hiragana_Katakana),e0("KanaMode",eq.XK_Kana_Shift),e0("KanjiMode",eq.XK_Kanji),e0("Katakana",eq.XK_Katakana),e0("Romaji",eq.XK_Romaji),e0("Zenkaku",eq.XK_Zenkaku),e0("ZenkakuHankaku",eq.XK_Zenkaku_Hankaku),e0("F1",eq.XK_F1),e0("F2",eq.XK_F2),e0("F3",eq.XK_F3),e0("F4",eq.XK_F4),e0("F5",eq.XK_F5),e0("F6",eq.XK_F6),e0("F7",eq.XK_F7),e0("F8",eq.XK_F8),e0("F9",eq.XK_F9),e0("F10",eq.XK_F10),e0("F11",eq.XK_F11),e0("F12",eq.XK_F12),e0("F13",eq.XK_F13),e0("F14",eq.XK_F14),e0("F15",eq.XK_F15),e0("F16",eq.XK_F16),e0("F17",eq.XK_F17),e0("F18",eq.XK_F18),e0("F19",eq.XK_F19),e0("F20",eq.XK_F20),e0("F21",eq.XK_F21),e0("F22",eq.XK_F22),e0("F23",eq.XK_F23),e0("F24",eq.XK_F24),e0("F25",eq.XK_F25),e0("F26",eq.XK_F26),e0("F27",eq.XK_F27),e0("F28",eq.XK_F28),e0("F29",eq.XK_F29),e0("F30",eq.XK_F30),e0("F31",eq.XK_F31),e0("F32",eq.XK_F32),e0("F33",eq.XK_F33),e0("F34",eq.XK_F34),e0("F35",eq.XK_F35),e0("Close",eq.XF86XK_Close),e0("MailForward",eq.XF86XK_MailForward),e0("MailReply",eq.XF86XK_Reply),e0("MailSend",eq.XF86XK_Send),e0("MediaFastForward",eq.XF86XK_AudioForward),e0("MediaPause",eq.XF86XK_AudioPause),e0("MediaPlay",eq.XF86XK_AudioPlay),e0("MediaRecord",eq.XF86XK_AudioRecord),e0("MediaRewind",eq.XF86XK_AudioRewind),e0("MediaStop",eq.XF86XK_AudioStop),e0("MediaTrackNext",eq.XF86XK_AudioNext),e0("MediaTrackPrevious",eq.XF86XK_AudioPrev),e0("New",eq.XF86XK_New),e0("Open",eq.XF86XK_Open),e0("Print",eq.XK_Print),e0("Save",eq.XF86XK_Save),e0("SpellCheck",eq.XF86XK_Spell),e0("AudioVolumeDown",eq.XF86XK_AudioLowerVolume),e0("AudioVolumeUp",eq.XF86XK_AudioRaiseVolume),e0("AudioVolumeMute",eq.XF86XK_AudioMute),e0("MicrophoneVolumeMute",eq.XF86XK_AudioMicMute),e0("LaunchApplication1",eq.XF86XK_MyComputer),e0("LaunchApplication2",eq.XF86XK_Calculator),e0("LaunchCalendar",eq.XF86XK_Calendar),e0("LaunchMail",eq.XF86XK_Mail),e0("LaunchMediaPlayer",eq.XF86XK_AudioMedia),e0("LaunchMusicPlayer",eq.XF86XK_Music),e0("LaunchPhone",eq.XF86XK_Phone),e0("LaunchScreenSaver",eq.XF86XK_ScreenSaver),e0("LaunchSpreadsheet",eq.XF86XK_Excel),e0("LaunchWebBrowser",eq.XF86XK_WWW),e0("LaunchWebCam",eq.XF86XK_WebCam),e0("LaunchWordProcessor",eq.XF86XK_Word),e0("BrowserBack",eq.XF86XK_Back),e0("BrowserFavorites",eq.XF86XK_Favorites),e0("BrowserForward",eq.XF86XK_Forward),e0("BrowserHome",eq.XF86XK_HomePage),e0("BrowserRefresh",eq.XF86XK_Refresh),e0("BrowserSearch",eq.XF86XK_Search),e0("BrowserStop",eq.XF86XK_Stop),e0("Dimmer",eq.XF86XK_BrightnessAdjust),e0("MediaAudioTrack",eq.XF86XK_AudioCycleTrack),e0("RandomToggle",eq.XF86XK_AudioRandomPlay),e0("SplitScreenToggle",eq.XF86XK_SplitScreen),e0("Subtitle",eq.XF86XK_Subtitle),e0("VideoModeNext",eq.XF86XK_Next_VMode),e5("=",eq.XK_equal,eq.XK_KP_Equal),e5("+",eq.XK_plus,eq.XK_KP_Add),e5("-",eq.XK_minus,eq.XK_KP_Subtract),e5("*",eq.XK_asterisk,eq.XK_KP_Multiply),e5("/",eq.XK_slash,eq.XK_KP_Divide),e5(".",eq.XK_period,eq.XK_KP_Decimal),e5(",",eq.XK_comma,eq.XK_KP_Separator),e5("0",eq.XK_0,eq.XK_KP_0),e5("1",eq.XK_1,eq.XK_KP_1),e5("2",eq.XK_2,eq.XK_KP_2),e5("3",eq.XK_3,eq.XK_KP_3),e5("4",eq.XK_4,eq.XK_KP_4),e5("5",eq.XK_5,eq.XK_KP_5),e5("6",eq.XK_6,eq.XK_KP_6),e5("7",eq.XK_7,eq.XK_KP_7),e5("8",eq.XK_8,eq.XK_KP_8),e5("9",eq.XK_9,eq.XK_KP_9);class e6{constructor(e){this._target=e||null,this._keyDownList={},this._altGrArmed=!1,this._eventHandlers={keyup:this._handleKeyUp.bind(this),keydown:this._handleKeyDown.bind(this),blur:this._allKeysUp.bind(this)},this.onkeyevent=()=>{}}_sendKeyEvent(e,t,s){if(s)this._keyDownList[t]=e;else{if(!(t in this._keyDownList))return;delete this._keyDownList[t]}_("onkeyevent "+(s?"down":"up")+", keysym: "+e,", code: "+t),this.onkeyevent(e,t,s)}_getKeyCode(e){let t=e3(e);return"Unidentified"!==t?t:e.keyCode&&229!==e.keyCode?"Platform"+e.keyCode:e.keyIdentifier?"U+"!==e.keyIdentifier.substr(0,2)?e.keyIdentifier:"Platform"+String.fromCharCode(parseInt(e.keyIdentifier.substr(2),16)).toUpperCase().charCodeAt():"Unidentified"}_handleKeyDown(e){let t=this._getKeyCode(e),s=function(e){let t=function(e){if(void 0!==e.key){switch(e.key){case"OS":return"Meta";case"LaunchMyComputer":return"LaunchApplication1";case"LaunchCalculator":return"LaunchApplication2"}switch(e.key){case"UIKeyInputUpArrow":return"ArrowUp";case"UIKeyInputDownArrow":return"ArrowDown";case"UIKeyInputLeftArrow":return"ArrowLeft";case"UIKeyInputRightArrow":return"ArrowRight";case"UIKeyInputEscape":return"Escape"}return"\0"===e.key&&"NumpadDecimal"===e.code?"Delete":e.key}let t=e3(e);return t in e$?e$[t]:e.charCode?String.fromCharCode(e.charCode):"Unidentified"}(e);if("Unidentified"===t)return null;if(t in e1){let s=e.location;if("Meta"===t&&0===s&&(s=2),"Clear"===t&&3===s&&"NumLock"===e3(e)&&(s=0),(void 0===s||s>3)&&(s=0),"Meta"===t){let t=e3(e);if("AltLeft"===t)return eq.XK_Meta_L;if("AltRight"===t)return eq.XK_Meta_R}if("Clear"===t&&"NumLock"===e3(e))return eq.XK_Num_Lock;if(k())switch(t){case"Zenkaku":case"Hankaku":return eq.XK_Zenkaku_Hankaku;case"Romaji":case"KanaMode":return eq.XK_Romaji}return e1[t][s]}if(1!==t.length)return null;let s=t.charCodeAt();return s?eZ.lookup(s):null}(e);if(this._altGrArmed&&(this._altGrArmed=!1,clearTimeout(this._altGrTimeout),"AltRight"===t&&e.timeStamp-this._altGrCtrlTime<50?s=eq.XK_ISO_Level3_Shift:this._sendKeyEvent(eq.XK_Control_L,"ControlLeft",!0)),"Unidentified"===t){s&&(this._sendKeyEvent(s,t,!0),this._sendKeyEvent(s,t,!1)),K(e);return}if(v()||y())switch(s){case eq.XK_Super_L:s=eq.XK_Alt_L;break;case eq.XK_Super_R:s=eq.XK_Super_L;break;case eq.XK_Alt_L:s=eq.XK_Mode_switch;break;case eq.XK_Alt_R:s=eq.XK_ISO_Level3_Shift}if(t in this._keyDownList&&(s=this._keyDownList[t]),(v()||y())&&"CapsLock"===t){this._sendKeyEvent(eq.XK_Caps_Lock,"CapsLock",!0),this._sendKeyEvent(eq.XK_Caps_Lock,"CapsLock",!1),K(e);return}let i=[eq.XK_Zenkaku_Hankaku,eq.XK_Eisu_toggle,eq.XK_Katakana,eq.XK_Hiragana,eq.XK_Romaji];if(k()&&i.includes(s)){this._sendKeyEvent(s,t,!0),this._sendKeyEvent(s,t,!1),K(e);return}if(K(e),"ControlLeft"===t&&k()&&!("ControlLeft"in this._keyDownList)){this._altGrArmed=!0,this._altGrTimeout=setTimeout(this._handleAltGrTimeout.bind(this),100),this._altGrCtrlTime=e.timeStamp;return}this._sendKeyEvent(s,t,!0)}_handleKeyUp(e){K(e);let t=this._getKeyCode(e);if(this._altGrArmed&&(this._altGrArmed=!1,clearTimeout(this._altGrTimeout),this._sendKeyEvent(eq.XK_Control_L,"ControlLeft",!0)),(v()||y())&&"CapsLock"===t){this._sendKeyEvent(eq.XK_Caps_Lock,"CapsLock",!0),this._sendKeyEvent(eq.XK_Caps_Lock,"CapsLock",!1);return}this._sendKeyEvent(this._keyDownList[t],t,!1),k()&&("ShiftLeft"===t||"ShiftRight"===t)&&("ShiftRight"in this._keyDownList&&this._sendKeyEvent(this._keyDownList.ShiftRight,"ShiftRight",!1),"ShiftLeft"in this._keyDownList&&this._sendKeyEvent(this._keyDownList.ShiftLeft,"ShiftLeft",!1))}_handleAltGrTimeout(){this._altGrArmed=!1,clearTimeout(this._altGrTimeout),this._sendKeyEvent(eq.XK_Control_L,"ControlLeft",!0)}_allKeysUp(){for(let e in _(">> Keyboard.allKeysUp"),this._keyDownList)this._sendKeyEvent(this._keyDownList[e],e,!1);_("<< Keyboard.allKeysUp")}grab(){this._target.addEventListener("keydown",this._eventHandlers.keydown),this._target.addEventListener("keyup",this._eventHandlers.keyup),window.addEventListener("blur",this._eventHandlers.blur)}ungrab(){this._target.removeEventListener("keydown",this._eventHandlers.keydown),this._target.removeEventListener("keyup",this._eventHandlers.keyup),window.removeEventListener("blur",this._eventHandlers.blur),this._allKeysUp()}}class e4{constructor(){this._target=null,this._state=127,this._tracked=[],this._ignored=[],this._waitingRelease=!1,this._releaseStart=0,this._longpressTimeoutId=null,this._twoTouchTimeoutId=null,this._boundEventHandler=this._eventHandler.bind(this)}attach(e){this.detach(),this._target=e,this._target.addEventListener("touchstart",this._boundEventHandler),this._target.addEventListener("touchmove",this._boundEventHandler),this._target.addEventListener("touchend",this._boundEventHandler),this._target.addEventListener("touchcancel",this._boundEventHandler)}detach(){this._target&&(this._stopLongpressTimeout(),this._stopTwoTouchTimeout(),this._target.removeEventListener("touchstart",this._boundEventHandler),this._target.removeEventListener("touchmove",this._boundEventHandler),this._target.removeEventListener("touchend",this._boundEventHandler),this._target.removeEventListener("touchcancel",this._boundEventHandler),this._target=null)}_eventHandler(e){let t;switch(e.stopPropagation(),e.preventDefault(),e.type){case"touchstart":t=this._touchStart;break;case"touchmove":t=this._touchMove;break;case"touchend":case"touchcancel":t=this._touchEnd}for(let s=0;s<e.changedTouches.length;s++){let i=e.changedTouches[s];t.call(this,i.identifier,i.clientX,i.clientY)}}_touchStart(e,t,s){if(this._hasDetectedGesture()||0===this._state){this._ignored.push(e);return}if(this._tracked.length>0&&Date.now()-this._tracked[0].started>250||this._waitingRelease){this._state=0,this._ignored.push(e);return}switch(this._tracked.push({id:e,started:Date.now(),active:!0,firstX:t,firstY:s,lastX:t,lastY:s,angle:0}),this._tracked.length){case 1:this._startLongpressTimeout();break;case 2:this._state&=-26,this._stopLongpressTimeout();break;case 3:this._state&=-99;break;default:this._state=0}}_touchMove(e,t,s){let i=this._tracked.find(t=>t.id===e);if(void 0===i)return;i.lastX=t,i.lastY=s;let r=t-i.firstX,n=s-i.firstY;if((i.firstX!==i.lastX||i.firstY!==i.lastY)&&(i.angle=180*Math.atan2(n,r)/Math.PI),!this._hasDetectedGesture()){if(50>Math.hypot(r,n))return;if(this._state&=-24,this._stopLongpressTimeout(),1!==this._tracked.length&&(this._state&=-9),2!==this._tracked.length&&(this._state&=-97),2===this._tracked.length){let t=this._tracked.find(t=>t.id!==e);if(Math.hypot(t.firstX-t.lastX,t.firstY-t.lastY)>50){let e=Math.abs(i.angle-t.angle);(e=Math.abs((e+180)%360-180))>90?this._state&=-33:this._state&=-65,this._isTwoTouchTimeoutRunning()&&this._stopTwoTouchTimeout()}else this._isTwoTouchTimeoutRunning()||this._startTwoTouchTimeout()}if(!this._hasDetectedGesture())return;this._pushEvent("gesturestart")}this._pushEvent("gesturemove")}_touchEnd(e,t,s){if(-1!==this._ignored.indexOf(e)){this._ignored.splice(this._ignored.indexOf(e),1),0===this._ignored.length&&0===this._tracked.length&&(this._state=127,this._waitingRelease=!1);return}if(!this._hasDetectedGesture()&&this._isTwoTouchTimeoutRunning()&&(this._stopTwoTouchTimeout(),this._state=0),!this._hasDetectedGesture()&&(this._state&=-105,this._state&=-17,this._stopLongpressTimeout(),!this._waitingRelease))switch(this._releaseStart=Date.now(),this._waitingRelease=!0,this._tracked.length){case 1:this._state&=-7;break;case 2:this._state&=-6}if(this._waitingRelease){if(Date.now()-this._releaseStart>250&&(this._state=0),this._tracked.some(e=>Date.now()-e.started>1e3)&&(this._state=0),this._tracked.find(t=>t.id===e).active=!1,this._hasDetectedGesture())this._pushEvent("gesturestart");else if(0!==this._state)return}this._hasDetectedGesture()&&this._pushEvent("gestureend");for(let e=0;e<this._tracked.length;e++)this._tracked[e].active&&this._ignored.push(this._tracked[e].id);this._tracked=[],this._state=0,-1!==this._ignored.indexOf(e)&&this._ignored.splice(this._ignored.indexOf(e),1),0===this._ignored.length&&(this._state=127,this._waitingRelease=!1)}_hasDetectedGesture(){return!(0===this._state||this._state&this._state-1||7&this._state&&this._tracked.some(e=>e.active))}_startLongpressTimeout(){this._stopLongpressTimeout(),this._longpressTimeoutId=setTimeout(()=>this._longpressTimeout(),1e3)}_stopLongpressTimeout(){clearTimeout(this._longpressTimeoutId),this._longpressTimeoutId=null}_longpressTimeout(){if(this._hasDetectedGesture())throw Error("A longpress gesture failed, conflict with a different gesture");this._state=16,this._pushEvent("gesturestart")}_startTwoTouchTimeout(){this._stopTwoTouchTimeout(),this._twoTouchTimeoutId=setTimeout(()=>this._twoTouchTimeout(),50)}_stopTwoTouchTimeout(){clearTimeout(this._twoTouchTimeoutId),this._twoTouchTimeoutId=null}_isTwoTouchTimeoutRunning(){return null!==this._twoTouchTimeoutId}_twoTouchTimeout(){if(0===this._tracked.length)throw Error("A pinch or two drag gesture failed, no tracked touches");let e=this._getAverageMovement(),t=Math.abs(e.x),s=Math.abs(e.y),i=this._getAverageDistance(),r=Math.abs(Math.hypot(i.first.x,i.first.y)-Math.hypot(i.last.x,i.last.y));s<r&&t<r?this._state=64:this._state=32,this._pushEvent("gesturestart"),this._pushEvent("gesturemove")}_pushEvent(e){let t={type:this._stateToGesture(this._state)},s=this._getPosition(),i=s.last;switch("gesturestart"===e&&(i=s.first),this._state){case 32:case 64:i=s.first}if(t.clientX=i.x,t.clientY=i.y,64===this._state){let s=this._getAverageDistance();"gesturestart"===e?(t.magnitudeX=s.first.x,t.magnitudeY=s.first.y):(t.magnitudeX=s.last.x,t.magnitudeY=s.last.y)}else if(32===this._state){if("gesturestart"===e)t.magnitudeX=0,t.magnitudeY=0;else{let e=this._getAverageMovement();t.magnitudeX=e.x,t.magnitudeY=e.y}}let r=new CustomEvent(e,{detail:t});this._target.dispatchEvent(r)}_stateToGesture(e){switch(e){case 1:return"onetap";case 2:return"twotap";case 4:return"threetap";case 8:return"drag";case 16:return"longpress";case 32:return"twodrag";case 64:return"pinch"}throw Error("Unknown gesture state: "+e)}_getPosition(){if(0===this._tracked.length)throw Error("Failed to get gesture position, no tracked touches");let e=this._tracked.length,t=0,s=0,i=0,r=0;for(let e=0;e<this._tracked.length;e++)t+=this._tracked[e].firstX,s+=this._tracked[e].firstY,i+=this._tracked[e].lastX,r+=this._tracked[e].lastY;return{first:{x:t/e,y:s/e},last:{x:i/e,y:r/e}}}_getAverageMovement(){let e,t;if(0===this._tracked.length)throw Error("Failed to get gesture movement, no tracked touches");e=t=0;let s=this._tracked.length;for(let s=0;s<this._tracked.length;s++)e+=this._tracked[s].lastX-this._tracked[s].firstX,t+=this._tracked[s].lastY-this._tracked[s].firstY;return{x:e/s,y:t/s}}_getAverageDistance(){if(0===this._tracked.length)throw Error("Failed to get gesture distance, no tracked touches");let e=this._tracked[0],t=this._tracked[this._tracked.length-1];return{first:{x:Math.abs(t.firstX-e.firstX),y:Math.abs(t.firstY-e.firstY)},last:{x:Math.abs(t.lastX-e.lastX),y:Math.abs(t.lastY-e.lastY)}}}}let e8=!b||g;class e7{constructor(){this._target=null,this._canvas=document.createElement("canvas"),e8&&(this._canvas.style.position="fixed",this._canvas.style.zIndex="65535",this._canvas.style.pointerEvents="none",this._canvas.style.visibility="hidden"),this._position={x:0,y:0},this._hotSpot={x:0,y:0},this._eventHandlers={mouseover:this._handleMouseOver.bind(this),mouseleave:this._handleMouseLeave.bind(this),mousemove:this._handleMouseMove.bind(this),mouseup:this._handleMouseUp.bind(this)}}attach(e){if(this._target&&this.detach(),this._target=e,e8){document.body.appendChild(this._canvas);let e={capture:!0,passive:!0};this._target.addEventListener("mouseover",this._eventHandlers.mouseover,e),this._target.addEventListener("mouseleave",this._eventHandlers.mouseleave,e),this._target.addEventListener("mousemove",this._eventHandlers.mousemove,e),this._target.addEventListener("mouseup",this._eventHandlers.mouseup,e)}this.clear()}detach(){if(this._target){if(e8){let e={capture:!0,passive:!0};this._target.removeEventListener("mouseover",this._eventHandlers.mouseover,e),this._target.removeEventListener("mouseleave",this._eventHandlers.mouseleave,e),this._target.removeEventListener("mousemove",this._eventHandlers.mousemove,e),this._target.removeEventListener("mouseup",this._eventHandlers.mouseup,e),document.body.removeChild(this._canvas)}this._target=null}}change(e,t,s,i,r){if(0===i||0===r){this.clear();return}this._position.x=this._position.x+this._hotSpot.x-t,this._position.y=this._position.y+this._hotSpot.y-s,this._hotSpot.x=t,this._hotSpot.y=s;let n=this._canvas.getContext("2d");this._canvas.width=i,this._canvas.height=r;let a=new ImageData(new Uint8ClampedArray(e),i,r);if(n.clearRect(0,0,i,r),n.putImageData(a,0,0),e8)this._updatePosition();else{let e=this._canvas.toDataURL();this._target.style.cursor="url("+e+")"+t+" "+s+", default"}}clear(){this._target.style.cursor="none",this._canvas.width=0,this._canvas.height=0,this._position.x=this._position.x+this._hotSpot.x,this._position.y=this._position.y+this._hotSpot.y,this._hotSpot.x=0,this._hotSpot.y=0}move(e,t){if(!e8)return;window.visualViewport?(this._position.x=e+window.visualViewport.offsetLeft,this._position.y=t+window.visualViewport.offsetTop):(this._position.x=e,this._position.y=t),this._updatePosition();let s=document.elementFromPoint(e,t);this._updateVisibility(s)}_handleMouseOver(e){this._handleMouseMove(e)}_handleMouseLeave(e){this._updateVisibility(e.relatedTarget)}_handleMouseMove(e){this._updateVisibility(e.target),this._position.x=e.clientX-this._hotSpot.x,this._position.y=e.clientY-this._hotSpot.y,this._updatePosition()}_handleMouseUp(e){let t=document.elementFromPoint(e.clientX,e.clientY);this._updateVisibility(t),this._captureIsActive()&&window.setTimeout(()=>{this._target&&(t=document.elementFromPoint(e.clientX,e.clientY),this._updateVisibility(t))},0)}_showCursor(){"hidden"===this._canvas.style.visibility&&(this._canvas.style.visibility="")}_hideCursor(){"hidden"!==this._canvas.style.visibility&&(this._canvas.style.visibility="hidden")}_shouldShowCursor(e){return!!e&&(e===this._target||!!this._target.contains(e)&&"none"===window.getComputedStyle(e).cursor)}_updateVisibility(e){this._captureIsActive()&&(e=document.captureElement),this._shouldShowCursor(e)?this._showCursor():this._hideCursor()}_updatePosition(){this._canvas.style.left=this._position.x+"px",this._canvas.style.top=this._position.y+"px"}_captureIsActive(){return document.captureElement&&document.documentElement.contains(document.captureElement)}}let e9={CONNECTING:[WebSocket.CONNECTING,"connecting"],OPEN:[WebSocket.OPEN,"open"],CLOSING:[WebSocket.CLOSING,"closing"],CLOSED:[WebSocket.CLOSED,"closed"]},te=["send","close","binaryType","onerror","onmessage","onopen","protocol","readyState"];class tt{constructor(){this._websocket=null,this._rQi=0,this._rQlen=0,this._rQbufferSize=4194304,this._rQ=null,this._sQbufferSize=10240,this._sQlen=0,this._sQ=null,this._eventHandlers={message:()=>{},open:()=>{},close:()=>{},error:()=>{}}}get readyState(){let e;return null===this._websocket?"unused":(e=this._websocket.readyState,e9.CONNECTING.includes(e))?"connecting":e9.OPEN.includes(e)?"open":e9.CLOSING.includes(e)?"closing":e9.CLOSED.includes(e)?"closed":"unknown"}get sQ(){return this._sQ}get rQ(){return this._rQ}get rQi(){return this._rQi}set rQi(e){this._rQi=e}get rQlen(){return this._rQlen-this._rQi}rQpeek8(){return this._rQ[this._rQi]}rQskipBytes(e){this._rQi+=e}rQshift8(){return this._rQshift(1)}rQshift16(){return this._rQshift(2)}rQshift32(){return this._rQshift(4)}_rQshift(e){let t=0;for(let s=e-1;s>=0;s--)t+=this._rQ[this._rQi++]<<8*s;return t}rQshiftStr(e){void 0===e&&(e=this.rQlen);let t="";for(let s=0;s<e;s+=4096){let i=this.rQshiftBytes(Math.min(4096,e-s));t+=String.fromCharCode.apply(null,i)}return t}rQshiftBytes(e){return void 0===e&&(e=this.rQlen),this._rQi+=e,new Uint8Array(this._rQ.buffer,this._rQi-e,e)}rQshiftTo(e,t){void 0===t&&(t=this.rQlen),e.set(new Uint8Array(this._rQ.buffer,this._rQi,t)),this._rQi+=t}rQslice(e,t=this.rQlen){return new Uint8Array(this._rQ.buffer,this._rQi+e,t-e)}rQwait(e,t,s){if(this.rQlen<t){if(s){if(this._rQi<s)throw Error("rQwait cannot backup "+s+" bytes");this._rQi-=s}return!0}return!1}flush(){this._sQlen>0&&"open"===this.readyState&&(this._websocket.send(this._encodeMessage()),this._sQlen=0)}send(e){this._sQ.set(e,this._sQlen),this._sQlen+=e.length,this.flush()}sendString(e){this.send(e.split("").map(e=>e.charCodeAt(0)))}off(e){this._eventHandlers[e]=()=>{}}on(e,t){this._eventHandlers[e]=t}_allocateBuffers(){this._rQ=new Uint8Array(this._rQbufferSize),this._sQ=new Uint8Array(this._sQbufferSize)}init(){this._allocateBuffers(),this._rQi=0,this._websocket=null}open(e,t){this.attach(new WebSocket(e,t))}attach(e){this.init();let t=[...Object.keys(e),...Object.getOwnPropertyNames(Object.getPrototypeOf(e))];for(let e=0;e<te.length;e++){let s=te[e];if(0>t.indexOf(s))throw Error("Raw channel missing property: "+s)}this._websocket=e,this._websocket.binaryType="arraybuffer",this._websocket.onmessage=this._recvMessage.bind(this),this._websocket.onopen=()=>{_(">> WebSock.onopen"),this._websocket.protocol&&d("Server choose sub-protocol: "+this._websocket.protocol),this._eventHandlers.open(),_("<< WebSock.onopen")},this._websocket.onclose=e=>{_(">> WebSock.onclose"),this._eventHandlers.close(e),_("<< WebSock.onclose")},this._websocket.onerror=e=>{_(">> WebSock.onerror: "+e),this._eventHandlers.error(e),_("<< WebSock.onerror: "+e)}}close(){this._websocket&&(("connecting"===this.readyState||"open"===this.readyState)&&(d("Closing WebSocket connection"),this._websocket.close()),this._websocket.onmessage=()=>{})}_encodeMessage(){return new Uint8Array(this._sQ.buffer,0,this._sQlen)}_expandCompactRQ(e){let t=(this._rQlen-this._rQi+e)*8,s=this._rQbufferSize<t;if(s&&(this._rQbufferSize=Math.max(2*this._rQbufferSize,t)),this._rQbufferSize>41943040&&(this._rQbufferSize=41943040,this._rQbufferSize-this.rQlen<e))throw Error("Receive Queue buffer exceeded 41943040 bytes, and the new message could not fit");if(s){let e=this._rQ.buffer;this._rQ=new Uint8Array(this._rQbufferSize),this._rQ.set(new Uint8Array(e,this._rQi,this._rQlen-this._rQi))}else this._rQ.copyWithin(0,this._rQi,this._rQlen);this._rQlen=this._rQlen-this._rQi,this._rQi=0}_DecodeMessage(e){let t=new Uint8Array(e);t.length>this._rQbufferSize-this._rQlen&&this._expandCompactRQ(t.length),this._rQ.set(t,this._rQlen),this._rQlen+=t.length}_recvMessage(e){this._DecodeMessage(e.data),this.rQlen>0?(this._eventHandlers.message(),this._rQlen==this._rQi&&(this._rQlen=0,this._rQi=0)):_("Ignoring empty message")}}let ts=[13,16,10,23,0,4,2,27,14,5,20,9,22,18,11,3,25,7,15,6,26,19,12,1,40,51,30,36,46,54,29,39,50,44,32,47,43,48,38,55,33,52,45,41,49,35,28,31],ti=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28];n=(i=65536)|(r=16777216),h=(a=4)|(o=1024);let tr=[n|o,0,0|i,n|h,n|a,i|h,0|a,0|i,0|o,n|o,n|h,0|o,r|h,n|a,0|r,0|a,0|h,r|o,r|o,i|o,i|o,0|n,0|n,r|h,i|a,r|a,r|a,i|a,0,0|h,i|h,0|r,0|i,n|h,0|a,0|n,n|o,0|r,0|r,0|o,n|a,0|i,i|o,r|a,0|o,0|a,r|h,i|h,n|h,i|a,0|n,r|h,r|a,0|h,i|h,n|o,0|h,r|o,r|o,0,i|a,i|o,0,n|a],tn=[(n=(i=1048576)|(r=-2147483648))|(h=(a=32)|(o=32768)),r|o,0|o,i|h,0|i,0|a,n|a,r|h,r|a,n|h,n|o,0|r,r|o,0|i,0|a,n|a,i|o,i|a,r|h,0,0|r,0|o,i|h,0|n,i|a,r|a,0,i|o,0|h,n|o,0|n,0|h,0,i|h,n|a,0|i,r|h,0|n,n|o,0|o,0|n,r|o,0|a,n|h,i|h,0|a,0|o,0|r,0|h,n|o,0|i,r|a,i|a,r|h,r|a,i|a,i|o,0,r|o,0|h,0|r,n|a,n|h,i|o];n=(i=131072)|(r=134217728);let ta=[0|(h=(a=8)|(o=512)),n|o,0,n|a,r|o,0,i|h,r|o,i|a,r|a,r|a,0|i,n|h,i|a,0|n,0|h,0|r,0|a,n|o,0|o,i|o,0|n,n|a,i|h,r|h,i|o,0|i,r|h,0|a,n|h,0|o,0|r,n|o,0|r,i|a,0|h,0|i,n|o,r|o,0,0|o,i|a,n|h,r|o,r|a,0|o,0,n|a,r|h,0|i,0|r,n|h,0|a,i|h,i|o,r|a,0|n,r|h,0|h,0|n,i|h,0|a,n|a,i|o];n=(i=8192)|(r=8388608),h=(a=1)|(o=128);let to=[n|a,i|h,i|h,0|o,n|o,r|h,r|a,i|a,0,0|n,0|n,n|h,0|h,0,r|o,r|a,0|a,0|i,0|r,n|a,0|o,0|r,i|a,i|o,r|h,0|a,i|o,r|o,0|i,n|o,n|h,0|h,r|o,r|a,0|n,n|h,0|h,0,0,0|n,i|o,r|o,r|h,0|a,n|a,i|h,i|h,0|o,n|h,0|h,0|a,0|i,r|a,i|a,n|o,r|h,i|a,i|o,0|r,n|a,0|o,0|r,0|i,n|o];n=(i=33554432)|(r=1073741824),h=(a=256)|(o=524288);let th=[0|a,i|h,i|o,n|a,0|o,0|a,0|r,i|o,r|h,0|o,i|a,r|h,n|a,n|o,0|h,0|r,0|i,r|o,r|o,0,r|a,n|h,n|h,i|a,n|o,r|a,0,0|n,i|h,0|i,0|n,0|h,0|o,n|a,0|a,0|i,0|r,i|o,n|a,r|h,i|a,0|r,n|o,i|h,r|h,0|a,0|i,n|o,n|h,0|h,0|n,n|h,i|o,0,r|o,0|n,0|h,i|a,r|a,0|o,0,r|o,i|h,r|a];n=(i=4194304)|(r=536870912),h=(a=16)|(o=16384);let tl=[r|a,0|n,0|o,n|h,0|n,0|a,n|h,0|i,r|o,i|h,0|i,r|a,i|a,r|o,0|r,0|h,0,i|a,r|h,0|o,i|o,r|h,0|a,n|a,n|a,0,i|h,n|o,0|h,i|o,n|o,0|r,r|o,0|a,n|a,i|o,n|h,0|i,0|h,r|a,0|i,r|o,0|r,0|h,r|a,n|h,i|o,0|n,i|h,n|o,0,n|a,0|a,0|o,0|n,i|h,0|o,i|a,r|h,0,n|o,0|r,i|a,r|h];n=(i=2097152)|(r=67108864),h=(a=2)|(o=2048);let t_=[0|i,n|a,r|h,0,0|o,r|h,i|h,n|o,n|h,0|i,0,r|a,0|a,0|r,n|a,0|h,r|o,i|h,i|a,r|o,r|a,0|n,n|o,i|a,0|n,0|o,0|h,n|h,i|o,0|a,0|r,i|o,0|r,i|o,0|i,r|h,r|h,n|a,n|a,0|a,i|a,0|r,r|o,0|i,n|o,0|h,i|h,n|o,0|h,r|a,n|h,0|n,i|o,0,0|a,n|h,0,i|h,0|n,0|o,r|a,r|o,0|o,i|a];n=(i=262144)|(r=268435456);let td=[r|(h=(a=64)|(o=4096)),0|o,0|i,n|h,0|r,r|h,0|a,0|r,i|a,0|n,n|h,i|o,n|o,i|h,0|o,0|a,0|n,r|a,r|o,0|h,i|o,i|a,n|a,n|o,0|h,0,0,n|a,r|a,r|o,i|h,0|i,i|h,0|i,n|o,0|o,0|a,n|a,0|o,i|h,r|o,0|a,r|a,0|n,n|a,0|r,0|i,r|h,0,n|h,i|a,r|a,0|n,r|o,r|h,0,n|h,i|o,i|o,0|h,0|h,i|a,0|r,n|o];class tc{constructor(e){this.keys=[];let t=[],s=[],i=[];for(let s=0,i=56;s<56;++s,i-=8){let r=7&(i+=i<-5?65:i<-3?31:i<-1?63:27===i?35:0);t[s]=(e[i>>>3]&1<<r)!=0?1:0}for(let e=0;e<16;++e){let r=e<<1,n=r+1;i[r]=i[n]=0;for(let i=28;i<59;i+=28)for(let r=i-28;r<i;++r){let n=r+ti[e];s[r]=n<i?t[n]:t[n-28]}for(let e=0;e<24;++e)0!==s[ts[e]]&&(i[r]|=1<<23-e),0!==s[ts[e+24]]&&(i[n]|=1<<23-e)}for(let e=0,t=0,s=0;e<16;++e){let e=i[t++],r=i[t++];this.keys[s]=(16515072&e)<<6,this.keys[s]|=(4032&e)<<10,this.keys[s]|=(16515072&r)>>>10,this.keys[s]|=(4032&r)>>>6,++s,this.keys[s]=(258048&e)<<12,this.keys[s]|=(63&e)<<16,this.keys[s]|=(258048&r)>>>4,this.keys[s]|=63&r,++s}}enc8(e){let t=e.slice(),s=0,i,r,n;n=((i=t[s++]<<24|t[s++]<<16|t[s++]<<8|t[s++])>>>4^(r=t[s++]<<24|t[s++]<<16|t[s++]<<8|t[s++]))&252645135,r^=n,i^=n<<4,n=(i>>>16^r)&65535,r^=n,i^=n<<16,n=(r>>>2^i)&858993459,i^=n,r^=n<<2,n=(r>>>8^i)&16711935,i^=n,r^=n<<8,n=(i^(r=r<<1|r>>>31&1))&2863311530,i^=n,r^=n,i=i<<1|i>>>31&1;for(let e=0,t=0;e<8;++e){let e=t_[63&(n=(r<<28|r>>>4)^this.keys[t++])];e|=th[n>>>8&63],e|=ta[n>>>16&63],e|=tr[n>>>24&63],e|=td[63&(n=r^this.keys[t++])],e|=tl[n>>>8&63],e|=to[n>>>16&63],e|=tn[n>>>24&63],i^=e,r^=e=t_[63&(n=(i<<28|i>>>4)^this.keys[t++])]|th[n>>>8&63]|ta[n>>>16&63]|tr[n>>>24&63]|td[63&(n=i^this.keys[t++])]|tl[n>>>8&63]|to[n>>>16&63]|tn[n>>>24&63]}for(n=(i^(r=r<<31|r>>>1))&2863311530,i^=n,r^=n,n=((i=i<<31|i>>>1)>>>8^r)&16711935,r^=n,i^=n<<8,n=(i>>>2^r)&858993459,r^=n,i^=n<<2,n=(r>>>16^i)&65535,i^=n,r^=n<<16,n=(r>>>4^i)&252645135,i^=n,r^=n<<4,n=[r,i],s=0;s<8;s++)t[s]=(n[s>>>2]>>>8*(3-s%4))%256,t[s]<0&&(t[s]+=256);return t}encrypt(e){return this.enc8(e.slice(0,8)).concat(this.enc8(e.slice(8,16)))}}var tu={Again:57349,AltLeft:56,AltRight:57400,ArrowDown:57424,ArrowLeft:57419,ArrowRight:57421,ArrowUp:57416,AudioVolumeDown:57390,AudioVolumeMute:57376,AudioVolumeUp:57392,Backquote:41,Backslash:43,Backspace:14,BracketLeft:26,BracketRight:27,BrowserBack:57450,BrowserFavorites:57446,BrowserForward:57449,BrowserHome:57394,BrowserRefresh:57447,BrowserSearch:57445,BrowserStop:57448,CapsLock:58,Comma:51,ContextMenu:57437,ControlLeft:29,ControlRight:57373,Convert:121,Copy:57464,Cut:57404,Delete:57427,Digit0:11,Digit1:2,Digit2:3,Digit3:4,Digit4:5,Digit5:6,Digit6:7,Digit7:8,Digit8:9,Digit9:10,Eject:57469,End:57423,Enter:28,Equal:13,Escape:1,F1:59,F10:68,F11:87,F12:88,F13:93,F14:94,F15:95,F16:85,F17:57347,F18:57463,F19:57348,F2:60,F20:90,F21:116,F22:57465,F23:109,F24:111,F3:61,F4:62,F5:63,F6:64,F7:65,F8:66,F9:67,Find:57409,Help:57461,Hiragana:119,Home:57415,Insert:57426,IntlBackslash:86,IntlRo:115,IntlYen:125,KanaMode:112,Katakana:120,KeyA:30,KeyB:48,KeyC:46,KeyD:32,KeyE:18,KeyF:33,KeyG:34,KeyH:35,KeyI:23,KeyJ:36,KeyK:37,KeyL:38,KeyM:50,KeyN:49,KeyO:24,KeyP:25,KeyQ:16,KeyR:19,KeyS:31,KeyT:20,KeyU:22,KeyV:47,KeyW:17,KeyX:45,KeyY:21,KeyZ:44,Lang1:114,Lang2:113,Lang3:120,Lang4:119,Lang5:118,LaunchApp1:57451,LaunchApp2:57377,LaunchMail:57452,MediaPlayPause:57378,MediaSelect:57453,MediaStop:57380,MediaTrackNext:57369,MediaTrackPrevious:57360,MetaLeft:57435,MetaRight:57436,Minus:12,NonConvert:123,NumLock:69,Numpad0:82,Numpad1:79,Numpad2:80,Numpad3:81,Numpad4:75,Numpad5:76,Numpad6:77,Numpad7:71,Numpad8:72,Numpad9:73,NumpadAdd:78,NumpadComma:126,NumpadDecimal:83,NumpadDivide:57397,NumpadEnter:57372,NumpadEqual:89,NumpadMultiply:55,NumpadParenLeft:57462,NumpadParenRight:57467,NumpadSubtract:74,Open:100,PageDown:57425,PageUp:57417,Paste:101,Pause:57414,Period:52,Power:57438,PrintScreen:84,Props:57350,Quote:40,ScrollLock:70,Semicolon:39,ShiftLeft:42,ShiftRight:54,Slash:53,Sleep:57439,Space:57,Suspend:57381,Tab:15,Undo:57351,WakeUp:57443};let tf={encodingRaw:0,encodingCopyRect:1,encodingRRE:2,encodingHextile:5,encodingTight:7,encodingTightPNG:-260,pseudoEncodingQualityLevel0:-32,pseudoEncodingDesktopSize:-223,pseudoEncodingLastRect:-224,pseudoEncodingCursor:-239,pseudoEncodingQEMUExtendedKeyEvent:-258,pseudoEncodingDesktopName:-307,pseudoEncodingExtendedDesktopSize:-308,pseudoEncodingXvp:-309,pseudoEncodingFence:-312,pseudoEncodingContinuousUpdates:-313,pseudoEncodingCompressLevel0:-256,pseudoEncodingVMwareCursor:1464686180,pseudoEncodingExtendedClipboard:3231835598};class tp{constructor(){this._lines=0}decodeRect(e,t,s,i,r,n,a){if(0===s||0===i)return!0;0===this._lines&&(this._lines=i);let o=s*(8==a?1:4);if(r.rQwait("RAW",o))return!1;let h=t+(i-this._lines),l=Math.min(this._lines,Math.floor(r.rQlen/o)),_=s*l,d=r.rQ,c=r.rQi;if(8==a){let e=new Uint8Array(4*_);for(let t=0;t<_;t++)e[4*t+0]=(d[c+t]>>0&3)*255/3,e[4*t+1]=(d[c+t]>>2&3)*255/3,e[4*t+2]=(d[c+t]>>4&3)*255/3,e[4*t+3]=255;d=e,c=0}for(let e=0;e<_;e++)d[4*e+3]=255;return n.blitImage(e,h,s,l,d,c),r.rQskipBytes(l*o),this._lines-=l,!(this._lines>0)}}class tg{decodeRect(e,t,s,i,r,n,a){if(r.rQwait("COPYRECT",4))return!1;let o=r.rQshift16(),h=r.rQshift16();return 0===s||0===i||(n.copyImage(o,h,e,t,s,i),!0)}}class tm{constructor(){this._subrects=0}decodeRect(e,t,s,i,r,n,a){if(0===this._subrects){if(r.rQwait("RRE",8))return!1;this._subrects=r.rQshift32();let a=r.rQshiftBytes(4);n.fillRect(e,t,s,i,a)}for(;this._subrects>0;){if(r.rQwait("RRE",12))return!1;let s=r.rQshiftBytes(4),i=r.rQshift16(),a=r.rQshift16(),o=r.rQshift16(),h=r.rQshift16();n.fillRect(e+i,t+a,o,h,s),this._subrects--}return!0}}class tw{constructor(){this._tiles=0,this._lastsubencoding=0,this._tileBuffer=new Uint8Array(1024)}decodeRect(e,t,s,i,r,n,a){for(0===this._tiles&&(this._tilesX=Math.ceil(s/16),this._tilesY=Math.ceil(i/16),this._totalTiles=this._tilesX*this._tilesY,this._tiles=this._totalTiles);this._tiles>0;){let a=1;if(r.rQwait("HEXTILE",a))return!1;let o=r.rQ,h=r.rQi,l=o[h];if(l>30)throw Error("Illegal hextile subencoding (subencoding: "+l+")");let d=this._totalTiles-this._tiles,c=d%this._tilesX,u=Math.floor(d/this._tilesX),f=e+16*c,p=t+16*u,g=Math.min(16,e+s-f),m=Math.min(16,t+i-p);if(1&l)a+=g*m*4;else if(2&l&&(a+=4),4&l&&(a+=4),8&l){if(a++,r.rQwait("HEXTILE",a))return!1;let e=o[h+a-1];16&l?a+=6*e:a+=2*e}if(r.rQwait("HEXTILE",a))return!1;if(h++,0===l)1&this._lastsubencoding?_(" Ignoring blank after RAW"):n.fillRect(f,p,g,m,this._background);else if(1&l){let e=g*m;for(let t=0;t<e;t++)o[h+4*t+3]=255;n.blitImage(f,p,g,m,o,h),h+=a-1}else{if(2&l&&(this._background=[o[h],o[h+1],o[h+2],o[h+3]],h+=4),4&l&&(this._foreground=[o[h],o[h+1],o[h+2],o[h+3]],h+=4),this._startTile(f,p,g,m,this._background),8&l){let e=o[h];h++;for(let t=0;t<e;t++){let e;16&l?(e=[o[h],o[h+1],o[h+2],o[h+3]],h+=4):e=this._foreground;let t=o[h],s=t>>4,i=15&t,r=o[++h];h++;let n=(r>>4)+1,a=(15&r)+1;this._subTile(s,i,n,a,e)}}this._finishTile(n)}r.rQi=h,this._lastsubencoding=l,this._tiles--}return!0}_startTile(e,t,s,i,r){this._tileX=e,this._tileY=t,this._tileW=s,this._tileH=i;let n=r[0],a=r[1],o=r[2],h=this._tileBuffer;for(let e=0;e<s*i*4;e+=4)h[e]=n,h[e+1]=a,h[e+2]=o,h[e+3]=255}_subTile(e,t,s,i,r){let n=r[0],a=r[1],o=r[2],h=e+s,l=t+i,_=this._tileBuffer,d=this._tileW;for(let s=t;s<l;s++)for(let t=e;t<h;t++){let e=(t+s*d)*4;_[e]=n,_[e+1]=a,_[e+2]=o,_[e+3]=255}}_finishTile(e){e.blitImage(this._tileX,this._tileY,this._tileW,this._tileH,this._tileBuffer,0)}}class tb{constructor(){this._ctl=null,this._filter=null,this._numColors=0,this._palette=new Uint8Array(1024),this._len=0,this._zlibs=[];for(let e=0;e<4;e++)this._zlibs[e]=new es}decodeRect(e,t,s,i,r,n,a){let o;if(null===this._ctl){if(r.rQwait("TIGHT compression-control",1))return!1;this._ctl=r.rQshift8();for(let e=0;e<4;e++)this._ctl>>e&1&&(this._zlibs[e].reset(),d("Reset zlib stream "+e));this._ctl=this._ctl>>4}if(8===this._ctl)o=this._fillRect(e,t,s,i,r,n,a);else if(9===this._ctl)o=this._jpegRect(e,t,s,i,r,n,a);else if(10===this._ctl)o=this._pngRect(e,t,s,i,r,n,a);else if((8&this._ctl)==0)o=this._basicRect(this._ctl,e,t,s,i,r,n,a);else throw Error("Illegal tight compression received (ctl: "+this._ctl+")");return o&&(this._ctl=null),o}_fillRect(e,t,s,i,r,n,a){if(r.rQwait("TIGHT",3))return!1;let o=r.rQi,h=r.rQ;return n.fillRect(e,t,s,i,[h[o],h[o+1],h[o+2]],!1),r.rQskipBytes(3),!0}_jpegRect(e,t,s,i,r,n,a){let o=this._readData(r);return null!==o&&(n.imageRect(e,t,s,i,"image/jpeg",o),!0)}_pngRect(e,t,s,i,r,n,a){throw Error("PNG received in standard Tight rect")}_basicRect(e,t,s,i,r,n,a,o){let h;if(null===this._filter){if(4&e){if(n.rQwait("TIGHT",1))return!1;this._filter=n.rQshift8()}else this._filter=0}let l=3&e;switch(this._filter){case 0:h=this._copyFilter(l,t,s,i,r,n,a,o);break;case 1:h=this._paletteFilter(l,t,s,i,r,n,a,o);break;case 2:h=this._gradientFilter(l,t,s,i,r,n,a,o);break;default:throw Error("Illegal tight filter received (ctl: "+this._filter+")")}return h&&(this._filter=null),h}_copyFilter(e,t,s,i,r,n,a,o){let h;let l=i*r*3;if(0===l)return!0;if(l<12){if(n.rQwait("TIGHT",l))return!1;h=n.rQshiftBytes(l)}else{if(null===(h=this._readData(n)))return!1;this._zlibs[e].setInput(h),h=this._zlibs[e].inflate(l),this._zlibs[e].setInput(null)}let _=new Uint8Array(i*r*4);for(let e=0,t=0;e<i*r*4;e+=4,t+=3)_[e]=h[t],_[e+1]=h[t+1],_[e+2]=h[t+2],_[e+3]=255;return a.blitImage(t,s,i,r,_,0,!1),!0}_paletteFilter(e,t,s,i,r,n,a,o){let h;if(0===this._numColors){if(n.rQwait("TIGHT palette",1))return!1;let e=n.rQpeek8()+1,t=3*e;if(n.rQwait("TIGHT palette",1+t))return!1;this._numColors=e,n.rQskipBytes(1),n.rQshiftTo(this._palette,t)}let l=Math.floor((i*(this._numColors<=2?1:8)+7)/8)*r;if(0===l)return!0;if(l<12){if(n.rQwait("TIGHT",l))return!1;h=n.rQshiftBytes(l)}else{if(null===(h=this._readData(n)))return!1;this._zlibs[e].setInput(h),h=this._zlibs[e].inflate(l),this._zlibs[e].setInput(null)}return 2==this._numColors?this._monoRect(t,s,i,r,h,this._palette,a):this._paletteRect(t,s,i,r,h,this._palette,a),this._numColors=0,!0}_monoRect(e,t,s,i,r,n,a){let o=this._getScratchBuffer(s*i*4),h=Math.floor((s+7)/8),l=Math.floor(s/8);for(let e=0;e<i;e++){let t,i,a;for(a=0;a<l;a++)for(let l=7;l>=0;l--)t=(e*s+8*a+7-l)*4,i=(r[e*h+a]>>l&1)*3,o[t]=n[i],o[t+1]=n[i+1],o[t+2]=n[i+2],o[t+3]=255;for(let l=7;l>=8-s%8;l--)t=(e*s+8*a+7-l)*4,i=(r[e*h+a]>>l&1)*3,o[t]=n[i],o[t+1]=n[i+1],o[t+2]=n[i+2],o[t+3]=255}a.blitImage(e,t,s,i,o,0,!1)}_paletteRect(e,t,s,i,r,n,a){let o=this._getScratchBuffer(s*i*4),h=s*i*4;for(let e=0,t=0;e<h;e+=4,t++){let s=3*r[t];o[e]=n[s],o[e+1]=n[s+1],o[e+2]=n[s+2],o[e+3]=255}a.blitImage(e,t,s,i,o,0,!1)}_gradientFilter(e,t,s,i,r,n,a,o){throw Error("Gradient filter not implemented")}_readData(e){if(0===this._len){let t;if(e.rQwait("TIGHT",3))return null;t=e.rQshift8(),this._len=127&t,128&t&&(t=e.rQshift8(),this._len|=(127&t)<<7,128&t&&(t=e.rQshift8(),this._len|=t<<14))}if(e.rQwait("TIGHT",this._len))return null;let t=e.rQshiftBytes(this._len);return this._len=0,t}_getScratchBuffer(e){return(!this._scratchBuffer||this._scratchBuffer.length<e)&&(this._scratchBuffer=new Uint8Array(e)),this._scratchBuffer}}class tv extends tb{_pngRect(e,t,s,i,r,n,a){let o=this._readData(r);return null!==o&&(n.imageRect(e,t,s,i,"image/png",o),!0)}_basicRect(e,t,s,i,r,n,a,o){throw Error("BasicCompression received in TightPNG rect")}}class tk extends A{constructor(e,t,s){if(!e)throw Error("Must specify target");if(!t)throw Error("Must specify URL, WebSocket or RTCDataChannel");super(),this._target=e,"string"==typeof t?this._url=t:(this._url=null,this._rawChannel=t),s=s||{},this._rfbCredentials=s.credentials||{},this._shared=!("shared"in s)||!!s.shared,this._repeaterID=s.repeaterID||"",this._wsProtocols=s.wsProtocols||[],this._rfbConnectionState="",this._rfbInitState="",this._rfbAuthScheme=-1,this._rfbCleanDisconnect=!0,this._rfbVersion=0,this._rfbMaxVersion=3.8,this._rfbTightVNC=!1,this._rfbVeNCryptState=0,this._rfbXvpVer=0,this._fbWidth=0,this._fbHeight=0,this._fbName="",this._capabilities={power:!1},this._supportsFence=!1,this._supportsContinuousUpdates=!1,this._enabledContinuousUpdates=!1,this._supportsSetDesktopSize=!1,this._screenID=0,this._screenFlags=0,this._qemuExtKeyEventSupported=!1,this._clipboardText=null,this._clipboardServerCapabilitiesActions={},this._clipboardServerCapabilitiesFormats={},this._sock=null,this._display=null,this._flushing=!1,this._keyboard=null,this._gestures=null,this._resizeObserver=null,this._disconnTimer=null,this._resizeTimeout=null,this._mouseMoveTimer=null,this._decoders={},this._FBU={rects:0,x:0,y:0,width:0,height:0,encoding:null},this._mousePos={},this._mouseButtonMask=0,this._mouseLastMoveTime=0,this._viewportDragging=!1,this._viewportDragPos={},this._viewportHasMoved=!1,this._accumulatedWheelDeltaX=0,this._accumulatedWheelDeltaY=0,this._gestureLastTapTime=null,this._gestureFirstDoubleTapEv=null,this._gestureLastMagnitudeX=0,this._gestureLastMagnitudeY=0,this._eventHandlers={focusCanvas:this._focusCanvas.bind(this),handleResize:this._handleResize.bind(this),handleMouse:this._handleMouse.bind(this),handleWheel:this._handleWheel.bind(this),handleGesture:this._handleGesture.bind(this)},_(">> RFB.constructor"),this._screen=document.createElement("div"),this._screen.style.display="flex",this._screen.style.width="100%",this._screen.style.height="100%",this._screen.style.overflow="auto",this._screen.style.background="rgb(40, 40, 40)",this._canvas=document.createElement("canvas"),this._canvas.style.margin="auto",this._canvas.style.outline="none",this._canvas.width=0,this._canvas.height=0,this._canvas.tabIndex=-1,this._screen.appendChild(this._canvas),this._cursor=new e7,this._cursorImage=tk.cursors.none,this._decoders[tf.encodingRaw]=new tp,this._decoders[tf.encodingCopyRect]=new tg,this._decoders[tf.encodingRRE]=new tm,this._decoders[tf.encodingHextile]=new tw,this._decoders[tf.encodingTight]=new tb,this._decoders[tf.encodingTightPNG]=new tv;try{this._display=new z(this._canvas)}catch(e){throw u("Display exception: "+e),e}this._display.onflush=this._onFlush.bind(this),this._keyboard=new e6(this._canvas),this._keyboard.onkeyevent=this._handleKeyEvent.bind(this),this._gestures=new e4,this._sock=new tt,this._sock.on("open",this._socketOpen.bind(this)),this._sock.on("close",this._socketClose.bind(this)),this._sock.on("message",this._handleMessage.bind(this)),this._sock.on("error",this._socketError.bind(this)),this._resizeObserver=new ResizeObserver(this._eventHandlers.handleResize),this._updateConnectionState("connecting"),_("<< RFB.constructor"),this.dragViewport=!1,this.focusOnClick=!0,this._viewOnly=!1,this._clipViewport=!1,this._scaleViewport=!1,this._resizeSession=!1,this._showDotCursor=!1,void 0!==s.showDotCursor&&(c("Specifying showDotCursor as a RFB constructor argument is deprecated"),this._showDotCursor=s.showDotCursor),this._qualityLevel=6,this._compressionLevel=2}get viewOnly(){return this._viewOnly}set viewOnly(e){this._viewOnly=e,("connecting"===this._rfbConnectionState||"connected"===this._rfbConnectionState)&&(e?this._keyboard.ungrab():this._keyboard.grab())}get capabilities(){return this._capabilities}get touchButton(){return 0}set touchButton(e){c("Using old API!")}get clipViewport(){return this._clipViewport}set clipViewport(e){this._clipViewport=e,this._updateClip()}get scaleViewport(){return this._scaleViewport}set scaleViewport(e){this._scaleViewport=e,e&&this._clipViewport&&this._updateClip(),this._updateScale(),!e&&this._clipViewport&&this._updateClip()}get resizeSession(){return this._resizeSession}set resizeSession(e){this._resizeSession=e,e&&this._requestRemoteResize()}get showDotCursor(){return this._showDotCursor}set showDotCursor(e){this._showDotCursor=e,this._refreshCursor()}get background(){return this._screen.style.background}set background(e){this._screen.style.background=e}get qualityLevel(){return this._qualityLevel}set qualityLevel(e){if(!Number.isInteger(e)||e<0||e>9){u("qualityLevel must be an integer between 0 and 9");return}this._qualityLevel!==e&&(this._qualityLevel=e,"connected"===this._rfbConnectionState&&this._sendEncodings())}get compressionLevel(){return this._compressionLevel}set compressionLevel(e){if(!Number.isInteger(e)||e<0||e>9){u("compressionLevel must be an integer between 0 and 9");return}this._compressionLevel!==e&&(this._compressionLevel=e,"connected"===this._rfbConnectionState&&this._sendEncodings())}disconnect(){this._updateConnectionState("disconnecting"),this._sock.off("error"),this._sock.off("message"),this._sock.off("open")}sendCredentials(e){this._rfbCredentials=e,setTimeout(this._initMsg.bind(this),0)}sendCtrlAltDel(){"connected"!==this._rfbConnectionState||this._viewOnly||(d("Sending Ctrl-Alt-Del"),this.sendKey(eq.XK_Control_L,"ControlLeft",!0),this.sendKey(eq.XK_Alt_L,"AltLeft",!0),this.sendKey(eq.XK_Delete,"Delete",!0),this.sendKey(eq.XK_Delete,"Delete",!1),this.sendKey(eq.XK_Alt_L,"AltLeft",!1),this.sendKey(eq.XK_Control_L,"ControlLeft",!1))}machineShutdown(){this._xvpOp(1,2)}machineReboot(){this._xvpOp(1,3)}machineReset(){this._xvpOp(1,4)}sendKey(e,t,s){if("connected"!==this._rfbConnectionState||this._viewOnly)return;if(void 0===s){this.sendKey(e,t,!0),this.sendKey(e,t,!1);return}let i=tu[t];if(this._qemuExtKeyEventSupported&&i)d("Sending key ("+(s?"down":"up")+"): keysym "+(e=e||0)+", scancode "+i),tk.messages.QEMUExtendedKeyEvent(this._sock,e,s,i);else{if(!e)return;d("Sending keysym ("+(s?"down":"up")+"): "+e),tk.messages.keyEvent(this._sock,e,s?1:0)}}focus(){this._canvas.focus()}blur(){this._canvas.blur()}clipboardPasteFrom(e){if("connected"===this._rfbConnectionState&&!this._viewOnly){if(this._clipboardServerCapabilitiesFormats[1]&&this._clipboardServerCapabilitiesActions[134217728])this._clipboardText=e,tk.messages.extendedClipboardNotify(this._sock,[1]);else{let t=new Uint8Array(e.length);for(let s=0;s<e.length;s++)t[s]=e.charCodeAt(s);tk.messages.clientCutText(this._sock,t)}}}_connect(){if(_(">> RFB.connect"),this._url)d(`connecting to ${this._url}`),this._sock.open(this._url,this._wsProtocols);else{if(d(`attaching ${this._rawChannel} to Websock`),this._sock.attach(this._rawChannel),"closed"===this._sock.readyState)throw Error("Cannot use already closed WebSocket/RTCDataChannel");"open"===this._sock.readyState&&this._socketOpen()}this._target.appendChild(this._screen),this._gestures.attach(this._canvas),this._cursor.attach(this._canvas),this._refreshCursor(),this._resizeObserver.observe(this._screen),this._canvas.addEventListener("mousedown",this._eventHandlers.focusCanvas),this._canvas.addEventListener("touchstart",this._eventHandlers.focusCanvas),this._canvas.addEventListener("mousedown",this._eventHandlers.handleMouse),this._canvas.addEventListener("mouseup",this._eventHandlers.handleMouse),this._canvas.addEventListener("mousemove",this._eventHandlers.handleMouse),this._canvas.addEventListener("click",this._eventHandlers.handleMouse),this._canvas.addEventListener("contextmenu",this._eventHandlers.handleMouse),this._canvas.addEventListener("wheel",this._eventHandlers.handleWheel),this._canvas.addEventListener("gesturestart",this._eventHandlers.handleGesture),this._canvas.addEventListener("gesturemove",this._eventHandlers.handleGesture),this._canvas.addEventListener("gestureend",this._eventHandlers.handleGesture),_("<< RFB.connect")}_disconnect(){_(">> RFB.disconnect"),this._cursor.detach(),this._canvas.removeEventListener("gesturestart",this._eventHandlers.handleGesture),this._canvas.removeEventListener("gesturemove",this._eventHandlers.handleGesture),this._canvas.removeEventListener("gestureend",this._eventHandlers.handleGesture),this._canvas.removeEventListener("wheel",this._eventHandlers.handleWheel),this._canvas.removeEventListener("mousedown",this._eventHandlers.handleMouse),this._canvas.removeEventListener("mouseup",this._eventHandlers.handleMouse),this._canvas.removeEventListener("mousemove",this._eventHandlers.handleMouse),this._canvas.removeEventListener("click",this._eventHandlers.handleMouse),this._canvas.removeEventListener("contextmenu",this._eventHandlers.handleMouse),this._canvas.removeEventListener("mousedown",this._eventHandlers.focusCanvas),this._canvas.removeEventListener("touchstart",this._eventHandlers.focusCanvas),this._resizeObserver.disconnect(),this._keyboard.ungrab(),this._gestures.detach(),this._sock.close();try{this._target.removeChild(this._screen)}catch(e){if("NotFoundError"===e.name);else throw e}clearTimeout(this._resizeTimeout),clearTimeout(this._mouseMoveTimer),_("<< RFB.disconnect")}_socketOpen(){"connecting"===this._rfbConnectionState&&""===this._rfbInitState?(this._rfbInitState="ProtocolVersion",_("Starting VNC handshake")):this._fail("Unexpected server connection while "+this._rfbConnectionState)}_socketClose(e){_("WebSocket on-close event");let t="";switch(e.code&&(t="(code: "+e.code,e.reason&&(t+=", reason: "+e.reason),t+=")"),this._rfbConnectionState){case"connecting":this._fail("Connection closed "+t);break;case"connected":this._updateConnectionState("disconnecting"),this._updateConnectionState("disconnected");break;case"disconnecting":this._updateConnectionState("disconnected");break;case"disconnected":this._fail("Unexpected server disconnect when already disconnected "+t);break;default:this._fail("Unexpected server disconnect before connecting "+t)}this._sock.off("close"),this._rawChannel=null}_socketError(e){c("WebSocket on-error event")}_focusCanvas(e){this.focusOnClick&&this.focus()}_setDesktopName(e){this._fbName=e,this.dispatchEvent(new CustomEvent("desktopname",{detail:{name:this._fbName}}))}_handleResize(){window.requestAnimationFrame(()=>{this._updateClip(),this._updateScale()}),this._resizeSession&&(clearTimeout(this._resizeTimeout),this._resizeTimeout=setTimeout(this._requestRemoteResize.bind(this),500))}_updateClip(){let e=this._display.clipViewport,t=this._clipViewport;if(this._scaleViewport&&(t=!1),e!==t&&(this._display.clipViewport=t),t){let e=this._screenSize();this._display.viewportChangeSize(e.w,e.h),this._fixScrollbars()}}_updateScale(){if(this._scaleViewport){let e=this._screenSize();this._display.autoscale(e.w,e.h)}else this._display.scale=1;this._fixScrollbars()}_requestRemoteResize(){if(clearTimeout(this._resizeTimeout),this._resizeTimeout=null,!this._resizeSession||this._viewOnly||!this._supportsSetDesktopSize)return;let e=this._screenSize();tk.messages.setDesktopSize(this._sock,Math.floor(e.w),Math.floor(e.h),this._screenID,this._screenFlags),_("Requested new desktop size: "+e.w+"x"+e.h)}_screenSize(){let e=this._screen.getBoundingClientRect();return{w:e.width,h:e.height}}_fixScrollbars(){let e=this._screen.style.overflow;this._screen.style.overflow="hidden",this._screen.getBoundingClientRect(),this._screen.style.overflow=e}_updateConnectionState(e){let t=this._rfbConnectionState;if(e===t){_("Already in state '"+e+"', ignoring");return}if("disconnected"===t){u("Tried changing state of a disconnected RFB object");return}switch(e){case"connected":if("connecting"!==t){u("Bad transition to connected state, previous connection state: "+t);return}break;case"disconnected":if("disconnecting"!==t){u("Bad transition to disconnected state, previous connection state: "+t);return}break;case"connecting":if(""!==t){u("Bad transition to connecting state, previous connection state: "+t);return}break;case"disconnecting":if("connected"!==t&&"connecting"!==t){u("Bad transition to disconnecting state, previous connection state: "+t);return}break;default:u("Unknown connection state: "+e);return}switch(this._rfbConnectionState=e,_("New state '"+e+"', was '"+t+"'."),this._disconnTimer&&"disconnecting"!==e&&(_("Clearing disconnect timer"),clearTimeout(this._disconnTimer),this._disconnTimer=null,this._sock.off("close")),e){case"connecting":this._connect();break;case"connected":this.dispatchEvent(new CustomEvent("connect",{detail:{}}));break;case"disconnecting":this._disconnect(),this._disconnTimer=setTimeout(()=>{u("Disconnection timed out."),this._updateConnectionState("disconnected")},3e3);break;case"disconnected":this.dispatchEvent(new CustomEvent("disconnect",{detail:{clean:this._rfbCleanDisconnect}}))}}_fail(e){switch(this._rfbConnectionState){case"disconnecting":u("Failed when disconnecting: "+e);break;case"connected":u("Failed while connected: "+e);break;case"connecting":u("Failed when connecting: "+e);break;default:u("RFB failure: "+e)}return this._rfbCleanDisconnect=!1,this._updateConnectionState("disconnecting"),this._updateConnectionState("disconnected"),!1}_setCapability(e,t){this._capabilities[e]=t,this.dispatchEvent(new CustomEvent("capabilities",{detail:{capabilities:this._capabilities}}))}_handleMessage(){if(0===this._sock.rQlen){c("handleMessage called on an empty receive queue");return}switch(this._rfbConnectionState){case"disconnected":u("Got data while disconnected");break;case"connected":for(;!this._flushing&&this._normalMsg()&&0!==this._sock.rQlen;);break;default:this._initMsg()}}_handleKeyEvent(e,t,s){this.sendKey(e,t,s)}_handleMouse(e){if("click"===e.type&&e.target!==this._canvas||(e.stopPropagation(),e.preventDefault(),"click"===e.type||"contextmenu"===e.type))return;let t=X(e.clientX,e.clientY,this._canvas);switch(e.type){case"mousedown":!function(e){if(e.setCapture)e.setCapture(),document.captureElement=e;else{M();let t=document.getElementById("noVNC_mouse_capture_elem");null===t&&((t=document.createElement("div")).id="noVNC_mouse_capture_elem",t.style.position="fixed",t.style.top="0px",t.style.left="0px",t.style.width="100%",t.style.height="100%",t.style.zIndex=1e4,t.style.display="none",document.body.appendChild(t),t.addEventListener("contextmenu",S),t.addEventListener("mousemove",S),t.addEventListener("mouseup",S)),document.captureElement=e,E.observe(e,{attributes:!0}),x(),t.style.display="",window.addEventListener("mousemove",S),window.addEventListener("mouseup",S)}}(this._canvas),this._handleMouseButton(t.x,t.y,!0,1<<e.button);break;case"mouseup":this._handleMouseButton(t.x,t.y,!1,1<<e.button);break;case"mousemove":this._handleMouseMove(t.x,t.y)}}_handleMouseButton(e,t,s,i){if(this.dragViewport){if(s&&!this._viewportDragging){this._viewportDragging=!0,this._viewportDragPos={x:e,y:t},this._viewportHasMoved=!1;return}if(this._viewportDragging=!1,this._viewportHasMoved)return;this._sendMouse(e,t,i)}null!==this._mouseMoveTimer&&(clearTimeout(this._mouseMoveTimer),this._mouseMoveTimer=null,this._sendMouse(e,t,this._mouseButtonMask)),s?this._mouseButtonMask|=i:this._mouseButtonMask&=~i,this._sendMouse(e,t,this._mouseButtonMask)}_handleMouseMove(e,t){if(this._viewportDragging){let s=this._viewportDragPos.x-e,i=this._viewportDragPos.y-t;(this._viewportHasMoved||Math.abs(s)>m||Math.abs(i)>m)&&(this._viewportHasMoved=!0,this._viewportDragPos={x:e,y:t},this._display.viewportChangePos(s,i));return}if(this._mousePos={x:e,y:t},null==this._mouseMoveTimer){let s=Date.now()-this._mouseLastMoveTime;s>17?(this._sendMouse(e,t,this._mouseButtonMask),this._mouseLastMoveTime=Date.now()):this._mouseMoveTimer=setTimeout(()=>{this._handleDelayedMouseMove()},17-s)}}_handleDelayedMouseMove(){this._mouseMoveTimer=null,this._sendMouse(this._mousePos.x,this._mousePos.y,this._mouseButtonMask),this._mouseLastMoveTime=Date.now()}_sendMouse(e,t,s){"connected"!==this._rfbConnectionState||this._viewOnly||tk.messages.pointerEvent(this._sock,this._display.absX(e),this._display.absY(t),s)}_handleWheel(e){if("connected"!==this._rfbConnectionState||this._viewOnly)return;e.stopPropagation(),e.preventDefault();let t=X(e.clientX,e.clientY,this._canvas),s=e.deltaX,i=e.deltaY;0!==e.deltaMode&&(s*=19,i*=19),this._accumulatedWheelDeltaX+=s,this._accumulatedWheelDeltaY+=i,Math.abs(this._accumulatedWheelDeltaX)>=50&&(this._accumulatedWheelDeltaX<0?(this._handleMouseButton(t.x,t.y,!0,32),this._handleMouseButton(t.x,t.y,!1,32)):this._accumulatedWheelDeltaX>0&&(this._handleMouseButton(t.x,t.y,!0,64),this._handleMouseButton(t.x,t.y,!1,64)),this._accumulatedWheelDeltaX=0),Math.abs(this._accumulatedWheelDeltaY)>=50&&(this._accumulatedWheelDeltaY<0?(this._handleMouseButton(t.x,t.y,!0,8),this._handleMouseButton(t.x,t.y,!1,8)):this._accumulatedWheelDeltaY>0&&(this._handleMouseButton(t.x,t.y,!0,16),this._handleMouseButton(t.x,t.y,!1,16)),this._accumulatedWheelDeltaY=0)}_fakeMouseMove(e,t,s){this._handleMouseMove(t,s),this._cursor.move(e.detail.clientX,e.detail.clientY)}_handleTapEvent(e,t){let s=X(e.detail.clientX,e.detail.clientY,this._canvas);null!==this._gestureLastTapTime&&Date.now()-this._gestureLastTapTime<1e3&&this._gestureFirstDoubleTapEv.detail.type===e.detail.type&&50>Math.hypot(this._gestureFirstDoubleTapEv.detail.clientX-e.detail.clientX,this._gestureFirstDoubleTapEv.detail.clientY-e.detail.clientY)?s=X(this._gestureFirstDoubleTapEv.detail.clientX,this._gestureFirstDoubleTapEv.detail.clientY,this._canvas):this._gestureFirstDoubleTapEv=e,this._gestureLastTapTime=Date.now(),this._fakeMouseMove(this._gestureFirstDoubleTapEv,s.x,s.y),this._handleMouseButton(s.x,s.y,!0,t),this._handleMouseButton(s.x,s.y,!1,t)}_handleGesture(e){let t;let s=X(e.detail.clientX,e.detail.clientY,this._canvas);switch(e.type){case"gesturestart":switch(e.detail.type){case"onetap":this._handleTapEvent(e,1);break;case"twotap":this._handleTapEvent(e,4);break;case"threetap":this._handleTapEvent(e,2);break;case"drag":this._fakeMouseMove(e,s.x,s.y),this._handleMouseButton(s.x,s.y,!0,1);break;case"longpress":this._fakeMouseMove(e,s.x,s.y),this._handleMouseButton(s.x,s.y,!0,4);break;case"twodrag":this._gestureLastMagnitudeX=e.detail.magnitudeX,this._gestureLastMagnitudeY=e.detail.magnitudeY,this._fakeMouseMove(e,s.x,s.y);break;case"pinch":this._gestureLastMagnitudeX=Math.hypot(e.detail.magnitudeX,e.detail.magnitudeY),this._fakeMouseMove(e,s.x,s.y)}break;case"gesturemove":switch(e.detail.type){case"onetap":case"twotap":case"threetap":break;case"drag":case"longpress":this._fakeMouseMove(e,s.x,s.y);break;case"twodrag":for(this._fakeMouseMove(e,s.x,s.y);e.detail.magnitudeY-this._gestureLastMagnitudeY>50;)this._handleMouseButton(s.x,s.y,!0,8),this._handleMouseButton(s.x,s.y,!1,8),this._gestureLastMagnitudeY+=50;for(;e.detail.magnitudeY-this._gestureLastMagnitudeY<-50;)this._handleMouseButton(s.x,s.y,!0,16),this._handleMouseButton(s.x,s.y,!1,16),this._gestureLastMagnitudeY-=50;for(;e.detail.magnitudeX-this._gestureLastMagnitudeX>50;)this._handleMouseButton(s.x,s.y,!0,32),this._handleMouseButton(s.x,s.y,!1,32),this._gestureLastMagnitudeX+=50;for(;e.detail.magnitudeX-this._gestureLastMagnitudeX<-50;)this._handleMouseButton(s.x,s.y,!0,64),this._handleMouseButton(s.x,s.y,!1,64),this._gestureLastMagnitudeX-=50;break;case"pinch":if(this._fakeMouseMove(e,s.x,s.y),Math.abs((t=Math.hypot(e.detail.magnitudeX,e.detail.magnitudeY))-this._gestureLastMagnitudeX)>75){for(this._handleKeyEvent(eq.XK_Control_L,"ControlLeft",!0);t-this._gestureLastMagnitudeX>75;)this._handleMouseButton(s.x,s.y,!0,8),this._handleMouseButton(s.x,s.y,!1,8),this._gestureLastMagnitudeX+=75;for(;t-this._gestureLastMagnitudeX<-75;)this._handleMouseButton(s.x,s.y,!0,16),this._handleMouseButton(s.x,s.y,!1,16),this._gestureLastMagnitudeX-=75}this._handleKeyEvent(eq.XK_Control_L,"ControlLeft",!1)}break;case"gestureend":switch(e.detail.type){case"onetap":case"twotap":case"threetap":case"pinch":case"twodrag":break;case"drag":this._fakeMouseMove(e,s.x,s.y),this._handleMouseButton(s.x,s.y,!1,1);break;case"longpress":this._fakeMouseMove(e,s.x,s.y),this._handleMouseButton(s.x,s.y,!1,4)}}}_negotiateProtocolVersion(){if(this._sock.rQwait("version",12))return!1;let e=this._sock.rQshiftStr(12).substr(4,7);d("Server ProtocolVersion: "+e);let t=0;switch(e){case"000.000":t=1;break;case"003.003":case"003.006":case"003.889":this._rfbVersion=3.3;break;case"003.007":this._rfbVersion=3.7;break;case"003.008":case"004.000":case"004.001":case"005.000":this._rfbVersion=3.8;break;default:return this._fail("Invalid server version "+e)}if(t){let e="ID:"+this._repeaterID;for(;e.length<250;)e+="\0";return this._sock.sendString(e),!0}this._rfbVersion>this._rfbMaxVersion&&(this._rfbVersion=this._rfbMaxVersion);let s="00"+parseInt(this._rfbVersion,10)+".00"+10*this._rfbVersion%10;this._sock.sendString("RFB "+s+"\n"),_("Sent ProtocolVersion: "+s),this._rfbInitState="Security"}_negotiateSecurity(){if(this._rfbVersion>=3.7){let e=this._sock.rQshift8();if(this._sock.rQwait("security type",e,1))return!1;if(0===e)return this._rfbInitState="SecurityReason",this._securityContext="no security types",this._securityStatus=1,this._initMsg();let t=this._sock.rQshiftBytes(e);if(_("Server security types: "+t),t.includes(1))this._rfbAuthScheme=1;else if(t.includes(22))this._rfbAuthScheme=22;else if(t.includes(16))this._rfbAuthScheme=16;else if(t.includes(2))this._rfbAuthScheme=2;else{if(!t.includes(19))return this._fail("Unsupported security types (types: "+t+")");this._rfbAuthScheme=19}this._sock.send([this._rfbAuthScheme])}else{if(this._sock.rQwait("security scheme",4))return!1;if(this._rfbAuthScheme=this._sock.rQshift32(),0==this._rfbAuthScheme)return this._rfbInitState="SecurityReason",this._securityContext="authentication scheme",this._securityStatus=1,this._initMsg()}return this._rfbInitState="Authentication",_("Authenticating using scheme: "+this._rfbAuthScheme),this._initMsg()}_handleSecurityReason(){if(this._sock.rQwait("reason length",4))return!1;let e=this._sock.rQshift32(),t="";if(e>0){if(this._sock.rQwait("reason",e,4))return!1;t=this._sock.rQshiftStr(e)}return""!==t?(this.dispatchEvent(new CustomEvent("securityfailure",{detail:{status:this._securityStatus,reason:t}})),this._fail("Security negotiation failed on "+this._securityContext+" (reason: "+t+")")):(this.dispatchEvent(new CustomEvent("securityfailure",{detail:{status:this._securityStatus}})),this._fail("Security negotiation failed on "+this._securityContext))}_negotiateXvpAuth(){if(void 0===this._rfbCredentials.username||void 0===this._rfbCredentials.password||void 0===this._rfbCredentials.target)return this.dispatchEvent(new CustomEvent("credentialsrequired",{detail:{types:["username","password","target"]}})),!1;let e=String.fromCharCode(this._rfbCredentials.username.length)+String.fromCharCode(this._rfbCredentials.target.length)+this._rfbCredentials.username+this._rfbCredentials.target;return this._sock.sendString(e),this._rfbAuthScheme=2,this._negotiateAuthentication()}_negotiateVeNCryptAuth(){if(0==this._rfbVeNCryptState){if(this._sock.rQwait("vencrypt version",2))return!1;let e=this._sock.rQshift8(),t=this._sock.rQshift8();if(!(0==e&&2==t))return this._fail("Unsupported VeNCrypt version "+e+"."+t);this._sock.send([0,2]),this._rfbVeNCryptState=1}if(1==this._rfbVeNCryptState){if(this._sock.rQwait("vencrypt ack",1))return!1;let e=this._sock.rQshift8();if(0!=e)return this._fail("VeNCrypt failure "+e);this._rfbVeNCryptState=2}if(2==this._rfbVeNCryptState){if(this._sock.rQwait("vencrypt subtypes length",1))return!1;let e=this._sock.rQshift8();if(e<1)return this._fail("VeNCrypt subtypes empty");this._rfbVeNCryptSubtypesLength=e,this._rfbVeNCryptState=3}if(3==this._rfbVeNCryptState){if(this._sock.rQwait("vencrypt subtypes",4*this._rfbVeNCryptSubtypesLength))return!1;let e=[];for(let t=0;t<this._rfbVeNCryptSubtypesLength;t++)e.push(this._sock.rQshift32());if(-1==e.indexOf(256))return this._fail("VeNCrypt Plain subtype not offered by server");this._sock.send([0,0,1,0]),this._rfbVeNCryptState=4}if(4==this._rfbVeNCryptState){if(void 0===this._rfbCredentials.username||void 0===this._rfbCredentials.password)return this.dispatchEvent(new CustomEvent("credentialsrequired",{detail:{types:["username","password"]}})),!1;let e=p(this._rfbCredentials.username),t=p(this._rfbCredentials.password);return this._sock.send([e.length>>24&255,e.length>>16&255,e.length>>8&255,255&e.length]),this._sock.send([t.length>>24&255,t.length>>16&255,t.length>>8&255,255&t.length]),this._sock.sendString(e),this._sock.sendString(t),this._rfbInitState="SecurityResult",!0}}_negotiateStdVNCAuth(){if(this._sock.rQwait("auth challenge",16))return!1;if(void 0===this._rfbCredentials.password)return this.dispatchEvent(new CustomEvent("credentialsrequired",{detail:{types:["password"]}})),!1;let e=Array.prototype.slice.call(this._sock.rQshiftBytes(16)),t=tk.genDES(this._rfbCredentials.password,e);return this._sock.send(t),this._rfbInitState="SecurityResult",!0}_negotiateTightUnixAuth(){return void 0===this._rfbCredentials.username||void 0===this._rfbCredentials.password?(this.dispatchEvent(new CustomEvent("credentialsrequired",{detail:{types:["username","password"]}})),!1):(this._sock.send([0,0,0,this._rfbCredentials.username.length]),this._sock.send([0,0,0,this._rfbCredentials.password.length]),this._sock.sendString(this._rfbCredentials.username),this._sock.sendString(this._rfbCredentials.password),this._rfbInitState="SecurityResult",!0)}_negotiateTightTunnels(e){let t={0:{vendor:"TGHT",signature:"NOTUNNEL"}},s={};for(let t=0;t<e;t++){let e=this._sock.rQshift32(),t=this._sock.rQshiftStr(4),i=this._sock.rQshiftStr(8);s[e]={vendor:t,signature:i}}return(_("Server Tight tunnel types: "+s),s[1]&&"SICR"===s[1].vendor&&"SCHANNEL"===s[1].signature&&(_("Detected Siemens server. Assuming NOTUNNEL support."),s[0]={vendor:"TGHT",signature:"NOTUNNEL"}),s[0])?s[0].vendor!=t[0].vendor||s[0].signature!=t[0].signature?this._fail("Client's tunnel type had the incorrect vendor or signature"):(_("Selected tunnel type: "+t[0]),this._sock.send([0,0,0,0]),!1):this._fail("Server wanted tunnels, but doesn't support the notunnel type")}_negotiateTightAuth(){if(!this._rfbTightVNC){if(this._sock.rQwait("num tunnels",4))return!1;let e=this._sock.rQshift32();if(e>0&&this._sock.rQwait("tunnel capabilities",16*e,4))return!1;if(this._rfbTightVNC=!0,e>0)return this._negotiateTightTunnels(e),!1}if(this._sock.rQwait("sub auth count",4))return!1;let e=this._sock.rQshift32();if(0===e)return this._rfbInitState="SecurityResult",!0;if(this._sock.rQwait("sub auth capabilities",16*e,4))return!1;let t={STDVNOAUTH__:1,STDVVNCAUTH_:2,TGHTULGNAUTH:129},s=[];for(let t=0;t<e;t++){this._sock.rQshift32();let e=this._sock.rQshiftStr(12);s.push(e)}for(let e in _("Server Tight authentication types: "+s),t)if(-1!=s.indexOf(e))switch(this._sock.send([0,0,0,t[e]]),_("Selected authentication type: "+e),e){case"STDVNOAUTH__":return this._rfbInitState="SecurityResult",!0;case"STDVVNCAUTH_":return this._rfbAuthScheme=2,this._initMsg();case"TGHTULGNAUTH":return this._rfbAuthScheme=129,this._initMsg();default:return this._fail("Unsupported tiny auth scheme (scheme: "+e+")")}return this._fail("No supported sub-auth types!")}_negotiateAuthentication(){switch(this._rfbAuthScheme){case 1:if(this._rfbVersion>=3.8)return this._rfbInitState="SecurityResult",!0;return this._rfbInitState="ClientInitialisation",this._initMsg();case 22:return this._negotiateXvpAuth();case 2:return this._negotiateStdVNCAuth();case 16:return this._negotiateTightAuth();case 19:return this._negotiateVeNCryptAuth();case 129:return this._negotiateTightUnixAuth();default:return this._fail("Unsupported auth scheme (scheme: "+this._rfbAuthScheme+")")}}_handleSecurityResult(){if(this._sock.rQwait("VNC auth response ",4))return!1;let e=this._sock.rQshift32();return 0===e?(this._rfbInitState="ClientInitialisation",_("Authentication OK"),this._initMsg()):this._rfbVersion>=3.8?(this._rfbInitState="SecurityReason",this._securityContext="security result",this._securityStatus=e,this._initMsg()):(this.dispatchEvent(new CustomEvent("securityfailure",{detail:{status:e}})),this._fail("Security handshake failed"))}_negotiateServerInit(){if(this._sock.rQwait("server initialization",24))return!1;let e=this._sock.rQshift16(),t=this._sock.rQshift16(),s=this._sock.rQshift8(),i=this._sock.rQshift8(),r=this._sock.rQshift8(),n=this._sock.rQshift8(),a=this._sock.rQshift16(),o=this._sock.rQshift16(),h=this._sock.rQshift16(),l=this._sock.rQshift8(),_=this._sock.rQshift8(),u=this._sock.rQshift8();this._sock.rQskipBytes(3);let p=this._sock.rQshift32();if(this._sock.rQwait("server init name",p,24))return!1;let g=this._sock.rQshiftStr(p);if(g=f(g,!0),this._rfbTightVNC){if(this._sock.rQwait("TightVNC extended server init header",8,24+p))return!1;let e=this._sock.rQshift16(),t=this._sock.rQshift16(),s=this._sock.rQshift16();if(this._sock.rQskipBytes(2),this._sock.rQwait("TightVNC extended server init header",(e+t+s)*16,32+p))return!1;this._sock.rQskipBytes(16*e),this._sock.rQskipBytes(16*t),this._sock.rQskipBytes(16*s)}return d("Screen: "+e+"x"+t+", bpp: "+s+", depth: "+i+", bigEndian: "+r+", trueColor: "+n+", redMax: "+a+", greenMax: "+o+", blueMax: "+h+", redShift: "+l+", greenShift: "+_+", blueShift: "+u),this._setDesktopName(g),this._resize(e,t),this._viewOnly||this._keyboard.grab(),this._fbDepth=24,"Intel(r) AMT KVM"===this._fbName&&(c("Intel AMT KVM only supports 8/16 bit depths. Using low color mode."),this._fbDepth=8),tk.messages.pixelFormat(this._sock,this._fbDepth,!0),this._sendEncodings(),tk.messages.fbUpdateRequest(this._sock,!1,0,0,this._fbWidth,this._fbHeight),this._updateConnectionState("connected"),!0}_sendEncodings(){let e=[];e.push(tf.encodingCopyRect),24==this._fbDepth&&(e.push(tf.encodingTight),e.push(tf.encodingTightPNG),e.push(tf.encodingHextile),e.push(tf.encodingRRE)),e.push(tf.encodingRaw),e.push(tf.pseudoEncodingQualityLevel0+this._qualityLevel),e.push(tf.pseudoEncodingCompressLevel0+this._compressionLevel),e.push(tf.pseudoEncodingDesktopSize),e.push(tf.pseudoEncodingLastRect),e.push(tf.pseudoEncodingQEMUExtendedKeyEvent),e.push(tf.pseudoEncodingExtendedDesktopSize),e.push(tf.pseudoEncodingXvp),e.push(tf.pseudoEncodingFence),e.push(tf.pseudoEncodingContinuousUpdates),e.push(tf.pseudoEncodingDesktopName),e.push(tf.pseudoEncodingExtendedClipboard),24==this._fbDepth&&(e.push(tf.pseudoEncodingVMwareCursor),e.push(tf.pseudoEncodingCursor)),tk.messages.clientEncodings(this._sock,e)}_initMsg(){switch(this._rfbInitState){case"ProtocolVersion":return this._negotiateProtocolVersion();case"Security":return this._negotiateSecurity();case"Authentication":return this._negotiateAuthentication();case"SecurityResult":return this._handleSecurityResult();case"SecurityReason":return this._handleSecurityReason();case"ClientInitialisation":return this._sock.send([this._shared?1:0]),this._rfbInitState="ServerInitialisation",!0;case"ServerInitialisation":return this._negotiateServerInit();default:return this._fail("Unknown init state (state: "+this._rfbInitState+")")}}_handleSetColourMapMsg(){return _("SetColorMapEntries"),this._fail("Unexpected SetColorMapEntries message")}_handleServerCutText(){if(_("ServerCutText"),this._sock.rQwait("ServerCutText header",7,1))return!1;this._sock.rQskipBytes(3);let e=this._sock.rQshift32();if(e|=0,this._sock.rQwait("ServerCutText content",Math.abs(e),8))return!1;if(e>=0){let t=this._sock.rQshiftStr(e);if(this._viewOnly)return!0;this.dispatchEvent(new CustomEvent("clipboard",{detail:{text:t}}))}else{e=Math.abs(e);let t=this._sock.rQshift32(),s=65535&t,i=4278190080&t;if(16777216&i){this._clipboardServerCapabilitiesFormats={},this._clipboardServerCapabilitiesActions={};for(let e=0;e<=15;e++){let t=1<<e;s&t&&(this._clipboardServerCapabilitiesFormats[t]=!0,this._sock.rQshift32())}for(let e=24;e<=31;e++){let t=1<<e;this._clipboardServerCapabilitiesActions[t]=!!(i&t)}tk.messages.extendedClipboardCaps(this._sock,[16777216,33554432,67108864,134217728,268435456],{extendedClipboardFormatText:0})}else if(33554432===i){if(this._viewOnly)return!0;null!=this._clipboardText&&this._clipboardServerCapabilitiesActions[268435456]&&1&s&&tk.messages.extendedClipboardProvide(this._sock,[1],[this._clipboardText])}else if(67108864===i){if(this._viewOnly)return!0;this._clipboardServerCapabilitiesActions[134217728]&&(null!=this._clipboardText?tk.messages.extendedClipboardNotify(this._sock,[1]):tk.messages.extendedClipboardNotify(this._sock,[]))}else if(134217728===i){if(this._viewOnly)return!0;this._clipboardServerCapabilitiesActions[33554432]&&1&s&&tk.messages.extendedClipboardRequest(this._sock,[1])}else{if(268435456!==i)return this._fail("Unexpected action in extended clipboard message: "+i);if(this._viewOnly||!(1&s))return!0;this._clipboardText=null;let t=this._sock.rQshiftBytes(e-4),r=new es,n=null;r.setInput(t);for(let e=0;e<=15;e++){let t=1<<e;if(s&t){let e=0,s=r.inflate(4);e|=s[0]<<24,e|=s[1]<<16,e|=s[2]<<8,e|=s[3];let i=r.inflate(e);1===t&&(n=i)}}if(r.setInput(null),null!==n){let e="";for(let t=0;t<n.length;t++)e+=String.fromCharCode(n[t]);(n=f(n=e)).length>0&&"\0"===n.charAt(n.length-1)&&(n=n.slice(0,-1)),n=n.replace("\r\n","\n"),this.dispatchEvent(new CustomEvent("clipboard",{detail:{text:n}}))}}}return!0}_handleServerFenceMsg(){if(this._sock.rQwait("ServerFence header",8,1))return!1;this._sock.rQskipBytes(3);let e=this._sock.rQshift32(),t=this._sock.rQshift8();if(this._sock.rQwait("ServerFence payload",t,9))return!1;t>64&&(c("Bad payload length ("+t+") in fence response"),t=64);let s=this._sock.rQshiftStr(t);return(this._supportsFence=!0,-2147483648&e)?(e&=3,tk.messages.clientFence(this._sock,e,s),!0):this._fail("Unexpected fence response")}_handleXvpMsg(){if(this._sock.rQwait("XVP version and message",3,1))return!1;this._sock.rQskipBytes(1);let e=this._sock.rQshift8(),t=this._sock.rQshift8();switch(t){case 0:u("XVP Operation Failed");break;case 1:this._rfbXvpVer=e,d("XVP extensions enabled (version "+this._rfbXvpVer+")"),this._setCapability("power",!0);break;default:this._fail("Illegal server XVP message (msg: "+t+")")}return!0}_normalMsg(){let e,t,s;switch(e=this._FBU.rects>0?0:this._sock.rQshift8()){case 0:return(s=this._framebufferUpdate())&&!this._enabledContinuousUpdates&&tk.messages.fbUpdateRequest(this._sock,!0,0,0,this._fbWidth,this._fbHeight),s;case 1:return this._handleSetColourMapMsg();case 2:return _("Bell"),this.dispatchEvent(new CustomEvent("bell",{detail:{}})),!0;case 3:return this._handleServerCutText();case 150:return t=!this._supportsContinuousUpdates,this._supportsContinuousUpdates=!0,this._enabledContinuousUpdates=!1,t&&(this._enabledContinuousUpdates=!0,this._updateContinuousUpdates(),d("Enabling continuous updates.")),!0;case 248:return this._handleServerFenceMsg();case 250:return this._handleXvpMsg();default:return this._fail("Unexpected server message (type "+e+")"),_("sock.rQslice(0, 30): "+this._sock.rQslice(0,30)),!0}}_onFlush(){this._flushing=!1,this._sock.rQlen>0&&this._handleMessage()}_framebufferUpdate(){if(0===this._FBU.rects){if(this._sock.rQwait("FBU header",3,1))return!1;if(this._sock.rQskipBytes(1),this._FBU.rects=this._sock.rQshift16(),this._display.pending())return this._flushing=!0,this._display.flush(),!1}for(;this._FBU.rects>0;){if(null===this._FBU.encoding){if(this._sock.rQwait("rect header",12))return!1;let e=this._sock.rQshiftBytes(12);this._FBU.x=(e[0]<<8)+e[1],this._FBU.y=(e[2]<<8)+e[3],this._FBU.width=(e[4]<<8)+e[5],this._FBU.height=(e[6]<<8)+e[7],this._FBU.encoding=parseInt((e[8]<<24)+(e[9]<<16)+(e[10]<<8)+e[11],10)}if(!this._handleRect())return!1;this._FBU.rects--,this._FBU.encoding=null}return this._display.flip(),!0}_handleRect(){switch(this._FBU.encoding){case tf.pseudoEncodingLastRect:return this._FBU.rects=1,!0;case tf.pseudoEncodingVMwareCursor:return this._handleVMwareCursor();case tf.pseudoEncodingCursor:return this._handleCursor();case tf.pseudoEncodingQEMUExtendedKeyEvent:return this._qemuExtKeyEventSupported=!0,!0;case tf.pseudoEncodingDesktopName:return this._handleDesktopName();case tf.pseudoEncodingDesktopSize:return this._resize(this._FBU.width,this._FBU.height),!0;case tf.pseudoEncodingExtendedDesktopSize:return this._handleExtendedDesktopSize();default:return this._handleDataRect()}}_handleVMwareCursor(){let e;let t=this._FBU.x,s=this._FBU.y,i=this._FBU.width,r=this._FBU.height;if(this._sock.rQwait("VMware cursor encoding",1))return!1;let n=this._sock.rQshift8();if(this._sock.rQshift8(),0==n){if(e=Array(i*r*4),this._sock.rQwait("VMware cursor classic encoding",i*r*8,2))return!1;let t=Array(i*r);for(let e=0;e<i*r;e++)t[e]=this._sock.rQshift32();let s=Array(i*r);for(let e=0;e<i*r;e++)s[e]=this._sock.rQshift32();for(let n=0;n<i*r;n++)if(0==t[n]){let t=s[n],i=t>>8&255,r=t>>16&255,a=t>>24&255;e[4*n]=i,e[4*n+1]=r,e[4*n+2]=a,e[4*n+3]=255}else(-256&t[n])==-256?0==s[n]?(e[4*n]=0,e[4*n+1]=0,e[4*n+2]=0,e[4*n+3]=0):(s[n],e[4*n]=0,e[4*n+1]=0,e[4*n+2]=0,e[4*n+3]=255):(e[4*n]=0,e[4*n+1]=0,e[4*n+2]=0,e[4*n+3]=255)}else{if(1!=n)return c("The given cursor type is not supported: "+n+" given."),!1;if(this._sock.rQwait("VMware cursor alpha encoding",i*r*4,2))return!1;e=Array(i*r*4);for(let t=0;t<i*r;t++){let s=this._sock.rQshift32();e[4*t]=s>>24&255,e[4*t+1]=s>>16&255,e[4*t+2]=s>>8&255,e[4*t+3]=255&s}}return this._updateCursor(e,t,s,i,r),!0}_handleCursor(){let e=this._FBU.x,t=this._FBU.y,s=this._FBU.width,i=this._FBU.height,r=s*i*4,n=Math.ceil(s/8)*i;if(this._sock.rQwait("cursor encoding",r+n))return!1;let a=this._sock.rQshiftBytes(r),o=this._sock.rQshiftBytes(n),h=new Uint8Array(s*i*4),l=0;for(let e=0;e<i;e++)for(let t=0;t<s;t++){let i=o[e*Math.ceil(s/8)+Math.floor(t/8)]<<t%8&128?255:0;h[l]=a[l+2],h[l+1]=a[l+1],h[l+2]=a[l],h[l+3]=i,l+=4}return this._updateCursor(h,e,t,s,i),!0}_handleDesktopName(){if(this._sock.rQwait("DesktopName",4))return!1;let e=this._sock.rQshift32();if(this._sock.rQwait("DesktopName",e,4))return!1;let t=this._sock.rQshiftStr(e);return t=f(t,!0),this._setDesktopName(t),!0}_handleExtendedDesktopSize(){if(this._sock.rQwait("ExtendedDesktopSize",4))return!1;let e=this._sock.rQpeek8();if(this._sock.rQwait("ExtendedDesktopSize",4+16*e))return!1;let t=!this._supportsSetDesktopSize;this._supportsSetDesktopSize=!0,t&&this._requestRemoteResize(),this._sock.rQskipBytes(1),this._sock.rQskipBytes(3);for(let t=0;t<e;t+=1)0===t?(this._screenID=this._sock.rQshiftBytes(4),this._sock.rQskipBytes(2),this._sock.rQskipBytes(2),this._sock.rQskipBytes(2),this._sock.rQskipBytes(2),this._screenFlags=this._sock.rQshiftBytes(4)):this._sock.rQskipBytes(16);if(1===this._FBU.x&&0!==this._FBU.y){let e="";switch(this._FBU.y){case 1:e="Resize is administratively prohibited";break;case 2:e="Out of resources";break;case 3:e="Invalid screen layout";break;default:e="Unknown reason"}c("Server did not accept the resize request: "+e)}else this._resize(this._FBU.width,this._FBU.height);return!0}_handleDataRect(){let e=this._decoders[this._FBU.encoding];if(!e)return this._fail("Unsupported encoding (encoding: "+this._FBU.encoding+")"),!1;try{return e.decodeRect(this._FBU.x,this._FBU.y,this._FBU.width,this._FBU.height,this._sock,this._display,this._fbDepth)}catch(e){return this._fail("Error decoding rect: "+e),!1}}_updateContinuousUpdates(){this._enabledContinuousUpdates&&tk.messages.enableContinuousUpdates(this._sock,!0,0,0,this._fbWidth,this._fbHeight)}_resize(e,t){this._fbWidth=e,this._fbHeight=t,this._display.resize(this._fbWidth,this._fbHeight),this._updateClip(),this._updateScale(),this._updateContinuousUpdates()}_xvpOp(e,t){this._rfbXvpVer<e||(d("Sending XVP operation "+t+" (version "+e+")"),tk.messages.xvpOp(this._sock,e,t))}_updateCursor(e,t,s,i,r){this._cursorImage={rgbaPixels:e,hotx:t,hoty:s,w:i,h:r},this._refreshCursor()}_shouldShowDotCursor(){if(!this._showDotCursor)return!1;for(let e=3;e<this._cursorImage.rgbaPixels.length;e+=4)if(this._cursorImage.rgbaPixels[e])return!1;return!0}_refreshCursor(){if("connecting"!==this._rfbConnectionState&&"connected"!==this._rfbConnectionState)return;let e=this._shouldShowDotCursor()?tk.cursors.dot:this._cursorImage;this._cursor.change(e.rgbaPixels,e.hotx,e.hoty,e.w,e.h)}static genDES(e,t){return new tc(e.split("").map(e=>e.charCodeAt(0))).encrypt(t)}}tk.messages={keyEvent(e,t,s){let i=e._sQ,r=e._sQlen;i[r]=4,i[r+1]=s,i[r+2]=0,i[r+3]=0,i[r+4]=t>>24,i[r+5]=t>>16,i[r+6]=t>>8,i[r+7]=t,e._sQlen+=8,e.flush()},QEMUExtendedKeyEvent(e,t,s,i){let r=e._sQ,n=e._sQlen;r[n]=255,r[n+1]=0,r[n+2]=s>>8,r[n+3]=s,r[n+4]=t>>24,r[n+5]=t>>16,r[n+6]=t>>8,r[n+7]=t;let a=function(e){let t=i>>8,s=255&i;return 224===t&&s<127?128|s:e}(i);r[n+8]=a>>24,r[n+9]=a>>16,r[n+10]=a>>8,r[n+11]=a,e._sQlen+=12,e.flush()},pointerEvent(e,t,s,i){let r=e._sQ,n=e._sQlen;r[n]=5,r[n+1]=i,r[n+2]=t>>8,r[n+3]=t,r[n+4]=s>>8,r[n+5]=s,e._sQlen+=6,e.flush()},_buildExtendedClipboardFlags(e,t){let s=new Uint8Array(4),i=0,r=0;for(let t=0;t<e.length;t++)r|=e[t];for(let e=0;e<t.length;e++)i|=t[e];return s[0]=r>>24,s[1]=0,s[2]=0,s[3]=i,s},extendedClipboardProvide(e,t,s){let i=new eY,r=[];for(let e=0;e<t.length;e++){if(1!=t[e])throw Error("Unsupported extended clipboard format for Provide message.");s[e]=s[e].replace(/\r\n|\r|\n/gm,"\r\n");let i=p(s[e]+"\0");r.push(i.length>>24&255,i.length>>16&255,i.length>>8&255,255&i.length);for(let e=0;e<i.length;e++)r.push(i.charCodeAt(e))}let n=i.deflate(new Uint8Array(r)),a=new Uint8Array(4+n.length);a.set(tk.messages._buildExtendedClipboardFlags([268435456],t)),a.set(n,4),tk.messages.clientCutText(e,a,!0)},extendedClipboardNotify(e,t){let s=tk.messages._buildExtendedClipboardFlags([134217728],t);tk.messages.clientCutText(e,s,!0)},extendedClipboardRequest(e,t){let s=tk.messages._buildExtendedClipboardFlags([33554432],t);tk.messages.clientCutText(e,s,!0)},extendedClipboardCaps(e,t,s){let i=Object.keys(s),r=new Uint8Array(4+4*i.length);i.map(e=>parseInt(e)),i.sort((e,t)=>e-t),r.set(tk.messages._buildExtendedClipboardFlags(t,[]));let n=4;for(let e=0;e<i.length;e++)r[n]=s[i[e]]>>24,r[n+1]=s[i[e]]>>16,r[n+2]=s[i[e]]>>8,r[n+3]=s[i[e]]>>0,n+=4,r[3]|=1<<i[e];tk.messages.clientCutText(e,r,!0)},clientCutText(e,t,s=!1){let i;let r=e._sQ,n=e._sQlen;r[n]=6,r[n+1]=0,r[n+2]=0,r[n+3]=0,i=s?-t.length>>>0:t.length,r[n+4]=i>>24,r[n+5]=i>>16,r[n+6]=i>>8,r[n+7]=i,e._sQlen+=8;let a=0,o=t.length;for(;o>0;){let s=Math.min(o,e._sQbufferSize-e._sQlen);for(let i=0;i<s;i++)r[e._sQlen+i]=t[a+i];e._sQlen+=s,e.flush(),o-=s,a+=s}},setDesktopSize(e,t,s,i,r){let n=e._sQ,a=e._sQlen;n[a]=251,n[a+1]=0,n[a+2]=t>>8,n[a+3]=t,n[a+4]=s>>8,n[a+5]=s,n[a+6]=1,n[a+7]=0,n[a+8]=i>>24,n[a+9]=i>>16,n[a+10]=i>>8,n[a+11]=i,n[a+12]=0,n[a+13]=0,n[a+14]=0,n[a+15]=0,n[a+16]=t>>8,n[a+17]=t,n[a+18]=s>>8,n[a+19]=s,n[a+20]=r>>24,n[a+21]=r>>16,n[a+22]=r>>8,n[a+23]=r,e._sQlen+=24,e.flush()},clientFence(e,t,s){let i=e._sQ,r=e._sQlen;i[r]=248,i[r+1]=0,i[r+2]=0,i[r+3]=0,i[r+4]=t>>24,i[r+5]=t>>16,i[r+6]=t>>8,i[r+7]=t;let n=s.length;i[r+8]=n;for(let e=0;e<n;e++)i[r+9+e]=s.charCodeAt(e);e._sQlen+=9+n,e.flush()},enableContinuousUpdates(e,t,s,i,r,n){let a=e._sQ,o=e._sQlen;a[o]=150,a[o+1]=t,a[o+2]=s>>8,a[o+3]=s,a[o+4]=i>>8,a[o+5]=i,a[o+6]=r>>8,a[o+7]=r,a[o+8]=n>>8,a[o+9]=n,e._sQlen+=10,e.flush()},pixelFormat(e,t,s){let i;let r=e._sQ,n=e._sQlen;i=t>16?32:t>8?16:8;let a=Math.floor(t/3);r[n]=0,r[n+1]=0,r[n+2]=0,r[n+3]=0,r[n+4]=i,r[n+5]=t,r[n+6]=0,r[n+7]=s?1:0,r[n+8]=0,r[n+9]=(1<<a)-1,r[n+10]=0,r[n+11]=(1<<a)-1,r[n+12]=0,r[n+13]=(1<<a)-1,r[n+14]=0*a,r[n+15]=1*a,r[n+16]=2*a,r[n+17]=0,r[n+18]=0,r[n+19]=0,e._sQlen+=20,e.flush()},clientEncodings(e,t){let s=e._sQ,i=e._sQlen;s[i]=2,s[i+1]=0,s[i+2]=t.length>>8,s[i+3]=t.length;let r=i+4;for(let e=0;e<t.length;e++){let i=t[e];s[r]=i>>24,s[r+1]=i>>16,s[r+2]=i>>8,s[r+3]=i,r+=4}e._sQlen+=r-i,e.flush()},fbUpdateRequest(e,t,s,i,r,n){let a=e._sQ,o=e._sQlen;void 0===s&&(s=0),void 0===i&&(i=0),a[o]=3,a[o+1]=t?1:0,a[o+2]=s>>8&255,a[o+3]=255&s,a[o+4]=i>>8&255,a[o+5]=255&i,a[o+6]=r>>8&255,a[o+7]=255&r,a[o+8]=n>>8&255,a[o+9]=255&n,e._sQlen+=10,e.flush()},xvpOp(e,t,s){let i=e._sQ,r=e._sQlen;i[r]=250,i[r+1]=0,i[r+2]=t,i[r+3]=s,e._sQlen+=4,e.flush()}},tk.cursors={none:{rgbaPixels:new Uint8Array,w:0,h:0,hotx:0,hoty:0},dot:{rgbaPixels:new Uint8Array([255,255,255,255,0,0,0,255,255,255,255,255,0,0,0,255,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,255,255,255,255,255]),w:3,h:3,hotx:1,hoty:1}}}}]);