diff --git a/JagEd.js b/JagEd.js index aa92a92d..e15e9200 100644 --- a/JagEd.js +++ b/JagEd.js @@ -1 +1 @@ -(()=>{"use strict";var t={7444:(t,i,e)=>{t.exports=e.p+"0c791968973e1f25c170.wasm"},8227:(t,i,e)=>{t.exports=e.p+"9f86b5397894e28b5ae2.wasm"}},i={};function e(s){var n=i[s];if(void 0!==n)return n.exports;var r=i[s]={exports:{}};return t[s](r,r.exports,e),r.exports}e.m=t,e.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),e.p="/Client2/",e.b=document.baseURI||self.location.href,(()=>{async function t(t,i={}){const e={env:Object.assign(Object.create(globalThis),i.env||{},{abort(t,i,e,s){t=h(t>>>0),i=h(i>>>0),e>>>=0,s>>>=0,(()=>{throw Error(`${t} in ${i}:${e}:${s}`)})()}})},{exports:s}=await WebAssembly.instantiate(t,e),n=s.memory||i.env.memory,r=Object.setPrototypeOf({read:(t,i,e,r)=>(i=function(t,i,e,r,h){if(null==r)return 0;const o=r.length,l=s.__pin(s.__new(o<>>0;if(h)new h(n.buffer,l,o).set(r);else for(let i=0;i>>0),r[i]);return s.__unpin(l),l}(l,6,0,i,Int8Array)||function(){throw TypeError("value must not be null")}(),function(t,i,e){if(!e)return null;const s=function(t){try{return o.getUint32(t,!0)}catch{return o=new DataView(n.buffer),o.getUint32(t,!0)}}(e-4)>>>i,r=new Array(s);for(let n=0;n>>0));return r}(a,0,s.read(t,i,e,r)>>>0))},s);function h(t){if(!t)return null;const i=t+new Uint32Array(n.buffer)[t-4>>>2]>>>1,e=new Uint16Array(n.buffer);let s=t>>>1,r="";for(;i-s>1024;)r+=String.fromCharCode(...e.subarray(s,s+=1024));return r+String.fromCharCode(...e.subarray(s,i))}let o=new DataView(n.buffer);function l(t,i){try{o.setUint8(t,i,!0)}catch{o=new DataView(n.buffer),o.setUint8(t,i,!0)}}function a(t){try{return o.getInt8(t,!0)}catch{return o=new DataView(n.buffer),o.getInt8(t,!0)}}return r}class i{static tt=null;static load=async i=>{this.tt=await t(new WebAssembly.Module(i),{env:void 0})};static read=(t,i,e,s)=>{if(!this.tt)throw new Error('bz2 not found!!');return Int8Array.from(this.tt.read(t,i,e,s))}}let s;function n(t,i){return s=t.exports,r.it=i,s}async function r(t){void 0===t&&(t=new URL(e(7444),e.b));const i={et:{}};('string'==typeof t||'function'==typeof Request&&t instanceof Request||'function'==typeof URL&&t instanceof URL)&&(t=fetch(t));const{instance:s,module:r}=await async function(t,i){if('function'==typeof Response&&t instanceof Response){if('function'==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(t,i)}catch(i){if('application/wasm'==t.headers.get('Content-Type'))throw i;console.warn('`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n',i)}const e=await t.arrayBuffer();return await WebAssembly.instantiate(e,i)}{const e=await WebAssembly.instantiate(t,i);return e instanceof WebAssembly.Instance?{instance:e,module:t}:e}}(await t,i);return n(s,r)}let h=null,o=!1;class l extends Error{constructor(t){super(t),this.name='DecompressionError'}}let a=0,c=null,f=null;function u(t,i,e){let s;if(e){const n=i;s=t.st(n);const r=new Uint8Array(t.memory.buffer,s,n);try{e(r)}catch(i){throw t.nt(s,n),i}return a=n,s}if('string'==typeof i){const e=a=function(t){let i=0,e=0,s=0;const n=t.length;for(;i{this.ft=t,this.ut=i,this.dt=e,this._t(0,0,i,e)};static It=()=>{this.left=0,this.top=0,this.right=this.ut,this.bottom=this.dt,this.wt=this.right-1,this.yt=this.right/2|0};static _t=(t,i,e,s)=>{t<0&&(t=0),i<0&&(i=0),e>this.ut&&(e=this.ut),s>this.dt&&(s=this.dt),this.top=i,this.bottom=s,this.left=t,this.right=e,this.wt=this.right-1,this.yt=this.right/2|0,this.At=this.bottom/2|0};static clear=()=>{const t=this.ut*this.dt;for(let i=0;i{this.Ct(t,i,n,e),this.Ct(t,i+s-1,n,e),this.Et(t,i,n,s),this.Et(t+e-1,i,n,s)};static Ct=(t,i,e,s)=>{if(i=this.bottom)return;tthis.right&&(s=this.right-t);const n=t+i*this.ut;for(let t=0;t{if(t=this.right)return;ithis.bottom&&(s=this.bottom-i);const n=t+i*this.ut;for(let t=0;t{const r=Math.abs(e-t),h=Math.abs(s-i),o=t=this.left&&t=this.top&&i-h&&(a-=h,t+=o),e{tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const r=this.ut-e;let h=t+i*this.ut;for(let t=-s;t<0;t++){for(let t=-e;t<0;t++)this.ft[h++]=n;h+=r}};static bt(t,i,e,s,n,r){tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const h=256-r,o=(n>>16&255)*r,l=(n>>8&255)*r,a=(255&n)*r,c=this.ut-e;let f=t+i*this.ut;for(let t=0;t>16&255)*h>>8<<16)+(l+(this.ft[f]>>8&255)*h>>8<<8)+(a+(255&this.ft[f])*h>>8);this.ft[f++]=t}f+=c}}static Rt(t,i,e,s,n){const r=256-n,h=(s>>16&255)*n,o=(s>>8&255)*n,l=(255&s)*n;let a=i-e;a<0&&(a=0);let c=i+e;c>=this.dt&&(c=this.dt-1);for(let s=a;s<=c;s++){const n=s-i,a=0|Math.sqrt(e*e-n*n);let c=t-a;c<0&&(c=0);let f=t+a;f>=this.ut&&(f=this.ut-1);let u=c+s*this.ut;for(let t=c;t<=f;t++){const t=(h+(this.ft[u]>>16&255)*r>>8<<16)+(o+(this.ft[u]>>8&255)*r>>8<<8)+(l+(255&this.ft[u])*r>>8);this.ft[u++]=t}}}static Ot=(t,i,e)=>{t=this.right||i=this.bottom||(this.ft[t+i*this.ut]=e)}}const A=document.getElementById('canvas'),p=A.getContext('2d',{willReadFrequently:!0}),_=document.createElement('canvas'),I=document.createElement('img'),g=_.getContext('2d',{willReadFrequently:!0});class C{vt;width;height;Lt;St;ft;constructor(t,i,e=p){this.Lt=e,this.vt=this.Lt.getImageData(0,0,t,i),this.St=new Uint32Array(this.vt.data.buffer),this.ft=new Int32Array(t*i),this.width=t,this.height=i,this.bind()}clear(){this.ft.fill(0)}bind(){m.bind(this.ft,this.width,this.height)}draw(t,i){this.#t(),this.Lt.putImageData(this.vt,t,i)}#t(){const t=this.ft.length,i=this.ft,e=this.St;for(let s=0;s>16&255|(t>>8&255)<<8|(255&t)<<16|4278190080}}}const E=async t=>new Promise((i=>setTimeout(i,t))),T=async t=>new Int8Array(await(await fetch(t)).arrayBuffer());class b{xt;cursor=null;constructor(){const t=new w;t.next=t,t.rt=t,this.xt=t}Mt(t){t.rt&&t.ht(),t.rt=this.xt.rt,t.next=this.xt,t.rt&&(t.rt.next=t),t.next.rt=t}kt(t){t.rt&&t.ht(),t.rt=this.xt,t.next=this.xt.next,t.rt.next=t,t.next&&(t.next.rt=t)}Dt(){const t=this.xt.next;return t===this.xt?null:(t?.ht(),t)}head(){const t=this.xt.next;return t===this.xt?(this.cursor=null,null):(this.cursor=t?.next||null,t)}Ft(){const t=this.xt.rt;return t===this.xt?(this.cursor=null,null):(this.cursor=t?.rt||null,t)}next(){const t=this.cursor;return t===this.xt?(this.cursor=null,null):(this.cursor=t?.next||null,t)}rt(){const t=this.cursor;return t===this.xt?(this.cursor=null,null):(this.cursor=t?.rt||null,t)}clear(){for(;;){const t=this.xt.next;if(t===this.xt)return;t?.ht()}}}class R extends y{static Nt=3988292384;static Bt=new Int32Array(256);static Ut=new Uint32Array(33);static Pt=new b;static Gt=new b;static Wt=new b;static Yt=0;static Ht=0;static Vt=0;static{for(let t=0;t<32;t++)R.Ut[t]=(1<>>=1:i=i>>>1^R.Nt;R.Bt[t]=i}}static Kt=t=>{let i=4294967295;for(let e=0;e>>8^R.Bt[255&(i^t[e])];return~i};view;data;Xt=0;jt=0;random=null;constructor(t){if(!t)throw new Error('Input src packet array was null!');super(),t instanceof Int8Array?this.data=new Uint8Array(t):this.data=t,this.view=new DataView(this.data.buffer,this.data.byteOffset,this.data.byteLength)}get length(){return this.view.byteLength}get available(){return this.length-this.Xt}static zt=t=>{let i=null;return 0===t&&R.Yt>0?(R.Yt--,i=R.Pt.Dt()):1===t&&R.Ht>0?(R.Ht--,i=R.Gt.Dt()):2===t&&R.Vt>0&&(R.Vt--,i=R.Wt.Dt()),i?(i.Xt=0,i):new R(0===t?new Uint8Array(100):1===t?new Uint8Array(5e3):new Uint8Array(3e4))};release(){this.Xt=0,100===this.view.byteLength&&R.Yt<1e3?(R.Pt.Mt(this),R.Yt++):5e3===this.view.byteLength&&R.Ht<250?(R.Gt.Mt(this),R.Ht++):3e4===this.view.byteLength&&R.Vt<50&&(R.Wt.Mt(this),R.Vt++)}get Zt(){return this.view.getUint8(this.Xt++)}get qt(){return this.view.getInt8(this.Xt++)}get Jt(){const t=this.view.getUint16(this.Xt);return this.Xt+=2,t}get $t(){const t=this.view.getInt16(this.Xt);return this.Xt+=2,t}get Qt(){const t=this.view.getUint8(this.Xt++)<<16|this.view.getUint16(this.Xt);return this.Xt+=2,t}get ti(){const t=this.view.getInt32(this.Xt);return this.Xt+=4,t}get ii(){const t=this.view.getBigInt64(this.Xt);return this.Xt+=8,t}get ei(){return this.view.getUint8(this.Xt)<128?this.Zt-64:this.Jt-49152}get si(){return this.view.getUint8(this.Xt)<128?this.Zt:this.Jt-32768}get ni(){const t=this.view,i=t.byteLength;let e,s='';for(;10!==(e=t.getUint8(this.Xt++))&&this.Xt>16),this.view.setUint16(this.Xt,t),this.Xt+=2}p4(t){this.view.setInt32(this.Xt,t),this.Xt+=4}ai(t){this.view.setInt32(this.Xt,t,!0),this.Xt+=4}ci(t){this.view.setBigInt64(this.Xt,t),this.Xt+=8}fi(t){const i=this.view,e=t.length;for(let s=0;s>>3,e=8-(7&this.jt),s=0;for(this.jt+=t;t>e;e=8)s+=(this.view.getUint8(i++)&R.Ut[e])<>>e-t&R.Ut[t],s}Ai(t,i){const e=this.Xt;this.Xt=0;const s=new Uint8Array(e);this.ri(e,0,s);const n=function(t){const i=[];for(;t>0n;)i.unshift(Number(0xffn&t)),t>>=8n;return 128&i[0]&&i.unshift(0),new Uint8Array(i)}(function(t,i,e){let s=1n;for(;i>0n;)i%2n===1n&&(s=s*t%e),t=t*t%e,i>>=1n;return s}(function(t){let i=0n;for(let e=0;e{const s=new R(t.read(i+'.dat')),n=new R(t.read('index.dat'));n.Xt=s.Jt;const r=n.Jt,h=n.Jt,o=n.Zt,l=new Int32Array(o);for(let t=1;ts.length||n.Xt>n.length)throw new Error;const a=n.Zt,c=n.Zt,f=n.Jt,u=n.Jt,d=new O(f,u,l);d.pi=a,d._i=c,d.Ii=r,d.gi=h;const w=d.ft,y=n.Zt;if(0===y){const t=d.width*d.height;for(let i=0;im.bottom&&(n-=i+n-m.bottom),tm.right){const i=t+r-m.right;r-=i,o+=i,h+=i}r>0&&n>0&&this.Ei(r,n,this.ft,s,o,m.ft,e,h)}Ti(){const t=this.ft,i=this.width,e=this.height;for(let s=0;s>16&255;n+=t,n<0?n=0:n>255&&(n=255);let r=this.palette[s]>>8&255;r+=i,r<0?r=0:r>255&&(r=255);let h=255&this.palette[s];h+=e,h<0?h=0:h>255&&(h=255),this.palette[s]=(n<<16)+(r<<8)+h}}Ri(){this.Ii|=0,this.gi|=0,this.Ii/=2,this.gi/=2,this.Ii|=0,this.gi|=0;const t=new Int8Array(this.Ii*this.gi);let i=0;for(let e=0;e>1)+(e+this._i>>1)*this.Ii]=this.ft[i++];this.ft=t,this.width=this.Ii,this.height=this.gi,this.pi=0,this._i=0}Oi(){if(this.width===this.Ii&&this.height===this.gi)return;const t=new Int8Array(this.Ii*this.gi);let i=0;for(let e=0;e>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=e[s++];0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t]}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=this.palette[255&t]}h+=o,s+=n}}clip(t,i,e,s){try{const n=this.width;this.height;let r=0,h=0;const o=this.Ii,l=this.gi,a=(o<<16)/e|0,c=(l<<16)/s|0;t=t+(this.pi*e+o-1)/o|0,i=i+(this._i*s+l-1)/l|0,this.pi*e%o!=0&&(r=(o-this.pi*e%o<<16)/e|0),this._i*s%l!=0&&(h=(l-this._i*s%l<<16)/s|0),e=e*(this.width-(r>>16))/o|0,s=s*(this.height-(h>>16))/l|0;let f,u=t+i*m.ut,d=m.ut-e;im.bottom&&(s-=i+s-m.bottom),tm.right&&(f=t+e-m.right,e-=f,d+=f),this.vi(m.ft,this.ft,this.palette,r,h,u,d,e,s,a,c,n)}catch(t){console.log('error in sprite clipping routine')}}vi(t,i,e,s,n,r,h,o,l,a,c,f){try{const u=s;for(let d=-l;d<0;d++){const l=(n>>16)*f;for(let n=-o;n<0;n++){const n=i[(s>>16)+l];0==n?r++:t[r++]=e[255&n],s+=a}n+=c,s=u,r+=h}}catch(t){console.log('error in plot_scale')}}}class v extends Array{constructor(t,i){super(t);for(let e=0;e{this.Si=null,this.Si=null,this.sin=null,this.cos=null,this.Di=null,this.Mi=null,this.Xi=null,this.ji=null,this.Pi=null,this.Gi=null,this.Hi=null,this.palette=null,this.Vi=null,console.log('Draw3D unloaded!')};static Zi=()=>{this.Di=new Int32Array(this.dt);for(let t=0;t{this.Di=new Int32Array(i);for(let e=0;e{this.Pi=null,this.Gi.fill(null)};static $i=t=>{this.ki=0;for(let i=0;i<50;i++)try{this.Mi[i]=O.Ci(t,i.toString()),this.Li&&128===this.Mi[i]?.Ii?this.Mi[i]?.Ri():this.Mi[i]?.Oi(),this.ki++}catch(t){}};static Qi=t=>{if(0!==this.ji[t])return this.ji[t];const i=this.Vi[t];if(!i)return 0;let e=0,s=0,n=0;const r=i.length;for(let t=0;t>16&255,s+=i[t]>>8&255,n+=255&i[t];let h=(e/r<<16)+(s/r<<8)+(n/r|0);return h=this.te(h,1.4),0===h&&(h=1),this.ji[t]=h,h};static ie=t=>{const i=t+.03*Math.random()-.015;let e=0;for(let t=0;t<512;t++){const s=(t/8|0)/64+.0078125,n=(7&t)/8+.0625;for(let t=0;t<128;t++){const r=t/128;let h=r,o=r,l=r;if(0!==n){let t;t=r<.5?r*(n+1):r+n-r*n;const i=2*r-t;let e=s+.3333333333333333;e>1&&e--;let a=s-.3333333333333333;a<0&&a++,h=6*e<1?i+6*(t-i)*e:2*e<1?t:3*e<2?i+(t-i)*(.6666666666666666-e)*6:i,o=6*s<1?i+6*(t-i)*s:2*s<1?t:3*s<2?i+(t-i)*(.6666666666666666-s)*6:i,l=6*a<1?i+6*(t-i)*a:2*a<1?t:3*a<2?i+(t-i)*(.6666666666666666-a)*6:i}const a=((256*h|0)<<16)+((256*o|0)<<8)+(256*l|0);this.palette[e++]=this.te(a,i)}}for(let t=0;t<50;t++){const e=this.Mi[t];if(!e)continue;const s=e.palette;this.Vi[t]=new Int32Array(s.length);for(let e=0;e{const e=(t>>16)/256,s=(t>>8&255)/256,n=(255&t)/256;return((256*Math.pow(e,i)|0)<<16)+((256*Math.pow(s,i)|0)<<8)+(256*Math.pow(n,i)|0)};static se=t=>{this.Pi||(this.Wi=t,this.Li?this.Pi=new k(t,16384):this.Pi=new k(t,65536),this.Gi.fill(null))};static ne=(t,i,e,s,n,r,h,o,l)=>{let a=0,c=0;n!==s&&(a=(i-t<<16)/(n-s)|0,c=(o-h<<15)/(n-s)|0);let f=0,u=0;r!==n&&(f=(e-i<<16)/(r-n)|0,u=(l-o<<15)/(r-n)|0);let d=0,w=0;if(r!==s&&(d=(t-e<<16)/(s-r)|0,w=(h-l<<15)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),nf)for(r-=n,n-=s,s=this.Di[s];;){if(--n<0)for(;;){if(--r<0)return;this.re(e>>16,i>>16,l>>7,o>>7,this.ft,s,0),e+=d,i+=f,l+=w,o+=u,s+=this.ut}this.re(e>>16,t>>16,l>>7,h>>7,this.ft,s,0),e+=d,t+=a,l+=w,h+=c,s+=this.ut}else for(r-=n,n-=s,s=this.Di[s];;){if(--n<0)for(;;){if(--r<0)return;this.re(i>>16,e>>16,o>>7,l>>7,this.ft,s,0),e+=d,i+=f,l+=w,o+=u,s+=this.ut}this.re(t>>16,e>>16,h>>7,l>>7,this.ft,s,0),e+=d,t+=a,l+=w,h+=c,s+=this.ut}else if(i=t<<=16,o=h<<=15,s<0&&(i-=d*s,t-=a*s,o-=w*s,h-=c*s,s=0),e<<=16,l<<=15,r<0&&(e-=f*r,l-=u*r,r=0),s!==r&&da)for(n-=r,r-=s,s=this.Di[s];;){if(--r<0)for(;;){if(--n<0)return;this.re(e>>16,t>>16,l>>7,h>>7,this.ft,s,0),e+=f,t+=a,l+=u,h+=c,s+=this.ut}this.re(i>>16,t>>16,o>>7,h>>7,this.ft,s,0),i+=d,t+=a,o+=w,h+=c,s+=this.ut}else for(n-=r,r-=s,s=this.Di[s];;){if(--r<0)for(;;){if(--n<0)return;this.re(t>>16,e>>16,h>>7,l>>7,this.ft,s,0),e+=f,t+=a,l+=u,h+=c,s+=this.ut}this.re(t>>16,i>>16,h>>7,o>>7,this.ft,s,0),i+=d,t+=a,o+=w,h+=c,s+=this.ut}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),rd)for(s-=r,r-=n,n=this.Di[n];;){if(--r<0)for(;;){if(--s<0)return;this.re(t>>16,e>>16,h>>7,l>>7,this.ft,n,0),t+=a,e+=d,h+=c,l+=w,n+=this.ut}this.re(t>>16,i>>16,h>>7,o>>7,this.ft,n,0),t+=a,i+=f,h+=c,o+=u,n+=this.ut}else for(s-=r,r-=n,n=this.Di[n];;){if(--r<0)for(;;){if(--s<0)return;this.re(e>>16,t>>16,l>>7,h>>7,this.ft,n,0),t+=a,e+=d,h+=c,l+=w,n+=this.ut}this.re(i>>16,t>>16,o>>7,h>>7,this.ft,n,0),t+=a,i+=f,h+=c,o+=u,n+=this.ut}else if(e=i<<=16,l=o<<=15,n<0&&(e-=a*n,i-=f*n,l-=c*n,o-=u*n,n=0),t<<=16,h<<=15,s<0&&(t-=d*s,h-=w*s,s=0),r-=s,s-=n,n=this.Di[n],a>16,i>>16,h>>7,o>>7,this.ft,n,0),t+=d,i+=f,h+=w,o+=u,n+=this.ut}this.re(e>>16,i>>16,l>>7,o>>7,this.ft,n,0),e+=a,i+=f,l+=c,o+=u,n+=this.ut}else for(;;){if(--s<0)for(;;){if(--r<0)return;this.re(i>>16,t>>16,o>>7,h>>7,this.ft,n,0),t+=d,i+=f,h+=w,o+=u,n+=this.ut}this.re(i>>16,e>>16,o>>7,l>>7,this.ft,n,0),e+=a,i+=f,l+=c,o+=u,n+=this.ut}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,o>>7,h>>7,this.ft,r,0),i+=f,t+=a,o+=u,h+=c,r+=this.ut}this.re(i>>16,e>>16,o>>7,l>>7,this.ft,r,0),i+=f,e+=d,o+=u,l+=w,r+=this.ut}else for(;;){if(--s<0)for(;;){if(--n<0)return;this.re(t>>16,i>>16,h>>7,o>>7,this.ft,r,0),i+=f,t+=a,o+=u,h+=c,r+=this.ut}this.re(e>>16,i>>16,l>>7,o>>7,this.ft,r,0),i+=f,e+=d,o+=u,l+=w,r+=this.ut}else if(t=e<<=16,h=l<<=15,r<0&&(t-=f*r,e-=d*r,h-=u*r,l-=w*r,r=0),i<<=16,o<<=15,n<0&&(i-=a*n,o-=c*n,n=0),s-=n,n-=r,r=this.Di[r],f>16,e>>16,o>>7,l>>7,this.ft,r,0),i+=a,e+=d,o+=c,l+=w,r+=this.ut}this.re(t>>16,e>>16,h>>7,l>>7,this.ft,r,0),t+=f,e+=d,h+=u,l+=w,r+=this.ut}else for(;;){if(--n<0)for(;;){if(--s<0)return;this.re(e>>16,i>>16,l>>7,o>>7,this.ft,r,0),i+=a,e+=d,o+=c,l+=w,r+=this.ut}this.re(e>>16,t>>16,l>>7,h>>7,this.ft,r,0),t+=f,e+=d,h+=u,l+=w,r+=this.ut}};static re=(t,i,e,s,n,r,h)=>{let o;if(this.Bi){let l;if(this.Ui){if(l=i-t>3?(s-e)/(i-t)|0:0,i>this.wt&&(i=this.wt),t<0&&(e-=t*l,t=0),t>=i)return;r+=t,h=i-t>>2,l<<=2}else{if(!(t>2)>0?(s-e)*this.Si[h]>>15:0}if(0===this.alpha)for(;;){if(--h<0){if((h=i-t&3)>0){o=this.palette[e>>8];do{n[r++]=o,h--}while(h>0);return}break}o=this.palette[e>>8],e+=l,n[r++]=o,n[r++]=o,n[r++]=o,n[r++]=o}else{const s=this.alpha,a=256-this.alpha;for(;;){if(--h<0){if((h=i-t&3)>0){o=this.palette[e>>8],o=((16711935&o)*a>>8&16711935)+((65280&o)*a>>8&65280);do{n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),h--}while(h>0)}break}o=this.palette[e>>8],e+=l,o=((16711935&o)*a>>8&16711935)+((65280&o)*a>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280)}}}else if(tthis.wt&&(i=this.wt),t<0&&(e-=t*l,t=0),t>=i))return;if(r+=t,h=i-t,0===this.alpha)do{n[r++]=this.palette[e>>8],e+=l,h--}while(h>0);else{const t=this.alpha,i=256-this.alpha;do{o=this.palette[e>>8],e+=l,o=((16711935&o)*i>>8&16711935)+((65280&o)*i>>8&65280),n[r++]=o+((16711935&n[r])*t>>8&16711935)+((65280&n[r])*t>>8&65280),h--}while(h>0)}}};static he=(t,i,e,s,n,r,h)=>{let o=0;n!==s&&(o=(i-t<<16)/(n-s)|0);let l=0;r!==n&&(l=(e-i<<16)/(r-n)|0);let a=0;if(r!==s&&(a=(t-e<<16)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),nl)for(r-=n,n-=s,s=this.Di[s];;){if(--n<0)for(;;){if(--r<0)return;this.oe(e>>16,i>>16,this.ft,s,h),e+=a,i+=l,s+=this.ut}this.oe(e>>16,t>>16,this.ft,s,h),e+=a,t+=o,s+=this.ut}else for(r-=n,n-=s,s=this.Di[s];;){if(--n<0)for(;;){if(--r<0)return;this.oe(i>>16,e>>16,this.ft,s,h),e+=a,i+=l,s+=this.ut}this.oe(t>>16,e>>16,this.ft,s,h),e+=a,t+=o,s+=this.ut}else if(i=t<<=16,s<0&&(i-=a*s,t-=o*s,s=0),e<<=16,r<0&&(e-=l*r,r=0),s!==r&&ao)for(n-=r,r-=s,s=this.Di[s];;){if(--r<0)for(;;){if(--n<0)return;this.oe(e>>16,t>>16,this.ft,s,h),e+=l,t+=o,s+=this.ut}this.oe(i>>16,t>>16,this.ft,s,h),i+=a,t+=o,s+=this.ut}else for(n-=r,r-=s,s=this.Di[s];;){if(--r<0)for(;;){if(--n<0)return;this.oe(t>>16,e>>16,this.ft,s,h),e+=l,t+=o,s+=this.ut}this.oe(t>>16,i>>16,this.ft,s,h),i+=a,t+=o,s+=this.ut}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),ra)for(s-=r,r-=n,n=this.Di[n];;){if(--r<0)for(;;){if(--s<0)return;this.oe(t>>16,e>>16,this.ft,n,h),t+=o,e+=a,n+=this.ut}this.oe(t>>16,i>>16,this.ft,n,h),t+=o,i+=l,n+=this.ut}else for(s-=r,r-=n,n=this.Di[n];;){if(--r<0)for(;;){if(--s<0)return;this.oe(e>>16,t>>16,this.ft,n,h),t+=o,e+=a,n+=this.ut}this.oe(i>>16,t>>16,this.ft,n,h),t+=o,i+=l,n+=this.ut}else if(e=i<<=16,n<0&&(e-=o*n,i-=l*n,n=0),t<<=16,s<0&&(t-=a*s,s=0),o>16,i>>16,this.ft,n,h),t+=a,i+=l,n+=this.ut}this.oe(e>>16,i>>16,this.ft,n,h),e+=o,i+=l,n+=this.ut}else for(r-=s,s-=n,n=this.Di[n];;){if(--s<0)for(;;){if(--r<0)return;this.oe(i>>16,t>>16,this.ft,n,h),t+=a,i+=l,n+=this.ut}this.oe(i>>16,e>>16,this.ft,n,h),e+=o,i+=l,n+=this.ut}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,this.ft,r,h),i+=l,t+=o,r+=this.ut}this.oe(i>>16,e>>16,this.ft,r,h),i+=l,e+=a,r+=this.ut}else for(n-=s,s-=r,r=this.Di[r];;){if(--s<0)for(;;){if(--n<0)return;this.oe(t>>16,i>>16,this.ft,r,h),i+=l,t+=o,r+=this.ut}this.oe(e>>16,i>>16,this.ft,r,h),i+=l,e+=a,r+=this.ut}else if(t=e<<=16,r<0&&(t-=l*r,e-=a*r,r=0),i<<=16,n<0&&(i-=o*n,n=0),l>16,e>>16,this.ft,r,h),i+=o,e+=a,r+=this.ut}this.oe(t>>16,e>>16,this.ft,r,h),t+=l,e+=a,r+=this.ut}else for(s-=n,n-=r,r=this.Di[r];;){if(--n<0)for(;;){if(--s<0)return;this.oe(e>>16,i>>16,this.ft,r,h),i+=o,e+=a,r+=this.ut}this.oe(e>>16,t>>16,this.ft,r,h),t+=l,e+=a,r+=this.ut}};static le=(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w,y,m,A,p)=>{const _=this.ae(p);this.Ki=!this.Xi[p];const I=a-u,g=c-w,C=f-m,E=d-a,T=y-c,b=A-f;let R=E*c-T*a<<14;const O=T*f-b*c<<8,v=b*a-E*f<<5;let L=I*c-g*a<<14;const S=g*f-C*c<<8,x=C*a-I*f<<5;let M=g*E-I*T<<14;const k=C*T-g*b<<8,D=I*b-C*E<<5;let F=0,N=0;n!==s&&(F=(i-t<<16)/(n-s)|0,N=(o-h<<16)/(n-s)|0);let B=0,U=0;r!==n&&(B=(e-i<<16)/(r-n)|0,U=(l-o<<16)/(r-n)|0);let P=0,G=0;if(r!==s&&(P=(t-e<<16)/(s-r)|0,G=(h-l<<16)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),nB)for(r-=n,n-=s,s=this.Di[s];;){if(--n<0)for(;;){if(--r<0)return;this.ce(e>>16,i>>16,this.ft,s,_,0,0,R,L,M,O,S,k,l>>8,o>>8),e+=P,i+=B,l+=G,o+=U,s+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(e>>16,t>>16,this.ft,s,_,0,0,R,L,M,O,S,k,l>>8,h>>8),e+=P,t+=F,l+=G,h+=N,s+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}else for(r-=n,n-=s,s=this.Di[s];;){if(--n<0)for(;;){if(--r<0)return;this.ce(i>>16,e>>16,this.ft,s,_,0,0,R,L,M,O,S,k,o>>8,l>>8),e+=P,i+=B,l+=G,o+=U,s+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(t>>16,e>>16,this.ft,s,_,0,0,R,L,M,O,S,k,h>>8,l>>8),e+=P,t+=F,l+=G,h+=N,s+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}}else{i=t<<=16,o=h<<=16,s<0&&(i-=P*s,t-=F*s,o-=G*s,h-=N*s,s=0),e<<=16,l<<=16,r<0&&(e-=B*r,l-=U*r,r=0);const a=s-this.Ni;if(R+=v*a,L+=x*a,M+=D*a,R|=0,L|=0,M|=0,(s===r||P>=F)&&(s!==r||B<=F))for(n-=r,r-=s,s=this.Di[s];;){if(--r<0)for(;;){if(--n<0)return;this.ce(t>>16,e>>16,this.ft,s,_,0,0,R,L,M,O,S,k,h>>8,l>>8),e+=B,t+=F,l+=U,h+=N,s+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(t>>16,i>>16,this.ft,s,_,0,0,R,L,M,O,S,k,h>>8,o>>8),i+=P,t+=F,o+=G,h+=N,s+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}else for(n-=r,r-=s,s=this.Di[s];;){if(--r<0)for(;;){if(--n<0)return;this.ce(e>>16,t>>16,this.ft,s,_,0,0,R,L,M,O,S,k,l>>8,h>>8),e+=B,t+=F,l+=U,h+=N,s+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(i>>16,t>>16,this.ft,s,_,0,0,R,L,M,O,S,k,o>>8,h>>8),i+=P,t+=F,o+=G,h+=N,s+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),rP)for(s-=r,r-=n,n=this.Di[n];;){if(--r<0)for(;;){if(--s<0)return;this.ce(t>>16,e>>16,this.ft,n,_,0,0,R,L,M,O,S,k,h>>8,l>>8),t+=F,e+=P,h+=N,l+=G,n+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(t>>16,i>>16,this.ft,n,_,0,0,R,L,M,O,S,k,h>>8,o>>8),t+=F,i+=B,h+=N,o+=U,n+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}else for(s-=r,r-=n,n=this.Di[n];;){if(--r<0)for(;;){if(--s<0)return;this.ce(e>>16,t>>16,this.ft,n,_,0,0,R,L,M,O,S,k,l>>8,h>>8),t+=F,e+=P,h+=N,l+=G,n+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(i>>16,t>>16,this.ft,n,_,0,0,R,L,M,O,S,k,o>>8,h>>8),t+=F,i+=B,h+=N,o+=U,n+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}}else{e=i<<=16,l=o<<=16,n<0&&(e-=F*n,i-=B*n,l-=N*n,o-=U*n,n=0),t<<=16,h<<=16,s<0&&(t-=P*s,h-=G*s,s=0);const a=n-this.Ni;if(R+=v*a,L+=x*a,M+=D*a,R|=0,L|=0,M|=0,r-=s,s-=n,n=this.Di[n],F>16,i>>16,this.ft,n,_,0,0,R,L,M,O,S,k,h>>8,o>>8),t+=P,i+=B,h+=G,o+=U,n+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(e>>16,i>>16,this.ft,n,_,0,0,R,L,M,O,S,k,l>>8,o>>8),e+=F,i+=B,l+=N,o+=U,n+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}else for(;;){if(--s<0)for(;;){if(--r<0)return;this.ce(i>>16,t>>16,this.ft,n,_,0,0,R,L,M,O,S,k,o>>8,h>>8),t+=P,i+=B,h+=G,o+=U,n+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(i>>16,e>>16,this.ft,n,_,0,0,R,L,M,O,S,k,o>>8,l>>8),e+=F,i+=B,l+=N,o+=U,n+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,this.ft,r,_,0,0,R,L,M,O,S,k,o>>8,h>>8),i+=B,t+=F,o+=U,h+=N,r+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(i>>16,e>>16,this.ft,r,_,0,0,R,L,M,O,S,k,o>>8,l>>8),i+=B,e+=P,o+=U,l+=G,r+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}else for(;;){if(--s<0)for(;;){if(--n<0)return;this.ce(t>>16,i>>16,this.ft,r,_,0,0,R,L,M,O,S,k,h>>8,o>>8),i+=B,t+=F,o+=U,h+=N,r+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(e>>16,i>>16,this.ft,r,_,0,0,R,L,M,O,S,k,l>>8,o>>8),i+=B,e+=P,o+=U,l+=G,r+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}}else{t=e<<=16,h=l<<=16,r<0&&(t-=B*r,e-=P*r,h-=U*r,l-=G*r,r=0),i<<=16,o<<=16,n<0&&(i-=F*n,o-=N*n,n=0);const a=r-this.Ni;if(R+=v*a,L+=x*a,M+=D*a,R|=0,L|=0,M|=0,s-=n,n-=r,r=this.Di[r],B>16,e>>16,this.ft,r,_,0,0,R,L,M,O,S,k,o>>8,l>>8),i+=F,e+=P,o+=N,l+=G,r+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(t>>16,e>>16,this.ft,r,_,0,0,R,L,M,O,S,k,h>>8,l>>8),t+=B,e+=P,h+=U,l+=G,r+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}else for(;;){if(--n<0)for(;;){if(--s<0)return;this.ce(e>>16,i>>16,this.ft,r,_,0,0,R,L,M,O,S,k,l>>8,o>>8),i+=F,e+=P,o+=N,l+=G,r+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(e>>16,t>>16,this.ft,r,_,0,0,R,L,M,O,S,k,l>>8,h>>8),t+=B,e+=P,h+=U,l+=G,r+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}}};static ce=(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w)=>{if(t>=i)return;let y,m,A,p,_,I,g,C,E;if(this.Ui){if(y=(w-d)/(i-t)|0,i>this.wt&&(i=this.wt),t<0&&(d-=t*y,t=0),t>=i)return;m=i-t>>3,y<<=12}else i-t>7?(m=i-t>>3,y=(w-d)*this.Si[m]>>6):(m=0,y=0);if(d<<=9,s+=t,this.Li&&n)if(A=0,p=0,I=t-this.Fi,o+=(c>>3)*I,l+=(f>>3)*I,a+=(u>>3)*I,o|=0,l|=0,_=(a|=0)>>12,0!==_&&(h=l/_|0,(r=o/_|0)<0?r=0:r>4032&&(r=4032)),o+=c,l+=f,a+=u,o|=0,l|=0,_=(a|=0)>>12,0!==_&&(A=o/_|0,p=l/_|0,A<7?A=7:A>4032&&(A=4032)),g=A-r>>3,C=p-h>>3,r+=d>>3&786432,E=d>>23,this.Ki){for(;m-- >0;)e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r=A,h=p,o+=c,l+=f,_=(a+=u)>>12,0!==_&&(A=o/_|0,p=l/_|0,A<7?A=7:A>4032&&(A=4032)),g=A-r>>3,C=p-h>>3,r+=(d+=y)>>3&786432,E=d>>23;for(m=i-t&7;m-- >0;)e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C}else{for(;m-- >0;){let t;0!=(t=n[(4032&h)+(r>>6)]>>>E)&&(e[s]=t),s+=1,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s+=1,r=A,h=p,o+=c,l+=f,a+=u,o|=0,l|=0,_=(a|=0)>>12,0!==_&&(A=o/_|0,p=l/_|0,A<7?A=7:A>4032&&(A=4032)),g=A-r>>3,C=p-h>>3,r+=(d+=y)>>3&786432,E=d>>23}for(m=i-t&7;m-- >0;){let t;0!=(t=n[(4032&h)+(r>>6)]>>>E)&&(e[s]=t),s++,r+=g,h+=C}}else if(A=0,p=0,I=t-this.Fi,o+=(c>>3)*I,l+=(f>>3)*I,a+=(u>>3)*I,o|=0,l|=0,_=(a|=0)>>14,0!==_&&(h=l/_|0,(r=o/_|0)<0?r=0:r>16256&&(r=16256)),o+=c,l+=f,a+=u,o|=0,l|=0,_=(a|=0)>>14,0!==_&&(A=o/_|0,p=l/_|0,A<7?A=7:A>16256&&(A=16256)),g=A-r>>3,C=p-h>>3,r+=6291456&d,E=d>>23,this.Ki&&n){for(;m-- >0;)e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r=A,h=p,o+=c,l+=f,a+=u,o|=0,l|=0,_=(a|=0)>>14,0!==_&&(A=o/_|0,p=l/_|0,A<7?A=7:A>16256&&(A=16256)),g=A-r>>3,C=p-h>>3,r+=6291456&(d+=y),E=d>>23;for(m=i-t&7;m-- >0;)e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C}else{for(;m-- >0&&n;){let t;0!=(t=n[(16256&h)+(r>>7)]>>>E)&&(e[s]=t),s+=1,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,r=A,h=p,o+=c,l+=f,a+=u,o|=0,l|=0,_=(a|=0)>>14,0!==_&&(A=o/_|0,p=l/_|0,A<7?A=7:A>16256&&(A=16256)),g=A-r>>3,C=p-h>>3,r+=6291456&(d+=y),E=d>>23}for(m=i-t&7;m-- >0&&n;){let t;0!=(t=n[(16256&h)+(r>>7)]>>>E)&&(e[s]=t),s++,r+=g,h+=C}}};static oe=(t,i,e,s,n)=>{if(this.Ui&&(i>this.wt&&(i=this.wt),t<0&&(t=0)),t>=i)return;s+=t;let r=i-t>>2;if(0===this.alpha)for(;;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;e[s++]=n}e[s++]=n,e[s++]=n,e[s++]=n,e[s++]=n}const h=this.alpha,o=256-this.alpha;for(n=((16711935&n)*o>>8&16711935)+((65280&n)*o>>8&65280);;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280)}e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280)}};static ee=t=>{this.Gi[t]&&this.Pi&&(this.Pi[this.Wi++]=this.Gi[t],this.Gi[t]=null)};static ae=t=>{if(this.Hi[t]=this.Yi++,this.Gi[t])return this.Gi[t];let i;if(this.Wi>0&&this.Pi)i=this.Pi[--this.Wi],this.Pi[this.Wi]=null;else{let t=0,e=-1;for(let i=0;i>>3)&16316671,i[n+8192]=r-(r>>>2)&16316671,i[n+12288]=r-(r>>>2)-(r>>>3)&16316671}}else{if(64===e.width)for(let t=0;t<128;t++)for(let n=0;n<128;n++)i[n+(t<<7)]=s[e.ft[(n>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)i[t]=s[e.ft[t]];this.Xi[t]=!1;for(let e=0;e<16384;e++){i[e]&=16316671;const s=i[e];0===s&&(this.Xi[t]=!0),i[e+16384]=s-(s>>>3)&16316671,i[e+32768]=s-(s>>>2)&16316671,i[e+49152]=s-(s>>>2)-(s>>>3)&16316671}}return i}}const N={'Backspace':{code:8,ch:8},'Enter':{code:10,ch:10},'Shift':{code:16,ch:65535},'Escape':{code:27,ch:27},'Tab':{code:9,ch:9},'CapsLock':{code:20,ch:65535},' ':{code:32,ch:32},'Control':{code:17,ch:65535},'Alt':{code:18,ch:65535},'Meta':{code:524,ch:65535},'ArrowLeft':{code:37,ch:65535},'ArrowRight':{code:39,ch:65535},'ArrowUp':{code:38,ch:65535},'ArrowDown':{code:40,ch:65535},'Insert':{code:155,ch:65535},'Home':{code:36,ch:65535},'PageUp':{code:33,ch:65535},'Delete':{code:127,ch:127},'End':{code:35,ch:65535},'PageDown':{code:34,ch:65535},'`':{code:192,ch:96},'~':{code:192,ch:126},'!':{code:49,ch:33},'@':{code:50,ch:64},'#':{code:51,ch:35},'$':{code:52,ch:36},'%':{code:53,ch:37},'^':{code:54,ch:94},'&':{code:55,ch:38},'*':{code:56,ch:42},'(':{code:57,ch:40},')':{code:48,ch:41},'-':{code:45,ch:45},'_':{code:45,ch:95},'=':{code:61,ch:61},'+':{code:61,ch:43},'[':{code:91,ch:91},'{':{code:91,ch:123},']':{code:93,ch:93},'}':{code:93,ch:125},'\\':{code:92,ch:92},'|':{code:92,ch:124},';':{code:59,ch:59},':':{code:59,ch:58},"'":{code:222,ch:39},'"':{code:222,ch:34},',':{code:44,ch:44},'<':{code:44,ch:60},'.':{code:46,ch:46},'>':{code:46,ch:62},'/':{code:47,ch:47},'?':{code:47,ch:63},'F1':{code:112,ch:65535},'F2':{code:113,ch:65535},'F3':{code:114,ch:65535},'F4':{code:115,ch:65535},'F5':{code:116,ch:65535},'F6':{code:117,ch:65535},'F7':{code:118,ch:65535},'F8':{code:119,ch:65535},'F9':{code:120,ch:65535},'F10':{code:121,ch:65535},'F11':{code:122,ch:65535},'F12':{code:123,ch:65535},0:{code:48,ch:48},1:{code:49,ch:49},2:{code:50,ch:50},3:{code:51,ch:51},4:{code:52,ch:52},5:{code:53,ch:53},6:{code:54,ch:54},7:{code:55,ch:55},8:{code:56,ch:56},9:{code:57,ch:57},'a':{code:65,ch:97},'b':{code:66,ch:98},'c':{code:67,ch:99},'d':{code:68,ch:100},'e':{code:69,ch:101},'f':{code:70,ch:102},'g':{code:71,ch:103},'h':{code:72,ch:104},'i':{code:73,ch:105},'j':{code:74,ch:106},'k':{code:75,ch:107},'l':{code:76,ch:108},'m':{code:77,ch:109},'n':{code:78,ch:110},'o':{code:79,ch:111},'p':{code:80,ch:112},'q':{code:81,ch:113},'r':{code:82,ch:114},'s':{code:83,ch:115},'t':{code:84,ch:116},'u':{code:85,ch:117},'v':{code:86,ch:118},'w':{code:87,ch:119},'x':{code:88,ch:120},'y':{code:89,ch:121},'z':{code:90,ch:122},'A':{code:65,ch:65},'B':{code:66,ch:66},'C':{code:67,ch:67},'D':{code:68,ch:68},'E':{code:69,ch:69},'F':{code:70,ch:70},'G':{code:71,ch:71},'H':{code:72,ch:72},'I':{code:73,ch:73},'J':{code:74,ch:74},'K':{code:75,ch:75},'L':{code:76,ch:76},'M':{code:77,ch:77},'N':{code:78,ch:78},'O':{code:79,ch:79},'P':{code:80,ch:80},'Q':{code:81,ch:81},'R':{code:82,ch:82},'S':{code:83,ch:83},'T':{code:84,ch:84},'U':{code:85,ch:85},'V':{code:86,ch:86},'W':{code:87,ch:87},'X':{code:88,ch:88},'Y':{code:89,ch:89},'Z':{code:90,ch:90}},B=['Tab','F1','F2','F3','F4','F5','F6','F7','F8','F9','F10','ArrowLeft','ArrowRight','ArrowUp','ArrowDown'];class U{static enabled=!1;static fe=null;static ue=null;static de=0;static we=0;static ye=0;static me=0;static Ae=0;static pe=()=>{this.fe=R.zt(1),this.ue=null,this.de=performance.now(),this.enabled=!0};static _e=()=>{this.enabled=!1,this.fe=null};static flush=()=>{let t=null;return this.ue&&this.enabled&&(t=this.ue),this.ue=null,t};static stop=()=>{let t=null;return this.fe&&this.fe.Xt>0&&this.enabled&&(t=this.fe),this._e(),t};static Ie=(t,i,e)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;this.we++;const s=performance.now();let n=(s-this.de)/10|0;n>250&&(n=250),this.de=s,this.ge(5),1===e?this.fe?.p1(1):this.fe?.p1(2),this.fe?.p1(n),this.fe?.p3(t+(i<<10))};static Ce=t=>{if(!this.enabled)return;this.we++;const i=performance.now();let e=(i-this.de)/10|0;e>250&&(e=250),this.de=i,this.ge(2),1===t?this.fe?.p1(3):this.fe?.p1(4),this.fe?.p1(e)};static Ee=(t,i)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;const e=performance.now();if(e-this.ye>=50){this.ye=e,this.we++;let s=(e-this.de)/10|0;s>250&&(s=250),this.de=e,t-this.me<8&&t-this.me>=-8&&i-this.Ae<8&&i-this.Ae>=-8?(this.ge(3),this.fe?.p1(5),this.fe?.p1(s),this.fe?.p1(t+(i-this.Ae+8<<4)+8-this.me)):t-this.me<128&&t-this.me>=-128&&i-this.Ae<128&&i-this.Ae>=-128?(this.ge(4),this.fe?.p1(6),this.fe?.p1(s),this.fe?.p1(t+128-this.me),this.fe?.p1(i+128-this.Ae)):(this.ge(5),this.fe?.p1(7),this.fe?.p1(s),this.fe?.p3(t+(i<<10))),this.me=t,this.Ae=i}};static Te=t=>{if(!this.enabled)return;this.we++;const i=performance.now();let e=(i-this.de)/10|0;e>250&&(e=250),this.de=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.ge(3),this.fe?.p1(8),this.fe?.p1(e),this.fe?.p1(t)};static be=t=>{if(!this.enabled)return;this.we++;const i=performance.now();let e=(i-this.de)/10|0;e>250&&(e=250),this.de=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.ge(3),this.fe?.p1(9),this.fe?.p1(e),this.fe?.p1(t)};static Re=()=>{if(!this.enabled)return;this.we++;const t=performance.now();let i=(t-this.de)/10|0;i>250&&(i=250),this.de=t,this.ge(2),this.fe?.p1(10),this.fe?.p1(i)};static Oe=()=>{if(!this.enabled)return;this.we++;const t=performance.now();let i=(t-this.de)/10|0;i>250&&(i=250),this.de=t,this.ge(2),this.fe?.p1(11),this.fe?.p1(i)};static ve=()=>{if(!this.enabled)return;this.we++;const t=performance.now();let i=(t-this.de)/10|0;i>250&&(i=250),this.de=t,this.ge(2),this.fe?.p1(12),this.fe?.p1(i)};static Le=()=>{if(!this.enabled)return;this.we++;const t=performance.now();let i=(t-this.de)/10|0;i>250&&(i=250),this.de=t,this.ge(2),this.fe?.p1(13),this.fe?.p1(i)};static ge=t=>{if(this.fe&&this.fe.Xt+t>=500){const t=this.fe;this.fe=R.zt(1),this.ue=t}}}class P{static getParameter(t){return new URLSearchParams(window.location.search).get(t)??''}static setParameter(t,i){const e=new URL(window.location.toString());e.searchParams.set(t,i),window.history.pushState(null,'',e.toString())}Se=0;xe=[];Me=0;ke=null;state=0;De=20;Fe=1;Ne=[];Be=0;Ue=0;Pe=[];Ge=!0;We=!1;Ye=50;hasFocus=!0;He=!1;Ve=0;Ke=0;Xe=0;je=0;ze=0;Ze=0;qe=0;Je=[];$e=[];Qe=0;ts=0;input=null;es=!1;ss=!1;ns=!1;time=-1;rs=0;hs=0;os=0;ls=0;cs=0;fs=0;constructor(t=!1){A.tabIndex=-1,p.fillStyle='black',p.fillRect(0,0,A.width,A.height),this.We=t,this.We?this.resize(window.innerWidth,window.innerHeight):this.resize(A.width,A.height)}get width(){return A.width}get height(){return A.height}resize=(t,i)=>{A.width=t,A.height=i,this.ke=new C(t,i),F.Zi()};us=async()=>{A.addEventListener('resize',(()=>{this.We&&this.resize(window.innerWidth,window.innerHeight)}),!1),A.onmousedown=this.onmousedown,A.onmouseup=this.onmouseup,A.onmouseenter=this.onmouseenter,A.onmouseleave=this.onmouseleave,A.onmousemove=this.onmousemove,window.onbeforeunload=this.zi,A.onfocus=this.onfocus,A.onblur=this.onblur,this.ds?(A.ontouchstart=this.ontouchstart,A.ontouchend=this.ontouchend,A.ontouchmove=this.ontouchmove):(A.onkeydown=this.onkeydown,A.onkeyup=this.onkeyup),A.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.ds&&'low'===P.getParameter('detail')&&(this.Ye=30),await this.ws(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.Ne[t]=performance.now();let t,i=0,e=256,s=1,n=0;for(;this.state>=0;){if(this.state>0&&(this.state--,0===this.state))return void this.ys();const r=e,h=s;e=300,s=1,t=performance.now();const o=this.Ne[i];if(0===o?(e=r,s=h):t>o&&(e=2560*this.De/(t-o)|0),e<25?e=25:e>256&&(e=256,s=this.De-(t-o)/10|0),this.Ne[i]=t,i=(i+1)%10,s>1)for(let t=0;t<10;t++)0!==this.Ne[t]&&(this.Ne[t]+=s);for(s0&&(this.Be=1e3*e/(256*this.De)|0);const l=performance.now();if(this.Ge&&this.refresh(),await this.draw(),this.Pe[this.Ue]=(performance.now()-l)/1e3,this.Ue=(this.Ue+1)%this.Pe.length,this.Ye<50){const i=1e3/this.Ye-(performance.now()-t);i>0&&await E(i)}}-1===this.state&&this.ys()};ys=()=>{this.state=-2,this.zi()};As=t=>{this.De=1e3/t|0};ps=t=>{this.Ye=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.De|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};zi=()=>{};draw=async()=>{};refresh=()=>{};async ws(t,i){const e=this.width,s=this.height;this.Ge&&(p.fillStyle='black',p.fillRect(0,0,e,s),this.Ge=!1);const n=s/2-18;p.fillStyle='rgb(140, 17, 17)',p.rect((e/2|0)-152,n,304,34),p.fillRect((e/2|0)-150,n+2,3*t,30),p.fillStyle='black',p.fillRect((e/2|0)-150+3*t,n+2,300-3*t,30),p.font='bold 13px helvetica, sans-serif',p.textAlign='center',p.fillStyle='white',p.fillText(i,e/2|0,n+22),await E(5)}_s=()=>{let t=-1;return this.ts!==this.Qe&&(t=this.$e[this.Qe],this.Qe=this.Qe+1&127),t};get ms(){const t=this.Pe.length;let i=0;for(let e=0;ethis.Se&&(this.Se=e),this.xe[this.Me]=e,this.Me=(this.Me+1)%250,e}get Is(){return this.xe.reduce(((t,i)=>t+i),0)/250}onkeydown=t=>{const i=t.key;B.includes(i)&&t.preventDefault(),this.Ve=0;const e=N[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;t.ctrlKey&&(n>='A'.charCodeAt(0)&&n<=']'.charCodeAt(0)||n=='_'.charCodeAt(0)?n-='A'.charCodeAt(0)-1:n>='a'.charCodeAt(0)&&n<='z'.charCodeAt(0)&&(n-='a'.charCodeAt(0)-1)),n<30&&(n=0),s===N.ArrowLeft.code?n=1:s===N.ArrowRight.code?n=2:s===N.ArrowUp.code?n=3:s===N.ArrowDown.code?n=4:s===N.Control.code?n=5:s===N.Shift.code?n=6:s===N.Alt.code?n=7:s===N.Backspace.code||s===N.Delete.code?n=8:s===N.Tab.code?n=9:s===N.Enter.code?n=10:s>=N.F1.code&&s<=N.F12.code?n=s+1008-N.F1.code:s===N.Home.code?n=1e3:s===N.End.code?n=1001:s===N.PageUp.code?n=1002:s===N.PageDown.code&&(n=1003),n>0&&n<128&&(this.Je[n]=1),n>4&&(this.$e[this.ts]=n,this.ts=this.ts+1&127),U.enabled&&U.Te(n)};onkeyup=t=>{const i=t.key;B.includes(i)&&t.preventDefault(),this.Ve=0;const e=N[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;n<30&&(n=0),s===N.ArrowLeft.code?n=1:s===N.ArrowRight.code?n=2:s===N.ArrowUp.code?n=3:s===N.ArrowDown.code?n=4:s===N.Control.code?n=5:s===N.Shift.code?n=6:s===N.Alt.code?n=7:s===N.Backspace.code||s===N.Delete.code?n=8:s===N.Tab.code?n=9:s===N.Enter.code?n=10:s>=N.F1.code&&s<=N.F12.code?n=s+1008-N.F1.code:s===N.Home.code?n=1e3:s===N.End.code?n=1001:s===N.PageUp.code?n=1002:s===N.PageDown.code&&(n=1003),n>0&&n<128&&(this.Je[n]=0),U.enabled&&U.be(n)};onmousedown=t=>{if(this.es=!1,(t.clientX>0||t.clientY>0)&&this.gs(t),this.Ve=0,this.Ze=this.Xe,this.qe=this.je,this.ds&&!this.Cs){if(this.Es()||this.Ts()||this.bs())return this.ze=1,void(this.Ke=1);t.timeStamp>=this.time+500?(this.ze=2,this.Ke=2):(this.ze=1,this.Ke=1)}else 2===t.button?(this.ze=2,this.Ke=2):(this.ze=1,this.Ke=1);U.enabled&&U.Ie(this.Ze,this.qe,t.buttons)};onmouseup=t=>{this.gs(t),this.Ve=0,this.Ke=0,U.enabled&&U.Ce(t.buttons)};onmouseenter=t=>{this.gs(t),U.enabled&&U.ve()};onmouseleave=t=>{this.gs(t),this.Ve=0,this.Xe=-1,this.je=-1,this.Ke=0,this.Ze=-1,this.qe=-1,U.enabled&&U.Le()};onmousemove=t=>{this.gs(t),this.Ve=0,U.enabled&&U.Ee(this.Xe,this.je)};onfocus=t=>{this.hasFocus=!0,this.Ge=!0,this.refresh(),U.enabled&&U.Re()};onblur=t=>{this.hasFocus=!1,U.enabled&&U.Oe()};ontouchstart=t=>{if(!this.ds)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.es=!0;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.rs=this.cs=this.os=0|i.screenX,this.hs=this.fs=this.ls=0|i.screenY,this.time=t.timeStamp,this.ss=this.Rs(),this.ns=this.Os()};ontouchend=t=>{if(!this.ds||!this.es)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;if(this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.cs=0|i.screenX,this.fs=0|i.screenY,this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.ss&&!this.Rs())return void(this.es=!1);if(this.ns&&!this.Os())return void(this.es=!1);if(this.Es()||this.vs()||this.Ts()||this.bs()){null!==this.input&&(this.input.parentNode?.contains(this.input)&&this.input.parentNode?.removeChild(this.input),this.input=null);const t=document.createElement('input');return this.Ts()?(t.setAttribute('id','username'),t.setAttribute('placeholder','Username')):this.bs()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.Es()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.vs()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this.Ls?t.setAttribute('type','password'):t.setAttribute('type',this.bs()?'password':'text'),t.setAttribute('autofocus','autofocus'),t.setAttribute('spellcheck','false'),t.setAttribute('autocomplete','off'),t.setAttribute('style',`position: fixed; left: ${e}px; top: ${s}px; width: 1px; height: 1px; opacity: 0;`),document.body.appendChild(t),t.focus(),t.click(),this.Ls&&(t.oninput=t=>{if(!(t instanceof InputEvent))return;const i=t,e=i.data;null!==e&&'insertText'===i.inputType&&this.onkeydown(new KeyboardEvent('keydown',{key:e,code:e}))}),t.onkeydown=t=>{this.Ls&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this.Ls&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeyup(new KeyboardEvent('keyup',{key:t.key,code:t.key}))},t.onfocus=t=>{this.input?.parentNode?.removeChild(this.input),this.input=null,this.onfocus(t)},this.input=t,void(this.es=!1)}const n=t.timeStamp>=this.time+500,r=Math.abs(this.rs-this.cs)>16||Math.abs(this.hs-this.fs)>16;n&&!r?(this.es=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.Ke=0,this.es=!1)};ontouchmove=t=>{if(!this.ds||!this.es)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.cs=0|i.screenX,this.fs=0|i.screenY,this.ss&&-1===this.Ss()?(this.os-this.cs>0?this.rotate(2):this.os-this.cs<0&&this.rotate(0),this.ls-this.fs>0?this.rotate(3):this.ls-this.fs<0&&this.rotate(1)):(this.ns||-1!==this.Ss())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this.os=this.cs,this.ls=this.fs};get ds(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get Ls(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get Cs(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}Rs=()=>this.He&&this.Xe>=8&&this.Xe<=520&&this.je>=11&&this.je<=345;Es=()=>this.He&&-1===this.xs()&&!this.Ms()&&!this.ks()&&this.Xe>=11&&this.Xe<=506&&this.je>=449&&this.je<=482;vs=()=>this.He&&(this.Ms()||this.ks())&&this.Xe>=11&&this.Xe<=506&&this.je>=383&&this.je<=482;Os=()=>this.He&&this.Xe>=562&&this.Xe<=752&&this.je>=231&&this.je<=492;Ts=()=>!this.He&&2===this.Ds()&&this.Xe>=301&&this.Xe<=562&&this.je>=262&&this.je<=279;bs=()=>!this.He&&2===this.Ds()&&this.Xe>=301&&this.Xe<=562&&this.je>=279&&this.je<=296;rotate=t=>{0===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowLeft',code:'ArrowLeft'}))):1===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowUp',code:'ArrowUp'}))):2===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowRight',code:'ArrowRight'}))):3===t&&(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowDown',code:'ArrowDown'})))};Fs=()=>null!==document.fullscreenElement;gs=t=>{if(this.Fs()){const i=t.target.getBoundingClientRect(),e=window.innerHeight/A.height,s=(window.innerWidth-A.width*e)/2;this.Xe=0|this.Ns(t.clientX-i.left-s,0,A.width*e,0,789),this.je=0|this.Ns(t.clientY-i.top,0,A.height*e,0,532)}else{const i=A.getBoundingClientRect(),e=A.width/i.width,s=A.height/i.height;this.Xe=(t.clientX-i.left)*e|0,this.je=(t.clientY-i.top)*s|0}this.Xe<0&&(this.Xe=0),this.je<0&&(this.je=0),this.Xe>789&&(this.Xe=789),this.je>532&&(this.je=532)};Ns=(t,i,e,s,n)=>(t-i)*(n-s)/(e-i)+s}class G{db;constructor(t){t.onerror=this.onerror,t.onclose=this.onclose,this.db=t}static openDatabase=async()=>await new Promise(((t,i)=>{const e=indexedDB.open('lostcity',1);e.onsuccess=i=>{const e=i.target;console.log('database success!'),t(e.result)},e.onupgradeneeded=t=>{t.target.result.createObjectStore('cache')},e.onerror=t=>{const e=t.target;console.error('database error!: ',e.error),i(e.result)}}));Bs=async t=>await new Promise((i=>{const e=this.db.transaction('cache','readonly').objectStore('cache').get(t);e.onsuccess=()=>{i(e.result)},e.onerror=t=>{i(void 0)}}));Us=async(t,i)=>await new Promise(((e,s)=>{const n=this.db.transaction('cache','readwrite').objectStore('cache').put(i,t);n.onsuccess=()=>{e()},n.onerror=t=>{s()}}));onclose=t=>{console.log('database close!')};onerror=t=>{console.log('database error!')};Ps=t=>{const i=t.trim();let e=0;for(let t=0;t='A'&&s<='Z'?e+=s.charCodeAt(0)+1-65:s>='a'&&s<='z'?e+=s.charCodeAt(0)+1-97:s>='0'&&s<='9'&&(e+=s.charCodeAt(0)+27-48)}return e}}class W{static Ps=t=>{let i=0;t=t.toUpperCase();for(let e=0;e=this.Ws)return null;if(this.Xs[t])return this.Xs[t];const e=this.Ks[t],s=e+this.Vs[t];if(this.Gs){const i=Uint8Array.from(this.buffer.subarray(e,e+s));return this.Xs[t]=i,i}{const e=Uint8Array.from(i.read(this.Hs[t],this.buffer,this.Vs[t],this.Ks[t]));return this.Xs[t]=e,e}}}class Y{static zs=new Uint8Array(520);Zs;qs;store;constructor(t,i,e){this.Zs=new R(t),this.qs=new R(i),this.store=e+1}get Ws(){return this.qs.length/6}read(t,i=!1){this.qs.Xt=6*t;const e=this.qs.Qt;let s=this.qs.Qt;if(s<=0||s>this.Zs.length/520)return null;const n=new Uint8Array(e);let r=0;for(let i=0;r512&&(h=512),this.Zs.ri(h+8,0,Y.zs);const o=(255&Y.zs[0])<<8|255&Y.zs[1],l=(255&Y.zs[2])<<8|255&Y.zs[3],a=(255&Y.zs[4])<<16|(255&Y.zs[5])<<8|255&Y.zs[6],c=255&Y.zs[7];if(o!==t||l!==i||c!==this.store)return null;if(a<0||a>this.Zs.length/520)return null;for(let t=0;t>>0;if(h.nt(e,a),4294967295===s){const t=h.$s(),i=h.Qs(),e=new Uint8Array(h.memory.buffer,t,i),s=(new TextDecoder).decode(e);throw new l(s)}const n=h.buffer()>>>0;return new Uint8Array(h.memory.buffer,n,s)}(n)}}class H{static tn=[];static en=t=>{const i=new R(t.read('base_head.dat')),e=new R(t.read('base_type.dat')),s=new R(t.read('base_label.dat')),n=i.Jt;i.Xt+=2;for(let t=0;t{const i=new R(t.read('frame_head.dat')),e=new R(t.read('frame_tran1.dat')),s=new R(t.read('frame_tran2.dat')),n=new R(t.read('frame_del.dat')),r=i.Jt;i.Xt+=2;const h=new Int32Array(500),o=new Int32Array(500),l=new Int32Array(500),a=new Int32Array(500);for(let t=0;t0){if(0!==f.types[t])for(let i=t-1;i>d;i--)if(0===f.types[i]){h[w]=i,o[w]=0,l[w]=0,a[w]=0,w++;break}h[w]=t;let e=0;3===f.types[h[w]]&&(e=128),o[w]=1&i?s.ei:e,l[w]=2&i?s.ei:e,a[w]=4&i?s.ei:e,d=t,w++}}r.length=w,r.nn=new Int32Array(w),r.x=new Int32Array(w),r.y=new Int32Array(w),r.z=new Int32Array(w);for(let t=0;t>7)<2?i=2:i>126&&(i=126),(65408&t)+i):(i<0?i=0:i>127&&(i=127),127-i)}static lr=(t,i,e)=>{const s=t.rn,n=t.hn,r=t.ln;let h,o,l,a,c;if(i){h=new Int32Array(s);for(let i=0;i{const n=t.rn,r=t.hn,h=t.ln;let o,l,a,c,f;if(s)o=t.Ar,l=t.ar,a=t.pr;else{o=new Int32Array(n),l=new Int32Array(n),a=new Int32Array(n);for(let i=0;i{const e=t.rn,s=t.hn,n=t.ln,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e);for(let i=0;i{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,l=0,a=-1;for(let c=0;c{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,l=0,a=-1;for(let c=0;c{let o=-1;const l=t.Ar[i],a=t.ar[i],c=t.pr[i];for(let t=0;t{if(!j.metadata)throw new Error('cant loading model metadata!!!!!');const i=j.metadata[t];if(!i)throw console.log(`Error model:${t} not found!`),new Error('cant loading model metadata!!!!!');if(!(j.head&&j.Cn&&j.En&&j.Tn&&j.bn&&j.Rn&&j.On&&j.vn&&j.Ln&&j.Sn&&j.xn&&j.Mn&&j.kn&&j.axis))throw new Error('cant loading model!!!!!');const e=i.rn,s=i.hn,n=i.ln,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e),l=new Int32Array(s),a=new Int32Array(s),c=new Int32Array(s),f=new Int32Array(n),u=new Int32Array(n),d=new Int32Array(n);let w=null;i.dn>=0&&(w=new Int32Array(e));let y=null;i.An>=0&&(y=new Int32Array(s));let m=null,A=0;i.pn>=0?m=new Int32Array(s):A=-i.pn-1;let p=null;i._n>=0&&(p=new Int32Array(s));let _=null;i.In>=0&&(_=new Int32Array(s));const I=new Int32Array(s);j.On.Xt=i.an,j.vn.Xt=i.cn,j.Ln.Xt=i.fn,j.Sn.Xt=i.un,j.xn.Xt=i.dn;let g,C,E,T=0,b=0,R=0;for(let t=0;t{if(!j.metadata||!j.metadata[i])throw new Error('No model metadata');const e=j.metadata[i];if(e.data=t,!e.data.length)throw new Error('No model data');const s=e.rn,n=e.hn,r=e.ln,h=new Int32Array(s),o=new Int32Array(s),l=new Int32Array(s),a=new Int32Array(n),c=new Int32Array(n),f=new Int32Array(n),u=new Int32Array(r),d=new Int32Array(r),w=new Int32Array(r);let y=null;e.dn>=0&&(y=new Int32Array(s));let m=null;e.An>=0&&(m=new Int32Array(n));let A=null,p=0;e.pn>=0?A=new Int32Array(n):p=-e.pn-1;let _=null;e._n>=0&&(_=new Int32Array(n));let I=null;e.In>=0&&(I=new Int32Array(n));const g=new Int32Array(n),C=new R(e.data);C.Xt=e.an;const E=new R(e.data);E.Xt=e.cn;const T=new R(e.data);T.Xt=e.fn;const b=new R(e.data);b.Xt=e.un;const O=new R(e.data);O.Xt=e.dn;let v,L,S,x=0,M=0,k=0;for(let t=0;tthis.Fr&&(this.Fr=-e),e>this.Dr&&(this.Dr=e);const n=i*i+s*s;n>this.kr&&(this.kr=n)}this.kr=Math.sqrt(this.kr)+.99|0,this.Br=Math.sqrt(this.kr*this.kr+this.Fr*this.Fr)+.99|0,this.Nr=this.Br+(Math.sqrt(this.kr*this.kr+this.Dr*this.Dr)+.99|0)}$r(){this.Fr=0,this.Dr=0;for(let t=0;tthis.Fr&&(this.Fr=-i),i>this.Dr&&(this.Dr=i)}this.Br=Math.sqrt(this.kr*this.kr+this.Fr*this.Fr)+.99|0,this.Nr=this.Br+(Math.sqrt(this.kr*this.kr+this.Dr*this.Dr)+.99|0)}Qr(){if(this.Pr){const t=new Int32Array(256);let i=0;for(let e=0;ei&&(i=s)}this.Yr=new v(i+1,null);for(let e=0;e<=i;e++)this.Yr[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;ei&&(i=s)}this.Hr=new v(i+1,null);for(let e=0;e<=i;e++)this.Hr[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;eo;)o=e[h++];r&&r.types&&s.x&&s.y&&s.z&&r.labels&&(i!==o||0===r.types[i])&&this.ih(s.x[t],s.y[t],s.z[t],r.labels[i],r.types[i])}j.$n=0,j.Qn=0,j.tr=0,h=0,o=e[h++];for(let t=0;to;)o=e[h++];r&&r.types&&n.x&&n.y&&n.z&&r.labels&&(i===o||0===r.types[i])&&this.ih(n.x[t],n.y[t],n.z[t],r.labels[i],r.types[i])}}else this.eh(t)}eh(t){if(!this.Yr||-1===t||!V.tn[t])return;const i=V.tn[t],e=i.sn;j.$n=0,j.Qn=0,j.tr=0;for(let t=0;t>16;this.pr[t]=this.ar[t]*i+this.pr[t]*e>>16,this.ar[t]=s}}translate(t,i,e){for(let s=0;s>8;if(this.cr&&this.ur&&this.dr||(this.cr=new Int32Array(this.hn),this.ur=new Int32Array(this.hn),this.dr=new Int32Array(this.hn)),!this.yr){this.yr=new v(this.rn,null);for(let t=0;t8192||m>8192||A>8192||y<-8192||m<-8192||A<-8192;)y>>=1,m>>=1,A>>=1;let p=0|Math.sqrt(y*y+m*m+A*A);if(p<=0&&(p=1),y=256*y/p|0,m=256*m/p|0,A=256*A/p|0,this.wr&&1&this.wr[i]){const r=t+((e*y+s*m+n*A)/(h+(h/2|0))|0);this.Tr&&(this.cr[i]=j.hr(this.Tr[i],r,this.wr[i]))}else{let t=this.yr[r];t&&(t.x+=y,t.y+=m,t.z+=A,t.w++),t=this.yr[o],t&&(t.x+=y,t.y+=m,t.z+=A,t.w++),t=this.yr[l],t&&(t.x+=y,t.y+=m,t.z+=A,t.w++)}}if(r)this.lh(t,h,e,s,n);else{this.mr=new v(this.rn,null);for(let t=0;t>16;for(let s=0;s>16,p=p*u-A*f>>16,A=m),0!==t&&(m=p*l-_*o>>16,_=p*o+_*l>>16,p=m),0!==i&&(m=_*a+A*c>>16,_=_*c-A*a>>16,A=m),A+=n,p+=r,_+=h,m=p*w-_*d>>16,_=p*d+_*w>>16,p=m,j.Nn&&j.Bn&&j.Un&&(j.Un[s]=_-y,j.Nn[s]=F.Fi+((A<<9)/_|0),j.Bn[s]=F.Ni+((p<<9)/_|0)),this.ln>0&&j.Pn&&j.Gn&&j.Wn&&(j.Pn[s]=A,j.Gn[s]=p,j.Wn[s]=_)}try{this.uh(!1,!1,0)}catch(t){}}draw(t,i,e,s,n,r,h,o,l){const a=o*n-r*s>>16,c=h*i+a*e>>16,f=this.kr*e>>16,u=c+f;if(u<=50||c>=3500)return;const d=o*s+r*n>>16;let w=d-this.kr<<9;if((w/u|0)>=m.yt)return;let y=d+this.kr<<9;if((y/u|0)<=-m.yt)return;const A=h*e-a*i>>16,p=this.kr*i>>16;let _=A+p<<9;if((_/u|0)<=-m.At)return;let I=A-(p+(this.Fr*e>>16))<<9;if((I/u|0)>=m.At)return;let g=c-(f+(this.Fr*i>>16))<=50,C=!1;if(l>0&&j.ir){let t=c-f;t<=50&&(t=50),d>0?(w=w/u|0,y=y/t|0):(y=y/u|0,w=w/t|0),A>0?(I=I/u|0,_=_/t|0):(_=_/u|0,I=I/t|0);const i=j.Xe-F.Fi,e=j.je-F.Ni;i>w&&iI&&e<_&&(this.Zr?j.sr[j.er++]=l:C=!0)}const E=F.Fi,T=F.Ni;let b=0,R=0;0!==t&&(b=F.sin[t],R=F.cos[t]);for(let l=0;l>16,d=d*R-f*b>>16,f=a),f+=r,u+=h,d+=o,a=d*s+f*n>>16,d=d*n-f*s>>16,f=a,a=u*e-d*i>>16,d=u*i+d*e>>16,u=a,j.Un&&(j.Un[l]=d-c),d>=50&&j.Nn&&j.Bn?(j.Nn[l]=E+((f<<9)/d|0),j.Bn[l]=T+((u<<9)/d|0)):j.Nn&&(j.Nn[l]=-5e3,g=!0),(g||this.ln>0)&&j.Pn&&j.Gn&&j.Wn&&(j.Pn[l]=f,j.Gn[l]=u,j.Wn[l]=d)}try{this.uh(g,C,l)}catch(t){}}uh(t,i,e,s=!1){j.nr&&(this.qr=-1,this.Jr=-1);for(let t=0;tm.wt||l>m.wt||a>m.wt),j.Hn&&j.Yn){const t=((d+w+y)/3|0)+this.Br;j.Hn[t][j.Yn[t]++]=s,j.nr&&this.dh(j.Xe,j.je,c,f,u,o,l,a)&&this.Jr=0;t--){const i=j.Yn[t];if(!(i<=0)&&j.Hn){const e=j.Hn[t];for(let t=0;t=0;t--){const i=j.Yn[t];if(i>0&&j.Hn){const e=j.Hn[t];for(let s=0;s0||j.Vn[2]>0)&&(n=(j.zn[1]+j.zn[2])/(j.Vn[1]+j.Vn[2])|0);let r=0;j.Vn&&j.zn&&(j.Vn[3]>0||j.Vn[4]>0)&&(r=(j.zn[3]+j.zn[4])/(j.Vn[3]+j.Vn[4])|0);let h=0;if(j.Vn&&j.zn&&(j.Vn[6]>0||j.Vn[8]>0)&&(h=(j.zn[6]+j.zn[8])/(j.Vn[6]+j.Vn[8])|0),j.Vn&&j.Kn){let t,i=0,e=j.Vn[10],o=j.Kn[10],l=j.Xn;i===e&&(i=0,e=j.Vn[11],o=j.Kn[11],l=j.jn),t=in;)this.wh(o[i++],s),i===e&&o!==j.Kn[11]&&(i=0,e=j.Vn[11],o=j.Kn[11],l=j.jn),t=ir;)this.wh(o[i++],s),i===e&&o!==j.Kn[11]&&(i=0,e=j.Vn[11],o=j.Kn[11],l=j.jn),t=ih;)this.wh(o[i++],s),i===e&&o!==j.Kn[11]&&(i=0,e=j.Vn[11],o=j.Kn[11],l=j.jn),t=i>2,r=this.br[i],h=this.Rr[i],o=this.Or[i];F.le(j.Nn[e],j.Nn[s],j.Nn[n],j.Bn[e],j.Bn[s],j.Bn[n],this.cr[t],this.ur[t],this.dr[t],j.Pn[r],j.Gn[r],j.Wn[r],j.Pn[h],j.Pn[o],j.Gn[h],j.Gn[o],j.Wn[h],j.Wn[o],this.Tr[t])}else if(3===r&&this.wr&&this.Tr&&this.cr&&j.Nn&&j.Bn&&j.Pn&&j.Gn&&j.Wn){const i=this.wr[t]>>2,r=this.br[i],h=this.Rr[i],o=this.Or[i];F.le(j.Nn[e],j.Nn[s],j.Nn[n],j.Bn[e],j.Bn[s],j.Bn[n],this.cr[t],this.cr[t],this.cr[t],j.Pn[r],j.Gn[r],j.Wn[r],j.Pn[h],j.Pn[o],j.Gn[h],j.Gn[o],j.Wn[h],j.Wn[o],this.Tr[t])}}yh(t,i=!1){let e=0;if(j.Wn){const i=F.Fi,s=F.Ni,n=this._r[t],r=this.Ir[t],h=this.gr[t],o=j.Wn[n],l=j.Wn[r],a=j.Wn[h];if(o>=50&&j.Nn&&j.Bn&&this.cr)j.Zn[e]=j.Nn[n],j.qn[e]=j.Bn[n],j.Jn[e++]=this.cr[t];else if(j.Pn&&j.Gn&&this.cr){const c=j.Pn[n],f=j.Gn[n],u=this.cr[t];if(a>=50&&this.dr){const n=(50-o)*F.xi[a-o];j.Zn[e]=i+((c+((j.Pn[h]-c)*n>>16)<<9)/50|0),j.qn[e]=s+((f+((j.Gn[h]-f)*n>>16)<<9)/50|0),j.Jn[e++]=u+((this.dr[t]-u)*n>>16)}if(l>=50&&this.ur){const n=(50-o)*F.xi[l-o];j.Zn[e]=i+((c+((j.Pn[r]-c)*n>>16)<<9)/50|0),j.qn[e]=s+((f+((j.Gn[r]-f)*n>>16)<<9)/50|0),j.Jn[e++]=u+((this.ur[t]-u)*n>>16)}}if(l>=50&&j.Nn&&j.Bn&&this.ur)j.Zn[e]=j.Nn[r],j.qn[e]=j.Bn[r],j.Jn[e++]=this.ur[t];else if(j.Pn&&j.Gn&&this.ur){const c=j.Pn[r],f=j.Gn[r],u=this.ur[t];if(o>=50&&this.cr){const r=(50-l)*F.xi[o-l];j.Zn[e]=i+((c+((j.Pn[n]-c)*r>>16)<<9)/50|0),j.qn[e]=s+((f+((j.Gn[n]-f)*r>>16)<<9)/50|0),j.Jn[e++]=u+((this.cr[t]-u)*r>>16)}if(a>=50&&this.dr){const n=(50-l)*F.xi[a-l];j.Zn[e]=i+((c+((j.Pn[h]-c)*n>>16)<<9)/50|0),j.qn[e]=s+((f+((j.Gn[h]-f)*n>>16)<<9)/50|0),j.Jn[e++]=u+((this.dr[t]-u)*n>>16)}}if(a>=50&&j.Nn&&j.Bn&&this.dr)j.Zn[e]=j.Nn[h],j.qn[e]=j.Bn[h],j.Jn[e++]=this.dr[t];else if(j.Pn&&j.Gn&&this.dr){const c=j.Pn[h],f=j.Gn[h],u=this.dr[t];if(l>=50&&this.ur){const n=(50-a)*F.xi[l-a];j.Zn[e]=i+((c+((j.Pn[r]-c)*n>>16)<<9)/50|0),j.qn[e]=s+((f+((j.Gn[r]-f)*n>>16)<<9)/50|0),j.Jn[e++]=u+((this.ur[t]-u)*n>>16)}if(o>=50&&this.cr){const r=(50-a)*F.xi[o-a];j.Zn[e]=i+((c+((j.Pn[n]-c)*r>>16)<<9)/50|0),j.qn[e]=s+((f+((j.Gn[n]-f)*r>>16)<<9)/50|0),j.Jn[e++]=u+((this.cr[t]-u)*r>>16)}}}const s=j.Zn[0],n=j.Zn[1],r=j.Zn[2],h=j.qn[0],o=j.qn[1],l=j.qn[2];if(!((s-n)*(l-o)-(h-o)*(r-n)<=0))if(F.Ui=!1,3===e){let e;if((s<0||n<0||r<0||s>m.wt||n>m.wt||r>m.wt)&&(F.Ui=!0),e=this.wr?3&this.wr[t]:0,i)F.Tt(s,n,h,o,j.Jn[0]),F.Tt(n,r,o,l,j.Jn[1]),F.Tt(r,s,l,h,j.Jn[2]);else if(0===e)F.ne(s,n,r,h,o,l,j.Jn[0],j.Jn[1],j.Jn[2]);else if(1===e&&this.cr)F.he(s,n,r,h,o,l,F.palette[this.cr[t]]);else if(2===e&&this.wr&&this.Tr&&j.Pn&&j.Gn&&j.Wn){const i=this.wr[t]>>2,e=this.br[i],a=this.Rr[i],c=this.Or[i];F.le(s,n,r,h,o,l,j.Jn[0],j.Jn[1],j.Jn[2],j.Pn[e],j.Gn[e],j.Wn[e],j.Pn[a],j.Pn[c],j.Gn[a],j.Gn[c],j.Wn[a],j.Wn[c],this.Tr[t])}else if(3===e&&this.wr&&this.Tr&&this.cr&&j.Pn&&j.Gn&&j.Wn){const i=this.wr[t]>>2,e=this.br[i],a=this.Rr[i],c=this.Or[i];F.le(s,n,r,h,o,l,this.cr[t],this.cr[t],this.cr[t],j.Pn[e],j.Gn[e],j.Wn[e],j.Pn[a],j.Pn[c],j.Gn[a],j.Gn[c],j.Wn[a],j.Wn[c],this.Tr[t])}}else if(4===e){let e;if((s<0||n<0||r<0||s>m.wt||n>m.wt||r>m.wt||j.Zn[3]<0||j.Zn[3]>m.wt)&&(F.Ui=!0),e=this.wr?3&this.wr[t]:0,i)F.Tt(s,n,h,o,j.Jn[0]),F.Tt(n,r,o,l,j.Jn[1]),F.Tt(r,j.Zn[3],l,j.qn[3],j.Jn[2]),F.Tt(j.Zn[3],s,j.qn[3],h,j.Jn[3]);else if(0===e)F.ne(s,n,r,h,o,l,j.Jn[0],j.Jn[1],j.Jn[2]),F.ne(s,r,j.Zn[3],h,l,j.qn[3],j.Jn[0],j.Jn[2],j.Jn[3]);else if(1===e){if(this.cr){const i=F.palette[this.cr[t]];F.he(s,n,r,h,o,l,i),F.he(s,r,j.Zn[3],h,l,j.qn[3],i)}}else if(2===e&&this.wr&&this.Tr&&j.Pn&&j.Gn&&j.Wn){const i=this.wr[t]>>2,e=this.br[i],a=this.Rr[i],c=this.Or[i];F.le(s,n,r,h,o,l,j.Jn[0],j.Jn[1],j.Jn[2],j.Pn[e],j.Gn[e],j.Wn[e],j.Pn[a],j.Pn[c],j.Gn[a],j.Gn[c],j.Wn[a],j.Wn[c],this.Tr[t]),F.le(s,r,j.Zn[3],h,l,j.qn[3],j.Jn[0],j.Jn[2],j.Jn[3],j.Pn[e],j.Gn[e],j.Wn[e],j.Pn[a],j.Pn[c],j.Gn[a],j.Gn[c],j.Wn[a],j.Wn[c],this.Tr[t])}else if(3===e&&this.wr&&this.Tr&&this.cr&&j.Pn&&j.Gn&&j.Wn){const i=this.wr[t]>>2,e=this.br[i],a=this.Rr[i],c=this.Or[i];F.le(s,n,r,h,o,l,this.cr[t],this.cr[t],this.cr[t],j.Pn[e],j.Gn[e],j.Wn[e],j.Pn[a],j.Pn[c],j.Gn[a],j.Gn[c],j.Wn[a],j.Wn[c],this.Tr[t]),F.le(s,r,j.Zn[3],h,l,j.qn[3],this.cr[t],this.cr[t],this.cr[t],j.Pn[e],j.Gn[e],j.Wn[e],j.Pn[a],j.Pn[c],j.Gn[a],j.Gn[c],j.Wn[a],j.Wn[c],this.Tr[t])}}}ih(t,i,e,s,n){if(!s)return;const r=s.length;if(0===n){let n=0;j.$n=0,j.Qn=0,j.tr=0;for(let t=0;t0?(j.$n=(j.$n/n|0)+t,j.Qn=(j.Qn/n|0)+i,j.tr=(j.tr/n|0)+e):(j.$n=t,j.Qn=i,j.tr=e)}else if(1===n)for(let n=0;n=this.Yr.length)continue;const h=this.Yr[r];if(h)for(let s=0;s=this.Yr.length)continue;const h=this.Yr[r];if(h)for(let s=0;s>16;this.ar[n]=this.ar[n]*c-this.Ar[n]*a>>16,this.Ar[n]=t}if(0!==r){a=F.sin[r],c=F.cos[r];const t=this.ar[n]*c-this.pr[n]*a>>16;this.pr[n]=this.ar[n]*a+this.pr[n]*c>>16,this.ar[n]=t}if(0!==o){a=F.sin[o],c=F.cos[o];const t=this.pr[n]*a+this.Ar[n]*c>>16;this.pr[n]=this.pr[n]*c-this.Ar[n]*a>>16,this.Ar[n]=t}this.Ar[n]+=j.$n,this.ar[n]+=j.Qn,this.pr[n]+=j.tr}}else if(3===n)for(let n=0;n=this.Yr.length)continue;const h=this.Yr[r];if(h)for(let s=0;s=this.Hr.length)continue;const n=this.Hr[e];if(n)for(let i=0;i255&&(this.Er[e]=255)}}}ah(){this.Fr=0,this.kr=0,this.Dr=0,this.vr=999999,this.Lr=-999999,this.Mr=-99999,this.Sr=99999;for(let t=0;tthis.Lr&&(this.Lr=i),sthis.Mr&&(this.Mr=s),-e>this.Fr&&(this.Fr=-e),e>this.Dr&&(this.Dr=e);const n=i*i+s*s;n>this.kr&&(this.kr=n)}this.kr=0|Math.sqrt(this.kr),this.Br=0|Math.sqrt(this.kr*this.kr+this.Fr*this.Fr),this.Nr=this.Br+(0|Math.sqrt(this.kr*this.kr+this.Dr*this.Dr))}dh(t,i,e,s,n,r,h,o){return!(ie&&i>s&&i>n)&&(!(t{const e=t.read(i+'.dat');if(!e)throw new Error(`${i} jpeg not found!`);const s=await(async t=>{255!==t[0]&&(t[0]=255),URL.revokeObjectURL(I.src),I.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>I.onload=()=>t())),g.clearRect(0,0,_.width,_.height);const i=I.naturalWidth,e=I.naturalHeight;return _.width=i,_.height=e,g.drawImage(I,0,0),g.getImageData(0,0,i,e)})(e),n=new J(s.width,s.height),r=new Uint32Array(s.data.buffer),h=n.ft;for(let t=0;t>24&255)<<24|(255&i)<<16|(i>>8&255)<<8|i>>16&255}return n};static Ci=(t,i,e=0)=>{const s=new R(t.read(i+'.dat')),n=new R(t.read('index.dat'));n.Xt=s.Jt;const r=n.Jt,h=n.Jt,o=[],l=n.Zt-1;for(let t=0;ts.length||n.Xt>n.length)throw new Error;const a=n.Zt,c=n.Zt,f=n.Jt,u=n.Jt,d=new J(f,u);d.pi=a,d._i=c,d.Ii=r,d.gi=h;const w=n.Zt;if(0===w){const t=d.width*d.height;for(let i=0;im.bottom&&(n-=i+n-m.bottom),tm.right){const i=t+r-m.right;r-=i,o+=i,h+=i}r>0&&n>0&&this.Ch(r,n,this.ft,s,o,m.ft,e,h)}Eh(t,i,e){i|=0,e|=0;let s=(i+=this.pi)+(e+=this._i)*m.ut,n=0,r=this.height,h=this.width,o=m.ut-h,l=0;if(em.bottom&&(r-=e+r-m.bottom),im.right){const t=i+h-m.right;h-=t,l+=t,o+=t}h>0&&r>0&&this.Th(h,r,this.ft,n,l,m.ft,s,o,t)}bh(t,i){t|=0,i|=0;let e=(t+=this.pi)+(i+=this._i)*m.ut,s=0,n=this.height,r=this.width,h=m.ut-r,o=0;if(im.bottom&&(n-=i+n-m.bottom),tm.right){const i=t+r-m.right;r-=i,o+=i,h+=i}r>0&&n>0&&this.Rh(r,n,this.ft,s,o,m.ft,e,h)}Ti(){const t=this.ft,i=this.width,e=this.height;for(let s=0;s>16&255;r+=t,r<1?r=1:r>255&&(r=255);let h=n>>8&255;h+=i,h<1?h=1:h>255&&(h=255);let o=255&n;o+=e,o<1?o=1:o>255&&(o=255),this.ft[s]=(r<<16)+(h<<8)+o}}}Oi(t,i,e,s){t|=0,i|=0,e|=0,s|=0;try{const n=this.width;let r=0,h=0;const o=this.Ii,l=this.gi,a=(o<<16)/e|0,c=(l<<16)/s|0;t+=(this.pi*e+o-1)/o|0,i+=(this._i*s+l-1)/l|0,this.pi*e%o!=0&&(r=(o-this.pi*e%o<<16)/e|0),this._i*s%l!=0&&(h=(l-this._i*s%l<<16)/s|0),e=e*(this.width-(r>>16))/o|0,s=s*(this.height-(h>>16))/l|0;let f=t+i*m.ut,u=m.ut-e;if(im.bottom&&(s-=i+s-m.bottom),tm.right){const i=t+e-m.right;e-=i,u+=i}this.scale(e,s,this.ft,r,h,m.ft,u,f,n,a,c)}catch(t){console.error('error in sprite clipping routine')}}Oh(t,i,e,s,n,r,h,o,l,a){t|=0,i|=0,e|=0,s|=0;try{const c=-e/2|0,f=-s/2|0,u=65536*Math.sin(l/326.11)|0,d=65536*Math.cos(l/326.11)|0,w=u*a>>8,y=d*a>>8;let A=(h<<16)+f*w+c*y,p=f*y-c*w+(o<<16),_=t+i*m.ut;for(let t=0;t>16)+(h>>16)*this.width],s+=y,h-=w;A+=w,p+=y,_+=m.ut}}catch(t){}}Lh(t,i,e){t|=0,i|=0;let s=(t+=this.pi)+(i+=this._i)*m.ut,n=0,r=this.height,h=this.width,o=m.ut-h,l=0;if(im.bottom&&(r-=i+r-m.bottom),tm.right){const i=t+h-m.right;h-=i,l+=i,o+=i}h>0&&r>0&&this.Sh(h,r,this.ft,l,n,m.ft,s,o,e.ft)}scale(t,i,e,s,n,r,h,o,l,a,c){try{const f=s;for(let u=-i;u<0;u++){const i=(n>>16)*l;for(let n=-t;n<0;n++){const t=e[(s>>16)+i];0===t?o++:r[o++]=t,s+=a}n+=c,s=f,o+=h}}catch(t){console.error('error in plot_scale')}}Rh(t,i,e,s,n,r,h,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++)r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++];for(let i=t;i<0;i++)r[h++]=e[s++];h+=o,s+=n}}Th(t,i,e,s,n,r,h,o,l){const a=256-l;for(let c=-i;c<0;c++){for(let i=-t;i<0;i++){const t=e[s++];if(0===t)h++;else{const i=r[h];r[h++]=((16711935&t)*l+(16711935&i)*a&4278255360)+((65280&t)*l+(65280&i)*a&16711680)>>8}}h+=o,s+=n}}Ch(t,i,e,s,n,r,h,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=e[s++];0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=t}h+=o,s+=n}}Sh(t,i,e,s,n,r,h,o,l){const a=-(t>>2);t=-(3&t);for(let c=-i;c<0;c++){for(let t=a;t<0;t++){let t=e[n++];0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++}for(let i=t;i<0;i++){const t=e[n++];0!==t&&0===l[h]?r[h++]=t:h++}h+=o,n+=s}}}class ${static xh=['_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9'];static Mh=t=>{t=t.trim();let i=0n;for(let e=0;e=65&&s<=90?i+=BigInt(s+1-65):s>=97&&s<=122?i+=BigInt(s+1-97):s>=48&&s<=57&&(i+=BigInt(s+27-48))}return i};static kh=t=>{if(t<0n||t>=6582952005840035281n)return'invalid_name';if(t%37n===0n)return'invalid_name';let i=0;const e=Array(12);for(;0n!==t;){const s=t;t/=37n,e[11-i++]=this.xh[Number(s-37n*t)]}return e.slice(12-i).join('')};static Dh=t=>{const i=[...t.toLowerCase()];let e=!0;for(let t=0;t='a'&&s<='z'&&(i[t]=s.toUpperCase(),e=!1),'.'!==s&&'!'!==s||(e=!0)}return i.join('')};static Fh=t=>{let i='';for(let e=0;e(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static Bh=t=>{if(0===t.length)return t;const i=[...t];for(let t=0;t='a'&&i[t+1]<='z'&&(i[t+1]=String.fromCharCode(i[t+1].charCodeAt(0)+'A'.charCodeAt(0)-97)));return i[0]>='a'&&i[0]<='z'&&(i[0]=String.fromCharCode(i[0].charCodeAt(0)+'A'.charCodeAt(0)-97)),i.join('')};static Uh=t=>{const i=t.toUpperCase();let e=0n;for(let t=0;t>56n)&0xffffffffffffffn;return e}}class Q{static tn=[];static Ph=null;static Gh=null;static Wh=0;static Yh=1;static Hh=2;static Vh=3;static Kh=4;static Xh=5;static jh=6;static zh=7;static Zh=1;static qh=2;static Jh=3;static $h=4;static Qh=5;static io=6;static eo=1;static so=100;static no=101;static ro=200;static ho=201;static oo=202;static lo=203;static ao=205;static co=300;static fo=301;static uo=302;static do=303;static wo=304;static yo=305;static mo=306;static Ao=307;static po=308;static _o=309;static Io=310;static Co=311;static Eo=312;static To=313;static bo=314;static Ro=315;static Oo=316;static vo=317;static Lo=318;static So=319;static xo=320;static Mo=321;static ko=322;static Do=323;static Fo=324;static No=325;static Bo=326;static Uo=327;static Po=401;static Go=500;static Wo=501;static Yo=502;static Ho=503;static Vo=600;static Ko=601;static Xo=602;static jo=603;static zo=604;static Zo=605;static qo=606;static Jo=607;static $o=608;static Qo=609;static tl=610;static il=611;static el=612;static sl=613;static nl=650;static rl=651;static hl=652;static ol=653;static ll=654;static al=655;static en=(t,i,e)=>{this.Ph=new q(5e4),this.Gh=new q(5e4);const s=new R(t.read('data'));let n=-1;for(s.Xt+=2;s.Xt0){r.wl=new Uint8Array(h),r.yl=new Uint16Array(h);for(let t=0;t0){r.scripts=new v(o,null);for(let t=0;t0){const s=e.lastIndexOf(',');r.Ol[t]=this.vl(i,e.substring(0,s),parseInt(e.substring(s+1),10))}}r.Ll=new v(5,null);for(let t=0;t<5;t++){const i=s.ni;r.Ll[t]=i,0===i.length&&(r.Ll[t]=null)}}if(r.type===Q.Vh&&(r.fill=1===s.Zt),r.type===Q.Kh||r.type===Q.Yh){r.Sl=1===s.Zt;const t=s.Zt;e&&(r.font=e[t]),r.xl=1===s.Zt}if(r.type===Q.Kh&&(r.text=s.ni,r.Ml=s.ni),r.type!==Q.Yh&&r.type!==Q.Vh&&r.type!==Q.Kh||(r.kl=s.ti),r.type!==Q.Vh&&r.type!==Q.Kh||(r.Dl=s.ti,r.Fl=s.ti),r.type===Q.Xh){const t=s.ni;if(t.length>0){const e=t.lastIndexOf(',');r.Nl=this.vl(i,t.substring(0,e),parseInt(t.substring(e+1),10))}const e=s.ni;if(e.length>0){const t=e.lastIndexOf(',');r.Bl=this.vl(i,e.substring(0,t),parseInt(e.substring(t+1),10))}}if(r.type===Q.jh){const t=s.Zt;0!==t&&(r.model=this.Ul((t-1<<8)+s.Zt));const i=s.Zt;0!==i&&(r.Pl=this.Ul((i-1<<8)+s.Zt)),r.Gl=s.Zt,0===r.Gl?r.Gl=-1:r.Gl=(r.Gl-1<<8)+s.Zt,r.Wl=s.Zt,0===r.Wl?r.Wl=-1:r.Wl=(r.Wl-1<<8)+s.Zt,r.zoom=s.Jt,r.Yl=s.Jt,r.Hl=s.Jt}if(r.type===Q.zh){r._l=new Int32Array(r.width*r.height),r.Il=new Int32Array(r.width*r.height),r.Sl=1===s.Zt;const t=s.Zt;e&&(r.font=e[t]),r.xl=1===s.Zt,r.kl=s.ti,r.El=s.$t,r.Tl=s.$t,r.gl=1===s.Zt,r.Ll=new v(5,null);for(let t=0;t<5;t++){const i=s.ni;r.Ll[t]=i,0===i.length&&(r.Ll[t]=null)}}r.fl!==Q.qh&&r.type!==Q.Hh||(r.Vl=s.ni,r.action=s.ni,r.Kl=s.Jt),r.fl!==Q.Zh&&r.fl!==Q.$h&&r.fl!==Q.Qh&&r.fl!==Q.io||(r.Xl=s.ni,0===r.Xl.length&&(r.fl===Q.Zh?r.Xl='Ok':r.fl===Q.$h||r.fl===Q.Qh?r.Xl='Select':r.fl===Q.io&&(r.Xl='Continue')))}this.Ph=null,this.Gh=null};static vl=(t,i,e)=>{const s=$.Uh(i)<<8n|BigInt(e);if(this.Ph){const t=this.Ph.get(s);if(t)return t}let n;try{n=J.Ci(t,i,e),this.Ph?.put(s,n)}catch(t){return null}return n};static Ul=t=>{if(this.Gh){const i=this.Gh.get(BigInt(t));if(i)return i}const i=j.model(t);return this.Gh?.put(BigInt(t),i),i};id=-1;cl=-1;type=-1;fl=-1;ul=0;width=0;height=0;dl=-1;wl=null;yl=null;scripts=null;scroll=0;hide=!1;draggable=!1;gl=!1;Cl=!1;El=0;Tl=0;bl=null;Rl=null;Ol=null;Ll=null;fill=!1;Sl=!1;font=null;xl=!1;text=null;Ml=null;kl=0;Dl=0;Fl=0;Nl=null;Bl=null;model=null;Pl=null;Gl=-1;Wl=-1;zoom=0;Yl=0;Hl=0;Vl=null;action=null;Kl=-1;Xl=null;ml=null;Al=null;pl=null;x=0;y=0;jl=0;_l=null;Il=null;zl=0;Zl=0;Ul(t,i,e){let s=this.model;if(e&&(s=this.Pl),!s)return null;if(-1===t&&-1===i&&!s.Tr)return s;const n=j.Ur(s,!0,!0,!1);return-1===t&&-1===i||n.Qr(),-1!==t&&n.eh(t),-1!==i&&n.eh(i),n.oh(64,768,-50,-10,-50,!0),n}ql(){if(this.cl===this.id)return this.x;let t=Q.tn[this.cl];if(!t.ml||!t.Al||!t.pl)return this.x;let i=t.ml.indexOf(this.id);if(-1===i)return this.x;let e=t.Al[i];for(;t.cl!==t.id;){const s=Q.tn[t.cl];s.ml&&s.Al&&s.pl&&(i=s.ml.indexOf(t.id),-1!==i&&(e+=s.Al[i])),t=s}return e}Jl(){if(this.cl===this.id)return this.y;let t=Q.tn[this.cl];if(!t.ml||!t.Al||!t.pl)return this.y;let i=t.ml.indexOf(this.id);if(-1===i)return this.y;let e=t.pl[i];for(;t.cl!==t.id;){const s=Q.tn[t.cl];s.ml&&s.Al&&s.pl&&(i=s.ml.indexOf(t.id),-1!==i&&(e+=s.pl[i])),t=s}return e}outline(t){const i=this.ql(),e=this.Jl();m.gt(i,e,this.width,this.height,t)}move(t,i){if(this.cl===this.id)return;this.x=0,this.y=0;const e=Q.tn[this.cl];if(e.ml&&e.Al&&e.pl){const s=e.ml.indexOf(this.id);-1!==s&&(e.Al[s]=t,e.pl[s]=i)}}delete(){if(this.cl===this.id)return;const t=Q.tn[this.cl];if(t.ml&&t.Al&&t.pl){const i=t.ml.indexOf(this.id);-1!==i&&(t.ml.splice(i,1),t.Al.splice(i,1),t.pl.splice(i,1))}}}var tt,it=(tt="file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/tinymidipcm.mjs",function(t){var i,s,n=void 0!==(t=t||{})?t:{};n.ready=new Promise((function(t,e){i=t,s=e})),["_tsf_load_memory","_tsf_set_output","_tsf_channel_set_bank_preset","_tsf_set_max_voices","_tsf_channel_set_presetnumber","_tsf_reset","_tsf_close","_tml_load_memory","_midi_render","_malloc","_realloc","_free","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(n.ready,t)||Object.defineProperty(n.ready,t,{get:()=>X('You are getting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),set:()=>X('You are setting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js')})}));var r=Object.assign({},n),h=[],o='object'==typeof window,l='function'==typeof importScripts,a='object'==typeof process&&'object'==typeof process.versions&&'string'==typeof process.versions.node,c=!o&&!a&&!l;if(n.ENVIRONMENT)throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');var f,u,d,w='';if(a){if('undefined'==typeof process||!process.release||'node'!==process.release.name)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');var y,m;w=l?require('path').$l(w)+'/':__dirname+'/';var A=()=>{m||(y=require('fs'),m=require('path'))};f=(t,i)=>(A(),t=m.normalize(t),y.Ql(t,i?void 0:'utf8')),d=t=>{var i=f(t,!0);return i.buffer||(i=new Uint8Array(i)),k(i.buffer),i},u=(t,i,e)=>{A(),t=m.normalize(t),y.ta(t,(function(t,s){t?e(t):i(s.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,'/'),h=process.argv.slice(2),process.on('uncaughtException',(function(t){if(!(t instanceof nt))throw t})),process.on('unhandledRejection',(function(t){throw t})),n.inspect=function(){return'[Emscripten Module object]'}}else if(c){if('object'==typeof process&&'function'==typeof require||'object'==typeof window||'function'==typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');'undefined'!=typeof read&&(f=function(t){return read(t)}),d=function(t){let i;return'function'==typeof readbuffer?new Uint8Array(readbuffer(t)):(i=read(t,'binary'),k('object'==typeof i),i)},u=function(t,i,e){setTimeout((()=>i(d(t))),0)},'undefined'!=typeof scriptArgs?h=scriptArgs:void 0!==arguments&&(h=arguments),'undefined'!=typeof print&&('undefined'==typeof console&&(console={}),console.log=print,console.warn=console.error='undefined'!=typeof printErr?printErr:print)}else{if(!o&&!l)throw new Error('environment detection error');if(l?w=self.location.href:'undefined'!=typeof document&&document.currentScript&&(w=document.currentScript.src),tt&&(w=tt),w=0!==w.indexOf('blob:')?w.substr(0,w.replace(/[?#].*/,"").lastIndexOf('/')+1):'','object'!=typeof window&&'function'!=typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');f=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.send(null),i.responseText},l&&(d=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.responseType='arraybuffer',i.send(null),new Uint8Array(i.response)}),u=(t,i,e)=>{var s=new XMLHttpRequest;s.open('GET',t,!0),s.responseType='arraybuffer',s.onload=()=>{200==s.status||0==s.status&&s.response?i(s.response):e()},s.onerror=e,s.send(null)}}n.print||console.log.bind(console);var p,_,I=n.printErr||console.warn.bind(console);function g(t,i){Object.getOwnPropertyDescriptor(n,t)||Object.defineProperty(n,t,{configurable:!0,get:function(){X('Module.'+t+' has been replaced with plain '+i+' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')}})}function C(t){return'FS_createPath'===t||'FS_createDataFile'===t||'FS_createPreloadedFile'===t||'FS_unlink'===t||'addRunDependency'===t||'FS_createLazyFile'===t||'FS_createDevice'===t||'removeRunDependency'===t}Object.assign(n,r),r=null,p='fetchSettings',Object.getOwnPropertyDescriptor(n,p)&&X('`Module.'+p+'` was supplied but `'+p+'` not included in INCOMING_MODULE_JS_API'),n.arguments&&(h=n.arguments),g('arguments','arguments_'),n.thisProgram&&n.thisProgram,g('thisProgram','thisProgram'),n.quit&&n.quit,g('quit','quit_'),k(void 0===n.memoryInitializerPrefixURL,'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'),k(void 0===n.pthreadMainPrefixURL,'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'),k(void 0===n.cdInitializerPrefixURL,'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'),k(void 0===n.filePackagePrefixURL,'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'),k(void 0===n.read,'Module.read option was removed (modify read_ in JS)'),k(void 0===n.readAsync,'Module.readAsync option was removed (modify readAsync in JS)'),k(void 0===n.readBinary,'Module.readBinary option was removed (modify readBinary in JS)'),k(void 0===n.setWindowTitle,'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'),k(void 0===n.TOTAL_MEMORY,'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'),g('read','read_'),g('readAsync','readAsync'),g('readBinary','readBinary'),g('setWindowTitle','setWindowTitle'),k(!c,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),n.wasmBinary&&(_=n.wasmBinary),g('wasmBinary','wasmBinary');var E;n.noExitRuntime;g('noExitRuntime','noExitRuntime'),'object'!=typeof WebAssembly&&X('no native wasm support detected');var T,b,R,O,v,L,S,x,M=!1;function k(t,i){t||X('Assertion failed'+(i?': '+i:''))}function D(t){T=t,n.HEAP8=b=new Int8Array(t),n.HEAP16=O=new Int16Array(t),n.HEAP32=v=new Int32Array(t),n.HEAPU8=R=new Uint8Array(t),n.HEAPU16=new Uint16Array(t),n.HEAPU32=L=new Uint32Array(t),n.HEAPF32=S=new Float32Array(t),n.HEAPF64=x=new Float64Array(t)}'undefined'!=typeof TextDecoder&&new TextDecoder('utf8');var F=5242880;n.TOTAL_STACK&&k(F===n.TOTAL_STACK,'the stack size can no longer be determined at runtime');var N=n.INITIAL_MEMORY||16777216;function B(){if(!M){var t=ft(),i=L[t>>2],e=L[t+4>>2];34821223==i&&2310721022==e||X('Stack overflow! Stack cookie has been overwritten at 0x'+t.toString(16)+', expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+e.toString(16)+' 0x'+i.toString(16)),1668509029!==L[0]&&X('Runtime error: The application has corrupted its heap memory area (address zero)!')}}g('INITIAL_MEMORY','INITIAL_MEMORY'),k(N>=F,'INITIAL_MEMORY should be larger than TOTAL_STACK, was '+N+'! (TOTAL_STACK='+F+')'),k('undefined'!=typeof Int32Array&&'undefined'!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,'JS engine does not provide full typed array support'),k(!n.wasmMemory,'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'),k(16777216==N,'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'),function(){var t=new Int16Array(1),i=new Int8Array(t.buffer);if(t[0]=25459,115!==i[0]||99!==i[1])throw'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'}();var U=[],P=[],G=[],W=!1;k(Math.imul,'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),k(Math.fround,'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),k(Math.clz32,'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),k(Math.trunc,'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');var Y=0,H=null,V=null,K={};function X(t){n.onAbort&&n.onAbort(t),I(t='Aborted('+t+')'),M=!0;var i=new WebAssembly.RuntimeError(t);throw s(i),i}var j={error:function(){X('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM')},init:function(){j.error()},ia:function(){j.error()},ea:function(){j.error()},sa:function(){j.error()},open:function(){j.error()},na:function(){j.error()},ra:function(){j.error()},ha:function(){j.error()},oa:function(){j.error()},la:function(){j.error()}};n.FS_createDataFile=j.ia,n.FS_createPreloadedFile=j.ea;var z,Z,q,J,$='data:application/octet-stream;base64,';function Q(t){return t.startsWith($)}function it(t){return t.startsWith('file://')}function et(t,i){return function(){var e=t,s=i;return i||(s=n.asm),k(W,'native function `'+e+'` called before runtime initialization'),s[t]||k(s[t],'exported native function `'+e+'` not found'),s[t].apply(null,arguments)}}function st(t){try{if(t==z&&_)return new Uint8Array(_);if(d)return d(t);throw"both async and sync fetching of the wasm failed"}catch(t){X(t)}}function nt(t){this.name='ExitStatus',this.message='Program terminated with exit('+t+')',this.status=t}function rt(t){for(;t.length>0;)t.shift()(n)}function ht(t){ht.aa||(ht.aa={}),ht.aa[t]||(ht.aa[t]=1,a&&(t='warning: '+t),I(t))}function ot(t){try{return E.ca(t-T.byteLength+65535>>>16),D(E.buffer),1}catch(i){I('emscripten_realloc_buffer: Attempted to grow heap from '+T.byteLength+' bytes to '+t+' bytes, but got error: '+i)}}n.locateFile?Q(z='tinymidipcm.wasm')||(Z=z,z=n.locateFile?n.locateFile(Z,w):w+Z):z=new URL(e(8227),e.b).toString();var lt,at={"emscripten_memcpy_big":function(t,i,e){R.copyWithin(t,i,i+e)},"emscripten_resize_heap":function(t){var i=R.length;k((t>>>=0)>i);var e,s,n=2147483648;if(t>n)return I('Cannot enlarge memory, asked to go up to '+t+' bytes, but the limit is '+n+' bytes!'),!1;for(var r=1;r<=4;r*=2){var h=i*(1+.2/r);h=Math.min(h,t+100663296);var o=Math.min(n,(e=Math.max(t,h))+((s=65536)-e%s)%s);if(ot(o))return!0}return I('Failed to grow the heap from '+i+' bytes to '+o+' bytes, not enough memory!'),!1}},ct=(function(){var t,i={'env':at,'wasi_snapshot_preview1':at};function e(t,i){var e,s=t.exports;n.asm=s,k(E=n.asm.memory,"memory not found in wasm exports"),D(E.buffer),k(n.asm.__indirect_function_table,"table not found in wasm exports"),e=n.asm.__wasm_call_ctors,P.unshift(e),function(t){if(Y--,n.monitorRunDependencies&&n.monitorRunDependencies(Y),t?(k(K[t]),delete K[t]):I('warning: run dependency removed without ID'),0==Y&&(null!==H&&(clearInterval(H),H=null),V)){var i=V;V=null,i()}}('wasm-instantiate')}t='wasm-instantiate',Y++,n.monitorRunDependencies&&n.monitorRunDependencies(Y),t?(k(!K[t]),K[t]=1,null===H&&'undefined'!=typeof setInterval&&(H=setInterval((function(){if(M)return clearInterval(H),void(H=null);var t=!1;for(var i in K)t||(t=!0,I('still waiting on run dependencies:')),I('dependency: '+i);t&&I('(end of list)')}),1e4))):I('warning: run dependency added without ID');var r=n;function h(t){k(n===r,'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'),r=null,e(t.instance)}function c(t){return function(){if(!_&&(o||l)){if('function'==typeof fetch&&!it(z))return fetch(z,{credentials:'same-origin'}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+z+"'";return t.arrayBuffer()})).catch((function(){return st(z)}));if(u)return new Promise((function(t,i){u(z,(function(i){t(new Uint8Array(i))}),i)}))}return Promise.resolve().then((function(){return st(z)}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){I('failed to asynchronously prepare wasm: '+t),it(z)&&I('warning: Loading from a file URI ('+z+') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing'),X(t)}))}if(n.instantiateWasm)try{return n.instantiateWasm(i,e)}catch(t){I('Module.instantiateWasm callback failed with error: '+t),s(t)}(_||'function'!=typeof WebAssembly.instantiateStreaming||Q(z)||it(z)||a||'function'!=typeof fetch?c(h):fetch(z,{credentials:'same-origin'}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(h,(function(t){return I('wasm streaming compile failed: '+t),I('falling back to ArrayBuffer instantiation'),c(h)}))}))).catch(s)}(),n.___wasm_call_ctors=et("__wasm_call_ctors"),n._malloc=et("malloc"),n._free=et("free"),n._tsf_load_memory=et("tsf_load_memory"),n._tsf_close=et("tsf_close"),n._tsf_reset=et("tsf_reset"),n._tsf_set_output=et("tsf_set_output"),n._tsf_set_max_voices=et("tsf_set_max_voices"),n._realloc=et("realloc"),n._tsf_channel_set_presetnumber=et("tsf_channel_set_presetnumber"),n._tsf_channel_set_bank_preset=et("tsf_channel_set_bank_preset"),n._tml_load_memory=et("tml_load_memory"),n._midi_render=et("midi_render"),n.___errno_location=et("__errno_location"),n._fflush=et("fflush"),n._emscripten_stack_init=function(){return(ct=n._emscripten_stack_init=n.asm.emscripten_stack_init).apply(null,arguments)}),ft=(n._emscripten_stack_get_free=function(){return(n._emscripten_stack_get_free=n.asm.emscripten_stack_get_free).apply(null,arguments)},n._emscripten_stack_get_base=function(){return(n._emscripten_stack_get_base=n.asm.emscripten_stack_get_base).apply(null,arguments)},n._emscripten_stack_get_end=function(){return(ft=n._emscripten_stack_get_end=n.asm.emscripten_stack_get_end).apply(null,arguments)});function ut(){var t;ct(),k(!(3&(t=ft()))),L[t>>2]=34821223,L[t+4>>2]=2310721022,L[0]=1668509029}function dt(t){function e(){lt||(lt=!0,n.calledRun=!0,M||(k(!W),W=!0,B(),rt(P),i(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),k(!n._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(B(),n.postRun)for('function'==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)t=n.postRun.shift(),G.unshift(t);var t;rt(G)}()))}t=t||h,Y>0||(ut(),function(){if(n.preRun)for('function'==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)t=n.preRun.shift(),U.unshift(t);var t;rt(U)}(),Y>0||(n.setStatus?(n.setStatus('Running...'),setTimeout((function(){setTimeout((function(){n.setStatus('')}),1),e()}),1)):e(),B()))}if(n.stackSave=et("stackSave"),n.stackRestore=et("stackRestore"),n.stackAlloc=et("stackAlloc"),n.setValue=function(t,i,e="i8"){switch(e.endsWith('*')&&(e='*'),e){case'i1':case'i8':b[0|t]=i;break;case'i16':O[t>>1]=i;break;case'i32':v[t>>2]=i;break;case'i64':J=[i>>>0,(q=i,+Math.abs(q)>=1?q>0?(0|Math.min(+Math.floor(q/4294967296),4294967295))>>>0:~~+Math.ceil((q-+(~~q>>>0))/4294967296)>>>0:0)],v[t>>2]=J[0],v[t+4>>2]=J[1];break;case'float':S[t>>2]=i;break;case'double':x[t>>3]=i;break;case'*':L[t>>2]=i;break;default:X('invalid type for setValue: '+e)}},n.getValue=function(t,i="i8"){switch(i.endsWith('*')&&(i='*'),i){case'i1':case'i8':return b[0|t];case'i16':return O[t>>1];case'i32':case'i64':return v[t>>2];case'float':return S[t>>2];case'double':return x[t>>3];case'*':return L[t>>2];default:X('invalid type for getValue: '+i)}return null},['run','UTF8ArrayToString','UTF8ToString','stringToUTF8Array','stringToUTF8','lengthBytesUTF8','addOnPreRun','addOnInit','addOnPreMain','addOnExit','addOnPostRun','addRunDependency','removeRunDependency','FS_createFolder','FS_createPath','FS_createDataFile','FS_createPreloadedFile','FS_createLazyFile','FS_createLink','FS_createDevice','FS_unlink','getLEB','getFunctionTables','alignFunctionTables','registerFunctions','prettyPrint','getCompilerSetting','print','printErr','callMain','abort','keepRuntimeAlive','wasmMemory','stackAlloc','stackSave','stackRestore','getTempRet0','setTempRet0','writeStackCookie','checkStackCookie','ptrToString','zeroMemory','stringToNewUTF8','exitJS','getHeapMax','emscripten_realloc_buffer','ENV','ERRNO_CODES','ERRNO_MESSAGES','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','DNS','getHostByName','Protocols','Sockets','getRandomDevice','warnOnce','traverseStack','UNWIND_CACHE','convertPCtoSourceLocation','readAsmConstArgsArray','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','handleException','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','freeTableIndexes','functionsInTableMap','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','PATH','PATH_FS','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16Decoder','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeArrayToMemory','writeAsciiToMemory','SYSCALLS','getSocketFromFD','getSocketAddress','JSEvents','registerKeyEventCallback','specialHTMLTargets','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','currentFullscreenStrategy','restoreOldWindowedStyle','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','demangle','demangleAll','jsStackTrace','stackTrace','ExitStatus','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','dlopenMissingError','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','uncaughtExceptionCount','exceptionLast','exceptionCaught','ExceptionInfo','exception_addRef','exception_decRef','Browser','setMainLoop','wget','FS','MEMFS','TTY','PIPEFS','SOCKFS','_setNetworkCallback','tempFixedLengthArray','miniTempWebGLFloatBuffers','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','GL','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','AL','SDL_unicode','SDL_ttfContext','SDL_audio','SDL','SDL_gfx','GLUT','EGL','GLFW_Window','GLFW','GLEW','IDBStore','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){Object.getOwnPropertyDescriptor(n,t)||Object.defineProperty(n,t,{configurable:!0,get:function(){var i="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";C(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),X(i)}})})),['ptrToString','zeroMemory','stringToNewUTF8','exitJS','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','getHostByName','getRandomDevice','traverseStack','convertPCtoSourceLocation','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeAsciiToMemory','getSocketFromFD','getSocketAddress','registerKeyEventCallback','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','ExceptionInfo','exception_addRef','exception_decRef','setMainLoop','_setNetworkCallback','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','SDL_unicode','SDL_ttfContext','SDL_audio','GLFW_Window','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){'undefined'==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var i='`'+t+'` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line';C(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),ht(i)}})})),V=function t(){lt||dt(),lt||(V=t)},n.preInit)for('function'==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return dt(),t.ready});const et=it;const st=class{constructor(t={}){this.fa=void 0,this.ua=0,this.da=0,this.wa=0,this.ya=t.ya||100,this.sampleRate=t.sampleRate||44100,this.ma=t.ma||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.Aa(1),this.pa=t.pa||(()=>{}),this._a=t._a||(()=>{}),this.Ia=void 0,this.test=0}async init(){if(!this.fa){if('undefined'!=typeof process){const{$l:t}=await import('path'),{ga:i}=await import('module');globalThis.__dirname=t("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js"),globalThis.require=i("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js")}this.fa=await et(),this.Ca=this.fa._malloc(this.bufferSize),this.Ea=this.fa._malloc(8)}}Aa(t){this.bufferSize=4*this.sampleRate*this.ma*t}Ta(){if(!this.fa)throw new Error(`${this.constructor.name} not initalized. call .init()`)}ba(t){this.Ta();const{_malloc:i,_free:e,_tsf_load_memory:s,_tsf_set_output:n,_tsf_channel_set_bank_preset:r,_tsf_set_max_voices:h,_tsf_channel_set_presetnumber:o}=this.fa;e(this.ua),this.ua=i(t.length),this.fa.HEAPU8.set(t,this.ua),this.da=s(this.ua,t.length),n(this.da,2===this.ma?0:2,this.sampleRate,this.gain)}Ra(){this.Ta();const t=new Uint8Array(this.bufferSize);return t.set(this.fa.HEAPU8.subarray(this.Ca,this.Ca+this.bufferSize)),t}Oa(t){const{_malloc:i,_free:e,_tml_load_memory:s}=this.fa;return e(this.wa),this.wa=i(t.length),this.fa.HEAPU8.set(t,this.wa),s(this.wa,t.length)}va(t){const{_midi_render:i}=this.fa;return i(this.da,t,this.ma,this.sampleRate,this.Ca,this.bufferSize,this.Ea)}La(t){if(this.Ta(),!this.da)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.Ia);const{setValue:i,getValue:e}=this.fa;i(this.Ea,0,'double'),this.fa._tsf_reset(this.da),this.fa._tsf_channel_set_bank_preset(this.da,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let s=this.Oa(t);const n=()=>{s=this.va(s);const t=this.Ra();this.pa(t),s?this.Ia=setTimeout(n,this.ya):this._a(e(this.Ea,'double'))};this.Ia=setTimeout(n,16)}};!function(){window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioContext&&(window.audioContext=new window.AudioContext);var t=function(i){if(window.audioContext){var e=window.audioContext.createBuffer(1,1,22050),s=window.audioContext.createBufferSource();s.buffer=e,s.connect(window.audioContext.destination),s.start?s.start(0):s.play?s.play(0):s.noteOn&&s.noteOn(0)}document.removeEventListener('touchstart',t),document.removeEventListener('touchend',t),document.removeEventListener('click',t)};document.addEventListener('touchstart',t),document.addEventListener('touchend',t),document.addEventListener('click',t)}(),(async()=>{let t=new Float32Array,i=window.audioContext.createGain();i.gain.value=.1,i.connect(window.audioContext.destination);let e=window.audioContext.currentTime,s=[];const n=new st({ya:30,pa:i=>{let e=new Float32Array(i.buffer),s=new Float32Array(t.length+e.length);s.set(t,0),s.set(e,t.length),t=s},_a:t=>{},bufferSize:102400});await n.init();const r=await fetch('./SCC1_Florestan.sf2'),h=new Uint8Array(await r.arrayBuffer());function o(){if(!window.audioContext||!t.length)return;let n=window.audioContext.createBufferSource();const r=t.length/2,h=window.audioContext.createBuffer(2,r,44100);for(let i=0;i<2;i++){const e=h.getChannelData(i);let s=i;for(let i=0;i{if(l&&clearInterval(l),t=new Float32Array,s.length){let t=i.gain.value;i.gain.value=0,s.forEach((t=>{t.stop(window.audioContext.currentTime)})),s=[],i.gain.value=t}},window._tinyMidiVolume=(t=1)=>{i.gain.value=t},window._tinyMidiPlay=async(t,i=1)=>{t&&(await window._tinyMidiStop(),-1!=i&&window._tinyMidiVolume(i),e=window.audioContext.currentTime,l=setInterval(o,250),n.La(t))}})();class nt{level;y;x;z;model;Sa;xa;Ma;ka;Da;Fa;Na;info;Ba=0;Yi=0;constructor(t,i,e,s,n,r,h,o,l,a,c,f,u){this.level=t,this.y=i,this.x=e,this.z=s,this.model=n,this.Sa=r,this.xa=h,this.Ma=o,this.ka=l,this.Da=a,this.Fa=c,this.Na=f,this.info=u}}class rt extends w{level;x;z;Ua;Pa;Ga;Wa=null;Ya=null;Ha=null;Va=null;Ka=null;Xa=null;ja=null;za=0;Za=0;qa=0;visible=!1;update=!1;Ja=!1;$a=0;Qa=0;tc=0;ic=0;constructor(t,i,e){super(),this.Ua=this.level=t,this.x=i,this.z=e,this.Pa=new v(5,null),this.Ga=new Int32Array(5)}}class ht{ec;sc;nc;rc;type;vr;Lr;Sr;Mr;Dr;Fr;mode=0;hc=0;oc=0;lc=0;ac=0;cc=0;fc=0;constructor(t,i,e,s,n,r,h,o,l,a,c){this.ec=t,this.sc=i,this.nc=e,this.rc=s,this.type=n,this.vr=r,this.Lr=h,this.Sr=o,this.Mr=l,this.Dr=a,this.Fr=c}}class ot{static OPEN=0;static uc=1;static dc=2;static wc=4;static yc=8;static mc=ot.uc<<4;static Ac=ot.dc<<4;static _c=ot.wc<<4;static Ic=ot.yc<<4;static gc=256;static Cc=512;static Ec=1024;static Tc=2048;static bc=4096;static Rc=ot.Cc<<4;static Oc=ot.Ec<<4;static vc=ot.Tc<<4;static Lc=ot.bc<<4;static Sc=ot.gc<<9;static xc=524288;static Mc=2097152;static kc=ot.Mc|ot.xc;static Dc=ot.gc|ot.kc;static Fc=ot.dc|ot.Dc;static Nc=ot.yc|ot.Dc;static Bc=ot.dc|ot.wc|ot.Nc;static Uc=ot.Ac|ot.Dc;static Pc=ot.yc|ot.mc|ot.Uc;static Gc=ot.Ic|ot.Dc;static Wc=ot.uc|ot.dc|ot.Gc;static Yc=ot.Ac|ot._c|ot.Gc;static Hc=16777215}class lt{static Vc=0;static Kc=1;static Xc=2;static jc=3}class at{static zc=0;static Zc=1;static qc=2;static Jc=3}class ct{static $c=new ct(0,at.zc);static Qc=new ct(1,at.zc);static tf=new ct(2,at.zc);static if=new ct(3,at.zc);static ef=new ct(4,at.Zc);static sf=new ct(5,at.Zc);static nf=new ct(6,at.Zc);static rf=new ct(7,at.Zc);static hf=new ct(8,at.Zc);static lf=new ct(9,at.qc);static af=new ct(10,at.qc);static cf=new ct(11,at.qc);static ff=new ct(12,at.qc);static uf=new ct(13,at.qc);static df=new ct(14,at.qc);static wf=new ct(15,at.qc);static yf=new ct(16,at.qc);static mf=new ct(17,at.qc);static Af=new ct(18,at.qc);static pf=new ct(19,at.qc);static _f=new ct(20,at.qc);static If=new ct(21,at.qc);static Jc=new ct(22,at.Jc);static values(){return[this.$c,this.Qc,this.mf,this.wf,this.tf,this.df,this.lf,this.if,this.Jc,this.ff,this.cf,this.nf,this._f,this.af,this.sf,this.uf,this.rf,this.ef,this.yf,this.hf,this.pf,this.If,this.Af]}static of(t){const i=this.values();for(let e=0;et*ut.Cf+i;offsetX;Ef;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.Ef=0,this.sizeX=ut.Cf,this.sizeZ=ut.Cf,this.flags=new Int32Array(this.sizeX*this.sizeZ),this.reset()}reset=()=>{for(let t=0;t{this.flags[ut.index(t-this.offsetX,i-this.Ef)]|=ot.Mc};bf=(t,i)=>{this.flags[ut.index(t-this.offsetX,i-this.Ef)]&=~ot.Mc};Rf=(t,i,e,s,n,r)=>{let h=ot.gc;r&&(h|=ot.Sc);const o=t-this.offsetX,l=i-this.Ef;if(n===lt.Kc||n===lt.jc){const t=e;e=s,s=t}for(let t=o;t=0&&t=0&&i{let h=ot.gc;r&&(h|=ot.Sc);const o=t-this.offsetX,l=i-this.Ef;if(n===lt.Kc||n===lt.jc){const t=e;e=s,s=t}for(let t=o;t=0&&t=0&&i{const r=t-this.offsetX,h=i-this.Ef,o=n?ot.Lc:ot.Ic,l=n?ot.bc:ot.yc,a=n?ot.Ec:ot.dc,c=n?ot.Oc:ot.Ac,f=n?ot.Cc:ot.uc,u=n?ot.Rc:ot.mc,d=n?ot.Tc:ot.wc,w=n?ot.vc:ot._c;e===ct.$c.id?s===lt.Vc?(this.add(r,h,o),this.add(r-1,h,l)):s===lt.Kc?(this.add(r,h,a),this.add(r,h+1,c)):s===lt.Xc?(this.add(r,h,l),this.add(r+1,h,o)):s===lt.jc&&(this.add(r,h,c),this.add(r,h-1,a)):e===ct.Qc.id||e===ct.if.id?s===lt.Vc?(this.add(r,h,f),this.add(r-1,h+1,u)):s===lt.Kc?(this.add(r,h,d),this.add(r+1,h+1,w)):s===lt.Xc?(this.add(r,h,u),this.add(r+1,h-1,f)):s===lt.jc&&(this.add(r,h,w),this.add(r-1,h-1,d)):e===ct.tf.id&&(s===lt.Vc?(this.add(r,h,a|o),this.add(r-1,h,l),this.add(r,h+1,c)):s===lt.Kc?(this.add(r,h,a|l),this.add(r,h+1,c),this.add(r+1,h,o)):s===lt.Xc?(this.add(r,h,c|l),this.add(r+1,h,o),this.add(r,h-1,a)):s===lt.jc&&(this.add(r,h,c|o),this.add(r,h-1,a),this.add(r-1,h,l))),n&&this.vf(t,i,e,s,!1)};Lf=(t,i,e,s,n)=>{const r=t-this.offsetX,h=i-this.Ef,o=n?ot.Lc:ot.Ic,l=n?ot.bc:ot.yc,a=n?ot.Ec:ot.dc,c=n?ot.Oc:ot.Ac,f=n?ot.Cc:ot.uc,u=n?ot.Rc:ot.mc,d=n?ot.Tc:ot.wc,w=n?ot.vc:ot._c;e===ct.$c.id?s===lt.Vc?(this.remove(r,h,o),this.remove(r-1,h,l)):s===lt.Kc?(this.remove(r,h,a),this.remove(r,h+1,c)):s===lt.Xc?(this.remove(r,h,l),this.remove(r+1,h,o)):s===lt.jc&&(this.remove(r,h,c),this.remove(r,h-1,a)):e===ct.Qc.id||e===ct.if.id?s===lt.Vc?(this.remove(r,h,f),this.remove(r-1,h+1,u)):s===lt.Kc?(this.remove(r,h,d),this.remove(r+1,h+1,w)):s===lt.Xc?(this.remove(r,h,u),this.remove(r+1,h-1,f)):s===lt.jc&&(this.remove(r,h,w),this.remove(r-1,h-1,d)):e===ct.tf.id&&(s===lt.Vc?(this.remove(r,h,a|o),this.remove(r-1,h,l),this.remove(r,h+1,c)):s===lt.Kc?(this.remove(r,h,a|l),this.remove(r,h+1,c),this.remove(r+1,h,o)):s===lt.Xc?(this.remove(r,h,c|l),this.remove(r+1,h,o),this.remove(r,h-1,a)):s===lt.jc&&(this.remove(r,h,c|o),this.remove(r,h-1,a),this.remove(r-1,h,l))),n&&this.Lf(t,i,e,s,!1)};Sf=(t,i,e,s,n,r)=>{if(t===e&&i===s)return!0;const h=t-this.offsetX,o=i-this.Ef,l=e-this.offsetX,a=s-this.Ef,c=ut.index(h,o);if(n===ct.$c.id){if(r===lt.Vc){if(h===l-1&&o===a)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.Uc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.Fc)===ot.OPEN)return!0}else if(r===lt.Kc){if(h===l&&o===a+1)return!0;if(h===l-1&&o===a&&(this.flags[c]&ot.Nc)===ot.OPEN)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.Gc)===ot.OPEN)return!0}else if(r===lt.Xc){if(h===l+1&&o===a)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.Uc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.Fc)===ot.OPEN)return!0}else if(r===lt.jc){if(h===l&&o===a-1)return!0;if(h===l-1&&o===a&&(this.flags[c]&ot.Nc)===ot.OPEN)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.Gc)===ot.OPEN)return!0}}else if(n===ct.tf.id){if(r===lt.Vc){if(h===l-1&&o===a)return!0;if(h===l&&o===a+1)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.Gc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.Fc)===ot.OPEN)return!0}else if(r===lt.Kc){if(h===l-1&&o===a&&(this.flags[c]&ot.Nc)===ot.OPEN)return!0;if(h===l&&o===a+1)return!0;if(h===l+1&&o===a)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.Fc)===ot.OPEN)return!0}else if(r===lt.Xc){if(h===l-1&&o===a&&(this.flags[c]&ot.Nc)===ot.OPEN)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.Uc)===ot.OPEN)return!0;if(h===l+1&&o===a)return!0;if(h===l&&o===a-1)return!0}else if(r===lt.jc){if(h===l-1&&o===a)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.Uc)===ot.OPEN)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.Gc)===ot.OPEN)return!0;if(h===l&&o===a-1)return!0}}else if(n===ct.lf.id){if(h===l&&o===a+1&&(this.flags[c]&ot.Ac)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.dc)===ot.OPEN)return!0;if(h===l-1&&o===a&&(this.flags[c]&ot.yc)===ot.OPEN)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.Ic)===ot.OPEN)return!0}return!1};xf=(t,i,e,s,n,r)=>{if(t===e&&i===s)return!0;const h=t-this.offsetX,o=i-this.Ef,l=e-this.offsetX,a=s-this.Ef,c=ut.index(h,o);if(n===ct.nf.id||n===ct.rf.id){if(n===ct.rf.id&&(r=r+2&3),r===lt.Vc){if(h===l+1&&o===a&&(this.flags[c]&ot.Ic)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.dc)===ot.OPEN)return!0}else if(r===lt.Kc){if(h===l-1&&o===a&&(this.flags[c]&ot.yc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.dc)===ot.OPEN)return!0}else if(r===lt.Xc){if(h===l-1&&o===a&&(this.flags[c]&ot.yc)===ot.OPEN)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.Ac)===ot.OPEN)return!0}else if(r===lt.jc){if(h===l+1&&o===a&&(this.flags[c]&ot.Ic)===ot.OPEN)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.Ac)===ot.OPEN)return!0}}else if(n===ct.hf.id){if(h===l&&o===a+1&&(this.flags[c]&ot.Ac)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.dc)===ot.OPEN)return!0;if(h===l-1&&o===a&&(this.flags[c]&ot.yc)===ot.OPEN)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.Ic)===ot.OPEN)return!0}return!1};Mf=(t,i,e,s,n,r,h)=>{const o=e+n-1,l=s+r-1,a=ut.index(t-this.offsetX,i-this.Ef);return t>=e&&t<=o&&i>=s&&i<=l||(t===e-1&&i>=s&&i<=l&&(this.flags[a]&ot.yc)===ot.OPEN&&(h&ft.Vc)===ot.OPEN||(t===o+1&&i>=s&&i<=l&&(this.flags[a]&ot.Ic)===ot.OPEN&&(h&ft.Xc)===ot.OPEN||(i===s-1&&t>=e&&t<=o&&(this.flags[a]&ot.dc)===ot.OPEN&&(h&ft.jc)===ot.OPEN||i===l+1&&t>=e&&t<=o&&(this.flags[a]&ot.Ac)===ot.OPEN&&(h&ft.Kc)===ot.OPEN)))};add=(t,i,e)=>{this.flags[ut.index(t,i)]|=e};remove=(t,i,e)=>{this.flags[ut.index(t,i)]&=ot.Hc-e}}class dt{y;x;z;model;Na;info;constructor(t,i,e,s,n,r){this.y=t,this.x=i,this.z=e,this.model=s,this.Na=n,this.info=r}}class wt{y;x;z;kf;Df;Ff;Nf;Na;info;constructor(t,i,e,s,n,r,h,o,l){this.y=t,this.x=i,this.z=e,this.kf=s,this.Df=n,this.Ff=r,this.Nf=h,this.Na=o,this.info=l}}class yt{y;x;z;type;angle;model;Na;info;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.type=s,this.angle=n,this.model=r,this.Na=h,this.info=o}}class mt{y;x;z;Bf;Uf;Pf;Na;offset;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.Bf=s,this.Uf=n,this.Pf=r,this.Na=h,this.offset=o}}class At{Gf;Wf;Yf;Hf;Vf;color;flat;constructor(t,i,e,s,n,r,h){this.Gf=t,this.Wf=i,this.Yf=e,this.Hf=s,this.Vf=n,this.color=r,this.flat=h}}class pt{static Kf=new Int32Array(6);static Xf=new Int32Array(6);static jf=new Int32Array(6);static zf=new Int32Array(6);static Zf=new Int32Array(6);static qf=[Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,2,6),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,13,14)];static Jf=[Int8Array.of(0,1,2,3,0,0,1,3),Int8Array.of(1,1,2,3,1,0,1,3),Int8Array.of(0,1,2,3,1,0,1,3),Int8Array.of(0,0,1,2,0,0,2,4,1,0,4,3),Int8Array.of(0,0,1,4,0,0,4,3,1,1,2,4),Int8Array.of(0,0,4,3,1,0,1,2,1,0,2,4),Int8Array.of(0,1,2,4,1,0,1,4,1,0,4,3),Int8Array.of(0,4,1,2,0,4,2,5,1,0,4,5,1,0,5,3),Int8Array.of(0,4,1,2,0,4,2,3,0,4,3,5,1,0,4,5),Int8Array.of(0,0,4,5,1,4,1,2,1,4,2,3,1,4,3,5),Int8Array.of(0,0,1,5,0,1,4,5,0,1,2,4,1,0,5,3,1,5,4,3,1,4,2,3),Int8Array.of(1,0,1,5,1,1,4,5,1,1,2,4,0,0,5,3,0,5,4,3,0,4,2,3),Int8Array.of(1,0,5,4,1,0,1,5,0,0,4,3,0,4,5,3,0,5,2,3,0,1,2,5)];static $f=128;static Qf=this.$f/2|0;static tu=this.$f/4|0;static iu=3*this.$f/4|0;Ar;ar;pr;eu;su;nu;ru;hu;ou;lu;flat;shape;angle;au;cu;constructor(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w,y,m,A,p){this.flat=!(m!==s||m!==d||m!==o),this.shape=i,this.angle=r,this.au=u,this.cu=l;const _=pt.qf[i],I=_.length;this.Ar=new Int32Array(I),this.ar=new Int32Array(I),this.pr=new Int32Array(I);const g=new Int32Array(I),C=new Int32Array(I),E=t*pt.$f,T=A*pt.$f;for(let t=0;t8&&I<=12&&(I=9+(I-r-9&3)),I>12&&I<=16&&(I=13+(I-r-13&3)),1===I?(i=E,l=T,c=m,u=h,A=a):2===I?(i=E+pt.Qf,l=T,c=m+s>>1,u=h+p>>1,A=a+e>>1):3===I?(i=E+pt.$f,l=T,c=s,u=p,A=e):4===I?(i=E+pt.$f,l=T+pt.Qf,c=s+d>>1,u=p+n>>1,A=e+w>>1):5===I?(i=E+pt.$f,l=T+pt.$f,c=d,u=n,A=w):6===I?(i=E+pt.Qf,l=T+pt.$f,c=d+o>>1,u=n+y>>1,A=w+f>>1):7===I?(i=E,l=T+pt.$f,c=o,u=y,A=f):8===I?(i=E,l=T+pt.Qf,c=o+m>>1,u=y+h>>1,A=f+a>>1):9===I?(i=E+pt.Qf,l=T+pt.tu,c=m+s>>1,u=h+p>>1,A=a+e>>1):10===I?(i=E+pt.iu,l=T+pt.Qf,c=s+d>>1,u=p+n>>1,A=e+w>>1):11===I?(i=E+pt.Qf,l=T+pt.iu,c=d+o>>1,u=n+y>>1,A=w+f>>1):12===I?(i=E+pt.tu,l=T+pt.Qf,c=o+m>>1,u=y+h>>1,A=f+a>>1):13===I?(i=E+pt.tu,l=T+pt.tu,c=m,u=h,A=a):14===I?(i=E+pt.iu,l=T+pt.tu,c=s,u=p,A=e):15===I?(i=E+pt.iu,l=T+pt.iu,c=d,u=n,A=w):(i=E+pt.tu,l=T+pt.iu,c=o,u=y,A=f),this.Ar[t]=i,this.ar[t]=c,this.pr[t]=l,g[t]=u,C[t]=A}const b=pt.Jf[i],R=b.length/4|0;this.ru=new Int32Array(R),this.hu=new Int32Array(R),this.ou=new Int32Array(R),this.eu=new Int32Array(R),this.su=new Int32Array(R),this.nu=new Int32Array(R),this.lu=-1!==c?new Int32Array(R):null;let O=0;for(let t=0;t{this.Ru=0,this.Ou=0,this.vu=t,this.Lu=i,this.Su=t/2|0,this.xu=i/2|0;const r=new x(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let i=0;i<2048;i+=64){this.Mu=F.sin[t],this.ku=F.cos[t],this.Du=F.sin[i],this.Fu=F.cos[i];const h=(t-128)/32|0,o=i/64|0;for(let t=-26;t<=26;t++)for(let i=-26;i<=26;i++){const l=128*t,a=128*i;let c=!1;for(let t=-e;t<=s;t+=128)if(this.wd(l,a,n[h]+t)){c=!0;break}r[h][o][t+25+1][i+25+1]=c}}for(let t=0;t<8;t++)for(let i=0;i<32;i++)for(let e=-25;e<25;e++)for(let s=-25;s<25;s++){let n=!1;t:for(let h=-1;h<=1;h++)for(let o=-1;o<=1;o++){if(r[t][i][e+h+25+1][s+o+25+1]){n=!0;break t}if(r[t][(i+1)%31][e+h+25+1][s+o+25+1]){n=!0;break t}if(r[t+1][i][e+h+25+1][s+o+25+1]){n=!0;break t}if(r[t+1][(i+1)%31][e+h+25+1][s+o+25+1]){n=!0;break t}}this.Iu[t][i][e+25][s+25]=n}};static zi=()=>{this.gu=null,this.Cu=null,this.Eu=null,this.bu=null,this.Iu=null,this.Tu=null,this.zu=null,console.log('World3D unloaded!')};static yd=(t,i,e,s,n,r,h,o)=>{It.Eu[t][It.Cu[t]++]=new ht(e/128|0,r/128|0,n/128|0,o/128|0,i,e,r,n,o,s,h)};static wd=(t,i,e)=>{const s=i*this.Du+t*this.Fu>>16,n=i*this.Fu-t*this.Du>>16,r=e*this.Mu+n*this.ku>>16,h=e*this.ku-n*this.Mu>>16;if(r<50||r>3500)return!1;const o=this.Su+((s<<9)/r|0),l=this.xu+((h<<9)/r|0);return o>=this.Ru&&o<=this.vu&&l>=this.Ou&&l<=this.Lu};md;sc;rc;Ad;pd;_d;Id;gd;Cd;Ed=0;Td=0;bd=0;constructor(t,i,e,s){this.md=e,this.sc=s,this.rc=i,this.pd=new S(e,s,i,null),this.Id=new D(e,s+1,i+1),this.Ad=t,this._d=new v(5e3,null),this.gd=new Int32Array(1e4),this.Cd=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this.Td=t;for(let i=0;i{const e=this.pd[0][t][i];for(let e=0;e<3;e++){this.pd[e][t][i]=this.pd[e+1][t][i];const s=this.pd[e][t][i];s&&s.level--}this.pd[0][t][i]||(this.pd[0][t][i]=new rt(0,t,i));const s=this.pd[0][t][i];s&&(s.ja=e),this.pd[3][t][i]=null};vd=(t,i,e,s)=>{const n=this.pd[t][i][e];n&&(n.qa=s)};Ld=(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w,y,m,A,p,_)=>{if(s===_t.fu){for(let s=t;s>=0;s--)this.pd[s][i][e]||(this.pd[s][i][e]=new rt(s,i,e));const s=this.pd[t][i][e];s&&(s.Wa=new At(c,f,u,d,-1,p,!1))}else if(s===_t.uu){for(let s=t;s>=0;s--)this.pd[s][i][e]||(this.pd[s][i][e]=new rt(s,i,e));const s=this.pd[t][i][e];s&&(s.Wa=new At(w,y,m,A,r,_,h===o&&h===l&&h===a))}else{for(let s=t;s>=0;s--)this.pd[s][i][e]||(this.pd[s][i][e]=new rt(s,i,e));const I=this.pd[t][i][e];I&&(I.Ya=new pt(i,s,y,o,u,n,c,a,_,w,r,A,p,l,m,d,h,e,f))}};Sd=(t,i,e,s,n,r,h)=>{this.pd[i][e][s]||(this.pd[i][e][s]=new rt(i,e,s));const o=this.pd[i][e][s];o&&(o.Ka=new dt(n,128*e+64,128*s+64,t,r,h))};xd=(t,i,e)=>{const s=this.pd[t][i][e];s&&(s.Ka=null)};Md=(t,i,e,s,n,r,h,o)=>{let l=0;const a=this.pd[s][t][i];if(a)for(let t=0;tl&&(l=e)}else this.pd[s][t][i]=new rt(s,t,i);const c=this.pd[s][t][i];c&&(c.Xa=new mt(e,128*t+64,128*i+64,r,h,o,n,l))};kd=(t,i,e)=>{const s=this.pd[t][i][e];s&&(s.Xa=null)};vf=(t,i,e,s,n,r,h,o,l,a)=>{if(!h&&!o)return;for(let s=t;s>=0;s--)this.pd[s][i][e]||(this.pd[s][i][e]=new rt(s,i,e));const c=this.pd[t][i][e];c&&(c.Ha=new wt(s,128*i+64,128*e+64,n,r,h,o,l,a))};Lf=(t,i,e,s)=>{const n=this.pd[t][i][e];1===s&&n&&(n.Ha=null)};Dd=(t,i,e,s,n,r,h,o,l,a,c)=>{if(!o)return;for(let s=t;s>=0;s--)this.pd[s][i][e]||(this.pd[s][i][e]=new rt(s,i,e));const f=this.pd[t][i][e];f&&(f.Va=new yt(s,128*i+n+64,128*e+r+64,c,a,o,h,l))};Fd=(t,i,e)=>{const s=this.pd[t][i][e];s&&(s.Va=null)};Nd=(t,i,e,s)=>{const n=this.pd[t][i][e];if(!n)return;const r=n.Va;if(!r)return;const h=128*i+64,o=128*e+64;r.x=h+((r.x-h)*s/16|0),r.z=o+((r.z-o)*s/16|0)};Bd=(t,i,e,s)=>{if(!s)return;const n=this.pd[t][i][e];if(!n)return;const r=n.Va;r&&(r.model=s)};Ud=(t,i,e,s)=>{if(!s)return;const n=this.pd[t][i][e];if(!n)return;const r=n.Ka;r&&(r.model=s)};Pd=(t,i,e,s)=>{if(!s)return;const n=this.pd[t][i][e];if(!n)return;const r=n.Ha;r&&(r.Ff=s)};Gd=(t,i,e,s,n)=>{if(!s)return;const r=this.pd[e][t][i];if(!r)return;const h=r.Ha;h&&(h.Ff=s,h.Nf=n)};Rf=(t,i,e,s,n,r,h,o,l,a,c)=>{if(!n&&!r)return!0;const f=128*i+64*l,u=128*e+64*a;return this.Wd(f,u,s,t,i,e,l,a,n,r,h,o,c,!1)};Yd=(t,i,e,s,n,r,h,o,l,a)=>{if(!n&&!r)return!0;let c=i-l,f=s-l,u=i+l,d=s+l;return a&&(o>640&&o<1408&&(d+=128),o>1152&&o<1920&&(u+=128),(o>1664||o<384)&&(f-=128),o>128&&o<896&&(c-=128)),c=c/128|0,f=f/128|0,u=u/128|0,d=d/128|0,this.Wd(i,s,e,t,c,f,u+1-c,d-f+1,n,r,h,0,o,!0)};Hd=(t,i,e,s,n,r,h,o,l,a,c,f)=>!l&&!a||this.Wd(i,s,e,t,n,r,h+1-n,o-r+1,l,a,c,0,f,!0);Of=(t,i,e)=>{const s=this.pd[t][i][e];if(s)for(let t=0;t>29&3)&&n.Ma===i&&n.Da===e)return void this.Vd(n)}};Kd=(t,i,e,s)=>{if(!s)return;const n=this.pd[t][i][e];if(n)for(let t=0;t>29&3))return void(i.model=s)}};Xd=()=>{for(let t=0;t{const s=this.pd[t][i][e];return s&&s.Ha?s.Ha.Na:0};zd=(t,i,e)=>{const s=this.pd[t][e][i];return s&&s.Va?s.Va.Na:0};Zd=(t,i,e)=>{const s=this.pd[t][i][e];if(!s)return 0;for(let t=0;t>29&3)&&n.Ma===i&&n.Da===e)return n.Na}return 0};qd=(t,i,e)=>{const s=this.pd[t][i][e];return s&&s.Ka?s.Ka.Na:0};Jd=(t,i,e,s)=>{const n=this.pd[t][i][e];if(n){if(n.Ha&&n.Ha.Na===s)return 255&n.Ha.info;if(n.Va&&n.Va.Na===s)return 255&n.Va.info;if(n.Ka&&n.Ka.Na===s)return 255&n.Ka.info;for(let t=0;t{const r=i*(0|Math.sqrt(e*e+s*s+n*n))>>8;for(let i=0;i{if(i0){const n=this.pd[t][i+1][e-1];n&&n.Ka&&n.Ka.model&&n.Ka.model.yr&&this.tw(s,n.Ka.model,128,0,-128,!0)}};Qd=(t,i,e,s,n,r)=>{let h=!0,o=i;const l=i+s,a=e-1,c=e+n;for(let f=t;f<=t+1;f++)if(f!==this.md){for(let u=o;u<=l;u++)if(!(u<0||u>=this.sc))for(let o=a;o<=c;o++){if(o<0||o>=this.rc||h&&u=e||u===i))continue;const a=this.pd[f][u][o];if(!a)continue;const d=128*(u-i)+64*(1-s),w=128*(o-e)+64*(1-n),y=((this.Ad[f][u][o]+this.Ad[f][u+1][o]+this.Ad[f][u][o+1]+this.Ad[f][u+1][o+1])/4|0)-((this.Ad[t][i][e]+this.Ad[t][i+1][e]+this.Ad[t][i][e+1]+this.Ad[t][i+1][e+1])/4|0),m=a.Ha;m&&m.Ff&&m.Ff.yr&&this.tw(r,m.Ff,d,y,w,h),m&&m.Nf&&m.Nf.yr&&this.tw(r,m.Nf,d,y,w,h);for(let t=0;t{this.bd++;let h=0;const o=i.Ar,l=i.rn;if(t.yr&&t.mr)for(let r=0;ri.Dr)continue;const u=t.Ar[r]-e;if(ui.Lr)continue;const d=t.pr[r]-n;if(di.Mr)continue;if(i.yr&&i.mr)for(let t=0;t{const h=this.pd[t][i][e];if(!h)return;const o=h.Wa;if(o){const t=o.color;if(0!==t)for(let i=0;i<4;i++)s[n]=t,s[n+1]=t,s[n+2]=t,s[n+3]=t,n+=r;return}const l=h.Ya;if(!l)return;const a=l.shape,c=l.angle,f=l.au,u=l.cu,d=It.od[a],w=It.ld[c];let y=0;if(0===f)for(let t=0;t<4;t++)0!==d[w[y++]]&&(s[n]=u),0!==d[w[y++]]&&(s[n+1]=u),0!==d[w[y++]]&&(s[n+2]=u),0!==d[w[y++]]&&(s[n+3]=u),n+=r;else for(let t=0;t<4;t++)s[n]=0===d[w[y++]]?f:u,s[n+1]=0===d[w[y++]]?f:u,s[n+2]=0===d[w[y++]]?f:u,s[n+3]=0===d[w[y++]]?f:u,n+=r};click=(t,i)=>{It.ju=!0,It.Xe=t,It.je=i,It.ud=-1,It.dd=-1};draw=(t,i,e,s,n,r,h)=>{t<0?t=0:t>=128*this.sc&&(t=128*this.sc-1),e<0?e=0:e>=128*this.rc&&(e=128*this.rc-1),It.Yi++,It.Mu=F.sin[r],It.ku=F.cos[r],It.Du=F.sin[n],It.Fu=F.cos[n],It.zu=It.Iu[(r-128)/32|0][n/64|0],It.Nu=t,It.Bu=i,It.Uu=e,It.Pu=t/128|0,It.Gu=e/128|0,It.Ku=s,It.Wu=It.Pu-25,It.Wu<0&&(It.Wu=0),It.Hu=It.Gu-25,It.Hu<0&&(It.Hu=0),It.Yu=It.Pu+25,It.Yu>this.sc&&(It.Yu=this.sc),It.Vu=It.Gu+25,It.Vu>this.rc&&(It.Vu=this.rc),this.sw(),It.Xu=0;for(let t=this.Td;t=2e3)?(h.visible=!0,h.update=!0,h.Ja=h.za>0,It.Xu++):(h.visible=!1,h.update=!1,h.$a=0))}}for(let t=this.Td;t=It.Yu))for(let t=-25;t<=0;t++){const n=It.Gu+t,r=It.Gu-t;let o;if(e>=It.Wu&&(n>=It.Hu&&(o=i[e][n],o&&o.visible&&this.nw(o,!0,h)),r=It.Hu&&(o=i[s][n],o&&o.visible&&this.nw(o,!0,h)),r=It.Yu))for(let t=-25;t<=0;t++){const n=It.Gu+t,r=It.Gu-t;let o;if(e>=It.Wu&&(n>=It.Hu&&(o=i[e][n],o&&o.visible&&this.nw(o,!1,h)),r=It.Hu&&(o=i[s][n],o&&o.visible&&this.nw(o,!1,h)),r{if(!l&&!a)return!1;for(let t=n;t=this.sc||i>=this.rc)return!1;const e=this.pd[s][t][i];if(e&&e.za>=5)return!1}const w=new nt(s,e,t,i,l,a,u,n,n+h-1,r,r+o-1,c,f);for(let t=n;tn&&(e|=1),tr&&(e+=8),i=0;e--)this.pd[e][t][i]||(this.pd[e][t][i]=new rt(e,t,i));const l=this.pd[s][t][i];l&&(l.Pa[l.za]=w,l.Ga[l.za]=e,l.Za|=e,l.za++)}return d&&(this._d[this.Ed++]=w),!0};Vd=t=>{for(let i=t.Ma;i<=t.ka;i++)for(let e=t.Da;e<=t.Fa;e++){const s=this.pd[t.level][i][e];if(s){for(let i=0;i{const t=It.Cu[It.Ku],i=It.Eu[It.Ku];It.fd=0;for(let e=0;e=0&&s<=50){n=t.nc+25-It.Gu,n<0&&(n=0),r=t.rc+25-It.Gu,r>50&&(r=50);let i=!1;for(;n<=r;)if(It.zu&&It.zu[s][n++]){i=!0;break}if(i){if(h=It.Nu-t.vr,h>32)t.mode=1;else{if(h>=-32)continue;t.mode=2,h=-h}t.lc=(t.Sr-It.Uu<<8)/h|0,t.ac=(t.Mr-It.Uu<<8)/h|0,t.cc=(t.Dr-It.Bu<<8)/h|0,t.fc=(t.Fr-It.Bu<<8)/h|0,It.Tu[It.fd++]=t}}}else if(2===t.type){if(s=t.nc+25-It.Gu,s>=0&&s<=50){n=t.ec+25-It.Pu,n<0&&(n=0),r=t.sc+25-It.Pu,r>50&&(r=50);let i=!1;for(;n<=r;)if(It.zu&&It.zu[n++][s]){i=!0;break}if(i){if(h=It.Uu-t.Sr,h>32)t.mode=3;else{if(h>=-32)continue;t.mode=4,h=-h}t.hc=(t.vr-It.Nu<<8)/h|0,t.oc=(t.Lr-It.Nu<<8)/h|0,t.cc=(t.Dr-It.Bu<<8)/h|0,t.fc=(t.Fr-It.Bu<<8)/h|0,It.Tu[It.fd++]=t}}}else if(4===t.type&&(s=t.Dr-It.Bu,s>128&&(n=t.nc+25-It.Gu,n<0&&(n=0),r=t.rc+25-It.Gu,r>50&&(r=50),n<=r))){let i=t.ec+25-It.Pu;i<0&&(i=0),h=t.sc+25-It.Pu,h>50&&(h=50);let e=!1;t:for(let t=i;t<=h;t++)for(let i=n;i<=r;i++)if(It.zu&&It.zu[t][i]){e=!0;break t}e&&(t.mode=5,t.hc=(t.vr-It.Nu<<8)/s|0,t.oc=(t.Lr-It.Nu<<8)/s|0,t.lc=(t.Sr-It.Uu<<8)/s|0,t.ac=(t.Mr-It.Uu<<8)/s|0,It.Tu[It.fd++]=t)}}};nw=(t,i,e)=>{for(It.bu.Mt(t);;){let t;do{if(t=It.bu.Dt(),!t)return}while(!t.update);const s=t.x,n=t.z,r=t.level,h=t.Ua,o=this.pd[r];if(t.visible){if(i){if(r>0){const t=this.pd[r-1][s][n];if(t&&t.update)continue}if(s<=It.Pu&&s>It.Wu){const i=o[s-1][n];if(i&&i.update&&(i.visible||!(1&t.Za)))continue}if(s>=It.Pu&&sIt.Hu){const i=o[s][n-1];if(i&&i.update&&(i.visible||!(8&t.Za)))continue}if(n>=It.Gu&&nn&&(a+=6),c=It.Zu[a],t.ic=It.Ju[a]),f&&(f.kf&It.qu[a]?16===f.kf?(t.$a=3,t.Qa=It.$u[a],t.tc=3-t.Qa):32===f.kf?(t.$a=6,t.Qa=It.Qu[a],t.tc=6-t.Qa):64===f.kf?(t.$a=12,t.Qa=It.td[a],t.tc=12-t.Qa):(t.$a=9,t.Qa=It.ed[a],t.tc=9-t.Qa):t.$a=0,f.kf&c&&!this.lw(h,s,n,f.kf)&&f.Ff?.draw(0,It.Mu,It.ku,It.Du,It.Fu,f.x-It.Nu,f.y-It.Bu,f.z-It.Uu,f.Na),f.Df&c&&!this.lw(h,s,n,f.Df)&&f.Nf?.draw(0,It.Mu,It.ku,It.Du,It.Fu,f.x-It.Nu,f.y-It.Bu,f.z-It.Uu,f.Na)),u&&!this.visible(h,s,n,u.model.Fr))if(u.type&c)u.model.draw(u.angle,It.Mu,It.ku,It.Du,It.Fu,u.x-It.Nu,u.y-It.Bu,u.z-It.Uu,u.Na);else if(768&u.type){const t=u.x-It.Nu,i=u.y-It.Bu,e=u.z-It.Uu,s=u.angle;let n,r;if(n=s===lt.Kc||s===lt.Xc?-t:t,r=s===lt.Xc||s===lt.jc?-e:e,256&u.type&&rn){const n=t+It.rd[s],r=e+It.hd[s];u.model.draw(512*s+1280&2047,It.Mu,It.ku,It.Du,It.Fu,n,i,r,u.Na)}}if(l){const i=t.Ka;i&&i.model?.draw(0,It.Mu,It.ku,It.Du,It.Fu,i.x-It.Nu,i.y-It.Bu,i.z-It.Uu,i.Na);const e=t.Xa;e&&0===e.offset&&(e.Pf&&e.Pf.draw(0,It.Mu,It.ku,It.Du,It.Fu,e.x-It.Nu,e.y-It.Bu,e.z-It.Uu,e.Na),e.Uf&&e.Uf.draw(0,It.Mu,It.ku,It.Du,It.Fu,e.x-It.Nu,e.y-It.Bu,e.z-It.Uu,e.Na),e.Bf&&e.Bf.draw(0,It.Mu,It.ku,It.Du,It.Fu,e.x-It.Nu,e.y-It.Bu,e.z-It.Uu,e.Na))}const d=t.Za;if(0!==d){if(sIt.Pu&&1&d){const t=o[s-1][n];t&&t.update&&It.bu.Mt(t)}if(n>It.Gu&&8&d){const t=o[s][n-1];t&&t.update&&It.bu.Mt(t)}}}if(0!==t.$a){let i=!0;for(let e=0;ei.Ma&&(r+=1),ei.Da&&(r+=8),ss&&(s=n);const h=It.Gu-i.Da,l=i.Fa-It.Gu;i.Ba=l>h?s+l:s+h}for(;;){let t=-50,i=-1;for(let e=0;et&&(t=s.Ba,i=e))}if(-1===i)break;const l=It.gu[i];if(l){l.Yi=It.Yi;let t=l.model;t||(t=l.Sa?.draw(e)??null),t&&!this.aw(h,l.Ma,l.ka,l.Da,l.Fa,t.Fr)&&t.draw(l.xa,It.Mu,It.ku,It.Du,It.Fu,l.x-It.Nu,l.y-It.Bu,l.z-It.Uu,l.Na);for(let t=l.Ma;t<=l.ka;t++)for(let i=l.Da;i<=l.Fa;i++){const e=o[t][i];e&&(0!==e.$a?It.bu.Mt(e):t===s&&i===n||!e.update||It.bu.Mt(e))}}}if(t.Ja)continue}if(!t.update||0!==t.$a)continue;if(s<=It.Pu&&s>It.Wu){const t=o[s-1][n];if(t&&t.update)continue}if(s>=It.Pu&&sIt.Hu){const t=o[s][n-1];if(t&&t.update)continue}if(n>=It.Gu&&n=r){const r=t+It.sd[n],h=s+It.nd[n];i.model.draw(512*n+256,It.Mu,It.ku,It.Du,It.Fu,r,e,h,i.Na)}if(512&i.type&&h<=r){const r=t+It.rd[n],h=s+It.hd[n];i.model.draw(512*n+1280&2047,It.Mu,It.ku,It.Du,It.Fu,r,e,h,i.Na)}}const e=t.Ha;e&&(e.Df&t.ic&&!this.lw(h,s,n,e.Df)&&e.Nf?.draw(0,It.Mu,It.ku,It.Du,It.Fu,e.x-It.Nu,e.y-It.Bu,e.z-It.Uu,e.Na),e.kf&t.ic&&!this.lw(h,s,n,e.kf)&&e.Ff?.draw(0,It.Mu,It.ku,It.Du,It.Fu,e.x-It.Nu,e.y-It.Bu,e.z-It.Uu,e.Na))}if(rIt.Pu){const t=o[s-1][n];t&&t.update&&It.bu.Mt(t)}if(n>It.Gu){const t=o[s][n-1];t&&t.update&&It.bu.Mt(t)}}};hw=(t,i,e,s,n,r,h,o)=>{let l,a,c,f,u=l=(e<<7)-It.Nu,d=a=(s<<7)-It.Uu,w=c=u+128,y=f=d+128,A=this.Ad[i][e][s]-It.Bu,p=this.Ad[i][e+1][s]-It.Bu,_=this.Ad[i][e+1][s+1]-It.Bu,I=this.Ad[i][e][s+1]-It.Bu,g=d*h+u*o>>16;if(d=d*o-u*h>>16,u=g,g=A*r-d*n>>16,d=A*n+d*r>>16,A=g,d<50)return;if(g=a*h+w*o>>16,a=a*o-w*h>>16,w=g,g=p*r-a*n>>16,a=p*n+a*r>>16,p=g,a<50)return;if(g=y*h+c*o>>16,y=y*o-c*h>>16,c=g,g=_*r-y*n>>16,y=_*n+y*r>>16,_=g,y<50)return;if(g=f*h+l*o>>16,f=f*o-l*h>>16,l=g,g=I*r-f*n>>16,f=I*n+f*r>>16,I=g,f<50)return;const C=F.Fi+((u<<9)/d|0),E=F.Ni+((A<<9)/d|0),T=F.Fi+((w<<9)/a|0),b=F.Ni+((p<<9)/a|0),R=F.Fi+((c<<9)/y|0),O=F.Ni+((_<<9)/y|0),v=F.Fi+((l<<9)/f|0),L=F.Ni+((I<<9)/f|0);if(F.alpha=0,(R-v)*(b-L)-(O-L)*(T-v)>0)if(F.Ui=R<0||v<0||T<0||R>m.wt||v>m.wt||T>m.wt,It.ju&&this.cw(It.Xe,It.je,O,L,b,R,v,T)&&(It.ud=e,It.dd=s),-1===t.Vf)12345678!==t.Yf&&F.ne(R,v,T,O,L,b,t.Yf,t.Hf,t.Wf);else if(It.Li){const i=It.ad[t.Vf];F.ne(R,v,T,O,L,b,this.fw(i,t.Yf),this.fw(i,t.Hf),this.fw(i,t.Wf))}else t.flat?F.le(R,v,T,O,L,b,t.Yf,t.Hf,t.Wf,u,A,d,w,l,p,I,a,f,t.Vf):F.le(R,v,T,O,L,b,t.Yf,t.Hf,t.Wf,c,_,y,l,w,I,p,f,a,t.Vf);if(!((C-T)*(L-b)-(E-b)*(v-T)<=0))if(F.Ui=C<0||T<0||v<0||C>m.wt||T>m.wt||v>m.wt,It.ju&&this.cw(It.Xe,It.je,E,b,L,C,T,v)&&(It.ud=e,It.dd=s),-1!==t.Vf){if(!It.Li)return void F.le(C,T,v,E,b,L,t.Gf,t.Wf,t.Hf,u,A,d,w,l,p,I,a,f,t.Vf);const i=It.ad[t.Vf];F.ne(C,T,v,E,b,L,this.fw(i,t.Gf),this.fw(i,t.Wf),this.fw(i,t.Hf))}else 12345678!==t.Gf&&F.ne(C,T,v,E,b,L,t.Gf,t.Wf,t.Hf)};ow=(t,i,e,s,n,r,h)=>{let o=e.Ar.length;for(let t=0;t>16;if(l=l*h-i*r>>16,i=a,a=o*n-l*s>>16,l=o*s+l*n>>16,o=a,l<50)return;e.lu&&(pt.jf[t]=i,pt.zf[t]=o,pt.Zf[t]=l),pt.Kf[t]=F.Fi+((i<<9)/l|0),pt.Xf[t]=F.Ni+((o<<9)/l|0)}F.alpha=0,o=e.ru.length;for(let s=0;s0)if(F.Ui=o<0||l<0||a<0||o>m.wt||l>m.wt||a>m.wt,It.ju&&this.cw(It.Xe,It.je,c,f,u,o,l,a)&&(It.ud=t,It.dd=i),e.lu&&-1!==e.lu[s])if(It.Li){const t=It.ad[e.lu[s]];F.ne(o,l,a,c,f,u,this.fw(t,e.eu[s]),this.fw(t,e.su[s]),this.fw(t,e.nu[s]))}else e.flat?F.le(o,l,a,c,f,u,e.eu[s],e.su[s],e.nu[s],pt.jf[0],pt.zf[0],pt.Zf[0],pt.jf[1],pt.jf[3],pt.zf[1],pt.zf[3],pt.Zf[1],pt.Zf[3],e.lu[s]):F.le(o,l,a,c,f,u,e.eu[s],e.su[s],e.nu[s],pt.jf[n],pt.zf[n],pt.Zf[n],pt.jf[r],pt.jf[h],pt.zf[r],pt.zf[h],pt.Zf[r],pt.Zf[h],e.lu[s]);else 12345678!==e.eu[s]&&F.ne(o,l,a,c,f,u,e.eu[s],e.su[s],e.nu[s])}};rw=(t,i,e)=>{const s=this.Id[t][i][e];if(s===-It.Yi)return!1;if(s===It.Yi)return!0;{const s=i<<7,n=e<<7;return this.uw(s+1,this.Ad[t][i][e],n+1)&&this.uw(s+128-1,this.Ad[t][i+1][e],n+1)&&this.uw(s+128-1,this.Ad[t][i+1][e+1],n+128-1)&&this.uw(s+1,this.Ad[t][i][e+1],n+128-1)?(this.Id[t][i][e]=It.Yi,!0):(this.Id[t][i][e]=-It.Yi,!1)}};lw=(t,i,e,s)=>{if(!this.rw(t,i,e))return!1;const n=i<<7,r=e<<7,h=this.Ad[t][i][e]-1,o=h-120,l=h-230,a=h-238;if(s<16){if(1===s){if(n>It.Nu){if(!this.uw(n,h,r))return!1;if(!this.uw(n,h,r+128))return!1}if(t>0){if(!this.uw(n,o,r))return!1;if(!this.uw(n,o,r+128))return!1}return!!this.uw(n,l,r)&&this.uw(n,l,r+128)}if(2===s){if(r0){if(!this.uw(n,o,r+128))return!1;if(!this.uw(n+128,o,r+128))return!1}return!!this.uw(n,l,r+128)&&this.uw(n+128,l,r+128)}if(4===s){if(n0){if(!this.uw(n+128,o,r))return!1;if(!this.uw(n+128,o,r+128))return!1}return!!this.uw(n+128,l,r)&&this.uw(n+128,l,r+128)}if(8===s){if(r>It.Uu){if(!this.uw(n,h,r))return!1;if(!this.uw(n+128,h,r))return!1}if(t>0){if(!this.uw(n,o,r))return!1;if(!this.uw(n+128,o,r))return!1}return!!this.uw(n,l,r)&&this.uw(n+128,l,r)}}return!!this.uw(n+64,a,r+64)&&(16===s?this.uw(n,l,r+128):32===s?this.uw(n+128,l,r+128):64===s?this.uw(n+128,l,r):128===s?this.uw(n,l,r):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,i,e,s)=>{if(this.rw(t,i,e)){const n=i<<7,r=e<<7;return this.uw(n+1,this.Ad[t][i][e]-s,r+1)&&this.uw(n+128-1,this.Ad[t][i+1][e]-s,r+1)&&this.uw(n+128-1,this.Ad[t][i+1][e+1]-s,r+128-1)&&this.uw(n+1,this.Ad[t][i][e+1]-s,r+128-1)}return!1};aw=(t,i,e,s,n,r)=>{let h,o;if(i!==e||s!==n){for(h=i;h<=e;h++)for(o=s;o<=n;o++)if(this.Id[t][h][o]===-It.Yi)return!1;o=1+(i<<7);const l=2+(s<<7),a=this.Ad[t][i][s]-r;if(!this.uw(o,a,l))return!1;const c=(e<<7)-1;if(!this.uw(c,a,l))return!1;const f=(n<<7)-1;return!!this.uw(o,a,f)&&this.uw(c,a,f)}return!!this.rw(t,i,s)&&(h=i<<7,o=s<<7,this.uw(h+1,this.Ad[t][i][s]-r,o+1)&&this.uw(h+128-1,this.Ad[t][i+1][s]-r,o+1)&&this.uw(h+128-1,this.Ad[t][i+1][s+1]-r,o+128-1)&&this.uw(h+1,this.Ad[t][i][s+1]-r,o+128-1))};uw=(t,i,e)=>{for(let s=0;s0){const t=n.Sr+(n.lc*s>>8),r=n.Mr+(n.ac*s>>8),h=n.Dr+(n.cc*s>>8),o=n.Fr+(n.fc*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(2===n.mode){const s=t-n.vr;if(s>0){const t=n.Sr+(n.lc*s>>8),r=n.Mr+(n.ac*s>>8),h=n.Dr+(n.cc*s>>8),o=n.Fr+(n.fc*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(3===n.mode){const s=n.Sr-e;if(s>0){const e=n.vr+(n.hc*s>>8),r=n.Lr+(n.oc*s>>8),h=n.Dr+(n.cc*s>>8),o=n.Fr+(n.fc*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(4===n.mode){const s=e-n.Sr;if(s>0){const e=n.vr+(n.hc*s>>8),r=n.Lr+(n.oc*s>>8),h=n.Dr+(n.cc*s>>8),o=n.Fr+(n.fc*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(5===n.mode){const s=i-n.Dr;if(s>0){const i=n.vr+(n.hc*s>>8),r=n.Lr+(n.oc*s>>8),h=n.Sr+(n.lc*s>>8),o=n.Mr+(n.ac*s>>8);if(t>=i&&t<=r&&e>=h&&e<=o)return!0}}}return!1};cw=(t,i,e,s,n,r,h,o)=>{if(ie&&i>s&&i>n)return!1;if(tr&&t>h&&t>o)return!1;const l=(i-s)*(o-h)-(t-h)*(n-s);return((i-e)*(h-r)-(t-r)*(s-e))*l>0&&l*((i-n)*(r-o)-(t-o)*(e-n))>0};fw=(t,i)=>((i=(127-i)*(127&t)/160|0)<2?i=2:i>126&&(i=126),(65408&t)+i)}class gt{id;dw=null;constructor(t){this.id=t}ww(t){for(;;){const i=t.Zt;if(0===i)break;this.decode(i,t)}return this}}class Ct extends gt{static count=0;static tn=[];static en=t=>{const i=new R(t.read('flo.dat'));this.count=i.Jt;for(let t=0;t(e>179&&(i=i/2|0),e>192&&(i=i/2|0),e>217&&(i=i/2|0),e>243&&(i=i/2|0),(t/4<<10)+(i/32<<7)+(e/2|0));static mw=(t,i)=>-1===t?12345678:((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);static Aw=(t,i)=>-2===t?12345678:-1===t?(i<0?i=0:i>127&&(i=127),127-i):((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);pw=0;texture=-1;_w=!1;Iw=!0;gw=0;Cw=0;Ew=0;Tw=0;bw=0;Rw=0;decode(t,i){1===t?(this.pw=i.Qt,this.setColor(this.pw)):2===t?this.texture=i.Zt:3===t?this._w=!0:5===t?this.Iw=!1:6===t?this.dw=i.ni:console.log('Error unrecognised config code: ',t)}setColor(t){const i=(t>>16&255)/256,e=(t>>8&255)/256,s=(255&t)/256;let n=i;ei&&(r=e),s>r&&(r=s);let h=0,o=0;const l=(n+r)/2;n!==r&&(l<.5&&(o=(r-n)/(r+n)),l>=.5&&(o=(r-n)/(2-r-n)),i===r?h=(e-s)/(r-n):e===r?h=(s-i)/(r-n)+2:s===r&&(h=(i-e)/(r-n)+4)),h/=6,this.gw=256*h|0,this.Cw=256*o|0,this.Ew=256*l|0,this.Cw<0?this.Cw=0:this.Cw>255&&(this.Cw=255),this.Ew<0?this.Ew=0:this.Ew>255&&(this.Ew=255),this.Tw=l>.5?(1-l)*o*512|0:l*o*512|0,this.Tw<1&&(this.Tw=1),this.bw=h*this.Tw|0;let a=this.gw+(16*Math.random()|0)-8;a<0?a=0:a>255&&(a=255);let c=this.Cw+(48*Math.random()|0)-24;c<0?c=0:c>255&&(c=255);let f=this.Ew+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255),this.Rw=Ct.yw(a,c,f)}}class Et extends gt{static count=0;static cache=null;static Zs=null;static Ow=null;static Lw=0;static Sw=new q(500);static xw=new q(30);static en=t=>{this.Zs=new R(t.read('loc.dat'));const i=new R(t.read('loc.idx'));this.count=i.Jt,this.Ow=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.Ow||!this.Zs)throw new Error('LocType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Lw=(this.Lw+1)%10;const i=this.cache[this.Lw];return this.Zs.Xt=this.Ow[t],i.id=t,i.reset(),i.ww(this.Zs),i.Mw||(i.Mw=new Int32Array(1)),-1===i.kw&&i.Mw&&(i.active=i.Mw.length>0&&i.Mw[0]===ct.af.id,i.Dw&&(i.active=!0)),i};static zi=()=>{this.Sw=null,this.xw=null,this.Ow=null,this.cache=null,this.Zs=null};Fw=null;Mw=null;name=null;Nw=null;Bw=null;Uw=null;width=1;length=1;Pw=!0;Gw=!0;active=!1;kw=-1;Ww=!1;Yw=!1;Iw=!1;Gl=-1;Hw=!1;Vw=16;Kw=0;Xw=0;Dw=null;jw=-1;zw=-1;Zw=!1;qw=!0;Jw=128;$w=128;Qw=128;ty=0;iy=0;ey=0;sy=0;ny=!1;decode(t,i){if(1===t){const t=i.Zt;this.Fw=new Int32Array(t),this.Mw=new Int32Array(t);for(let e=0;e=30&&t<39)this.Dw||(this.Dw=new v(5,null)),this.Dw[t-30]=i.ni,'hidden'===this.Dw[t-30]?.toLowerCase()&&(this.Dw[t-30]=null);else if(40===t){const t=i.Zt;this.Bw=new Uint16Array(t),this.Uw=new Uint16Array(t);for(let e=0;e=this.Fw.length)return null;let c=this.Fw[o];if(-1===c)return null;const f=this.Zw!==i>3;f&&(c+=65536);let u=Et.Sw?.get(BigInt(c));u||(u=j.model(65535&c),f&&u.hh(),Et.Sw?.put(BigInt(c),u));const d=128!==this.Jw||128!==this.$w||128!==this.Qw,w=0!==this.iy||0!==this.ey||0!==this.sy;let y=j.Ur(u,!this.Bw,!this.Hw,i===lt.Vc&&-1===h&&!d&&!w);for(-1!==h&&(y.Qr(),y.eh(h),y.Hr=null,y.Yr=null);i-- >0;)y.sh();if(this.Bw&&this.Uw)for(let t=0;t{const i=new R(t.read('seq.dat'));this.count=i.Jt;for(let t=0;t{let e=this.lA(t+45365,i+91923,4)+(this.lA(t+10294,i+37821,2)-128>>1)+(this.lA(t,i,1)-128>>2)-128;return e=35+(.3*e|0),e<10?e=10:e>60&&(e=60),e};static lA=(t,i,e)=>{const s=t/e|0,n=t&e-1,r=i/e|0,h=i&e-1,o=this.aA(s,r),l=this.aA(s+1,r),a=this.aA(s,r+1),c=this.aA(s+1,r+1),f=this.cA(o,l,n,e),u=this.cA(a,c,n,e);return this.cA(f,u,h,e)};static cA=(t,i,e,s)=>{const n=65536-F.cos[1024*e/s|0]>>1;return(t*(65536-n)>>16)+(i*n>>16)};static aA=(t,i)=>((this.fA(t-1,i-1)+this.fA(t+1,i-1)+this.fA(t-1,i+1)+this.fA(t+1,i+1))/16|0)+((this.fA(t-1,i)+this.fA(t+1,i)+this.fA(t,i-1)+this.fA(t,i+1))/8|0)+(this.fA(t,i)/4|0);static fA=(t,i)=>{const e=t+57*i,s=BigInt(e<<13^e);return 255&Number((s*(s*s*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static Rf=(t,i,e,s,n,r,h,o,l,a,c)=>{const f=n[c][i][e],u=n[c][i+1][e],d=n[c][i+1][e+1],w=n[c][i][e+1],y=f+u+d+w>>2,m=Et.get(o);let A=i+(e<<7)+(o<<14)+1073741824|0;m.active||(A+=-2147483648),A|=0;const p=(a<<6)+l<<24>>24;if(l===ct.Jc.id)s?.Sd(m.Ul(ct.Jc.id,a,f,u,d,w,-1),t,i,e,y,A,p),m.Pw&&m.active&&h?.Tf(i,e),-1!==m.Gl&&r.Mt(new Tt(o,t,3,i,e,bt.tn[m.Gl],!0));else if(l===ct.af.id||l===ct.cf.id){const n=m.Ul(ct.af.id,a,f,u,d,w,-1);if(n){let r,h,o=0;l===ct.cf.id&&(o+=256),a===lt.Kc||a===lt.jc?(r=m.length,h=m.width):(r=m.width,h=m.length),s?.Rf(t,i,e,y,n,null,A,p,r,h,o)}m.Pw&&h?.Rf(i,e,m.width,m.length,a,m.Gw),-1!==m.Gl&&r.Mt(new Tt(o,t,2,i,e,bt.tn[m.Gl],!0))}else if(l>=ct.ff.id)s?.Rf(t,i,e,y,m.Ul(l,a,f,u,d,w,-1),null,A,p,1,1,0),m.Pw&&h?.Rf(i,e,m.width,m.length,a,m.Gw),-1!==m.Gl&&r.Mt(new Tt(o,t,2,i,e,bt.tn[m.Gl],!0));else if(l===ct.$c.id)s?.vf(t,i,e,y,Ot.Qm[a],0,m.Ul(ct.$c.id,a,f,u,d,w,-1),null,A,p),m.Pw&&h?.vf(i,e,l,a,m.Gw),-1!==m.Gl&&r.Mt(new Tt(o,t,0,i,e,bt.tn[m.Gl],!0));else if(l===ct.Qc.id)s?.vf(t,i,e,y,Ot.tA[a],0,m.Ul(ct.Qc.id,a,f,u,d,w,-1),null,A,p),m.Pw&&h?.vf(i,e,l,a,m.Gw),-1!==m.Gl&&r.Mt(new Tt(o,t,0,i,e,bt.tn[m.Gl],!0));else if(l===ct.tf.id){const n=a+1&3;s?.vf(t,i,e,y,Ot.Qm[a],Ot.Qm[n],m.Ul(ct.tf.id,a+4,f,u,d,w,-1),m.Ul(ct.tf.id,n,f,u,d,w,-1),A,p),m.Pw&&h?.vf(i,e,l,a,m.Gw),-1!==m.Gl&&r.Mt(new Tt(o,t,0,i,e,bt.tn[m.Gl],!0))}else if(l===ct.if.id)s?.vf(t,i,e,y,Ot.tA[a],0,m.Ul(ct.if.id,a,f,u,d,w,-1),null,A,p),m.Pw&&h?.vf(i,e,l,a,m.Gw),-1!==m.Gl&&r.Mt(new Tt(o,t,0,i,e,bt.tn[m.Gl],!0));else if(l===ct.lf.id)s?.Rf(t,i,e,y,m.Ul(l,a,f,u,d,w,-1),null,A,p,1,1,0),m.Pw&&h?.Rf(i,e,m.width,m.length,a,m.Gw),-1!==m.Gl&&r.Mt(new Tt(o,t,2,i,e,bt.tn[m.Gl],!0));else if(l===ct.ef.id)s?.Dd(t,i,e,y,0,0,A,m.Ul(ct.ef.id,lt.Vc,f,u,d,w,-1),p,512*a,Ot.Qm[a]),-1!==m.Gl&&r.Mt(new Tt(o,t,1,i,e,bt.tn[m.Gl],!0));else if(l===ct.sf.id){let n=16;if(s){const r=s.jd(t,i,e);r>0&&(n=Et.get(r>>14&32767).Vw)}s?.Dd(t,i,e,y,Ot.iA[a]*n,Ot.eA[a]*n,A,m.Ul(ct.ef.id,lt.Vc,f,u,d,w,-1),p,512*a,Ot.Qm[a]),-1!==m.Gl&&r.Mt(new Tt(o,t,1,i,e,bt.tn[m.Gl],!0))}else l===ct.nf.id?(s?.Dd(t,i,e,y,0,0,A,m.Ul(ct.ef.id,lt.Vc,f,u,d,w,-1),p,a,256),-1!==m.Gl&&r.Mt(new Tt(o,t,1,i,e,bt.tn[m.Gl],!0))):l===ct.rf.id?(s?.Dd(t,i,e,y,0,0,A,m.Ul(ct.ef.id,lt.Vc,f,u,d,w,-1),p,a,512),-1!==m.Gl&&r.Mt(new Tt(o,t,1,i,e,bt.tn[m.Gl],!0))):l===ct.hf.id&&(s?.Dd(t,i,e,y,0,0,A,m.Ul(ct.ef.id,lt.Vc,f,u,d,w,-1),p,a,768),-1!==m.Gl&&r.Mt(new Tt(o,t,1,i,e,bt.tn[m.Gl],!0)))};sc;rc;uA;dA;wA;yA;mA;AA;pA;_A;IA;gA;CA;EA;TA;bA;constructor(t,i,e,s){this.sc=t,this.rc=i,this.uA=e,this.dA=s,this.wA=new M(ut.gf,t,i),this.yA=new M(ut.gf,t,i),this.mA=new M(ut.gf,t,i),this.AA=new M(ut.gf,t,i),this.bA=new D(ut.gf,t+1,i+1),this.pA=new M(ut.gf,t+1,i+1),this._A=new k(t+1,i+1),this.IA=new Int32Array(i),this.gA=new Int32Array(i),this.CA=new Int32Array(i),this.EA=new Int32Array(i),this.TA=new Int32Array(i)}RA=(t,i)=>{for(let t=0;t=0&&i[n]?.Tf(e,s)}Ot.sA+=(5*Math.random()|0)-2,Ot.sA<-8?Ot.sA=-8:Ot.sA>8&&(Ot.sA=8),Ot.nA+=(5*Math.random()|0)-2,Ot.nA<-16?Ot.nA=-16:Ot.nA>16&&(Ot.nA=16);for(let i=0;i>8;for(let t=1;t>2)+(e[l+1][t]>>3)+(e[l][t-1]>>2)+(e[l][t+1]>>3)+(e[l][t]>>1);this._A[l][t]=u-d}for(let t=0;t=0&&s0){const i=Ct.tn[e-1];this.IA[t]+=i.bw,this.gA[t]+=i.Cw,this.CA[t]+=i.Ew,this.EA[t]+=i.Tw,n=this.TA[t]++}}const r=e-5;if(r>=0&&r0){const i=Ct.tn[e-1];this.IA[t]-=i.bw,this.gA[t]-=i.Cw,this.CA[t]-=i.Ew,this.EA[t]-=i.Tw,n=this.TA[t]--}}}if(e>=1&&e=0&&a=0&&c=1&&l0||c>0){const f=this.uA[i][e][l],u=this.uA[i][e+1][l],d=this.uA[i][e+1][l+1],w=this.uA[i][e][l+1],y=this._A[e][l],m=this._A[e+1][l],A=this._A[e+1][l+1],p=this._A[e][l+1];let _=-1,I=-1;if(a>0){const t=256*s/h|0,i=n/o|0;let e=r/o|0;_=Ct.yw(t,i,e);const l=t+Ot.sA&255;e+=Ot.nA,e<0?e=0:e>255&&(e=255),I=Ct.yw(l,i,e)}if(i>0){let t=0!==a||this.mA[i][e][l]===_t.fu;c>0&&!Ct.tn[c-1].Iw&&(t=!1),t&&f===u&&f===d&&f===w&&(this.bA[i][e][l]|=2340)}let g=0;if(-1!==_&&(g=F.palette[Ct.mw(I,96)]),0===c)t?.Ld(i,e,l,_t.fu,lt.Vc,-1,f,u,d,w,Ct.mw(_,y),Ct.mw(_,m),Ct.mw(_,A),Ct.mw(_,p),Rt.Oy,Rt.Oy,Rt.Oy,Rt.Oy,g,Rt.Oy);else{const s=this.mA[i][e][l]+1,n=this.AA[i][e][l],r=Ct.tn[c-1];let h,o,a=r.texture;a>=0?(o=F.Qi(a),h=-1):r.pw===Rt.by?(o=0,h=-2,a=-1):(h=Ct.yw(r.gw,r.Cw,r.Ew),o=F.palette[Ct.Aw(r.Rw,96)]),t?.Ld(i,e,l,s,n,a,f,u,d,w,Ct.mw(_,y),Ct.mw(_,m),Ct.mw(_,A),Ct.mw(_,p),Ct.Aw(h,y),Ct.Aw(h,m),Ct.Aw(h,A),Ct.Aw(h,p),g,o)}}}}}}for(let e=1;e0&&(t<<=3,i<<=3,e<<=3);for(let n=0;n<=s;n++)for(let r=0;r<=this.rc;r++)for(let h=0;h<=this.sc;h++){if(this.bA[n][h][r]&t){let i=r,e=r,o=n,l=n;for(;i>0&&this.bA[n][h][i-1]&t;)i--;for(;e0;){for(let s=i;s<=e;s++)if(!(this.bA[o-1][h][s]&t))break t;o--}t:for(;l=8){const n=this.uA[l][h][i]-240,r=this.uA[o][h][i];It.yd(s,1,128*h,n,128*i,128*h,r,128*e+128);for(let s=o;s<=l;s++)for(let n=i;n<=e;n++)this.bA[s][h][n]&=~t}}if(this.bA[n][h][r]&i){let t=h,e=h,o=n,l=n;for(;t>0&&this.bA[n][t-1][r]&i;)t--;for(;e0;){for(let s=t;s<=e;s++)if(!(this.bA[o-1][s][r]&i))break t;o--}t:for(;l=8){const n=this.uA[l][t][r]-240,h=this.uA[o][t][r];It.yd(s,2,128*t,n,128*r,128*e+128,h,128*r);for(let s=o;s<=l;s++)for(let n=t;n<=e;n++)this.bA[s][n][r]&=~i}}if(this.bA[n][h][r]&e){let t=h,i=h,o=r,l=r;for(;o>0&&this.bA[n][h][o-1]&e;)o--;for(;l0;){for(let i=o;i<=l;i++)if(!(this.bA[n][t-1][i]&e))break t;t--}t:for(;i=4){const r=this.uA[n][t][o];It.yd(s,4,128*t,r,128*o,128*i+128,r,128*l+128);for(let s=t;s<=i;s++)for(let t=o;t<=l;t++)this.bA[n][s][t]&=~e}}}}}};vA=(t,i,e,s)=>{let n=0;for(let t=0;t>24;break}for(let r=t;r=0&&t=0&&r{const r=new R(new Uint8Array(n));for(let n=0;n=0&&l=0&&a>24,this.AA[n][l][a]=(c-2&3)<<24>>24):c<=81?this.dA[n][l][a]=c-49<<24>>24:this.wA[n][l][a]=c-81<<24>>24}else for(;c=r.Zt,0!==c;){if(1===c){r.Zt;break}c<=49&&r.Zt}}};SA=(t,i,e,s,n,r)=>{const h=new R(new Uint8Array(s));let o=-1;for(;;){const s=h.si;if(0===s)return;o+=s;let l=0;for(;;){const s=h.si;if(0===s)break;l+=s-1;const a=63&l,c=l>>6&63,f=l>>12,u=h.Zt,d=u>>2,w=3&u,y=c+n,m=a+r;if(y>0&&m>0&&y=0&&(n=e[s]),this.Rf(f,y,m,t,i,n,o,d,w)}}}};Rf=(t,i,e,s,n,r,h,o,l)=>{if(Ot.Li){if(16&this.dA[t][i][e])return;if(this.OA(t,i,e)!==Ot.rA)return}const a=this.uA[t][i][e],c=this.uA[t][i+1][e],f=this.uA[t][i+1][e+1],u=this.uA[t][i][e+1],d=a+c+f+u>>2,w=Et.get(h);let y=i+(e<<7)+(h<<14)+1073741824|0;w.active||(y+=-2147483648),y|=0;const m=(l<<6)+o<<24>>24;if(o===ct.Jc.id)(!Ot.Li||w.active||w.ny)&&(s?.Sd(w.Ul(ct.Jc.id,l,a,c,f,u,-1),t,i,e,d,y,m),w.Pw&&w.active&&r?.Tf(i,e),-1!==w.Gl&&n.Mt(new Tt(h,t,3,i,e,bt.tn[w.Gl],!0)));else if(o===ct.af.id||o===ct.cf.id){const A=w.Ul(ct.af.id,l,a,c,f,u,-1);if(A){let n,r,h=0;if(o===ct.cf.id&&(h+=256),l===lt.Kc||l===lt.jc?(n=w.length,r=w.width):(n=w.width,r=w.length),s?.Rf(t,i,e,d,A,null,y,m,n,r,h)&&w.qw)for(let s=0;s<=n;s++)for(let n=0;n<=r;n++){let r=A.kr/4|0;r>30&&(r=30),r>this.pA[t][i+s][e+n]&&(this.pA[t][i+s][e+n]=r<<24>>24)}}w.Pw&&r?.Rf(i,e,w.width,w.length,l,w.Gw),-1!==w.Gl&&n.Mt(new Tt(h,t,2,i,e,bt.tn[w.Gl],!0))}else if(o>=ct.ff.id)s?.Rf(t,i,e,d,w.Ul(o,l,a,c,f,u,-1),null,y,m,1,1,0),o>=ct.ff.id&&o<=ct.mf.id&&o!==ct.uf.id&&t>0&&(this.bA[t][i][e]|=2340),w.Pw&&r?.Rf(i,e,w.width,w.length,l,w.Gw),-1!==w.Gl&&n.Mt(new Tt(h,t,2,i,e,bt.tn[w.Gl],!0));else if(o===ct.$c.id)s?.vf(t,i,e,d,Ot.Qm[l],0,w.Ul(ct.$c.id,l,a,c,f,u,-1),null,y,m),l===lt.Vc?(w.qw&&(this.pA[t][i][e]=50,this.pA[t][i][e+1]=50),w.Iw&&(this.bA[t][i][e]|=585)):l===lt.Kc?(w.qw&&(this.pA[t][i][e+1]=50,this.pA[t][i+1][e+1]=50),w.Iw&&(this.bA[t][i][e+1]|=1170)):l===lt.Xc?(w.qw&&(this.pA[t][i+1][e]=50,this.pA[t][i+1][e+1]=50),w.Iw&&(this.bA[t][i+1][e]|=585)):l===lt.jc&&(w.qw&&(this.pA[t][i][e]=50,this.pA[t][i+1][e]=50),w.Iw&&(this.bA[t][i][e]|=1170)),w.Pw&&r?.vf(i,e,o,l,w.Gw),-1!==w.Gl&&n.Mt(new Tt(h,t,0,i,e,bt.tn[w.Gl],!0)),16!==w.Vw&&s?.Nd(t,i,e,w.Vw);else if(o===ct.Qc.id)s?.vf(t,i,e,d,Ot.tA[l],0,w.Ul(ct.Qc.id,l,a,c,f,u,-1),null,y,m),w.qw&&(l===lt.Vc?this.pA[t][i][e+1]=50:l===lt.Kc?this.pA[t][i+1][e+1]=50:l===lt.Xc?this.pA[t][i+1][e]=50:l===lt.jc&&(this.pA[t][i][e]=50)),w.Pw&&r?.vf(i,e,o,l,w.Gw),-1!==w.Gl&&n.Mt(new Tt(h,t,0,i,e,bt.tn[w.Gl],!0));else if(o===ct.tf.id){const A=l+1&3;s?.vf(t,i,e,d,Ot.Qm[l],Ot.Qm[A],w.Ul(ct.tf.id,l+4,a,c,f,u,-1),w.Ul(ct.tf.id,A,a,c,f,u,-1),y,m),w.Iw&&(l===lt.Vc?(this.bA[t][i][e]|=265,this.bA[t][i][e+1]|=1170):l===lt.Kc?(this.bA[t][i][e+1]|=1170,this.bA[t][i+1][e]|=585):l===lt.Xc?(this.bA[t][i+1][e]|=585,this.bA[t][i][e]|=1170):l===lt.jc&&(this.bA[t][i][e]|=1170,this.bA[t][i][e]|=585)),w.Pw&&r?.vf(i,e,o,l,w.Gw),-1!==w.Gl&&n.Mt(new Tt(h,t,0,i,e,bt.tn[w.Gl],!0)),16!==w.Vw&&s?.Nd(t,i,e,w.Vw)}else if(o===ct.if.id)s?.vf(t,i,e,d,Ot.tA[l],0,w.Ul(ct.if.id,l,a,c,f,u,-1),null,y,m),w.qw&&(l===lt.Vc?this.pA[t][i][e+1]=50:l===lt.Kc?this.pA[t][i+1][e+1]=50:l===lt.Xc?this.pA[t][i+1][e]=50:l===lt.jc&&(this.pA[t][i][e]=50)),w.Pw&&r?.vf(i,e,o,l,w.Gw),-1!==w.Gl&&n.Mt(new Tt(h,t,0,i,e,bt.tn[w.Gl],!0));else if(o===ct.lf.id)s?.Rf(t,i,e,d,w.Ul(o,l,a,c,f,u,-1),null,y,m,1,1,0),w.Pw&&r?.Rf(i,e,w.width,w.length,l,w.Gw),-1!==w.Gl&&n.Mt(new Tt(h,t,2,i,e,bt.tn[w.Gl],!0));else if(o===ct.ef.id)s?.Dd(t,i,e,d,0,0,y,w.Ul(ct.ef.id,lt.Vc,a,c,f,u,-1),m,512*l,Ot.Qm[l]),-1!==w.Gl&&n.Mt(new Tt(h,t,1,i,e,bt.tn[w.Gl],!0));else if(o===ct.sf.id){let r=16;if(s){const n=s.jd(t,i,e);n>0&&(r=Et.get(n>>14&32767).Vw)}s?.Dd(t,i,e,d,Ot.iA[l]*r,Ot.eA[l]*r,y,w.Ul(ct.ef.id,lt.Vc,a,c,f,u,-1),m,512*l,Ot.Qm[l]),-1!==w.Gl&&n.Mt(new Tt(h,t,1,i,e,bt.tn[w.Gl],!0))}else o===ct.nf.id?(s?.Dd(t,i,e,d,0,0,y,w.Ul(ct.ef.id,lt.Vc,a,c,f,u,-1),m,l,256),-1!==w.Gl&&n.Mt(new Tt(h,t,1,i,e,bt.tn[w.Gl],!0))):o===ct.rf.id?(s?.Dd(t,i,e,d,0,0,y,w.Ul(ct.ef.id,lt.Vc,a,c,f,u,-1),m,l,512),-1!==w.Gl&&n.Mt(new Tt(h,t,1,i,e,bt.tn[w.Gl],!0))):o===ct.hf.id&&(s?.Dd(t,i,e,d,0,0,y,w.Ul(ct.ef.id,lt.Vc,a,c,f,u,-1),m,l,768),-1!==w.Gl&&n.Mt(new Tt(h,t,1,i,e,bt.tn[w.Gl],!0)))};OA=(t,i,e)=>8&this.dA[t][i][e]?0:t<=0||!(2&this.dA[1][i][e])?t:t-1}class vt extends w{}class Lt extends vt{x=0;z=0;xa=0;xA=!1;size=1;MA=-1;kA=-1;DA=-1;FA=-1;NA=-1;BA=-1;UA=-1;PA=null;GA=100;WA=0;YA=0;HA=0;VA=0;KA=-1e3;XA=0;jA=0;zA=-1;ZA=0;qA=0;JA=-1;$A=0;QA=0;tp=-1;ip=0;ep=0;sp=0;np=0;rp=-1;hp=0;op=0;lp=0;ap=0;cp=0;fp=0;up=0;dp=0;wp=0;yp=0;mp=0;Yi=0;height=0;Ap=0;pathLength=0;pp=new Int32Array(10);_p=new Int32Array(10);Ip=new v(10,!1);gp=0;Cp=-1;Ep=-1;Tp=-1;bp=-1;move(t,i,e){if(-1!==this.tp&&bt.tn[this.tp].priority<=1&&(this.tp=-1),!t){const t=i-this.pp[0],s=e-this._p[0];if(t>=-8&&t<=8&&s>=-8&&s<=8){this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.pp[t]=this.pp[t-1],this._p[t]=this._p[t-1],this.Ip[t]=this.Ip[t-1];return this.pp[0]=i,this._p[0]=e,void(this.Ip[0]=!1)}}this.pathLength=0,this.gp=0,this.pp[0]=i,this._p[0]=e,this.x=128*this.pp[0]+64*this.size,this.z=128*this._p[0]+64*this.size}step(t,i){let e=this.pp[0],s=this._p[0];0===i?(e--,s++):1===i?s++:2===i?(e++,s++):3===i?e--:4===i?e++:5===i?(e--,s--):6===i?s--:7===i&&(e++,s--),-1!==this.tp&&bt.tn[this.tp].priority<=1&&(this.tp=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.pp[t]=this.pp[t-1],this._p[t]=this._p[t-1],this.Ip[t]=this.Ip[t-1];this.pp[0]=e,this._p[0]=s,this.Ip[0]=t}}class St extends gt{static count=0;static tn=[];static Gh=new q(30);static en=t=>{const i=new R(t.read('spotanim.dat'));this.count=i.Jt;for(let t=0;t=40&&t<50)this.Bw[t-40]=i.Jt;else{if(!(t>=50&&t<60))throw new Error(`Unrecognized spotanim config code: ${t}`);this.Uw[t-50]=i.Jt}}Ul(){let t=St.Gh?.get(BigInt(this.id));if(t)return t;t=j.model(this.model);for(let i=0;i<6;i++)0!==this.Bw[0]&&t.rh(this.Bw[i],this.Uw[i]);return St.Gh?.put(BigInt(this.id),t),t}}class xt extends gt{static count=0;static tn=[];static en=t=>{const i=new R(t.read('idk.dat'));this.count=i.Jt;for(let t=0;t=40&&t<50)this.Bw[t-40]=i.Jt;else if(t>=50&&t<60)this.Uw[t-50]=i.Jt;else{if(!(t>=60&&t<70))throw new Error(`Unrecognized idk config code: ${t}`);this.vp[t-60]=i.Jt}}Ul(){if(!this.Fw)return null;const t=new v(this.Fw.length,null);for(let i=0;i{this.Sp=i,this.Zs=new R(t.read('obj.dat'));const e=new R(t.read('obj.idx'));this.count=e.Jt,this.Ow=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.Ow||!this.Zs)throw new Error('ObjType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Lw=(this.Lw+1)%10;const i=this.cache[this.Lw];return this.Zs.Xt=this.Ow[t],i.id=t,i.reset(),i.ww(this.Zs),-1!==i.Mp&&i.kp(),!this.Sp&&i.members&&(i.name='Members Object',i.Nw="Login to a members' server to use this object.",i.Dw=null,i.Dp=null),i};static zi=()=>{this.Gh=null,this.xp=null,this.Ow=null,this.cache=null,this.Zs=null};static Fp=(t,i)=>{if(Mt.xp){let e=Mt.xp.get(BigInt(t));if(e&&e.gi!==i&&-1!==e.gi&&(e.ht(),e=null),e)return e}let e=Mt.get(t);if(e.Np||(i=-1),e.Np&&e.Bp&&i>1){let t=-1;for(let s=0;s<10;s++)i>=e.Bp[s]&&0!==e.Bp[s]&&(t=e.Np[s]);-1!==t&&(e=Mt.get(t))}const s=new J(32,32),n=F.Fi,r=F.Ni,h=F.Di,o=m.ft,l=m.ut,a=m.dt,c=m.left,f=m.right,u=m.top,d=m.bottom;F.Bi=!1,m.bind(s.ft,32,32),m.fillRect(0,0,32,32,Rt.Oy),F.Zi();const w=e.Up(1),y=F.sin[e.Pp]*e.Gp>>16,A=F.cos[e.Pp]*e.Gp>>16;w.fh(0,e.Wp,e.Yp,e.Pp,e.Hp,y+(w.Fr/2|0)+e.Vp,A+e.Vp);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.ft[t+32*i]&&(t>0&&s.ft[t+32*i-1]>1||i>0&&s.ft[t+32*(i-1)]>1||t<31&&s.ft[t+32*i+1]>1||i<31&&s.ft[t+32*(i+1)]>1)&&(s.ft[t+32*i]=1);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.ft[t+32*i]&&t>0&&i>0&&s.ft[t+32*(i-1)-1]>0&&(s.ft[t+32*i]=3153952);if(-1!==e.Mp){const t=this.Fp(e.Kp,10),i=t.Ii,s=t.gi;t.Ii=32,t.gi=32,t.Oi(5,5,22,22),t.Ii=i,t.gi=s}return Mt.xp?.put(BigInt(t),s),m.bind(o,l,a),m._t(c,u,f,d),F.Fi=n,F.Ni=r,F.Di=h,F.Bi=!0,e.Xp?s.Ii=33:s.Ii=32,s.gi=i,s};model=0;name=null;Nw=null;Bw=null;Uw=null;Gp=2e3;Pp=0;Wp=0;Yp=0;Hp=0;Vp=0;jp=!1;zp=-1;Xp=!1;Zp=1;members=!1;Dw=null;Dp=null;qp=-1;Jp=-1;$p=0;Qp=-1;t_=-1;i_=0;e_=-1;s_=-1;n_=-1;r_=-1;h_=-1;o_=-1;Np=null;Bp=null;Kp=-1;Mp=-1;decode(t,i){if(1===t)this.model=i.Jt;else if(2===t)this.name=i.ni;else if(3===t)this.Nw=i.ni;else if(4===t)this.Gp=i.Jt;else if(5===t)this.Pp=i.Jt;else if(6===t)this.Wp=i.Jt;else if(7===t)this.Hp=i.$t,this.Hp>32767&&(this.Hp-=65536);else if(8===t)this.Vp=i.$t,this.Vp>32767&&(this.Vp-=65536);else if(9===t)this.jp=!0;else if(10===t)this.zp=i.Jt;else if(11===t)this.Xp=!0;else if(12===t)this.Zp=i.ti;else if(16===t)this.members=!0;else if(23===t)this.qp=i.Jt,this.$p=i.qt;else if(24===t)this.Jp=i.Jt;else if(25===t)this.Qp=i.Jt,this.i_=i.qt;else if(26===t)this.t_=i.Jt;else if(t>=30&&t<35)this.Dw||(this.Dw=new v(5,null)),this.Dw[t-30]=i.ni,'hidden'===this.Dw[t-30]?.toLowerCase()&&(this.Dw[t-30]=null);else if(t>=35&&t<40)this.Dp||(this.Dp=new v(5,null)),this.Dp[t-35]=i.ni;else if(40===t){const t=i.Zt;this.Bw=new Uint16Array(t),this.Uw=new Uint16Array(t);for(let e=0;e=100&&t<110&&(this.Np&&this.Bp||(this.Np=new Uint16Array(10),this.Bp=new Uint16Array(10)),this.Np[t-100]=i.Jt,this.Bp[t-100]=i.Jt)}l_(t){let i=this.qp;if(1===t&&(i=this.Qp),-1===i)return null;let e=this.Jp,s=this.e_;1===t&&(e=this.t_,s=this.s_);let n=j.model(i);if(-1!==e){const t=j.model(e);if(-1===s){const i=[n,t];n=j.Xr(i,2)}else{const i=[n,t,j.model(s)];n=j.Xr(i,3)}}if(0===t&&0!==this.$p&&n.translate(this.$p,0,0),1===t&&0!==this.i_&&n.translate(this.i_,0,0),this.Bw&&this.Uw)for(let t=0;t1){let i=-1;for(let e=0;e<10;e++)t>=this.Bp[e]&&0!==this.Bp[e]&&(i=this.Np[e]);if(-1!==i)return Mt.get(i).Up(1)}if(Mt.Gh){const t=Mt.Gh.get(BigInt(this.id));if(t)return t}const i=j.model(this.model);if(this.Bw&&this.Uw)for(let t=0;t=this.v_&&(this.M_=null),t>=this.O_&&t=kt.I_[i].length)&&(e=0),this.T_[i]=e}this.MA=t.Jt,65535===this.MA&&(this.MA=-1),this.kA=t.Jt,65535===this.kA&&(this.kA=-1),this.DA=t.Jt,65535===this.DA&&(this.DA=-1),this.FA=t.Jt,65535===this.FA&&(this.FA=-1),this.NA=t.Jt,65535===this.NA&&(this.NA=-1),this.BA=t.Jt,65535===this.BA&&(this.BA=-1),this.UA=t.Jt,65535===this.UA&&(this.UA=-1),this.name=$.Bh($.kh(t.ii)),this.b_=t.Zt,this.visible=!0,this.R_=0n;for(let t=0;t<12;t++)this.R_<<=0x4n,this.E_[t]>=256&&(this.R_+=BigInt(this.E_[t])-256n);this.E_[0]>=256&&(this.R_+=BigInt(this.E_[0])-256n>>4n),this.E_[1]>=256&&(this.R_+=BigInt(this.E_[1])-256n>>8n);for(let t=0;t<5;t++)this.R_<<=0x3n,this.R_+=BigInt(this.T_[t]);this.R_<<=0x1n,this.R_+=BigInt(this.g_)}Lp(){if(!this.visible)return null;const t=new v(12,null);let i=0;for(let e=0;e<12;e++){const s=this.E_[e];if(s>=256&&s<512&&(t[i++]=xt.tn[s-256].Lp()),s>=512){const e=Mt.get(s-512).Lp(this.g_);e&&(t[i++]=e)}}const e=j.Xr(t,i);for(let t=0;t<5;t++)0!==this.T_[t]&&(e.rh(kt.I_[t][0],kt.I_[t][this.T_[t]]),1===t&&e.rh(kt.__[0],kt.__[this.T_[t]]));return e}k_(){let t=this.R_,i=-1,e=-1,s=-1,n=-1;if(this.tp>=0&&0===this.sp){const r=bt.tn[this.tp];if(r.frames&&(i=r.frames[this.ip]),this.JA>=0&&this.JA!==this.MA){const t=bt.tn[this.JA].frames;t&&(e=t[this.$A])}r.Iy>=0&&(s=r.Iy,t+=BigInt(s-this.E_[5])<<8n),r.gy>=0&&(n=r.gy,t+=BigInt(n-this.E_[3])<<16n)}else if(this.JA>=0){const t=bt.tn[this.JA].frames;t&&(i=t[this.$A])}let r=kt.Gh?.get(t);if(!r){const i=new v(12,null);let e=0;for(let t=0;t<12;t++){let r=this.E_[t];if(n>=0&&3===t&&(r=n),s>=0&&5===t&&(r=s),r>=256&&r<512){const t=xt.tn[r-256].Ul();t&&(i[e++]=t)}if(r>=512){const t=Mt.get(r-512).l_(this.g_);t&&(i[e++]=t)}}r=j.Xr(i,e);for(let t=0;t<5;t++)0!==this.T_[t]&&(r.rh(kt.I_[t][0],kt.I_[t][this.T_[t]]),1===t&&r.rh(kt.__[0],kt.__[this.T_[t]]));r.Qr(),r.oh(64,850,-30,-50,-30,!0),kt.Gh?.put(t,r)}if(this.Li)return r;const h=j.Wr(r,!0);return-1!==i&&-1!==e?h.th(i,e,bt.tn[this.tp].py):-1!==i&&h.eh(i),h.Kr(),h.Hr=null,h.Yr=null,h}}class Dt extends gt{static count=0;static cache=null;static Zs=null;static Ow=null;static Lw=0;static Gh=new q(30);static en=t=>{this.Zs=new R(t.read('npc.dat'));const i=new R(t.read('npc.idx'));this.count=i.Jt,this.Ow=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.Ow||!this.Zs)throw new Error('NpcType not loaded!!!');for(let i=0;i<20;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Lw=(this.Lw+1)%20;const i=this.cache[this.Lw]=new Dt(t);return this.Zs.Xt=this.Ow[t],i.ww(this.Zs),i};static zi=()=>{this.Gh=null,this.Ow=null,this.cache=null,this.Zs=null};name=null;Nw=null;size=1;Fw=null;vp=null;Hw=!1;D_=-1;F_=-1;N_=-1;B_=-1;U_=-1;Bw=null;Uw=null;Dw=null;Jw=-1;$w=-1;Qw=-1;P_=!0;G_=-1;Rp=128;Op=128;decode(t,i){if(1===t){const t=i.Zt;this.Fw=new Uint16Array(t);for(let e=0;e=30&&t<40)this.Dw||(this.Dw=new v(5,null)),this.Dw[t-30]=i.ni,'hidden'===this.Dw[t-30]?.toLowerCase()&&(this.Dw[t-30]=null);else if(40===t){const t=i.Zt;this.Bw=new Uint16Array(t),this.Uw=new Uint16Array(t);for(let e=0;e{const i=new R(t.read('varp.dat'));this.count=i.Jt;for(let t=0;t{It.Li=!1,F.Li=!1,Nt.Li=!1,Ot.Li=!1};static II=()=>{It.Li=!0,F.Li=!0,Nt.Li=!0,Ot.Li=!0};gI=2048;CI=2047;EI=!1;TI=!1;bI=!1;RI=!1;db=null;OI=0;vI=[];stream=null;in=R.zt(1);LI=R.zt(1);SI=R.zt(1);xI=0n;MI=0;kI=0;DI=0;FI=null;NI=0;packetSize=0;BI=0;UI=0;GI=0;WI=null;YI=!0;HI=0;VI=0;KI=null;XI=null;jI=null;zI=null;ZI=null;qI=null;JI=null;$I=null;QI=null;tg=null;ig=null;eg='';sg='';username='';password='';ng=null;rg=null;hg=null;og=null;lg=[];ag=!1;cg=null;fg=null;ug=null;dg=null;wg=null;yg=null;mg=null;Ag=null;pg=null;_g=null;Ig=new Int32Array(256);gg=0;Cg=0;Eg=0;Tg=null;bg=null;Rg=null;Og=null;vg=null;Lg=null;Sg=null;xg=null;Mg=null;kg=null;Dg=null;Fg=null;Ng=null;Bg=null;Ug=null;Pg=null;Gg=null;Wg=null;Yg=null;Hg=null;Vg=null;Kg=new Int32Array(33);Xg=new Int32Array(33);jg=new Int32Array(151);zg=new Int32Array(151);Zg=null;qg=null;Jg=null;$g=null;Qg=null;tC=null;iC=new v(13,null);eC=null;sC=null;nC=new v(50,null);rC=new v(50,null);hC=new v(20,null);oC=new v(20,null);lC=null;aC=new v(8,null);cC=null;fC=null;uC=null;dC=null;wC=null;yC=null;mC=null;AC=null;pC=null;_C=null;IC=null;gC=null;CC=null;EC=null;TC=null;bC=null;RC=null;OC=null;vC=new v(1e3,null);LC=!1;SC=!1;xC=!1;MC=!1;kC=-1;DC=0;FC=0;NC=0;BC=0;UC=0;PC=0;GC=!1;WC=0;YC=0;HC=0;VC=0;KC=0;XC=0;jC=[];zC=-1;ZC=-1;qC=new Q;JC=78;$C=0;QC=0;tE=[];iE=0;eE=0;sE=0;nE=0;rE=0;hE=0;oE=0;lE=0;aE=[];cE=[];fE=[];uE=[];dE=null;wE=-1;yE=3;mE=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];AE=0;pE=0;_E=0;IE=!1;gE=0;CE=!1;EE='';TE='';bE=0;RE='';OE=!1;vE=-1;LE=new v(100,null);SE=new v(100,null);messageType=new Int32Array(100);xE=new Int32Array(100);ME=0;kE=0;DE=0;FE='';NE=0;BE=0;UE=0;PE=0;GE=0;WE=0;YE=0;HE=0;VE=0;KE=!1;XE=0;jE=0;zE=0;ZE=0;qE=null;JE=0;$E=0;QE=0;tT=0;iT=!1;eT=[];sT=[];nT=0;rT=0;hT=0;oT=null;lT=0;aT=new Int32Array(500);cT=new Int32Array(500);fT=new Int32Array(500);uT=new Int32Array(500);dT=0;wT=0;yT=0;mT='';AT=!1;pT=-1;_T=0;IT=0;gT=0;CT=0;ET=0;TT=new Int32Array(1e3);bT=new Int32Array(1e3);RT=null;OT=0;vT=0;LT=0;ST=0;xT=0;MT=!1;kT=0;DT=0;FT=0;NT=0;BT=2;UT=2;PT=1;GT=new Int32Array(5);WT=new v(5,!1);YT=new Int32Array(5);HT=new Int32Array(5);VT=new Int32Array(5);KT=0;XT=0;jT=0;zT=0;ZT=0;qT=0;JT=0;$T=0;QT=0;tb=1;ib=2;eb=-1;$n=0;tr=0;sb=0;nb=0;rb=0;hb=0;ob=null;lb=null;ab=null;cb=0;fb=0;ub=new Int8Array(16384);wb=new v(ut.gf,null);yb=0;mb=0;Ab=128;pb=0;_b=0;Ib=0;gb=0;Cb=0;uA=null;dA=null;Eb=new k(ut.Cf,ut.Cf);Tb=0;bb=0;Rb=0;Ob=0;vb=0;Lb=0;Sb=0;xb=0;Mb=0;kb=0;Db=0;Fb=0;Nb=new v(this.gI,null);Bb=0;Ub=new Int32Array(this.gI);Pb=0;Gb=0;Wb=new Int32Array(this.gI);Yb=new Int32Array(1e3);Hb=new v(this.gI,null);Vb=new v(8192,null);Kb=0;Xb=new Int32Array(8192);jb=new b;zb=new b;Zb=new b;_d=new b;qb=new S(ut.gf,ut.Cf,ut.Cf,null);Jb=new b;$b=new Int32Array(4e3);Qb=new Int32Array(4e3);tR=new Int32Array(ut.Cf*ut.Cf);iR=new Int32Array(ut.Cf*ut.Cf);eR=0;sR=null;nR=0;rR=0;hR=-1;oR=0;lR=0;aR=0;cR=0;fR=!1;uR=!0;dR=!1;wR=new Int32Array(7);yR=new Int32Array(5);mR=0;AR=0;static pR=50;_R=new Int32Array(Nt.pR);IR=new Int32Array(Nt.pR);gR=new Int32Array(Nt.pR);CR=new Int32Array(Nt.pR);ER=new Int32Array(Nt.pR);TR=new Int32Array(Nt.pR);bR=new Int32Array(Nt.pR);RR=new v(Nt.pR,null);OR=new v(100,null);vR=new BigInt64Array(100);LR=new Int32Array(100);SR=null;xR=0;MR=!0;kR=new Int32Array(50);DR=new Int32Array(50);FR=new Int32Array(50);NR=192;BR=-1;UR=-1;PR=0;GR=0;WR=0;YR=!0;HR=null;VR=0;KR=0;XR=192;jR=new v(16,null);zR=0;ZR=!1;zi=()=>{try{this.stream&&this.stream.close()}catch(t){}this.stream=null,window._tinyMidiStop&&window._tinyMidiStop(),this.LI=null,this.SI=null,this.in=null,this.ab=null,this.ob=null,this.lb=null,this.uA=null,this.dA=null,this.RT=null,this.wb=null,this.tR=null,this.iR=null,this.$b=null,this.Qb=null,this.ub=null,this.bg=null,this.Rg=null,this.Og=null,this.vg=null,this.Lg=null,this.Sg=null,this.xg=null,this.Mg=null,this.kg=null,this.Dg=null,this.Fg=null,this.Ng=null,this.Bg=null,this.Ug=null,this.Pg=null,this.Gg=null,this.Wg=null,this.Zg=null,this.Jg=null,this.qg=null,this.$g=null,this.Qg=null,this.tC=null,this.iC=null,this.mC=null,this.AC=null,this.pC=null,this._C=null,this.IC=null,this.gC=null,this.CC=null,this.EC=null,this.TC=null,this.bC=null,this.sC=null,this.hC=null,this.oC=null,this.aC=null,this.cC=null,this.fC=null,this.uC=null,this.dC=null,this.nC=null,this.rC=null,this.Eb=null,this.Nb=null,this.Ub=null,this.Wb=null,this.Hb=null,this.Yb=null,this.Vb=null,this.Xb=null,this.qb=null,this.Jb=null,this._d=null,this.jb=null,this.zb=null,this.Zb=null,this.fT=null,this.uT=null,this.aT=null,this.cT=null,this.jC=null,this.eT=null,this.TT=null,this.bT=null,this.vC=null,this.eC=null,this.OR=null,this.vR=null,this.LR=null,this.zI=null,this.ZI=null,this.KI=null,this.XI=null,this.jI=null,this.qI=null,this.JI=null,this.$I=null,this.QI=null,this.qR(),Et.zi(),Dt.zi(),Mt.zi(),Ct.tn=null,xt.tn=null,Q.tn=null,bt.tn=null,St.tn=null,St.Gh=null,Ft.tn=null,this.ke=null,kt.Gh=null,F.zi(),It.zi(),j.zi(),H.tn=[],V.tn=[]};Ds(){return this.HI}Ms(){return this.OE}ks(){return this.CE}xs(){return this.ZC}Ss(){return this.kC}qR=()=>{this.ag=!1,this.Tg&&(clearInterval(this.Tg),this.Tg=null),this.tg=null,this.ig=null,this.lg=[],this.mg=null,this.Ag=null,this.pg=null,this._g=null,this.dg=null,this.ug=null,this.wg=null,this.yg=null,this.cg=null,this.fg=null};JR=async(t,i,e,s)=>{let n=5,r=await(this.db?.Bs(t));if(r&&R.Kt(r)!==e&&(r=void 0),r)return new W(r);for(;!r;){await this.ws(s,`Requesting ${i}`);try{r=await T(`${Nt.J_}/${t}${e}`)}catch(t){r=void 0;for(let t=n;t>0;t--)await this.ws(s,`Error loading - Will retry in ${t} secs.`),await E(1e3);n*=2,n>60&&(n=60)}}return await(this.db?.Us(t,r)),new W(r)};$R=async(t,e,s)=>{let n=await(this.db?.Bs(t+'.mid'));if(n&&12345678!==e&&R.Kt(n)!==e&&(n=void 0),!n)try{n=await T(`${Nt.J_}/${t}_${e}.mid`),s!==n.length&&(n=n.slice(0,s))}catch(t){}if(!n)return;await(this.db?.Us(t+'.mid',n));const r=new R(Uint8Array.from(n)).ti;!function(t,i){window._tinyMidiPlay&&window._tinyMidiPlay(t,i/256)}(i.read(r,n,s,4),this.XR)};QR=()=>{if(p.fillStyle='black',p.fillRect(0,0,this.width,this.height),this.As(1),this.bI){this.ag=!1,p.font='bold 16px helvetica, sans-serif',p.textAlign='left',p.fillStyle='yellow';let t=35;p.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,p.fillStyle='white',p.fillText('To fix this try the following (in order):',30,t),t+=50,p.font='bold 12px helvetica, sans-serif',p.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,p.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,p.fillText('3: Try using a different game-world',30,t),t+=30,p.fillText('4: Try rebooting your computer',30,t),t+=30,p.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.RI&&(this.ag=!1,p.font='bold 20px helvetica, sans-serif',p.textAlign='left',p.fillStyle='white',p.fillText('Error - unable to load game!',50,50),p.fillText('To play RuneScape make sure you play from',50,100),p.fillText('https://2004scape.org',50,150)),this.TI){this.ag=!1,p.font='bold 13px helvetica, sans-serif',p.textAlign='left',p.fillStyle='yellow';let t=35;p.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,p.fillStyle='white',p.fillText('To fix this try the following (in order):',30,t),t+=50,p.font='bold 12px helvetica, sans-serif',p.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,p.fillText('2: Try rebooting your computer, and reloading',30,t)}};tO=t=>{if(!t.wl)return!1;for(let i=0;i=s)return!1}else if(3===t.wl[i]){if(e<=s)return!1}else if(4===t.wl[i]){if(e===s)return!1}else if(e!==s)return!1}return!0};eO=(t,i,e,s,n)=>{this.wC?.draw(t,i),this.yC?.draw(t,i+n-16),m.fillRect(t,i+16,16,n-32,Rt.Py);let r=(n-32)*n/s|0;r<8&&(r=8);const h=(n-r-32)*e/(s-n)|0;m.fillRect(t,i+h+16,16,r,Rt.Gy),m.Et(t,i+h+16,Rt.Wy,r),m.Et(t+1,i+h+16,Rt.Wy,r),m.Ct(t,i+h+16,Rt.Wy,16),m.Ct(t,i+h+17,Rt.Wy,16),m.Et(t+15,i+h+16,Rt.Yy,r),m.Et(t+14,i+h+17,Rt.Yy,r-1),m.Ct(t,i+h+r+15,Rt.Yy,16),m.Ct(t+1,i+h+r+14,Rt.Yy,15)};sO=(t,i)=>{let e=!1;const s=Q.tn[t];if(!s.ml)return!1;for(let t=0;ts.delay[n.zl];)n.Zl-=s.delay[n.zl]+1,n.zl++,n.zl>=s.my&&(n.zl-=s.yy,(n.zl<0||n.zl>=s.my)&&(n.zl=0)),e=!0}}}return e};nO=(t,i,e,s,n=!1)=>{if(0!==t.type||!t.ml||t.hide&&this.NE!==t.id&&this.BE!==t.id&&this.UE!==t.id)return;const r=m.left,h=m.top,o=m.right,l=m.bottom;m._t(i,e,i+t.width,e+t.height);const a=t.ml.length;for(let r=0;r0&&this.rO(l),l.type===Q.Wh)l.jl>l.scroll-l.height&&(l.jl=l.scroll-l.height),l.jl<0&&(l.jl=0),this.nO(l,h,o,l.jl,n),l.scroll>l.height&&this.eO(h+l.width,o,l.jl,l.scroll,l.height);else if(l.type===Q.Hh){let t=0;for(let i=0;i0){let i=0,e=0;const r=l._l[t]-1;if(s>=-32&&s<=512&&n>=-32&&n<=334||0!==this.WE&&this.GE===t){const h=Mt.Fp(r,l.Il[t]);if(0!==this.WE&&this.GE===t&&this.PE===l.id?(i=this.Xe-this.YE,e=this.je-this.HE,i<5&&i>-5&&(i=0),e<5&&e>-5&&(e=0),this.VE<5&&(i=0,e=0),h.Eh(128,s+i,n+e)):0!==this.JE&&this.$E===t&&this.QE===l.id?h.Eh(128,s,n):h.draw(s,n),33===h.Ii||1!==l.Il[t]){const r=l.Il[t];this.ng?.hO(s+i+1,n+10+e,this.oO(r),Rt.Oy),this.ng?.hO(s+i,n+9+e,this.oO(r),Rt.Ey)}}}else if(l.Ol&&t<20){const i=l.Ol[t];i?.draw(s,n)}t++}}else if(l.type===Q.Vh)l.fill?m.fillRect(h,o,l.width,l.height,l.kl):m.gt(h,o,l.width,l.height,l.kl);else if(l.type===Q.Kh){const t=l.font;let i=l.kl,e=l.text;if(this.UE!==l.id&&this.BE!==l.id&&this.NE!==l.id||0===l.Fl||(i=l.Fl),this.tO(l)&&(i=l.Dl,l.Ml&&l.Ml.length>0&&(e=l.Ml)),l.fl===Q.io&&this.iT&&(e='Please wait...',i=l.kl),!t||!e)continue;for(let s=o+t.height;e.length>0;s+=t.height){if(-1!==e.indexOf('%')){for(;;){const t=e.indexOf('%1');if(-1===t)break;e=e.substring(0,t)+this.lO(this.iO(l,0))+e.substring(t+2)}for(;;){const t=e.indexOf('%2');if(-1===t)break;e=e.substring(0,t)+this.lO(this.iO(l,1))+e.substring(t+2)}for(;;){const t=e.indexOf('%3');if(-1===t)break;e=e.substring(0,t)+this.lO(this.iO(l,2))+e.substring(t+2)}for(;;){const t=e.indexOf('%4');if(-1===t)break;e=e.substring(0,t)+this.lO(this.iO(l,3))+e.substring(t+2)}for(;;){const t=e.indexOf('%5');if(-1===t)break;e=e.substring(0,t)+this.lO(this.iO(l,4))+e.substring(t+2)}}const n=e.indexOf('\\n');let r;-1!==n?(r=e.substring(0,n),e=e.substring(n+2)):(r=e,e=''),l.Sl?t.aO(h+(l.width/2|0),s,r,i,l.xl):t.cO(h,s,r,i,l.xl)}}else if(l.type===Q.Xh){let t;t=this.tO(l)?l.Bl:l.Nl,t?.draw(h,o)}else if(l.type===Q.jh){const t=F.Fi,i=F.Ni;F.Fi=h+(l.width/2|0),F.Ni=o+(l.height/2|0);const e=F.sin[l.Yl]*l.zoom>>16,s=F.cos[l.Yl]*l.zoom>>16,n=this.tO(l);let r;r=n?l.Wl:l.Gl;let a=null;if(-1===r)a=l.Ul(-1,-1,n);else{const t=bt.tn[r];t.frames&&t.Ay&&(a=l.Ul(t.frames[l.zl],t.Ay[l.zl],n))}a&&a.fh(0,l.Hl,0,l.Yl,0,e,s),F.Fi=t,F.Ni=i}else if(l.type===Q.zh){const t=l.font;if(!t||!l._l||!l.Il)continue;let i=0;for(let e=0;e0){const n=Mt.get(l._l[i]-1);let r=n.name;if((n.Xp||1!==l.Il[i])&&(r=r+' x'+this.fO(l.Il[i])),!r)continue;const a=h+s*(l.El+115),c=o+e*(l.Tl+12);l.Sl?t.aO(a+(l.width/2|0),c,r,l.kl,l.xl):t.cO(a,c,r,l.kl,l.xl)}i++}}}m._t(r,h,o,l)};rO=t=>{let i=t.ul;if(i>=Q.eo&&i<=Q.so)i--,i>=this.mR?(t.text='',t.fl=0):(t.text=this.OR[i],t.fl=1);else if(i>=Q.no&&i<=Q.ro)i-=Q.no,i>=this.mR?(t.text='',t.fl=0):(0===this.LR[i]?t.text='@red@Offline':this.LR[i]===Nt.Z_?t.text='@gre@World-'+(this.LR[i]-9):t.text='@yel@World-'+(this.LR[i]-9),t.fl=1);else if(i===Q.lo)t.scroll=15*this.mR+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i>=Q.Po&&i<=Q.Go)i-=Q.Po,i>=this.QC?(t.text='',t.fl=0):(t.text=$.Bh($.kh(this.tE[i])),t.fl=1);else if(i===Q.Ho)t.scroll=15*this.QC+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i===Q.Uo){if(t.Yl=150,t.Hl=256*Math.sin(this.OI/40)&2047,this.dR){this.dR=!1;const i=new v(7,null);let e=0;for(let t=0;t<7;t++){const s=this.wR[t];s>=0&&(i[e++]=xt.tn[s].Ul())}const s=j.Xr(i,e);for(let t=0;t<5;t++)0!==this.yR[t]&&(s.rh(kt.I_[t][0],kt.I_[t][this.yR[t]]),1===t&&s.rh(kt.__[0],kt.__[this.yR[t]]));if(this.sR){const i=bt.tn[this.sR.MA].frames;i&&(s.Qr(),s.eh(i[0]),s.oh(64,850,-30,-50,-30,!0),t.model=s)}}}else if(i===Q.Fo)this.RC||(this.RC=t.Nl,this.OC=t.Bl),this.uR?t.Nl=this.OC:t.Nl=this.RC;else if(i===Q.No)this.RC||(this.RC=t.Nl,this.OC=t.Bl),this.uR?t.Nl=this.RC:t.Nl=this.OC;else if(i===Q.Vo)t.text=this.mT,this.OI%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(i===Q.sl)this.fR?this.AT?(t.kl=Rt.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.kl=Rt.Ry,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(i===Q.nl||i===Q.al)if(0===this._T)t.text='';else{let i;i=0===this.IT?'earlier today':1===this.IT?'yesterday':this.IT+' days ago',t.text='You last logged in '+i+' from: '+$.Nh(this._T)}else if(i===Q.rl)0===this.CT&&(t.text='0 unread messages',t.kl=Rt.Ey),1===this.CT&&(t.text='1 unread message',t.kl=Rt.GREEN),this.CT>1&&(t.text=this.CT+' unread messages',t.kl=Rt.GREEN);else if(i===Q.hl)if(201===this.gT)t.text='';else if(200===this.gT)t.text='You have not yet set any password recovery questions.';else{let i;i=0===this.gT?'Earlier today':1===this.gT?'Yesterday':this.gT+' days ago',t.text=i+' you changed your recovery questions'}else i===Q.ol?201===this.gT?t.text='':200===this.gT?t.text='We strongly recommend you do so now to secure your account.':t.text='If you do not remember making this change then cancel it immediately':i===Q.ll&&(201===this.gT?t.text='':(this.gT,t.text="Do this from the 'account management' area on our front webpage"))};iO=(t,i)=>{if(!t.scripts||i>=t.scripts.length)return-2;try{const e=t.scripts[i];if(!e)return-1;let s=0,n=0;for(;;){const t=e[n++];if(0===t)return s;if(1===t)s+=this.cE[e[n++]];else if(2===t)s+=this.fE[e[n++]];else if(3===t)s+=this.aE[e[n++]];else if(4===t){const t=Q.tn[e[n++]],i=e[n++]+1;if(t._l&&t.Il)for(let e=0;et<999999999?String(t):'*';fO=t=>{let i=String(t);for(let t=i.length-3;t>0;t-=3)i=i.substring(0,t)+','+i.substring(t);return i.length>8?i='@gre@'+i.substring(0,i.length-8)+' million @whi@('+i+')':i.length>4&&(i='@cya@'+i.substring(0,i.length-4)+'K @whi@('+i+')'),' '+i};oO=t=>t<1e5?String(t):t<1e7?(t/1e3|0)+'K':(t/1e6|0)+'M'}(new class extends Nt{EI=!1;TI=!1;bI=!1;RI=!1;uO=null;dO=null;wO=null;yO=null;mO=null;AO=null;Nu=0;Bu=0;Uu=0;pO=0;_O=0;IO=2;model={id:parseInt(P.getParameter('model'))||0,gO:null,x:0,y:0,z:420,xa:0};CO=null;constructor(){super(!0)}load=async()=>{if(this.EI)this.TI=!0;else{this.EI=!0;try{await async function(t){if(o||h)return;o=!0;const i=await r(t);h||(h=i)}(),await i.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new G(await G.openDatabase()),this.uO=document.getElementById('rightPanel');const t=document.getElementById('mainPanel');t&&(t.ondragover=t=>{t.preventDefault(),t.stopPropagation()},t.ondrop=async t=>{if(t.preventDefault(),t.stopPropagation(),!t.dataTransfer||!t.dataTransfer.files.length)return;const i=['main_file_cache.dat','main_file_cache.idx0','main_file_cache.idx1','main_file_cache.idx2','main_file_cache.idx3','main_file_cache.idx4'],e=[];for(let s=0;s{this.TI||this.bI||this.RI||(this.EO(),this.TO())};draw=async()=>{this.TI||this.bI||this.RI?this.QR():(j.nr=!0,j.Xe=this.Xe,j.je=this.je,this.ke?.bind(),m.clear(),m.fillRect(0,0,this.width,this.height,Rt.Oy),null!==this.model.gO&&(this.model.gO.draw(this.model.xa,F.sin[this.pO],F.cos[this.pO],F.sin[this._O],F.cos[this._O],this.model.x-this.Nu,this.model.y-this.Bu,this.model.z-this.Uu,0),-1!==this.model.gO.qr&&this.model.gO.mh(this.model.gO.qr)),this.ke?.draw(0,0),this.CO?.draw(this.Xe,this.je))};init=async()=>{const t=await(this.db?.Bs('main_file_cache.dat'));if(!t){return document.getElementById('helpme').style.display='block',void(A.style.display='none')}const i=await(this.db?.Bs('main_file_cache.idx0')),e=await(this.db?.Bs('main_file_cache.idx1')),s=await(this.db?.Bs('main_file_cache.idx2')),n=await(this.db?.Bs('main_file_cache.idx3')),r=await(this.db?.Bs('main_file_cache.idx4'));if(!(i&&e&&s&&n&&r)){return document.getElementById('helpme').style.display='block',void(A.style.display='none')}document.getElementById('helpme').style.display='none',A.style.display='block',this.dO=new Y(t,i,0),this.wO=new Y(t,e,1),this.yO=new Y(t,s,2),this.mO=new Y(t,n,3),this.AO=new Y(t,r,4),await this.ws(10,'Unpacking textures');const h=this.dO.read(6);F.$i(h),F.ie(.8),F.se(20),await this.ws(20,'Loading models...');for(let t=0;t{this.model.id=i,this.bO(i)},t.appendChild(e)}}await this.ws(80,'Finishing up...'),this.CO=new C(512,128),this.CO.bind();for(let t=0;t<512;t++)for(let i=0;i<128;i++){const e=t,s=127-i;m.Ot(e,s,F.palette[i+128*t])}this.CO.draw(0,0)};bO(t){if(null===this.wO)return;const i=this.wO.read(t);null!==i?(this.model.gO=j.jr(i,t),this.model.gO.oh(64,850,-30,-50,-30,!0),document.title=`Model ${t} | 2004Scape Tools`):document.title=`Missing model ${t} | 2004Scape Tools`}EO(){for(;;){const t=this._s();if(-1===t)break;t==='r'.charCodeAt(0)?(this.IO=2,this.Nu=0,this.Bu=0,this.Uu=0,this.pO=0,this._O=0,this.model.x=0,this.model.y=0,this.model.z=420,this.model.xa=0):t==='1'.charCodeAt(0)?(this.model.id--,j.metadata&&this.model.id<0&&(this.model.id=j.metadata.length-1),this.bO(this.model.id)):t==='2'.charCodeAt(0)&&(this.model.id++,j.metadata&&this.model.id>=j.metadata.length&&(this.model.id=0),this.bO(this.model.id))}}TO(){this.Je['['.charCodeAt(0)]?this.IO--:this.Je[']'.charCodeAt(0)]&&this.IO++,this.Je[1]?this.model.xa+=this.IO:this.Je[2]&&(this.model.xa-=this.IO),this.Je['w'.charCodeAt(0)]?this.model.z-=this.IO:this.Je['s'.charCodeAt(0)]&&(this.model.z+=this.IO),this.Je['a'.charCodeAt(0)]?this.model.x-=this.IO:this.Je['d'.charCodeAt(0)]&&(this.model.x+=this.IO),this.Je['q'.charCodeAt(0)]?this.model.y-=this.IO:this.Je['e'.charCodeAt(0)]&&(this.model.y+=this.IO),this.pO=2047&this.pO,this._O=2047&this._O,this.model.xa=2047&this.model.xa}}).us().then((()=>{}))})()})(); \ No newline at end of file +(()=>{"use strict";var t={7444:(t,i,e)=>{t.exports=e.p+"0c791968973e1f25c170.wasm"},8227:(t,i,e)=>{t.exports=e.p+"9f86b5397894e28b5ae2.wasm"}},i={};function e(s){var n=i[s];if(void 0!==n)return n.exports;var r=i[s]={exports:{}};return t[s](r,r.exports,e),r.exports}e.m=t,e.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),e.p="/Client2/",e.b=document.baseURI||self.location.href,(()=>{async function t(t,i={}){const e={env:Object.assign(Object.create(globalThis),i.env||{},{abort(t,i,e,s){t=h(t>>>0),i=h(i>>>0),e>>>=0,s>>>=0,(()=>{throw Error(`${t} in ${i}:${e}:${s}`)})()}})},{exports:s}=await WebAssembly.instantiate(t,e),n=s.memory||i.env.memory,r=Object.setPrototypeOf({read:(t,i,e,r)=>(i=function(t,i,e,r,h){if(null==r)return 0;const o=r.length,l=s.__pin(s.__new(o<>>0;if(h)new h(n.buffer,l,o).set(r);else for(let i=0;i>>0),r[i]);return s.__unpin(l),l}(l,6,0,i,Int8Array)||function(){throw TypeError("value must not be null")}(),function(t,i,e){if(!e)return null;const s=function(t){try{return o.getUint32(t,!0)}catch{return o=new DataView(n.buffer),o.getUint32(t,!0)}}(e-4)>>>i,r=new Array(s);for(let n=0;n>>0));return r}(a,0,s.read(t,i,e,r)>>>0))},s);function h(t){if(!t)return null;const i=t+new Uint32Array(n.buffer)[t-4>>>2]>>>1,e=new Uint16Array(n.buffer);let s=t>>>1,r="";for(;i-s>1024;)r+=String.fromCharCode(...e.subarray(s,s+=1024));return r+String.fromCharCode(...e.subarray(s,i))}let o=new DataView(n.buffer);function l(t,i){try{o.setUint8(t,i,!0)}catch{o=new DataView(n.buffer),o.setUint8(t,i,!0)}}function a(t){try{return o.getInt8(t,!0)}catch{return o=new DataView(n.buffer),o.getInt8(t,!0)}}return r}class i{static tt=null;static load=async i=>{this.tt=await t(new WebAssembly.Module(i),{env:void 0})};static read=(t,i,e,s)=>{if(!this.tt)throw new Error('bz2 not found!!');return Int8Array.from(this.tt.read(t,i,e,s))}}let s;function n(t,i){return s=t.exports,r.it=i,s}async function r(t){void 0===t&&(t=new URL(e(7444),e.b));const i={et:{}};('string'==typeof t||'function'==typeof Request&&t instanceof Request||'function'==typeof URL&&t instanceof URL)&&(t=fetch(t));const{instance:s,module:r}=await async function(t,i){if('function'==typeof Response&&t instanceof Response){if('function'==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(t,i)}catch(i){if('application/wasm'==t.headers.get('Content-Type'))throw i;console.warn('`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n',i)}const e=await t.arrayBuffer();return await WebAssembly.instantiate(e,i)}{const e=await WebAssembly.instantiate(t,i);return e instanceof WebAssembly.Instance?{instance:e,module:t}:e}}(await t,i);return n(s,r)}let h=null,o=!1;class l extends Error{constructor(t){super(t),this.name='DecompressionError'}}let a=0,c=null,f=null;function u(t,i,e){let s;if(e){const n=i;s=t.st(n);const r=new Uint8Array(t.memory.buffer,s,n);try{e(r)}catch(i){throw t.nt(s,n),i}return a=n,s}if('string'==typeof i){const e=a=function(t){let i=0,e=0,s=0;const n=t.length;for(;i{this.ft=t,this.ut=i,this.dt=e,this._t(0,0,i,e)};static It=()=>{this.left=0,this.top=0,this.right=this.ut,this.bottom=this.dt,this.wt=this.right-1,this.yt=this.right/2|0};static _t=(t,i,e,s)=>{t<0&&(t=0),i<0&&(i=0),e>this.ut&&(e=this.ut),s>this.dt&&(s=this.dt),this.top=i,this.bottom=s,this.left=t,this.right=e,this.wt=this.right-1,this.yt=this.right/2|0,this.At=this.bottom/2|0};static clear=()=>{const t=this.ut*this.dt;for(let i=0;i{this.Ct(t,i,n,e),this.Ct(t,i+s-1,n,e),this.Et(t,i,n,s),this.Et(t+e-1,i,n,s)};static Ct=(t,i,e,s)=>{if(i=this.bottom)return;tthis.right&&(s=this.right-t);const n=t+i*this.ut;for(let t=0;t{if(t=this.right)return;ithis.bottom&&(s=this.bottom-i);const n=t+i*this.ut;for(let t=0;t{const r=Math.abs(e-t),h=Math.abs(s-i),o=t=this.left&&t=this.top&&i-h&&(a-=h,t+=o),e{tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const r=this.ut-e;let h=t+i*this.ut;for(let t=-s;t<0;t++){for(let t=-e;t<0;t++)this.ft[h++]=n;h+=r}};static bt(t,i,e,s,n,r){tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const h=256-r,o=(n>>16&255)*r,l=(n>>8&255)*r,a=(255&n)*r,c=this.ut-e;let f=t+i*this.ut;for(let t=0;t>16&255)*h>>8<<16)+(l+(this.ft[f]>>8&255)*h>>8<<8)+(a+(255&this.ft[f])*h>>8);this.ft[f++]=t}f+=c}}static Rt(t,i,e,s,n){const r=256-n,h=(s>>16&255)*n,o=(s>>8&255)*n,l=(255&s)*n;let a=i-e;a<0&&(a=0);let c=i+e;c>=this.dt&&(c=this.dt-1);for(let s=a;s<=c;s++){const n=s-i,a=0|Math.sqrt(e*e-n*n);let c=t-a;c<0&&(c=0);let f=t+a;f>=this.ut&&(f=this.ut-1);let u=c+s*this.ut;for(let t=c;t<=f;t++){const t=(h+(this.ft[u]>>16&255)*r>>8<<16)+(o+(this.ft[u]>>8&255)*r>>8<<8)+(l+(255&this.ft[u])*r>>8);this.ft[u++]=t}}}static Ot=(t,i,e)=>{t=this.right||i=this.bottom||(this.ft[t+i*this.ut]=e)}}const A=document.getElementById('canvas'),p=A.getContext('2d',{willReadFrequently:!0}),_=document.createElement('canvas'),I=document.createElement('img'),g=_.getContext('2d',{willReadFrequently:!0});class C{vt;width;height;Lt;St;ft;constructor(t,i,e=p){this.Lt=e,this.vt=this.Lt.getImageData(0,0,t,i),this.St=new Uint32Array(this.vt.data.buffer),this.ft=new Int32Array(t*i),this.width=t,this.height=i,this.bind()}clear(){this.ft.fill(0)}bind(){m.bind(this.ft,this.width,this.height)}draw(t,i){this.#t(),this.Lt.putImageData(this.vt,t,i)}#t(){const t=this.ft.length,i=this.ft,e=this.St;for(let s=0;s>16&255|(t>>8&255)<<8|(255&t)<<16|4278190080}}}const E=async t=>new Promise((i=>setTimeout(i,t))),T=async t=>new Int8Array(await(await fetch(t)).arrayBuffer());class b{xt;cursor=null;constructor(){const t=new w;t.next=t,t.rt=t,this.xt=t}Mt(t){t.rt&&t.ht(),t.rt=this.xt.rt,t.next=this.xt,t.rt&&(t.rt.next=t),t.next.rt=t}kt(t){t.rt&&t.ht(),t.rt=this.xt,t.next=this.xt.next,t.rt.next=t,t.next&&(t.next.rt=t)}Dt(){const t=this.xt.next;return t===this.xt?null:(t?.ht(),t)}head(){const t=this.xt.next;return t===this.xt?(this.cursor=null,null):(this.cursor=t?.next||null,t)}Nt(){const t=this.xt.rt;return t===this.xt?(this.cursor=null,null):(this.cursor=t?.rt||null,t)}next(){const t=this.cursor;return t===this.xt?(this.cursor=null,null):(this.cursor=t?.next||null,t)}rt(){const t=this.cursor;return t===this.xt?(this.cursor=null,null):(this.cursor=t?.rt||null,t)}clear(){for(;;){const t=this.xt.next;if(t===this.xt)return;t?.ht()}}}class R extends y{static Ft=3988292384;static Bt=new Int32Array(256);static Ut=new Uint32Array(33);static Pt=new b;static Gt=new b;static Wt=new b;static Yt=0;static Ht=0;static Vt=0;static{for(let t=0;t<32;t++)R.Ut[t]=(1<>>=1:i=i>>>1^R.Ft;R.Bt[t]=i}}static Kt=t=>{let i=4294967295;for(let e=0;e>>8^R.Bt[255&(i^t[e])];return~i};view;data;Xt=0;jt=0;random=null;constructor(t){if(!t)throw new Error('Input src packet array was null!');super(),t instanceof Int8Array?this.data=new Uint8Array(t):this.data=t,this.view=new DataView(this.data.buffer,this.data.byteOffset,this.data.byteLength)}get length(){return this.view.byteLength}get available(){return this.length-this.Xt}static zt=t=>{let i=null;return 0===t&&R.Yt>0?(R.Yt--,i=R.Pt.Dt()):1===t&&R.Ht>0?(R.Ht--,i=R.Gt.Dt()):2===t&&R.Vt>0&&(R.Vt--,i=R.Wt.Dt()),i?(i.Xt=0,i):new R(0===t?new Uint8Array(100):1===t?new Uint8Array(5e3):new Uint8Array(3e4))};release(){this.Xt=0,100===this.view.byteLength&&R.Yt<1e3?(R.Pt.Mt(this),R.Yt++):5e3===this.view.byteLength&&R.Ht<250?(R.Gt.Mt(this),R.Ht++):3e4===this.view.byteLength&&R.Vt<50&&(R.Wt.Mt(this),R.Vt++)}get Zt(){return this.view.getUint8(this.Xt++)}get qt(){return this.view.getInt8(this.Xt++)}get Jt(){const t=this.view.getUint16(this.Xt);return this.Xt+=2,t}get $t(){const t=this.view.getInt16(this.Xt);return this.Xt+=2,t}get Qt(){const t=this.view.getUint8(this.Xt++)<<16|this.view.getUint16(this.Xt);return this.Xt+=2,t}get ti(){const t=this.view.getInt32(this.Xt);return this.Xt+=4,t}get ii(){const t=this.view.getBigInt64(this.Xt);return this.Xt+=8,t}get ei(){return this.view.getUint8(this.Xt)<128?this.Zt-64:this.Jt-49152}get si(){return this.view.getUint8(this.Xt)<128?this.Zt:this.Jt-32768}get ni(){const t=this.view,i=t.byteLength;let e,s='';for(;10!==(e=t.getUint8(this.Xt++))&&this.Xt>16),this.view.setUint16(this.Xt,t),this.Xt+=2}p4(t){this.view.setInt32(this.Xt,t),this.Xt+=4}ai(t){this.view.setInt32(this.Xt,t,!0),this.Xt+=4}ci(t){this.view.setBigInt64(this.Xt,t),this.Xt+=8}fi(t){const i=this.view,e=t.length;for(let s=0;s>>3,e=8-(7&this.jt),s=0;for(this.jt+=t;t>e;e=8)s+=(this.view.getUint8(i++)&R.Ut[e])<>>e-t&R.Ut[t],s}Ai(t,i){const e=this.Xt;this.Xt=0;const s=new Uint8Array(e);this.ri(e,0,s);const n=function(t){const i=[];for(;t>0n;)i.unshift(Number(0xffn&t)),t>>=8n;return 128&i[0]&&i.unshift(0),new Uint8Array(i)}(function(t,i,e){let s=1n;for(;i>0n;)i%2n===1n&&(s=s*t%e),t=t*t%e,i>>=1n;return s}(function(t){let i=0n;for(let e=0;e{const s=new R(t.read(i+'.dat')),n=new R(t.read('index.dat'));n.Xt=s.Jt;const r=n.Jt,h=n.Jt,o=n.Zt,l=new Int32Array(o);for(let t=1;ts.length||n.Xt>n.length)throw new Error;const a=n.Zt,c=n.Zt,f=n.Jt,u=n.Jt,d=new O(f,u,l);d.pi=a,d._i=c,d.Ii=r,d.gi=h;const w=d.ft,y=n.Zt;if(0===y){const t=d.width*d.height;for(let i=0;im.bottom&&(n-=i+n-m.bottom),tm.right){const i=t+r-m.right;r-=i,o+=i,h+=i}r>0&&n>0&&this.Ei(r,n,this.ft,s,o,m.ft,e,h)}Ti(){const t=this.ft,i=this.width,e=this.height;for(let s=0;s>16&255;n+=t,n<0?n=0:n>255&&(n=255);let r=this.palette[s]>>8&255;r+=i,r<0?r=0:r>255&&(r=255);let h=255&this.palette[s];h+=e,h<0?h=0:h>255&&(h=255),this.palette[s]=(n<<16)+(r<<8)+h}}Ri(){this.Ii|=0,this.gi|=0,this.Ii/=2,this.gi/=2,this.Ii|=0,this.gi|=0;const t=new Int8Array(this.Ii*this.gi);let i=0;for(let e=0;e>1)+(e+this._i>>1)*this.Ii]=this.ft[i++];this.ft=t,this.width=this.Ii,this.height=this.gi,this.pi=0,this._i=0}Oi(){if(this.width===this.Ii&&this.height===this.gi)return;const t=new Int8Array(this.Ii*this.gi);let i=0;for(let e=0;e>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=e[s++];0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t]}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=this.palette[255&t]}h+=o,s+=n}}clip(t,i,e,s){try{const n=this.width;this.height;let r=0,h=0;const o=this.Ii,l=this.gi,a=(o<<16)/e|0,c=(l<<16)/s|0;t=t+(this.pi*e+o-1)/o|0,i=i+(this._i*s+l-1)/l|0,this.pi*e%o!=0&&(r=(o-this.pi*e%o<<16)/e|0),this._i*s%l!=0&&(h=(l-this._i*s%l<<16)/s|0),e=e*(this.width-(r>>16))/o|0,s=s*(this.height-(h>>16))/l|0;let f,u=t+i*m.ut,d=m.ut-e;im.bottom&&(s-=i+s-m.bottom),tm.right&&(f=t+e-m.right,e-=f,d+=f),this.vi(m.ft,this.ft,this.palette,r,h,u,d,e,s,a,c,n)}catch(t){console.log('error in sprite clipping routine')}}vi(t,i,e,s,n,r,h,o,l,a,c,f){try{const u=s;for(let d=-l;d<0;d++){const l=(n>>16)*f;for(let n=-o;n<0;n++){const n=i[(s>>16)+l];0==n?r++:t[r++]=e[255&n],s+=a}n+=c,s=u,r+=h}}catch(t){console.log('error in plot_scale')}}}class v extends Array{constructor(t,i){super(t);for(let e=0;e{this.Si=null,this.Si=null,this.sin=null,this.cos=null,this.Di=null,this.Mi=null,this.Xi=null,this.ji=null,this.Pi=null,this.Gi=null,this.Hi=null,this.palette=null,this.Vi=null,console.log('Draw3D unloaded!')};static Zi=()=>{this.Di=new Int32Array(this.dt);for(let t=0;t{this.Di=new Int32Array(i);for(let e=0;e{this.Pi=null,this.Gi.fill(null)};static $i=t=>{this.ki=0;for(let i=0;i<50;i++)try{this.Mi[i]=O.Ci(t,i.toString()),this.Li&&128===this.Mi[i]?.Ii?this.Mi[i]?.Ri():this.Mi[i]?.Oi(),this.ki++}catch(t){}};static Qi=t=>{if(0!==this.ji[t])return this.ji[t];const i=this.Vi[t];if(!i)return 0;let e=0,s=0,n=0;const r=i.length;for(let t=0;t>16&255,s+=i[t]>>8&255,n+=255&i[t];let h=(e/r<<16)+(s/r<<8)+(n/r|0);return h=this.te(h,1.4),0===h&&(h=1),this.ji[t]=h,h};static ie=t=>{const i=t+.03*Math.random()-.015;let e=0;for(let t=0;t<512;t++){const s=(t/8|0)/64+.0078125,n=(7&t)/8+.0625;for(let t=0;t<128;t++){const r=t/128;let h=r,o=r,l=r;if(0!==n){let t;t=r<.5?r*(n+1):r+n-r*n;const i=2*r-t;let e=s+.3333333333333333;e>1&&e--;let a=s-.3333333333333333;a<0&&a++,h=6*e<1?i+6*(t-i)*e:2*e<1?t:3*e<2?i+(t-i)*(.6666666666666666-e)*6:i,o=6*s<1?i+6*(t-i)*s:2*s<1?t:3*s<2?i+(t-i)*(.6666666666666666-s)*6:i,l=6*a<1?i+6*(t-i)*a:2*a<1?t:3*a<2?i+(t-i)*(.6666666666666666-a)*6:i}const a=((256*h|0)<<16)+((256*o|0)<<8)+(256*l|0);this.palette[e++]=this.te(a,i)}}for(let t=0;t<50;t++){const e=this.Mi[t];if(!e)continue;const s=e.palette;this.Vi[t]=new Int32Array(s.length);for(let e=0;e{const e=(t>>16)/256,s=(t>>8&255)/256,n=(255&t)/256;return((256*Math.pow(e,i)|0)<<16)+((256*Math.pow(s,i)|0)<<8)+(256*Math.pow(n,i)|0)};static se=t=>{this.Pi||(this.Wi=t,this.Li?this.Pi=new k(t,16384):this.Pi=new k(t,65536),this.Gi.fill(null))};static ne=(t,i,e,s,n,r,h,o,l)=>{let a=0,c=0;n!==s&&(a=(i-t<<16)/(n-s)|0,c=(o-h<<15)/(n-s)|0);let f=0,u=0;r!==n&&(f=(e-i<<16)/(r-n)|0,u=(l-o<<15)/(r-n)|0);let d=0,w=0;if(r!==s&&(d=(t-e<<16)/(s-r)|0,w=(h-l<<15)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),nf)for(r-=n,n-=s,s=this.Di[s];;){if(--n<0)for(;;){if(--r<0)return;this.re(e>>16,i>>16,l>>7,o>>7,this.ft,s,0),e+=d,i+=f,l+=w,o+=u,s+=this.ut}this.re(e>>16,t>>16,l>>7,h>>7,this.ft,s,0),e+=d,t+=a,l+=w,h+=c,s+=this.ut}else for(r-=n,n-=s,s=this.Di[s];;){if(--n<0)for(;;){if(--r<0)return;this.re(i>>16,e>>16,o>>7,l>>7,this.ft,s,0),e+=d,i+=f,l+=w,o+=u,s+=this.ut}this.re(t>>16,e>>16,h>>7,l>>7,this.ft,s,0),e+=d,t+=a,l+=w,h+=c,s+=this.ut}else if(i=t<<=16,o=h<<=15,s<0&&(i-=d*s,t-=a*s,o-=w*s,h-=c*s,s=0),e<<=16,l<<=15,r<0&&(e-=f*r,l-=u*r,r=0),s!==r&&da)for(n-=r,r-=s,s=this.Di[s];;){if(--r<0)for(;;){if(--n<0)return;this.re(e>>16,t>>16,l>>7,h>>7,this.ft,s,0),e+=f,t+=a,l+=u,h+=c,s+=this.ut}this.re(i>>16,t>>16,o>>7,h>>7,this.ft,s,0),i+=d,t+=a,o+=w,h+=c,s+=this.ut}else for(n-=r,r-=s,s=this.Di[s];;){if(--r<0)for(;;){if(--n<0)return;this.re(t>>16,e>>16,h>>7,l>>7,this.ft,s,0),e+=f,t+=a,l+=u,h+=c,s+=this.ut}this.re(t>>16,i>>16,h>>7,o>>7,this.ft,s,0),i+=d,t+=a,o+=w,h+=c,s+=this.ut}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),rd)for(s-=r,r-=n,n=this.Di[n];;){if(--r<0)for(;;){if(--s<0)return;this.re(t>>16,e>>16,h>>7,l>>7,this.ft,n,0),t+=a,e+=d,h+=c,l+=w,n+=this.ut}this.re(t>>16,i>>16,h>>7,o>>7,this.ft,n,0),t+=a,i+=f,h+=c,o+=u,n+=this.ut}else for(s-=r,r-=n,n=this.Di[n];;){if(--r<0)for(;;){if(--s<0)return;this.re(e>>16,t>>16,l>>7,h>>7,this.ft,n,0),t+=a,e+=d,h+=c,l+=w,n+=this.ut}this.re(i>>16,t>>16,o>>7,h>>7,this.ft,n,0),t+=a,i+=f,h+=c,o+=u,n+=this.ut}else if(e=i<<=16,l=o<<=15,n<0&&(e-=a*n,i-=f*n,l-=c*n,o-=u*n,n=0),t<<=16,h<<=15,s<0&&(t-=d*s,h-=w*s,s=0),r-=s,s-=n,n=this.Di[n],a>16,i>>16,h>>7,o>>7,this.ft,n,0),t+=d,i+=f,h+=w,o+=u,n+=this.ut}this.re(e>>16,i>>16,l>>7,o>>7,this.ft,n,0),e+=a,i+=f,l+=c,o+=u,n+=this.ut}else for(;;){if(--s<0)for(;;){if(--r<0)return;this.re(i>>16,t>>16,o>>7,h>>7,this.ft,n,0),t+=d,i+=f,h+=w,o+=u,n+=this.ut}this.re(i>>16,e>>16,o>>7,l>>7,this.ft,n,0),e+=a,i+=f,l+=c,o+=u,n+=this.ut}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,o>>7,h>>7,this.ft,r,0),i+=f,t+=a,o+=u,h+=c,r+=this.ut}this.re(i>>16,e>>16,o>>7,l>>7,this.ft,r,0),i+=f,e+=d,o+=u,l+=w,r+=this.ut}else for(;;){if(--s<0)for(;;){if(--n<0)return;this.re(t>>16,i>>16,h>>7,o>>7,this.ft,r,0),i+=f,t+=a,o+=u,h+=c,r+=this.ut}this.re(e>>16,i>>16,l>>7,o>>7,this.ft,r,0),i+=f,e+=d,o+=u,l+=w,r+=this.ut}else if(t=e<<=16,h=l<<=15,r<0&&(t-=f*r,e-=d*r,h-=u*r,l-=w*r,r=0),i<<=16,o<<=15,n<0&&(i-=a*n,o-=c*n,n=0),s-=n,n-=r,r=this.Di[r],f>16,e>>16,o>>7,l>>7,this.ft,r,0),i+=a,e+=d,o+=c,l+=w,r+=this.ut}this.re(t>>16,e>>16,h>>7,l>>7,this.ft,r,0),t+=f,e+=d,h+=u,l+=w,r+=this.ut}else for(;;){if(--n<0)for(;;){if(--s<0)return;this.re(e>>16,i>>16,l>>7,o>>7,this.ft,r,0),i+=a,e+=d,o+=c,l+=w,r+=this.ut}this.re(e>>16,t>>16,l>>7,h>>7,this.ft,r,0),t+=f,e+=d,h+=u,l+=w,r+=this.ut}};static re=(t,i,e,s,n,r,h)=>{let o;if(this.Bi){let l;if(this.Ui){if(l=i-t>3?(s-e)/(i-t)|0:0,i>this.wt&&(i=this.wt),t<0&&(e-=t*l,t=0),t>=i)return;r+=t,h=i-t>>2,l<<=2}else{if(!(t>2)>0?(s-e)*this.Si[h]>>15:0}if(0===this.alpha)for(;;){if(--h<0){if((h=i-t&3)>0){o=this.palette[e>>8];do{n[r++]=o,h--}while(h>0);return}break}o=this.palette[e>>8],e+=l,n[r++]=o,n[r++]=o,n[r++]=o,n[r++]=o}else{const s=this.alpha,a=256-this.alpha;for(;;){if(--h<0){if((h=i-t&3)>0){o=this.palette[e>>8],o=((16711935&o)*a>>8&16711935)+((65280&o)*a>>8&65280);do{n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),h--}while(h>0)}break}o=this.palette[e>>8],e+=l,o=((16711935&o)*a>>8&16711935)+((65280&o)*a>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280)}}}else if(tthis.wt&&(i=this.wt),t<0&&(e-=t*l,t=0),t>=i))return;if(r+=t,h=i-t,0===this.alpha)do{n[r++]=this.palette[e>>8],e+=l,h--}while(h>0);else{const t=this.alpha,i=256-this.alpha;do{o=this.palette[e>>8],e+=l,o=((16711935&o)*i>>8&16711935)+((65280&o)*i>>8&65280),n[r++]=o+((16711935&n[r])*t>>8&16711935)+((65280&n[r])*t>>8&65280),h--}while(h>0)}}};static he=(t,i,e,s,n,r,h)=>{let o=0;n!==s&&(o=(i-t<<16)/(n-s)|0);let l=0;r!==n&&(l=(e-i<<16)/(r-n)|0);let a=0;if(r!==s&&(a=(t-e<<16)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),nl)for(r-=n,n-=s,s=this.Di[s];;){if(--n<0)for(;;){if(--r<0)return;this.oe(e>>16,i>>16,this.ft,s,h),e+=a,i+=l,s+=this.ut}this.oe(e>>16,t>>16,this.ft,s,h),e+=a,t+=o,s+=this.ut}else for(r-=n,n-=s,s=this.Di[s];;){if(--n<0)for(;;){if(--r<0)return;this.oe(i>>16,e>>16,this.ft,s,h),e+=a,i+=l,s+=this.ut}this.oe(t>>16,e>>16,this.ft,s,h),e+=a,t+=o,s+=this.ut}else if(i=t<<=16,s<0&&(i-=a*s,t-=o*s,s=0),e<<=16,r<0&&(e-=l*r,r=0),s!==r&&ao)for(n-=r,r-=s,s=this.Di[s];;){if(--r<0)for(;;){if(--n<0)return;this.oe(e>>16,t>>16,this.ft,s,h),e+=l,t+=o,s+=this.ut}this.oe(i>>16,t>>16,this.ft,s,h),i+=a,t+=o,s+=this.ut}else for(n-=r,r-=s,s=this.Di[s];;){if(--r<0)for(;;){if(--n<0)return;this.oe(t>>16,e>>16,this.ft,s,h),e+=l,t+=o,s+=this.ut}this.oe(t>>16,i>>16,this.ft,s,h),i+=a,t+=o,s+=this.ut}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),ra)for(s-=r,r-=n,n=this.Di[n];;){if(--r<0)for(;;){if(--s<0)return;this.oe(t>>16,e>>16,this.ft,n,h),t+=o,e+=a,n+=this.ut}this.oe(t>>16,i>>16,this.ft,n,h),t+=o,i+=l,n+=this.ut}else for(s-=r,r-=n,n=this.Di[n];;){if(--r<0)for(;;){if(--s<0)return;this.oe(e>>16,t>>16,this.ft,n,h),t+=o,e+=a,n+=this.ut}this.oe(i>>16,t>>16,this.ft,n,h),t+=o,i+=l,n+=this.ut}else if(e=i<<=16,n<0&&(e-=o*n,i-=l*n,n=0),t<<=16,s<0&&(t-=a*s,s=0),o>16,i>>16,this.ft,n,h),t+=a,i+=l,n+=this.ut}this.oe(e>>16,i>>16,this.ft,n,h),e+=o,i+=l,n+=this.ut}else for(r-=s,s-=n,n=this.Di[n];;){if(--s<0)for(;;){if(--r<0)return;this.oe(i>>16,t>>16,this.ft,n,h),t+=a,i+=l,n+=this.ut}this.oe(i>>16,e>>16,this.ft,n,h),e+=o,i+=l,n+=this.ut}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,this.ft,r,h),i+=l,t+=o,r+=this.ut}this.oe(i>>16,e>>16,this.ft,r,h),i+=l,e+=a,r+=this.ut}else for(n-=s,s-=r,r=this.Di[r];;){if(--s<0)for(;;){if(--n<0)return;this.oe(t>>16,i>>16,this.ft,r,h),i+=l,t+=o,r+=this.ut}this.oe(e>>16,i>>16,this.ft,r,h),i+=l,e+=a,r+=this.ut}else if(t=e<<=16,r<0&&(t-=l*r,e-=a*r,r=0),i<<=16,n<0&&(i-=o*n,n=0),l>16,e>>16,this.ft,r,h),i+=o,e+=a,r+=this.ut}this.oe(t>>16,e>>16,this.ft,r,h),t+=l,e+=a,r+=this.ut}else for(s-=n,n-=r,r=this.Di[r];;){if(--n<0)for(;;){if(--s<0)return;this.oe(e>>16,i>>16,this.ft,r,h),i+=o,e+=a,r+=this.ut}this.oe(e>>16,t>>16,this.ft,r,h),t+=l,e+=a,r+=this.ut}};static le=(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w,y,m,A,p)=>{const _=this.ae(p);this.Ki=!this.Xi[p];const I=a-u,g=c-w,C=f-m,E=d-a,T=y-c,b=A-f;let R=E*c-T*a<<14;const O=T*f-b*c<<8,v=b*a-E*f<<5;let L=I*c-g*a<<14;const S=g*f-C*c<<8,x=C*a-I*f<<5;let M=g*E-I*T<<14;const k=C*T-g*b<<8,D=I*b-C*E<<5;let N=0,F=0;n!==s&&(N=(i-t<<16)/(n-s)|0,F=(o-h<<16)/(n-s)|0);let B=0,U=0;r!==n&&(B=(e-i<<16)/(r-n)|0,U=(l-o<<16)/(r-n)|0);let P=0,G=0;if(r!==s&&(P=(t-e<<16)/(s-r)|0,G=(h-l<<16)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),nB)for(r-=n,n-=s,s=this.Di[s];;){if(--n<0)for(;;){if(--r<0)return;this.ce(e>>16,i>>16,this.ft,s,_,0,0,R,L,M,O,S,k,l>>8,o>>8),e+=P,i+=B,l+=G,o+=U,s+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(e>>16,t>>16,this.ft,s,_,0,0,R,L,M,O,S,k,l>>8,h>>8),e+=P,t+=N,l+=G,h+=F,s+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}else for(r-=n,n-=s,s=this.Di[s];;){if(--n<0)for(;;){if(--r<0)return;this.ce(i>>16,e>>16,this.ft,s,_,0,0,R,L,M,O,S,k,o>>8,l>>8),e+=P,i+=B,l+=G,o+=U,s+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(t>>16,e>>16,this.ft,s,_,0,0,R,L,M,O,S,k,h>>8,l>>8),e+=P,t+=N,l+=G,h+=F,s+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}}else{i=t<<=16,o=h<<=16,s<0&&(i-=P*s,t-=N*s,o-=G*s,h-=F*s,s=0),e<<=16,l<<=16,r<0&&(e-=B*r,l-=U*r,r=0);const a=s-this.Fi;if(R+=v*a,L+=x*a,M+=D*a,R|=0,L|=0,M|=0,(s===r||P>=N)&&(s!==r||B<=N))for(n-=r,r-=s,s=this.Di[s];;){if(--r<0)for(;;){if(--n<0)return;this.ce(t>>16,e>>16,this.ft,s,_,0,0,R,L,M,O,S,k,h>>8,l>>8),e+=B,t+=N,l+=U,h+=F,s+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(t>>16,i>>16,this.ft,s,_,0,0,R,L,M,O,S,k,h>>8,o>>8),i+=P,t+=N,o+=G,h+=F,s+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}else for(n-=r,r-=s,s=this.Di[s];;){if(--r<0)for(;;){if(--n<0)return;this.ce(e>>16,t>>16,this.ft,s,_,0,0,R,L,M,O,S,k,l>>8,h>>8),e+=B,t+=N,l+=U,h+=F,s+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(i>>16,t>>16,this.ft,s,_,0,0,R,L,M,O,S,k,o>>8,h>>8),i+=P,t+=N,o+=G,h+=F,s+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),rP)for(s-=r,r-=n,n=this.Di[n];;){if(--r<0)for(;;){if(--s<0)return;this.ce(t>>16,e>>16,this.ft,n,_,0,0,R,L,M,O,S,k,h>>8,l>>8),t+=N,e+=P,h+=F,l+=G,n+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(t>>16,i>>16,this.ft,n,_,0,0,R,L,M,O,S,k,h>>8,o>>8),t+=N,i+=B,h+=F,o+=U,n+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}else for(s-=r,r-=n,n=this.Di[n];;){if(--r<0)for(;;){if(--s<0)return;this.ce(e>>16,t>>16,this.ft,n,_,0,0,R,L,M,O,S,k,l>>8,h>>8),t+=N,e+=P,h+=F,l+=G,n+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(i>>16,t>>16,this.ft,n,_,0,0,R,L,M,O,S,k,o>>8,h>>8),t+=N,i+=B,h+=F,o+=U,n+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}}else{e=i<<=16,l=o<<=16,n<0&&(e-=N*n,i-=B*n,l-=F*n,o-=U*n,n=0),t<<=16,h<<=16,s<0&&(t-=P*s,h-=G*s,s=0);const a=n-this.Fi;if(R+=v*a,L+=x*a,M+=D*a,R|=0,L|=0,M|=0,r-=s,s-=n,n=this.Di[n],N>16,i>>16,this.ft,n,_,0,0,R,L,M,O,S,k,h>>8,o>>8),t+=P,i+=B,h+=G,o+=U,n+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(e>>16,i>>16,this.ft,n,_,0,0,R,L,M,O,S,k,l>>8,o>>8),e+=N,i+=B,l+=F,o+=U,n+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}else for(;;){if(--s<0)for(;;){if(--r<0)return;this.ce(i>>16,t>>16,this.ft,n,_,0,0,R,L,M,O,S,k,o>>8,h>>8),t+=P,i+=B,h+=G,o+=U,n+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(i>>16,e>>16,this.ft,n,_,0,0,R,L,M,O,S,k,o>>8,l>>8),e+=N,i+=B,l+=F,o+=U,n+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,this.ft,r,_,0,0,R,L,M,O,S,k,o>>8,h>>8),i+=B,t+=N,o+=U,h+=F,r+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(i>>16,e>>16,this.ft,r,_,0,0,R,L,M,O,S,k,o>>8,l>>8),i+=B,e+=P,o+=U,l+=G,r+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}else for(;;){if(--s<0)for(;;){if(--n<0)return;this.ce(t>>16,i>>16,this.ft,r,_,0,0,R,L,M,O,S,k,h>>8,o>>8),i+=B,t+=N,o+=U,h+=F,r+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(e>>16,i>>16,this.ft,r,_,0,0,R,L,M,O,S,k,l>>8,o>>8),i+=B,e+=P,o+=U,l+=G,r+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}}else{t=e<<=16,h=l<<=16,r<0&&(t-=B*r,e-=P*r,h-=U*r,l-=G*r,r=0),i<<=16,o<<=16,n<0&&(i-=N*n,o-=F*n,n=0);const a=r-this.Fi;if(R+=v*a,L+=x*a,M+=D*a,R|=0,L|=0,M|=0,s-=n,n-=r,r=this.Di[r],B>16,e>>16,this.ft,r,_,0,0,R,L,M,O,S,k,o>>8,l>>8),i+=N,e+=P,o+=F,l+=G,r+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(t>>16,e>>16,this.ft,r,_,0,0,R,L,M,O,S,k,h>>8,l>>8),t+=B,e+=P,h+=U,l+=G,r+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}else for(;;){if(--n<0)for(;;){if(--s<0)return;this.ce(e>>16,i>>16,this.ft,r,_,0,0,R,L,M,O,S,k,l>>8,o>>8),i+=N,e+=P,o+=F,l+=G,r+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(e>>16,t>>16,this.ft,r,_,0,0,R,L,M,O,S,k,l>>8,h>>8),t+=B,e+=P,h+=U,l+=G,r+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}}};static ce=(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w)=>{if(t>=i)return;let y,m,A,p,_,I,g,C,E;if(this.Ui){if(y=(w-d)/(i-t)|0,i>this.wt&&(i=this.wt),t<0&&(d-=t*y,t=0),t>=i)return;m=i-t>>3,y<<=12}else i-t>7?(m=i-t>>3,y=(w-d)*this.Si[m]>>6):(m=0,y=0);if(d<<=9,s+=t,this.Li&&n)if(A=0,p=0,I=t-this.Ni,o+=(c>>3)*I,l+=(f>>3)*I,a+=(u>>3)*I,o|=0,l|=0,_=(a|=0)>>12,0!==_&&(h=l/_|0,(r=o/_|0)<0?r=0:r>4032&&(r=4032)),o+=c,l+=f,a+=u,o|=0,l|=0,_=(a|=0)>>12,0!==_&&(A=o/_|0,p=l/_|0,A<7?A=7:A>4032&&(A=4032)),g=A-r>>3,C=p-h>>3,r+=d>>3&786432,E=d>>23,this.Ki){for(;m-- >0;)e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r=A,h=p,o+=c,l+=f,_=(a+=u)>>12,0!==_&&(A=o/_|0,p=l/_|0,A<7?A=7:A>4032&&(A=4032)),g=A-r>>3,C=p-h>>3,r+=(d+=y)>>3&786432,E=d>>23;for(m=i-t&7;m-- >0;)e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C}else{for(;m-- >0;){let t;0!=(t=n[(4032&h)+(r>>6)]>>>E)&&(e[s]=t),s+=1,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s+=1,r=A,h=p,o+=c,l+=f,a+=u,o|=0,l|=0,_=(a|=0)>>12,0!==_&&(A=o/_|0,p=l/_|0,A<7?A=7:A>4032&&(A=4032)),g=A-r>>3,C=p-h>>3,r+=(d+=y)>>3&786432,E=d>>23}for(m=i-t&7;m-- >0;){let t;0!=(t=n[(4032&h)+(r>>6)]>>>E)&&(e[s]=t),s++,r+=g,h+=C}}else if(A=0,p=0,I=t-this.Ni,o+=(c>>3)*I,l+=(f>>3)*I,a+=(u>>3)*I,o|=0,l|=0,_=(a|=0)>>14,0!==_&&(h=l/_|0,(r=o/_|0)<0?r=0:r>16256&&(r=16256)),o+=c,l+=f,a+=u,o|=0,l|=0,_=(a|=0)>>14,0!==_&&(A=o/_|0,p=l/_|0,A<7?A=7:A>16256&&(A=16256)),g=A-r>>3,C=p-h>>3,r+=6291456&d,E=d>>23,this.Ki&&n){for(;m-- >0;)e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r=A,h=p,o+=c,l+=f,a+=u,o|=0,l|=0,_=(a|=0)>>14,0!==_&&(A=o/_|0,p=l/_|0,A<7?A=7:A>16256&&(A=16256)),g=A-r>>3,C=p-h>>3,r+=6291456&(d+=y),E=d>>23;for(m=i-t&7;m-- >0;)e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C}else{for(;m-- >0&&n;){let t;0!=(t=n[(16256&h)+(r>>7)]>>>E)&&(e[s]=t),s+=1,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,r=A,h=p,o+=c,l+=f,a+=u,o|=0,l|=0,_=(a|=0)>>14,0!==_&&(A=o/_|0,p=l/_|0,A<7?A=7:A>16256&&(A=16256)),g=A-r>>3,C=p-h>>3,r+=6291456&(d+=y),E=d>>23}for(m=i-t&7;m-- >0&&n;){let t;0!=(t=n[(16256&h)+(r>>7)]>>>E)&&(e[s]=t),s++,r+=g,h+=C}}};static oe=(t,i,e,s,n)=>{if(this.Ui&&(i>this.wt&&(i=this.wt),t<0&&(t=0)),t>=i)return;s+=t;let r=i-t>>2;if(0===this.alpha)for(;;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;e[s++]=n}e[s++]=n,e[s++]=n,e[s++]=n,e[s++]=n}const h=this.alpha,o=256-this.alpha;for(n=((16711935&n)*o>>8&16711935)+((65280&n)*o>>8&65280);;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280)}e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280)}};static ee=t=>{this.Gi[t]&&this.Pi&&(this.Pi[this.Wi++]=this.Gi[t],this.Gi[t]=null)};static ae=t=>{if(this.Hi[t]=this.Yi++,this.Gi[t])return this.Gi[t];let i;if(this.Wi>0&&this.Pi)i=this.Pi[--this.Wi],this.Pi[this.Wi]=null;else{let t=0,e=-1;for(let i=0;i>>3)&16316671,i[n+8192]=r-(r>>>2)&16316671,i[n+12288]=r-(r>>>2)-(r>>>3)&16316671}}else{if(64===e.width)for(let t=0;t<128;t++)for(let n=0;n<128;n++)i[n+(t<<7)]=s[e.ft[(n>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)i[t]=s[e.ft[t]];this.Xi[t]=!1;for(let e=0;e<16384;e++){i[e]&=16316671;const s=i[e];0===s&&(this.Xi[t]=!0),i[e+16384]=s-(s>>>3)&16316671,i[e+32768]=s-(s>>>2)&16316671,i[e+49152]=s-(s>>>2)-(s>>>3)&16316671}}return i}}const F=['F11','F12'],B={'Backspace':{code:8,ch:8},'Enter':{code:10,ch:10},'Shift':{code:16,ch:65535},'Escape':{code:27,ch:27},'Tab':{code:9,ch:9},'CapsLock':{code:20,ch:65535},' ':{code:32,ch:32},'Control':{code:17,ch:65535},'Alt':{code:18,ch:65535},'Meta':{code:524,ch:65535},'ArrowLeft':{code:37,ch:65535},'ArrowRight':{code:39,ch:65535},'ArrowUp':{code:38,ch:65535},'ArrowDown':{code:40,ch:65535},'Insert':{code:155,ch:65535},'Home':{code:36,ch:65535},'PageUp':{code:33,ch:65535},'Delete':{code:127,ch:127},'End':{code:35,ch:65535},'PageDown':{code:34,ch:65535},'`':{code:192,ch:96},'~':{code:192,ch:126},'!':{code:49,ch:33},'@':{code:50,ch:64},'#':{code:51,ch:35},'$':{code:52,ch:36},'%':{code:53,ch:37},'^':{code:54,ch:94},'&':{code:55,ch:38},'*':{code:56,ch:42},'(':{code:57,ch:40},')':{code:48,ch:41},'-':{code:45,ch:45},'_':{code:45,ch:95},'=':{code:61,ch:61},'+':{code:61,ch:43},'[':{code:91,ch:91},'{':{code:91,ch:123},']':{code:93,ch:93},'}':{code:93,ch:125},'\\':{code:92,ch:92},'|':{code:92,ch:124},';':{code:59,ch:59},':':{code:59,ch:58},"'":{code:222,ch:39},'"':{code:222,ch:34},',':{code:44,ch:44},'<':{code:44,ch:60},'.':{code:46,ch:46},'>':{code:46,ch:62},'/':{code:47,ch:47},'?':{code:47,ch:63},'F1':{code:112,ch:65535},'F2':{code:113,ch:65535},'F3':{code:114,ch:65535},'F4':{code:115,ch:65535},'F5':{code:116,ch:65535},'F6':{code:117,ch:65535},'F7':{code:118,ch:65535},'F8':{code:119,ch:65535},'F9':{code:120,ch:65535},'F10':{code:121,ch:65535},'F11':{code:122,ch:65535},'F12':{code:123,ch:65535},0:{code:48,ch:48},1:{code:49,ch:49},2:{code:50,ch:50},3:{code:51,ch:51},4:{code:52,ch:52},5:{code:53,ch:53},6:{code:54,ch:54},7:{code:55,ch:55},8:{code:56,ch:56},9:{code:57,ch:57},'a':{code:65,ch:97},'b':{code:66,ch:98},'c':{code:67,ch:99},'d':{code:68,ch:100},'e':{code:69,ch:101},'f':{code:70,ch:102},'g':{code:71,ch:103},'h':{code:72,ch:104},'i':{code:73,ch:105},'j':{code:74,ch:106},'k':{code:75,ch:107},'l':{code:76,ch:108},'m':{code:77,ch:109},'n':{code:78,ch:110},'o':{code:79,ch:111},'p':{code:80,ch:112},'q':{code:81,ch:113},'r':{code:82,ch:114},'s':{code:83,ch:115},'t':{code:84,ch:116},'u':{code:85,ch:117},'v':{code:86,ch:118},'w':{code:87,ch:119},'x':{code:88,ch:120},'y':{code:89,ch:121},'z':{code:90,ch:122},'A':{code:65,ch:65},'B':{code:66,ch:66},'C':{code:67,ch:67},'D':{code:68,ch:68},'E':{code:69,ch:69},'F':{code:70,ch:70},'G':{code:71,ch:71},'H':{code:72,ch:72},'I':{code:73,ch:73},'J':{code:74,ch:74},'K':{code:75,ch:75},'L':{code:76,ch:76},'M':{code:77,ch:77},'N':{code:78,ch:78},'O':{code:79,ch:79},'P':{code:80,ch:80},'Q':{code:81,ch:81},'R':{code:82,ch:82},'S':{code:83,ch:83},'T':{code:84,ch:84},'U':{code:85,ch:85},'V':{code:86,ch:86},'W':{code:87,ch:87},'X':{code:88,ch:88},'Y':{code:89,ch:89},'Z':{code:90,ch:90}};class U{static enabled=!1;static fe=null;static ue=null;static de=0;static we=0;static ye=0;static me=0;static Ae=0;static pe=()=>{this.fe=R.zt(1),this.ue=null,this.de=performance.now(),this.enabled=!0};static _e=()=>{this.enabled=!1,this.fe=null};static flush=()=>{let t=null;return this.ue&&this.enabled&&(t=this.ue),this.ue=null,t};static stop=()=>{let t=null;return this.fe&&this.fe.Xt>0&&this.enabled&&(t=this.fe),this._e(),t};static Ie=(t,i,e)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;this.we++;const s=performance.now();let n=(s-this.de)/10|0;n>250&&(n=250),this.de=s,this.ge(5),1===e?this.fe?.p1(1):this.fe?.p1(2),this.fe?.p1(n),this.fe?.p3(t+(i<<10))};static Ce=t=>{if(!this.enabled)return;this.we++;const i=performance.now();let e=(i-this.de)/10|0;e>250&&(e=250),this.de=i,this.ge(2),1===t?this.fe?.p1(3):this.fe?.p1(4),this.fe?.p1(e)};static Ee=(t,i)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;const e=performance.now();if(e-this.ye>=50){this.ye=e,this.we++;let s=(e-this.de)/10|0;s>250&&(s=250),this.de=e,t-this.me<8&&t-this.me>=-8&&i-this.Ae<8&&i-this.Ae>=-8?(this.ge(3),this.fe?.p1(5),this.fe?.p1(s),this.fe?.p1(t+(i-this.Ae+8<<4)+8-this.me)):t-this.me<128&&t-this.me>=-128&&i-this.Ae<128&&i-this.Ae>=-128?(this.ge(4),this.fe?.p1(6),this.fe?.p1(s),this.fe?.p1(t+128-this.me),this.fe?.p1(i+128-this.Ae)):(this.ge(5),this.fe?.p1(7),this.fe?.p1(s),this.fe?.p3(t+(i<<10))),this.me=t,this.Ae=i}};static Te=t=>{if(!this.enabled)return;this.we++;const i=performance.now();let e=(i-this.de)/10|0;e>250&&(e=250),this.de=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.ge(3),this.fe?.p1(8),this.fe?.p1(e),this.fe?.p1(t)};static be=t=>{if(!this.enabled)return;this.we++;const i=performance.now();let e=(i-this.de)/10|0;e>250&&(e=250),this.de=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.ge(3),this.fe?.p1(9),this.fe?.p1(e),this.fe?.p1(t)};static Re=()=>{if(!this.enabled)return;this.we++;const t=performance.now();let i=(t-this.de)/10|0;i>250&&(i=250),this.de=t,this.ge(2),this.fe?.p1(10),this.fe?.p1(i)};static Oe=()=>{if(!this.enabled)return;this.we++;const t=performance.now();let i=(t-this.de)/10|0;i>250&&(i=250),this.de=t,this.ge(2),this.fe?.p1(11),this.fe?.p1(i)};static ve=()=>{if(!this.enabled)return;this.we++;const t=performance.now();let i=(t-this.de)/10|0;i>250&&(i=250),this.de=t,this.ge(2),this.fe?.p1(12),this.fe?.p1(i)};static Le=()=>{if(!this.enabled)return;this.we++;const t=performance.now();let i=(t-this.de)/10|0;i>250&&(i=250),this.de=t,this.ge(2),this.fe?.p1(13),this.fe?.p1(i)};static ge=t=>{if(this.fe&&this.fe.Xt+t>=500){const t=this.fe;this.fe=R.zt(1),this.ue=t}}}class P{static getParameter(t){return new URLSearchParams(window.location.search).get(t)??''}static setParameter(t,i){const e=new URL(window.location.toString());e.searchParams.set(t,i),window.history.pushState(null,'',e.toString())}Se=0;xe=[];Me=0;ke=null;state=0;De=20;Ne=1;Fe=[];Be=0;Ue=0;Pe=[];Ge=!0;We=!1;Ye=50;hasFocus=!0;He=!1;Ve=0;Ke=0;Xe=0;je=0;ze=0;Ze=0;qe=0;Je=[];$e=[];Qe=0;ts=0;input=null;es=!1;ss=!1;ns=!1;time=-1;rs=0;hs=0;os=0;ls=0;cs=0;fs=0;constructor(t=!1){A.tabIndex=-1,p.fillStyle='black',p.fillRect(0,0,A.width,A.height),this.We=t,this.We?this.resize(window.innerWidth,window.innerHeight):this.resize(A.width,A.height)}get width(){return A.width}get height(){return A.height}resize=(t,i)=>{A.width=t,A.height=i,this.ke=new C(t,i),N.Zi()};us=async()=>{A.addEventListener('resize',(()=>{this.We&&this.resize(window.innerWidth,window.innerHeight)}),!1),A.onmousedown=this.onmousedown,A.onmouseup=this.onmouseup,A.onmouseenter=this.onmouseenter,A.onmouseleave=this.onmouseleave,A.onmousemove=this.onmousemove,window.onbeforeunload=this.zi,A.onfocus=this.onfocus,A.onblur=this.onblur,this.ds?(A.ontouchstart=this.ontouchstart,A.ontouchend=this.ontouchend,A.ontouchmove=this.ontouchmove):(A.onkeydown=this.onkeydown,A.onkeyup=this.onkeyup),A.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.ds&&'low'===P.getParameter('detail')&&(this.Ye=30),await this.ws(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.Fe[t]=performance.now();let t,i=0,e=256,s=1,n=0;for(;this.state>=0;){if(this.state>0&&(this.state--,0===this.state))return void this.ys();const r=e,h=s;e=300,s=1,t=performance.now();const o=this.Fe[i];if(0===o?(e=r,s=h):t>o&&(e=2560*this.De/(t-o)|0),e<25?e=25:e>256&&(e=256,s=this.De-(t-o)/10|0),this.Fe[i]=t,i=(i+1)%10,s>1)for(let t=0;t<10;t++)0!==this.Fe[t]&&(this.Fe[t]+=s);for(s0&&(this.Be=1e3*e/(256*this.De)|0);const l=performance.now();if(this.Ge&&this.refresh(),await this.draw(),this.Pe[this.Ue]=(performance.now()-l)/1e3,this.Ue=(this.Ue+1)%this.Pe.length,this.Ye<50){const i=1e3/this.Ye-(performance.now()-t);i>0&&await E(i)}}-1===this.state&&this.ys()};ys=()=>{this.state=-2,this.zi()};As=t=>{this.De=1e3/t|0};ps=t=>{this.Ye=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.De|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};zi=()=>{};draw=async()=>{};refresh=()=>{};async ws(t,i){const e=this.width,s=this.height;this.Ge&&(p.fillStyle='black',p.fillRect(0,0,e,s),this.Ge=!1);const n=s/2-18;p.fillStyle='rgb(140, 17, 17)',p.rect((e/2|0)-152,n,304,34),p.fillRect((e/2|0)-150,n+2,3*t,30),p.fillStyle='black',p.fillRect((e/2|0)-150+3*t,n+2,300-3*t,30),p.font='bold 13px helvetica, sans-serif',p.textAlign='center',p.fillStyle='white',p.fillText(i,e/2|0,n+22),await E(5)}_s=()=>{let t=-1;return this.ts!==this.Qe&&(t=this.$e[this.Qe],this.Qe=this.Qe+1&127),t};get ms(){const t=this.Pe.length;let i=0;for(let e=0;ethis.Se&&(this.Se=e),this.xe[this.Me]=e,this.Me=(this.Me+1)%250,e}get Is(){return this.xe.reduce(((t,i)=>t+i),0)/250}onkeydown=t=>{const i=t.key;this.Ve=0;const e=B[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;t.ctrlKey&&(n>='A'.charCodeAt(0)&&n<=']'.charCodeAt(0)||n=='_'.charCodeAt(0)?n-='A'.charCodeAt(0)-1:n>='a'.charCodeAt(0)&&n<='z'.charCodeAt(0)&&(n-='a'.charCodeAt(0)-1)),n<30&&(n=0),s===B.ArrowLeft.code?n=1:s===B.ArrowRight.code?n=2:s===B.ArrowUp.code?n=3:s===B.ArrowDown.code?n=4:s===B.Control.code?n=5:s===B.Shift.code?n=6:s===B.Alt.code?n=7:s===B.Backspace.code||s===B.Delete.code?n=8:s===B.Tab.code?n=9:s===B.Enter.code?n=10:s>=B.F1.code&&s<=B.F12.code?n=s+1008-B.F1.code:s===B.Home.code?n=1e3:s===B.End.code?n=1001:s===B.PageUp.code?n=1002:s===B.PageDown.code&&(n=1003),n>0&&n<128&&(this.Je[n]=1),n>4&&(this.$e[this.ts]=n,this.ts=this.ts+1&127),U.enabled&&U.Te(n),F.includes(i)||t.preventDefault()};onkeyup=t=>{const i=t.key;this.Ve=0;const e=B[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;n<30&&(n=0),s===B.ArrowLeft.code?n=1:s===B.ArrowRight.code?n=2:s===B.ArrowUp.code?n=3:s===B.ArrowDown.code?n=4:s===B.Control.code?n=5:s===B.Shift.code?n=6:s===B.Alt.code?n=7:s===B.Backspace.code||s===B.Delete.code?n=8:s===B.Tab.code?n=9:s===B.Enter.code?n=10:s>=B.F1.code&&s<=B.F12.code?n=s+1008-B.F1.code:s===B.Home.code?n=1e3:s===B.End.code?n=1001:s===B.PageUp.code?n=1002:s===B.PageDown.code&&(n=1003),n>0&&n<128&&(this.Je[n]=0),U.enabled&&U.be(n),F.includes(i)||t.preventDefault()};onmousedown=t=>{if(this.es=!1,(t.clientX>0||t.clientY>0)&&this.gs(t),this.Ve=0,this.Ze=this.Xe,this.qe=this.je,this.ds&&!this.Cs){if(this.Es()||this.Ts()||this.bs())return this.ze=1,void(this.Ke=1);t.timeStamp>=this.time+500?(this.ze=2,this.Ke=2):(this.ze=1,this.Ke=1)}else 2===t.button?(this.ze=2,this.Ke=2):(this.ze=1,this.Ke=1);U.enabled&&U.Ie(this.Ze,this.qe,t.buttons)};onmouseup=t=>{this.gs(t),this.Ve=0,this.Ke=0,U.enabled&&U.Ce(t.buttons)};onmouseenter=t=>{this.gs(t),U.enabled&&U.ve()};onmouseleave=t=>{this.gs(t),this.Ve=0,this.Xe=-1,this.je=-1,this.Ke=0,this.Ze=-1,this.qe=-1,U.enabled&&U.Le()};onmousemove=t=>{this.gs(t),this.Ve=0,U.enabled&&U.Ee(this.Xe,this.je)};onfocus=t=>{this.hasFocus=!0,this.Ge=!0,this.refresh(),U.enabled&&U.Re()};onblur=t=>{this.hasFocus=!1,U.enabled&&U.Oe()};ontouchstart=t=>{if(!this.ds)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.es=!0;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.rs=this.cs=this.os=0|i.screenX,this.hs=this.fs=this.ls=0|i.screenY,this.time=t.timeStamp,this.ss=this.Rs(),this.ns=this.Os()};ontouchend=t=>{if(!this.ds||!this.es)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;if(this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.cs=0|i.screenX,this.fs=0|i.screenY,this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.ss&&!this.Rs())return void(this.es=!1);if(this.ns&&!this.Os())return void(this.es=!1);if(this.Es()||this.vs()||this.Ts()||this.bs()){null!==this.input&&(this.input.parentNode?.contains(this.input)&&this.input.parentNode?.removeChild(this.input),this.input=null);const t=document.createElement('input');return this.Ts()?(t.setAttribute('id','username'),t.setAttribute('placeholder','Username')):this.bs()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.Es()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.vs()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this.Ls?t.setAttribute('type','password'):t.setAttribute('type',this.bs()?'password':'text'),t.setAttribute('autofocus','autofocus'),t.setAttribute('spellcheck','false'),t.setAttribute('autocomplete','off'),t.setAttribute('style',`position: fixed; left: ${e}px; top: ${s}px; width: 1px; height: 1px; opacity: 0;`),document.body.appendChild(t),t.focus(),t.click(),this.Ls&&(t.oninput=t=>{if(!(t instanceof InputEvent))return;const i=t,e=i.data;null!==e&&'insertText'===i.inputType&&this.onkeydown(new KeyboardEvent('keydown',{key:e,code:e}))}),t.onkeydown=t=>{this.Ls&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this.Ls&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeyup(new KeyboardEvent('keyup',{key:t.key,code:t.key}))},t.onfocus=t=>{this.input?.parentNode?.removeChild(this.input),this.input=null,this.onfocus(t)},this.input=t,void(this.es=!1)}const n=t.timeStamp>=this.time+500,r=Math.abs(this.rs-this.cs)>16||Math.abs(this.hs-this.fs)>16;n&&!r?(this.es=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.Ke=0,this.es=!1)};ontouchmove=t=>{if(!this.ds||!this.es)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.cs=0|i.screenX,this.fs=0|i.screenY,this.ss&&-1===this.Ss()?(this.os-this.cs>0?this.rotate(2):this.os-this.cs<0&&this.rotate(0),this.ls-this.fs>0?this.rotate(3):this.ls-this.fs<0&&this.rotate(1)):(this.ns||-1!==this.Ss())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this.os=this.cs,this.ls=this.fs};get ds(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get Ls(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get Cs(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}Rs=()=>this.He&&this.Xe>=8&&this.Xe<=520&&this.je>=11&&this.je<=345;Es=()=>this.He&&-1===this.xs()&&!this.Ms()&&!this.ks()&&this.Xe>=11&&this.Xe<=506&&this.je>=449&&this.je<=482;vs=()=>this.He&&(this.Ms()||this.ks())&&this.Xe>=11&&this.Xe<=506&&this.je>=383&&this.je<=482;Os=()=>this.He&&this.Xe>=562&&this.Xe<=752&&this.je>=231&&this.je<=492;Ts=()=>!this.He&&2===this.Ds()&&this.Xe>=301&&this.Xe<=562&&this.je>=262&&this.je<=279;bs=()=>!this.He&&2===this.Ds()&&this.Xe>=301&&this.Xe<=562&&this.je>=279&&this.je<=296;rotate=t=>{0===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowLeft',code:'ArrowLeft'}))):1===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowUp',code:'ArrowUp'}))):2===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowRight',code:'ArrowRight'}))):3===t&&(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowDown',code:'ArrowDown'})))};Ns=()=>null!==document.fullscreenElement;gs=t=>{if(this.Ns()){const i=t.target.getBoundingClientRect(),e=window.innerHeight/A.height,s=(window.innerWidth-A.width*e)/2;this.Xe=0|this.Fs(t.clientX-i.left-s,0,A.width*e,0,789),this.je=0|this.Fs(t.clientY-i.top,0,A.height*e,0,532)}else{const i=A.getBoundingClientRect(),e=A.width/i.width,s=A.height/i.height;this.Xe=(t.clientX-i.left)*e|0,this.je=(t.clientY-i.top)*s|0}this.Xe<0&&(this.Xe=0),this.je<0&&(this.je=0),this.Xe>789&&(this.Xe=789),this.je>532&&(this.je=532)};Fs=(t,i,e,s,n)=>(t-i)*(n-s)/(e-i)+s}class G{db;constructor(t){t.onerror=this.onerror,t.onclose=this.onclose,this.db=t}static openDatabase=async()=>await new Promise(((t,i)=>{const e=indexedDB.open('lostcity',1);e.onsuccess=i=>{const e=i.target;console.log('database success!'),t(e.result)},e.onupgradeneeded=t=>{t.target.result.createObjectStore('cache')},e.onerror=t=>{const e=t.target;console.error('database error!: ',e.error),i(e.result)}}));Bs=async t=>await new Promise((i=>{const e=this.db.transaction('cache','readonly').objectStore('cache').get(t);e.onsuccess=()=>{i(e.result)},e.onerror=t=>{i(void 0)}}));Us=async(t,i)=>await new Promise(((e,s)=>{const n=this.db.transaction('cache','readwrite').objectStore('cache').put(i,t);n.onsuccess=()=>{e()},n.onerror=t=>{s()}}));onclose=t=>{console.log('database close!')};onerror=t=>{console.log('database error!')};Ps=t=>{const i=t.trim();let e=0;for(let t=0;t='A'&&s<='Z'?e+=s.charCodeAt(0)+1-65:s>='a'&&s<='z'?e+=s.charCodeAt(0)+1-97:s>='0'&&s<='9'&&(e+=s.charCodeAt(0)+27-48)}return e}}class W{static Ps=t=>{let i=0;t=t.toUpperCase();for(let e=0;e=this.Ws)return null;if(this.Xs[t])return this.Xs[t];const e=this.Ks[t],s=e+this.Vs[t];if(this.Gs){const i=Uint8Array.from(this.buffer.subarray(e,e+s));return this.Xs[t]=i,i}{const e=Uint8Array.from(i.read(this.Hs[t],this.buffer,this.Vs[t],this.Ks[t]));return this.Xs[t]=e,e}}}class Y{static zs=new Uint8Array(520);Zs;qs;store;constructor(t,i,e){this.Zs=new R(t),this.qs=new R(i),this.store=e+1}get Ws(){return this.qs.length/6}read(t,i=!1){this.qs.Xt=6*t;const e=this.qs.Qt;let s=this.qs.Qt;if(s<=0||s>this.Zs.length/520)return null;const n=new Uint8Array(e);let r=0;for(let i=0;r512&&(h=512),this.Zs.ri(h+8,0,Y.zs);const o=(255&Y.zs[0])<<8|255&Y.zs[1],l=(255&Y.zs[2])<<8|255&Y.zs[3],a=(255&Y.zs[4])<<16|(255&Y.zs[5])<<8|255&Y.zs[6],c=255&Y.zs[7];if(o!==t||l!==i||c!==this.store)return null;if(a<0||a>this.Zs.length/520)return null;for(let t=0;t>>0;if(h.nt(e,a),4294967295===s){const t=h.$s(),i=h.Qs(),e=new Uint8Array(h.memory.buffer,t,i),s=(new TextDecoder).decode(e);throw new l(s)}const n=h.buffer()>>>0;return new Uint8Array(h.memory.buffer,n,s)}(n)}}class H{static tn=[];static en=t=>{const i=new R(t.read('base_head.dat')),e=new R(t.read('base_type.dat')),s=new R(t.read('base_label.dat')),n=i.Jt;i.Xt+=2;for(let t=0;t{const i=new R(t.read('frame_head.dat')),e=new R(t.read('frame_tran1.dat')),s=new R(t.read('frame_tran2.dat')),n=new R(t.read('frame_del.dat')),r=i.Jt;i.Xt+=2;const h=new Int32Array(500),o=new Int32Array(500),l=new Int32Array(500),a=new Int32Array(500);for(let t=0;t0){if(0!==f.types[t])for(let i=t-1;i>d;i--)if(0===f.types[i]){h[w]=i,o[w]=0,l[w]=0,a[w]=0,w++;break}h[w]=t;let e=0;3===f.types[h[w]]&&(e=128),o[w]=1&i?s.ei:e,l[w]=2&i?s.ei:e,a[w]=4&i?s.ei:e,d=t,w++}}r.length=w,r.nn=new Int32Array(w),r.x=new Int32Array(w),r.y=new Int32Array(w),r.z=new Int32Array(w);for(let t=0;t>7)<2?i=2:i>126&&(i=126),(65408&t)+i):(i<0?i=0:i>127&&(i=127),127-i)}static lr=(t,i,e)=>{const s=t.rn,n=t.hn,r=t.ln;let h,o,l,a,c;if(i){h=new Int32Array(s);for(let i=0;i{const n=t.rn,r=t.hn,h=t.ln;let o,l,a,c,f;if(s)o=t.Ar,l=t.ar,a=t.pr;else{o=new Int32Array(n),l=new Int32Array(n),a=new Int32Array(n);for(let i=0;i{const e=t.rn,s=t.hn,n=t.ln,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e);for(let i=0;i{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,l=0,a=-1;for(let c=0;c{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,l=0,a=-1;for(let c=0;c{let o=-1;const l=t.Ar[i],a=t.ar[i],c=t.pr[i];for(let t=0;t{if(!j.metadata)throw new Error('cant loading model metadata!!!!!');const i=j.metadata[t];if(!i)throw console.log(`Error model:${t} not found!`),new Error('cant loading model metadata!!!!!');if(!(j.head&&j.Cn&&j.En&&j.Tn&&j.bn&&j.Rn&&j.On&&j.vn&&j.Ln&&j.Sn&&j.xn&&j.Mn&&j.kn&&j.axis))throw new Error('cant loading model!!!!!');const e=i.rn,s=i.hn,n=i.ln,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e),l=new Int32Array(s),a=new Int32Array(s),c=new Int32Array(s),f=new Int32Array(n),u=new Int32Array(n),d=new Int32Array(n);let w=null;i.dn>=0&&(w=new Int32Array(e));let y=null;i.An>=0&&(y=new Int32Array(s));let m=null,A=0;i.pn>=0?m=new Int32Array(s):A=-i.pn-1;let p=null;i._n>=0&&(p=new Int32Array(s));let _=null;i.In>=0&&(_=new Int32Array(s));const I=new Int32Array(s);j.On.Xt=i.an,j.vn.Xt=i.cn,j.Ln.Xt=i.fn,j.Sn.Xt=i.un,j.xn.Xt=i.dn;let g,C,E,T=0,b=0,R=0;for(let t=0;t{if(!j.metadata||!j.metadata[i])throw new Error('No model metadata');const e=j.metadata[i];if(e.data=t,!e.data.length)throw new Error('No model data');const s=e.rn,n=e.hn,r=e.ln,h=new Int32Array(s),o=new Int32Array(s),l=new Int32Array(s),a=new Int32Array(n),c=new Int32Array(n),f=new Int32Array(n),u=new Int32Array(r),d=new Int32Array(r),w=new Int32Array(r);let y=null;e.dn>=0&&(y=new Int32Array(s));let m=null;e.An>=0&&(m=new Int32Array(n));let A=null,p=0;e.pn>=0?A=new Int32Array(n):p=-e.pn-1;let _=null;e._n>=0&&(_=new Int32Array(n));let I=null;e.In>=0&&(I=new Int32Array(n));const g=new Int32Array(n),C=new R(e.data);C.Xt=e.an;const E=new R(e.data);E.Xt=e.cn;const T=new R(e.data);T.Xt=e.fn;const b=new R(e.data);b.Xt=e.un;const O=new R(e.data);O.Xt=e.dn;let v,L,S,x=0,M=0,k=0;for(let t=0;tthis.Nr&&(this.Nr=-e),e>this.Dr&&(this.Dr=e);const n=i*i+s*s;n>this.kr&&(this.kr=n)}this.kr=Math.sqrt(this.kr)+.99|0,this.Br=Math.sqrt(this.kr*this.kr+this.Nr*this.Nr)+.99|0,this.Fr=this.Br+(Math.sqrt(this.kr*this.kr+this.Dr*this.Dr)+.99|0)}$r(){this.Nr=0,this.Dr=0;for(let t=0;tthis.Nr&&(this.Nr=-i),i>this.Dr&&(this.Dr=i)}this.Br=Math.sqrt(this.kr*this.kr+this.Nr*this.Nr)+.99|0,this.Fr=this.Br+(Math.sqrt(this.kr*this.kr+this.Dr*this.Dr)+.99|0)}Qr(){if(this.Pr){const t=new Int32Array(256);let i=0;for(let e=0;ei&&(i=s)}this.Yr=new v(i+1,null);for(let e=0;e<=i;e++)this.Yr[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;ei&&(i=s)}this.Hr=new v(i+1,null);for(let e=0;e<=i;e++)this.Hr[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;eo;)o=e[h++];r&&r.types&&s.x&&s.y&&s.z&&r.labels&&(i!==o||0===r.types[i])&&this.ih(s.x[t],s.y[t],s.z[t],r.labels[i],r.types[i])}j.$n=0,j.Qn=0,j.tr=0,h=0,o=e[h++];for(let t=0;to;)o=e[h++];r&&r.types&&n.x&&n.y&&n.z&&r.labels&&(i===o||0===r.types[i])&&this.ih(n.x[t],n.y[t],n.z[t],r.labels[i],r.types[i])}}else this.eh(t)}eh(t){if(!this.Yr||-1===t||!V.tn[t])return;const i=V.tn[t],e=i.sn;j.$n=0,j.Qn=0,j.tr=0;for(let t=0;t>16;this.pr[t]=this.ar[t]*i+this.pr[t]*e>>16,this.ar[t]=s}}translate(t,i,e){for(let s=0;s>8;if(this.cr&&this.ur&&this.dr||(this.cr=new Int32Array(this.hn),this.ur=new Int32Array(this.hn),this.dr=new Int32Array(this.hn)),!this.yr){this.yr=new v(this.rn,null);for(let t=0;t8192||m>8192||A>8192||y<-8192||m<-8192||A<-8192;)y>>=1,m>>=1,A>>=1;let p=0|Math.sqrt(y*y+m*m+A*A);if(p<=0&&(p=1),y=256*y/p|0,m=256*m/p|0,A=256*A/p|0,this.wr&&1&this.wr[i]){const r=t+((e*y+s*m+n*A)/(h+(h/2|0))|0);this.Tr&&(this.cr[i]=j.hr(this.Tr[i],r,this.wr[i]))}else{let t=this.yr[r];t&&(t.x+=y,t.y+=m,t.z+=A,t.w++),t=this.yr[o],t&&(t.x+=y,t.y+=m,t.z+=A,t.w++),t=this.yr[l],t&&(t.x+=y,t.y+=m,t.z+=A,t.w++)}}if(r)this.lh(t,h,e,s,n);else{this.mr=new v(this.rn,null);for(let t=0;t>16;for(let s=0;s>16,p=p*u-A*f>>16,A=m),0!==t&&(m=p*l-_*o>>16,_=p*o+_*l>>16,p=m),0!==i&&(m=_*a+A*c>>16,_=_*c-A*a>>16,A=m),A+=n,p+=r,_+=h,m=p*w-_*d>>16,_=p*d+_*w>>16,p=m,j.Fn&&j.Bn&&j.Un&&(j.Un[s]=_-y,j.Fn[s]=N.Ni+((A<<9)/_|0),j.Bn[s]=N.Fi+((p<<9)/_|0)),this.ln>0&&j.Pn&&j.Gn&&j.Wn&&(j.Pn[s]=A,j.Gn[s]=p,j.Wn[s]=_)}try{this.uh(!1,!1,0)}catch(t){}}draw(t,i,e,s,n,r,h,o,l){const a=o*n-r*s>>16,c=h*i+a*e>>16,f=this.kr*e>>16,u=c+f;if(u<=50||c>=3500)return;const d=o*s+r*n>>16;let w=d-this.kr<<9;if((w/u|0)>=m.yt)return;let y=d+this.kr<<9;if((y/u|0)<=-m.yt)return;const A=h*e-a*i>>16,p=this.kr*i>>16;let _=A+p<<9;if((_/u|0)<=-m.At)return;let I=A-(p+(this.Nr*e>>16))<<9;if((I/u|0)>=m.At)return;let g=c-(f+(this.Nr*i>>16))<=50,C=!1;if(l>0&&j.ir){let t=c-f;t<=50&&(t=50),d>0?(w=w/u|0,y=y/t|0):(y=y/u|0,w=w/t|0),A>0?(I=I/u|0,_=_/t|0):(_=_/u|0,I=I/t|0);const i=j.Xe-N.Ni,e=j.je-N.Fi;i>w&&iI&&e<_&&(this.Zr?j.sr[j.er++]=l:C=!0)}const E=N.Ni,T=N.Fi;let b=0,R=0;0!==t&&(b=N.sin[t],R=N.cos[t]);for(let l=0;l>16,d=d*R-f*b>>16,f=a),f+=r,u+=h,d+=o,a=d*s+f*n>>16,d=d*n-f*s>>16,f=a,a=u*e-d*i>>16,d=u*i+d*e>>16,u=a,j.Un&&(j.Un[l]=d-c),d>=50&&j.Fn&&j.Bn?(j.Fn[l]=E+((f<<9)/d|0),j.Bn[l]=T+((u<<9)/d|0)):j.Fn&&(j.Fn[l]=-5e3,g=!0),(g||this.ln>0)&&j.Pn&&j.Gn&&j.Wn&&(j.Pn[l]=f,j.Gn[l]=u,j.Wn[l]=d)}try{this.uh(g,C,l)}catch(t){}}uh(t,i,e,s=!1){j.nr&&(this.qr=-1,this.Jr=-1);for(let t=0;tm.wt||l>m.wt||a>m.wt),j.Hn&&j.Yn){const t=((d+w+y)/3|0)+this.Br;j.Hn[t][j.Yn[t]++]=s,j.nr&&this.dh(j.Xe,j.je,c,f,u,o,l,a)&&this.Jr=0;t--){const i=j.Yn[t];if(!(i<=0)&&j.Hn){const e=j.Hn[t];for(let t=0;t=0;t--){const i=j.Yn[t];if(i>0&&j.Hn){const e=j.Hn[t];for(let s=0;s0||j.Vn[2]>0)&&(n=(j.zn[1]+j.zn[2])/(j.Vn[1]+j.Vn[2])|0);let r=0;j.Vn&&j.zn&&(j.Vn[3]>0||j.Vn[4]>0)&&(r=(j.zn[3]+j.zn[4])/(j.Vn[3]+j.Vn[4])|0);let h=0;if(j.Vn&&j.zn&&(j.Vn[6]>0||j.Vn[8]>0)&&(h=(j.zn[6]+j.zn[8])/(j.Vn[6]+j.Vn[8])|0),j.Vn&&j.Kn){let t,i=0,e=j.Vn[10],o=j.Kn[10],l=j.Xn;i===e&&(i=0,e=j.Vn[11],o=j.Kn[11],l=j.jn),t=in;)this.wh(o[i++],s),i===e&&o!==j.Kn[11]&&(i=0,e=j.Vn[11],o=j.Kn[11],l=j.jn),t=ir;)this.wh(o[i++],s),i===e&&o!==j.Kn[11]&&(i=0,e=j.Vn[11],o=j.Kn[11],l=j.jn),t=ih;)this.wh(o[i++],s),i===e&&o!==j.Kn[11]&&(i=0,e=j.Vn[11],o=j.Kn[11],l=j.jn),t=i>2,r=this.br[i],h=this.Rr[i],o=this.Or[i];N.le(j.Fn[e],j.Fn[s],j.Fn[n],j.Bn[e],j.Bn[s],j.Bn[n],this.cr[t],this.ur[t],this.dr[t],j.Pn[r],j.Gn[r],j.Wn[r],j.Pn[h],j.Pn[o],j.Gn[h],j.Gn[o],j.Wn[h],j.Wn[o],this.Tr[t])}else if(3===r&&this.wr&&this.Tr&&this.cr&&j.Fn&&j.Bn&&j.Pn&&j.Gn&&j.Wn){const i=this.wr[t]>>2,r=this.br[i],h=this.Rr[i],o=this.Or[i];N.le(j.Fn[e],j.Fn[s],j.Fn[n],j.Bn[e],j.Bn[s],j.Bn[n],this.cr[t],this.cr[t],this.cr[t],j.Pn[r],j.Gn[r],j.Wn[r],j.Pn[h],j.Pn[o],j.Gn[h],j.Gn[o],j.Wn[h],j.Wn[o],this.Tr[t])}}yh(t,i=!1){let e=0;if(j.Wn){const i=N.Ni,s=N.Fi,n=this._r[t],r=this.Ir[t],h=this.gr[t],o=j.Wn[n],l=j.Wn[r],a=j.Wn[h];if(o>=50&&j.Fn&&j.Bn&&this.cr)j.Zn[e]=j.Fn[n],j.qn[e]=j.Bn[n],j.Jn[e++]=this.cr[t];else if(j.Pn&&j.Gn&&this.cr){const c=j.Pn[n],f=j.Gn[n],u=this.cr[t];if(a>=50&&this.dr){const n=(50-o)*N.xi[a-o];j.Zn[e]=i+((c+((j.Pn[h]-c)*n>>16)<<9)/50|0),j.qn[e]=s+((f+((j.Gn[h]-f)*n>>16)<<9)/50|0),j.Jn[e++]=u+((this.dr[t]-u)*n>>16)}if(l>=50&&this.ur){const n=(50-o)*N.xi[l-o];j.Zn[e]=i+((c+((j.Pn[r]-c)*n>>16)<<9)/50|0),j.qn[e]=s+((f+((j.Gn[r]-f)*n>>16)<<9)/50|0),j.Jn[e++]=u+((this.ur[t]-u)*n>>16)}}if(l>=50&&j.Fn&&j.Bn&&this.ur)j.Zn[e]=j.Fn[r],j.qn[e]=j.Bn[r],j.Jn[e++]=this.ur[t];else if(j.Pn&&j.Gn&&this.ur){const c=j.Pn[r],f=j.Gn[r],u=this.ur[t];if(o>=50&&this.cr){const r=(50-l)*N.xi[o-l];j.Zn[e]=i+((c+((j.Pn[n]-c)*r>>16)<<9)/50|0),j.qn[e]=s+((f+((j.Gn[n]-f)*r>>16)<<9)/50|0),j.Jn[e++]=u+((this.cr[t]-u)*r>>16)}if(a>=50&&this.dr){const n=(50-l)*N.xi[a-l];j.Zn[e]=i+((c+((j.Pn[h]-c)*n>>16)<<9)/50|0),j.qn[e]=s+((f+((j.Gn[h]-f)*n>>16)<<9)/50|0),j.Jn[e++]=u+((this.dr[t]-u)*n>>16)}}if(a>=50&&j.Fn&&j.Bn&&this.dr)j.Zn[e]=j.Fn[h],j.qn[e]=j.Bn[h],j.Jn[e++]=this.dr[t];else if(j.Pn&&j.Gn&&this.dr){const c=j.Pn[h],f=j.Gn[h],u=this.dr[t];if(l>=50&&this.ur){const n=(50-a)*N.xi[l-a];j.Zn[e]=i+((c+((j.Pn[r]-c)*n>>16)<<9)/50|0),j.qn[e]=s+((f+((j.Gn[r]-f)*n>>16)<<9)/50|0),j.Jn[e++]=u+((this.ur[t]-u)*n>>16)}if(o>=50&&this.cr){const r=(50-a)*N.xi[o-a];j.Zn[e]=i+((c+((j.Pn[n]-c)*r>>16)<<9)/50|0),j.qn[e]=s+((f+((j.Gn[n]-f)*r>>16)<<9)/50|0),j.Jn[e++]=u+((this.cr[t]-u)*r>>16)}}}const s=j.Zn[0],n=j.Zn[1],r=j.Zn[2],h=j.qn[0],o=j.qn[1],l=j.qn[2];if(!((s-n)*(l-o)-(h-o)*(r-n)<=0))if(N.Ui=!1,3===e){let e;if((s<0||n<0||r<0||s>m.wt||n>m.wt||r>m.wt)&&(N.Ui=!0),e=this.wr?3&this.wr[t]:0,i)N.Tt(s,n,h,o,j.Jn[0]),N.Tt(n,r,o,l,j.Jn[1]),N.Tt(r,s,l,h,j.Jn[2]);else if(0===e)N.ne(s,n,r,h,o,l,j.Jn[0],j.Jn[1],j.Jn[2]);else if(1===e&&this.cr)N.he(s,n,r,h,o,l,N.palette[this.cr[t]]);else if(2===e&&this.wr&&this.Tr&&j.Pn&&j.Gn&&j.Wn){const i=this.wr[t]>>2,e=this.br[i],a=this.Rr[i],c=this.Or[i];N.le(s,n,r,h,o,l,j.Jn[0],j.Jn[1],j.Jn[2],j.Pn[e],j.Gn[e],j.Wn[e],j.Pn[a],j.Pn[c],j.Gn[a],j.Gn[c],j.Wn[a],j.Wn[c],this.Tr[t])}else if(3===e&&this.wr&&this.Tr&&this.cr&&j.Pn&&j.Gn&&j.Wn){const i=this.wr[t]>>2,e=this.br[i],a=this.Rr[i],c=this.Or[i];N.le(s,n,r,h,o,l,this.cr[t],this.cr[t],this.cr[t],j.Pn[e],j.Gn[e],j.Wn[e],j.Pn[a],j.Pn[c],j.Gn[a],j.Gn[c],j.Wn[a],j.Wn[c],this.Tr[t])}}else if(4===e){let e;if((s<0||n<0||r<0||s>m.wt||n>m.wt||r>m.wt||j.Zn[3]<0||j.Zn[3]>m.wt)&&(N.Ui=!0),e=this.wr?3&this.wr[t]:0,i)N.Tt(s,n,h,o,j.Jn[0]),N.Tt(n,r,o,l,j.Jn[1]),N.Tt(r,j.Zn[3],l,j.qn[3],j.Jn[2]),N.Tt(j.Zn[3],s,j.qn[3],h,j.Jn[3]);else if(0===e)N.ne(s,n,r,h,o,l,j.Jn[0],j.Jn[1],j.Jn[2]),N.ne(s,r,j.Zn[3],h,l,j.qn[3],j.Jn[0],j.Jn[2],j.Jn[3]);else if(1===e){if(this.cr){const i=N.palette[this.cr[t]];N.he(s,n,r,h,o,l,i),N.he(s,r,j.Zn[3],h,l,j.qn[3],i)}}else if(2===e&&this.wr&&this.Tr&&j.Pn&&j.Gn&&j.Wn){const i=this.wr[t]>>2,e=this.br[i],a=this.Rr[i],c=this.Or[i];N.le(s,n,r,h,o,l,j.Jn[0],j.Jn[1],j.Jn[2],j.Pn[e],j.Gn[e],j.Wn[e],j.Pn[a],j.Pn[c],j.Gn[a],j.Gn[c],j.Wn[a],j.Wn[c],this.Tr[t]),N.le(s,r,j.Zn[3],h,l,j.qn[3],j.Jn[0],j.Jn[2],j.Jn[3],j.Pn[e],j.Gn[e],j.Wn[e],j.Pn[a],j.Pn[c],j.Gn[a],j.Gn[c],j.Wn[a],j.Wn[c],this.Tr[t])}else if(3===e&&this.wr&&this.Tr&&this.cr&&j.Pn&&j.Gn&&j.Wn){const i=this.wr[t]>>2,e=this.br[i],a=this.Rr[i],c=this.Or[i];N.le(s,n,r,h,o,l,this.cr[t],this.cr[t],this.cr[t],j.Pn[e],j.Gn[e],j.Wn[e],j.Pn[a],j.Pn[c],j.Gn[a],j.Gn[c],j.Wn[a],j.Wn[c],this.Tr[t]),N.le(s,r,j.Zn[3],h,l,j.qn[3],this.cr[t],this.cr[t],this.cr[t],j.Pn[e],j.Gn[e],j.Wn[e],j.Pn[a],j.Pn[c],j.Gn[a],j.Gn[c],j.Wn[a],j.Wn[c],this.Tr[t])}}}ih(t,i,e,s,n){if(!s)return;const r=s.length;if(0===n){let n=0;j.$n=0,j.Qn=0,j.tr=0;for(let t=0;t0?(j.$n=(j.$n/n|0)+t,j.Qn=(j.Qn/n|0)+i,j.tr=(j.tr/n|0)+e):(j.$n=t,j.Qn=i,j.tr=e)}else if(1===n)for(let n=0;n=this.Yr.length)continue;const h=this.Yr[r];if(h)for(let s=0;s=this.Yr.length)continue;const h=this.Yr[r];if(h)for(let s=0;s>16;this.ar[n]=this.ar[n]*c-this.Ar[n]*a>>16,this.Ar[n]=t}if(0!==r){a=N.sin[r],c=N.cos[r];const t=this.ar[n]*c-this.pr[n]*a>>16;this.pr[n]=this.ar[n]*a+this.pr[n]*c>>16,this.ar[n]=t}if(0!==o){a=N.sin[o],c=N.cos[o];const t=this.pr[n]*a+this.Ar[n]*c>>16;this.pr[n]=this.pr[n]*c-this.Ar[n]*a>>16,this.Ar[n]=t}this.Ar[n]+=j.$n,this.ar[n]+=j.Qn,this.pr[n]+=j.tr}}else if(3===n)for(let n=0;n=this.Yr.length)continue;const h=this.Yr[r];if(h)for(let s=0;s=this.Hr.length)continue;const n=this.Hr[e];if(n)for(let i=0;i255&&(this.Er[e]=255)}}}ah(){this.Nr=0,this.kr=0,this.Dr=0,this.vr=999999,this.Lr=-999999,this.Mr=-99999,this.Sr=99999;for(let t=0;tthis.Lr&&(this.Lr=i),sthis.Mr&&(this.Mr=s),-e>this.Nr&&(this.Nr=-e),e>this.Dr&&(this.Dr=e);const n=i*i+s*s;n>this.kr&&(this.kr=n)}this.kr=0|Math.sqrt(this.kr),this.Br=0|Math.sqrt(this.kr*this.kr+this.Nr*this.Nr),this.Fr=this.Br+(0|Math.sqrt(this.kr*this.kr+this.Dr*this.Dr))}dh(t,i,e,s,n,r,h,o){return!(ie&&i>s&&i>n)&&(!(t{const e=t.read(i+'.dat');if(!e)throw new Error(`${i} jpeg not found!`);const s=await(async t=>{255!==t[0]&&(t[0]=255),URL.revokeObjectURL(I.src),I.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>I.onload=()=>t())),g.clearRect(0,0,_.width,_.height);const i=I.naturalWidth,e=I.naturalHeight;return _.width=i,_.height=e,g.drawImage(I,0,0),g.getImageData(0,0,i,e)})(e),n=new J(s.width,s.height),r=new Uint32Array(s.data.buffer),h=n.ft;for(let t=0;t>24&255)<<24|(255&i)<<16|(i>>8&255)<<8|i>>16&255}return n};static Ci=(t,i,e=0)=>{const s=new R(t.read(i+'.dat')),n=new R(t.read('index.dat'));n.Xt=s.Jt;const r=n.Jt,h=n.Jt,o=[],l=n.Zt-1;for(let t=0;ts.length||n.Xt>n.length)throw new Error;const a=n.Zt,c=n.Zt,f=n.Jt,u=n.Jt,d=new J(f,u);d.pi=a,d._i=c,d.Ii=r,d.gi=h;const w=n.Zt;if(0===w){const t=d.width*d.height;for(let i=0;im.bottom&&(n-=i+n-m.bottom),tm.right){const i=t+r-m.right;r-=i,o+=i,h+=i}r>0&&n>0&&this.Ch(r,n,this.ft,s,o,m.ft,e,h)}Eh(t,i,e){i|=0,e|=0;let s=(i+=this.pi)+(e+=this._i)*m.ut,n=0,r=this.height,h=this.width,o=m.ut-h,l=0;if(em.bottom&&(r-=e+r-m.bottom),im.right){const t=i+h-m.right;h-=t,l+=t,o+=t}h>0&&r>0&&this.Th(h,r,this.ft,n,l,m.ft,s,o,t)}bh(t,i){t|=0,i|=0;let e=(t+=this.pi)+(i+=this._i)*m.ut,s=0,n=this.height,r=this.width,h=m.ut-r,o=0;if(im.bottom&&(n-=i+n-m.bottom),tm.right){const i=t+r-m.right;r-=i,o+=i,h+=i}r>0&&n>0&&this.Rh(r,n,this.ft,s,o,m.ft,e,h)}Ti(){const t=this.ft,i=this.width,e=this.height;for(let s=0;s>16&255;r+=t,r<1?r=1:r>255&&(r=255);let h=n>>8&255;h+=i,h<1?h=1:h>255&&(h=255);let o=255&n;o+=e,o<1?o=1:o>255&&(o=255),this.ft[s]=(r<<16)+(h<<8)+o}}}Oi(t,i,e,s){t|=0,i|=0,e|=0,s|=0;try{const n=this.width;let r=0,h=0;const o=this.Ii,l=this.gi,a=(o<<16)/e|0,c=(l<<16)/s|0;t+=(this.pi*e+o-1)/o|0,i+=(this._i*s+l-1)/l|0,this.pi*e%o!=0&&(r=(o-this.pi*e%o<<16)/e|0),this._i*s%l!=0&&(h=(l-this._i*s%l<<16)/s|0),e=e*(this.width-(r>>16))/o|0,s=s*(this.height-(h>>16))/l|0;let f=t+i*m.ut,u=m.ut-e;if(im.bottom&&(s-=i+s-m.bottom),tm.right){const i=t+e-m.right;e-=i,u+=i}this.scale(e,s,this.ft,r,h,m.ft,u,f,n,a,c)}catch(t){console.error('error in sprite clipping routine')}}Oh(t,i,e,s,n,r,h,o,l,a){t|=0,i|=0,e|=0,s|=0;try{const c=-e/2|0,f=-s/2|0,u=65536*Math.sin(l/326.11)|0,d=65536*Math.cos(l/326.11)|0,w=u*a>>8,y=d*a>>8;let A=(h<<16)+f*w+c*y,p=f*y-c*w+(o<<16),_=t+i*m.ut;for(let t=0;t>16)+(h>>16)*this.width],s+=y,h-=w;A+=w,p+=y,_+=m.ut}}catch(t){}}Lh(t,i,e){t|=0,i|=0;let s=(t+=this.pi)+(i+=this._i)*m.ut,n=0,r=this.height,h=this.width,o=m.ut-h,l=0;if(im.bottom&&(r-=i+r-m.bottom),tm.right){const i=t+h-m.right;h-=i,l+=i,o+=i}h>0&&r>0&&this.Sh(h,r,this.ft,l,n,m.ft,s,o,e.ft)}scale(t,i,e,s,n,r,h,o,l,a,c){try{const f=s;for(let u=-i;u<0;u++){const i=(n>>16)*l;for(let n=-t;n<0;n++){const t=e[(s>>16)+i];0===t?o++:r[o++]=t,s+=a}n+=c,s=f,o+=h}}catch(t){console.error('error in plot_scale')}}Rh(t,i,e,s,n,r,h,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++)r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++];for(let i=t;i<0;i++)r[h++]=e[s++];h+=o,s+=n}}Th(t,i,e,s,n,r,h,o,l){const a=256-l;for(let c=-i;c<0;c++){for(let i=-t;i<0;i++){const t=e[s++];if(0===t)h++;else{const i=r[h];r[h++]=((16711935&t)*l+(16711935&i)*a&4278255360)+((65280&t)*l+(65280&i)*a&16711680)>>8}}h+=o,s+=n}}Ch(t,i,e,s,n,r,h,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=e[s++];0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=t}h+=o,s+=n}}Sh(t,i,e,s,n,r,h,o,l){const a=-(t>>2);t=-(3&t);for(let c=-i;c<0;c++){for(let t=a;t<0;t++){let t=e[n++];0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++}for(let i=t;i<0;i++){const t=e[n++];0!==t&&0===l[h]?r[h++]=t:h++}h+=o,n+=s}}}class ${static xh=['_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9'];static Mh=t=>{t=t.trim();let i=0n;for(let e=0;e=65&&s<=90?i+=BigInt(s+1-65):s>=97&&s<=122?i+=BigInt(s+1-97):s>=48&&s<=57&&(i+=BigInt(s+27-48))}return i};static kh=t=>{if(t<0n||t>=6582952005840035281n)return'invalid_name';if(t%37n===0n)return'invalid_name';let i=0;const e=Array(12);for(;0n!==t;){const s=t;t/=37n,e[11-i++]=this.xh[Number(s-37n*t)]}return e.slice(12-i).join('')};static Dh=t=>{const i=[...t.toLowerCase()];let e=!0;for(let t=0;t='a'&&s<='z'&&(i[t]=s.toUpperCase(),e=!1),'.'!==s&&'!'!==s||(e=!0)}return i.join('')};static Nh=t=>{let i='';for(let e=0;e(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static Bh=t=>{if(0===t.length)return t;const i=[...t];for(let t=0;t='a'&&i[t+1]<='z'&&(i[t+1]=String.fromCharCode(i[t+1].charCodeAt(0)+'A'.charCodeAt(0)-97)));return i[0]>='a'&&i[0]<='z'&&(i[0]=String.fromCharCode(i[0].charCodeAt(0)+'A'.charCodeAt(0)-97)),i.join('')};static Uh=t=>{const i=t.toUpperCase();let e=0n;for(let t=0;t>56n)&0xffffffffffffffn;return e}}class Q{static tn=[];static Ph=null;static Gh=null;static Wh=0;static Yh=1;static Hh=2;static Vh=3;static Kh=4;static Xh=5;static jh=6;static zh=7;static Zh=1;static qh=2;static Jh=3;static $h=4;static Qh=5;static io=6;static eo=1;static so=100;static no=101;static ro=200;static ho=201;static oo=202;static lo=203;static ao=205;static co=300;static fo=301;static uo=302;static do=303;static wo=304;static yo=305;static mo=306;static Ao=307;static po=308;static _o=309;static Io=310;static Co=311;static Eo=312;static To=313;static bo=314;static Ro=315;static Oo=316;static vo=317;static Lo=318;static So=319;static xo=320;static Mo=321;static ko=322;static Do=323;static No=324;static Fo=325;static Bo=326;static Uo=327;static Po=401;static Go=500;static Wo=501;static Yo=502;static Ho=503;static Vo=600;static Ko=601;static Xo=602;static jo=603;static zo=604;static Zo=605;static qo=606;static Jo=607;static $o=608;static Qo=609;static tl=610;static il=611;static el=612;static sl=613;static nl=650;static rl=651;static hl=652;static ol=653;static ll=654;static al=655;static en=(t,i,e)=>{this.Ph=new q(5e4),this.Gh=new q(5e4);const s=new R(t.read('data'));let n=-1;for(s.Xt+=2;s.Xt0){r.wl=new Uint8Array(h),r.yl=new Uint16Array(h);for(let t=0;t0){r.scripts=new v(o,null);for(let t=0;t0){const s=e.lastIndexOf(',');r.Ol[t]=this.vl(i,e.substring(0,s),parseInt(e.substring(s+1),10))}}r.Ll=new v(5,null);for(let t=0;t<5;t++){const i=s.ni;r.Ll[t]=i,0===i.length&&(r.Ll[t]=null)}}if(r.type===Q.Vh&&(r.fill=1===s.Zt),r.type===Q.Kh||r.type===Q.Yh){r.Sl=1===s.Zt;const t=s.Zt;e&&(r.font=e[t]),r.xl=1===s.Zt}if(r.type===Q.Kh&&(r.text=s.ni,r.Ml=s.ni),r.type!==Q.Yh&&r.type!==Q.Vh&&r.type!==Q.Kh||(r.kl=s.ti),r.type!==Q.Vh&&r.type!==Q.Kh||(r.Dl=s.ti,r.Nl=s.ti),r.type===Q.Xh){const t=s.ni;if(t.length>0){const e=t.lastIndexOf(',');r.Fl=this.vl(i,t.substring(0,e),parseInt(t.substring(e+1),10))}const e=s.ni;if(e.length>0){const t=e.lastIndexOf(',');r.Bl=this.vl(i,e.substring(0,t),parseInt(e.substring(t+1),10))}}if(r.type===Q.jh){const t=s.Zt;0!==t&&(r.model=this.Ul((t-1<<8)+s.Zt));const i=s.Zt;0!==i&&(r.Pl=this.Ul((i-1<<8)+s.Zt)),r.Gl=s.Zt,0===r.Gl?r.Gl=-1:r.Gl=(r.Gl-1<<8)+s.Zt,r.Wl=s.Zt,0===r.Wl?r.Wl=-1:r.Wl=(r.Wl-1<<8)+s.Zt,r.zoom=s.Jt,r.Yl=s.Jt,r.Hl=s.Jt}if(r.type===Q.zh){r._l=new Int32Array(r.width*r.height),r.Il=new Int32Array(r.width*r.height),r.Sl=1===s.Zt;const t=s.Zt;e&&(r.font=e[t]),r.xl=1===s.Zt,r.kl=s.ti,r.El=s.$t,r.Tl=s.$t,r.gl=1===s.Zt,r.Ll=new v(5,null);for(let t=0;t<5;t++){const i=s.ni;r.Ll[t]=i,0===i.length&&(r.Ll[t]=null)}}r.fl!==Q.qh&&r.type!==Q.Hh||(r.Vl=s.ni,r.action=s.ni,r.Kl=s.Jt),r.fl!==Q.Zh&&r.fl!==Q.$h&&r.fl!==Q.Qh&&r.fl!==Q.io||(r.Xl=s.ni,0===r.Xl.length&&(r.fl===Q.Zh?r.Xl='Ok':r.fl===Q.$h||r.fl===Q.Qh?r.Xl='Select':r.fl===Q.io&&(r.Xl='Continue')))}this.Ph=null,this.Gh=null};static vl=(t,i,e)=>{const s=$.Uh(i)<<8n|BigInt(e);if(this.Ph){const t=this.Ph.get(s);if(t)return t}let n;try{n=J.Ci(t,i,e),this.Ph?.put(s,n)}catch(t){return null}return n};static Ul=t=>{if(this.Gh){const i=this.Gh.get(BigInt(t));if(i)return i}const i=j.model(t);return this.Gh?.put(BigInt(t),i),i};id=-1;cl=-1;type=-1;fl=-1;ul=0;width=0;height=0;dl=-1;wl=null;yl=null;scripts=null;scroll=0;hide=!1;draggable=!1;gl=!1;Cl=!1;El=0;Tl=0;bl=null;Rl=null;Ol=null;Ll=null;fill=!1;Sl=!1;font=null;xl=!1;text=null;Ml=null;kl=0;Dl=0;Nl=0;Fl=null;Bl=null;model=null;Pl=null;Gl=-1;Wl=-1;zoom=0;Yl=0;Hl=0;Vl=null;action=null;Kl=-1;Xl=null;ml=null;Al=null;pl=null;x=0;y=0;jl=0;_l=null;Il=null;zl=0;Zl=0;Ul(t,i,e){let s=this.model;if(e&&(s=this.Pl),!s)return null;if(-1===t&&-1===i&&!s.Tr)return s;const n=j.Ur(s,!0,!0,!1);return-1===t&&-1===i||n.Qr(),-1!==t&&n.eh(t),-1!==i&&n.eh(i),n.oh(64,768,-50,-10,-50,!0),n}ql(){if(this.cl===this.id)return this.x;let t=Q.tn[this.cl];if(!t.ml||!t.Al||!t.pl)return this.x;let i=t.ml.indexOf(this.id);if(-1===i)return this.x;let e=t.Al[i];for(;t.cl!==t.id;){const s=Q.tn[t.cl];s.ml&&s.Al&&s.pl&&(i=s.ml.indexOf(t.id),-1!==i&&(e+=s.Al[i])),t=s}return e}Jl(){if(this.cl===this.id)return this.y;let t=Q.tn[this.cl];if(!t.ml||!t.Al||!t.pl)return this.y;let i=t.ml.indexOf(this.id);if(-1===i)return this.y;let e=t.pl[i];for(;t.cl!==t.id;){const s=Q.tn[t.cl];s.ml&&s.Al&&s.pl&&(i=s.ml.indexOf(t.id),-1!==i&&(e+=s.pl[i])),t=s}return e}outline(t){const i=this.ql(),e=this.Jl();m.gt(i,e,this.width,this.height,t)}move(t,i){if(this.cl===this.id)return;this.x=0,this.y=0;const e=Q.tn[this.cl];if(e.ml&&e.Al&&e.pl){const s=e.ml.indexOf(this.id);-1!==s&&(e.Al[s]=t,e.pl[s]=i)}}delete(){if(this.cl===this.id)return;const t=Q.tn[this.cl];if(t.ml&&t.Al&&t.pl){const i=t.ml.indexOf(this.id);-1!==i&&(t.ml.splice(i,1),t.Al.splice(i,1),t.pl.splice(i,1))}}}var tt,it=(tt="file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/tinymidipcm.mjs",function(t){var i,s,n=void 0!==(t=t||{})?t:{};n.ready=new Promise((function(t,e){i=t,s=e})),["_tsf_load_memory","_tsf_set_output","_tsf_channel_set_bank_preset","_tsf_set_max_voices","_tsf_channel_set_presetnumber","_tsf_reset","_tsf_close","_tml_load_memory","_midi_render","_malloc","_realloc","_free","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(n.ready,t)||Object.defineProperty(n.ready,t,{get:()=>X('You are getting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),set:()=>X('You are setting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js')})}));var r=Object.assign({},n),h=[],o='object'==typeof window,l='function'==typeof importScripts,a='object'==typeof process&&'object'==typeof process.versions&&'string'==typeof process.versions.node,c=!o&&!a&&!l;if(n.ENVIRONMENT)throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');var f,u,d,w='';if(a){if('undefined'==typeof process||!process.release||'node'!==process.release.name)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');var y,m;w=l?require('path').$l(w)+'/':__dirname+'/';var A=()=>{m||(y=require('fs'),m=require('path'))};f=(t,i)=>(A(),t=m.normalize(t),y.Ql(t,i?void 0:'utf8')),d=t=>{var i=f(t,!0);return i.buffer||(i=new Uint8Array(i)),k(i.buffer),i},u=(t,i,e)=>{A(),t=m.normalize(t),y.ta(t,(function(t,s){t?e(t):i(s.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,'/'),h=process.argv.slice(2),process.on('uncaughtException',(function(t){if(!(t instanceof nt))throw t})),process.on('unhandledRejection',(function(t){throw t})),n.inspect=function(){return'[Emscripten Module object]'}}else if(c){if('object'==typeof process&&'function'==typeof require||'object'==typeof window||'function'==typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');'undefined'!=typeof read&&(f=function(t){return read(t)}),d=function(t){let i;return'function'==typeof readbuffer?new Uint8Array(readbuffer(t)):(i=read(t,'binary'),k('object'==typeof i),i)},u=function(t,i,e){setTimeout((()=>i(d(t))),0)},'undefined'!=typeof scriptArgs?h=scriptArgs:void 0!==arguments&&(h=arguments),'undefined'!=typeof print&&('undefined'==typeof console&&(console={}),console.log=print,console.warn=console.error='undefined'!=typeof printErr?printErr:print)}else{if(!o&&!l)throw new Error('environment detection error');if(l?w=self.location.href:'undefined'!=typeof document&&document.currentScript&&(w=document.currentScript.src),tt&&(w=tt),w=0!==w.indexOf('blob:')?w.substr(0,w.replace(/[?#].*/,"").lastIndexOf('/')+1):'','object'!=typeof window&&'function'!=typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');f=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.send(null),i.responseText},l&&(d=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.responseType='arraybuffer',i.send(null),new Uint8Array(i.response)}),u=(t,i,e)=>{var s=new XMLHttpRequest;s.open('GET',t,!0),s.responseType='arraybuffer',s.onload=()=>{200==s.status||0==s.status&&s.response?i(s.response):e()},s.onerror=e,s.send(null)}}n.print||console.log.bind(console);var p,_,I=n.printErr||console.warn.bind(console);function g(t,i){Object.getOwnPropertyDescriptor(n,t)||Object.defineProperty(n,t,{configurable:!0,get:function(){X('Module.'+t+' has been replaced with plain '+i+' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')}})}function C(t){return'FS_createPath'===t||'FS_createDataFile'===t||'FS_createPreloadedFile'===t||'FS_unlink'===t||'addRunDependency'===t||'FS_createLazyFile'===t||'FS_createDevice'===t||'removeRunDependency'===t}Object.assign(n,r),r=null,p='fetchSettings',Object.getOwnPropertyDescriptor(n,p)&&X('`Module.'+p+'` was supplied but `'+p+'` not included in INCOMING_MODULE_JS_API'),n.arguments&&(h=n.arguments),g('arguments','arguments_'),n.thisProgram&&n.thisProgram,g('thisProgram','thisProgram'),n.quit&&n.quit,g('quit','quit_'),k(void 0===n.memoryInitializerPrefixURL,'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'),k(void 0===n.pthreadMainPrefixURL,'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'),k(void 0===n.cdInitializerPrefixURL,'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'),k(void 0===n.filePackagePrefixURL,'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'),k(void 0===n.read,'Module.read option was removed (modify read_ in JS)'),k(void 0===n.readAsync,'Module.readAsync option was removed (modify readAsync in JS)'),k(void 0===n.readBinary,'Module.readBinary option was removed (modify readBinary in JS)'),k(void 0===n.setWindowTitle,'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'),k(void 0===n.TOTAL_MEMORY,'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'),g('read','read_'),g('readAsync','readAsync'),g('readBinary','readBinary'),g('setWindowTitle','setWindowTitle'),k(!c,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),n.wasmBinary&&(_=n.wasmBinary),g('wasmBinary','wasmBinary');var E;n.noExitRuntime;g('noExitRuntime','noExitRuntime'),'object'!=typeof WebAssembly&&X('no native wasm support detected');var T,b,R,O,v,L,S,x,M=!1;function k(t,i){t||X('Assertion failed'+(i?': '+i:''))}function D(t){T=t,n.HEAP8=b=new Int8Array(t),n.HEAP16=O=new Int16Array(t),n.HEAP32=v=new Int32Array(t),n.HEAPU8=R=new Uint8Array(t),n.HEAPU16=new Uint16Array(t),n.HEAPU32=L=new Uint32Array(t),n.HEAPF32=S=new Float32Array(t),n.HEAPF64=x=new Float64Array(t)}'undefined'!=typeof TextDecoder&&new TextDecoder('utf8');var N=5242880;n.TOTAL_STACK&&k(N===n.TOTAL_STACK,'the stack size can no longer be determined at runtime');var F=n.INITIAL_MEMORY||16777216;function B(){if(!M){var t=ft(),i=L[t>>2],e=L[t+4>>2];34821223==i&&2310721022==e||X('Stack overflow! Stack cookie has been overwritten at 0x'+t.toString(16)+', expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+e.toString(16)+' 0x'+i.toString(16)),1668509029!==L[0]&&X('Runtime error: The application has corrupted its heap memory area (address zero)!')}}g('INITIAL_MEMORY','INITIAL_MEMORY'),k(F>=N,'INITIAL_MEMORY should be larger than TOTAL_STACK, was '+F+'! (TOTAL_STACK='+N+')'),k('undefined'!=typeof Int32Array&&'undefined'!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,'JS engine does not provide full typed array support'),k(!n.wasmMemory,'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'),k(16777216==F,'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'),function(){var t=new Int16Array(1),i=new Int8Array(t.buffer);if(t[0]=25459,115!==i[0]||99!==i[1])throw'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'}();var U=[],P=[],G=[],W=!1;k(Math.imul,'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),k(Math.fround,'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),k(Math.clz32,'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),k(Math.trunc,'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');var Y=0,H=null,V=null,K={};function X(t){n.onAbort&&n.onAbort(t),I(t='Aborted('+t+')'),M=!0;var i=new WebAssembly.RuntimeError(t);throw s(i),i}var j={error:function(){X('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM')},init:function(){j.error()},ia:function(){j.error()},ea:function(){j.error()},sa:function(){j.error()},open:function(){j.error()},na:function(){j.error()},ra:function(){j.error()},ha:function(){j.error()},oa:function(){j.error()},la:function(){j.error()}};n.FS_createDataFile=j.ia,n.FS_createPreloadedFile=j.ea;var z,Z,q,J,$='data:application/octet-stream;base64,';function Q(t){return t.startsWith($)}function it(t){return t.startsWith('file://')}function et(t,i){return function(){var e=t,s=i;return i||(s=n.asm),k(W,'native function `'+e+'` called before runtime initialization'),s[t]||k(s[t],'exported native function `'+e+'` not found'),s[t].apply(null,arguments)}}function st(t){try{if(t==z&&_)return new Uint8Array(_);if(d)return d(t);throw"both async and sync fetching of the wasm failed"}catch(t){X(t)}}function nt(t){this.name='ExitStatus',this.message='Program terminated with exit('+t+')',this.status=t}function rt(t){for(;t.length>0;)t.shift()(n)}function ht(t){ht.aa||(ht.aa={}),ht.aa[t]||(ht.aa[t]=1,a&&(t='warning: '+t),I(t))}function ot(t){try{return E.ca(t-T.byteLength+65535>>>16),D(E.buffer),1}catch(i){I('emscripten_realloc_buffer: Attempted to grow heap from '+T.byteLength+' bytes to '+t+' bytes, but got error: '+i)}}n.locateFile?Q(z='tinymidipcm.wasm')||(Z=z,z=n.locateFile?n.locateFile(Z,w):w+Z):z=new URL(e(8227),e.b).toString();var lt,at={"emscripten_memcpy_big":function(t,i,e){R.copyWithin(t,i,i+e)},"emscripten_resize_heap":function(t){var i=R.length;k((t>>>=0)>i);var e,s,n=2147483648;if(t>n)return I('Cannot enlarge memory, asked to go up to '+t+' bytes, but the limit is '+n+' bytes!'),!1;for(var r=1;r<=4;r*=2){var h=i*(1+.2/r);h=Math.min(h,t+100663296);var o=Math.min(n,(e=Math.max(t,h))+((s=65536)-e%s)%s);if(ot(o))return!0}return I('Failed to grow the heap from '+i+' bytes to '+o+' bytes, not enough memory!'),!1}},ct=(function(){var t,i={'env':at,'wasi_snapshot_preview1':at};function e(t,i){var e,s=t.exports;n.asm=s,k(E=n.asm.memory,"memory not found in wasm exports"),D(E.buffer),k(n.asm.__indirect_function_table,"table not found in wasm exports"),e=n.asm.__wasm_call_ctors,P.unshift(e),function(t){if(Y--,n.monitorRunDependencies&&n.monitorRunDependencies(Y),t?(k(K[t]),delete K[t]):I('warning: run dependency removed without ID'),0==Y&&(null!==H&&(clearInterval(H),H=null),V)){var i=V;V=null,i()}}('wasm-instantiate')}t='wasm-instantiate',Y++,n.monitorRunDependencies&&n.monitorRunDependencies(Y),t?(k(!K[t]),K[t]=1,null===H&&'undefined'!=typeof setInterval&&(H=setInterval((function(){if(M)return clearInterval(H),void(H=null);var t=!1;for(var i in K)t||(t=!0,I('still waiting on run dependencies:')),I('dependency: '+i);t&&I('(end of list)')}),1e4))):I('warning: run dependency added without ID');var r=n;function h(t){k(n===r,'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'),r=null,e(t.instance)}function c(t){return function(){if(!_&&(o||l)){if('function'==typeof fetch&&!it(z))return fetch(z,{credentials:'same-origin'}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+z+"'";return t.arrayBuffer()})).catch((function(){return st(z)}));if(u)return new Promise((function(t,i){u(z,(function(i){t(new Uint8Array(i))}),i)}))}return Promise.resolve().then((function(){return st(z)}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){I('failed to asynchronously prepare wasm: '+t),it(z)&&I('warning: Loading from a file URI ('+z+') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing'),X(t)}))}if(n.instantiateWasm)try{return n.instantiateWasm(i,e)}catch(t){I('Module.instantiateWasm callback failed with error: '+t),s(t)}(_||'function'!=typeof WebAssembly.instantiateStreaming||Q(z)||it(z)||a||'function'!=typeof fetch?c(h):fetch(z,{credentials:'same-origin'}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(h,(function(t){return I('wasm streaming compile failed: '+t),I('falling back to ArrayBuffer instantiation'),c(h)}))}))).catch(s)}(),n.___wasm_call_ctors=et("__wasm_call_ctors"),n._malloc=et("malloc"),n._free=et("free"),n._tsf_load_memory=et("tsf_load_memory"),n._tsf_close=et("tsf_close"),n._tsf_reset=et("tsf_reset"),n._tsf_set_output=et("tsf_set_output"),n._tsf_set_max_voices=et("tsf_set_max_voices"),n._realloc=et("realloc"),n._tsf_channel_set_presetnumber=et("tsf_channel_set_presetnumber"),n._tsf_channel_set_bank_preset=et("tsf_channel_set_bank_preset"),n._tml_load_memory=et("tml_load_memory"),n._midi_render=et("midi_render"),n.___errno_location=et("__errno_location"),n._fflush=et("fflush"),n._emscripten_stack_init=function(){return(ct=n._emscripten_stack_init=n.asm.emscripten_stack_init).apply(null,arguments)}),ft=(n._emscripten_stack_get_free=function(){return(n._emscripten_stack_get_free=n.asm.emscripten_stack_get_free).apply(null,arguments)},n._emscripten_stack_get_base=function(){return(n._emscripten_stack_get_base=n.asm.emscripten_stack_get_base).apply(null,arguments)},n._emscripten_stack_get_end=function(){return(ft=n._emscripten_stack_get_end=n.asm.emscripten_stack_get_end).apply(null,arguments)});function ut(){var t;ct(),k(!(3&(t=ft()))),L[t>>2]=34821223,L[t+4>>2]=2310721022,L[0]=1668509029}function dt(t){function e(){lt||(lt=!0,n.calledRun=!0,M||(k(!W),W=!0,B(),rt(P),i(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),k(!n._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(B(),n.postRun)for('function'==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)t=n.postRun.shift(),G.unshift(t);var t;rt(G)}()))}t=t||h,Y>0||(ut(),function(){if(n.preRun)for('function'==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)t=n.preRun.shift(),U.unshift(t);var t;rt(U)}(),Y>0||(n.setStatus?(n.setStatus('Running...'),setTimeout((function(){setTimeout((function(){n.setStatus('')}),1),e()}),1)):e(),B()))}if(n.stackSave=et("stackSave"),n.stackRestore=et("stackRestore"),n.stackAlloc=et("stackAlloc"),n.setValue=function(t,i,e="i8"){switch(e.endsWith('*')&&(e='*'),e){case'i1':case'i8':b[0|t]=i;break;case'i16':O[t>>1]=i;break;case'i32':v[t>>2]=i;break;case'i64':J=[i>>>0,(q=i,+Math.abs(q)>=1?q>0?(0|Math.min(+Math.floor(q/4294967296),4294967295))>>>0:~~+Math.ceil((q-+(~~q>>>0))/4294967296)>>>0:0)],v[t>>2]=J[0],v[t+4>>2]=J[1];break;case'float':S[t>>2]=i;break;case'double':x[t>>3]=i;break;case'*':L[t>>2]=i;break;default:X('invalid type for setValue: '+e)}},n.getValue=function(t,i="i8"){switch(i.endsWith('*')&&(i='*'),i){case'i1':case'i8':return b[0|t];case'i16':return O[t>>1];case'i32':case'i64':return v[t>>2];case'float':return S[t>>2];case'double':return x[t>>3];case'*':return L[t>>2];default:X('invalid type for getValue: '+i)}return null},['run','UTF8ArrayToString','UTF8ToString','stringToUTF8Array','stringToUTF8','lengthBytesUTF8','addOnPreRun','addOnInit','addOnPreMain','addOnExit','addOnPostRun','addRunDependency','removeRunDependency','FS_createFolder','FS_createPath','FS_createDataFile','FS_createPreloadedFile','FS_createLazyFile','FS_createLink','FS_createDevice','FS_unlink','getLEB','getFunctionTables','alignFunctionTables','registerFunctions','prettyPrint','getCompilerSetting','print','printErr','callMain','abort','keepRuntimeAlive','wasmMemory','stackAlloc','stackSave','stackRestore','getTempRet0','setTempRet0','writeStackCookie','checkStackCookie','ptrToString','zeroMemory','stringToNewUTF8','exitJS','getHeapMax','emscripten_realloc_buffer','ENV','ERRNO_CODES','ERRNO_MESSAGES','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','DNS','getHostByName','Protocols','Sockets','getRandomDevice','warnOnce','traverseStack','UNWIND_CACHE','convertPCtoSourceLocation','readAsmConstArgsArray','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','handleException','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','freeTableIndexes','functionsInTableMap','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','PATH','PATH_FS','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16Decoder','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeArrayToMemory','writeAsciiToMemory','SYSCALLS','getSocketFromFD','getSocketAddress','JSEvents','registerKeyEventCallback','specialHTMLTargets','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','currentFullscreenStrategy','restoreOldWindowedStyle','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','demangle','demangleAll','jsStackTrace','stackTrace','ExitStatus','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','dlopenMissingError','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','uncaughtExceptionCount','exceptionLast','exceptionCaught','ExceptionInfo','exception_addRef','exception_decRef','Browser','setMainLoop','wget','FS','MEMFS','TTY','PIPEFS','SOCKFS','_setNetworkCallback','tempFixedLengthArray','miniTempWebGLFloatBuffers','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','GL','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','AL','SDL_unicode','SDL_ttfContext','SDL_audio','SDL','SDL_gfx','GLUT','EGL','GLFW_Window','GLFW','GLEW','IDBStore','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){Object.getOwnPropertyDescriptor(n,t)||Object.defineProperty(n,t,{configurable:!0,get:function(){var i="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";C(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),X(i)}})})),['ptrToString','zeroMemory','stringToNewUTF8','exitJS','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','getHostByName','getRandomDevice','traverseStack','convertPCtoSourceLocation','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeAsciiToMemory','getSocketFromFD','getSocketAddress','registerKeyEventCallback','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','ExceptionInfo','exception_addRef','exception_decRef','setMainLoop','_setNetworkCallback','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','SDL_unicode','SDL_ttfContext','SDL_audio','GLFW_Window','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){'undefined'==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var i='`'+t+'` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line';C(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),ht(i)}})})),V=function t(){lt||dt(),lt||(V=t)},n.preInit)for('function'==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return dt(),t.ready});const et=it;const st=class{constructor(t={}){this.fa=void 0,this.ua=0,this.da=0,this.wa=0,this.ya=t.ya||100,this.sampleRate=t.sampleRate||44100,this.ma=t.ma||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.Aa(1),this.pa=t.pa||(()=>{}),this._a=t._a||(()=>{}),this.Ia=void 0,this.test=0}async init(){if(!this.fa){if('undefined'!=typeof process){const{$l:t}=await import('path'),{ga:i}=await import('module');globalThis.__dirname=t("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js"),globalThis.require=i("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js")}this.fa=await et(),this.Ca=this.fa._malloc(this.bufferSize),this.Ea=this.fa._malloc(8)}}Aa(t){this.bufferSize=4*this.sampleRate*this.ma*t}Ta(){if(!this.fa)throw new Error(`${this.constructor.name} not initalized. call .init()`)}ba(t){this.Ta();const{_malloc:i,_free:e,_tsf_load_memory:s,_tsf_set_output:n,_tsf_channel_set_bank_preset:r,_tsf_set_max_voices:h,_tsf_channel_set_presetnumber:o}=this.fa;e(this.ua),this.ua=i(t.length),this.fa.HEAPU8.set(t,this.ua),this.da=s(this.ua,t.length),n(this.da,2===this.ma?0:2,this.sampleRate,this.gain)}Ra(){this.Ta();const t=new Uint8Array(this.bufferSize);return t.set(this.fa.HEAPU8.subarray(this.Ca,this.Ca+this.bufferSize)),t}Oa(t){const{_malloc:i,_free:e,_tml_load_memory:s}=this.fa;return e(this.wa),this.wa=i(t.length),this.fa.HEAPU8.set(t,this.wa),s(this.wa,t.length)}va(t){const{_midi_render:i}=this.fa;return i(this.da,t,this.ma,this.sampleRate,this.Ca,this.bufferSize,this.Ea)}La(t){if(this.Ta(),!this.da)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.Ia);const{setValue:i,getValue:e}=this.fa;i(this.Ea,0,'double'),this.fa._tsf_reset(this.da),this.fa._tsf_channel_set_bank_preset(this.da,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let s=this.Oa(t);const n=()=>{s=this.va(s);const t=this.Ra();this.pa(t),s?this.Ia=setTimeout(n,this.ya):this._a(e(this.Ea,'double'))};this.Ia=setTimeout(n,16)}};!function(){window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioContext&&(window.audioContext=new window.AudioContext);var t=function(i){if(window.audioContext){var e=window.audioContext.createBuffer(1,1,22050),s=window.audioContext.createBufferSource();s.buffer=e,s.connect(window.audioContext.destination),s.start?s.start(0):s.play?s.play(0):s.noteOn&&s.noteOn(0)}document.removeEventListener('touchstart',t),document.removeEventListener('touchend',t),document.removeEventListener('click',t)};document.addEventListener('touchstart',t),document.addEventListener('touchend',t),document.addEventListener('click',t)}(),(async()=>{let t=new Float32Array,i=window.audioContext.createGain();i.gain.value=.1,i.connect(window.audioContext.destination);let e=window.audioContext.currentTime,s=[];const n=new st({ya:30,pa:i=>{let e=new Float32Array(i.buffer),s=new Float32Array(t.length+e.length);s.set(t,0),s.set(e,t.length),t=s},_a:t=>{},bufferSize:102400});await n.init();const r=await fetch('./SCC1_Florestan.sf2'),h=new Uint8Array(await r.arrayBuffer());function o(){if(!window.audioContext||!t.length)return;let n=window.audioContext.createBufferSource();const r=t.length/2,h=window.audioContext.createBuffer(2,r,44100);for(let i=0;i<2;i++){const e=h.getChannelData(i);let s=i;for(let i=0;i{if(l&&clearInterval(l),t=new Float32Array,s.length){let t=i.gain.value;i.gain.value=0,s.forEach((t=>{t.stop(window.audioContext.currentTime)})),s=[],i.gain.value=t}},window._tinyMidiVolume=(t=1)=>{i.gain.value=t},window._tinyMidiPlay=async(t,i=1)=>{t&&(await window._tinyMidiStop(),-1!=i&&window._tinyMidiVolume(i),e=window.audioContext.currentTime,l=setInterval(o,250),n.La(t))}})();class nt{level;y;x;z;model;Sa;xa;Ma;ka;Da;Na;Fa;info;Ba=0;Yi=0;constructor(t,i,e,s,n,r,h,o,l,a,c,f,u){this.level=t,this.y=i,this.x=e,this.z=s,this.model=n,this.Sa=r,this.xa=h,this.Ma=o,this.ka=l,this.Da=a,this.Na=c,this.Fa=f,this.info=u}}class rt extends w{level;x;z;Ua;Pa;Ga;Wa=null;Ya=null;Ha=null;Va=null;Ka=null;Xa=null;ja=null;za=0;Za=0;qa=0;visible=!1;update=!1;Ja=!1;$a=0;Qa=0;tc=0;ic=0;constructor(t,i,e){super(),this.Ua=this.level=t,this.x=i,this.z=e,this.Pa=new v(5,null),this.Ga=new Int32Array(5)}}class ht{ec;sc;nc;rc;type;vr;Lr;Sr;Mr;Dr;Nr;mode=0;hc=0;oc=0;lc=0;ac=0;cc=0;fc=0;constructor(t,i,e,s,n,r,h,o,l,a,c){this.ec=t,this.sc=i,this.nc=e,this.rc=s,this.type=n,this.vr=r,this.Lr=h,this.Sr=o,this.Mr=l,this.Dr=a,this.Nr=c}}class ot{static OPEN=0;static uc=1;static dc=2;static wc=4;static yc=8;static mc=ot.uc<<4;static Ac=ot.dc<<4;static _c=ot.wc<<4;static Ic=ot.yc<<4;static gc=256;static Cc=512;static Ec=1024;static Tc=2048;static bc=4096;static Rc=ot.Cc<<4;static Oc=ot.Ec<<4;static vc=ot.Tc<<4;static Lc=ot.bc<<4;static Sc=ot.gc<<9;static xc=524288;static Mc=2097152;static kc=ot.Mc|ot.xc;static Dc=ot.gc|ot.kc;static Nc=ot.dc|ot.Dc;static Fc=ot.yc|ot.Dc;static Bc=ot.dc|ot.wc|ot.Fc;static Uc=ot.Ac|ot.Dc;static Pc=ot.yc|ot.mc|ot.Uc;static Gc=ot.Ic|ot.Dc;static Wc=ot.uc|ot.dc|ot.Gc;static Yc=ot.Ac|ot._c|ot.Gc;static Hc=16777215}class lt{static Vc=0;static Kc=1;static Xc=2;static jc=3}class at{static zc=0;static Zc=1;static qc=2;static Jc=3}class ct{static $c=new ct(0,at.zc);static Qc=new ct(1,at.zc);static tf=new ct(2,at.zc);static if=new ct(3,at.zc);static ef=new ct(4,at.Zc);static sf=new ct(5,at.Zc);static nf=new ct(6,at.Zc);static rf=new ct(7,at.Zc);static hf=new ct(8,at.Zc);static lf=new ct(9,at.qc);static af=new ct(10,at.qc);static cf=new ct(11,at.qc);static ff=new ct(12,at.qc);static uf=new ct(13,at.qc);static df=new ct(14,at.qc);static wf=new ct(15,at.qc);static yf=new ct(16,at.qc);static mf=new ct(17,at.qc);static Af=new ct(18,at.qc);static pf=new ct(19,at.qc);static _f=new ct(20,at.qc);static If=new ct(21,at.qc);static Jc=new ct(22,at.Jc);static values(){return[this.$c,this.Qc,this.mf,this.wf,this.tf,this.df,this.lf,this.if,this.Jc,this.ff,this.cf,this.nf,this._f,this.af,this.sf,this.uf,this.rf,this.ef,this.yf,this.hf,this.pf,this.If,this.Af]}static of(t){const i=this.values();for(let e=0;et*ut.Cf+i;offsetX;Ef;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.Ef=0,this.sizeX=ut.Cf,this.sizeZ=ut.Cf,this.flags=new Int32Array(this.sizeX*this.sizeZ),this.reset()}reset=()=>{for(let t=0;t{this.flags[ut.index(t-this.offsetX,i-this.Ef)]|=ot.Mc};bf=(t,i)=>{this.flags[ut.index(t-this.offsetX,i-this.Ef)]&=~ot.Mc};Rf=(t,i,e,s,n,r)=>{let h=ot.gc;r&&(h|=ot.Sc);const o=t-this.offsetX,l=i-this.Ef;if(n===lt.Kc||n===lt.jc){const t=e;e=s,s=t}for(let t=o;t=0&&t=0&&i{let h=ot.gc;r&&(h|=ot.Sc);const o=t-this.offsetX,l=i-this.Ef;if(n===lt.Kc||n===lt.jc){const t=e;e=s,s=t}for(let t=o;t=0&&t=0&&i{const r=t-this.offsetX,h=i-this.Ef,o=n?ot.Lc:ot.Ic,l=n?ot.bc:ot.yc,a=n?ot.Ec:ot.dc,c=n?ot.Oc:ot.Ac,f=n?ot.Cc:ot.uc,u=n?ot.Rc:ot.mc,d=n?ot.Tc:ot.wc,w=n?ot.vc:ot._c;e===ct.$c.id?s===lt.Vc?(this.add(r,h,o),this.add(r-1,h,l)):s===lt.Kc?(this.add(r,h,a),this.add(r,h+1,c)):s===lt.Xc?(this.add(r,h,l),this.add(r+1,h,o)):s===lt.jc&&(this.add(r,h,c),this.add(r,h-1,a)):e===ct.Qc.id||e===ct.if.id?s===lt.Vc?(this.add(r,h,f),this.add(r-1,h+1,u)):s===lt.Kc?(this.add(r,h,d),this.add(r+1,h+1,w)):s===lt.Xc?(this.add(r,h,u),this.add(r+1,h-1,f)):s===lt.jc&&(this.add(r,h,w),this.add(r-1,h-1,d)):e===ct.tf.id&&(s===lt.Vc?(this.add(r,h,a|o),this.add(r-1,h,l),this.add(r,h+1,c)):s===lt.Kc?(this.add(r,h,a|l),this.add(r,h+1,c),this.add(r+1,h,o)):s===lt.Xc?(this.add(r,h,c|l),this.add(r+1,h,o),this.add(r,h-1,a)):s===lt.jc&&(this.add(r,h,c|o),this.add(r,h-1,a),this.add(r-1,h,l))),n&&this.vf(t,i,e,s,!1)};Lf=(t,i,e,s,n)=>{const r=t-this.offsetX,h=i-this.Ef,o=n?ot.Lc:ot.Ic,l=n?ot.bc:ot.yc,a=n?ot.Ec:ot.dc,c=n?ot.Oc:ot.Ac,f=n?ot.Cc:ot.uc,u=n?ot.Rc:ot.mc,d=n?ot.Tc:ot.wc,w=n?ot.vc:ot._c;e===ct.$c.id?s===lt.Vc?(this.remove(r,h,o),this.remove(r-1,h,l)):s===lt.Kc?(this.remove(r,h,a),this.remove(r,h+1,c)):s===lt.Xc?(this.remove(r,h,l),this.remove(r+1,h,o)):s===lt.jc&&(this.remove(r,h,c),this.remove(r,h-1,a)):e===ct.Qc.id||e===ct.if.id?s===lt.Vc?(this.remove(r,h,f),this.remove(r-1,h+1,u)):s===lt.Kc?(this.remove(r,h,d),this.remove(r+1,h+1,w)):s===lt.Xc?(this.remove(r,h,u),this.remove(r+1,h-1,f)):s===lt.jc&&(this.remove(r,h,w),this.remove(r-1,h-1,d)):e===ct.tf.id&&(s===lt.Vc?(this.remove(r,h,a|o),this.remove(r-1,h,l),this.remove(r,h+1,c)):s===lt.Kc?(this.remove(r,h,a|l),this.remove(r,h+1,c),this.remove(r+1,h,o)):s===lt.Xc?(this.remove(r,h,c|l),this.remove(r+1,h,o),this.remove(r,h-1,a)):s===lt.jc&&(this.remove(r,h,c|o),this.remove(r,h-1,a),this.remove(r-1,h,l))),n&&this.Lf(t,i,e,s,!1)};Sf=(t,i,e,s,n,r)=>{if(t===e&&i===s)return!0;const h=t-this.offsetX,o=i-this.Ef,l=e-this.offsetX,a=s-this.Ef,c=ut.index(h,o);if(n===ct.$c.id){if(r===lt.Vc){if(h===l-1&&o===a)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.Uc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.Nc)===ot.OPEN)return!0}else if(r===lt.Kc){if(h===l&&o===a+1)return!0;if(h===l-1&&o===a&&(this.flags[c]&ot.Fc)===ot.OPEN)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.Gc)===ot.OPEN)return!0}else if(r===lt.Xc){if(h===l+1&&o===a)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.Uc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.Nc)===ot.OPEN)return!0}else if(r===lt.jc){if(h===l&&o===a-1)return!0;if(h===l-1&&o===a&&(this.flags[c]&ot.Fc)===ot.OPEN)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.Gc)===ot.OPEN)return!0}}else if(n===ct.tf.id){if(r===lt.Vc){if(h===l-1&&o===a)return!0;if(h===l&&o===a+1)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.Gc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.Nc)===ot.OPEN)return!0}else if(r===lt.Kc){if(h===l-1&&o===a&&(this.flags[c]&ot.Fc)===ot.OPEN)return!0;if(h===l&&o===a+1)return!0;if(h===l+1&&o===a)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.Nc)===ot.OPEN)return!0}else if(r===lt.Xc){if(h===l-1&&o===a&&(this.flags[c]&ot.Fc)===ot.OPEN)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.Uc)===ot.OPEN)return!0;if(h===l+1&&o===a)return!0;if(h===l&&o===a-1)return!0}else if(r===lt.jc){if(h===l-1&&o===a)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.Uc)===ot.OPEN)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.Gc)===ot.OPEN)return!0;if(h===l&&o===a-1)return!0}}else if(n===ct.lf.id){if(h===l&&o===a+1&&(this.flags[c]&ot.Ac)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.dc)===ot.OPEN)return!0;if(h===l-1&&o===a&&(this.flags[c]&ot.yc)===ot.OPEN)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.Ic)===ot.OPEN)return!0}return!1};xf=(t,i,e,s,n,r)=>{if(t===e&&i===s)return!0;const h=t-this.offsetX,o=i-this.Ef,l=e-this.offsetX,a=s-this.Ef,c=ut.index(h,o);if(n===ct.nf.id||n===ct.rf.id){if(n===ct.rf.id&&(r=r+2&3),r===lt.Vc){if(h===l+1&&o===a&&(this.flags[c]&ot.Ic)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.dc)===ot.OPEN)return!0}else if(r===lt.Kc){if(h===l-1&&o===a&&(this.flags[c]&ot.yc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.dc)===ot.OPEN)return!0}else if(r===lt.Xc){if(h===l-1&&o===a&&(this.flags[c]&ot.yc)===ot.OPEN)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.Ac)===ot.OPEN)return!0}else if(r===lt.jc){if(h===l+1&&o===a&&(this.flags[c]&ot.Ic)===ot.OPEN)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.Ac)===ot.OPEN)return!0}}else if(n===ct.hf.id){if(h===l&&o===a+1&&(this.flags[c]&ot.Ac)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.dc)===ot.OPEN)return!0;if(h===l-1&&o===a&&(this.flags[c]&ot.yc)===ot.OPEN)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.Ic)===ot.OPEN)return!0}return!1};Mf=(t,i,e,s,n,r,h)=>{const o=e+n-1,l=s+r-1,a=ut.index(t-this.offsetX,i-this.Ef);return t>=e&&t<=o&&i>=s&&i<=l||(t===e-1&&i>=s&&i<=l&&(this.flags[a]&ot.yc)===ot.OPEN&&(h&ft.Vc)===ot.OPEN||(t===o+1&&i>=s&&i<=l&&(this.flags[a]&ot.Ic)===ot.OPEN&&(h&ft.Xc)===ot.OPEN||(i===s-1&&t>=e&&t<=o&&(this.flags[a]&ot.dc)===ot.OPEN&&(h&ft.jc)===ot.OPEN||i===l+1&&t>=e&&t<=o&&(this.flags[a]&ot.Ac)===ot.OPEN&&(h&ft.Kc)===ot.OPEN)))};add=(t,i,e)=>{this.flags[ut.index(t,i)]|=e};remove=(t,i,e)=>{this.flags[ut.index(t,i)]&=ot.Hc-e}}class dt{y;x;z;model;Fa;info;constructor(t,i,e,s,n,r){this.y=t,this.x=i,this.z=e,this.model=s,this.Fa=n,this.info=r}}class wt{y;x;z;kf;Df;Nf;Ff;Fa;info;constructor(t,i,e,s,n,r,h,o,l){this.y=t,this.x=i,this.z=e,this.kf=s,this.Df=n,this.Nf=r,this.Ff=h,this.Fa=o,this.info=l}}class yt{y;x;z;type;angle;model;Fa;info;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.type=s,this.angle=n,this.model=r,this.Fa=h,this.info=o}}class mt{y;x;z;Bf;Uf;Pf;Fa;offset;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.Bf=s,this.Uf=n,this.Pf=r,this.Fa=h,this.offset=o}}class At{Gf;Wf;Yf;Hf;Vf;color;flat;constructor(t,i,e,s,n,r,h){this.Gf=t,this.Wf=i,this.Yf=e,this.Hf=s,this.Vf=n,this.color=r,this.flat=h}}class pt{static Kf=new Int32Array(6);static Xf=new Int32Array(6);static jf=new Int32Array(6);static zf=new Int32Array(6);static Zf=new Int32Array(6);static qf=[Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,2,6),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,13,14)];static Jf=[Int8Array.of(0,1,2,3,0,0,1,3),Int8Array.of(1,1,2,3,1,0,1,3),Int8Array.of(0,1,2,3,1,0,1,3),Int8Array.of(0,0,1,2,0,0,2,4,1,0,4,3),Int8Array.of(0,0,1,4,0,0,4,3,1,1,2,4),Int8Array.of(0,0,4,3,1,0,1,2,1,0,2,4),Int8Array.of(0,1,2,4,1,0,1,4,1,0,4,3),Int8Array.of(0,4,1,2,0,4,2,5,1,0,4,5,1,0,5,3),Int8Array.of(0,4,1,2,0,4,2,3,0,4,3,5,1,0,4,5),Int8Array.of(0,0,4,5,1,4,1,2,1,4,2,3,1,4,3,5),Int8Array.of(0,0,1,5,0,1,4,5,0,1,2,4,1,0,5,3,1,5,4,3,1,4,2,3),Int8Array.of(1,0,1,5,1,1,4,5,1,1,2,4,0,0,5,3,0,5,4,3,0,4,2,3),Int8Array.of(1,0,5,4,1,0,1,5,0,0,4,3,0,4,5,3,0,5,2,3,0,1,2,5)];static $f=128;static Qf=this.$f/2|0;static tu=this.$f/4|0;static iu=3*this.$f/4|0;Ar;ar;pr;eu;su;nu;ru;hu;ou;lu;flat;shape;angle;au;cu;constructor(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w,y,m,A,p){this.flat=!(m!==s||m!==d||m!==o),this.shape=i,this.angle=r,this.au=u,this.cu=l;const _=pt.qf[i],I=_.length;this.Ar=new Int32Array(I),this.ar=new Int32Array(I),this.pr=new Int32Array(I);const g=new Int32Array(I),C=new Int32Array(I),E=t*pt.$f,T=A*pt.$f;for(let t=0;t8&&I<=12&&(I=9+(I-r-9&3)),I>12&&I<=16&&(I=13+(I-r-13&3)),1===I?(i=E,l=T,c=m,u=h,A=a):2===I?(i=E+pt.Qf,l=T,c=m+s>>1,u=h+p>>1,A=a+e>>1):3===I?(i=E+pt.$f,l=T,c=s,u=p,A=e):4===I?(i=E+pt.$f,l=T+pt.Qf,c=s+d>>1,u=p+n>>1,A=e+w>>1):5===I?(i=E+pt.$f,l=T+pt.$f,c=d,u=n,A=w):6===I?(i=E+pt.Qf,l=T+pt.$f,c=d+o>>1,u=n+y>>1,A=w+f>>1):7===I?(i=E,l=T+pt.$f,c=o,u=y,A=f):8===I?(i=E,l=T+pt.Qf,c=o+m>>1,u=y+h>>1,A=f+a>>1):9===I?(i=E+pt.Qf,l=T+pt.tu,c=m+s>>1,u=h+p>>1,A=a+e>>1):10===I?(i=E+pt.iu,l=T+pt.Qf,c=s+d>>1,u=p+n>>1,A=e+w>>1):11===I?(i=E+pt.Qf,l=T+pt.iu,c=d+o>>1,u=n+y>>1,A=w+f>>1):12===I?(i=E+pt.tu,l=T+pt.Qf,c=o+m>>1,u=y+h>>1,A=f+a>>1):13===I?(i=E+pt.tu,l=T+pt.tu,c=m,u=h,A=a):14===I?(i=E+pt.iu,l=T+pt.tu,c=s,u=p,A=e):15===I?(i=E+pt.iu,l=T+pt.iu,c=d,u=n,A=w):(i=E+pt.tu,l=T+pt.iu,c=o,u=y,A=f),this.Ar[t]=i,this.ar[t]=c,this.pr[t]=l,g[t]=u,C[t]=A}const b=pt.Jf[i],R=b.length/4|0;this.ru=new Int32Array(R),this.hu=new Int32Array(R),this.ou=new Int32Array(R),this.eu=new Int32Array(R),this.su=new Int32Array(R),this.nu=new Int32Array(R),this.lu=-1!==c?new Int32Array(R):null;let O=0;for(let t=0;t{this.Ru=0,this.Ou=0,this.vu=t,this.Lu=i,this.Su=t/2|0,this.xu=i/2|0;const r=new x(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let i=0;i<2048;i+=64){this.Mu=N.sin[t],this.ku=N.cos[t],this.Du=N.sin[i],this.Nu=N.cos[i];const h=(t-128)/32|0,o=i/64|0;for(let t=-26;t<=26;t++)for(let i=-26;i<=26;i++){const l=128*t,a=128*i;let c=!1;for(let t=-e;t<=s;t+=128)if(this.wd(l,a,n[h]+t)){c=!0;break}r[h][o][t+25+1][i+25+1]=c}}for(let t=0;t<8;t++)for(let i=0;i<32;i++)for(let e=-25;e<25;e++)for(let s=-25;s<25;s++){let n=!1;t:for(let h=-1;h<=1;h++)for(let o=-1;o<=1;o++){if(r[t][i][e+h+25+1][s+o+25+1]){n=!0;break t}if(r[t][(i+1)%31][e+h+25+1][s+o+25+1]){n=!0;break t}if(r[t+1][i][e+h+25+1][s+o+25+1]){n=!0;break t}if(r[t+1][(i+1)%31][e+h+25+1][s+o+25+1]){n=!0;break t}}this.Iu[t][i][e+25][s+25]=n}};static zi=()=>{this.gu=null,this.Cu=null,this.Eu=null,this.bu=null,this.Iu=null,this.Tu=null,this.zu=null,console.log('World3D unloaded!')};static yd=(t,i,e,s,n,r,h,o)=>{It.Eu[t][It.Cu[t]++]=new ht(e/128|0,r/128|0,n/128|0,o/128|0,i,e,r,n,o,s,h)};static wd=(t,i,e)=>{const s=i*this.Du+t*this.Nu>>16,n=i*this.Nu-t*this.Du>>16,r=e*this.Mu+n*this.ku>>16,h=e*this.ku-n*this.Mu>>16;if(r<50||r>3500)return!1;const o=this.Su+((s<<9)/r|0),l=this.xu+((h<<9)/r|0);return o>=this.Ru&&o<=this.vu&&l>=this.Ou&&l<=this.Lu};md;sc;rc;Ad;pd;_d;Id;gd;Cd;Ed=0;Td=0;bd=0;constructor(t,i,e,s){this.md=e,this.sc=s,this.rc=i,this.pd=new S(e,s,i,null),this.Id=new D(e,s+1,i+1),this.Ad=t,this._d=new v(5e3,null),this.gd=new Int32Array(1e4),this.Cd=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this.Td=t;for(let i=0;i{const e=this.pd[0][t][i];for(let e=0;e<3;e++){this.pd[e][t][i]=this.pd[e+1][t][i];const s=this.pd[e][t][i];s&&s.level--}this.pd[0][t][i]||(this.pd[0][t][i]=new rt(0,t,i));const s=this.pd[0][t][i];s&&(s.ja=e),this.pd[3][t][i]=null};vd=(t,i,e,s)=>{const n=this.pd[t][i][e];n&&(n.qa=s)};Ld=(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w,y,m,A,p,_)=>{if(s===_t.fu){for(let s=t;s>=0;s--)this.pd[s][i][e]||(this.pd[s][i][e]=new rt(s,i,e));const s=this.pd[t][i][e];s&&(s.Wa=new At(c,f,u,d,-1,p,!1))}else if(s===_t.uu){for(let s=t;s>=0;s--)this.pd[s][i][e]||(this.pd[s][i][e]=new rt(s,i,e));const s=this.pd[t][i][e];s&&(s.Wa=new At(w,y,m,A,r,_,h===o&&h===l&&h===a))}else{for(let s=t;s>=0;s--)this.pd[s][i][e]||(this.pd[s][i][e]=new rt(s,i,e));const I=this.pd[t][i][e];I&&(I.Ya=new pt(i,s,y,o,u,n,c,a,_,w,r,A,p,l,m,d,h,e,f))}};Sd=(t,i,e,s,n,r,h)=>{this.pd[i][e][s]||(this.pd[i][e][s]=new rt(i,e,s));const o=this.pd[i][e][s];o&&(o.Ka=new dt(n,128*e+64,128*s+64,t,r,h))};xd=(t,i,e)=>{const s=this.pd[t][i][e];s&&(s.Ka=null)};Md=(t,i,e,s,n,r,h,o)=>{let l=0;const a=this.pd[s][t][i];if(a)for(let t=0;tl&&(l=e)}else this.pd[s][t][i]=new rt(s,t,i);const c=this.pd[s][t][i];c&&(c.Xa=new mt(e,128*t+64,128*i+64,r,h,o,n,l))};kd=(t,i,e)=>{const s=this.pd[t][i][e];s&&(s.Xa=null)};vf=(t,i,e,s,n,r,h,o,l,a)=>{if(!h&&!o)return;for(let s=t;s>=0;s--)this.pd[s][i][e]||(this.pd[s][i][e]=new rt(s,i,e));const c=this.pd[t][i][e];c&&(c.Ha=new wt(s,128*i+64,128*e+64,n,r,h,o,l,a))};Lf=(t,i,e,s)=>{const n=this.pd[t][i][e];1===s&&n&&(n.Ha=null)};Dd=(t,i,e,s,n,r,h,o,l,a,c)=>{if(!o)return;for(let s=t;s>=0;s--)this.pd[s][i][e]||(this.pd[s][i][e]=new rt(s,i,e));const f=this.pd[t][i][e];f&&(f.Va=new yt(s,128*i+n+64,128*e+r+64,c,a,o,h,l))};Nd=(t,i,e)=>{const s=this.pd[t][i][e];s&&(s.Va=null)};Fd=(t,i,e,s)=>{const n=this.pd[t][i][e];if(!n)return;const r=n.Va;if(!r)return;const h=128*i+64,o=128*e+64;r.x=h+((r.x-h)*s/16|0),r.z=o+((r.z-o)*s/16|0)};Bd=(t,i,e,s)=>{if(!s)return;const n=this.pd[t][i][e];if(!n)return;const r=n.Va;r&&(r.model=s)};Ud=(t,i,e,s)=>{if(!s)return;const n=this.pd[t][i][e];if(!n)return;const r=n.Ka;r&&(r.model=s)};Pd=(t,i,e,s)=>{if(!s)return;const n=this.pd[t][i][e];if(!n)return;const r=n.Ha;r&&(r.Nf=s)};Gd=(t,i,e,s,n)=>{if(!s)return;const r=this.pd[e][t][i];if(!r)return;const h=r.Ha;h&&(h.Nf=s,h.Ff=n)};Rf=(t,i,e,s,n,r,h,o,l,a,c)=>{if(!n&&!r)return!0;const f=128*i+64*l,u=128*e+64*a;return this.Wd(f,u,s,t,i,e,l,a,n,r,h,o,c,!1)};Yd=(t,i,e,s,n,r,h,o,l,a)=>{if(!n&&!r)return!0;let c=i-l,f=s-l,u=i+l,d=s+l;return a&&(o>640&&o<1408&&(d+=128),o>1152&&o<1920&&(u+=128),(o>1664||o<384)&&(f-=128),o>128&&o<896&&(c-=128)),c=c/128|0,f=f/128|0,u=u/128|0,d=d/128|0,this.Wd(i,s,e,t,c,f,u+1-c,d-f+1,n,r,h,0,o,!0)};Hd=(t,i,e,s,n,r,h,o,l,a,c,f)=>!l&&!a||this.Wd(i,s,e,t,n,r,h+1-n,o-r+1,l,a,c,0,f,!0);Of=(t,i,e)=>{const s=this.pd[t][i][e];if(s)for(let t=0;t>29&3)&&n.Ma===i&&n.Da===e)return void this.Vd(n)}};Kd=(t,i,e,s)=>{if(!s)return;const n=this.pd[t][i][e];if(n)for(let t=0;t>29&3))return void(i.model=s)}};Xd=()=>{for(let t=0;t{const s=this.pd[t][i][e];return s&&s.Ha?s.Ha.Fa:0};zd=(t,i,e)=>{const s=this.pd[t][e][i];return s&&s.Va?s.Va.Fa:0};Zd=(t,i,e)=>{const s=this.pd[t][i][e];if(!s)return 0;for(let t=0;t>29&3)&&n.Ma===i&&n.Da===e)return n.Fa}return 0};qd=(t,i,e)=>{const s=this.pd[t][i][e];return s&&s.Ka?s.Ka.Fa:0};Jd=(t,i,e,s)=>{const n=this.pd[t][i][e];if(n){if(n.Ha&&n.Ha.Fa===s)return 255&n.Ha.info;if(n.Va&&n.Va.Fa===s)return 255&n.Va.info;if(n.Ka&&n.Ka.Fa===s)return 255&n.Ka.info;for(let t=0;t{const r=i*(0|Math.sqrt(e*e+s*s+n*n))>>8;for(let i=0;i{if(i0){const n=this.pd[t][i+1][e-1];n&&n.Ka&&n.Ka.model&&n.Ka.model.yr&&this.tw(s,n.Ka.model,128,0,-128,!0)}};Qd=(t,i,e,s,n,r)=>{let h=!0,o=i;const l=i+s,a=e-1,c=e+n;for(let f=t;f<=t+1;f++)if(f!==this.md){for(let u=o;u<=l;u++)if(!(u<0||u>=this.sc))for(let o=a;o<=c;o++){if(o<0||o>=this.rc||h&&u=e||u===i))continue;const a=this.pd[f][u][o];if(!a)continue;const d=128*(u-i)+64*(1-s),w=128*(o-e)+64*(1-n),y=((this.Ad[f][u][o]+this.Ad[f][u+1][o]+this.Ad[f][u][o+1]+this.Ad[f][u+1][o+1])/4|0)-((this.Ad[t][i][e]+this.Ad[t][i+1][e]+this.Ad[t][i][e+1]+this.Ad[t][i+1][e+1])/4|0),m=a.Ha;m&&m.Nf&&m.Nf.yr&&this.tw(r,m.Nf,d,y,w,h),m&&m.Ff&&m.Ff.yr&&this.tw(r,m.Ff,d,y,w,h);for(let t=0;t{this.bd++;let h=0;const o=i.Ar,l=i.rn;if(t.yr&&t.mr)for(let r=0;ri.Dr)continue;const u=t.Ar[r]-e;if(ui.Lr)continue;const d=t.pr[r]-n;if(di.Mr)continue;if(i.yr&&i.mr)for(let t=0;t{const h=this.pd[t][i][e];if(!h)return;const o=h.Wa;if(o){const t=o.color;if(0!==t)for(let i=0;i<4;i++)s[n]=t,s[n+1]=t,s[n+2]=t,s[n+3]=t,n+=r;return}const l=h.Ya;if(!l)return;const a=l.shape,c=l.angle,f=l.au,u=l.cu,d=It.od[a],w=It.ld[c];let y=0;if(0===f)for(let t=0;t<4;t++)0!==d[w[y++]]&&(s[n]=u),0!==d[w[y++]]&&(s[n+1]=u),0!==d[w[y++]]&&(s[n+2]=u),0!==d[w[y++]]&&(s[n+3]=u),n+=r;else for(let t=0;t<4;t++)s[n]=0===d[w[y++]]?f:u,s[n+1]=0===d[w[y++]]?f:u,s[n+2]=0===d[w[y++]]?f:u,s[n+3]=0===d[w[y++]]?f:u,n+=r};click=(t,i)=>{It.ju=!0,It.Xe=t,It.je=i,It.ud=-1,It.dd=-1};draw=(t,i,e,s,n,r,h)=>{t<0?t=0:t>=128*this.sc&&(t=128*this.sc-1),e<0?e=0:e>=128*this.rc&&(e=128*this.rc-1),It.Yi++,It.Mu=N.sin[r],It.ku=N.cos[r],It.Du=N.sin[n],It.Nu=N.cos[n],It.zu=It.Iu[(r-128)/32|0][n/64|0],It.Fu=t,It.Bu=i,It.Uu=e,It.Pu=t/128|0,It.Gu=e/128|0,It.Ku=s,It.Wu=It.Pu-25,It.Wu<0&&(It.Wu=0),It.Hu=It.Gu-25,It.Hu<0&&(It.Hu=0),It.Yu=It.Pu+25,It.Yu>this.sc&&(It.Yu=this.sc),It.Vu=It.Gu+25,It.Vu>this.rc&&(It.Vu=this.rc),this.sw(),It.Xu=0;for(let t=this.Td;t=2e3)?(h.visible=!0,h.update=!0,h.Ja=h.za>0,It.Xu++):(h.visible=!1,h.update=!1,h.$a=0))}}for(let t=this.Td;t=It.Yu))for(let t=-25;t<=0;t++){const n=It.Gu+t,r=It.Gu-t;let o;if(e>=It.Wu&&(n>=It.Hu&&(o=i[e][n],o&&o.visible&&this.nw(o,!0,h)),r=It.Hu&&(o=i[s][n],o&&o.visible&&this.nw(o,!0,h)),r=It.Yu))for(let t=-25;t<=0;t++){const n=It.Gu+t,r=It.Gu-t;let o;if(e>=It.Wu&&(n>=It.Hu&&(o=i[e][n],o&&o.visible&&this.nw(o,!1,h)),r=It.Hu&&(o=i[s][n],o&&o.visible&&this.nw(o,!1,h)),r{if(!l&&!a)return!1;for(let t=n;t=this.sc||i>=this.rc)return!1;const e=this.pd[s][t][i];if(e&&e.za>=5)return!1}const w=new nt(s,e,t,i,l,a,u,n,n+h-1,r,r+o-1,c,f);for(let t=n;tn&&(e|=1),tr&&(e+=8),i=0;e--)this.pd[e][t][i]||(this.pd[e][t][i]=new rt(e,t,i));const l=this.pd[s][t][i];l&&(l.Pa[l.za]=w,l.Ga[l.za]=e,l.Za|=e,l.za++)}return d&&(this._d[this.Ed++]=w),!0};Vd=t=>{for(let i=t.Ma;i<=t.ka;i++)for(let e=t.Da;e<=t.Na;e++){const s=this.pd[t.level][i][e];if(s){for(let i=0;i{const t=It.Cu[It.Ku],i=It.Eu[It.Ku];It.fd=0;for(let e=0;e=0&&s<=50){n=t.nc+25-It.Gu,n<0&&(n=0),r=t.rc+25-It.Gu,r>50&&(r=50);let i=!1;for(;n<=r;)if(It.zu&&It.zu[s][n++]){i=!0;break}if(i){if(h=It.Fu-t.vr,h>32)t.mode=1;else{if(h>=-32)continue;t.mode=2,h=-h}t.lc=(t.Sr-It.Uu<<8)/h|0,t.ac=(t.Mr-It.Uu<<8)/h|0,t.cc=(t.Dr-It.Bu<<8)/h|0,t.fc=(t.Nr-It.Bu<<8)/h|0,It.Tu[It.fd++]=t}}}else if(2===t.type){if(s=t.nc+25-It.Gu,s>=0&&s<=50){n=t.ec+25-It.Pu,n<0&&(n=0),r=t.sc+25-It.Pu,r>50&&(r=50);let i=!1;for(;n<=r;)if(It.zu&&It.zu[n++][s]){i=!0;break}if(i){if(h=It.Uu-t.Sr,h>32)t.mode=3;else{if(h>=-32)continue;t.mode=4,h=-h}t.hc=(t.vr-It.Fu<<8)/h|0,t.oc=(t.Lr-It.Fu<<8)/h|0,t.cc=(t.Dr-It.Bu<<8)/h|0,t.fc=(t.Nr-It.Bu<<8)/h|0,It.Tu[It.fd++]=t}}}else if(4===t.type&&(s=t.Dr-It.Bu,s>128&&(n=t.nc+25-It.Gu,n<0&&(n=0),r=t.rc+25-It.Gu,r>50&&(r=50),n<=r))){let i=t.ec+25-It.Pu;i<0&&(i=0),h=t.sc+25-It.Pu,h>50&&(h=50);let e=!1;t:for(let t=i;t<=h;t++)for(let i=n;i<=r;i++)if(It.zu&&It.zu[t][i]){e=!0;break t}e&&(t.mode=5,t.hc=(t.vr-It.Fu<<8)/s|0,t.oc=(t.Lr-It.Fu<<8)/s|0,t.lc=(t.Sr-It.Uu<<8)/s|0,t.ac=(t.Mr-It.Uu<<8)/s|0,It.Tu[It.fd++]=t)}}};nw=(t,i,e)=>{for(It.bu.Mt(t);;){let t;do{if(t=It.bu.Dt(),!t)return}while(!t.update);const s=t.x,n=t.z,r=t.level,h=t.Ua,o=this.pd[r];if(t.visible){if(i){if(r>0){const t=this.pd[r-1][s][n];if(t&&t.update)continue}if(s<=It.Pu&&s>It.Wu){const i=o[s-1][n];if(i&&i.update&&(i.visible||!(1&t.Za)))continue}if(s>=It.Pu&&sIt.Hu){const i=o[s][n-1];if(i&&i.update&&(i.visible||!(8&t.Za)))continue}if(n>=It.Gu&&nn&&(a+=6),c=It.Zu[a],t.ic=It.Ju[a]),f&&(f.kf&It.qu[a]?16===f.kf?(t.$a=3,t.Qa=It.$u[a],t.tc=3-t.Qa):32===f.kf?(t.$a=6,t.Qa=It.Qu[a],t.tc=6-t.Qa):64===f.kf?(t.$a=12,t.Qa=It.td[a],t.tc=12-t.Qa):(t.$a=9,t.Qa=It.ed[a],t.tc=9-t.Qa):t.$a=0,f.kf&c&&!this.lw(h,s,n,f.kf)&&f.Nf?.draw(0,It.Mu,It.ku,It.Du,It.Nu,f.x-It.Fu,f.y-It.Bu,f.z-It.Uu,f.Fa),f.Df&c&&!this.lw(h,s,n,f.Df)&&f.Ff?.draw(0,It.Mu,It.ku,It.Du,It.Nu,f.x-It.Fu,f.y-It.Bu,f.z-It.Uu,f.Fa)),u&&!this.visible(h,s,n,u.model.Nr))if(u.type&c)u.model.draw(u.angle,It.Mu,It.ku,It.Du,It.Nu,u.x-It.Fu,u.y-It.Bu,u.z-It.Uu,u.Fa);else if(768&u.type){const t=u.x-It.Fu,i=u.y-It.Bu,e=u.z-It.Uu,s=u.angle;let n,r;if(n=s===lt.Kc||s===lt.Xc?-t:t,r=s===lt.Xc||s===lt.jc?-e:e,256&u.type&&rn){const n=t+It.rd[s],r=e+It.hd[s];u.model.draw(512*s+1280&2047,It.Mu,It.ku,It.Du,It.Nu,n,i,r,u.Fa)}}if(l){const i=t.Ka;i&&i.model?.draw(0,It.Mu,It.ku,It.Du,It.Nu,i.x-It.Fu,i.y-It.Bu,i.z-It.Uu,i.Fa);const e=t.Xa;e&&0===e.offset&&(e.Pf&&e.Pf.draw(0,It.Mu,It.ku,It.Du,It.Nu,e.x-It.Fu,e.y-It.Bu,e.z-It.Uu,e.Fa),e.Uf&&e.Uf.draw(0,It.Mu,It.ku,It.Du,It.Nu,e.x-It.Fu,e.y-It.Bu,e.z-It.Uu,e.Fa),e.Bf&&e.Bf.draw(0,It.Mu,It.ku,It.Du,It.Nu,e.x-It.Fu,e.y-It.Bu,e.z-It.Uu,e.Fa))}const d=t.Za;if(0!==d){if(sIt.Pu&&1&d){const t=o[s-1][n];t&&t.update&&It.bu.Mt(t)}if(n>It.Gu&&8&d){const t=o[s][n-1];t&&t.update&&It.bu.Mt(t)}}}if(0!==t.$a){let i=!0;for(let e=0;ei.Ma&&(r+=1),ei.Da&&(r+=8),ss&&(s=n);const h=It.Gu-i.Da,l=i.Na-It.Gu;i.Ba=l>h?s+l:s+h}for(;;){let t=-50,i=-1;for(let e=0;et&&(t=s.Ba,i=e))}if(-1===i)break;const l=It.gu[i];if(l){l.Yi=It.Yi;let t=l.model;t||(t=l.Sa?.draw(e)??null),t&&!this.aw(h,l.Ma,l.ka,l.Da,l.Na,t.Nr)&&t.draw(l.xa,It.Mu,It.ku,It.Du,It.Nu,l.x-It.Fu,l.y-It.Bu,l.z-It.Uu,l.Fa);for(let t=l.Ma;t<=l.ka;t++)for(let i=l.Da;i<=l.Na;i++){const e=o[t][i];e&&(0!==e.$a?It.bu.Mt(e):t===s&&i===n||!e.update||It.bu.Mt(e))}}}if(t.Ja)continue}if(!t.update||0!==t.$a)continue;if(s<=It.Pu&&s>It.Wu){const t=o[s-1][n];if(t&&t.update)continue}if(s>=It.Pu&&sIt.Hu){const t=o[s][n-1];if(t&&t.update)continue}if(n>=It.Gu&&n=r){const r=t+It.sd[n],h=s+It.nd[n];i.model.draw(512*n+256,It.Mu,It.ku,It.Du,It.Nu,r,e,h,i.Fa)}if(512&i.type&&h<=r){const r=t+It.rd[n],h=s+It.hd[n];i.model.draw(512*n+1280&2047,It.Mu,It.ku,It.Du,It.Nu,r,e,h,i.Fa)}}const e=t.Ha;e&&(e.Df&t.ic&&!this.lw(h,s,n,e.Df)&&e.Ff?.draw(0,It.Mu,It.ku,It.Du,It.Nu,e.x-It.Fu,e.y-It.Bu,e.z-It.Uu,e.Fa),e.kf&t.ic&&!this.lw(h,s,n,e.kf)&&e.Nf?.draw(0,It.Mu,It.ku,It.Du,It.Nu,e.x-It.Fu,e.y-It.Bu,e.z-It.Uu,e.Fa))}if(rIt.Pu){const t=o[s-1][n];t&&t.update&&It.bu.Mt(t)}if(n>It.Gu){const t=o[s][n-1];t&&t.update&&It.bu.Mt(t)}}};hw=(t,i,e,s,n,r,h,o)=>{let l,a,c,f,u=l=(e<<7)-It.Fu,d=a=(s<<7)-It.Uu,w=c=u+128,y=f=d+128,A=this.Ad[i][e][s]-It.Bu,p=this.Ad[i][e+1][s]-It.Bu,_=this.Ad[i][e+1][s+1]-It.Bu,I=this.Ad[i][e][s+1]-It.Bu,g=d*h+u*o>>16;if(d=d*o-u*h>>16,u=g,g=A*r-d*n>>16,d=A*n+d*r>>16,A=g,d<50)return;if(g=a*h+w*o>>16,a=a*o-w*h>>16,w=g,g=p*r-a*n>>16,a=p*n+a*r>>16,p=g,a<50)return;if(g=y*h+c*o>>16,y=y*o-c*h>>16,c=g,g=_*r-y*n>>16,y=_*n+y*r>>16,_=g,y<50)return;if(g=f*h+l*o>>16,f=f*o-l*h>>16,l=g,g=I*r-f*n>>16,f=I*n+f*r>>16,I=g,f<50)return;const C=N.Ni+((u<<9)/d|0),E=N.Fi+((A<<9)/d|0),T=N.Ni+((w<<9)/a|0),b=N.Fi+((p<<9)/a|0),R=N.Ni+((c<<9)/y|0),O=N.Fi+((_<<9)/y|0),v=N.Ni+((l<<9)/f|0),L=N.Fi+((I<<9)/f|0);if(N.alpha=0,(R-v)*(b-L)-(O-L)*(T-v)>0)if(N.Ui=R<0||v<0||T<0||R>m.wt||v>m.wt||T>m.wt,It.ju&&this.cw(It.Xe,It.je,O,L,b,R,v,T)&&(It.ud=e,It.dd=s),-1===t.Vf)12345678!==t.Yf&&N.ne(R,v,T,O,L,b,t.Yf,t.Hf,t.Wf);else if(It.Li){const i=It.ad[t.Vf];N.ne(R,v,T,O,L,b,this.fw(i,t.Yf),this.fw(i,t.Hf),this.fw(i,t.Wf))}else t.flat?N.le(R,v,T,O,L,b,t.Yf,t.Hf,t.Wf,u,A,d,w,l,p,I,a,f,t.Vf):N.le(R,v,T,O,L,b,t.Yf,t.Hf,t.Wf,c,_,y,l,w,I,p,f,a,t.Vf);if(!((C-T)*(L-b)-(E-b)*(v-T)<=0))if(N.Ui=C<0||T<0||v<0||C>m.wt||T>m.wt||v>m.wt,It.ju&&this.cw(It.Xe,It.je,E,b,L,C,T,v)&&(It.ud=e,It.dd=s),-1!==t.Vf){if(!It.Li)return void N.le(C,T,v,E,b,L,t.Gf,t.Wf,t.Hf,u,A,d,w,l,p,I,a,f,t.Vf);const i=It.ad[t.Vf];N.ne(C,T,v,E,b,L,this.fw(i,t.Gf),this.fw(i,t.Wf),this.fw(i,t.Hf))}else 12345678!==t.Gf&&N.ne(C,T,v,E,b,L,t.Gf,t.Wf,t.Hf)};ow=(t,i,e,s,n,r,h)=>{let o=e.Ar.length;for(let t=0;t>16;if(l=l*h-i*r>>16,i=a,a=o*n-l*s>>16,l=o*s+l*n>>16,o=a,l<50)return;e.lu&&(pt.jf[t]=i,pt.zf[t]=o,pt.Zf[t]=l),pt.Kf[t]=N.Ni+((i<<9)/l|0),pt.Xf[t]=N.Fi+((o<<9)/l|0)}N.alpha=0,o=e.ru.length;for(let s=0;s0)if(N.Ui=o<0||l<0||a<0||o>m.wt||l>m.wt||a>m.wt,It.ju&&this.cw(It.Xe,It.je,c,f,u,o,l,a)&&(It.ud=t,It.dd=i),e.lu&&-1!==e.lu[s])if(It.Li){const t=It.ad[e.lu[s]];N.ne(o,l,a,c,f,u,this.fw(t,e.eu[s]),this.fw(t,e.su[s]),this.fw(t,e.nu[s]))}else e.flat?N.le(o,l,a,c,f,u,e.eu[s],e.su[s],e.nu[s],pt.jf[0],pt.zf[0],pt.Zf[0],pt.jf[1],pt.jf[3],pt.zf[1],pt.zf[3],pt.Zf[1],pt.Zf[3],e.lu[s]):N.le(o,l,a,c,f,u,e.eu[s],e.su[s],e.nu[s],pt.jf[n],pt.zf[n],pt.Zf[n],pt.jf[r],pt.jf[h],pt.zf[r],pt.zf[h],pt.Zf[r],pt.Zf[h],e.lu[s]);else 12345678!==e.eu[s]&&N.ne(o,l,a,c,f,u,e.eu[s],e.su[s],e.nu[s])}};rw=(t,i,e)=>{const s=this.Id[t][i][e];if(s===-It.Yi)return!1;if(s===It.Yi)return!0;{const s=i<<7,n=e<<7;return this.uw(s+1,this.Ad[t][i][e],n+1)&&this.uw(s+128-1,this.Ad[t][i+1][e],n+1)&&this.uw(s+128-1,this.Ad[t][i+1][e+1],n+128-1)&&this.uw(s+1,this.Ad[t][i][e+1],n+128-1)?(this.Id[t][i][e]=It.Yi,!0):(this.Id[t][i][e]=-It.Yi,!1)}};lw=(t,i,e,s)=>{if(!this.rw(t,i,e))return!1;const n=i<<7,r=e<<7,h=this.Ad[t][i][e]-1,o=h-120,l=h-230,a=h-238;if(s<16){if(1===s){if(n>It.Fu){if(!this.uw(n,h,r))return!1;if(!this.uw(n,h,r+128))return!1}if(t>0){if(!this.uw(n,o,r))return!1;if(!this.uw(n,o,r+128))return!1}return!!this.uw(n,l,r)&&this.uw(n,l,r+128)}if(2===s){if(r0){if(!this.uw(n,o,r+128))return!1;if(!this.uw(n+128,o,r+128))return!1}return!!this.uw(n,l,r+128)&&this.uw(n+128,l,r+128)}if(4===s){if(n0){if(!this.uw(n+128,o,r))return!1;if(!this.uw(n+128,o,r+128))return!1}return!!this.uw(n+128,l,r)&&this.uw(n+128,l,r+128)}if(8===s){if(r>It.Uu){if(!this.uw(n,h,r))return!1;if(!this.uw(n+128,h,r))return!1}if(t>0){if(!this.uw(n,o,r))return!1;if(!this.uw(n+128,o,r))return!1}return!!this.uw(n,l,r)&&this.uw(n+128,l,r)}}return!!this.uw(n+64,a,r+64)&&(16===s?this.uw(n,l,r+128):32===s?this.uw(n+128,l,r+128):64===s?this.uw(n+128,l,r):128===s?this.uw(n,l,r):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,i,e,s)=>{if(this.rw(t,i,e)){const n=i<<7,r=e<<7;return this.uw(n+1,this.Ad[t][i][e]-s,r+1)&&this.uw(n+128-1,this.Ad[t][i+1][e]-s,r+1)&&this.uw(n+128-1,this.Ad[t][i+1][e+1]-s,r+128-1)&&this.uw(n+1,this.Ad[t][i][e+1]-s,r+128-1)}return!1};aw=(t,i,e,s,n,r)=>{let h,o;if(i!==e||s!==n){for(h=i;h<=e;h++)for(o=s;o<=n;o++)if(this.Id[t][h][o]===-It.Yi)return!1;o=1+(i<<7);const l=2+(s<<7),a=this.Ad[t][i][s]-r;if(!this.uw(o,a,l))return!1;const c=(e<<7)-1;if(!this.uw(c,a,l))return!1;const f=(n<<7)-1;return!!this.uw(o,a,f)&&this.uw(c,a,f)}return!!this.rw(t,i,s)&&(h=i<<7,o=s<<7,this.uw(h+1,this.Ad[t][i][s]-r,o+1)&&this.uw(h+128-1,this.Ad[t][i+1][s]-r,o+1)&&this.uw(h+128-1,this.Ad[t][i+1][s+1]-r,o+128-1)&&this.uw(h+1,this.Ad[t][i][s+1]-r,o+128-1))};uw=(t,i,e)=>{for(let s=0;s0){const t=n.Sr+(n.lc*s>>8),r=n.Mr+(n.ac*s>>8),h=n.Dr+(n.cc*s>>8),o=n.Nr+(n.fc*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(2===n.mode){const s=t-n.vr;if(s>0){const t=n.Sr+(n.lc*s>>8),r=n.Mr+(n.ac*s>>8),h=n.Dr+(n.cc*s>>8),o=n.Nr+(n.fc*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(3===n.mode){const s=n.Sr-e;if(s>0){const e=n.vr+(n.hc*s>>8),r=n.Lr+(n.oc*s>>8),h=n.Dr+(n.cc*s>>8),o=n.Nr+(n.fc*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(4===n.mode){const s=e-n.Sr;if(s>0){const e=n.vr+(n.hc*s>>8),r=n.Lr+(n.oc*s>>8),h=n.Dr+(n.cc*s>>8),o=n.Nr+(n.fc*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(5===n.mode){const s=i-n.Dr;if(s>0){const i=n.vr+(n.hc*s>>8),r=n.Lr+(n.oc*s>>8),h=n.Sr+(n.lc*s>>8),o=n.Mr+(n.ac*s>>8);if(t>=i&&t<=r&&e>=h&&e<=o)return!0}}}return!1};cw=(t,i,e,s,n,r,h,o)=>{if(ie&&i>s&&i>n)return!1;if(tr&&t>h&&t>o)return!1;const l=(i-s)*(o-h)-(t-h)*(n-s);return((i-e)*(h-r)-(t-r)*(s-e))*l>0&&l*((i-n)*(r-o)-(t-o)*(e-n))>0};fw=(t,i)=>((i=(127-i)*(127&t)/160|0)<2?i=2:i>126&&(i=126),(65408&t)+i)}class gt{id;dw=null;constructor(t){this.id=t}ww(t){for(;;){const i=t.Zt;if(0===i)break;this.decode(i,t)}return this}}class Ct extends gt{static count=0;static tn=[];static en=t=>{const i=new R(t.read('flo.dat'));this.count=i.Jt;for(let t=0;t(e>179&&(i=i/2|0),e>192&&(i=i/2|0),e>217&&(i=i/2|0),e>243&&(i=i/2|0),(t/4<<10)+(i/32<<7)+(e/2|0));static mw=(t,i)=>-1===t?12345678:((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);static Aw=(t,i)=>-2===t?12345678:-1===t?(i<0?i=0:i>127&&(i=127),127-i):((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);pw=0;texture=-1;_w=!1;Iw=!0;gw=0;Cw=0;Ew=0;Tw=0;bw=0;Rw=0;decode(t,i){1===t?(this.pw=i.Qt,this.setColor(this.pw)):2===t?this.texture=i.Zt:3===t?this._w=!0:5===t?this.Iw=!1:6===t?this.dw=i.ni:console.log('Error unrecognised config code: ',t)}setColor(t){const i=(t>>16&255)/256,e=(t>>8&255)/256,s=(255&t)/256;let n=i;ei&&(r=e),s>r&&(r=s);let h=0,o=0;const l=(n+r)/2;n!==r&&(l<.5&&(o=(r-n)/(r+n)),l>=.5&&(o=(r-n)/(2-r-n)),i===r?h=(e-s)/(r-n):e===r?h=(s-i)/(r-n)+2:s===r&&(h=(i-e)/(r-n)+4)),h/=6,this.gw=256*h|0,this.Cw=256*o|0,this.Ew=256*l|0,this.Cw<0?this.Cw=0:this.Cw>255&&(this.Cw=255),this.Ew<0?this.Ew=0:this.Ew>255&&(this.Ew=255),this.Tw=l>.5?(1-l)*o*512|0:l*o*512|0,this.Tw<1&&(this.Tw=1),this.bw=h*this.Tw|0;let a=this.gw+(16*Math.random()|0)-8;a<0?a=0:a>255&&(a=255);let c=this.Cw+(48*Math.random()|0)-24;c<0?c=0:c>255&&(c=255);let f=this.Ew+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255),this.Rw=Ct.yw(a,c,f)}}class Et extends gt{static count=0;static cache=null;static Zs=null;static Ow=null;static Lw=0;static Sw=new q(500);static xw=new q(30);static en=t=>{this.Zs=new R(t.read('loc.dat'));const i=new R(t.read('loc.idx'));this.count=i.Jt,this.Ow=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.Ow||!this.Zs)throw new Error('LocType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Lw=(this.Lw+1)%10;const i=this.cache[this.Lw];return this.Zs.Xt=this.Ow[t],i.id=t,i.reset(),i.ww(this.Zs),i.Mw||(i.Mw=new Int32Array(1)),-1===i.kw&&i.Mw&&(i.active=i.Mw.length>0&&i.Mw[0]===ct.af.id,i.Dw&&(i.active=!0)),i};static zi=()=>{this.Sw=null,this.xw=null,this.Ow=null,this.cache=null,this.Zs=null};Nw=null;Mw=null;name=null;Fw=null;Bw=null;Uw=null;width=1;length=1;Pw=!0;Gw=!0;active=!1;kw=-1;Ww=!1;Yw=!1;Iw=!1;Gl=-1;Hw=!1;Vw=16;Kw=0;Xw=0;Dw=null;jw=-1;zw=-1;Zw=!1;qw=!0;Jw=128;$w=128;Qw=128;ty=0;iy=0;ey=0;sy=0;ny=!1;decode(t,i){if(1===t){const t=i.Zt;this.Nw=new Int32Array(t),this.Mw=new Int32Array(t);for(let e=0;e=30&&t<39)this.Dw||(this.Dw=new v(5,null)),this.Dw[t-30]=i.ni,'hidden'===this.Dw[t-30]?.toLowerCase()&&(this.Dw[t-30]=null);else if(40===t){const t=i.Zt;this.Bw=new Uint16Array(t),this.Uw=new Uint16Array(t);for(let e=0;e=this.Nw.length)return null;let c=this.Nw[o];if(-1===c)return null;const f=this.Zw!==i>3;f&&(c+=65536);let u=Et.Sw?.get(BigInt(c));u||(u=j.model(65535&c),f&&u.hh(),Et.Sw?.put(BigInt(c),u));const d=128!==this.Jw||128!==this.$w||128!==this.Qw,w=0!==this.iy||0!==this.ey||0!==this.sy;let y=j.Ur(u,!this.Bw,!this.Hw,i===lt.Vc&&-1===h&&!d&&!w);for(-1!==h&&(y.Qr(),y.eh(h),y.Hr=null,y.Yr=null);i-- >0;)y.sh();if(this.Bw&&this.Uw)for(let t=0;t{const i=new R(t.read('seq.dat'));this.count=i.Jt;for(let t=0;t{let e=this.lA(t+45365,i+91923,4)+(this.lA(t+10294,i+37821,2)-128>>1)+(this.lA(t,i,1)-128>>2)-128;return e=35+(.3*e|0),e<10?e=10:e>60&&(e=60),e};static lA=(t,i,e)=>{const s=t/e|0,n=t&e-1,r=i/e|0,h=i&e-1,o=this.aA(s,r),l=this.aA(s+1,r),a=this.aA(s,r+1),c=this.aA(s+1,r+1),f=this.cA(o,l,n,e),u=this.cA(a,c,n,e);return this.cA(f,u,h,e)};static cA=(t,i,e,s)=>{const n=65536-N.cos[1024*e/s|0]>>1;return(t*(65536-n)>>16)+(i*n>>16)};static aA=(t,i)=>((this.fA(t-1,i-1)+this.fA(t+1,i-1)+this.fA(t-1,i+1)+this.fA(t+1,i+1))/16|0)+((this.fA(t-1,i)+this.fA(t+1,i)+this.fA(t,i-1)+this.fA(t,i+1))/8|0)+(this.fA(t,i)/4|0);static fA=(t,i)=>{const e=t+57*i,s=BigInt(e<<13^e);return 255&Number((s*(s*s*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static Rf=(t,i,e,s,n,r,h,o,l,a,c)=>{const f=n[c][i][e],u=n[c][i+1][e],d=n[c][i+1][e+1],w=n[c][i][e+1],y=f+u+d+w>>2,m=Et.get(o);let A=i+(e<<7)+(o<<14)+1073741824|0;m.active||(A+=-2147483648),A|=0;const p=(a<<6)+l<<24>>24;if(l===ct.Jc.id)s?.Sd(m.Ul(ct.Jc.id,a,f,u,d,w,-1),t,i,e,y,A,p),m.Pw&&m.active&&h?.Tf(i,e),-1!==m.Gl&&r.Mt(new Tt(o,t,3,i,e,bt.tn[m.Gl],!0));else if(l===ct.af.id||l===ct.cf.id){const n=m.Ul(ct.af.id,a,f,u,d,w,-1);if(n){let r,h,o=0;l===ct.cf.id&&(o+=256),a===lt.Kc||a===lt.jc?(r=m.length,h=m.width):(r=m.width,h=m.length),s?.Rf(t,i,e,y,n,null,A,p,r,h,o)}m.Pw&&h?.Rf(i,e,m.width,m.length,a,m.Gw),-1!==m.Gl&&r.Mt(new Tt(o,t,2,i,e,bt.tn[m.Gl],!0))}else if(l>=ct.ff.id)s?.Rf(t,i,e,y,m.Ul(l,a,f,u,d,w,-1),null,A,p,1,1,0),m.Pw&&h?.Rf(i,e,m.width,m.length,a,m.Gw),-1!==m.Gl&&r.Mt(new Tt(o,t,2,i,e,bt.tn[m.Gl],!0));else if(l===ct.$c.id)s?.vf(t,i,e,y,Ot.Qm[a],0,m.Ul(ct.$c.id,a,f,u,d,w,-1),null,A,p),m.Pw&&h?.vf(i,e,l,a,m.Gw),-1!==m.Gl&&r.Mt(new Tt(o,t,0,i,e,bt.tn[m.Gl],!0));else if(l===ct.Qc.id)s?.vf(t,i,e,y,Ot.tA[a],0,m.Ul(ct.Qc.id,a,f,u,d,w,-1),null,A,p),m.Pw&&h?.vf(i,e,l,a,m.Gw),-1!==m.Gl&&r.Mt(new Tt(o,t,0,i,e,bt.tn[m.Gl],!0));else if(l===ct.tf.id){const n=a+1&3;s?.vf(t,i,e,y,Ot.Qm[a],Ot.Qm[n],m.Ul(ct.tf.id,a+4,f,u,d,w,-1),m.Ul(ct.tf.id,n,f,u,d,w,-1),A,p),m.Pw&&h?.vf(i,e,l,a,m.Gw),-1!==m.Gl&&r.Mt(new Tt(o,t,0,i,e,bt.tn[m.Gl],!0))}else if(l===ct.if.id)s?.vf(t,i,e,y,Ot.tA[a],0,m.Ul(ct.if.id,a,f,u,d,w,-1),null,A,p),m.Pw&&h?.vf(i,e,l,a,m.Gw),-1!==m.Gl&&r.Mt(new Tt(o,t,0,i,e,bt.tn[m.Gl],!0));else if(l===ct.lf.id)s?.Rf(t,i,e,y,m.Ul(l,a,f,u,d,w,-1),null,A,p,1,1,0),m.Pw&&h?.Rf(i,e,m.width,m.length,a,m.Gw),-1!==m.Gl&&r.Mt(new Tt(o,t,2,i,e,bt.tn[m.Gl],!0));else if(l===ct.ef.id)s?.Dd(t,i,e,y,0,0,A,m.Ul(ct.ef.id,lt.Vc,f,u,d,w,-1),p,512*a,Ot.Qm[a]),-1!==m.Gl&&r.Mt(new Tt(o,t,1,i,e,bt.tn[m.Gl],!0));else if(l===ct.sf.id){let n=16;if(s){const r=s.jd(t,i,e);r>0&&(n=Et.get(r>>14&32767).Vw)}s?.Dd(t,i,e,y,Ot.iA[a]*n,Ot.eA[a]*n,A,m.Ul(ct.ef.id,lt.Vc,f,u,d,w,-1),p,512*a,Ot.Qm[a]),-1!==m.Gl&&r.Mt(new Tt(o,t,1,i,e,bt.tn[m.Gl],!0))}else l===ct.nf.id?(s?.Dd(t,i,e,y,0,0,A,m.Ul(ct.ef.id,lt.Vc,f,u,d,w,-1),p,a,256),-1!==m.Gl&&r.Mt(new Tt(o,t,1,i,e,bt.tn[m.Gl],!0))):l===ct.rf.id?(s?.Dd(t,i,e,y,0,0,A,m.Ul(ct.ef.id,lt.Vc,f,u,d,w,-1),p,a,512),-1!==m.Gl&&r.Mt(new Tt(o,t,1,i,e,bt.tn[m.Gl],!0))):l===ct.hf.id&&(s?.Dd(t,i,e,y,0,0,A,m.Ul(ct.ef.id,lt.Vc,f,u,d,w,-1),p,a,768),-1!==m.Gl&&r.Mt(new Tt(o,t,1,i,e,bt.tn[m.Gl],!0)))};sc;rc;uA;dA;wA;yA;mA;AA;pA;_A;IA;gA;CA;EA;TA;bA;constructor(t,i,e,s){this.sc=t,this.rc=i,this.uA=e,this.dA=s,this.wA=new M(ut.gf,t,i),this.yA=new M(ut.gf,t,i),this.mA=new M(ut.gf,t,i),this.AA=new M(ut.gf,t,i),this.bA=new D(ut.gf,t+1,i+1),this.pA=new M(ut.gf,t+1,i+1),this._A=new k(t+1,i+1),this.IA=new Int32Array(i),this.gA=new Int32Array(i),this.CA=new Int32Array(i),this.EA=new Int32Array(i),this.TA=new Int32Array(i)}RA=(t,i)=>{for(let t=0;t=0&&i[n]?.Tf(e,s)}Ot.sA+=(5*Math.random()|0)-2,Ot.sA<-8?Ot.sA=-8:Ot.sA>8&&(Ot.sA=8),Ot.nA+=(5*Math.random()|0)-2,Ot.nA<-16?Ot.nA=-16:Ot.nA>16&&(Ot.nA=16);for(let i=0;i>8;for(let t=1;t>2)+(e[l+1][t]>>3)+(e[l][t-1]>>2)+(e[l][t+1]>>3)+(e[l][t]>>1);this._A[l][t]=u-d}for(let t=0;t=0&&s0){const i=Ct.tn[e-1];this.IA[t]+=i.bw,this.gA[t]+=i.Cw,this.CA[t]+=i.Ew,this.EA[t]+=i.Tw,n=this.TA[t]++}}const r=e-5;if(r>=0&&r0){const i=Ct.tn[e-1];this.IA[t]-=i.bw,this.gA[t]-=i.Cw,this.CA[t]-=i.Ew,this.EA[t]-=i.Tw,n=this.TA[t]--}}}if(e>=1&&e=0&&a=0&&c=1&&l0||c>0){const f=this.uA[i][e][l],u=this.uA[i][e+1][l],d=this.uA[i][e+1][l+1],w=this.uA[i][e][l+1],y=this._A[e][l],m=this._A[e+1][l],A=this._A[e+1][l+1],p=this._A[e][l+1];let _=-1,I=-1;if(a>0){const t=256*s/h|0,i=n/o|0;let e=r/o|0;_=Ct.yw(t,i,e);const l=t+Ot.sA&255;e+=Ot.nA,e<0?e=0:e>255&&(e=255),I=Ct.yw(l,i,e)}if(i>0){let t=0!==a||this.mA[i][e][l]===_t.fu;c>0&&!Ct.tn[c-1].Iw&&(t=!1),t&&f===u&&f===d&&f===w&&(this.bA[i][e][l]|=2340)}let g=0;if(-1!==_&&(g=N.palette[Ct.mw(I,96)]),0===c)t?.Ld(i,e,l,_t.fu,lt.Vc,-1,f,u,d,w,Ct.mw(_,y),Ct.mw(_,m),Ct.mw(_,A),Ct.mw(_,p),Rt.Oy,Rt.Oy,Rt.Oy,Rt.Oy,g,Rt.Oy);else{const s=this.mA[i][e][l]+1,n=this.AA[i][e][l],r=Ct.tn[c-1];let h,o,a=r.texture;a>=0?(o=N.Qi(a),h=-1):r.pw===Rt.by?(o=0,h=-2,a=-1):(h=Ct.yw(r.gw,r.Cw,r.Ew),o=N.palette[Ct.Aw(r.Rw,96)]),t?.Ld(i,e,l,s,n,a,f,u,d,w,Ct.mw(_,y),Ct.mw(_,m),Ct.mw(_,A),Ct.mw(_,p),Ct.Aw(h,y),Ct.Aw(h,m),Ct.Aw(h,A),Ct.Aw(h,p),g,o)}}}}}}for(let e=1;e0&&(t<<=3,i<<=3,e<<=3);for(let n=0;n<=s;n++)for(let r=0;r<=this.rc;r++)for(let h=0;h<=this.sc;h++){if(this.bA[n][h][r]&t){let i=r,e=r,o=n,l=n;for(;i>0&&this.bA[n][h][i-1]&t;)i--;for(;e0;){for(let s=i;s<=e;s++)if(!(this.bA[o-1][h][s]&t))break t;o--}t:for(;l=8){const n=this.uA[l][h][i]-240,r=this.uA[o][h][i];It.yd(s,1,128*h,n,128*i,128*h,r,128*e+128);for(let s=o;s<=l;s++)for(let n=i;n<=e;n++)this.bA[s][h][n]&=~t}}if(this.bA[n][h][r]&i){let t=h,e=h,o=n,l=n;for(;t>0&&this.bA[n][t-1][r]&i;)t--;for(;e0;){for(let s=t;s<=e;s++)if(!(this.bA[o-1][s][r]&i))break t;o--}t:for(;l=8){const n=this.uA[l][t][r]-240,h=this.uA[o][t][r];It.yd(s,2,128*t,n,128*r,128*e+128,h,128*r);for(let s=o;s<=l;s++)for(let n=t;n<=e;n++)this.bA[s][n][r]&=~i}}if(this.bA[n][h][r]&e){let t=h,i=h,o=r,l=r;for(;o>0&&this.bA[n][h][o-1]&e;)o--;for(;l0;){for(let i=o;i<=l;i++)if(!(this.bA[n][t-1][i]&e))break t;t--}t:for(;i=4){const r=this.uA[n][t][o];It.yd(s,4,128*t,r,128*o,128*i+128,r,128*l+128);for(let s=t;s<=i;s++)for(let t=o;t<=l;t++)this.bA[n][s][t]&=~e}}}}}};vA=(t,i,e,s)=>{let n=0;for(let t=0;t>24;break}for(let r=t;r=0&&t=0&&r{const r=new R(new Uint8Array(n));for(let n=0;n=0&&l=0&&a>24,this.AA[n][l][a]=(c-2&3)<<24>>24):c<=81?this.dA[n][l][a]=c-49<<24>>24:this.wA[n][l][a]=c-81<<24>>24}else for(;c=r.Zt,0!==c;){if(1===c){r.Zt;break}c<=49&&r.Zt}}};SA=(t,i,e,s,n,r)=>{const h=new R(new Uint8Array(s));let o=-1;for(;;){const s=h.si;if(0===s)return;o+=s;let l=0;for(;;){const s=h.si;if(0===s)break;l+=s-1;const a=63&l,c=l>>6&63,f=l>>12,u=h.Zt,d=u>>2,w=3&u,y=c+n,m=a+r;if(y>0&&m>0&&y=0&&(n=e[s]),this.Rf(f,y,m,t,i,n,o,d,w)}}}};Rf=(t,i,e,s,n,r,h,o,l)=>{if(Ot.Li){if(16&this.dA[t][i][e])return;if(this.OA(t,i,e)!==Ot.rA)return}const a=this.uA[t][i][e],c=this.uA[t][i+1][e],f=this.uA[t][i+1][e+1],u=this.uA[t][i][e+1],d=a+c+f+u>>2,w=Et.get(h);let y=i+(e<<7)+(h<<14)+1073741824|0;w.active||(y+=-2147483648),y|=0;const m=(l<<6)+o<<24>>24;if(o===ct.Jc.id)(!Ot.Li||w.active||w.ny)&&(s?.Sd(w.Ul(ct.Jc.id,l,a,c,f,u,-1),t,i,e,d,y,m),w.Pw&&w.active&&r?.Tf(i,e),-1!==w.Gl&&n.Mt(new Tt(h,t,3,i,e,bt.tn[w.Gl],!0)));else if(o===ct.af.id||o===ct.cf.id){const A=w.Ul(ct.af.id,l,a,c,f,u,-1);if(A){let n,r,h=0;if(o===ct.cf.id&&(h+=256),l===lt.Kc||l===lt.jc?(n=w.length,r=w.width):(n=w.width,r=w.length),s?.Rf(t,i,e,d,A,null,y,m,n,r,h)&&w.qw)for(let s=0;s<=n;s++)for(let n=0;n<=r;n++){let r=A.kr/4|0;r>30&&(r=30),r>this.pA[t][i+s][e+n]&&(this.pA[t][i+s][e+n]=r<<24>>24)}}w.Pw&&r?.Rf(i,e,w.width,w.length,l,w.Gw),-1!==w.Gl&&n.Mt(new Tt(h,t,2,i,e,bt.tn[w.Gl],!0))}else if(o>=ct.ff.id)s?.Rf(t,i,e,d,w.Ul(o,l,a,c,f,u,-1),null,y,m,1,1,0),o>=ct.ff.id&&o<=ct.mf.id&&o!==ct.uf.id&&t>0&&(this.bA[t][i][e]|=2340),w.Pw&&r?.Rf(i,e,w.width,w.length,l,w.Gw),-1!==w.Gl&&n.Mt(new Tt(h,t,2,i,e,bt.tn[w.Gl],!0));else if(o===ct.$c.id)s?.vf(t,i,e,d,Ot.Qm[l],0,w.Ul(ct.$c.id,l,a,c,f,u,-1),null,y,m),l===lt.Vc?(w.qw&&(this.pA[t][i][e]=50,this.pA[t][i][e+1]=50),w.Iw&&(this.bA[t][i][e]|=585)):l===lt.Kc?(w.qw&&(this.pA[t][i][e+1]=50,this.pA[t][i+1][e+1]=50),w.Iw&&(this.bA[t][i][e+1]|=1170)):l===lt.Xc?(w.qw&&(this.pA[t][i+1][e]=50,this.pA[t][i+1][e+1]=50),w.Iw&&(this.bA[t][i+1][e]|=585)):l===lt.jc&&(w.qw&&(this.pA[t][i][e]=50,this.pA[t][i+1][e]=50),w.Iw&&(this.bA[t][i][e]|=1170)),w.Pw&&r?.vf(i,e,o,l,w.Gw),-1!==w.Gl&&n.Mt(new Tt(h,t,0,i,e,bt.tn[w.Gl],!0)),16!==w.Vw&&s?.Fd(t,i,e,w.Vw);else if(o===ct.Qc.id)s?.vf(t,i,e,d,Ot.tA[l],0,w.Ul(ct.Qc.id,l,a,c,f,u,-1),null,y,m),w.qw&&(l===lt.Vc?this.pA[t][i][e+1]=50:l===lt.Kc?this.pA[t][i+1][e+1]=50:l===lt.Xc?this.pA[t][i+1][e]=50:l===lt.jc&&(this.pA[t][i][e]=50)),w.Pw&&r?.vf(i,e,o,l,w.Gw),-1!==w.Gl&&n.Mt(new Tt(h,t,0,i,e,bt.tn[w.Gl],!0));else if(o===ct.tf.id){const A=l+1&3;s?.vf(t,i,e,d,Ot.Qm[l],Ot.Qm[A],w.Ul(ct.tf.id,l+4,a,c,f,u,-1),w.Ul(ct.tf.id,A,a,c,f,u,-1),y,m),w.Iw&&(l===lt.Vc?(this.bA[t][i][e]|=265,this.bA[t][i][e+1]|=1170):l===lt.Kc?(this.bA[t][i][e+1]|=1170,this.bA[t][i+1][e]|=585):l===lt.Xc?(this.bA[t][i+1][e]|=585,this.bA[t][i][e]|=1170):l===lt.jc&&(this.bA[t][i][e]|=1170,this.bA[t][i][e]|=585)),w.Pw&&r?.vf(i,e,o,l,w.Gw),-1!==w.Gl&&n.Mt(new Tt(h,t,0,i,e,bt.tn[w.Gl],!0)),16!==w.Vw&&s?.Fd(t,i,e,w.Vw)}else if(o===ct.if.id)s?.vf(t,i,e,d,Ot.tA[l],0,w.Ul(ct.if.id,l,a,c,f,u,-1),null,y,m),w.qw&&(l===lt.Vc?this.pA[t][i][e+1]=50:l===lt.Kc?this.pA[t][i+1][e+1]=50:l===lt.Xc?this.pA[t][i+1][e]=50:l===lt.jc&&(this.pA[t][i][e]=50)),w.Pw&&r?.vf(i,e,o,l,w.Gw),-1!==w.Gl&&n.Mt(new Tt(h,t,0,i,e,bt.tn[w.Gl],!0));else if(o===ct.lf.id)s?.Rf(t,i,e,d,w.Ul(o,l,a,c,f,u,-1),null,y,m,1,1,0),w.Pw&&r?.Rf(i,e,w.width,w.length,l,w.Gw),-1!==w.Gl&&n.Mt(new Tt(h,t,2,i,e,bt.tn[w.Gl],!0));else if(o===ct.ef.id)s?.Dd(t,i,e,d,0,0,y,w.Ul(ct.ef.id,lt.Vc,a,c,f,u,-1),m,512*l,Ot.Qm[l]),-1!==w.Gl&&n.Mt(new Tt(h,t,1,i,e,bt.tn[w.Gl],!0));else if(o===ct.sf.id){let r=16;if(s){const n=s.jd(t,i,e);n>0&&(r=Et.get(n>>14&32767).Vw)}s?.Dd(t,i,e,d,Ot.iA[l]*r,Ot.eA[l]*r,y,w.Ul(ct.ef.id,lt.Vc,a,c,f,u,-1),m,512*l,Ot.Qm[l]),-1!==w.Gl&&n.Mt(new Tt(h,t,1,i,e,bt.tn[w.Gl],!0))}else o===ct.nf.id?(s?.Dd(t,i,e,d,0,0,y,w.Ul(ct.ef.id,lt.Vc,a,c,f,u,-1),m,l,256),-1!==w.Gl&&n.Mt(new Tt(h,t,1,i,e,bt.tn[w.Gl],!0))):o===ct.rf.id?(s?.Dd(t,i,e,d,0,0,y,w.Ul(ct.ef.id,lt.Vc,a,c,f,u,-1),m,l,512),-1!==w.Gl&&n.Mt(new Tt(h,t,1,i,e,bt.tn[w.Gl],!0))):o===ct.hf.id&&(s?.Dd(t,i,e,d,0,0,y,w.Ul(ct.ef.id,lt.Vc,a,c,f,u,-1),m,l,768),-1!==w.Gl&&n.Mt(new Tt(h,t,1,i,e,bt.tn[w.Gl],!0)))};OA=(t,i,e)=>8&this.dA[t][i][e]?0:t<=0||!(2&this.dA[1][i][e])?t:t-1}class vt extends w{}class Lt extends vt{x=0;z=0;xa=0;xA=!1;size=1;MA=-1;kA=-1;DA=-1;NA=-1;FA=-1;BA=-1;UA=-1;PA=null;GA=100;WA=0;YA=0;HA=0;VA=0;KA=-1e3;XA=0;jA=0;zA=-1;ZA=0;qA=0;JA=-1;$A=0;QA=0;tp=-1;ip=0;ep=0;sp=0;np=0;rp=-1;hp=0;op=0;lp=0;ap=0;cp=0;fp=0;up=0;dp=0;wp=0;yp=0;mp=0;Yi=0;height=0;Ap=0;pathLength=0;pp=new Int32Array(10);_p=new Int32Array(10);Ip=new v(10,!1);gp=0;Cp=-1;Ep=-1;Tp=-1;bp=-1;move(t,i,e){if(-1!==this.tp&&bt.tn[this.tp].priority<=1&&(this.tp=-1),!t){const t=i-this.pp[0],s=e-this._p[0];if(t>=-8&&t<=8&&s>=-8&&s<=8){this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.pp[t]=this.pp[t-1],this._p[t]=this._p[t-1],this.Ip[t]=this.Ip[t-1];return this.pp[0]=i,this._p[0]=e,void(this.Ip[0]=!1)}}this.pathLength=0,this.gp=0,this.pp[0]=i,this._p[0]=e,this.x=128*this.pp[0]+64*this.size,this.z=128*this._p[0]+64*this.size}step(t,i){let e=this.pp[0],s=this._p[0];0===i?(e--,s++):1===i?s++:2===i?(e++,s++):3===i?e--:4===i?e++:5===i?(e--,s--):6===i?s--:7===i&&(e++,s--),-1!==this.tp&&bt.tn[this.tp].priority<=1&&(this.tp=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.pp[t]=this.pp[t-1],this._p[t]=this._p[t-1],this.Ip[t]=this.Ip[t-1];this.pp[0]=e,this._p[0]=s,this.Ip[0]=t}}class St extends gt{static count=0;static tn=[];static Gh=new q(30);static en=t=>{const i=new R(t.read('spotanim.dat'));this.count=i.Jt;for(let t=0;t=40&&t<50)this.Bw[t-40]=i.Jt;else{if(!(t>=50&&t<60))throw new Error(`Unrecognized spotanim config code: ${t}`);this.Uw[t-50]=i.Jt}}Ul(){let t=St.Gh?.get(BigInt(this.id));if(t)return t;t=j.model(this.model);for(let i=0;i<6;i++)0!==this.Bw[0]&&t.rh(this.Bw[i],this.Uw[i]);return St.Gh?.put(BigInt(this.id),t),t}}class xt extends gt{static count=0;static tn=[];static en=t=>{const i=new R(t.read('idk.dat'));this.count=i.Jt;for(let t=0;t=40&&t<50)this.Bw[t-40]=i.Jt;else if(t>=50&&t<60)this.Uw[t-50]=i.Jt;else{if(!(t>=60&&t<70))throw new Error(`Unrecognized idk config code: ${t}`);this.vp[t-60]=i.Jt}}Ul(){if(!this.Nw)return null;const t=new v(this.Nw.length,null);for(let i=0;i{this.Sp=i,this.Zs=new R(t.read('obj.dat'));const e=new R(t.read('obj.idx'));this.count=e.Jt,this.Ow=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.Ow||!this.Zs)throw new Error('ObjType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Lw=(this.Lw+1)%10;const i=this.cache[this.Lw];return this.Zs.Xt=this.Ow[t],i.id=t,i.reset(),i.ww(this.Zs),-1!==i.Mp&&i.kp(),!this.Sp&&i.members&&(i.name='Members Object',i.Fw="Login to a members' server to use this object.",i.Dw=null,i.Dp=null),i};static zi=()=>{this.Gh=null,this.xp=null,this.Ow=null,this.cache=null,this.Zs=null};static Np=(t,i)=>{if(Mt.xp){let e=Mt.xp.get(BigInt(t));if(e&&e.gi!==i&&-1!==e.gi&&(e.ht(),e=null),e)return e}let e=Mt.get(t);if(e.Fp||(i=-1),e.Fp&&e.Bp&&i>1){let t=-1;for(let s=0;s<10;s++)i>=e.Bp[s]&&0!==e.Bp[s]&&(t=e.Fp[s]);-1!==t&&(e=Mt.get(t))}const s=new J(32,32),n=N.Ni,r=N.Fi,h=N.Di,o=m.ft,l=m.ut,a=m.dt,c=m.left,f=m.right,u=m.top,d=m.bottom;N.Bi=!1,m.bind(s.ft,32,32),m.fillRect(0,0,32,32,Rt.Oy),N.Zi();const w=e.Up(1),y=N.sin[e.Pp]*e.Gp>>16,A=N.cos[e.Pp]*e.Gp>>16;w.fh(0,e.Wp,e.Yp,e.Pp,e.Hp,y+(w.Nr/2|0)+e.Vp,A+e.Vp);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.ft[t+32*i]&&(t>0&&s.ft[t+32*i-1]>1||i>0&&s.ft[t+32*(i-1)]>1||t<31&&s.ft[t+32*i+1]>1||i<31&&s.ft[t+32*(i+1)]>1)&&(s.ft[t+32*i]=1);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.ft[t+32*i]&&t>0&&i>0&&s.ft[t+32*(i-1)-1]>0&&(s.ft[t+32*i]=3153952);if(-1!==e.Mp){const t=this.Np(e.Kp,10),i=t.Ii,s=t.gi;t.Ii=32,t.gi=32,t.Oi(5,5,22,22),t.Ii=i,t.gi=s}return Mt.xp?.put(BigInt(t),s),m.bind(o,l,a),m._t(c,u,f,d),N.Ni=n,N.Fi=r,N.Di=h,N.Bi=!0,e.Xp?s.Ii=33:s.Ii=32,s.gi=i,s};model=0;name=null;Fw=null;Bw=null;Uw=null;Gp=2e3;Pp=0;Wp=0;Yp=0;Hp=0;Vp=0;jp=!1;zp=-1;Xp=!1;Zp=1;members=!1;Dw=null;Dp=null;qp=-1;Jp=-1;$p=0;Qp=-1;t_=-1;i_=0;e_=-1;s_=-1;n_=-1;r_=-1;h_=-1;o_=-1;Fp=null;Bp=null;Kp=-1;Mp=-1;decode(t,i){if(1===t)this.model=i.Jt;else if(2===t)this.name=i.ni;else if(3===t)this.Fw=i.ni;else if(4===t)this.Gp=i.Jt;else if(5===t)this.Pp=i.Jt;else if(6===t)this.Wp=i.Jt;else if(7===t)this.Hp=i.$t,this.Hp>32767&&(this.Hp-=65536);else if(8===t)this.Vp=i.$t,this.Vp>32767&&(this.Vp-=65536);else if(9===t)this.jp=!0;else if(10===t)this.zp=i.Jt;else if(11===t)this.Xp=!0;else if(12===t)this.Zp=i.ti;else if(16===t)this.members=!0;else if(23===t)this.qp=i.Jt,this.$p=i.qt;else if(24===t)this.Jp=i.Jt;else if(25===t)this.Qp=i.Jt,this.i_=i.qt;else if(26===t)this.t_=i.Jt;else if(t>=30&&t<35)this.Dw||(this.Dw=new v(5,null)),this.Dw[t-30]=i.ni,'hidden'===this.Dw[t-30]?.toLowerCase()&&(this.Dw[t-30]=null);else if(t>=35&&t<40)this.Dp||(this.Dp=new v(5,null)),this.Dp[t-35]=i.ni;else if(40===t){const t=i.Zt;this.Bw=new Uint16Array(t),this.Uw=new Uint16Array(t);for(let e=0;e=100&&t<110&&(this.Fp&&this.Bp||(this.Fp=new Uint16Array(10),this.Bp=new Uint16Array(10)),this.Fp[t-100]=i.Jt,this.Bp[t-100]=i.Jt)}l_(t){let i=this.qp;if(1===t&&(i=this.Qp),-1===i)return null;let e=this.Jp,s=this.e_;1===t&&(e=this.t_,s=this.s_);let n=j.model(i);if(-1!==e){const t=j.model(e);if(-1===s){const i=[n,t];n=j.Xr(i,2)}else{const i=[n,t,j.model(s)];n=j.Xr(i,3)}}if(0===t&&0!==this.$p&&n.translate(this.$p,0,0),1===t&&0!==this.i_&&n.translate(this.i_,0,0),this.Bw&&this.Uw)for(let t=0;t1){let i=-1;for(let e=0;e<10;e++)t>=this.Bp[e]&&0!==this.Bp[e]&&(i=this.Fp[e]);if(-1!==i)return Mt.get(i).Up(1)}if(Mt.Gh){const t=Mt.Gh.get(BigInt(this.id));if(t)return t}const i=j.model(this.model);if(this.Bw&&this.Uw)for(let t=0;t=this.v_&&(this.M_=null),t>=this.O_&&t=kt.I_[i].length)&&(e=0),this.T_[i]=e}this.MA=t.Jt,65535===this.MA&&(this.MA=-1),this.kA=t.Jt,65535===this.kA&&(this.kA=-1),this.DA=t.Jt,65535===this.DA&&(this.DA=-1),this.NA=t.Jt,65535===this.NA&&(this.NA=-1),this.FA=t.Jt,65535===this.FA&&(this.FA=-1),this.BA=t.Jt,65535===this.BA&&(this.BA=-1),this.UA=t.Jt,65535===this.UA&&(this.UA=-1),this.name=$.Bh($.kh(t.ii)),this.b_=t.Zt,this.visible=!0,this.R_=0n;for(let t=0;t<12;t++)this.R_<<=0x4n,this.E_[t]>=256&&(this.R_+=BigInt(this.E_[t])-256n);this.E_[0]>=256&&(this.R_+=BigInt(this.E_[0])-256n>>4n),this.E_[1]>=256&&(this.R_+=BigInt(this.E_[1])-256n>>8n);for(let t=0;t<5;t++)this.R_<<=0x3n,this.R_+=BigInt(this.T_[t]);this.R_<<=0x1n,this.R_+=BigInt(this.g_)}Lp(){if(!this.visible)return null;const t=new v(12,null);let i=0;for(let e=0;e<12;e++){const s=this.E_[e];if(s>=256&&s<512&&(t[i++]=xt.tn[s-256].Lp()),s>=512){const e=Mt.get(s-512).Lp(this.g_);e&&(t[i++]=e)}}const e=j.Xr(t,i);for(let t=0;t<5;t++)0!==this.T_[t]&&(e.rh(kt.I_[t][0],kt.I_[t][this.T_[t]]),1===t&&e.rh(kt.__[0],kt.__[this.T_[t]]));return e}k_(){let t=this.R_,i=-1,e=-1,s=-1,n=-1;if(this.tp>=0&&0===this.sp){const r=bt.tn[this.tp];if(r.frames&&(i=r.frames[this.ip]),this.JA>=0&&this.JA!==this.MA){const t=bt.tn[this.JA].frames;t&&(e=t[this.$A])}r.Iy>=0&&(s=r.Iy,t+=BigInt(s-this.E_[5])<<8n),r.gy>=0&&(n=r.gy,t+=BigInt(n-this.E_[3])<<16n)}else if(this.JA>=0){const t=bt.tn[this.JA].frames;t&&(i=t[this.$A])}let r=kt.Gh?.get(t);if(!r){const i=new v(12,null);let e=0;for(let t=0;t<12;t++){let r=this.E_[t];if(n>=0&&3===t&&(r=n),s>=0&&5===t&&(r=s),r>=256&&r<512){const t=xt.tn[r-256].Ul();t&&(i[e++]=t)}if(r>=512){const t=Mt.get(r-512).l_(this.g_);t&&(i[e++]=t)}}r=j.Xr(i,e);for(let t=0;t<5;t++)0!==this.T_[t]&&(r.rh(kt.I_[t][0],kt.I_[t][this.T_[t]]),1===t&&r.rh(kt.__[0],kt.__[this.T_[t]]));r.Qr(),r.oh(64,850,-30,-50,-30,!0),kt.Gh?.put(t,r)}if(this.Li)return r;const h=j.Wr(r,!0);return-1!==i&&-1!==e?h.th(i,e,bt.tn[this.tp].py):-1!==i&&h.eh(i),h.Kr(),h.Hr=null,h.Yr=null,h}}class Dt extends gt{static count=0;static cache=null;static Zs=null;static Ow=null;static Lw=0;static Gh=new q(30);static en=t=>{this.Zs=new R(t.read('npc.dat'));const i=new R(t.read('npc.idx'));this.count=i.Jt,this.Ow=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.Ow||!this.Zs)throw new Error('NpcType not loaded!!!');for(let i=0;i<20;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Lw=(this.Lw+1)%20;const i=this.cache[this.Lw]=new Dt(t);return this.Zs.Xt=this.Ow[t],i.ww(this.Zs),i};static zi=()=>{this.Gh=null,this.Ow=null,this.cache=null,this.Zs=null};name=null;Fw=null;size=1;Nw=null;vp=null;Hw=!1;D_=-1;N_=-1;F_=-1;B_=-1;U_=-1;Bw=null;Uw=null;Dw=null;Jw=-1;$w=-1;Qw=-1;P_=!0;G_=-1;Rp=128;Op=128;decode(t,i){if(1===t){const t=i.Zt;this.Nw=new Uint16Array(t);for(let e=0;e=30&&t<40)this.Dw||(this.Dw=new v(5,null)),this.Dw[t-30]=i.ni,'hidden'===this.Dw[t-30]?.toLowerCase()&&(this.Dw[t-30]=null);else if(40===t){const t=i.Zt;this.Bw=new Uint16Array(t),this.Uw=new Uint16Array(t);for(let e=0;e{const i=new R(t.read('varp.dat'));this.count=i.Jt;for(let t=0;t{It.Li=!1,N.Li=!1,Ft.Li=!1,Ot.Li=!1};static II=()=>{It.Li=!0,N.Li=!0,Ft.Li=!0,Ot.Li=!0};gI=2048;CI=2047;EI=!1;TI=!1;bI=!1;RI=!1;db=null;OI=0;vI=[];stream=null;in=R.zt(1);LI=R.zt(1);SI=R.zt(1);xI=0n;MI=0;kI=0;DI=0;NI=null;FI=0;packetSize=0;BI=0;UI=0;GI=0;WI=null;YI=!0;HI=0;VI=0;KI=null;XI=null;jI=null;zI=null;ZI=null;qI=null;JI=null;$I=null;QI=null;tg=null;ig=null;eg='';sg='';username='';password='';ng=null;rg=null;hg=null;og=null;lg=[];ag=!1;cg=null;fg=null;ug=null;dg=null;wg=null;yg=null;mg=null;Ag=null;pg=null;_g=null;Ig=new Int32Array(256);gg=0;Cg=0;Eg=0;Tg=null;bg=null;Rg=null;Og=null;vg=null;Lg=null;Sg=null;xg=null;Mg=null;kg=null;Dg=null;Ng=null;Fg=null;Bg=null;Ug=null;Pg=null;Gg=null;Wg=null;Yg=null;Hg=null;Vg=null;Kg=new Int32Array(33);Xg=new Int32Array(33);jg=new Int32Array(151);zg=new Int32Array(151);Zg=null;qg=null;Jg=null;$g=null;Qg=null;tC=null;iC=new v(13,null);eC=null;sC=null;nC=new v(50,null);rC=new v(50,null);hC=new v(20,null);oC=new v(20,null);lC=null;aC=new v(8,null);cC=null;fC=null;uC=null;dC=null;wC=null;yC=null;mC=null;AC=null;pC=null;_C=null;IC=null;gC=null;CC=null;EC=null;TC=null;bC=null;RC=null;OC=null;vC=new v(1e3,null);LC=!1;SC=!1;xC=!1;MC=!1;kC=-1;DC=0;NC=0;FC=0;BC=0;UC=0;PC=0;GC=!1;WC=0;YC=0;HC=0;VC=0;KC=0;XC=0;jC=[];zC=-1;ZC=-1;qC=new Q;JC=78;$C=0;QC=0;tE=[];iE=0;eE=0;sE=0;nE=0;rE=0;hE=0;oE=0;lE=0;aE=[];cE=[];fE=[];uE=[];dE=null;wE=-1;yE=3;mE=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];AE=0;pE=0;_E=0;IE=!1;gE=0;CE=!1;EE='';TE='';bE=0;RE='';OE=!1;vE=-1;LE=new v(100,null);SE=new v(100,null);messageType=new Int32Array(100);xE=new Int32Array(100);ME=0;kE=0;DE=0;NE='';FE=0;BE=0;UE=0;PE=0;GE=0;WE=0;YE=0;HE=0;VE=0;KE=!1;XE=0;jE=0;zE=0;ZE=0;qE=null;JE=0;$E=0;QE=0;tT=0;iT=!1;eT=[];sT=[];nT=0;rT=0;hT=0;oT=null;lT=0;aT=new Int32Array(500);cT=new Int32Array(500);fT=new Int32Array(500);uT=new Int32Array(500);dT=0;wT=0;yT=0;mT='';AT=!1;pT=-1;_T=0;IT=0;gT=0;CT=0;ET=0;TT=new Int32Array(1e3);bT=new Int32Array(1e3);RT=null;OT=0;vT=0;LT=0;ST=0;xT=0;MT=!1;kT=0;DT=0;NT=0;FT=0;BT=2;UT=2;PT=1;GT=new Int32Array(5);WT=new v(5,!1);YT=new Int32Array(5);HT=new Int32Array(5);VT=new Int32Array(5);KT=0;XT=0;jT=0;zT=0;ZT=0;qT=0;JT=0;$T=0;QT=0;tb=1;ib=2;eb=-1;$n=0;tr=0;sb=0;nb=0;rb=0;hb=0;ob=null;lb=null;ab=null;cb=0;fb=0;ub=new Int8Array(16384);wb=new v(ut.gf,null);yb=0;mb=0;Ab=128;pb=0;_b=0;Ib=0;gb=0;Cb=0;uA=null;dA=null;Eb=new k(ut.Cf,ut.Cf);Tb=0;bb=0;Rb=0;Ob=0;vb=0;Lb=0;Sb=0;xb=0;Mb=0;kb=0;Db=0;Nb=0;Fb=new v(this.gI,null);Bb=0;Ub=new Int32Array(this.gI);Pb=0;Gb=0;Wb=new Int32Array(this.gI);Yb=new Int32Array(1e3);Hb=new v(this.gI,null);Vb=new v(8192,null);Kb=0;Xb=new Int32Array(8192);jb=new b;zb=new b;Zb=new b;_d=new b;qb=new S(ut.gf,ut.Cf,ut.Cf,null);Jb=new b;$b=new Int32Array(4e3);Qb=new Int32Array(4e3);tR=new Int32Array(ut.Cf*ut.Cf);iR=new Int32Array(ut.Cf*ut.Cf);eR=0;sR=null;nR=0;rR=0;hR=-1;oR=0;lR=0;aR=0;cR=0;fR=!1;uR=!0;dR=!1;wR=new Int32Array(7);yR=new Int32Array(5);mR=0;AR=0;static pR=50;_R=new Int32Array(Ft.pR);IR=new Int32Array(Ft.pR);gR=new Int32Array(Ft.pR);CR=new Int32Array(Ft.pR);ER=new Int32Array(Ft.pR);TR=new Int32Array(Ft.pR);bR=new Int32Array(Ft.pR);RR=new v(Ft.pR,null);OR=new v(100,null);vR=new BigInt64Array(100);LR=new Int32Array(100);SR=null;xR=0;MR=!0;kR=new Int32Array(50);DR=new Int32Array(50);NR=new Int32Array(50);FR=192;BR=-1;UR=-1;PR=0;GR=0;WR=0;YR=!0;HR=null;VR=0;KR=0;XR=192;jR=new v(16,null);zR=0;ZR=!1;zi=()=>{try{this.stream&&this.stream.close()}catch(t){}this.stream=null,window._tinyMidiStop&&window._tinyMidiStop(),this.LI=null,this.SI=null,this.in=null,this.ab=null,this.ob=null,this.lb=null,this.uA=null,this.dA=null,this.RT=null,this.wb=null,this.tR=null,this.iR=null,this.$b=null,this.Qb=null,this.ub=null,this.bg=null,this.Rg=null,this.Og=null,this.vg=null,this.Lg=null,this.Sg=null,this.xg=null,this.Mg=null,this.kg=null,this.Dg=null,this.Ng=null,this.Fg=null,this.Bg=null,this.Ug=null,this.Pg=null,this.Gg=null,this.Wg=null,this.Zg=null,this.Jg=null,this.qg=null,this.$g=null,this.Qg=null,this.tC=null,this.iC=null,this.mC=null,this.AC=null,this.pC=null,this._C=null,this.IC=null,this.gC=null,this.CC=null,this.EC=null,this.TC=null,this.bC=null,this.sC=null,this.hC=null,this.oC=null,this.aC=null,this.cC=null,this.fC=null,this.uC=null,this.dC=null,this.nC=null,this.rC=null,this.Eb=null,this.Fb=null,this.Ub=null,this.Wb=null,this.Hb=null,this.Yb=null,this.Vb=null,this.Xb=null,this.qb=null,this.Jb=null,this._d=null,this.jb=null,this.zb=null,this.Zb=null,this.fT=null,this.uT=null,this.aT=null,this.cT=null,this.jC=null,this.eT=null,this.TT=null,this.bT=null,this.vC=null,this.eC=null,this.OR=null,this.vR=null,this.LR=null,this.zI=null,this.ZI=null,this.KI=null,this.XI=null,this.jI=null,this.qI=null,this.JI=null,this.$I=null,this.QI=null,this.qR(),Et.zi(),Dt.zi(),Mt.zi(),Ct.tn=null,xt.tn=null,Q.tn=null,bt.tn=null,St.tn=null,St.Gh=null,Nt.tn=null,this.ke=null,kt.Gh=null,N.zi(),It.zi(),j.zi(),H.tn=[],V.tn=[]};Ds(){return this.HI}Ms(){return this.OE}ks(){return this.CE}xs(){return this.ZC}Ss(){return this.kC}qR=()=>{this.ag=!1,this.Tg&&(clearInterval(this.Tg),this.Tg=null),this.tg=null,this.ig=null,this.lg=[],this.mg=null,this.Ag=null,this.pg=null,this._g=null,this.dg=null,this.ug=null,this.wg=null,this.yg=null,this.cg=null,this.fg=null};JR=async(t,i,e,s)=>{let n=5,r=await(this.db?.Bs(t));if(r&&R.Kt(r)!==e&&(r=void 0),r)return new W(r);for(;!r;){await this.ws(s,`Requesting ${i}`);try{r=await T(`${Ft.J_}/${t}${e}`)}catch(t){r=void 0;for(let t=n;t>0;t--)await this.ws(s,`Error loading - Will retry in ${t} secs.`),await E(1e3);n*=2,n>60&&(n=60)}}return await(this.db?.Us(t,r)),new W(r)};$R=async(t,e,s)=>{let n=await(this.db?.Bs(t+'.mid'));if(n&&12345678!==e&&R.Kt(n)!==e&&(n=void 0),!n)try{n=await T(`${Ft.J_}/${t}_${e}.mid`),s!==n.length&&(n=n.slice(0,s))}catch(t){}if(!n)return;await(this.db?.Us(t+'.mid',n));const r=new R(Uint8Array.from(n)).ti;!function(t,i){window._tinyMidiPlay&&window._tinyMidiPlay(t,i/256)}(i.read(r,n,s,4),this.XR)};QR=()=>{if(p.fillStyle='black',p.fillRect(0,0,this.width,this.height),this.As(1),this.bI){this.ag=!1,p.font='bold 16px helvetica, sans-serif',p.textAlign='left',p.fillStyle='yellow';let t=35;p.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,p.fillStyle='white',p.fillText('To fix this try the following (in order):',30,t),t+=50,p.font='bold 12px helvetica, sans-serif',p.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,p.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,p.fillText('3: Try using a different game-world',30,t),t+=30,p.fillText('4: Try rebooting your computer',30,t),t+=30,p.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.RI&&(this.ag=!1,p.font='bold 20px helvetica, sans-serif',p.textAlign='left',p.fillStyle='white',p.fillText('Error - unable to load game!',50,50),p.fillText('To play RuneScape make sure you play from',50,100),p.fillText('https://2004scape.org',50,150)),this.TI){this.ag=!1,p.font='bold 13px helvetica, sans-serif',p.textAlign='left',p.fillStyle='yellow';let t=35;p.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,p.fillStyle='white',p.fillText('To fix this try the following (in order):',30,t),t+=50,p.font='bold 12px helvetica, sans-serif',p.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,p.fillText('2: Try rebooting your computer, and reloading',30,t)}};tO=t=>{if(!t.wl)return!1;for(let i=0;i=s)return!1}else if(3===t.wl[i]){if(e<=s)return!1}else if(4===t.wl[i]){if(e===s)return!1}else if(e!==s)return!1}return!0};eO=(t,i,e,s,n)=>{this.wC?.draw(t,i),this.yC?.draw(t,i+n-16),m.fillRect(t,i+16,16,n-32,Rt.Py);let r=(n-32)*n/s|0;r<8&&(r=8);const h=(n-r-32)*e/(s-n)|0;m.fillRect(t,i+h+16,16,r,Rt.Gy),m.Et(t,i+h+16,Rt.Wy,r),m.Et(t+1,i+h+16,Rt.Wy,r),m.Ct(t,i+h+16,Rt.Wy,16),m.Ct(t,i+h+17,Rt.Wy,16),m.Et(t+15,i+h+16,Rt.Yy,r),m.Et(t+14,i+h+17,Rt.Yy,r-1),m.Ct(t,i+h+r+15,Rt.Yy,16),m.Ct(t+1,i+h+r+14,Rt.Yy,15)};sO=(t,i)=>{let e=!1;const s=Q.tn[t];if(!s.ml)return!1;for(let t=0;ts.delay[n.zl];)n.Zl-=s.delay[n.zl]+1,n.zl++,n.zl>=s.my&&(n.zl-=s.yy,(n.zl<0||n.zl>=s.my)&&(n.zl=0)),e=!0}}}return e};nO=(t,i,e,s,n=!1)=>{if(0!==t.type||!t.ml||t.hide&&this.FE!==t.id&&this.BE!==t.id&&this.UE!==t.id)return;const r=m.left,h=m.top,o=m.right,l=m.bottom;m._t(i,e,i+t.width,e+t.height);const a=t.ml.length;for(let r=0;r0&&this.rO(l),l.type===Q.Wh)l.jl>l.scroll-l.height&&(l.jl=l.scroll-l.height),l.jl<0&&(l.jl=0),this.nO(l,h,o,l.jl,n),l.scroll>l.height&&this.eO(h+l.width,o,l.jl,l.scroll,l.height);else if(l.type===Q.Hh){let t=0;for(let i=0;i0){let i=0,e=0;const r=l._l[t]-1;if(s>=-32&&s<=512&&n>=-32&&n<=334||0!==this.WE&&this.GE===t){const h=Mt.Np(r,l.Il[t]);if(0!==this.WE&&this.GE===t&&this.PE===l.id?(i=this.Xe-this.YE,e=this.je-this.HE,i<5&&i>-5&&(i=0),e<5&&e>-5&&(e=0),this.VE<5&&(i=0,e=0),h.Eh(128,s+i,n+e)):0!==this.JE&&this.$E===t&&this.QE===l.id?h.Eh(128,s,n):h.draw(s,n),33===h.Ii||1!==l.Il[t]){const r=l.Il[t];this.ng?.hO(s+i+1,n+10+e,this.oO(r),Rt.Oy),this.ng?.hO(s+i,n+9+e,this.oO(r),Rt.Ey)}}}else if(l.Ol&&t<20){const i=l.Ol[t];i?.draw(s,n)}t++}}else if(l.type===Q.Vh)l.fill?m.fillRect(h,o,l.width,l.height,l.kl):m.gt(h,o,l.width,l.height,l.kl);else if(l.type===Q.Kh){const t=l.font;let i=l.kl,e=l.text;if(this.UE!==l.id&&this.BE!==l.id&&this.FE!==l.id||0===l.Nl||(i=l.Nl),this.tO(l)&&(i=l.Dl,l.Ml&&l.Ml.length>0&&(e=l.Ml)),l.fl===Q.io&&this.iT&&(e='Please wait...',i=l.kl),!t||!e)continue;for(let s=o+t.height;e.length>0;s+=t.height){if(-1!==e.indexOf('%')){for(;;){const t=e.indexOf('%1');if(-1===t)break;e=e.substring(0,t)+this.lO(this.iO(l,0))+e.substring(t+2)}for(;;){const t=e.indexOf('%2');if(-1===t)break;e=e.substring(0,t)+this.lO(this.iO(l,1))+e.substring(t+2)}for(;;){const t=e.indexOf('%3');if(-1===t)break;e=e.substring(0,t)+this.lO(this.iO(l,2))+e.substring(t+2)}for(;;){const t=e.indexOf('%4');if(-1===t)break;e=e.substring(0,t)+this.lO(this.iO(l,3))+e.substring(t+2)}for(;;){const t=e.indexOf('%5');if(-1===t)break;e=e.substring(0,t)+this.lO(this.iO(l,4))+e.substring(t+2)}}const n=e.indexOf('\\n');let r;-1!==n?(r=e.substring(0,n),e=e.substring(n+2)):(r=e,e=''),l.Sl?t.aO(h+(l.width/2|0),s,r,i,l.xl):t.cO(h,s,r,i,l.xl)}}else if(l.type===Q.Xh){let t;t=this.tO(l)?l.Bl:l.Fl,t?.draw(h,o)}else if(l.type===Q.jh){const t=N.Ni,i=N.Fi;N.Ni=h+(l.width/2|0),N.Fi=o+(l.height/2|0);const e=N.sin[l.Yl]*l.zoom>>16,s=N.cos[l.Yl]*l.zoom>>16,n=this.tO(l);let r;r=n?l.Wl:l.Gl;let a=null;if(-1===r)a=l.Ul(-1,-1,n);else{const t=bt.tn[r];t.frames&&t.Ay&&(a=l.Ul(t.frames[l.zl],t.Ay[l.zl],n))}a&&a.fh(0,l.Hl,0,l.Yl,0,e,s),N.Ni=t,N.Fi=i}else if(l.type===Q.zh){const t=l.font;if(!t||!l._l||!l.Il)continue;let i=0;for(let e=0;e0){const n=Mt.get(l._l[i]-1);let r=n.name;if((n.Xp||1!==l.Il[i])&&(r=r+' x'+this.fO(l.Il[i])),!r)continue;const a=h+s*(l.El+115),c=o+e*(l.Tl+12);l.Sl?t.aO(a+(l.width/2|0),c,r,l.kl,l.xl):t.cO(a,c,r,l.kl,l.xl)}i++}}}m._t(r,h,o,l)};rO=t=>{let i=t.ul;if(i>=Q.eo&&i<=Q.so)i--,i>=this.mR?(t.text='',t.fl=0):(t.text=this.OR[i],t.fl=1);else if(i>=Q.no&&i<=Q.ro)i-=Q.no,i>=this.mR?(t.text='',t.fl=0):(0===this.LR[i]?t.text='@red@Offline':this.LR[i]===Ft.Z_?t.text='@gre@World-'+(this.LR[i]-9):t.text='@yel@World-'+(this.LR[i]-9),t.fl=1);else if(i===Q.lo)t.scroll=15*this.mR+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i>=Q.Po&&i<=Q.Go)i-=Q.Po,i>=this.QC?(t.text='',t.fl=0):(t.text=$.Bh($.kh(this.tE[i])),t.fl=1);else if(i===Q.Ho)t.scroll=15*this.QC+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i===Q.Uo){if(t.Yl=150,t.Hl=256*Math.sin(this.OI/40)&2047,this.dR){this.dR=!1;const i=new v(7,null);let e=0;for(let t=0;t<7;t++){const s=this.wR[t];s>=0&&(i[e++]=xt.tn[s].Ul())}const s=j.Xr(i,e);for(let t=0;t<5;t++)0!==this.yR[t]&&(s.rh(kt.I_[t][0],kt.I_[t][this.yR[t]]),1===t&&s.rh(kt.__[0],kt.__[this.yR[t]]));if(this.sR){const i=bt.tn[this.sR.MA].frames;i&&(s.Qr(),s.eh(i[0]),s.oh(64,850,-30,-50,-30,!0),t.model=s)}}}else if(i===Q.No)this.RC||(this.RC=t.Fl,this.OC=t.Bl),this.uR?t.Fl=this.OC:t.Fl=this.RC;else if(i===Q.Fo)this.RC||(this.RC=t.Fl,this.OC=t.Bl),this.uR?t.Fl=this.RC:t.Fl=this.OC;else if(i===Q.Vo)t.text=this.mT,this.OI%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(i===Q.sl)this.fR?this.AT?(t.kl=Rt.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.kl=Rt.Ry,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(i===Q.nl||i===Q.al)if(0===this._T)t.text='';else{let i;i=0===this.IT?'earlier today':1===this.IT?'yesterday':this.IT+' days ago',t.text='You last logged in '+i+' from: '+$.Fh(this._T)}else if(i===Q.rl)0===this.CT&&(t.text='0 unread messages',t.kl=Rt.Ey),1===this.CT&&(t.text='1 unread message',t.kl=Rt.GREEN),this.CT>1&&(t.text=this.CT+' unread messages',t.kl=Rt.GREEN);else if(i===Q.hl)if(201===this.gT)t.text='';else if(200===this.gT)t.text='You have not yet set any password recovery questions.';else{let i;i=0===this.gT?'Earlier today':1===this.gT?'Yesterday':this.gT+' days ago',t.text=i+' you changed your recovery questions'}else i===Q.ol?201===this.gT?t.text='':200===this.gT?t.text='We strongly recommend you do so now to secure your account.':t.text='If you do not remember making this change then cancel it immediately':i===Q.ll&&(201===this.gT?t.text='':(this.gT,t.text="Do this from the 'account management' area on our front webpage"))};iO=(t,i)=>{if(!t.scripts||i>=t.scripts.length)return-2;try{const e=t.scripts[i];if(!e)return-1;let s=0,n=0;for(;;){const t=e[n++];if(0===t)return s;if(1===t)s+=this.cE[e[n++]];else if(2===t)s+=this.fE[e[n++]];else if(3===t)s+=this.aE[e[n++]];else if(4===t){const t=Q.tn[e[n++]],i=e[n++]+1;if(t._l&&t.Il)for(let e=0;et<999999999?String(t):'*';fO=t=>{let i=String(t);for(let t=i.length-3;t>0;t-=3)i=i.substring(0,t)+','+i.substring(t);return i.length>8?i='@gre@'+i.substring(0,i.length-8)+' million @whi@('+i+')':i.length>4&&(i='@cya@'+i.substring(0,i.length-4)+'K @whi@('+i+')'),' '+i};oO=t=>t<1e5?String(t):t<1e7?(t/1e3|0)+'K':(t/1e6|0)+'M'}(new class extends Ft{EI=!1;TI=!1;bI=!1;RI=!1;uO=null;dO=null;wO=null;yO=null;mO=null;AO=null;Fu=0;Bu=0;Uu=0;pO=0;_O=0;IO=2;model={id:parseInt(P.getParameter('model'))||0,gO:null,x:0,y:0,z:420,xa:0};CO=null;constructor(){super(!0)}load=async()=>{if(this.EI)this.TI=!0;else{this.EI=!0;try{await async function(t){if(o||h)return;o=!0;const i=await r(t);h||(h=i)}(),await i.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new G(await G.openDatabase()),this.uO=document.getElementById('rightPanel');const t=document.getElementById('mainPanel');t&&(t.ondragover=t=>{t.preventDefault(),t.stopPropagation()},t.ondrop=async t=>{if(t.preventDefault(),t.stopPropagation(),!t.dataTransfer||!t.dataTransfer.files.length)return;const i=['main_file_cache.dat','main_file_cache.idx0','main_file_cache.idx1','main_file_cache.idx2','main_file_cache.idx3','main_file_cache.idx4'],e=[];for(let s=0;s{this.TI||this.bI||this.RI||(this.EO(),this.TO())};draw=async()=>{this.TI||this.bI||this.RI?this.QR():(j.nr=!0,j.Xe=this.Xe,j.je=this.je,this.ke?.bind(),m.clear(),m.fillRect(0,0,this.width,this.height,Rt.Oy),null!==this.model.gO&&(this.model.gO.draw(this.model.xa,N.sin[this.pO],N.cos[this.pO],N.sin[this._O],N.cos[this._O],this.model.x-this.Fu,this.model.y-this.Bu,this.model.z-this.Uu,0),-1!==this.model.gO.qr&&this.model.gO.mh(this.model.gO.qr)),this.ke?.draw(0,0),this.CO?.draw(this.Xe,this.je))};init=async()=>{const t=await(this.db?.Bs('main_file_cache.dat'));if(!t){return document.getElementById('helpme').style.display='block',void(A.style.display='none')}const i=await(this.db?.Bs('main_file_cache.idx0')),e=await(this.db?.Bs('main_file_cache.idx1')),s=await(this.db?.Bs('main_file_cache.idx2')),n=await(this.db?.Bs('main_file_cache.idx3')),r=await(this.db?.Bs('main_file_cache.idx4'));if(!(i&&e&&s&&n&&r)){return document.getElementById('helpme').style.display='block',void(A.style.display='none')}document.getElementById('helpme').style.display='none',A.style.display='block',this.dO=new Y(t,i,0),this.wO=new Y(t,e,1),this.yO=new Y(t,s,2),this.mO=new Y(t,n,3),this.AO=new Y(t,r,4),await this.ws(10,'Unpacking textures');const h=this.dO.read(6);N.$i(h),N.ie(.8),N.se(20),await this.ws(20,'Loading models...');for(let t=0;t{this.model.id=i,this.bO(i)},t.appendChild(e)}}await this.ws(80,'Finishing up...'),this.CO=new C(512,128),this.CO.bind();for(let t=0;t<512;t++)for(let i=0;i<128;i++){const e=t,s=127-i;m.Ot(e,s,N.palette[i+128*t])}this.CO.draw(0,0)};bO(t){if(null===this.wO)return;const i=this.wO.read(t);null!==i?(this.model.gO=j.jr(i,t),this.model.gO.oh(64,850,-30,-50,-30,!0),document.title=`Model ${t} | 2004Scape Tools`):document.title=`Missing model ${t} | 2004Scape Tools`}EO(){for(;;){const t=this._s();if(-1===t)break;t==='r'.charCodeAt(0)?(this.IO=2,this.Fu=0,this.Bu=0,this.Uu=0,this.pO=0,this._O=0,this.model.x=0,this.model.y=0,this.model.z=420,this.model.xa=0):t==='1'.charCodeAt(0)?(this.model.id--,j.metadata&&this.model.id<0&&(this.model.id=j.metadata.length-1),this.bO(this.model.id)):t==='2'.charCodeAt(0)&&(this.model.id++,j.metadata&&this.model.id>=j.metadata.length&&(this.model.id=0),this.bO(this.model.id))}}TO(){this.Je['['.charCodeAt(0)]?this.IO--:this.Je[']'.charCodeAt(0)]&&this.IO++,this.Je[1]?this.model.xa+=this.IO:this.Je[2]&&(this.model.xa-=this.IO),this.Je['w'.charCodeAt(0)]?this.model.z-=this.IO:this.Je['s'.charCodeAt(0)]&&(this.model.z+=this.IO),this.Je['a'.charCodeAt(0)]?this.model.x-=this.IO:this.Je['d'.charCodeAt(0)]&&(this.model.x+=this.IO),this.Je['q'.charCodeAt(0)]?this.model.y-=this.IO:this.Je['e'.charCodeAt(0)]&&(this.model.y+=this.IO),this.pO=2047&this.pO,this._O=2047&this._O,this.model.xa=2047&this.model.xa}}).us().then((()=>{}))})()})(); \ No newline at end of file diff --git a/index.js b/index.js index 8769aa95..d190ffe6 100644 --- a/index.js +++ b/index.js @@ -1 +1 @@ -(()=>{"use strict";var t,i,s,h,e={1651:(t,i,s)=>{s.d(i,{K:()=>k});var h=s(1120),e=s(4583),n=s(2901),r=s(1069),o=s(7046),l=(s(9896),s(6666)),a=s(3045),c=s(818),f=s(670),u=s(8268),d=s(3867),w=s(7854),A=s(8950),y=s(1302),p=s(9298),m=s(8665),I=s(1312),_=s(3819),E=s(8317),g=s(9234),C=s(1908),T=s(123),O=s(5637),b=s(6948),v=s(2164),L=s(8738),R=s(3764),S=s(8534),M=s(6730);class k extends o.A{static tt=225;static it=10;static portOffset=0;static members=!0;static st=!1;static ht='';static et='';static nt=!1;static rt=2;static ot=!1;static lt='https://raw.githubusercontent.com/2004scape/Server/main';static exponent=58778699976184461502525193738213253649000149147835990136706041084440742975821n;static ct=7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789n;static ft=0;static ut=0;static dt=0;static wt=0;static At=0;static yt=0;static It=0;static _t=0;static Et=0;static gt=0;static Ct=0;static Tt=0;static Ot=0;static bt=0;static vt=0;static Lt=()=>{a.A.st=!1,e.A.st=!1,k.st=!1,c.A.st=!1};static Rt=()=>{a.A.st=!0,e.A.st=!0,k.st=!0,c.A.st=!0};St=2048;Mt=2047;kt=!1;xt=!1;Dt=!1;Nt=!1;db=null;Pt=0;Ft=[];stream=null;in=r.A.Ut(1);Bt=r.A.Ut(1);Gt=r.A.Ut(1);Ht=0n;Wt=0;Yt=0;Vt=0;Kt=null;Xt=0;packetSize=0;zt=0;jt=0;Zt=0;qt=null;$t=!0;Jt=0;Qt=0;ti=null;ii=null;si=null;hi=null;ei=null;ni=null;ri=null;oi=null;li=null;ai=null;ci=null;fi='';ui='';username='';password='';di=null;wi=null;Ai=null;yi=null;pi=[];mi=!1;Ii=null;_i=null;Ei=null;gi=null;Ci=null;Ti=null;Oi=null;bi=null;vi=null;Li=null;Ri=new Int32Array(256);Si=0;Mi=0;ki=0;xi=null;Di=null;Ni=null;Pi=null;Fi=null;Ui=null;Bi=null;Gi=null;Hi=null;Wi=null;Yi=null;Vi=null;Ki=null;Xi=null;zi=null;ji=null;Zi=null;qi=null;$i=null;Ji=null;Qi=null;ts=new Int32Array(33);ss=new Int32Array(33);hs=new Int32Array(151);es=new Int32Array(151);ns=null;rs=null;os=null;ls=null;cs=null;fs=null;us=new d.ds(13,null);ws=null;As=null;ys=new d.ds(50,null);ps=new d.ds(50,null);Is=new d.ds(20,null);_s=new d.ds(20,null);Es=null;gs=new d.ds(8,null);Cs=null;Ts=null;Os=null;bs=null;vs=null;Ls=null;Rs=null;Ss=null;Ms=null;ks=null;xs=null;Ds=null;Ns=null;Ps=null;Fs=null;Us=null;Bs=null;Gs=null;Hs=new d.ds(1e3,null);Ws=!1;Ys=!1;Vs=!1;Ks=!1;Xs=-1;zs=0;js=0;Zs=0;qs=0;$s=0;Js=0;Qs=!1;th=0;ih=0;sh=0;hh=0;eh=0;nh=0;rh=[];oh=-1;lh=-1;ah=new h.A;fh=78;uh=0;dh=0;wh=[];Ah=0;yh=0;ph=0;mh=0;Ih=0;_h=0;Eh=0;gh=0;Ch=[];Th=[];Oh=[];bh=[];Lh=null;Rh=-1;Sh=3;Mh=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];kh=0;xh=0;Dh=0;Nh=!1;Ph=0;Fh=!1;Uh='';Bh='';Gh=0;Hh='';Wh=!1;Yh=-1;Vh=new d.ds(100,null);Kh=new d.ds(100,null);messageType=new Int32Array(100);Xh=new Int32Array(100);zh=0;jh=0;Zh=0;qh='';$h=0;Jh=0;Qh=0;te=0;ie=0;se=0;he=0;ee=0;ne=0;re=!1;oe=0;le=0;ae=0;ce=0;fe=null;ue=0;de=0;we=0;Ae=0;ye=!1;pe=[];me=[];Ie=0;_e=0;Ee=0;ge=null;Ce=0;Te=new Int32Array(500);Oe=new Int32Array(500);be=new Int32Array(500);ve=new Int32Array(500);Le=0;Re=0;Se=0;Me='';ke=!1;xe=-1;De=0;Ne=0;Pe=0;Fe=0;Ue=0;Be=new Int32Array(1e3);Ge=new Int32Array(1e3);He=null;We=0;Ye=0;Ve=0;Ke=0;Xe=0;ze=!1;je=0;Ze=0;qe=0;$e=0;Je=2;Qe=2;tn=1;sn=new Int32Array(5);hn=new d.ds(5,!1);en=new Int32Array(5);nn=new Int32Array(5);rn=new Int32Array(5);ln=0;an=0;cn=0;fn=0;un=0;dn=0;wn=0;An=0;yn=0;pn=1;mn=2;In=-1;_n=0;En=0;gn=0;Cn=0;Tn=0;On=0;bn=null;vn=null;Ln=null;Rn=0;Sn=0;Mn=new Int8Array(16384);kn=new d.ds(f.A.xn,null);Dn=0;Nn=0;Pn=128;Fn=0;Un=0;Bn=0;Gn=0;Hn=0;Wn=null;Yn=null;Vn=new d.Kn(f.A.Xn,f.A.Xn);zn=0;jn=0;Zn=0;qn=0;$n=0;Jn=0;Qn=0;tr=0;ir=0;sr=0;hr=0;er=0;nr=new d.ds(this.St,null);rr=0;lr=new Int32Array(this.St);ar=0;cr=0;ur=new Int32Array(this.St);dr=new Int32Array(1e3);wr=new d.ds(this.St,null);Ar=new d.ds(8192,null);yr=0;pr=new Int32Array(8192);mr=new l.A;Ir=new l.A;_r=new l.A;Er=new l.A;gr=new d.Cr(f.A.xn,f.A.Xn,f.A.Xn,null);Tr=new l.A;Or=new Int32Array(4e3);br=new Int32Array(4e3);vr=new Int32Array(f.A.Xn*f.A.Xn);Lr=new Int32Array(f.A.Xn*f.A.Xn);Rr=0;Sr=null;Mr=0;kr=0;Dr=-1;Nr=0;Pr=0;Fr=0;Ur=0;Br=!1;Gr=!0;Hr=!1;Wr=new Int32Array(7);Yr=new Int32Array(5);Vr=0;Kr=0;static Xr=50;zr=new Int32Array(k.Xr);jr=new Int32Array(k.Xr);Zr=new Int32Array(k.Xr);qr=new Int32Array(k.Xr);$r=new Int32Array(k.Xr);Jr=new Int32Array(k.Xr);Qr=new Int32Array(k.Xr);io=new d.ds(k.Xr,null);so=new d.ds(100,null);ho=new BigInt64Array(100);eo=new Int32Array(100);no=null;ro=0;oo=!0;lo=new Int32Array(50);ao=new Int32Array(50);co=new Int32Array(50);fo=192;uo=-1;do=-1;wo=0;Ao=0;yo=0;po=!0;mo=null;Io=0;_o=0;Eo=192;Co=new d.ds(16,null);To=0;Oo=!1;bo=()=>{try{this.stream&&this.stream.close()}catch(t){}this.stream=null,(0,T.vo)(),this.Bt=null,this.Gt=null,this.in=null,this.Ln=null,this.bn=null,this.vn=null,this.Wn=null,this.Yn=null,this.He=null,this.kn=null,this.vr=null,this.Lr=null,this.Or=null,this.br=null,this.Mn=null,this.Di=null,this.Ni=null,this.Pi=null,this.Fi=null,this.Ui=null,this.Bi=null,this.Gi=null,this.Hi=null,this.Wi=null,this.Yi=null,this.Vi=null,this.Ki=null,this.Xi=null,this.zi=null,this.ji=null,this.Zi=null,this.qi=null,this.ns=null,this.os=null,this.rs=null,this.ls=null,this.cs=null,this.fs=null,this.us=null,this.Rs=null,this.Ss=null,this.Ms=null,this.ks=null,this.xs=null,this.Ds=null,this.Ns=null,this.Ps=null,this.Fs=null,this.Us=null,this.As=null,this.Is=null,this._s=null,this.gs=null,this.Cs=null,this.Ts=null,this.Os=null,this.bs=null,this.ys=null,this.ps=null,this.Vn=null,this.nr=null,this.lr=null,this.ur=null,this.wr=null,this.dr=null,this.Ar=null,this.pr=null,this.gr=null,this.Tr=null,this.Er=null,this.mr=null,this.Ir=null,this._r=null,this.be=null,this.ve=null,this.Te=null,this.Oe=null,this.rh=null,this.pe=null,this.Be=null,this.Ge=null,this.Hs=null,this.ws=null,this.so=null,this.ho=null,this.eo=null,this.hi=null,this.ei=null,this.ti=null,this.ii=null,this.si=null,this.ni=null,this.ri=null,this.oi=null,this.li=null,this.Lo(),O.A.bo(),b.A.bo(),y.A.bo(),v.A.Ro=null,E.A.Ro=null,h.A.Ro=null,I.A.Ro=null,L.A.Ro=null,L.A.So=null,R.A.Ro=null,this.Mo=null,u.A.So=null,e.A.bo(),a.A.bo(),m.A.bo(),S.A.Ro=[],M.A.Ro=[]};ko(){return this.Jt}xo(){return this.Wh}Do(){return this.Fh}No(){return this.lh}Po(){return this.Xs}Lo=()=>{this.mi=!1,this.xi&&(clearInterval(this.xi),this.xi=null),this.ai=null,this.ci=null,this.pi=[],this.Oi=null,this.bi=null,this.vi=null,this.Li=null,this.gi=null,this.Ei=null,this.Ci=null,this.Ti=null,this.Ii=null,this._i=null};Fo=async(t,i,s,h)=>{let e=5,o=await(this.db?.Uo(t));if(o&&r.A.Bo(o)!==s&&(o=void 0),o)return new n.A(o);for(;!o;){await this.Go(h,`Requesting ${i}`);try{o=await(0,g.Ho)(`${k.et}/${t}${s}`)}catch(t){o=void 0;for(let t=e;t>0;t--)await this.Go(h,`Error loading - Will retry in ${t} secs.`),await(0,g.Wo)(1e3);e*=2,e>60&&(e=60)}}return await(this.db?.Yo(t,o)),new n.A(o)};Vo=async(t,i,s)=>{let h=await(this.db?.Uo(t+'.mid'));if(h&&12345678!==i&&r.A.Bo(h)!==i&&(h=void 0),!h)try{h=await(0,g.Ho)(`${k.et}/${t}_${i}.mid`),s!==h.length&&(h=h.slice(0,s))}catch(t){}if(!h)return;await(this.db?.Yo(t+'.mid',h));const e=new r.A(Uint8Array.from(h)).Ko,n=C.A.read(e,h,s,4);(0,T.Xo)(n,this.Eo)};zo=()=>{if(w.jo.fillStyle='black',w.jo.fillRect(0,0,this.width,this.height),this.Zo(1),this.Dt){this.mi=!1,w.jo.font='bold 16px helvetica, sans-serif',w.jo.textAlign='left',w.jo.fillStyle='yellow';let t=35;w.jo.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,w.jo.fillStyle='white',w.jo.fillText('To fix this try the following (in order):',30,t),t+=50,w.jo.font='bold 12px helvetica, sans-serif',w.jo.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.jo.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,w.jo.fillText('3: Try using a different game-world',30,t),t+=30,w.jo.fillText('4: Try rebooting your computer',30,t),t+=30,w.jo.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.Nt&&(this.mi=!1,w.jo.font='bold 20px helvetica, sans-serif',w.jo.textAlign='left',w.jo.fillStyle='white',w.jo.fillText('Error - unable to load game!',50,50),w.jo.fillText('To play RuneScape make sure you play from',50,100),w.jo.fillText('https://2004scape.org',50,150)),this.xt){this.mi=!1,w.jo.font='bold 13px helvetica, sans-serif',w.jo.textAlign='left',w.jo.fillStyle='yellow';let t=35;w.jo.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,w.jo.fillStyle='white',w.jo.fillText('To fix this try the following (in order):',30,t),t+=50,w.jo.font='bold 12px helvetica, sans-serif',w.jo.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.jo.fillText('2: Try rebooting your computer, and reloading',30,t)}};qo=t=>{if(!t.$o)return!1;for(let i=0;i=h)return!1}else if(3===t.$o[i]){if(s<=h)return!1}else if(4===t.$o[i]){if(s===h)return!1}else if(s!==h)return!1}return!0};tl=(t,i,s,h,e)=>{this.vs?.draw(t,i),this.Ls?.draw(t,i+e-16),A.A.fillRect(t,i+16,16,e-32,p.A.il);let n=(e-32)*e/h|0;n<8&&(n=8);const r=(e-n-32)*s/(h-e)|0;A.A.fillRect(t,i+r+16,16,n,p.A.sl),A.A.hl(t,i+r+16,p.A.el,n),A.A.hl(t+1,i+r+16,p.A.el,n),A.A.nl(t,i+r+16,p.A.el,16),A.A.nl(t,i+r+17,p.A.el,16),A.A.hl(t+15,i+r+16,p.A.rl,n),A.A.hl(t+14,i+r+17,p.A.rl,n-1),A.A.nl(t,i+r+n+15,p.A.rl,16),A.A.nl(t+1,i+r+n+14,p.A.rl,15)};ol=(t,i)=>{let s=!1;const e=h.A.Ro[t];if(!e.ll)return!1;for(let t=0;th.delay[n.ul];)n.fl-=h.delay[n.ul]+1,n.ul++,n.ul>=h.dl&&(n.ul-=h.wl,(n.ul<0||n.ul>=h.dl)&&(n.ul=0)),s=!0}}}return s};Al=(t,i,s,n,r=!1)=>{if(0!==t.type||!t.ll||t.hide&&this.$h!==t.id&&this.Jh!==t.id&&this.Qh!==t.id)return;const o=A.A.left,l=A.A.top,a=A.A.right,c=A.A.bottom;A.A.yl(i,s,i+t.width,s+t.height);const f=t.ll.length;for(let o=0;o0&&this.gl(c),c.type===h.A.Cl)c.Tl>c.scroll-c.height&&(c.Tl=c.scroll-c.height),c.Tl<0&&(c.Tl=0),this.Al(c,l,a,c.Tl,r),c.scroll>c.height&&this.tl(l+c.width,a,c.Tl,c.scroll,c.height);else if(c.type===h.A.Ol){let t=0;for(let i=0;i0){let i=0,s=0;const n=c.Ll[t]-1;if(h>=-32&&h<=512&&e>=-32&&e<=334||0!==this.se&&this.ie===t){const r=y.A.kl(n,c.Rl[t]);if(0!==this.se&&this.ie===t&&this.te===c.id?(i=this.xl-this.he,s=this.Dl-this.ee,i<5&&i>-5&&(i=0),s<5&&s>-5&&(s=0),this.ne<5&&(i=0,s=0),r.Nl(128,h+i,e+s)):0!==this.ue&&this.de===t&&this.we===c.id?r.Nl(128,h,e):r.draw(h,e),33===r.Pl||1!==c.Rl[t]){const n=c.Rl[t];this.di?.Fl(h+i+1,e+10+s,this.Ul(n),p.A.Bl),this.di?.Fl(h+i,e+9+s,this.Ul(n),p.A.Gl)}}}else if(c.Hl&&t<20){const i=c.Hl[t];i?.draw(h,e)}t++}}else if(c.type===h.A.Wl)c.fill?A.A.fillRect(l,a,c.width,c.height,c.Yl):A.A.Il(l,a,c.width,c.height,c.Yl);else if(c.type===h.A.Vl){const t=c.font;let i=c.Yl,s=c.text;if(this.Qh!==c.id&&this.Jh!==c.id&&this.$h!==c.id||0===c.Kl||(i=c.Kl),this.qo(c)&&(i=c.Xl,c.zl&&c.zl.length>0&&(s=c.zl)),c.jl===h.A.Zl&&this.ye&&(s='Please wait...',i=c.Yl),!t||!s)continue;for(let h=a+t.height;s.length>0;h+=t.height){if(-1!==s.indexOf('%')){for(;;){const t=s.indexOf('%1');if(-1===t)break;s=s.substring(0,t)+this.ql(this.Jo(c,0))+s.substring(t+2)}for(;;){const t=s.indexOf('%2');if(-1===t)break;s=s.substring(0,t)+this.ql(this.Jo(c,1))+s.substring(t+2)}for(;;){const t=s.indexOf('%3');if(-1===t)break;s=s.substring(0,t)+this.ql(this.Jo(c,2))+s.substring(t+2)}for(;;){const t=s.indexOf('%4');if(-1===t)break;s=s.substring(0,t)+this.ql(this.Jo(c,3))+s.substring(t+2)}for(;;){const t=s.indexOf('%5');if(-1===t)break;s=s.substring(0,t)+this.ql(this.Jo(c,4))+s.substring(t+2)}}const e=s.indexOf('\\n');let n;-1!==e?(n=s.substring(0,e),s=s.substring(e+2)):(n=s,s=''),c.$l?t.Jl(l+(c.width/2|0),h,n,i,c.Ql):t.ta(l,h,n,i,c.Ql)}}else if(c.type===h.A.ia){let t;t=this.qo(c)?c.sa:c.ha,t?.draw(l,a)}else if(c.type===h.A.ea){const t=e.A.na,i=e.A.ra;e.A.na=l+(c.width/2|0),e.A.ra=a+(c.height/2|0);const s=e.A.sin[c.oa]*c.zoom>>16,h=e.A.cos[c.oa]*c.zoom>>16,n=this.qo(c);let r;r=n?c.cl:c.al;let o=null;if(-1===r)o=c.la(-1,-1,n);else{const t=I.A.Ro[r];t.frames&&t.aa&&(o=c.la(t.frames[c.ul],t.aa[c.ul],n))}o&&o.ca(0,c.fa,0,c.oa,0,s,h),e.A.na=t,e.A.ra=i}else if(c.type===h.A.ua){const t=c.font;if(!t||!c.Ll||!c.Rl)continue;let i=0;for(let s=0;s0){const e=y.A.get(c.Ll[i]-1);let n=e.name;if((e.da||1!==c.Rl[i])&&(n=n+' x'+this.wa(c.Rl[i])),!n)continue;const r=l+h*(c.Sl+115),o=a+s*(c.Ml+12);c.$l?t.Jl(r+(c.width/2|0),o,n,c.Yl,c.Ql):t.ta(r,o,n,c.Yl,c.Ql)}i++}}}A.A.yl(o,l,a,c)};gl=t=>{let i=t.El;if(i>=h.A.Aa&&i<=h.A.ya)i--,i>=this.Vr?(t.text='',t.jl=0):(t.text=this.so[i],t.jl=1);else if(i>=h.A.pa&&i<=h.A.ma)i-=h.A.pa,i>=this.Vr?(t.text='',t.jl=0):(0===this.eo[i]?t.text='@red@Offline':this.eo[i]===k.it?t.text='@gre@World-'+(this.eo[i]-9):t.text='@yel@World-'+(this.eo[i]-9),t.jl=1);else if(i===h.A.Ia)t.scroll=15*this.Vr+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i>=h.A._a&&i<=h.A.Ea)i-=h.A._a,i>=this.dh?(t.text='',t.jl=0):(t.text=_.A.ga(_.A.Ca(this.wh[i])),t.jl=1);else if(i===h.A.Ta)t.scroll=15*this.dh+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i===h.A.Oa){if(t.oa=150,t.fa=256*Math.sin(this.Pt/40)&2047,this.Hr){this.Hr=!1;const i=new d.ds(7,null);let s=0;for(let t=0;t<7;t++){const h=this.Wr[t];h>=0&&(i[s++]=E.A.Ro[h].la())}const h=m.A.ba(i,s);for(let t=0;t<5;t++)0!==this.Yr[t]&&(h.va(u.A.La[t][0],u.A.La[t][this.Yr[t]]),1===t&&h.va(u.A.Ra[0],u.A.Ra[this.Yr[t]]));if(this.Sr){const i=I.A.Ro[this.Sr.Sa].frames;i&&(h.Ma(),h.ka(i[0]),h.xa(64,850,-30,-50,-30,!0),t.model=h)}}}else if(i===h.A.Da)this.Bs||(this.Bs=t.ha,this.Gs=t.sa),this.Gr?t.ha=this.Gs:t.ha=this.Bs;else if(i===h.A.Na)this.Bs||(this.Bs=t.ha,this.Gs=t.sa),this.Gr?t.ha=this.Bs:t.ha=this.Gs;else if(i===h.A.Pa)t.text=this.Me,this.Pt%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(i===h.A.Fa)this.Br?this.ke?(t.Yl=p.A.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.Yl=p.A._l,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(i===h.A.Ua||i===h.A.Ba)if(0===this.De)t.text='';else{let i;i=0===this.Ne?'earlier today':1===this.Ne?'yesterday':this.Ne+' days ago',t.text='You last logged in '+i+' from: '+_.A.Ga(this.De)}else if(i===h.A.Ha)0===this.Fe&&(t.text='0 unread messages',t.Yl=p.A.Gl),1===this.Fe&&(t.text='1 unread message',t.Yl=p.A.GREEN),this.Fe>1&&(t.text=this.Fe+' unread messages',t.Yl=p.A.GREEN);else if(i===h.A.Wa)if(201===this.Pe)t.text='';else if(200===this.Pe)t.text='You have not yet set any password recovery questions.';else{let i;i=0===this.Pe?'Earlier today':1===this.Pe?'Yesterday':this.Pe+' days ago',t.text=i+' you changed your recovery questions'}else i===h.A.Ya?201===this.Pe?t.text='':200===this.Pe?t.text='We strongly recommend you do so now to secure your account.':t.text='If you do not remember making this change then cancel it immediately':i===h.A.Va&&(201===this.Pe?t.text='':(this.Pe,t.text="Do this from the 'account management' area on our front webpage"))};Jo=(t,i)=>{if(!t.scripts||i>=t.scripts.length)return-2;try{const s=t.scripts[i];if(!s)return-1;let e=0,n=0;for(;;){const t=s[n++];if(0===t)return e;if(1===t)e+=this.Th[s[n++]];else if(2===t)e+=this.Oh[s[n++]];else if(3===t)e+=this.Ch[s[n++]];else if(4===t){const t=h.A.Ro[s[n++]],i=s[n++]+1;if(t.Ll&&t.Rl)for(let s=0;st<999999999?String(t):'*';wa=t=>{let i=String(t);for(let t=i.length-3;t>0;t-=3)i=i.substring(0,t)+','+i.substring(t);return i.length>8?i='@gre@'+i.substring(0,i.length-8)+' million @whi@('+i+')':i.length>4&&(i='@cya@'+i.substring(0,i.length-4)+'K @whi@('+i+')'),' '+i};Ul=t=>t<1e5?String(t):t<1e7?(t/1e3|0)+'K':(t/1e6|0)+'M'}},7604:(t,i,s)=>{s.d(i,{w:()=>r});var h=s(7046),e=s(1651),n=s(9234);async function r(){await async function(){0===h.A.getParameter('world').length&&h.A.setParameter('world','1');'localhost'===window.location.hostname&&'0'===h.A.getParameter('world')?(e.K.ht='http://localhost',e.K.et='http://localhost',e.K.portOffset=0):await async function(t){const i=await o(t,parseInt(h.A.getParameter('world'),10)),s=new URL(i.address);e.K.it=10+i.id-1,e.K.ht=`${s.protocol}//${s.hostname}`,e.K.et=`${s.protocol}//${s.hostname}:${s.port}`,t||(e.K.ht=e.K.ht.replace('https:','http:'));e.K.portOffset=i.portOffset,e.K.members=!0===i?.members,h.A.setParameter('world',i.id.toString(10))}(window.location.protocol.startsWith('https'))}(),function(){0===h.A.getParameter('detail').length&&h.A.setParameter('detail','high');'low'===h.A.getParameter('detail')?e.K.Rt():e.K.Lt()}(),0===h.A.getParameter('method').length&&h.A.setParameter('method','0')}async function o(t,i,s=0){if(s>=10)throw new Error('could not find world to connect!');const h=t?'https:':'http:';let e;try{e=JSON.parse(await(0,n.Xa)(`${h}//2004scape.org/api/v1/worldlist`))}catch(h){return await(0,n.Wo)(1e3),o(t,i,++s)}e.push({id:0,region:'Local Development',address:'http://localhost',portOffset:0,members:!0,nr:0});const r=e.find((t=>t.id===i));return r||o(t,i,10)}},7906:(t,i,s)=>{s.a(t,(async(t,i)=>{try{var h=s(1312),e=s(5637),n=s(1302),r=s(6948),o=s(8317),l=s(8738),a=s(3764),c=s(1120),f=s(1183),u=s(8950),d=s(4583),w=s(1673),A=s(2511),y=s(2682),p=s(8665),m=s(9298),I=s(1069),_=s(3554),E=s(353),g=s(2634),C=s(4544),T=s(2215),O=s(3955),b=s(7953),v=s(2646),L=s(3937),R=(s(9896),s(1908)),S=s(6666),M=s(3819),k=s(2595),x=s(3045),D=s(818),N=s(5599),P=s(1023),F=s(6169),U=s(2630),B=s(5327),G=s(670),H=s(9456),W=s(8268),Y=s(8412),V=s(3606),K=s(4197),X=s(254),z=s(7628),j=s(123),Z=s(9234),q=s(3867),$=s(1651),J=s(8534),Q=s(6730),tt=s(2164),it=s(7604),st=s(3795),ht=s(4909);class t extends $.K{load=async()=>{if(this.kt)this.xt=!0;else{this.kt=!0;try{await this.Go(10,'Connecting to fileserver'),await R.A.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new C.A(await C.A.openDatabase());const t=new I.A(new Uint8Array(await(0,Z.Ho)(`${$.K.et}/crc`)));for(let i=0;i<9;i++)this.Ft[i]=t.Ko;$.K.st||await this.Vo('scape_main',12345678,4e4);const i=await this.Fo('title','title screen',this.Ft[1],10);this.qt=i,this.di=y.A.za(i,'p11'),this.wi=y.A.za(i,'p12'),this.Ai=y.A.za(i,'b12'),this.yi=y.A.za(i,'q8'),await this.ja(),this.Za();const s=await this.Fo('config','config',this.Ft[2],15),u=await this.Fo('interface','interface',this.Ft[3],20),m=await this.Fo('media','2d graphics',this.Ft[4],30),_=await this.Fo('models','3d graphics',this.Ft[5],40),E=await this.Fo('textures','textures',this.Ft[6],60),g=await this.Fo('wordenc','chat system',this.Ft[7],65),T=await this.Fo('sounds','sound effects',this.Ft[8],70);this.Yn=new q.qa(G.A.xn,G.A.Xn,G.A.Xn),this.Wn=new q.$a(G.A.xn,G.A.Xn+1,G.A.Xn+1),this.Wn&&(this.He=new x.A(this.Wn,G.A.Xn,G.A.xn,G.A.Xn));for(let t=0;t34||t>34))999===i&&(i=h);else if(999!==i){s=h;break}this.hs[t-9]=i-21,this.es[t-9]=s-i}d.A.rc(479,96),this.$i=d.A.oc,d.A.rc(190,261),this.Ji=d.A.oc,d.A.rc(512,334),this.Qi=d.A.oc;const V=new Int32Array(9);for(let t=0;t<9;t++){const i=32*t+128+15,s=3*i+600,h=d.A.sin[i];V[t]=s*h>>16}x.A.init(512,334,500,800,V),b.A.ec(g),this.lc()}catch(t){console.error(t),this.Dt=!0}}};update=async()=>{this.xt||this.Dt||this.Nt||(this.Pt++,this.ac?await this.cc():await this.fc())};draw=async()=>{this.xt||this.Dt||this.Nt?this.zo():(this.ac?this.uc():await this.dc(),this.zs=0)};refresh=()=>{this.$t=!0};Go=async(t,i)=>{if(console.log(`${t}%: ${i}`),await this.wc(),!this.qt)return void await super.Go(t,i);this.si?.bind();this.Ai?.Ac(180,54,'RuneScape is loading - please wait...',m.A._l);u.A.Il(28,62,304,34,m.A.yc),u.A.Il(29,63,302,32,m.A.Bl),u.A.fillRect(30,64,3*t,30,m.A.yc),u.A.fillRect(30+3*t,64,300-3*t,30,m.A.Bl),this.Ai?.Ac(180,85,i,m.A._l),this.si?.draw(214,186),this.$t&&(this.$t=!1,this.mi||(this.hi?.draw(0,0),this.ei?.draw(661,0)),this.ti?.draw(128,0),this.ii?.draw(214,386),this.ni?.draw(0,265),this.ri?.draw(574,265),this.oi?.draw(128,186),this.li?.draw(574,186)),await(0,Z.Wo)(5)};mc=()=>{this.mi&&(this.Ic(),this.Ic(),this._c())};wc=async()=>{this.ti||(this.Mo=null,this.Fi=null,this.Ni=null,this.Di=null,this.Pi=null,this.Ui=null,this.Bi=null,this.Gi=null,this.hi=new f.A(128,265),u.A.clear(),this.ei=new f.A(128,265),u.A.clear(),this.ti=new f.A(533,186),u.A.clear(),this.ii=new f.A(360,146),u.A.clear(),this.si=new f.A(360,200),u.A.clear(),this.ni=new f.A(214,267),u.A.clear(),this.ri=new f.A(215,267),u.A.clear(),this.oi=new f.A(86,79),u.A.clear(),this.li=new f.A(87,79),u.A.clear(),this.qt&&(await this.ja(),this.Za()),this.$t=!0)};ja=async()=>{if(!this.qt)return;const t=await A.A.Ec(this.qt,'title');this.hi?.bind(),t.tc(0,0),this.ei?.bind(),t.tc(-661,0),this.ti?.bind(),t.tc(-128,0),this.ii?.bind(),t.tc(-214,-386),this.si?.bind(),t.tc(-214,-186),this.ni?.bind(),t.tc(0,-265),this.ri?.bind(),t.tc(-128,-186),this.oi?.bind(),t.tc(-128,-186),this.li?.bind(),t.tc(-574,-186),t.Ja(),this.hi?.bind(),t.tc(394,0),this.ei?.bind(),t.tc(-267,0),this.ti?.bind(),t.tc(266,0),this.ii?.bind(),t.tc(180,-386),this.si?.bind(),t.tc(180,-186),this.ni?.bind(),t.tc(394,-265),this.ri?.bind(),t.tc(-180,-265),this.oi?.bind(),t.tc(212,-186),this.li?.bind(),t.tc(-180,-186);const i=A.A.za(this.qt,'logo');this.ti?.bind(),i.draw((this.width/2|0)-(i.width/2|0)-128,18)};gc=t=>{if(!this.gi||!this.Ei)return;this.gi.fill(0);for(let t=0;t<5e3;t++){const t=128*Math.random()*256|0;this.gi[t]=256*Math.random()|0}for(let t=0;t<20;t++){for(let t=1;t<255;t++)for(let i=1;i<127;i++){const s=i+(t<<7);this.Ei[s]=(this.gi[s-1]+this.gi[s+1]+this.gi[s-128]+this.gi[s+128])/4|0}const t=this.gi;this.gi=this.Ei,this.Ei=t}if(t){let i=0;for(let s=0;s{if(this.qt){this.ai=w.A.za(this.qt,'titlebox'),this.ci=w.A.za(this.qt,'titlebutton');for(let t=0;t<12;t++)this.pi[t]=w.A.za(this.qt,'runes',t);this.Ii=new A.A(128,265),this._i=new A.A(128,265),this.hi&&(0,Z.Oc)(this.hi.nc,0,this.Ii.nc,0,33920),this.ei&&(0,Z.Oc)(this.ei.nc,0,this._i.nc,0,33920),this.bi=new Int32Array(256);for(let t=0;t<64;t++)this.bi[t]=262144*t;for(let t=0;t<64;t++)this.bi[t+64]=1024*t+m.A.RED;for(let t=0;t<64;t++)this.bi[t+128]=4*t+m.A.Gl;for(let t=0;t<64;t++)this.bi[t+192]=m.A._l;this.vi=new Int32Array(256);for(let t=0;t<64;t++)this.vi[t]=1024*t;for(let t=0;t<64;t++)this.vi[t+64]=4*t+m.A.GREEN;for(let t=0;t<64;t++)this.vi[t+128]=262144*t+m.A.bc;for(let t=0;t<64;t++)this.vi[t+192]=m.A._l;this.Li=new Int32Array(256);for(let t=0;t<64;t++)this.Li[t]=4*t;for(let t=0;t<64;t++)this.Li[t+64]=262144*t+m.A.BLUE;for(let t=0;t<64;t++)this.Li[t+128]=1024*t+m.A.vc;for(let t=0;t<64;t++)this.Li[t+192]=m.A._l;this.Oi=new Int32Array(256),this.gi=new Int32Array(32768),this.Ei=new Int32Array(32768),this.gc(null),this.Ci=new Int32Array(32768),this.Ti=new Int32Array(32768),this.Go(10,'Connecting to fileserver').then((()=>{this.mi||(this.mi=!0,this.xi=setInterval(this.mc,35))}))}};fc=async()=>{if(0===this.Jt){let t=(this.width/2|0)-80,i=20+(this.height/2|0);i+=20,1===this.Lc&&this.Rc>=t-75&&this.Rc<=t+75&&this.Sc>=i-20&&this.Sc<=i+20&&(this.Jt=3,this.Qt=0),t=80+(this.width/2|0),1===this.Lc&&this.Rc>=t-75&&this.Rc<=t+75&&this.Sc>=i-20&&this.Sc<=i+20&&(this.fi='',this.ui='Enter your username & password.',this.Jt=2,this.Qt=0)}else if(2===this.Jt){let t=(this.height/2|0)-40;t+=30,t+=25,1===this.Lc&&this.Sc>=t-15&&this.Sc=t-15&&this.Sc=i-75&&this.Rc<=i+75&&this.Sc>=s-20&&this.Sc<=s+20&&await this.Mc(this.username,this.password,!1),i=80+(this.width/2|0),1===this.Lc&&this.Rc>=i-75&&this.Rc<=i+75&&this.Sc>=s-20&&this.Sc<=s+20&&(this.Jt=0,this.username='',this.password='');;){const t=this.kc();if(-1===t)return;let i=!1;for(let s=0;s0&&(this.username=this.username.substring(0,this.username.length-1)),9!==t&&10!==t&&13!==t||(this.Qt=1),i&&(this.username=this.username+String.fromCharCode(t)),this.username.length>12&&(this.username=this.username.substring(0,12))):1===this.Qt&&(8===t&&this.password.length>0&&(this.password=this.password.substring(0,this.password.length-1)),9!==t&&10!==t&&13!==t||(this.Qt=0),i&&(this.password=this.password+String.fromCharCode(t)),this.password.length>20&&(this.password=this.password.substring(0,20)))}}else if(3===this.Jt){const t=this.width/2|0;let i=50+(this.height/2|0);i+=20,1===this.Lc&&this.Rc>=t-75&&this.Rc<=t+75&&this.Sc>=i-20&&this.Sc<=i+20&&(this.Jt=0)}};dc=async()=>{await this.wc(),this.si?.bind(),this.ai?.draw(0,0);if(0===this.Jt){let t=180,i=80;this.Ai?.Jl(t,i,'Welcome to RuneScape',m.A.Gl,!0),t=100,i=120,this.ci?.draw(t-73,i-20),this.Ai?.Jl(t,i+5,'New user',m.A._l,!0),t=260,this.ci?.draw(t-73,i-20),this.Ai?.Jl(t,i+5,'Existing User',m.A._l,!0)}else if(2===this.Jt){let t=100,i=60;this.fi.length>0?(this.Ai?.Jl(180,i-15,this.fi,m.A.Gl,!0),this.Ai?.Jl(180,i,this.ui,m.A.Gl,!0),i+=30):(this.Ai?.Jl(180,i-7,this.ui,m.A.Gl,!0),i+=30),this.Ai?.ta(90,i,`Username: ${this.username}${0===this.Qt&&this.Pt%40<20?'@yel@|':''}`,m.A._l,!0),i+=15,this.Ai?.ta(92,i,`Password: ${M.A.Dc(this.password)}${1===this.Qt&&this.Pt%40<20?'@yel@|':''}`,m.A._l,!0),i=150,this.ci?.draw(t-73,i-20),this.Ai?.Jl(t,i+5,'Login',m.A._l,!0),t=260,this.ci?.draw(t-73,i-20),this.Ai?.Jl(t,i+5,'Cancel',m.A._l,!0)}else if(3===this.Jt){this.Ai?.Jl(180,40,'Create a free account',m.A.Gl,!0);const t=180;let i=65;this.Ai?.Jl(180,i,'To create a new account you need to',m.A._l,!0),i+=15,this.Ai?.Jl(180,i,'go back to the main RuneScape webpage',m.A._l,!0),i+=15,this.Ai?.Jl(180,i,"and choose the red 'create account'",m.A._l,!0),i+=15,this.Ai?.Jl(180,i,'button at the top right of that page.',m.A._l,!0),i=150,this.ci?.draw(t-73,i-20),this.Ai?.Jl(t,i+5,'Cancel',m.A._l,!0)}this.si?.draw(214,186),this.$t&&(this.$t=!1,this.ti?.draw(128,0),this.ii?.draw(214,386),this.ni?.draw(0,265),this.ri?.draw(574,265),this.oi?.draw(128,186),this.li?.draw(574,186))};Mc=async(t,i,s)=>{try{s||(this.fi='',this.ui='Connecting to server...',await this.dc()),this.stream=new _.A(await _.A.Nc({host:$.K.ht,port:43594+$.K.portOffset})),await(this.stream?.Pc(this.in.data,0,8)),this.in.Fc=0,this.Ht=this.in.Uc;const h=new Int32Array([Math.floor(99999999*Math.random()),Math.floor(99999999*Math.random()),Number(this.Ht>>32n),Number(this.Ht&BigInt(4294967295))]);this.Bt.Fc=0,this.Bt.p1(10),this.Bt.p4(h[0]),this.Bt.p4(h[1]),this.Bt.p4(h[2]),this.Bt.p4(h[3]),this.Bt.p4(0),this.Bt.Bc(t),this.Bt.Bc(i),this.Bt.Gc($.K.ct,$.K.exponent),this.Gt.Fc=0,s?this.Gt.p1(18):this.Gt.p1(16),this.Gt.p1(this.Bt.Fc+36+1+1),this.Gt.p1($.K.tt),this.Gt.p1($.K.st?1:0);for(let t=0;t<9;t++)this.Gt.p4(this.Ft[t]);this.Gt.Hc(this.Bt.data,this.Bt.Fc,0),this.Bt.random=new g.A(h);for(let t=0;t<4;t++)h[t]+=50;this.Kt=new g.A(h),this.stream?.write(this.Gt.data,this.Gt.Fc);const e=await this.stream.read();if(1===e)return await(0,Z.Wo)(2e3),void await this.Mc(t,i,s);if(2===e||18===e){this.Br=18===e,k.A.Wc(),this.ac=!0,this.Bt.Fc=0,this.in.Fc=0,this.Xt=-1,this.zt=-1,this.jt=-1,this.Zt=-1,this.packetSize=0,this.Wt=0,this.Vt=0,this.Yt=0,this.Ah=0,this.nh=0,this.Qs=!1,this.Yc=0;for(let t=0;t<100;t++)this.Vh[t]=null;this.oe=0,this.Ie=0,this.We=0,this.ro=0,this.Ze=(100*Math.random()|0)-50,this.qe=(110*Math.random()|0)-55,this.$e=(80*Math.random()|0)-40,this.An=(120*Math.random()|0)-60,this.yn=(30*Math.random()|0)-20,this.Fn=(20*Math.random()|0)-10&2047,this.In=-1,this.Ke=0,this.Xe=0,this.rr=0,this.yr=0;for(let t=0;t{if(null!==this.nr){this.Vt>1&&this.Vt--,this.Yt>0&&this.Yt--;for(let t=0;t<5&&await this.read();t++);if(this.ac){for(let t=0;tthis.Ao+(this.wo/22|0)&&(this.wo=i.Fc,this.Ao=Date.now(),this.uo=this.lo[t],this.do=this.ao[t],await(0,j.zc)(i.data.slice(0,i.Fc),this.fo))}catch(t){console.error(t)}this.ro--;for(let i=t;i0&&(this.yo-=20,this.yo<0&&(this.yo=0),0===this.yo&&this.po&&!$.K.st&&this.mo&&await this.Vo(this.mo,this.Io,this._o));const t=k.A.flush();if(t&&(this.Bt.jc(O.A.Zc),this.Bt.p2(t.Fc),this.Bt.Hc(t.data,t.Fc,0),t.release()),this.Wt++,this.Wt>750&&await this.qc(),this.$c(),this.Jc(),this.Qc(),this.tf(),(1===this.if[1]||1===this.if[2]||1===this.if[3]||1===this.if[4])&&this.Nn++>5&&(this.Nn=0,this.Bt.jc(O.A.sf),this.Bt.p2(this.Pn),this.Bt.p2(this.Fn),this.Bt.p1(this.An),this.Bt.p1(this.yn)),this.Ye++,0!==this.js&&(this.Zs+=20,this.Zs>=400&&(this.js=0)),0!==this.ue&&(this.Ae++,this.Ae>=15&&(2===this.ue&&(this.Ws=!0),3===this.ue&&(this.Ys=!0),this.ue=0)),0!==this.se&&(this.ne++,(this.xl>this.he+5||this.xlthis.ee+5||this.Dl=5){if(this.Le=-1,this.ef(),this.Le===this.te&&this.Re!==this.ie){const t=c.A.Ro[this.te];if(t.Ll){const i=t.Ll[this.Re];t.Ll[this.Re]=t.Ll[this.ie],t.Ll[this.ie]=i}if(t.Rl){const i=t.Rl[this.Re];t.Rl[this.Re]=t.Rl[this.ie],t.Rl[this.ie]=i}this.Bt.jc(O.A.nf),this.Bt.p2(this.te),this.Bt.p2(this.ie),this.Bt.p2(this.Re)}}else(1===this.Ce||this.rf(this.nh-1))&&this.nh>2?this.lf():this.nh>0&&await this.af(this.nh-1);this.Ae=10,this.Lc=0}if($.K.dt++,$.K.dt>127&&($.K.dt=0,this.Bt.jc(O.A.cf),this.Bt.p3(4991788)),-1!==x.A.ff&&this.Sr){const t=x.A.ff,i=x.A.uf,s=this.df(this.Sr.wf[0],this.Sr.Af[0],t,i,0,0,0,0,0,0,!0);x.A.ff=-1,s&&(this.qs=this.Rc,this.$s=this.Sc,this.js=1,this.Zs=0)}1===this.Lc&&this.Lh&&(this.Lh=null,this.Ys=!0,this.Lc=0),await this.yf(),this.pf(),this.mf(),this.If(),1!==this.hf&&1!==this.Lc||this.zs++,2===this.We&&($.K.ot?this._f():this.Ef()),2===this.We&&this.ze&&this.gf();for(let t=0;t<5;t++)this.sn[t]++;if(await this.Cf(),this.Yc++,this.Yc>4500&&(this.Yt=250,this.Yc-=500,this.Bt.jc(O.A.Tf)),this.je++,this.je>500){this.je=0;const t=8*Math.random()|0;1&~t||(this.Ze+=this.Je),2&~t||(this.qe+=this.Qe),4&~t||(this.$e+=this.tn)}if(this.Ze<-50&&(this.Je=2),this.Ze>50&&(this.Je=-2),this.qe<-55&&(this.Qe=2),this.qe>55&&(this.Qe=-2),this.$e<-40&&(this.tn=1),this.$e>40&&(this.tn=-1),this.wn++,this.wn>500){this.wn=0;const t=8*Math.random()|0;1&~t||(this.An+=this.mn),2&~t||(this.yn+=this.pn)}this.An<-60&&(this.mn=2),this.An>60&&(this.mn=-2),this.yn<-20&&(this.pn=1),this.yn>10&&(this.pn=-1),$.K.wt++,$.K.wt>110&&($.K.wt=0,this.Bt.jc(O.A.Of),this.Bt.p4(0)),this.Pr++,this.Pr>50&&this.Bt.jc(O.A.bf);try{this.stream&&this.Bt.Fc>0&&(this.stream.write(this.Bt.data,this.Bt.Fc),this.Bt.Fc=0,this.Pr=0)}catch(t){console.log(t),await this.qc()}}}};uc=()=>{if(null===this.nr)return;this.$t&&(this.$t=!1,this.Hi?.draw(0,11),this.Wi?.draw(0,375),this.Yi?.draw(729,5),this.Vi?.draw(752,231),this.Ki?.draw(0,0),this.Xi?.draw(561,0),this.zi?.draw(520,11),this.ji?.draw(520,231),this.Zi?.draw(501,375),this.qi?.draw(0,345),this.Ws=!0,this.Ys=!0,this.Vs=!0,this.Ks=!0,2!==this.We&&(this.Pi?.draw(8,11),this.Ni?.draw(561,5))),2===this.We&&this.vf(),this.Qs&&1===this.th&&(this.Ws=!0);let t=!1;if(-1!==this.oh&&(t=this.ol(this.oh,this.Ye),t&&(this.Ws=!0)),2===this.ue&&(this.Ws=!0),2===this.se&&(this.Ws=!0),this.Ws&&(this.Lf(),this.Ws=!1),-1===this.lh){this.ah.Tl=this.fh-this.uh-77,this.xl>453&&this.xl<565&&this.Dl>350&&this.Rf(this.xl-22,this.Dl-375,this.fh,77,!1,463,0,this.ah);let t=this.fh-this.ah.Tl-77;t<0&&(t=0),t>this.fh-77&&(t=this.fh-77),this.uh!==t&&(this.uh=t,this.Ys=!0)}-1!==this.lh&&(t=this.ol(this.lh,this.Ye),t&&(this.Ys=!0)),3===this.ue&&(this.Ys=!0),3===this.se&&(this.Ys=!0),this.Lh&&(this.Ys=!0),this.Qs&&2===this.th&&(this.Ys=!0),this.Ys&&(this.Sf(),this.Ys=!1),2===this.We&&(this.Mf(),this.Ni?.draw(561,5)),-1!==this.Rh&&(this.Vs=!0),this.Vs&&(-1!==this.Rh&&this.Rh===this.Sh&&(this.Rh=-1,this.Bt.jc(O.A.kf),this.Bt.p1(this.Sh)),this.Vs=!1,this.Gi?.bind(),this.fs?.draw(0,0),-1===this.oh&&(-1!==this.Mh[this.Sh]&&(0===this.Sh?this.Rs?.draw(29,30):1===this.Sh?this.Ss?.draw(59,29):2===this.Sh?this.Ss?.draw(87,29):3===this.Sh?this.Ms?.draw(115,29):4===this.Sh?this.xs?.draw(156,29):5===this.Sh?this.xs?.draw(184,29):6===this.Sh&&this.ks?.draw(212,30)),-1!==this.Mh[0]&&(0!==this.Rh||this.Pt%20<10)&&this.us[0]?.draw(35,34),-1!==this.Mh[1]&&(1!==this.Rh||this.Pt%20<10)&&this.us[1]?.draw(59,32),-1!==this.Mh[2]&&(2!==this.Rh||this.Pt%20<10)&&this.us[2]?.draw(86,32),-1!==this.Mh[3]&&(3!==this.Rh||this.Pt%20<10)&&this.us[3]?.draw(121,33),-1!==this.Mh[4]&&(4!==this.Rh||this.Pt%20<10)&&this.us[4]?.draw(157,34),-1!==this.Mh[5]&&(5!==this.Rh||this.Pt%20<10)&&this.us[5]?.draw(185,32),-1!==this.Mh[6]&&(6!==this.Rh||this.Pt%20<10)&&this.us[6]?.draw(212,34)),this.Gi?.draw(520,165),this.Bi?.bind(),this.cs?.draw(0,0),-1===this.oh&&(-1!==this.Mh[this.Sh]&&(7===this.Sh?this.Ds?.draw(49,0):8===this.Sh?this.Ns?.draw(81,0):9===this.Sh?this.Ns?.draw(108,0):10===this.Sh?this.Ps?.draw(136,1):11===this.Sh?this.Us?.draw(178,0):12===this.Sh?this.Us?.draw(205,0):13===this.Sh&&this.Fs?.draw(233,0)),-1!==this.Mh[8]&&(8!==this.Rh||this.Pt%20<10)&&this.us[7]?.draw(80,2),-1!==this.Mh[9]&&(9!==this.Rh||this.Pt%20<10)&&this.us[8]?.draw(107,3),-1!==this.Mh[10]&&(10!==this.Rh||this.Pt%20<10)&&this.us[9]?.draw(142,4),-1!==this.Mh[11]&&(11!==this.Rh||this.Pt%20<10)&&this.us[10]?.draw(179,2),-1!==this.Mh[12]&&(12!==this.Rh||this.Pt%20<10)&&this.us[11]?.draw(206,2),-1!==this.Mh[13]&&(13!==this.Rh||this.Pt%20<10)&&this.us[12]?.draw(230,2)),this.Bi?.draw(501,492),this.Pi?.bind()),this.Ks&&(this.Ks=!1,this.Ui?.bind(),this.ls?.draw(0,0),this.wi?.Jl(57,33,'Public chat',m.A._l,!0),0===this.kh&&this.wi?.Jl(57,46,'On',m.A.GREEN,!0),1===this.kh&&this.wi?.Jl(57,46,'Friends',m.A.Gl,!0),2===this.kh&&this.wi?.Jl(57,46,'Off',m.A.RED,!0),3===this.kh&&this.wi?.Jl(57,46,'Hide',m.A.bc,!0),this.wi?.Jl(186,33,'Private chat',m.A._l,!0),0===this.xh&&this.wi?.Jl(186,46,'On',m.A.GREEN,!0),1===this.xh&&this.wi?.Jl(186,46,'Friends',m.A.Gl,!0),2===this.xh&&this.wi?.Jl(186,46,'Off',m.A.RED,!0),this.wi?.Jl(326,33,'Trade/duel',m.A._l,!0),0===this.Dh&&this.wi?.Jl(326,46,'On',m.A.GREEN,!0),1===this.Dh&&this.wi?.Jl(326,46,'Friends',m.A.Gl,!0),2===this.Dh&&this.wi?.Jl(326,46,'Off',m.A.RED,!0),this.wi?.Jl(462,38,'Report abuse',m.A._l,!0),this.Ui?.draw(0,471),this.Pi?.bind()),this.Ye=0};vf=()=>{if(this.Ve++,this.xf(),this.Df(),this.Nf(),this.Pf(),this.Ff(),!this.ze){let t=this.Pn;(this.dn/256|0)>t&&(t=this.dn/256|0),this.hn[4]&&this.nn[4]+128>t&&(t=this.nn[4]+128);const i=this.Fn+this.$e&2047;if(this.Sr&&this.Uf(this.Gn,this.Bf(this.Dn,this.Sr.x,this.Sr.z)-50,this.Hn,i,t,3*t+600),$.K.ut++,$.K.ut>1802){$.K.ut=0,this.Bt.jc(O.A.Gf),this.Bt.p1(0);const t=this.Bt.Fc;this.Bt.p2(29711),this.Bt.p1(70),this.Bt.p1(256*Math.random()|0),this.Bt.p1(242),this.Bt.p1(186),this.Bt.p1(39),this.Bt.p1(61),2*Math.random()|0||this.Bt.p1(13),2*Math.random()|0||this.Bt.p2(57856),this.Bt.p2(65536*Math.random()|0),this.Bt.Hf(this.Bt.Fc-t)}}let t;t=this.ze?this.Wf():this.Yf();const i=this.ln,s=this.an,h=this.cn,e=this.fn,n=this.un;let r;for(let t=0;t<5;t++)this.hn[t]&&(r=Math.random()*(2*this.en[t]+1)-this.en[t]+Math.sin(this.sn[t]*(this.rn[t]/100))*this.nn[t]|0,0===t&&(this.ln+=r),1===t&&(this.an+=r),2===t&&(this.cn+=r),3===t&&(this.un=this.un+r&2047),4===t&&(this.fn+=r,this.fn<128&&(this.fn=128),this.fn>383&&(this.fn=383)));r=d.A.Vf,p.A.Kf=!0,p.A.Xf=0,p.A.xl=this.xl-8,p.A.Dl=this.Dl-11,u.A.clear(),this.He?.draw(this.ln,this.an,this.cn,t,this.un,this.fn,this.Pt),this.He?.zf(),this.jf(),this.Zf(),$.K.nt&&this.qf(),this.$f(r),this.Jf(),this.Pi?.draw(8,11),this.ln=i,this.an=s,this.cn=h,this.fn=e,this.un=n};Qf=()=>{e.A.tu?.clear(),e.A.iu?.clear(),r.A.So?.clear(),n.A.So?.clear(),n.A.su?.clear(),W.A.So?.clear(),l.A.So?.clear()};hu=(t,i)=>{this.eu(t.x,i,t.z)};eu=(t,i,s)=>{if(t<128||s<128||t>13056||s>13056)return this.zn=-1,void(this.jn=-1);const h=this.Bf(this.Dn,t,s)-i;this.nu(t,h,s)};nu=(t,i,s)=>{let h=t-this.ln,e=i-this.an,n=s-this.cn;const r=d.A.sin[this.fn],o=d.A.cos[this.fn],l=d.A.sin[this.un],a=d.A.cos[this.un];let c=n*l+h*a>>16;n=n*a-h*l>>16,h=c,c=e*o-n*r>>16,n=e*r+n*o>>16,e=c,n>=50?(this.zn=d.A.na+((h<<9)/n|0),this.jn=d.A.ra+((e<<9)/n|0)):(this.zn=-1,this.jn=-1)};jf=()=>{this.Kr=0;for(let t=-1;t-1))for(let t=0;t<8;t++)h.ru&1<=0&&10===this.Ah&&this.Ih===this.lr[t]&&(this.hu(i,i.height+15),this.zn>-1&&this._s[7]?.draw(this.zn-12,this.jn-s))}else 1===this.Ah&&this.yh===this.pr[t-this.rr]&&this.Pt%20<10&&(this.hu(i,i.height+15),this.zn>-1&&this._s[2]?.draw(this.zn-12,this.jn-28));if(i.ou&&(t>=this.rr||0===this.kh||3===this.kh||1===this.kh&&this.lu(i.name))&&(this.hu(i,i.height),this.zn>-1&&this.Kr<$.K.Xr&&this.Ai&&(this.qr[this.Kr]=this.Ai.au(i.ou)/2|0,this.Zr[this.Kr]=this.Ai.height,this.zr[this.Kr]=this.zn,this.jr[this.Kr]=this.jn,this.$r[this.Kr]=i.cu,this.Jr[this.Kr]=i.fu,this.Qr[this.Kr]=i.uu,this.io[this.Kr++]=i.ou,0===this.Zh&&1===i.fu&&(this.Zr[this.Kr]+=10,this.jr[this.Kr]+=5),0===this.Zh&&2===i.fu&&(this.qr[this.Kr]=60))),i.du>this.Pt+100&&(this.hu(i,i.height+15),this.zn>-1)){let t=30*i.wu/i.Au|0;t>30&&(t=30),u.A.fillRect(this.zn-15,this.jn-3,t,5,m.A.GREEN),u.A.fillRect(this.zn-15+t,this.jn-3,30-t,5,m.A.RED)}if(i.du>this.Pt+330&&(this.hu(i,i.height/2|0),this.zn>-1&&(this.Is[i.yu]?.draw(this.zn-12,this.jn-12),this.di?.Ac(this.zn,this.jn+4,i.pu.toString(),m.A.Bl),this.di?.Ac(this.zn-1,this.jn+3,i.pu.toString(),m.A._l))),$.K.nt){if(i.pathLength>0||i.mu>=this.Pt||i.Iu>this.Pt){const t=64*i.size;this._u(128*i.wf[0]+t,128*i.Af[0]+t,this.Dn,i.size,65535,!1)}this._u(i.x,i.z,this.Dn,i.size,6710886,!1);let s=0;if(this.hu(i,i.height+30),t32767&&(i-=32768),this.di?.Ac(this.zn,this.jn+s,'Face Entity: '+i,m.A._l),s-=15}(t.Eu&W.A.Lu)===W.A.Lu&&(this.di?.Ac(this.zn,this.jn+s,'Say',m.A._l),s-=15),(t.Eu&W.A.Ru)===W.A.Ru&&(this.di?.Ac(this.zn,this.jn+s,'Hit: Type '+t.yu+' Amount '+t.pu+' HP '+t.wu+'/'+t.Au,m.A._l),s-=15),(t.Eu&W.A.Su)===W.A.Su&&(this.di?.Ac(this.zn,this.jn+s,'Face Coord: '+t.Mu/2+' '+t.ku/2,m.A._l),s-=15),(t.Eu&W.A.xu)===W.A.xu&&(this.di?.Ac(this.zn,this.jn+s,'Chat',m.A._l),s-=15),(t.Eu&W.A.Du)===W.A.Du&&(this.di?.Ac(this.zn,this.jn+s,'Play Spotanim: '+t.Nu,m.A._l),s-=15),(t.Eu&W.A.Pu)===W.A.Pu&&(this.di?.Ac(this.zn,this.jn+s,'Exact Move',m.A._l),s-=15)}}else{const t=i;let s=0;if(this.hu(i,i.height+30),this.di?.Ac(this.zn,this.jn+s,t.type?.name??null,m.A._l),s-=15,-1!==t.Eu&&this.Pt-t.gu<30){if((t.Eu&Y.A.Tu)===Y.A.Tu&&(this.di?.Ac(this.zn,this.jn+s,'Play Seq: '+t.Ou,m.A._l),s-=15),(t.Eu&Y.A.bu)===Y.A.bu){let i=t.vu;i>32767&&(i-=32768),this.di?.Ac(this.zn,this.jn+s,'Face Entity: '+i,m.A._l),s-=15}(t.Eu&Y.A.Lu)===Y.A.Lu&&(this.di?.Ac(this.zn,this.jn+s,'Say',m.A._l),s-=15),(t.Eu&Y.A.Ru)===Y.A.Ru&&(this.di?.Ac(this.zn,this.jn+s,'Hit: Type '+t.yu+' Amount '+t.pu+' HP '+t.wu+'/'+t.Au,m.A._l),s-=15),(t.Eu&Y.A.Fu)===Y.A.Fu&&(this.di?.Ac(this.zn,this.jn+s,'Change Type: '+t.type?.id??null,m.A._l),s-=15),(t.Eu&Y.A.Du)===Y.A.Du&&(this.di?.Ac(this.zn,this.jn+s,'Play Spotanim: '+t.Nu,m.A._l),s-=15),(t.Eu&Y.A.Su)===Y.A.Su&&(this.di?.Ac(this.zn,this.jn+s,'Face Coord: '+t.Mu/2+' '+t.ku/2,m.A._l),s-=15)}}}}}if($.K.nt)for(let t=0;t=104||i.z>=104||this._u(128*i.x+64,128*i.z+64,i.level,1,16776960,!1)}for(let t=0;tthis.jr[r]-this.Zr[r]&&s-ethis.zr[r]-this.qr[r]&&this.jr[r]-this.Zr[r]{2===this.Ah&&this._s[2]&&(this.eu((this._h-this.Tn<<7)+this.ph,2*this.gh,(this.Eh-this.On<<7)+this.mh),this.zn>-1&&this.Pt%20<10&&this._s[2].draw(this.zn-12,this.jn-28))};qf=()=>{const t=507;let i=13;this.Oo?this.di?.Hu(t,i,'tock',m.A.Gl,!0):this.Ai?.Hu(t,i,'tick',m.A.Gl,!0),i+=13,this.di?.Hu(t,i,`Fps: ${this.Wu}, ${this.Yu} ms`,m.A.Gl,!0),i+=13,this.di?.Hu(t,i,`Draw: ${this.ms.toFixed(1)}, Avg: ${this.Vu.toFixed(1)}, Slow: ${this.Ku.toFixed(1)} ms`,m.A.Gl,!0),i+=13,this.di?.Hu(t,i,`Occluders: ${x.A.Xu[x.A.zu]} Active: ${x.A.ju}`,m.A.Gl,!0),i+=13,this.di?.Hu(t,i,'Local Pos: '+(this.Sr?.x??-1)+', '+(this.Sr?.z??-1)+', '+(this.Sr?.y??-1),m.A.Gl,!0),i+=13,this.di?.Hu(t,i,'Camera Pos: '+this.ln+', '+this.cn+', '+this.an,m.A.Gl,!0),i+=13,this.di?.Hu(t,i,'Camera Angle: '+this.un+', '+this.fn,m.A.Gl,!0),i+=13,this.di?.Hu(t,i,'Cutscene Source: '+this.tr+', '+this.ir+' '+this.sr+'; '+this.hr+', '+this.er,m.A.Gl,!0),i+=13,this.di?.Hu(t,i,'Cutscene Destination: '+this.Zn+', '+this.qn+' '+this.$n+'; '+this.Jn+', '+this.Qn,m.A.Gl,!0),$.K.ot&&(i+=13,this.di?.Hu(t,i,'Instructions:',m.A.Gl,!0),i+=13,this.di?.Hu(t,i,'- Arrows to move Camera',m.A.Gl,!0),i+=13,this.di?.Hu(t,i,'- Shift to control Source or Dest',m.A.Gl,!0),i+=13,this.di?.Hu(t,i,'- Alt to control Height',m.A.Gl,!0),i+=13,this.di?.Hu(t,i,'- Ctrl to control Modifier',m.A.Gl,!0))};_u=(t,i,s,h,e,n)=>{const r=this.Bf(s,t,i),o=64*h;this.nu(t-o,r,i-o);const l=this.zn,a=this.jn;this.nu(t+o,r,i-o);const c=this.zn,f=this.jn;this.nu(t-o,r,i+o);const d=this.zn,w=this.jn;this.nu(t+o,r,i+o);const A=this.zn,y=this.jn;-1!==l&&-1!==c&&-1!==d&&-1!==A&&(n&&(u.A.Zu(l,a,A,y,(16711422&e)>>1),u.A.Zu(c,f,d,w,(16711422&e)>>1)),u.A.Zu(l,a,c,f,e),u.A.Zu(l,a,d,w,e),u.A.Zu(c,f,A,y,e),u.A.Zu(d,w,A,y,e))};_f(){const t=1==this.if[5]?2:1;1==this.if[6]?(1==this.if[1]?(this.Zn-=t,this.Zn<1&&(this.Zn=1)):1==this.if[2]&&(this.Zn+=t,this.Zn>102&&(this.Zn=102)),1==this.if[3]?1==this.if[7]?this.$n+=2*t:(this.qn+=1,this.qn>102&&(this.qn=102)):1==this.if[4]&&(1==this.if[7]?this.$n-=2*t:(this.qn-=1,this.qn<1&&(this.qn=1)))):(1==this.if[1]?(this.tr-=t,this.tr<1&&(this.tr=1)):1==this.if[2]&&(this.tr+=t,this.tr>102&&(this.tr=102)),1==this.if[3]?1==this.if[7]?this.sr+=2*t:(this.ir+=t,this.ir>102&&(this.ir=102)):1==this.if[4]&&(1==this.if[7]?this.sr-=2*t:(this.ir-=t,this.ir<1&&(this.ir=1)))),this.ln=128*this.tr+64,this.cn=128*this.ir+64,this.an=this.Bf(this.Dn,this.tr,this.ir)-this.sr;const i=128*this.Zn+64,s=128*this.qn+64,h=this.Bf(this.Dn,this.Zn,this.qn)-this.$n,e=i-this.ln,n=h-this.an,r=s-this.cn,o=0|Math.sqrt(e*e+r*r);this.fn=325.949*Math.atan2(n,o)&2047,this.un=-325.949*Math.atan2(e,r)&2047,this.fn<128&&(this.fn=128),this.fn>383&&(this.fn=383)}Jf=()=>{if(this.qu(),1===this.js&&this.gs[this.Zs/100|0]?.draw(this.qs-8-8,this.$s-8-11),2===this.js&&this.gs[4+(this.Zs/100|0)]?.draw(this.qs-8-8,this.$s-8-11),-1!==this.Xs&&(this.ol(this.Xs,this.Ye),this.Al(c.A.Ro[this.Xs],0,0,0)),this.$u(),this.Qs?0===this.th&&this.Ju():(this.ef(),this.Qu()),1===this.kr&&(this.Fr>0||1===this.Ur?this._s[1]?.draw(472,258):this._s[1]?.draw(472,296)),this.Fr>0&&(this._s[0]?.draw(472,296),this.wi?.Ac(484,329,'Level: '+this.Fr,m.A.Gl)),1===this.Ur&&(this._s[6]?.draw(472,296),this.wi?.Ac(484,329,'Arena',m.A.Gl)),0!==this.Vt){let t=this.Vt/50|0;const i=t/60|0;t%=60,t<10?this.wi?.Fl(4,329,'System update in: '+i+':0'+t,m.A.Gl):this.wi?.Fl(4,329,'System update in: '+i+':'+t,m.A.Gl)}};qu=()=>{if(0===this.jh)return;const t=this.wi;let i=0;0!==this.Vt&&(i=1);for(let s=0;s<100;s++){if(!this.Vh[s])continue;const h=this.messageType[s];let e;if((3===h||7===h)&&(7===h||0===this.xh||1===this.xh&&this.lu(this.Kh[s]))&&(e=329-13*i,t?.Fl(4,e,'From '+this.Kh[s]+': '+this.Vh[s],m.A.Bl),t?.Fl(4,e-1,'From '+this.Kh[s]+': '+this.Vh[s],m.A.bc),i++,i>=5))return;if(5===h&&this.xh<2&&(e=329-13*i,t?.Fl(4,e,this.Vh[s],m.A.Bl),t?.Fl(4,e-1,this.Vh[s],m.A.bc),i++,i>=5))return;if(6===h&&this.xh<2&&(e=329-13*i,t?.Fl(4,e,'To '+this.Kh[s]+': '+this.Vh[s],m.A.Bl),t?.Fl(4,e-1,'To '+this.Kh[s]+': '+this.Vh[s],m.A.bc),i++,i>=5))return}};$u=()=>{if(!this.Sr)return;const t=(this.Sr.x>>7)+this.Tn,i=(this.Sr.z>>7)+this.On;if(this.Fr=t>=2944&&t<3392&&i>=3520&&i<6400?1+((i-3520)/8|0):t>=2944&&t<3392&&i>=9920&&i<12800?1+((i-9920)/8|0):0,this.Ur=0,t>=3328&&t<3392&&i>=3200&&i<3264){const s=63&t,h=63&i;(s>=4&&s<=29&&h>=44&&h<=58||s>=36&&s<=61&&h>=44&&h<=58||s>=4&&s<=29&&h>=25&&h<=39||s>=36&&s<=61&&h>=25&&h<=39||s>=4&&s<=29&&h>=6&&h<=20||s>=36&&s<=61&&h>=6&&h<=20)&&(this.Ur=1)}0===this.Ur&&t>=3328&&t<=3393&&i>=3203&&i<=3325&&(this.Ur=2),this.Js=0,(t>=3053&&t<=3156&&i>=3056&&i<=3136||t>=3072&&t<=3118&&i>=9492&&i<=9535)&&(this.Js=1),1===this.Js&&t>=3139&&t<=3199&&i>=3008&&i<=3062&&(this.Js=0)};Lf=()=>{this.Di?.bind(),this.Ji&&(d.A.oc=this.Ji),this.ns?.draw(0,0),-1!==this.oh?this.Al(c.A.Ro[this.oh],0,0,0):-1!==this.Mh[this.Sh]&&this.Al(c.A.Ro[this.Mh[this.Sh]],0,0,0),this.Qs&&1===this.th&&this.Ju(),this.Di?.draw(562,231),this.Pi?.bind(),this.Qi&&(d.A.oc=this.Qi)};Sf=()=>{if(this.Fi?.bind(),this.$i&&(d.A.oc=this.$i),this.rs?.draw(0,0),this.Fh)this.Ai?.Ac(239,40,this.Uh,m.A.Bl),this.Ai?.Ac(239,60,this.Bh+'*',m.A.td);else if(this.Wh)this.Ai?.Ac(239,40,'Enter amount:',m.A.Bl),this.Ai?.Ac(239,60,this.Hh+'*',m.A.td);else if(this.Lh)this.Ai?.Ac(239,40,this.Lh,m.A.Bl),this.Ai?.Ac(239,60,'Click to continue',m.A.td);else if(-1!==this.lh)this.Al(c.A.Ro[this.lh],0,0,0);else if(-1===this.Yh){let t=this.wi;0===$.K.rt&&(t=this.yi);let i=0;u.A.yl(0,0,463,77);for(let s=0;s<100;s++){const h=this.Vh[s];if(!h)continue;const e=this.messageType[s],n=this.uh+70-14*i;0===e&&(n>0&&n<110&&t?.Fl(4,n,h,m.A.Bl),i++),1===e&&(n>0&&n<110&&(t?.Fl(4,n,this.Kh[s]+':',m.A._l),t?.Fl(t.au(this.Kh[s])+12,n,h,m.A.BLUE)),i++),2===e&&(0===this.kh||1===this.kh&&this.lu(this.Kh[s]))&&(n>0&&n<110&&(t?.Fl(4,n,this.Kh[s]+':',m.A.Bl),t?.Fl(t.au(this.Kh[s])+12,n,h,m.A.BLUE)),i++),3!==e&&7!==e||0!==this.jh||!(7===e||0===this.xh||1===this.xh&&this.lu(this.Kh[s]))||(n>0&&n<110&&(t?.Fl(4,n,'From '+this.Kh[s]+':',m.A.Bl),t?.Fl(t.au('From '+this.Kh[s])+12,n,h,m.A.sd)),i++),4===e&&(0===this.Dh||1===this.Dh&&this.lu(this.Kh[s]))&&(n>0&&n<110&&t?.Fl(4,n,this.Kh[s]+' '+this.Vh[s],m.A.hd),i++),5===e&&0===this.jh&&this.xh<2&&(n>0&&n<110&&t?.Fl(4,n,h,m.A.sd),i++),6===e&&0===this.jh&&this.xh<2&&(n>0&&n<110&&(t?.Fl(4,n,'To '+this.Kh[s]+':',m.A.Bl),t?.Fl(t.au('To '+this.Kh[s])+12,n,h,m.A.sd)),i++),8===e&&(0===this.Dh||1===this.Dh&&this.lu(this.Kh[s]))&&(n>0&&n<110&&t?.Fl(4,n,this.Kh[s]+' '+this.Vh[s],m.A.ed),i++)}u.A.Gu(),this.fh=14*i+7,this.fh<78&&(this.fh=78),this.tl(463,0,this.fh-this.uh-77,this.fh,77),0==$.K.rt?t?.Fl(3,90,this.qh+'*',m.A.Bl):1==$.K.rt?t?.Fl(3,90,this.qh+'*',m.A.BLUE):(t?.Fl(4,90,M.A.ga(this.username)+':',m.A.Bl),t?.Fl(t.au(this.username+': ')+6,90,this.qh+'*',m.A.BLUE)),u.A.nl(0,77,m.A.Bl,479)}else this.Al(c.A.Ro[this.Yh],0,0,0);this.Qs&&2===this.th&&this.Ju(),this.Fi?.draw(22,375),this.Pi?.bind(),this.Qi&&(d.A.oc=this.Qi)};Mf=()=>{if(this.Ni?.bind(),!this.Sr)return;const t=this.Fn+this.An&2047;let i=48+(this.Sr.x/32|0),s=464-(this.Sr.z/32|0);this.ws?.nd(21,9,146,151,this.hs,this.es,i,s,t,this.yn+256),this.As?.nd(0,0,33,33,this.ts,this.ss,25,25,this.Fn,256);for(let t=0;t{if(!i)return;const h=this.Fn+this.An&2047,e=s*s+t*t;if(e>6400)return;let n=d.A.sin[h],r=d.A.cos[h];n=256*n/(this.yn+256)|0,r=256*r/(this.yn+256)|0;const o=t*n+s*r>>16,l=t*r-s*n>>16;e>2500&&this.os?i.ad(o+94-(i.Pl/2|0),83-l-(i.fd/2|0),this.os):i.draw(o+94-(i.Pl/2|0),83-l-(i.fd/2|0))};ud=t=>{if(!this.ws)return;const i=this.ws.nc,s=i.length;for(let t=0;t>14&32767;const h=e.A.get(s).yd;if(h<0)continue;let n=t,r=i;if(22!==h&&29!==h&&34!==h&&36!==h&&46!==h&&47!==h&&48!==h){const s=G.A.Xn,h=G.A.Xn,e=this.kn[this.Dn];if(e){const o=e.flags;for(let e=0;e<10;e++){const e=4*Math.random()|0;0===e&&n>0&&n>t-3&&(o[G.A.index(n-1,r)]&H.A.pd)===H.A.OPEN&&n--,1===e&&n0&&r>i-3&&(o[G.A.index(n,r-1)]&H.A.Id)===H.A.OPEN&&r--,3===e&&r{if(!this.He||!this.ws)return;let r=this.He.Ed(s,t,i);if(0!==r){const o=this.He.gd(s,t,i,r),l=o>>6&3,a=31&o;let c=h;r>0&&(c=n);const f=this.ws.nc,u=4*t+512*(103-i)*4+24624,d=r>>14&32767,w=e.A.get(d);if(-1===w.Cd)a!==P.A.Td.id&&a!==P.A.Od.id||(l===F.A.bd?(f[u]=c,f[u+512]=c,f[u+1024]=c,f[u+1536]=c):l===F.A.vd?(f[u]=c,f[u+1]=c,f[u+2]=c,f[u+3]=c):l===F.A.Ld?(f[u+3]=c,f[u+3+512]=c,f[u+3+1024]=c,f[u+3+1536]=c):l===F.A.Rd&&(f[u+1536]=c,f[u+1536+1]=c,f[u+1536+2]=c,f[u+1536+3]=c)),a===P.A.Sd.id&&(l===F.A.bd?f[u]=c:l===F.A.vd?f[u+3]=c:l===F.A.Ld?f[u+3+1536]=c:l===F.A.Rd&&(f[u+1536]=c)),a===P.A.Od.id&&(l===F.A.Rd?(f[u]=c,f[u+512]=c,f[u+1024]=c,f[u+1536]=c):l===F.A.bd?(f[u]=c,f[u+1]=c,f[u+2]=c,f[u+3]=c):l===F.A.vd?(f[u+3]=c,f[u+3+512]=c,f[u+3+1024]=c,f[u+3+1536]=c):l===F.A.Ld&&(f[u+1536]=c,f[u+1536+1]=c,f[u+1536+2]=c,f[u+1536+3]=c));else{const s=this.ys[w.Cd];if(s){const h=(4*w.width-s.width)/2|0,e=(4*w.length-s.height)/2|0;s.draw(4*t+48+h,4*(G.A.Xn-i-w.length)+e+48)}}}if(r=this.He.Md(s,t,i),0!==r){const h=this.He.gd(s,t,i,r),n=h>>6&3,o=31&h,l=r>>14&32767,a=e.A.get(l);if(-1!==a.Cd){const s=this.ys[a.Cd];if(s){const h=(4*a.width-s.width)/2|0,e=(4*a.length-s.height)/2|0;s.draw(4*t+48+h,4*(G.A.Xn-i-a.length)+e+48)}}else if(o===P.A.kd.id){let s=15658734;r>0&&(s=15597568);const h=this.ws.nc,e=4*t+512*(G.A.Xn-1-i)*4+24624;n===F.A.bd||n===F.A.Ld?(h[e+1536]=s,h[e+1024+1]=s,h[e+512+2]=s,h[e+3]=s):(h[e]=s,h[e+512+1]=s,h[e+1024+2]=s,h[e+1536+3]=s)}}if(r=this.He.Ad(s,t,i),0!==r){const s=e.A.get(r>>14&32767);if(-1!==s.Cd){const h=this.ys[s.Cd];if(h){const e=(4*s.width-h.width)/2|0,n=(4*s.length-h.height)/2|0;h.draw(4*t+48+e,4*(G.A.Xn-i-s.length)+n+48)}}}};Qu=()=>{if(this.nh<2&&0===this.oe&&0===this.Ie)return;let t;t=1===this.oe&&this.nh<2?'Use '+this.fe+' with...':1===this.Ie&&this.nh<2?this.ge+'...':this.rh[this.nh-1],this.nh>2&&(t=t+'@whi@ / '+(this.nh-2)+' more options'),this.Ai?.xd(4,15,t,m.A._l,!0,this.Pt/1e3|0)};Ju=()=>{const t=this.ih,i=this.sh,s=this.hh,h=this.eh,e=m.A.Dd;u.A.fillRect(t,i,s,h,e),u.A.fillRect(t+1,i+1,s-2,16,m.A.Bl),u.A.Il(t+1,i+18,s-2,h-19,m.A.Bl),this.Ai?.Fl(t+3,i+14,'Choose Option',e);let n=this.xl,r=this.Dl;0===this.th&&(n-=8,r-=11),1===this.th&&(n-=562,r-=231),2===this.th&&(n-=22,r-=375);for(let h=0;ht&&ne-13&&r{if(0!==this.se)return;let t=this.Lc;if(1===this.Ie&&this.Rc>=520&&this.Sc>=165&&this.Rc<=788&&this.Sc<=230&&(t=0),this.Qs){if(1!==t){let t=this.xl,i=this.Dl;0===this.th?(t-=8,i-=11):1===this.th?(t-=562,i-=231):2===this.th&&(t-=22,i-=375),(tthis.ih+this.hh+10||ithis.sh+this.eh+10)&&(this.Qs=!1,1===this.th&&(this.Ws=!0),2===this.th&&(this.Ys=!0))}if(1===t){const t=this.ih,i=this.sh,s=this.hh;let h=this.Rc,e=this.Sc;0===this.th?(h-=8,e-=11):1===this.th?(h-=562,e-=231):2===this.th&&(h-=22,e-=375);let n=-1;for(let r=0;rt&&ho-13&&e0){const t=this.Te[this.nh-1];if(602===t||596===t||22===t||892===t||415===t||405===t||38===t||422===t||478===t||347===t||188===t){const t=this.be[this.nh-1],i=this.ve[this.nh-1];if(c.A.Ro[i].draggable)return this.re=!1,this.ne=0,this.te=i,this.ie=t,this.se=2,this.he=this.Rc,this.ee=this.Sc,c.A.Ro[i].Nd===this.Xs&&(this.se=1),void(c.A.Ro[i].Nd===this.lh&&(this.se=3))}}if(1===t&&(1===this.Ce||this.rf(this.nh-1))&&this.nh>2&&(t=2),1===t&&this.nh>0&&await this.af(this.nh-1),2!==t||this.nh<=0)return;this.lf()}};pf=()=>{if(1===this.Lc&&this.Sr){let t=this.Rc-21-561,i=this.Sc-9-5;if(t>=0&&i>=0&&t<146&&i<151){t-=73,i-=75;const s=this.Fn+this.An&2047;let h=d.A.sin[s],e=d.A.cos[s];h=h*(this.yn+256)>>8,e=e*(this.yn+256)>>8;const n=i*h+t*e>>11,r=i*e-t*h>>11,o=this.Sr.x+n>>7,l=this.Sr.z-r>>7;this.df(this.Sr.wf[0],this.Sr.Af[0],o,l,1,0,0,0,0,0,!0)&&(this.Bt.p1(t),this.Bt.p1(i),this.Bt.p2(this.Fn),this.Bt.p1(57),this.Bt.p1(this.An),this.Bt.p1(this.yn),this.Bt.p1(89),this.Bt.p2(this.Sr.x),this.Bt.p2(this.Sr.z),this.Bt.p1(this.Rr),this.Bt.p1(63))}}};rf=t=>{if(t<0)return!1;let i=this.Te[t];return i>=2e3&&(i-=2e3),406===i};af=async t=>{if(t<0)return;this.Wh&&(this.Wh=!1,this.Ys=!0);let i=this.Te[t];const s=this.Oe[t],h=this.be[t],r=this.ve[t];if(i>=2e3&&(i-=2e3),903===i||363===i){let s=this.rh[t];const h=s.indexOf('@whi@');if(-1!==h){s=s.substring(h+5).trim();const t=M.A.ga(M.A.Ca(M.A.ld(s)));let e=!1;for(let s=0;s=90&&this.Bt.jc(O.A.Hd),this.Bt.jc(O.A.Wd)):347===i?this.Bt.jc(O.A.Yd):422===i?this.Bt.jc(O.A.Vd):405===i?($.K.Et+=s,$.K.Et>=97&&(this.Bt.jc(O.A.Kd),this.Bt.p3(14953816)),this.Bt.jc(O.A.Xd)):38===i&&this.Bt.jc(O.A.zd),this.Bt.p2(s),this.Bt.p2(h),this.Bt.p2(r),this.Ae=0,this.we=r,this.de=h,this.ue=2,c.A.Ro[r].Nd===this.Xs&&(this.ue=1),c.A.Ro[r].Nd===this.lh&&(this.ue=3);else if(728===i||542===i||6===i||963===i||245===i){const t=this.Ar[s];t&&this.Sr&&(this.df(this.Sr.wf[0],this.Sr.Af[0],t.wf[0],t.Af[0],2,1,1,0,0,0,!1),this.qs=this.Rc,this.$s=this.Sc,this.js=2,this.Zs=0,542===i?this.Bt.jc(O.A.jd):6===i?(3&s||$.K._t++,$.K._t>=124&&(this.Bt.jc(O.A.Zd),this.Bt.p4(0)),this.Bt.jc(O.A.qd)):963===i?this.Bt.jc(O.A.$d):728===i?this.Bt.jc(O.A.Jd):245===i&&(3&s||$.K.gt++,$.K.gt>=85&&(this.Bt.jc(O.A.Qd),this.Bt.p2(39596)),this.Bt.jc(O.A.tw)),this.Bt.p2(s))}else if(217===i){if(this.Sr){this.df(this.Sr.wf[0],this.Sr.Af[0],h,r,2,0,0,0,0,0,!1)||this.df(this.Sr.wf[0],this.Sr.Af[0],h,r,2,1,1,0,0,0,!1),this.qs=this.Rc,this.$s=this.Sc,this.js=2,this.Zs=0,this.Bt.jc(O.A.iw),this.Bt.p2(h+this.Tn),this.Bt.p2(r+this.On),this.Bt.p2(s),this.Bt.p2(this.ce),this.Bt.p2(this.le),this.Bt.p2(this.ae)}}else if(1175===i){const t=s>>14&32767,i=e.A.get(t);let h;h=i.sw?i.sw:"It's a "+i.name+'.',this.Ud(0,h,'')}else if(285===i)this.Bd(O.A.hw,h,r,s);else if(881===i)this.Bt.jc(O.A.ew),this.Bt.p2(s),this.Bt.p2(h),this.Bt.p2(r),this.Bt.p2(this.ce),this.Bt.p2(this.le),this.Bt.p2(this.ae),this.Ae=0,this.we=r,this.de=h,this.ue=2,c.A.Ro[r].Nd===this.Xs&&(this.ue=1),c.A.Ro[r].Nd===this.lh&&(this.ue=3);else if(391===i)this.Bt.jc(O.A.nw),this.Bt.p2(s),this.Bt.p2(h),this.Bt.p2(r),this.Bt.p2(this._e),this.Ae=0,this.we=r,this.de=h,this.ue=2,c.A.Ro[r].Nd===this.Xs&&(this.ue=1),c.A.Ro[r].Nd===this.lh&&(this.ue=3);else if(660===i)this.Qs?this.He?.click(h-8,r-11):this.He?.click(this.Rc-8,this.Sc-11);else{if(188===i)return this.oe=1,this.le=h,this.ae=r,this.ce=s,this.fe=n.A.get(s).name,void(this.Ie=0);if(44===i)this.ye||(this.Bt.jc(O.A.rw),this.Bt.p2(r),this.ye=!0);else if(1773===i){const t=n.A.get(s);let i;i=r>=1e5?r+' x '+t.name:t.sw?t.sw:"It's a "+t.name+'.',this.Ud(0,i,'')}else if(900===i){const t=this.Ar[s];t&&this.Sr&&(this.df(this.Sr.wf[0],this.Sr.Af[0],t.wf[0],t.Af[0],2,1,1,0,0,0,!1),this.qs=this.Rc,this.$s=this.Sc,this.js=2,this.Zs=0,this.Bt.jc(O.A.ow),this.Bt.p2(s),this.Bt.p2(this.ce),this.Bt.p2(this.le),this.Bt.p2(this.ae))}else if(1373===i||1544===i||151===i||1101===i){const t=this.nr[s];t&&this.Sr&&(this.df(this.Sr.wf[0],this.Sr.Af[0],t.wf[0],t.Af[0],2,1,1,0,0,0,!1),this.qs=this.Rc,this.$s=this.Sc,this.js=2,this.Zs=0,1101===i?this.Bt.jc(O.A.Fd):151===i?($.K.bt++,$.K.bt>=90&&(this.Bt.jc(O.A.lw),this.Bt.p2(31114)),this.Bt.jc(O.A.aw)):1373===i?this.Bt.jc(O.A.Pd):1544===i&&this.Bt.jc(O.A.cw),this.Bt.p2(s))}else if(265===i){const t=this.Ar[s];t&&this.Sr&&(this.df(this.Sr.wf[0],this.Sr.Af[0],t.wf[0],t.Af[0],2,1,1,0,0,0,!1),this.qs=this.Rc,this.$s=this.Sc,this.js=2,this.Zs=0,this.Bt.jc(O.A.fw),this.Bt.p2(s),this.Bt.p2(this._e))}else if(679===i){const i=this.rh[t],s=i.indexOf('@whi@');if(-1!==s){const t=M.A.ld(i.substring(s+5).trim());let h=-1;for(let i=0;i0&&(this.Ys=!0,this.Wh=!1,this.Fh=!0,this.Bh='',this.Gh=3,this.no=this.ho[h],this.Uh='Enter message to send to '+this.so[h])}}else if(55===i)this.Bd(O.A.uw,h,r,s)&&this.Bt.p2(this._e);else if(224===i||993===i||99===i||746===i||877===i){if(this.Sr){this.df(this.Sr.wf[0],this.Sr.Af[0],h,r,2,0,0,0,0,0,!1)||this.df(this.Sr.wf[0],this.Sr.Af[0],h,r,2,1,1,0,0,0,!1),this.qs=this.Rc,this.$s=this.Sc,this.js=2,this.Zs=0,224===i?this.Bt.jc(O.A.dw):746===i?this.Bt.jc(O.A.ww):877===i?this.Bt.jc(O.A.Aw):99===i?this.Bt.jc(O.A.yw):993===i&&this.Bt.jc(O.A.pw),this.Bt.p2(h+this.Tn),this.Bt.p2(r+this.On),this.Bt.p2(s)}}else if(1607===i){const t=this.Ar[s];if(t&&t.type){let i;i=t.type.sw?t.type.sw:"It's a "+t.type.name+'.',this.Ud(0,i,'')}}else if(504===i)this.Bd(O.A.mw,h,r,s);else{if(930===i){const t=c.A.Ro[r];this.Ie=1,this._e=r,this.Ee=t.Iw,this.oe=0;let i=t._w;i&&-1!==i.indexOf(' ')&&(i=i.substring(0,i.indexOf(' ')));let s=t._w;return s&&-1!==s.indexOf(' ')&&(s=s.substring(s.indexOf(' ')+1)),this.ge=i+' '+t.action+' '+s,void(16===this.Ee&&(this.Ws=!0,this.Sh=3,this.Vs=!0))}if(951===i){const t=c.A.Ro[r];let i=!0;t.El>0&&(i=this.Ew(t)),i&&(this.Bt.jc(O.A.gw),this.Bt.p2(r))}else if(602===i||596===i||22===i||892===i||415===i)22===i?this.Bt.jc(O.A.Cw):415===i?(3&r||$.K.Ot++,$.K.Ot>=55&&(this.Bt.jc(O.A.Tw),this.Bt.p4(0)),this.Bt.jc(O.A.Ow)):602===i?this.Bt.jc(O.A.bw):892===i?(3&h||$.K.vt++,$.K.vt>=130&&(this.Bt.jc(O.A.Lw),this.Bt.p1(177)),this.Bt.jc(O.A.Rw)):596===i&&this.Bt.jc(O.A.Sw),this.Bt.p2(s),this.Bt.p2(h),this.Bt.p2(r),this.Ae=0,this.we=r,this.de=h,this.ue=2,c.A.Ro[r].Nd===this.Xs&&(this.ue=1),c.A.Ro[r].Nd===this.lh&&(this.ue=3);else if(581===i)3&s||$.K.It++,$.K.It>=99&&(this.Bt.jc(O.A.Mw),this.Bt.p4(0)),this.Bd(O.A.kw,h,r,s);else if(965===i){if(this.Sr){this.df(this.Sr.wf[0],this.Sr.Af[0],h,r,2,0,0,0,0,0,!1)||this.df(this.Sr.wf[0],this.Sr.Af[0],h,r,2,1,1,0,0,0,!1),this.qs=this.Rc,this.$s=this.Sc,this.js=2,this.Zs=0,this.Bt.jc(O.A.xw),this.Bt.p2(h+this.Tn),this.Bt.p2(r+this.On),this.Bt.p2(s),this.Bt.p2(this._e)}}else if(1501===i)$.K.Tt+=this.On,$.K.Tt>=92&&(this.Bt.jc(O.A.Dw),this.Bt.p4(0)),this.Bd(O.A.Nw,h,r,s);else if(364===i)this.Bd(O.A.Pw,h,r,s);else if(1102===i){const t=n.A.get(s);let i;i=t.sw?t.sw:"It's a "+t.name+'.',this.Ud(0,i,'')}else if(960===i){this.Bt.jc(O.A.gw),this.Bt.p2(r);const t=c.A.Ro[r];if(t.scripts&&t.scripts[0]&&5===t.scripts[0][0]){const i=t.scripts[0][1];t.Qo&&this.pe[i]!==t.Qo[0]&&(this.pe[i]=t.Qo[0],await this.Fw(i),this.Ws=!0)}}else if(34===i){const i=this.rh[t],s=i.indexOf('@whi@');if(-1!==s){this.Uw(),this.Me=i.substring(s+5).trim(),this.ke=!1;for(let t=0;t{const i=t.El;if(i===c.A.Kw&&(this.Ys=!0,this.Wh=!1,this.Fh=!0,this.Bh='',this.Gh=1,this.Uh='Enter name of friend to add to list'),i===c.A.Xw&&(this.Ys=!0,this.Wh=!1,this.Fh=!0,this.Bh='',this.Gh=2,this.Uh='Enter name of friend to delete from list'),i===c.A.zw)return this.Yt=250,!0;if(i===c.A.jw&&(this.Ys=!0,this.Wh=!1,this.Fh=!0,this.Bh='',this.Gh=4,this.Uh='Enter name of player to add to list'),i===c.A.Zw&&(this.Ys=!0,this.Wh=!1,this.Fh=!0,this.Bh='',this.Gh=5,this.Uh='Enter name of player to delete from list'),i>=c.A.qw&&i<=c.A.$w){const t=(i-300)/2|0,s=1&i;let h=this.Wr[t];if(-1!==h)for(;;)if(0===s&&(h--,h<0&&(h=o.A.count-1)),1===s&&(h++,h>=o.A.count&&(h=0)),!o.A.Ro[h].disable&&o.A.Ro[h].type===t+(this.Gr?0:7)){this.Wr[t]=h,this.Hr=!0;break}}if(i>=c.A.Jw&&i<=c.A.Qw){const t=(i-314)/2|0,s=1&i;let h=this.Yr[t];0===s&&(h--,h<0&&(h=W.A.La[t].length-1)),1===s&&(h++,h>=W.A.La[t].length&&(h=0)),this.Yr[t]=h,this.Hr=!0}if(i!==c.A.Da||this.Gr||(this.Gr=!0,this.Vc()),i===c.A.Na&&this.Gr&&(this.Gr=!1,this.Vc()),i===c.A.tA){this.Bt.jc(O.A.iA),this.Bt.p1(this.Gr?0:1);for(let t=0;t<7;t++)this.Bt.p1(this.Wr[t]);for(let t=0;t<5;t++)this.Bt.p1(this.Yr[t]);return!0}return i===c.A.Fa&&(this.ke=!this.ke),i>=c.A.sA&&i<=c.A.hA&&(this.Uw(),this.Me.length>0&&(this.Bt.jc(O.A.eA),this.Bt.nA(M.A.ld(this.Me)),this.Bt.p1(i-601),this.Bt.p1(this.ke?1:0))),!1};Vc=()=>{this.Hr=!0;for(let t=0;t<7;t++){this.Wr[t]=-1;for(let i=0;i{if(!this.Sr||!this.He)return!1;const n=h>>14&32767,r=this.He.gd(this.Dn,i,s,h);if(-1===r)return!1;const o=31&r,l=r>>6&3;if(o===P.A.rA.id||o===P.A.oA.id||o===P.A.lA.id){const t=e.A.get(n);let h,r;l===F.A.bd||l===F.A.Ld?(h=t.width,r=t.length):(h=t.length,r=t.width);let o=t.aA;0!==l&&(o=(o<>4-l)),this.df(this.Sr.wf[0],this.Sr.Af[0],i,s,2,h,r,0,0,o,!1)}else this.df(this.Sr.wf[0],this.Sr.Af[0],i,s,2,0,0,l,o+1,0,!1);return this.qs=this.Rc,this.$s=this.Sc,this.js=2,this.Zs=0,this.Bt.jc(t),this.Bt.p2(i+this.Tn),this.Bt.p2(s+this.On),this.Bt.p2(n),!0};mf=()=>{1===this.Lc&&(this.Rc>=549&&this.Rc<=583&&this.Sc>=195&&this.Sc<231&&-1!==this.Mh[0]?(this.Ws=!0,this.Sh=0,this.Vs=!0):this.Rc>=579&&this.Rc<=609&&this.Sc>=194&&this.Sc<231&&-1!==this.Mh[1]?(this.Ws=!0,this.Sh=1,this.Vs=!0):this.Rc>=607&&this.Rc<=637&&this.Sc>=194&&this.Sc<231&&-1!==this.Mh[2]?(this.Ws=!0,this.Sh=2,this.Vs=!0):this.Rc>=635&&this.Rc<=679&&this.Sc>=194&&this.Sc<229&&-1!==this.Mh[3]?(this.Ws=!0,this.Sh=3,this.Vs=!0):this.Rc>=676&&this.Rc<=706&&this.Sc>=194&&this.Sc<231&&-1!==this.Mh[4]?(this.Ws=!0,this.Sh=4,this.Vs=!0):this.Rc>=704&&this.Rc<=734&&this.Sc>=194&&this.Sc<231&&-1!==this.Mh[5]?(this.Ws=!0,this.Sh=5,this.Vs=!0):this.Rc>=732&&this.Rc<=766&&this.Sc>=195&&this.Sc<231&&-1!==this.Mh[6]?(this.Ws=!0,this.Sh=6,this.Vs=!0):this.Rc>=550&&this.Rc<=584&&this.Sc>=492&&this.Sc<528&&-1!==this.Mh[7]?(this.Ws=!0,this.Sh=7,this.Vs=!0):this.Rc>=582&&this.Rc<=612&&this.Sc>=492&&this.Sc<529&&-1!==this.Mh[8]?(this.Ws=!0,this.Sh=8,this.Vs=!0):this.Rc>=609&&this.Rc<=639&&this.Sc>=492&&this.Sc<529&&-1!==this.Mh[9]?(this.Ws=!0,this.Sh=9,this.Vs=!0):this.Rc>=637&&this.Rc<=681&&this.Sc>=493&&this.Sc<528&&-1!==this.Mh[10]?(this.Ws=!0,this.Sh=10,this.Vs=!0):this.Rc>=679&&this.Rc<=709&&this.Sc>=492&&this.Sc<529&&-1!==this.Mh[11]?(this.Ws=!0,this.Sh=11,this.Vs=!0):this.Rc>=706&&this.Rc<=736&&this.Sc>=492&&this.Sc<529&&-1!==this.Mh[12]?(this.Ws=!0,this.Sh=12,this.Vs=!0):this.Rc>=734&&this.Rc<=768&&this.Sc>=492&&this.Sc<528&&-1!==this.Mh[13]&&(this.Ws=!0,this.Sh=13,this.Vs=!0),$.K.ft++,$.K.ft>150&&($.K.ft=0,this.Bt.jc(O.A.cA),this.Bt.p1(43)))};Cf=async()=>{for(;;){let t;do{for(;;){if(t=this.kc(),-1===t)return;if(-1!==this.Xs&&this.Xs===this.xe){8===t&&this.Me.length>0&&(this.Me=this.Me.substring(0,this.Me.length-1));break}if(this.Fh){if(t>=32&&t<=122&&this.Bh.length<80&&(this.Bh=this.Bh+String.fromCharCode(t),this.Ys=!0),8===t&&this.Bh.length>0&&(this.Bh=this.Bh.substring(0,this.Bh.length-1),this.Ys=!0),13===t||10===t){let t;if(this.Fh=!1,this.Ys=!0,1===this.Gh&&(t=M.A.ld(this.Bh),this.Gw(t)),2===this.Gh&&this.Vr>0&&(t=M.A.ld(this.Bh),this.Ww(t)),3===this.Gh&&this.Bh.length>0&&this.no){this.Bt.jc(O.A.fA),this.Bt.p1(0);const t=this.Bt.Fc;this.Bt.nA(this.no),v.A.uA(this.Bt,this.Bh),this.Bt.Hf(this.Bt.Fc-t),this.Bh=M.A.dA(this.Bh),this.Bh=b.A.filter(this.Bh),this.Ud(6,this.Bh,M.A.ga(M.A.Ca(this.no))),2===this.xh&&(this.xh=1,this.Ks=!0,this.Bt.jc(O.A.wA),this.Bt.p1(this.kh),this.Bt.p1(this.xh),this.Bt.p1(this.Dh))}4===this.Gh&&this.dh<100&&(t=M.A.ld(this.Bh),this.Hw(t)),5===this.Gh&&this.dh>0&&(t=M.A.ld(this.Bh),this.Yw(t))}}else if(this.Wh){if(t>=48&&t<=57&&this.Hh.length<10&&(this.Hh=this.Hh+String.fromCharCode(t),this.Ys=!0),8===t&&this.Hh.length>0&&(this.Hh=this.Hh.substring(0,this.Hh.length-1),this.Ys=!0),13===t||10===t){if(this.Hh.length>0){let t=0;try{t=parseInt(this.Hh,10)}catch(t){}this.Bt.jc(O.A.AA),this.Bt.p4(t)}this.Wh=!1,this.Ys=!0}}else if(-1===this.lh&&(t>=32&&t<=122&&this.qh.length<80&&(this.qh=this.qh+String.fromCharCode(t),this.Ys=!0),8===t&&this.qh.length>0&&(this.qh=this.qh.substring(0,this.qh.length-1),this.Ys=!0),(13===t||10===t)&&this.qh.length>0)){if('::clientdrop'===this.qh)await this.qc();else if(this.Br&&'::noclip'===this.qh)for(let t=0;t122)&&(t<65||t>90)&&(t<48||t>57)&&32!==t);this.Me.length<12&&(this.Me=this.Me+String.fromCharCode(t))}};If=()=>{if(1===this.Lc)if(this.Rc>=8&&this.Rc<=108&&this.Sc>=490&&this.Sc<=522)this.kh=(this.kh+1)%4,this.Ks=!0,this.Ys=!0,this.Bt.jc(O.A.wA),this.Bt.p1(this.kh),this.Bt.p1(this.xh),this.Bt.p1(this.Dh);else if(this.Rc>=137&&this.Rc<=237&&this.Sc>=490&&this.Sc<=522)this.xh=(this.xh+1)%3,this.Ks=!0,this.Ys=!0,this.Bt.jc(O.A.wA),this.Bt.p1(this.kh),this.Bt.p1(this.xh),this.Bt.p1(this.Dh);else if(this.Rc>=275&&this.Rc<=375&&this.Sc>=490&&this.Sc<=522)this.Dh=(this.Dh+1)%3,this.Ks=!0,this.Ys=!0,this.Bt.jc(O.A.wA),this.Bt.p1(this.kh),this.Bt.p1(this.xh),this.Bt.p1(this.Dh);else if(this.Rc>=416&&this.Rc<=516&&this.Sc>=490&&this.Sc<=522){this.Uw(),this.Me='',this.ke=!1;for(let t=0;t{if(this.Nh?this.Ph=32:this.Ph=0,this.Nh=!1,t>=n&&t=r&&i=n&&t=r+h-16&&i=n-this.Ph&&t=r+16&&i0){let t=(h-32)*h/s|0;t<8&&(t=8);const n=i-r-(t/2|0)-16,l=h-t-32;o.Tl=(s-h)*n/l|0,e&&(this.Ws=!0),this.Nh=!0}};Kc=()=>{this.Fi||(this.Lo(),this.Mo=null,this.ti=null,this.ii=null,this.si=null,this.hi=null,this.ei=null,this.ni=null,this.ri=null,this.oi=null,this.li=null,this.Fi=new f.A(479,96),this.Ni=new f.A(168,160),u.A.clear(),this.os?.draw(0,0),this.Di=new f.A(190,261),this.Pi=new f.A(512,334),u.A.clear(),this.Ui=new f.A(501,61),this.Bi=new f.A(288,40),this.Gi=new f.A(269,66),this.$t=!0)};lu=t=>{if(!t)return!1;for(let i=0;i{if(0n===t)return;if(this.Vr>=100)return void this.Ud(0,'Your friends list is full. Max of 100 hit','');const i=M.A.ga(M.A.Ca(t));for(let s=0;s{if(0n!==t)for(let i=0;i{if(0n===t)return;if(this.dh>=100)return void this.Ud(0,'Your ignore list is full. Max of 100 hit','');const i=M.A.ga(M.A.Ca(t));for(let s=0;s{if(0n!==t)for(let i=0;i{const s=this.gr[this.Dn][t][i];if(!s)return void this.He?.TA(this.Dn,t,i);let h=-99999999,e=null;for(let t=s.head();t;t=s.next()){const i=n.A.get(t.index);let s=i.OA;i.da&&(s*=t.count+1),s>h&&(h=s,e=t)}if(!e)return;s.bA(e);let r=-1,o=-1,l=0,a=0;for(let t=s.head();t;t=s.next())t.index!==e.index&&-1===r&&(r=t.index,l=t.count),t.index!==e.index&&t.index!==r&&-1===o&&(o=t.index,a=t.count);let c=null;-1!==r&&(c=n.A.get(r).vA(l));let f=null;-1!==o&&(f=n.A.get(o).vA(a));const u=t+(i<<7)+1610612736|0,d=n.A.get(e.index);this.He?.LA(t,i,this.Bf(this.Dn,128*t+64,128*i+64),this.Dn,u,d.vA(e.count),f,c)};RA=(t,i,s,h,n,r,o)=>{if(i<1||s<1||i>102||s>102)return;if($.K.st&&t!==this.Dn)return;if(!this.He)return;let l=0;if(o===N.A.SA&&(l=this.He.Ed(t,i,s)),o===N.A.MA&&(l=this.He.kA(t,s,i)),o===N.A.xA&&(l=this.He.Md(t,i,s)),o===N.A.lA&&(l=this.He.Ad(t,i,s)),0!==l){const h=this.He.gd(t,i,s,l),n=l>>14&32767,r=31&h,a=h>>6;if(o===N.A.SA){this.He?.DA(t,i,s,1);const h=e.A.get(n);h.NA&&this.kn[t]?.DA(i,s,r,a,h.PA)}if(o===N.A.MA&&this.He?.FA(t,i,s),o===N.A.xA){this.He.UA(t,i,s);const h=e.A.get(n);if(i+h.width>G.A.Xn-1||s+h.width>G.A.Xn-1||i+h.length>G.A.Xn-1||s+h.length>G.A.Xn-1)return;h.NA&&this.kn[t]?.UA(i,s,h.width,h.length,a,h.PA)}if(o===N.A.lA){this.He?.BA(t,i,s);const h=e.A.get(n);h.NA&&h.active&&this.kn[t]?.GA(i,s)}}if(h>=0){let e=t;this.Yn&&t<3&&!(2&~this.Yn[1][i][s])&&(e=t+1),this.Wn&&D.A.RA(t,i,s,this.He,this.Wn,this._r,this.kn[t],h,r,n,e)}};Uw=()=>{this.Bt.jc(O.A.HA),-1!==this.oh&&(this.oh=-1,this.Ws=!0,this.ye=!1,this.Vs=!0),-1!==this.lh&&(this.lh=-1,this.Ys=!0,this.ye=!1),this.Xs=-1};qc=async()=>{this.Yt>0?await this.WA():(this.Pi?.bind(),this.wi?.Ac(257,144,'Connection lost',m.A.Bl),this.wi?.Ac(256,143,'Connection lost',m.A._l),this.wi?.Ac(257,159,'Please wait - attempting to reestablish',m.A.Bl),this.wi?.Ac(256,158,'Please wait - attempting to reestablish',m.A._l),this.Pi?.draw(8,11),this.Ke=0,this.stream?.close(),this.ac=!1,await this.Mc(this.username,this.password,!0),this.ac||await this.WA())};WA=async()=>{this.stream&&this.stream.close(),this.stream=null,this.ac=!1,this.Jt=0,this.username='',this.password='',k.A.Wc(),this.Qf(),this.He?.reset();for(let t=0;t{if(!this.stream)return!1;try{let t=this.stream.available;if(0===t)return!1;if(-1===this.Xt&&(await this.stream.Pc(this.in.data,0,1),this.Xt=255&this.in.data[0],this.Kt&&(this.Xt=this.Xt-this.Kt.YA&255),this.packetSize=E.A.VA[this.Xt],t--),-1===this.packetSize){if(t<=0)return!1;await this.stream.Pc(this.in.data,0,1),this.packetSize=255&this.in.data[0],t--}if(-2===this.packetSize){if(t<=1)return!1;await this.stream.Pc(this.in.data,0,2),this.in.Fc=0,this.packetSize=this.in.KA,t-=2}if(t0&&this.Ud(5,s+' has logged in.',''),0===i&&this.Ud(5,s+' has logged out.','')),s=null;break}s&&this.Vr<100&&(this.ho[this.Vr]=t,this.so[this.Vr]=s,this.eo[this.Vr]=i,this.Vr++,this.Ws=!0);let h=!1;for(;!h;){h=!0;for(let t=0;t=0&&h>=0&&s=G.A.Xn||t.z>=G.A.Xn)&&t.sy();return 0!==this.Ke&&(this.Ke-=e,this.Xe-=n),this.ze=!1,this.Xt=-1,!0}if(this.Xt===T.A.hy)return c.A.Ro[this.in.KA].model=this.Sr?.ey()||null,this.Xt=-1,!0;if(this.Xt===T.A.ny)return this.Ah=this.in.ZA,1===this.Ah&&(this.yh=this.in.KA),this.Ah>=2&&this.Ah<=6&&(2===this.Ah&&(this.ph=64,this.mh=64),3===this.Ah&&(this.ph=0,this.mh=64),4===this.Ah&&(this.ph=128,this.mh=64),5===this.Ah&&(this.ph=64,this.mh=0),6===this.Ah&&(this.ph=64,this.mh=128),this.Ah=2,this._h=this.in.KA,this.Eh=this.in.KA,this.gh=this.in.ZA),10===this.Ah&&(this.Ih=this.in.KA),this.Xt=-1,!0;if(this.Xt===T.A.oy){const t=this.in.ly,i=this.in.Ko,s=this.in.Ko;return t!==this.mo&&this.po&&!$.K.st&&await this.Vo(t,i,s),this.mo=t,this.Io=i,this._o=s,this.yo=0,this.Xt=-1,!0}if(this.Xt===T.A.uy)return await this.WA(),this.Xt=-1,!1;if(this.Xt===T.A.wy){const t=this.in.ZA,i=this.in.ZA;let s=-1;if(this.Ln)for(let h=0;h=100&&(this.ln=128*this.tr+64,this.cn=128*this.ir+64,this.an=this.Bf(this.Dn,this.tr,this.ir)-this.sr),this.Xt=-1,!0;if(this.Xt===T.A.sp){this._n=this.in.ZA,this.En=this.in.ZA;for(let t=this._n;t=this._n&&t.x=this.En&&t.z1?this.Ud(7,e,M.A.ga(M.A.Ca(t))):this.Ud(3,e,M.A.ga(M.A.Ca(t)))}catch(t){}return this.Xt=-1,!0}if(this.Xt===T.A.lp){for(let t=0;t=100){const t=128*this.Zn+64,i=128*this.qn+64,s=this.Bf(this.Dn,this.Zn,this.qn)-this.$n,h=t-this.ln,e=s-this.an,n=i-this.cn,r=0|Math.sqrt(h*h+n*n);this.fn=325.949*Math.atan2(e,r)&2047,this.un=-325.949*Math.atan2(h,n)&2047,this.fn<128&&(this.fn=128),this.fn>383&&(this.fn=383)}return this.Xt=-1,!0}if(this.Xt===T.A.dp)return this.Sh=this.in.ZA,this.Ws=!0,this.Vs=!0,this.Xt=-1,!0;if(this.Xt===T.A.wp){const t=this.in.ly;let i;if(t.endsWith(':tradereq:')){const s=t.substring(0,t.indexOf(':'));i=M.A.ld(s);let h=!1;for(let t=0;t>10&31,h=i>>5&31,e=31&i;return c.A.Ro[t].Yl=(s<<19)+(h<<11)+(e<<3),this.Xt=-1,!0}if(this.Xt===T.A.Ep){for(let t=0;t=this.bh[s]&&(this.Oh[t]=s+2);return this.Xt=-1,!0}if(this.Xt===T.A.Lp){for(this._n=this.in.ZA,this.En=this.in.ZA;this.in.Fc=0&&t{try{this.In=-1,this.Er.clear(),this._r.clear(),this.Ir.clear(),this.mr.clear(),d.A.Pp(),this.Qf(),this.He?.reset();for(let t=0;t>8,s=255&this.Ln[t];if(33===i&&s>=71&&s<=73){D.A.st=!1;break}}if($.K.st?this.He?.Fp(this.Dn):this.He?.Fp(0),this.Ln&&this.bn){this.Bt.jc(O.A.bf);for(let s=0;s>8)-this.Tn,h=64*(255&this.Ln[s])-this.On,e=this.bn[s];if(e){const s=new I.A(new Uint8Array(e)).Ko,n=R.A.read(s,e,e.length-4,4);t.Up(8*(this.gn-6),8*(this.Cn-6),i,h,n)}else this.Cn<800&&t.Bp(h,i,64,64)}}if(this.Ln&&this.vn){this.Bt.jc(O.A.bf);for(let s=0;s>8)-this.Tn,r=64*(255&this.Ln[s])-this.On;t.Gp(this.He,this._r,this.kn,e,n,r)}}}this.Bt.jc(O.A.bf),t.Hp(this.He,this.kn),this.Pi?.bind(),this.Bt.jc(O.A.bf);for(let t=this._r.head();t;t=this._r.next())2===(this.Yn&&2&this.Yn[1][t.Wp][t.Yp])&&(t.Vp--,t.Vp<0&&t.sy());for(let t=0;t{const i=c.A.Ro[t];if(i.ll)for(let t=0;t{let t=0;for(let i=0;i<99;i++){const s=i+1;t+=s+300*Math.pow(2,s/7)|0,this.bh[i]=t/4|0}};Ud=(t,i,s)=>{0===t&&-1!==this.Yh&&(this.Lh=i,this.Lc=0),-1===this.lh&&(this.Ys=!0);for(let t=99;t>0;t--)this.messageType[t]=this.messageType[t-1],this.Kh[t]=this.Kh[t-1],this.Vh[t]=this.Vh[t-1];$.K.nt&&0===t&&(i='['+(this.Pt/30|0)+']: '+i),this.messageType[0]=t,this.Kh[0]=s,this.Vh[0]=i};Fw=async t=>{const i=a.A.Ro[t].Xp;if(0!==i){const s=this.pe[t];if(1===i&&(1===s&&d.A.sc(.9),2===s&&d.A.sc(.8),3===s&&d.A.sc(.7),4===s&&d.A.sc(.6),n.A.su?.clear(),this.$t=!0),3===i){const t=this.po;0===s&&(this.Eo=256,(0,j.zp)(256),this.po=!0),1===s&&(this.Eo=192,(0,j.zp)(192),this.po=!0),2===s&&(this.Eo=128,(0,j.zp)(128),this.po=!0),3===s&&(this.Eo=64,(0,j.zp)(64),this.po=!0),4===s&&(this.po=!1),this.po!==t&&(this.po&&this.mo?await this.Vo(this.mo,this.Io,this._o):(0,j.vo)(),this.yo=0)}4===i&&(0===s&&(this.fo=256,(0,j.jp)(256),this.oo=!0),1===s&&(this.fo=192,(0,j.jp)(192),this.oo=!0),2===s&&(this.fo=128,(0,j.jp)(128),this.oo=!0),3===s&&(this.fo=64,(0,j.jp)(64),this.oo=!0),4===s&&(this.oo=!1)),5===i&&(this.Ce=s),6===i&&(this.Zh=s),8===i&&(this.jh=s,this.Ys=!0)}};Zp=(t,i)=>{let s=0;for(let t=0;t<100;t++){if(!this.Vh[t])continue;const h=this.messageType[t],e=this.uh+70+4-14*s;if(e<-20)break;0===h&&s++,1!==h&&2!==h||!(1===h||0===this.kh||1===this.kh&&this.lu(this.Kh[t]))||(i>e-14&&i<=e&&this.Sr&&this.Kh[t]!==this.Sr.name&&(this.Br&&(this.rh[this.nh]='Report abuse @whi@'+this.Kh[t],this.Te[this.nh]=34,this.nh++),this.rh[this.nh]='Add ignore @whi@'+this.Kh[t],this.Te[this.nh]=436,this.nh++,this.rh[this.nh]='Add friend @whi@'+this.Kh[t],this.Te[this.nh]=406,this.nh++),s++),3!==h&&7!==h||0!==this.jh||!(7===h||0===this.xh||1===this.xh&&this.lu(this.Kh[t]))||(i>e-14&&i<=e&&(this.Br&&(this.rh[this.nh]='Report abuse @whi@'+this.Kh[t],this.Te[this.nh]=34,this.nh++),this.rh[this.nh]='Add ignore @whi@'+this.Kh[t],this.Te[this.nh]=436,this.nh++,this.rh[this.nh]='Add friend @whi@'+this.Kh[t],this.Te[this.nh]=406,this.nh++),s++),4===h&&(0===this.Dh||1===this.Dh&&this.lu(this.Kh[t]))&&(i>e-14&&i<=e&&(this.rh[this.nh]='Accept trade @whi@'+this.Kh[t],this.Te[this.nh]=903,this.nh++),s++),(5===h||6===h)&&0===this.jh&&this.xh<2&&s++,8===h&&(0===this.Dh||1===this.Dh&&this.lu(this.Kh[t]))&&(i>e-14&&i<=e&&(this.rh[this.nh]='Accept duel @whi@'+this.Kh[t],this.Te[this.nh]=363,this.nh++),s++)}};qp=t=>{if(0===this.jh)return;let i=0;0!==this.Vt&&(i=1);for(let s=0;s<100;s++)if(null!==this.Vh[s]){const h=this.messageType[s];if((3===h||7===h)&&(7===h||0===this.xh||1===this.xh&&this.lu(this.Kh[s]))){const h=329-13*i;if(this.xl>8&&this.xl<520&&t-11>h-10&&t-11<=h+3&&(this.Br&&(this.rh[this.nh]='Report abuse @whi@'+this.Kh[s],this.Te[this.nh]=2034,this.nh++),this.rh[this.nh]='Add ignore @whi@'+this.Kh[s],this.Te[this.nh]=2436,this.nh++,this.rh[this.nh]='Add friend @whi@'+this.Kh[s],this.Te[this.nh]=2406,this.nh++),i++,i>=5)return}if((5===h||6===h)&&this.xh<2&&(i++,i>=5))return}};$p=(t,i,s,h,e,r)=>{if(0!==t.type||!t.ll||t.hide||ih+t.width||s>e+t.height||!t.pl||!t.ml)return;const o=t.ll.length;for(let l=0;l=0||0!==f.Kl)&&i>=o&&s>=a&&i=0?this.Se=f.Jp:this.Se=f.id),0===f.type)this.$p(f,i,s,o,a,f.Tl),f.scroll>f.height&&this.Rf(i,s,f.scroll,f.height,!0,o+f.width,a,f);else if(2===f.type){let t=0;for(let h=0;h=r+32||s>=l+32){t++;continue}if(this.Re=t,this.Le=f.id,!f.Ll||f.Ll[t]<=0){t++;continue}const c=n.A.get(f.Ll[t]-1);if(1===this.oe&&f.Qp)f.id===this.ae&&t===this.le||(this.rh[this.nh]='Use '+this.fe+' with @lre@'+c.name,this.Te[this.nh]=881,this.Oe[this.nh]=c.id,this.be[this.nh]=t,this.ve[this.nh]=f.id,this.nh++);else if(1===this.Ie&&f.Qp)16&~this.Ee||(this.rh[this.nh]=this.ge+' @lre@'+c.name,this.Te[this.nh]=391,this.Oe[this.nh]=c.id,this.be[this.nh]=t,this.ve[this.nh]=f.id,this.nh++);else{if(f.Qp)for(let i=4;i>=3;i--)c.tm&&c.tm[i]?(this.rh[this.nh]=c.tm[i]+' @lre@'+c.name,3===i?this.Te[this.nh]=478:4===i&&(this.Te[this.nh]=347),this.Oe[this.nh]=c.id,this.be[this.nh]=t,this.ve[this.nh]=f.id,this.nh++):4===i&&(this.rh[this.nh]='Drop @lre@'+c.name,this.Te[this.nh]=347,this.Oe[this.nh]=c.id,this.be[this.nh]=t,this.ve[this.nh]=f.id,this.nh++);if(f.im&&(this.rh[this.nh]='Use @lre@'+c.name,this.Te[this.nh]=188,this.Oe[this.nh]=c.id,this.be[this.nh]=t,this.ve[this.nh]=f.id,this.nh++),f.Qp&&c.tm)for(let i=2;i>=0;i--)c.tm[i]&&(this.rh[this.nh]=c.tm[i]+' @lre@'+c.name,0===i?this.Te[this.nh]=405:1===i?this.Te[this.nh]=38:2===i&&(this.Te[this.nh]=422),this.Oe[this.nh]=c.id,this.be[this.nh]=t,this.ve[this.nh]=f.id,this.nh++);if(f.sm)for(let i=4;i>=0;i--)f.sm[i]&&(this.rh[this.nh]=f.sm[i]+' @lre@'+c.name,0===i?this.Te[this.nh]=602:1===i?this.Te[this.nh]=596:2===i?this.Te[this.nh]=22:3===i?this.Te[this.nh]=892:4===i&&(this.Te[this.nh]=415),this.Oe[this.nh]=c.id,this.be[this.nh]=t,this.ve[this.nh]=f.id,this.nh++);this.rh[this.nh]='Examine @lre@'+c.name,$.K.nt&&(this.rh[this.nh]+='@whi@ ('+c.id+')'),this.Te[this.nh]=1773,this.Oe[this.nh]=c.id,f.Rl&&(this.ve[this.nh]=f.Rl[t]),this.nh++}t++}}else if(i>=o&&s>=a&&i{let i=t.El;return i>=c.A.Aa&&i<=c.A.ma?(i>=c.A.pa?i-=c.A.pa:i--,this.rh[this.nh]='Remove @whi@'+this.so[i],this.Te[this.nh]=557,this.nh++,this.rh[this.nh]='Message @whi@'+this.so[i],this.Te[this.nh]=679,this.nh++,!0):i>=c.A._a&&i<=c.A.Ea&&(this.rh[this.nh]='Remove @whi@'+t.text,this.Te[this.nh]=556,this.nh++,!0)};um=()=>{0===this.oe&&0===this.Ie&&(this.rh[this.nh]='Walk here',this.Te[this.nh]=660,this.be[this.nh]=this.xl,this.ve[this.nh]=this.Dl,this.nh++);let t=-1;for(let i=0;i>7&127,o=s>>29&3,l=s>>14&32767;if(s!==t){if(t=s,2===o&&this.He&&this.He.gd(this.Dn,h,r,s)>=0){const t=e.A.get(l);if(1===this.oe)this.rh[this.nh]='Use '+this.fe+' with @cya@'+t.name,this.Te[this.nh]=450,this.Oe[this.nh]=s,this.be[this.nh]=h,this.ve[this.nh]=r,this.nh++;else if(1!==this.Ie){if(t.wm)for(let i=4;i>=0;i--)t.wm[i]&&(this.rh[this.nh]=t.wm[i]+' @cya@'+t.name,0===i&&(this.Te[this.nh]=285),1===i&&(this.Te[this.nh]=504),2===i&&(this.Te[this.nh]=364),3===i&&(this.Te[this.nh]=581),4===i&&(this.Te[this.nh]=1501),this.Oe[this.nh]=s,this.be[this.nh]=h,this.ve[this.nh]=r,this.nh++);this.rh[this.nh]='Examine @cya@'+t.name,$.K.nt&&(this.rh[this.nh]+='@whi@ ('+t.id+')'),this.Te[this.nh]=1175,this.Oe[this.nh]=s,this.be[this.nh]=h,this.ve[this.nh]=r,this.nh++}else 4&~this.Ee||(this.rh[this.nh]=this.ge+' @cya@'+t.name,this.Te[this.nh]=55,this.Oe[this.nh]=s,this.be[this.nh]=h,this.ve[this.nh]=r,this.nh++)}if(1===o){const t=this.Ar[l];if(t&&t.type&&1===t.type.size&&64==(127&t.x)&&64==(127&t.z))for(let i=0;i=0;s--)t.wm&&t.wm[s]?(this.rh[this.nh]=t.wm[s]+' @lre@'+t.name,0===s&&(this.Te[this.nh]=224),1===s&&(this.Te[this.nh]=993),2===s&&(this.Te[this.nh]=99),3===s&&(this.Te[this.nh]=746),4===s&&(this.Te[this.nh]=877),this.Oe[this.nh]=i.index,this.be[this.nh]=h,this.ve[this.nh]=r,this.nh++):2===s&&(this.rh[this.nh]='Take @lre@'+t.name,this.Te[this.nh]=99,this.Oe[this.nh]=i.index,this.be[this.nh]=h,this.ve[this.nh]=r,this.nh++);this.rh[this.nh]='Examine @lre@'+t.name,$.K.nt&&(this.rh[this.nh]+='@whi@ ('+i.index+')'),this.Te[this.nh]=1102,this.Oe[this.nh]=i.index,this.be[this.nh]=h,this.ve[this.nh]=r,this.nh++}else 1&~this.Ee||(this.rh[this.nh]=this.ge+' @lre@'+t.name,this.Te[this.nh]=965,this.Oe[this.nh]=i.index,this.be[this.nh]=h,this.ve[this.nh]=r,this.nh++)}}}}};Am=(t,i,s,h)=>{if(this.nh>=400)return;let e=t.name;if(0!==t._m&&this.Sr&&(e=e+this.Em(this.Sr.Ka,t._m)+' (level-'+t._m+')'),1===this.oe)this.rh[this.nh]='Use '+this.fe+' with @yel@'+e,this.Te[this.nh]=900,this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++;else if(1!==this.Ie){let n;if(t.wm)for(n=4;n>=0;n--)t.wm[n]&&'attack'!==t.wm[n]?.toLowerCase()&&(this.rh[this.nh]=t.wm[n]+' @yel@'+e,0===n?this.Te[this.nh]=728:1===n?this.Te[this.nh]=542:2===n?this.Te[this.nh]=6:3===n?this.Te[this.nh]=963:4===n&&(this.Te[this.nh]=245),this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++);if(t.wm)for(n=4;n>=0;n--)if(t.wm[n]&&'attack'===t.wm[n]?.toLowerCase()){let r=0;this.Sr&&t._m>this.Sr.Ka&&(r=2e3),this.rh[this.nh]=t.wm[n]+' @yel@'+e,0===n?this.Te[this.nh]=r+728:1===n?this.Te[this.nh]=r+542:2===n?this.Te[this.nh]=r+6:3===n?this.Te[this.nh]=r+963:4===n&&(this.Te[this.nh]=r+245),this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++}this.rh[this.nh]='Examine @yel@'+e,$.K.nt&&(this.rh[this.nh]+='@whi@ ('+t.id+')'),this.Te[this.nh]=1607,this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++}else 2&~this.Ee||(this.rh[this.nh]=this.ge+' @yel@'+e,this.Te[this.nh]=265,this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++)};ym=(t,i,s,h)=>{if(t===this.Sr||this.nh>=400)return;let e=null;this.Sr&&(e=t.name+this.Em(this.Sr.Ka,t.Ka)+' (level-'+t.Ka+')'),1===this.oe?(this.rh[this.nh]='Use '+this.fe+' with @whi@'+e,this.Te[this.nh]=367,this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++):1!==this.Ie?(this.rh[this.nh]='Follow @whi@'+e,this.Te[this.nh]=1544,this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++,0===this.Js&&(this.rh[this.nh]='Trade with @whi@'+e,this.Te[this.nh]=1373,this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++),this.Fr>0&&(this.rh[this.nh]='Attack @whi@'+e,this.Sr&&this.Sr.Ka>=t.Ka?this.Te[this.nh]=151:this.Te[this.nh]=2151,this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++),1===this.Ur&&(this.rh[this.nh]='Fight @whi@'+e,this.Te[this.nh]=151,this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++),2===this.Ur&&(this.rh[this.nh]='Duel-with @whi@'+e,this.Te[this.nh]=1101,this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++)):8&~this.Ee||(this.rh[this.nh]=this.ge+' @whi@'+e,this.Te[this.nh]=651,this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++);for(let t=0;t{const s=t-i;return s<-9?'@red@':s<-6?'@or3@':s<-3?'@or2@':s<0?'@or1@':s>9?'@gre@':s>6?'@gr3@':s>3?'@gr2@':s>0?'@gr1@':'@yel@'};ef=()=>{if(0===this.se){this.rh[0]='Cancel',this.Te[0]=1252,this.nh=1,this.qp(this.Dl),this.Se=0,this.xl>8&&this.Dl>11&&this.xl<520&&this.Dl<345&&(-1===this.Xs?this.um():this.$p(c.A.Ro[this.Xs],this.xl,this.Dl,8,11,0)),this.Se!==this.$h&&(this.$h=this.Se),this.Se=0,this.xl>562&&this.Dl>231&&this.xl<752&&this.Dl<492&&(-1!==this.oh?this.$p(c.A.Ro[this.oh],this.xl,this.Dl,562,231,0):-1!==this.Mh[this.Sh]&&this.$p(c.A.Ro[this.Mh[this.Sh]],this.xl,this.Dl,562,231,0)),this.Se!==this.Jh&&(this.Ws=!0,this.Jh=this.Se),this.Se=0,this.xl>22&&this.Dl>375&&this.xl<431&&this.Dl<471&&(-1===this.lh?this.Zp(this.xl-22,this.Dl-375):this.$p(c.A.Ro[this.lh],this.xl,this.Dl,22,375,0)),-1!==this.lh&&this.Se!==this.Qh&&(this.Ys=!0,this.Qh=this.Se);let t=!1;for(;!t;){t=!0;for(let i=0;i1e3){const s=this.rh[i];this.rh[i]=this.rh[i+1],this.rh[i+1]=s;const h=this.Te[i];this.Te[i]=this.Te[i+1],this.Te[i+1]=h;const e=this.be[i];this.be[i]=this.be[i+1],this.be[i+1]=e;const n=this.ve[i];this.ve[i]=this.ve[i+1],this.ve[i+1]=n;const r=this.Oe[i];this.Oe[i]=this.Oe[i+1],this.Oe[i+1]=r,t=!1}}}};lf=()=>{let t=0;if(this.Ai){let i;t=this.Ai.au('Choose Option');for(let s=0;st&&(t=i)}t+=8;const i=15*this.nh+21;let s,h;this.Rc>8&&this.Sc>11&&this.Rc<520&&this.Sc<345&&(s=this.Rc-(t/2|0)-8,s+t>512?s=512-t:s<0&&(s=0),h=this.Sc-11,h+i>334?h=334-i:h<0&&(h=0),this.Qs=!0,this.th=0,this.ih=s,this.sh=h,this.hh=t,this.eh=15*this.nh+22),this.Rc>562&&this.Sc>231&&this.Rc<752&&this.Sc<492&&(s=this.Rc-(t/2|0)-562,s<0?s=0:s+t>190&&(s=190-t),h=this.Sc-231,h<0?h=0:h+i>261&&(h=261-i),this.Qs=!0,this.th=1,this.ih=s,this.sh=h,this.hh=t,this.eh=15*this.nh+22),this.Rc>22&&this.Sc>375&&this.Rc<501&&this.Sc<471&&(s=this.Rc-(t/2|0)-22,s<0?s=0:s+t>479&&(s=479-t),h=this.Sc-375,h<0?h=0:h+i>96&&(h=96-i),this.Qs=!0,this.th=2,this.ih=s,this.sh=h,this.hh=t,this.eh=15*this.nh+22)};df=(t,i,s,h,e,n,r,o,l,a,c)=>{const f=this.kn[this.Dn];if(!f)return!1;const u=G.A.Xn,d=G.A.Xn;for(let t=0;t0&&0===this.vr[i]&&(E[i]&H.A.pd)===H.A.OPEN&&(this.Or[p]=w-1,this.br[p]=A,p=(p+1)%_,this.vr[i]=2,this.Lr[i]=t),i=G.A.index(w+1,A),w0&&0===this.vr[i]&&(E[i]&H.A.Id)===H.A.OPEN&&(this.Or[p]=w,this.br[p]=A-1,p=(p+1)%_,this.vr[i]=1,this.Lr[i]=t),i=G.A.index(w,A+1),A0&&A>0&&0===this.vr[i]&&!(E[i]&H.A.bm)&&(E[G.A.index(w-1,A)]&H.A.pd)===H.A.OPEN&&(E[G.A.index(w,A-1)]&H.A.Id)===H.A.OPEN&&(this.Or[p]=w-1,this.br[p]=A-1,p=(p+1)%_,this.vr[i]=3,this.Lr[i]=t),i=G.A.index(w+1,A-1),w0&&0===this.vr[i]&&!(E[i]&H.A.vm)&&(E[G.A.index(w+1,A)]&H.A.md)===H.A.OPEN&&(E[G.A.index(w,A-1)]&H.A.Id)===H.A.OPEN&&(this.Or[p]=w+1,this.br[p]=A-1,p=(p+1)%_,this.vr[i]=9,this.Lr[i]=t),i=G.A.index(w-1,A+1),w>0&&A=0&&s>=0&&e0){_=Math.min(m,25),m--;const t=this.Or[m],i=this.br[m];if($.K.nt&&1===this.if[6]&&1===this.if[7]){for(let t=0;t{this.cr=0,this.ar=0,this.xm(t),this.Dm(t),this.Nm(t,i),this.Pm(t);for(let t=0;t{t.Fm();if(0!==t.Um(1)){const i=t.Um(2);if(0===i)this.ur[this.ar++]=this.Mt;else if(1===i){const i=t.Um(3);this.Sr?.step(!1,i);1===t.Um(1)&&(this.ur[this.ar++]=this.Mt)}else if(2===i){const i=t.Um(3);this.Sr?.step(!0,i);const s=t.Um(3);this.Sr?.step(!0,s);1===t.Um(1)&&(this.ur[this.ar++]=this.Mt)}else if(3===i){this.Dn=t.Um(2);const i=t.Um(7),s=t.Um(7),h=t.Um(1);this.Sr?.move(1===h,i,s);1===t.Um(1)&&(this.ur[this.ar++]=this.Mt)}}};Dm=t=>{const i=t.Um(8);if(ithis.rr)throw new Error(`eek! ${this.username} Too many players`);this.rr=0;for(let s=0;s{let s;for(;t.Bm+10<8*i&&(s=t.Um(11),2047!==s);){if(!this.nr[s]){this.nr[s]=new W.A;const t=this.wr[s];t&&this.nr[s]?.read(t)}this.lr[this.rr++]=s;const i=this.nr[s];i&&(i.Vf=this.Pt);let h=t.Um(5);h>15&&(h-=32);let e=t.Um(5);e>15&&(e-=32);const n=t.Um(1);this.Sr&&i?.move(1===n,this.Sr.wf[0]+h,this.Sr.Af[0]+e);1===t.Um(1)&&(this.ur[this.ar++]=s)}t.Gm()};Pm=t=>{for(let i=0;i{if(t.Eu=s,t.gu=this.Pt,(s&W.A.Cu)===W.A.Cu){const s=e.ZA,h=new Uint8Array(s),n=new I.A(h);e.xy(s,0,h),this.wr[i]=n,t.read(n)}if((s&W.A.Tu)===W.A.Tu){let i=e.KA;65535===i&&(i=-1),i===t.Ou&&(t.Ym=0);const s=e.ZA;(-1===i||-1===t.Ou||h.A.Ro[i].priority>h.A.Ro[t.Ou].priority||0===h.A.Ro[t.Ou].priority)&&(t.Ou=i,t.Vm=0,t.Km=0,t.Xm=s,t.Ym=0)}if((s&W.A.bu)===W.A.bu&&(t.vu=e.KA,65535===t.vu&&(t.vu=-1)),(s&W.A.Lu)===W.A.Lu&&(t.ou=e.ly,t.cu=0,t.fu=0,t.uu=150,t.name&&this.Ud(2,t.ou,t.name)),(s&W.A.Ru)===W.A.Ru&&(t.pu=e.ZA,t.yu=e.ZA,t.du=this.Pt+400,t.wu=e.ZA,t.Au=e.ZA),(s&W.A.Su)===W.A.Su&&(t.zm=e.KA,t.jm=e.KA,t.Mu=t.zm,t.ku=t.jm),(s&W.A.xu)===W.A.xu){const i=e.KA,s=e.ZA,h=e.ZA,n=e.Fc;if(t.name){const n=M.A.ld(t.name);let r=!1;if(s<=1)for(let t=0;t>8,t.fu=255&i,t.uu=150,s>1?this.Ud(1,r,t.name):this.Ud(2,r,t.name)}catch(t){}}e.Fc=n+h}if((s&W.A.Du)===W.A.Du){t.Nu=e.KA;const i=e.Ko;t.Zm=i>>16,t.qm=this.Pt+(65535&i),t.$m=0,t.Jm=0,t.qm>this.Pt&&(t.$m=-1),65535===t.Nu&&(t.Nu=-1)}(s&W.A.Pu)===W.A.Pu&&(t.Qm=e.ZA,t.tI=e.ZA,t.iI=e.ZA,t.sI=e.ZA,t.mu=e.KA+this.Pt,t.Iu=e.KA+this.Pt,t.hI=e.ZA,t.pathLength=0,t.wf[0]=t.iI,t.Af[0]=t.sI)};QA=(t,i)=>{this.cr=0,this.ar=0,this.eI(t),this.nI(t,i),this.rI(t);for(let t=0;t{t.Fm();const i=t.Um(8);if(ithis.yr)throw new Error(`eek! ${this.username} Too many npc!`);this.yr=0;for(let s=0;s{for(;t.Bm+21<8*i;){const i=t.Um(13);if(8191===i)break;this.Ar[i]||(this.Ar[i]=new Y.A);const s=this.Ar[i];this.pr[this.yr++]=i,s?(s.Vf=this.Pt,s.type=r.A.get(t.Um(11)),s.size=s.type.size,s.oI=s.type.lI,s.aI=s.type.cI,s.fI=s.type.uI,s.dI=s.type.wI,s.Sa=s.type.AI):t.Um(11);let h=t.Um(5);h>15&&(h-=32);let e=t.Um(5);e>15&&(e-=32),this.Sr&&s?.move(!1,this.Sr.wf[0]+h,this.Sr.Af[0]+e);1===t.Um(1)&&(this.ur[this.ar++]=i)}t.Gm()};rI=t=>{for(let i=0;ih.A.Ro[e.Ou].priority||0===h.A.Ro[e.Ou].priority)&&(e.Ou=i,e.Vm=0,e.Km=0,e.Xm=s,e.Ym=0)}if((n&Y.A.bu)===Y.A.bu&&(e.vu=t.KA,65535===e.vu&&(e.vu=-1)),(n&Y.A.Lu)===Y.A.Lu&&(e.ou=t.ly,e.uu=100),(n&Y.A.Ru)===Y.A.Ru&&(e.pu=t.ZA,e.yu=t.ZA,e.du=this.Pt+400,e.wu=t.ZA,e.Au=t.ZA),(n&Y.A.Fu)===Y.A.Fu&&(e.type=r.A.get(t.KA),e.oI=e.type.lI,e.aI=e.type.cI,e.fI=e.type.uI,e.dI=e.type.wI,e.Sa=e.type.AI),(n&Y.A.Du)===Y.A.Du){e.Nu=t.KA;const i=t.Ko;e.Zm=i>>16,e.qm=this.Pt+(65535&i),e.$m=0,e.Jm=0,e.qm>this.Pt&&(e.$m=-1),65535===e.Nu&&(e.Nu=-1)}(n&Y.A.Su)===Y.A.Su&&(e.zm=t.KA,e.jm=t.KA,e.Mu=e.zm,e.ku=e.jm)}};$c=()=>{for(let t=-1;t1406){$.K.yt=0,this.Bt.jc(O.A.pI),this.Bt.p1(0);const t=this.Bt.Fc;this.Bt.p1(162),this.Bt.p1(22),2*Math.random()|0||this.Bt.p1(84),this.Bt.p2(31824),this.Bt.p2(13490),2*Math.random()|0||this.Bt.p1(123),2*Math.random()|0||this.Bt.p1(134),this.Bt.p1(100),this.Bt.p1(94),this.Bt.p2(35521),this.Bt.Hf(this.Bt.Fc-t)}};yI=t=>{(t.x<128||t.z<128||t.x>=13184||t.z>=13184)&&(t.Ou=-1,t.Nu=-1,t.mu=0,t.Iu=0,t.x=128*t.wf[0]+64*t.size,t.z=128*t.Af[0]+64*t.size,t.pathLength=0),t===this.Sr&&(t.x<1536||t.z<1536||t.x>=11776||t.z>=11776)&&(t.Ou=-1,t.Nu=-1,t.mu=0,t.Iu=0,t.x=128*t.wf[0]+64*t.size,t.z=128*t.Af[0]+64*t.size,t.pathLength=0),t.mu>this.Pt?this.mI(t):t.Iu>=this.Pt?this.II(t):this._I(t),this.EI(t),this.gI(t)};xf=()=>{if(this.Sr){this.Sr.x>>7===this.Ke&&this.Sr.z>>7===this.Xe&&(this.Ke=0);for(let t=-1;t50||this.rr>200)&&-1!==t&&i.CI===i.Sa;const h=i.x>>7,e=i.z>>7;if(!(h<0||h>=G.A.Xn||e<0||e>=G.A.Xn))if(!i.TI||this.Pt=i.bI){if(64==(127&i.x)&&64==(127&i.z)){if(this.Vn[h][e]===this.Ve)continue;this.Vn[h][e]=this.Ve}i.y=this.Bf(this.Dn,i.x,i.z),this.He?.vI(this.Dn,i.x,i.y,i.z,null,i,s,i.LI,60,i.RI)}else i.st=!1,i.y=this.Bf(this.Dn,i.x,i.z),this.He?.SI(this.Dn,i.x,i.y,i.z,i.MI,i.kI,i.xI,i.DI,null,i,s,i.LI)}}};Jc=()=>{for(let t=0;t{for(let t=0;t>7,e=i.z>>7;if(!(h<0||h>=G.A.Xn||e<0||e>=G.A.Xn)){if(1===i.size&&64==(127&i.x)&&64==(127&i.z)){if(this.Vn[h][e]===this.Ve)continue;this.Vn[h][e]=this.Ve}this.He?.vI(this.Dn,i.x,this.Bf(this.Dn,i.x,i.z),i.z,null,i,s,i.LI,64*(i.size-1)+60,i.RI)}}};Nf=()=>{for(let t=this.mr.head();t;t=this.mr.next())if(t.level!==this.Dn||this.Pt>t.NI)t.sy();else if(this.Pt>=t.FI){if(t.target>0){const i=this.Ar[t.target-1];i&&t.UI(i.x,this.Bf(t.level,i.x,i.z)-t.offsetY,i.z,this.Pt)}if(t.target<0){const i=-t.target-1;let s;s=i===this.Dr?this.Sr:this.nr[i],s&&t.UI(s.x,this.Bf(t.level,s.x,s.z)-t.offsetY,s.z,this.Pt)}t.update(this.Ye),this.He?.vI(this.Dn,0|t.x,0|t.y,0|t.z,null,t,-1,t.LI,60,!1)}};Pf=()=>{for(let t=this.Ir.head();t;t=this.Ir.next())t.level!==this.Dn||t.BI?t.sy():this.Pt>=t.FI&&(t.update(this.Ye),t.BI?t.sy():this.He?.vI(t.level,t.x,t.y,t.z,null,t,-1,0,60,!1))};Ff=()=>{for(let t=this._r.head();t;t=this._r.next()){let i=!1;if(t.fl+=this.Ye,-1===t.ul&&(t.ul=0,i=!0),t.GI.delay)for(;t.fl>t.GI.delay[t.ul];)if(t.fl-=t.GI.delay[t.ul]+1,t.ul++,i=!0,t.ul>=t.GI.dl&&(t.ul-=t.GI.wl,t.ul<0||t.ul>=t.GI.dl)){t.sy(),i=!1;break}if(i&&this.He){const i=t.Vp,s=t.Wp,h=t.Yp;let n=0;if(0===t.HI?n=this.He.Ed(i,s,h):1===t.HI?n=this.He.kA(i,h,s):2===t.HI?n=this.He.Md(i,s,h):3===t.HI&&(n=this.He.Ad(i,s,h)),this.Wn&&0!==n&&(n>>14&32767)===t.index){const r=this.Wn[i][s][h],o=this.Wn[i][s+1][h],l=this.Wn[i][s+1][h+1],a=this.Wn[i][s][h+1],c=e.A.get(t.index);let f=-1;if(-1!==t.ul&&t.GI.frames&&(f=t.GI.frames[t.ul]),2===t.HI){const t=this.He.gd(i,s,h,n);let e=31&t;const u=t>>6;e===P.A.oA.id&&(e=P.A.rA.id),this.He?.WI(i,s,h,c.la(e,u,r,o,l,a,f))}else if(1===t.HI)this.He?.YI(i,s,h,c.la(P.A.VI.id,0,r,o,l,a,f));else if(0===t.HI){const t=this.He.gd(i,s,h,n),e=31&t,u=t>>6;if(e===P.A.Od.id){const t=u+1&3;this.He?.KI(s,h,i,c.la(P.A.Od.id,u+4,r,o,l,a,f),c.la(P.A.Od.id,t,r,o,l,a,f))}else this.He?.XI(i,s,h,c.la(e,u,r,o,l,a,f))}else if(3===t.HI){const t=this.He.gd(i,s,h,n)>>6;this.He?.zI(i,s,h,c.la(P.A.lA.id,t,r,o,l,a,f))}}else t.sy()}}};Qc=()=>{for(let t=-1;t0&&(s.uu--,0===s.uu&&(s.ou=null))}for(let t=0;t0&&(s.uu--,0===s.uu&&(s.ou=null))}};tf=()=>{if(2===this.We){for(let t=this.Er.head();t;t=this.Er.next())this.Pt>=t.NI&&(this.RA(t.hp,t.x,t.z,t.Kp,t.angle,t.shape,t.Nd),t.sy());$.K.At++,$.K.At>85&&($.K.At=0,this.Bt.jc(O.A.jI))}};mI=t=>{const i=t.mu-this.Pt,s=128*t.Qm+64*t.size,h=128*t.tI+64*t.size;t.x+=(s-t.x)/i|0,t.z+=(h-t.z)/i|0,t.ZI=0,0===t.hI&&(t.qI=1024),1===t.hI&&(t.qI=1536),2===t.hI&&(t.qI=0),3===t.hI&&(t.qI=512)};II=t=>{if(t.Iu===this.Pt||-1===t.Ou||0!==t.Xm||t.Km+1>h.A.Ro[t.Ou].delay[t.Vm]){const i=t.Iu-t.mu,s=this.Pt-t.mu,h=128*t.Qm+64*t.size,e=128*t.tI+64*t.size,n=128*t.iI+64*t.size,r=128*t.sI+64*t.size;t.x=(h*(i-s)+n*s)/i|0,t.z=(e*(i-s)+r*s)/i|0}t.ZI=0,0===t.hI&&(t.qI=1024),1===t.hI&&(t.qI=1536),2===t.hI&&(t.qI=0),3===t.hI&&(t.qI=512),t.LI=t.qI};EI=t=>{if(-1!==t.vu&&t.vu<32768){const i=this.Ar[t.vu];if(i){const s=t.x-i.x,h=t.z-i.z;0===s&&0===h||(t.qI=325.949*Math.atan2(s,h)&2047)}}if(t.vu>=32768){let i=t.vu-32768;i===this.Dr&&(i=this.Mt);const s=this.nr[i];if(s){const i=t.x-s.x,h=t.z-s.z;0===i&&0===h||(t.qI=325.949*Math.atan2(i,h)&2047)}}if((0!==t.zm||0!==t.jm)&&(0===t.pathLength||t.ZI>0)){const i=t.x-64*(t.zm-this.Tn-this.Tn),s=t.z-64*(t.jm-this.On-this.On);0===i&&0===s||(t.qI=325.949*Math.atan2(i,s)&2047),t.zm=0,t.jm=0}const i=t.qI-t.LI&2047;if(0!==i&&(i<32||i>2016?t.LI=t.qI:i>1024?t.LI-=32:t.LI+=32,t.LI&=2047,t.CI===t.Sa&&t.LI!==t.qI)){if(-1!==t.$I)return void(t.CI=t.$I);t.CI=t.oI}};gI=t=>{let i;if(t.RI=!1,-1!==t.CI&&(i=h.A.Ro[t.CI],t.JI++,i.delay&&t.QIi.delay[t.QI]&&(t.JI=0,t.QI++),t.QI>=i.dl&&(t.JI=0,t.QI=0)),-1!==t.Ou&&0===t.Xm){for(i=h.A.Ro[t.Ou],t.Km++;i.delay&&t.Vmi.delay[t.Vm];)t.Km-=i.delay[t.Vm],t.Vm++;t.Vm>=i.dl&&(t.Vm-=i.wl,t.Ym++,t.Ym>=i.t_&&(t.Ou=-1),(t.Vm<0||t.Vm>=i.dl)&&(t.Ou=-1)),t.RI=i.i_}if(t.Xm>0&&t.Xm--,-1!==t.Nu&&this.Pt>=t.qm){for(t.$m<0&&(t.$m=0),i=l.A.Ro[t.Nu].GI,t.Jm++;i&&i.delay&&t.$mi.delay[t.$m];)t.Jm-=i.delay[t.$m],t.$m++;i&&t.$m>=i.dl&&(t.$m<0||t.$m>=i.dl)&&(t.Nu=-1)}};_I=t=>{if(t.CI=t.Sa,0===t.pathLength)return void(t.ZI=0);if(-1!==t.Ou&&0===t.Xm){if(!h.A.Ro[t.Ou].s_)return void t.ZI++}const i=t.x,s=t.z,e=128*t.wf[t.pathLength-1]+64*t.size,n=128*t.Af[t.pathLength-1]+64*t.size;if(e-i<=256&&e-i>=-256&&n-s<=256&&n-s>=-256){t.qI=in?1792:1536:i>e?sn?256:512:s1024&&(h-=2048);let r=t.aI;h>=-256&&h<=256?r=t.oI:h>=256&&h<768?r=t.dI:h>=-768&&h<=-256&&(r=t.fI),-1===r&&(r=t.oI),t.CI=r;let o=4;t.LI!==t.qI&&-1===t.vu&&(o=2),t.pathLength>2&&(o=6),t.pathLength>3&&(o=8),t.ZI>0&&t.pathLength>1&&(o=8,t.ZI--),t.h_[t.pathLength-1]&&(o<<=1),o>=8&&t.CI===t.oI&&-1!==t.e_&&(t.CI=t.e_),ie&&(t.x=e)):i>e&&(t.x-=o,t.xn&&(t.z=n)):s>n&&(t.z-=o,t.z{let t=3;if(this.fn<310&&this.Sr){let i=this.ln>>7,s=this.cn>>7;const h=this.Sr.x>>7,e=this.Sr.z>>7;let n,r,o,l;if(this.Yn&&4&this.Yn[this.Dn][i][s]&&(t=this.Dn),n=h>i?h-i:i-h,r=e>s?e-s:s-e,n>r)for(o=65536*r/n|0,l=32768;i!==h;)ih&&i--,this.Yn&&4&this.Yn[this.Dn][i][s]&&(t=this.Dn),l+=o,l>=65536&&(l-=65536,se&&s--,this.Yn&&4&this.Yn[this.Dn][i][s]&&(t=this.Dn));else for(o=65536*n/r|0,l=32768;s!==e;)se&&s--,this.Yn&&4&this.Yn[this.Dn][i][s]&&(t=this.Dn),l+=o,l>=65536&&(l-=65536,ih&&i--,this.Yn&&4&this.Yn[this.Dn][i][s]&&(t=this.Dn))}return this.Sr&&this.Yn&&4&this.Yn[this.Dn][this.Sr.x>>7][this.Sr.z>>7]&&(t=this.Dn),t};Wf=()=>{if(!this.Yn)return 0;return this.Bf(this.Dn,this.ln,this.cn)-this.an>=800||!(4&this.Yn[this.Dn][this.ln>>7][this.cn>>7])?3:this.Dn};Bf=(t,i,s)=>{if(!this.Wn)return 0;const h=Math.min(i>>7,G.A.Xn-1),e=Math.min(s>>7,G.A.Xn-1);let n=t;t<3&&this.Yn&&!(2&~this.Yn[1][h][e])&&(n=t+1);const r=127&i,o=127&s;return(this.Wn[n][h][e]*(128-r)+this.Wn[n][h+1][e]*r>>7)*(128-o)+(this.Wn[n][h][e+1]*(128-r)+this.Wn[n][h+1][e+1]*r>>7)*o>>7};Uf=(t,i,s,h,e,n)=>{const r=2048-e&2047,o=2048-h&2047;let l,a,c,f=0,u=0,w=n;0!==r&&(l=d.A.sin[r],a=d.A.cos[r],c=u*a-n*l>>16,w=u*l+n*a>>16,u=c),0!==o&&(l=d.A.sin[o],a=d.A.cos[o],c=w*l+f*a>>16,w=w*a-f*l>>16,f=c),this.ln=t-f,this.an=i-u,this.cn=s-w,this.fn=e,this.un=h};Ef=()=>{if(!this.Sr)return;const t=this.Sr.x+this.Ze,i=this.Sr.z+this.qe;(this.Gn-t<-500||this.Gn-t>500||this.Hn-i<-500||this.Hn-i>500)&&(this.Gn=t,this.Hn=i),this.Gn!==t&&(this.Gn+=(t-this.Gn)/16|0),this.Hn!==i&&(this.Hn+=(i-this.Hn)/16|0),1===this.if[1]?this.Un+=(-this.Un-24)/2|0:1===this.if[2]?this.Un+=(24-this.Un)/2|0:this.Un=this.Un/2|0,1===this.if[3]?this.Bn+=(12-this.Bn)/2|0:1===this.if[4]?this.Bn+=(-this.Bn-12)/2|0:this.Bn=this.Bn/2|0,this.Fn=this.Fn+this.Un/2&2047,this.Pn+=this.Bn/2|0,this.Pn<128&&(this.Pn=128),this.Pn>383&&(this.Pn=383);const s=this.Gn>>7,h=this.Hn>>7,e=this.Bf(this.Dn,this.Gn,this.Hn);let n=0;if(this.Wn&&s>3&&h>3&&s<100&&h<100)for(let t=s-4;t<=s+4;t++)for(let i=h-4;i<=h+4;i++){let s=this.Dn;s<3&&this.Yn&&!(2&~this.Yn[1][t][i])&&s++;const h=e-this.Wn[s][t][i];h>n&&(n=h)}let r=192*n;r>98048&&(r=98048),r<32768&&(r=32768),r>this.dn?this.dn+=(r-this.dn)/24|0:r{let t=128*this.tr+64,i=128*this.ir+64,s=this.Bf(this.Dn,this.tr,this.ir)-this.sr;this.lnt&&(this.ln=t)),this.ln>t&&(this.ln-=this.hr+((this.ln-t)*this.er/1e3|0),this.lns&&(this.an=s)),this.an>s&&(this.an-=this.hr+((this.an-s)*this.er/1e3|0),this.ani&&(this.cn=i)),this.cn>i&&(this.cn-=this.hr+((this.cn-i)*this.er/1e3|0),this.cn383&&(o=383),this.fno&&(this.fn=o)),this.fn>o&&(this.fn-=this.Jn+((this.fn-o)*this.Qn/1e3|0),this.fn1024&&(a-=2048),a<-1024&&(a+=2048),a>0&&(this.un+=this.Jn+(a*this.Qn/1e3|0),this.un&=2047),a<0&&(this.un-=this.Jn+(-a*this.Qn/1e3|0),this.un&=2047);let c=l-this.un;c>1024&&(c-=2048),c<-1024&&(c+=2048),(c<0&&a>0||c>0&&a<0)&&(this.un=l)};vy=(t,i)=>{const s=t.ZA;let n=this._n+(s>>4&7),r=this.En+(7&s);if(i===T.A.by||i===T.A.Oy){const s=t.ZA,h=s>>2,e=3&s,o=P.A.of(h).Nd;let l;if(l=i===T.A.Oy?-1:t.KA,n>=0&&r>=0&&n>14&32767,h=31&t,e=t>>6}t=new U.A(this.Dn,o,n,r,0,F.A.bd,P.A.Td.id,s,e,h),this.Tr.n_(t)}t&&(t.Kp=l,t.shape=h,t.angle=e),this.RA(this.Dn,n,r,l,e,h,o)}}else if(i===T.A.Ty){const i=t.ZA>>2,s=P.A.of(i).Nd,e=t.KA;if(n>=0&&r>=0&&n>14&32767,this.Dn,s,n,r,h.A.Ro[e],!1);this._r.n_(i)}}}else if(i===T.A.Cy){const i=t.KA,s=t.KA;if(n>=0&&r>=0&&n=0&&r>=0&&n=0&&r>=0&&n=0&&s>=0&&i=0&&r>=0&&n=0&&r>=0&&n>2,h=3&i,o=P.A.of(s).Nd,l=t.KA,a=t.KA,c=t.KA,f=t.KA;let u,d=t.zA,w=t.zA,A=t.zA,y=t.zA;if(u=f===this.Dr?this.Sr:this.nr[f],u&&this.Wn){const t=new B.A(this.Dn,o,n,r,-1,h,s,a+this.Pt);this.Er.n_(t);const i=new B.A(this.Dn,o,n,r,l,h,s,c+this.Pt);this.Er.n_(i);const f=this.Wn[this.Dn][n][r],p=this.Wn[this.Dn][n+1][r],m=this.Wn[this.Dn][n+1][r+1],I=this.Wn[this.Dn][n][r+1],_=e.A.get(l);u.OI=a+this.Pt,u.bI=c+this.Pt,u.TI=_.la(s,h,f,p,m,I,-1);let E,g=_.width,C=_.length;h!==F.A.vd&&h!==F.A.Rd||(g=_.length,C=_.width),u.r_=128*n+64*g,u.o_=128*r+64*C,u.l_=this.Bf(this.Dn,u.r_,u.o_),d>A&&(E=d,d=A,A=E),w>y&&(E=w,w=y,y=E),u.MI=n+d,u.xI=n+A,u.kI=r+w,u.DI=r+y}}else if(i===T.A.py){const i=t.KA,s=t.KA,h=t.KA;if(n>=0&&r>=0&&n{if(!$.K.st){if(d.A.a_[17]>=t){const t=d.A.c_[17];if(!t)return;const i=t.width*t.height-1,s=t.width*this.Ye*2,h=t.nc,e=this.Mn;for(let t=0;t<=i;t++)e[t]=h[t-s&i];t.nc=e,this.Mn=h,d.A.f_(17)}if(d.A.a_[24]>=t){const t=d.A.c_[24];if(!t)return;const i=t.width*t.height-1,s=t.width*this.Ye*2,h=t.nc,e=this.Mn;for(let t=0;t<=i;t++)e[t]=h[t-s&i];t.nc=e,this.Mn=h,d.A.f_(24)}}};Ic=()=>{if(!(this.Ci&&this.Ti&&this.gi&&this.Ri))return;for(let t=10;t<117;t++){(100*Math.random()|0)<50&&(this.Ci[t+32512]=255)}for(let t=0;t<100;t++){const t=2+(124*Math.random()|0)+(128+(128*Math.random()|0)<<7);this.Ci[t]=192}for(let t=1;t<255;t++)for(let i=1;i<127;i++){const s=i+(t<<7);this.Ti[s]=(this.Ci[s-1]+this.Ci[s+1]+this.Ci[s-128]+this.Ci[s+128])/4|0}this.Si+=128,this.Si>this.gi.length&&(this.Si-=this.gi.length,this.gc(this.pi[12*Math.random()|0]));for(let t=1;t<255;t++)for(let i=1;i<127;i++){const s=i+(t<<7);let h=this.Ti[s+128]-(this.gi[s+this.Si&this.gi.length-1]/5|0);h<0&&(h=0),this.Ci[s]=h}for(let t=0;t<255;t++)this.Ri[t]=this.Ri[t+1];if(this.Ri[255]=16*Math.sin(this.Pt/14)+14*Math.sin(this.Pt/15)+12*Math.sin(this.Pt/16)|0,this.Mi>0&&(this.Mi-=4),this.ki>0&&(this.ki-=4),0===this.Mi&&0===this.ki){const t=2e3*Math.random()|0;0===t?this.Mi=1024:1===t&&(this.ki=1024)}};u_=(t,i,s)=>{const h=256-i;return((16711935&t)*h+(16711935&s)*i&4278255360)+((65280&t)*h+(65280&s)*i&16711680)>>8};_c=()=>{if(!(this.Oi&&this.bi&&this.vi&&this.Li&&this.Ri&&this.Ci))return;const t=256;if(this.Mi>0)for(let t=0;t<256;t++)this.Mi>768?this.Oi[t]=this.u_(this.bi[t],1024-this.Mi,this.vi[t]):this.Mi>256?this.Oi[t]=this.vi[t]:this.Oi[t]=this.u_(this.vi[t],256-this.Mi,this.bi[t]);else if(this.ki>0)for(let t=0;t<256;t++)this.ki>768?this.Oi[t]=this.u_(this.bi[t],1024-this.ki,this.Li[t]):this.ki>256?this.Oi[t]=this.Li[t]:this.Oi[t]=this.u_(this.Li[t],256-this.ki,this.bi[t]);else for(let t=0;t<256;t++)this.Oi[t]=this.bi[t];for(let t=0;t<33920;t++)this.hi&&this.Ii&&(this.hi.nc[t]=this.Ii.nc[t]);let i=0,s=1152;for(let h=1;h<255;h++){let e=(this.Ri[h]*(t-h)/t|0)+22;e<0&&(e=0),i+=e;for(let t=e;t<128;t++){let t=this.Ci[i++];if(0===t)s++;else{const i=t,h=256-t;if(t=this.Oi[t],this.hi){const e=this.hi.nc[s];this.hi.nc[s++]=((16711935&t)*i+(16711935&e)*h&4278255360)+((65280&t)*i+(65280&e)*h&16711680)>>8}}}s+=e}this.hi?.draw(0,0);for(let t=0;t<33920;t++)this.ei&&this._i&&(this.ei.nc[t]=this._i.nc[t]);i=0,s=1176;for(let h=1;h<255;h++){const e=this.Ri[h]*(t-h)/t|0,n=103-e;s+=e;for(let t=0;t>8}}}i+=128-n,s+=128-n-e}this.ei?.draw(661,0)}}console.log(`RS2 user client - release #${$.K.tt}`),await(0,it.w)(),(new t).d_().then((()=>{})),i()}catch(t){i(t)}}),1)},7046:(t,i,s)=>{s.d(i,{A:()=>a});var h=s(1183),e=s(4583),n=s(9234),r=s(9091),o=s(2595),l=s(7854);class a{static getParameter(t){return new URLSearchParams(window.location.search).get(t)??''}static setParameter(t,i){const s=new URL(window.location.toString());s.searchParams.set(t,i),window.history.pushState(null,'',s.toString())}Ku=0;w_=[];A_=0;Mo=null;state=0;Yu=20;y_=1;p_=[];Wu=0;m_=0;I_=[];__=!0;E_=!1;g_=50;hasFocus=!0;ac=!1;Yc=0;hf=0;xl=0;Dl=0;Lc=0;Rc=0;Sc=0;if=[];C_=[];T_=0;O_=0;input=null;b_=!1;v_=!1;L_=!1;time=-1;R_=0;S_=0;M_=0;k_=0;x_=0;D_=0;constructor(t=!1){l.N_.tabIndex=-1,l.jo.fillStyle='black',l.jo.fillRect(0,0,l.N_.width,l.N_.height),this.E_=t,this.E_?this.resize(window.innerWidth,window.innerHeight):this.resize(l.N_.width,l.N_.height)}get width(){return l.N_.width}get height(){return l.N_.height}resize=(t,i)=>{l.N_.width=t,l.N_.height=i,this.Mo=new h.A(t,i),e.A.P_()};d_=async()=>{l.N_.addEventListener('resize',(()=>{this.E_&&this.resize(window.innerWidth,window.innerHeight)}),!1),l.N_.onmousedown=this.onmousedown,l.N_.onmouseup=this.onmouseup,l.N_.onmouseenter=this.onmouseenter,l.N_.onmouseleave=this.onmouseleave,l.N_.onmousemove=this.onmousemove,window.onbeforeunload=this.bo,l.N_.onfocus=this.onfocus,l.N_.onblur=this.onblur,this.F_?(l.N_.ontouchstart=this.ontouchstart,l.N_.ontouchend=this.ontouchend,l.N_.ontouchmove=this.ontouchmove):(l.N_.onkeydown=this.onkeydown,l.N_.onkeyup=this.onkeyup),l.N_.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.F_&&'low'===a.getParameter('detail')&&(this.g_=30),await this.Go(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.p_[t]=performance.now();let t,i=0,s=256,h=1,e=0;for(;this.state>=0;){if(this.state>0&&(this.state--,0===this.state))return void this.U_();const r=s,o=h;s=300,h=1,t=performance.now();const l=this.p_[i];if(0===l?(s=r,h=o):t>l&&(s=2560*this.Yu/(t-l)|0),s<25?s=25:s>256&&(s=256,h=this.Yu-(t-l)/10|0),this.p_[i]=t,i=(i+1)%10,h>1)for(let t=0;t<10;t++)0!==this.p_[t]&&(this.p_[t]+=h);for(h0&&(this.Wu=1e3*s/(256*this.Yu)|0);const a=performance.now();if(this.__&&this.refresh(),await this.draw(),this.I_[this.m_]=(performance.now()-a)/1e3,this.m_=(this.m_+1)%this.I_.length,this.g_<50){const i=1e3/this.g_-(performance.now()-t);i>0&&await(0,n.Wo)(i)}}-1===this.state&&this.U_()};U_=()=>{this.state=-2,this.bo()};Zo=t=>{this.Yu=1e3/t|0};yA=t=>{this.g_=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.Yu|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};bo=()=>{};draw=async()=>{};refresh=()=>{};async Go(t,i){const s=this.width,h=this.height;this.__&&(l.jo.fillStyle='black',l.jo.fillRect(0,0,s,h),this.__=!1);const e=h/2-18;l.jo.fillStyle='rgb(140, 17, 17)',l.jo.rect((s/2|0)-152,e,304,34),l.jo.fillRect((s/2|0)-150,e+2,3*t,30),l.jo.fillStyle='black',l.jo.fillRect((s/2|0)-150+3*t,e+2,300-3*t,30),l.jo.font='bold 13px helvetica, sans-serif',l.jo.textAlign='center',l.jo.fillStyle='white',l.jo.fillText(i,s/2|0,e+22),await(0,n.Wo)(5)}kc=()=>{let t=-1;return this.O_!==this.T_&&(t=this.C_[this.T_],this.T_=this.T_+1&127),t};get ms(){const t=this.I_.length;let i=0;for(let s=0;sthis.Ku&&(this.Ku=s),this.w_[this.A_]=s,this.A_=(this.A_+1)%250,s}get Vu(){return this.w_.reduce(((t,i)=>t+i),0)/250}onkeydown=t=>{const i=t.key;r.p.includes(i)&&t.preventDefault(),this.Yc=0;const s=r.L[i];if(!s||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const h=s.code;let e=s.ch;t.ctrlKey&&(e>='A'.charCodeAt(0)&&e<=']'.charCodeAt(0)||e=='_'.charCodeAt(0)?e-='A'.charCodeAt(0)-1:e>='a'.charCodeAt(0)&&e<='z'.charCodeAt(0)&&(e-='a'.charCodeAt(0)-1)),e<30&&(e=0),h===r.L.ArrowLeft.code?e=1:h===r.L.ArrowRight.code?e=2:h===r.L.ArrowUp.code?e=3:h===r.L.ArrowDown.code?e=4:h===r.L.Control.code?e=5:h===r.L.Shift.code?e=6:h===r.L.Alt.code?e=7:h===r.L.Backspace.code||h===r.L.Delete.code?e=8:h===r.L.Tab.code?e=9:h===r.L.Enter.code?e=10:h>=r.L.F1.code&&h<=r.L.F12.code?e=h+1008-r.L.F1.code:h===r.L.Home.code?e=1e3:h===r.L.End.code?e=1001:h===r.L.PageUp.code?e=1002:h===r.L.PageDown.code&&(e=1003),e>0&&e<128&&(this.if[e]=1),e>4&&(this.C_[this.O_]=e,this.O_=this.O_+1&127),o.A.enabled&&o.A.B_(e)};onkeyup=t=>{const i=t.key;r.p.includes(i)&&t.preventDefault(),this.Yc=0;const s=r.L[i];if(!s||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const h=s.code;let e=s.ch;e<30&&(e=0),h===r.L.ArrowLeft.code?e=1:h===r.L.ArrowRight.code?e=2:h===r.L.ArrowUp.code?e=3:h===r.L.ArrowDown.code?e=4:h===r.L.Control.code?e=5:h===r.L.Shift.code?e=6:h===r.L.Alt.code?e=7:h===r.L.Backspace.code||h===r.L.Delete.code?e=8:h===r.L.Tab.code?e=9:h===r.L.Enter.code?e=10:h>=r.L.F1.code&&h<=r.L.F12.code?e=h+1008-r.L.F1.code:h===r.L.Home.code?e=1e3:h===r.L.End.code?e=1001:h===r.L.PageUp.code?e=1002:h===r.L.PageDown.code&&(e=1003),e>0&&e<128&&(this.if[e]=0),o.A.enabled&&o.A.G_(e)};onmousedown=t=>{if(this.b_=!1,(t.clientX>0||t.clientY>0)&&this.H_(t),this.Yc=0,this.Rc=this.xl,this.Sc=this.Dl,this.F_&&!this.W_){if(this.Y_()||this.V_()||this.K_())return this.Lc=1,void(this.hf=1);t.timeStamp>=this.time+500?(this.Lc=2,this.hf=2):(this.Lc=1,this.hf=1)}else 2===t.button?(this.Lc=2,this.hf=2):(this.Lc=1,this.hf=1);o.A.enabled&&o.A.X_(this.Rc,this.Sc,t.buttons)};onmouseup=t=>{this.H_(t),this.Yc=0,this.hf=0,o.A.enabled&&o.A.z_(t.buttons)};onmouseenter=t=>{this.H_(t),o.A.enabled&&o.A.j_()};onmouseleave=t=>{this.H_(t),this.Yc=0,this.xl=-1,this.Dl=-1,this.hf=0,this.Rc=-1,this.Sc=-1,o.A.enabled&&o.A.Z_()};onmousemove=t=>{this.H_(t),this.Yc=0,o.A.enabled&&o.A.q_(this.xl,this.Dl)};onfocus=t=>{this.hasFocus=!0,this.__=!0,this.refresh(),o.A.enabled&&o.A.J_()};onblur=t=>{this.hasFocus=!1,o.A.enabled&&o.A.Q_()};ontouchstart=t=>{if(!this.F_)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.b_=!0;const i=t.changedTouches[0],s=0|i.clientX,h=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:s,clientY:h})),this.R_=this.x_=this.M_=0|i.screenX,this.S_=this.D_=this.k_=0|i.screenY,this.time=t.timeStamp,this.v_=this.tE(),this.L_=this.iE()};ontouchend=t=>{if(!this.F_||!this.b_)return;const i=t.changedTouches[0],s=0|i.clientX,h=0|i.clientY;if(this.onmousemove(new MouseEvent('mousemove',{clientX:s,clientY:h})),this.x_=0|i.screenX,this.D_=0|i.screenY,this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.v_&&!this.tE())return void(this.b_=!1);if(this.L_&&!this.iE())return void(this.b_=!1);if(this.Y_()||this.sE()||this.V_()||this.K_()){null!==this.input&&(this.input.parentNode?.contains(this.input)&&this.input.parentNode?.removeChild(this.input),this.input=null);const t=document.createElement('input');return this.V_()?(t.setAttribute('id','username'),t.setAttribute('placeholder','Username')):this.K_()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.Y_()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.sE()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this.hE?t.setAttribute('type','password'):t.setAttribute('type',this.K_()?'password':'text'),t.setAttribute('autofocus','autofocus'),t.setAttribute('spellcheck','false'),t.setAttribute('autocomplete','off'),t.setAttribute('style',`position: fixed; left: ${s}px; top: ${h}px; width: 1px; height: 1px; opacity: 0;`),document.body.appendChild(t),t.focus(),t.click(),this.hE&&(t.oninput=t=>{if(!(t instanceof InputEvent))return;const i=t,s=i.data;null!==s&&'insertText'===i.inputType&&this.onkeydown(new KeyboardEvent('keydown',{key:s,code:s}))}),t.onkeydown=t=>{this.hE&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this.hE&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeyup(new KeyboardEvent('keyup',{key:t.key,code:t.key}))},t.onfocus=t=>{this.input?.parentNode?.removeChild(this.input),this.input=null,this.onfocus(t)},this.input=t,void(this.b_=!1)}const e=t.timeStamp>=this.time+500,n=Math.abs(this.R_-this.x_)>16||Math.abs(this.S_-this.D_)>16;e&&!n?(this.b_=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.hf=0,this.b_=!1)};ontouchmove=t=>{if(!this.F_||!this.b_)return;const i=t.changedTouches[0],s=0|i.clientX,h=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:s,clientY:h})),this.x_=0|i.screenX,this.D_=0|i.screenY,this.v_&&-1===this.Po()?(this.M_-this.x_>0?this.rotate(2):this.M_-this.x_<0&&this.rotate(0),this.k_-this.D_>0?this.rotate(3):this.k_-this.D_<0&&this.rotate(1)):(this.L_||-1!==this.Po())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this.M_=this.x_,this.k_=this.D_};get F_(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get hE(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get W_(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}tE=()=>this.ac&&this.xl>=8&&this.xl<=520&&this.Dl>=11&&this.Dl<=345;Y_=()=>this.ac&&-1===this.No()&&!this.xo()&&!this.Do()&&this.xl>=11&&this.xl<=506&&this.Dl>=449&&this.Dl<=482;sE=()=>this.ac&&(this.xo()||this.Do())&&this.xl>=11&&this.xl<=506&&this.Dl>=383&&this.Dl<=482;iE=()=>this.ac&&this.xl>=562&&this.xl<=752&&this.Dl>=231&&this.Dl<=492;V_=()=>!this.ac&&2===this.ko()&&this.xl>=301&&this.xl<=562&&this.Dl>=262&&this.Dl<=279;K_=()=>!this.ac&&2===this.ko()&&this.xl>=301&&this.xl<=562&&this.Dl>=279&&this.Dl<=296;rotate=t=>{0===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowLeft',code:'ArrowLeft'}))):1===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowUp',code:'ArrowUp'}))):2===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowRight',code:'ArrowRight'}))):3===t&&(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowDown',code:'ArrowDown'})))};eE=()=>null!==document.fullscreenElement;H_=t=>{if(this.eE()){const i=t.target.getBoundingClientRect(),s=window.innerHeight/l.N_.height,h=(window.innerWidth-l.N_.width*s)/2;this.xl=0|this.nE(t.clientX-i.left-h,0,l.N_.width*s,0,789),this.Dl=0|this.nE(t.clientY-i.top,0,l.N_.height*s,0,532)}else{const i=l.N_.getBoundingClientRect(),s=l.N_.width/i.width,h=l.N_.height/i.height;this.xl=(t.clientX-i.left)*s|0,this.Dl=(t.clientY-i.top)*h|0}this.xl<0&&(this.xl=0),this.Dl<0&&(this.Dl=0),this.xl>789&&(this.xl=789),this.Dl>532&&(this.Dl=532)};nE=(t,i,s,h,e)=>(t-i)*(e-h)/(s-i)+h}},2595:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1069);class e{static enabled=!1;static rE=null;static oE=null;static lE=0;static aE=0;static cE=0;static fE=0;static uE=0;static Fy=()=>{this.rE=h.A.Ut(1),this.oE=null,this.lE=performance.now(),this.enabled=!0};static Wc=()=>{this.enabled=!1,this.rE=null};static flush=()=>{let t=null;return this.oE&&this.enabled&&(t=this.oE),this.oE=null,t};static stop=()=>{let t=null;return this.rE&&this.rE.Fc>0&&this.enabled&&(t=this.rE),this.Wc(),t};static X_=(t,i,s)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;this.aE++;const h=performance.now();let e=(h-this.lE)/10|0;e>250&&(e=250),this.lE=h,this.dE(5),1===s?this.rE?.p1(1):this.rE?.p1(2),this.rE?.p1(e),this.rE?.p3(t+(i<<10))};static z_=t=>{if(!this.enabled)return;this.aE++;const i=performance.now();let s=(i-this.lE)/10|0;s>250&&(s=250),this.lE=i,this.dE(2),1===t?this.rE?.p1(3):this.rE?.p1(4),this.rE?.p1(s)};static q_=(t,i)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;const s=performance.now();if(s-this.cE>=50){this.cE=s,this.aE++;let h=(s-this.lE)/10|0;h>250&&(h=250),this.lE=s,t-this.fE<8&&t-this.fE>=-8&&i-this.uE<8&&i-this.uE>=-8?(this.dE(3),this.rE?.p1(5),this.rE?.p1(h),this.rE?.p1(t+(i-this.uE+8<<4)+8-this.fE)):t-this.fE<128&&t-this.fE>=-128&&i-this.uE<128&&i-this.uE>=-128?(this.dE(4),this.rE?.p1(6),this.rE?.p1(h),this.rE?.p1(t+128-this.fE),this.rE?.p1(i+128-this.uE)):(this.dE(5),this.rE?.p1(7),this.rE?.p1(h),this.rE?.p3(t+(i<<10))),this.fE=t,this.uE=i}};static B_=t=>{if(!this.enabled)return;this.aE++;const i=performance.now();let s=(i-this.lE)/10|0;s>250&&(s=250),this.lE=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.dE(3),this.rE?.p1(8),this.rE?.p1(s),this.rE?.p1(t)};static G_=t=>{if(!this.enabled)return;this.aE++;const i=performance.now();let s=(i-this.lE)/10|0;s>250&&(s=250),this.lE=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.dE(3),this.rE?.p1(9),this.rE?.p1(s),this.rE?.p1(t)};static J_=()=>{if(!this.enabled)return;this.aE++;const t=performance.now();let i=(t-this.lE)/10|0;i>250&&(i=250),this.lE=t,this.dE(2),this.rE?.p1(10),this.rE?.p1(i)};static Q_=()=>{if(!this.enabled)return;this.aE++;const t=performance.now();let i=(t-this.lE)/10|0;i>250&&(i=250),this.lE=t,this.dE(2),this.rE?.p1(11),this.rE?.p1(i)};static j_=()=>{if(!this.enabled)return;this.aE++;const t=performance.now();let i=(t-this.lE)/10|0;i>250&&(i=250),this.lE=t,this.dE(2),this.rE?.p1(12),this.rE?.p1(i)};static Z_=()=>{if(!this.enabled)return;this.aE++;const t=performance.now();let i=(t-this.lE)/10|0;i>250&&(i=250),this.lE=t,this.dE(2),this.rE?.p1(13),this.rE?.p1(i)};static dE=t=>{if(this.rE&&this.rE.Fc+t>=500){const t=this.rE;this.rE=h.A.Ut(1),this.oE=t}}}},9091:(t,i,s)=>{s.d(i,{L:()=>h,p:()=>e});const h={'Backspace':{code:8,ch:8},'Enter':{code:10,ch:10},'Shift':{code:16,ch:65535},'Escape':{code:27,ch:27},'Tab':{code:9,ch:9},'CapsLock':{code:20,ch:65535},' ':{code:32,ch:32},'Control':{code:17,ch:65535},'Alt':{code:18,ch:65535},'Meta':{code:524,ch:65535},'ArrowLeft':{code:37,ch:65535},'ArrowRight':{code:39,ch:65535},'ArrowUp':{code:38,ch:65535},'ArrowDown':{code:40,ch:65535},'Insert':{code:155,ch:65535},'Home':{code:36,ch:65535},'PageUp':{code:33,ch:65535},'Delete':{code:127,ch:127},'End':{code:35,ch:65535},'PageDown':{code:34,ch:65535},'`':{code:192,ch:96},'~':{code:192,ch:126},'!':{code:49,ch:33},'@':{code:50,ch:64},'#':{code:51,ch:35},'$':{code:52,ch:36},'%':{code:53,ch:37},'^':{code:54,ch:94},'&':{code:55,ch:38},'*':{code:56,ch:42},'(':{code:57,ch:40},')':{code:48,ch:41},'-':{code:45,ch:45},'_':{code:45,ch:95},'=':{code:61,ch:61},'+':{code:61,ch:43},'[':{code:91,ch:91},'{':{code:91,ch:123},']':{code:93,ch:93},'}':{code:93,ch:125},'\\':{code:92,ch:92},'|':{code:92,ch:124},';':{code:59,ch:59},':':{code:59,ch:58},"'":{code:222,ch:39},'"':{code:222,ch:34},',':{code:44,ch:44},'<':{code:44,ch:60},'.':{code:46,ch:46},'>':{code:46,ch:62},'/':{code:47,ch:47},'?':{code:47,ch:63},'F1':{code:112,ch:65535},'F2':{code:113,ch:65535},'F3':{code:114,ch:65535},'F4':{code:115,ch:65535},'F5':{code:116,ch:65535},'F6':{code:117,ch:65535},'F7':{code:118,ch:65535},'F8':{code:119,ch:65535},'F9':{code:120,ch:65535},'F10':{code:121,ch:65535},'F11':{code:122,ch:65535},'F12':{code:123,ch:65535},0:{code:48,ch:48},1:{code:49,ch:49},2:{code:50,ch:50},3:{code:51,ch:51},4:{code:52,ch:52},5:{code:53,ch:53},6:{code:54,ch:54},7:{code:55,ch:55},8:{code:56,ch:56},9:{code:57,ch:57},'a':{code:65,ch:97},'b':{code:66,ch:98},'c':{code:67,ch:99},'d':{code:68,ch:100},'e':{code:69,ch:101},'f':{code:70,ch:102},'g':{code:71,ch:103},'h':{code:72,ch:104},'i':{code:73,ch:105},'j':{code:74,ch:106},'k':{code:75,ch:107},'l':{code:76,ch:108},'m':{code:77,ch:109},'n':{code:78,ch:110},'o':{code:79,ch:111},'p':{code:80,ch:112},'q':{code:81,ch:113},'r':{code:82,ch:114},'s':{code:83,ch:115},'t':{code:84,ch:116},'u':{code:85,ch:117},'v':{code:86,ch:118},'w':{code:87,ch:119},'x':{code:88,ch:120},'y':{code:89,ch:121},'z':{code:90,ch:122},'A':{code:65,ch:65},'B':{code:66,ch:66},'C':{code:67,ch:67},'D':{code:68,ch:68},'E':{code:69,ch:69},'F':{code:70,ch:70},'G':{code:71,ch:71},'H':{code:72,ch:72},'I':{code:73,ch:73},'J':{code:74,ch:74},'K':{code:75,ch:75},'L':{code:76,ch:76},'M':{code:77,ch:77},'N':{code:78,ch:78},'O':{code:79,ch:79},'P':{code:80,ch:80},'Q':{code:81,ch:81},'R':{code:82,ch:82},'S':{code:83,ch:83},'T':{code:84,ch:84},'U':{code:85,ch:85},'V':{code:86,ch:86},'W':{code:87,ch:87},'X':{code:88,ch:88},'Y':{code:89,ch:89},'Z':{code:90,ch:90}},e=['Tab','F1','F2','F3','F4','F5','F6','F7','F8','F9','F10','ArrowLeft','ArrowRight','ArrowUp','ArrowDown']},1120:(t,i,s)=>{s.d(i,{A:()=>c});var h=s(1069),e=s(8665),n=s(2679),r=s(2511),o=s(3819),l=s(3867),a=s(8950);class c{static Ro=[];static wE=null;static So=null;static Cl=0;static AE=1;static Ol=2;static Wl=3;static Vl=4;static ia=5;static ea=6;static ua=7;static hm=1;static om=2;static lm=3;static am=4;static fm=5;static Zl=6;static Aa=1;static ya=100;static pa=101;static ma=200;static Kw=201;static Xw=202;static Ia=203;static zw=205;static qw=300;static yE=301;static pE=302;static mE=303;static IE=304;static _E=305;static EE=306;static gE=307;static CE=308;static TE=309;static OE=310;static bE=311;static vE=312;static $w=313;static Jw=314;static LE=315;static RE=316;static SE=317;static ME=318;static kE=319;static xE=320;static DE=321;static NE=322;static Qw=323;static Da=324;static Na=325;static tA=326;static Oa=327;static _a=401;static Ea=500;static jw=501;static Zw=502;static Ta=503;static Pa=600;static sA=601;static PE=602;static FE=603;static UE=604;static BE=605;static GE=606;static HE=607;static WE=608;static YE=609;static VE=610;static KE=611;static hA=612;static Fa=613;static Ua=650;static Ha=651;static Wa=652;static Ya=653;static Va=654;static Ba=655;static ec=(t,i,s)=>{this.wE=new n.A(5e4),this.So=new n.A(5e4);const e=new h.A(t.read('data'));let r=-1;for(e.Fc+=2;e.Fc0){h.$o=new Uint8Array(n),h.Qo=new Uint16Array(n);for(let t=0;t0){h.scripts=new l.ds(o,null);for(let t=0;t0){const e=s.lastIndexOf(',');h.Hl[t]=this.XE(i,s.substring(0,e),parseInt(s.substring(e+1),10))}}h.sm=new l.ds(5,null);for(let t=0;t<5;t++){const i=e.ly;h.sm[t]=i,0===i.length&&(h.sm[t]=null)}}if(h.type===c.Wl&&(h.fill=1===e.ZA),h.type===c.Vl||h.type===c.AE){h.$l=1===e.ZA;const t=e.ZA;s&&(h.font=s[t]),h.Ql=1===e.ZA}if(h.type===c.Vl&&(h.text=e.ly,h.zl=e.ly),h.type!==c.AE&&h.type!==c.Wl&&h.type!==c.Vl||(h.Yl=e.Ko),h.type!==c.Wl&&h.type!==c.Vl||(h.Xl=e.Ko,h.Kl=e.Ko),h.type===c.ia){const t=e.ly;if(t.length>0){const s=t.lastIndexOf(',');h.ha=this.XE(i,t.substring(0,s),parseInt(t.substring(s+1),10))}const s=e.ly;if(s.length>0){const t=s.lastIndexOf(',');h.sa=this.XE(i,s.substring(0,t),parseInt(s.substring(t+1),10))}}if(h.type===c.ea){const t=e.ZA;0!==t&&(h.model=this.la((t-1<<8)+e.ZA));const i=e.ZA;0!==i&&(h.zE=this.la((i-1<<8)+e.ZA)),h.al=e.ZA,0===h.al?h.al=-1:h.al=(h.al-1<<8)+e.ZA,h.cl=e.ZA,0===h.cl?h.cl=-1:h.cl=(h.cl-1<<8)+e.ZA,h.zoom=e.KA,h.oa=e.KA,h.fa=e.KA}if(h.type===c.ua){h.Ll=new Int32Array(h.width*h.height),h.Rl=new Int32Array(h.width*h.height),h.$l=1===e.ZA;const t=e.ZA;s&&(h.font=s[t]),h.Ql=1===e.ZA,h.Yl=e.Ko,h.Sl=e.tp,h.Ml=e.tp,h.Qp=1===e.ZA,h.sm=new l.ds(5,null);for(let t=0;t<5;t++){const i=e.ly;h.sm[t]=i,0===i.length&&(h.sm[t]=null)}}h.jl!==c.om&&h.type!==c.Ol||(h._w=e.ly,h.action=e.ly,h.Iw=e.KA),h.jl!==c.hm&&h.jl!==c.am&&h.jl!==c.fm&&h.jl!==c.Zl||(h.rm=e.ly,0===h.rm.length&&(h.jl===c.hm?h.rm='Ok':h.jl===c.am||h.jl===c.fm?h.rm='Select':h.jl===c.Zl&&(h.rm='Continue')))}this.wE=null,this.So=null};static XE=(t,i,s)=>{const h=o.A.jE(i)<<8n|BigInt(s);if(this.wE){const t=this.wE.get(h);if(t)return t}let e;try{e=r.A.za(t,i,s),this.wE?.put(h,e)}catch(t){return null}return e};static la=t=>{if(this.So){const i=this.So.get(BigInt(t));if(i)return i}const i=e.A.model(t);return this.So?.put(BigInt(t),i),i};id=-1;Nd=-1;type=-1;jl=-1;El=0;width=0;height=0;Jp=-1;$o=null;Qo=null;scripts=null;scroll=0;hide=!1;draggable=!1;Qp=!1;im=!1;Sl=0;Ml=0;bl=null;vl=null;Hl=null;sm=null;fill=!1;$l=!1;font=null;Ql=!1;text=null;zl=null;Yl=0;Xl=0;Kl=0;ha=null;sa=null;model=null;zE=null;al=-1;cl=-1;zoom=0;oa=0;fa=0;_w=null;action=null;Iw=-1;rm=null;ll=null;pl=null;ml=null;x=0;y=0;Tl=0;Ll=null;Rl=null;ul=0;fl=0;la(t,i,s){let h=this.model;if(s&&(h=this.zE),!h)return null;if(-1===t&&-1===i&&!h.ZE)return h;const n=e.A.qE(h,!0,!0,!1);return-1===t&&-1===i||n.Ma(),-1!==t&&n.ka(t),-1!==i&&n.ka(i),n.xa(64,768,-50,-10,-50,!0),n}$E(){if(this.Nd===this.id)return this.x;let t=c.Ro[this.Nd];if(!t.ll||!t.pl||!t.ml)return this.x;let i=t.ll.indexOf(this.id);if(-1===i)return this.x;let s=t.pl[i];for(;t.Nd!==t.id;){const h=c.Ro[t.Nd];h.ll&&h.pl&&h.ml&&(i=h.ll.indexOf(t.id),-1!==i&&(s+=h.pl[i])),t=h}return s}JE(){if(this.Nd===this.id)return this.y;let t=c.Ro[this.Nd];if(!t.ll||!t.pl||!t.ml)return this.y;let i=t.ll.indexOf(this.id);if(-1===i)return this.y;let s=t.ml[i];for(;t.Nd!==t.id;){const h=c.Ro[t.Nd];h.ll&&h.pl&&h.ml&&(i=h.ll.indexOf(t.id),-1!==i&&(s+=h.ml[i])),t=h}return s}outline(t){const i=this.$E(),s=this.JE();a.A.Il(i,s,this.width,this.height,t)}move(t,i){if(this.Nd===this.id)return;this.x=0,this.y=0;const s=c.Ro[this.Nd];if(s.ll&&s.pl&&s.ml){const h=s.ll.indexOf(this.id);-1!==h&&(s.pl[h]=t,s.ml[h]=i)}}delete(){if(this.Nd===this.id)return;const t=c.Ro[this.Nd];if(t.ll&&t.pl&&t.ml){const i=t.ll.indexOf(this.id);-1!==i&&(t.ll.splice(i,1),t.pl.splice(i,1),t.ml.splice(i,1))}}}},6333:(t,i,s)=>{s.d(i,{$:()=>h});class h{id;QE=null;constructor(t){this.id=t}tg(t){for(;;){const i=t.ZA;if(0===i)break;this.decode(i,t)}return this}}},2164:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(1069),e=s(6333);class n extends e.${static count=0;static Ro=[];static ec=t=>{const i=new h.A(t.read('flo.dat'));this.count=i.KA;for(let t=0;t(s>179&&(i=i/2|0),s>192&&(i=i/2|0),s>217&&(i=i/2|0),s>243&&(i=i/2|0),(t/4<<10)+(i/32<<7)+(s/2|0));static sg=(t,i)=>-1===t?12345678:((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);static hg=(t,i)=>-2===t?12345678:-1===t?(i<0?i=0:i>127&&(i=127),127-i):((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);eg=0;texture=-1;ng=!1;rg=!0;og=0;lg=0;ag=0;cg=0;fg=0;ug=0;decode(t,i){1===t?(this.eg=i.dg,this.setColor(this.eg)):2===t?this.texture=i.ZA:3===t?this.ng=!0:5===t?this.rg=!1:6===t?this.QE=i.ly:console.log('Error unrecognised config code: ',t)}setColor(t){const i=(t>>16&255)/256,s=(t>>8&255)/256,h=(255&t)/256;let e=i;si&&(r=s),h>r&&(r=h);let o=0,l=0;const a=(e+r)/2;e!==r&&(a<.5&&(l=(r-e)/(r+e)),a>=.5&&(l=(r-e)/(2-r-e)),i===r?o=(s-h)/(r-e):s===r?o=(h-i)/(r-e)+2:h===r&&(o=(i-s)/(r-e)+4)),o/=6,this.og=256*o|0,this.lg=256*l|0,this.ag=256*a|0,this.lg<0?this.lg=0:this.lg>255&&(this.lg=255),this.ag<0?this.ag=0:this.ag>255&&(this.ag=255),this.cg=a>.5?(1-a)*l*512|0:a*l*512|0,this.cg<1&&(this.cg=1),this.fg=o*this.cg|0;let c=this.og+(16*Math.random()|0)-8;c<0?c=0:c>255&&(c=255);let f=this.lg+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255);let u=this.ag+(48*Math.random()|0)-24;u<0?u=0:u>255&&(u=255),this.ug=n.ig(c,f,u)}}},8317:(t,i,s)=>{s.d(i,{A:()=>o});var h=s(1069),e=s(6333),n=s(8665),r=s(3867);class o extends e.${static count=0;static Ro=[];static ec=t=>{const i=new h.A(t.read('idk.dat'));this.count=i.KA;for(let t=0;t=40&&t<50)this.yg[t-40]=i.KA;else if(t>=50&&t<60)this.pg[t-50]=i.KA;else{if(!(t>=60&&t<70))throw new Error(`Unrecognized idk config code: ${t}`);this.Ag[t-60]=i.KA}}la(){if(!this.wg)return null;const t=new r.ds(this.wg.length,null);for(let i=0;i{s.d(i,{A:()=>c});var h=s(6333),e=s(1069),n=s(2679),r=s(8665),o=s(1023),l=s(6169),a=s(3867);class c extends h.${static count=0;static cache=null;static mg=null;static Ig=null;static _g=0;static tu=new n.A(500);static iu=new n.A(30);static ec=t=>{this.mg=new e.A(t.read('loc.dat'));const i=new e.A(t.read('loc.idx'));this.count=i.KA,this.Ig=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.Ig||!this.mg)throw new Error('LocType not loaded!!!');for(let i=0;i<10;i++){const s=this.cache[i];if(s&&s.id===t)return s}this._g=(this._g+1)%10;const i=this.cache[this._g];return this.mg.Fc=this.Ig[t],i.id=t,i.reset(),i.tg(this.mg),i.Eg||(i.Eg=new Int32Array(1)),-1===i.gg&&i.Eg&&(i.active=i.Eg.length>0&&i.Eg[0]===o.A.rA.id,i.wm&&(i.active=!0)),i};static bo=()=>{this.tu=null,this.iu=null,this.Ig=null,this.cache=null,this.mg=null};wg=null;Eg=null;name=null;sw=null;yg=null;pg=null;width=1;length=1;NA=!0;PA=!0;active=!1;gg=-1;Cg=!1;Tg=!1;rg=!1;al=-1;Og=!1;bg=16;vg=0;Lg=0;wm=null;yd=-1;Cd=-1;Rg=!1;Sg=!0;Mg=128;kg=128;xg=128;aA=0;Dg=0;Ng=0;Pg=0;Fg=!1;decode(t,i){if(1===t){const t=i.ZA;this.wg=new Int32Array(t),this.Eg=new Int32Array(t);for(let s=0;s=30&&t<39)this.wm||(this.wm=new a.ds(5,null)),this.wm[t-30]=i.ly,'hidden'===this.wm[t-30]?.toLowerCase()&&(this.wm[t-30]=null);else if(40===t){const t=i.ZA;this.yg=new Uint16Array(t),this.pg=new Uint16Array(t);for(let s=0;s=this.wg.length)return null;let d=this.wg[a];if(-1===d)return null;const w=this.Rg!==i>3;w&&(d+=65536);let A=c.tu?.get(BigInt(d));A||(A=r.A.model(65535&d),w&&A.Vg(),c.tu?.put(BigInt(d),A));const y=128!==this.Mg||128!==this.kg||128!==this.xg,p=0!==this.Dg||0!==this.Ng||0!==this.Pg;let m=r.A.qE(A,!this.yg,!this.Og,i===l.A.bd&&-1===o&&!y&&!p);for(-1!==o&&(m.Ma(),m.ka(o),m.Kg=null,m.Xg=null);i-- >0;)m.zg();if(this.yg&&this.pg)for(let t=0;t{s.d(i,{A:()=>l});var h=s(6333),e=s(1069),n=s(2679),r=s(8665),o=s(3867);class l extends h.${static count=0;static cache=null;static mg=null;static Ig=null;static _g=0;static So=new n.A(30);static ec=t=>{this.mg=new e.A(t.read('npc.dat'));const i=new e.A(t.read('npc.idx'));this.count=i.KA,this.Ig=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.Ig||!this.mg)throw new Error('NpcType not loaded!!!');for(let i=0;i<20;i++){const s=this.cache[i];if(s&&s.id===t)return s}this._g=(this._g+1)%20;const i=this.cache[this._g]=new l(t);return this.mg.Fc=this.Ig[t],i.tg(this.mg),i};static bo=()=>{this.So=null,this.Ig=null,this.cache=null,this.mg=null};name=null;sw=null;size=1;wg=null;Ag=null;Og=!1;AI=-1;lI=-1;cI=-1;uI=-1;wI=-1;yg=null;pg=null;wm=null;Mg=-1;kg=-1;xg=-1;od=!0;_m=-1;qg=128;$g=128;decode(t,i){if(1===t){const t=i.ZA;this.wg=new Uint16Array(t);for(let s=0;s=30&&t<40)this.wm||(this.wm=new o.ds(5,null)),this.wm[t-30]=i.ly,'hidden'===this.wm[t-30]?.toLowerCase()&&(this.wm[t-30]=null);else if(40===t){const t=i.ZA;this.yg=new Uint16Array(t),this.pg=new Uint16Array(t);for(let s=0;s{s.d(i,{A:()=>u});var h=s(6333),e=s(1069),n=s(2511),r=s(2679),o=s(8665),l=s(4583),a=s(8950),c=s(9298),f=s(3867);class u extends h.${static count=0;static cache=null;static mg=null;static Ig=null;static _g=0;static hC=!0;static So=new r.A(50);static su=new r.A(200);static ec=(t,i)=>{this.hC=i,this.mg=new e.A(t.read('obj.dat'));const s=new e.A(t.read('obj.idx'));this.count=s.KA,this.Ig=new Int32Array(this.count);let h=2;for(let t=0;t{if(!this.cache||!this.Ig||!this.mg)throw new Error('ObjType not loaded!!!');for(let i=0;i<10;i++){const s=this.cache[i];if(s&&s.id===t)return s}this._g=(this._g+1)%10;const i=this.cache[this._g];return this.mg.Fc=this.Ig[t],i.id=t,i.reset(),i.tg(this.mg),-1!==i.eC&&i.nC(),!this.hC&&i.members&&(i.name='Members Object',i.sw="Login to a members' server to use this object.",i.wm=null,i.tm=null),i};static bo=()=>{this.So=null,this.su=null,this.Ig=null,this.cache=null,this.mg=null};static kl=(t,i)=>{if(u.su){let s=u.su.get(BigInt(t));if(s&&s.fd!==i&&-1!==s.fd&&(s.sy(),s=null),s)return s}let s=u.get(t);if(s.rC||(i=-1),s.rC&&s.oC&&i>1){let t=-1;for(let h=0;h<10;h++)i>=s.oC[h]&&0!==s.oC[h]&&(t=s.rC[h]);-1!==t&&(s=u.get(t))}const h=new n.A(32,32),e=l.A.na,r=l.A.ra,o=l.A.oc,f=a.A.nc,d=a.A.lC,w=a.A.aC,A=a.A.left,y=a.A.right,p=a.A.top,m=a.A.bottom;l.A.cC=!1,a.A.bind(h.nc,32,32),a.A.fillRect(0,0,32,32,c.A.Bl),l.A.P_();const I=s.vA(1),_=l.A.sin[s.yp]*s.mp>>16,E=l.A.cos[s.yp]*s.mp>>16;I.ca(0,s.pp,s.fC,s.yp,s.uC,_+(I.Zg/2|0)+s.dC,E+s.dC);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===h.nc[t+32*i]&&(t>0&&h.nc[t+32*i-1]>1||i>0&&h.nc[t+32*(i-1)]>1||t<31&&h.nc[t+32*i+1]>1||i<31&&h.nc[t+32*(i+1)]>1)&&(h.nc[t+32*i]=1);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===h.nc[t+32*i]&&t>0&&i>0&&h.nc[t+32*(i-1)-1]>0&&(h.nc[t+32*i]=3153952);if(-1!==s.eC){const t=this.kl(s.wC,10),i=t.Pl,h=t.fd;t.Pl=32,t.fd=32,t.AC(5,5,22,22),t.Pl=i,t.fd=h}return u.su?.put(BigInt(t),h),a.A.bind(f,d,w),a.A.yl(A,p,y,m),l.A.na=e,l.A.ra=r,l.A.oc=o,l.A.cC=!0,s.da?h.Pl=33:h.Pl=32,h.fd=i,h};model=0;name=null;sw=null;yg=null;pg=null;mp=2e3;yp=0;pp=0;fC=0;uC=0;dC=0;yC=!1;pC=-1;da=!1;OA=1;members=!1;wm=null;tm=null;mC=-1;IC=-1;_C=0;EC=-1;gC=-1;CC=0;TC=-1;OC=-1;bC=-1;vC=-1;LC=-1;RC=-1;rC=null;oC=null;wC=-1;eC=-1;decode(t,i){if(1===t)this.model=i.KA;else if(2===t)this.name=i.ly;else if(3===t)this.sw=i.ly;else if(4===t)this.mp=i.KA;else if(5===t)this.yp=i.KA;else if(6===t)this.pp=i.KA;else if(7===t)this.uC=i.tp,this.uC>32767&&(this.uC-=65536);else if(8===t)this.dC=i.tp,this.dC>32767&&(this.dC-=65536);else if(9===t)this.yC=!0;else if(10===t)this.pC=i.KA;else if(11===t)this.da=!0;else if(12===t)this.OA=i.Ko;else if(16===t)this.members=!0;else if(23===t)this.mC=i.KA,this._C=i.zA;else if(24===t)this.IC=i.KA;else if(25===t)this.EC=i.KA,this.CC=i.zA;else if(26===t)this.gC=i.KA;else if(t>=30&&t<35)this.wm||(this.wm=new f.ds(5,null)),this.wm[t-30]=i.ly,'hidden'===this.wm[t-30]?.toLowerCase()&&(this.wm[t-30]=null);else if(t>=35&&t<40)this.tm||(this.tm=new f.ds(5,null)),this.tm[t-35]=i.ly;else if(40===t){const t=i.ZA;this.yg=new Uint16Array(t),this.pg=new Uint16Array(t);for(let s=0;s=100&&t<110&&(this.rC&&this.oC||(this.rC=new Uint16Array(10),this.oC=new Uint16Array(10)),this.rC[t-100]=i.KA,this.oC[t-100]=i.KA)}SC(t){let i=this.mC;if(1===t&&(i=this.EC),-1===i)return null;let s=this.IC,h=this.TC;1===t&&(s=this.gC,h=this.OC);let e=o.A.model(i);if(-1!==s){const t=o.A.model(s);if(-1===h){const i=[e,t];e=o.A.ba(i,2)}else{const i=[e,t,o.A.model(h)];e=o.A.ba(i,3)}}if(0===t&&0!==this._C&&e.translate(this._C,0,0),1===t&&0!==this.CC&&e.translate(this.CC,0,0),this.yg&&this.pg)for(let t=0;t1){let i=-1;for(let s=0;s<10;s++)t>=this.oC[s]&&0!==this.oC[s]&&(i=this.rC[s]);if(-1!==i)return u.get(i).vA(1)}if(u.So){const t=u.So.get(BigInt(this.id));if(t)return t}const i=o.A.model(this.model);if(this.yg&&this.pg)for(let t=0;t{s.d(i,{A:()=>r});var h=s(6333),e=s(1069),n=s(6730);class r extends h.${static count=0;static Ro=[];static ec=t=>{const i=new e.A(t.read('seq.dat'));this.count=i.KA;for(let t=0;t{s.d(i,{A:()=>l});var h=s(6333),e=s(1069),n=s(1312),r=s(8665),o=s(2679);class l extends h.${static count=0;static Ro=[];static So=new o.A(30);static ec=t=>{const i=new e.A(t.read('spotanim.dat'));this.count=i.KA;for(let t=0;t=40&&t<50)this.yg[t-40]=i.KA;else{if(!(t>=50&&t<60))throw new Error(`Unrecognized spotanim config code: ${t}`);this.pg[t-50]=i.KA}}la(){let t=l.So?.get(BigInt(this.id));if(t)return t;t=r.A.model(this.model);for(let i=0;i<6;i++)0!==this.yg[0]&&t.va(this.yg[i],this.pg[i]);return l.So?.put(BigInt(this.id),t),t}}},3764:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(6333),e=s(1069);class n extends h.${static count=0;static Ro=[];static xC=[];static DC=0;static ec=t=>{const i=new e.A(t.read('varp.dat'));this.count=i.KA;for(let t=0;t{s.d(i,{A:()=>h});class h{static OPEN=0;static BC=1;static GC=2;static HC=4;static WC=8;static YC=h.BC<<4;static VC=h.GC<<4;static KC=h.HC<<4;static XC=h.WC<<4;static zC=256;static jC=512;static ZC=1024;static qC=2048;static $C=4096;static JC=h.jC<<4;static QC=h.ZC<<4;static tT=h.qC<<4;static iT=h.$C<<4;static sT=h.zC<<9;static hT=524288;static eT=2097152;static nT=h.eT|h.hT;static rT=h.zC|h.nT;static Id=h.GC|h.rT;static pd=h.WC|h.rT;static bm=h.GC|h.HC|h.pd;static _d=h.VC|h.rT;static Lm=h.WC|h.YC|h._d;static md=h.XC|h.rT;static vm=h.BC|h.GC|h.md;static Rm=h.VC|h.KC|h.md;static oT=16777215}},670:(t,i,s)=>{s.d(i,{A:()=>o});var h=s(9456),e=s(6169),n=s(1023),r=s(4909);class o{static xn=4;static Xn=104;static index=(t,i)=>t*o.Xn+i;offsetX;lT;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.lT=0,this.sizeX=o.Xn,this.sizeZ=o.Xn,this.flags=new Int32Array(this.sizeX*this.sizeZ),this.reset()}reset=()=>{for(let t=0;t{this.flags[o.index(t-this.offsetX,i-this.lT)]|=h.A.eT};GA=(t,i)=>{this.flags[o.index(t-this.offsetX,i-this.lT)]&=~h.A.eT};RA=(t,i,s,n,r,o)=>{let l=h.A.zC;o&&(l|=h.A.sT);const a=t-this.offsetX,c=i-this.lT;if(r===e.A.vd||r===e.A.Rd){const t=s;s=n,n=t}for(let t=a;t=0&&t=0&&i{let l=h.A.zC;o&&(l|=h.A.sT);const a=t-this.offsetX,c=i-this.lT;if(r===e.A.vd||r===e.A.Rd){const t=s;s=n,n=t}for(let t=a;t=0&&t=0&&i{const l=t-this.offsetX,a=i-this.lT,c=o?h.A.iT:h.A.XC,f=o?h.A.$C:h.A.WC,u=o?h.A.ZC:h.A.GC,d=o?h.A.QC:h.A.VC,w=o?h.A.jC:h.A.BC,A=o?h.A.JC:h.A.YC,y=o?h.A.qC:h.A.HC,p=o?h.A.tT:h.A.KC;s===n.A.Td.id?r===e.A.bd?(this.add(l,a,c),this.add(l-1,a,f)):r===e.A.vd?(this.add(l,a,u),this.add(l,a+1,d)):r===e.A.Ld?(this.add(l,a,f),this.add(l+1,a,c)):r===e.A.Rd&&(this.add(l,a,d),this.add(l,a-1,u)):s===n.A.fT.id||s===n.A.Sd.id?r===e.A.bd?(this.add(l,a,w),this.add(l-1,a+1,A)):r===e.A.vd?(this.add(l,a,y),this.add(l+1,a+1,p)):r===e.A.Ld?(this.add(l,a,A),this.add(l+1,a-1,w)):r===e.A.Rd&&(this.add(l,a,p),this.add(l-1,a-1,y)):s===n.A.Od.id&&(r===e.A.bd?(this.add(l,a,u|c),this.add(l-1,a,f),this.add(l,a+1,d)):r===e.A.vd?(this.add(l,a,u|f),this.add(l,a+1,d),this.add(l+1,a,c)):r===e.A.Ld?(this.add(l,a,d|f),this.add(l+1,a,c),this.add(l,a-1,u)):r===e.A.Rd&&(this.add(l,a,d|c),this.add(l,a-1,u),this.add(l-1,a,f))),o&&this.cT(t,i,s,r,!1)};DA=(t,i,s,r,o)=>{const l=t-this.offsetX,a=i-this.lT,c=o?h.A.iT:h.A.XC,f=o?h.A.$C:h.A.WC,u=o?h.A.ZC:h.A.GC,d=o?h.A.QC:h.A.VC,w=o?h.A.jC:h.A.BC,A=o?h.A.JC:h.A.YC,y=o?h.A.qC:h.A.HC,p=o?h.A.tT:h.A.KC;s===n.A.Td.id?r===e.A.bd?(this.remove(l,a,c),this.remove(l-1,a,f)):r===e.A.vd?(this.remove(l,a,u),this.remove(l,a+1,d)):r===e.A.Ld?(this.remove(l,a,f),this.remove(l+1,a,c)):r===e.A.Rd&&(this.remove(l,a,d),this.remove(l,a-1,u)):s===n.A.fT.id||s===n.A.Sd.id?r===e.A.bd?(this.remove(l,a,w),this.remove(l-1,a+1,A)):r===e.A.vd?(this.remove(l,a,y),this.remove(l+1,a+1,p)):r===e.A.Ld?(this.remove(l,a,A),this.remove(l+1,a-1,w)):r===e.A.Rd&&(this.remove(l,a,p),this.remove(l-1,a-1,y)):s===n.A.Od.id&&(r===e.A.bd?(this.remove(l,a,u|c),this.remove(l-1,a,f),this.remove(l,a+1,d)):r===e.A.vd?(this.remove(l,a,u|f),this.remove(l,a+1,d),this.remove(l+1,a,c)):r===e.A.Ld?(this.remove(l,a,d|f),this.remove(l+1,a,c),this.remove(l,a-1,u)):r===e.A.Rd&&(this.remove(l,a,d|c),this.remove(l,a-1,u),this.remove(l-1,a,f))),o&&this.DA(t,i,s,r,!1)};Cm=(t,i,s,r,l,a)=>{if(t===s&&i===r)return!0;const c=t-this.offsetX,f=i-this.lT,u=s-this.offsetX,d=r-this.lT,w=o.index(c,f);if(l===n.A.Td.id){if(a===e.A.bd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A._d)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.Id)===h.A.OPEN)return!0}else if(a===e.A.vd){if(c===u&&f===d+1)return!0;if(c===u-1&&f===d&&(this.flags[w]&h.A.pd)===h.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.md)===h.A.OPEN)return!0}else if(a===e.A.Ld){if(c===u+1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A._d)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.Id)===h.A.OPEN)return!0}else if(a===e.A.Rd){if(c===u&&f===d-1)return!0;if(c===u-1&&f===d&&(this.flags[w]&h.A.pd)===h.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.md)===h.A.OPEN)return!0}}else if(l===n.A.Od.id){if(a===e.A.bd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.md)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.Id)===h.A.OPEN)return!0}else if(a===e.A.vd){if(c===u-1&&f===d&&(this.flags[w]&h.A.pd)===h.A.OPEN)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.Id)===h.A.OPEN)return!0}else if(a===e.A.Ld){if(c===u-1&&f===d&&(this.flags[w]&h.A.pd)===h.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A._d)===h.A.OPEN)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1)return!0}else if(a===e.A.Rd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A._d)===h.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.md)===h.A.OPEN)return!0;if(c===u&&f===d-1)return!0}}else if(l===n.A.kd.id){if(c===u&&f===d+1&&(this.flags[w]&h.A.VC)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.GC)===h.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&h.A.WC)===h.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.XC)===h.A.OPEN)return!0}return!1};Tm=(t,i,s,r,l,a)=>{if(t===s&&i===r)return!0;const c=t-this.offsetX,f=i-this.lT,u=s-this.offsetX,d=r-this.lT,w=o.index(c,f);if(l===n.A.uT.id||l===n.A.dT.id){if(l===n.A.dT.id&&(a=a+2&3),a===e.A.bd){if(c===u+1&&f===d&&(this.flags[w]&h.A.XC)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.GC)===h.A.OPEN)return!0}else if(a===e.A.vd){if(c===u-1&&f===d&&(this.flags[w]&h.A.WC)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.GC)===h.A.OPEN)return!0}else if(a===e.A.Ld){if(c===u-1&&f===d&&(this.flags[w]&h.A.WC)===h.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A.VC)===h.A.OPEN)return!0}else if(a===e.A.Rd){if(c===u+1&&f===d&&(this.flags[w]&h.A.XC)===h.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A.VC)===h.A.OPEN)return!0}}else if(l===n.A.wT.id){if(c===u&&f===d+1&&(this.flags[w]&h.A.VC)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.GC)===h.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&h.A.WC)===h.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.XC)===h.A.OPEN)return!0}return!1};Om=(t,i,s,e,n,l,a)=>{const c=s+n-1,f=e+l-1,u=o.index(t-this.offsetX,i-this.lT);return t>=s&&t<=c&&i>=e&&i<=f||(t===s-1&&i>=e&&i<=f&&(this.flags[u]&h.A.WC)===h.A.OPEN&&(a&r.A.bd)===h.A.OPEN||(t===c+1&&i>=e&&i<=f&&(this.flags[u]&h.A.XC)===h.A.OPEN&&(a&r.A.Ld)===h.A.OPEN||(i===e-1&&t>=s&&t<=c&&(this.flags[u]&h.A.GC)===h.A.OPEN&&(a&r.A.Rd)===h.A.OPEN||i===f+1&&t>=s&&t<=c&&(this.flags[u]&h.A.VC)===h.A.OPEN&&(a&r.A.vd)===h.A.OPEN)))};add=(t,i,s)=>{this.flags[o.index(t,i)]|=s};remove=(t,i,s)=>{this.flags[o.index(t,i)]&=h.A.oT-s}}},4909:(t,i,s)=>{s.d(i,{A:()=>h});class h{static vd=1;static Ld=2;static Rd=4;static bd=8}},6169:(t,i,s)=>{s.d(i,{A:()=>h});class h{static bd=0;static vd=1;static Ld=2;static Rd=3}},5599:(t,i,s)=>{s.d(i,{A:()=>h});class h{static SA=0;static MA=1;static xA=2;static lA=3}},1023:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(5599);class e{static Td=new e(0,h.A.SA);static fT=new e(1,h.A.SA);static Od=new e(2,h.A.SA);static Sd=new e(3,h.A.SA);static VI=new e(4,h.A.MA);static gm=new e(5,h.A.MA);static uT=new e(6,h.A.MA);static dT=new e(7,h.A.MA);static wT=new e(8,h.A.MA);static kd=new e(9,h.A.xA);static rA=new e(10,h.A.xA);static oA=new e(11,h.A.xA);static AT=new e(12,h.A.xA);static yT=new e(13,h.A.xA);static pT=new e(14,h.A.xA);static mT=new e(15,h.A.xA);static IT=new e(16,h.A.xA);static _T=new e(17,h.A.xA);static ET=new e(18,h.A.xA);static gT=new e(19,h.A.xA);static CT=new e(20,h.A.xA);static TT=new e(21,h.A.xA);static lA=new e(22,h.A.lA);static values(){return[this.Td,this.fT,this._T,this.mT,this.Od,this.pT,this.kd,this.Sd,this.lA,this.AT,this.oA,this.uT,this.CT,this.rA,this.gm,this.yT,this.dT,this.VI,this.IT,this.wT,this.gT,this.TT,this.ET]}static of(t){const i=this.values();for(let s=0;s{s.d(i,{A:()=>y});var h=s(670),e=s(2164),n=s(1069),r=s(4583),o=s(3045),l=s(5637),a=s(4197),c=s(1312),f=s(1023),u=s(6169),d=s(9298),w=s(5518),A=s(3867);class y{static OT=Int8Array.of(1,2,4,8);static bT=Uint8Array.of(16,32,64,128);static vT=Int8Array.of(1,0,-1,0);static LT=Int8Array.of(0,-1,0,1);static RT=(17*Math.random()|0)-8;static ST=(33*Math.random()|0)-16;static st=!0;static Dp=0;static MT=!1;static kT=(t,i)=>{let s=this.xT(t+45365,i+91923,4)+(this.xT(t+10294,i+37821,2)-128>>1)+(this.xT(t,i,1)-128>>2)-128;return s=35+(.3*s|0),s<10?s=10:s>60&&(s=60),s};static xT=(t,i,s)=>{const h=t/s|0,e=t&s-1,n=i/s|0,r=i&s-1,o=this.DT(h,n),l=this.DT(h+1,n),a=this.DT(h,n+1),c=this.DT(h+1,n+1),f=this.NT(o,l,e,s),u=this.NT(a,c,e,s);return this.NT(f,u,r,s)};static NT=(t,i,s,h)=>{const e=65536-r.A.cos[1024*s/h|0]>>1;return(t*(65536-e)>>16)+(i*e>>16)};static DT=(t,i)=>((this.PT(t-1,i-1)+this.PT(t+1,i-1)+this.PT(t-1,i+1)+this.PT(t+1,i+1))/16|0)+((this.PT(t-1,i)+this.PT(t+1,i)+this.PT(t,i-1)+this.PT(t,i+1))/8|0)+(this.PT(t,i)/4|0);static PT=(t,i)=>{const s=t+57*i,h=BigInt(s<<13^s);return 255&Number((h*(h*h*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static RA=(t,i,s,h,e,n,r,o,d,w,A)=>{const p=e[A][i][s],m=e[A][i+1][s],I=e[A][i+1][s+1],_=e[A][i][s+1],E=p+m+I+_>>2,g=l.A.get(o);let C=i+(s<<7)+(o<<14)+1073741824|0;g.active||(C+=-2147483648),C|=0;const T=(w<<6)+d<<24>>24;if(d===f.A.lA.id)h?.FT(g.la(f.A.lA.id,w,p,m,I,_,-1),t,i,s,E,C,T),g.NA&&g.active&&r?.aT(i,s),-1!==g.al&&n.n_(new a.A(o,t,3,i,s,c.A.Ro[g.al],!0));else if(d===f.A.rA.id||d===f.A.oA.id){const e=g.la(f.A.rA.id,w,p,m,I,_,-1);if(e){let n,r,o=0;d===f.A.oA.id&&(o+=256),w===u.A.vd||w===u.A.Rd?(n=g.length,r=g.width):(n=g.width,r=g.length),h?.RA(t,i,s,E,e,null,C,T,n,r,o)}g.NA&&r?.RA(i,s,g.width,g.length,w,g.PA),-1!==g.al&&n.n_(new a.A(o,t,2,i,s,c.A.Ro[g.al],!0))}else if(d>=f.A.AT.id)h?.RA(t,i,s,E,g.la(d,w,p,m,I,_,-1),null,C,T,1,1,0),g.NA&&r?.RA(i,s,g.width,g.length,w,g.PA),-1!==g.al&&n.n_(new a.A(o,t,2,i,s,c.A.Ro[g.al],!0));else if(d===f.A.Td.id)h?.cT(t,i,s,E,y.OT[w],0,g.la(f.A.Td.id,w,p,m,I,_,-1),null,C,T),g.NA&&r?.cT(i,s,d,w,g.PA),-1!==g.al&&n.n_(new a.A(o,t,0,i,s,c.A.Ro[g.al],!0));else if(d===f.A.fT.id)h?.cT(t,i,s,E,y.bT[w],0,g.la(f.A.fT.id,w,p,m,I,_,-1),null,C,T),g.NA&&r?.cT(i,s,d,w,g.PA),-1!==g.al&&n.n_(new a.A(o,t,0,i,s,c.A.Ro[g.al],!0));else if(d===f.A.Od.id){const e=w+1&3;h?.cT(t,i,s,E,y.OT[w],y.OT[e],g.la(f.A.Od.id,w+4,p,m,I,_,-1),g.la(f.A.Od.id,e,p,m,I,_,-1),C,T),g.NA&&r?.cT(i,s,d,w,g.PA),-1!==g.al&&n.n_(new a.A(o,t,0,i,s,c.A.Ro[g.al],!0))}else if(d===f.A.Sd.id)h?.cT(t,i,s,E,y.bT[w],0,g.la(f.A.Sd.id,w,p,m,I,_,-1),null,C,T),g.NA&&r?.cT(i,s,d,w,g.PA),-1!==g.al&&n.n_(new a.A(o,t,0,i,s,c.A.Ro[g.al],!0));else if(d===f.A.kd.id)h?.RA(t,i,s,E,g.la(d,w,p,m,I,_,-1),null,C,T,1,1,0),g.NA&&r?.RA(i,s,g.width,g.length,w,g.PA),-1!==g.al&&n.n_(new a.A(o,t,2,i,s,c.A.Ro[g.al],!0));else if(d===f.A.VI.id)h?.UT(t,i,s,E,0,0,C,g.la(f.A.VI.id,u.A.bd,p,m,I,_,-1),T,512*w,y.OT[w]),-1!==g.al&&n.n_(new a.A(o,t,1,i,s,c.A.Ro[g.al],!0));else if(d===f.A.gm.id){let e=16;if(h){const n=h.Ed(t,i,s);n>0&&(e=l.A.get(n>>14&32767).bg)}h?.UT(t,i,s,E,y.vT[w]*e,y.LT[w]*e,C,g.la(f.A.VI.id,u.A.bd,p,m,I,_,-1),T,512*w,y.OT[w]),-1!==g.al&&n.n_(new a.A(o,t,1,i,s,c.A.Ro[g.al],!0))}else d===f.A.uT.id?(h?.UT(t,i,s,E,0,0,C,g.la(f.A.VI.id,u.A.bd,p,m,I,_,-1),T,w,256),-1!==g.al&&n.n_(new a.A(o,t,1,i,s,c.A.Ro[g.al],!0))):d===f.A.dT.id?(h?.UT(t,i,s,E,0,0,C,g.la(f.A.VI.id,u.A.bd,p,m,I,_,-1),T,w,512),-1!==g.al&&n.n_(new a.A(o,t,1,i,s,c.A.Ro[g.al],!0))):d===f.A.wT.id&&(h?.UT(t,i,s,E,0,0,C,g.la(f.A.VI.id,u.A.bd,p,m,I,_,-1),T,w,768),-1!==g.al&&n.n_(new a.A(o,t,1,i,s,c.A.Ro[g.al],!0)))};xI;DI;Wn;Yn;BT;GT;HT;WT;YT;VT;KT;XT;zT;jT;ZT;qT;constructor(t,i,s,e){this.xI=t,this.DI=i,this.Wn=s,this.Yn=e,this.BT=new A.qa(h.A.xn,t,i),this.GT=new A.qa(h.A.xn,t,i),this.HT=new A.qa(h.A.xn,t,i),this.WT=new A.qa(h.A.xn,t,i),this.qT=new A.$a(h.A.xn,t+1,i+1),this.YT=new A.qa(h.A.xn,t+1,i+1),this.VT=new A.Kn(t+1,i+1),this.KT=new Int32Array(i),this.XT=new Int32Array(i),this.zT=new Int32Array(i),this.jT=new Int32Array(i),this.ZT=new Int32Array(i)}Hp=(t,i)=>{for(let t=0;t=0&&i[h]?.aT(s,e)}y.RT+=(5*Math.random()|0)-2,y.RT<-8?y.RT=-8:y.RT>8&&(y.RT=8),y.ST+=(5*Math.random()|0)-2,y.ST<-16?y.ST=-16:y.ST>16&&(y.ST=16);for(let i=0;i>8;for(let t=1;t>2)+(s[e+1][t]>>3)+(s[e][t-1]>>2)+(s[e][t+1]>>3)+(s[e][t]>>1);this.VT[e][t]=u-d}for(let t=0;t=0&&h0){const i=e.A.Ro[s-1];this.KT[t]+=i.fg,this.XT[t]+=i.lg,this.zT[t]+=i.ag,this.jT[t]+=i.cg,n=this.ZT[t]++}}const r=s-5;if(r>=0&&r0){const i=e.A.Ro[s-1];this.KT[t]-=i.fg,this.XT[t]-=i.lg,this.zT[t]-=i.ag,this.jT[t]-=i.cg,n=this.ZT[t]--}}}if(s>=1&&s=0&&f=0&&A=1&&c0||A>0){const p=this.Wn[i][s][c],m=this.Wn[i][s+1][c],I=this.Wn[i][s+1][c+1],_=this.Wn[i][s][c+1],E=this.VT[s][c],g=this.VT[s+1][c],C=this.VT[s+1][c+1],T=this.VT[s][c+1];let O=-1,b=-1;if(f>0){const t=256*h/l|0,i=n/a|0;let s=o/a|0;O=e.A.ig(t,i,s);const r=t+y.RT&255;s+=y.ST,s<0?s=0:s>255&&(s=255),b=e.A.ig(r,i,s)}if(i>0){let t=0!==f||this.HT[i][s][c]===w.A.JT;A>0&&!e.A.Ro[A-1].rg&&(t=!1),t&&p===m&&p===I&&p===_&&(this.qT[i][s][c]|=2340)}let v=0;if(-1!==O&&(v=r.A.palette[e.A.sg(b,96)]),0===A)t?.QT(i,s,c,w.A.JT,u.A.bd,-1,p,m,I,_,e.A.sg(O,E),e.A.sg(O,g),e.A.sg(O,C),e.A.sg(O,T),d.A.Bl,d.A.Bl,d.A.Bl,d.A.Bl,v,d.A.Bl);else{const h=this.HT[i][s][c]+1,n=this.WT[i][s][c],o=e.A.Ro[A-1];let l,a,f=o.texture;f>=0?(a=r.A.tO(f),l=-1):o.eg===d.A.vc?(a=0,l=-2,f=-1):(l=e.A.ig(o.og,o.lg,o.ag),a=r.A.palette[e.A.hg(o.ug,96)]),t?.QT(i,s,c,h,n,f,p,m,I,_,e.A.sg(O,E),e.A.sg(O,g),e.A.sg(O,C),e.A.sg(O,T),e.A.hg(l,E),e.A.hg(l,g),e.A.hg(l,C),e.A.hg(l,T),v,a)}}}}}}for(let s=1;s0&&(t<<=3,i<<=3,s<<=3);for(let h=0;h<=e;h++)for(let n=0;n<=this.DI;n++)for(let r=0;r<=this.xI;r++){if(this.qT[h][r][n]&t){let i=n,s=n,l=h,a=h;for(;i>0&&this.qT[h][r][i-1]&t;)i--;for(;s0;){for(let h=i;h<=s;h++)if(!(this.qT[l-1][r][h]&t))break t;l--}t:for(;a=8){const h=this.Wn[a][r][i]-240,n=this.Wn[l][r][i];o.A.eO(e,1,128*r,h,128*i,128*r,n,128*s+128);for(let h=l;h<=a;h++)for(let e=i;e<=s;e++)this.qT[h][r][e]&=~t}}if(this.qT[h][r][n]&i){let t=r,s=r,l=h,a=h;for(;t>0&&this.qT[h][t-1][n]&i;)t--;for(;s0;){for(let h=t;h<=s;h++)if(!(this.qT[l-1][h][n]&i))break t;l--}t:for(;a=8){const h=this.Wn[a][t][n]-240,r=this.Wn[l][t][n];o.A.eO(e,2,128*t,h,128*n,128*s+128,r,128*n);for(let h=l;h<=a;h++)for(let e=t;e<=s;e++)this.qT[h][e][n]&=~i}}if(this.qT[h][r][n]&s){let t=r,i=r,l=n,a=n;for(;l>0&&this.qT[h][r][l-1]&s;)l--;for(;a0;){for(let i=l;i<=a;i++)if(!(this.qT[h][t-1][i]&s))break t;t--}t:for(;i=4){const n=this.Wn[h][t][l];o.A.eO(e,4,128*t,n,128*l,128*i+128,n,128*a+128);for(let e=t;e<=i;e++)for(let t=l;t<=a;t++)this.qT[h][e][t]&=~s}}}}}};Bp=(t,i,s,n)=>{let r=0;for(let t=0;t>24;break}for(let e=t;e=0&&t=0&&e{const o=new n.A(new Uint8Array(r));for(let n=0;n=0&&a=0&&c>24,this.WT[n][a][c]=(f-2&3)<<24>>24):f<=81?this.Yn[n][a][c]=f-49<<24>>24:this.BT[n][a][c]=f-81<<24>>24}else for(;f=o.ZA,0!==f;){if(1===f){o.ZA;break}f<=49&&o.ZA}}};Gp=(t,i,s,e,r,o)=>{const l=new n.A(new Uint8Array(e));let a=-1;for(;;){const e=l.nO;if(0===e)return;a+=e;let n=0;for(;;){const e=l.nO;if(0===e)break;n+=e-1;const c=63&n,f=n>>6&63,u=n>>12,d=l.ZA,w=d>>2,A=3&d,y=f+r,p=c+o;if(y>0&&p>0&&y=0&&(e=s[h]),this.RA(u,y,p,t,i,e,a,w,A)}}}};RA=(t,i,s,h,e,n,r,o,d)=>{if(y.st){if(16&this.Yn[t][i][s])return;if(this.$T(t,i,s)!==y.Dp)return}const w=this.Wn[t][i][s],A=this.Wn[t][i+1][s],p=this.Wn[t][i+1][s+1],m=this.Wn[t][i][s+1],I=w+A+p+m>>2,_=l.A.get(r);let E=i+(s<<7)+(r<<14)+1073741824|0;_.active||(E+=-2147483648),E|=0;const g=(d<<6)+o<<24>>24;if(o===f.A.lA.id)(!y.st||_.active||_.Fg)&&(h?.FT(_.la(f.A.lA.id,d,w,A,p,m,-1),t,i,s,I,E,g),_.NA&&_.active&&n?.aT(i,s),-1!==_.al&&e.n_(new a.A(r,t,3,i,s,c.A.Ro[_.al],!0)));else if(o===f.A.rA.id||o===f.A.oA.id){const l=_.la(f.A.rA.id,d,w,A,p,m,-1);if(l){let e,n,r=0;if(o===f.A.oA.id&&(r+=256),d===u.A.vd||d===u.A.Rd?(e=_.length,n=_.width):(e=_.width,n=_.length),h?.RA(t,i,s,I,l,null,E,g,e,n,r)&&_.Sg)for(let h=0;h<=e;h++)for(let e=0;e<=n;e++){let n=l.rO/4|0;n>30&&(n=30),n>this.YT[t][i+h][s+e]&&(this.YT[t][i+h][s+e]=n<<24>>24)}}_.NA&&n?.RA(i,s,_.width,_.length,d,_.PA),-1!==_.al&&e.n_(new a.A(r,t,2,i,s,c.A.Ro[_.al],!0))}else if(o>=f.A.AT.id)h?.RA(t,i,s,I,_.la(o,d,w,A,p,m,-1),null,E,g,1,1,0),o>=f.A.AT.id&&o<=f.A._T.id&&o!==f.A.yT.id&&t>0&&(this.qT[t][i][s]|=2340),_.NA&&n?.RA(i,s,_.width,_.length,d,_.PA),-1!==_.al&&e.n_(new a.A(r,t,2,i,s,c.A.Ro[_.al],!0));else if(o===f.A.Td.id)h?.cT(t,i,s,I,y.OT[d],0,_.la(f.A.Td.id,d,w,A,p,m,-1),null,E,g),d===u.A.bd?(_.Sg&&(this.YT[t][i][s]=50,this.YT[t][i][s+1]=50),_.rg&&(this.qT[t][i][s]|=585)):d===u.A.vd?(_.Sg&&(this.YT[t][i][s+1]=50,this.YT[t][i+1][s+1]=50),_.rg&&(this.qT[t][i][s+1]|=1170)):d===u.A.Ld?(_.Sg&&(this.YT[t][i+1][s]=50,this.YT[t][i+1][s+1]=50),_.rg&&(this.qT[t][i+1][s]|=585)):d===u.A.Rd&&(_.Sg&&(this.YT[t][i][s]=50,this.YT[t][i+1][s]=50),_.rg&&(this.qT[t][i][s]|=1170)),_.NA&&n?.cT(i,s,o,d,_.PA),-1!==_.al&&e.n_(new a.A(r,t,0,i,s,c.A.Ro[_.al],!0)),16!==_.bg&&h?.oO(t,i,s,_.bg);else if(o===f.A.fT.id)h?.cT(t,i,s,I,y.bT[d],0,_.la(f.A.fT.id,d,w,A,p,m,-1),null,E,g),_.Sg&&(d===u.A.bd?this.YT[t][i][s+1]=50:d===u.A.vd?this.YT[t][i+1][s+1]=50:d===u.A.Ld?this.YT[t][i+1][s]=50:d===u.A.Rd&&(this.YT[t][i][s]=50)),_.NA&&n?.cT(i,s,o,d,_.PA),-1!==_.al&&e.n_(new a.A(r,t,0,i,s,c.A.Ro[_.al],!0));else if(o===f.A.Od.id){const l=d+1&3;h?.cT(t,i,s,I,y.OT[d],y.OT[l],_.la(f.A.Od.id,d+4,w,A,p,m,-1),_.la(f.A.Od.id,l,w,A,p,m,-1),E,g),_.rg&&(d===u.A.bd?(this.qT[t][i][s]|=265,this.qT[t][i][s+1]|=1170):d===u.A.vd?(this.qT[t][i][s+1]|=1170,this.qT[t][i+1][s]|=585):d===u.A.Ld?(this.qT[t][i+1][s]|=585,this.qT[t][i][s]|=1170):d===u.A.Rd&&(this.qT[t][i][s]|=1170,this.qT[t][i][s]|=585)),_.NA&&n?.cT(i,s,o,d,_.PA),-1!==_.al&&e.n_(new a.A(r,t,0,i,s,c.A.Ro[_.al],!0)),16!==_.bg&&h?.oO(t,i,s,_.bg)}else if(o===f.A.Sd.id)h?.cT(t,i,s,I,y.bT[d],0,_.la(f.A.Sd.id,d,w,A,p,m,-1),null,E,g),_.Sg&&(d===u.A.bd?this.YT[t][i][s+1]=50:d===u.A.vd?this.YT[t][i+1][s+1]=50:d===u.A.Ld?this.YT[t][i+1][s]=50:d===u.A.Rd&&(this.YT[t][i][s]=50)),_.NA&&n?.cT(i,s,o,d,_.PA),-1!==_.al&&e.n_(new a.A(r,t,0,i,s,c.A.Ro[_.al],!0));else if(o===f.A.kd.id)h?.RA(t,i,s,I,_.la(o,d,w,A,p,m,-1),null,E,g,1,1,0),_.NA&&n?.RA(i,s,_.width,_.length,d,_.PA),-1!==_.al&&e.n_(new a.A(r,t,2,i,s,c.A.Ro[_.al],!0));else if(o===f.A.VI.id)h?.UT(t,i,s,I,0,0,E,_.la(f.A.VI.id,u.A.bd,w,A,p,m,-1),g,512*d,y.OT[d]),-1!==_.al&&e.n_(new a.A(r,t,1,i,s,c.A.Ro[_.al],!0));else if(o===f.A.gm.id){let n=16;if(h){const e=h.Ed(t,i,s);e>0&&(n=l.A.get(e>>14&32767).bg)}h?.UT(t,i,s,I,y.vT[d]*n,y.LT[d]*n,E,_.la(f.A.VI.id,u.A.bd,w,A,p,m,-1),g,512*d,y.OT[d]),-1!==_.al&&e.n_(new a.A(r,t,1,i,s,c.A.Ro[_.al],!0))}else o===f.A.uT.id?(h?.UT(t,i,s,I,0,0,E,_.la(f.A.VI.id,u.A.bd,w,A,p,m,-1),g,d,256),-1!==_.al&&e.n_(new a.A(r,t,1,i,s,c.A.Ro[_.al],!0))):o===f.A.dT.id?(h?.UT(t,i,s,I,0,0,E,_.la(f.A.VI.id,u.A.bd,w,A,p,m,-1),g,d,512),-1!==_.al&&e.n_(new a.A(r,t,1,i,s,c.A.Ro[_.al],!0))):o===f.A.wT.id&&(h?.UT(t,i,s,I,0,0,E,_.la(f.A.VI.id,u.A.bd,w,A,p,m,-1),g,d,768),-1!==_.al&&e.n_(new a.A(r,t,1,i,s,c.A.Ro[_.al],!0)))};$T=(t,i,s)=>8&this.Yn[t][i][s]?0:t<=0||!(2&this.Yn[1][i][s])?t:t-1}},3045:(t,i,s)=>{s.d(i,{A:()=>I});var h=s(4583),e=s(1161),n=s(3795),r=s(8256),o=s(670),l=s(9222),a=s(6855),c=s(7441),f=s(6666),u=s(5748),d=s(3479),w=s(8950),A=s(2771),y=s(5518),p=s(6169),m=s(3867);class I{static lO=new m.aO(8,32,51,51,!1);static cO=new m.ds(100,null);static Xu=new Int32Array(o.A.xn);static fO=new m.uO(o.A.xn,500,null);static dO=new m.ds(500,null);static wO=new f.A;static Vf=0;static AO=0;static yO=0;static pO=0;static mO=0;static IO=0;static _O=0;static EO=0;static gO=0;static CO=0;static TO=0;static OO=0;static bO=0;static vO=0;static LO=0;static RO=0;static SO=0;static MO=0;static kO=0;static xO=0;static zu=0;static DO=0;static NO=!1;static PO=null;static FO=Uint8Array.of(19,55,38,155,255,110,137,205,76);static UO=Uint8Array.of(160,192,80,96,0,144,80,48,160);static BO=Uint8Array.of(76,8,137,4,0,1,38,2,19);static GO=Int8Array.of(0,0,2,0,0,2,1,1,0);static HO=Int8Array.of(2,0,0,2,0,0,0,4,4);static WO=Int8Array.of(0,4,4,8,0,0,8,0,0);static YO=Int8Array.of(1,1,0,0,0,8,0,0,8);static VO=Int8Array.of(53,-53,-53,53);static KO=Int8Array.of(-53,-53,53,53);static XO=Int8Array.of(-45,45,45,-45);static zO=Int8Array.of(45,45,-45,-45);static jO=[new Int8Array(16),Int8Array.of(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,0,0,0,1,1,0,0,1,1,1,0,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1),Int8Array.of(0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0),Int8Array.of(0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0),Int8Array.of(1,1,1,1,1,1,1,1,0,1,1,1,0,0,1,1),Int8Array.of(1,1,1,1,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,0,0,0,0,1,1,0,1,1,1,0,1,1,1),Int8Array.of(0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1)];static ZO=[Int8Array.of(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),Int8Array.of(12,8,4,0,13,9,5,1,14,10,6,2,15,11,7,3),Int8Array.of(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0),Int8Array.of(3,7,11,15,2,6,10,14,1,5,9,13,0,4,8,12)];static qO=Int32Array.of(41,39248,41,4643,41,41,41,41,41,41,41,41,41,41,41,43086,41,41,41,41,41,41,41,8602,41,28992,41,41,41,41,41,5056,41,41,41,41,41,41,41,41,41,41,41,41,41,41,3131,41,41,41);static ju=0;static xl=0;static Dl=0;static ff=-1;static uf=-1;static st=!0;static init=(t,i,s,e,n)=>{this.AO=0,this.yO=0,this.pO=t,this.mO=i,this.IO=t/2|0,this._O=i/2|0;const r=new m.aO(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let i=0;i<2048;i+=64){this.EO=h.A.sin[t],this.gO=h.A.cos[t],this.CO=h.A.sin[i],this.TO=h.A.cos[i];const o=(t-128)/32|0,l=i/64|0;for(let t=-26;t<=26;t++)for(let i=-26;i<=26;i++){const h=128*t,a=128*i;let c=!1;for(let t=-s;t<=e;t+=128)if(this.$O(h,a,n[o]+t)){c=!0;break}r[o][l][t+25+1][i+25+1]=c}}for(let t=0;t<8;t++)for(let i=0;i<32;i++)for(let s=-25;s<25;s++)for(let h=-25;h<25;h++){let e=!1;t:for(let n=-1;n<=1;n++)for(let o=-1;o<=1;o++){if(r[t][i][s+n+25+1][h+o+25+1]){e=!0;break t}if(r[t][(i+1)%31][s+n+25+1][h+o+25+1]){e=!0;break t}if(r[t+1][i][s+n+25+1][h+o+25+1]){e=!0;break t}if(r[t+1][(i+1)%31][s+n+25+1][h+o+25+1]){e=!0;break t}}this.lO[t][i][s+25][h+25]=e}};static bo=()=>{this.cO=null,this.Xu=null,this.fO=null,this.wO=null,this.lO=null,this.dO=null,this.PO=null,console.log('World3D unloaded!')};static eO=(t,i,s,h,e,n,o,l)=>{I.fO[t][I.Xu[t]++]=new r.A(s/128|0,n/128|0,e/128|0,l/128|0,i,s,n,e,l,h,o)};static $O=(t,i,s)=>{const h=i*this.CO+t*this.TO>>16,e=i*this.TO-t*this.CO>>16,n=s*this.EO+e*this.gO>>16,r=s*this.gO-e*this.EO>>16;if(n<50||n>3500)return!1;const o=this.IO+((h<<9)/n|0),l=this._O+((r<<9)/n|0);return o>=this.AO&&o<=this.pO&&l>=this.yO&&l<=this.mO};JO;xI;DI;QO;tb;Er;ib;sb;hb;eb=0;nb=0;rb=0;constructor(t,i,s,h){this.JO=s,this.xI=h,this.DI=i,this.tb=new m.Cr(s,h,i,null),this.ib=new m.$a(s,h+1,i+1),this.QO=t,this.Er=new m.ds(5e3,null),this.sb=new Int32Array(1e4),this.hb=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this.nb=t;for(let i=0;i{const s=this.tb[0][t][i];for(let s=0;s<3;s++){this.tb[s][t][i]=this.tb[s+1][t][i];const h=this.tb[s][t][i];h&&h.level--}this.tb[0][t][i]||(this.tb[0][t][i]=new n.A(0,t,i));const h=this.tb[0][t][i];h&&(h.ob=s),this.tb[3][t][i]=null};iO=(t,i,s,h)=>{const e=this.tb[t][i][s];e&&(e.lb=h)};QT=(t,i,s,h,e,r,o,l,a,c,f,u,w,p,m,I,_,E,g,C)=>{if(h===y.A.JT){for(let h=t;h>=0;h--)this.tb[h][i][s]||(this.tb[h][i][s]=new n.A(h,i,s));const h=this.tb[t][i][s];h&&(h.ab=new d.A(f,u,w,p,-1,g,!1))}else if(h===y.A.cb){for(let h=t;h>=0;h--)this.tb[h][i][s]||(this.tb[h][i][s]=new n.A(h,i,s));const h=this.tb[t][i][s];h&&(h.ab=new d.A(m,I,_,E,r,C,o===l&&o===a&&o===c))}else{for(let h=t;h>=0;h--)this.tb[h][i][s]||(this.tb[h][i][s]=new n.A(h,i,s));const d=this.tb[t][i][s];d&&(d.fb=new A.A(i,h,I,l,w,e,f,c,C,m,r,E,g,a,_,p,o,s,u))}};FT=(t,i,s,h,e,r,o)=>{this.tb[i][s][h]||(this.tb[i][s][h]=new n.A(i,s,h));const a=this.tb[i][s][h];a&&(a.ub=new l.A(e,128*s+64,128*h+64,t,r,o))};BA=(t,i,s)=>{const h=this.tb[t][i][s];h&&(h.ub=null)};LA=(t,i,s,h,e,r,o,l)=>{let a=0;const c=this.tb[h][t][i];if(c)for(let t=0;ta&&(a=s)}else this.tb[h][t][i]=new n.A(h,t,i);const f=this.tb[h][t][i];f&&(f.yb=new u.A(s,128*t+64,128*i+64,r,o,l,e,a))};TA=(t,i,s)=>{const h=this.tb[t][i][s];h&&(h.yb=null)};cT=(t,i,s,h,e,r,o,l,c,f)=>{if(!o&&!l)return;for(let h=t;h>=0;h--)this.tb[h][i][s]||(this.tb[h][i][s]=new n.A(h,i,s));const u=this.tb[t][i][s];u&&(u.pb=new a.A(h,128*i+64,128*s+64,e,r,o,l,c,f))};DA=(t,i,s,h)=>{const e=this.tb[t][i][s];1===h&&e&&(e.pb=null)};UT=(t,i,s,h,e,r,o,l,a,f,u)=>{if(!l)return;for(let h=t;h>=0;h--)this.tb[h][i][s]||(this.tb[h][i][s]=new n.A(h,i,s));const d=this.tb[t][i][s];d&&(d.mb=new c.A(h,128*i+e+64,128*s+r+64,u,f,l,o,a))};FA=(t,i,s)=>{const h=this.tb[t][i][s];h&&(h.mb=null)};oO=(t,i,s,h)=>{const e=this.tb[t][i][s];if(!e)return;const n=e.mb;if(!n)return;const r=128*i+64,o=128*s+64;n.x=r+((n.x-r)*h/16|0),n.z=o+((n.z-o)*h/16|0)};YI=(t,i,s,h)=>{if(!h)return;const e=this.tb[t][i][s];if(!e)return;const n=e.mb;n&&(n.model=h)};zI=(t,i,s,h)=>{if(!h)return;const e=this.tb[t][i][s];if(!e)return;const n=e.ub;n&&(n.model=h)};XI=(t,i,s,h)=>{if(!h)return;const e=this.tb[t][i][s];if(!e)return;const n=e.pb;n&&(n.Ib=h)};KI=(t,i,s,h,e)=>{if(!h)return;const n=this.tb[s][t][i];if(!n)return;const r=n.pb;r&&(r.Ib=h,r._b=e)};RA=(t,i,s,h,e,n,r,o,l,a,c)=>{if(!e&&!n)return!0;const f=128*i+64*l,u=128*s+64*a;return this.Eb(f,u,h,t,i,s,l,a,e,n,r,o,c,!1)};vI=(t,i,s,h,e,n,r,o,l,a)=>{if(!e&&!n)return!0;let c=i-l,f=h-l,u=i+l,d=h+l;return a&&(o>640&&o<1408&&(d+=128),o>1152&&o<1920&&(u+=128),(o>1664||o<384)&&(f-=128),o>128&&o<896&&(c-=128)),c=c/128|0,f=f/128|0,u=u/128|0,d=d/128|0,this.Eb(i,h,s,t,c,f,u+1-c,d-f+1,e,n,r,0,o,!0)};SI=(t,i,s,h,e,n,r,o,l,a,c,f)=>!l&&!a||this.Eb(i,h,s,t,e,n,r+1-e,o-n+1,l,a,c,0,f,!0);UA=(t,i,s)=>{const h=this.tb[t][i][s];if(h)for(let t=0;t>29&3)&&e.Cb===i&&e.Tb===s)return void this.Ob(e)}};WI=(t,i,s,h)=>{if(!h)return;const e=this.tb[t][i][s];if(e)for(let t=0;t>29&3))return void(i.model=h)}};zf=()=>{for(let t=0;t{const h=this.tb[t][i][s];return h&&h.pb?h.pb.gb:0};kA=(t,i,s)=>{const h=this.tb[t][s][i];return h&&h.mb?h.mb.gb:0};Md=(t,i,s)=>{const h=this.tb[t][i][s];if(!h)return 0;for(let t=0;t>29&3)&&e.Cb===i&&e.Tb===s)return e.gb}return 0};Ad=(t,i,s)=>{const h=this.tb[t][i][s];return h&&h.ub?h.ub.gb:0};gd=(t,i,s,h)=>{const e=this.tb[t][i][s];if(e){if(e.pb&&e.pb.gb===h)return 255&e.pb.info;if(e.mb&&e.mb.gb===h)return 255&e.mb.info;if(e.ub&&e.ub.gb===h)return 255&e.ub.info;for(let t=0;t{const n=i*(0|Math.sqrt(s*s+h*h+e*e))>>8;for(let i=0;i{if(i0){const e=this.tb[t][i+1][s-1];e&&e.ub&&e.ub.model&&e.ub.model.bb&&this.Lb(h,e.ub.model,128,0,-128,!0)}};vb=(t,i,s,h,e,n)=>{let r=!0,o=i;const l=i+h,a=s-1,c=s+e;for(let f=t;f<=t+1;f++)if(f!==this.JO){for(let u=o;u<=l;u++)if(!(u<0||u>=this.xI))for(let o=a;o<=c;o++){if(o<0||o>=this.DI||r&&u=s||u===i))continue;const a=this.tb[f][u][o];if(!a)continue;const d=128*(u-i)+64*(1-h),w=128*(o-s)+64*(1-e),A=((this.QO[f][u][o]+this.QO[f][u+1][o]+this.QO[f][u][o+1]+this.QO[f][u+1][o+1])/4|0)-((this.QO[t][i][s]+this.QO[t][i+1][s]+this.QO[t][i][s+1]+this.QO[t][i+1][s+1])/4|0),y=a.pb;y&&y.Ib&&y.Ib.bb&&this.Lb(n,y.Ib,d,A,w,r),y&&y._b&&y._b.bb&&this.Lb(n,y._b,d,A,w,r);for(let t=0;t{this.rb++;let r=0;const o=i.Gg,l=i.Bg;if(t.bb&&t.xb)for(let n=0;ni.Db)continue;const u=t.Gg[n]-s;if(ui.Pb)continue;const d=t.Hg[n]-e;if(di.Ub)continue;if(i.bb&&i.xb)for(let t=0;t{const r=this.tb[t][i][s];if(!r)return;const o=r.ab;if(o){const t=o.color;if(0!==t)for(let i=0;i<4;i++)h[e]=t,h[e+1]=t,h[e+2]=t,h[e+3]=t,e+=n;return}const l=r.fb;if(!l)return;const a=l.shape,c=l.angle,f=l.Vb,u=l.Kb,d=I.jO[a],w=I.ZO[c];let A=0;if(0===f)for(let t=0;t<4;t++)0!==d[w[A++]]&&(h[e]=u),0!==d[w[A++]]&&(h[e+1]=u),0!==d[w[A++]]&&(h[e+2]=u),0!==d[w[A++]]&&(h[e+3]=u),e+=n;else for(let t=0;t<4;t++)h[e]=0===d[w[A++]]?f:u,h[e+1]=0===d[w[A++]]?f:u,h[e+2]=0===d[w[A++]]?f:u,h[e+3]=0===d[w[A++]]?f:u,e+=n};click=(t,i)=>{I.NO=!0,I.xl=t,I.Dl=i,I.ff=-1,I.uf=-1};draw=(t,i,s,e,n,r,o)=>{t<0?t=0:t>=128*this.xI&&(t=128*this.xI-1),s<0?s=0:s>=128*this.DI&&(s=128*this.DI-1),I.Vf++,I.EO=h.A.sin[r],I.gO=h.A.cos[r],I.CO=h.A.sin[n],I.TO=h.A.cos[n],I.PO=I.lO[(r-128)/32|0][n/64|0],I.OO=t,I.bO=i,I.vO=s,I.LO=t/128|0,I.RO=s/128|0,I.zu=e,I.SO=I.LO-25,I.SO<0&&(I.SO=0),I.kO=I.RO-25,I.kO<0&&(I.kO=0),I.MO=I.LO+25,I.MO>this.xI&&(I.MO=this.xI),I.xO=I.RO+25,I.xO>this.DI&&(I.xO=this.DI),this.Xb(),I.DO=0;for(let t=this.nb;t=2e3)?(r.visible=!0,r.update=!0,r.zb=r.wb>0,I.DO++):(r.visible=!1,r.update=!1,r.jb=0))}}for(let t=this.nb;t=I.MO))for(let t=-25;t<=0;t++){const e=I.RO+t,n=I.RO-t;let r;if(s>=I.SO&&(e>=I.kO&&(r=i[s][e],r&&r.visible&&this.Zb(r,!0,o)),n=I.kO&&(r=i[h][e],r&&r.visible&&this.Zb(r,!0,o)),n=I.MO))for(let t=-25;t<=0;t++){const e=I.RO+t,n=I.RO-t;let r;if(s>=I.SO&&(e>=I.kO&&(r=i[s][e],r&&r.visible&&this.Zb(r,!1,o)),n=I.kO&&(r=i[h][e],r&&r.visible&&this.Zb(r,!1,o)),n{if(!c&&!f)return!1;for(let t=r;t=this.xI||i>=this.DI)return!1;const s=this.tb[h][t][i];if(s&&s.wb>=5)return!1}const y=new e.A(h,s,t,i,c,f,w,r,r+l-1,o,o+a-1,u,d);for(let t=r;tr&&(s|=1),to&&(s+=8),i=0;s--)this.tb[s][t][i]||(this.tb[s][t][i]=new n.A(s,t,i));const e=this.tb[h][t][i];e&&(e.Ab[e.wb]=y,e.qb[e.wb]=s,e.$b|=s,e.wb++)}return A&&(this.Er[this.eb++]=y),!0};Ob=t=>{for(let i=t.Cb;i<=t.Sb;i++)for(let s=t.Tb;s<=t.Mb;s++){const h=this.tb[t.level][i][s];if(h){for(let i=0;i{const t=I.Xu[I.zu],i=I.fO[I.zu];I.ju=0;for(let s=0;s=0&&h<=50){e=t.kI+25-I.RO,e<0&&(e=0),n=t.DI+25-I.RO,n>50&&(n=50);let i=!1;for(;e<=n;)if(I.PO&&I.PO[h][e++]){i=!0;break}if(i){if(r=I.OO-t.Nb,r>32)t.mode=1;else{if(r>=-32)continue;t.mode=2,r=-r}t.Jb=(t.Fb-I.vO<<8)/r|0,t.Qb=(t.Ub-I.vO<<8)/r|0,t.tv=(t.Db-I.bO<<8)/r|0,t.iv=(t.Zg-I.bO<<8)/r|0,I.dO[I.ju++]=t}}}else if(2===t.type){if(h=t.kI+25-I.RO,h>=0&&h<=50){e=t.MI+25-I.LO,e<0&&(e=0),n=t.xI+25-I.LO,n>50&&(n=50);let i=!1;for(;e<=n;)if(I.PO&&I.PO[e++][h]){i=!0;break}if(i){if(r=I.vO-t.Fb,r>32)t.mode=3;else{if(r>=-32)continue;t.mode=4,r=-r}t.sv=(t.Nb-I.OO<<8)/r|0,t.hv=(t.Pb-I.OO<<8)/r|0,t.tv=(t.Db-I.bO<<8)/r|0,t.iv=(t.Zg-I.bO<<8)/r|0,I.dO[I.ju++]=t}}}else if(4===t.type&&(h=t.Db-I.bO,h>128&&(e=t.kI+25-I.RO,e<0&&(e=0),n=t.DI+25-I.RO,n>50&&(n=50),e<=n))){let i=t.MI+25-I.LO;i<0&&(i=0),r=t.xI+25-I.LO,r>50&&(r=50);let s=!1;t:for(let t=i;t<=r;t++)for(let i=e;i<=n;i++)if(I.PO&&I.PO[t][i]){s=!0;break t}s&&(t.mode=5,t.sv=(t.Nb-I.OO<<8)/h|0,t.hv=(t.Pb-I.OO<<8)/h|0,t.Jb=(t.Fb-I.vO<<8)/h|0,t.Qb=(t.Ub-I.vO<<8)/h|0,I.dO[I.ju++]=t)}}};Zb=(t,i,s)=>{for(I.wO.n_(t);;){let t;do{if(t=I.wO.ev(),!t)return}while(!t.update);const h=t.x,e=t.z,n=t.level,r=t.nv,o=this.tb[n];if(t.visible){if(i){if(n>0){const t=this.tb[n-1][h][e];if(t&&t.update)continue}if(h<=I.LO&&h>I.SO){const i=o[h-1][e];if(i&&i.update&&(i.visible||!(1&t.$b)))continue}if(h>=I.LO&&hI.kO){const i=o[h][e-1];if(i&&i.update&&(i.visible||!(8&t.$b)))continue}if(e>=I.RO&&ee&&(a+=6),c=I.FO[a],t.cv=I.BO[a]),f&&(f.fv&I.UO[a]?16===f.fv?(t.jb=3,t.uv=I.GO[a],t.dv=3-t.uv):32===f.fv?(t.jb=6,t.uv=I.HO[a],t.dv=6-t.uv):64===f.fv?(t.jb=12,t.uv=I.WO[a],t.dv=12-t.uv):(t.jb=9,t.uv=I.YO[a],t.dv=9-t.uv):t.jb=0,f.fv&c&&!this.wv(r,h,e,f.fv)&&f.Ib?.draw(0,I.EO,I.gO,I.CO,I.TO,f.x-I.OO,f.y-I.bO,f.z-I.vO,f.gb),f.Av&c&&!this.wv(r,h,e,f.Av)&&f._b?.draw(0,I.EO,I.gO,I.CO,I.TO,f.x-I.OO,f.y-I.bO,f.z-I.vO,f.gb)),u&&!this.visible(r,h,e,u.model.Zg))if(u.type&c)u.model.draw(u.angle,I.EO,I.gO,I.CO,I.TO,u.x-I.OO,u.y-I.bO,u.z-I.vO,u.gb);else if(768&u.type){const t=u.x-I.OO,i=u.y-I.bO,s=u.z-I.vO,h=u.angle;let e,n;if(e=h===p.A.vd||h===p.A.Ld?-t:t,n=h===p.A.Ld||h===p.A.Rd?-s:s,256&u.type&&ne){const e=t+I.XO[h],n=s+I.zO[h];u.model.draw(512*h+1280&2047,I.EO,I.gO,I.CO,I.TO,e,i,n,u.gb)}}if(l){const i=t.ub;i&&i.model?.draw(0,I.EO,I.gO,I.CO,I.TO,i.x-I.OO,i.y-I.bO,i.z-I.vO,i.gb);const s=t.yb;s&&0===s.offset&&(s.yv&&s.yv.draw(0,I.EO,I.gO,I.CO,I.TO,s.x-I.OO,s.y-I.bO,s.z-I.vO,s.gb),s.pv&&s.pv.draw(0,I.EO,I.gO,I.CO,I.TO,s.x-I.OO,s.y-I.bO,s.z-I.vO,s.gb),s.mv&&s.mv.draw(0,I.EO,I.gO,I.CO,I.TO,s.x-I.OO,s.y-I.bO,s.z-I.vO,s.gb))}const d=t.$b;if(0!==d){if(hI.LO&&1&d){const t=o[h-1][e];t&&t.update&&I.wO.n_(t)}if(e>I.RO&&8&d){const t=o[h][e-1];t&&t.update&&I.wO.n_(t)}}}if(0!==t.jb){let i=!0;for(let s=0;si.Cb&&(n+=1),si.Tb&&(n+=8),hh&&(h=e);const r=I.RO-i.Tb,l=i.Mb-I.RO;i.Iv=l>r?h+l:h+r}for(;;){let t=-50,i=-1;for(let s=0;st&&(t=h.Iv,i=s))}if(-1===i)break;const l=I.cO[i];if(l){l.Vf=I.Vf;let t=l.model;t||(t=l.av?.draw(s)??null),t&&!this._v(r,l.Cb,l.Sb,l.Tb,l.Mb,t.Zg)&&t.draw(l.LI,I.EO,I.gO,I.CO,I.TO,l.x-I.OO,l.y-I.bO,l.z-I.vO,l.gb);for(let t=l.Cb;t<=l.Sb;t++)for(let i=l.Tb;i<=l.Mb;i++){const s=o[t][i];s&&(0!==s.jb?I.wO.n_(s):t===h&&i===e||!s.update||I.wO.n_(s))}}}if(t.zb)continue}if(!t.update||0!==t.jb)continue;if(h<=I.LO&&h>I.SO){const t=o[h-1][e];if(t&&t.update)continue}if(h>=I.LO&&hI.kO){const t=o[h][e-1];if(t&&t.update)continue}if(e>=I.RO&&e=n){const n=t+I.VO[e],r=h+I.KO[e];i.model.draw(512*e+256,I.EO,I.gO,I.CO,I.TO,n,s,r,i.gb)}if(512&i.type&&r<=n){const n=t+I.XO[e],r=h+I.zO[e];i.model.draw(512*e+1280&2047,I.EO,I.gO,I.CO,I.TO,n,s,r,i.gb)}}const s=t.pb;s&&(s.Av&t.cv&&!this.wv(r,h,e,s.Av)&&s._b?.draw(0,I.EO,I.gO,I.CO,I.TO,s.x-I.OO,s.y-I.bO,s.z-I.vO,s.gb),s.fv&t.cv&&!this.wv(r,h,e,s.fv)&&s.Ib?.draw(0,I.EO,I.gO,I.CO,I.TO,s.x-I.OO,s.y-I.bO,s.z-I.vO,s.gb))}if(nI.LO){const t=o[h-1][e];t&&t.update&&I.wO.n_(t)}if(e>I.RO){const t=o[h][e-1];t&&t.update&&I.wO.n_(t)}}};ov=(t,i,s,e,n,r,o,l)=>{let a,c,f,u,d=a=(s<<7)-I.OO,A=c=(e<<7)-I.vO,y=f=d+128,p=u=A+128,m=this.QO[i][s][e]-I.bO,_=this.QO[i][s+1][e]-I.bO,E=this.QO[i][s+1][e+1]-I.bO,g=this.QO[i][s][e+1]-I.bO,C=A*o+d*l>>16;if(A=A*l-d*o>>16,d=C,C=m*r-A*n>>16,A=m*n+A*r>>16,m=C,A<50)return;if(C=c*o+y*l>>16,c=c*l-y*o>>16,y=C,C=_*r-c*n>>16,c=_*n+c*r>>16,_=C,c<50)return;if(C=p*o+f*l>>16,p=p*l-f*o>>16,f=C,C=E*r-p*n>>16,p=E*n+p*r>>16,E=C,p<50)return;if(C=u*o+a*l>>16,u=u*l-a*o>>16,a=C,C=g*r-u*n>>16,u=g*n+u*r>>16,g=C,u<50)return;const T=h.A.na+((d<<9)/A|0),O=h.A.ra+((m<<9)/A|0),b=h.A.na+((y<<9)/c|0),v=h.A.ra+((_<<9)/c|0),L=h.A.na+((f<<9)/p|0),R=h.A.ra+((E<<9)/p|0),S=h.A.na+((a<<9)/u|0),M=h.A.ra+((g<<9)/u|0);if(h.A.alpha=0,(L-S)*(v-M)-(R-M)*(b-S)>0)if(h.A.Ev=L<0||S<0||b<0||L>w.A.gv||S>w.A.gv||b>w.A.gv,I.NO&&this.Cv(I.xl,I.Dl,R,M,v,L,S,b)&&(I.ff=s,I.uf=e),-1===t.Tv)12345678!==t.Ov&&h.A.bv(L,S,b,R,M,v,t.Ov,t.vv,t.Lv);else if(I.st){const i=I.qO[t.Tv];h.A.bv(L,S,b,R,M,v,this.Rv(i,t.Ov),this.Rv(i,t.vv),this.Rv(i,t.Lv))}else t.flat?h.A.Sv(L,S,b,R,M,v,t.Ov,t.vv,t.Lv,d,m,A,y,a,_,g,c,u,t.Tv):h.A.Sv(L,S,b,R,M,v,t.Ov,t.vv,t.Lv,f,E,p,a,y,g,_,u,c,t.Tv);if(!((T-b)*(M-v)-(O-v)*(S-b)<=0))if(h.A.Ev=T<0||b<0||S<0||T>w.A.gv||b>w.A.gv||S>w.A.gv,I.NO&&this.Cv(I.xl,I.Dl,O,v,M,T,b,S)&&(I.ff=s,I.uf=e),-1!==t.Tv){if(!I.st)return void h.A.Sv(T,b,S,O,v,M,t.Mv,t.Lv,t.vv,d,m,A,y,a,_,g,c,u,t.Tv);const i=I.qO[t.Tv];h.A.bv(T,b,S,O,v,M,this.Rv(i,t.Mv),this.Rv(i,t.Lv),this.Rv(i,t.vv))}else 12345678!==t.Mv&&h.A.bv(T,b,S,O,v,M,t.Mv,t.Lv,t.vv)};lv=(t,i,s,e,n,r,o)=>{let l=s.Gg.length;for(let t=0;t>16;if(a=a*o-i*r>>16,i=c,c=l*n-a*e>>16,a=l*e+a*n>>16,l=c,a<50)return;s.kv&&(A.A.xv[t]=i,A.A.Dv[t]=l,A.A.Nv[t]=a),A.A.Pv[t]=h.A.na+((i<<9)/a|0),A.A.Fv[t]=h.A.ra+((l<<9)/a|0)}h.A.alpha=0,l=s.Uv.length;for(let e=0;e0)if(h.A.Ev=l<0||a<0||c<0||l>w.A.gv||a>w.A.gv||c>w.A.gv,I.NO&&this.Cv(I.xl,I.Dl,f,u,d,l,a,c)&&(I.ff=t,I.uf=i),s.kv&&-1!==s.kv[e])if(I.st){const t=I.qO[s.kv[e]];h.A.bv(l,a,c,f,u,d,this.Rv(t,s.Hv[e]),this.Rv(t,s.Wv[e]),this.Rv(t,s.Yv[e]))}else s.flat?h.A.Sv(l,a,c,f,u,d,s.Hv[e],s.Wv[e],s.Yv[e],A.A.xv[0],A.A.Dv[0],A.A.Nv[0],A.A.xv[1],A.A.xv[3],A.A.Dv[1],A.A.Dv[3],A.A.Nv[1],A.A.Nv[3],s.kv[e]):h.A.Sv(l,a,c,f,u,d,s.Hv[e],s.Wv[e],s.Yv[e],A.A.xv[n],A.A.Dv[n],A.A.Nv[n],A.A.xv[r],A.A.xv[o],A.A.Dv[r],A.A.Dv[o],A.A.Nv[r],A.A.Nv[o],s.kv[e]);else 12345678!==s.Hv[e]&&h.A.bv(l,a,c,f,u,d,s.Hv[e],s.Wv[e],s.Yv[e])}};rv=(t,i,s)=>{const h=this.ib[t][i][s];if(h===-I.Vf)return!1;if(h===I.Vf)return!0;{const h=i<<7,e=s<<7;return this.Vv(h+1,this.QO[t][i][s],e+1)&&this.Vv(h+128-1,this.QO[t][i+1][s],e+1)&&this.Vv(h+128-1,this.QO[t][i+1][s+1],e+128-1)&&this.Vv(h+1,this.QO[t][i][s+1],e+128-1)?(this.ib[t][i][s]=I.Vf,!0):(this.ib[t][i][s]=-I.Vf,!1)}};wv=(t,i,s,h)=>{if(!this.rv(t,i,s))return!1;const e=i<<7,n=s<<7,r=this.QO[t][i][s]-1,o=r-120,l=r-230,a=r-238;if(h<16){if(1===h){if(e>I.OO){if(!this.Vv(e,r,n))return!1;if(!this.Vv(e,r,n+128))return!1}if(t>0){if(!this.Vv(e,o,n))return!1;if(!this.Vv(e,o,n+128))return!1}return!!this.Vv(e,l,n)&&this.Vv(e,l,n+128)}if(2===h){if(n0){if(!this.Vv(e,o,n+128))return!1;if(!this.Vv(e+128,o,n+128))return!1}return!!this.Vv(e,l,n+128)&&this.Vv(e+128,l,n+128)}if(4===h){if(e0){if(!this.Vv(e+128,o,n))return!1;if(!this.Vv(e+128,o,n+128))return!1}return!!this.Vv(e+128,l,n)&&this.Vv(e+128,l,n+128)}if(8===h){if(n>I.vO){if(!this.Vv(e,r,n))return!1;if(!this.Vv(e+128,r,n))return!1}if(t>0){if(!this.Vv(e,o,n))return!1;if(!this.Vv(e+128,o,n))return!1}return!!this.Vv(e,l,n)&&this.Vv(e+128,l,n)}}return!!this.Vv(e+64,a,n+64)&&(16===h?this.Vv(e,l,n+128):32===h?this.Vv(e+128,l,n+128):64===h?this.Vv(e+128,l,n):128===h?this.Vv(e,l,n):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,i,s,h)=>{if(this.rv(t,i,s)){const e=i<<7,n=s<<7;return this.Vv(e+1,this.QO[t][i][s]-h,n+1)&&this.Vv(e+128-1,this.QO[t][i+1][s]-h,n+1)&&this.Vv(e+128-1,this.QO[t][i+1][s+1]-h,n+128-1)&&this.Vv(e+1,this.QO[t][i][s+1]-h,n+128-1)}return!1};_v=(t,i,s,h,e,n)=>{let r,o;if(i!==s||h!==e){for(r=i;r<=s;r++)for(o=h;o<=e;o++)if(this.ib[t][r][o]===-I.Vf)return!1;o=1+(i<<7);const l=2+(h<<7),a=this.QO[t][i][h]-n;if(!this.Vv(o,a,l))return!1;const c=(s<<7)-1;if(!this.Vv(c,a,l))return!1;const f=(e<<7)-1;return!!this.Vv(o,a,f)&&this.Vv(c,a,f)}return!!this.rv(t,i,h)&&(r=i<<7,o=h<<7,this.Vv(r+1,this.QO[t][i][h]-n,o+1)&&this.Vv(r+128-1,this.QO[t][i+1][h]-n,o+1)&&this.Vv(r+128-1,this.QO[t][i+1][h+1]-n,o+128-1)&&this.Vv(r+1,this.QO[t][i][h+1]-n,o+128-1))};Vv=(t,i,s)=>{for(let h=0;h0){const t=e.Fb+(e.Jb*h>>8),n=e.Ub+(e.Qb*h>>8),r=e.Db+(e.tv*h>>8),o=e.Zg+(e.iv*h>>8);if(s>=t&&s<=n&&i>=r&&i<=o)return!0}}else if(2===e.mode){const h=t-e.Nb;if(h>0){const t=e.Fb+(e.Jb*h>>8),n=e.Ub+(e.Qb*h>>8),r=e.Db+(e.tv*h>>8),o=e.Zg+(e.iv*h>>8);if(s>=t&&s<=n&&i>=r&&i<=o)return!0}}else if(3===e.mode){const h=e.Fb-s;if(h>0){const s=e.Nb+(e.sv*h>>8),n=e.Pb+(e.hv*h>>8),r=e.Db+(e.tv*h>>8),o=e.Zg+(e.iv*h>>8);if(t>=s&&t<=n&&i>=r&&i<=o)return!0}}else if(4===e.mode){const h=s-e.Fb;if(h>0){const s=e.Nb+(e.sv*h>>8),n=e.Pb+(e.hv*h>>8),r=e.Db+(e.tv*h>>8),o=e.Zg+(e.iv*h>>8);if(t>=s&&t<=n&&i>=r&&i<=o)return!0}}else if(5===e.mode){const h=i-e.Db;if(h>0){const i=e.Nb+(e.sv*h>>8),n=e.Pb+(e.hv*h>>8),r=e.Fb+(e.Jb*h>>8),o=e.Ub+(e.Qb*h>>8);if(t>=i&&t<=n&&s>=r&&s<=o)return!0}}}return!1};Cv=(t,i,s,h,e,n,r,o)=>{if(is&&i>h&&i>e)return!1;if(tn&&t>r&&t>o)return!1;const l=(i-h)*(o-r)-(t-r)*(e-h);return((i-s)*(r-n)-(t-n)*(h-s))*l>0&&l*((i-e)*(n-o)-(t-o)*(s-e))>0};Rv=(t,i)=>((i=(127-i)*(127&t)/160|0)<2?i=2:i>126&&(i=126),(65408&t)+i)}},7121:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{}},4197:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{Vp;HI;Wp;Yp;index;GI;ul;fl;constructor(t,i,s,h,e,n,r){super(),this.Vp=i,this.HI=s,this.Wp=h,this.Yp=e,this.index=t,this.GI=n,r&&-1!==n.wl&&this.GI.delay?(this.ul=Math.random()*this.GI.dl|0,this.fl=Math.random()*this.GI.delay[this.ul]|0):(this.ul=-1,this.fl=0)}}},8412:(t,i,s)=>{s.d(i,{A:()=>o});var h=s(9418),e=s(8665),n=s(8738),r=s(1312);class o extends h.A{static Tu=2;static bu=4;static Lu=8;static Ru=16;static Fu=32;static Du=64;static Su=128;type=null;draw(t){if(!this.type)return null;if(-1===this.Nu||-1===this.$m)return this.Jg();const i=this.Jg();if(!i)return null;const s=n.A.Ro[this.Nu],h=e.A.qE(s.la(),!0,!s.Og,!1);h.translate(-this.Zm,0,0),h.Ma(),s.GI&&s.GI.frames&&h.ka(s.GI.frames[this.$m]),h.Kg=null,h.Xg=null,128===s.qg&&128===s.$g||h.scale(s.qg,s.$g,s.qg),h.xa(64+s.vg,850+s.Lg,-30,-50,-30,!0);const r=[i,h],o=e.A.Kv(r,2);return 1===this.type.size&&(o.sC=!0),o}isVisible(){return null!==this.type}Jg(){if(!this.type)return null;if(this.Ou>=0&&0===this.Xm){const t=r.A.Ro[this.Ou].frames;if(t){const i=t[this.Vm];let s=-1;if(this.CI>=0&&this.CI!==this.Sa){const t=r.A.Ro[this.CI].frames;t&&(s=t[this.QI])}return this.type.Jg(i,s,r.A.Ro[this.Ou].s_)}}let t=-1;if(this.CI>=0){const i=r.A.Ro[this.CI].frames;i&&(t=i[this.QI])}const i=this.type.Jg(t,-1,null);return i?(this.height=i.Zg,i):null}}},3606:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{index;count;constructor(t,i){super(),this.index=t,this.count=i}}},9418:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(7121),e=s(1312),n=s(3867);class r extends h.A{x=0;z=0;LI=0;RI=!1;size=1;Sa=-1;$I=-1;oI=-1;aI=-1;fI=-1;dI=-1;e_=-1;ou=null;uu=100;cu=0;fu=0;pu=0;yu=0;du=-1e3;wu=0;Au=0;vu=-1;zm=0;jm=0;CI=-1;QI=0;JI=0;Ou=-1;Vm=0;Km=0;Xm=0;Ym=0;Nu=-1;$m=0;Jm=0;qm=0;Zm=0;Qm=0;iI=0;tI=0;sI=0;mu=0;Iu=0;hI=0;Vf=0;height=0;qI=0;pathLength=0;wf=new Int32Array(10);Af=new Int32Array(10);h_=new n.ds(10,!1);ZI=0;Eu=-1;gu=-1;Mu=-1;ku=-1;move(t,i,s){if(-1!==this.Ou&&e.A.Ro[this.Ou].priority<=1&&(this.Ou=-1),!t){const t=i-this.wf[0],h=s-this.Af[0];if(t>=-8&&t<=8&&h>=-8&&h<=8){this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.wf[t]=this.wf[t-1],this.Af[t]=this.Af[t-1],this.h_[t]=this.h_[t-1];return this.wf[0]=i,this.Af[0]=s,void(this.h_[0]=!1)}}this.pathLength=0,this.ZI=0,this.wf[0]=i,this.Af[0]=s,this.x=128*this.wf[0]+64*this.size,this.z=128*this.Af[0]+64*this.size}step(t,i){let s=this.wf[0],h=this.Af[0];0===i?(s--,h++):1===i?h++:2===i?(s++,h++):3===i?s--:4===i?s++:5===i?(s--,h--):6===i?h--:7===i&&(s++,h--),-1!==this.Ou&&e.A.Ro[this.Ou].priority<=1&&(this.Ou=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.wf[t]=this.wf[t-1],this.Af[t]=this.Af[t-1],this.h_[t]=this.h_[t-1];this.wf[0]=s,this.Af[0]=h,this.h_[0]=t}}},8268:(t,i,s)=>{s.d(i,{A:()=>d});var h=s(9418),e=s(8665),n=s(2679),r=s(8738),o=s(1312),l=s(8317),a=s(1302),c=s(3819),f=s(3867),u=s(9298);class d extends h.A{static Cu=1;static Tu=2;static bu=4;static Lu=8;static Ru=16;static Su=32;static xu=64;static Hm=128;static Du=256;static Pu=512;static Ra=[u.A.Xv,u.A.zv,u.A.jv,u.A.Zv,u.A.qv,u.A.$v,u.A.Jv,u.A.Qv,u.A.tL,u.A.iL,u.A.sL,u.A.hL,u.A.eL,u.A.nL,u.A.rL,u.A.oL];static La=[[u.A.lL,u.A.aL,u.A.cL,u.A.fL,u.A.uL,u.A.dL,u.A.wL,u.A.AL,u.A.yL,u.A.pL,u.A.mL,u.A.IL],[u.A._L,u.A.EL,u.A.gL,u.A.CL,u.A.TL,u.A.OL,u.A.bL,u.A.vL,u.A.LL,u.A.RL,u.A.SL,u.A.ML,u.A.kL,u.A.xL,u.A.DL,u.A.NL],[u.A.NL-1,u.A._L+1,u.A.EL,u.A.gL,u.A.CL,u.A.TL,u.A.OL,u.A.bL,u.A.vL,u.A.LL,u.A.RL,u.A.SL,u.A.ML,u.A.kL,u.A.xL,u.A.DL],[u.A.PL,u.A.FL,u.A.UL,u.A.BL,u.A.GL,u.A.HL],[u.A.WL,u.A.YL,u.A.VL,u.A.KL,u.A.XL,u.A.zL,u.A.jL,u.A.ZL]];static So=new n.A(200);name=null;visible=!1;qL=0;ru=0;$L=new Uint16Array(12);JL=new Uint16Array(5);Ka=0;QL=0n;y=0;OI=0;bI=0;r_=0;l_=0;o_=0;TI=null;MI=0;kI=0;xI=0;DI=0;st=!1;draw(t){if(!this.visible)return null;let i=this.Jg();if(this.height=i.Zg,i.sC=!0,this.st)return i;if(-1!==this.Nu&&-1!==this.$m){const t=r.A.Ro[this.Nu],s=e.A.qE(t.la(),!0,!t.Og,!1);s.translate(-this.Zm,0,0),s.Ma(),t.GI&&t.GI.frames&&s.ka(t.GI.frames[this.$m]),s.Kg=null,s.Xg=null,128===t.qg&&128===t.$g||s.scale(t.qg,t.$g,t.qg),s.xa(t.vg+64,t.Lg+850,-30,-50,-30,!0);const h=[i,s];i=e.A.Kv(h,2)}if(this.TI&&(t>=this.bI&&(this.TI=null),t>=this.OI&&t=d.La[i].length)&&(s=0),this.JL[i]=s}this.Sa=t.KA,65535===this.Sa&&(this.Sa=-1),this.$I=t.KA,65535===this.$I&&(this.$I=-1),this.oI=t.KA,65535===this.oI&&(this.oI=-1),this.aI=t.KA,65535===this.aI&&(this.aI=-1),this.fI=t.KA,65535===this.fI&&(this.fI=-1),this.dI=t.KA,65535===this.dI&&(this.dI=-1),this.e_=t.KA,65535===this.e_&&(this.e_=-1),this.name=c.A.ga(c.A.Ca(t.Uc)),this.Ka=t.ZA,this.visible=!0,this.QL=0n;for(let t=0;t<12;t++)this.QL<<=0x4n,this.$L[t]>=256&&(this.QL+=BigInt(this.$L[t])-256n);this.$L[0]>=256&&(this.QL+=BigInt(this.$L[0])-256n>>4n),this.$L[1]>=256&&(this.QL+=BigInt(this.$L[1])-256n>>8n);for(let t=0;t<5;t++)this.QL<<=0x3n,this.QL+=BigInt(this.JL[t]);this.QL<<=0x1n,this.QL+=BigInt(this.qL)}ey(){if(!this.visible)return null;const t=new f.ds(12,null);let i=0;for(let s=0;s<12;s++){const h=this.$L[s];if(h>=256&&h<512&&(t[i++]=l.A.Ro[h-256].ey()),h>=512){const s=a.A.get(h-512).ey(this.qL);s&&(t[i++]=s)}}const s=e.A.ba(t,i);for(let t=0;t<5;t++)0!==this.JL[t]&&(s.va(d.La[t][0],d.La[t][this.JL[t]]),1===t&&s.va(d.Ra[0],d.Ra[this.JL[t]]));return s}Jg(){let t=this.QL,i=-1,s=-1,h=-1,n=-1;if(this.Ou>=0&&0===this.Xm){const e=o.A.Ro[this.Ou];if(e.frames&&(i=e.frames[this.Vm]),this.CI>=0&&this.CI!==this.Sa){const t=o.A.Ro[this.CI].frames;t&&(s=t[this.QI])}e.MC>=0&&(h=e.MC,t+=BigInt(h-this.$L[5])<<8n),e.kC>=0&&(n=e.kC,t+=BigInt(n-this.$L[3])<<16n)}else if(this.CI>=0){const t=o.A.Ro[this.CI].frames;t&&(i=t[this.QI])}let r=d.So?.get(t);if(!r){const i=new f.ds(12,null);let s=0;for(let t=0;t<12;t++){let e=this.$L[t];if(n>=0&&3===t&&(e=n),h>=0&&5===t&&(e=h),e>=256&&e<512){const t=l.A.Ro[e-256].la();t&&(i[s++]=t)}if(e>=512){const t=a.A.get(e-512).SC(this.qL);t&&(i[s++]=t)}}r=e.A.ba(i,s);for(let t=0;t<5;t++)0!==this.JL[t]&&(r.va(d.La[t][0],d.La[t][this.JL[t]]),1===t&&r.va(d.Ra[0],d.Ra[this.JL[t]]));r.Ma(),r.xa(64,850,-30,-50,-30,!0),d.So?.put(t,r)}if(this.st)return r;const c=e.A.Qg(r,!0);return-1!==i&&-1!==s?c.tC(i,s,o.A.Ro[this.Ou].s_):-1!==i&&c.ka(i),c.iC(),c.Kg=null,c.Xg=null,c}}},254:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(8738),e=s(7121),n=s(8665);class r extends e.A{tR;level;iR;sR;hR;offsetY;FI;NI;eR;arc;target;mobile=!1;x=0;z=0;y=0;velocityX=0;nR=0;rR=0;velocityY=0;oR=0;LI=0;pitch=0;ul=0;fl=0;constructor(t,i,s,e,n,r,o,l,a,c,f){super(),this.tR=h.A.Ro[t],this.level=i,this.iR=s,this.sR=n,this.hR=e,this.FI=r,this.NI=o,this.eR=l,this.arc=a,this.target=c,this.offsetY=f}UI(t,i,s,h){if(!this.mobile){const i=t-this.iR,h=s-this.sR,e=Math.sqrt(i*i+h*h);this.x=this.iR+i*this.arc/e,this.z=this.sR+h*this.arc/e,this.y=this.hR}const e=this.NI+1-h;this.velocityX=(t-this.x)/e,this.nR=(s-this.z)/e,this.rR=Math.sqrt(this.velocityX*this.velocityX+this.nR*this.nR),this.mobile||(this.velocityY=-this.rR*Math.tan(.02454369*this.eR)),this.oR=2*(i-this.y-this.velocityY*e)/(e*e)}update(t){if(this.mobile=!0,this.x+=this.velocityX*t,this.z+=this.nR*t,this.y+=this.velocityY*t+.5*this.oR*t*t,this.velocityY+=this.oR*t,this.LI=325.949*Math.atan2(this.velocityX,this.nR)+1024&2047,this.pitch=325.949*Math.atan2(this.velocityY,this.rR)&2047,this.tR.GI&&this.tR.GI.delay)for(this.fl+=t;this.fl>this.tR.GI.delay[this.ul];)this.fl-=this.tR.GI.delay[this.ul]+1,this.ul++,this.ul>=this.tR.GI.dl&&(this.ul=0)}draw(){const t=this.tR.la(),i=n.A.qE(t,!0,!this.tR.Og,!1);return this.tR.GI&&this.tR.GI.frames&&(i.Ma(),i.ka(this.tR.GI.frames[this.ul]),i.Kg=null,i.Xg=null),128===this.tR.qg&&128===this.tR.$g||i.scale(this.tR.qg,this.tR.$g,this.tR.qg),i.lR(this.pitch),i.xa(64+this.tR.vg,850+this.tR.Lg,-30,-50,-30,!0),i}}},7628:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(7121),e=s(8738),n=s(8665);class r extends h.A{type;level;x;z;y;FI;BI=!1;ul=0;fl=0;constructor(t,i,s,h,n,r,o){super(),this.type=e.A.Ro[t],this.level=i,this.x=s,this.z=h,this.y=n,this.FI=r+o}update(t){if(this.type.GI&&this.type.GI.delay)for(this.fl+=t;this.fl>this.type.GI.delay[this.ul];)this.fl-=this.type.GI.delay[this.ul]+1,this.ul++,this.ul>=this.type.GI.dl&&(this.ul=0,this.BI=!0)}draw(){const t=this.type.la(),i=n.A.qE(t,!0,!this.type.Og,!1);return!this.BI&&this.type.GI&&this.type.GI.frames&&(i.Ma(),i.ka(this.type.GI.frames[this.ul]),i.Kg=null,i.Xg=null),128===this.type.qg&&128===this.type.$g||i.scale(this.type.qg,this.type.$g,this.type.qg),0!==this.type.orientation&&(90===this.type.orientation?i.zg():180===this.type.orientation?(i.zg(),i.zg()):270===this.type.orientation&&(i.zg(),i.zg(),i.zg())),i.xa(64+this.type.vg,850+this.type.Lg,-30,-50,-30,!0),i}}},9222:(t,i,s)=>{s.d(i,{A:()=>h});class h{y;x;z;model;gb;info;constructor(t,i,s,h,e,n){this.y=t,this.x=i,this.z=s,this.model=h,this.gb=e,this.info=n}}},1161:(t,i,s)=>{s.d(i,{A:()=>h});class h{level;y;x;z;model;av;LI;Cb;Sb;Tb;Mb;gb;info;Iv=0;Vf=0;constructor(t,i,s,h,e,n,r,o,l,a,c,f,u){this.level=t,this.y=i,this.x=s,this.z=h,this.model=e,this.av=n,this.LI=r,this.Cb=o,this.Sb=l,this.Tb=a,this.Mb=c,this.gb=f,this.info=u}}},5327:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{hp;Nd;x;z;Kp;angle;shape;NI;constructor(t,i,s,h,e,n,r,o){super(),this.hp=t,this.Nd=i,this.x=s,this.z=h,this.Kp=e,this.angle=n,this.shape=r,this.NI=o}}},2630:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{hp;Nd;x;z;Kp;angle;shape;ep;np;rp;constructor(t,i,s,h,e,n,r,o,l,a){super(),this.hp=t,this.Nd=i,this.x=s,this.z=h,this.Kp=e,this.angle=n,this.shape=r,this.ep=o,this.np=l,this.rp=a}}},5748:(t,i,s)=>{s.d(i,{A:()=>h});class h{y;x;z;mv;pv;yv;gb;offset;constructor(t,i,s,h,e,n,r,o){this.y=t,this.x=i,this.z=s,this.mv=h,this.pv=e,this.yv=n,this.gb=r,this.offset=o}}},8256:(t,i,s)=>{s.d(i,{A:()=>h});class h{MI;xI;kI;DI;type;Nb;Pb;Fb;Ub;Db;Zg;mode=0;sv=0;hv=0;Jb=0;Qb=0;tv=0;iv=0;constructor(t,i,s,h,e,n,r,o,l,a,c){this.MI=t,this.xI=i,this.kI=s,this.DI=h,this.type=e,this.Nb=n,this.Pb=r,this.Fb=o,this.Ub=l,this.Db=a,this.Zg=c}}},3795:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(1982),e=s(3867);class n extends h.A{level;x;z;nv;Ab;qb;ab=null;fb=null;pb=null;mb=null;ub=null;yb=null;ob=null;wb=0;$b=0;lb=0;visible=!1;update=!1;zb=!1;jb=0;uv=0;dv=0;cv=0;constructor(t,i,s){super(),this.nv=this.level=t,this.x=i,this.z=s,this.Ab=new e.ds(5,null),this.qb=new Int32Array(5)}}},2771:(t,i,s)=>{s.d(i,{A:()=>h});class h{static Pv=new Int32Array(6);static Fv=new Int32Array(6);static xv=new Int32Array(6);static Dv=new Int32Array(6);static Nv=new Int32Array(6);static aR=[Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,2,6),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,13,14)];static cR=[Int8Array.of(0,1,2,3,0,0,1,3),Int8Array.of(1,1,2,3,1,0,1,3),Int8Array.of(0,1,2,3,1,0,1,3),Int8Array.of(0,0,1,2,0,0,2,4,1,0,4,3),Int8Array.of(0,0,1,4,0,0,4,3,1,1,2,4),Int8Array.of(0,0,4,3,1,0,1,2,1,0,2,4),Int8Array.of(0,1,2,4,1,0,1,4,1,0,4,3),Int8Array.of(0,4,1,2,0,4,2,5,1,0,4,5,1,0,5,3),Int8Array.of(0,4,1,2,0,4,2,3,0,4,3,5,1,0,4,5),Int8Array.of(0,0,4,5,1,4,1,2,1,4,2,3,1,4,3,5),Int8Array.of(0,0,1,5,0,1,4,5,0,1,2,4,1,0,5,3,1,5,4,3,1,4,2,3),Int8Array.of(1,0,1,5,1,1,4,5,1,1,2,4,0,0,5,3,0,5,4,3,0,4,2,3),Int8Array.of(1,0,5,4,1,0,1,5,0,0,4,3,0,4,5,3,0,5,2,3,0,1,2,5)];static fR=128;static uR=this.fR/2|0;static dR=this.fR/4|0;static wR=3*this.fR/4|0;Gg;Wg;Hg;Hv;Wv;Yv;Uv;Bv;Gv;kv;flat;shape;angle;Vb;Kb;constructor(t,i,s,e,n,r,o,l,a,c,f,u,d,w,A,y,p,m,I){this.flat=!(p!==e||p!==w||p!==l),this.shape=i,this.angle=r,this.Vb=d,this.Kb=a;const _=h.aR[i],E=_.length;this.Gg=new Int32Array(E),this.Wg=new Int32Array(E),this.Hg=new Int32Array(E);const g=new Int32Array(E),C=new Int32Array(E),T=t*h.fR,O=m*h.fR;for(let t=0;t8&&E<=12&&(E=9+(E-r-9&3)),E>12&&E<=16&&(E=13+(E-r-13&3)),1===E?(i=T,a=O,f=p,d=o,m=c):2===E?(i=T+h.uR,a=O,f=p+e>>1,d=o+I>>1,m=c+s>>1):3===E?(i=T+h.fR,a=O,f=e,d=I,m=s):4===E?(i=T+h.fR,a=O+h.uR,f=e+w>>1,d=I+n>>1,m=s+A>>1):5===E?(i=T+h.fR,a=O+h.fR,f=w,d=n,m=A):6===E?(i=T+h.uR,a=O+h.fR,f=w+l>>1,d=n+y>>1,m=A+u>>1):7===E?(i=T,a=O+h.fR,f=l,d=y,m=u):8===E?(i=T,a=O+h.uR,f=l+p>>1,d=y+o>>1,m=u+c>>1):9===E?(i=T+h.uR,a=O+h.dR,f=p+e>>1,d=o+I>>1,m=c+s>>1):10===E?(i=T+h.wR,a=O+h.uR,f=e+w>>1,d=I+n>>1,m=s+A>>1):11===E?(i=T+h.uR,a=O+h.wR,f=w+l>>1,d=n+y>>1,m=A+u>>1):12===E?(i=T+h.dR,a=O+h.uR,f=l+p>>1,d=y+o>>1,m=u+c>>1):13===E?(i=T+h.dR,a=O+h.dR,f=p,d=o,m=c):14===E?(i=T+h.wR,a=O+h.dR,f=e,d=I,m=s):15===E?(i=T+h.wR,a=O+h.wR,f=w,d=n,m=A):(i=T+h.dR,a=O+h.wR,f=l,d=y,m=u),this.Gg[t]=i,this.Wg[t]=f,this.Hg[t]=a,g[t]=d,C[t]=m}const b=h.cR[i],v=b.length/4|0;this.Uv=new Int32Array(v),this.Bv=new Int32Array(v),this.Gv=new Int32Array(v),this.Hv=new Int32Array(v),this.Wv=new Int32Array(v),this.Yv=new Int32Array(v),this.kv=-1!==f?new Int32Array(v):null;let L=0;for(let t=0;t{s.d(i,{A:()=>h});class h{static JT=0;static cb=1;static AR=2;static yR=3;static pR=4;static mR=5;static uR=6;static dR=7;static wR=8;static IR=9;static _R=10;static ER=11}},3479:(t,i,s)=>{s.d(i,{A:()=>h});class h{Mv;Lv;Ov;vv;Tv;color;flat;constructor(t,i,s,h,e,n,r){this.Mv=t,this.Lv=i,this.Ov=s,this.vv=h,this.Tv=e,this.color=n,this.flat=r}}},6855:(t,i,s)=>{s.d(i,{A:()=>h});class h{y;x;z;fv;Av;Ib;_b;gb;info;constructor(t,i,s,h,e,n,r,o,l){this.y=t,this.x=i,this.z=s,this.fv=h,this.Av=e,this.Ib=n,this._b=r,this.gb=o,this.info=l}}},7441:(t,i,s)=>{s.d(i,{A:()=>h});class h{y;x;z;type;angle;model;gb;info;constructor(t,i,s,h,e,n,r,o){this.y=t,this.x=i,this.z=s,this.type=h,this.angle=e,this.model=n,this.gb=r,this.info=o}}},7536:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e{gR;CR;constructor(t){this.CR=[],this.gR=t;for(let i=0;i{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{TR;OR;constructor(){super(),this.TR=this,this.OR=this}bR(){this.OR&&this.TR&&(this.OR.TR=this.TR,this.TR.OR=this.OR,this.TR=null,this.OR=null)}}},3819:(t,i,s)=>{s.d(i,{A:()=>h});class h{static vR=['_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9'];static ld=t=>{t=t.trim();let i=0n;for(let s=0;s=65&&h<=90?i+=BigInt(h+1-65):h>=97&&h<=122?i+=BigInt(h+1-97):h>=48&&h<=57&&(i+=BigInt(h+27-48))}return i};static Ca=t=>{if(t<0n||t>=6582952005840035281n)return'invalid_name';if(t%37n===0n)return'invalid_name';let i=0;const s=Array(12);for(;0n!==t;){const h=t;t/=37n,s[11-i++]=this.vR[Number(h-37n*t)]}return s.slice(12-i).join('')};static dA=t=>{const i=[...t.toLowerCase()];let s=!0;for(let t=0;t='a'&&h<='z'&&(i[t]=h.toUpperCase(),s=!1),'.'!==h&&'!'!==h||(s=!0)}return i.join('')};static Dc=t=>{let i='';for(let s=0;s(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static ga=t=>{if(0===t.length)return t;const i=[...t];for(let t=0;t='a'&&i[t+1]<='z'&&(i[t+1]=String.fromCharCode(i[t+1].charCodeAt(0)+'A'.charCodeAt(0)-97)));return i[0]>='a'&&i[0]<='z'&&(i[0]=String.fromCharCode(i[0].charCodeAt(0)+'A'.charCodeAt(0)-97)),i.join('')};static jE=t=>{const i=t.toUpperCase();let s=0n;for(let t=0;t>56n)&0xffffffffffffffn;return s}}},6666:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e{LR;cursor=null;constructor(){const t=new h.A;t.next=t,t.Im=t,this.LR=t}n_(t){t.Im&&t.sy(),t.Im=this.LR.Im,t.next=this.LR,t.Im&&(t.Im.next=t),t.next.Im=t}bA(t){t.Im&&t.sy(),t.Im=this.LR,t.next=this.LR.next,t.Im.next=t,t.next&&(t.next.Im=t)}ev(){const t=this.LR.next;return t===this.LR?null:(t?.sy(),t)}head(){const t=this.LR.next;return t===this.LR?(this.cursor=null,null):(this.cursor=t?.next||null,t)}pm(){const t=this.LR.Im;return t===this.LR?(this.cursor=null,null):(this.cursor=t?.Im||null,t)}next(){const t=this.cursor;return t===this.LR?(this.cursor=null,null):(this.cursor=t?.next||null,t)}Im(){const t=this.cursor;return t===this.LR?(this.cursor=null,null):(this.cursor=t?.Im||null,t)}clear(){for(;;){const t=this.LR.next;if(t===this.LR)return;t?.sy()}}}},1982:(t,i,s)=>{s.d(i,{A:()=>h});class h{key;next;Im;constructor(){this.key=0n,this.next=this,this.Im=this}sy(){this.Im&&this.next&&(this.Im.next=this.next,this.next.Im=this.Im,this.next=null,this.Im=null)}}},2679:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(2512),e=s(7536);class n{RR;SR;history;available;constructor(t){this.RR=t,this.available=t,this.SR=new e.A(1024),this.history=new h.A}get(t){const i=this.SR.get(t);return i&&this.history.push(i),i}put(t,i){if(0===this.available){const t=this.history.pop();t?.sy(),t?.bR()}else this.available--;this.SR.put(t,i),this.history.push(i)}clear(){const t=this.history.pop();t?(t.sy(),t.bR()):this.available=this.RR}}},2512:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(4474);class e{head;constructor(){this.head=new h.A}push(t){t.OR&&t.bR(),t.OR=this.head.OR,t.TR=this.head,t.OR&&(t.OR.TR=t),t.TR.OR=t}pop(){const t=this.head.TR;return t===this.head?null:(t?.bR(),t)}}},8534:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(1069),e=s(3867);class n{static Ro=[];static ec=t=>{const i=new h.A(t.read('base_head.dat')),s=new h.A(t.read('base_type.dat')),r=new h.A(t.read('base_label.dat')),o=i.KA;i.Fc+=2;for(let t=0;t{s.d(i,{A:()=>n});var h=s(8534),e=s(1069);class n{static Ro=[];static ec=t=>{const i=new e.A(t.read('frame_head.dat')),s=new e.A(t.read('frame_tran1.dat')),r=new e.A(t.read('frame_tran2.dat')),o=new e.A(t.read('frame_del.dat')),l=i.KA;i.Fc+=2;const a=new Int32Array(500),c=new Int32Array(500),f=new Int32Array(500),u=new Int32Array(500);for(let t=0;t0){if(0!==d.types[t])for(let i=t-1;i>A;i--)if(0===d.types[i]){a[y]=i,c[y]=0,f[y]=0,u[y]=0,y++;break}a[y]=t;let s=0;3===d.types[a[y]]&&(s=128),c[y]=1&i?r.kR:s,f[y]=2&i?r.kR:s,u[y]=4&i?r.kR:s,A=t,y++}}e.length=y,e.xR=new Int32Array(y),e.x=new Int32Array(y),e.y=new Int32Array(y),e.z=new Int32Array(y);for(let t=0;t{s.d(i,{N_:()=>h,jo:()=>e,DR:()=>o,NR:()=>r,PR:()=>n});const h=document.getElementById('canvas'),e=h.getContext('2d',{willReadFrequently:!0}),n=document.createElement('canvas'),r=document.createElement('img'),o=n.getContext('2d',{willReadFrequently:!0})},9298:(t,i,s)=>{s.d(i,{A:()=>h});class h{static RED=16711680;static GREEN=65280;static BLUE=255;static Gl=16776960;static bc=65535;static vc=16711935;static _l=16777215;static Bl=0;static FR=16748608;static sd=8388608;static td=128;static UR=16756736;static BR=16740352;static GR=16723968;static HR=12648192;static WR=8453888;static YR=4259584;static yc=9179409;static Dd=6116423;static il=2301979;static sl=5063219;static el=7759444;static rl=3353893;static hd=8388736;static ed=13350793;static Uu=Int32Array.of(h.Gl,h.RED,h.GREEN,h.bc,h.vc,h._l);static lL=6798;static aL=107;static cL=10283;static fL=16;static uL=4797;static dL=7744;static wL=5799;static AL=4634;static yL=33697;static pL=22433;static mL=2983;static IL=54193;static _L=8741;static EL=12;static gL=64030;static CL=43162;static TL=7735;static OL=8404;static bL=1701;static vL=38430;static LL=24094;static RL=10153;static SL=56621;static ML=4783;static kL=1341;static xL=16578;static DL=35003;static NL=25239;static Xv=9104;static zv=10275;static jv=7595;static Zv=3610;static qv=7975;static $v=8526;static Jv=918;static Qv=38802;static tL=24466;static iL=10145;static sL=58654;static hL=5027;static eL=1457;static nL=16565;static rL=34991;static oL=25486;static PL=4626;static FL=11146;static UL=6439;static BL=12;static GL=4758;static HL=10270;static ZL=4574;static WL=4550;static YL=4537;static VL=5681;static KL=5673;static XL=5790;static zL=6806;static jL=8076}},8950:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(4474);class e extends h.A{static nc=new Int32Array;static lC=0;static aC=0;static top=0;static bottom=0;static left=0;static right=0;static gv=0;static VR=0;static KR=0;static bind=(t,i,s)=>{this.nc=t,this.lC=i,this.aC=s,this.yl(0,0,i,s)};static Gu=()=>{this.left=0,this.top=0,this.right=this.lC,this.bottom=this.aC,this.gv=this.right-1,this.VR=this.right/2|0};static yl=(t,i,s,h)=>{t<0&&(t=0),i<0&&(i=0),s>this.lC&&(s=this.lC),h>this.aC&&(h=this.aC),this.top=i,this.bottom=h,this.left=t,this.right=s,this.gv=this.right-1,this.VR=this.right/2|0,this.KR=this.bottom/2|0};static clear=()=>{const t=this.lC*this.aC;for(let i=0;i{this.nl(t,i,e,s),this.nl(t,i+h-1,e,s),this.hl(t,i,e,h),this.hl(t+s-1,i,e,h)};static nl=(t,i,s,h)=>{if(i=this.bottom)return;tthis.right&&(h=this.right-t);const e=t+i*this.lC;for(let t=0;t{if(t=this.right)return;ithis.bottom&&(h=this.bottom-i);const e=t+i*this.lC;for(let t=0;t{const n=Math.abs(s-t),r=Math.abs(h-i),o=t=this.left&&t=this.top&&i-r&&(a-=r,t+=o),s{tthis.right&&(s=this.right-t),i+h>this.bottom&&(h=this.bottom-i);const n=this.lC-s;let r=t+i*this.lC;for(let t=-h;t<0;t++){for(let t=-s;t<0;t++)this.nc[r++]=e;r+=n}};static XR(t,i,s,h,e,n){tthis.right&&(s=this.right-t),i+h>this.bottom&&(h=this.bottom-i);const r=256-n,o=(e>>16&255)*n,l=(e>>8&255)*n,a=(255&e)*n,c=this.lC-s;let f=t+i*this.lC;for(let t=0;t>16&255)*r>>8<<16)+(l+(this.nc[f]>>8&255)*r>>8<<8)+(a+(255&this.nc[f])*r>>8);this.nc[f++]=t}f+=c}}static zR(t,i,s,h,e){const n=256-e,r=(h>>16&255)*e,o=(h>>8&255)*e,l=(255&h)*e;let a=i-s;a<0&&(a=0);let c=i+s;c>=this.aC&&(c=this.aC-1);for(let h=a;h<=c;h++){const e=h-i,a=0|Math.sqrt(s*s-e*e);let c=t-a;c<0&&(c=0);let f=t+a;f>=this.lC&&(f=this.lC-1);let u=c+h*this.lC;for(let t=c;t<=f;t++){const t=(r+(this.nc[u]>>16&255)*n>>8<<16)+(o+(this.nc[u]>>8&255)*n>>8<<8)+(l+(255&this.nc[u])*n>>8);this.nc[u++]=t}}}static jR=(t,i,s)=>{t=this.right||i=this.bottom||(this.nc[t+i*this.lC]=s)}}},4583:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(8950),e=s(1673),n=s(3867);class r extends h.A{static st=!1;static ZR=new Int32Array(512);static qR=new Int32Array(2048);static sin=new Int32Array(2048);static cos=new Int32Array(2048);static palette=new Int32Array(65536);static c_=new n.ds(50,null);static $R=0;static oc=new Int32Array;static na=0;static ra=0;static cC=!0;static Ev=!1;static alpha=0;static JR=null;static QR=new n.ds(50,null);static tS=0;static Vf=0;static a_=new Int32Array(50);static iS=new n.ds(50,null);static sS=!1;static hS=new n.ds(50,!1);static eS=new Int32Array(50);static{for(let t=1;t<512;t++)this.ZR[t]=32768/t|0;for(let t=1;t<2048;t++)this.qR[t]=65536/t|0;for(let t=0;t<2048;t++)this.sin[t]=65536*Math.sin(.0030679615757712823*t)|0,this.cos[t]=65536*Math.cos(.0030679615757712823*t)|0}static bo=()=>{this.ZR=null,this.ZR=null,this.sin=null,this.cos=null,this.oc=null,this.c_=null,this.hS=null,this.eS=null,this.JR=null,this.QR=null,this.a_=null,this.palette=null,this.iS=null,console.log('Draw3D unloaded!')};static P_=()=>{this.oc=new Int32Array(this.aC);for(let t=0;t{this.oc=new Int32Array(i);for(let s=0;s{this.JR=null,this.QR.fill(null)};static ic=t=>{this.$R=0;for(let i=0;i<50;i++)try{this.c_[i]=e.A.za(t,i.toString()),this.st&&128===this.c_[i]?.Pl?this.c_[i]?.nS():this.c_[i]?.AC(),this.$R++}catch(t){}};static tO=t=>{if(0!==this.eS[t])return this.eS[t];const i=this.iS[t];if(!i)return 0;let s=0,h=0,e=0;const n=i.length;for(let t=0;t>16&255,h+=i[t]>>8&255,e+=255&i[t];let r=(s/n<<16)+(h/n<<8)+(e/n|0);return r=this.rS(r,1.4),0===r&&(r=1),this.eS[t]=r,r};static sc=t=>{const i=t+.03*Math.random()-.015;let s=0;for(let t=0;t<512;t++){const h=(t/8|0)/64+.0078125,e=(7&t)/8+.0625;for(let t=0;t<128;t++){const n=t/128;let r=n,o=n,l=n;if(0!==e){let t;t=n<.5?n*(e+1):n+e-n*e;const i=2*n-t;let s=h+.3333333333333333;s>1&&s--;let a=h-.3333333333333333;a<0&&a++,r=6*s<1?i+6*(t-i)*s:2*s<1?t:3*s<2?i+(t-i)*(.6666666666666666-s)*6:i,o=6*h<1?i+6*(t-i)*h:2*h<1?t:3*h<2?i+(t-i)*(.6666666666666666-h)*6:i,l=6*a<1?i+6*(t-i)*a:2*a<1?t:3*a<2?i+(t-i)*(.6666666666666666-a)*6:i}const a=((256*r|0)<<16)+((256*o|0)<<8)+(256*l|0);this.palette[s++]=this.rS(a,i)}}for(let t=0;t<50;t++){const s=this.c_[t];if(!s)continue;const h=s.palette;this.iS[t]=new Int32Array(h.length);for(let s=0;s{const s=(t>>16)/256,h=(t>>8&255)/256,e=(255&t)/256;return((256*Math.pow(s,i)|0)<<16)+((256*Math.pow(h,i)|0)<<8)+(256*Math.pow(e,i)|0)};static hc=t=>{this.JR||(this.tS=t,this.st?this.JR=new n.Kn(t,16384):this.JR=new n.Kn(t,65536),this.QR.fill(null))};static bv=(t,i,s,h,e,n,r,o,l)=>{let a=0,c=0;e!==h&&(a=(i-t<<16)/(e-h)|0,c=(o-r<<15)/(e-h)|0);let f=0,u=0;n!==e&&(f=(s-i<<16)/(n-e)|0,u=(l-o<<15)/(n-e)|0);let d=0,w=0;if(n!==h&&(d=(t-s<<16)/(h-n)|0,w=(r-l<<15)/(h-n)|0),h<=e&&h<=n){if(hthis.bottom&&(e=this.bottom),n>this.bottom&&(n=this.bottom),ef)for(n-=e,e-=h,h=this.oc[h];;){if(--e<0)for(;;){if(--n<0)return;this.oS(s>>16,i>>16,l>>7,o>>7,this.nc,h,0),s+=d,i+=f,l+=w,o+=u,h+=this.lC}this.oS(s>>16,t>>16,l>>7,r>>7,this.nc,h,0),s+=d,t+=a,l+=w,r+=c,h+=this.lC}else for(n-=e,e-=h,h=this.oc[h];;){if(--e<0)for(;;){if(--n<0)return;this.oS(i>>16,s>>16,o>>7,l>>7,this.nc,h,0),s+=d,i+=f,l+=w,o+=u,h+=this.lC}this.oS(t>>16,s>>16,r>>7,l>>7,this.nc,h,0),s+=d,t+=a,l+=w,r+=c,h+=this.lC}else if(i=t<<=16,o=r<<=15,h<0&&(i-=d*h,t-=a*h,o-=w*h,r-=c*h,h=0),s<<=16,l<<=15,n<0&&(s-=f*n,l-=u*n,n=0),h!==n&&da)for(e-=n,n-=h,h=this.oc[h];;){if(--n<0)for(;;){if(--e<0)return;this.oS(s>>16,t>>16,l>>7,r>>7,this.nc,h,0),s+=f,t+=a,l+=u,r+=c,h+=this.lC}this.oS(i>>16,t>>16,o>>7,r>>7,this.nc,h,0),i+=d,t+=a,o+=w,r+=c,h+=this.lC}else for(e-=n,n-=h,h=this.oc[h];;){if(--n<0)for(;;){if(--e<0)return;this.oS(t>>16,s>>16,r>>7,l>>7,this.nc,h,0),s+=f,t+=a,l+=u,r+=c,h+=this.lC}this.oS(t>>16,i>>16,r>>7,o>>7,this.nc,h,0),i+=d,t+=a,o+=w,r+=c,h+=this.lC}}else if(e<=n){if(ethis.bottom&&(n=this.bottom),h>this.bottom&&(h=this.bottom),nd)for(h-=n,n-=e,e=this.oc[e];;){if(--n<0)for(;;){if(--h<0)return;this.oS(t>>16,s>>16,r>>7,l>>7,this.nc,e,0),t+=a,s+=d,r+=c,l+=w,e+=this.lC}this.oS(t>>16,i>>16,r>>7,o>>7,this.nc,e,0),t+=a,i+=f,r+=c,o+=u,e+=this.lC}else for(h-=n,n-=e,e=this.oc[e];;){if(--n<0)for(;;){if(--h<0)return;this.oS(s>>16,t>>16,l>>7,r>>7,this.nc,e,0),t+=a,s+=d,r+=c,l+=w,e+=this.lC}this.oS(i>>16,t>>16,o>>7,r>>7,this.nc,e,0),t+=a,i+=f,r+=c,o+=u,e+=this.lC}else if(s=i<<=16,l=o<<=15,e<0&&(s-=a*e,i-=f*e,l-=c*e,o-=u*e,e=0),t<<=16,r<<=15,h<0&&(t-=d*h,r-=w*h,h=0),n-=h,h-=e,e=this.oc[e],a>16,i>>16,r>>7,o>>7,this.nc,e,0),t+=d,i+=f,r+=w,o+=u,e+=this.lC}this.oS(s>>16,i>>16,l>>7,o>>7,this.nc,e,0),s+=a,i+=f,l+=c,o+=u,e+=this.lC}else for(;;){if(--h<0)for(;;){if(--n<0)return;this.oS(i>>16,t>>16,o>>7,r>>7,this.nc,e,0),t+=d,i+=f,r+=w,o+=u,e+=this.lC}this.oS(i>>16,s>>16,o>>7,l>>7,this.nc,e,0),s+=a,i+=f,l+=c,o+=u,e+=this.lC}}else if(nthis.bottom&&(h=this.bottom),e>this.bottom&&(e=this.bottom),h>16,t>>16,o>>7,r>>7,this.nc,n,0),i+=f,t+=a,o+=u,r+=c,n+=this.lC}this.oS(i>>16,s>>16,o>>7,l>>7,this.nc,n,0),i+=f,s+=d,o+=u,l+=w,n+=this.lC}else for(;;){if(--h<0)for(;;){if(--e<0)return;this.oS(t>>16,i>>16,r>>7,o>>7,this.nc,n,0),i+=f,t+=a,o+=u,r+=c,n+=this.lC}this.oS(s>>16,i>>16,l>>7,o>>7,this.nc,n,0),i+=f,s+=d,o+=u,l+=w,n+=this.lC}else if(t=s<<=16,r=l<<=15,n<0&&(t-=f*n,s-=d*n,r-=u*n,l-=w*n,n=0),i<<=16,o<<=15,e<0&&(i-=a*e,o-=c*e,e=0),h-=e,e-=n,n=this.oc[n],f>16,s>>16,o>>7,l>>7,this.nc,n,0),i+=a,s+=d,o+=c,l+=w,n+=this.lC}this.oS(t>>16,s>>16,r>>7,l>>7,this.nc,n,0),t+=f,s+=d,r+=u,l+=w,n+=this.lC}else for(;;){if(--e<0)for(;;){if(--h<0)return;this.oS(s>>16,i>>16,l>>7,o>>7,this.nc,n,0),i+=a,s+=d,o+=c,l+=w,n+=this.lC}this.oS(s>>16,t>>16,l>>7,r>>7,this.nc,n,0),t+=f,s+=d,r+=u,l+=w,n+=this.lC}};static oS=(t,i,s,h,e,n,r)=>{let o;if(this.cC){let l;if(this.Ev){if(l=i-t>3?(h-s)/(i-t)|0:0,i>this.gv&&(i=this.gv),t<0&&(s-=t*l,t=0),t>=i)return;n+=t,r=i-t>>2,l<<=2}else{if(!(t>2)>0?(h-s)*this.ZR[r]>>15:0}if(0===this.alpha)for(;;){if(--r<0){if((r=i-t&3)>0){o=this.palette[s>>8];do{e[n++]=o,r--}while(r>0);return}break}o=this.palette[s>>8],s+=l,e[n++]=o,e[n++]=o,e[n++]=o,e[n++]=o}else{const h=this.alpha,a=256-this.alpha;for(;;){if(--r<0){if((r=i-t&3)>0){o=this.palette[s>>8],o=((16711935&o)*a>>8&16711935)+((65280&o)*a>>8&65280);do{e[n++]=o+((16711935&e[n])*h>>8&16711935)+((65280&e[n])*h>>8&65280),r--}while(r>0)}break}o=this.palette[s>>8],s+=l,o=((16711935&o)*a>>8&16711935)+((65280&o)*a>>8&65280),e[n++]=o+((16711935&e[n])*h>>8&16711935)+((65280&e[n])*h>>8&65280),e[n++]=o+((16711935&e[n])*h>>8&16711935)+((65280&e[n])*h>>8&65280),e[n++]=o+((16711935&e[n])*h>>8&16711935)+((65280&e[n])*h>>8&65280),e[n++]=o+((16711935&e[n])*h>>8&16711935)+((65280&e[n])*h>>8&65280)}}}else if(tthis.gv&&(i=this.gv),t<0&&(s-=t*l,t=0),t>=i))return;if(n+=t,r=i-t,0===this.alpha)do{e[n++]=this.palette[s>>8],s+=l,r--}while(r>0);else{const t=this.alpha,i=256-this.alpha;do{o=this.palette[s>>8],s+=l,o=((16711935&o)*i>>8&16711935)+((65280&o)*i>>8&65280),e[n++]=o+((16711935&e[n])*t>>8&16711935)+((65280&e[n])*t>>8&65280),r--}while(r>0)}}};static lS=(t,i,s,h,e,n,r)=>{let o=0;e!==h&&(o=(i-t<<16)/(e-h)|0);let l=0;n!==e&&(l=(s-i<<16)/(n-e)|0);let a=0;if(n!==h&&(a=(t-s<<16)/(h-n)|0),h<=e&&h<=n){if(hthis.bottom&&(e=this.bottom),n>this.bottom&&(n=this.bottom),el)for(n-=e,e-=h,h=this.oc[h];;){if(--e<0)for(;;){if(--n<0)return;this.aS(s>>16,i>>16,this.nc,h,r),s+=a,i+=l,h+=this.lC}this.aS(s>>16,t>>16,this.nc,h,r),s+=a,t+=o,h+=this.lC}else for(n-=e,e-=h,h=this.oc[h];;){if(--e<0)for(;;){if(--n<0)return;this.aS(i>>16,s>>16,this.nc,h,r),s+=a,i+=l,h+=this.lC}this.aS(t>>16,s>>16,this.nc,h,r),s+=a,t+=o,h+=this.lC}else if(i=t<<=16,h<0&&(i-=a*h,t-=o*h,h=0),s<<=16,n<0&&(s-=l*n,n=0),h!==n&&ao)for(e-=n,n-=h,h=this.oc[h];;){if(--n<0)for(;;){if(--e<0)return;this.aS(s>>16,t>>16,this.nc,h,r),s+=l,t+=o,h+=this.lC}this.aS(i>>16,t>>16,this.nc,h,r),i+=a,t+=o,h+=this.lC}else for(e-=n,n-=h,h=this.oc[h];;){if(--n<0)for(;;){if(--e<0)return;this.aS(t>>16,s>>16,this.nc,h,r),s+=l,t+=o,h+=this.lC}this.aS(t>>16,i>>16,this.nc,h,r),i+=a,t+=o,h+=this.lC}}else if(e<=n){if(ethis.bottom&&(n=this.bottom),h>this.bottom&&(h=this.bottom),na)for(h-=n,n-=e,e=this.oc[e];;){if(--n<0)for(;;){if(--h<0)return;this.aS(t>>16,s>>16,this.nc,e,r),t+=o,s+=a,e+=this.lC}this.aS(t>>16,i>>16,this.nc,e,r),t+=o,i+=l,e+=this.lC}else for(h-=n,n-=e,e=this.oc[e];;){if(--n<0)for(;;){if(--h<0)return;this.aS(s>>16,t>>16,this.nc,e,r),t+=o,s+=a,e+=this.lC}this.aS(i>>16,t>>16,this.nc,e,r),t+=o,i+=l,e+=this.lC}else if(s=i<<=16,e<0&&(s-=o*e,i-=l*e,e=0),t<<=16,h<0&&(t-=a*h,h=0),o>16,i>>16,this.nc,e,r),t+=a,i+=l,e+=this.lC}this.aS(s>>16,i>>16,this.nc,e,r),s+=o,i+=l,e+=this.lC}else for(n-=h,h-=e,e=this.oc[e];;){if(--h<0)for(;;){if(--n<0)return;this.aS(i>>16,t>>16,this.nc,e,r),t+=a,i+=l,e+=this.lC}this.aS(i>>16,s>>16,this.nc,e,r),s+=o,i+=l,e+=this.lC}}else if(nthis.bottom&&(h=this.bottom),e>this.bottom&&(e=this.bottom),h>16,t>>16,this.nc,n,r),i+=l,t+=o,n+=this.lC}this.aS(i>>16,s>>16,this.nc,n,r),i+=l,s+=a,n+=this.lC}else for(e-=h,h-=n,n=this.oc[n];;){if(--h<0)for(;;){if(--e<0)return;this.aS(t>>16,i>>16,this.nc,n,r),i+=l,t+=o,n+=this.lC}this.aS(s>>16,i>>16,this.nc,n,r),i+=l,s+=a,n+=this.lC}else if(t=s<<=16,n<0&&(t-=l*n,s-=a*n,n=0),i<<=16,e<0&&(i-=o*e,e=0),l>16,s>>16,this.nc,n,r),i+=o,s+=a,n+=this.lC}this.aS(t>>16,s>>16,this.nc,n,r),t+=l,s+=a,n+=this.lC}else for(h-=e,e-=n,n=this.oc[n];;){if(--e<0)for(;;){if(--h<0)return;this.aS(s>>16,i>>16,this.nc,n,r),i+=o,s+=a,n+=this.lC}this.aS(s>>16,t>>16,this.nc,n,r),t+=l,s+=a,n+=this.lC}};static Sv=(t,i,s,h,e,n,r,o,l,a,c,f,u,d,w,A,y,p,m)=>{const I=this.cS(m);this.sS=!this.hS[m];const _=a-u,E=c-w,g=f-y,C=d-a,T=A-c,O=p-f;let b=C*c-T*a<<14;const v=T*f-O*c<<8,L=O*a-C*f<<5;let R=_*c-E*a<<14;const S=E*f-g*c<<8,M=g*a-_*f<<5;let k=E*C-_*T<<14;const x=g*T-E*O<<8,D=_*O-g*C<<5;let N=0,P=0;e!==h&&(N=(i-t<<16)/(e-h)|0,P=(o-r<<16)/(e-h)|0);let F=0,U=0;n!==e&&(F=(s-i<<16)/(n-e)|0,U=(l-o<<16)/(n-e)|0);let B=0,G=0;if(n!==h&&(B=(t-s<<16)/(h-n)|0,G=(r-l<<16)/(h-n)|0),h<=e&&h<=n){if(hthis.bottom&&(e=this.bottom),n>this.bottom&&(n=this.bottom),eF)for(n-=e,e-=h,h=this.oc[h];;){if(--e<0)for(;;){if(--n<0)return;this.fS(s>>16,i>>16,this.nc,h,I,0,0,b,R,k,v,S,x,l>>8,o>>8),s+=B,i+=F,l+=G,o+=U,h+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(s>>16,t>>16,this.nc,h,I,0,0,b,R,k,v,S,x,l>>8,r>>8),s+=B,t+=N,l+=G,r+=P,h+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}else for(n-=e,e-=h,h=this.oc[h];;){if(--e<0)for(;;){if(--n<0)return;this.fS(i>>16,s>>16,this.nc,h,I,0,0,b,R,k,v,S,x,o>>8,l>>8),s+=B,i+=F,l+=G,o+=U,h+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(t>>16,s>>16,this.nc,h,I,0,0,b,R,k,v,S,x,r>>8,l>>8),s+=B,t+=N,l+=G,r+=P,h+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}}else{i=t<<=16,o=r<<=16,h<0&&(i-=B*h,t-=N*h,o-=G*h,r-=P*h,h=0),s<<=16,l<<=16,n<0&&(s-=F*n,l-=U*n,n=0);const a=h-this.ra;if(b+=L*a,R+=M*a,k+=D*a,b|=0,R|=0,k|=0,(h===n||B>=N)&&(h!==n||F<=N))for(e-=n,n-=h,h=this.oc[h];;){if(--n<0)for(;;){if(--e<0)return;this.fS(t>>16,s>>16,this.nc,h,I,0,0,b,R,k,v,S,x,r>>8,l>>8),s+=F,t+=N,l+=U,r+=P,h+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(t>>16,i>>16,this.nc,h,I,0,0,b,R,k,v,S,x,r>>8,o>>8),i+=B,t+=N,o+=G,r+=P,h+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}else for(e-=n,n-=h,h=this.oc[h];;){if(--n<0)for(;;){if(--e<0)return;this.fS(s>>16,t>>16,this.nc,h,I,0,0,b,R,k,v,S,x,l>>8,r>>8),s+=F,t+=N,l+=U,r+=P,h+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(i>>16,t>>16,this.nc,h,I,0,0,b,R,k,v,S,x,o>>8,r>>8),i+=B,t+=N,o+=G,r+=P,h+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}}}else if(e<=n){if(ethis.bottom&&(n=this.bottom),h>this.bottom&&(h=this.bottom),nB)for(h-=n,n-=e,e=this.oc[e];;){if(--n<0)for(;;){if(--h<0)return;this.fS(t>>16,s>>16,this.nc,e,I,0,0,b,R,k,v,S,x,r>>8,l>>8),t+=N,s+=B,r+=P,l+=G,e+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(t>>16,i>>16,this.nc,e,I,0,0,b,R,k,v,S,x,r>>8,o>>8),t+=N,i+=F,r+=P,o+=U,e+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}else for(h-=n,n-=e,e=this.oc[e];;){if(--n<0)for(;;){if(--h<0)return;this.fS(s>>16,t>>16,this.nc,e,I,0,0,b,R,k,v,S,x,l>>8,r>>8),t+=N,s+=B,r+=P,l+=G,e+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(i>>16,t>>16,this.nc,e,I,0,0,b,R,k,v,S,x,o>>8,r>>8),t+=N,i+=F,r+=P,o+=U,e+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}}else{s=i<<=16,l=o<<=16,e<0&&(s-=N*e,i-=F*e,l-=P*e,o-=U*e,e=0),t<<=16,r<<=16,h<0&&(t-=B*h,r-=G*h,h=0);const a=e-this.ra;if(b+=L*a,R+=M*a,k+=D*a,b|=0,R|=0,k|=0,n-=h,h-=e,e=this.oc[e],N>16,i>>16,this.nc,e,I,0,0,b,R,k,v,S,x,r>>8,o>>8),t+=B,i+=F,r+=G,o+=U,e+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(s>>16,i>>16,this.nc,e,I,0,0,b,R,k,v,S,x,l>>8,o>>8),s+=N,i+=F,l+=P,o+=U,e+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}else for(;;){if(--h<0)for(;;){if(--n<0)return;this.fS(i>>16,t>>16,this.nc,e,I,0,0,b,R,k,v,S,x,o>>8,r>>8),t+=B,i+=F,r+=G,o+=U,e+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(i>>16,s>>16,this.nc,e,I,0,0,b,R,k,v,S,x,o>>8,l>>8),s+=N,i+=F,l+=P,o+=U,e+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}}}else if(nthis.bottom&&(h=this.bottom),e>this.bottom&&(e=this.bottom),h>16,t>>16,this.nc,n,I,0,0,b,R,k,v,S,x,o>>8,r>>8),i+=F,t+=N,o+=U,r+=P,n+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(i>>16,s>>16,this.nc,n,I,0,0,b,R,k,v,S,x,o>>8,l>>8),i+=F,s+=B,o+=U,l+=G,n+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}else for(;;){if(--h<0)for(;;){if(--e<0)return;this.fS(t>>16,i>>16,this.nc,n,I,0,0,b,R,k,v,S,x,r>>8,o>>8),i+=F,t+=N,o+=U,r+=P,n+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(s>>16,i>>16,this.nc,n,I,0,0,b,R,k,v,S,x,l>>8,o>>8),i+=F,s+=B,o+=U,l+=G,n+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}}else{t=s<<=16,r=l<<=16,n<0&&(t-=F*n,s-=B*n,r-=U*n,l-=G*n,n=0),i<<=16,o<<=16,e<0&&(i-=N*e,o-=P*e,e=0);const a=n-this.ra;if(b+=L*a,R+=M*a,k+=D*a,b|=0,R|=0,k|=0,h-=e,e-=n,n=this.oc[n],F>16,s>>16,this.nc,n,I,0,0,b,R,k,v,S,x,o>>8,l>>8),i+=N,s+=B,o+=P,l+=G,n+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(t>>16,s>>16,this.nc,n,I,0,0,b,R,k,v,S,x,r>>8,l>>8),t+=F,s+=B,r+=U,l+=G,n+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}else for(;;){if(--e<0)for(;;){if(--h<0)return;this.fS(s>>16,i>>16,this.nc,n,I,0,0,b,R,k,v,S,x,l>>8,o>>8),i+=N,s+=B,o+=P,l+=G,n+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(s>>16,t>>16,this.nc,n,I,0,0,b,R,k,v,S,x,l>>8,r>>8),t+=F,s+=B,r+=U,l+=G,n+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}}};static fS=(t,i,s,h,e,n,r,o,l,a,c,f,u,d,w)=>{if(t>=i)return;let A,y,p,m,I,_,E,g,C;if(this.Ev){if(A=(w-d)/(i-t)|0,i>this.gv&&(i=this.gv),t<0&&(d-=t*A,t=0),t>=i)return;y=i-t>>3,A<<=12}else i-t>7?(y=i-t>>3,A=(w-d)*this.ZR[y]>>6):(y=0,A=0);if(d<<=9,h+=t,this.st&&e)if(p=0,m=0,_=t-this.na,o+=(c>>3)*_,l+=(f>>3)*_,a+=(u>>3)*_,o|=0,l|=0,I=(a|=0)>>12,0!==I&&(r=l/I|0,(n=o/I|0)<0?n=0:n>4032&&(n=4032)),o+=c,l+=f,a+=u,o|=0,l|=0,I=(a|=0)>>12,0!==I&&(p=o/I|0,m=l/I|0,p<7?p=7:p>4032&&(p=4032)),E=p-n>>3,g=m-r>>3,n+=d>>3&786432,C=d>>23,this.sS){for(;y-- >0;)s[h++]=e[(4032&r)+(n>>6)]>>>C,n+=E,r+=g,s[h++]=e[(4032&r)+(n>>6)]>>>C,n+=E,r+=g,s[h++]=e[(4032&r)+(n>>6)]>>>C,n+=E,r+=g,s[h++]=e[(4032&r)+(n>>6)]>>>C,n+=E,r+=g,s[h++]=e[(4032&r)+(n>>6)]>>>C,n+=E,r+=g,s[h++]=e[(4032&r)+(n>>6)]>>>C,n+=E,r+=g,s[h++]=e[(4032&r)+(n>>6)]>>>C,n+=E,r+=g,s[h++]=e[(4032&r)+(n>>6)]>>>C,n=p,r=m,o+=c,l+=f,I=(a+=u)>>12,0!==I&&(p=o/I|0,m=l/I|0,p<7?p=7:p>4032&&(p=4032)),E=p-n>>3,g=m-r>>3,n+=(d+=A)>>3&786432,C=d>>23;for(y=i-t&7;y-- >0;)s[h++]=e[(4032&r)+(n>>6)]>>>C,n+=E,r+=g}else{for(;y-- >0;){let t;0!=(t=e[(4032&r)+(n>>6)]>>>C)&&(s[h]=t),h+=1,0!=(t=e[(4032&(r+=g))+((n+=E)>>6)]>>>C)&&(s[h]=t),h++,0!=(t=e[(4032&(r+=g))+((n+=E)>>6)]>>>C)&&(s[h]=t),h++,0!=(t=e[(4032&(r+=g))+((n+=E)>>6)]>>>C)&&(s[h]=t),h++,0!=(t=e[(4032&(r+=g))+((n+=E)>>6)]>>>C)&&(s[h]=t),h++,0!=(t=e[(4032&(r+=g))+((n+=E)>>6)]>>>C)&&(s[h]=t),h++,0!=(t=e[(4032&(r+=g))+((n+=E)>>6)]>>>C)&&(s[h]=t),h++,0!=(t=e[(4032&(r+=g))+((n+=E)>>6)]>>>C)&&(s[h]=t),h+=1,n=p,r=m,o+=c,l+=f,a+=u,o|=0,l|=0,I=(a|=0)>>12,0!==I&&(p=o/I|0,m=l/I|0,p<7?p=7:p>4032&&(p=4032)),E=p-n>>3,g=m-r>>3,n+=(d+=A)>>3&786432,C=d>>23}for(y=i-t&7;y-- >0;){let t;0!=(t=e[(4032&r)+(n>>6)]>>>C)&&(s[h]=t),h++,n+=E,r+=g}}else if(p=0,m=0,_=t-this.na,o+=(c>>3)*_,l+=(f>>3)*_,a+=(u>>3)*_,o|=0,l|=0,I=(a|=0)>>14,0!==I&&(r=l/I|0,(n=o/I|0)<0?n=0:n>16256&&(n=16256)),o+=c,l+=f,a+=u,o|=0,l|=0,I=(a|=0)>>14,0!==I&&(p=o/I|0,m=l/I|0,p<7?p=7:p>16256&&(p=16256)),E=p-n>>3,g=m-r>>3,n+=6291456&d,C=d>>23,this.sS&&e){for(;y-- >0;)s[h++]=e[(16256&r)+(n>>7)]>>>C,n+=E,r+=g,s[h++]=e[(16256&r)+(n>>7)]>>>C,n+=E,r+=g,s[h++]=e[(16256&r)+(n>>7)]>>>C,n+=E,r+=g,s[h++]=e[(16256&r)+(n>>7)]>>>C,n+=E,r+=g,s[h++]=e[(16256&r)+(n>>7)]>>>C,n+=E,r+=g,s[h++]=e[(16256&r)+(n>>7)]>>>C,n+=E,r+=g,s[h++]=e[(16256&r)+(n>>7)]>>>C,n+=E,r+=g,s[h++]=e[(16256&r)+(n>>7)]>>>C,n=p,r=m,o+=c,l+=f,a+=u,o|=0,l|=0,I=(a|=0)>>14,0!==I&&(p=o/I|0,m=l/I|0,p<7?p=7:p>16256&&(p=16256)),E=p-n>>3,g=m-r>>3,n+=6291456&(d+=A),C=d>>23;for(y=i-t&7;y-- >0;)s[h++]=e[(16256&r)+(n>>7)]>>>C,n+=E,r+=g}else{for(;y-- >0&&e;){let t;0!=(t=e[(16256&r)+(n>>7)]>>>C)&&(s[h]=t),h+=1,0!=(t=e[(16256&(r+=g))+((n+=E)>>7)]>>>C)&&(s[h]=t),h++,0!=(t=e[(16256&(r+=g))+((n+=E)>>7)]>>>C)&&(s[h]=t),h++,0!=(t=e[(16256&(r+=g))+((n+=E)>>7)]>>>C)&&(s[h]=t),h++,0!=(t=e[(16256&(r+=g))+((n+=E)>>7)]>>>C)&&(s[h]=t),h++,0!=(t=e[(16256&(r+=g))+((n+=E)>>7)]>>>C)&&(s[h]=t),h++,0!=(t=e[(16256&(r+=g))+((n+=E)>>7)]>>>C)&&(s[h]=t),h++,0!=(t=e[(16256&(r+=g))+((n+=E)>>7)]>>>C)&&(s[h]=t),h++,n=p,r=m,o+=c,l+=f,a+=u,o|=0,l|=0,I=(a|=0)>>14,0!==I&&(p=o/I|0,m=l/I|0,p<7?p=7:p>16256&&(p=16256)),E=p-n>>3,g=m-r>>3,n+=6291456&(d+=A),C=d>>23}for(y=i-t&7;y-- >0&&e;){let t;0!=(t=e[(16256&r)+(n>>7)]>>>C)&&(s[h]=t),h++,n+=E,r+=g}}};static aS=(t,i,s,h,e)=>{if(this.Ev&&(i>this.gv&&(i=this.gv),t<0&&(t=0)),t>=i)return;h+=t;let n=i-t>>2;if(0===this.alpha)for(;;){if(n--,n<0)for(n=i-t&3;;){if(n--,n<0)return;s[h++]=e}s[h++]=e,s[h++]=e,s[h++]=e,s[h++]=e}const r=this.alpha,o=256-this.alpha;for(e=((16711935&e)*o>>8&16711935)+((65280&e)*o>>8&65280);;){if(n--,n<0)for(n=i-t&3;;){if(n--,n<0)return;s[h++]=e+((16711935&s[h])*r>>8&16711935)+((65280&s[h])*r>>8&65280)}s[h++]=e+((16711935&s[h])*r>>8&16711935)+((65280&s[h])*r>>8&65280),s[h++]=e+((16711935&s[h])*r>>8&16711935)+((65280&s[h])*r>>8&65280),s[h++]=e+((16711935&s[h])*r>>8&16711935)+((65280&s[h])*r>>8&65280),s[h++]=e+((16711935&s[h])*r>>8&16711935)+((65280&s[h])*r>>8&65280)}};static f_=t=>{this.QR[t]&&this.JR&&(this.JR[this.tS++]=this.QR[t],this.QR[t]=null)};static cS=t=>{if(this.a_[t]=this.Vf++,this.QR[t])return this.QR[t];let i;if(this.tS>0&&this.JR)i=this.JR[--this.tS],this.JR[this.tS]=null;else{let t=0,s=-1;for(let i=0;i>>3)&16316671,i[e+8192]=n-(n>>>2)&16316671,i[e+12288]=n-(n>>>2)-(n>>>3)&16316671}}else{if(64===s.width)for(let t=0;t<128;t++)for(let e=0;e<128;e++)i[e+(t<<7)]=h[s.nc[(e>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)i[t]=h[s.nc[t]];this.hS[t]=!1;for(let s=0;s<16384;s++){i[s]&=16316671;const h=i[s];0===h&&(this.hS[t]=!0),i[s+16384]=h-(h>>>3)&16316671,i[s+32768]=h-(h>>>2)&16316671,i[s+49152]=h-(h>>>2)-(h>>>3)&16316671}}return i}}},880:(t,i,s)=>{s.d(i,{r:()=>e});var h=s(7854);const e=async t=>{255!==t[0]&&(t[0]=255),URL.revokeObjectURL(h.NR.src),h.NR.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>h.NR.onload=()=>t())),h.DR.clearRect(0,0,h.PR.width,h.PR.height);const i=h.NR.naturalWidth,s=h.NR.naturalHeight;return h.PR.width=i,h.PR.height=s,h.DR.drawImage(h.NR,0,0),h.DR.getImageData(0,0,i,s)}},8665:(t,i,s)=>{s.d(i,{A:()=>f});var h=s(1069),e=s(8950),n=s(4583),r=s(6730),o=s(4474),l=s(3867);class a{Bg=0;Gb=0;uS=0;dS=-1;wS=-1;AS=-1;yS=-1;pS=-1;mS=-1;IS=-1;_S=-1;ES=-1;gS=0;CS=-1;TS=-1;OS=-1;data=null}class c{x=0;y=0;z=0;w=0}class f extends o.A{static metadata=null;static head=null;static bS=null;static vS=null;static LS=null;static RS=null;static SS=null;static MS=null;static kS=null;static xS=null;static DS=null;static NS=null;static PS=null;static FS=null;static axis=null;static US=new l.ds(4096,!1);static BS=new l.ds(4096,!1);static GS=new Int32Array(4096);static HS=new Int32Array(4096);static WS=new Int32Array(4096);static YS=new Int32Array(4096);static VS=new Int32Array(4096);static KS=new Int32Array(4096);static XS=new Int32Array(1500);static zS=new l.Kn(1500,512);static jS=new Int32Array(12);static ZS=new l.Kn(12,2e3);static qS=new Int32Array(2e3);static $S=new Int32Array(2e3);static JS=new Int32Array(12);static QS=new Int32Array(10);static tM=new Int32Array(10);static iM=new Int32Array(10);static _n=0;static sM=0;static En=0;static Kf=!1;static xl=0;static Dl=0;static Xf=0;static dm=new Int32Array(1e3);static hM=!1;static ec(t){try{f.head=new h.A(t.read('ob_head.dat')),f.bS=new h.A(t.read('ob_face1.dat')),f.vS=new h.A(t.read('ob_face2.dat')),f.LS=new h.A(t.read('ob_face3.dat')),f.RS=new h.A(t.read('ob_face4.dat')),f.SS=new h.A(t.read('ob_face5.dat')),f.MS=new h.A(t.read('ob_point1.dat')),f.kS=new h.A(t.read('ob_point2.dat')),f.xS=new h.A(t.read('ob_point3.dat')),f.DS=new h.A(t.read('ob_point4.dat')),f.NS=new h.A(t.read('ob_point5.dat')),f.PS=new h.A(t.read('ob_vertex1.dat')),f.FS=new h.A(t.read('ob_vertex2.dat')),f.axis=new h.A(t.read('ob_axis.dat')),f.head.Fc=0,f.MS.Fc=0,f.kS.Fc=0,f.xS.Fc=0,f.DS.Fc=0,f.PS.Fc=0,f.FS.Fc=0;const i=f.head.KA;f.metadata=new l.ds(i+100,null);let s=0,e=0,n=0,r=0,o=0,c=0,u=0;for(let t=0;t>7)<2?i=2:i>126&&(i=126),(65408&t)+i):(i<0?i=0:i>127&&(i=127),127-i)}static Ug=(t,i,s)=>{const h=t.Bg,e=t.Gb,n=t.uS;let r,o,a,u,d;if(i){r=new Int32Array(h);for(let i=0;i{const e=t.Bg,n=t.Gb,r=t.uS;let o,l,a,c,u;if(h)o=t.Gg,l=t.Wg,a=t.Hg;else{o=new Int32Array(e),l=new Int32Array(e),a=new Int32Array(e);for(let i=0;i{const s=t.Bg,h=t.Gb,e=t.uS,n=new Int32Array(s),r=new Int32Array(s),o=new Int32Array(s);for(let i=0;i{let s=!1,h=!1,e=!1,n=!1,r=0,o=0,l=0,a=-1;for(let c=0;c{let s=!1,h=!1,e=!1,n=!1,r=0,o=0,l=0,a=-1;for(let c=0;c{let o=-1;const l=t.Gg[i],a=t.Wg[i],c=t.Hg[i];for(let t=0;t{if(!f.metadata)throw new Error('cant loading model metadata!!!!!');const i=f.metadata[t];if(!i)throw console.log(`Error model:${t} not found!`),new Error('cant loading model metadata!!!!!');if(!(f.head&&f.bS&&f.vS&&f.LS&&f.RS&&f.SS&&f.MS&&f.kS&&f.xS&&f.DS&&f.NS&&f.PS&&f.FS&&f.axis))throw new Error('cant loading model!!!!!');const s=i.Bg,h=i.Gb,e=i.uS,n=new Int32Array(s),r=new Int32Array(s),o=new Int32Array(s),l=new Int32Array(h),a=new Int32Array(h),c=new Int32Array(h),u=new Int32Array(e),d=new Int32Array(e),w=new Int32Array(e);let A=null;i.pS>=0&&(A=new Int32Array(s));let y=null;i.ES>=0&&(y=new Int32Array(h));let p=null,m=0;i.gS>=0?p=new Int32Array(h):m=-i.gS-1;let I=null;i.CS>=0&&(I=new Int32Array(h));let _=null;i.TS>=0&&(_=new Int32Array(h));const E=new Int32Array(h);f.MS.Fc=i.dS,f.kS.Fc=i.wS,f.xS.Fc=i.AS,f.DS.Fc=i.yS,f.NS.Fc=i.pS;let g,C,T,O=0,b=0,v=0;for(let t=0;t{if(!f.metadata||!f.metadata[i])throw new Error('No model metadata');const s=f.metadata[i];if(s.data=t,!s.data.length)throw new Error('No model data');const e=s.Bg,n=s.Gb,r=s.uS,o=new Int32Array(e),l=new Int32Array(e),a=new Int32Array(e),c=new Int32Array(n),u=new Int32Array(n),d=new Int32Array(n),w=new Int32Array(r),A=new Int32Array(r),y=new Int32Array(r);let p=null;s.pS>=0&&(p=new Int32Array(e));let m=null;s.ES>=0&&(m=new Int32Array(n));let I=null,_=0;s.gS>=0?I=new Int32Array(n):_=-s.gS-1;let E=null;s.CS>=0&&(E=new Int32Array(n));let g=null;s.TS>=0&&(g=new Int32Array(n));const C=new Int32Array(n),T=new h.A(s.data);T.Fc=s.dS;const O=new h.A(s.data);O.Fc=s.wS;const b=new h.A(s.data);b.Fc=s.AS;const v=new h.A(s.data);v.Fc=s.yS;const L=new h.A(s.data);L.Fc=s.pS;let R,S,M,k=0,x=0,D=0;for(let t=0;tthis.Zg&&(this.Zg=-s),s>this.Db&&(this.Db=s);const e=i*i+h*h;e>this.rO&&(this.rO=e)}this.rO=Math.sqrt(this.rO)+.99|0,this.AM=Math.sqrt(this.rO*this.rO+this.Zg*this.Zg)+.99|0,this.wM=this.AM+(Math.sqrt(this.rO*this.rO+this.Db*this.Db)+.99|0)}Yg(){this.Zg=0,this.Db=0;for(let t=0;tthis.Zg&&(this.Zg=-i),i>this.Db&&(this.Db=i)}this.AM=Math.sqrt(this.rO*this.rO+this.Zg*this.Zg)+.99|0,this.wM=this.AM+(Math.sqrt(this.rO*this.rO+this.Db*this.Db)+.99|0)}Ma(){if(this.yM){const t=new Int32Array(256);let i=0;for(let s=0;si&&(i=h)}this.Xg=new l.ds(i+1,null);for(let s=0;s<=i;s++)this.Xg[s]=new Int32Array(t[s]),t[s]=0;let s=0;for(;si&&(i=h)}this.Kg=new l.ds(i+1,null);for(let s=0;s<=i;s++)this.Kg[s]=new Int32Array(t[s]),t[s]=0;let s=0;for(;sl;)l=s[o++];n&&n.types&&h.x&&h.y&&h.z&&n.labels&&(i!==l||0===n.types[i])&&this.EM(h.x[t],h.y[t],h.z[t],n.labels[i],n.types[i])}f._n=0,f.sM=0,f.En=0,o=0,l=s[o++];for(let t=0;tl;)l=s[o++];n&&n.types&&e.x&&e.y&&e.z&&n.labels&&(i===l||0===n.types[i])&&this.EM(e.x[t],e.y[t],e.z[t],n.labels[i],n.types[i])}}else this.ka(t)}ka(t){if(!this.Xg||-1===t||!r.A.Ro[t])return;const i=r.A.Ro[t],s=i.MR;f._n=0,f.sM=0,f.En=0;for(let t=0;t>16;this.Hg[t]=this.Wg[t]*i+this.Hg[t]*s>>16,this.Wg[t]=h}}translate(t,i,s){for(let h=0;h>8;if(this.rM&&this.oM&&this.lM||(this.rM=new Int32Array(this.Gb),this.oM=new Int32Array(this.Gb),this.lM=new Int32Array(this.Gb)),!this.bb){this.bb=new l.ds(this.Bg,null);for(let t=0;t8192||p>8192||m>8192||y<-8192||p<-8192||m<-8192;)y>>=1,p>>=1,m>>=1;let I=0|Math.sqrt(y*y+p*p+m*m);if(I<=0&&(I=1),y=256*y/I|0,p=256*p/I|0,m=256*m/I|0,this.Bb&&1&this.Bb[i]){const n=t+((s*y+h*p+e*m)/(r+(r/2|0))|0);this.ZE&&(this.rM[i]=f.nM(this.ZE[i],n,this.Bb[i]))}else{let t=this.bb[n];t&&(t.x+=y,t.y+=p,t.z+=m,t.w++),t=this.bb[o],t&&(t.x+=y,t.y+=p,t.z+=m,t.w++),t=this.bb[l],t&&(t.x+=y,t.y+=p,t.z+=m,t.w++)}}if(n)this.Rb(t,r,s,h,e);else{this.xb=new l.ds(this.Bg,null);for(let t=0;t>16;for(let h=0;h>16,_=_*w-I*d>>16,I=m),0!==t&&(m=_*a-E*l>>16,E=_*l+E*a>>16,_=m),0!==i&&(m=E*c+I*u>>16,E=E*u-I*c>>16,I=m),I+=e,_+=r,E+=o,m=_*y-E*A>>16,E=_*A+E*y>>16,_=m,f.GS&&f.HS&&f.WS&&(f.WS[h]=E-p,f.GS[h]=n.A.na+((I<<9)/E|0),f.HS[h]=n.A.ra+((_<<9)/E|0)),this.uS>0&&f.YS&&f.VS&&f.KS&&(f.YS[h]=I,f.VS[h]=_,f.KS[h]=E)}try{this.CM(!1,!1,0)}catch(t){}}draw(t,i,s,h,r,o,l,a,c){const u=a*r-o*h>>16,d=l*i+u*s>>16,w=this.rO*s>>16,A=d+w;if(A<=50||d>=3500)return;const y=a*h+o*r>>16;let p=y-this.rO<<9;if((p/A|0)>=e.A.VR)return;let m=y+this.rO<<9;if((m/A|0)<=-e.A.VR)return;const I=l*s-u*i>>16,_=this.rO*i>>16;let E=I+_<<9;if((E/A|0)<=-e.A.KR)return;let g=I-(_+(this.Zg*s>>16))<<9;if((g/A|0)>=e.A.KR)return;let C=d-(w+(this.Zg*i>>16))<=50,T=!1;if(c>0&&f.Kf){let t=d-w;t<=50&&(t=50),y>0?(p=p/A|0,m=m/t|0):(m=m/A|0,p=p/t|0),I>0?(g=g/A|0,E=E/t|0):(E=E/A|0,g=g/t|0);const i=f.xl-n.A.na,s=f.Dl-n.A.ra;i>p&&ig&&s>16,w=w*L-c*v>>16,c=n),c+=o,u+=l,w+=a,n=w*h+c*r>>16,w=w*r-c*h>>16,c=n,n=u*s-w*i>>16,w=u*i+w*s>>16,u=n,f.WS&&(f.WS[e]=w-d),w>=50&&f.GS&&f.HS?(f.GS[e]=O+((c<<9)/w|0),f.HS[e]=b+((u<<9)/w|0)):f.GS&&(f.GS[e]=-5e3,C=!0),(C||this.uS>0)&&f.YS&&f.VS&&f.KS&&(f.YS[e]=c,f.VS[e]=u,f.KS[e]=w)}try{this.CM(C,T,c)}catch(t){}}CM(t,i,s,h=!1){f.hM&&(this.IM=-1,this._M=-1);for(let t=0;te.A.gv||a>e.A.gv||c>e.A.gv),f.zS&&f.XS){const t=((A+y+p)/3|0)+this.AM;f.zS[t][f.XS[t]++]=h,f.hM&&this.TM(f.xl,f.Dl,u,d,w,l,a,c)&&this._M=0;t--){const i=f.XS[t];if(!(i<=0)&&f.zS){const s=f.zS[t];for(let t=0;t=0;t--){const i=f.XS[t];if(i>0&&f.zS){const s=f.zS[t];for(let h=0;h0||f.jS[2]>0)&&(n=(f.JS[1]+f.JS[2])/(f.jS[1]+f.jS[2])|0);let r=0;f.jS&&f.JS&&(f.jS[3]>0||f.jS[4]>0)&&(r=(f.JS[3]+f.JS[4])/(f.jS[3]+f.jS[4])|0);let o=0;if(f.jS&&f.JS&&(f.jS[6]>0||f.jS[8]>0)&&(o=(f.JS[6]+f.JS[8])/(f.jS[6]+f.jS[8])|0),f.jS&&f.ZS){let t,i=0,s=f.jS[10],e=f.ZS[10],l=f.qS;i===s&&(i=0,s=f.jS[11],e=f.ZS[11],l=f.$S),t=in;)this.OM(e[i++],h),i===s&&e!==f.ZS[11]&&(i=0,s=f.jS[11],e=f.ZS[11],l=f.$S),t=ir;)this.OM(e[i++],h),i===s&&e!==f.ZS[11]&&(i=0,s=f.jS[11],e=f.ZS[11],l=f.$S),t=io;)this.OM(e[i++],h),i===s&&e!==f.ZS[11]&&(i=0,s=f.jS[11],e=f.ZS[11],l=f.$S),t=i>2,r=this.fM[i],o=this.uM[i],l=this.dM[i];n.A.Sv(f.GS[s],f.GS[h],f.GS[e],f.HS[s],f.HS[h],f.HS[e],this.rM[t],this.oM[t],this.lM[t],f.YS[r],f.VS[r],f.KS[r],f.YS[o],f.YS[l],f.VS[o],f.VS[l],f.KS[o],f.KS[l],this.ZE[t])}else if(3===r&&this.Bb&&this.ZE&&this.rM&&f.GS&&f.HS&&f.YS&&f.VS&&f.KS){const i=this.Bb[t]>>2,r=this.fM[i],o=this.uM[i],l=this.dM[i];n.A.Sv(f.GS[s],f.GS[h],f.GS[e],f.HS[s],f.HS[h],f.HS[e],this.rM[t],this.rM[t],this.rM[t],f.YS[r],f.VS[r],f.KS[r],f.YS[o],f.YS[l],f.VS[o],f.VS[l],f.KS[o],f.KS[l],this.ZE[t])}}bM(t,i=!1){let s=0;if(f.KS){const i=n.A.na,h=n.A.ra,e=this.Hb[t],r=this.Wb[t],o=this.Yb[t],l=f.KS[e],a=f.KS[r],c=f.KS[o];if(l>=50&&f.GS&&f.HS&&this.rM)f.QS[s]=f.GS[e],f.tM[s]=f.HS[e],f.iM[s++]=this.rM[t];else if(f.YS&&f.VS&&this.rM){const u=f.YS[e],d=f.VS[e],w=this.rM[t];if(c>=50&&this.lM){const e=(50-l)*n.A.qR[c-l];f.QS[s]=i+((u+((f.YS[o]-u)*e>>16)<<9)/50|0),f.tM[s]=h+((d+((f.VS[o]-d)*e>>16)<<9)/50|0),f.iM[s++]=w+((this.lM[t]-w)*e>>16)}if(a>=50&&this.oM){const e=(50-l)*n.A.qR[a-l];f.QS[s]=i+((u+((f.YS[r]-u)*e>>16)<<9)/50|0),f.tM[s]=h+((d+((f.VS[r]-d)*e>>16)<<9)/50|0),f.iM[s++]=w+((this.oM[t]-w)*e>>16)}}if(a>=50&&f.GS&&f.HS&&this.oM)f.QS[s]=f.GS[r],f.tM[s]=f.HS[r],f.iM[s++]=this.oM[t];else if(f.YS&&f.VS&&this.oM){const u=f.YS[r],d=f.VS[r],w=this.oM[t];if(l>=50&&this.rM){const r=(50-a)*n.A.qR[l-a];f.QS[s]=i+((u+((f.YS[e]-u)*r>>16)<<9)/50|0),f.tM[s]=h+((d+((f.VS[e]-d)*r>>16)<<9)/50|0),f.iM[s++]=w+((this.rM[t]-w)*r>>16)}if(c>=50&&this.lM){const e=(50-a)*n.A.qR[c-a];f.QS[s]=i+((u+((f.YS[o]-u)*e>>16)<<9)/50|0),f.tM[s]=h+((d+((f.VS[o]-d)*e>>16)<<9)/50|0),f.iM[s++]=w+((this.lM[t]-w)*e>>16)}}if(c>=50&&f.GS&&f.HS&&this.lM)f.QS[s]=f.GS[o],f.tM[s]=f.HS[o],f.iM[s++]=this.lM[t];else if(f.YS&&f.VS&&this.lM){const u=f.YS[o],d=f.VS[o],w=this.lM[t];if(a>=50&&this.oM){const e=(50-c)*n.A.qR[a-c];f.QS[s]=i+((u+((f.YS[r]-u)*e>>16)<<9)/50|0),f.tM[s]=h+((d+((f.VS[r]-d)*e>>16)<<9)/50|0),f.iM[s++]=w+((this.oM[t]-w)*e>>16)}if(l>=50&&this.rM){const r=(50-c)*n.A.qR[l-c];f.QS[s]=i+((u+((f.YS[e]-u)*r>>16)<<9)/50|0),f.tM[s]=h+((d+((f.VS[e]-d)*r>>16)<<9)/50|0),f.iM[s++]=w+((this.rM[t]-w)*r>>16)}}}const h=f.QS[0],r=f.QS[1],o=f.QS[2],l=f.tM[0],a=f.tM[1],c=f.tM[2];if(!((h-r)*(c-a)-(l-a)*(o-r)<=0))if(n.A.Ev=!1,3===s){let s;if((h<0||r<0||o<0||h>e.A.gv||r>e.A.gv||o>e.A.gv)&&(n.A.Ev=!0),s=this.Bb?3&this.Bb[t]:0,i)n.A.Zu(h,r,l,a,f.iM[0]),n.A.Zu(r,o,a,c,f.iM[1]),n.A.Zu(o,h,c,l,f.iM[2]);else if(0===s)n.A.bv(h,r,o,l,a,c,f.iM[0],f.iM[1],f.iM[2]);else if(1===s&&this.rM)n.A.lS(h,r,o,l,a,c,n.A.palette[this.rM[t]]);else if(2===s&&this.Bb&&this.ZE&&f.YS&&f.VS&&f.KS){const i=this.Bb[t]>>2,s=this.fM[i],e=this.uM[i],u=this.dM[i];n.A.Sv(h,r,o,l,a,c,f.iM[0],f.iM[1],f.iM[2],f.YS[s],f.VS[s],f.KS[s],f.YS[e],f.YS[u],f.VS[e],f.VS[u],f.KS[e],f.KS[u],this.ZE[t])}else if(3===s&&this.Bb&&this.ZE&&this.rM&&f.YS&&f.VS&&f.KS){const i=this.Bb[t]>>2,s=this.fM[i],e=this.uM[i],u=this.dM[i];n.A.Sv(h,r,o,l,a,c,this.rM[t],this.rM[t],this.rM[t],f.YS[s],f.VS[s],f.KS[s],f.YS[e],f.YS[u],f.VS[e],f.VS[u],f.KS[e],f.KS[u],this.ZE[t])}}else if(4===s){let s;if((h<0||r<0||o<0||h>e.A.gv||r>e.A.gv||o>e.A.gv||f.QS[3]<0||f.QS[3]>e.A.gv)&&(n.A.Ev=!0),s=this.Bb?3&this.Bb[t]:0,i)n.A.Zu(h,r,l,a,f.iM[0]),n.A.Zu(r,o,a,c,f.iM[1]),n.A.Zu(o,f.QS[3],c,f.tM[3],f.iM[2]),n.A.Zu(f.QS[3],h,f.tM[3],l,f.iM[3]);else if(0===s)n.A.bv(h,r,o,l,a,c,f.iM[0],f.iM[1],f.iM[2]),n.A.bv(h,o,f.QS[3],l,c,f.tM[3],f.iM[0],f.iM[2],f.iM[3]);else if(1===s){if(this.rM){const i=n.A.palette[this.rM[t]];n.A.lS(h,r,o,l,a,c,i),n.A.lS(h,o,f.QS[3],l,c,f.tM[3],i)}}else if(2===s&&this.Bb&&this.ZE&&f.YS&&f.VS&&f.KS){const i=this.Bb[t]>>2,s=this.fM[i],e=this.uM[i],u=this.dM[i];n.A.Sv(h,r,o,l,a,c,f.iM[0],f.iM[1],f.iM[2],f.YS[s],f.VS[s],f.KS[s],f.YS[e],f.YS[u],f.VS[e],f.VS[u],f.KS[e],f.KS[u],this.ZE[t]),n.A.Sv(h,o,f.QS[3],l,c,f.tM[3],f.iM[0],f.iM[2],f.iM[3],f.YS[s],f.VS[s],f.KS[s],f.YS[e],f.YS[u],f.VS[e],f.VS[u],f.KS[e],f.KS[u],this.ZE[t])}else if(3===s&&this.Bb&&this.ZE&&this.rM&&f.YS&&f.VS&&f.KS){const i=this.Bb[t]>>2,s=this.fM[i],e=this.uM[i],u=this.dM[i];n.A.Sv(h,r,o,l,a,c,this.rM[t],this.rM[t],this.rM[t],f.YS[s],f.VS[s],f.KS[s],f.YS[e],f.YS[u],f.VS[e],f.VS[u],f.KS[e],f.KS[u],this.ZE[t]),n.A.Sv(h,o,f.QS[3],l,c,f.tM[3],this.rM[t],this.rM[t],this.rM[t],f.YS[s],f.VS[s],f.KS[s],f.YS[e],f.YS[u],f.VS[e],f.VS[u],f.KS[e],f.KS[u],this.ZE[t])}}}EM(t,i,s,h,e){if(!h)return;const r=h.length;if(0===e){let e=0;f._n=0,f.sM=0,f.En=0;for(let t=0;t0?(f._n=(f._n/e|0)+t,f.sM=(f.sM/e|0)+i,f.En=(f.En/e|0)+s):(f._n=t,f.sM=i,f.En=s)}else if(1===e)for(let e=0;e=this.Xg.length)continue;const r=this.Xg[n];if(r)for(let h=0;h=this.Xg.length)continue;const o=this.Xg[r];if(o)for(let h=0;h>16;this.Wg[e]=this.Wg[e]*u-this.Gg[e]*c>>16,this.Gg[e]=t}if(0!==r){c=n.A.sin[r],u=n.A.cos[r];const t=this.Wg[e]*u-this.Hg[e]*c>>16;this.Hg[e]=this.Wg[e]*c+this.Hg[e]*u>>16,this.Wg[e]=t}if(0!==l){c=n.A.sin[l],u=n.A.cos[l];const t=this.Hg[e]*c+this.Gg[e]*u>>16;this.Hg[e]=this.Hg[e]*u-this.Gg[e]*c>>16,this.Gg[e]=t}this.Gg[e]+=f._n,this.Wg[e]+=f.sM,this.Hg[e]+=f.En}}else if(3===e)for(let e=0;e=this.Xg.length)continue;const r=this.Xg[n];if(r)for(let h=0;h=this.Kg.length)continue;const e=this.Kg[s];if(e)for(let i=0;i255&&(this.cM[s]=255)}}}gM(){this.Zg=0,this.rO=0,this.Db=0,this.Nb=999999,this.Pb=-999999,this.Ub=-99999,this.Fb=99999;for(let t=0;tthis.Pb&&(this.Pb=i),hthis.Ub&&(this.Ub=h),-s>this.Zg&&(this.Zg=-s),s>this.Db&&(this.Db=s);const e=i*i+h*h;e>this.rO&&(this.rO=e)}this.rO=0|Math.sqrt(this.rO),this.AM=0|Math.sqrt(this.rO*this.rO+this.Zg*this.Zg),this.wM=this.AM+(0|Math.sqrt(this.rO*this.rO+this.Db*this.Db))}TM(t,i,s,h,e,n,r,o){return!(is&&i>h&&i>e)&&(!(t{s.d(i,{A:()=>o});var h=s(8950),e=s(1069),n=s(4474),r=s(880);class o extends n.A{nc;width;height;Cc;Tc;Pl;fd;constructor(t,i){super(),this.nc=new Int32Array(t*i),this.width=this.Pl=t,this.height=this.fd=i,this.Cc=this.Tc=0}static Ec=async(t,i)=>{const s=t.read(i+'.dat');if(!s)throw new Error(`${i} jpeg not found!`);const h=await(0,r.r)(s),e=new o(h.width,h.height),n=new Uint32Array(h.data.buffer),l=e.nc;for(let t=0;t>24&255)<<24|(255&i)<<16|(i>>8&255)<<8|i>>16&255}return e};static za=(t,i,s=0)=>{const h=new e.A(t.read(i+'.dat')),n=new e.A(t.read('index.dat'));n.Fc=h.KA;const r=n.KA,l=n.KA,a=[],c=n.ZA-1;for(let t=0;th.length||n.Fc>n.length)throw new Error;const f=n.ZA,u=n.ZA,d=n.KA,w=n.KA,A=new o(d,w);A.Cc=f,A.Tc=u,A.Pl=r,A.fd=l;const y=n.ZA;if(0===y){const t=A.width*A.height;for(let i=0;ih.A.bottom&&(n-=i+n-h.A.bottom),th.A.right){const i=t+r-h.A.right;r-=i,l+=i,o+=i}r>0&&n>0&&this.LM(r,n,this.nc,e,l,h.A.nc,s,o)}Nl(t,i,s){i|=0,s|=0;let e=(i+=this.Cc)+(s+=this.Tc)*h.A.lC,n=0,r=this.height,o=this.width,l=h.A.lC-o,a=0;if(sh.A.bottom&&(r-=s+r-h.A.bottom),ih.A.right){const t=i+o-h.A.right;o-=t,a+=t,l+=t}o>0&&r>0&&this.RM(o,r,this.nc,n,a,h.A.nc,e,l,t)}tc(t,i){t|=0,i|=0;let s=(t+=this.Cc)+(i+=this.Tc)*h.A.lC,e=0,n=this.height,r=this.width,o=h.A.lC-r,l=0;if(ih.A.bottom&&(n-=i+n-h.A.bottom),th.A.right){const i=t+r-h.A.right;r-=i,l+=i,o+=i}r>0&&n>0&&this.SM(r,n,this.nc,e,l,h.A.nc,s,o)}Ja(){const t=this.nc,i=this.width,s=this.height;for(let h=0;h>16&255;n+=t,n<1?n=1:n>255&&(n=255);let r=e>>8&255;r+=i,r<1?r=1:r>255&&(r=255);let o=255&e;o+=s,o<1?o=1:o>255&&(o=255),this.nc[h]=(n<<16)+(r<<8)+o}}}AC(t,i,s,e){t|=0,i|=0,s|=0,e|=0;try{const n=this.width;let r=0,o=0;const l=this.Pl,a=this.fd,c=(l<<16)/s|0,f=(a<<16)/e|0;t+=(this.Cc*s+l-1)/l|0,i+=(this.Tc*e+a-1)/a|0,this.Cc*s%l!=0&&(r=(l-this.Cc*s%l<<16)/s|0),this.Tc*e%a!=0&&(o=(a-this.Tc*e%a<<16)/e|0),s=s*(this.width-(r>>16))/l|0,e=e*(this.height-(o>>16))/a|0;let u=t+i*h.A.lC,d=h.A.lC-s;if(ih.A.bottom&&(e-=i+e-h.A.bottom),th.A.right){const i=t+s-h.A.right;s-=i,d+=i}this.scale(s,e,this.nc,r,o,h.A.nc,d,u,n,c,f)}catch(t){console.error('error in sprite clipping routine')}}nd(t,i,s,e,n,r,o,l,a,c){t|=0,i|=0,s|=0,e|=0;try{const f=-s/2|0,u=-e/2|0,d=65536*Math.sin(a/326.11)|0,w=65536*Math.cos(a/326.11)|0,A=d*c>>8,y=w*c>>8;let p=(o<<16)+u*A+f*y,m=u*y-f*A+(l<<16),I=t+i*h.A.lC;for(let t=0;t>16)+(o>>16)*this.width],e+=y,o-=A;p+=A,m+=y,I+=h.A.lC}}catch(t){}}ad(t,i,s){t|=0,i|=0;let e=(t+=this.Cc)+(i+=this.Tc)*h.A.lC,n=0,r=this.height,o=this.width,l=h.A.lC-o,a=0;if(ih.A.bottom&&(r-=i+r-h.A.bottom),th.A.right){const i=t+o-h.A.right;o-=i,a+=i,l+=i}o>0&&r>0&&this.MM(o,r,this.nc,a,n,h.A.nc,e,l,s.nc)}scale(t,i,s,h,e,n,r,o,l,a,c){try{const f=h;for(let u=-i;u<0;u++){const i=(e>>16)*l;for(let e=-t;e<0;e++){const t=s[(h>>16)+i];0===t?o++:n[o++]=t,h+=a}e+=c,h=f,o+=r}}catch(t){console.error('error in plot_scale')}}SM(t,i,s,h,e,n,r,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++)n[r++]=s[h++],n[r++]=s[h++],n[r++]=s[h++],n[r++]=s[h++];for(let i=t;i<0;i++)n[r++]=s[h++];r+=o,h+=e}}RM(t,i,s,h,e,n,r,o,l){const a=256-l;for(let c=-i;c<0;c++){for(let i=-t;i<0;i++){const t=s[h++];if(0===t)r++;else{const i=n[r];n[r++]=((16711935&t)*l+(16711935&i)*a&4278255360)+((65280&t)*l+(65280&i)*a&16711680)>>8}}r+=o,h+=e}}LM(t,i,s,h,e,n,r,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=s[h++];0===t?r++:n[r++]=t,t=s[h++],0===t?r++:n[r++]=t,t=s[h++],0===t?r++:n[r++]=t,t=s[h++],0===t?r++:n[r++]=t}for(let i=t;i<0;i++){const t=s[h++];0===t?r++:n[r++]=t}r+=o,h+=e}}MM(t,i,s,h,e,n,r,o,l){const a=-(t>>2);t=-(3&t);for(let c=-i;c<0;c++){for(let t=a;t<0;t++){let t=s[e++];0!==t&&0===l[r]?n[r++]=t:r++,t=s[e++],0!==t&&0===l[r]?n[r++]=t:r++,t=s[e++],0!==t&&0===l[r]?n[r++]=t:r++,t=s[e++],0!==t&&0===l[r]?n[r++]=t:r++}for(let i=t;i<0;i++){const t=s[e++];0!==t&&0===l[r]?n[r++]=t:r++}r+=o,e+=h}}}},1673:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(8950),e=s(1069),n=s(4474);class r extends n.A{nc;width;height;Cc;Tc;Pl;fd;palette;constructor(t,i,s){super(),this.nc=new Int8Array(t*i),this.width=this.Pl=t,this.height=this.fd=i,this.Cc=this.Tc=0,this.palette=s}static za=(t,i,s=0)=>{const h=new e.A(t.read(i+'.dat')),n=new e.A(t.read('index.dat'));n.Fc=h.KA;const o=n.KA,l=n.KA,a=n.ZA,c=new Int32Array(a);for(let t=1;th.length||n.Fc>n.length)throw new Error;const f=n.ZA,u=n.ZA,d=n.KA,w=n.KA,A=new r(d,w,c);A.Cc=f,A.Tc=u,A.Pl=o,A.fd=l;const y=A.nc,p=n.ZA;if(0===p){const t=A.width*A.height;for(let i=0;ih.A.bottom&&(n-=i+n-h.A.bottom),th.A.right){const i=t+r-h.A.right;r-=i,l+=i,o+=i}r>0&&n>0&&this.kM(r,n,this.nc,e,l,h.A.nc,s,o)}Ja(){const t=this.nc,i=this.width,s=this.height;for(let h=0;h>16&255;e+=t,e<0?e=0:e>255&&(e=255);let n=this.palette[h]>>8&255;n+=i,n<0?n=0:n>255&&(n=255);let r=255&this.palette[h];r+=s,r<0?r=0:r>255&&(r=255),this.palette[h]=(e<<16)+(n<<8)+r}}nS(){this.Pl|=0,this.fd|=0,this.Pl/=2,this.fd/=2,this.Pl|=0,this.fd|=0;const t=new Int8Array(this.Pl*this.fd);let i=0;for(let s=0;s>1)+(s+this.Tc>>1)*this.Pl]=this.nc[i++];this.nc=t,this.width=this.Pl,this.height=this.fd,this.Cc=0,this.Tc=0}AC(){if(this.width===this.Pl&&this.height===this.fd)return;const t=new Int8Array(this.Pl*this.fd);let i=0;for(let s=0;s>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=s[h++];0===t?r++:n[r++]=this.palette[255&t],t=s[h++],0===t?r++:n[r++]=this.palette[255&t],t=s[h++],0===t?r++:n[r++]=this.palette[255&t],t=s[h++],0===t?r++:n[r++]=this.palette[255&t]}for(let i=t;i<0;i++){const t=s[h++];0===t?r++:n[r++]=this.palette[255&t]}r+=o,h+=e}}clip(t,i,s,e){try{const n=this.width;this.height;let r=0,o=0;const l=this.Pl,a=this.fd,c=(l<<16)/s|0,f=(a<<16)/e|0;t=t+(this.Cc*s+l-1)/l|0,i=i+(this.Tc*e+a-1)/a|0,this.Cc*s%l!=0&&(r=(l-this.Cc*s%l<<16)/s|0),this.Tc*e%a!=0&&(o=(a-this.Tc*e%a<<16)/e|0),s=s*(this.width-(r>>16))/l|0,e=e*(this.height-(o>>16))/a|0;let u,d=t+i*h.A.lC,w=h.A.lC-s;ih.A.bottom&&(e-=i+e-h.A.bottom),th.A.right&&(u=t+s-h.A.right,s-=u,w+=u),this.xM(h.A.nc,this.nc,this.palette,r,o,d,w,s,e,c,f,n)}catch(t){console.log('error in sprite clipping routine')}}xM(t,i,s,h,e,n,r,o,l,a,c,f){try{const u=h;for(let d=-l;d<0;d++){const l=(e>>16)*f;for(let e=-o;e<0;e++){const e=i[(h>>16)+l];0==e?n++:t[n++]=s[255&e],h+=a}e+=c,h=u,n+=r}}catch(t){console.log('error in plot_scale')}}}},2682:(t,i,s)=>{s.d(i,{A:()=>l});var h=s(8950),e=s(1069),n=s(4474);class r{seed;constructor(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}DM(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}YA(){return this.next(32)}next(t){return this.seed=0x5deece66dn*this.seed+0xbn&(1n<<48n)-1n,Number(this.seed)>>>48-t}}var o=s(9298);class l extends n.A{static xc='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!"£$%^&*()-_=+[{]};:\'@#~,<.>/?\\| ';static NM=[];static{const t=navigator.userAgent.includes('Capacitor');for(let i=0;i<256;i++){let s=l.xc.indexOf(String.fromCharCode(i));t&&s>=63&&s--,-1===s&&(s=74),l.NM[i]=s}}PM=[];FM=new Int32Array(94);UM=new Int32Array(94);BM=new Int32Array(94);GM=new Int32Array(94);HM=new Int32Array(95);WM=new Int32Array(256);random=new r(BigInt(Date.now()));height=0;static za=(t,i)=>{const s=new e.A(t.read(i+'.dat')),h=new e.A(t.read('index.dat'));h.Fc=s.KA+4;const n=h.ZA;n>0&&(h.Fc+=3*(n-1));const r=new l;for(let t=0;t<94;t++){r.BM[t]=h.ZA,r.GM[t]=h.ZA;const i=r.FM[t]=h.KA,e=r.UM[t]=h.KA,n=h.ZA,o=i*e;if(r.PM[t]=new Int8Array(o),0===n)for(let h=0;hr.height&&(r.height=e),r.BM[t]=1,r.HM[t]=i+2;{let s=0;for(let h=e/7|0;h=h.A.bottom&&(n-=s+n+1-h.A.bottom),i=h.A.right){const t=i+e+1-h.A.right;e-=t,a+=t,l+=t}e>0&&n>0&&this.XM(e,n,t,c,a,h.A.nc,o,l,r)}KM(t,i,s,e,n,r,o){s|=0,e|=0;let l=(t|=0)+(i|=0)*h.A.lC,a=h.A.lC-s,c=0,f=0;if(i=h.A.bottom&&(e-=i+e+1-h.A.bottom),t=h.A.right){const i=t+s+1-h.A.right;s-=i,c+=i,a+=i}s>0&&e>0&&this.zM(s,e,h.A.nc,l,a,o,f,c,n,r)}XM(t,i,s,h,e,n,r,o,l){const a=-((t|=0)>>2);t=-(3&t);for(let c=-(i|=0);c<0;c++){for(let t=a;t<0;t++)0===s[h++]?r++:n[r++]=l,0===s[h++]?r++:n[r++]=l,0===s[h++]?r++:n[r++]=l,0===s[h++]?r++:n[r++]=l;for(let i=t;i<0;i++)0===s[h++]?r++:n[r++]=l;r+=o,h+=e}}zM(t,i,s,h,e,n,r,o,l,a){t|=0;const c=((16711935&l)*a&4278255360)+((65280&l)*a&16711680)>>8,f=256-a;for(let l=-(i|=0);l<0;l++){for(let i=-t;i<0;i++)if(0===n[r++])h++;else{const t=s[h];s[h++]=(((16711935&t)*f&4278255360)+((65280&t)*f&16711680)>>8)+c}h+=e,r+=o}}VM(t){return'red'===t?o.A.RED:'gre'===t?o.A.GREEN:'blu'===t?o.A.BLUE:'yel'===t?o.A.Gl:'cya'===t?o.A.bc:'mag'===t?o.A.vc:'whi'===t?o.A._l:'bla'===t?o.A.Bl:'lre'===t?o.A.FR:'dre'===t?o.A.sd:'dbl'===t?o.A.td:'or1'===t?o.A.UR:'or2'===t?o.A.BR:'or3'===t?o.A.GR:'gr1'===t?o.A.HR:'gr2'===t?o.A.WR:'gr3'===t?o.A.YR:o.A.Bl}split(t,i){if(0===t.length)return[t];const s=[];for(;t.length>0;){if(this.au(t)<=i&&-1===t.indexOf('|')){s.push(t);break}let h=t.length;for(let s=0;si)break;h=s}else if('|'===t[s]){h=s;break}s.push(t.substring(0,h)),t=t.substring(h+1)}return s}}},1183:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(8950),e=s(7854);class n{jM;width;height;ZM;qM;nc;constructor(t,i,s=e.jo){this.ZM=s,this.jM=this.ZM.getImageData(0,0,t,i),this.qM=new Uint32Array(this.jM.data.buffer),this.nc=new Int32Array(t*i),this.width=t,this.height=i,this.bind()}clear(){this.nc.fill(0)}bind(){h.A.bind(this.nc,this.width,this.height)}draw(t,i){this.#t(),this.ZM.putImageData(this.jM,t,i)}#t(){const t=this.nc.length,i=this.nc,s=this.qM;for(let h=0;h>16&255|(t>>8&255)<<8|(255&t)<<16|4278190080}}}},3955:(t,i,s)=>{s.d(i,{A:()=>h});class h{static iy=150;static Tf=70;static bf=108;static Zc=81;static sf=189;static Mw=7;static Zd=88;static Kd=30;static Qd=176;static Hd=220;static Dw=66;static Tw=17;static lw=2;static Lw=238;static cA=233;static Gf=146;static cf=215;static Of=236;static jI=85;static pI=219;static dw=140;static pw=40;static yw=200;static ww=178;static Aw=247;static xw=138;static iw=239;static Jd=194;static jd=8;static qd=27;static $d=113;static tw=100;static fw=134;static ow=202;static hw=245;static mw=172;static Pw=96;static kw=97;static Nw=116;static uw=9;static Gd=75;static Fd=164;static aw=53;static cw=185;static Pd=206;static Vw=177;static Bw=248;static Xd=195;static zd=71;static Vd=133;static Wd=157;static Yd=211;static nw=48;static ew=130;static bw=31;static Sw=59;static Cw=212;static Rw=38;static Ow=6;static gw=155;static rw=235;static HA=231;static AA=237;static kf=175;static km=93;static eA=190;static Mm=165;static nf=159;static gA=171;static EA=79;static iA=52;static wA=244;static fA=148;static _A=11;static IA=118;static pA=4;static mA=158;static Sm=181}},3554:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(6666),e=s(1982);class n{$M;JM;QM;closed=!1;tk=!1;static Nc=async t=>await new Promise(((i,s)=>{const h=t.host.startsWith('https'),e=h?'wss':'ws',n=t.host.substring(t.host.indexOf('//')+2),r=h?t.port+2:t.port+1,o=new WebSocket(`${e}://${n}:${r}`,'binary');o.addEventListener('open',(()=>{console.log('connection open!'),i(o)})),o.addEventListener('error',(()=>{console.log('connection error!'),s(o)}))}));constructor(t){t.onclose=this.onclose,t.onerror=this.onerror,this.JM=new l(t,5e3),this.QM=new r(t,5e3),this.$M=t}get host(){return this.$M.url.split('/')[2]}get port(){return parseInt(this.$M.url.split(':')[2],10)}get available(){return this.closed?0:this.JM.available}write(t,i){this.QM.write(t,i)}async read(){return this.closed?0:this.JM.ik()??await this.JM.sk()}async Pc(t,i,s){if(!this.closed)for(;s>0;){const h=this.JM.hk(t,i,s)??await this.JM.ek(t,i,s);if(h.length<=0)throw new Error('EOF');i+=h.length,s-=h.length}}close(){this.closed=!0,this.$M.close(),this.JM.close(),this.QM.close(),console.log('connection close!'),this.tk&&console.log('connection error!')}onclose=t=>{this.closed||this.close()};onerror=t=>{this.closed||(this.tk=!0,this.close())}}class r{$M;nk;closed=!1;tk=!1;constructor(t,i){this.$M=t,this.nk=i}write(t,i){if(!this.closed){if(this.tk)throw this.tk=!1,new Error('Error in writer thread');if(i>this.nk||t.length>this.nk)throw new Error('buffer overflow');try{this.$M.send(t.subarray(0,i))}catch(t){this.tk=!0}}}close(){this.closed=!0}}class o extends e.A{Gm;position;constructor(t){super(),this.Gm=t,this.position=0}get available(){return this.Gm.length-this.position}get read(){return this.Gm[this.position++]}get rk(){return this.Gm.length}}class l{nk;queue=new h.A;event=null;lk=null;total=0;closed=!1;constructor(t,i){this.nk=i,t.binaryType='arraybuffer',t.onmessage=this.onmessage}get available(){return this.total}onmessage=t=>{if(this.closed)throw new Error('WebSocketReader is closed!');const i=new o(new Uint8Array(t.data));if(this.event?this.queue.n_(i):this.event=i,this.total+=i.rk,this.lk&&(this.lk(this.event),this.lk=null,this.total>this.nk))throw new Error('buffer overflow')};ak(){return this.event&&this.event.available>0?this.event.read:null}async ck(t){for(this.event=this.queue.ev();this.totalthis.lk=t));return this.event?this.event.read:this.ck(t)}hk(t,i,s){if(this.closed)throw new Error('WebSocketReader is closed!');if(!(this.event&&this.event.available>=s))return null;for(;s>0;){const h=this.ak();if(null===h)throw new Error('EOF - tried to read a fast byte when there was not enough immediate bytes.');t[i++]=h,this.total--,s--}return t}async ek(t,i,s){if(this.closed)throw new Error('WebSocketReader is closed!');for(;s>0;)t[i++]=this.ak()??await this.ck(s),this.total--,s--;return t}ik(){if(this.closed)throw new Error('WebSocketReader is closed!');const t=this.ak();return null===t?null:(this.total--,t)}async sk(){if(this.closed)throw new Error('WebSocketReader is closed!');const t=await this.ck(1);return this.total--,t}close(){this.closed=!0,this.lk=null,this.total=0,this.event=null,this.queue.clear()}}},4544:(t,i,s)=>{s.d(i,{A:()=>h});class h{db;constructor(t){t.onerror=this.onerror,t.onclose=this.onclose,this.db=t}static openDatabase=async()=>await new Promise(((t,i)=>{const s=indexedDB.open('lostcity',1);s.onsuccess=i=>{const s=i.target;console.log('database success!'),t(s.result)},s.onupgradeneeded=t=>{t.target.result.createObjectStore('cache')},s.onerror=t=>{const s=t.target;console.error('database error!: ',s.error),i(s.result)}}));Uo=async t=>await new Promise((i=>{const s=this.db.transaction('cache','readonly').objectStore('cache').get(t);s.onsuccess=()=>{i(s.result)},s.onerror=t=>{i(void 0)}}));Yo=async(t,i)=>await new Promise(((s,h)=>{const e=this.db.transaction('cache','readwrite').objectStore('cache').put(i,t);e.onsuccess=()=>{s()},e.onerror=t=>{h()}}));onclose=t=>{console.log('database close!')};onerror=t=>{console.log('database error!')};fk=t=>{const i=t.trim();let s=0;for(let t=0;t='A'&&h<='Z'?s+=h.charCodeAt(0)+1-65:h>='a'&&h<='z'?s+=h.charCodeAt(0)+1-97:h>='0'&&h<='9'&&(s+=h.charCodeAt(0)+27-48)}return s}}},2634:(t,i,s)=>{s.d(i,{A:()=>h});class h{count=0;uk=new Int32Array(256);dk=new Int32Array(256);a=0;b=0;c=0;constructor(t){for(let i=0;i>>2,e+=i,s+=h,s^=h<<8,n+=s,h+=e,h^=e>>>16,r+=h,e+=n,e^=n<<10,o+=e,n+=r,n^=r>>>4,t+=n,r+=o,r^=o<<8,i+=r,o+=t,o^=t>>>9,s+=o,t+=i;for(let l=0;l<256;l+=8)t+=this.uk[l],i+=this.uk[l+1],s+=this.uk[l+2],h+=this.uk[l+3],e+=this.uk[l+4],n+=this.uk[l+5],r+=this.uk[l+6],o+=this.uk[l+7],t^=i<<11,h+=t,i+=s,i^=s>>>2,e+=i,s+=h,s^=h<<8,n+=s,h+=e,h^=e>>>16,r+=h,e+=n,e^=n<<10,o+=e,n+=r,n^=r>>>4,t+=n,r+=o,r^=o<<8,i+=r,o+=t,o^=t>>>9,s+=o,t+=i,this.dk[l]=t,this.dk[l+1]=i,this.dk[l+2]=s,this.dk[l+3]=h,this.dk[l+4]=e,this.dk[l+5]=n,this.dk[l+6]=r,this.dk[l+7]=o;for(let l=0;l<256;l+=8)t+=this.dk[l],i+=this.dk[l+1],s+=this.dk[l+2],h+=this.dk[l+3],e+=this.dk[l+4],n+=this.dk[l+5],r+=this.dk[l+6],o+=this.dk[l+7],t^=i<<11,h+=t,i+=s,i^=s>>>2,e+=i,s+=h,s^=h<<8,n+=s,h+=e,h^=e>>>16,r+=h,e+=n,e^=n<<10,o+=e,n+=r,n^=r>>>4,t+=n,r+=o,r^=o<<8,i+=r,o+=t,o^=t>>>9,s+=o,t+=i,this.dk[l]=t,this.dk[l+1]=i,this.dk[l+2]=s,this.dk[l+3]=h,this.dk[l+4]=e,this.dk[l+5]=n,this.dk[l+6]=r,this.dk[l+7]=o;this.wk(),this.count=256}wk(){this.c++,this.b+=this.c;for(let t=0;t<256;t++){const i=this.dk[t],s=3&t;let h;0===s?this.a^=this.a<<13:1===s?this.a^=this.a>>>6:2===s?this.a^=this.a<<2:3===s&&(this.a^=this.a>>>16),this.a+=this.dk[t+128&255],this.dk[t]=h=this.dk[i>>>2&255]+this.a+this.b,this.uk[t]=this.b=this.dk[h>>>8>>>2&255]+i}}}},2901:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(1069),e=s(1908);class n{static fk=t=>{let i=0;t=t.toUpperCase();for(let s=0;s=this.yk)return null;if(this.Ek[t])return this.Ek[t];const i=this._k[t],s=i+this.Ik[t];if(this.Ak){const h=Uint8Array.from(this.buffer.subarray(i,i+s));return this.Ek[t]=h,h}{const i=Uint8Array.from(e.A.read(this.mk[t],this.buffer,this.Ik[t],this._k[t]));return this.Ek[t]=i,i}}}},1069:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(9234),e=s(6666),n=s(4474);class r extends n.A{static Ck=3988292384;static Tk=new Int32Array(256);static Ok=new Uint32Array(33);static bk=new e.A;static vk=new e.A;static Lk=new e.A;static Rk=0;static Sk=0;static Mk=0;static{for(let t=0;t<32;t++)r.Ok[t]=(1<>>=1:i=i>>>1^r.Ck;r.Tk[t]=i}}static Bo=t=>{let i=4294967295;for(let s=0;s>>8^r.Tk[255&(i^t[s])];return~i};view;data;Fc=0;Bm=0;random=null;constructor(t){if(!t)throw new Error('Input src packet array was null!');super(),t instanceof Int8Array?this.data=new Uint8Array(t):this.data=t,this.view=new DataView(this.data.buffer,this.data.byteOffset,this.data.byteLength)}get length(){return this.view.byteLength}get available(){return this.length-this.Fc}static Ut=t=>{let i=null;return 0===t&&r.Rk>0?(r.Rk--,i=r.bk.ev()):1===t&&r.Sk>0?(r.Sk--,i=r.vk.ev()):2===t&&r.Mk>0&&(r.Mk--,i=r.Lk.ev()),i?(i.Fc=0,i):new r(0===t?new Uint8Array(100):1===t?new Uint8Array(5e3):new Uint8Array(3e4))};release(){this.Fc=0,100===this.view.byteLength&&r.Rk<1e3?(r.bk.n_(this),r.Rk++):5e3===this.view.byteLength&&r.Sk<250?(r.vk.n_(this),r.Sk++):3e4===this.view.byteLength&&r.Mk<50&&(r.Lk.n_(this),r.Mk++)}get ZA(){return this.view.getUint8(this.Fc++)}get zA(){return this.view.getInt8(this.Fc++)}get KA(){const t=this.view.getUint16(this.Fc);return this.Fc+=2,t}get tp(){const t=this.view.getInt16(this.Fc);return this.Fc+=2,t}get dg(){const t=this.view.getUint8(this.Fc++)<<16|this.view.getUint16(this.Fc);return this.Fc+=2,t}get Ko(){const t=this.view.getInt32(this.Fc);return this.Fc+=4,t}get Uc(){const t=this.view.getBigInt64(this.Fc);return this.Fc+=8,t}get kR(){return this.view.getUint8(this.Fc)<128?this.ZA-64:this.KA-49152}get nO(){return this.view.getUint8(this.Fc)<128?this.ZA:this.KA-32768}get ly(){const t=this.view,i=t.byteLength;let s,h='';for(;10!==(s=t.getUint8(this.Fc++))&&this.Fc>16),this.view.setUint16(this.Fc,t),this.Fc+=2}p4(t){this.view.setInt32(this.Fc,t),this.Fc+=4}xk(t){this.view.setInt32(this.Fc,t,!0),this.Fc+=4}nA(t){this.view.setBigInt64(this.Fc,t),this.Fc+=8}Bc(t){const i=this.view,s=t.length;for(let h=0;h>>3,s=8-(7&this.Bm),h=0;for(this.Bm+=t;t>s;s=8)h+=(this.view.getUint8(i++)&r.Ok[s])<>>s-t&r.Ok[t],h}Gc(t,i){const s=this.Fc;this.Fc=0;const e=new Uint8Array(s);this.xy(s,0,e);const n=(0,h.Dk)(e),r=(0,h.Nk)(n,i,t),o=(0,h.Pk)(r);this.Fc=0,this.p1(o.length),this.Hc(o,o.length,0)}}},353:(t,i,s)=>{s.d(i,{A:()=>h});class h{static Fk=[95,218,67,50,253,222,194,60,101,128,8,251,92,111,24,33,223,66,232,59,227,113,153,105,126,98,167,102,177,238,62,190,147,23,150,151,156,144,193,155,81,0,198,22,137,210,179,16,168,170,32,181,248,141,58,87,208,106,180,191,221,241,40,176,196,154,65,145,230,78,30,161,188,41,14,129,18,199,47,247,225,34,51,10,159,75,12,56,61,31,39,91,46,242,134,5,122,123,209,228,104,195,21,3,11,44,107,172,6,186,110,215,205,103,27,185,124,77,252,117,86,115,127,207,52,79,43,97,219,116,169,7,118,162,108,36,20,233,88,135,80,19,42,237,57,152,71,9,250,17,4,119,234,130,26,200,189,163,254,245,197,171,220,235,140,244,184,94,211,231,99,246,121,212,112,204,63,148,83,178,1,255,131,13,183,142,236,45,55,35,243,136,37,85,100,160,38,224,146,174,82,48,109,132,125,90,143,138,240,173,165,164,192,175,29,74,28,114,213,73,64,206,76,139,96,2,229,15,93,25,239,202,49,70,214,201,72,203,68,89,69,157,216,217,249,120,226,84,149,187,54,53,158,166,182,133,0];static VA=[0,-2,4,6,-1,0,0,2,0,0,0,0,5,4,2,2,0,0,0,0,2,-2,2,14,0,6,3,0,4,0,0,0,3,0,0,0,0,0,0,0,0,-1,4,2,6,0,6,0,0,3,7,0,0,0,-1,0,0,0,0,4,0,0,0,0,0,0,0,0,1,15,0,0,0,0,6,0,2,0,0,0,2,0,0,0,1,0,0,4,0,0,0,0,0,0,0,0,0,0,-2,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,-2,0,0,2,0,0,0,2,9,0,0,0,0,0,4,0,0,0,3,7,9,0,0,0,0,0,0,0,0,0,-2,0,0,0,0,3,2,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,-2,2,0,0,0,0,0,6,0,0,0,2,0,2,0,0,0,-2,0,0,4,0,0,0,0,6,0,0,-2,-2,0,0,0,0,0,0,-2,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,-2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0]}},2215:(t,i,s)=>{s.d(i,{A:()=>h});class h{static Jy=14;static Ly=28;static Op=129;static My=167;static Ip=168;static qy=195;static _p=2;static gp=26;static Ap=46;static dp=84;static ap=87;static jy=103;static Sy=146;static hy=197;static bp=201;static Xy=204;static Qy=209;static Hy=126;static cp=185;static By=15;static Ny=98;static Mp=213;static up=74;static Sp=13;static ip=3;static Tp=239;static JA=1;static kp=184;static Dy=133;static Py=226;static wp=4;static Cp=21;static Zy=32;static fA=41;static jA=152;static Ay=19;static Rp=22;static ny=25;static qA=43;static vp=44;static fp=68;static Ep=136;static yy=139;static Gy=140;static uy=142;static Uy=243;static Yy=254;static wy=20;static $A=80;static op=132;static ky=220;static ty=237;static XA=150;static Ry=175;static lp=193;static Vy=12;static oy=54;static Wy=212;static zy=7;static sp=135;static Lp=162;static my=23;static Ty=42;static gy=49;static Iy=50;static by=59;static Ey=69;static Oy=76;static py=151;static _y=191;static Cy=223}},3937:(t,i,s)=>{s.d(i,{A:()=>o});class h{start=0;end=0;form=0;length=0;Uk=null;Bk=null;threshold=0;position=0;delta=0;amplitude=0;Gk=0;read(t){this.form=t.ZA,this.start=t.Ko,this.end=t.Ko,this.length=t.ZA,this.Uk=new Int32Array(this.length),this.Bk=new Int32Array(this.length);for(let i=0;i=this.threshold&&this.Bk&&this.Uk&&(this.amplitude=this.Bk[this.position++]<<15,this.position>=this.length&&(this.position=this.length-1),this.threshold=this.Uk[this.position]/65536*t|0,this.threshold>this.Gk&&(this.delta=((this.Bk[this.position]<<15)-this.amplitude)/(this.threshold-this.Gk)|0)),this.amplitude+=this.delta,this.Gk++,this.amplitude-this.delta>>15}}class e{static buffer=null;static PT=null;static sin=null;static Hk=new Int32Array(5);static Wk=new Int32Array(5);static Yk=new Int32Array(5);static Vk=new Int32Array(5);static Kk=new Int32Array(5);Xk=null;zk=null;jk=null;Zk=null;qk=null;$k=null;release=null;attack=null;Jk=new Int32Array(5);Qk=new Int32Array(5);tx=new Int32Array(5);start=0;length=500;ix=100;sx=0;static init=()=>{this.PT=new Int32Array(32768);for(let t=0;t<32768;t++)Math.random()>.5?this.PT[t]=1:this.PT[t]=-1;this.sin=new Int32Array(32768);for(let t=0;t<32768;t++)this.sin[t]=16384*Math.sin(t/5215.1903)|0;this.buffer=new Int32Array(220500)};Xc(t,i){for(let i=0;i>1,r+=(i*h>>16)+n}if(this.qk&&this.$k){const i=this.qk.evaluate(t),s=this.$k.evaluate(t);c=c*(32768+(this.hx(s,a,this.qk.form)>>1))>>15,a+=(i*o>>16)+l}for(let h=0;h<5;h++)if(0!==this.Jk[h]){const n=i+e.Wk[h];n>15,e.Hk[h],this.Xk.form),e.Hk[h]+=(s*e.Vk[h]>>16)+e.Kk[h])}}if(this.release&&this.attack){this.release.reset(),this.attack.reset();let i=0,s=!0;for(let h=0;h>8):this.release.start+((this.release.end-this.release.start)*r>>8),i+=256,i>=o&&(i=0,s=!s),s&&(e.buffer[h]=0)}}if(this.sx>0&&this.ix>0){const i=this.sx*s;for(let s=i;s32767&&(e.buffer[i]=32767);return e.buffer}hx(t,i,s){return 1===s?(32767&i)<16384?t:-t:2===s?e.sin[32767&i]*t>>14:3===s?((32767&i)*t>>14)-t:4===s?e.PT[i/2607&32767]*t:0}read(t){this.Xk=new h,this.Xk.read(t),this.zk=new h,this.zk.read(t),0!==t.ZA&&(t.Fc--,this.jk=new h,this.jk.read(t),this.Zk=new h,this.Zk.read(t)),0!==t.ZA&&(t.Fc--,this.qk=new h,this.qk.read(t),this.$k=new h,this.$k.read(t)),0!==t.ZA&&(t.Fc--,this.release=new h,this.release.read(t),this.attack=new h,this.attack.read(t));for(let i=0;i<10;i++){const s=t.nO;if(0===s)break;this.Jk[i]=s,this.Qk[i]=t.kR,this.tx[i]=t.nO}this.sx=t.nO,this.ix=t.nO,this.length=t.KA,this.start=t.KA}}var n=s(1069),r=s(3867);class o{static Ky=new Int32Array(1e3);static nx=null;static ox=null;static lx=new r.ds(1e3,null);ux=new r.ds(10,null);wx=0;loopEnd=0;static ec=t=>{const i=new n.A(t.read('sounds.dat'));for(this.nx=new Uint8Array(441e3),this.ox=new n.A(this.nx),e.init();;){const t=i.KA;if(65535===t)break;const s=new o;s.read(i),this.lx[t]=s,this.Ky[t]=s.trim()}};static Xc=(t,i)=>{if(!this.lx[t])return null;const s=this.lx[t];return s?.Ax(i)??null};read(t){for(let i=0;i<10;i++)0!==t.ZA&&(t.Fc--,this.ux[i]=new e,this.ux[i]?.read(t));this.wx=t.KA,this.loopEnd=t.KA}trim(){let t=9999999;for(let i=0;i<10;i++)this.ux[i]&&(this.ux[i].start/20|0)i&&(i=this.ux[t].length+this.ux[t].start);if(0===i)return 0;let s=22050*i/1e3|0,h=22050*this.wx/1e3|0,e=22050*this.loopEnd/1e3|0;(h<0||e<0||e>s||h>=e)&&(t=0);let n=s+(e-h)*(t-1);for(let t=44;t>8<<24>>24)}if(t>1){h+=44,e+=44,s+=44,n+=44;const i=n-s;for(let t=s-1;t>=e;t--)o.nx&&(o.nx[t+i]=o.nx[t]);for(let i=1;i{s.d(i,{$a:()=>a,qa:()=>o,ds:()=>h,uO:()=>e,Cr:()=>n,aO:()=>r,Kn:()=>l});class h extends Array{constructor(t,i){super(t);for(let s=0;s{s.d(i,{Pk:()=>l,Ho:()=>e,Dk:()=>o,Wo:()=>h,Xa:()=>n,Oc:()=>r,Nk:()=>a});const h=async t=>new Promise((i=>setTimeout(i,t))),e=async t=>new Int8Array(await(await fetch(t)).arrayBuffer()),n=async t=>(await fetch(t)).text();function r(t,i,s,h,e){for(;e--;)s[h++]=t[i++]}function o(t){let i=0n;for(let s=0;s0n;)i.unshift(Number(0xffn&t)),t>>=8n;return 128&i[0]&&i.unshift(0),new Uint8Array(i)}function a(t,i,s){let h=1n;for(;i>0n;)i%2n===1n&&(h=h*t%s),t=t*t%s,i>>=1n;return h}},7953:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1069);class e{static yx=new Uint16Array(['d','o','t'].join('').split('').map((t=>t.charCodeAt(0))));static mx=new Uint16Array(['(','a',')'].join('').split('').map((t=>t.charCodeAt(0))));static Ix=new Uint16Array(['s','l','a','s','h'].join('').split('').map((t=>t.charCodeAt(0))));static _x=['cook',"cook's",'cooks','seeks','sheet'];static Ex=[];static gx=[];static Cx=[];static Tx=[];static Ox=[];static bx=[];static ec=t=>{const i=new h.A(t.read('fragmentsenc.txt')),s=new h.A(t.read('badenc.txt')),e=new h.A(t.read('domainenc.txt')),n=new h.A(t.read('tldlist.txt'));this.read(s,e,i,n)};static filter=t=>{const i=[...t];this.format(i);const s=i.join('').trim(),h=s.toLowerCase(),e=[...h];this.vx(e),this.Lx(e),this.Rx(e),this.Sx(e);for(let t=0;t{this.xx(t),this.Dx(i),this.Nx(s),this.Px(h)};static Px=t=>{const i=t.Ko;for(let s=0;st.ZA))};static xx=t=>{const i=t.Ko;for(let s=0;st.ZA));const i=new Array(t.ZA).fill([]).map((()=>[t.zA,t.zA]));i.length>0&&(this.Tx[s]=i)}};static Dx=t=>{const i=t.Ko;for(let s=0;st.ZA))};static Nx=t=>{const i=t.Ko;for(let s=0;s{const i=[...t],s=[...t];this.Fx(null,i,this.yx),this.Fx(null,s,this.Ix);for(let h=0;h{for(let i=0;i<2;i++)for(let i=this.Cx.length-1;i>=0;i--)this.Fx(this.Tx[i],t,this.Cx[i])};static Rx=t=>{const i=[...t],s=[...t];this.Fx(null,i,this.mx),this.Fx(null,s,this.yx);for(let h=this.Ox.length-1;h>=0;h--)this.Bx(s,i,this.Ox[h],t)};static Sx=t=>{for(let i=0;i=0&&e{if(this.Xx(t))return!0;const i=this.zx(t),s=this.bx,h=s.length;if(i===s[0]||i===s[h-1])return!0;let e=0,n=h-1;for(;e<=n;){const t=(e+n)/2|0;if(i===s[t])return!0;i{if(t.length>6)return 0;let i=0;for(let s=0;s{for(let s=i;s=0;s++)if(this.Zx(t[s]))return s;return-1};static Vx=(t,i)=>{for(let s=t;s=0;s++)if(!this.Zx(i[s]))return s;return i.length};static qx=(t,i,s)=>i===s||'o'===i&&'0'===s?1:'o'===i&&'('===s&&')'===t?2:'c'!==i||'('!==s&&'<'!==s&&'['!==s?'e'===i&&'€'===s||'s'===i&&'$'===s||'l'===i&&'i'===s?1:0:1;static Bx=(t,i,s,h)=>{const e=s.length,n=h.length;for(let r=0;r<=n-e;r++){const{$x:e,Jx:n}=this.Qx(r,s,h);if(!e)continue;const o=this.tD(r,h,3,i,['@']),l=this.iD(n-1,h,3,t,['.',',']);(o>2||l>2)&&this.Yx(r,n,h)}};static Qx=(t,i,s)=>{const h=i.length;let e=t,n=0;for(;e0)e+=l,n++;else{if(0===n)break;const s=this.qx(o,String.fromCharCode(i[n-1]),r);if(s>0)e+=s,1===n&&t++;else{if(n>=h||!this.Hx(r))break;e++}}}return{$x:n>=h,Jx:e}};static Fx=(t,i,s)=>{if(!(s.length>i.length))for(let h=0;h<=i.length-s.length;h++){let e=h;const{Jx:n,sD:r,hD:o,eD:l,nD:a}=this.rD(i,s,e);e=n;let c=i[e],f=e+1=s.length)||l&&a)continue;let u,d=!0;if(o){let t=!1,s=!1;if((h-1<0||this.Hx(i[h-1])&&"'"!==i[h-1])&&(t=!0),(e>=i.length||this.Hx(i[e])&&"'"!==i[e])&&(s=!0),!t||!s){let s=!1;for(u=h-2,t&&(u=h);!s&&u=0&&(!this.Hx(i[u])||"'"===i[u])){const t=[];let h;for(h=0;h<3&&u+h=0&&(!this.Hx(i[u-1])||"'"===i[u-1])&&(e=!1),e&&!this.Kx(t)&&(s=!0)}u++}s||(d=!1)}}else{c=' ',h-1>=0&&(c=i[h-1]),f=' ',e{let h=s,e=0,n=0,r=!1,o=!1,l=!1;for(;h=t.length||o&&l);){const a=t[h],c=h+10)1===f&&this.Zx(a)&&(o=!0),2===f&&(this.Zx(a)||this.Zx(c))&&(o=!0),h+=f,e++;else{if(0===e)break;let t;if((t=this.cD(c,String.fromCharCode(i[e-1]),a))>0)h+=t;else{if(e>=i.length||!this.Wx(a))break;if(this.Hx(a)&&"'"!==a&&(r=!0),this.Zx(a)&&(l=!0),h++,n++,(100*n/(h-s)|0)>90)break}}}return{Jx:h,sD:e,hD:r,eD:o,nD:l}};static cD=(t,i,s)=>{if(i===s)return 1;if(i>='a'&&i<='m'){if('a'===i)return'4'!==s&&'@'!==s&&'^'!==s?'/'===s&&'\\'===t?2:0:1;if('b'===i)return'6'!==s&&'8'!==s?'1'===s&&'3'===t?2:0:1;if('c'===i)return'('!==s&&'<'!==s&&'{'!==s&&'['!==s?0:1;if('d'===i)return'['===s&&')'===t?2:0;if('e'===i)return'3'!==s&&'€'!==s?0:1;if('f'===i)return'p'===s&&'h'===t?2:'£'===s?1:0;if('g'===i)return'9'!==s&&'6'!==s?0:1;if('h'===i)return'#'===s?1:0;if('i'===i)return'y'!==s&&'l'!==s&&'j'!==s&&'1'!==s&&'!'!==s&&':'!==s&&';'!==s&&'|'!==s?0:1;if('j'===i)return 0;if('k'===i)return 0;if('l'===i)return'1'!==s&&'|'!==s&&'i'!==s?0:1;if('m'===i)return 0}if(i>='n'&&i<='z'){if('n'===i)return 0;if('o'===i)return'0'!==s&&'*'!==s?'('===s&&')'===t||'['===s&&']'===t||'{'===s&&'}'===t||'<'===s&&'>'===t?2:0:1;if('p'===i)return 0;if('q'===i)return 0;if('r'===i)return 0;if('s'===i)return'5'!==s&&'z'!==s&&'$'!==s&&'2'!==s?0:1;if('t'===i)return'7'!==s&&'+'!==s?0:1;if('u'===i)return'v'===s?1:'\\'===s&&'/'===t||'\\'===s&&'|'===t||'|'===s&&'/'===t?2:0;if('v'===i)return'\\'===s&&'/'===t||'\\'===s&&'|'===t||'|'===s&&'/'===t?2:0;if('w'===i)return'v'===s&&'v'===t?2:0;if('x'===i)return')'===s&&'('===t||'}'===s&&'{'===t||']'===s&&'['===t||'>'===s&&'<'===t?2:0;if('y'===i)return 0;if('z'===i)return 0}return i>='0'&&i<='9'?'0'===i?'o'===s||'O'===s?1:'('===s&&')'===t||'{'===s&&'}'===t||'['===s&&']'===t?2:0:'1'===i&&'l'===s?1:0:','===i?'.'===s?1:0:'.'===i?','===s?1:0:'!'===i&&'i'===s?1:0};static lD=(t,i,s)=>{let h=0,e=i.length-1;for(;h<=e;){const n=(h+e)/2|0;if(i[n][0]===t&&i[n][1]===s)return!0;tthis.jx(t)?t.charCodeAt(0)+1-'a'.charCodeAt(0):"'"===t?28:this.Zx(t)?t.charCodeAt(0)+29-'0'.charCodeAt(0):27;static Ux=(t,i,s,h,e)=>{if(!(h.length>s.length))for(let n=0;n<=s.length-h.length;n++){const{Jx:r,fD:o}=this.uD(s,h,n);if(o0&&c>0&&(l=!0),2===i&&(a>2&&c>0||a>0&&c>2)&&(l=!0),3===i&&a>0&&c>2&&(l=!0),!l)continue;let f,u=n,d=r-1,w=!1;if(a>2){if(4===a)for(w=!1,f=n-1;f>=0;f--)if(w){if('*'!==e[f])break;u=f}else'*'===e[f]&&(u=f,w=!0);for(w=!1,f=u-1;f>=0;f--)if(w){if(this.Hx(s[f]))break;u=f}else this.Hx(s[f])||(w=!0,u=f)}if(c>2){if(4===c)for(w=!1,f=d+1;f{let h=0;for(;s0)s+=r,h++;else{if(0===h)break;let t;if((t=this.qx(n,String.fromCharCode(i[h-1]),e))>0)s+=t;else{if(!this.Hx(e))break;s++}}}return{Jx:s,fD:h}};static Hx=t=>!this.aD(t)&&!this.Zx(t);static Wx=t=>!this.jx(t)||('v'===t||'x'===t||'j'===t||'q'===t||'z'===t);static aD=t=>this.jx(t)||this.dD(t);static Zx=t=>t>='0'&&t<='9';static jx=t=>t>='a'&&t<='z';static dD=t=>t>='A'&&t<='Z';static Xx=t=>{for(let i=0;i{for(let h=t;h{let s=0;for(let h=i-1;h>=0&&this.Hx(t[h]);h--)'*'===t[h]&&s++;return s};static AD=(t,i)=>{let s=0;for(let h=i+1;h(e?this.wD(i,s):this.AD(i,s))>=h?4:this.Hx(e?t[s-1]:t[s+1])?1:0;static tD=(t,i,s,h,e)=>{if(0===t)return 2;for(let s=t-1;s>=0&&this.Hx(i[s]);s--)if(e.includes(i[s]))return 3;return this.yD(i,h,t,s,!0)};static iD=(t,i,s,h,e)=>{if(t+1===i.length)return 2;for(let s=t+1;s{let i=0;for(let s=0;st>=' '&&t<=''||' '===t||'\n'===t||'\t'===t||'£'===t||'€'===t;static Mx=(t,i)=>{for(let s=0;s{let i=!0;for(let s=0;s{s.d(i,{A:()=>h});class h{static mD=[' ','e','t','a','o','i','h','n','s','r','d','l','u','m','w','c','y','f','g','p','b','v','k','x','j','q','z','0','1','2','3','4','5','6','7','8','9',' ','!','?','.',',',':',';','(',')','-','&','*','\\','\'','@','#','+','=','£','$','%','"','[',']'];static ID=[];static ec=(t,i)=>{let s,h=0,e=-1;for(let n=0;n>4&15,-1!==e?(this.ID[h++]=this.mD[(e<<4)+s-195],e=-1):s<13?this.ID[h++]=this.mD[s]:e=s,s=15&i,-1!==e?(this.ID[h++]=this.mD[(e<<4)+s-195],e=-1):s<13?this.ID[h++]=this.mD[s]:e=s}let n=!0;for(let t=0;t='a'&&i<='z'&&(this.ID[t]=i.toUpperCase(),n=!1),'.'!==i&&'!'!==i||(n=!0)}return this.ID.slice(0,h).join('')};static uA=(t,i)=>{i.length>80&&(i=i.substring(0,80)),i=i.toLowerCase();let s=-1;for(let h=0;h12&&(n+=195),-1===s?n<13?s=n:t.p1(n):n<13?(t.p1((s<<4)+n),s=-1):(t.p1((s<<4)+(n>>4)),s=15&n)}-1!==s&&t.p1(s<<4)}}},1908:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(9763);class e{static _D=null;static load=async t=>{this._D=await(0,h.F)(new WebAssembly.Module(t),{env:void 0})};static read=(t,i,s,h)=>{if(!this._D)throw new Error('bz2 not found!!');return Int8Array.from(this._D.read(t,i,s,h))}}},123:(t,i,s)=>{let h;async function e(t,i){n(i);try{const i=await window.audioContext.decodeAudioData(Uint8Array.from(t).buffer);let s=window.audioContext.createBufferSource();s.buffer=i,s.connect(h),s.start()}catch(t){console.log(t)}}function n(t){h||(h=window.audioContext.createGain(),h.connect(window.audioContext.destination)),h.gain.value=t/256}function r(t,i){window._tinyMidiPlay&&window._tinyMidiPlay(t,i/256)}function o(t){window._tinyMidiVolume&&window._tinyMidiVolume(t/256)}function l(){window._tinyMidiStop&&window._tinyMidiStop()}s.d(i,{zc:()=>e,Xo:()=>r,jp:()=>n,vo:()=>l,zp:()=>o})},9763:(t,i,s)=>{async function h(t,i={}){const s={env:Object.assign(Object.create(globalThis),i.env||{},{abort(t,i,s,h){t=r(t>>>0),i=r(i>>>0),s>>>=0,h>>>=0,(()=>{throw Error(`${t} in ${i}:${s}:${h}`)})()}})},{exports:h}=await WebAssembly.instantiate(t,s),e=h.memory||i.env.memory,n=Object.setPrototypeOf({read:(t,i,s,n)=>(i=function(t,i,s,n,r){if(null==n)return 0;const o=n.length,l=h.__pin(h.__new(o<>>0;if(r)new r(e.buffer,l,o).set(n);else for(let i=0;i>>0),n[i]);return h.__unpin(l),l}(l,6,0,i,Int8Array)||function(){throw TypeError("value must not be null")}(),function(t,i,s){if(!s)return null;const h=function(t){try{return o.getUint32(t,!0)}catch{return o=new DataView(e.buffer),o.getUint32(t,!0)}}(s-4)>>>i,n=new Array(h);for(let e=0;e>>0));return n}(a,0,h.read(t,i,s,n)>>>0))},h);function r(t){if(!t)return null;const i=t+new Uint32Array(e.buffer)[t-4>>>2]>>>1,s=new Uint16Array(e.buffer);let h=t>>>1,n="";for(;i-h>1024;)n+=String.fromCharCode(...s.subarray(h,h+=1024));return n+String.fromCharCode(...s.subarray(h,i))}let o=new DataView(e.buffer);function l(t,i){try{o.setUint8(t,i,!0)}catch{o=new DataView(e.buffer),o.setUint8(t,i,!0)}}function a(t){try{return o.getInt8(t,!0)}catch{return o=new DataView(e.buffer),o.getInt8(t,!0)}}return n}s.d(i,{F:()=>h})},9896:(t,i,s)=>{var h=s(8151);!function(){window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioContext&&(window.audioContext=new window.AudioContext);var t=function(i){if(window.audioContext){var s=window.audioContext.createBuffer(1,1,22050),h=window.audioContext.createBufferSource();h.buffer=s,h.connect(window.audioContext.destination),h.start?h.start(0):h.play?h.play(0):h.noteOn&&h.noteOn(0)}document.removeEventListener('touchstart',t),document.removeEventListener('touchend',t),document.removeEventListener('click',t)};document.addEventListener('touchstart',t),document.addEventListener('touchend',t),document.addEventListener('click',t)}(),(async()=>{let t=new Float32Array,i=window.audioContext.createGain();i.gain.value=.1,i.connect(window.audioContext.destination);let s=window.audioContext.currentTime,e=[];const n=new h.A({ED:30,gD:i=>{let s=new Float32Array(i.buffer),h=new Float32Array(t.length+s.length);h.set(t,0),h.set(s,t.length),t=h},CD:t=>{},bufferSize:102400});await n.init();const r=await fetch('./SCC1_Florestan.sf2'),o=new Uint8Array(await r.arrayBuffer());function l(){if(!window.audioContext||!t.length)return;let h=window.audioContext.createBufferSource();const n=t.length/2,r=window.audioContext.createBuffer(2,n,44100);for(let i=0;i<2;i++){const s=r.getChannelData(i);let h=i;for(let i=0;i{if(a&&clearInterval(a),t=new Float32Array,e.length){let t=i.gain.value;i.gain.value=0,e.forEach((t=>{t.stop(window.audioContext.currentTime)})),e=[],i.gain.value=t}},window._tinyMidiVolume=(t=1)=>{i.gain.value=t},window._tinyMidiPlay=async(t,i=1)=>{t&&(await window._tinyMidiStop(),-1!=i&&window._tinyMidiVolume(i),s=window.audioContext.currentTime,a=setInterval(l,250),n.OD(t))}})()},8151:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(5473);const e=class{constructor(t={}){this.bD=void 0,this.vD=0,this.LD=0,this.RD=0,this.ED=t.ED||100,this.sampleRate=t.sampleRate||44100,this.SD=t.SD||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.MD(1),this.gD=t.gD||(()=>{}),this.CD=t.CD||(()=>{}),this.kD=void 0,this.test=0}async init(){if(!this.bD){if('undefined'!=typeof process){const{xD:t}=await import('path'),{DD:i}=await import('module');globalThis.__dirname=t("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js"),globalThis.require=i("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js")}this.bD=await(0,h.A)(),this.ND=this.bD._malloc(this.bufferSize),this.PD=this.bD._malloc(8)}}MD(t){this.bufferSize=4*this.sampleRate*this.SD*t}FD(){if(!this.bD)throw new Error(`${this.constructor.name} not initalized. call .init()`)}TD(t){this.FD();const{_malloc:i,_free:s,_tsf_load_memory:h,_tsf_set_output:e,_tsf_channel_set_bank_preset:n,_tsf_set_max_voices:r,_tsf_channel_set_presetnumber:o}=this.bD;s(this.vD),this.vD=i(t.length),this.bD.HEAPU8.set(t,this.vD),this.LD=h(this.vD,t.length),e(this.LD,2===this.SD?0:2,this.sampleRate,this.gain)}UD(){this.FD();const t=new Uint8Array(this.bufferSize);return t.set(this.bD.HEAPU8.subarray(this.ND,this.ND+this.bufferSize)),t}BD(t){const{_malloc:i,_free:s,_tml_load_memory:h}=this.bD;return s(this.RD),this.RD=i(t.length),this.bD.HEAPU8.set(t,this.RD),h(this.RD,t.length)}GD(t){const{_midi_render:i}=this.bD;return i(this.LD,t,this.SD,this.sampleRate,this.ND,this.bufferSize,this.PD)}OD(t){if(this.FD(),!this.LD)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.kD);const{setValue:i,getValue:s}=this.bD;i(this.PD,0,'double'),this.bD._tsf_reset(this.LD),this.bD._tsf_channel_set_bank_preset(this.LD,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let h=this.BD(t);const e=()=>{h=this.GD(h);const t=this.UD();this.gD(t),h?this.kD=setTimeout(e,this.ED):this.CD(s(this.PD,'double'))};this.kD=setTimeout(e,16)}}},8227:(t,i,s)=>{t.exports=s.p+"9f86b5397894e28b5ae2.wasm"},5473:(t,i,s)=>{var h;s.d(i,{A:()=>e});const e=(h="file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/tinymidipcm.mjs",function(t){var i,e,n=void 0!==(t=t||{})?t:{};n.ready=new Promise((function(t,s){i=t,e=s})),["_tsf_load_memory","_tsf_set_output","_tsf_channel_set_bank_preset","_tsf_set_max_voices","_tsf_channel_set_presetnumber","_tsf_reset","_tsf_close","_tml_load_memory","_midi_render","_malloc","_realloc","_free","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(n.ready,t)||Object.defineProperty(n.ready,t,{get:()=>z('You are getting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),set:()=>z('You are setting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js')})}));var r=Object.assign({},n),o=[],l='object'==typeof window,a='function'==typeof importScripts,c='object'==typeof process&&'object'==typeof process.versions&&'string'==typeof process.versions.node,f=!l&&!c&&!a;if(n.ENVIRONMENT)throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');var u,d,w,A='';if(c){if('undefined'==typeof process||!process.release||'node'!==process.release.name)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');var y,p;A=a?require('path').xD(A)+'/':__dirname+'/';var m=()=>{p||(y=require('fs'),p=require('path'))};u=(t,i)=>(m(),t=p.normalize(t),y.HD(t,i?void 0:'utf8')),w=t=>{var i=u(t,!0);return i.buffer||(i=new Uint8Array(i)),D(i.buffer),i},d=(t,i,s)=>{m(),t=p.normalize(t),y.WD(t,(function(t,h){t?s(t):i(h.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,'/'),o=process.argv.slice(2),process.on('uncaughtException',(function(t){if(!(t instanceof et))throw t})),process.on('unhandledRejection',(function(t){throw t})),n.inspect=function(){return'[Emscripten Module object]'}}else if(f){if('object'==typeof process&&'function'==typeof require||'object'==typeof window||'function'==typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');'undefined'!=typeof read&&(u=function(t){return read(t)}),w=function(t){let i;return'function'==typeof readbuffer?new Uint8Array(readbuffer(t)):(i=read(t,'binary'),D('object'==typeof i),i)},d=function(t,i,s){setTimeout((()=>i(w(t))),0)},'undefined'!=typeof scriptArgs?o=scriptArgs:void 0!==arguments&&(o=arguments),'undefined'!=typeof print&&('undefined'==typeof console&&(console={}),console.log=print,console.warn=console.error='undefined'!=typeof printErr?printErr:print)}else{if(!l&&!a)throw new Error('environment detection error');if(a?A=self.location.href:'undefined'!=typeof document&&document.currentScript&&(A=document.currentScript.src),h&&(A=h),A=0!==A.indexOf('blob:')?A.substr(0,A.replace(/[?#].*/,"").lastIndexOf('/')+1):'','object'!=typeof window&&'function'!=typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');u=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.send(null),i.responseText},a&&(w=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.responseType='arraybuffer',i.send(null),new Uint8Array(i.response)}),d=(t,i,s)=>{var h=new XMLHttpRequest;h.open('GET',t,!0),h.responseType='arraybuffer',h.onload=()=>{200==h.status||0==h.status&&h.response?i(h.response):s()},h.onerror=s,h.send(null)}}n.print||console.log.bind(console);var I,_,E=n.printErr||console.warn.bind(console);function g(t,i){Object.getOwnPropertyDescriptor(n,t)||Object.defineProperty(n,t,{configurable:!0,get:function(){z('Module.'+t+' has been replaced with plain '+i+' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')}})}function C(t){return'FS_createPath'===t||'FS_createDataFile'===t||'FS_createPreloadedFile'===t||'FS_unlink'===t||'addRunDependency'===t||'FS_createLazyFile'===t||'FS_createDevice'===t||'removeRunDependency'===t}Object.assign(n,r),r=null,I='fetchSettings',Object.getOwnPropertyDescriptor(n,I)&&z('`Module.'+I+'` was supplied but `'+I+'` not included in INCOMING_MODULE_JS_API'),n.arguments&&(o=n.arguments),g('arguments','arguments_'),n.thisProgram&&n.thisProgram,g('thisProgram','thisProgram'),n.quit&&n.quit,g('quit','quit_'),D(void 0===n.memoryInitializerPrefixURL,'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===n.pthreadMainPrefixURL,'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'),D(void 0===n.cdInitializerPrefixURL,'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===n.filePackagePrefixURL,'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'),D(void 0===n.read,'Module.read option was removed (modify read_ in JS)'),D(void 0===n.readAsync,'Module.readAsync option was removed (modify readAsync in JS)'),D(void 0===n.readBinary,'Module.readBinary option was removed (modify readBinary in JS)'),D(void 0===n.setWindowTitle,'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'),D(void 0===n.TOTAL_MEMORY,'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'),g('read','read_'),g('readAsync','readAsync'),g('readBinary','readBinary'),g('setWindowTitle','setWindowTitle'),D(!f,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),n.wasmBinary&&(_=n.wasmBinary),g('wasmBinary','wasmBinary');var T;n.noExitRuntime;g('noExitRuntime','noExitRuntime'),'object'!=typeof WebAssembly&&z('no native wasm support detected');var O,b,v,L,R,S,M,k,x=!1;function D(t,i){t||z('Assertion failed'+(i?': '+i:''))}function N(t){O=t,n.HEAP8=b=new Int8Array(t),n.HEAP16=L=new Int16Array(t),n.HEAP32=R=new Int32Array(t),n.HEAPU8=v=new Uint8Array(t),n.HEAPU16=new Uint16Array(t),n.HEAPU32=S=new Uint32Array(t),n.HEAPF32=M=new Float32Array(t),n.HEAPF64=k=new Float64Array(t)}'undefined'!=typeof TextDecoder&&new TextDecoder('utf8');var P=5242880;n.TOTAL_STACK&&D(P===n.TOTAL_STACK,'the stack size can no longer be determined at runtime');var F=n.INITIAL_MEMORY||16777216;function U(){if(!x){var t=ft(),i=S[t>>2],s=S[t+4>>2];34821223==i&&2310721022==s||z('Stack overflow! Stack cookie has been overwritten at 0x'+t.toString(16)+', expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+s.toString(16)+' 0x'+i.toString(16)),1668509029!==S[0]&&z('Runtime error: The application has corrupted its heap memory area (address zero)!')}}g('INITIAL_MEMORY','INITIAL_MEMORY'),D(F>=P,'INITIAL_MEMORY should be larger than TOTAL_STACK, was '+F+'! (TOTAL_STACK='+P+')'),D('undefined'!=typeof Int32Array&&'undefined'!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,'JS engine does not provide full typed array support'),D(!n.wasmMemory,'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'),D(16777216==F,'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'),function(){var t=new Int16Array(1),i=new Int8Array(t.buffer);if(t[0]=25459,115!==i[0]||99!==i[1])throw'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'}();var B=[],G=[],H=[],W=!1;D(Math.imul,'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.fround,'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.clz32,'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.trunc,'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');var Y=0,V=null,K=null,X={};function z(t){n.onAbort&&n.onAbort(t),E(t='Aborted('+t+')'),x=!0;var i=new WebAssembly.RuntimeError(t);throw e(i),i}var j={error:function(){z('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM')},init:function(){j.error()},YD:function(){j.error()},VD:function(){j.error()},KD:function(){j.error()},open:function(){j.error()},XD:function(){j.error()},zD:function(){j.error()},jD:function(){j.error()},ZD:function(){j.error()},qD:function(){j.error()}};n.FS_createDataFile=j.YD,n.FS_createPreloadedFile=j.VD;var Z,q,$,J,Q='data:application/octet-stream;base64,';function tt(t){return t.startsWith(Q)}function it(t){return t.startsWith('file://')}function st(t,i){return function(){var s=t,h=i;return i||(h=n.asm),D(W,'native function `'+s+'` called before runtime initialization'),h[t]||D(h[t],'exported native function `'+s+'` not found'),h[t].apply(null,arguments)}}function ht(t){try{if(t==Z&&_)return new Uint8Array(_);if(w)return w(t);throw"both async and sync fetching of the wasm failed"}catch(t){z(t)}}function et(t){this.name='ExitStatus',this.message='Program terminated with exit('+t+')',this.status=t}function nt(t){for(;t.length>0;)t.shift()(n)}function rt(t){rt.$D||(rt.$D={}),rt.$D[t]||(rt.$D[t]=1,c&&(t='warning: '+t),E(t))}function ot(t){try{return T.JD(t-O.byteLength+65535>>>16),N(T.buffer),1}catch(i){E('emscripten_realloc_buffer: Attempted to grow heap from '+O.byteLength+' bytes to '+t+' bytes, but got error: '+i)}}n.locateFile?tt(Z='tinymidipcm.wasm')||(q=Z,Z=n.locateFile?n.locateFile(q,A):A+q):Z=new URL(s(8227),s.b).toString();var lt,at={"emscripten_memcpy_big":function(t,i,s){v.copyWithin(t,i,i+s)},"emscripten_resize_heap":function(t){var i=v.length;D((t>>>=0)>i);var s,h,e=2147483648;if(t>e)return E('Cannot enlarge memory, asked to go up to '+t+' bytes, but the limit is '+e+' bytes!'),!1;for(var n=1;n<=4;n*=2){var r=i*(1+.2/n);r=Math.min(r,t+100663296);var o=Math.min(e,(s=Math.max(t,r))+((h=65536)-s%h)%h);if(ot(o))return!0}return E('Failed to grow the heap from '+i+' bytes to '+o+' bytes, not enough memory!'),!1}},ct=(function(){var t,i={'env':at,'wasi_snapshot_preview1':at};function s(t,i){var s,h=t.exports;n.asm=h,D(T=n.asm.memory,"memory not found in wasm exports"),N(T.buffer),D(n.asm.__indirect_function_table,"table not found in wasm exports"),s=n.asm.__wasm_call_ctors,G.unshift(s),function(t){if(Y--,n.monitorRunDependencies&&n.monitorRunDependencies(Y),t?(D(X[t]),delete X[t]):E('warning: run dependency removed without ID'),0==Y&&(null!==V&&(clearInterval(V),V=null),K)){var i=K;K=null,i()}}('wasm-instantiate')}t='wasm-instantiate',Y++,n.monitorRunDependencies&&n.monitorRunDependencies(Y),t?(D(!X[t]),X[t]=1,null===V&&'undefined'!=typeof setInterval&&(V=setInterval((function(){if(x)return clearInterval(V),void(V=null);var t=!1;for(var i in X)t||(t=!0,E('still waiting on run dependencies:')),E('dependency: '+i);t&&E('(end of list)')}),1e4))):E('warning: run dependency added without ID');var h=n;function r(t){D(n===h,'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'),h=null,s(t.instance)}function o(t){return function(){if(!_&&(l||a)){if('function'==typeof fetch&&!it(Z))return fetch(Z,{credentials:'same-origin'}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+Z+"'";return t.arrayBuffer()})).catch((function(){return ht(Z)}));if(d)return new Promise((function(t,i){d(Z,(function(i){t(new Uint8Array(i))}),i)}))}return Promise.resolve().then((function(){return ht(Z)}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){E('failed to asynchronously prepare wasm: '+t),it(Z)&&E('warning: Loading from a file URI ('+Z+') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing'),z(t)}))}if(n.instantiateWasm)try{return n.instantiateWasm(i,s)}catch(t){E('Module.instantiateWasm callback failed with error: '+t),e(t)}(_||'function'!=typeof WebAssembly.instantiateStreaming||tt(Z)||it(Z)||c||'function'!=typeof fetch?o(r):fetch(Z,{credentials:'same-origin'}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(r,(function(t){return E('wasm streaming compile failed: '+t),E('falling back to ArrayBuffer instantiation'),o(r)}))}))).catch(e)}(),n.___wasm_call_ctors=st("__wasm_call_ctors"),n._malloc=st("malloc"),n._free=st("free"),n._tsf_load_memory=st("tsf_load_memory"),n._tsf_close=st("tsf_close"),n._tsf_reset=st("tsf_reset"),n._tsf_set_output=st("tsf_set_output"),n._tsf_set_max_voices=st("tsf_set_max_voices"),n._realloc=st("realloc"),n._tsf_channel_set_presetnumber=st("tsf_channel_set_presetnumber"),n._tsf_channel_set_bank_preset=st("tsf_channel_set_bank_preset"),n._tml_load_memory=st("tml_load_memory"),n._midi_render=st("midi_render"),n.___errno_location=st("__errno_location"),n._fflush=st("fflush"),n._emscripten_stack_init=function(){return(ct=n._emscripten_stack_init=n.asm.emscripten_stack_init).apply(null,arguments)}),ft=(n._emscripten_stack_get_free=function(){return(n._emscripten_stack_get_free=n.asm.emscripten_stack_get_free).apply(null,arguments)},n._emscripten_stack_get_base=function(){return(n._emscripten_stack_get_base=n.asm.emscripten_stack_get_base).apply(null,arguments)},n._emscripten_stack_get_end=function(){return(ft=n._emscripten_stack_get_end=n.asm.emscripten_stack_get_end).apply(null,arguments)});function ut(){var t;ct(),D(!(3&(t=ft()))),S[t>>2]=34821223,S[t+4>>2]=2310721022,S[0]=1668509029}function dt(t){function s(){lt||(lt=!0,n.calledRun=!0,x||(D(!W),W=!0,U(),nt(G),i(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),D(!n._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(U(),n.postRun)for('function'==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)t=n.postRun.shift(),H.unshift(t);var t;nt(H)}()))}t=t||o,Y>0||(ut(),function(){if(n.preRun)for('function'==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)t=n.preRun.shift(),B.unshift(t);var t;nt(B)}(),Y>0||(n.setStatus?(n.setStatus('Running...'),setTimeout((function(){setTimeout((function(){n.setStatus('')}),1),s()}),1)):s(),U()))}if(n.stackSave=st("stackSave"),n.stackRestore=st("stackRestore"),n.stackAlloc=st("stackAlloc"),n.setValue=function(t,i,s="i8"){switch(s.endsWith('*')&&(s='*'),s){case'i1':case'i8':b[0|t]=i;break;case'i16':L[t>>1]=i;break;case'i32':R[t>>2]=i;break;case'i64':J=[i>>>0,($=i,+Math.abs($)>=1?$>0?(0|Math.min(+Math.floor($/4294967296),4294967295))>>>0:~~+Math.ceil(($-+(~~$>>>0))/4294967296)>>>0:0)],R[t>>2]=J[0],R[t+4>>2]=J[1];break;case'float':M[t>>2]=i;break;case'double':k[t>>3]=i;break;case'*':S[t>>2]=i;break;default:z('invalid type for setValue: '+s)}},n.getValue=function(t,i="i8"){switch(i.endsWith('*')&&(i='*'),i){case'i1':case'i8':return b[0|t];case'i16':return L[t>>1];case'i32':case'i64':return R[t>>2];case'float':return M[t>>2];case'double':return k[t>>3];case'*':return S[t>>2];default:z('invalid type for getValue: '+i)}return null},['run','UTF8ArrayToString','UTF8ToString','stringToUTF8Array','stringToUTF8','lengthBytesUTF8','addOnPreRun','addOnInit','addOnPreMain','addOnExit','addOnPostRun','addRunDependency','removeRunDependency','FS_createFolder','FS_createPath','FS_createDataFile','FS_createPreloadedFile','FS_createLazyFile','FS_createLink','FS_createDevice','FS_unlink','getLEB','getFunctionTables','alignFunctionTables','registerFunctions','prettyPrint','getCompilerSetting','print','printErr','callMain','abort','keepRuntimeAlive','wasmMemory','stackAlloc','stackSave','stackRestore','getTempRet0','setTempRet0','writeStackCookie','checkStackCookie','ptrToString','zeroMemory','stringToNewUTF8','exitJS','getHeapMax','emscripten_realloc_buffer','ENV','ERRNO_CODES','ERRNO_MESSAGES','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','DNS','getHostByName','Protocols','Sockets','getRandomDevice','warnOnce','traverseStack','UNWIND_CACHE','convertPCtoSourceLocation','readAsmConstArgsArray','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','handleException','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','freeTableIndexes','functionsInTableMap','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','PATH','PATH_FS','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16Decoder','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeArrayToMemory','writeAsciiToMemory','SYSCALLS','getSocketFromFD','getSocketAddress','JSEvents','registerKeyEventCallback','specialHTMLTargets','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','currentFullscreenStrategy','restoreOldWindowedStyle','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','demangle','demangleAll','jsStackTrace','stackTrace','ExitStatus','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','dlopenMissingError','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','uncaughtExceptionCount','exceptionLast','exceptionCaught','ExceptionInfo','exception_addRef','exception_decRef','Browser','setMainLoop','wget','FS','MEMFS','TTY','PIPEFS','SOCKFS','_setNetworkCallback','tempFixedLengthArray','miniTempWebGLFloatBuffers','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','GL','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','AL','SDL_unicode','SDL_ttfContext','SDL_audio','SDL','SDL_gfx','GLUT','EGL','GLFW_Window','GLFW','GLEW','IDBStore','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){Object.getOwnPropertyDescriptor(n,t)||Object.defineProperty(n,t,{configurable:!0,get:function(){var i="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";C(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),z(i)}})})),['ptrToString','zeroMemory','stringToNewUTF8','exitJS','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','getHostByName','getRandomDevice','traverseStack','convertPCtoSourceLocation','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeAsciiToMemory','getSocketFromFD','getSocketAddress','registerKeyEventCallback','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','ExceptionInfo','exception_addRef','exception_decRef','setMainLoop','_setNetworkCallback','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','SDL_unicode','SDL_ttfContext','SDL_audio','GLFW_Window','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){'undefined'==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var i='`'+t+'` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line';C(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),rt(i)}})})),K=function t(){lt||dt(),lt||(K=t)},n.preInit)for('function'==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return dt(),t.ready})}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var s=n[t]={exports:{}};return e[t](s,s.exports,r),s.exports}r.m=e,t="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",i="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",s="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",h=t=>{t&&t.d<1&&(t.d=1,t.forEach((t=>t.r--)),t.forEach((t=>t.r--?t.r++:t())))},r.a=(e,n,r)=>{var o;r&&((o=[]).d=-1);var l,a,c,f=new Set,u=e.exports,d=new Promise(((t,i)=>{c=i,a=t}));d[i]=u,d[t]=t=>(o&&t(o),f.forEach(t),d.catch((t=>{}))),e.exports=d,n((e=>{var n;l=(e=>e.map((e=>{if(null!==e&&"object"==typeof e){if(e[t])return e;if(e.then){var n=[];n.d=0,e.then((t=>{r[i]=t,h(n)}),(t=>{r[s]=t,h(n)}));var r={};return r[t]=t=>t(n),r}}var o={};return o[t]=t=>{},o[i]=e,o})))(e);var r=()=>l.map((t=>{if(t[s])throw t[s];return t[i]})),a=new Promise((i=>{(n=()=>i(r)).r=0;var s=t=>t!==o&&!f.has(t)&&(f.add(t),t&&!t.d&&(n.r++,t.push(n)));l.map((i=>i[t](s)))}));return n.r?a:r()}),(t=>(t?c(d[s]=t):a(u),h(o)))),o&&o.d<0&&(o.d=0)},r.d=(t,i)=>{for(var s in i)r.o(i,s)&&!r.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:i[s]})},r.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),r.p="/Client2/",r.b=document.baseURI||self.location.href;r(7906)})(); \ No newline at end of file +(()=>{"use strict";var t,i,s,h,e={1651:(t,i,s)=>{s.d(i,{K:()=>k});var h=s(1120),e=s(4583),n=s(2901),r=s(1069),o=s(7046),l=(s(9896),s(6666)),a=s(3045),c=s(818),f=s(670),u=s(8268),d=s(3867),w=s(7854),A=s(8950),y=s(1302),p=s(9298),m=s(8665),I=s(1312),_=s(3819),E=s(8317),g=s(9234),C=s(1908),T=s(123),O=s(5637),b=s(6948),v=s(2164),L=s(8738),R=s(3764),S=s(8534),M=s(6730);class k extends o.A{static tt=225;static it=10;static portOffset=0;static members=!0;static st=!1;static ht='';static et='';static nt=!1;static rt=2;static ot=!1;static lt='https://raw.githubusercontent.com/2004scape/Server/main';static exponent=58778699976184461502525193738213253649000149147835990136706041084440742975821n;static ct=7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789n;static ft=0;static ut=0;static dt=0;static wt=0;static At=0;static yt=0;static It=0;static _t=0;static Et=0;static gt=0;static Ct=0;static Tt=0;static Ot=0;static bt=0;static vt=0;static Lt=()=>{a.A.st=!1,e.A.st=!1,k.st=!1,c.A.st=!1};static Rt=()=>{a.A.st=!0,e.A.st=!0,k.st=!0,c.A.st=!0};St=2048;Mt=2047;kt=!1;xt=!1;Dt=!1;Nt=!1;db=null;Pt=0;Ft=[];stream=null;in=r.A.Ut(1);Bt=r.A.Ut(1);Gt=r.A.Ut(1);Ht=0n;Wt=0;Yt=0;Vt=0;Kt=null;Xt=0;packetSize=0;zt=0;jt=0;Zt=0;qt=null;$t=!0;Jt=0;Qt=0;ti=null;ii=null;si=null;hi=null;ei=null;ni=null;ri=null;oi=null;li=null;ai=null;ci=null;fi='';ui='';username='';password='';di=null;wi=null;Ai=null;yi=null;pi=[];mi=!1;Ii=null;_i=null;Ei=null;gi=null;Ci=null;Ti=null;Oi=null;bi=null;vi=null;Li=null;Ri=new Int32Array(256);Si=0;Mi=0;ki=0;xi=null;Di=null;Ni=null;Pi=null;Fi=null;Ui=null;Bi=null;Gi=null;Hi=null;Wi=null;Yi=null;Vi=null;Ki=null;Xi=null;zi=null;ji=null;Zi=null;qi=null;$i=null;Ji=null;Qi=null;ts=new Int32Array(33);ss=new Int32Array(33);hs=new Int32Array(151);es=new Int32Array(151);ns=null;rs=null;os=null;ls=null;cs=null;fs=null;us=new d.ds(13,null);ws=null;As=null;ys=new d.ds(50,null);ps=new d.ds(50,null);Is=new d.ds(20,null);_s=new d.ds(20,null);Es=null;gs=new d.ds(8,null);Cs=null;Ts=null;Os=null;bs=null;vs=null;Ls=null;Rs=null;Ss=null;Ms=null;ks=null;xs=null;Ds=null;Ns=null;Ps=null;Fs=null;Us=null;Bs=null;Gs=null;Hs=new d.ds(1e3,null);Ws=!1;Ys=!1;Vs=!1;Ks=!1;Xs=-1;zs=0;js=0;Zs=0;qs=0;$s=0;Js=0;Qs=!1;th=0;ih=0;sh=0;hh=0;eh=0;nh=0;rh=[];oh=-1;lh=-1;ah=new h.A;fh=78;uh=0;dh=0;wh=[];Ah=0;yh=0;ph=0;mh=0;Ih=0;_h=0;Eh=0;gh=0;Ch=[];Th=[];Oh=[];bh=[];Lh=null;Rh=-1;Sh=3;Mh=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];kh=0;xh=0;Dh=0;Nh=!1;Ph=0;Fh=!1;Uh='';Bh='';Gh=0;Hh='';Wh=!1;Yh=-1;Vh=new d.ds(100,null);Kh=new d.ds(100,null);messageType=new Int32Array(100);Xh=new Int32Array(100);zh=0;jh=0;Zh=0;qh='';$h=0;Jh=0;Qh=0;te=0;ie=0;se=0;he=0;ee=0;ne=0;re=!1;oe=0;le=0;ae=0;ce=0;fe=null;ue=0;de=0;we=0;Ae=0;ye=!1;pe=[];me=[];Ie=0;_e=0;Ee=0;ge=null;Ce=0;Te=new Int32Array(500);Oe=new Int32Array(500);be=new Int32Array(500);ve=new Int32Array(500);Le=0;Re=0;Se=0;Me='';ke=!1;xe=-1;De=0;Ne=0;Pe=0;Fe=0;Ue=0;Be=new Int32Array(1e3);Ge=new Int32Array(1e3);He=null;We=0;Ye=0;Ve=0;Ke=0;Xe=0;ze=!1;je=0;Ze=0;qe=0;$e=0;Je=2;Qe=2;tn=1;sn=new Int32Array(5);hn=new d.ds(5,!1);en=new Int32Array(5);nn=new Int32Array(5);rn=new Int32Array(5);ln=0;an=0;cn=0;fn=0;un=0;dn=0;wn=0;An=0;yn=0;pn=1;mn=2;In=-1;_n=0;En=0;gn=0;Cn=0;Tn=0;On=0;bn=null;vn=null;Ln=null;Rn=0;Sn=0;Mn=new Int8Array(16384);kn=new d.ds(f.A.xn,null);Dn=0;Nn=0;Pn=128;Fn=0;Un=0;Bn=0;Gn=0;Hn=0;Wn=null;Yn=null;Vn=new d.Kn(f.A.Xn,f.A.Xn);zn=0;jn=0;Zn=0;qn=0;$n=0;Jn=0;Qn=0;tr=0;ir=0;sr=0;hr=0;er=0;nr=new d.ds(this.St,null);rr=0;lr=new Int32Array(this.St);ar=0;cr=0;ur=new Int32Array(this.St);dr=new Int32Array(1e3);wr=new d.ds(this.St,null);Ar=new d.ds(8192,null);yr=0;pr=new Int32Array(8192);mr=new l.A;Ir=new l.A;_r=new l.A;Er=new l.A;gr=new d.Cr(f.A.xn,f.A.Xn,f.A.Xn,null);Tr=new l.A;Or=new Int32Array(4e3);br=new Int32Array(4e3);vr=new Int32Array(f.A.Xn*f.A.Xn);Lr=new Int32Array(f.A.Xn*f.A.Xn);Rr=0;Sr=null;Mr=0;kr=0;Dr=-1;Nr=0;Pr=0;Fr=0;Ur=0;Br=!1;Gr=!0;Hr=!1;Wr=new Int32Array(7);Yr=new Int32Array(5);Vr=0;Kr=0;static Xr=50;zr=new Int32Array(k.Xr);jr=new Int32Array(k.Xr);Zr=new Int32Array(k.Xr);qr=new Int32Array(k.Xr);$r=new Int32Array(k.Xr);Jr=new Int32Array(k.Xr);Qr=new Int32Array(k.Xr);io=new d.ds(k.Xr,null);so=new d.ds(100,null);ho=new BigInt64Array(100);eo=new Int32Array(100);no=null;ro=0;oo=!0;lo=new Int32Array(50);ao=new Int32Array(50);co=new Int32Array(50);fo=192;uo=-1;do=-1;wo=0;Ao=0;yo=0;po=!0;mo=null;Io=0;_o=0;Eo=192;Co=new d.ds(16,null);To=0;Oo=!1;bo=()=>{try{this.stream&&this.stream.close()}catch(t){}this.stream=null,(0,T.vo)(),this.Bt=null,this.Gt=null,this.in=null,this.Ln=null,this.bn=null,this.vn=null,this.Wn=null,this.Yn=null,this.He=null,this.kn=null,this.vr=null,this.Lr=null,this.Or=null,this.br=null,this.Mn=null,this.Di=null,this.Ni=null,this.Pi=null,this.Fi=null,this.Ui=null,this.Bi=null,this.Gi=null,this.Hi=null,this.Wi=null,this.Yi=null,this.Vi=null,this.Ki=null,this.Xi=null,this.zi=null,this.ji=null,this.Zi=null,this.qi=null,this.ns=null,this.os=null,this.rs=null,this.ls=null,this.cs=null,this.fs=null,this.us=null,this.Rs=null,this.Ss=null,this.Ms=null,this.ks=null,this.xs=null,this.Ds=null,this.Ns=null,this.Ps=null,this.Fs=null,this.Us=null,this.As=null,this.Is=null,this._s=null,this.gs=null,this.Cs=null,this.Ts=null,this.Os=null,this.bs=null,this.ys=null,this.ps=null,this.Vn=null,this.nr=null,this.lr=null,this.ur=null,this.wr=null,this.dr=null,this.Ar=null,this.pr=null,this.gr=null,this.Tr=null,this.Er=null,this.mr=null,this.Ir=null,this._r=null,this.be=null,this.ve=null,this.Te=null,this.Oe=null,this.rh=null,this.pe=null,this.Be=null,this.Ge=null,this.Hs=null,this.ws=null,this.so=null,this.ho=null,this.eo=null,this.hi=null,this.ei=null,this.ti=null,this.ii=null,this.si=null,this.ni=null,this.ri=null,this.oi=null,this.li=null,this.Lo(),O.A.bo(),b.A.bo(),y.A.bo(),v.A.Ro=null,E.A.Ro=null,h.A.Ro=null,I.A.Ro=null,L.A.Ro=null,L.A.So=null,R.A.Ro=null,this.Mo=null,u.A.So=null,e.A.bo(),a.A.bo(),m.A.bo(),S.A.Ro=[],M.A.Ro=[]};ko(){return this.Jt}xo(){return this.Wh}Do(){return this.Fh}No(){return this.lh}Po(){return this.Xs}Lo=()=>{this.mi=!1,this.xi&&(clearInterval(this.xi),this.xi=null),this.ai=null,this.ci=null,this.pi=[],this.Oi=null,this.bi=null,this.vi=null,this.Li=null,this.gi=null,this.Ei=null,this.Ci=null,this.Ti=null,this.Ii=null,this._i=null};Fo=async(t,i,s,h)=>{let e=5,o=await(this.db?.Uo(t));if(o&&r.A.Bo(o)!==s&&(o=void 0),o)return new n.A(o);for(;!o;){await this.Go(h,`Requesting ${i}`);try{o=await(0,g.Ho)(`${k.et}/${t}${s}`)}catch(t){o=void 0;for(let t=e;t>0;t--)await this.Go(h,`Error loading - Will retry in ${t} secs.`),await(0,g.Wo)(1e3);e*=2,e>60&&(e=60)}}return await(this.db?.Yo(t,o)),new n.A(o)};Vo=async(t,i,s)=>{let h=await(this.db?.Uo(t+'.mid'));if(h&&12345678!==i&&r.A.Bo(h)!==i&&(h=void 0),!h)try{h=await(0,g.Ho)(`${k.et}/${t}_${i}.mid`),s!==h.length&&(h=h.slice(0,s))}catch(t){}if(!h)return;await(this.db?.Yo(t+'.mid',h));const e=new r.A(Uint8Array.from(h)).Ko,n=C.A.read(e,h,s,4);(0,T.Xo)(n,this.Eo)};zo=()=>{if(w.jo.fillStyle='black',w.jo.fillRect(0,0,this.width,this.height),this.Zo(1),this.Dt){this.mi=!1,w.jo.font='bold 16px helvetica, sans-serif',w.jo.textAlign='left',w.jo.fillStyle='yellow';let t=35;w.jo.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,w.jo.fillStyle='white',w.jo.fillText('To fix this try the following (in order):',30,t),t+=50,w.jo.font='bold 12px helvetica, sans-serif',w.jo.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.jo.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,w.jo.fillText('3: Try using a different game-world',30,t),t+=30,w.jo.fillText('4: Try rebooting your computer',30,t),t+=30,w.jo.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.Nt&&(this.mi=!1,w.jo.font='bold 20px helvetica, sans-serif',w.jo.textAlign='left',w.jo.fillStyle='white',w.jo.fillText('Error - unable to load game!',50,50),w.jo.fillText('To play RuneScape make sure you play from',50,100),w.jo.fillText('https://2004scape.org',50,150)),this.xt){this.mi=!1,w.jo.font='bold 13px helvetica, sans-serif',w.jo.textAlign='left',w.jo.fillStyle='yellow';let t=35;w.jo.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,w.jo.fillStyle='white',w.jo.fillText('To fix this try the following (in order):',30,t),t+=50,w.jo.font='bold 12px helvetica, sans-serif',w.jo.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.jo.fillText('2: Try rebooting your computer, and reloading',30,t)}};qo=t=>{if(!t.$o)return!1;for(let i=0;i=h)return!1}else if(3===t.$o[i]){if(s<=h)return!1}else if(4===t.$o[i]){if(s===h)return!1}else if(s!==h)return!1}return!0};tl=(t,i,s,h,e)=>{this.vs?.draw(t,i),this.Ls?.draw(t,i+e-16),A.A.fillRect(t,i+16,16,e-32,p.A.il);let n=(e-32)*e/h|0;n<8&&(n=8);const r=(e-n-32)*s/(h-e)|0;A.A.fillRect(t,i+r+16,16,n,p.A.sl),A.A.hl(t,i+r+16,p.A.el,n),A.A.hl(t+1,i+r+16,p.A.el,n),A.A.nl(t,i+r+16,p.A.el,16),A.A.nl(t,i+r+17,p.A.el,16),A.A.hl(t+15,i+r+16,p.A.rl,n),A.A.hl(t+14,i+r+17,p.A.rl,n-1),A.A.nl(t,i+r+n+15,p.A.rl,16),A.A.nl(t+1,i+r+n+14,p.A.rl,15)};ol=(t,i)=>{let s=!1;const e=h.A.Ro[t];if(!e.ll)return!1;for(let t=0;th.delay[n.ul];)n.fl-=h.delay[n.ul]+1,n.ul++,n.ul>=h.dl&&(n.ul-=h.wl,(n.ul<0||n.ul>=h.dl)&&(n.ul=0)),s=!0}}}return s};Al=(t,i,s,n,r=!1)=>{if(0!==t.type||!t.ll||t.hide&&this.$h!==t.id&&this.Jh!==t.id&&this.Qh!==t.id)return;const o=A.A.left,l=A.A.top,a=A.A.right,c=A.A.bottom;A.A.yl(i,s,i+t.width,s+t.height);const f=t.ll.length;for(let o=0;o0&&this.gl(c),c.type===h.A.Cl)c.Tl>c.scroll-c.height&&(c.Tl=c.scroll-c.height),c.Tl<0&&(c.Tl=0),this.Al(c,l,a,c.Tl,r),c.scroll>c.height&&this.tl(l+c.width,a,c.Tl,c.scroll,c.height);else if(c.type===h.A.Ol){let t=0;for(let i=0;i0){let i=0,s=0;const n=c.Ll[t]-1;if(h>=-32&&h<=512&&e>=-32&&e<=334||0!==this.se&&this.ie===t){const r=y.A.kl(n,c.Rl[t]);if(0!==this.se&&this.ie===t&&this.te===c.id?(i=this.xl-this.he,s=this.Dl-this.ee,i<5&&i>-5&&(i=0),s<5&&s>-5&&(s=0),this.ne<5&&(i=0,s=0),r.Nl(128,h+i,e+s)):0!==this.ue&&this.de===t&&this.we===c.id?r.Nl(128,h,e):r.draw(h,e),33===r.Pl||1!==c.Rl[t]){const n=c.Rl[t];this.di?.Fl(h+i+1,e+10+s,this.Ul(n),p.A.Bl),this.di?.Fl(h+i,e+9+s,this.Ul(n),p.A.Gl)}}}else if(c.Hl&&t<20){const i=c.Hl[t];i?.draw(h,e)}t++}}else if(c.type===h.A.Wl)c.fill?A.A.fillRect(l,a,c.width,c.height,c.Yl):A.A.Il(l,a,c.width,c.height,c.Yl);else if(c.type===h.A.Vl){const t=c.font;let i=c.Yl,s=c.text;if(this.Qh!==c.id&&this.Jh!==c.id&&this.$h!==c.id||0===c.Kl||(i=c.Kl),this.qo(c)&&(i=c.Xl,c.zl&&c.zl.length>0&&(s=c.zl)),c.jl===h.A.Zl&&this.ye&&(s='Please wait...',i=c.Yl),!t||!s)continue;for(let h=a+t.height;s.length>0;h+=t.height){if(-1!==s.indexOf('%')){for(;;){const t=s.indexOf('%1');if(-1===t)break;s=s.substring(0,t)+this.ql(this.Jo(c,0))+s.substring(t+2)}for(;;){const t=s.indexOf('%2');if(-1===t)break;s=s.substring(0,t)+this.ql(this.Jo(c,1))+s.substring(t+2)}for(;;){const t=s.indexOf('%3');if(-1===t)break;s=s.substring(0,t)+this.ql(this.Jo(c,2))+s.substring(t+2)}for(;;){const t=s.indexOf('%4');if(-1===t)break;s=s.substring(0,t)+this.ql(this.Jo(c,3))+s.substring(t+2)}for(;;){const t=s.indexOf('%5');if(-1===t)break;s=s.substring(0,t)+this.ql(this.Jo(c,4))+s.substring(t+2)}}const e=s.indexOf('\\n');let n;-1!==e?(n=s.substring(0,e),s=s.substring(e+2)):(n=s,s=''),c.$l?t.Jl(l+(c.width/2|0),h,n,i,c.Ql):t.ta(l,h,n,i,c.Ql)}}else if(c.type===h.A.ia){let t;t=this.qo(c)?c.sa:c.ha,t?.draw(l,a)}else if(c.type===h.A.ea){const t=e.A.na,i=e.A.ra;e.A.na=l+(c.width/2|0),e.A.ra=a+(c.height/2|0);const s=e.A.sin[c.oa]*c.zoom>>16,h=e.A.cos[c.oa]*c.zoom>>16,n=this.qo(c);let r;r=n?c.cl:c.al;let o=null;if(-1===r)o=c.la(-1,-1,n);else{const t=I.A.Ro[r];t.frames&&t.aa&&(o=c.la(t.frames[c.ul],t.aa[c.ul],n))}o&&o.ca(0,c.fa,0,c.oa,0,s,h),e.A.na=t,e.A.ra=i}else if(c.type===h.A.ua){const t=c.font;if(!t||!c.Ll||!c.Rl)continue;let i=0;for(let s=0;s0){const e=y.A.get(c.Ll[i]-1);let n=e.name;if((e.da||1!==c.Rl[i])&&(n=n+' x'+this.wa(c.Rl[i])),!n)continue;const r=l+h*(c.Sl+115),o=a+s*(c.Ml+12);c.$l?t.Jl(r+(c.width/2|0),o,n,c.Yl,c.Ql):t.ta(r,o,n,c.Yl,c.Ql)}i++}}}A.A.yl(o,l,a,c)};gl=t=>{let i=t.El;if(i>=h.A.Aa&&i<=h.A.ya)i--,i>=this.Vr?(t.text='',t.jl=0):(t.text=this.so[i],t.jl=1);else if(i>=h.A.pa&&i<=h.A.ma)i-=h.A.pa,i>=this.Vr?(t.text='',t.jl=0):(0===this.eo[i]?t.text='@red@Offline':this.eo[i]===k.it?t.text='@gre@World-'+(this.eo[i]-9):t.text='@yel@World-'+(this.eo[i]-9),t.jl=1);else if(i===h.A.Ia)t.scroll=15*this.Vr+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i>=h.A._a&&i<=h.A.Ea)i-=h.A._a,i>=this.dh?(t.text='',t.jl=0):(t.text=_.A.ga(_.A.Ca(this.wh[i])),t.jl=1);else if(i===h.A.Ta)t.scroll=15*this.dh+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i===h.A.Oa){if(t.oa=150,t.fa=256*Math.sin(this.Pt/40)&2047,this.Hr){this.Hr=!1;const i=new d.ds(7,null);let s=0;for(let t=0;t<7;t++){const h=this.Wr[t];h>=0&&(i[s++]=E.A.Ro[h].la())}const h=m.A.ba(i,s);for(let t=0;t<5;t++)0!==this.Yr[t]&&(h.va(u.A.La[t][0],u.A.La[t][this.Yr[t]]),1===t&&h.va(u.A.Ra[0],u.A.Ra[this.Yr[t]]));if(this.Sr){const i=I.A.Ro[this.Sr.Sa].frames;i&&(h.Ma(),h.ka(i[0]),h.xa(64,850,-30,-50,-30,!0),t.model=h)}}}else if(i===h.A.Da)this.Bs||(this.Bs=t.ha,this.Gs=t.sa),this.Gr?t.ha=this.Gs:t.ha=this.Bs;else if(i===h.A.Na)this.Bs||(this.Bs=t.ha,this.Gs=t.sa),this.Gr?t.ha=this.Bs:t.ha=this.Gs;else if(i===h.A.Pa)t.text=this.Me,this.Pt%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(i===h.A.Fa)this.Br?this.ke?(t.Yl=p.A.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.Yl=p.A._l,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(i===h.A.Ua||i===h.A.Ba)if(0===this.De)t.text='';else{let i;i=0===this.Ne?'earlier today':1===this.Ne?'yesterday':this.Ne+' days ago',t.text='You last logged in '+i+' from: '+_.A.Ga(this.De)}else if(i===h.A.Ha)0===this.Fe&&(t.text='0 unread messages',t.Yl=p.A.Gl),1===this.Fe&&(t.text='1 unread message',t.Yl=p.A.GREEN),this.Fe>1&&(t.text=this.Fe+' unread messages',t.Yl=p.A.GREEN);else if(i===h.A.Wa)if(201===this.Pe)t.text='';else if(200===this.Pe)t.text='You have not yet set any password recovery questions.';else{let i;i=0===this.Pe?'Earlier today':1===this.Pe?'Yesterday':this.Pe+' days ago',t.text=i+' you changed your recovery questions'}else i===h.A.Ya?201===this.Pe?t.text='':200===this.Pe?t.text='We strongly recommend you do so now to secure your account.':t.text='If you do not remember making this change then cancel it immediately':i===h.A.Va&&(201===this.Pe?t.text='':(this.Pe,t.text="Do this from the 'account management' area on our front webpage"))};Jo=(t,i)=>{if(!t.scripts||i>=t.scripts.length)return-2;try{const s=t.scripts[i];if(!s)return-1;let e=0,n=0;for(;;){const t=s[n++];if(0===t)return e;if(1===t)e+=this.Th[s[n++]];else if(2===t)e+=this.Oh[s[n++]];else if(3===t)e+=this.Ch[s[n++]];else if(4===t){const t=h.A.Ro[s[n++]],i=s[n++]+1;if(t.Ll&&t.Rl)for(let s=0;st<999999999?String(t):'*';wa=t=>{let i=String(t);for(let t=i.length-3;t>0;t-=3)i=i.substring(0,t)+','+i.substring(t);return i.length>8?i='@gre@'+i.substring(0,i.length-8)+' million @whi@('+i+')':i.length>4&&(i='@cya@'+i.substring(0,i.length-4)+'K @whi@('+i+')'),' '+i};Ul=t=>t<1e5?String(t):t<1e7?(t/1e3|0)+'K':(t/1e6|0)+'M'}},7604:(t,i,s)=>{s.d(i,{w:()=>r});var h=s(7046),e=s(1651),n=s(9234);async function r(){await async function(){0===h.A.getParameter('world').length&&h.A.setParameter('world','1');'localhost'===window.location.hostname&&'0'===h.A.getParameter('world')?(e.K.ht='http://localhost',e.K.et='http://localhost',e.K.portOffset=0):await async function(t){const i=await o(t,parseInt(h.A.getParameter('world'),10)),s=new URL(i.address);e.K.it=10+i.id-1,e.K.ht=`${s.protocol}//${s.hostname}`,e.K.et=`${s.protocol}//${s.hostname}:${s.port}`,t||(e.K.ht=e.K.ht.replace('https:','http:'));e.K.portOffset=i.portOffset,e.K.members=!0===i?.members,h.A.setParameter('world',i.id.toString(10))}(window.location.protocol.startsWith('https'))}(),function(){0===h.A.getParameter('detail').length&&h.A.setParameter('detail','high');'low'===h.A.getParameter('detail')?e.K.Rt():e.K.Lt()}(),0===h.A.getParameter('method').length&&h.A.setParameter('method','0')}async function o(t,i,s=0){if(s>=10)throw new Error('could not find world to connect!');const h=t?'https:':'http:';let e;try{e=JSON.parse(await(0,n.Xa)(`${h}//2004scape.org/api/v1/worldlist`))}catch(h){return await(0,n.Wo)(1e3),o(t,i,++s)}e.push({id:0,region:'Local Development',address:'http://localhost',portOffset:0,members:!0,nr:0});const r=e.find((t=>t.id===i));return r||o(t,i,10)}},7906:(t,i,s)=>{s.a(t,(async(t,i)=>{try{var h=s(1312),e=s(5637),n=s(1302),r=s(6948),o=s(8317),l=s(8738),a=s(3764),c=s(1120),f=s(1183),u=s(8950),d=s(4583),w=s(1673),A=s(2511),y=s(2682),p=s(8665),m=s(9298),I=s(1069),_=s(3554),E=s(353),g=s(2634),C=s(4544),T=s(2215),O=s(3955),b=s(7953),v=s(2646),L=s(3937),R=(s(9896),s(1908)),S=s(6666),M=s(3819),k=s(2595),x=s(3045),D=s(818),N=s(5599),P=s(1023),F=s(6169),U=s(2630),B=s(5327),G=s(670),H=s(9456),W=s(8268),Y=s(8412),V=s(3606),K=s(4197),X=s(254),z=s(7628),j=s(123),Z=s(9234),q=s(3867),$=s(1651),J=s(8534),Q=s(6730),tt=s(2164),it=s(7604),st=s(3795),ht=s(4909);class t extends $.K{load=async()=>{if(this.kt)this.xt=!0;else{this.kt=!0;try{await this.Go(10,'Connecting to fileserver'),await R.A.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new C.A(await C.A.openDatabase());const t=new I.A(new Uint8Array(await(0,Z.Ho)(`${$.K.et}/crc`)));for(let i=0;i<9;i++)this.Ft[i]=t.Ko;$.K.st||await this.Vo('scape_main',12345678,4e4);const i=await this.Fo('title','title screen',this.Ft[1],10);this.qt=i,this.di=y.A.za(i,'p11'),this.wi=y.A.za(i,'p12'),this.Ai=y.A.za(i,'b12'),this.yi=y.A.za(i,'q8'),await this.ja(),this.Za();const s=await this.Fo('config','config',this.Ft[2],15),u=await this.Fo('interface','interface',this.Ft[3],20),m=await this.Fo('media','2d graphics',this.Ft[4],30),_=await this.Fo('models','3d graphics',this.Ft[5],40),E=await this.Fo('textures','textures',this.Ft[6],60),g=await this.Fo('wordenc','chat system',this.Ft[7],65),T=await this.Fo('sounds','sound effects',this.Ft[8],70);this.Yn=new q.qa(G.A.xn,G.A.Xn,G.A.Xn),this.Wn=new q.$a(G.A.xn,G.A.Xn+1,G.A.Xn+1),this.Wn&&(this.He=new x.A(this.Wn,G.A.Xn,G.A.xn,G.A.Xn));for(let t=0;t34||t>34))999===i&&(i=h);else if(999!==i){s=h;break}this.hs[t-9]=i-21,this.es[t-9]=s-i}d.A.rc(479,96),this.$i=d.A.oc,d.A.rc(190,261),this.Ji=d.A.oc,d.A.rc(512,334),this.Qi=d.A.oc;const V=new Int32Array(9);for(let t=0;t<9;t++){const i=32*t+128+15,s=3*i+600,h=d.A.sin[i];V[t]=s*h>>16}x.A.init(512,334,500,800,V),b.A.ec(g),this.lc()}catch(t){console.error(t),this.Dt=!0}}};update=async()=>{this.xt||this.Dt||this.Nt||(this.Pt++,this.ac?await this.cc():await this.fc())};draw=async()=>{this.xt||this.Dt||this.Nt?this.zo():(this.ac?this.uc():await this.dc(),this.zs=0)};refresh=()=>{this.$t=!0};Go=async(t,i)=>{if(console.log(`${t}%: ${i}`),await this.wc(),!this.qt)return void await super.Go(t,i);this.si?.bind();this.Ai?.Ac(180,54,'RuneScape is loading - please wait...',m.A._l);u.A.Il(28,62,304,34,m.A.yc),u.A.Il(29,63,302,32,m.A.Bl),u.A.fillRect(30,64,3*t,30,m.A.yc),u.A.fillRect(30+3*t,64,300-3*t,30,m.A.Bl),this.Ai?.Ac(180,85,i,m.A._l),this.si?.draw(214,186),this.$t&&(this.$t=!1,this.mi||(this.hi?.draw(0,0),this.ei?.draw(661,0)),this.ti?.draw(128,0),this.ii?.draw(214,386),this.ni?.draw(0,265),this.ri?.draw(574,265),this.oi?.draw(128,186),this.li?.draw(574,186)),await(0,Z.Wo)(5)};mc=()=>{this.mi&&(this.Ic(),this.Ic(),this._c())};wc=async()=>{this.ti||(this.Mo=null,this.Fi=null,this.Ni=null,this.Di=null,this.Pi=null,this.Ui=null,this.Bi=null,this.Gi=null,this.hi=new f.A(128,265),u.A.clear(),this.ei=new f.A(128,265),u.A.clear(),this.ti=new f.A(533,186),u.A.clear(),this.ii=new f.A(360,146),u.A.clear(),this.si=new f.A(360,200),u.A.clear(),this.ni=new f.A(214,267),u.A.clear(),this.ri=new f.A(215,267),u.A.clear(),this.oi=new f.A(86,79),u.A.clear(),this.li=new f.A(87,79),u.A.clear(),this.qt&&(await this.ja(),this.Za()),this.$t=!0)};ja=async()=>{if(!this.qt)return;const t=await A.A.Ec(this.qt,'title');this.hi?.bind(),t.tc(0,0),this.ei?.bind(),t.tc(-661,0),this.ti?.bind(),t.tc(-128,0),this.ii?.bind(),t.tc(-214,-386),this.si?.bind(),t.tc(-214,-186),this.ni?.bind(),t.tc(0,-265),this.ri?.bind(),t.tc(-128,-186),this.oi?.bind(),t.tc(-128,-186),this.li?.bind(),t.tc(-574,-186),t.Ja(),this.hi?.bind(),t.tc(394,0),this.ei?.bind(),t.tc(-267,0),this.ti?.bind(),t.tc(266,0),this.ii?.bind(),t.tc(180,-386),this.si?.bind(),t.tc(180,-186),this.ni?.bind(),t.tc(394,-265),this.ri?.bind(),t.tc(-180,-265),this.oi?.bind(),t.tc(212,-186),this.li?.bind(),t.tc(-180,-186);const i=A.A.za(this.qt,'logo');this.ti?.bind(),i.draw((this.width/2|0)-(i.width/2|0)-128,18)};gc=t=>{if(!this.gi||!this.Ei)return;this.gi.fill(0);for(let t=0;t<5e3;t++){const t=128*Math.random()*256|0;this.gi[t]=256*Math.random()|0}for(let t=0;t<20;t++){for(let t=1;t<255;t++)for(let i=1;i<127;i++){const s=i+(t<<7);this.Ei[s]=(this.gi[s-1]+this.gi[s+1]+this.gi[s-128]+this.gi[s+128])/4|0}const t=this.gi;this.gi=this.Ei,this.Ei=t}if(t){let i=0;for(let s=0;s{if(this.qt){this.ai=w.A.za(this.qt,'titlebox'),this.ci=w.A.za(this.qt,'titlebutton');for(let t=0;t<12;t++)this.pi[t]=w.A.za(this.qt,'runes',t);this.Ii=new A.A(128,265),this._i=new A.A(128,265),this.hi&&(0,Z.Oc)(this.hi.nc,0,this.Ii.nc,0,33920),this.ei&&(0,Z.Oc)(this.ei.nc,0,this._i.nc,0,33920),this.bi=new Int32Array(256);for(let t=0;t<64;t++)this.bi[t]=262144*t;for(let t=0;t<64;t++)this.bi[t+64]=1024*t+m.A.RED;for(let t=0;t<64;t++)this.bi[t+128]=4*t+m.A.Gl;for(let t=0;t<64;t++)this.bi[t+192]=m.A._l;this.vi=new Int32Array(256);for(let t=0;t<64;t++)this.vi[t]=1024*t;for(let t=0;t<64;t++)this.vi[t+64]=4*t+m.A.GREEN;for(let t=0;t<64;t++)this.vi[t+128]=262144*t+m.A.bc;for(let t=0;t<64;t++)this.vi[t+192]=m.A._l;this.Li=new Int32Array(256);for(let t=0;t<64;t++)this.Li[t]=4*t;for(let t=0;t<64;t++)this.Li[t+64]=262144*t+m.A.BLUE;for(let t=0;t<64;t++)this.Li[t+128]=1024*t+m.A.vc;for(let t=0;t<64;t++)this.Li[t+192]=m.A._l;this.Oi=new Int32Array(256),this.gi=new Int32Array(32768),this.Ei=new Int32Array(32768),this.gc(null),this.Ci=new Int32Array(32768),this.Ti=new Int32Array(32768),this.Go(10,'Connecting to fileserver').then((()=>{this.mi||(this.mi=!0,this.xi=setInterval(this.mc,35))}))}};fc=async()=>{if(0===this.Jt){let t=(this.width/2|0)-80,i=20+(this.height/2|0);i+=20,1===this.Lc&&this.Rc>=t-75&&this.Rc<=t+75&&this.Sc>=i-20&&this.Sc<=i+20&&(this.Jt=3,this.Qt=0),t=80+(this.width/2|0),1===this.Lc&&this.Rc>=t-75&&this.Rc<=t+75&&this.Sc>=i-20&&this.Sc<=i+20&&(this.fi='',this.ui='Enter your username & password.',this.Jt=2,this.Qt=0)}else if(2===this.Jt){let t=(this.height/2|0)-40;t+=30,t+=25,1===this.Lc&&this.Sc>=t-15&&this.Sc=t-15&&this.Sc=i-75&&this.Rc<=i+75&&this.Sc>=s-20&&this.Sc<=s+20&&await this.Mc(this.username,this.password,!1),i=80+(this.width/2|0),1===this.Lc&&this.Rc>=i-75&&this.Rc<=i+75&&this.Sc>=s-20&&this.Sc<=s+20&&(this.Jt=0,this.username='',this.password='');;){const t=this.kc();if(-1===t)return;let i=!1;for(let s=0;s0&&(this.username=this.username.substring(0,this.username.length-1)),9!==t&&10!==t&&13!==t||(this.Qt=1),i&&(this.username=this.username+String.fromCharCode(t)),this.username.length>12&&(this.username=this.username.substring(0,12))):1===this.Qt&&(8===t&&this.password.length>0&&(this.password=this.password.substring(0,this.password.length-1)),9!==t&&10!==t&&13!==t||(this.Qt=0),i&&(this.password=this.password+String.fromCharCode(t)),this.password.length>20&&(this.password=this.password.substring(0,20)))}}else if(3===this.Jt){const t=this.width/2|0;let i=50+(this.height/2|0);i+=20,1===this.Lc&&this.Rc>=t-75&&this.Rc<=t+75&&this.Sc>=i-20&&this.Sc<=i+20&&(this.Jt=0)}};dc=async()=>{await this.wc(),this.si?.bind(),this.ai?.draw(0,0);if(0===this.Jt){let t=180,i=80;this.Ai?.Jl(t,i,'Welcome to RuneScape',m.A.Gl,!0),t=100,i=120,this.ci?.draw(t-73,i-20),this.Ai?.Jl(t,i+5,'New user',m.A._l,!0),t=260,this.ci?.draw(t-73,i-20),this.Ai?.Jl(t,i+5,'Existing User',m.A._l,!0)}else if(2===this.Jt){let t=100,i=60;this.fi.length>0?(this.Ai?.Jl(180,i-15,this.fi,m.A.Gl,!0),this.Ai?.Jl(180,i,this.ui,m.A.Gl,!0),i+=30):(this.Ai?.Jl(180,i-7,this.ui,m.A.Gl,!0),i+=30),this.Ai?.ta(90,i,`Username: ${this.username}${0===this.Qt&&this.Pt%40<20?'@yel@|':''}`,m.A._l,!0),i+=15,this.Ai?.ta(92,i,`Password: ${M.A.Dc(this.password)}${1===this.Qt&&this.Pt%40<20?'@yel@|':''}`,m.A._l,!0),i=150,this.ci?.draw(t-73,i-20),this.Ai?.Jl(t,i+5,'Login',m.A._l,!0),t=260,this.ci?.draw(t-73,i-20),this.Ai?.Jl(t,i+5,'Cancel',m.A._l,!0)}else if(3===this.Jt){this.Ai?.Jl(180,40,'Create a free account',m.A.Gl,!0);const t=180;let i=65;this.Ai?.Jl(180,i,'To create a new account you need to',m.A._l,!0),i+=15,this.Ai?.Jl(180,i,'go back to the main RuneScape webpage',m.A._l,!0),i+=15,this.Ai?.Jl(180,i,"and choose the red 'create account'",m.A._l,!0),i+=15,this.Ai?.Jl(180,i,'button at the top right of that page.',m.A._l,!0),i=150,this.ci?.draw(t-73,i-20),this.Ai?.Jl(t,i+5,'Cancel',m.A._l,!0)}this.si?.draw(214,186),this.$t&&(this.$t=!1,this.ti?.draw(128,0),this.ii?.draw(214,386),this.ni?.draw(0,265),this.ri?.draw(574,265),this.oi?.draw(128,186),this.li?.draw(574,186))};Mc=async(t,i,s)=>{try{s||(this.fi='',this.ui='Connecting to server...',await this.dc()),this.stream=new _.A(await _.A.Nc({host:$.K.ht,port:43594+$.K.portOffset})),await(this.stream?.Pc(this.in.data,0,8)),this.in.Fc=0,this.Ht=this.in.Uc;const h=new Int32Array([Math.floor(99999999*Math.random()),Math.floor(99999999*Math.random()),Number(this.Ht>>32n),Number(this.Ht&BigInt(4294967295))]);this.Bt.Fc=0,this.Bt.p1(10),this.Bt.p4(h[0]),this.Bt.p4(h[1]),this.Bt.p4(h[2]),this.Bt.p4(h[3]),this.Bt.p4(0),this.Bt.Bc(t),this.Bt.Bc(i),this.Bt.Gc($.K.ct,$.K.exponent),this.Gt.Fc=0,s?this.Gt.p1(18):this.Gt.p1(16),this.Gt.p1(this.Bt.Fc+36+1+1),this.Gt.p1($.K.tt),this.Gt.p1($.K.st?1:0);for(let t=0;t<9;t++)this.Gt.p4(this.Ft[t]);this.Gt.Hc(this.Bt.data,this.Bt.Fc,0),this.Bt.random=new g.A(h);for(let t=0;t<4;t++)h[t]+=50;this.Kt=new g.A(h),this.stream?.write(this.Gt.data,this.Gt.Fc);const e=await this.stream.read();if(1===e)return await(0,Z.Wo)(2e3),void await this.Mc(t,i,s);if(2===e||18===e){this.Br=18===e,k.A.Wc(),this.ac=!0,this.Bt.Fc=0,this.in.Fc=0,this.Xt=-1,this.zt=-1,this.jt=-1,this.Zt=-1,this.packetSize=0,this.Wt=0,this.Vt=0,this.Yt=0,this.Ah=0,this.nh=0,this.Qs=!1,this.Yc=0;for(let t=0;t<100;t++)this.Vh[t]=null;this.oe=0,this.Ie=0,this.We=0,this.ro=0,this.Ze=(100*Math.random()|0)-50,this.qe=(110*Math.random()|0)-55,this.$e=(80*Math.random()|0)-40,this.An=(120*Math.random()|0)-60,this.yn=(30*Math.random()|0)-20,this.Fn=(20*Math.random()|0)-10&2047,this.In=-1,this.Ke=0,this.Xe=0,this.rr=0,this.yr=0;for(let t=0;t{if(null!==this.nr){this.Vt>1&&this.Vt--,this.Yt>0&&this.Yt--;for(let t=0;t<5&&await this.read();t++);if(this.ac){for(let t=0;tthis.Ao+(this.wo/22|0)&&(this.wo=i.Fc,this.Ao=Date.now(),this.uo=this.lo[t],this.do=this.ao[t],await(0,j.zc)(i.data.slice(0,i.Fc),this.fo))}catch(t){console.error(t)}this.ro--;for(let i=t;i0&&(this.yo-=20,this.yo<0&&(this.yo=0),0===this.yo&&this.po&&!$.K.st&&this.mo&&await this.Vo(this.mo,this.Io,this._o));const t=k.A.flush();if(t&&(this.Bt.jc(O.A.Zc),this.Bt.p2(t.Fc),this.Bt.Hc(t.data,t.Fc,0),t.release()),this.Wt++,this.Wt>750&&await this.qc(),this.$c(),this.Jc(),this.Qc(),this.tf(),(1===this.if[1]||1===this.if[2]||1===this.if[3]||1===this.if[4])&&this.Nn++>5&&(this.Nn=0,this.Bt.jc(O.A.sf),this.Bt.p2(this.Pn),this.Bt.p2(this.Fn),this.Bt.p1(this.An),this.Bt.p1(this.yn)),this.Ye++,0!==this.js&&(this.Zs+=20,this.Zs>=400&&(this.js=0)),0!==this.ue&&(this.Ae++,this.Ae>=15&&(2===this.ue&&(this.Ws=!0),3===this.ue&&(this.Ys=!0),this.ue=0)),0!==this.se&&(this.ne++,(this.xl>this.he+5||this.xlthis.ee+5||this.Dl=5){if(this.Le=-1,this.ef(),this.Le===this.te&&this.Re!==this.ie){const t=c.A.Ro[this.te];if(t.Ll){const i=t.Ll[this.Re];t.Ll[this.Re]=t.Ll[this.ie],t.Ll[this.ie]=i}if(t.Rl){const i=t.Rl[this.Re];t.Rl[this.Re]=t.Rl[this.ie],t.Rl[this.ie]=i}this.Bt.jc(O.A.nf),this.Bt.p2(this.te),this.Bt.p2(this.ie),this.Bt.p2(this.Re)}}else(1===this.Ce||this.rf(this.nh-1))&&this.nh>2?this.lf():this.nh>0&&await this.af(this.nh-1);this.Ae=10,this.Lc=0}if($.K.dt++,$.K.dt>127&&($.K.dt=0,this.Bt.jc(O.A.cf),this.Bt.p3(4991788)),-1!==x.A.ff&&this.Sr){const t=x.A.ff,i=x.A.uf,s=this.df(this.Sr.wf[0],this.Sr.Af[0],t,i,0,0,0,0,0,0,!0);x.A.ff=-1,s&&(this.qs=this.Rc,this.$s=this.Sc,this.js=1,this.Zs=0)}1===this.Lc&&this.Lh&&(this.Lh=null,this.Ys=!0,this.Lc=0),await this.yf(),this.pf(),this.mf(),this.If(),1!==this.hf&&1!==this.Lc||this.zs++,2===this.We&&($.K.ot?this._f():this.Ef()),2===this.We&&this.ze&&this.gf();for(let t=0;t<5;t++)this.sn[t]++;if(await this.Cf(),this.Yc++,this.Yc>4500&&(this.Yt=250,this.Yc-=500,this.Bt.jc(O.A.Tf)),this.je++,this.je>500){this.je=0;const t=8*Math.random()|0;1&~t||(this.Ze+=this.Je),2&~t||(this.qe+=this.Qe),4&~t||(this.$e+=this.tn)}if(this.Ze<-50&&(this.Je=2),this.Ze>50&&(this.Je=-2),this.qe<-55&&(this.Qe=2),this.qe>55&&(this.Qe=-2),this.$e<-40&&(this.tn=1),this.$e>40&&(this.tn=-1),this.wn++,this.wn>500){this.wn=0;const t=8*Math.random()|0;1&~t||(this.An+=this.mn),2&~t||(this.yn+=this.pn)}this.An<-60&&(this.mn=2),this.An>60&&(this.mn=-2),this.yn<-20&&(this.pn=1),this.yn>10&&(this.pn=-1),$.K.wt++,$.K.wt>110&&($.K.wt=0,this.Bt.jc(O.A.Of),this.Bt.p4(0)),this.Pr++,this.Pr>50&&this.Bt.jc(O.A.bf);try{this.stream&&this.Bt.Fc>0&&(this.stream.write(this.Bt.data,this.Bt.Fc),this.Bt.Fc=0,this.Pr=0)}catch(t){console.log(t),await this.qc()}}}};uc=()=>{if(null===this.nr)return;this.$t&&(this.$t=!1,this.Hi?.draw(0,11),this.Wi?.draw(0,375),this.Yi?.draw(729,5),this.Vi?.draw(752,231),this.Ki?.draw(0,0),this.Xi?.draw(561,0),this.zi?.draw(520,11),this.ji?.draw(520,231),this.Zi?.draw(501,375),this.qi?.draw(0,345),this.Ws=!0,this.Ys=!0,this.Vs=!0,this.Ks=!0,2!==this.We&&(this.Pi?.draw(8,11),this.Ni?.draw(561,5))),2===this.We&&this.vf(),this.Qs&&1===this.th&&(this.Ws=!0);let t=!1;if(-1!==this.oh&&(t=this.ol(this.oh,this.Ye),t&&(this.Ws=!0)),2===this.ue&&(this.Ws=!0),2===this.se&&(this.Ws=!0),this.Ws&&(this.Lf(),this.Ws=!1),-1===this.lh){this.ah.Tl=this.fh-this.uh-77,this.xl>453&&this.xl<565&&this.Dl>350&&this.Rf(this.xl-22,this.Dl-375,this.fh,77,!1,463,0,this.ah);let t=this.fh-this.ah.Tl-77;t<0&&(t=0),t>this.fh-77&&(t=this.fh-77),this.uh!==t&&(this.uh=t,this.Ys=!0)}-1!==this.lh&&(t=this.ol(this.lh,this.Ye),t&&(this.Ys=!0)),3===this.ue&&(this.Ys=!0),3===this.se&&(this.Ys=!0),this.Lh&&(this.Ys=!0),this.Qs&&2===this.th&&(this.Ys=!0),this.Ys&&(this.Sf(),this.Ys=!1),2===this.We&&(this.Mf(),this.Ni?.draw(561,5)),-1!==this.Rh&&(this.Vs=!0),this.Vs&&(-1!==this.Rh&&this.Rh===this.Sh&&(this.Rh=-1,this.Bt.jc(O.A.kf),this.Bt.p1(this.Sh)),this.Vs=!1,this.Gi?.bind(),this.fs?.draw(0,0),-1===this.oh&&(-1!==this.Mh[this.Sh]&&(0===this.Sh?this.Rs?.draw(29,30):1===this.Sh?this.Ss?.draw(59,29):2===this.Sh?this.Ss?.draw(87,29):3===this.Sh?this.Ms?.draw(115,29):4===this.Sh?this.xs?.draw(156,29):5===this.Sh?this.xs?.draw(184,29):6===this.Sh&&this.ks?.draw(212,30)),-1!==this.Mh[0]&&(0!==this.Rh||this.Pt%20<10)&&this.us[0]?.draw(35,34),-1!==this.Mh[1]&&(1!==this.Rh||this.Pt%20<10)&&this.us[1]?.draw(59,32),-1!==this.Mh[2]&&(2!==this.Rh||this.Pt%20<10)&&this.us[2]?.draw(86,32),-1!==this.Mh[3]&&(3!==this.Rh||this.Pt%20<10)&&this.us[3]?.draw(121,33),-1!==this.Mh[4]&&(4!==this.Rh||this.Pt%20<10)&&this.us[4]?.draw(157,34),-1!==this.Mh[5]&&(5!==this.Rh||this.Pt%20<10)&&this.us[5]?.draw(185,32),-1!==this.Mh[6]&&(6!==this.Rh||this.Pt%20<10)&&this.us[6]?.draw(212,34)),this.Gi?.draw(520,165),this.Bi?.bind(),this.cs?.draw(0,0),-1===this.oh&&(-1!==this.Mh[this.Sh]&&(7===this.Sh?this.Ds?.draw(49,0):8===this.Sh?this.Ns?.draw(81,0):9===this.Sh?this.Ns?.draw(108,0):10===this.Sh?this.Ps?.draw(136,1):11===this.Sh?this.Us?.draw(178,0):12===this.Sh?this.Us?.draw(205,0):13===this.Sh&&this.Fs?.draw(233,0)),-1!==this.Mh[8]&&(8!==this.Rh||this.Pt%20<10)&&this.us[7]?.draw(80,2),-1!==this.Mh[9]&&(9!==this.Rh||this.Pt%20<10)&&this.us[8]?.draw(107,3),-1!==this.Mh[10]&&(10!==this.Rh||this.Pt%20<10)&&this.us[9]?.draw(142,4),-1!==this.Mh[11]&&(11!==this.Rh||this.Pt%20<10)&&this.us[10]?.draw(179,2),-1!==this.Mh[12]&&(12!==this.Rh||this.Pt%20<10)&&this.us[11]?.draw(206,2),-1!==this.Mh[13]&&(13!==this.Rh||this.Pt%20<10)&&this.us[12]?.draw(230,2)),this.Bi?.draw(501,492),this.Pi?.bind()),this.Ks&&(this.Ks=!1,this.Ui?.bind(),this.ls?.draw(0,0),this.wi?.Jl(57,33,'Public chat',m.A._l,!0),0===this.kh&&this.wi?.Jl(57,46,'On',m.A.GREEN,!0),1===this.kh&&this.wi?.Jl(57,46,'Friends',m.A.Gl,!0),2===this.kh&&this.wi?.Jl(57,46,'Off',m.A.RED,!0),3===this.kh&&this.wi?.Jl(57,46,'Hide',m.A.bc,!0),this.wi?.Jl(186,33,'Private chat',m.A._l,!0),0===this.xh&&this.wi?.Jl(186,46,'On',m.A.GREEN,!0),1===this.xh&&this.wi?.Jl(186,46,'Friends',m.A.Gl,!0),2===this.xh&&this.wi?.Jl(186,46,'Off',m.A.RED,!0),this.wi?.Jl(326,33,'Trade/duel',m.A._l,!0),0===this.Dh&&this.wi?.Jl(326,46,'On',m.A.GREEN,!0),1===this.Dh&&this.wi?.Jl(326,46,'Friends',m.A.Gl,!0),2===this.Dh&&this.wi?.Jl(326,46,'Off',m.A.RED,!0),this.wi?.Jl(462,38,'Report abuse',m.A._l,!0),this.Ui?.draw(0,471),this.Pi?.bind()),this.Ye=0};vf=()=>{if(this.Ve++,this.xf(),this.Df(),this.Nf(),this.Pf(),this.Ff(),!this.ze){let t=this.Pn;(this.dn/256|0)>t&&(t=this.dn/256|0),this.hn[4]&&this.nn[4]+128>t&&(t=this.nn[4]+128);const i=this.Fn+this.$e&2047;if(this.Sr&&this.Uf(this.Gn,this.Bf(this.Dn,this.Sr.x,this.Sr.z)-50,this.Hn,i,t,3*t+600),$.K.ut++,$.K.ut>1802){$.K.ut=0,this.Bt.jc(O.A.Gf),this.Bt.p1(0);const t=this.Bt.Fc;this.Bt.p2(29711),this.Bt.p1(70),this.Bt.p1(256*Math.random()|0),this.Bt.p1(242),this.Bt.p1(186),this.Bt.p1(39),this.Bt.p1(61),2*Math.random()|0||this.Bt.p1(13),2*Math.random()|0||this.Bt.p2(57856),this.Bt.p2(65536*Math.random()|0),this.Bt.Hf(this.Bt.Fc-t)}}let t;t=this.ze?this.Wf():this.Yf();const i=this.ln,s=this.an,h=this.cn,e=this.fn,n=this.un;let r;for(let t=0;t<5;t++)this.hn[t]&&(r=Math.random()*(2*this.en[t]+1)-this.en[t]+Math.sin(this.sn[t]*(this.rn[t]/100))*this.nn[t]|0,0===t&&(this.ln+=r),1===t&&(this.an+=r),2===t&&(this.cn+=r),3===t&&(this.un=this.un+r&2047),4===t&&(this.fn+=r,this.fn<128&&(this.fn=128),this.fn>383&&(this.fn=383)));r=d.A.Vf,p.A.Kf=!0,p.A.Xf=0,p.A.xl=this.xl-8,p.A.Dl=this.Dl-11,u.A.clear(),this.He?.draw(this.ln,this.an,this.cn,t,this.un,this.fn,this.Pt),this.He?.zf(),this.jf(),this.Zf(),$.K.nt&&this.qf(),this.$f(r),this.Jf(),this.Pi?.draw(8,11),this.ln=i,this.an=s,this.cn=h,this.fn=e,this.un=n};Qf=()=>{e.A.tu?.clear(),e.A.iu?.clear(),r.A.So?.clear(),n.A.So?.clear(),n.A.su?.clear(),W.A.So?.clear(),l.A.So?.clear()};hu=(t,i)=>{this.eu(t.x,i,t.z)};eu=(t,i,s)=>{if(t<128||s<128||t>13056||s>13056)return this.zn=-1,void(this.jn=-1);const h=this.Bf(this.Dn,t,s)-i;this.nu(t,h,s)};nu=(t,i,s)=>{let h=t-this.ln,e=i-this.an,n=s-this.cn;const r=d.A.sin[this.fn],o=d.A.cos[this.fn],l=d.A.sin[this.un],a=d.A.cos[this.un];let c=n*l+h*a>>16;n=n*a-h*l>>16,h=c,c=e*o-n*r>>16,n=e*r+n*o>>16,e=c,n>=50?(this.zn=d.A.na+((h<<9)/n|0),this.jn=d.A.ra+((e<<9)/n|0)):(this.zn=-1,this.jn=-1)};jf=()=>{this.Kr=0;for(let t=-1;t-1))for(let t=0;t<8;t++)h.ru&1<=0&&10===this.Ah&&this.Ih===this.lr[t]&&(this.hu(i,i.height+15),this.zn>-1&&this._s[7]?.draw(this.zn-12,this.jn-s))}else 1===this.Ah&&this.yh===this.pr[t-this.rr]&&this.Pt%20<10&&(this.hu(i,i.height+15),this.zn>-1&&this._s[2]?.draw(this.zn-12,this.jn-28));if(i.ou&&(t>=this.rr||0===this.kh||3===this.kh||1===this.kh&&this.lu(i.name))&&(this.hu(i,i.height),this.zn>-1&&this.Kr<$.K.Xr&&this.Ai&&(this.qr[this.Kr]=this.Ai.au(i.ou)/2|0,this.Zr[this.Kr]=this.Ai.height,this.zr[this.Kr]=this.zn,this.jr[this.Kr]=this.jn,this.$r[this.Kr]=i.cu,this.Jr[this.Kr]=i.fu,this.Qr[this.Kr]=i.uu,this.io[this.Kr++]=i.ou,0===this.Zh&&1===i.fu&&(this.Zr[this.Kr]+=10,this.jr[this.Kr]+=5),0===this.Zh&&2===i.fu&&(this.qr[this.Kr]=60))),i.du>this.Pt+100&&(this.hu(i,i.height+15),this.zn>-1)){let t=30*i.wu/i.Au|0;t>30&&(t=30),u.A.fillRect(this.zn-15,this.jn-3,t,5,m.A.GREEN),u.A.fillRect(this.zn-15+t,this.jn-3,30-t,5,m.A.RED)}if(i.du>this.Pt+330&&(this.hu(i,i.height/2|0),this.zn>-1&&(this.Is[i.yu]?.draw(this.zn-12,this.jn-12),this.di?.Ac(this.zn,this.jn+4,i.pu.toString(),m.A.Bl),this.di?.Ac(this.zn-1,this.jn+3,i.pu.toString(),m.A._l))),$.K.nt){if(i.pathLength>0||i.mu>=this.Pt||i.Iu>this.Pt){const t=64*i.size;this._u(128*i.wf[0]+t,128*i.Af[0]+t,this.Dn,i.size,65535,!1)}this._u(i.x,i.z,this.Dn,i.size,6710886,!1);let s=0;if(this.hu(i,i.height+30),t32767&&(i-=32768),this.di?.Ac(this.zn,this.jn+s,'Face Entity: '+i,m.A._l),s-=15}(t.Eu&W.A.Lu)===W.A.Lu&&(this.di?.Ac(this.zn,this.jn+s,'Say',m.A._l),s-=15),(t.Eu&W.A.Ru)===W.A.Ru&&(this.di?.Ac(this.zn,this.jn+s,'Hit: Type '+t.yu+' Amount '+t.pu+' HP '+t.wu+'/'+t.Au,m.A._l),s-=15),(t.Eu&W.A.Su)===W.A.Su&&(this.di?.Ac(this.zn,this.jn+s,'Face Coord: '+t.Mu/2+' '+t.ku/2,m.A._l),s-=15),(t.Eu&W.A.xu)===W.A.xu&&(this.di?.Ac(this.zn,this.jn+s,'Chat',m.A._l),s-=15),(t.Eu&W.A.Du)===W.A.Du&&(this.di?.Ac(this.zn,this.jn+s,'Play Spotanim: '+t.Nu,m.A._l),s-=15),(t.Eu&W.A.Pu)===W.A.Pu&&(this.di?.Ac(this.zn,this.jn+s,'Exact Move',m.A._l),s-=15)}}else{const t=i;let s=0;if(this.hu(i,i.height+30),this.di?.Ac(this.zn,this.jn+s,t.type?.name??null,m.A._l),s-=15,-1!==t.Eu&&this.Pt-t.gu<30){if((t.Eu&Y.A.Tu)===Y.A.Tu&&(this.di?.Ac(this.zn,this.jn+s,'Play Seq: '+t.Ou,m.A._l),s-=15),(t.Eu&Y.A.bu)===Y.A.bu){let i=t.vu;i>32767&&(i-=32768),this.di?.Ac(this.zn,this.jn+s,'Face Entity: '+i,m.A._l),s-=15}(t.Eu&Y.A.Lu)===Y.A.Lu&&(this.di?.Ac(this.zn,this.jn+s,'Say',m.A._l),s-=15),(t.Eu&Y.A.Ru)===Y.A.Ru&&(this.di?.Ac(this.zn,this.jn+s,'Hit: Type '+t.yu+' Amount '+t.pu+' HP '+t.wu+'/'+t.Au,m.A._l),s-=15),(t.Eu&Y.A.Fu)===Y.A.Fu&&(this.di?.Ac(this.zn,this.jn+s,'Change Type: '+t.type?.id??null,m.A._l),s-=15),(t.Eu&Y.A.Du)===Y.A.Du&&(this.di?.Ac(this.zn,this.jn+s,'Play Spotanim: '+t.Nu,m.A._l),s-=15),(t.Eu&Y.A.Su)===Y.A.Su&&(this.di?.Ac(this.zn,this.jn+s,'Face Coord: '+t.Mu/2+' '+t.ku/2,m.A._l),s-=15)}}}}}if($.K.nt)for(let t=0;t=104||i.z>=104||this._u(128*i.x+64,128*i.z+64,i.level,1,16776960,!1)}for(let t=0;tthis.jr[r]-this.Zr[r]&&s-ethis.zr[r]-this.qr[r]&&this.jr[r]-this.Zr[r]{2===this.Ah&&this._s[2]&&(this.eu((this._h-this.Tn<<7)+this.ph,2*this.gh,(this.Eh-this.On<<7)+this.mh),this.zn>-1&&this.Pt%20<10&&this._s[2].draw(this.zn-12,this.jn-28))};qf=()=>{const t=507;let i=13;this.Oo?this.di?.Hu(t,i,'tock',m.A.Gl,!0):this.Ai?.Hu(t,i,'tick',m.A.Gl,!0),i+=13,this.di?.Hu(t,i,`Fps: ${this.Wu}, ${this.Yu} ms`,m.A.Gl,!0),i+=13,this.di?.Hu(t,i,`Draw: ${this.ms.toFixed(1)}, Avg: ${this.Vu.toFixed(1)}, Slow: ${this.Ku.toFixed(1)} ms`,m.A.Gl,!0),i+=13,this.di?.Hu(t,i,`Occluders: ${x.A.Xu[x.A.zu]} Active: ${x.A.ju}`,m.A.Gl,!0),i+=13,this.di?.Hu(t,i,'Local Pos: '+(this.Sr?.x??-1)+', '+(this.Sr?.z??-1)+', '+(this.Sr?.y??-1),m.A.Gl,!0),i+=13,this.di?.Hu(t,i,'Camera Pos: '+this.ln+', '+this.cn+', '+this.an,m.A.Gl,!0),i+=13,this.di?.Hu(t,i,'Camera Angle: '+this.un+', '+this.fn,m.A.Gl,!0),i+=13,this.di?.Hu(t,i,'Cutscene Source: '+this.tr+', '+this.ir+' '+this.sr+'; '+this.hr+', '+this.er,m.A.Gl,!0),i+=13,this.di?.Hu(t,i,'Cutscene Destination: '+this.Zn+', '+this.qn+' '+this.$n+'; '+this.Jn+', '+this.Qn,m.A.Gl,!0),$.K.ot&&(i+=13,this.di?.Hu(t,i,'Instructions:',m.A.Gl,!0),i+=13,this.di?.Hu(t,i,'- Arrows to move Camera',m.A.Gl,!0),i+=13,this.di?.Hu(t,i,'- Shift to control Source or Dest',m.A.Gl,!0),i+=13,this.di?.Hu(t,i,'- Alt to control Height',m.A.Gl,!0),i+=13,this.di?.Hu(t,i,'- Ctrl to control Modifier',m.A.Gl,!0))};_u=(t,i,s,h,e,n)=>{const r=this.Bf(s,t,i),o=64*h;this.nu(t-o,r,i-o);const l=this.zn,a=this.jn;this.nu(t+o,r,i-o);const c=this.zn,f=this.jn;this.nu(t-o,r,i+o);const d=this.zn,w=this.jn;this.nu(t+o,r,i+o);const A=this.zn,y=this.jn;-1!==l&&-1!==c&&-1!==d&&-1!==A&&(n&&(u.A.Zu(l,a,A,y,(16711422&e)>>1),u.A.Zu(c,f,d,w,(16711422&e)>>1)),u.A.Zu(l,a,c,f,e),u.A.Zu(l,a,d,w,e),u.A.Zu(c,f,A,y,e),u.A.Zu(d,w,A,y,e))};_f(){const t=1==this.if[5]?2:1;1==this.if[6]?(1==this.if[1]?(this.Zn-=t,this.Zn<1&&(this.Zn=1)):1==this.if[2]&&(this.Zn+=t,this.Zn>102&&(this.Zn=102)),1==this.if[3]?1==this.if[7]?this.$n+=2*t:(this.qn+=1,this.qn>102&&(this.qn=102)):1==this.if[4]&&(1==this.if[7]?this.$n-=2*t:(this.qn-=1,this.qn<1&&(this.qn=1)))):(1==this.if[1]?(this.tr-=t,this.tr<1&&(this.tr=1)):1==this.if[2]&&(this.tr+=t,this.tr>102&&(this.tr=102)),1==this.if[3]?1==this.if[7]?this.sr+=2*t:(this.ir+=t,this.ir>102&&(this.ir=102)):1==this.if[4]&&(1==this.if[7]?this.sr-=2*t:(this.ir-=t,this.ir<1&&(this.ir=1)))),this.ln=128*this.tr+64,this.cn=128*this.ir+64,this.an=this.Bf(this.Dn,this.tr,this.ir)-this.sr;const i=128*this.Zn+64,s=128*this.qn+64,h=this.Bf(this.Dn,this.Zn,this.qn)-this.$n,e=i-this.ln,n=h-this.an,r=s-this.cn,o=0|Math.sqrt(e*e+r*r);this.fn=325.949*Math.atan2(n,o)&2047,this.un=-325.949*Math.atan2(e,r)&2047,this.fn<128&&(this.fn=128),this.fn>383&&(this.fn=383)}Jf=()=>{if(this.qu(),1===this.js&&this.gs[this.Zs/100|0]?.draw(this.qs-8-8,this.$s-8-11),2===this.js&&this.gs[4+(this.Zs/100|0)]?.draw(this.qs-8-8,this.$s-8-11),-1!==this.Xs&&(this.ol(this.Xs,this.Ye),this.Al(c.A.Ro[this.Xs],0,0,0)),this.$u(),this.Qs?0===this.th&&this.Ju():(this.ef(),this.Qu()),1===this.kr&&(this.Fr>0||1===this.Ur?this._s[1]?.draw(472,258):this._s[1]?.draw(472,296)),this.Fr>0&&(this._s[0]?.draw(472,296),this.wi?.Ac(484,329,'Level: '+this.Fr,m.A.Gl)),1===this.Ur&&(this._s[6]?.draw(472,296),this.wi?.Ac(484,329,'Arena',m.A.Gl)),0!==this.Vt){let t=this.Vt/50|0;const i=t/60|0;t%=60,t<10?this.wi?.Fl(4,329,'System update in: '+i+':0'+t,m.A.Gl):this.wi?.Fl(4,329,'System update in: '+i+':'+t,m.A.Gl)}};qu=()=>{if(0===this.jh)return;const t=this.wi;let i=0;0!==this.Vt&&(i=1);for(let s=0;s<100;s++){if(!this.Vh[s])continue;const h=this.messageType[s];let e;if((3===h||7===h)&&(7===h||0===this.xh||1===this.xh&&this.lu(this.Kh[s]))&&(e=329-13*i,t?.Fl(4,e,'From '+this.Kh[s]+': '+this.Vh[s],m.A.Bl),t?.Fl(4,e-1,'From '+this.Kh[s]+': '+this.Vh[s],m.A.bc),i++,i>=5))return;if(5===h&&this.xh<2&&(e=329-13*i,t?.Fl(4,e,this.Vh[s],m.A.Bl),t?.Fl(4,e-1,this.Vh[s],m.A.bc),i++,i>=5))return;if(6===h&&this.xh<2&&(e=329-13*i,t?.Fl(4,e,'To '+this.Kh[s]+': '+this.Vh[s],m.A.Bl),t?.Fl(4,e-1,'To '+this.Kh[s]+': '+this.Vh[s],m.A.bc),i++,i>=5))return}};$u=()=>{if(!this.Sr)return;const t=(this.Sr.x>>7)+this.Tn,i=(this.Sr.z>>7)+this.On;if(this.Fr=t>=2944&&t<3392&&i>=3520&&i<6400?1+((i-3520)/8|0):t>=2944&&t<3392&&i>=9920&&i<12800?1+((i-9920)/8|0):0,this.Ur=0,t>=3328&&t<3392&&i>=3200&&i<3264){const s=63&t,h=63&i;(s>=4&&s<=29&&h>=44&&h<=58||s>=36&&s<=61&&h>=44&&h<=58||s>=4&&s<=29&&h>=25&&h<=39||s>=36&&s<=61&&h>=25&&h<=39||s>=4&&s<=29&&h>=6&&h<=20||s>=36&&s<=61&&h>=6&&h<=20)&&(this.Ur=1)}0===this.Ur&&t>=3328&&t<=3393&&i>=3203&&i<=3325&&(this.Ur=2),this.Js=0,(t>=3053&&t<=3156&&i>=3056&&i<=3136||t>=3072&&t<=3118&&i>=9492&&i<=9535)&&(this.Js=1),1===this.Js&&t>=3139&&t<=3199&&i>=3008&&i<=3062&&(this.Js=0)};Lf=()=>{this.Di?.bind(),this.Ji&&(d.A.oc=this.Ji),this.ns?.draw(0,0),-1!==this.oh?this.Al(c.A.Ro[this.oh],0,0,0):-1!==this.Mh[this.Sh]&&this.Al(c.A.Ro[this.Mh[this.Sh]],0,0,0),this.Qs&&1===this.th&&this.Ju(),this.Di?.draw(562,231),this.Pi?.bind(),this.Qi&&(d.A.oc=this.Qi)};Sf=()=>{if(this.Fi?.bind(),this.$i&&(d.A.oc=this.$i),this.rs?.draw(0,0),this.Fh)this.Ai?.Ac(239,40,this.Uh,m.A.Bl),this.Ai?.Ac(239,60,this.Bh+'*',m.A.td);else if(this.Wh)this.Ai?.Ac(239,40,'Enter amount:',m.A.Bl),this.Ai?.Ac(239,60,this.Hh+'*',m.A.td);else if(this.Lh)this.Ai?.Ac(239,40,this.Lh,m.A.Bl),this.Ai?.Ac(239,60,'Click to continue',m.A.td);else if(-1!==this.lh)this.Al(c.A.Ro[this.lh],0,0,0);else if(-1===this.Yh){let t=this.wi;0===$.K.rt&&(t=this.yi);let i=0;u.A.yl(0,0,463,77);for(let s=0;s<100;s++){const h=this.Vh[s];if(!h)continue;const e=this.messageType[s],n=this.uh+70-14*i;0===e&&(n>0&&n<110&&t?.Fl(4,n,h,m.A.Bl),i++),1===e&&(n>0&&n<110&&(t?.Fl(4,n,this.Kh[s]+':',m.A._l),t?.Fl(t.au(this.Kh[s])+12,n,h,m.A.BLUE)),i++),2===e&&(0===this.kh||1===this.kh&&this.lu(this.Kh[s]))&&(n>0&&n<110&&(t?.Fl(4,n,this.Kh[s]+':',m.A.Bl),t?.Fl(t.au(this.Kh[s])+12,n,h,m.A.BLUE)),i++),3!==e&&7!==e||0!==this.jh||!(7===e||0===this.xh||1===this.xh&&this.lu(this.Kh[s]))||(n>0&&n<110&&(t?.Fl(4,n,'From '+this.Kh[s]+':',m.A.Bl),t?.Fl(t.au('From '+this.Kh[s])+12,n,h,m.A.sd)),i++),4===e&&(0===this.Dh||1===this.Dh&&this.lu(this.Kh[s]))&&(n>0&&n<110&&t?.Fl(4,n,this.Kh[s]+' '+this.Vh[s],m.A.hd),i++),5===e&&0===this.jh&&this.xh<2&&(n>0&&n<110&&t?.Fl(4,n,h,m.A.sd),i++),6===e&&0===this.jh&&this.xh<2&&(n>0&&n<110&&(t?.Fl(4,n,'To '+this.Kh[s]+':',m.A.Bl),t?.Fl(t.au('To '+this.Kh[s])+12,n,h,m.A.sd)),i++),8===e&&(0===this.Dh||1===this.Dh&&this.lu(this.Kh[s]))&&(n>0&&n<110&&t?.Fl(4,n,this.Kh[s]+' '+this.Vh[s],m.A.ed),i++)}u.A.Gu(),this.fh=14*i+7,this.fh<78&&(this.fh=78),this.tl(463,0,this.fh-this.uh-77,this.fh,77),0==$.K.rt?t?.Fl(3,90,this.qh+'*',m.A.Bl):1==$.K.rt?t?.Fl(3,90,this.qh+'*',m.A.BLUE):(t?.Fl(4,90,M.A.ga(this.username)+':',m.A.Bl),t?.Fl(t.au(this.username+': ')+6,90,this.qh+'*',m.A.BLUE)),u.A.nl(0,77,m.A.Bl,479)}else this.Al(c.A.Ro[this.Yh],0,0,0);this.Qs&&2===this.th&&this.Ju(),this.Fi?.draw(22,375),this.Pi?.bind(),this.Qi&&(d.A.oc=this.Qi)};Mf=()=>{if(this.Ni?.bind(),!this.Sr)return;const t=this.Fn+this.An&2047;let i=48+(this.Sr.x/32|0),s=464-(this.Sr.z/32|0);this.ws?.nd(21,9,146,151,this.hs,this.es,i,s,t,this.yn+256),this.As?.nd(0,0,33,33,this.ts,this.ss,25,25,this.Fn,256);for(let t=0;t{if(!i)return;const h=this.Fn+this.An&2047,e=s*s+t*t;if(e>6400)return;let n=d.A.sin[h],r=d.A.cos[h];n=256*n/(this.yn+256)|0,r=256*r/(this.yn+256)|0;const o=t*n+s*r>>16,l=t*r-s*n>>16;e>2500&&this.os?i.ad(o+94-(i.Pl/2|0),83-l-(i.fd/2|0),this.os):i.draw(o+94-(i.Pl/2|0),83-l-(i.fd/2|0))};ud=t=>{if(!this.ws)return;const i=this.ws.nc,s=i.length;for(let t=0;t>14&32767;const h=e.A.get(s).yd;if(h<0)continue;let n=t,r=i;if(22!==h&&29!==h&&34!==h&&36!==h&&46!==h&&47!==h&&48!==h){const s=G.A.Xn,h=G.A.Xn,e=this.kn[this.Dn];if(e){const o=e.flags;for(let e=0;e<10;e++){const e=4*Math.random()|0;0===e&&n>0&&n>t-3&&(o[G.A.index(n-1,r)]&H.A.pd)===H.A.OPEN&&n--,1===e&&n0&&r>i-3&&(o[G.A.index(n,r-1)]&H.A.Id)===H.A.OPEN&&r--,3===e&&r{if(!this.He||!this.ws)return;let r=this.He.Ed(s,t,i);if(0!==r){const o=this.He.gd(s,t,i,r),l=o>>6&3,a=31&o;let c=h;r>0&&(c=n);const f=this.ws.nc,u=4*t+512*(103-i)*4+24624,d=r>>14&32767,w=e.A.get(d);if(-1===w.Cd)a!==P.A.Td.id&&a!==P.A.Od.id||(l===F.A.bd?(f[u]=c,f[u+512]=c,f[u+1024]=c,f[u+1536]=c):l===F.A.vd?(f[u]=c,f[u+1]=c,f[u+2]=c,f[u+3]=c):l===F.A.Ld?(f[u+3]=c,f[u+3+512]=c,f[u+3+1024]=c,f[u+3+1536]=c):l===F.A.Rd&&(f[u+1536]=c,f[u+1536+1]=c,f[u+1536+2]=c,f[u+1536+3]=c)),a===P.A.Sd.id&&(l===F.A.bd?f[u]=c:l===F.A.vd?f[u+3]=c:l===F.A.Ld?f[u+3+1536]=c:l===F.A.Rd&&(f[u+1536]=c)),a===P.A.Od.id&&(l===F.A.Rd?(f[u]=c,f[u+512]=c,f[u+1024]=c,f[u+1536]=c):l===F.A.bd?(f[u]=c,f[u+1]=c,f[u+2]=c,f[u+3]=c):l===F.A.vd?(f[u+3]=c,f[u+3+512]=c,f[u+3+1024]=c,f[u+3+1536]=c):l===F.A.Ld&&(f[u+1536]=c,f[u+1536+1]=c,f[u+1536+2]=c,f[u+1536+3]=c));else{const s=this.ys[w.Cd];if(s){const h=(4*w.width-s.width)/2|0,e=(4*w.length-s.height)/2|0;s.draw(4*t+48+h,4*(G.A.Xn-i-w.length)+e+48)}}}if(r=this.He.Md(s,t,i),0!==r){const h=this.He.gd(s,t,i,r),n=h>>6&3,o=31&h,l=r>>14&32767,a=e.A.get(l);if(-1!==a.Cd){const s=this.ys[a.Cd];if(s){const h=(4*a.width-s.width)/2|0,e=(4*a.length-s.height)/2|0;s.draw(4*t+48+h,4*(G.A.Xn-i-a.length)+e+48)}}else if(o===P.A.kd.id){let s=15658734;r>0&&(s=15597568);const h=this.ws.nc,e=4*t+512*(G.A.Xn-1-i)*4+24624;n===F.A.bd||n===F.A.Ld?(h[e+1536]=s,h[e+1024+1]=s,h[e+512+2]=s,h[e+3]=s):(h[e]=s,h[e+512+1]=s,h[e+1024+2]=s,h[e+1536+3]=s)}}if(r=this.He.Ad(s,t,i),0!==r){const s=e.A.get(r>>14&32767);if(-1!==s.Cd){const h=this.ys[s.Cd];if(h){const e=(4*s.width-h.width)/2|0,n=(4*s.length-h.height)/2|0;h.draw(4*t+48+e,4*(G.A.Xn-i-s.length)+n+48)}}}};Qu=()=>{if(this.nh<2&&0===this.oe&&0===this.Ie)return;let t;t=1===this.oe&&this.nh<2?'Use '+this.fe+' with...':1===this.Ie&&this.nh<2?this.ge+'...':this.rh[this.nh-1],this.nh>2&&(t=t+'@whi@ / '+(this.nh-2)+' more options'),this.Ai?.xd(4,15,t,m.A._l,!0,this.Pt/1e3|0)};Ju=()=>{const t=this.ih,i=this.sh,s=this.hh,h=this.eh,e=m.A.Dd;u.A.fillRect(t,i,s,h,e),u.A.fillRect(t+1,i+1,s-2,16,m.A.Bl),u.A.Il(t+1,i+18,s-2,h-19,m.A.Bl),this.Ai?.Fl(t+3,i+14,'Choose Option',e);let n=this.xl,r=this.Dl;0===this.th&&(n-=8,r-=11),1===this.th&&(n-=562,r-=231),2===this.th&&(n-=22,r-=375);for(let h=0;ht&&ne-13&&r{if(0!==this.se)return;let t=this.Lc;if(1===this.Ie&&this.Rc>=520&&this.Sc>=165&&this.Rc<=788&&this.Sc<=230&&(t=0),this.Qs){if(1!==t){let t=this.xl,i=this.Dl;0===this.th?(t-=8,i-=11):1===this.th?(t-=562,i-=231):2===this.th&&(t-=22,i-=375),(tthis.ih+this.hh+10||ithis.sh+this.eh+10)&&(this.Qs=!1,1===this.th&&(this.Ws=!0),2===this.th&&(this.Ys=!0))}if(1===t){const t=this.ih,i=this.sh,s=this.hh;let h=this.Rc,e=this.Sc;0===this.th?(h-=8,e-=11):1===this.th?(h-=562,e-=231):2===this.th&&(h-=22,e-=375);let n=-1;for(let r=0;rt&&ho-13&&e0){const t=this.Te[this.nh-1];if(602===t||596===t||22===t||892===t||415===t||405===t||38===t||422===t||478===t||347===t||188===t){const t=this.be[this.nh-1],i=this.ve[this.nh-1];if(c.A.Ro[i].draggable)return this.re=!1,this.ne=0,this.te=i,this.ie=t,this.se=2,this.he=this.Rc,this.ee=this.Sc,c.A.Ro[i].Nd===this.Xs&&(this.se=1),void(c.A.Ro[i].Nd===this.lh&&(this.se=3))}}if(1===t&&(1===this.Ce||this.rf(this.nh-1))&&this.nh>2&&(t=2),1===t&&this.nh>0&&await this.af(this.nh-1),2!==t||this.nh<=0)return;this.lf()}};pf=()=>{if(1===this.Lc&&this.Sr){let t=this.Rc-21-561,i=this.Sc-9-5;if(t>=0&&i>=0&&t<146&&i<151){t-=73,i-=75;const s=this.Fn+this.An&2047;let h=d.A.sin[s],e=d.A.cos[s];h=h*(this.yn+256)>>8,e=e*(this.yn+256)>>8;const n=i*h+t*e>>11,r=i*e-t*h>>11,o=this.Sr.x+n>>7,l=this.Sr.z-r>>7;this.df(this.Sr.wf[0],this.Sr.Af[0],o,l,1,0,0,0,0,0,!0)&&(this.Bt.p1(t),this.Bt.p1(i),this.Bt.p2(this.Fn),this.Bt.p1(57),this.Bt.p1(this.An),this.Bt.p1(this.yn),this.Bt.p1(89),this.Bt.p2(this.Sr.x),this.Bt.p2(this.Sr.z),this.Bt.p1(this.Rr),this.Bt.p1(63))}}};rf=t=>{if(t<0)return!1;let i=this.Te[t];return i>=2e3&&(i-=2e3),406===i};af=async t=>{if(t<0)return;this.Wh&&(this.Wh=!1,this.Ys=!0);let i=this.Te[t];const s=this.Oe[t],h=this.be[t],r=this.ve[t];if(i>=2e3&&(i-=2e3),903===i||363===i){let s=this.rh[t];const h=s.indexOf('@whi@');if(-1!==h){s=s.substring(h+5).trim();const t=M.A.ga(M.A.Ca(M.A.ld(s)));let e=!1;for(let s=0;s=90&&this.Bt.jc(O.A.Hd),this.Bt.jc(O.A.Wd)):347===i?this.Bt.jc(O.A.Yd):422===i?this.Bt.jc(O.A.Vd):405===i?($.K.Et+=s,$.K.Et>=97&&(this.Bt.jc(O.A.Kd),this.Bt.p3(14953816)),this.Bt.jc(O.A.Xd)):38===i&&this.Bt.jc(O.A.zd),this.Bt.p2(s),this.Bt.p2(h),this.Bt.p2(r),this.Ae=0,this.we=r,this.de=h,this.ue=2,c.A.Ro[r].Nd===this.Xs&&(this.ue=1),c.A.Ro[r].Nd===this.lh&&(this.ue=3);else if(728===i||542===i||6===i||963===i||245===i){const t=this.Ar[s];t&&this.Sr&&(this.df(this.Sr.wf[0],this.Sr.Af[0],t.wf[0],t.Af[0],2,1,1,0,0,0,!1),this.qs=this.Rc,this.$s=this.Sc,this.js=2,this.Zs=0,542===i?this.Bt.jc(O.A.jd):6===i?(3&s||$.K._t++,$.K._t>=124&&(this.Bt.jc(O.A.Zd),this.Bt.p4(0)),this.Bt.jc(O.A.qd)):963===i?this.Bt.jc(O.A.$d):728===i?this.Bt.jc(O.A.Jd):245===i&&(3&s||$.K.gt++,$.K.gt>=85&&(this.Bt.jc(O.A.Qd),this.Bt.p2(39596)),this.Bt.jc(O.A.tw)),this.Bt.p2(s))}else if(217===i){if(this.Sr){this.df(this.Sr.wf[0],this.Sr.Af[0],h,r,2,0,0,0,0,0,!1)||this.df(this.Sr.wf[0],this.Sr.Af[0],h,r,2,1,1,0,0,0,!1),this.qs=this.Rc,this.$s=this.Sc,this.js=2,this.Zs=0,this.Bt.jc(O.A.iw),this.Bt.p2(h+this.Tn),this.Bt.p2(r+this.On),this.Bt.p2(s),this.Bt.p2(this.ce),this.Bt.p2(this.le),this.Bt.p2(this.ae)}}else if(1175===i){const t=s>>14&32767,i=e.A.get(t);let h;h=i.sw?i.sw:"It's a "+i.name+'.',this.Ud(0,h,'')}else if(285===i)this.Bd(O.A.hw,h,r,s);else if(881===i)this.Bt.jc(O.A.ew),this.Bt.p2(s),this.Bt.p2(h),this.Bt.p2(r),this.Bt.p2(this.ce),this.Bt.p2(this.le),this.Bt.p2(this.ae),this.Ae=0,this.we=r,this.de=h,this.ue=2,c.A.Ro[r].Nd===this.Xs&&(this.ue=1),c.A.Ro[r].Nd===this.lh&&(this.ue=3);else if(391===i)this.Bt.jc(O.A.nw),this.Bt.p2(s),this.Bt.p2(h),this.Bt.p2(r),this.Bt.p2(this._e),this.Ae=0,this.we=r,this.de=h,this.ue=2,c.A.Ro[r].Nd===this.Xs&&(this.ue=1),c.A.Ro[r].Nd===this.lh&&(this.ue=3);else if(660===i)this.Qs?this.He?.click(h-8,r-11):this.He?.click(this.Rc-8,this.Sc-11);else{if(188===i)return this.oe=1,this.le=h,this.ae=r,this.ce=s,this.fe=n.A.get(s).name,void(this.Ie=0);if(44===i)this.ye||(this.Bt.jc(O.A.rw),this.Bt.p2(r),this.ye=!0);else if(1773===i){const t=n.A.get(s);let i;i=r>=1e5?r+' x '+t.name:t.sw?t.sw:"It's a "+t.name+'.',this.Ud(0,i,'')}else if(900===i){const t=this.Ar[s];t&&this.Sr&&(this.df(this.Sr.wf[0],this.Sr.Af[0],t.wf[0],t.Af[0],2,1,1,0,0,0,!1),this.qs=this.Rc,this.$s=this.Sc,this.js=2,this.Zs=0,this.Bt.jc(O.A.ow),this.Bt.p2(s),this.Bt.p2(this.ce),this.Bt.p2(this.le),this.Bt.p2(this.ae))}else if(1373===i||1544===i||151===i||1101===i){const t=this.nr[s];t&&this.Sr&&(this.df(this.Sr.wf[0],this.Sr.Af[0],t.wf[0],t.Af[0],2,1,1,0,0,0,!1),this.qs=this.Rc,this.$s=this.Sc,this.js=2,this.Zs=0,1101===i?this.Bt.jc(O.A.Fd):151===i?($.K.bt++,$.K.bt>=90&&(this.Bt.jc(O.A.lw),this.Bt.p2(31114)),this.Bt.jc(O.A.aw)):1373===i?this.Bt.jc(O.A.Pd):1544===i&&this.Bt.jc(O.A.cw),this.Bt.p2(s))}else if(265===i){const t=this.Ar[s];t&&this.Sr&&(this.df(this.Sr.wf[0],this.Sr.Af[0],t.wf[0],t.Af[0],2,1,1,0,0,0,!1),this.qs=this.Rc,this.$s=this.Sc,this.js=2,this.Zs=0,this.Bt.jc(O.A.fw),this.Bt.p2(s),this.Bt.p2(this._e))}else if(679===i){const i=this.rh[t],s=i.indexOf('@whi@');if(-1!==s){const t=M.A.ld(i.substring(s+5).trim());let h=-1;for(let i=0;i0&&(this.Ys=!0,this.Wh=!1,this.Fh=!0,this.Bh='',this.Gh=3,this.no=this.ho[h],this.Uh='Enter message to send to '+this.so[h])}}else if(55===i)this.Bd(O.A.uw,h,r,s)&&this.Bt.p2(this._e);else if(224===i||993===i||99===i||746===i||877===i){if(this.Sr){this.df(this.Sr.wf[0],this.Sr.Af[0],h,r,2,0,0,0,0,0,!1)||this.df(this.Sr.wf[0],this.Sr.Af[0],h,r,2,1,1,0,0,0,!1),this.qs=this.Rc,this.$s=this.Sc,this.js=2,this.Zs=0,224===i?this.Bt.jc(O.A.dw):746===i?this.Bt.jc(O.A.ww):877===i?this.Bt.jc(O.A.Aw):99===i?this.Bt.jc(O.A.yw):993===i&&this.Bt.jc(O.A.pw),this.Bt.p2(h+this.Tn),this.Bt.p2(r+this.On),this.Bt.p2(s)}}else if(1607===i){const t=this.Ar[s];if(t&&t.type){let i;i=t.type.sw?t.type.sw:"It's a "+t.type.name+'.',this.Ud(0,i,'')}}else if(504===i)this.Bd(O.A.mw,h,r,s);else{if(930===i){const t=c.A.Ro[r];this.Ie=1,this._e=r,this.Ee=t.Iw,this.oe=0;let i=t._w;i&&-1!==i.indexOf(' ')&&(i=i.substring(0,i.indexOf(' ')));let s=t._w;return s&&-1!==s.indexOf(' ')&&(s=s.substring(s.indexOf(' ')+1)),this.ge=i+' '+t.action+' '+s,void(16===this.Ee&&(this.Ws=!0,this.Sh=3,this.Vs=!0))}if(951===i){const t=c.A.Ro[r];let i=!0;t.El>0&&(i=this.Ew(t)),i&&(this.Bt.jc(O.A.gw),this.Bt.p2(r))}else if(602===i||596===i||22===i||892===i||415===i)22===i?this.Bt.jc(O.A.Cw):415===i?(3&r||$.K.Ot++,$.K.Ot>=55&&(this.Bt.jc(O.A.Tw),this.Bt.p4(0)),this.Bt.jc(O.A.Ow)):602===i?this.Bt.jc(O.A.bw):892===i?(3&h||$.K.vt++,$.K.vt>=130&&(this.Bt.jc(O.A.Lw),this.Bt.p1(177)),this.Bt.jc(O.A.Rw)):596===i&&this.Bt.jc(O.A.Sw),this.Bt.p2(s),this.Bt.p2(h),this.Bt.p2(r),this.Ae=0,this.we=r,this.de=h,this.ue=2,c.A.Ro[r].Nd===this.Xs&&(this.ue=1),c.A.Ro[r].Nd===this.lh&&(this.ue=3);else if(581===i)3&s||$.K.It++,$.K.It>=99&&(this.Bt.jc(O.A.Mw),this.Bt.p4(0)),this.Bd(O.A.kw,h,r,s);else if(965===i){if(this.Sr){this.df(this.Sr.wf[0],this.Sr.Af[0],h,r,2,0,0,0,0,0,!1)||this.df(this.Sr.wf[0],this.Sr.Af[0],h,r,2,1,1,0,0,0,!1),this.qs=this.Rc,this.$s=this.Sc,this.js=2,this.Zs=0,this.Bt.jc(O.A.xw),this.Bt.p2(h+this.Tn),this.Bt.p2(r+this.On),this.Bt.p2(s),this.Bt.p2(this._e)}}else if(1501===i)$.K.Tt+=this.On,$.K.Tt>=92&&(this.Bt.jc(O.A.Dw),this.Bt.p4(0)),this.Bd(O.A.Nw,h,r,s);else if(364===i)this.Bd(O.A.Pw,h,r,s);else if(1102===i){const t=n.A.get(s);let i;i=t.sw?t.sw:"It's a "+t.name+'.',this.Ud(0,i,'')}else if(960===i){this.Bt.jc(O.A.gw),this.Bt.p2(r);const t=c.A.Ro[r];if(t.scripts&&t.scripts[0]&&5===t.scripts[0][0]){const i=t.scripts[0][1];t.Qo&&this.pe[i]!==t.Qo[0]&&(this.pe[i]=t.Qo[0],await this.Fw(i),this.Ws=!0)}}else if(34===i){const i=this.rh[t],s=i.indexOf('@whi@');if(-1!==s){this.Uw(),this.Me=i.substring(s+5).trim(),this.ke=!1;for(let t=0;t{const i=t.El;if(i===c.A.Kw&&(this.Ys=!0,this.Wh=!1,this.Fh=!0,this.Bh='',this.Gh=1,this.Uh='Enter name of friend to add to list'),i===c.A.Xw&&(this.Ys=!0,this.Wh=!1,this.Fh=!0,this.Bh='',this.Gh=2,this.Uh='Enter name of friend to delete from list'),i===c.A.zw)return this.Yt=250,!0;if(i===c.A.jw&&(this.Ys=!0,this.Wh=!1,this.Fh=!0,this.Bh='',this.Gh=4,this.Uh='Enter name of player to add to list'),i===c.A.Zw&&(this.Ys=!0,this.Wh=!1,this.Fh=!0,this.Bh='',this.Gh=5,this.Uh='Enter name of player to delete from list'),i>=c.A.qw&&i<=c.A.$w){const t=(i-300)/2|0,s=1&i;let h=this.Wr[t];if(-1!==h)for(;;)if(0===s&&(h--,h<0&&(h=o.A.count-1)),1===s&&(h++,h>=o.A.count&&(h=0)),!o.A.Ro[h].disable&&o.A.Ro[h].type===t+(this.Gr?0:7)){this.Wr[t]=h,this.Hr=!0;break}}if(i>=c.A.Jw&&i<=c.A.Qw){const t=(i-314)/2|0,s=1&i;let h=this.Yr[t];0===s&&(h--,h<0&&(h=W.A.La[t].length-1)),1===s&&(h++,h>=W.A.La[t].length&&(h=0)),this.Yr[t]=h,this.Hr=!0}if(i!==c.A.Da||this.Gr||(this.Gr=!0,this.Vc()),i===c.A.Na&&this.Gr&&(this.Gr=!1,this.Vc()),i===c.A.tA){this.Bt.jc(O.A.iA),this.Bt.p1(this.Gr?0:1);for(let t=0;t<7;t++)this.Bt.p1(this.Wr[t]);for(let t=0;t<5;t++)this.Bt.p1(this.Yr[t]);return!0}return i===c.A.Fa&&(this.ke=!this.ke),i>=c.A.sA&&i<=c.A.hA&&(this.Uw(),this.Me.length>0&&(this.Bt.jc(O.A.eA),this.Bt.nA(M.A.ld(this.Me)),this.Bt.p1(i-601),this.Bt.p1(this.ke?1:0))),!1};Vc=()=>{this.Hr=!0;for(let t=0;t<7;t++){this.Wr[t]=-1;for(let i=0;i{if(!this.Sr||!this.He)return!1;const n=h>>14&32767,r=this.He.gd(this.Dn,i,s,h);if(-1===r)return!1;const o=31&r,l=r>>6&3;if(o===P.A.rA.id||o===P.A.oA.id||o===P.A.lA.id){const t=e.A.get(n);let h,r;l===F.A.bd||l===F.A.Ld?(h=t.width,r=t.length):(h=t.length,r=t.width);let o=t.aA;0!==l&&(o=(o<>4-l)),this.df(this.Sr.wf[0],this.Sr.Af[0],i,s,2,h,r,0,0,o,!1)}else this.df(this.Sr.wf[0],this.Sr.Af[0],i,s,2,0,0,l,o+1,0,!1);return this.qs=this.Rc,this.$s=this.Sc,this.js=2,this.Zs=0,this.Bt.jc(t),this.Bt.p2(i+this.Tn),this.Bt.p2(s+this.On),this.Bt.p2(n),!0};mf=()=>{1===this.Lc&&(this.Rc>=549&&this.Rc<=583&&this.Sc>=195&&this.Sc<231&&-1!==this.Mh[0]?(this.Ws=!0,this.Sh=0,this.Vs=!0):this.Rc>=579&&this.Rc<=609&&this.Sc>=194&&this.Sc<231&&-1!==this.Mh[1]?(this.Ws=!0,this.Sh=1,this.Vs=!0):this.Rc>=607&&this.Rc<=637&&this.Sc>=194&&this.Sc<231&&-1!==this.Mh[2]?(this.Ws=!0,this.Sh=2,this.Vs=!0):this.Rc>=635&&this.Rc<=679&&this.Sc>=194&&this.Sc<229&&-1!==this.Mh[3]?(this.Ws=!0,this.Sh=3,this.Vs=!0):this.Rc>=676&&this.Rc<=706&&this.Sc>=194&&this.Sc<231&&-1!==this.Mh[4]?(this.Ws=!0,this.Sh=4,this.Vs=!0):this.Rc>=704&&this.Rc<=734&&this.Sc>=194&&this.Sc<231&&-1!==this.Mh[5]?(this.Ws=!0,this.Sh=5,this.Vs=!0):this.Rc>=732&&this.Rc<=766&&this.Sc>=195&&this.Sc<231&&-1!==this.Mh[6]?(this.Ws=!0,this.Sh=6,this.Vs=!0):this.Rc>=550&&this.Rc<=584&&this.Sc>=492&&this.Sc<528&&-1!==this.Mh[7]?(this.Ws=!0,this.Sh=7,this.Vs=!0):this.Rc>=582&&this.Rc<=612&&this.Sc>=492&&this.Sc<529&&-1!==this.Mh[8]?(this.Ws=!0,this.Sh=8,this.Vs=!0):this.Rc>=609&&this.Rc<=639&&this.Sc>=492&&this.Sc<529&&-1!==this.Mh[9]?(this.Ws=!0,this.Sh=9,this.Vs=!0):this.Rc>=637&&this.Rc<=681&&this.Sc>=493&&this.Sc<528&&-1!==this.Mh[10]?(this.Ws=!0,this.Sh=10,this.Vs=!0):this.Rc>=679&&this.Rc<=709&&this.Sc>=492&&this.Sc<529&&-1!==this.Mh[11]?(this.Ws=!0,this.Sh=11,this.Vs=!0):this.Rc>=706&&this.Rc<=736&&this.Sc>=492&&this.Sc<529&&-1!==this.Mh[12]?(this.Ws=!0,this.Sh=12,this.Vs=!0):this.Rc>=734&&this.Rc<=768&&this.Sc>=492&&this.Sc<528&&-1!==this.Mh[13]&&(this.Ws=!0,this.Sh=13,this.Vs=!0),$.K.ft++,$.K.ft>150&&($.K.ft=0,this.Bt.jc(O.A.cA),this.Bt.p1(43)))};Cf=async()=>{for(;;){let t;do{for(;;){if(t=this.kc(),-1===t)return;if(-1!==this.Xs&&this.Xs===this.xe){8===t&&this.Me.length>0&&(this.Me=this.Me.substring(0,this.Me.length-1));break}if(this.Fh){if(t>=32&&t<=122&&this.Bh.length<80&&(this.Bh=this.Bh+String.fromCharCode(t),this.Ys=!0),8===t&&this.Bh.length>0&&(this.Bh=this.Bh.substring(0,this.Bh.length-1),this.Ys=!0),13===t||10===t){let t;if(this.Fh=!1,this.Ys=!0,1===this.Gh&&(t=M.A.ld(this.Bh),this.Gw(t)),2===this.Gh&&this.Vr>0&&(t=M.A.ld(this.Bh),this.Ww(t)),3===this.Gh&&this.Bh.length>0&&this.no){this.Bt.jc(O.A.fA),this.Bt.p1(0);const t=this.Bt.Fc;this.Bt.nA(this.no),v.A.uA(this.Bt,this.Bh),this.Bt.Hf(this.Bt.Fc-t),this.Bh=M.A.dA(this.Bh),this.Bh=b.A.filter(this.Bh),this.Ud(6,this.Bh,M.A.ga(M.A.Ca(this.no))),2===this.xh&&(this.xh=1,this.Ks=!0,this.Bt.jc(O.A.wA),this.Bt.p1(this.kh),this.Bt.p1(this.xh),this.Bt.p1(this.Dh))}4===this.Gh&&this.dh<100&&(t=M.A.ld(this.Bh),this.Hw(t)),5===this.Gh&&this.dh>0&&(t=M.A.ld(this.Bh),this.Yw(t))}}else if(this.Wh){if(t>=48&&t<=57&&this.Hh.length<10&&(this.Hh=this.Hh+String.fromCharCode(t),this.Ys=!0),8===t&&this.Hh.length>0&&(this.Hh=this.Hh.substring(0,this.Hh.length-1),this.Ys=!0),13===t||10===t){if(this.Hh.length>0){let t=0;try{t=parseInt(this.Hh,10)}catch(t){}this.Bt.jc(O.A.AA),this.Bt.p4(t)}this.Wh=!1,this.Ys=!0}}else if(-1===this.lh&&(t>=32&&t<=122&&this.qh.length<80&&(this.qh=this.qh+String.fromCharCode(t),this.Ys=!0),8===t&&this.qh.length>0&&(this.qh=this.qh.substring(0,this.qh.length-1),this.Ys=!0),(13===t||10===t)&&this.qh.length>0)){if('::clientdrop'===this.qh)await this.qc();else if(this.Br&&'::noclip'===this.qh)for(let t=0;t122)&&(t<65||t>90)&&(t<48||t>57)&&32!==t);this.Me.length<12&&(this.Me=this.Me+String.fromCharCode(t))}};If=()=>{if(1===this.Lc)if(this.Rc>=8&&this.Rc<=108&&this.Sc>=490&&this.Sc<=522)this.kh=(this.kh+1)%4,this.Ks=!0,this.Ys=!0,this.Bt.jc(O.A.wA),this.Bt.p1(this.kh),this.Bt.p1(this.xh),this.Bt.p1(this.Dh);else if(this.Rc>=137&&this.Rc<=237&&this.Sc>=490&&this.Sc<=522)this.xh=(this.xh+1)%3,this.Ks=!0,this.Ys=!0,this.Bt.jc(O.A.wA),this.Bt.p1(this.kh),this.Bt.p1(this.xh),this.Bt.p1(this.Dh);else if(this.Rc>=275&&this.Rc<=375&&this.Sc>=490&&this.Sc<=522)this.Dh=(this.Dh+1)%3,this.Ks=!0,this.Ys=!0,this.Bt.jc(O.A.wA),this.Bt.p1(this.kh),this.Bt.p1(this.xh),this.Bt.p1(this.Dh);else if(this.Rc>=416&&this.Rc<=516&&this.Sc>=490&&this.Sc<=522){this.Uw(),this.Me='',this.ke=!1;for(let t=0;t{if(this.Nh?this.Ph=32:this.Ph=0,this.Nh=!1,t>=n&&t=r&&i=n&&t=r+h-16&&i=n-this.Ph&&t=r+16&&i0){let t=(h-32)*h/s|0;t<8&&(t=8);const n=i-r-(t/2|0)-16,l=h-t-32;o.Tl=(s-h)*n/l|0,e&&(this.Ws=!0),this.Nh=!0}};Kc=()=>{this.Fi||(this.Lo(),this.Mo=null,this.ti=null,this.ii=null,this.si=null,this.hi=null,this.ei=null,this.ni=null,this.ri=null,this.oi=null,this.li=null,this.Fi=new f.A(479,96),this.Ni=new f.A(168,160),u.A.clear(),this.os?.draw(0,0),this.Di=new f.A(190,261),this.Pi=new f.A(512,334),u.A.clear(),this.Ui=new f.A(501,61),this.Bi=new f.A(288,40),this.Gi=new f.A(269,66),this.$t=!0)};lu=t=>{if(!t)return!1;for(let i=0;i{if(0n===t)return;if(this.Vr>=100)return void this.Ud(0,'Your friends list is full. Max of 100 hit','');const i=M.A.ga(M.A.Ca(t));for(let s=0;s{if(0n!==t)for(let i=0;i{if(0n===t)return;if(this.dh>=100)return void this.Ud(0,'Your ignore list is full. Max of 100 hit','');const i=M.A.ga(M.A.Ca(t));for(let s=0;s{if(0n!==t)for(let i=0;i{const s=this.gr[this.Dn][t][i];if(!s)return void this.He?.TA(this.Dn,t,i);let h=-99999999,e=null;for(let t=s.head();t;t=s.next()){const i=n.A.get(t.index);let s=i.OA;i.da&&(s*=t.count+1),s>h&&(h=s,e=t)}if(!e)return;s.bA(e);let r=-1,o=-1,l=0,a=0;for(let t=s.head();t;t=s.next())t.index!==e.index&&-1===r&&(r=t.index,l=t.count),t.index!==e.index&&t.index!==r&&-1===o&&(o=t.index,a=t.count);let c=null;-1!==r&&(c=n.A.get(r).vA(l));let f=null;-1!==o&&(f=n.A.get(o).vA(a));const u=t+(i<<7)+1610612736|0,d=n.A.get(e.index);this.He?.LA(t,i,this.Bf(this.Dn,128*t+64,128*i+64),this.Dn,u,d.vA(e.count),f,c)};RA=(t,i,s,h,n,r,o)=>{if(i<1||s<1||i>102||s>102)return;if($.K.st&&t!==this.Dn)return;if(!this.He)return;let l=0;if(o===N.A.SA&&(l=this.He.Ed(t,i,s)),o===N.A.MA&&(l=this.He.kA(t,s,i)),o===N.A.xA&&(l=this.He.Md(t,i,s)),o===N.A.lA&&(l=this.He.Ad(t,i,s)),0!==l){const h=this.He.gd(t,i,s,l),n=l>>14&32767,r=31&h,a=h>>6;if(o===N.A.SA){this.He?.DA(t,i,s,1);const h=e.A.get(n);h.NA&&this.kn[t]?.DA(i,s,r,a,h.PA)}if(o===N.A.MA&&this.He?.FA(t,i,s),o===N.A.xA){this.He.UA(t,i,s);const h=e.A.get(n);if(i+h.width>G.A.Xn-1||s+h.width>G.A.Xn-1||i+h.length>G.A.Xn-1||s+h.length>G.A.Xn-1)return;h.NA&&this.kn[t]?.UA(i,s,h.width,h.length,a,h.PA)}if(o===N.A.lA){this.He?.BA(t,i,s);const h=e.A.get(n);h.NA&&h.active&&this.kn[t]?.GA(i,s)}}if(h>=0){let e=t;this.Yn&&t<3&&!(2&~this.Yn[1][i][s])&&(e=t+1),this.Wn&&D.A.RA(t,i,s,this.He,this.Wn,this._r,this.kn[t],h,r,n,e)}};Uw=()=>{this.Bt.jc(O.A.HA),-1!==this.oh&&(this.oh=-1,this.Ws=!0,this.ye=!1,this.Vs=!0),-1!==this.lh&&(this.lh=-1,this.Ys=!0,this.ye=!1),this.Xs=-1};qc=async()=>{this.Yt>0?await this.WA():(this.Pi?.bind(),this.wi?.Ac(257,144,'Connection lost',m.A.Bl),this.wi?.Ac(256,143,'Connection lost',m.A._l),this.wi?.Ac(257,159,'Please wait - attempting to reestablish',m.A.Bl),this.wi?.Ac(256,158,'Please wait - attempting to reestablish',m.A._l),this.Pi?.draw(8,11),this.Ke=0,this.stream?.close(),this.ac=!1,await this.Mc(this.username,this.password,!0),this.ac||await this.WA())};WA=async()=>{this.stream&&this.stream.close(),this.stream=null,this.ac=!1,this.Jt=0,this.username='',this.password='',k.A.Wc(),this.Qf(),this.He?.reset();for(let t=0;t{if(!this.stream)return!1;try{let t=this.stream.available;if(0===t)return!1;if(-1===this.Xt&&(await this.stream.Pc(this.in.data,0,1),this.Xt=255&this.in.data[0],this.Kt&&(this.Xt=this.Xt-this.Kt.YA&255),this.packetSize=E.A.VA[this.Xt],t--),-1===this.packetSize){if(t<=0)return!1;await this.stream.Pc(this.in.data,0,1),this.packetSize=255&this.in.data[0],t--}if(-2===this.packetSize){if(t<=1)return!1;await this.stream.Pc(this.in.data,0,2),this.in.Fc=0,this.packetSize=this.in.KA,t-=2}if(t0&&this.Ud(5,s+' has logged in.',''),0===i&&this.Ud(5,s+' has logged out.','')),s=null;break}s&&this.Vr<100&&(this.ho[this.Vr]=t,this.so[this.Vr]=s,this.eo[this.Vr]=i,this.Vr++,this.Ws=!0);let h=!1;for(;!h;){h=!0;for(let t=0;t=0&&h>=0&&s=G.A.Xn||t.z>=G.A.Xn)&&t.sy();return 0!==this.Ke&&(this.Ke-=e,this.Xe-=n),this.ze=!1,this.Xt=-1,!0}if(this.Xt===T.A.hy)return c.A.Ro[this.in.KA].model=this.Sr?.ey()||null,this.Xt=-1,!0;if(this.Xt===T.A.ny)return this.Ah=this.in.ZA,1===this.Ah&&(this.yh=this.in.KA),this.Ah>=2&&this.Ah<=6&&(2===this.Ah&&(this.ph=64,this.mh=64),3===this.Ah&&(this.ph=0,this.mh=64),4===this.Ah&&(this.ph=128,this.mh=64),5===this.Ah&&(this.ph=64,this.mh=0),6===this.Ah&&(this.ph=64,this.mh=128),this.Ah=2,this._h=this.in.KA,this.Eh=this.in.KA,this.gh=this.in.ZA),10===this.Ah&&(this.Ih=this.in.KA),this.Xt=-1,!0;if(this.Xt===T.A.oy){const t=this.in.ly,i=this.in.Ko,s=this.in.Ko;return t!==this.mo&&this.po&&!$.K.st&&await this.Vo(t,i,s),this.mo=t,this.Io=i,this._o=s,this.yo=0,this.Xt=-1,!0}if(this.Xt===T.A.uy)return await this.WA(),this.Xt=-1,!1;if(this.Xt===T.A.wy){const t=this.in.ZA,i=this.in.ZA;let s=-1;if(this.Ln)for(let h=0;h=100&&(this.ln=128*this.tr+64,this.cn=128*this.ir+64,this.an=this.Bf(this.Dn,this.tr,this.ir)-this.sr),this.Xt=-1,!0;if(this.Xt===T.A.sp){this._n=this.in.ZA,this.En=this.in.ZA;for(let t=this._n;t=this._n&&t.x=this.En&&t.z1?this.Ud(7,e,M.A.ga(M.A.Ca(t))):this.Ud(3,e,M.A.ga(M.A.Ca(t)))}catch(t){}return this.Xt=-1,!0}if(this.Xt===T.A.lp){for(let t=0;t=100){const t=128*this.Zn+64,i=128*this.qn+64,s=this.Bf(this.Dn,this.Zn,this.qn)-this.$n,h=t-this.ln,e=s-this.an,n=i-this.cn,r=0|Math.sqrt(h*h+n*n);this.fn=325.949*Math.atan2(e,r)&2047,this.un=-325.949*Math.atan2(h,n)&2047,this.fn<128&&(this.fn=128),this.fn>383&&(this.fn=383)}return this.Xt=-1,!0}if(this.Xt===T.A.dp)return this.Sh=this.in.ZA,this.Ws=!0,this.Vs=!0,this.Xt=-1,!0;if(this.Xt===T.A.wp){const t=this.in.ly;let i;if(t.endsWith(':tradereq:')){const s=t.substring(0,t.indexOf(':'));i=M.A.ld(s);let h=!1;for(let t=0;t>10&31,h=i>>5&31,e=31&i;return c.A.Ro[t].Yl=(s<<19)+(h<<11)+(e<<3),this.Xt=-1,!0}if(this.Xt===T.A.Ep){for(let t=0;t=this.bh[s]&&(this.Oh[t]=s+2);return this.Xt=-1,!0}if(this.Xt===T.A.Lp){for(this._n=this.in.ZA,this.En=this.in.ZA;this.in.Fc=0&&t{try{this.In=-1,this.Er.clear(),this._r.clear(),this.Ir.clear(),this.mr.clear(),d.A.Pp(),this.Qf(),this.He?.reset();for(let t=0;t>8,s=255&this.Ln[t];if(33===i&&s>=71&&s<=73){D.A.st=!1;break}}if($.K.st?this.He?.Fp(this.Dn):this.He?.Fp(0),this.Ln&&this.bn){this.Bt.jc(O.A.bf);for(let s=0;s>8)-this.Tn,h=64*(255&this.Ln[s])-this.On,e=this.bn[s];if(e){const s=new I.A(new Uint8Array(e)).Ko,n=R.A.read(s,e,e.length-4,4);t.Up(8*(this.gn-6),8*(this.Cn-6),i,h,n)}else this.Cn<800&&t.Bp(h,i,64,64)}}if(this.Ln&&this.vn){this.Bt.jc(O.A.bf);for(let s=0;s>8)-this.Tn,r=64*(255&this.Ln[s])-this.On;t.Gp(this.He,this._r,this.kn,e,n,r)}}}this.Bt.jc(O.A.bf),t.Hp(this.He,this.kn),this.Pi?.bind(),this.Bt.jc(O.A.bf);for(let t=this._r.head();t;t=this._r.next())2===(this.Yn&&2&this.Yn[1][t.Wp][t.Yp])&&(t.Vp--,t.Vp<0&&t.sy());for(let t=0;t{const i=c.A.Ro[t];if(i.ll)for(let t=0;t{let t=0;for(let i=0;i<99;i++){const s=i+1;t+=s+300*Math.pow(2,s/7)|0,this.bh[i]=t/4|0}};Ud=(t,i,s)=>{0===t&&-1!==this.Yh&&(this.Lh=i,this.Lc=0),-1===this.lh&&(this.Ys=!0);for(let t=99;t>0;t--)this.messageType[t]=this.messageType[t-1],this.Kh[t]=this.Kh[t-1],this.Vh[t]=this.Vh[t-1];$.K.nt&&0===t&&(i='['+(this.Pt/30|0)+']: '+i),this.messageType[0]=t,this.Kh[0]=s,this.Vh[0]=i};Fw=async t=>{const i=a.A.Ro[t].Xp;if(0!==i){const s=this.pe[t];if(1===i&&(1===s&&d.A.sc(.9),2===s&&d.A.sc(.8),3===s&&d.A.sc(.7),4===s&&d.A.sc(.6),n.A.su?.clear(),this.$t=!0),3===i){const t=this.po;0===s&&(this.Eo=256,(0,j.zp)(256),this.po=!0),1===s&&(this.Eo=192,(0,j.zp)(192),this.po=!0),2===s&&(this.Eo=128,(0,j.zp)(128),this.po=!0),3===s&&(this.Eo=64,(0,j.zp)(64),this.po=!0),4===s&&(this.po=!1),this.po!==t&&(this.po&&this.mo?await this.Vo(this.mo,this.Io,this._o):(0,j.vo)(),this.yo=0)}4===i&&(0===s&&(this.fo=256,(0,j.jp)(256),this.oo=!0),1===s&&(this.fo=192,(0,j.jp)(192),this.oo=!0),2===s&&(this.fo=128,(0,j.jp)(128),this.oo=!0),3===s&&(this.fo=64,(0,j.jp)(64),this.oo=!0),4===s&&(this.oo=!1)),5===i&&(this.Ce=s),6===i&&(this.Zh=s),8===i&&(this.jh=s,this.Ys=!0)}};Zp=(t,i)=>{let s=0;for(let t=0;t<100;t++){if(!this.Vh[t])continue;const h=this.messageType[t],e=this.uh+70+4-14*s;if(e<-20)break;0===h&&s++,1!==h&&2!==h||!(1===h||0===this.kh||1===this.kh&&this.lu(this.Kh[t]))||(i>e-14&&i<=e&&this.Sr&&this.Kh[t]!==this.Sr.name&&(this.Br&&(this.rh[this.nh]='Report abuse @whi@'+this.Kh[t],this.Te[this.nh]=34,this.nh++),this.rh[this.nh]='Add ignore @whi@'+this.Kh[t],this.Te[this.nh]=436,this.nh++,this.rh[this.nh]='Add friend @whi@'+this.Kh[t],this.Te[this.nh]=406,this.nh++),s++),3!==h&&7!==h||0!==this.jh||!(7===h||0===this.xh||1===this.xh&&this.lu(this.Kh[t]))||(i>e-14&&i<=e&&(this.Br&&(this.rh[this.nh]='Report abuse @whi@'+this.Kh[t],this.Te[this.nh]=34,this.nh++),this.rh[this.nh]='Add ignore @whi@'+this.Kh[t],this.Te[this.nh]=436,this.nh++,this.rh[this.nh]='Add friend @whi@'+this.Kh[t],this.Te[this.nh]=406,this.nh++),s++),4===h&&(0===this.Dh||1===this.Dh&&this.lu(this.Kh[t]))&&(i>e-14&&i<=e&&(this.rh[this.nh]='Accept trade @whi@'+this.Kh[t],this.Te[this.nh]=903,this.nh++),s++),(5===h||6===h)&&0===this.jh&&this.xh<2&&s++,8===h&&(0===this.Dh||1===this.Dh&&this.lu(this.Kh[t]))&&(i>e-14&&i<=e&&(this.rh[this.nh]='Accept duel @whi@'+this.Kh[t],this.Te[this.nh]=363,this.nh++),s++)}};qp=t=>{if(0===this.jh)return;let i=0;0!==this.Vt&&(i=1);for(let s=0;s<100;s++)if(null!==this.Vh[s]){const h=this.messageType[s];if((3===h||7===h)&&(7===h||0===this.xh||1===this.xh&&this.lu(this.Kh[s]))){const h=329-13*i;if(this.xl>8&&this.xl<520&&t-11>h-10&&t-11<=h+3&&(this.Br&&(this.rh[this.nh]='Report abuse @whi@'+this.Kh[s],this.Te[this.nh]=2034,this.nh++),this.rh[this.nh]='Add ignore @whi@'+this.Kh[s],this.Te[this.nh]=2436,this.nh++,this.rh[this.nh]='Add friend @whi@'+this.Kh[s],this.Te[this.nh]=2406,this.nh++),i++,i>=5)return}if((5===h||6===h)&&this.xh<2&&(i++,i>=5))return}};$p=(t,i,s,h,e,r)=>{if(0!==t.type||!t.ll||t.hide||ih+t.width||s>e+t.height||!t.pl||!t.ml)return;const o=t.ll.length;for(let l=0;l=0||0!==f.Kl)&&i>=o&&s>=a&&i=0?this.Se=f.Jp:this.Se=f.id),0===f.type)this.$p(f,i,s,o,a,f.Tl),f.scroll>f.height&&this.Rf(i,s,f.scroll,f.height,!0,o+f.width,a,f);else if(2===f.type){let t=0;for(let h=0;h=r+32||s>=l+32){t++;continue}if(this.Re=t,this.Le=f.id,!f.Ll||f.Ll[t]<=0){t++;continue}const c=n.A.get(f.Ll[t]-1);if(1===this.oe&&f.Qp)f.id===this.ae&&t===this.le||(this.rh[this.nh]='Use '+this.fe+' with @lre@'+c.name,this.Te[this.nh]=881,this.Oe[this.nh]=c.id,this.be[this.nh]=t,this.ve[this.nh]=f.id,this.nh++);else if(1===this.Ie&&f.Qp)16&~this.Ee||(this.rh[this.nh]=this.ge+' @lre@'+c.name,this.Te[this.nh]=391,this.Oe[this.nh]=c.id,this.be[this.nh]=t,this.ve[this.nh]=f.id,this.nh++);else{if(f.Qp)for(let i=4;i>=3;i--)c.tm&&c.tm[i]?(this.rh[this.nh]=c.tm[i]+' @lre@'+c.name,3===i?this.Te[this.nh]=478:4===i&&(this.Te[this.nh]=347),this.Oe[this.nh]=c.id,this.be[this.nh]=t,this.ve[this.nh]=f.id,this.nh++):4===i&&(this.rh[this.nh]='Drop @lre@'+c.name,this.Te[this.nh]=347,this.Oe[this.nh]=c.id,this.be[this.nh]=t,this.ve[this.nh]=f.id,this.nh++);if(f.im&&(this.rh[this.nh]='Use @lre@'+c.name,this.Te[this.nh]=188,this.Oe[this.nh]=c.id,this.be[this.nh]=t,this.ve[this.nh]=f.id,this.nh++),f.Qp&&c.tm)for(let i=2;i>=0;i--)c.tm[i]&&(this.rh[this.nh]=c.tm[i]+' @lre@'+c.name,0===i?this.Te[this.nh]=405:1===i?this.Te[this.nh]=38:2===i&&(this.Te[this.nh]=422),this.Oe[this.nh]=c.id,this.be[this.nh]=t,this.ve[this.nh]=f.id,this.nh++);if(f.sm)for(let i=4;i>=0;i--)f.sm[i]&&(this.rh[this.nh]=f.sm[i]+' @lre@'+c.name,0===i?this.Te[this.nh]=602:1===i?this.Te[this.nh]=596:2===i?this.Te[this.nh]=22:3===i?this.Te[this.nh]=892:4===i&&(this.Te[this.nh]=415),this.Oe[this.nh]=c.id,this.be[this.nh]=t,this.ve[this.nh]=f.id,this.nh++);this.rh[this.nh]='Examine @lre@'+c.name,$.K.nt&&(this.rh[this.nh]+='@whi@ ('+c.id+')'),this.Te[this.nh]=1773,this.Oe[this.nh]=c.id,f.Rl&&(this.ve[this.nh]=f.Rl[t]),this.nh++}t++}}else if(i>=o&&s>=a&&i{let i=t.El;return i>=c.A.Aa&&i<=c.A.ma?(i>=c.A.pa?i-=c.A.pa:i--,this.rh[this.nh]='Remove @whi@'+this.so[i],this.Te[this.nh]=557,this.nh++,this.rh[this.nh]='Message @whi@'+this.so[i],this.Te[this.nh]=679,this.nh++,!0):i>=c.A._a&&i<=c.A.Ea&&(this.rh[this.nh]='Remove @whi@'+t.text,this.Te[this.nh]=556,this.nh++,!0)};um=()=>{0===this.oe&&0===this.Ie&&(this.rh[this.nh]='Walk here',this.Te[this.nh]=660,this.be[this.nh]=this.xl,this.ve[this.nh]=this.Dl,this.nh++);let t=-1;for(let i=0;i>7&127,o=s>>29&3,l=s>>14&32767;if(s!==t){if(t=s,2===o&&this.He&&this.He.gd(this.Dn,h,r,s)>=0){const t=e.A.get(l);if(1===this.oe)this.rh[this.nh]='Use '+this.fe+' with @cya@'+t.name,this.Te[this.nh]=450,this.Oe[this.nh]=s,this.be[this.nh]=h,this.ve[this.nh]=r,this.nh++;else if(1!==this.Ie){if(t.wm)for(let i=4;i>=0;i--)t.wm[i]&&(this.rh[this.nh]=t.wm[i]+' @cya@'+t.name,0===i&&(this.Te[this.nh]=285),1===i&&(this.Te[this.nh]=504),2===i&&(this.Te[this.nh]=364),3===i&&(this.Te[this.nh]=581),4===i&&(this.Te[this.nh]=1501),this.Oe[this.nh]=s,this.be[this.nh]=h,this.ve[this.nh]=r,this.nh++);this.rh[this.nh]='Examine @cya@'+t.name,$.K.nt&&(this.rh[this.nh]+='@whi@ ('+t.id+')'),this.Te[this.nh]=1175,this.Oe[this.nh]=s,this.be[this.nh]=h,this.ve[this.nh]=r,this.nh++}else 4&~this.Ee||(this.rh[this.nh]=this.ge+' @cya@'+t.name,this.Te[this.nh]=55,this.Oe[this.nh]=s,this.be[this.nh]=h,this.ve[this.nh]=r,this.nh++)}if(1===o){const t=this.Ar[l];if(t&&t.type&&1===t.type.size&&64==(127&t.x)&&64==(127&t.z))for(let i=0;i=0;s--)t.wm&&t.wm[s]?(this.rh[this.nh]=t.wm[s]+' @lre@'+t.name,0===s&&(this.Te[this.nh]=224),1===s&&(this.Te[this.nh]=993),2===s&&(this.Te[this.nh]=99),3===s&&(this.Te[this.nh]=746),4===s&&(this.Te[this.nh]=877),this.Oe[this.nh]=i.index,this.be[this.nh]=h,this.ve[this.nh]=r,this.nh++):2===s&&(this.rh[this.nh]='Take @lre@'+t.name,this.Te[this.nh]=99,this.Oe[this.nh]=i.index,this.be[this.nh]=h,this.ve[this.nh]=r,this.nh++);this.rh[this.nh]='Examine @lre@'+t.name,$.K.nt&&(this.rh[this.nh]+='@whi@ ('+i.index+')'),this.Te[this.nh]=1102,this.Oe[this.nh]=i.index,this.be[this.nh]=h,this.ve[this.nh]=r,this.nh++}else 1&~this.Ee||(this.rh[this.nh]=this.ge+' @lre@'+t.name,this.Te[this.nh]=965,this.Oe[this.nh]=i.index,this.be[this.nh]=h,this.ve[this.nh]=r,this.nh++)}}}}};Am=(t,i,s,h)=>{if(this.nh>=400)return;let e=t.name;if(0!==t._m&&this.Sr&&(e=e+this.Em(this.Sr.Ka,t._m)+' (level-'+t._m+')'),1===this.oe)this.rh[this.nh]='Use '+this.fe+' with @yel@'+e,this.Te[this.nh]=900,this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++;else if(1!==this.Ie){let n;if(t.wm)for(n=4;n>=0;n--)t.wm[n]&&'attack'!==t.wm[n]?.toLowerCase()&&(this.rh[this.nh]=t.wm[n]+' @yel@'+e,0===n?this.Te[this.nh]=728:1===n?this.Te[this.nh]=542:2===n?this.Te[this.nh]=6:3===n?this.Te[this.nh]=963:4===n&&(this.Te[this.nh]=245),this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++);if(t.wm)for(n=4;n>=0;n--)if(t.wm[n]&&'attack'===t.wm[n]?.toLowerCase()){let r=0;this.Sr&&t._m>this.Sr.Ka&&(r=2e3),this.rh[this.nh]=t.wm[n]+' @yel@'+e,0===n?this.Te[this.nh]=r+728:1===n?this.Te[this.nh]=r+542:2===n?this.Te[this.nh]=r+6:3===n?this.Te[this.nh]=r+963:4===n&&(this.Te[this.nh]=r+245),this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++}this.rh[this.nh]='Examine @yel@'+e,$.K.nt&&(this.rh[this.nh]+='@whi@ ('+t.id+')'),this.Te[this.nh]=1607,this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++}else 2&~this.Ee||(this.rh[this.nh]=this.ge+' @yel@'+e,this.Te[this.nh]=265,this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++)};ym=(t,i,s,h)=>{if(t===this.Sr||this.nh>=400)return;let e=null;this.Sr&&(e=t.name+this.Em(this.Sr.Ka,t.Ka)+' (level-'+t.Ka+')'),1===this.oe?(this.rh[this.nh]='Use '+this.fe+' with @whi@'+e,this.Te[this.nh]=367,this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++):1!==this.Ie?(this.rh[this.nh]='Follow @whi@'+e,this.Te[this.nh]=1544,this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++,0===this.Js&&(this.rh[this.nh]='Trade with @whi@'+e,this.Te[this.nh]=1373,this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++),this.Fr>0&&(this.rh[this.nh]='Attack @whi@'+e,this.Sr&&this.Sr.Ka>=t.Ka?this.Te[this.nh]=151:this.Te[this.nh]=2151,this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++),1===this.Ur&&(this.rh[this.nh]='Fight @whi@'+e,this.Te[this.nh]=151,this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++),2===this.Ur&&(this.rh[this.nh]='Duel-with @whi@'+e,this.Te[this.nh]=1101,this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++)):8&~this.Ee||(this.rh[this.nh]=this.ge+' @whi@'+e,this.Te[this.nh]=651,this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++);for(let t=0;t{const s=t-i;return s<-9?'@red@':s<-6?'@or3@':s<-3?'@or2@':s<0?'@or1@':s>9?'@gre@':s>6?'@gr3@':s>3?'@gr2@':s>0?'@gr1@':'@yel@'};ef=()=>{if(0===this.se){this.rh[0]='Cancel',this.Te[0]=1252,this.nh=1,this.qp(this.Dl),this.Se=0,this.xl>8&&this.Dl>11&&this.xl<520&&this.Dl<345&&(-1===this.Xs?this.um():this.$p(c.A.Ro[this.Xs],this.xl,this.Dl,8,11,0)),this.Se!==this.$h&&(this.$h=this.Se),this.Se=0,this.xl>562&&this.Dl>231&&this.xl<752&&this.Dl<492&&(-1!==this.oh?this.$p(c.A.Ro[this.oh],this.xl,this.Dl,562,231,0):-1!==this.Mh[this.Sh]&&this.$p(c.A.Ro[this.Mh[this.Sh]],this.xl,this.Dl,562,231,0)),this.Se!==this.Jh&&(this.Ws=!0,this.Jh=this.Se),this.Se=0,this.xl>22&&this.Dl>375&&this.xl<431&&this.Dl<471&&(-1===this.lh?this.Zp(this.xl-22,this.Dl-375):this.$p(c.A.Ro[this.lh],this.xl,this.Dl,22,375,0)),-1!==this.lh&&this.Se!==this.Qh&&(this.Ys=!0,this.Qh=this.Se);let t=!1;for(;!t;){t=!0;for(let i=0;i1e3){const s=this.rh[i];this.rh[i]=this.rh[i+1],this.rh[i+1]=s;const h=this.Te[i];this.Te[i]=this.Te[i+1],this.Te[i+1]=h;const e=this.be[i];this.be[i]=this.be[i+1],this.be[i+1]=e;const n=this.ve[i];this.ve[i]=this.ve[i+1],this.ve[i+1]=n;const r=this.Oe[i];this.Oe[i]=this.Oe[i+1],this.Oe[i+1]=r,t=!1}}}};lf=()=>{let t=0;if(this.Ai){let i;t=this.Ai.au('Choose Option');for(let s=0;st&&(t=i)}t+=8;const i=15*this.nh+21;let s,h;this.Rc>8&&this.Sc>11&&this.Rc<520&&this.Sc<345&&(s=this.Rc-(t/2|0)-8,s+t>512?s=512-t:s<0&&(s=0),h=this.Sc-11,h+i>334?h=334-i:h<0&&(h=0),this.Qs=!0,this.th=0,this.ih=s,this.sh=h,this.hh=t,this.eh=15*this.nh+22),this.Rc>562&&this.Sc>231&&this.Rc<752&&this.Sc<492&&(s=this.Rc-(t/2|0)-562,s<0?s=0:s+t>190&&(s=190-t),h=this.Sc-231,h<0?h=0:h+i>261&&(h=261-i),this.Qs=!0,this.th=1,this.ih=s,this.sh=h,this.hh=t,this.eh=15*this.nh+22),this.Rc>22&&this.Sc>375&&this.Rc<501&&this.Sc<471&&(s=this.Rc-(t/2|0)-22,s<0?s=0:s+t>479&&(s=479-t),h=this.Sc-375,h<0?h=0:h+i>96&&(h=96-i),this.Qs=!0,this.th=2,this.ih=s,this.sh=h,this.hh=t,this.eh=15*this.nh+22)};df=(t,i,s,h,e,n,r,o,l,a,c)=>{const f=this.kn[this.Dn];if(!f)return!1;const u=G.A.Xn,d=G.A.Xn;for(let t=0;t0&&0===this.vr[i]&&(E[i]&H.A.pd)===H.A.OPEN&&(this.Or[p]=w-1,this.br[p]=A,p=(p+1)%_,this.vr[i]=2,this.Lr[i]=t),i=G.A.index(w+1,A),w0&&0===this.vr[i]&&(E[i]&H.A.Id)===H.A.OPEN&&(this.Or[p]=w,this.br[p]=A-1,p=(p+1)%_,this.vr[i]=1,this.Lr[i]=t),i=G.A.index(w,A+1),A0&&A>0&&0===this.vr[i]&&!(E[i]&H.A.bm)&&(E[G.A.index(w-1,A)]&H.A.pd)===H.A.OPEN&&(E[G.A.index(w,A-1)]&H.A.Id)===H.A.OPEN&&(this.Or[p]=w-1,this.br[p]=A-1,p=(p+1)%_,this.vr[i]=3,this.Lr[i]=t),i=G.A.index(w+1,A-1),w0&&0===this.vr[i]&&!(E[i]&H.A.vm)&&(E[G.A.index(w+1,A)]&H.A.md)===H.A.OPEN&&(E[G.A.index(w,A-1)]&H.A.Id)===H.A.OPEN&&(this.Or[p]=w+1,this.br[p]=A-1,p=(p+1)%_,this.vr[i]=9,this.Lr[i]=t),i=G.A.index(w-1,A+1),w>0&&A=0&&s>=0&&e0){_=Math.min(m,25),m--;const t=this.Or[m],i=this.br[m];if($.K.nt&&1===this.if[6]&&1===this.if[7]){for(let t=0;t{this.cr=0,this.ar=0,this.xm(t),this.Dm(t),this.Nm(t,i),this.Pm(t);for(let t=0;t{t.Fm();if(0!==t.Um(1)){const i=t.Um(2);if(0===i)this.ur[this.ar++]=this.Mt;else if(1===i){const i=t.Um(3);this.Sr?.step(!1,i);1===t.Um(1)&&(this.ur[this.ar++]=this.Mt)}else if(2===i){const i=t.Um(3);this.Sr?.step(!0,i);const s=t.Um(3);this.Sr?.step(!0,s);1===t.Um(1)&&(this.ur[this.ar++]=this.Mt)}else if(3===i){this.Dn=t.Um(2);const i=t.Um(7),s=t.Um(7),h=t.Um(1);this.Sr?.move(1===h,i,s);1===t.Um(1)&&(this.ur[this.ar++]=this.Mt)}}};Dm=t=>{const i=t.Um(8);if(ithis.rr)throw new Error(`eek! ${this.username} Too many players`);this.rr=0;for(let s=0;s{let s;for(;t.Bm+10<8*i&&(s=t.Um(11),2047!==s);){if(!this.nr[s]){this.nr[s]=new W.A;const t=this.wr[s];t&&this.nr[s]?.read(t)}this.lr[this.rr++]=s;const i=this.nr[s];i&&(i.Vf=this.Pt);let h=t.Um(5);h>15&&(h-=32);let e=t.Um(5);e>15&&(e-=32);const n=t.Um(1);this.Sr&&i?.move(1===n,this.Sr.wf[0]+h,this.Sr.Af[0]+e);1===t.Um(1)&&(this.ur[this.ar++]=s)}t.Gm()};Pm=t=>{for(let i=0;i{if(t.Eu=s,t.gu=this.Pt,(s&W.A.Cu)===W.A.Cu){const s=e.ZA,h=new Uint8Array(s),n=new I.A(h);e.xy(s,0,h),this.wr[i]=n,t.read(n)}if((s&W.A.Tu)===W.A.Tu){let i=e.KA;65535===i&&(i=-1),i===t.Ou&&(t.Ym=0);const s=e.ZA;(-1===i||-1===t.Ou||h.A.Ro[i].priority>h.A.Ro[t.Ou].priority||0===h.A.Ro[t.Ou].priority)&&(t.Ou=i,t.Vm=0,t.Km=0,t.Xm=s,t.Ym=0)}if((s&W.A.bu)===W.A.bu&&(t.vu=e.KA,65535===t.vu&&(t.vu=-1)),(s&W.A.Lu)===W.A.Lu&&(t.ou=e.ly,t.cu=0,t.fu=0,t.uu=150,t.name&&this.Ud(2,t.ou,t.name)),(s&W.A.Ru)===W.A.Ru&&(t.pu=e.ZA,t.yu=e.ZA,t.du=this.Pt+400,t.wu=e.ZA,t.Au=e.ZA),(s&W.A.Su)===W.A.Su&&(t.zm=e.KA,t.jm=e.KA,t.Mu=t.zm,t.ku=t.jm),(s&W.A.xu)===W.A.xu){const i=e.KA,s=e.ZA,h=e.ZA,n=e.Fc;if(t.name){const n=M.A.ld(t.name);let r=!1;if(s<=1)for(let t=0;t>8,t.fu=255&i,t.uu=150,s>1?this.Ud(1,r,t.name):this.Ud(2,r,t.name)}catch(t){}}e.Fc=n+h}if((s&W.A.Du)===W.A.Du){t.Nu=e.KA;const i=e.Ko;t.Zm=i>>16,t.qm=this.Pt+(65535&i),t.$m=0,t.Jm=0,t.qm>this.Pt&&(t.$m=-1),65535===t.Nu&&(t.Nu=-1)}(s&W.A.Pu)===W.A.Pu&&(t.Qm=e.ZA,t.tI=e.ZA,t.iI=e.ZA,t.sI=e.ZA,t.mu=e.KA+this.Pt,t.Iu=e.KA+this.Pt,t.hI=e.ZA,t.pathLength=0,t.wf[0]=t.iI,t.Af[0]=t.sI)};QA=(t,i)=>{this.cr=0,this.ar=0,this.eI(t),this.nI(t,i),this.rI(t);for(let t=0;t{t.Fm();const i=t.Um(8);if(ithis.yr)throw new Error(`eek! ${this.username} Too many npc!`);this.yr=0;for(let s=0;s{for(;t.Bm+21<8*i;){const i=t.Um(13);if(8191===i)break;this.Ar[i]||(this.Ar[i]=new Y.A);const s=this.Ar[i];this.pr[this.yr++]=i,s?(s.Vf=this.Pt,s.type=r.A.get(t.Um(11)),s.size=s.type.size,s.oI=s.type.lI,s.aI=s.type.cI,s.fI=s.type.uI,s.dI=s.type.wI,s.Sa=s.type.AI):t.Um(11);let h=t.Um(5);h>15&&(h-=32);let e=t.Um(5);e>15&&(e-=32),this.Sr&&s?.move(!1,this.Sr.wf[0]+h,this.Sr.Af[0]+e);1===t.Um(1)&&(this.ur[this.ar++]=i)}t.Gm()};rI=t=>{for(let i=0;ih.A.Ro[e.Ou].priority||0===h.A.Ro[e.Ou].priority)&&(e.Ou=i,e.Vm=0,e.Km=0,e.Xm=s,e.Ym=0)}if((n&Y.A.bu)===Y.A.bu&&(e.vu=t.KA,65535===e.vu&&(e.vu=-1)),(n&Y.A.Lu)===Y.A.Lu&&(e.ou=t.ly,e.uu=100),(n&Y.A.Ru)===Y.A.Ru&&(e.pu=t.ZA,e.yu=t.ZA,e.du=this.Pt+400,e.wu=t.ZA,e.Au=t.ZA),(n&Y.A.Fu)===Y.A.Fu&&(e.type=r.A.get(t.KA),e.oI=e.type.lI,e.aI=e.type.cI,e.fI=e.type.uI,e.dI=e.type.wI,e.Sa=e.type.AI),(n&Y.A.Du)===Y.A.Du){e.Nu=t.KA;const i=t.Ko;e.Zm=i>>16,e.qm=this.Pt+(65535&i),e.$m=0,e.Jm=0,e.qm>this.Pt&&(e.$m=-1),65535===e.Nu&&(e.Nu=-1)}(n&Y.A.Su)===Y.A.Su&&(e.zm=t.KA,e.jm=t.KA,e.Mu=e.zm,e.ku=e.jm)}};$c=()=>{for(let t=-1;t1406){$.K.yt=0,this.Bt.jc(O.A.pI),this.Bt.p1(0);const t=this.Bt.Fc;this.Bt.p1(162),this.Bt.p1(22),2*Math.random()|0||this.Bt.p1(84),this.Bt.p2(31824),this.Bt.p2(13490),2*Math.random()|0||this.Bt.p1(123),2*Math.random()|0||this.Bt.p1(134),this.Bt.p1(100),this.Bt.p1(94),this.Bt.p2(35521),this.Bt.Hf(this.Bt.Fc-t)}};yI=t=>{(t.x<128||t.z<128||t.x>=13184||t.z>=13184)&&(t.Ou=-1,t.Nu=-1,t.mu=0,t.Iu=0,t.x=128*t.wf[0]+64*t.size,t.z=128*t.Af[0]+64*t.size,t.pathLength=0),t===this.Sr&&(t.x<1536||t.z<1536||t.x>=11776||t.z>=11776)&&(t.Ou=-1,t.Nu=-1,t.mu=0,t.Iu=0,t.x=128*t.wf[0]+64*t.size,t.z=128*t.Af[0]+64*t.size,t.pathLength=0),t.mu>this.Pt?this.mI(t):t.Iu>=this.Pt?this.II(t):this._I(t),this.EI(t),this.gI(t)};xf=()=>{if(this.Sr){this.Sr.x>>7===this.Ke&&this.Sr.z>>7===this.Xe&&(this.Ke=0);for(let t=-1;t50||this.rr>200)&&-1!==t&&i.CI===i.Sa;const h=i.x>>7,e=i.z>>7;if(!(h<0||h>=G.A.Xn||e<0||e>=G.A.Xn))if(!i.TI||this.Pt=i.bI){if(64==(127&i.x)&&64==(127&i.z)){if(this.Vn[h][e]===this.Ve)continue;this.Vn[h][e]=this.Ve}i.y=this.Bf(this.Dn,i.x,i.z),this.He?.vI(this.Dn,i.x,i.y,i.z,null,i,s,i.LI,60,i.RI)}else i.st=!1,i.y=this.Bf(this.Dn,i.x,i.z),this.He?.SI(this.Dn,i.x,i.y,i.z,i.MI,i.kI,i.xI,i.DI,null,i,s,i.LI)}}};Jc=()=>{for(let t=0;t{for(let t=0;t>7,e=i.z>>7;if(!(h<0||h>=G.A.Xn||e<0||e>=G.A.Xn)){if(1===i.size&&64==(127&i.x)&&64==(127&i.z)){if(this.Vn[h][e]===this.Ve)continue;this.Vn[h][e]=this.Ve}this.He?.vI(this.Dn,i.x,this.Bf(this.Dn,i.x,i.z),i.z,null,i,s,i.LI,64*(i.size-1)+60,i.RI)}}};Nf=()=>{for(let t=this.mr.head();t;t=this.mr.next())if(t.level!==this.Dn||this.Pt>t.NI)t.sy();else if(this.Pt>=t.FI){if(t.target>0){const i=this.Ar[t.target-1];i&&t.UI(i.x,this.Bf(t.level,i.x,i.z)-t.offsetY,i.z,this.Pt)}if(t.target<0){const i=-t.target-1;let s;s=i===this.Dr?this.Sr:this.nr[i],s&&t.UI(s.x,this.Bf(t.level,s.x,s.z)-t.offsetY,s.z,this.Pt)}t.update(this.Ye),this.He?.vI(this.Dn,0|t.x,0|t.y,0|t.z,null,t,-1,t.LI,60,!1)}};Pf=()=>{for(let t=this.Ir.head();t;t=this.Ir.next())t.level!==this.Dn||t.BI?t.sy():this.Pt>=t.FI&&(t.update(this.Ye),t.BI?t.sy():this.He?.vI(t.level,t.x,t.y,t.z,null,t,-1,0,60,!1))};Ff=()=>{for(let t=this._r.head();t;t=this._r.next()){let i=!1;if(t.fl+=this.Ye,-1===t.ul&&(t.ul=0,i=!0),t.GI.delay)for(;t.fl>t.GI.delay[t.ul];)if(t.fl-=t.GI.delay[t.ul]+1,t.ul++,i=!0,t.ul>=t.GI.dl&&(t.ul-=t.GI.wl,t.ul<0||t.ul>=t.GI.dl)){t.sy(),i=!1;break}if(i&&this.He){const i=t.Vp,s=t.Wp,h=t.Yp;let n=0;if(0===t.HI?n=this.He.Ed(i,s,h):1===t.HI?n=this.He.kA(i,h,s):2===t.HI?n=this.He.Md(i,s,h):3===t.HI&&(n=this.He.Ad(i,s,h)),this.Wn&&0!==n&&(n>>14&32767)===t.index){const r=this.Wn[i][s][h],o=this.Wn[i][s+1][h],l=this.Wn[i][s+1][h+1],a=this.Wn[i][s][h+1],c=e.A.get(t.index);let f=-1;if(-1!==t.ul&&t.GI.frames&&(f=t.GI.frames[t.ul]),2===t.HI){const t=this.He.gd(i,s,h,n);let e=31&t;const u=t>>6;e===P.A.oA.id&&(e=P.A.rA.id),this.He?.WI(i,s,h,c.la(e,u,r,o,l,a,f))}else if(1===t.HI)this.He?.YI(i,s,h,c.la(P.A.VI.id,0,r,o,l,a,f));else if(0===t.HI){const t=this.He.gd(i,s,h,n),e=31&t,u=t>>6;if(e===P.A.Od.id){const t=u+1&3;this.He?.KI(s,h,i,c.la(P.A.Od.id,u+4,r,o,l,a,f),c.la(P.A.Od.id,t,r,o,l,a,f))}else this.He?.XI(i,s,h,c.la(e,u,r,o,l,a,f))}else if(3===t.HI){const t=this.He.gd(i,s,h,n)>>6;this.He?.zI(i,s,h,c.la(P.A.lA.id,t,r,o,l,a,f))}}else t.sy()}}};Qc=()=>{for(let t=-1;t0&&(s.uu--,0===s.uu&&(s.ou=null))}for(let t=0;t0&&(s.uu--,0===s.uu&&(s.ou=null))}};tf=()=>{if(2===this.We){for(let t=this.Er.head();t;t=this.Er.next())this.Pt>=t.NI&&(this.RA(t.hp,t.x,t.z,t.Kp,t.angle,t.shape,t.Nd),t.sy());$.K.At++,$.K.At>85&&($.K.At=0,this.Bt.jc(O.A.jI))}};mI=t=>{const i=t.mu-this.Pt,s=128*t.Qm+64*t.size,h=128*t.tI+64*t.size;t.x+=(s-t.x)/i|0,t.z+=(h-t.z)/i|0,t.ZI=0,0===t.hI&&(t.qI=1024),1===t.hI&&(t.qI=1536),2===t.hI&&(t.qI=0),3===t.hI&&(t.qI=512)};II=t=>{if(t.Iu===this.Pt||-1===t.Ou||0!==t.Xm||t.Km+1>h.A.Ro[t.Ou].delay[t.Vm]){const i=t.Iu-t.mu,s=this.Pt-t.mu,h=128*t.Qm+64*t.size,e=128*t.tI+64*t.size,n=128*t.iI+64*t.size,r=128*t.sI+64*t.size;t.x=(h*(i-s)+n*s)/i|0,t.z=(e*(i-s)+r*s)/i|0}t.ZI=0,0===t.hI&&(t.qI=1024),1===t.hI&&(t.qI=1536),2===t.hI&&(t.qI=0),3===t.hI&&(t.qI=512),t.LI=t.qI};EI=t=>{if(-1!==t.vu&&t.vu<32768){const i=this.Ar[t.vu];if(i){const s=t.x-i.x,h=t.z-i.z;0===s&&0===h||(t.qI=325.949*Math.atan2(s,h)&2047)}}if(t.vu>=32768){let i=t.vu-32768;i===this.Dr&&(i=this.Mt);const s=this.nr[i];if(s){const i=t.x-s.x,h=t.z-s.z;0===i&&0===h||(t.qI=325.949*Math.atan2(i,h)&2047)}}if((0!==t.zm||0!==t.jm)&&(0===t.pathLength||t.ZI>0)){const i=t.x-64*(t.zm-this.Tn-this.Tn),s=t.z-64*(t.jm-this.On-this.On);0===i&&0===s||(t.qI=325.949*Math.atan2(i,s)&2047),t.zm=0,t.jm=0}const i=t.qI-t.LI&2047;if(0!==i&&(i<32||i>2016?t.LI=t.qI:i>1024?t.LI-=32:t.LI+=32,t.LI&=2047,t.CI===t.Sa&&t.LI!==t.qI)){if(-1!==t.$I)return void(t.CI=t.$I);t.CI=t.oI}};gI=t=>{let i;if(t.RI=!1,-1!==t.CI&&(i=h.A.Ro[t.CI],t.JI++,i.delay&&t.QIi.delay[t.QI]&&(t.JI=0,t.QI++),t.QI>=i.dl&&(t.JI=0,t.QI=0)),-1!==t.Ou&&0===t.Xm){for(i=h.A.Ro[t.Ou],t.Km++;i.delay&&t.Vmi.delay[t.Vm];)t.Km-=i.delay[t.Vm],t.Vm++;t.Vm>=i.dl&&(t.Vm-=i.wl,t.Ym++,t.Ym>=i.t_&&(t.Ou=-1),(t.Vm<0||t.Vm>=i.dl)&&(t.Ou=-1)),t.RI=i.i_}if(t.Xm>0&&t.Xm--,-1!==t.Nu&&this.Pt>=t.qm){for(t.$m<0&&(t.$m=0),i=l.A.Ro[t.Nu].GI,t.Jm++;i&&i.delay&&t.$mi.delay[t.$m];)t.Jm-=i.delay[t.$m],t.$m++;i&&t.$m>=i.dl&&(t.$m<0||t.$m>=i.dl)&&(t.Nu=-1)}};_I=t=>{if(t.CI=t.Sa,0===t.pathLength)return void(t.ZI=0);if(-1!==t.Ou&&0===t.Xm){if(!h.A.Ro[t.Ou].s_)return void t.ZI++}const i=t.x,s=t.z,e=128*t.wf[t.pathLength-1]+64*t.size,n=128*t.Af[t.pathLength-1]+64*t.size;if(e-i<=256&&e-i>=-256&&n-s<=256&&n-s>=-256){t.qI=in?1792:1536:i>e?sn?256:512:s1024&&(h-=2048);let r=t.aI;h>=-256&&h<=256?r=t.oI:h>=256&&h<768?r=t.dI:h>=-768&&h<=-256&&(r=t.fI),-1===r&&(r=t.oI),t.CI=r;let o=4;t.LI!==t.qI&&-1===t.vu&&(o=2),t.pathLength>2&&(o=6),t.pathLength>3&&(o=8),t.ZI>0&&t.pathLength>1&&(o=8,t.ZI--),t.h_[t.pathLength-1]&&(o<<=1),o>=8&&t.CI===t.oI&&-1!==t.e_&&(t.CI=t.e_),ie&&(t.x=e)):i>e&&(t.x-=o,t.xn&&(t.z=n)):s>n&&(t.z-=o,t.z{let t=3;if(this.fn<310&&this.Sr){let i=this.ln>>7,s=this.cn>>7;const h=this.Sr.x>>7,e=this.Sr.z>>7;let n,r,o,l;if(this.Yn&&4&this.Yn[this.Dn][i][s]&&(t=this.Dn),n=h>i?h-i:i-h,r=e>s?e-s:s-e,n>r)for(o=65536*r/n|0,l=32768;i!==h;)ih&&i--,this.Yn&&4&this.Yn[this.Dn][i][s]&&(t=this.Dn),l+=o,l>=65536&&(l-=65536,se&&s--,this.Yn&&4&this.Yn[this.Dn][i][s]&&(t=this.Dn));else for(o=65536*n/r|0,l=32768;s!==e;)se&&s--,this.Yn&&4&this.Yn[this.Dn][i][s]&&(t=this.Dn),l+=o,l>=65536&&(l-=65536,ih&&i--,this.Yn&&4&this.Yn[this.Dn][i][s]&&(t=this.Dn))}return this.Sr&&this.Yn&&4&this.Yn[this.Dn][this.Sr.x>>7][this.Sr.z>>7]&&(t=this.Dn),t};Wf=()=>{if(!this.Yn)return 0;return this.Bf(this.Dn,this.ln,this.cn)-this.an>=800||!(4&this.Yn[this.Dn][this.ln>>7][this.cn>>7])?3:this.Dn};Bf=(t,i,s)=>{if(!this.Wn)return 0;const h=Math.min(i>>7,G.A.Xn-1),e=Math.min(s>>7,G.A.Xn-1);let n=t;t<3&&this.Yn&&!(2&~this.Yn[1][h][e])&&(n=t+1);const r=127&i,o=127&s;return(this.Wn[n][h][e]*(128-r)+this.Wn[n][h+1][e]*r>>7)*(128-o)+(this.Wn[n][h][e+1]*(128-r)+this.Wn[n][h+1][e+1]*r>>7)*o>>7};Uf=(t,i,s,h,e,n)=>{const r=2048-e&2047,o=2048-h&2047;let l,a,c,f=0,u=0,w=n;0!==r&&(l=d.A.sin[r],a=d.A.cos[r],c=u*a-n*l>>16,w=u*l+n*a>>16,u=c),0!==o&&(l=d.A.sin[o],a=d.A.cos[o],c=w*l+f*a>>16,w=w*a-f*l>>16,f=c),this.ln=t-f,this.an=i-u,this.cn=s-w,this.fn=e,this.un=h};Ef=()=>{if(!this.Sr)return;const t=this.Sr.x+this.Ze,i=this.Sr.z+this.qe;(this.Gn-t<-500||this.Gn-t>500||this.Hn-i<-500||this.Hn-i>500)&&(this.Gn=t,this.Hn=i),this.Gn!==t&&(this.Gn+=(t-this.Gn)/16|0),this.Hn!==i&&(this.Hn+=(i-this.Hn)/16|0),1===this.if[1]?this.Un+=(-this.Un-24)/2|0:1===this.if[2]?this.Un+=(24-this.Un)/2|0:this.Un=this.Un/2|0,1===this.if[3]?this.Bn+=(12-this.Bn)/2|0:1===this.if[4]?this.Bn+=(-this.Bn-12)/2|0:this.Bn=this.Bn/2|0,this.Fn=this.Fn+this.Un/2&2047,this.Pn+=this.Bn/2|0,this.Pn<128&&(this.Pn=128),this.Pn>383&&(this.Pn=383);const s=this.Gn>>7,h=this.Hn>>7,e=this.Bf(this.Dn,this.Gn,this.Hn);let n=0;if(this.Wn&&s>3&&h>3&&s<100&&h<100)for(let t=s-4;t<=s+4;t++)for(let i=h-4;i<=h+4;i++){let s=this.Dn;s<3&&this.Yn&&!(2&~this.Yn[1][t][i])&&s++;const h=e-this.Wn[s][t][i];h>n&&(n=h)}let r=192*n;r>98048&&(r=98048),r<32768&&(r=32768),r>this.dn?this.dn+=(r-this.dn)/24|0:r{let t=128*this.tr+64,i=128*this.ir+64,s=this.Bf(this.Dn,this.tr,this.ir)-this.sr;this.lnt&&(this.ln=t)),this.ln>t&&(this.ln-=this.hr+((this.ln-t)*this.er/1e3|0),this.lns&&(this.an=s)),this.an>s&&(this.an-=this.hr+((this.an-s)*this.er/1e3|0),this.ani&&(this.cn=i)),this.cn>i&&(this.cn-=this.hr+((this.cn-i)*this.er/1e3|0),this.cn383&&(o=383),this.fno&&(this.fn=o)),this.fn>o&&(this.fn-=this.Jn+((this.fn-o)*this.Qn/1e3|0),this.fn1024&&(a-=2048),a<-1024&&(a+=2048),a>0&&(this.un+=this.Jn+(a*this.Qn/1e3|0),this.un&=2047),a<0&&(this.un-=this.Jn+(-a*this.Qn/1e3|0),this.un&=2047);let c=l-this.un;c>1024&&(c-=2048),c<-1024&&(c+=2048),(c<0&&a>0||c>0&&a<0)&&(this.un=l)};vy=(t,i)=>{const s=t.ZA;let n=this._n+(s>>4&7),r=this.En+(7&s);if(i===T.A.by||i===T.A.Oy){const s=t.ZA,h=s>>2,e=3&s,o=P.A.of(h).Nd;let l;if(l=i===T.A.Oy?-1:t.KA,n>=0&&r>=0&&n>14&32767,h=31&t,e=t>>6}t=new U.A(this.Dn,o,n,r,0,F.A.bd,P.A.Td.id,s,e,h),this.Tr.n_(t)}t&&(t.Kp=l,t.shape=h,t.angle=e),this.RA(this.Dn,n,r,l,e,h,o)}}else if(i===T.A.Ty){const i=t.ZA>>2,s=P.A.of(i).Nd,e=t.KA;if(n>=0&&r>=0&&n>14&32767,this.Dn,s,n,r,h.A.Ro[e],!1);this._r.n_(i)}}}else if(i===T.A.Cy){const i=t.KA,s=t.KA;if(n>=0&&r>=0&&n=0&&r>=0&&n=0&&r>=0&&n=0&&s>=0&&i=0&&r>=0&&n=0&&r>=0&&n>2,h=3&i,o=P.A.of(s).Nd,l=t.KA,a=t.KA,c=t.KA,f=t.KA;let u,d=t.zA,w=t.zA,A=t.zA,y=t.zA;if(u=f===this.Dr?this.Sr:this.nr[f],u&&this.Wn){const t=new B.A(this.Dn,o,n,r,-1,h,s,a+this.Pt);this.Er.n_(t);const i=new B.A(this.Dn,o,n,r,l,h,s,c+this.Pt);this.Er.n_(i);const f=this.Wn[this.Dn][n][r],p=this.Wn[this.Dn][n+1][r],m=this.Wn[this.Dn][n+1][r+1],I=this.Wn[this.Dn][n][r+1],_=e.A.get(l);u.OI=a+this.Pt,u.bI=c+this.Pt,u.TI=_.la(s,h,f,p,m,I,-1);let E,g=_.width,C=_.length;h!==F.A.vd&&h!==F.A.Rd||(g=_.length,C=_.width),u.r_=128*n+64*g,u.o_=128*r+64*C,u.l_=this.Bf(this.Dn,u.r_,u.o_),d>A&&(E=d,d=A,A=E),w>y&&(E=w,w=y,y=E),u.MI=n+d,u.xI=n+A,u.kI=r+w,u.DI=r+y}}else if(i===T.A.py){const i=t.KA,s=t.KA,h=t.KA;if(n>=0&&r>=0&&n{if(!$.K.st){if(d.A.a_[17]>=t){const t=d.A.c_[17];if(!t)return;const i=t.width*t.height-1,s=t.width*this.Ye*2,h=t.nc,e=this.Mn;for(let t=0;t<=i;t++)e[t]=h[t-s&i];t.nc=e,this.Mn=h,d.A.f_(17)}if(d.A.a_[24]>=t){const t=d.A.c_[24];if(!t)return;const i=t.width*t.height-1,s=t.width*this.Ye*2,h=t.nc,e=this.Mn;for(let t=0;t<=i;t++)e[t]=h[t-s&i];t.nc=e,this.Mn=h,d.A.f_(24)}}};Ic=()=>{if(!(this.Ci&&this.Ti&&this.gi&&this.Ri))return;for(let t=10;t<117;t++){(100*Math.random()|0)<50&&(this.Ci[t+32512]=255)}for(let t=0;t<100;t++){const t=2+(124*Math.random()|0)+(128+(128*Math.random()|0)<<7);this.Ci[t]=192}for(let t=1;t<255;t++)for(let i=1;i<127;i++){const s=i+(t<<7);this.Ti[s]=(this.Ci[s-1]+this.Ci[s+1]+this.Ci[s-128]+this.Ci[s+128])/4|0}this.Si+=128,this.Si>this.gi.length&&(this.Si-=this.gi.length,this.gc(this.pi[12*Math.random()|0]));for(let t=1;t<255;t++)for(let i=1;i<127;i++){const s=i+(t<<7);let h=this.Ti[s+128]-(this.gi[s+this.Si&this.gi.length-1]/5|0);h<0&&(h=0),this.Ci[s]=h}for(let t=0;t<255;t++)this.Ri[t]=this.Ri[t+1];if(this.Ri[255]=16*Math.sin(this.Pt/14)+14*Math.sin(this.Pt/15)+12*Math.sin(this.Pt/16)|0,this.Mi>0&&(this.Mi-=4),this.ki>0&&(this.ki-=4),0===this.Mi&&0===this.ki){const t=2e3*Math.random()|0;0===t?this.Mi=1024:1===t&&(this.ki=1024)}};u_=(t,i,s)=>{const h=256-i;return((16711935&t)*h+(16711935&s)*i&4278255360)+((65280&t)*h+(65280&s)*i&16711680)>>8};_c=()=>{if(!(this.Oi&&this.bi&&this.vi&&this.Li&&this.Ri&&this.Ci))return;const t=256;if(this.Mi>0)for(let t=0;t<256;t++)this.Mi>768?this.Oi[t]=this.u_(this.bi[t],1024-this.Mi,this.vi[t]):this.Mi>256?this.Oi[t]=this.vi[t]:this.Oi[t]=this.u_(this.vi[t],256-this.Mi,this.bi[t]);else if(this.ki>0)for(let t=0;t<256;t++)this.ki>768?this.Oi[t]=this.u_(this.bi[t],1024-this.ki,this.Li[t]):this.ki>256?this.Oi[t]=this.Li[t]:this.Oi[t]=this.u_(this.Li[t],256-this.ki,this.bi[t]);else for(let t=0;t<256;t++)this.Oi[t]=this.bi[t];for(let t=0;t<33920;t++)this.hi&&this.Ii&&(this.hi.nc[t]=this.Ii.nc[t]);let i=0,s=1152;for(let h=1;h<255;h++){let e=(this.Ri[h]*(t-h)/t|0)+22;e<0&&(e=0),i+=e;for(let t=e;t<128;t++){let t=this.Ci[i++];if(0===t)s++;else{const i=t,h=256-t;if(t=this.Oi[t],this.hi){const e=this.hi.nc[s];this.hi.nc[s++]=((16711935&t)*i+(16711935&e)*h&4278255360)+((65280&t)*i+(65280&e)*h&16711680)>>8}}}s+=e}this.hi?.draw(0,0);for(let t=0;t<33920;t++)this.ei&&this._i&&(this.ei.nc[t]=this._i.nc[t]);i=0,s=1176;for(let h=1;h<255;h++){const e=this.Ri[h]*(t-h)/t|0,n=103-e;s+=e;for(let t=0;t>8}}}i+=128-n,s+=128-n-e}this.ei?.draw(661,0)}}console.log(`RS2 user client - release #${$.K.tt}`),await(0,it.w)(),(new t).d_().then((()=>{})),i()}catch(t){i(t)}}),1)},7046:(t,i,s)=>{s.d(i,{A:()=>a});var h=s(1183),e=s(4583),n=s(9234),r=s(9091),o=s(2595),l=s(7854);class a{static getParameter(t){return new URLSearchParams(window.location.search).get(t)??''}static setParameter(t,i){const s=new URL(window.location.toString());s.searchParams.set(t,i),window.history.pushState(null,'',s.toString())}Ku=0;w_=[];A_=0;Mo=null;state=0;Yu=20;y_=1;p_=[];Wu=0;m_=0;I_=[];__=!0;E_=!1;g_=50;hasFocus=!0;ac=!1;Yc=0;hf=0;xl=0;Dl=0;Lc=0;Rc=0;Sc=0;if=[];C_=[];T_=0;O_=0;input=null;b_=!1;v_=!1;L_=!1;time=-1;R_=0;S_=0;M_=0;k_=0;x_=0;D_=0;constructor(t=!1){l.N_.tabIndex=-1,l.jo.fillStyle='black',l.jo.fillRect(0,0,l.N_.width,l.N_.height),this.E_=t,this.E_?this.resize(window.innerWidth,window.innerHeight):this.resize(l.N_.width,l.N_.height)}get width(){return l.N_.width}get height(){return l.N_.height}resize=(t,i)=>{l.N_.width=t,l.N_.height=i,this.Mo=new h.A(t,i),e.A.P_()};d_=async()=>{l.N_.addEventListener('resize',(()=>{this.E_&&this.resize(window.innerWidth,window.innerHeight)}),!1),l.N_.onmousedown=this.onmousedown,l.N_.onmouseup=this.onmouseup,l.N_.onmouseenter=this.onmouseenter,l.N_.onmouseleave=this.onmouseleave,l.N_.onmousemove=this.onmousemove,window.onbeforeunload=this.bo,l.N_.onfocus=this.onfocus,l.N_.onblur=this.onblur,this.F_?(l.N_.ontouchstart=this.ontouchstart,l.N_.ontouchend=this.ontouchend,l.N_.ontouchmove=this.ontouchmove):(l.N_.onkeydown=this.onkeydown,l.N_.onkeyup=this.onkeyup),l.N_.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.F_&&'low'===a.getParameter('detail')&&(this.g_=30),await this.Go(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.p_[t]=performance.now();let t,i=0,s=256,h=1,e=0;for(;this.state>=0;){if(this.state>0&&(this.state--,0===this.state))return void this.U_();const r=s,o=h;s=300,h=1,t=performance.now();const l=this.p_[i];if(0===l?(s=r,h=o):t>l&&(s=2560*this.Yu/(t-l)|0),s<25?s=25:s>256&&(s=256,h=this.Yu-(t-l)/10|0),this.p_[i]=t,i=(i+1)%10,h>1)for(let t=0;t<10;t++)0!==this.p_[t]&&(this.p_[t]+=h);for(h0&&(this.Wu=1e3*s/(256*this.Yu)|0);const a=performance.now();if(this.__&&this.refresh(),await this.draw(),this.I_[this.m_]=(performance.now()-a)/1e3,this.m_=(this.m_+1)%this.I_.length,this.g_<50){const i=1e3/this.g_-(performance.now()-t);i>0&&await(0,n.Wo)(i)}}-1===this.state&&this.U_()};U_=()=>{this.state=-2,this.bo()};Zo=t=>{this.Yu=1e3/t|0};yA=t=>{this.g_=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.Yu|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};bo=()=>{};draw=async()=>{};refresh=()=>{};async Go(t,i){const s=this.width,h=this.height;this.__&&(l.jo.fillStyle='black',l.jo.fillRect(0,0,s,h),this.__=!1);const e=h/2-18;l.jo.fillStyle='rgb(140, 17, 17)',l.jo.rect((s/2|0)-152,e,304,34),l.jo.fillRect((s/2|0)-150,e+2,3*t,30),l.jo.fillStyle='black',l.jo.fillRect((s/2|0)-150+3*t,e+2,300-3*t,30),l.jo.font='bold 13px helvetica, sans-serif',l.jo.textAlign='center',l.jo.fillStyle='white',l.jo.fillText(i,s/2|0,e+22),await(0,n.Wo)(5)}kc=()=>{let t=-1;return this.O_!==this.T_&&(t=this.C_[this.T_],this.T_=this.T_+1&127),t};get ms(){const t=this.I_.length;let i=0;for(let s=0;sthis.Ku&&(this.Ku=s),this.w_[this.A_]=s,this.A_=(this.A_+1)%250,s}get Vu(){return this.w_.reduce(((t,i)=>t+i),0)/250}onkeydown=t=>{const i=t.key;this.Yc=0;const s=r.c[i];if(!s||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const h=s.code;let e=s.ch;t.ctrlKey&&(e>='A'.charCodeAt(0)&&e<=']'.charCodeAt(0)||e=='_'.charCodeAt(0)?e-='A'.charCodeAt(0)-1:e>='a'.charCodeAt(0)&&e<='z'.charCodeAt(0)&&(e-='a'.charCodeAt(0)-1)),e<30&&(e=0),h===r.c.ArrowLeft.code?e=1:h===r.c.ArrowRight.code?e=2:h===r.c.ArrowUp.code?e=3:h===r.c.ArrowDown.code?e=4:h===r.c.Control.code?e=5:h===r.c.Shift.code?e=6:h===r.c.Alt.code?e=7:h===r.c.Backspace.code||h===r.c.Delete.code?e=8:h===r.c.Tab.code?e=9:h===r.c.Enter.code?e=10:h>=r.c.F1.code&&h<=r.c.F12.code?e=h+1008-r.c.F1.code:h===r.c.Home.code?e=1e3:h===r.c.End.code?e=1001:h===r.c.PageUp.code?e=1002:h===r.c.PageDown.code&&(e=1003),e>0&&e<128&&(this.if[e]=1),e>4&&(this.C_[this.O_]=e,this.O_=this.O_+1&127),o.A.enabled&&o.A.B_(e),r.g.includes(i)||t.preventDefault()};onkeyup=t=>{const i=t.key;this.Yc=0;const s=r.c[i];if(!s||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const h=s.code;let e=s.ch;e<30&&(e=0),h===r.c.ArrowLeft.code?e=1:h===r.c.ArrowRight.code?e=2:h===r.c.ArrowUp.code?e=3:h===r.c.ArrowDown.code?e=4:h===r.c.Control.code?e=5:h===r.c.Shift.code?e=6:h===r.c.Alt.code?e=7:h===r.c.Backspace.code||h===r.c.Delete.code?e=8:h===r.c.Tab.code?e=9:h===r.c.Enter.code?e=10:h>=r.c.F1.code&&h<=r.c.F12.code?e=h+1008-r.c.F1.code:h===r.c.Home.code?e=1e3:h===r.c.End.code?e=1001:h===r.c.PageUp.code?e=1002:h===r.c.PageDown.code&&(e=1003),e>0&&e<128&&(this.if[e]=0),o.A.enabled&&o.A.G_(e),r.g.includes(i)||t.preventDefault()};onmousedown=t=>{if(this.b_=!1,(t.clientX>0||t.clientY>0)&&this.H_(t),this.Yc=0,this.Rc=this.xl,this.Sc=this.Dl,this.F_&&!this.W_){if(this.Y_()||this.V_()||this.K_())return this.Lc=1,void(this.hf=1);t.timeStamp>=this.time+500?(this.Lc=2,this.hf=2):(this.Lc=1,this.hf=1)}else 2===t.button?(this.Lc=2,this.hf=2):(this.Lc=1,this.hf=1);o.A.enabled&&o.A.X_(this.Rc,this.Sc,t.buttons)};onmouseup=t=>{this.H_(t),this.Yc=0,this.hf=0,o.A.enabled&&o.A.z_(t.buttons)};onmouseenter=t=>{this.H_(t),o.A.enabled&&o.A.j_()};onmouseleave=t=>{this.H_(t),this.Yc=0,this.xl=-1,this.Dl=-1,this.hf=0,this.Rc=-1,this.Sc=-1,o.A.enabled&&o.A.Z_()};onmousemove=t=>{this.H_(t),this.Yc=0,o.A.enabled&&o.A.q_(this.xl,this.Dl)};onfocus=t=>{this.hasFocus=!0,this.__=!0,this.refresh(),o.A.enabled&&o.A.J_()};onblur=t=>{this.hasFocus=!1,o.A.enabled&&o.A.Q_()};ontouchstart=t=>{if(!this.F_)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.b_=!0;const i=t.changedTouches[0],s=0|i.clientX,h=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:s,clientY:h})),this.R_=this.x_=this.M_=0|i.screenX,this.S_=this.D_=this.k_=0|i.screenY,this.time=t.timeStamp,this.v_=this.tE(),this.L_=this.iE()};ontouchend=t=>{if(!this.F_||!this.b_)return;const i=t.changedTouches[0],s=0|i.clientX,h=0|i.clientY;if(this.onmousemove(new MouseEvent('mousemove',{clientX:s,clientY:h})),this.x_=0|i.screenX,this.D_=0|i.screenY,this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.v_&&!this.tE())return void(this.b_=!1);if(this.L_&&!this.iE())return void(this.b_=!1);if(this.Y_()||this.sE()||this.V_()||this.K_()){null!==this.input&&(this.input.parentNode?.contains(this.input)&&this.input.parentNode?.removeChild(this.input),this.input=null);const t=document.createElement('input');return this.V_()?(t.setAttribute('id','username'),t.setAttribute('placeholder','Username')):this.K_()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.Y_()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.sE()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this.hE?t.setAttribute('type','password'):t.setAttribute('type',this.K_()?'password':'text'),t.setAttribute('autofocus','autofocus'),t.setAttribute('spellcheck','false'),t.setAttribute('autocomplete','off'),t.setAttribute('style',`position: fixed; left: ${s}px; top: ${h}px; width: 1px; height: 1px; opacity: 0;`),document.body.appendChild(t),t.focus(),t.click(),this.hE&&(t.oninput=t=>{if(!(t instanceof InputEvent))return;const i=t,s=i.data;null!==s&&'insertText'===i.inputType&&this.onkeydown(new KeyboardEvent('keydown',{key:s,code:s}))}),t.onkeydown=t=>{this.hE&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this.hE&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeyup(new KeyboardEvent('keyup',{key:t.key,code:t.key}))},t.onfocus=t=>{this.input?.parentNode?.removeChild(this.input),this.input=null,this.onfocus(t)},this.input=t,void(this.b_=!1)}const e=t.timeStamp>=this.time+500,n=Math.abs(this.R_-this.x_)>16||Math.abs(this.S_-this.D_)>16;e&&!n?(this.b_=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.hf=0,this.b_=!1)};ontouchmove=t=>{if(!this.F_||!this.b_)return;const i=t.changedTouches[0],s=0|i.clientX,h=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:s,clientY:h})),this.x_=0|i.screenX,this.D_=0|i.screenY,this.v_&&-1===this.Po()?(this.M_-this.x_>0?this.rotate(2):this.M_-this.x_<0&&this.rotate(0),this.k_-this.D_>0?this.rotate(3):this.k_-this.D_<0&&this.rotate(1)):(this.L_||-1!==this.Po())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this.M_=this.x_,this.k_=this.D_};get F_(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get hE(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get W_(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}tE=()=>this.ac&&this.xl>=8&&this.xl<=520&&this.Dl>=11&&this.Dl<=345;Y_=()=>this.ac&&-1===this.No()&&!this.xo()&&!this.Do()&&this.xl>=11&&this.xl<=506&&this.Dl>=449&&this.Dl<=482;sE=()=>this.ac&&(this.xo()||this.Do())&&this.xl>=11&&this.xl<=506&&this.Dl>=383&&this.Dl<=482;iE=()=>this.ac&&this.xl>=562&&this.xl<=752&&this.Dl>=231&&this.Dl<=492;V_=()=>!this.ac&&2===this.ko()&&this.xl>=301&&this.xl<=562&&this.Dl>=262&&this.Dl<=279;K_=()=>!this.ac&&2===this.ko()&&this.xl>=301&&this.xl<=562&&this.Dl>=279&&this.Dl<=296;rotate=t=>{0===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowLeft',code:'ArrowLeft'}))):1===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowUp',code:'ArrowUp'}))):2===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowRight',code:'ArrowRight'}))):3===t&&(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowDown',code:'ArrowDown'})))};eE=()=>null!==document.fullscreenElement;H_=t=>{if(this.eE()){const i=t.target.getBoundingClientRect(),s=window.innerHeight/l.N_.height,h=(window.innerWidth-l.N_.width*s)/2;this.xl=0|this.nE(t.clientX-i.left-h,0,l.N_.width*s,0,789),this.Dl=0|this.nE(t.clientY-i.top,0,l.N_.height*s,0,532)}else{const i=l.N_.getBoundingClientRect(),s=l.N_.width/i.width,h=l.N_.height/i.height;this.xl=(t.clientX-i.left)*s|0,this.Dl=(t.clientY-i.top)*h|0}this.xl<0&&(this.xl=0),this.Dl<0&&(this.Dl=0),this.xl>789&&(this.xl=789),this.Dl>532&&(this.Dl=532)};nE=(t,i,s,h,e)=>(t-i)*(e-h)/(s-i)+h}},2595:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1069);class e{static enabled=!1;static rE=null;static oE=null;static lE=0;static aE=0;static cE=0;static fE=0;static uE=0;static Fy=()=>{this.rE=h.A.Ut(1),this.oE=null,this.lE=performance.now(),this.enabled=!0};static Wc=()=>{this.enabled=!1,this.rE=null};static flush=()=>{let t=null;return this.oE&&this.enabled&&(t=this.oE),this.oE=null,t};static stop=()=>{let t=null;return this.rE&&this.rE.Fc>0&&this.enabled&&(t=this.rE),this.Wc(),t};static X_=(t,i,s)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;this.aE++;const h=performance.now();let e=(h-this.lE)/10|0;e>250&&(e=250),this.lE=h,this.dE(5),1===s?this.rE?.p1(1):this.rE?.p1(2),this.rE?.p1(e),this.rE?.p3(t+(i<<10))};static z_=t=>{if(!this.enabled)return;this.aE++;const i=performance.now();let s=(i-this.lE)/10|0;s>250&&(s=250),this.lE=i,this.dE(2),1===t?this.rE?.p1(3):this.rE?.p1(4),this.rE?.p1(s)};static q_=(t,i)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;const s=performance.now();if(s-this.cE>=50){this.cE=s,this.aE++;let h=(s-this.lE)/10|0;h>250&&(h=250),this.lE=s,t-this.fE<8&&t-this.fE>=-8&&i-this.uE<8&&i-this.uE>=-8?(this.dE(3),this.rE?.p1(5),this.rE?.p1(h),this.rE?.p1(t+(i-this.uE+8<<4)+8-this.fE)):t-this.fE<128&&t-this.fE>=-128&&i-this.uE<128&&i-this.uE>=-128?(this.dE(4),this.rE?.p1(6),this.rE?.p1(h),this.rE?.p1(t+128-this.fE),this.rE?.p1(i+128-this.uE)):(this.dE(5),this.rE?.p1(7),this.rE?.p1(h),this.rE?.p3(t+(i<<10))),this.fE=t,this.uE=i}};static B_=t=>{if(!this.enabled)return;this.aE++;const i=performance.now();let s=(i-this.lE)/10|0;s>250&&(s=250),this.lE=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.dE(3),this.rE?.p1(8),this.rE?.p1(s),this.rE?.p1(t)};static G_=t=>{if(!this.enabled)return;this.aE++;const i=performance.now();let s=(i-this.lE)/10|0;s>250&&(s=250),this.lE=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.dE(3),this.rE?.p1(9),this.rE?.p1(s),this.rE?.p1(t)};static J_=()=>{if(!this.enabled)return;this.aE++;const t=performance.now();let i=(t-this.lE)/10|0;i>250&&(i=250),this.lE=t,this.dE(2),this.rE?.p1(10),this.rE?.p1(i)};static Q_=()=>{if(!this.enabled)return;this.aE++;const t=performance.now();let i=(t-this.lE)/10|0;i>250&&(i=250),this.lE=t,this.dE(2),this.rE?.p1(11),this.rE?.p1(i)};static j_=()=>{if(!this.enabled)return;this.aE++;const t=performance.now();let i=(t-this.lE)/10|0;i>250&&(i=250),this.lE=t,this.dE(2),this.rE?.p1(12),this.rE?.p1(i)};static Z_=()=>{if(!this.enabled)return;this.aE++;const t=performance.now();let i=(t-this.lE)/10|0;i>250&&(i=250),this.lE=t,this.dE(2),this.rE?.p1(13),this.rE?.p1(i)};static dE=t=>{if(this.rE&&this.rE.Fc+t>=500){const t=this.rE;this.rE=h.A.Ut(1),this.oE=t}}}},9091:(t,i,s)=>{s.d(i,{c:()=>e,g:()=>h});const h=['F11','F12'],e={'Backspace':{code:8,ch:8},'Enter':{code:10,ch:10},'Shift':{code:16,ch:65535},'Escape':{code:27,ch:27},'Tab':{code:9,ch:9},'CapsLock':{code:20,ch:65535},' ':{code:32,ch:32},'Control':{code:17,ch:65535},'Alt':{code:18,ch:65535},'Meta':{code:524,ch:65535},'ArrowLeft':{code:37,ch:65535},'ArrowRight':{code:39,ch:65535},'ArrowUp':{code:38,ch:65535},'ArrowDown':{code:40,ch:65535},'Insert':{code:155,ch:65535},'Home':{code:36,ch:65535},'PageUp':{code:33,ch:65535},'Delete':{code:127,ch:127},'End':{code:35,ch:65535},'PageDown':{code:34,ch:65535},'`':{code:192,ch:96},'~':{code:192,ch:126},'!':{code:49,ch:33},'@':{code:50,ch:64},'#':{code:51,ch:35},'$':{code:52,ch:36},'%':{code:53,ch:37},'^':{code:54,ch:94},'&':{code:55,ch:38},'*':{code:56,ch:42},'(':{code:57,ch:40},')':{code:48,ch:41},'-':{code:45,ch:45},'_':{code:45,ch:95},'=':{code:61,ch:61},'+':{code:61,ch:43},'[':{code:91,ch:91},'{':{code:91,ch:123},']':{code:93,ch:93},'}':{code:93,ch:125},'\\':{code:92,ch:92},'|':{code:92,ch:124},';':{code:59,ch:59},':':{code:59,ch:58},"'":{code:222,ch:39},'"':{code:222,ch:34},',':{code:44,ch:44},'<':{code:44,ch:60},'.':{code:46,ch:46},'>':{code:46,ch:62},'/':{code:47,ch:47},'?':{code:47,ch:63},'F1':{code:112,ch:65535},'F2':{code:113,ch:65535},'F3':{code:114,ch:65535},'F4':{code:115,ch:65535},'F5':{code:116,ch:65535},'F6':{code:117,ch:65535},'F7':{code:118,ch:65535},'F8':{code:119,ch:65535},'F9':{code:120,ch:65535},'F10':{code:121,ch:65535},'F11':{code:122,ch:65535},'F12':{code:123,ch:65535},0:{code:48,ch:48},1:{code:49,ch:49},2:{code:50,ch:50},3:{code:51,ch:51},4:{code:52,ch:52},5:{code:53,ch:53},6:{code:54,ch:54},7:{code:55,ch:55},8:{code:56,ch:56},9:{code:57,ch:57},'a':{code:65,ch:97},'b':{code:66,ch:98},'c':{code:67,ch:99},'d':{code:68,ch:100},'e':{code:69,ch:101},'f':{code:70,ch:102},'g':{code:71,ch:103},'h':{code:72,ch:104},'i':{code:73,ch:105},'j':{code:74,ch:106},'k':{code:75,ch:107},'l':{code:76,ch:108},'m':{code:77,ch:109},'n':{code:78,ch:110},'o':{code:79,ch:111},'p':{code:80,ch:112},'q':{code:81,ch:113},'r':{code:82,ch:114},'s':{code:83,ch:115},'t':{code:84,ch:116},'u':{code:85,ch:117},'v':{code:86,ch:118},'w':{code:87,ch:119},'x':{code:88,ch:120},'y':{code:89,ch:121},'z':{code:90,ch:122},'A':{code:65,ch:65},'B':{code:66,ch:66},'C':{code:67,ch:67},'D':{code:68,ch:68},'E':{code:69,ch:69},'F':{code:70,ch:70},'G':{code:71,ch:71},'H':{code:72,ch:72},'I':{code:73,ch:73},'J':{code:74,ch:74},'K':{code:75,ch:75},'L':{code:76,ch:76},'M':{code:77,ch:77},'N':{code:78,ch:78},'O':{code:79,ch:79},'P':{code:80,ch:80},'Q':{code:81,ch:81},'R':{code:82,ch:82},'S':{code:83,ch:83},'T':{code:84,ch:84},'U':{code:85,ch:85},'V':{code:86,ch:86},'W':{code:87,ch:87},'X':{code:88,ch:88},'Y':{code:89,ch:89},'Z':{code:90,ch:90}}},1120:(t,i,s)=>{s.d(i,{A:()=>c});var h=s(1069),e=s(8665),n=s(2679),r=s(2511),o=s(3819),l=s(3867),a=s(8950);class c{static Ro=[];static wE=null;static So=null;static Cl=0;static AE=1;static Ol=2;static Wl=3;static Vl=4;static ia=5;static ea=6;static ua=7;static hm=1;static om=2;static lm=3;static am=4;static fm=5;static Zl=6;static Aa=1;static ya=100;static pa=101;static ma=200;static Kw=201;static Xw=202;static Ia=203;static zw=205;static qw=300;static yE=301;static pE=302;static mE=303;static IE=304;static _E=305;static EE=306;static gE=307;static CE=308;static TE=309;static OE=310;static bE=311;static vE=312;static $w=313;static Jw=314;static LE=315;static RE=316;static SE=317;static ME=318;static kE=319;static xE=320;static DE=321;static NE=322;static Qw=323;static Da=324;static Na=325;static tA=326;static Oa=327;static _a=401;static Ea=500;static jw=501;static Zw=502;static Ta=503;static Pa=600;static sA=601;static PE=602;static FE=603;static UE=604;static BE=605;static GE=606;static HE=607;static WE=608;static YE=609;static VE=610;static KE=611;static hA=612;static Fa=613;static Ua=650;static Ha=651;static Wa=652;static Ya=653;static Va=654;static Ba=655;static ec=(t,i,s)=>{this.wE=new n.A(5e4),this.So=new n.A(5e4);const e=new h.A(t.read('data'));let r=-1;for(e.Fc+=2;e.Fc0){h.$o=new Uint8Array(n),h.Qo=new Uint16Array(n);for(let t=0;t0){h.scripts=new l.ds(o,null);for(let t=0;t0){const e=s.lastIndexOf(',');h.Hl[t]=this.XE(i,s.substring(0,e),parseInt(s.substring(e+1),10))}}h.sm=new l.ds(5,null);for(let t=0;t<5;t++){const i=e.ly;h.sm[t]=i,0===i.length&&(h.sm[t]=null)}}if(h.type===c.Wl&&(h.fill=1===e.ZA),h.type===c.Vl||h.type===c.AE){h.$l=1===e.ZA;const t=e.ZA;s&&(h.font=s[t]),h.Ql=1===e.ZA}if(h.type===c.Vl&&(h.text=e.ly,h.zl=e.ly),h.type!==c.AE&&h.type!==c.Wl&&h.type!==c.Vl||(h.Yl=e.Ko),h.type!==c.Wl&&h.type!==c.Vl||(h.Xl=e.Ko,h.Kl=e.Ko),h.type===c.ia){const t=e.ly;if(t.length>0){const s=t.lastIndexOf(',');h.ha=this.XE(i,t.substring(0,s),parseInt(t.substring(s+1),10))}const s=e.ly;if(s.length>0){const t=s.lastIndexOf(',');h.sa=this.XE(i,s.substring(0,t),parseInt(s.substring(t+1),10))}}if(h.type===c.ea){const t=e.ZA;0!==t&&(h.model=this.la((t-1<<8)+e.ZA));const i=e.ZA;0!==i&&(h.zE=this.la((i-1<<8)+e.ZA)),h.al=e.ZA,0===h.al?h.al=-1:h.al=(h.al-1<<8)+e.ZA,h.cl=e.ZA,0===h.cl?h.cl=-1:h.cl=(h.cl-1<<8)+e.ZA,h.zoom=e.KA,h.oa=e.KA,h.fa=e.KA}if(h.type===c.ua){h.Ll=new Int32Array(h.width*h.height),h.Rl=new Int32Array(h.width*h.height),h.$l=1===e.ZA;const t=e.ZA;s&&(h.font=s[t]),h.Ql=1===e.ZA,h.Yl=e.Ko,h.Sl=e.tp,h.Ml=e.tp,h.Qp=1===e.ZA,h.sm=new l.ds(5,null);for(let t=0;t<5;t++){const i=e.ly;h.sm[t]=i,0===i.length&&(h.sm[t]=null)}}h.jl!==c.om&&h.type!==c.Ol||(h._w=e.ly,h.action=e.ly,h.Iw=e.KA),h.jl!==c.hm&&h.jl!==c.am&&h.jl!==c.fm&&h.jl!==c.Zl||(h.rm=e.ly,0===h.rm.length&&(h.jl===c.hm?h.rm='Ok':h.jl===c.am||h.jl===c.fm?h.rm='Select':h.jl===c.Zl&&(h.rm='Continue')))}this.wE=null,this.So=null};static XE=(t,i,s)=>{const h=o.A.jE(i)<<8n|BigInt(s);if(this.wE){const t=this.wE.get(h);if(t)return t}let e;try{e=r.A.za(t,i,s),this.wE?.put(h,e)}catch(t){return null}return e};static la=t=>{if(this.So){const i=this.So.get(BigInt(t));if(i)return i}const i=e.A.model(t);return this.So?.put(BigInt(t),i),i};id=-1;Nd=-1;type=-1;jl=-1;El=0;width=0;height=0;Jp=-1;$o=null;Qo=null;scripts=null;scroll=0;hide=!1;draggable=!1;Qp=!1;im=!1;Sl=0;Ml=0;bl=null;vl=null;Hl=null;sm=null;fill=!1;$l=!1;font=null;Ql=!1;text=null;zl=null;Yl=0;Xl=0;Kl=0;ha=null;sa=null;model=null;zE=null;al=-1;cl=-1;zoom=0;oa=0;fa=0;_w=null;action=null;Iw=-1;rm=null;ll=null;pl=null;ml=null;x=0;y=0;Tl=0;Ll=null;Rl=null;ul=0;fl=0;la(t,i,s){let h=this.model;if(s&&(h=this.zE),!h)return null;if(-1===t&&-1===i&&!h.ZE)return h;const n=e.A.qE(h,!0,!0,!1);return-1===t&&-1===i||n.Ma(),-1!==t&&n.ka(t),-1!==i&&n.ka(i),n.xa(64,768,-50,-10,-50,!0),n}$E(){if(this.Nd===this.id)return this.x;let t=c.Ro[this.Nd];if(!t.ll||!t.pl||!t.ml)return this.x;let i=t.ll.indexOf(this.id);if(-1===i)return this.x;let s=t.pl[i];for(;t.Nd!==t.id;){const h=c.Ro[t.Nd];h.ll&&h.pl&&h.ml&&(i=h.ll.indexOf(t.id),-1!==i&&(s+=h.pl[i])),t=h}return s}JE(){if(this.Nd===this.id)return this.y;let t=c.Ro[this.Nd];if(!t.ll||!t.pl||!t.ml)return this.y;let i=t.ll.indexOf(this.id);if(-1===i)return this.y;let s=t.ml[i];for(;t.Nd!==t.id;){const h=c.Ro[t.Nd];h.ll&&h.pl&&h.ml&&(i=h.ll.indexOf(t.id),-1!==i&&(s+=h.ml[i])),t=h}return s}outline(t){const i=this.$E(),s=this.JE();a.A.Il(i,s,this.width,this.height,t)}move(t,i){if(this.Nd===this.id)return;this.x=0,this.y=0;const s=c.Ro[this.Nd];if(s.ll&&s.pl&&s.ml){const h=s.ll.indexOf(this.id);-1!==h&&(s.pl[h]=t,s.ml[h]=i)}}delete(){if(this.Nd===this.id)return;const t=c.Ro[this.Nd];if(t.ll&&t.pl&&t.ml){const i=t.ll.indexOf(this.id);-1!==i&&(t.ll.splice(i,1),t.pl.splice(i,1),t.ml.splice(i,1))}}}},6333:(t,i,s)=>{s.d(i,{$:()=>h});class h{id;QE=null;constructor(t){this.id=t}tg(t){for(;;){const i=t.ZA;if(0===i)break;this.decode(i,t)}return this}}},2164:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(1069),e=s(6333);class n extends e.${static count=0;static Ro=[];static ec=t=>{const i=new h.A(t.read('flo.dat'));this.count=i.KA;for(let t=0;t(s>179&&(i=i/2|0),s>192&&(i=i/2|0),s>217&&(i=i/2|0),s>243&&(i=i/2|0),(t/4<<10)+(i/32<<7)+(s/2|0));static sg=(t,i)=>-1===t?12345678:((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);static hg=(t,i)=>-2===t?12345678:-1===t?(i<0?i=0:i>127&&(i=127),127-i):((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);eg=0;texture=-1;ng=!1;rg=!0;og=0;lg=0;ag=0;cg=0;fg=0;ug=0;decode(t,i){1===t?(this.eg=i.dg,this.setColor(this.eg)):2===t?this.texture=i.ZA:3===t?this.ng=!0:5===t?this.rg=!1:6===t?this.QE=i.ly:console.log('Error unrecognised config code: ',t)}setColor(t){const i=(t>>16&255)/256,s=(t>>8&255)/256,h=(255&t)/256;let e=i;si&&(r=s),h>r&&(r=h);let o=0,l=0;const a=(e+r)/2;e!==r&&(a<.5&&(l=(r-e)/(r+e)),a>=.5&&(l=(r-e)/(2-r-e)),i===r?o=(s-h)/(r-e):s===r?o=(h-i)/(r-e)+2:h===r&&(o=(i-s)/(r-e)+4)),o/=6,this.og=256*o|0,this.lg=256*l|0,this.ag=256*a|0,this.lg<0?this.lg=0:this.lg>255&&(this.lg=255),this.ag<0?this.ag=0:this.ag>255&&(this.ag=255),this.cg=a>.5?(1-a)*l*512|0:a*l*512|0,this.cg<1&&(this.cg=1),this.fg=o*this.cg|0;let c=this.og+(16*Math.random()|0)-8;c<0?c=0:c>255&&(c=255);let f=this.lg+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255);let u=this.ag+(48*Math.random()|0)-24;u<0?u=0:u>255&&(u=255),this.ug=n.ig(c,f,u)}}},8317:(t,i,s)=>{s.d(i,{A:()=>o});var h=s(1069),e=s(6333),n=s(8665),r=s(3867);class o extends e.${static count=0;static Ro=[];static ec=t=>{const i=new h.A(t.read('idk.dat'));this.count=i.KA;for(let t=0;t=40&&t<50)this.yg[t-40]=i.KA;else if(t>=50&&t<60)this.pg[t-50]=i.KA;else{if(!(t>=60&&t<70))throw new Error(`Unrecognized idk config code: ${t}`);this.Ag[t-60]=i.KA}}la(){if(!this.wg)return null;const t=new r.ds(this.wg.length,null);for(let i=0;i{s.d(i,{A:()=>c});var h=s(6333),e=s(1069),n=s(2679),r=s(8665),o=s(1023),l=s(6169),a=s(3867);class c extends h.${static count=0;static cache=null;static mg=null;static Ig=null;static _g=0;static tu=new n.A(500);static iu=new n.A(30);static ec=t=>{this.mg=new e.A(t.read('loc.dat'));const i=new e.A(t.read('loc.idx'));this.count=i.KA,this.Ig=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.Ig||!this.mg)throw new Error('LocType not loaded!!!');for(let i=0;i<10;i++){const s=this.cache[i];if(s&&s.id===t)return s}this._g=(this._g+1)%10;const i=this.cache[this._g];return this.mg.Fc=this.Ig[t],i.id=t,i.reset(),i.tg(this.mg),i.Eg||(i.Eg=new Int32Array(1)),-1===i.gg&&i.Eg&&(i.active=i.Eg.length>0&&i.Eg[0]===o.A.rA.id,i.wm&&(i.active=!0)),i};static bo=()=>{this.tu=null,this.iu=null,this.Ig=null,this.cache=null,this.mg=null};wg=null;Eg=null;name=null;sw=null;yg=null;pg=null;width=1;length=1;NA=!0;PA=!0;active=!1;gg=-1;Cg=!1;Tg=!1;rg=!1;al=-1;Og=!1;bg=16;vg=0;Lg=0;wm=null;yd=-1;Cd=-1;Rg=!1;Sg=!0;Mg=128;kg=128;xg=128;aA=0;Dg=0;Ng=0;Pg=0;Fg=!1;decode(t,i){if(1===t){const t=i.ZA;this.wg=new Int32Array(t),this.Eg=new Int32Array(t);for(let s=0;s=30&&t<39)this.wm||(this.wm=new a.ds(5,null)),this.wm[t-30]=i.ly,'hidden'===this.wm[t-30]?.toLowerCase()&&(this.wm[t-30]=null);else if(40===t){const t=i.ZA;this.yg=new Uint16Array(t),this.pg=new Uint16Array(t);for(let s=0;s=this.wg.length)return null;let d=this.wg[a];if(-1===d)return null;const w=this.Rg!==i>3;w&&(d+=65536);let A=c.tu?.get(BigInt(d));A||(A=r.A.model(65535&d),w&&A.Vg(),c.tu?.put(BigInt(d),A));const y=128!==this.Mg||128!==this.kg||128!==this.xg,p=0!==this.Dg||0!==this.Ng||0!==this.Pg;let m=r.A.qE(A,!this.yg,!this.Og,i===l.A.bd&&-1===o&&!y&&!p);for(-1!==o&&(m.Ma(),m.ka(o),m.Kg=null,m.Xg=null);i-- >0;)m.zg();if(this.yg&&this.pg)for(let t=0;t{s.d(i,{A:()=>l});var h=s(6333),e=s(1069),n=s(2679),r=s(8665),o=s(3867);class l extends h.${static count=0;static cache=null;static mg=null;static Ig=null;static _g=0;static So=new n.A(30);static ec=t=>{this.mg=new e.A(t.read('npc.dat'));const i=new e.A(t.read('npc.idx'));this.count=i.KA,this.Ig=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.Ig||!this.mg)throw new Error('NpcType not loaded!!!');for(let i=0;i<20;i++){const s=this.cache[i];if(s&&s.id===t)return s}this._g=(this._g+1)%20;const i=this.cache[this._g]=new l(t);return this.mg.Fc=this.Ig[t],i.tg(this.mg),i};static bo=()=>{this.So=null,this.Ig=null,this.cache=null,this.mg=null};name=null;sw=null;size=1;wg=null;Ag=null;Og=!1;AI=-1;lI=-1;cI=-1;uI=-1;wI=-1;yg=null;pg=null;wm=null;Mg=-1;kg=-1;xg=-1;od=!0;_m=-1;qg=128;$g=128;decode(t,i){if(1===t){const t=i.ZA;this.wg=new Uint16Array(t);for(let s=0;s=30&&t<40)this.wm||(this.wm=new o.ds(5,null)),this.wm[t-30]=i.ly,'hidden'===this.wm[t-30]?.toLowerCase()&&(this.wm[t-30]=null);else if(40===t){const t=i.ZA;this.yg=new Uint16Array(t),this.pg=new Uint16Array(t);for(let s=0;s{s.d(i,{A:()=>u});var h=s(6333),e=s(1069),n=s(2511),r=s(2679),o=s(8665),l=s(4583),a=s(8950),c=s(9298),f=s(3867);class u extends h.${static count=0;static cache=null;static mg=null;static Ig=null;static _g=0;static hC=!0;static So=new r.A(50);static su=new r.A(200);static ec=(t,i)=>{this.hC=i,this.mg=new e.A(t.read('obj.dat'));const s=new e.A(t.read('obj.idx'));this.count=s.KA,this.Ig=new Int32Array(this.count);let h=2;for(let t=0;t{if(!this.cache||!this.Ig||!this.mg)throw new Error('ObjType not loaded!!!');for(let i=0;i<10;i++){const s=this.cache[i];if(s&&s.id===t)return s}this._g=(this._g+1)%10;const i=this.cache[this._g];return this.mg.Fc=this.Ig[t],i.id=t,i.reset(),i.tg(this.mg),-1!==i.eC&&i.nC(),!this.hC&&i.members&&(i.name='Members Object',i.sw="Login to a members' server to use this object.",i.wm=null,i.tm=null),i};static bo=()=>{this.So=null,this.su=null,this.Ig=null,this.cache=null,this.mg=null};static kl=(t,i)=>{if(u.su){let s=u.su.get(BigInt(t));if(s&&s.fd!==i&&-1!==s.fd&&(s.sy(),s=null),s)return s}let s=u.get(t);if(s.rC||(i=-1),s.rC&&s.oC&&i>1){let t=-1;for(let h=0;h<10;h++)i>=s.oC[h]&&0!==s.oC[h]&&(t=s.rC[h]);-1!==t&&(s=u.get(t))}const h=new n.A(32,32),e=l.A.na,r=l.A.ra,o=l.A.oc,f=a.A.nc,d=a.A.lC,w=a.A.aC,A=a.A.left,y=a.A.right,p=a.A.top,m=a.A.bottom;l.A.cC=!1,a.A.bind(h.nc,32,32),a.A.fillRect(0,0,32,32,c.A.Bl),l.A.P_();const I=s.vA(1),_=l.A.sin[s.yp]*s.mp>>16,E=l.A.cos[s.yp]*s.mp>>16;I.ca(0,s.pp,s.fC,s.yp,s.uC,_+(I.Zg/2|0)+s.dC,E+s.dC);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===h.nc[t+32*i]&&(t>0&&h.nc[t+32*i-1]>1||i>0&&h.nc[t+32*(i-1)]>1||t<31&&h.nc[t+32*i+1]>1||i<31&&h.nc[t+32*(i+1)]>1)&&(h.nc[t+32*i]=1);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===h.nc[t+32*i]&&t>0&&i>0&&h.nc[t+32*(i-1)-1]>0&&(h.nc[t+32*i]=3153952);if(-1!==s.eC){const t=this.kl(s.wC,10),i=t.Pl,h=t.fd;t.Pl=32,t.fd=32,t.AC(5,5,22,22),t.Pl=i,t.fd=h}return u.su?.put(BigInt(t),h),a.A.bind(f,d,w),a.A.yl(A,p,y,m),l.A.na=e,l.A.ra=r,l.A.oc=o,l.A.cC=!0,s.da?h.Pl=33:h.Pl=32,h.fd=i,h};model=0;name=null;sw=null;yg=null;pg=null;mp=2e3;yp=0;pp=0;fC=0;uC=0;dC=0;yC=!1;pC=-1;da=!1;OA=1;members=!1;wm=null;tm=null;mC=-1;IC=-1;_C=0;EC=-1;gC=-1;CC=0;TC=-1;OC=-1;bC=-1;vC=-1;LC=-1;RC=-1;rC=null;oC=null;wC=-1;eC=-1;decode(t,i){if(1===t)this.model=i.KA;else if(2===t)this.name=i.ly;else if(3===t)this.sw=i.ly;else if(4===t)this.mp=i.KA;else if(5===t)this.yp=i.KA;else if(6===t)this.pp=i.KA;else if(7===t)this.uC=i.tp,this.uC>32767&&(this.uC-=65536);else if(8===t)this.dC=i.tp,this.dC>32767&&(this.dC-=65536);else if(9===t)this.yC=!0;else if(10===t)this.pC=i.KA;else if(11===t)this.da=!0;else if(12===t)this.OA=i.Ko;else if(16===t)this.members=!0;else if(23===t)this.mC=i.KA,this._C=i.zA;else if(24===t)this.IC=i.KA;else if(25===t)this.EC=i.KA,this.CC=i.zA;else if(26===t)this.gC=i.KA;else if(t>=30&&t<35)this.wm||(this.wm=new f.ds(5,null)),this.wm[t-30]=i.ly,'hidden'===this.wm[t-30]?.toLowerCase()&&(this.wm[t-30]=null);else if(t>=35&&t<40)this.tm||(this.tm=new f.ds(5,null)),this.tm[t-35]=i.ly;else if(40===t){const t=i.ZA;this.yg=new Uint16Array(t),this.pg=new Uint16Array(t);for(let s=0;s=100&&t<110&&(this.rC&&this.oC||(this.rC=new Uint16Array(10),this.oC=new Uint16Array(10)),this.rC[t-100]=i.KA,this.oC[t-100]=i.KA)}SC(t){let i=this.mC;if(1===t&&(i=this.EC),-1===i)return null;let s=this.IC,h=this.TC;1===t&&(s=this.gC,h=this.OC);let e=o.A.model(i);if(-1!==s){const t=o.A.model(s);if(-1===h){const i=[e,t];e=o.A.ba(i,2)}else{const i=[e,t,o.A.model(h)];e=o.A.ba(i,3)}}if(0===t&&0!==this._C&&e.translate(this._C,0,0),1===t&&0!==this.CC&&e.translate(this.CC,0,0),this.yg&&this.pg)for(let t=0;t1){let i=-1;for(let s=0;s<10;s++)t>=this.oC[s]&&0!==this.oC[s]&&(i=this.rC[s]);if(-1!==i)return u.get(i).vA(1)}if(u.So){const t=u.So.get(BigInt(this.id));if(t)return t}const i=o.A.model(this.model);if(this.yg&&this.pg)for(let t=0;t{s.d(i,{A:()=>r});var h=s(6333),e=s(1069),n=s(6730);class r extends h.${static count=0;static Ro=[];static ec=t=>{const i=new e.A(t.read('seq.dat'));this.count=i.KA;for(let t=0;t{s.d(i,{A:()=>l});var h=s(6333),e=s(1069),n=s(1312),r=s(8665),o=s(2679);class l extends h.${static count=0;static Ro=[];static So=new o.A(30);static ec=t=>{const i=new e.A(t.read('spotanim.dat'));this.count=i.KA;for(let t=0;t=40&&t<50)this.yg[t-40]=i.KA;else{if(!(t>=50&&t<60))throw new Error(`Unrecognized spotanim config code: ${t}`);this.pg[t-50]=i.KA}}la(){let t=l.So?.get(BigInt(this.id));if(t)return t;t=r.A.model(this.model);for(let i=0;i<6;i++)0!==this.yg[0]&&t.va(this.yg[i],this.pg[i]);return l.So?.put(BigInt(this.id),t),t}}},3764:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(6333),e=s(1069);class n extends h.${static count=0;static Ro=[];static xC=[];static DC=0;static ec=t=>{const i=new e.A(t.read('varp.dat'));this.count=i.KA;for(let t=0;t{s.d(i,{A:()=>h});class h{static OPEN=0;static BC=1;static GC=2;static HC=4;static WC=8;static YC=h.BC<<4;static VC=h.GC<<4;static KC=h.HC<<4;static XC=h.WC<<4;static zC=256;static jC=512;static ZC=1024;static qC=2048;static $C=4096;static JC=h.jC<<4;static QC=h.ZC<<4;static tT=h.qC<<4;static iT=h.$C<<4;static sT=h.zC<<9;static hT=524288;static eT=2097152;static nT=h.eT|h.hT;static rT=h.zC|h.nT;static Id=h.GC|h.rT;static pd=h.WC|h.rT;static bm=h.GC|h.HC|h.pd;static _d=h.VC|h.rT;static Lm=h.WC|h.YC|h._d;static md=h.XC|h.rT;static vm=h.BC|h.GC|h.md;static Rm=h.VC|h.KC|h.md;static oT=16777215}},670:(t,i,s)=>{s.d(i,{A:()=>o});var h=s(9456),e=s(6169),n=s(1023),r=s(4909);class o{static xn=4;static Xn=104;static index=(t,i)=>t*o.Xn+i;offsetX;lT;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.lT=0,this.sizeX=o.Xn,this.sizeZ=o.Xn,this.flags=new Int32Array(this.sizeX*this.sizeZ),this.reset()}reset=()=>{for(let t=0;t{this.flags[o.index(t-this.offsetX,i-this.lT)]|=h.A.eT};GA=(t,i)=>{this.flags[o.index(t-this.offsetX,i-this.lT)]&=~h.A.eT};RA=(t,i,s,n,r,o)=>{let l=h.A.zC;o&&(l|=h.A.sT);const a=t-this.offsetX,c=i-this.lT;if(r===e.A.vd||r===e.A.Rd){const t=s;s=n,n=t}for(let t=a;t=0&&t=0&&i{let l=h.A.zC;o&&(l|=h.A.sT);const a=t-this.offsetX,c=i-this.lT;if(r===e.A.vd||r===e.A.Rd){const t=s;s=n,n=t}for(let t=a;t=0&&t=0&&i{const l=t-this.offsetX,a=i-this.lT,c=o?h.A.iT:h.A.XC,f=o?h.A.$C:h.A.WC,u=o?h.A.ZC:h.A.GC,d=o?h.A.QC:h.A.VC,w=o?h.A.jC:h.A.BC,A=o?h.A.JC:h.A.YC,y=o?h.A.qC:h.A.HC,p=o?h.A.tT:h.A.KC;s===n.A.Td.id?r===e.A.bd?(this.add(l,a,c),this.add(l-1,a,f)):r===e.A.vd?(this.add(l,a,u),this.add(l,a+1,d)):r===e.A.Ld?(this.add(l,a,f),this.add(l+1,a,c)):r===e.A.Rd&&(this.add(l,a,d),this.add(l,a-1,u)):s===n.A.fT.id||s===n.A.Sd.id?r===e.A.bd?(this.add(l,a,w),this.add(l-1,a+1,A)):r===e.A.vd?(this.add(l,a,y),this.add(l+1,a+1,p)):r===e.A.Ld?(this.add(l,a,A),this.add(l+1,a-1,w)):r===e.A.Rd&&(this.add(l,a,p),this.add(l-1,a-1,y)):s===n.A.Od.id&&(r===e.A.bd?(this.add(l,a,u|c),this.add(l-1,a,f),this.add(l,a+1,d)):r===e.A.vd?(this.add(l,a,u|f),this.add(l,a+1,d),this.add(l+1,a,c)):r===e.A.Ld?(this.add(l,a,d|f),this.add(l+1,a,c),this.add(l,a-1,u)):r===e.A.Rd&&(this.add(l,a,d|c),this.add(l,a-1,u),this.add(l-1,a,f))),o&&this.cT(t,i,s,r,!1)};DA=(t,i,s,r,o)=>{const l=t-this.offsetX,a=i-this.lT,c=o?h.A.iT:h.A.XC,f=o?h.A.$C:h.A.WC,u=o?h.A.ZC:h.A.GC,d=o?h.A.QC:h.A.VC,w=o?h.A.jC:h.A.BC,A=o?h.A.JC:h.A.YC,y=o?h.A.qC:h.A.HC,p=o?h.A.tT:h.A.KC;s===n.A.Td.id?r===e.A.bd?(this.remove(l,a,c),this.remove(l-1,a,f)):r===e.A.vd?(this.remove(l,a,u),this.remove(l,a+1,d)):r===e.A.Ld?(this.remove(l,a,f),this.remove(l+1,a,c)):r===e.A.Rd&&(this.remove(l,a,d),this.remove(l,a-1,u)):s===n.A.fT.id||s===n.A.Sd.id?r===e.A.bd?(this.remove(l,a,w),this.remove(l-1,a+1,A)):r===e.A.vd?(this.remove(l,a,y),this.remove(l+1,a+1,p)):r===e.A.Ld?(this.remove(l,a,A),this.remove(l+1,a-1,w)):r===e.A.Rd&&(this.remove(l,a,p),this.remove(l-1,a-1,y)):s===n.A.Od.id&&(r===e.A.bd?(this.remove(l,a,u|c),this.remove(l-1,a,f),this.remove(l,a+1,d)):r===e.A.vd?(this.remove(l,a,u|f),this.remove(l,a+1,d),this.remove(l+1,a,c)):r===e.A.Ld?(this.remove(l,a,d|f),this.remove(l+1,a,c),this.remove(l,a-1,u)):r===e.A.Rd&&(this.remove(l,a,d|c),this.remove(l,a-1,u),this.remove(l-1,a,f))),o&&this.DA(t,i,s,r,!1)};Cm=(t,i,s,r,l,a)=>{if(t===s&&i===r)return!0;const c=t-this.offsetX,f=i-this.lT,u=s-this.offsetX,d=r-this.lT,w=o.index(c,f);if(l===n.A.Td.id){if(a===e.A.bd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A._d)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.Id)===h.A.OPEN)return!0}else if(a===e.A.vd){if(c===u&&f===d+1)return!0;if(c===u-1&&f===d&&(this.flags[w]&h.A.pd)===h.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.md)===h.A.OPEN)return!0}else if(a===e.A.Ld){if(c===u+1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A._d)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.Id)===h.A.OPEN)return!0}else if(a===e.A.Rd){if(c===u&&f===d-1)return!0;if(c===u-1&&f===d&&(this.flags[w]&h.A.pd)===h.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.md)===h.A.OPEN)return!0}}else if(l===n.A.Od.id){if(a===e.A.bd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.md)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.Id)===h.A.OPEN)return!0}else if(a===e.A.vd){if(c===u-1&&f===d&&(this.flags[w]&h.A.pd)===h.A.OPEN)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.Id)===h.A.OPEN)return!0}else if(a===e.A.Ld){if(c===u-1&&f===d&&(this.flags[w]&h.A.pd)===h.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A._d)===h.A.OPEN)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1)return!0}else if(a===e.A.Rd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A._d)===h.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.md)===h.A.OPEN)return!0;if(c===u&&f===d-1)return!0}}else if(l===n.A.kd.id){if(c===u&&f===d+1&&(this.flags[w]&h.A.VC)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.GC)===h.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&h.A.WC)===h.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.XC)===h.A.OPEN)return!0}return!1};Tm=(t,i,s,r,l,a)=>{if(t===s&&i===r)return!0;const c=t-this.offsetX,f=i-this.lT,u=s-this.offsetX,d=r-this.lT,w=o.index(c,f);if(l===n.A.uT.id||l===n.A.dT.id){if(l===n.A.dT.id&&(a=a+2&3),a===e.A.bd){if(c===u+1&&f===d&&(this.flags[w]&h.A.XC)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.GC)===h.A.OPEN)return!0}else if(a===e.A.vd){if(c===u-1&&f===d&&(this.flags[w]&h.A.WC)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.GC)===h.A.OPEN)return!0}else if(a===e.A.Ld){if(c===u-1&&f===d&&(this.flags[w]&h.A.WC)===h.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A.VC)===h.A.OPEN)return!0}else if(a===e.A.Rd){if(c===u+1&&f===d&&(this.flags[w]&h.A.XC)===h.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A.VC)===h.A.OPEN)return!0}}else if(l===n.A.wT.id){if(c===u&&f===d+1&&(this.flags[w]&h.A.VC)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.GC)===h.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&h.A.WC)===h.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.XC)===h.A.OPEN)return!0}return!1};Om=(t,i,s,e,n,l,a)=>{const c=s+n-1,f=e+l-1,u=o.index(t-this.offsetX,i-this.lT);return t>=s&&t<=c&&i>=e&&i<=f||(t===s-1&&i>=e&&i<=f&&(this.flags[u]&h.A.WC)===h.A.OPEN&&(a&r.A.bd)===h.A.OPEN||(t===c+1&&i>=e&&i<=f&&(this.flags[u]&h.A.XC)===h.A.OPEN&&(a&r.A.Ld)===h.A.OPEN||(i===e-1&&t>=s&&t<=c&&(this.flags[u]&h.A.GC)===h.A.OPEN&&(a&r.A.Rd)===h.A.OPEN||i===f+1&&t>=s&&t<=c&&(this.flags[u]&h.A.VC)===h.A.OPEN&&(a&r.A.vd)===h.A.OPEN)))};add=(t,i,s)=>{this.flags[o.index(t,i)]|=s};remove=(t,i,s)=>{this.flags[o.index(t,i)]&=h.A.oT-s}}},4909:(t,i,s)=>{s.d(i,{A:()=>h});class h{static vd=1;static Ld=2;static Rd=4;static bd=8}},6169:(t,i,s)=>{s.d(i,{A:()=>h});class h{static bd=0;static vd=1;static Ld=2;static Rd=3}},5599:(t,i,s)=>{s.d(i,{A:()=>h});class h{static SA=0;static MA=1;static xA=2;static lA=3}},1023:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(5599);class e{static Td=new e(0,h.A.SA);static fT=new e(1,h.A.SA);static Od=new e(2,h.A.SA);static Sd=new e(3,h.A.SA);static VI=new e(4,h.A.MA);static gm=new e(5,h.A.MA);static uT=new e(6,h.A.MA);static dT=new e(7,h.A.MA);static wT=new e(8,h.A.MA);static kd=new e(9,h.A.xA);static rA=new e(10,h.A.xA);static oA=new e(11,h.A.xA);static AT=new e(12,h.A.xA);static yT=new e(13,h.A.xA);static pT=new e(14,h.A.xA);static mT=new e(15,h.A.xA);static IT=new e(16,h.A.xA);static _T=new e(17,h.A.xA);static ET=new e(18,h.A.xA);static gT=new e(19,h.A.xA);static CT=new e(20,h.A.xA);static TT=new e(21,h.A.xA);static lA=new e(22,h.A.lA);static values(){return[this.Td,this.fT,this._T,this.mT,this.Od,this.pT,this.kd,this.Sd,this.lA,this.AT,this.oA,this.uT,this.CT,this.rA,this.gm,this.yT,this.dT,this.VI,this.IT,this.wT,this.gT,this.TT,this.ET]}static of(t){const i=this.values();for(let s=0;s{s.d(i,{A:()=>y});var h=s(670),e=s(2164),n=s(1069),r=s(4583),o=s(3045),l=s(5637),a=s(4197),c=s(1312),f=s(1023),u=s(6169),d=s(9298),w=s(5518),A=s(3867);class y{static OT=Int8Array.of(1,2,4,8);static bT=Uint8Array.of(16,32,64,128);static vT=Int8Array.of(1,0,-1,0);static LT=Int8Array.of(0,-1,0,1);static RT=(17*Math.random()|0)-8;static ST=(33*Math.random()|0)-16;static st=!0;static Dp=0;static MT=!1;static kT=(t,i)=>{let s=this.xT(t+45365,i+91923,4)+(this.xT(t+10294,i+37821,2)-128>>1)+(this.xT(t,i,1)-128>>2)-128;return s=35+(.3*s|0),s<10?s=10:s>60&&(s=60),s};static xT=(t,i,s)=>{const h=t/s|0,e=t&s-1,n=i/s|0,r=i&s-1,o=this.DT(h,n),l=this.DT(h+1,n),a=this.DT(h,n+1),c=this.DT(h+1,n+1),f=this.NT(o,l,e,s),u=this.NT(a,c,e,s);return this.NT(f,u,r,s)};static NT=(t,i,s,h)=>{const e=65536-r.A.cos[1024*s/h|0]>>1;return(t*(65536-e)>>16)+(i*e>>16)};static DT=(t,i)=>((this.PT(t-1,i-1)+this.PT(t+1,i-1)+this.PT(t-1,i+1)+this.PT(t+1,i+1))/16|0)+((this.PT(t-1,i)+this.PT(t+1,i)+this.PT(t,i-1)+this.PT(t,i+1))/8|0)+(this.PT(t,i)/4|0);static PT=(t,i)=>{const s=t+57*i,h=BigInt(s<<13^s);return 255&Number((h*(h*h*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static RA=(t,i,s,h,e,n,r,o,d,w,A)=>{const p=e[A][i][s],m=e[A][i+1][s],I=e[A][i+1][s+1],_=e[A][i][s+1],E=p+m+I+_>>2,g=l.A.get(o);let C=i+(s<<7)+(o<<14)+1073741824|0;g.active||(C+=-2147483648),C|=0;const T=(w<<6)+d<<24>>24;if(d===f.A.lA.id)h?.FT(g.la(f.A.lA.id,w,p,m,I,_,-1),t,i,s,E,C,T),g.NA&&g.active&&r?.aT(i,s),-1!==g.al&&n.n_(new a.A(o,t,3,i,s,c.A.Ro[g.al],!0));else if(d===f.A.rA.id||d===f.A.oA.id){const e=g.la(f.A.rA.id,w,p,m,I,_,-1);if(e){let n,r,o=0;d===f.A.oA.id&&(o+=256),w===u.A.vd||w===u.A.Rd?(n=g.length,r=g.width):(n=g.width,r=g.length),h?.RA(t,i,s,E,e,null,C,T,n,r,o)}g.NA&&r?.RA(i,s,g.width,g.length,w,g.PA),-1!==g.al&&n.n_(new a.A(o,t,2,i,s,c.A.Ro[g.al],!0))}else if(d>=f.A.AT.id)h?.RA(t,i,s,E,g.la(d,w,p,m,I,_,-1),null,C,T,1,1,0),g.NA&&r?.RA(i,s,g.width,g.length,w,g.PA),-1!==g.al&&n.n_(new a.A(o,t,2,i,s,c.A.Ro[g.al],!0));else if(d===f.A.Td.id)h?.cT(t,i,s,E,y.OT[w],0,g.la(f.A.Td.id,w,p,m,I,_,-1),null,C,T),g.NA&&r?.cT(i,s,d,w,g.PA),-1!==g.al&&n.n_(new a.A(o,t,0,i,s,c.A.Ro[g.al],!0));else if(d===f.A.fT.id)h?.cT(t,i,s,E,y.bT[w],0,g.la(f.A.fT.id,w,p,m,I,_,-1),null,C,T),g.NA&&r?.cT(i,s,d,w,g.PA),-1!==g.al&&n.n_(new a.A(o,t,0,i,s,c.A.Ro[g.al],!0));else if(d===f.A.Od.id){const e=w+1&3;h?.cT(t,i,s,E,y.OT[w],y.OT[e],g.la(f.A.Od.id,w+4,p,m,I,_,-1),g.la(f.A.Od.id,e,p,m,I,_,-1),C,T),g.NA&&r?.cT(i,s,d,w,g.PA),-1!==g.al&&n.n_(new a.A(o,t,0,i,s,c.A.Ro[g.al],!0))}else if(d===f.A.Sd.id)h?.cT(t,i,s,E,y.bT[w],0,g.la(f.A.Sd.id,w,p,m,I,_,-1),null,C,T),g.NA&&r?.cT(i,s,d,w,g.PA),-1!==g.al&&n.n_(new a.A(o,t,0,i,s,c.A.Ro[g.al],!0));else if(d===f.A.kd.id)h?.RA(t,i,s,E,g.la(d,w,p,m,I,_,-1),null,C,T,1,1,0),g.NA&&r?.RA(i,s,g.width,g.length,w,g.PA),-1!==g.al&&n.n_(new a.A(o,t,2,i,s,c.A.Ro[g.al],!0));else if(d===f.A.VI.id)h?.UT(t,i,s,E,0,0,C,g.la(f.A.VI.id,u.A.bd,p,m,I,_,-1),T,512*w,y.OT[w]),-1!==g.al&&n.n_(new a.A(o,t,1,i,s,c.A.Ro[g.al],!0));else if(d===f.A.gm.id){let e=16;if(h){const n=h.Ed(t,i,s);n>0&&(e=l.A.get(n>>14&32767).bg)}h?.UT(t,i,s,E,y.vT[w]*e,y.LT[w]*e,C,g.la(f.A.VI.id,u.A.bd,p,m,I,_,-1),T,512*w,y.OT[w]),-1!==g.al&&n.n_(new a.A(o,t,1,i,s,c.A.Ro[g.al],!0))}else d===f.A.uT.id?(h?.UT(t,i,s,E,0,0,C,g.la(f.A.VI.id,u.A.bd,p,m,I,_,-1),T,w,256),-1!==g.al&&n.n_(new a.A(o,t,1,i,s,c.A.Ro[g.al],!0))):d===f.A.dT.id?(h?.UT(t,i,s,E,0,0,C,g.la(f.A.VI.id,u.A.bd,p,m,I,_,-1),T,w,512),-1!==g.al&&n.n_(new a.A(o,t,1,i,s,c.A.Ro[g.al],!0))):d===f.A.wT.id&&(h?.UT(t,i,s,E,0,0,C,g.la(f.A.VI.id,u.A.bd,p,m,I,_,-1),T,w,768),-1!==g.al&&n.n_(new a.A(o,t,1,i,s,c.A.Ro[g.al],!0)))};xI;DI;Wn;Yn;BT;GT;HT;WT;YT;VT;KT;XT;zT;jT;ZT;qT;constructor(t,i,s,e){this.xI=t,this.DI=i,this.Wn=s,this.Yn=e,this.BT=new A.qa(h.A.xn,t,i),this.GT=new A.qa(h.A.xn,t,i),this.HT=new A.qa(h.A.xn,t,i),this.WT=new A.qa(h.A.xn,t,i),this.qT=new A.$a(h.A.xn,t+1,i+1),this.YT=new A.qa(h.A.xn,t+1,i+1),this.VT=new A.Kn(t+1,i+1),this.KT=new Int32Array(i),this.XT=new Int32Array(i),this.zT=new Int32Array(i),this.jT=new Int32Array(i),this.ZT=new Int32Array(i)}Hp=(t,i)=>{for(let t=0;t=0&&i[h]?.aT(s,e)}y.RT+=(5*Math.random()|0)-2,y.RT<-8?y.RT=-8:y.RT>8&&(y.RT=8),y.ST+=(5*Math.random()|0)-2,y.ST<-16?y.ST=-16:y.ST>16&&(y.ST=16);for(let i=0;i>8;for(let t=1;t>2)+(s[e+1][t]>>3)+(s[e][t-1]>>2)+(s[e][t+1]>>3)+(s[e][t]>>1);this.VT[e][t]=u-d}for(let t=0;t=0&&h0){const i=e.A.Ro[s-1];this.KT[t]+=i.fg,this.XT[t]+=i.lg,this.zT[t]+=i.ag,this.jT[t]+=i.cg,n=this.ZT[t]++}}const r=s-5;if(r>=0&&r0){const i=e.A.Ro[s-1];this.KT[t]-=i.fg,this.XT[t]-=i.lg,this.zT[t]-=i.ag,this.jT[t]-=i.cg,n=this.ZT[t]--}}}if(s>=1&&s=0&&f=0&&A=1&&c0||A>0){const p=this.Wn[i][s][c],m=this.Wn[i][s+1][c],I=this.Wn[i][s+1][c+1],_=this.Wn[i][s][c+1],E=this.VT[s][c],g=this.VT[s+1][c],C=this.VT[s+1][c+1],T=this.VT[s][c+1];let O=-1,b=-1;if(f>0){const t=256*h/l|0,i=n/a|0;let s=o/a|0;O=e.A.ig(t,i,s);const r=t+y.RT&255;s+=y.ST,s<0?s=0:s>255&&(s=255),b=e.A.ig(r,i,s)}if(i>0){let t=0!==f||this.HT[i][s][c]===w.A.JT;A>0&&!e.A.Ro[A-1].rg&&(t=!1),t&&p===m&&p===I&&p===_&&(this.qT[i][s][c]|=2340)}let v=0;if(-1!==O&&(v=r.A.palette[e.A.sg(b,96)]),0===A)t?.QT(i,s,c,w.A.JT,u.A.bd,-1,p,m,I,_,e.A.sg(O,E),e.A.sg(O,g),e.A.sg(O,C),e.A.sg(O,T),d.A.Bl,d.A.Bl,d.A.Bl,d.A.Bl,v,d.A.Bl);else{const h=this.HT[i][s][c]+1,n=this.WT[i][s][c],o=e.A.Ro[A-1];let l,a,f=o.texture;f>=0?(a=r.A.tO(f),l=-1):o.eg===d.A.vc?(a=0,l=-2,f=-1):(l=e.A.ig(o.og,o.lg,o.ag),a=r.A.palette[e.A.hg(o.ug,96)]),t?.QT(i,s,c,h,n,f,p,m,I,_,e.A.sg(O,E),e.A.sg(O,g),e.A.sg(O,C),e.A.sg(O,T),e.A.hg(l,E),e.A.hg(l,g),e.A.hg(l,C),e.A.hg(l,T),v,a)}}}}}}for(let s=1;s0&&(t<<=3,i<<=3,s<<=3);for(let h=0;h<=e;h++)for(let n=0;n<=this.DI;n++)for(let r=0;r<=this.xI;r++){if(this.qT[h][r][n]&t){let i=n,s=n,l=h,a=h;for(;i>0&&this.qT[h][r][i-1]&t;)i--;for(;s0;){for(let h=i;h<=s;h++)if(!(this.qT[l-1][r][h]&t))break t;l--}t:for(;a=8){const h=this.Wn[a][r][i]-240,n=this.Wn[l][r][i];o.A.eO(e,1,128*r,h,128*i,128*r,n,128*s+128);for(let h=l;h<=a;h++)for(let e=i;e<=s;e++)this.qT[h][r][e]&=~t}}if(this.qT[h][r][n]&i){let t=r,s=r,l=h,a=h;for(;t>0&&this.qT[h][t-1][n]&i;)t--;for(;s0;){for(let h=t;h<=s;h++)if(!(this.qT[l-1][h][n]&i))break t;l--}t:for(;a=8){const h=this.Wn[a][t][n]-240,r=this.Wn[l][t][n];o.A.eO(e,2,128*t,h,128*n,128*s+128,r,128*n);for(let h=l;h<=a;h++)for(let e=t;e<=s;e++)this.qT[h][e][n]&=~i}}if(this.qT[h][r][n]&s){let t=r,i=r,l=n,a=n;for(;l>0&&this.qT[h][r][l-1]&s;)l--;for(;a0;){for(let i=l;i<=a;i++)if(!(this.qT[h][t-1][i]&s))break t;t--}t:for(;i=4){const n=this.Wn[h][t][l];o.A.eO(e,4,128*t,n,128*l,128*i+128,n,128*a+128);for(let e=t;e<=i;e++)for(let t=l;t<=a;t++)this.qT[h][e][t]&=~s}}}}}};Bp=(t,i,s,n)=>{let r=0;for(let t=0;t>24;break}for(let e=t;e=0&&t=0&&e{const o=new n.A(new Uint8Array(r));for(let n=0;n=0&&a=0&&c>24,this.WT[n][a][c]=(f-2&3)<<24>>24):f<=81?this.Yn[n][a][c]=f-49<<24>>24:this.BT[n][a][c]=f-81<<24>>24}else for(;f=o.ZA,0!==f;){if(1===f){o.ZA;break}f<=49&&o.ZA}}};Gp=(t,i,s,e,r,o)=>{const l=new n.A(new Uint8Array(e));let a=-1;for(;;){const e=l.nO;if(0===e)return;a+=e;let n=0;for(;;){const e=l.nO;if(0===e)break;n+=e-1;const c=63&n,f=n>>6&63,u=n>>12,d=l.ZA,w=d>>2,A=3&d,y=f+r,p=c+o;if(y>0&&p>0&&y=0&&(e=s[h]),this.RA(u,y,p,t,i,e,a,w,A)}}}};RA=(t,i,s,h,e,n,r,o,d)=>{if(y.st){if(16&this.Yn[t][i][s])return;if(this.$T(t,i,s)!==y.Dp)return}const w=this.Wn[t][i][s],A=this.Wn[t][i+1][s],p=this.Wn[t][i+1][s+1],m=this.Wn[t][i][s+1],I=w+A+p+m>>2,_=l.A.get(r);let E=i+(s<<7)+(r<<14)+1073741824|0;_.active||(E+=-2147483648),E|=0;const g=(d<<6)+o<<24>>24;if(o===f.A.lA.id)(!y.st||_.active||_.Fg)&&(h?.FT(_.la(f.A.lA.id,d,w,A,p,m,-1),t,i,s,I,E,g),_.NA&&_.active&&n?.aT(i,s),-1!==_.al&&e.n_(new a.A(r,t,3,i,s,c.A.Ro[_.al],!0)));else if(o===f.A.rA.id||o===f.A.oA.id){const l=_.la(f.A.rA.id,d,w,A,p,m,-1);if(l){let e,n,r=0;if(o===f.A.oA.id&&(r+=256),d===u.A.vd||d===u.A.Rd?(e=_.length,n=_.width):(e=_.width,n=_.length),h?.RA(t,i,s,I,l,null,E,g,e,n,r)&&_.Sg)for(let h=0;h<=e;h++)for(let e=0;e<=n;e++){let n=l.rO/4|0;n>30&&(n=30),n>this.YT[t][i+h][s+e]&&(this.YT[t][i+h][s+e]=n<<24>>24)}}_.NA&&n?.RA(i,s,_.width,_.length,d,_.PA),-1!==_.al&&e.n_(new a.A(r,t,2,i,s,c.A.Ro[_.al],!0))}else if(o>=f.A.AT.id)h?.RA(t,i,s,I,_.la(o,d,w,A,p,m,-1),null,E,g,1,1,0),o>=f.A.AT.id&&o<=f.A._T.id&&o!==f.A.yT.id&&t>0&&(this.qT[t][i][s]|=2340),_.NA&&n?.RA(i,s,_.width,_.length,d,_.PA),-1!==_.al&&e.n_(new a.A(r,t,2,i,s,c.A.Ro[_.al],!0));else if(o===f.A.Td.id)h?.cT(t,i,s,I,y.OT[d],0,_.la(f.A.Td.id,d,w,A,p,m,-1),null,E,g),d===u.A.bd?(_.Sg&&(this.YT[t][i][s]=50,this.YT[t][i][s+1]=50),_.rg&&(this.qT[t][i][s]|=585)):d===u.A.vd?(_.Sg&&(this.YT[t][i][s+1]=50,this.YT[t][i+1][s+1]=50),_.rg&&(this.qT[t][i][s+1]|=1170)):d===u.A.Ld?(_.Sg&&(this.YT[t][i+1][s]=50,this.YT[t][i+1][s+1]=50),_.rg&&(this.qT[t][i+1][s]|=585)):d===u.A.Rd&&(_.Sg&&(this.YT[t][i][s]=50,this.YT[t][i+1][s]=50),_.rg&&(this.qT[t][i][s]|=1170)),_.NA&&n?.cT(i,s,o,d,_.PA),-1!==_.al&&e.n_(new a.A(r,t,0,i,s,c.A.Ro[_.al],!0)),16!==_.bg&&h?.oO(t,i,s,_.bg);else if(o===f.A.fT.id)h?.cT(t,i,s,I,y.bT[d],0,_.la(f.A.fT.id,d,w,A,p,m,-1),null,E,g),_.Sg&&(d===u.A.bd?this.YT[t][i][s+1]=50:d===u.A.vd?this.YT[t][i+1][s+1]=50:d===u.A.Ld?this.YT[t][i+1][s]=50:d===u.A.Rd&&(this.YT[t][i][s]=50)),_.NA&&n?.cT(i,s,o,d,_.PA),-1!==_.al&&e.n_(new a.A(r,t,0,i,s,c.A.Ro[_.al],!0));else if(o===f.A.Od.id){const l=d+1&3;h?.cT(t,i,s,I,y.OT[d],y.OT[l],_.la(f.A.Od.id,d+4,w,A,p,m,-1),_.la(f.A.Od.id,l,w,A,p,m,-1),E,g),_.rg&&(d===u.A.bd?(this.qT[t][i][s]|=265,this.qT[t][i][s+1]|=1170):d===u.A.vd?(this.qT[t][i][s+1]|=1170,this.qT[t][i+1][s]|=585):d===u.A.Ld?(this.qT[t][i+1][s]|=585,this.qT[t][i][s]|=1170):d===u.A.Rd&&(this.qT[t][i][s]|=1170,this.qT[t][i][s]|=585)),_.NA&&n?.cT(i,s,o,d,_.PA),-1!==_.al&&e.n_(new a.A(r,t,0,i,s,c.A.Ro[_.al],!0)),16!==_.bg&&h?.oO(t,i,s,_.bg)}else if(o===f.A.Sd.id)h?.cT(t,i,s,I,y.bT[d],0,_.la(f.A.Sd.id,d,w,A,p,m,-1),null,E,g),_.Sg&&(d===u.A.bd?this.YT[t][i][s+1]=50:d===u.A.vd?this.YT[t][i+1][s+1]=50:d===u.A.Ld?this.YT[t][i+1][s]=50:d===u.A.Rd&&(this.YT[t][i][s]=50)),_.NA&&n?.cT(i,s,o,d,_.PA),-1!==_.al&&e.n_(new a.A(r,t,0,i,s,c.A.Ro[_.al],!0));else if(o===f.A.kd.id)h?.RA(t,i,s,I,_.la(o,d,w,A,p,m,-1),null,E,g,1,1,0),_.NA&&n?.RA(i,s,_.width,_.length,d,_.PA),-1!==_.al&&e.n_(new a.A(r,t,2,i,s,c.A.Ro[_.al],!0));else if(o===f.A.VI.id)h?.UT(t,i,s,I,0,0,E,_.la(f.A.VI.id,u.A.bd,w,A,p,m,-1),g,512*d,y.OT[d]),-1!==_.al&&e.n_(new a.A(r,t,1,i,s,c.A.Ro[_.al],!0));else if(o===f.A.gm.id){let n=16;if(h){const e=h.Ed(t,i,s);e>0&&(n=l.A.get(e>>14&32767).bg)}h?.UT(t,i,s,I,y.vT[d]*n,y.LT[d]*n,E,_.la(f.A.VI.id,u.A.bd,w,A,p,m,-1),g,512*d,y.OT[d]),-1!==_.al&&e.n_(new a.A(r,t,1,i,s,c.A.Ro[_.al],!0))}else o===f.A.uT.id?(h?.UT(t,i,s,I,0,0,E,_.la(f.A.VI.id,u.A.bd,w,A,p,m,-1),g,d,256),-1!==_.al&&e.n_(new a.A(r,t,1,i,s,c.A.Ro[_.al],!0))):o===f.A.dT.id?(h?.UT(t,i,s,I,0,0,E,_.la(f.A.VI.id,u.A.bd,w,A,p,m,-1),g,d,512),-1!==_.al&&e.n_(new a.A(r,t,1,i,s,c.A.Ro[_.al],!0))):o===f.A.wT.id&&(h?.UT(t,i,s,I,0,0,E,_.la(f.A.VI.id,u.A.bd,w,A,p,m,-1),g,d,768),-1!==_.al&&e.n_(new a.A(r,t,1,i,s,c.A.Ro[_.al],!0)))};$T=(t,i,s)=>8&this.Yn[t][i][s]?0:t<=0||!(2&this.Yn[1][i][s])?t:t-1}},3045:(t,i,s)=>{s.d(i,{A:()=>I});var h=s(4583),e=s(1161),n=s(3795),r=s(8256),o=s(670),l=s(9222),a=s(6855),c=s(7441),f=s(6666),u=s(5748),d=s(3479),w=s(8950),A=s(2771),y=s(5518),p=s(6169),m=s(3867);class I{static lO=new m.aO(8,32,51,51,!1);static cO=new m.ds(100,null);static Xu=new Int32Array(o.A.xn);static fO=new m.uO(o.A.xn,500,null);static dO=new m.ds(500,null);static wO=new f.A;static Vf=0;static AO=0;static yO=0;static pO=0;static mO=0;static IO=0;static _O=0;static EO=0;static gO=0;static CO=0;static TO=0;static OO=0;static bO=0;static vO=0;static LO=0;static RO=0;static SO=0;static MO=0;static kO=0;static xO=0;static zu=0;static DO=0;static NO=!1;static PO=null;static FO=Uint8Array.of(19,55,38,155,255,110,137,205,76);static UO=Uint8Array.of(160,192,80,96,0,144,80,48,160);static BO=Uint8Array.of(76,8,137,4,0,1,38,2,19);static GO=Int8Array.of(0,0,2,0,0,2,1,1,0);static HO=Int8Array.of(2,0,0,2,0,0,0,4,4);static WO=Int8Array.of(0,4,4,8,0,0,8,0,0);static YO=Int8Array.of(1,1,0,0,0,8,0,0,8);static VO=Int8Array.of(53,-53,-53,53);static KO=Int8Array.of(-53,-53,53,53);static XO=Int8Array.of(-45,45,45,-45);static zO=Int8Array.of(45,45,-45,-45);static jO=[new Int8Array(16),Int8Array.of(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,0,0,0,1,1,0,0,1,1,1,0,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1),Int8Array.of(0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0),Int8Array.of(0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0),Int8Array.of(1,1,1,1,1,1,1,1,0,1,1,1,0,0,1,1),Int8Array.of(1,1,1,1,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,0,0,0,0,1,1,0,1,1,1,0,1,1,1),Int8Array.of(0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1)];static ZO=[Int8Array.of(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),Int8Array.of(12,8,4,0,13,9,5,1,14,10,6,2,15,11,7,3),Int8Array.of(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0),Int8Array.of(3,7,11,15,2,6,10,14,1,5,9,13,0,4,8,12)];static qO=Int32Array.of(41,39248,41,4643,41,41,41,41,41,41,41,41,41,41,41,43086,41,41,41,41,41,41,41,8602,41,28992,41,41,41,41,41,5056,41,41,41,41,41,41,41,41,41,41,41,41,41,41,3131,41,41,41);static ju=0;static xl=0;static Dl=0;static ff=-1;static uf=-1;static st=!0;static init=(t,i,s,e,n)=>{this.AO=0,this.yO=0,this.pO=t,this.mO=i,this.IO=t/2|0,this._O=i/2|0;const r=new m.aO(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let i=0;i<2048;i+=64){this.EO=h.A.sin[t],this.gO=h.A.cos[t],this.CO=h.A.sin[i],this.TO=h.A.cos[i];const o=(t-128)/32|0,l=i/64|0;for(let t=-26;t<=26;t++)for(let i=-26;i<=26;i++){const h=128*t,a=128*i;let c=!1;for(let t=-s;t<=e;t+=128)if(this.$O(h,a,n[o]+t)){c=!0;break}r[o][l][t+25+1][i+25+1]=c}}for(let t=0;t<8;t++)for(let i=0;i<32;i++)for(let s=-25;s<25;s++)for(let h=-25;h<25;h++){let e=!1;t:for(let n=-1;n<=1;n++)for(let o=-1;o<=1;o++){if(r[t][i][s+n+25+1][h+o+25+1]){e=!0;break t}if(r[t][(i+1)%31][s+n+25+1][h+o+25+1]){e=!0;break t}if(r[t+1][i][s+n+25+1][h+o+25+1]){e=!0;break t}if(r[t+1][(i+1)%31][s+n+25+1][h+o+25+1]){e=!0;break t}}this.lO[t][i][s+25][h+25]=e}};static bo=()=>{this.cO=null,this.Xu=null,this.fO=null,this.wO=null,this.lO=null,this.dO=null,this.PO=null,console.log('World3D unloaded!')};static eO=(t,i,s,h,e,n,o,l)=>{I.fO[t][I.Xu[t]++]=new r.A(s/128|0,n/128|0,e/128|0,l/128|0,i,s,n,e,l,h,o)};static $O=(t,i,s)=>{const h=i*this.CO+t*this.TO>>16,e=i*this.TO-t*this.CO>>16,n=s*this.EO+e*this.gO>>16,r=s*this.gO-e*this.EO>>16;if(n<50||n>3500)return!1;const o=this.IO+((h<<9)/n|0),l=this._O+((r<<9)/n|0);return o>=this.AO&&o<=this.pO&&l>=this.yO&&l<=this.mO};JO;xI;DI;QO;tb;Er;ib;sb;hb;eb=0;nb=0;rb=0;constructor(t,i,s,h){this.JO=s,this.xI=h,this.DI=i,this.tb=new m.Cr(s,h,i,null),this.ib=new m.$a(s,h+1,i+1),this.QO=t,this.Er=new m.ds(5e3,null),this.sb=new Int32Array(1e4),this.hb=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this.nb=t;for(let i=0;i{const s=this.tb[0][t][i];for(let s=0;s<3;s++){this.tb[s][t][i]=this.tb[s+1][t][i];const h=this.tb[s][t][i];h&&h.level--}this.tb[0][t][i]||(this.tb[0][t][i]=new n.A(0,t,i));const h=this.tb[0][t][i];h&&(h.ob=s),this.tb[3][t][i]=null};iO=(t,i,s,h)=>{const e=this.tb[t][i][s];e&&(e.lb=h)};QT=(t,i,s,h,e,r,o,l,a,c,f,u,w,p,m,I,_,E,g,C)=>{if(h===y.A.JT){for(let h=t;h>=0;h--)this.tb[h][i][s]||(this.tb[h][i][s]=new n.A(h,i,s));const h=this.tb[t][i][s];h&&(h.ab=new d.A(f,u,w,p,-1,g,!1))}else if(h===y.A.cb){for(let h=t;h>=0;h--)this.tb[h][i][s]||(this.tb[h][i][s]=new n.A(h,i,s));const h=this.tb[t][i][s];h&&(h.ab=new d.A(m,I,_,E,r,C,o===l&&o===a&&o===c))}else{for(let h=t;h>=0;h--)this.tb[h][i][s]||(this.tb[h][i][s]=new n.A(h,i,s));const d=this.tb[t][i][s];d&&(d.fb=new A.A(i,h,I,l,w,e,f,c,C,m,r,E,g,a,_,p,o,s,u))}};FT=(t,i,s,h,e,r,o)=>{this.tb[i][s][h]||(this.tb[i][s][h]=new n.A(i,s,h));const a=this.tb[i][s][h];a&&(a.ub=new l.A(e,128*s+64,128*h+64,t,r,o))};BA=(t,i,s)=>{const h=this.tb[t][i][s];h&&(h.ub=null)};LA=(t,i,s,h,e,r,o,l)=>{let a=0;const c=this.tb[h][t][i];if(c)for(let t=0;ta&&(a=s)}else this.tb[h][t][i]=new n.A(h,t,i);const f=this.tb[h][t][i];f&&(f.yb=new u.A(s,128*t+64,128*i+64,r,o,l,e,a))};TA=(t,i,s)=>{const h=this.tb[t][i][s];h&&(h.yb=null)};cT=(t,i,s,h,e,r,o,l,c,f)=>{if(!o&&!l)return;for(let h=t;h>=0;h--)this.tb[h][i][s]||(this.tb[h][i][s]=new n.A(h,i,s));const u=this.tb[t][i][s];u&&(u.pb=new a.A(h,128*i+64,128*s+64,e,r,o,l,c,f))};DA=(t,i,s,h)=>{const e=this.tb[t][i][s];1===h&&e&&(e.pb=null)};UT=(t,i,s,h,e,r,o,l,a,f,u)=>{if(!l)return;for(let h=t;h>=0;h--)this.tb[h][i][s]||(this.tb[h][i][s]=new n.A(h,i,s));const d=this.tb[t][i][s];d&&(d.mb=new c.A(h,128*i+e+64,128*s+r+64,u,f,l,o,a))};FA=(t,i,s)=>{const h=this.tb[t][i][s];h&&(h.mb=null)};oO=(t,i,s,h)=>{const e=this.tb[t][i][s];if(!e)return;const n=e.mb;if(!n)return;const r=128*i+64,o=128*s+64;n.x=r+((n.x-r)*h/16|0),n.z=o+((n.z-o)*h/16|0)};YI=(t,i,s,h)=>{if(!h)return;const e=this.tb[t][i][s];if(!e)return;const n=e.mb;n&&(n.model=h)};zI=(t,i,s,h)=>{if(!h)return;const e=this.tb[t][i][s];if(!e)return;const n=e.ub;n&&(n.model=h)};XI=(t,i,s,h)=>{if(!h)return;const e=this.tb[t][i][s];if(!e)return;const n=e.pb;n&&(n.Ib=h)};KI=(t,i,s,h,e)=>{if(!h)return;const n=this.tb[s][t][i];if(!n)return;const r=n.pb;r&&(r.Ib=h,r._b=e)};RA=(t,i,s,h,e,n,r,o,l,a,c)=>{if(!e&&!n)return!0;const f=128*i+64*l,u=128*s+64*a;return this.Eb(f,u,h,t,i,s,l,a,e,n,r,o,c,!1)};vI=(t,i,s,h,e,n,r,o,l,a)=>{if(!e&&!n)return!0;let c=i-l,f=h-l,u=i+l,d=h+l;return a&&(o>640&&o<1408&&(d+=128),o>1152&&o<1920&&(u+=128),(o>1664||o<384)&&(f-=128),o>128&&o<896&&(c-=128)),c=c/128|0,f=f/128|0,u=u/128|0,d=d/128|0,this.Eb(i,h,s,t,c,f,u+1-c,d-f+1,e,n,r,0,o,!0)};SI=(t,i,s,h,e,n,r,o,l,a,c,f)=>!l&&!a||this.Eb(i,h,s,t,e,n,r+1-e,o-n+1,l,a,c,0,f,!0);UA=(t,i,s)=>{const h=this.tb[t][i][s];if(h)for(let t=0;t>29&3)&&e.Cb===i&&e.Tb===s)return void this.Ob(e)}};WI=(t,i,s,h)=>{if(!h)return;const e=this.tb[t][i][s];if(e)for(let t=0;t>29&3))return void(i.model=h)}};zf=()=>{for(let t=0;t{const h=this.tb[t][i][s];return h&&h.pb?h.pb.gb:0};kA=(t,i,s)=>{const h=this.tb[t][s][i];return h&&h.mb?h.mb.gb:0};Md=(t,i,s)=>{const h=this.tb[t][i][s];if(!h)return 0;for(let t=0;t>29&3)&&e.Cb===i&&e.Tb===s)return e.gb}return 0};Ad=(t,i,s)=>{const h=this.tb[t][i][s];return h&&h.ub?h.ub.gb:0};gd=(t,i,s,h)=>{const e=this.tb[t][i][s];if(e){if(e.pb&&e.pb.gb===h)return 255&e.pb.info;if(e.mb&&e.mb.gb===h)return 255&e.mb.info;if(e.ub&&e.ub.gb===h)return 255&e.ub.info;for(let t=0;t{const n=i*(0|Math.sqrt(s*s+h*h+e*e))>>8;for(let i=0;i{if(i0){const e=this.tb[t][i+1][s-1];e&&e.ub&&e.ub.model&&e.ub.model.bb&&this.Lb(h,e.ub.model,128,0,-128,!0)}};vb=(t,i,s,h,e,n)=>{let r=!0,o=i;const l=i+h,a=s-1,c=s+e;for(let f=t;f<=t+1;f++)if(f!==this.JO){for(let u=o;u<=l;u++)if(!(u<0||u>=this.xI))for(let o=a;o<=c;o++){if(o<0||o>=this.DI||r&&u=s||u===i))continue;const a=this.tb[f][u][o];if(!a)continue;const d=128*(u-i)+64*(1-h),w=128*(o-s)+64*(1-e),A=((this.QO[f][u][o]+this.QO[f][u+1][o]+this.QO[f][u][o+1]+this.QO[f][u+1][o+1])/4|0)-((this.QO[t][i][s]+this.QO[t][i+1][s]+this.QO[t][i][s+1]+this.QO[t][i+1][s+1])/4|0),y=a.pb;y&&y.Ib&&y.Ib.bb&&this.Lb(n,y.Ib,d,A,w,r),y&&y._b&&y._b.bb&&this.Lb(n,y._b,d,A,w,r);for(let t=0;t{this.rb++;let r=0;const o=i.Gg,l=i.Bg;if(t.bb&&t.xb)for(let n=0;ni.Db)continue;const u=t.Gg[n]-s;if(ui.Pb)continue;const d=t.Hg[n]-e;if(di.Ub)continue;if(i.bb&&i.xb)for(let t=0;t{const r=this.tb[t][i][s];if(!r)return;const o=r.ab;if(o){const t=o.color;if(0!==t)for(let i=0;i<4;i++)h[e]=t,h[e+1]=t,h[e+2]=t,h[e+3]=t,e+=n;return}const l=r.fb;if(!l)return;const a=l.shape,c=l.angle,f=l.Vb,u=l.Kb,d=I.jO[a],w=I.ZO[c];let A=0;if(0===f)for(let t=0;t<4;t++)0!==d[w[A++]]&&(h[e]=u),0!==d[w[A++]]&&(h[e+1]=u),0!==d[w[A++]]&&(h[e+2]=u),0!==d[w[A++]]&&(h[e+3]=u),e+=n;else for(let t=0;t<4;t++)h[e]=0===d[w[A++]]?f:u,h[e+1]=0===d[w[A++]]?f:u,h[e+2]=0===d[w[A++]]?f:u,h[e+3]=0===d[w[A++]]?f:u,e+=n};click=(t,i)=>{I.NO=!0,I.xl=t,I.Dl=i,I.ff=-1,I.uf=-1};draw=(t,i,s,e,n,r,o)=>{t<0?t=0:t>=128*this.xI&&(t=128*this.xI-1),s<0?s=0:s>=128*this.DI&&(s=128*this.DI-1),I.Vf++,I.EO=h.A.sin[r],I.gO=h.A.cos[r],I.CO=h.A.sin[n],I.TO=h.A.cos[n],I.PO=I.lO[(r-128)/32|0][n/64|0],I.OO=t,I.bO=i,I.vO=s,I.LO=t/128|0,I.RO=s/128|0,I.zu=e,I.SO=I.LO-25,I.SO<0&&(I.SO=0),I.kO=I.RO-25,I.kO<0&&(I.kO=0),I.MO=I.LO+25,I.MO>this.xI&&(I.MO=this.xI),I.xO=I.RO+25,I.xO>this.DI&&(I.xO=this.DI),this.Xb(),I.DO=0;for(let t=this.nb;t=2e3)?(r.visible=!0,r.update=!0,r.zb=r.wb>0,I.DO++):(r.visible=!1,r.update=!1,r.jb=0))}}for(let t=this.nb;t=I.MO))for(let t=-25;t<=0;t++){const e=I.RO+t,n=I.RO-t;let r;if(s>=I.SO&&(e>=I.kO&&(r=i[s][e],r&&r.visible&&this.Zb(r,!0,o)),n=I.kO&&(r=i[h][e],r&&r.visible&&this.Zb(r,!0,o)),n=I.MO))for(let t=-25;t<=0;t++){const e=I.RO+t,n=I.RO-t;let r;if(s>=I.SO&&(e>=I.kO&&(r=i[s][e],r&&r.visible&&this.Zb(r,!1,o)),n=I.kO&&(r=i[h][e],r&&r.visible&&this.Zb(r,!1,o)),n{if(!c&&!f)return!1;for(let t=r;t=this.xI||i>=this.DI)return!1;const s=this.tb[h][t][i];if(s&&s.wb>=5)return!1}const y=new e.A(h,s,t,i,c,f,w,r,r+l-1,o,o+a-1,u,d);for(let t=r;tr&&(s|=1),to&&(s+=8),i=0;s--)this.tb[s][t][i]||(this.tb[s][t][i]=new n.A(s,t,i));const e=this.tb[h][t][i];e&&(e.Ab[e.wb]=y,e.qb[e.wb]=s,e.$b|=s,e.wb++)}return A&&(this.Er[this.eb++]=y),!0};Ob=t=>{for(let i=t.Cb;i<=t.Sb;i++)for(let s=t.Tb;s<=t.Mb;s++){const h=this.tb[t.level][i][s];if(h){for(let i=0;i{const t=I.Xu[I.zu],i=I.fO[I.zu];I.ju=0;for(let s=0;s=0&&h<=50){e=t.kI+25-I.RO,e<0&&(e=0),n=t.DI+25-I.RO,n>50&&(n=50);let i=!1;for(;e<=n;)if(I.PO&&I.PO[h][e++]){i=!0;break}if(i){if(r=I.OO-t.Nb,r>32)t.mode=1;else{if(r>=-32)continue;t.mode=2,r=-r}t.Jb=(t.Fb-I.vO<<8)/r|0,t.Qb=(t.Ub-I.vO<<8)/r|0,t.tv=(t.Db-I.bO<<8)/r|0,t.iv=(t.Zg-I.bO<<8)/r|0,I.dO[I.ju++]=t}}}else if(2===t.type){if(h=t.kI+25-I.RO,h>=0&&h<=50){e=t.MI+25-I.LO,e<0&&(e=0),n=t.xI+25-I.LO,n>50&&(n=50);let i=!1;for(;e<=n;)if(I.PO&&I.PO[e++][h]){i=!0;break}if(i){if(r=I.vO-t.Fb,r>32)t.mode=3;else{if(r>=-32)continue;t.mode=4,r=-r}t.sv=(t.Nb-I.OO<<8)/r|0,t.hv=(t.Pb-I.OO<<8)/r|0,t.tv=(t.Db-I.bO<<8)/r|0,t.iv=(t.Zg-I.bO<<8)/r|0,I.dO[I.ju++]=t}}}else if(4===t.type&&(h=t.Db-I.bO,h>128&&(e=t.kI+25-I.RO,e<0&&(e=0),n=t.DI+25-I.RO,n>50&&(n=50),e<=n))){let i=t.MI+25-I.LO;i<0&&(i=0),r=t.xI+25-I.LO,r>50&&(r=50);let s=!1;t:for(let t=i;t<=r;t++)for(let i=e;i<=n;i++)if(I.PO&&I.PO[t][i]){s=!0;break t}s&&(t.mode=5,t.sv=(t.Nb-I.OO<<8)/h|0,t.hv=(t.Pb-I.OO<<8)/h|0,t.Jb=(t.Fb-I.vO<<8)/h|0,t.Qb=(t.Ub-I.vO<<8)/h|0,I.dO[I.ju++]=t)}}};Zb=(t,i,s)=>{for(I.wO.n_(t);;){let t;do{if(t=I.wO.ev(),!t)return}while(!t.update);const h=t.x,e=t.z,n=t.level,r=t.nv,o=this.tb[n];if(t.visible){if(i){if(n>0){const t=this.tb[n-1][h][e];if(t&&t.update)continue}if(h<=I.LO&&h>I.SO){const i=o[h-1][e];if(i&&i.update&&(i.visible||!(1&t.$b)))continue}if(h>=I.LO&&hI.kO){const i=o[h][e-1];if(i&&i.update&&(i.visible||!(8&t.$b)))continue}if(e>=I.RO&&ee&&(a+=6),c=I.FO[a],t.cv=I.BO[a]),f&&(f.fv&I.UO[a]?16===f.fv?(t.jb=3,t.uv=I.GO[a],t.dv=3-t.uv):32===f.fv?(t.jb=6,t.uv=I.HO[a],t.dv=6-t.uv):64===f.fv?(t.jb=12,t.uv=I.WO[a],t.dv=12-t.uv):(t.jb=9,t.uv=I.YO[a],t.dv=9-t.uv):t.jb=0,f.fv&c&&!this.wv(r,h,e,f.fv)&&f.Ib?.draw(0,I.EO,I.gO,I.CO,I.TO,f.x-I.OO,f.y-I.bO,f.z-I.vO,f.gb),f.Av&c&&!this.wv(r,h,e,f.Av)&&f._b?.draw(0,I.EO,I.gO,I.CO,I.TO,f.x-I.OO,f.y-I.bO,f.z-I.vO,f.gb)),u&&!this.visible(r,h,e,u.model.Zg))if(u.type&c)u.model.draw(u.angle,I.EO,I.gO,I.CO,I.TO,u.x-I.OO,u.y-I.bO,u.z-I.vO,u.gb);else if(768&u.type){const t=u.x-I.OO,i=u.y-I.bO,s=u.z-I.vO,h=u.angle;let e,n;if(e=h===p.A.vd||h===p.A.Ld?-t:t,n=h===p.A.Ld||h===p.A.Rd?-s:s,256&u.type&&ne){const e=t+I.XO[h],n=s+I.zO[h];u.model.draw(512*h+1280&2047,I.EO,I.gO,I.CO,I.TO,e,i,n,u.gb)}}if(l){const i=t.ub;i&&i.model?.draw(0,I.EO,I.gO,I.CO,I.TO,i.x-I.OO,i.y-I.bO,i.z-I.vO,i.gb);const s=t.yb;s&&0===s.offset&&(s.yv&&s.yv.draw(0,I.EO,I.gO,I.CO,I.TO,s.x-I.OO,s.y-I.bO,s.z-I.vO,s.gb),s.pv&&s.pv.draw(0,I.EO,I.gO,I.CO,I.TO,s.x-I.OO,s.y-I.bO,s.z-I.vO,s.gb),s.mv&&s.mv.draw(0,I.EO,I.gO,I.CO,I.TO,s.x-I.OO,s.y-I.bO,s.z-I.vO,s.gb))}const d=t.$b;if(0!==d){if(hI.LO&&1&d){const t=o[h-1][e];t&&t.update&&I.wO.n_(t)}if(e>I.RO&&8&d){const t=o[h][e-1];t&&t.update&&I.wO.n_(t)}}}if(0!==t.jb){let i=!0;for(let s=0;si.Cb&&(n+=1),si.Tb&&(n+=8),hh&&(h=e);const r=I.RO-i.Tb,l=i.Mb-I.RO;i.Iv=l>r?h+l:h+r}for(;;){let t=-50,i=-1;for(let s=0;st&&(t=h.Iv,i=s))}if(-1===i)break;const l=I.cO[i];if(l){l.Vf=I.Vf;let t=l.model;t||(t=l.av?.draw(s)??null),t&&!this._v(r,l.Cb,l.Sb,l.Tb,l.Mb,t.Zg)&&t.draw(l.LI,I.EO,I.gO,I.CO,I.TO,l.x-I.OO,l.y-I.bO,l.z-I.vO,l.gb);for(let t=l.Cb;t<=l.Sb;t++)for(let i=l.Tb;i<=l.Mb;i++){const s=o[t][i];s&&(0!==s.jb?I.wO.n_(s):t===h&&i===e||!s.update||I.wO.n_(s))}}}if(t.zb)continue}if(!t.update||0!==t.jb)continue;if(h<=I.LO&&h>I.SO){const t=o[h-1][e];if(t&&t.update)continue}if(h>=I.LO&&hI.kO){const t=o[h][e-1];if(t&&t.update)continue}if(e>=I.RO&&e=n){const n=t+I.VO[e],r=h+I.KO[e];i.model.draw(512*e+256,I.EO,I.gO,I.CO,I.TO,n,s,r,i.gb)}if(512&i.type&&r<=n){const n=t+I.XO[e],r=h+I.zO[e];i.model.draw(512*e+1280&2047,I.EO,I.gO,I.CO,I.TO,n,s,r,i.gb)}}const s=t.pb;s&&(s.Av&t.cv&&!this.wv(r,h,e,s.Av)&&s._b?.draw(0,I.EO,I.gO,I.CO,I.TO,s.x-I.OO,s.y-I.bO,s.z-I.vO,s.gb),s.fv&t.cv&&!this.wv(r,h,e,s.fv)&&s.Ib?.draw(0,I.EO,I.gO,I.CO,I.TO,s.x-I.OO,s.y-I.bO,s.z-I.vO,s.gb))}if(nI.LO){const t=o[h-1][e];t&&t.update&&I.wO.n_(t)}if(e>I.RO){const t=o[h][e-1];t&&t.update&&I.wO.n_(t)}}};ov=(t,i,s,e,n,r,o,l)=>{let a,c,f,u,d=a=(s<<7)-I.OO,A=c=(e<<7)-I.vO,y=f=d+128,p=u=A+128,m=this.QO[i][s][e]-I.bO,_=this.QO[i][s+1][e]-I.bO,E=this.QO[i][s+1][e+1]-I.bO,g=this.QO[i][s][e+1]-I.bO,C=A*o+d*l>>16;if(A=A*l-d*o>>16,d=C,C=m*r-A*n>>16,A=m*n+A*r>>16,m=C,A<50)return;if(C=c*o+y*l>>16,c=c*l-y*o>>16,y=C,C=_*r-c*n>>16,c=_*n+c*r>>16,_=C,c<50)return;if(C=p*o+f*l>>16,p=p*l-f*o>>16,f=C,C=E*r-p*n>>16,p=E*n+p*r>>16,E=C,p<50)return;if(C=u*o+a*l>>16,u=u*l-a*o>>16,a=C,C=g*r-u*n>>16,u=g*n+u*r>>16,g=C,u<50)return;const T=h.A.na+((d<<9)/A|0),O=h.A.ra+((m<<9)/A|0),b=h.A.na+((y<<9)/c|0),v=h.A.ra+((_<<9)/c|0),L=h.A.na+((f<<9)/p|0),R=h.A.ra+((E<<9)/p|0),S=h.A.na+((a<<9)/u|0),M=h.A.ra+((g<<9)/u|0);if(h.A.alpha=0,(L-S)*(v-M)-(R-M)*(b-S)>0)if(h.A.Ev=L<0||S<0||b<0||L>w.A.gv||S>w.A.gv||b>w.A.gv,I.NO&&this.Cv(I.xl,I.Dl,R,M,v,L,S,b)&&(I.ff=s,I.uf=e),-1===t.Tv)12345678!==t.Ov&&h.A.bv(L,S,b,R,M,v,t.Ov,t.vv,t.Lv);else if(I.st){const i=I.qO[t.Tv];h.A.bv(L,S,b,R,M,v,this.Rv(i,t.Ov),this.Rv(i,t.vv),this.Rv(i,t.Lv))}else t.flat?h.A.Sv(L,S,b,R,M,v,t.Ov,t.vv,t.Lv,d,m,A,y,a,_,g,c,u,t.Tv):h.A.Sv(L,S,b,R,M,v,t.Ov,t.vv,t.Lv,f,E,p,a,y,g,_,u,c,t.Tv);if(!((T-b)*(M-v)-(O-v)*(S-b)<=0))if(h.A.Ev=T<0||b<0||S<0||T>w.A.gv||b>w.A.gv||S>w.A.gv,I.NO&&this.Cv(I.xl,I.Dl,O,v,M,T,b,S)&&(I.ff=s,I.uf=e),-1!==t.Tv){if(!I.st)return void h.A.Sv(T,b,S,O,v,M,t.Mv,t.Lv,t.vv,d,m,A,y,a,_,g,c,u,t.Tv);const i=I.qO[t.Tv];h.A.bv(T,b,S,O,v,M,this.Rv(i,t.Mv),this.Rv(i,t.Lv),this.Rv(i,t.vv))}else 12345678!==t.Mv&&h.A.bv(T,b,S,O,v,M,t.Mv,t.Lv,t.vv)};lv=(t,i,s,e,n,r,o)=>{let l=s.Gg.length;for(let t=0;t>16;if(a=a*o-i*r>>16,i=c,c=l*n-a*e>>16,a=l*e+a*n>>16,l=c,a<50)return;s.kv&&(A.A.xv[t]=i,A.A.Dv[t]=l,A.A.Nv[t]=a),A.A.Pv[t]=h.A.na+((i<<9)/a|0),A.A.Fv[t]=h.A.ra+((l<<9)/a|0)}h.A.alpha=0,l=s.Uv.length;for(let e=0;e0)if(h.A.Ev=l<0||a<0||c<0||l>w.A.gv||a>w.A.gv||c>w.A.gv,I.NO&&this.Cv(I.xl,I.Dl,f,u,d,l,a,c)&&(I.ff=t,I.uf=i),s.kv&&-1!==s.kv[e])if(I.st){const t=I.qO[s.kv[e]];h.A.bv(l,a,c,f,u,d,this.Rv(t,s.Hv[e]),this.Rv(t,s.Wv[e]),this.Rv(t,s.Yv[e]))}else s.flat?h.A.Sv(l,a,c,f,u,d,s.Hv[e],s.Wv[e],s.Yv[e],A.A.xv[0],A.A.Dv[0],A.A.Nv[0],A.A.xv[1],A.A.xv[3],A.A.Dv[1],A.A.Dv[3],A.A.Nv[1],A.A.Nv[3],s.kv[e]):h.A.Sv(l,a,c,f,u,d,s.Hv[e],s.Wv[e],s.Yv[e],A.A.xv[n],A.A.Dv[n],A.A.Nv[n],A.A.xv[r],A.A.xv[o],A.A.Dv[r],A.A.Dv[o],A.A.Nv[r],A.A.Nv[o],s.kv[e]);else 12345678!==s.Hv[e]&&h.A.bv(l,a,c,f,u,d,s.Hv[e],s.Wv[e],s.Yv[e])}};rv=(t,i,s)=>{const h=this.ib[t][i][s];if(h===-I.Vf)return!1;if(h===I.Vf)return!0;{const h=i<<7,e=s<<7;return this.Vv(h+1,this.QO[t][i][s],e+1)&&this.Vv(h+128-1,this.QO[t][i+1][s],e+1)&&this.Vv(h+128-1,this.QO[t][i+1][s+1],e+128-1)&&this.Vv(h+1,this.QO[t][i][s+1],e+128-1)?(this.ib[t][i][s]=I.Vf,!0):(this.ib[t][i][s]=-I.Vf,!1)}};wv=(t,i,s,h)=>{if(!this.rv(t,i,s))return!1;const e=i<<7,n=s<<7,r=this.QO[t][i][s]-1,o=r-120,l=r-230,a=r-238;if(h<16){if(1===h){if(e>I.OO){if(!this.Vv(e,r,n))return!1;if(!this.Vv(e,r,n+128))return!1}if(t>0){if(!this.Vv(e,o,n))return!1;if(!this.Vv(e,o,n+128))return!1}return!!this.Vv(e,l,n)&&this.Vv(e,l,n+128)}if(2===h){if(n0){if(!this.Vv(e,o,n+128))return!1;if(!this.Vv(e+128,o,n+128))return!1}return!!this.Vv(e,l,n+128)&&this.Vv(e+128,l,n+128)}if(4===h){if(e0){if(!this.Vv(e+128,o,n))return!1;if(!this.Vv(e+128,o,n+128))return!1}return!!this.Vv(e+128,l,n)&&this.Vv(e+128,l,n+128)}if(8===h){if(n>I.vO){if(!this.Vv(e,r,n))return!1;if(!this.Vv(e+128,r,n))return!1}if(t>0){if(!this.Vv(e,o,n))return!1;if(!this.Vv(e+128,o,n))return!1}return!!this.Vv(e,l,n)&&this.Vv(e+128,l,n)}}return!!this.Vv(e+64,a,n+64)&&(16===h?this.Vv(e,l,n+128):32===h?this.Vv(e+128,l,n+128):64===h?this.Vv(e+128,l,n):128===h?this.Vv(e,l,n):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,i,s,h)=>{if(this.rv(t,i,s)){const e=i<<7,n=s<<7;return this.Vv(e+1,this.QO[t][i][s]-h,n+1)&&this.Vv(e+128-1,this.QO[t][i+1][s]-h,n+1)&&this.Vv(e+128-1,this.QO[t][i+1][s+1]-h,n+128-1)&&this.Vv(e+1,this.QO[t][i][s+1]-h,n+128-1)}return!1};_v=(t,i,s,h,e,n)=>{let r,o;if(i!==s||h!==e){for(r=i;r<=s;r++)for(o=h;o<=e;o++)if(this.ib[t][r][o]===-I.Vf)return!1;o=1+(i<<7);const l=2+(h<<7),a=this.QO[t][i][h]-n;if(!this.Vv(o,a,l))return!1;const c=(s<<7)-1;if(!this.Vv(c,a,l))return!1;const f=(e<<7)-1;return!!this.Vv(o,a,f)&&this.Vv(c,a,f)}return!!this.rv(t,i,h)&&(r=i<<7,o=h<<7,this.Vv(r+1,this.QO[t][i][h]-n,o+1)&&this.Vv(r+128-1,this.QO[t][i+1][h]-n,o+1)&&this.Vv(r+128-1,this.QO[t][i+1][h+1]-n,o+128-1)&&this.Vv(r+1,this.QO[t][i][h+1]-n,o+128-1))};Vv=(t,i,s)=>{for(let h=0;h0){const t=e.Fb+(e.Jb*h>>8),n=e.Ub+(e.Qb*h>>8),r=e.Db+(e.tv*h>>8),o=e.Zg+(e.iv*h>>8);if(s>=t&&s<=n&&i>=r&&i<=o)return!0}}else if(2===e.mode){const h=t-e.Nb;if(h>0){const t=e.Fb+(e.Jb*h>>8),n=e.Ub+(e.Qb*h>>8),r=e.Db+(e.tv*h>>8),o=e.Zg+(e.iv*h>>8);if(s>=t&&s<=n&&i>=r&&i<=o)return!0}}else if(3===e.mode){const h=e.Fb-s;if(h>0){const s=e.Nb+(e.sv*h>>8),n=e.Pb+(e.hv*h>>8),r=e.Db+(e.tv*h>>8),o=e.Zg+(e.iv*h>>8);if(t>=s&&t<=n&&i>=r&&i<=o)return!0}}else if(4===e.mode){const h=s-e.Fb;if(h>0){const s=e.Nb+(e.sv*h>>8),n=e.Pb+(e.hv*h>>8),r=e.Db+(e.tv*h>>8),o=e.Zg+(e.iv*h>>8);if(t>=s&&t<=n&&i>=r&&i<=o)return!0}}else if(5===e.mode){const h=i-e.Db;if(h>0){const i=e.Nb+(e.sv*h>>8),n=e.Pb+(e.hv*h>>8),r=e.Fb+(e.Jb*h>>8),o=e.Ub+(e.Qb*h>>8);if(t>=i&&t<=n&&s>=r&&s<=o)return!0}}}return!1};Cv=(t,i,s,h,e,n,r,o)=>{if(is&&i>h&&i>e)return!1;if(tn&&t>r&&t>o)return!1;const l=(i-h)*(o-r)-(t-r)*(e-h);return((i-s)*(r-n)-(t-n)*(h-s))*l>0&&l*((i-e)*(n-o)-(t-o)*(s-e))>0};Rv=(t,i)=>((i=(127-i)*(127&t)/160|0)<2?i=2:i>126&&(i=126),(65408&t)+i)}},7121:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{}},4197:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{Vp;HI;Wp;Yp;index;GI;ul;fl;constructor(t,i,s,h,e,n,r){super(),this.Vp=i,this.HI=s,this.Wp=h,this.Yp=e,this.index=t,this.GI=n,r&&-1!==n.wl&&this.GI.delay?(this.ul=Math.random()*this.GI.dl|0,this.fl=Math.random()*this.GI.delay[this.ul]|0):(this.ul=-1,this.fl=0)}}},8412:(t,i,s)=>{s.d(i,{A:()=>o});var h=s(9418),e=s(8665),n=s(8738),r=s(1312);class o extends h.A{static Tu=2;static bu=4;static Lu=8;static Ru=16;static Fu=32;static Du=64;static Su=128;type=null;draw(t){if(!this.type)return null;if(-1===this.Nu||-1===this.$m)return this.Jg();const i=this.Jg();if(!i)return null;const s=n.A.Ro[this.Nu],h=e.A.qE(s.la(),!0,!s.Og,!1);h.translate(-this.Zm,0,0),h.Ma(),s.GI&&s.GI.frames&&h.ka(s.GI.frames[this.$m]),h.Kg=null,h.Xg=null,128===s.qg&&128===s.$g||h.scale(s.qg,s.$g,s.qg),h.xa(64+s.vg,850+s.Lg,-30,-50,-30,!0);const r=[i,h],o=e.A.Kv(r,2);return 1===this.type.size&&(o.sC=!0),o}isVisible(){return null!==this.type}Jg(){if(!this.type)return null;if(this.Ou>=0&&0===this.Xm){const t=r.A.Ro[this.Ou].frames;if(t){const i=t[this.Vm];let s=-1;if(this.CI>=0&&this.CI!==this.Sa){const t=r.A.Ro[this.CI].frames;t&&(s=t[this.QI])}return this.type.Jg(i,s,r.A.Ro[this.Ou].s_)}}let t=-1;if(this.CI>=0){const i=r.A.Ro[this.CI].frames;i&&(t=i[this.QI])}const i=this.type.Jg(t,-1,null);return i?(this.height=i.Zg,i):null}}},3606:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{index;count;constructor(t,i){super(),this.index=t,this.count=i}}},9418:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(7121),e=s(1312),n=s(3867);class r extends h.A{x=0;z=0;LI=0;RI=!1;size=1;Sa=-1;$I=-1;oI=-1;aI=-1;fI=-1;dI=-1;e_=-1;ou=null;uu=100;cu=0;fu=0;pu=0;yu=0;du=-1e3;wu=0;Au=0;vu=-1;zm=0;jm=0;CI=-1;QI=0;JI=0;Ou=-1;Vm=0;Km=0;Xm=0;Ym=0;Nu=-1;$m=0;Jm=0;qm=0;Zm=0;Qm=0;iI=0;tI=0;sI=0;mu=0;Iu=0;hI=0;Vf=0;height=0;qI=0;pathLength=0;wf=new Int32Array(10);Af=new Int32Array(10);h_=new n.ds(10,!1);ZI=0;Eu=-1;gu=-1;Mu=-1;ku=-1;move(t,i,s){if(-1!==this.Ou&&e.A.Ro[this.Ou].priority<=1&&(this.Ou=-1),!t){const t=i-this.wf[0],h=s-this.Af[0];if(t>=-8&&t<=8&&h>=-8&&h<=8){this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.wf[t]=this.wf[t-1],this.Af[t]=this.Af[t-1],this.h_[t]=this.h_[t-1];return this.wf[0]=i,this.Af[0]=s,void(this.h_[0]=!1)}}this.pathLength=0,this.ZI=0,this.wf[0]=i,this.Af[0]=s,this.x=128*this.wf[0]+64*this.size,this.z=128*this.Af[0]+64*this.size}step(t,i){let s=this.wf[0],h=this.Af[0];0===i?(s--,h++):1===i?h++:2===i?(s++,h++):3===i?s--:4===i?s++:5===i?(s--,h--):6===i?h--:7===i&&(s++,h--),-1!==this.Ou&&e.A.Ro[this.Ou].priority<=1&&(this.Ou=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.wf[t]=this.wf[t-1],this.Af[t]=this.Af[t-1],this.h_[t]=this.h_[t-1];this.wf[0]=s,this.Af[0]=h,this.h_[0]=t}}},8268:(t,i,s)=>{s.d(i,{A:()=>d});var h=s(9418),e=s(8665),n=s(2679),r=s(8738),o=s(1312),l=s(8317),a=s(1302),c=s(3819),f=s(3867),u=s(9298);class d extends h.A{static Cu=1;static Tu=2;static bu=4;static Lu=8;static Ru=16;static Su=32;static xu=64;static Hm=128;static Du=256;static Pu=512;static Ra=[u.A.Xv,u.A.zv,u.A.jv,u.A.Zv,u.A.qv,u.A.$v,u.A.Jv,u.A.Qv,u.A.tL,u.A.iL,u.A.sL,u.A.hL,u.A.eL,u.A.nL,u.A.rL,u.A.oL];static La=[[u.A.lL,u.A.aL,u.A.cL,u.A.fL,u.A.uL,u.A.dL,u.A.wL,u.A.AL,u.A.yL,u.A.pL,u.A.mL,u.A.IL],[u.A._L,u.A.EL,u.A.gL,u.A.CL,u.A.TL,u.A.OL,u.A.bL,u.A.vL,u.A.LL,u.A.RL,u.A.SL,u.A.ML,u.A.kL,u.A.xL,u.A.DL,u.A.NL],[u.A.NL-1,u.A._L+1,u.A.EL,u.A.gL,u.A.CL,u.A.TL,u.A.OL,u.A.bL,u.A.vL,u.A.LL,u.A.RL,u.A.SL,u.A.ML,u.A.kL,u.A.xL,u.A.DL],[u.A.PL,u.A.FL,u.A.UL,u.A.BL,u.A.GL,u.A.HL],[u.A.WL,u.A.YL,u.A.VL,u.A.KL,u.A.XL,u.A.zL,u.A.jL,u.A.ZL]];static So=new n.A(200);name=null;visible=!1;qL=0;ru=0;$L=new Uint16Array(12);JL=new Uint16Array(5);Ka=0;QL=0n;y=0;OI=0;bI=0;r_=0;l_=0;o_=0;TI=null;MI=0;kI=0;xI=0;DI=0;st=!1;draw(t){if(!this.visible)return null;let i=this.Jg();if(this.height=i.Zg,i.sC=!0,this.st)return i;if(-1!==this.Nu&&-1!==this.$m){const t=r.A.Ro[this.Nu],s=e.A.qE(t.la(),!0,!t.Og,!1);s.translate(-this.Zm,0,0),s.Ma(),t.GI&&t.GI.frames&&s.ka(t.GI.frames[this.$m]),s.Kg=null,s.Xg=null,128===t.qg&&128===t.$g||s.scale(t.qg,t.$g,t.qg),s.xa(t.vg+64,t.Lg+850,-30,-50,-30,!0);const h=[i,s];i=e.A.Kv(h,2)}if(this.TI&&(t>=this.bI&&(this.TI=null),t>=this.OI&&t=d.La[i].length)&&(s=0),this.JL[i]=s}this.Sa=t.KA,65535===this.Sa&&(this.Sa=-1),this.$I=t.KA,65535===this.$I&&(this.$I=-1),this.oI=t.KA,65535===this.oI&&(this.oI=-1),this.aI=t.KA,65535===this.aI&&(this.aI=-1),this.fI=t.KA,65535===this.fI&&(this.fI=-1),this.dI=t.KA,65535===this.dI&&(this.dI=-1),this.e_=t.KA,65535===this.e_&&(this.e_=-1),this.name=c.A.ga(c.A.Ca(t.Uc)),this.Ka=t.ZA,this.visible=!0,this.QL=0n;for(let t=0;t<12;t++)this.QL<<=0x4n,this.$L[t]>=256&&(this.QL+=BigInt(this.$L[t])-256n);this.$L[0]>=256&&(this.QL+=BigInt(this.$L[0])-256n>>4n),this.$L[1]>=256&&(this.QL+=BigInt(this.$L[1])-256n>>8n);for(let t=0;t<5;t++)this.QL<<=0x3n,this.QL+=BigInt(this.JL[t]);this.QL<<=0x1n,this.QL+=BigInt(this.qL)}ey(){if(!this.visible)return null;const t=new f.ds(12,null);let i=0;for(let s=0;s<12;s++){const h=this.$L[s];if(h>=256&&h<512&&(t[i++]=l.A.Ro[h-256].ey()),h>=512){const s=a.A.get(h-512).ey(this.qL);s&&(t[i++]=s)}}const s=e.A.ba(t,i);for(let t=0;t<5;t++)0!==this.JL[t]&&(s.va(d.La[t][0],d.La[t][this.JL[t]]),1===t&&s.va(d.Ra[0],d.Ra[this.JL[t]]));return s}Jg(){let t=this.QL,i=-1,s=-1,h=-1,n=-1;if(this.Ou>=0&&0===this.Xm){const e=o.A.Ro[this.Ou];if(e.frames&&(i=e.frames[this.Vm]),this.CI>=0&&this.CI!==this.Sa){const t=o.A.Ro[this.CI].frames;t&&(s=t[this.QI])}e.MC>=0&&(h=e.MC,t+=BigInt(h-this.$L[5])<<8n),e.kC>=0&&(n=e.kC,t+=BigInt(n-this.$L[3])<<16n)}else if(this.CI>=0){const t=o.A.Ro[this.CI].frames;t&&(i=t[this.QI])}let r=d.So?.get(t);if(!r){const i=new f.ds(12,null);let s=0;for(let t=0;t<12;t++){let e=this.$L[t];if(n>=0&&3===t&&(e=n),h>=0&&5===t&&(e=h),e>=256&&e<512){const t=l.A.Ro[e-256].la();t&&(i[s++]=t)}if(e>=512){const t=a.A.get(e-512).SC(this.qL);t&&(i[s++]=t)}}r=e.A.ba(i,s);for(let t=0;t<5;t++)0!==this.JL[t]&&(r.va(d.La[t][0],d.La[t][this.JL[t]]),1===t&&r.va(d.Ra[0],d.Ra[this.JL[t]]));r.Ma(),r.xa(64,850,-30,-50,-30,!0),d.So?.put(t,r)}if(this.st)return r;const c=e.A.Qg(r,!0);return-1!==i&&-1!==s?c.tC(i,s,o.A.Ro[this.Ou].s_):-1!==i&&c.ka(i),c.iC(),c.Kg=null,c.Xg=null,c}}},254:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(8738),e=s(7121),n=s(8665);class r extends e.A{tR;level;iR;sR;hR;offsetY;FI;NI;eR;arc;target;mobile=!1;x=0;z=0;y=0;velocityX=0;nR=0;rR=0;velocityY=0;oR=0;LI=0;pitch=0;ul=0;fl=0;constructor(t,i,s,e,n,r,o,l,a,c,f){super(),this.tR=h.A.Ro[t],this.level=i,this.iR=s,this.sR=n,this.hR=e,this.FI=r,this.NI=o,this.eR=l,this.arc=a,this.target=c,this.offsetY=f}UI(t,i,s,h){if(!this.mobile){const i=t-this.iR,h=s-this.sR,e=Math.sqrt(i*i+h*h);this.x=this.iR+i*this.arc/e,this.z=this.sR+h*this.arc/e,this.y=this.hR}const e=this.NI+1-h;this.velocityX=(t-this.x)/e,this.nR=(s-this.z)/e,this.rR=Math.sqrt(this.velocityX*this.velocityX+this.nR*this.nR),this.mobile||(this.velocityY=-this.rR*Math.tan(.02454369*this.eR)),this.oR=2*(i-this.y-this.velocityY*e)/(e*e)}update(t){if(this.mobile=!0,this.x+=this.velocityX*t,this.z+=this.nR*t,this.y+=this.velocityY*t+.5*this.oR*t*t,this.velocityY+=this.oR*t,this.LI=325.949*Math.atan2(this.velocityX,this.nR)+1024&2047,this.pitch=325.949*Math.atan2(this.velocityY,this.rR)&2047,this.tR.GI&&this.tR.GI.delay)for(this.fl+=t;this.fl>this.tR.GI.delay[this.ul];)this.fl-=this.tR.GI.delay[this.ul]+1,this.ul++,this.ul>=this.tR.GI.dl&&(this.ul=0)}draw(){const t=this.tR.la(),i=n.A.qE(t,!0,!this.tR.Og,!1);return this.tR.GI&&this.tR.GI.frames&&(i.Ma(),i.ka(this.tR.GI.frames[this.ul]),i.Kg=null,i.Xg=null),128===this.tR.qg&&128===this.tR.$g||i.scale(this.tR.qg,this.tR.$g,this.tR.qg),i.lR(this.pitch),i.xa(64+this.tR.vg,850+this.tR.Lg,-30,-50,-30,!0),i}}},7628:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(7121),e=s(8738),n=s(8665);class r extends h.A{type;level;x;z;y;FI;BI=!1;ul=0;fl=0;constructor(t,i,s,h,n,r,o){super(),this.type=e.A.Ro[t],this.level=i,this.x=s,this.z=h,this.y=n,this.FI=r+o}update(t){if(this.type.GI&&this.type.GI.delay)for(this.fl+=t;this.fl>this.type.GI.delay[this.ul];)this.fl-=this.type.GI.delay[this.ul]+1,this.ul++,this.ul>=this.type.GI.dl&&(this.ul=0,this.BI=!0)}draw(){const t=this.type.la(),i=n.A.qE(t,!0,!this.type.Og,!1);return!this.BI&&this.type.GI&&this.type.GI.frames&&(i.Ma(),i.ka(this.type.GI.frames[this.ul]),i.Kg=null,i.Xg=null),128===this.type.qg&&128===this.type.$g||i.scale(this.type.qg,this.type.$g,this.type.qg),0!==this.type.orientation&&(90===this.type.orientation?i.zg():180===this.type.orientation?(i.zg(),i.zg()):270===this.type.orientation&&(i.zg(),i.zg(),i.zg())),i.xa(64+this.type.vg,850+this.type.Lg,-30,-50,-30,!0),i}}},9222:(t,i,s)=>{s.d(i,{A:()=>h});class h{y;x;z;model;gb;info;constructor(t,i,s,h,e,n){this.y=t,this.x=i,this.z=s,this.model=h,this.gb=e,this.info=n}}},1161:(t,i,s)=>{s.d(i,{A:()=>h});class h{level;y;x;z;model;av;LI;Cb;Sb;Tb;Mb;gb;info;Iv=0;Vf=0;constructor(t,i,s,h,e,n,r,o,l,a,c,f,u){this.level=t,this.y=i,this.x=s,this.z=h,this.model=e,this.av=n,this.LI=r,this.Cb=o,this.Sb=l,this.Tb=a,this.Mb=c,this.gb=f,this.info=u}}},5327:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{hp;Nd;x;z;Kp;angle;shape;NI;constructor(t,i,s,h,e,n,r,o){super(),this.hp=t,this.Nd=i,this.x=s,this.z=h,this.Kp=e,this.angle=n,this.shape=r,this.NI=o}}},2630:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{hp;Nd;x;z;Kp;angle;shape;ep;np;rp;constructor(t,i,s,h,e,n,r,o,l,a){super(),this.hp=t,this.Nd=i,this.x=s,this.z=h,this.Kp=e,this.angle=n,this.shape=r,this.ep=o,this.np=l,this.rp=a}}},5748:(t,i,s)=>{s.d(i,{A:()=>h});class h{y;x;z;mv;pv;yv;gb;offset;constructor(t,i,s,h,e,n,r,o){this.y=t,this.x=i,this.z=s,this.mv=h,this.pv=e,this.yv=n,this.gb=r,this.offset=o}}},8256:(t,i,s)=>{s.d(i,{A:()=>h});class h{MI;xI;kI;DI;type;Nb;Pb;Fb;Ub;Db;Zg;mode=0;sv=0;hv=0;Jb=0;Qb=0;tv=0;iv=0;constructor(t,i,s,h,e,n,r,o,l,a,c){this.MI=t,this.xI=i,this.kI=s,this.DI=h,this.type=e,this.Nb=n,this.Pb=r,this.Fb=o,this.Ub=l,this.Db=a,this.Zg=c}}},3795:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(1982),e=s(3867);class n extends h.A{level;x;z;nv;Ab;qb;ab=null;fb=null;pb=null;mb=null;ub=null;yb=null;ob=null;wb=0;$b=0;lb=0;visible=!1;update=!1;zb=!1;jb=0;uv=0;dv=0;cv=0;constructor(t,i,s){super(),this.nv=this.level=t,this.x=i,this.z=s,this.Ab=new e.ds(5,null),this.qb=new Int32Array(5)}}},2771:(t,i,s)=>{s.d(i,{A:()=>h});class h{static Pv=new Int32Array(6);static Fv=new Int32Array(6);static xv=new Int32Array(6);static Dv=new Int32Array(6);static Nv=new Int32Array(6);static aR=[Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,2,6),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,13,14)];static cR=[Int8Array.of(0,1,2,3,0,0,1,3),Int8Array.of(1,1,2,3,1,0,1,3),Int8Array.of(0,1,2,3,1,0,1,3),Int8Array.of(0,0,1,2,0,0,2,4,1,0,4,3),Int8Array.of(0,0,1,4,0,0,4,3,1,1,2,4),Int8Array.of(0,0,4,3,1,0,1,2,1,0,2,4),Int8Array.of(0,1,2,4,1,0,1,4,1,0,4,3),Int8Array.of(0,4,1,2,0,4,2,5,1,0,4,5,1,0,5,3),Int8Array.of(0,4,1,2,0,4,2,3,0,4,3,5,1,0,4,5),Int8Array.of(0,0,4,5,1,4,1,2,1,4,2,3,1,4,3,5),Int8Array.of(0,0,1,5,0,1,4,5,0,1,2,4,1,0,5,3,1,5,4,3,1,4,2,3),Int8Array.of(1,0,1,5,1,1,4,5,1,1,2,4,0,0,5,3,0,5,4,3,0,4,2,3),Int8Array.of(1,0,5,4,1,0,1,5,0,0,4,3,0,4,5,3,0,5,2,3,0,1,2,5)];static fR=128;static uR=this.fR/2|0;static dR=this.fR/4|0;static wR=3*this.fR/4|0;Gg;Wg;Hg;Hv;Wv;Yv;Uv;Bv;Gv;kv;flat;shape;angle;Vb;Kb;constructor(t,i,s,e,n,r,o,l,a,c,f,u,d,w,A,y,p,m,I){this.flat=!(p!==e||p!==w||p!==l),this.shape=i,this.angle=r,this.Vb=d,this.Kb=a;const _=h.aR[i],E=_.length;this.Gg=new Int32Array(E),this.Wg=new Int32Array(E),this.Hg=new Int32Array(E);const g=new Int32Array(E),C=new Int32Array(E),T=t*h.fR,O=m*h.fR;for(let t=0;t8&&E<=12&&(E=9+(E-r-9&3)),E>12&&E<=16&&(E=13+(E-r-13&3)),1===E?(i=T,a=O,f=p,d=o,m=c):2===E?(i=T+h.uR,a=O,f=p+e>>1,d=o+I>>1,m=c+s>>1):3===E?(i=T+h.fR,a=O,f=e,d=I,m=s):4===E?(i=T+h.fR,a=O+h.uR,f=e+w>>1,d=I+n>>1,m=s+A>>1):5===E?(i=T+h.fR,a=O+h.fR,f=w,d=n,m=A):6===E?(i=T+h.uR,a=O+h.fR,f=w+l>>1,d=n+y>>1,m=A+u>>1):7===E?(i=T,a=O+h.fR,f=l,d=y,m=u):8===E?(i=T,a=O+h.uR,f=l+p>>1,d=y+o>>1,m=u+c>>1):9===E?(i=T+h.uR,a=O+h.dR,f=p+e>>1,d=o+I>>1,m=c+s>>1):10===E?(i=T+h.wR,a=O+h.uR,f=e+w>>1,d=I+n>>1,m=s+A>>1):11===E?(i=T+h.uR,a=O+h.wR,f=w+l>>1,d=n+y>>1,m=A+u>>1):12===E?(i=T+h.dR,a=O+h.uR,f=l+p>>1,d=y+o>>1,m=u+c>>1):13===E?(i=T+h.dR,a=O+h.dR,f=p,d=o,m=c):14===E?(i=T+h.wR,a=O+h.dR,f=e,d=I,m=s):15===E?(i=T+h.wR,a=O+h.wR,f=w,d=n,m=A):(i=T+h.dR,a=O+h.wR,f=l,d=y,m=u),this.Gg[t]=i,this.Wg[t]=f,this.Hg[t]=a,g[t]=d,C[t]=m}const b=h.cR[i],v=b.length/4|0;this.Uv=new Int32Array(v),this.Bv=new Int32Array(v),this.Gv=new Int32Array(v),this.Hv=new Int32Array(v),this.Wv=new Int32Array(v),this.Yv=new Int32Array(v),this.kv=-1!==f?new Int32Array(v):null;let L=0;for(let t=0;t{s.d(i,{A:()=>h});class h{static JT=0;static cb=1;static AR=2;static yR=3;static pR=4;static mR=5;static uR=6;static dR=7;static wR=8;static IR=9;static _R=10;static ER=11}},3479:(t,i,s)=>{s.d(i,{A:()=>h});class h{Mv;Lv;Ov;vv;Tv;color;flat;constructor(t,i,s,h,e,n,r){this.Mv=t,this.Lv=i,this.Ov=s,this.vv=h,this.Tv=e,this.color=n,this.flat=r}}},6855:(t,i,s)=>{s.d(i,{A:()=>h});class h{y;x;z;fv;Av;Ib;_b;gb;info;constructor(t,i,s,h,e,n,r,o,l){this.y=t,this.x=i,this.z=s,this.fv=h,this.Av=e,this.Ib=n,this._b=r,this.gb=o,this.info=l}}},7441:(t,i,s)=>{s.d(i,{A:()=>h});class h{y;x;z;type;angle;model;gb;info;constructor(t,i,s,h,e,n,r,o){this.y=t,this.x=i,this.z=s,this.type=h,this.angle=e,this.model=n,this.gb=r,this.info=o}}},7536:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e{gR;CR;constructor(t){this.CR=[],this.gR=t;for(let i=0;i{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{TR;OR;constructor(){super(),this.TR=this,this.OR=this}bR(){this.OR&&this.TR&&(this.OR.TR=this.TR,this.TR.OR=this.OR,this.TR=null,this.OR=null)}}},3819:(t,i,s)=>{s.d(i,{A:()=>h});class h{static vR=['_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9'];static ld=t=>{t=t.trim();let i=0n;for(let s=0;s=65&&h<=90?i+=BigInt(h+1-65):h>=97&&h<=122?i+=BigInt(h+1-97):h>=48&&h<=57&&(i+=BigInt(h+27-48))}return i};static Ca=t=>{if(t<0n||t>=6582952005840035281n)return'invalid_name';if(t%37n===0n)return'invalid_name';let i=0;const s=Array(12);for(;0n!==t;){const h=t;t/=37n,s[11-i++]=this.vR[Number(h-37n*t)]}return s.slice(12-i).join('')};static dA=t=>{const i=[...t.toLowerCase()];let s=!0;for(let t=0;t='a'&&h<='z'&&(i[t]=h.toUpperCase(),s=!1),'.'!==h&&'!'!==h||(s=!0)}return i.join('')};static Dc=t=>{let i='';for(let s=0;s(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static ga=t=>{if(0===t.length)return t;const i=[...t];for(let t=0;t='a'&&i[t+1]<='z'&&(i[t+1]=String.fromCharCode(i[t+1].charCodeAt(0)+'A'.charCodeAt(0)-97)));return i[0]>='a'&&i[0]<='z'&&(i[0]=String.fromCharCode(i[0].charCodeAt(0)+'A'.charCodeAt(0)-97)),i.join('')};static jE=t=>{const i=t.toUpperCase();let s=0n;for(let t=0;t>56n)&0xffffffffffffffn;return s}}},6666:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e{LR;cursor=null;constructor(){const t=new h.A;t.next=t,t.Im=t,this.LR=t}n_(t){t.Im&&t.sy(),t.Im=this.LR.Im,t.next=this.LR,t.Im&&(t.Im.next=t),t.next.Im=t}bA(t){t.Im&&t.sy(),t.Im=this.LR,t.next=this.LR.next,t.Im.next=t,t.next&&(t.next.Im=t)}ev(){const t=this.LR.next;return t===this.LR?null:(t?.sy(),t)}head(){const t=this.LR.next;return t===this.LR?(this.cursor=null,null):(this.cursor=t?.next||null,t)}pm(){const t=this.LR.Im;return t===this.LR?(this.cursor=null,null):(this.cursor=t?.Im||null,t)}next(){const t=this.cursor;return t===this.LR?(this.cursor=null,null):(this.cursor=t?.next||null,t)}Im(){const t=this.cursor;return t===this.LR?(this.cursor=null,null):(this.cursor=t?.Im||null,t)}clear(){for(;;){const t=this.LR.next;if(t===this.LR)return;t?.sy()}}}},1982:(t,i,s)=>{s.d(i,{A:()=>h});class h{key;next;Im;constructor(){this.key=0n,this.next=this,this.Im=this}sy(){this.Im&&this.next&&(this.Im.next=this.next,this.next.Im=this.Im,this.next=null,this.Im=null)}}},2679:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(2512),e=s(7536);class n{RR;SR;history;available;constructor(t){this.RR=t,this.available=t,this.SR=new e.A(1024),this.history=new h.A}get(t){const i=this.SR.get(t);return i&&this.history.push(i),i}put(t,i){if(0===this.available){const t=this.history.pop();t?.sy(),t?.bR()}else this.available--;this.SR.put(t,i),this.history.push(i)}clear(){const t=this.history.pop();t?(t.sy(),t.bR()):this.available=this.RR}}},2512:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(4474);class e{head;constructor(){this.head=new h.A}push(t){t.OR&&t.bR(),t.OR=this.head.OR,t.TR=this.head,t.OR&&(t.OR.TR=t),t.TR.OR=t}pop(){const t=this.head.TR;return t===this.head?null:(t?.bR(),t)}}},8534:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(1069),e=s(3867);class n{static Ro=[];static ec=t=>{const i=new h.A(t.read('base_head.dat')),s=new h.A(t.read('base_type.dat')),r=new h.A(t.read('base_label.dat')),o=i.KA;i.Fc+=2;for(let t=0;t{s.d(i,{A:()=>n});var h=s(8534),e=s(1069);class n{static Ro=[];static ec=t=>{const i=new e.A(t.read('frame_head.dat')),s=new e.A(t.read('frame_tran1.dat')),r=new e.A(t.read('frame_tran2.dat')),o=new e.A(t.read('frame_del.dat')),l=i.KA;i.Fc+=2;const a=new Int32Array(500),c=new Int32Array(500),f=new Int32Array(500),u=new Int32Array(500);for(let t=0;t0){if(0!==d.types[t])for(let i=t-1;i>A;i--)if(0===d.types[i]){a[y]=i,c[y]=0,f[y]=0,u[y]=0,y++;break}a[y]=t;let s=0;3===d.types[a[y]]&&(s=128),c[y]=1&i?r.kR:s,f[y]=2&i?r.kR:s,u[y]=4&i?r.kR:s,A=t,y++}}e.length=y,e.xR=new Int32Array(y),e.x=new Int32Array(y),e.y=new Int32Array(y),e.z=new Int32Array(y);for(let t=0;t{s.d(i,{N_:()=>h,jo:()=>e,DR:()=>o,NR:()=>r,PR:()=>n});const h=document.getElementById('canvas'),e=h.getContext('2d',{willReadFrequently:!0}),n=document.createElement('canvas'),r=document.createElement('img'),o=n.getContext('2d',{willReadFrequently:!0})},9298:(t,i,s)=>{s.d(i,{A:()=>h});class h{static RED=16711680;static GREEN=65280;static BLUE=255;static Gl=16776960;static bc=65535;static vc=16711935;static _l=16777215;static Bl=0;static FR=16748608;static sd=8388608;static td=128;static UR=16756736;static BR=16740352;static GR=16723968;static HR=12648192;static WR=8453888;static YR=4259584;static yc=9179409;static Dd=6116423;static il=2301979;static sl=5063219;static el=7759444;static rl=3353893;static hd=8388736;static ed=13350793;static Uu=Int32Array.of(h.Gl,h.RED,h.GREEN,h.bc,h.vc,h._l);static lL=6798;static aL=107;static cL=10283;static fL=16;static uL=4797;static dL=7744;static wL=5799;static AL=4634;static yL=33697;static pL=22433;static mL=2983;static IL=54193;static _L=8741;static EL=12;static gL=64030;static CL=43162;static TL=7735;static OL=8404;static bL=1701;static vL=38430;static LL=24094;static RL=10153;static SL=56621;static ML=4783;static kL=1341;static xL=16578;static DL=35003;static NL=25239;static Xv=9104;static zv=10275;static jv=7595;static Zv=3610;static qv=7975;static $v=8526;static Jv=918;static Qv=38802;static tL=24466;static iL=10145;static sL=58654;static hL=5027;static eL=1457;static nL=16565;static rL=34991;static oL=25486;static PL=4626;static FL=11146;static UL=6439;static BL=12;static GL=4758;static HL=10270;static ZL=4574;static WL=4550;static YL=4537;static VL=5681;static KL=5673;static XL=5790;static zL=6806;static jL=8076}},8950:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(4474);class e extends h.A{static nc=new Int32Array;static lC=0;static aC=0;static top=0;static bottom=0;static left=0;static right=0;static gv=0;static VR=0;static KR=0;static bind=(t,i,s)=>{this.nc=t,this.lC=i,this.aC=s,this.yl(0,0,i,s)};static Gu=()=>{this.left=0,this.top=0,this.right=this.lC,this.bottom=this.aC,this.gv=this.right-1,this.VR=this.right/2|0};static yl=(t,i,s,h)=>{t<0&&(t=0),i<0&&(i=0),s>this.lC&&(s=this.lC),h>this.aC&&(h=this.aC),this.top=i,this.bottom=h,this.left=t,this.right=s,this.gv=this.right-1,this.VR=this.right/2|0,this.KR=this.bottom/2|0};static clear=()=>{const t=this.lC*this.aC;for(let i=0;i{this.nl(t,i,e,s),this.nl(t,i+h-1,e,s),this.hl(t,i,e,h),this.hl(t+s-1,i,e,h)};static nl=(t,i,s,h)=>{if(i=this.bottom)return;tthis.right&&(h=this.right-t);const e=t+i*this.lC;for(let t=0;t{if(t=this.right)return;ithis.bottom&&(h=this.bottom-i);const e=t+i*this.lC;for(let t=0;t{const n=Math.abs(s-t),r=Math.abs(h-i),o=t=this.left&&t=this.top&&i-r&&(a-=r,t+=o),s{tthis.right&&(s=this.right-t),i+h>this.bottom&&(h=this.bottom-i);const n=this.lC-s;let r=t+i*this.lC;for(let t=-h;t<0;t++){for(let t=-s;t<0;t++)this.nc[r++]=e;r+=n}};static XR(t,i,s,h,e,n){tthis.right&&(s=this.right-t),i+h>this.bottom&&(h=this.bottom-i);const r=256-n,o=(e>>16&255)*n,l=(e>>8&255)*n,a=(255&e)*n,c=this.lC-s;let f=t+i*this.lC;for(let t=0;t>16&255)*r>>8<<16)+(l+(this.nc[f]>>8&255)*r>>8<<8)+(a+(255&this.nc[f])*r>>8);this.nc[f++]=t}f+=c}}static zR(t,i,s,h,e){const n=256-e,r=(h>>16&255)*e,o=(h>>8&255)*e,l=(255&h)*e;let a=i-s;a<0&&(a=0);let c=i+s;c>=this.aC&&(c=this.aC-1);for(let h=a;h<=c;h++){const e=h-i,a=0|Math.sqrt(s*s-e*e);let c=t-a;c<0&&(c=0);let f=t+a;f>=this.lC&&(f=this.lC-1);let u=c+h*this.lC;for(let t=c;t<=f;t++){const t=(r+(this.nc[u]>>16&255)*n>>8<<16)+(o+(this.nc[u]>>8&255)*n>>8<<8)+(l+(255&this.nc[u])*n>>8);this.nc[u++]=t}}}static jR=(t,i,s)=>{t=this.right||i=this.bottom||(this.nc[t+i*this.lC]=s)}}},4583:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(8950),e=s(1673),n=s(3867);class r extends h.A{static st=!1;static ZR=new Int32Array(512);static qR=new Int32Array(2048);static sin=new Int32Array(2048);static cos=new Int32Array(2048);static palette=new Int32Array(65536);static c_=new n.ds(50,null);static $R=0;static oc=new Int32Array;static na=0;static ra=0;static cC=!0;static Ev=!1;static alpha=0;static JR=null;static QR=new n.ds(50,null);static tS=0;static Vf=0;static a_=new Int32Array(50);static iS=new n.ds(50,null);static sS=!1;static hS=new n.ds(50,!1);static eS=new Int32Array(50);static{for(let t=1;t<512;t++)this.ZR[t]=32768/t|0;for(let t=1;t<2048;t++)this.qR[t]=65536/t|0;for(let t=0;t<2048;t++)this.sin[t]=65536*Math.sin(.0030679615757712823*t)|0,this.cos[t]=65536*Math.cos(.0030679615757712823*t)|0}static bo=()=>{this.ZR=null,this.ZR=null,this.sin=null,this.cos=null,this.oc=null,this.c_=null,this.hS=null,this.eS=null,this.JR=null,this.QR=null,this.a_=null,this.palette=null,this.iS=null,console.log('Draw3D unloaded!')};static P_=()=>{this.oc=new Int32Array(this.aC);for(let t=0;t{this.oc=new Int32Array(i);for(let s=0;s{this.JR=null,this.QR.fill(null)};static ic=t=>{this.$R=0;for(let i=0;i<50;i++)try{this.c_[i]=e.A.za(t,i.toString()),this.st&&128===this.c_[i]?.Pl?this.c_[i]?.nS():this.c_[i]?.AC(),this.$R++}catch(t){}};static tO=t=>{if(0!==this.eS[t])return this.eS[t];const i=this.iS[t];if(!i)return 0;let s=0,h=0,e=0;const n=i.length;for(let t=0;t>16&255,h+=i[t]>>8&255,e+=255&i[t];let r=(s/n<<16)+(h/n<<8)+(e/n|0);return r=this.rS(r,1.4),0===r&&(r=1),this.eS[t]=r,r};static sc=t=>{const i=t+.03*Math.random()-.015;let s=0;for(let t=0;t<512;t++){const h=(t/8|0)/64+.0078125,e=(7&t)/8+.0625;for(let t=0;t<128;t++){const n=t/128;let r=n,o=n,l=n;if(0!==e){let t;t=n<.5?n*(e+1):n+e-n*e;const i=2*n-t;let s=h+.3333333333333333;s>1&&s--;let a=h-.3333333333333333;a<0&&a++,r=6*s<1?i+6*(t-i)*s:2*s<1?t:3*s<2?i+(t-i)*(.6666666666666666-s)*6:i,o=6*h<1?i+6*(t-i)*h:2*h<1?t:3*h<2?i+(t-i)*(.6666666666666666-h)*6:i,l=6*a<1?i+6*(t-i)*a:2*a<1?t:3*a<2?i+(t-i)*(.6666666666666666-a)*6:i}const a=((256*r|0)<<16)+((256*o|0)<<8)+(256*l|0);this.palette[s++]=this.rS(a,i)}}for(let t=0;t<50;t++){const s=this.c_[t];if(!s)continue;const h=s.palette;this.iS[t]=new Int32Array(h.length);for(let s=0;s{const s=(t>>16)/256,h=(t>>8&255)/256,e=(255&t)/256;return((256*Math.pow(s,i)|0)<<16)+((256*Math.pow(h,i)|0)<<8)+(256*Math.pow(e,i)|0)};static hc=t=>{this.JR||(this.tS=t,this.st?this.JR=new n.Kn(t,16384):this.JR=new n.Kn(t,65536),this.QR.fill(null))};static bv=(t,i,s,h,e,n,r,o,l)=>{let a=0,c=0;e!==h&&(a=(i-t<<16)/(e-h)|0,c=(o-r<<15)/(e-h)|0);let f=0,u=0;n!==e&&(f=(s-i<<16)/(n-e)|0,u=(l-o<<15)/(n-e)|0);let d=0,w=0;if(n!==h&&(d=(t-s<<16)/(h-n)|0,w=(r-l<<15)/(h-n)|0),h<=e&&h<=n){if(hthis.bottom&&(e=this.bottom),n>this.bottom&&(n=this.bottom),ef)for(n-=e,e-=h,h=this.oc[h];;){if(--e<0)for(;;){if(--n<0)return;this.oS(s>>16,i>>16,l>>7,o>>7,this.nc,h,0),s+=d,i+=f,l+=w,o+=u,h+=this.lC}this.oS(s>>16,t>>16,l>>7,r>>7,this.nc,h,0),s+=d,t+=a,l+=w,r+=c,h+=this.lC}else for(n-=e,e-=h,h=this.oc[h];;){if(--e<0)for(;;){if(--n<0)return;this.oS(i>>16,s>>16,o>>7,l>>7,this.nc,h,0),s+=d,i+=f,l+=w,o+=u,h+=this.lC}this.oS(t>>16,s>>16,r>>7,l>>7,this.nc,h,0),s+=d,t+=a,l+=w,r+=c,h+=this.lC}else if(i=t<<=16,o=r<<=15,h<0&&(i-=d*h,t-=a*h,o-=w*h,r-=c*h,h=0),s<<=16,l<<=15,n<0&&(s-=f*n,l-=u*n,n=0),h!==n&&da)for(e-=n,n-=h,h=this.oc[h];;){if(--n<0)for(;;){if(--e<0)return;this.oS(s>>16,t>>16,l>>7,r>>7,this.nc,h,0),s+=f,t+=a,l+=u,r+=c,h+=this.lC}this.oS(i>>16,t>>16,o>>7,r>>7,this.nc,h,0),i+=d,t+=a,o+=w,r+=c,h+=this.lC}else for(e-=n,n-=h,h=this.oc[h];;){if(--n<0)for(;;){if(--e<0)return;this.oS(t>>16,s>>16,r>>7,l>>7,this.nc,h,0),s+=f,t+=a,l+=u,r+=c,h+=this.lC}this.oS(t>>16,i>>16,r>>7,o>>7,this.nc,h,0),i+=d,t+=a,o+=w,r+=c,h+=this.lC}}else if(e<=n){if(ethis.bottom&&(n=this.bottom),h>this.bottom&&(h=this.bottom),nd)for(h-=n,n-=e,e=this.oc[e];;){if(--n<0)for(;;){if(--h<0)return;this.oS(t>>16,s>>16,r>>7,l>>7,this.nc,e,0),t+=a,s+=d,r+=c,l+=w,e+=this.lC}this.oS(t>>16,i>>16,r>>7,o>>7,this.nc,e,0),t+=a,i+=f,r+=c,o+=u,e+=this.lC}else for(h-=n,n-=e,e=this.oc[e];;){if(--n<0)for(;;){if(--h<0)return;this.oS(s>>16,t>>16,l>>7,r>>7,this.nc,e,0),t+=a,s+=d,r+=c,l+=w,e+=this.lC}this.oS(i>>16,t>>16,o>>7,r>>7,this.nc,e,0),t+=a,i+=f,r+=c,o+=u,e+=this.lC}else if(s=i<<=16,l=o<<=15,e<0&&(s-=a*e,i-=f*e,l-=c*e,o-=u*e,e=0),t<<=16,r<<=15,h<0&&(t-=d*h,r-=w*h,h=0),n-=h,h-=e,e=this.oc[e],a>16,i>>16,r>>7,o>>7,this.nc,e,0),t+=d,i+=f,r+=w,o+=u,e+=this.lC}this.oS(s>>16,i>>16,l>>7,o>>7,this.nc,e,0),s+=a,i+=f,l+=c,o+=u,e+=this.lC}else for(;;){if(--h<0)for(;;){if(--n<0)return;this.oS(i>>16,t>>16,o>>7,r>>7,this.nc,e,0),t+=d,i+=f,r+=w,o+=u,e+=this.lC}this.oS(i>>16,s>>16,o>>7,l>>7,this.nc,e,0),s+=a,i+=f,l+=c,o+=u,e+=this.lC}}else if(nthis.bottom&&(h=this.bottom),e>this.bottom&&(e=this.bottom),h>16,t>>16,o>>7,r>>7,this.nc,n,0),i+=f,t+=a,o+=u,r+=c,n+=this.lC}this.oS(i>>16,s>>16,o>>7,l>>7,this.nc,n,0),i+=f,s+=d,o+=u,l+=w,n+=this.lC}else for(;;){if(--h<0)for(;;){if(--e<0)return;this.oS(t>>16,i>>16,r>>7,o>>7,this.nc,n,0),i+=f,t+=a,o+=u,r+=c,n+=this.lC}this.oS(s>>16,i>>16,l>>7,o>>7,this.nc,n,0),i+=f,s+=d,o+=u,l+=w,n+=this.lC}else if(t=s<<=16,r=l<<=15,n<0&&(t-=f*n,s-=d*n,r-=u*n,l-=w*n,n=0),i<<=16,o<<=15,e<0&&(i-=a*e,o-=c*e,e=0),h-=e,e-=n,n=this.oc[n],f>16,s>>16,o>>7,l>>7,this.nc,n,0),i+=a,s+=d,o+=c,l+=w,n+=this.lC}this.oS(t>>16,s>>16,r>>7,l>>7,this.nc,n,0),t+=f,s+=d,r+=u,l+=w,n+=this.lC}else for(;;){if(--e<0)for(;;){if(--h<0)return;this.oS(s>>16,i>>16,l>>7,o>>7,this.nc,n,0),i+=a,s+=d,o+=c,l+=w,n+=this.lC}this.oS(s>>16,t>>16,l>>7,r>>7,this.nc,n,0),t+=f,s+=d,r+=u,l+=w,n+=this.lC}};static oS=(t,i,s,h,e,n,r)=>{let o;if(this.cC){let l;if(this.Ev){if(l=i-t>3?(h-s)/(i-t)|0:0,i>this.gv&&(i=this.gv),t<0&&(s-=t*l,t=0),t>=i)return;n+=t,r=i-t>>2,l<<=2}else{if(!(t>2)>0?(h-s)*this.ZR[r]>>15:0}if(0===this.alpha)for(;;){if(--r<0){if((r=i-t&3)>0){o=this.palette[s>>8];do{e[n++]=o,r--}while(r>0);return}break}o=this.palette[s>>8],s+=l,e[n++]=o,e[n++]=o,e[n++]=o,e[n++]=o}else{const h=this.alpha,a=256-this.alpha;for(;;){if(--r<0){if((r=i-t&3)>0){o=this.palette[s>>8],o=((16711935&o)*a>>8&16711935)+((65280&o)*a>>8&65280);do{e[n++]=o+((16711935&e[n])*h>>8&16711935)+((65280&e[n])*h>>8&65280),r--}while(r>0)}break}o=this.palette[s>>8],s+=l,o=((16711935&o)*a>>8&16711935)+((65280&o)*a>>8&65280),e[n++]=o+((16711935&e[n])*h>>8&16711935)+((65280&e[n])*h>>8&65280),e[n++]=o+((16711935&e[n])*h>>8&16711935)+((65280&e[n])*h>>8&65280),e[n++]=o+((16711935&e[n])*h>>8&16711935)+((65280&e[n])*h>>8&65280),e[n++]=o+((16711935&e[n])*h>>8&16711935)+((65280&e[n])*h>>8&65280)}}}else if(tthis.gv&&(i=this.gv),t<0&&(s-=t*l,t=0),t>=i))return;if(n+=t,r=i-t,0===this.alpha)do{e[n++]=this.palette[s>>8],s+=l,r--}while(r>0);else{const t=this.alpha,i=256-this.alpha;do{o=this.palette[s>>8],s+=l,o=((16711935&o)*i>>8&16711935)+((65280&o)*i>>8&65280),e[n++]=o+((16711935&e[n])*t>>8&16711935)+((65280&e[n])*t>>8&65280),r--}while(r>0)}}};static lS=(t,i,s,h,e,n,r)=>{let o=0;e!==h&&(o=(i-t<<16)/(e-h)|0);let l=0;n!==e&&(l=(s-i<<16)/(n-e)|0);let a=0;if(n!==h&&(a=(t-s<<16)/(h-n)|0),h<=e&&h<=n){if(hthis.bottom&&(e=this.bottom),n>this.bottom&&(n=this.bottom),el)for(n-=e,e-=h,h=this.oc[h];;){if(--e<0)for(;;){if(--n<0)return;this.aS(s>>16,i>>16,this.nc,h,r),s+=a,i+=l,h+=this.lC}this.aS(s>>16,t>>16,this.nc,h,r),s+=a,t+=o,h+=this.lC}else for(n-=e,e-=h,h=this.oc[h];;){if(--e<0)for(;;){if(--n<0)return;this.aS(i>>16,s>>16,this.nc,h,r),s+=a,i+=l,h+=this.lC}this.aS(t>>16,s>>16,this.nc,h,r),s+=a,t+=o,h+=this.lC}else if(i=t<<=16,h<0&&(i-=a*h,t-=o*h,h=0),s<<=16,n<0&&(s-=l*n,n=0),h!==n&&ao)for(e-=n,n-=h,h=this.oc[h];;){if(--n<0)for(;;){if(--e<0)return;this.aS(s>>16,t>>16,this.nc,h,r),s+=l,t+=o,h+=this.lC}this.aS(i>>16,t>>16,this.nc,h,r),i+=a,t+=o,h+=this.lC}else for(e-=n,n-=h,h=this.oc[h];;){if(--n<0)for(;;){if(--e<0)return;this.aS(t>>16,s>>16,this.nc,h,r),s+=l,t+=o,h+=this.lC}this.aS(t>>16,i>>16,this.nc,h,r),i+=a,t+=o,h+=this.lC}}else if(e<=n){if(ethis.bottom&&(n=this.bottom),h>this.bottom&&(h=this.bottom),na)for(h-=n,n-=e,e=this.oc[e];;){if(--n<0)for(;;){if(--h<0)return;this.aS(t>>16,s>>16,this.nc,e,r),t+=o,s+=a,e+=this.lC}this.aS(t>>16,i>>16,this.nc,e,r),t+=o,i+=l,e+=this.lC}else for(h-=n,n-=e,e=this.oc[e];;){if(--n<0)for(;;){if(--h<0)return;this.aS(s>>16,t>>16,this.nc,e,r),t+=o,s+=a,e+=this.lC}this.aS(i>>16,t>>16,this.nc,e,r),t+=o,i+=l,e+=this.lC}else if(s=i<<=16,e<0&&(s-=o*e,i-=l*e,e=0),t<<=16,h<0&&(t-=a*h,h=0),o>16,i>>16,this.nc,e,r),t+=a,i+=l,e+=this.lC}this.aS(s>>16,i>>16,this.nc,e,r),s+=o,i+=l,e+=this.lC}else for(n-=h,h-=e,e=this.oc[e];;){if(--h<0)for(;;){if(--n<0)return;this.aS(i>>16,t>>16,this.nc,e,r),t+=a,i+=l,e+=this.lC}this.aS(i>>16,s>>16,this.nc,e,r),s+=o,i+=l,e+=this.lC}}else if(nthis.bottom&&(h=this.bottom),e>this.bottom&&(e=this.bottom),h>16,t>>16,this.nc,n,r),i+=l,t+=o,n+=this.lC}this.aS(i>>16,s>>16,this.nc,n,r),i+=l,s+=a,n+=this.lC}else for(e-=h,h-=n,n=this.oc[n];;){if(--h<0)for(;;){if(--e<0)return;this.aS(t>>16,i>>16,this.nc,n,r),i+=l,t+=o,n+=this.lC}this.aS(s>>16,i>>16,this.nc,n,r),i+=l,s+=a,n+=this.lC}else if(t=s<<=16,n<0&&(t-=l*n,s-=a*n,n=0),i<<=16,e<0&&(i-=o*e,e=0),l>16,s>>16,this.nc,n,r),i+=o,s+=a,n+=this.lC}this.aS(t>>16,s>>16,this.nc,n,r),t+=l,s+=a,n+=this.lC}else for(h-=e,e-=n,n=this.oc[n];;){if(--e<0)for(;;){if(--h<0)return;this.aS(s>>16,i>>16,this.nc,n,r),i+=o,s+=a,n+=this.lC}this.aS(s>>16,t>>16,this.nc,n,r),t+=l,s+=a,n+=this.lC}};static Sv=(t,i,s,h,e,n,r,o,l,a,c,f,u,d,w,A,y,p,m)=>{const I=this.cS(m);this.sS=!this.hS[m];const _=a-u,E=c-w,g=f-y,C=d-a,T=A-c,O=p-f;let b=C*c-T*a<<14;const v=T*f-O*c<<8,L=O*a-C*f<<5;let R=_*c-E*a<<14;const S=E*f-g*c<<8,M=g*a-_*f<<5;let k=E*C-_*T<<14;const x=g*T-E*O<<8,D=_*O-g*C<<5;let N=0,P=0;e!==h&&(N=(i-t<<16)/(e-h)|0,P=(o-r<<16)/(e-h)|0);let F=0,U=0;n!==e&&(F=(s-i<<16)/(n-e)|0,U=(l-o<<16)/(n-e)|0);let B=0,G=0;if(n!==h&&(B=(t-s<<16)/(h-n)|0,G=(r-l<<16)/(h-n)|0),h<=e&&h<=n){if(hthis.bottom&&(e=this.bottom),n>this.bottom&&(n=this.bottom),eF)for(n-=e,e-=h,h=this.oc[h];;){if(--e<0)for(;;){if(--n<0)return;this.fS(s>>16,i>>16,this.nc,h,I,0,0,b,R,k,v,S,x,l>>8,o>>8),s+=B,i+=F,l+=G,o+=U,h+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(s>>16,t>>16,this.nc,h,I,0,0,b,R,k,v,S,x,l>>8,r>>8),s+=B,t+=N,l+=G,r+=P,h+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}else for(n-=e,e-=h,h=this.oc[h];;){if(--e<0)for(;;){if(--n<0)return;this.fS(i>>16,s>>16,this.nc,h,I,0,0,b,R,k,v,S,x,o>>8,l>>8),s+=B,i+=F,l+=G,o+=U,h+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(t>>16,s>>16,this.nc,h,I,0,0,b,R,k,v,S,x,r>>8,l>>8),s+=B,t+=N,l+=G,r+=P,h+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}}else{i=t<<=16,o=r<<=16,h<0&&(i-=B*h,t-=N*h,o-=G*h,r-=P*h,h=0),s<<=16,l<<=16,n<0&&(s-=F*n,l-=U*n,n=0);const a=h-this.ra;if(b+=L*a,R+=M*a,k+=D*a,b|=0,R|=0,k|=0,(h===n||B>=N)&&(h!==n||F<=N))for(e-=n,n-=h,h=this.oc[h];;){if(--n<0)for(;;){if(--e<0)return;this.fS(t>>16,s>>16,this.nc,h,I,0,0,b,R,k,v,S,x,r>>8,l>>8),s+=F,t+=N,l+=U,r+=P,h+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(t>>16,i>>16,this.nc,h,I,0,0,b,R,k,v,S,x,r>>8,o>>8),i+=B,t+=N,o+=G,r+=P,h+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}else for(e-=n,n-=h,h=this.oc[h];;){if(--n<0)for(;;){if(--e<0)return;this.fS(s>>16,t>>16,this.nc,h,I,0,0,b,R,k,v,S,x,l>>8,r>>8),s+=F,t+=N,l+=U,r+=P,h+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(i>>16,t>>16,this.nc,h,I,0,0,b,R,k,v,S,x,o>>8,r>>8),i+=B,t+=N,o+=G,r+=P,h+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}}}else if(e<=n){if(ethis.bottom&&(n=this.bottom),h>this.bottom&&(h=this.bottom),nB)for(h-=n,n-=e,e=this.oc[e];;){if(--n<0)for(;;){if(--h<0)return;this.fS(t>>16,s>>16,this.nc,e,I,0,0,b,R,k,v,S,x,r>>8,l>>8),t+=N,s+=B,r+=P,l+=G,e+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(t>>16,i>>16,this.nc,e,I,0,0,b,R,k,v,S,x,r>>8,o>>8),t+=N,i+=F,r+=P,o+=U,e+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}else for(h-=n,n-=e,e=this.oc[e];;){if(--n<0)for(;;){if(--h<0)return;this.fS(s>>16,t>>16,this.nc,e,I,0,0,b,R,k,v,S,x,l>>8,r>>8),t+=N,s+=B,r+=P,l+=G,e+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(i>>16,t>>16,this.nc,e,I,0,0,b,R,k,v,S,x,o>>8,r>>8),t+=N,i+=F,r+=P,o+=U,e+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}}else{s=i<<=16,l=o<<=16,e<0&&(s-=N*e,i-=F*e,l-=P*e,o-=U*e,e=0),t<<=16,r<<=16,h<0&&(t-=B*h,r-=G*h,h=0);const a=e-this.ra;if(b+=L*a,R+=M*a,k+=D*a,b|=0,R|=0,k|=0,n-=h,h-=e,e=this.oc[e],N>16,i>>16,this.nc,e,I,0,0,b,R,k,v,S,x,r>>8,o>>8),t+=B,i+=F,r+=G,o+=U,e+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(s>>16,i>>16,this.nc,e,I,0,0,b,R,k,v,S,x,l>>8,o>>8),s+=N,i+=F,l+=P,o+=U,e+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}else for(;;){if(--h<0)for(;;){if(--n<0)return;this.fS(i>>16,t>>16,this.nc,e,I,0,0,b,R,k,v,S,x,o>>8,r>>8),t+=B,i+=F,r+=G,o+=U,e+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(i>>16,s>>16,this.nc,e,I,0,0,b,R,k,v,S,x,o>>8,l>>8),s+=N,i+=F,l+=P,o+=U,e+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}}}else if(nthis.bottom&&(h=this.bottom),e>this.bottom&&(e=this.bottom),h>16,t>>16,this.nc,n,I,0,0,b,R,k,v,S,x,o>>8,r>>8),i+=F,t+=N,o+=U,r+=P,n+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(i>>16,s>>16,this.nc,n,I,0,0,b,R,k,v,S,x,o>>8,l>>8),i+=F,s+=B,o+=U,l+=G,n+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}else for(;;){if(--h<0)for(;;){if(--e<0)return;this.fS(t>>16,i>>16,this.nc,n,I,0,0,b,R,k,v,S,x,r>>8,o>>8),i+=F,t+=N,o+=U,r+=P,n+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(s>>16,i>>16,this.nc,n,I,0,0,b,R,k,v,S,x,l>>8,o>>8),i+=F,s+=B,o+=U,l+=G,n+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}}else{t=s<<=16,r=l<<=16,n<0&&(t-=F*n,s-=B*n,r-=U*n,l-=G*n,n=0),i<<=16,o<<=16,e<0&&(i-=N*e,o-=P*e,e=0);const a=n-this.ra;if(b+=L*a,R+=M*a,k+=D*a,b|=0,R|=0,k|=0,h-=e,e-=n,n=this.oc[n],F>16,s>>16,this.nc,n,I,0,0,b,R,k,v,S,x,o>>8,l>>8),i+=N,s+=B,o+=P,l+=G,n+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(t>>16,s>>16,this.nc,n,I,0,0,b,R,k,v,S,x,r>>8,l>>8),t+=F,s+=B,r+=U,l+=G,n+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}else for(;;){if(--e<0)for(;;){if(--h<0)return;this.fS(s>>16,i>>16,this.nc,n,I,0,0,b,R,k,v,S,x,l>>8,o>>8),i+=N,s+=B,o+=P,l+=G,n+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(s>>16,t>>16,this.nc,n,I,0,0,b,R,k,v,S,x,l>>8,r>>8),t+=F,s+=B,r+=U,l+=G,n+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}}};static fS=(t,i,s,h,e,n,r,o,l,a,c,f,u,d,w)=>{if(t>=i)return;let A,y,p,m,I,_,E,g,C;if(this.Ev){if(A=(w-d)/(i-t)|0,i>this.gv&&(i=this.gv),t<0&&(d-=t*A,t=0),t>=i)return;y=i-t>>3,A<<=12}else i-t>7?(y=i-t>>3,A=(w-d)*this.ZR[y]>>6):(y=0,A=0);if(d<<=9,h+=t,this.st&&e)if(p=0,m=0,_=t-this.na,o+=(c>>3)*_,l+=(f>>3)*_,a+=(u>>3)*_,o|=0,l|=0,I=(a|=0)>>12,0!==I&&(r=l/I|0,(n=o/I|0)<0?n=0:n>4032&&(n=4032)),o+=c,l+=f,a+=u,o|=0,l|=0,I=(a|=0)>>12,0!==I&&(p=o/I|0,m=l/I|0,p<7?p=7:p>4032&&(p=4032)),E=p-n>>3,g=m-r>>3,n+=d>>3&786432,C=d>>23,this.sS){for(;y-- >0;)s[h++]=e[(4032&r)+(n>>6)]>>>C,n+=E,r+=g,s[h++]=e[(4032&r)+(n>>6)]>>>C,n+=E,r+=g,s[h++]=e[(4032&r)+(n>>6)]>>>C,n+=E,r+=g,s[h++]=e[(4032&r)+(n>>6)]>>>C,n+=E,r+=g,s[h++]=e[(4032&r)+(n>>6)]>>>C,n+=E,r+=g,s[h++]=e[(4032&r)+(n>>6)]>>>C,n+=E,r+=g,s[h++]=e[(4032&r)+(n>>6)]>>>C,n+=E,r+=g,s[h++]=e[(4032&r)+(n>>6)]>>>C,n=p,r=m,o+=c,l+=f,I=(a+=u)>>12,0!==I&&(p=o/I|0,m=l/I|0,p<7?p=7:p>4032&&(p=4032)),E=p-n>>3,g=m-r>>3,n+=(d+=A)>>3&786432,C=d>>23;for(y=i-t&7;y-- >0;)s[h++]=e[(4032&r)+(n>>6)]>>>C,n+=E,r+=g}else{for(;y-- >0;){let t;0!=(t=e[(4032&r)+(n>>6)]>>>C)&&(s[h]=t),h+=1,0!=(t=e[(4032&(r+=g))+((n+=E)>>6)]>>>C)&&(s[h]=t),h++,0!=(t=e[(4032&(r+=g))+((n+=E)>>6)]>>>C)&&(s[h]=t),h++,0!=(t=e[(4032&(r+=g))+((n+=E)>>6)]>>>C)&&(s[h]=t),h++,0!=(t=e[(4032&(r+=g))+((n+=E)>>6)]>>>C)&&(s[h]=t),h++,0!=(t=e[(4032&(r+=g))+((n+=E)>>6)]>>>C)&&(s[h]=t),h++,0!=(t=e[(4032&(r+=g))+((n+=E)>>6)]>>>C)&&(s[h]=t),h++,0!=(t=e[(4032&(r+=g))+((n+=E)>>6)]>>>C)&&(s[h]=t),h+=1,n=p,r=m,o+=c,l+=f,a+=u,o|=0,l|=0,I=(a|=0)>>12,0!==I&&(p=o/I|0,m=l/I|0,p<7?p=7:p>4032&&(p=4032)),E=p-n>>3,g=m-r>>3,n+=(d+=A)>>3&786432,C=d>>23}for(y=i-t&7;y-- >0;){let t;0!=(t=e[(4032&r)+(n>>6)]>>>C)&&(s[h]=t),h++,n+=E,r+=g}}else if(p=0,m=0,_=t-this.na,o+=(c>>3)*_,l+=(f>>3)*_,a+=(u>>3)*_,o|=0,l|=0,I=(a|=0)>>14,0!==I&&(r=l/I|0,(n=o/I|0)<0?n=0:n>16256&&(n=16256)),o+=c,l+=f,a+=u,o|=0,l|=0,I=(a|=0)>>14,0!==I&&(p=o/I|0,m=l/I|0,p<7?p=7:p>16256&&(p=16256)),E=p-n>>3,g=m-r>>3,n+=6291456&d,C=d>>23,this.sS&&e){for(;y-- >0;)s[h++]=e[(16256&r)+(n>>7)]>>>C,n+=E,r+=g,s[h++]=e[(16256&r)+(n>>7)]>>>C,n+=E,r+=g,s[h++]=e[(16256&r)+(n>>7)]>>>C,n+=E,r+=g,s[h++]=e[(16256&r)+(n>>7)]>>>C,n+=E,r+=g,s[h++]=e[(16256&r)+(n>>7)]>>>C,n+=E,r+=g,s[h++]=e[(16256&r)+(n>>7)]>>>C,n+=E,r+=g,s[h++]=e[(16256&r)+(n>>7)]>>>C,n+=E,r+=g,s[h++]=e[(16256&r)+(n>>7)]>>>C,n=p,r=m,o+=c,l+=f,a+=u,o|=0,l|=0,I=(a|=0)>>14,0!==I&&(p=o/I|0,m=l/I|0,p<7?p=7:p>16256&&(p=16256)),E=p-n>>3,g=m-r>>3,n+=6291456&(d+=A),C=d>>23;for(y=i-t&7;y-- >0;)s[h++]=e[(16256&r)+(n>>7)]>>>C,n+=E,r+=g}else{for(;y-- >0&&e;){let t;0!=(t=e[(16256&r)+(n>>7)]>>>C)&&(s[h]=t),h+=1,0!=(t=e[(16256&(r+=g))+((n+=E)>>7)]>>>C)&&(s[h]=t),h++,0!=(t=e[(16256&(r+=g))+((n+=E)>>7)]>>>C)&&(s[h]=t),h++,0!=(t=e[(16256&(r+=g))+((n+=E)>>7)]>>>C)&&(s[h]=t),h++,0!=(t=e[(16256&(r+=g))+((n+=E)>>7)]>>>C)&&(s[h]=t),h++,0!=(t=e[(16256&(r+=g))+((n+=E)>>7)]>>>C)&&(s[h]=t),h++,0!=(t=e[(16256&(r+=g))+((n+=E)>>7)]>>>C)&&(s[h]=t),h++,0!=(t=e[(16256&(r+=g))+((n+=E)>>7)]>>>C)&&(s[h]=t),h++,n=p,r=m,o+=c,l+=f,a+=u,o|=0,l|=0,I=(a|=0)>>14,0!==I&&(p=o/I|0,m=l/I|0,p<7?p=7:p>16256&&(p=16256)),E=p-n>>3,g=m-r>>3,n+=6291456&(d+=A),C=d>>23}for(y=i-t&7;y-- >0&&e;){let t;0!=(t=e[(16256&r)+(n>>7)]>>>C)&&(s[h]=t),h++,n+=E,r+=g}}};static aS=(t,i,s,h,e)=>{if(this.Ev&&(i>this.gv&&(i=this.gv),t<0&&(t=0)),t>=i)return;h+=t;let n=i-t>>2;if(0===this.alpha)for(;;){if(n--,n<0)for(n=i-t&3;;){if(n--,n<0)return;s[h++]=e}s[h++]=e,s[h++]=e,s[h++]=e,s[h++]=e}const r=this.alpha,o=256-this.alpha;for(e=((16711935&e)*o>>8&16711935)+((65280&e)*o>>8&65280);;){if(n--,n<0)for(n=i-t&3;;){if(n--,n<0)return;s[h++]=e+((16711935&s[h])*r>>8&16711935)+((65280&s[h])*r>>8&65280)}s[h++]=e+((16711935&s[h])*r>>8&16711935)+((65280&s[h])*r>>8&65280),s[h++]=e+((16711935&s[h])*r>>8&16711935)+((65280&s[h])*r>>8&65280),s[h++]=e+((16711935&s[h])*r>>8&16711935)+((65280&s[h])*r>>8&65280),s[h++]=e+((16711935&s[h])*r>>8&16711935)+((65280&s[h])*r>>8&65280)}};static f_=t=>{this.QR[t]&&this.JR&&(this.JR[this.tS++]=this.QR[t],this.QR[t]=null)};static cS=t=>{if(this.a_[t]=this.Vf++,this.QR[t])return this.QR[t];let i;if(this.tS>0&&this.JR)i=this.JR[--this.tS],this.JR[this.tS]=null;else{let t=0,s=-1;for(let i=0;i>>3)&16316671,i[e+8192]=n-(n>>>2)&16316671,i[e+12288]=n-(n>>>2)-(n>>>3)&16316671}}else{if(64===s.width)for(let t=0;t<128;t++)for(let e=0;e<128;e++)i[e+(t<<7)]=h[s.nc[(e>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)i[t]=h[s.nc[t]];this.hS[t]=!1;for(let s=0;s<16384;s++){i[s]&=16316671;const h=i[s];0===h&&(this.hS[t]=!0),i[s+16384]=h-(h>>>3)&16316671,i[s+32768]=h-(h>>>2)&16316671,i[s+49152]=h-(h>>>2)-(h>>>3)&16316671}}return i}}},880:(t,i,s)=>{s.d(i,{r:()=>e});var h=s(7854);const e=async t=>{255!==t[0]&&(t[0]=255),URL.revokeObjectURL(h.NR.src),h.NR.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>h.NR.onload=()=>t())),h.DR.clearRect(0,0,h.PR.width,h.PR.height);const i=h.NR.naturalWidth,s=h.NR.naturalHeight;return h.PR.width=i,h.PR.height=s,h.DR.drawImage(h.NR,0,0),h.DR.getImageData(0,0,i,s)}},8665:(t,i,s)=>{s.d(i,{A:()=>f});var h=s(1069),e=s(8950),n=s(4583),r=s(6730),o=s(4474),l=s(3867);class a{Bg=0;Gb=0;uS=0;dS=-1;wS=-1;AS=-1;yS=-1;pS=-1;mS=-1;IS=-1;_S=-1;ES=-1;gS=0;CS=-1;TS=-1;OS=-1;data=null}class c{x=0;y=0;z=0;w=0}class f extends o.A{static metadata=null;static head=null;static bS=null;static vS=null;static LS=null;static RS=null;static SS=null;static MS=null;static kS=null;static xS=null;static DS=null;static NS=null;static PS=null;static FS=null;static axis=null;static US=new l.ds(4096,!1);static BS=new l.ds(4096,!1);static GS=new Int32Array(4096);static HS=new Int32Array(4096);static WS=new Int32Array(4096);static YS=new Int32Array(4096);static VS=new Int32Array(4096);static KS=new Int32Array(4096);static XS=new Int32Array(1500);static zS=new l.Kn(1500,512);static jS=new Int32Array(12);static ZS=new l.Kn(12,2e3);static qS=new Int32Array(2e3);static $S=new Int32Array(2e3);static JS=new Int32Array(12);static QS=new Int32Array(10);static tM=new Int32Array(10);static iM=new Int32Array(10);static _n=0;static sM=0;static En=0;static Kf=!1;static xl=0;static Dl=0;static Xf=0;static dm=new Int32Array(1e3);static hM=!1;static ec(t){try{f.head=new h.A(t.read('ob_head.dat')),f.bS=new h.A(t.read('ob_face1.dat')),f.vS=new h.A(t.read('ob_face2.dat')),f.LS=new h.A(t.read('ob_face3.dat')),f.RS=new h.A(t.read('ob_face4.dat')),f.SS=new h.A(t.read('ob_face5.dat')),f.MS=new h.A(t.read('ob_point1.dat')),f.kS=new h.A(t.read('ob_point2.dat')),f.xS=new h.A(t.read('ob_point3.dat')),f.DS=new h.A(t.read('ob_point4.dat')),f.NS=new h.A(t.read('ob_point5.dat')),f.PS=new h.A(t.read('ob_vertex1.dat')),f.FS=new h.A(t.read('ob_vertex2.dat')),f.axis=new h.A(t.read('ob_axis.dat')),f.head.Fc=0,f.MS.Fc=0,f.kS.Fc=0,f.xS.Fc=0,f.DS.Fc=0,f.PS.Fc=0,f.FS.Fc=0;const i=f.head.KA;f.metadata=new l.ds(i+100,null);let s=0,e=0,n=0,r=0,o=0,c=0,u=0;for(let t=0;t>7)<2?i=2:i>126&&(i=126),(65408&t)+i):(i<0?i=0:i>127&&(i=127),127-i)}static Ug=(t,i,s)=>{const h=t.Bg,e=t.Gb,n=t.uS;let r,o,a,u,d;if(i){r=new Int32Array(h);for(let i=0;i{const e=t.Bg,n=t.Gb,r=t.uS;let o,l,a,c,u;if(h)o=t.Gg,l=t.Wg,a=t.Hg;else{o=new Int32Array(e),l=new Int32Array(e),a=new Int32Array(e);for(let i=0;i{const s=t.Bg,h=t.Gb,e=t.uS,n=new Int32Array(s),r=new Int32Array(s),o=new Int32Array(s);for(let i=0;i{let s=!1,h=!1,e=!1,n=!1,r=0,o=0,l=0,a=-1;for(let c=0;c{let s=!1,h=!1,e=!1,n=!1,r=0,o=0,l=0,a=-1;for(let c=0;c{let o=-1;const l=t.Gg[i],a=t.Wg[i],c=t.Hg[i];for(let t=0;t{if(!f.metadata)throw new Error('cant loading model metadata!!!!!');const i=f.metadata[t];if(!i)throw console.log(`Error model:${t} not found!`),new Error('cant loading model metadata!!!!!');if(!(f.head&&f.bS&&f.vS&&f.LS&&f.RS&&f.SS&&f.MS&&f.kS&&f.xS&&f.DS&&f.NS&&f.PS&&f.FS&&f.axis))throw new Error('cant loading model!!!!!');const s=i.Bg,h=i.Gb,e=i.uS,n=new Int32Array(s),r=new Int32Array(s),o=new Int32Array(s),l=new Int32Array(h),a=new Int32Array(h),c=new Int32Array(h),u=new Int32Array(e),d=new Int32Array(e),w=new Int32Array(e);let A=null;i.pS>=0&&(A=new Int32Array(s));let y=null;i.ES>=0&&(y=new Int32Array(h));let p=null,m=0;i.gS>=0?p=new Int32Array(h):m=-i.gS-1;let I=null;i.CS>=0&&(I=new Int32Array(h));let _=null;i.TS>=0&&(_=new Int32Array(h));const E=new Int32Array(h);f.MS.Fc=i.dS,f.kS.Fc=i.wS,f.xS.Fc=i.AS,f.DS.Fc=i.yS,f.NS.Fc=i.pS;let g,C,T,O=0,b=0,v=0;for(let t=0;t{if(!f.metadata||!f.metadata[i])throw new Error('No model metadata');const s=f.metadata[i];if(s.data=t,!s.data.length)throw new Error('No model data');const e=s.Bg,n=s.Gb,r=s.uS,o=new Int32Array(e),l=new Int32Array(e),a=new Int32Array(e),c=new Int32Array(n),u=new Int32Array(n),d=new Int32Array(n),w=new Int32Array(r),A=new Int32Array(r),y=new Int32Array(r);let p=null;s.pS>=0&&(p=new Int32Array(e));let m=null;s.ES>=0&&(m=new Int32Array(n));let I=null,_=0;s.gS>=0?I=new Int32Array(n):_=-s.gS-1;let E=null;s.CS>=0&&(E=new Int32Array(n));let g=null;s.TS>=0&&(g=new Int32Array(n));const C=new Int32Array(n),T=new h.A(s.data);T.Fc=s.dS;const O=new h.A(s.data);O.Fc=s.wS;const b=new h.A(s.data);b.Fc=s.AS;const v=new h.A(s.data);v.Fc=s.yS;const L=new h.A(s.data);L.Fc=s.pS;let R,S,M,k=0,x=0,D=0;for(let t=0;tthis.Zg&&(this.Zg=-s),s>this.Db&&(this.Db=s);const e=i*i+h*h;e>this.rO&&(this.rO=e)}this.rO=Math.sqrt(this.rO)+.99|0,this.AM=Math.sqrt(this.rO*this.rO+this.Zg*this.Zg)+.99|0,this.wM=this.AM+(Math.sqrt(this.rO*this.rO+this.Db*this.Db)+.99|0)}Yg(){this.Zg=0,this.Db=0;for(let t=0;tthis.Zg&&(this.Zg=-i),i>this.Db&&(this.Db=i)}this.AM=Math.sqrt(this.rO*this.rO+this.Zg*this.Zg)+.99|0,this.wM=this.AM+(Math.sqrt(this.rO*this.rO+this.Db*this.Db)+.99|0)}Ma(){if(this.yM){const t=new Int32Array(256);let i=0;for(let s=0;si&&(i=h)}this.Xg=new l.ds(i+1,null);for(let s=0;s<=i;s++)this.Xg[s]=new Int32Array(t[s]),t[s]=0;let s=0;for(;si&&(i=h)}this.Kg=new l.ds(i+1,null);for(let s=0;s<=i;s++)this.Kg[s]=new Int32Array(t[s]),t[s]=0;let s=0;for(;sl;)l=s[o++];n&&n.types&&h.x&&h.y&&h.z&&n.labels&&(i!==l||0===n.types[i])&&this.EM(h.x[t],h.y[t],h.z[t],n.labels[i],n.types[i])}f._n=0,f.sM=0,f.En=0,o=0,l=s[o++];for(let t=0;tl;)l=s[o++];n&&n.types&&e.x&&e.y&&e.z&&n.labels&&(i===l||0===n.types[i])&&this.EM(e.x[t],e.y[t],e.z[t],n.labels[i],n.types[i])}}else this.ka(t)}ka(t){if(!this.Xg||-1===t||!r.A.Ro[t])return;const i=r.A.Ro[t],s=i.MR;f._n=0,f.sM=0,f.En=0;for(let t=0;t>16;this.Hg[t]=this.Wg[t]*i+this.Hg[t]*s>>16,this.Wg[t]=h}}translate(t,i,s){for(let h=0;h>8;if(this.rM&&this.oM&&this.lM||(this.rM=new Int32Array(this.Gb),this.oM=new Int32Array(this.Gb),this.lM=new Int32Array(this.Gb)),!this.bb){this.bb=new l.ds(this.Bg,null);for(let t=0;t8192||p>8192||m>8192||y<-8192||p<-8192||m<-8192;)y>>=1,p>>=1,m>>=1;let I=0|Math.sqrt(y*y+p*p+m*m);if(I<=0&&(I=1),y=256*y/I|0,p=256*p/I|0,m=256*m/I|0,this.Bb&&1&this.Bb[i]){const n=t+((s*y+h*p+e*m)/(r+(r/2|0))|0);this.ZE&&(this.rM[i]=f.nM(this.ZE[i],n,this.Bb[i]))}else{let t=this.bb[n];t&&(t.x+=y,t.y+=p,t.z+=m,t.w++),t=this.bb[o],t&&(t.x+=y,t.y+=p,t.z+=m,t.w++),t=this.bb[l],t&&(t.x+=y,t.y+=p,t.z+=m,t.w++)}}if(n)this.Rb(t,r,s,h,e);else{this.xb=new l.ds(this.Bg,null);for(let t=0;t>16;for(let h=0;h>16,_=_*w-I*d>>16,I=m),0!==t&&(m=_*a-E*l>>16,E=_*l+E*a>>16,_=m),0!==i&&(m=E*c+I*u>>16,E=E*u-I*c>>16,I=m),I+=e,_+=r,E+=o,m=_*y-E*A>>16,E=_*A+E*y>>16,_=m,f.GS&&f.HS&&f.WS&&(f.WS[h]=E-p,f.GS[h]=n.A.na+((I<<9)/E|0),f.HS[h]=n.A.ra+((_<<9)/E|0)),this.uS>0&&f.YS&&f.VS&&f.KS&&(f.YS[h]=I,f.VS[h]=_,f.KS[h]=E)}try{this.CM(!1,!1,0)}catch(t){}}draw(t,i,s,h,r,o,l,a,c){const u=a*r-o*h>>16,d=l*i+u*s>>16,w=this.rO*s>>16,A=d+w;if(A<=50||d>=3500)return;const y=a*h+o*r>>16;let p=y-this.rO<<9;if((p/A|0)>=e.A.VR)return;let m=y+this.rO<<9;if((m/A|0)<=-e.A.VR)return;const I=l*s-u*i>>16,_=this.rO*i>>16;let E=I+_<<9;if((E/A|0)<=-e.A.KR)return;let g=I-(_+(this.Zg*s>>16))<<9;if((g/A|0)>=e.A.KR)return;let C=d-(w+(this.Zg*i>>16))<=50,T=!1;if(c>0&&f.Kf){let t=d-w;t<=50&&(t=50),y>0?(p=p/A|0,m=m/t|0):(m=m/A|0,p=p/t|0),I>0?(g=g/A|0,E=E/t|0):(E=E/A|0,g=g/t|0);const i=f.xl-n.A.na,s=f.Dl-n.A.ra;i>p&&ig&&s>16,w=w*L-c*v>>16,c=n),c+=o,u+=l,w+=a,n=w*h+c*r>>16,w=w*r-c*h>>16,c=n,n=u*s-w*i>>16,w=u*i+w*s>>16,u=n,f.WS&&(f.WS[e]=w-d),w>=50&&f.GS&&f.HS?(f.GS[e]=O+((c<<9)/w|0),f.HS[e]=b+((u<<9)/w|0)):f.GS&&(f.GS[e]=-5e3,C=!0),(C||this.uS>0)&&f.YS&&f.VS&&f.KS&&(f.YS[e]=c,f.VS[e]=u,f.KS[e]=w)}try{this.CM(C,T,c)}catch(t){}}CM(t,i,s,h=!1){f.hM&&(this.IM=-1,this._M=-1);for(let t=0;te.A.gv||a>e.A.gv||c>e.A.gv),f.zS&&f.XS){const t=((A+y+p)/3|0)+this.AM;f.zS[t][f.XS[t]++]=h,f.hM&&this.TM(f.xl,f.Dl,u,d,w,l,a,c)&&this._M=0;t--){const i=f.XS[t];if(!(i<=0)&&f.zS){const s=f.zS[t];for(let t=0;t=0;t--){const i=f.XS[t];if(i>0&&f.zS){const s=f.zS[t];for(let h=0;h0||f.jS[2]>0)&&(n=(f.JS[1]+f.JS[2])/(f.jS[1]+f.jS[2])|0);let r=0;f.jS&&f.JS&&(f.jS[3]>0||f.jS[4]>0)&&(r=(f.JS[3]+f.JS[4])/(f.jS[3]+f.jS[4])|0);let o=0;if(f.jS&&f.JS&&(f.jS[6]>0||f.jS[8]>0)&&(o=(f.JS[6]+f.JS[8])/(f.jS[6]+f.jS[8])|0),f.jS&&f.ZS){let t,i=0,s=f.jS[10],e=f.ZS[10],l=f.qS;i===s&&(i=0,s=f.jS[11],e=f.ZS[11],l=f.$S),t=in;)this.OM(e[i++],h),i===s&&e!==f.ZS[11]&&(i=0,s=f.jS[11],e=f.ZS[11],l=f.$S),t=ir;)this.OM(e[i++],h),i===s&&e!==f.ZS[11]&&(i=0,s=f.jS[11],e=f.ZS[11],l=f.$S),t=io;)this.OM(e[i++],h),i===s&&e!==f.ZS[11]&&(i=0,s=f.jS[11],e=f.ZS[11],l=f.$S),t=i>2,r=this.fM[i],o=this.uM[i],l=this.dM[i];n.A.Sv(f.GS[s],f.GS[h],f.GS[e],f.HS[s],f.HS[h],f.HS[e],this.rM[t],this.oM[t],this.lM[t],f.YS[r],f.VS[r],f.KS[r],f.YS[o],f.YS[l],f.VS[o],f.VS[l],f.KS[o],f.KS[l],this.ZE[t])}else if(3===r&&this.Bb&&this.ZE&&this.rM&&f.GS&&f.HS&&f.YS&&f.VS&&f.KS){const i=this.Bb[t]>>2,r=this.fM[i],o=this.uM[i],l=this.dM[i];n.A.Sv(f.GS[s],f.GS[h],f.GS[e],f.HS[s],f.HS[h],f.HS[e],this.rM[t],this.rM[t],this.rM[t],f.YS[r],f.VS[r],f.KS[r],f.YS[o],f.YS[l],f.VS[o],f.VS[l],f.KS[o],f.KS[l],this.ZE[t])}}bM(t,i=!1){let s=0;if(f.KS){const i=n.A.na,h=n.A.ra,e=this.Hb[t],r=this.Wb[t],o=this.Yb[t],l=f.KS[e],a=f.KS[r],c=f.KS[o];if(l>=50&&f.GS&&f.HS&&this.rM)f.QS[s]=f.GS[e],f.tM[s]=f.HS[e],f.iM[s++]=this.rM[t];else if(f.YS&&f.VS&&this.rM){const u=f.YS[e],d=f.VS[e],w=this.rM[t];if(c>=50&&this.lM){const e=(50-l)*n.A.qR[c-l];f.QS[s]=i+((u+((f.YS[o]-u)*e>>16)<<9)/50|0),f.tM[s]=h+((d+((f.VS[o]-d)*e>>16)<<9)/50|0),f.iM[s++]=w+((this.lM[t]-w)*e>>16)}if(a>=50&&this.oM){const e=(50-l)*n.A.qR[a-l];f.QS[s]=i+((u+((f.YS[r]-u)*e>>16)<<9)/50|0),f.tM[s]=h+((d+((f.VS[r]-d)*e>>16)<<9)/50|0),f.iM[s++]=w+((this.oM[t]-w)*e>>16)}}if(a>=50&&f.GS&&f.HS&&this.oM)f.QS[s]=f.GS[r],f.tM[s]=f.HS[r],f.iM[s++]=this.oM[t];else if(f.YS&&f.VS&&this.oM){const u=f.YS[r],d=f.VS[r],w=this.oM[t];if(l>=50&&this.rM){const r=(50-a)*n.A.qR[l-a];f.QS[s]=i+((u+((f.YS[e]-u)*r>>16)<<9)/50|0),f.tM[s]=h+((d+((f.VS[e]-d)*r>>16)<<9)/50|0),f.iM[s++]=w+((this.rM[t]-w)*r>>16)}if(c>=50&&this.lM){const e=(50-a)*n.A.qR[c-a];f.QS[s]=i+((u+((f.YS[o]-u)*e>>16)<<9)/50|0),f.tM[s]=h+((d+((f.VS[o]-d)*e>>16)<<9)/50|0),f.iM[s++]=w+((this.lM[t]-w)*e>>16)}}if(c>=50&&f.GS&&f.HS&&this.lM)f.QS[s]=f.GS[o],f.tM[s]=f.HS[o],f.iM[s++]=this.lM[t];else if(f.YS&&f.VS&&this.lM){const u=f.YS[o],d=f.VS[o],w=this.lM[t];if(a>=50&&this.oM){const e=(50-c)*n.A.qR[a-c];f.QS[s]=i+((u+((f.YS[r]-u)*e>>16)<<9)/50|0),f.tM[s]=h+((d+((f.VS[r]-d)*e>>16)<<9)/50|0),f.iM[s++]=w+((this.oM[t]-w)*e>>16)}if(l>=50&&this.rM){const r=(50-c)*n.A.qR[l-c];f.QS[s]=i+((u+((f.YS[e]-u)*r>>16)<<9)/50|0),f.tM[s]=h+((d+((f.VS[e]-d)*r>>16)<<9)/50|0),f.iM[s++]=w+((this.rM[t]-w)*r>>16)}}}const h=f.QS[0],r=f.QS[1],o=f.QS[2],l=f.tM[0],a=f.tM[1],c=f.tM[2];if(!((h-r)*(c-a)-(l-a)*(o-r)<=0))if(n.A.Ev=!1,3===s){let s;if((h<0||r<0||o<0||h>e.A.gv||r>e.A.gv||o>e.A.gv)&&(n.A.Ev=!0),s=this.Bb?3&this.Bb[t]:0,i)n.A.Zu(h,r,l,a,f.iM[0]),n.A.Zu(r,o,a,c,f.iM[1]),n.A.Zu(o,h,c,l,f.iM[2]);else if(0===s)n.A.bv(h,r,o,l,a,c,f.iM[0],f.iM[1],f.iM[2]);else if(1===s&&this.rM)n.A.lS(h,r,o,l,a,c,n.A.palette[this.rM[t]]);else if(2===s&&this.Bb&&this.ZE&&f.YS&&f.VS&&f.KS){const i=this.Bb[t]>>2,s=this.fM[i],e=this.uM[i],u=this.dM[i];n.A.Sv(h,r,o,l,a,c,f.iM[0],f.iM[1],f.iM[2],f.YS[s],f.VS[s],f.KS[s],f.YS[e],f.YS[u],f.VS[e],f.VS[u],f.KS[e],f.KS[u],this.ZE[t])}else if(3===s&&this.Bb&&this.ZE&&this.rM&&f.YS&&f.VS&&f.KS){const i=this.Bb[t]>>2,s=this.fM[i],e=this.uM[i],u=this.dM[i];n.A.Sv(h,r,o,l,a,c,this.rM[t],this.rM[t],this.rM[t],f.YS[s],f.VS[s],f.KS[s],f.YS[e],f.YS[u],f.VS[e],f.VS[u],f.KS[e],f.KS[u],this.ZE[t])}}else if(4===s){let s;if((h<0||r<0||o<0||h>e.A.gv||r>e.A.gv||o>e.A.gv||f.QS[3]<0||f.QS[3]>e.A.gv)&&(n.A.Ev=!0),s=this.Bb?3&this.Bb[t]:0,i)n.A.Zu(h,r,l,a,f.iM[0]),n.A.Zu(r,o,a,c,f.iM[1]),n.A.Zu(o,f.QS[3],c,f.tM[3],f.iM[2]),n.A.Zu(f.QS[3],h,f.tM[3],l,f.iM[3]);else if(0===s)n.A.bv(h,r,o,l,a,c,f.iM[0],f.iM[1],f.iM[2]),n.A.bv(h,o,f.QS[3],l,c,f.tM[3],f.iM[0],f.iM[2],f.iM[3]);else if(1===s){if(this.rM){const i=n.A.palette[this.rM[t]];n.A.lS(h,r,o,l,a,c,i),n.A.lS(h,o,f.QS[3],l,c,f.tM[3],i)}}else if(2===s&&this.Bb&&this.ZE&&f.YS&&f.VS&&f.KS){const i=this.Bb[t]>>2,s=this.fM[i],e=this.uM[i],u=this.dM[i];n.A.Sv(h,r,o,l,a,c,f.iM[0],f.iM[1],f.iM[2],f.YS[s],f.VS[s],f.KS[s],f.YS[e],f.YS[u],f.VS[e],f.VS[u],f.KS[e],f.KS[u],this.ZE[t]),n.A.Sv(h,o,f.QS[3],l,c,f.tM[3],f.iM[0],f.iM[2],f.iM[3],f.YS[s],f.VS[s],f.KS[s],f.YS[e],f.YS[u],f.VS[e],f.VS[u],f.KS[e],f.KS[u],this.ZE[t])}else if(3===s&&this.Bb&&this.ZE&&this.rM&&f.YS&&f.VS&&f.KS){const i=this.Bb[t]>>2,s=this.fM[i],e=this.uM[i],u=this.dM[i];n.A.Sv(h,r,o,l,a,c,this.rM[t],this.rM[t],this.rM[t],f.YS[s],f.VS[s],f.KS[s],f.YS[e],f.YS[u],f.VS[e],f.VS[u],f.KS[e],f.KS[u],this.ZE[t]),n.A.Sv(h,o,f.QS[3],l,c,f.tM[3],this.rM[t],this.rM[t],this.rM[t],f.YS[s],f.VS[s],f.KS[s],f.YS[e],f.YS[u],f.VS[e],f.VS[u],f.KS[e],f.KS[u],this.ZE[t])}}}EM(t,i,s,h,e){if(!h)return;const r=h.length;if(0===e){let e=0;f._n=0,f.sM=0,f.En=0;for(let t=0;t0?(f._n=(f._n/e|0)+t,f.sM=(f.sM/e|0)+i,f.En=(f.En/e|0)+s):(f._n=t,f.sM=i,f.En=s)}else if(1===e)for(let e=0;e=this.Xg.length)continue;const r=this.Xg[n];if(r)for(let h=0;h=this.Xg.length)continue;const o=this.Xg[r];if(o)for(let h=0;h>16;this.Wg[e]=this.Wg[e]*u-this.Gg[e]*c>>16,this.Gg[e]=t}if(0!==r){c=n.A.sin[r],u=n.A.cos[r];const t=this.Wg[e]*u-this.Hg[e]*c>>16;this.Hg[e]=this.Wg[e]*c+this.Hg[e]*u>>16,this.Wg[e]=t}if(0!==l){c=n.A.sin[l],u=n.A.cos[l];const t=this.Hg[e]*c+this.Gg[e]*u>>16;this.Hg[e]=this.Hg[e]*u-this.Gg[e]*c>>16,this.Gg[e]=t}this.Gg[e]+=f._n,this.Wg[e]+=f.sM,this.Hg[e]+=f.En}}else if(3===e)for(let e=0;e=this.Xg.length)continue;const r=this.Xg[n];if(r)for(let h=0;h=this.Kg.length)continue;const e=this.Kg[s];if(e)for(let i=0;i255&&(this.cM[s]=255)}}}gM(){this.Zg=0,this.rO=0,this.Db=0,this.Nb=999999,this.Pb=-999999,this.Ub=-99999,this.Fb=99999;for(let t=0;tthis.Pb&&(this.Pb=i),hthis.Ub&&(this.Ub=h),-s>this.Zg&&(this.Zg=-s),s>this.Db&&(this.Db=s);const e=i*i+h*h;e>this.rO&&(this.rO=e)}this.rO=0|Math.sqrt(this.rO),this.AM=0|Math.sqrt(this.rO*this.rO+this.Zg*this.Zg),this.wM=this.AM+(0|Math.sqrt(this.rO*this.rO+this.Db*this.Db))}TM(t,i,s,h,e,n,r,o){return!(is&&i>h&&i>e)&&(!(t{s.d(i,{A:()=>o});var h=s(8950),e=s(1069),n=s(4474),r=s(880);class o extends n.A{nc;width;height;Cc;Tc;Pl;fd;constructor(t,i){super(),this.nc=new Int32Array(t*i),this.width=this.Pl=t,this.height=this.fd=i,this.Cc=this.Tc=0}static Ec=async(t,i)=>{const s=t.read(i+'.dat');if(!s)throw new Error(`${i} jpeg not found!`);const h=await(0,r.r)(s),e=new o(h.width,h.height),n=new Uint32Array(h.data.buffer),l=e.nc;for(let t=0;t>24&255)<<24|(255&i)<<16|(i>>8&255)<<8|i>>16&255}return e};static za=(t,i,s=0)=>{const h=new e.A(t.read(i+'.dat')),n=new e.A(t.read('index.dat'));n.Fc=h.KA;const r=n.KA,l=n.KA,a=[],c=n.ZA-1;for(let t=0;th.length||n.Fc>n.length)throw new Error;const f=n.ZA,u=n.ZA,d=n.KA,w=n.KA,A=new o(d,w);A.Cc=f,A.Tc=u,A.Pl=r,A.fd=l;const y=n.ZA;if(0===y){const t=A.width*A.height;for(let i=0;ih.A.bottom&&(n-=i+n-h.A.bottom),th.A.right){const i=t+r-h.A.right;r-=i,l+=i,o+=i}r>0&&n>0&&this.LM(r,n,this.nc,e,l,h.A.nc,s,o)}Nl(t,i,s){i|=0,s|=0;let e=(i+=this.Cc)+(s+=this.Tc)*h.A.lC,n=0,r=this.height,o=this.width,l=h.A.lC-o,a=0;if(sh.A.bottom&&(r-=s+r-h.A.bottom),ih.A.right){const t=i+o-h.A.right;o-=t,a+=t,l+=t}o>0&&r>0&&this.RM(o,r,this.nc,n,a,h.A.nc,e,l,t)}tc(t,i){t|=0,i|=0;let s=(t+=this.Cc)+(i+=this.Tc)*h.A.lC,e=0,n=this.height,r=this.width,o=h.A.lC-r,l=0;if(ih.A.bottom&&(n-=i+n-h.A.bottom),th.A.right){const i=t+r-h.A.right;r-=i,l+=i,o+=i}r>0&&n>0&&this.SM(r,n,this.nc,e,l,h.A.nc,s,o)}Ja(){const t=this.nc,i=this.width,s=this.height;for(let h=0;h>16&255;n+=t,n<1?n=1:n>255&&(n=255);let r=e>>8&255;r+=i,r<1?r=1:r>255&&(r=255);let o=255&e;o+=s,o<1?o=1:o>255&&(o=255),this.nc[h]=(n<<16)+(r<<8)+o}}}AC(t,i,s,e){t|=0,i|=0,s|=0,e|=0;try{const n=this.width;let r=0,o=0;const l=this.Pl,a=this.fd,c=(l<<16)/s|0,f=(a<<16)/e|0;t+=(this.Cc*s+l-1)/l|0,i+=(this.Tc*e+a-1)/a|0,this.Cc*s%l!=0&&(r=(l-this.Cc*s%l<<16)/s|0),this.Tc*e%a!=0&&(o=(a-this.Tc*e%a<<16)/e|0),s=s*(this.width-(r>>16))/l|0,e=e*(this.height-(o>>16))/a|0;let u=t+i*h.A.lC,d=h.A.lC-s;if(ih.A.bottom&&(e-=i+e-h.A.bottom),th.A.right){const i=t+s-h.A.right;s-=i,d+=i}this.scale(s,e,this.nc,r,o,h.A.nc,d,u,n,c,f)}catch(t){console.error('error in sprite clipping routine')}}nd(t,i,s,e,n,r,o,l,a,c){t|=0,i|=0,s|=0,e|=0;try{const f=-s/2|0,u=-e/2|0,d=65536*Math.sin(a/326.11)|0,w=65536*Math.cos(a/326.11)|0,A=d*c>>8,y=w*c>>8;let p=(o<<16)+u*A+f*y,m=u*y-f*A+(l<<16),I=t+i*h.A.lC;for(let t=0;t>16)+(o>>16)*this.width],e+=y,o-=A;p+=A,m+=y,I+=h.A.lC}}catch(t){}}ad(t,i,s){t|=0,i|=0;let e=(t+=this.Cc)+(i+=this.Tc)*h.A.lC,n=0,r=this.height,o=this.width,l=h.A.lC-o,a=0;if(ih.A.bottom&&(r-=i+r-h.A.bottom),th.A.right){const i=t+o-h.A.right;o-=i,a+=i,l+=i}o>0&&r>0&&this.MM(o,r,this.nc,a,n,h.A.nc,e,l,s.nc)}scale(t,i,s,h,e,n,r,o,l,a,c){try{const f=h;for(let u=-i;u<0;u++){const i=(e>>16)*l;for(let e=-t;e<0;e++){const t=s[(h>>16)+i];0===t?o++:n[o++]=t,h+=a}e+=c,h=f,o+=r}}catch(t){console.error('error in plot_scale')}}SM(t,i,s,h,e,n,r,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++)n[r++]=s[h++],n[r++]=s[h++],n[r++]=s[h++],n[r++]=s[h++];for(let i=t;i<0;i++)n[r++]=s[h++];r+=o,h+=e}}RM(t,i,s,h,e,n,r,o,l){const a=256-l;for(let c=-i;c<0;c++){for(let i=-t;i<0;i++){const t=s[h++];if(0===t)r++;else{const i=n[r];n[r++]=((16711935&t)*l+(16711935&i)*a&4278255360)+((65280&t)*l+(65280&i)*a&16711680)>>8}}r+=o,h+=e}}LM(t,i,s,h,e,n,r,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=s[h++];0===t?r++:n[r++]=t,t=s[h++],0===t?r++:n[r++]=t,t=s[h++],0===t?r++:n[r++]=t,t=s[h++],0===t?r++:n[r++]=t}for(let i=t;i<0;i++){const t=s[h++];0===t?r++:n[r++]=t}r+=o,h+=e}}MM(t,i,s,h,e,n,r,o,l){const a=-(t>>2);t=-(3&t);for(let c=-i;c<0;c++){for(let t=a;t<0;t++){let t=s[e++];0!==t&&0===l[r]?n[r++]=t:r++,t=s[e++],0!==t&&0===l[r]?n[r++]=t:r++,t=s[e++],0!==t&&0===l[r]?n[r++]=t:r++,t=s[e++],0!==t&&0===l[r]?n[r++]=t:r++}for(let i=t;i<0;i++){const t=s[e++];0!==t&&0===l[r]?n[r++]=t:r++}r+=o,e+=h}}}},1673:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(8950),e=s(1069),n=s(4474);class r extends n.A{nc;width;height;Cc;Tc;Pl;fd;palette;constructor(t,i,s){super(),this.nc=new Int8Array(t*i),this.width=this.Pl=t,this.height=this.fd=i,this.Cc=this.Tc=0,this.palette=s}static za=(t,i,s=0)=>{const h=new e.A(t.read(i+'.dat')),n=new e.A(t.read('index.dat'));n.Fc=h.KA;const o=n.KA,l=n.KA,a=n.ZA,c=new Int32Array(a);for(let t=1;th.length||n.Fc>n.length)throw new Error;const f=n.ZA,u=n.ZA,d=n.KA,w=n.KA,A=new r(d,w,c);A.Cc=f,A.Tc=u,A.Pl=o,A.fd=l;const y=A.nc,p=n.ZA;if(0===p){const t=A.width*A.height;for(let i=0;ih.A.bottom&&(n-=i+n-h.A.bottom),th.A.right){const i=t+r-h.A.right;r-=i,l+=i,o+=i}r>0&&n>0&&this.kM(r,n,this.nc,e,l,h.A.nc,s,o)}Ja(){const t=this.nc,i=this.width,s=this.height;for(let h=0;h>16&255;e+=t,e<0?e=0:e>255&&(e=255);let n=this.palette[h]>>8&255;n+=i,n<0?n=0:n>255&&(n=255);let r=255&this.palette[h];r+=s,r<0?r=0:r>255&&(r=255),this.palette[h]=(e<<16)+(n<<8)+r}}nS(){this.Pl|=0,this.fd|=0,this.Pl/=2,this.fd/=2,this.Pl|=0,this.fd|=0;const t=new Int8Array(this.Pl*this.fd);let i=0;for(let s=0;s>1)+(s+this.Tc>>1)*this.Pl]=this.nc[i++];this.nc=t,this.width=this.Pl,this.height=this.fd,this.Cc=0,this.Tc=0}AC(){if(this.width===this.Pl&&this.height===this.fd)return;const t=new Int8Array(this.Pl*this.fd);let i=0;for(let s=0;s>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=s[h++];0===t?r++:n[r++]=this.palette[255&t],t=s[h++],0===t?r++:n[r++]=this.palette[255&t],t=s[h++],0===t?r++:n[r++]=this.palette[255&t],t=s[h++],0===t?r++:n[r++]=this.palette[255&t]}for(let i=t;i<0;i++){const t=s[h++];0===t?r++:n[r++]=this.palette[255&t]}r+=o,h+=e}}clip(t,i,s,e){try{const n=this.width;this.height;let r=0,o=0;const l=this.Pl,a=this.fd,c=(l<<16)/s|0,f=(a<<16)/e|0;t=t+(this.Cc*s+l-1)/l|0,i=i+(this.Tc*e+a-1)/a|0,this.Cc*s%l!=0&&(r=(l-this.Cc*s%l<<16)/s|0),this.Tc*e%a!=0&&(o=(a-this.Tc*e%a<<16)/e|0),s=s*(this.width-(r>>16))/l|0,e=e*(this.height-(o>>16))/a|0;let u,d=t+i*h.A.lC,w=h.A.lC-s;ih.A.bottom&&(e-=i+e-h.A.bottom),th.A.right&&(u=t+s-h.A.right,s-=u,w+=u),this.xM(h.A.nc,this.nc,this.palette,r,o,d,w,s,e,c,f,n)}catch(t){console.log('error in sprite clipping routine')}}xM(t,i,s,h,e,n,r,o,l,a,c,f){try{const u=h;for(let d=-l;d<0;d++){const l=(e>>16)*f;for(let e=-o;e<0;e++){const e=i[(h>>16)+l];0==e?n++:t[n++]=s[255&e],h+=a}e+=c,h=u,n+=r}}catch(t){console.log('error in plot_scale')}}}},2682:(t,i,s)=>{s.d(i,{A:()=>l});var h=s(8950),e=s(1069),n=s(4474);class r{seed;constructor(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}DM(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}YA(){return this.next(32)}next(t){return this.seed=0x5deece66dn*this.seed+0xbn&(1n<<48n)-1n,Number(this.seed)>>>48-t}}var o=s(9298);class l extends n.A{static xc='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!"£$%^&*()-_=+[{]};:\'@#~,<.>/?\\| ';static NM=[];static{const t=navigator.userAgent.includes('Capacitor');for(let i=0;i<256;i++){let s=l.xc.indexOf(String.fromCharCode(i));t&&s>=63&&s--,-1===s&&(s=74),l.NM[i]=s}}PM=[];FM=new Int32Array(94);UM=new Int32Array(94);BM=new Int32Array(94);GM=new Int32Array(94);HM=new Int32Array(95);WM=new Int32Array(256);random=new r(BigInt(Date.now()));height=0;static za=(t,i)=>{const s=new e.A(t.read(i+'.dat')),h=new e.A(t.read('index.dat'));h.Fc=s.KA+4;const n=h.ZA;n>0&&(h.Fc+=3*(n-1));const r=new l;for(let t=0;t<94;t++){r.BM[t]=h.ZA,r.GM[t]=h.ZA;const i=r.FM[t]=h.KA,e=r.UM[t]=h.KA,n=h.ZA,o=i*e;if(r.PM[t]=new Int8Array(o),0===n)for(let h=0;hr.height&&(r.height=e),r.BM[t]=1,r.HM[t]=i+2;{let s=0;for(let h=e/7|0;h=h.A.bottom&&(n-=s+n+1-h.A.bottom),i=h.A.right){const t=i+e+1-h.A.right;e-=t,a+=t,l+=t}e>0&&n>0&&this.XM(e,n,t,c,a,h.A.nc,o,l,r)}KM(t,i,s,e,n,r,o){s|=0,e|=0;let l=(t|=0)+(i|=0)*h.A.lC,a=h.A.lC-s,c=0,f=0;if(i=h.A.bottom&&(e-=i+e+1-h.A.bottom),t=h.A.right){const i=t+s+1-h.A.right;s-=i,c+=i,a+=i}s>0&&e>0&&this.zM(s,e,h.A.nc,l,a,o,f,c,n,r)}XM(t,i,s,h,e,n,r,o,l){const a=-((t|=0)>>2);t=-(3&t);for(let c=-(i|=0);c<0;c++){for(let t=a;t<0;t++)0===s[h++]?r++:n[r++]=l,0===s[h++]?r++:n[r++]=l,0===s[h++]?r++:n[r++]=l,0===s[h++]?r++:n[r++]=l;for(let i=t;i<0;i++)0===s[h++]?r++:n[r++]=l;r+=o,h+=e}}zM(t,i,s,h,e,n,r,o,l,a){t|=0;const c=((16711935&l)*a&4278255360)+((65280&l)*a&16711680)>>8,f=256-a;for(let l=-(i|=0);l<0;l++){for(let i=-t;i<0;i++)if(0===n[r++])h++;else{const t=s[h];s[h++]=(((16711935&t)*f&4278255360)+((65280&t)*f&16711680)>>8)+c}h+=e,r+=o}}VM(t){return'red'===t?o.A.RED:'gre'===t?o.A.GREEN:'blu'===t?o.A.BLUE:'yel'===t?o.A.Gl:'cya'===t?o.A.bc:'mag'===t?o.A.vc:'whi'===t?o.A._l:'bla'===t?o.A.Bl:'lre'===t?o.A.FR:'dre'===t?o.A.sd:'dbl'===t?o.A.td:'or1'===t?o.A.UR:'or2'===t?o.A.BR:'or3'===t?o.A.GR:'gr1'===t?o.A.HR:'gr2'===t?o.A.WR:'gr3'===t?o.A.YR:o.A.Bl}split(t,i){if(0===t.length)return[t];const s=[];for(;t.length>0;){if(this.au(t)<=i&&-1===t.indexOf('|')){s.push(t);break}let h=t.length;for(let s=0;si)break;h=s}else if('|'===t[s]){h=s;break}s.push(t.substring(0,h)),t=t.substring(h+1)}return s}}},1183:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(8950),e=s(7854);class n{jM;width;height;ZM;qM;nc;constructor(t,i,s=e.jo){this.ZM=s,this.jM=this.ZM.getImageData(0,0,t,i),this.qM=new Uint32Array(this.jM.data.buffer),this.nc=new Int32Array(t*i),this.width=t,this.height=i,this.bind()}clear(){this.nc.fill(0)}bind(){h.A.bind(this.nc,this.width,this.height)}draw(t,i){this.#t(),this.ZM.putImageData(this.jM,t,i)}#t(){const t=this.nc.length,i=this.nc,s=this.qM;for(let h=0;h>16&255|(t>>8&255)<<8|(255&t)<<16|4278190080}}}},3955:(t,i,s)=>{s.d(i,{A:()=>h});class h{static iy=150;static Tf=70;static bf=108;static Zc=81;static sf=189;static Mw=7;static Zd=88;static Kd=30;static Qd=176;static Hd=220;static Dw=66;static Tw=17;static lw=2;static Lw=238;static cA=233;static Gf=146;static cf=215;static Of=236;static jI=85;static pI=219;static dw=140;static pw=40;static yw=200;static ww=178;static Aw=247;static xw=138;static iw=239;static Jd=194;static jd=8;static qd=27;static $d=113;static tw=100;static fw=134;static ow=202;static hw=245;static mw=172;static Pw=96;static kw=97;static Nw=116;static uw=9;static Gd=75;static Fd=164;static aw=53;static cw=185;static Pd=206;static Vw=177;static Bw=248;static Xd=195;static zd=71;static Vd=133;static Wd=157;static Yd=211;static nw=48;static ew=130;static bw=31;static Sw=59;static Cw=212;static Rw=38;static Ow=6;static gw=155;static rw=235;static HA=231;static AA=237;static kf=175;static km=93;static eA=190;static Mm=165;static nf=159;static gA=171;static EA=79;static iA=52;static wA=244;static fA=148;static _A=11;static IA=118;static pA=4;static mA=158;static Sm=181}},3554:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(6666),e=s(1982);class n{$M;JM;QM;closed=!1;tk=!1;static Nc=async t=>await new Promise(((i,s)=>{const h=t.host.startsWith('https'),e=h?'wss':'ws',n=t.host.substring(t.host.indexOf('//')+2),r=h?t.port+2:t.port+1,o=new WebSocket(`${e}://${n}:${r}`,'binary');o.addEventListener('open',(()=>{console.log('connection open!'),i(o)})),o.addEventListener('error',(()=>{console.log('connection error!'),s(o)}))}));constructor(t){t.onclose=this.onclose,t.onerror=this.onerror,this.JM=new l(t,5e3),this.QM=new r(t,5e3),this.$M=t}get host(){return this.$M.url.split('/')[2]}get port(){return parseInt(this.$M.url.split(':')[2],10)}get available(){return this.closed?0:this.JM.available}write(t,i){this.QM.write(t,i)}async read(){return this.closed?0:this.JM.ik()??await this.JM.sk()}async Pc(t,i,s){if(!this.closed)for(;s>0;){const h=this.JM.hk(t,i,s)??await this.JM.ek(t,i,s);if(h.length<=0)throw new Error('EOF');i+=h.length,s-=h.length}}close(){this.closed=!0,this.$M.close(),this.JM.close(),this.QM.close(),console.log('connection close!'),this.tk&&console.log('connection error!')}onclose=t=>{this.closed||this.close()};onerror=t=>{this.closed||(this.tk=!0,this.close())}}class r{$M;nk;closed=!1;tk=!1;constructor(t,i){this.$M=t,this.nk=i}write(t,i){if(!this.closed){if(this.tk)throw this.tk=!1,new Error('Error in writer thread');if(i>this.nk||t.length>this.nk)throw new Error('buffer overflow');try{this.$M.send(t.subarray(0,i))}catch(t){this.tk=!0}}}close(){this.closed=!0}}class o extends e.A{Gm;position;constructor(t){super(),this.Gm=t,this.position=0}get available(){return this.Gm.length-this.position}get read(){return this.Gm[this.position++]}get rk(){return this.Gm.length}}class l{nk;queue=new h.A;event=null;lk=null;total=0;closed=!1;constructor(t,i){this.nk=i,t.binaryType='arraybuffer',t.onmessage=this.onmessage}get available(){return this.total}onmessage=t=>{if(this.closed)throw new Error('WebSocketReader is closed!');const i=new o(new Uint8Array(t.data));if(this.event?this.queue.n_(i):this.event=i,this.total+=i.rk,this.lk&&(this.lk(this.event),this.lk=null,this.total>this.nk))throw new Error('buffer overflow')};ak(){return this.event&&this.event.available>0?this.event.read:null}async ck(t){for(this.event=this.queue.ev();this.totalthis.lk=t));return this.event?this.event.read:this.ck(t)}hk(t,i,s){if(this.closed)throw new Error('WebSocketReader is closed!');if(!(this.event&&this.event.available>=s))return null;for(;s>0;){const h=this.ak();if(null===h)throw new Error('EOF - tried to read a fast byte when there was not enough immediate bytes.');t[i++]=h,this.total--,s--}return t}async ek(t,i,s){if(this.closed)throw new Error('WebSocketReader is closed!');for(;s>0;)t[i++]=this.ak()??await this.ck(s),this.total--,s--;return t}ik(){if(this.closed)throw new Error('WebSocketReader is closed!');const t=this.ak();return null===t?null:(this.total--,t)}async sk(){if(this.closed)throw new Error('WebSocketReader is closed!');const t=await this.ck(1);return this.total--,t}close(){this.closed=!0,this.lk=null,this.total=0,this.event=null,this.queue.clear()}}},4544:(t,i,s)=>{s.d(i,{A:()=>h});class h{db;constructor(t){t.onerror=this.onerror,t.onclose=this.onclose,this.db=t}static openDatabase=async()=>await new Promise(((t,i)=>{const s=indexedDB.open('lostcity',1);s.onsuccess=i=>{const s=i.target;console.log('database success!'),t(s.result)},s.onupgradeneeded=t=>{t.target.result.createObjectStore('cache')},s.onerror=t=>{const s=t.target;console.error('database error!: ',s.error),i(s.result)}}));Uo=async t=>await new Promise((i=>{const s=this.db.transaction('cache','readonly').objectStore('cache').get(t);s.onsuccess=()=>{i(s.result)},s.onerror=t=>{i(void 0)}}));Yo=async(t,i)=>await new Promise(((s,h)=>{const e=this.db.transaction('cache','readwrite').objectStore('cache').put(i,t);e.onsuccess=()=>{s()},e.onerror=t=>{h()}}));onclose=t=>{console.log('database close!')};onerror=t=>{console.log('database error!')};fk=t=>{const i=t.trim();let s=0;for(let t=0;t='A'&&h<='Z'?s+=h.charCodeAt(0)+1-65:h>='a'&&h<='z'?s+=h.charCodeAt(0)+1-97:h>='0'&&h<='9'&&(s+=h.charCodeAt(0)+27-48)}return s}}},2634:(t,i,s)=>{s.d(i,{A:()=>h});class h{count=0;uk=new Int32Array(256);dk=new Int32Array(256);a=0;b=0;c=0;constructor(t){for(let i=0;i>>2,e+=i,s+=h,s^=h<<8,n+=s,h+=e,h^=e>>>16,r+=h,e+=n,e^=n<<10,o+=e,n+=r,n^=r>>>4,t+=n,r+=o,r^=o<<8,i+=r,o+=t,o^=t>>>9,s+=o,t+=i;for(let l=0;l<256;l+=8)t+=this.uk[l],i+=this.uk[l+1],s+=this.uk[l+2],h+=this.uk[l+3],e+=this.uk[l+4],n+=this.uk[l+5],r+=this.uk[l+6],o+=this.uk[l+7],t^=i<<11,h+=t,i+=s,i^=s>>>2,e+=i,s+=h,s^=h<<8,n+=s,h+=e,h^=e>>>16,r+=h,e+=n,e^=n<<10,o+=e,n+=r,n^=r>>>4,t+=n,r+=o,r^=o<<8,i+=r,o+=t,o^=t>>>9,s+=o,t+=i,this.dk[l]=t,this.dk[l+1]=i,this.dk[l+2]=s,this.dk[l+3]=h,this.dk[l+4]=e,this.dk[l+5]=n,this.dk[l+6]=r,this.dk[l+7]=o;for(let l=0;l<256;l+=8)t+=this.dk[l],i+=this.dk[l+1],s+=this.dk[l+2],h+=this.dk[l+3],e+=this.dk[l+4],n+=this.dk[l+5],r+=this.dk[l+6],o+=this.dk[l+7],t^=i<<11,h+=t,i+=s,i^=s>>>2,e+=i,s+=h,s^=h<<8,n+=s,h+=e,h^=e>>>16,r+=h,e+=n,e^=n<<10,o+=e,n+=r,n^=r>>>4,t+=n,r+=o,r^=o<<8,i+=r,o+=t,o^=t>>>9,s+=o,t+=i,this.dk[l]=t,this.dk[l+1]=i,this.dk[l+2]=s,this.dk[l+3]=h,this.dk[l+4]=e,this.dk[l+5]=n,this.dk[l+6]=r,this.dk[l+7]=o;this.wk(),this.count=256}wk(){this.c++,this.b+=this.c;for(let t=0;t<256;t++){const i=this.dk[t],s=3&t;let h;0===s?this.a^=this.a<<13:1===s?this.a^=this.a>>>6:2===s?this.a^=this.a<<2:3===s&&(this.a^=this.a>>>16),this.a+=this.dk[t+128&255],this.dk[t]=h=this.dk[i>>>2&255]+this.a+this.b,this.uk[t]=this.b=this.dk[h>>>8>>>2&255]+i}}}},2901:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(1069),e=s(1908);class n{static fk=t=>{let i=0;t=t.toUpperCase();for(let s=0;s=this.yk)return null;if(this.Ek[t])return this.Ek[t];const i=this._k[t],s=i+this.Ik[t];if(this.Ak){const h=Uint8Array.from(this.buffer.subarray(i,i+s));return this.Ek[t]=h,h}{const i=Uint8Array.from(e.A.read(this.mk[t],this.buffer,this.Ik[t],this._k[t]));return this.Ek[t]=i,i}}}},1069:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(9234),e=s(6666),n=s(4474);class r extends n.A{static Ck=3988292384;static Tk=new Int32Array(256);static Ok=new Uint32Array(33);static bk=new e.A;static vk=new e.A;static Lk=new e.A;static Rk=0;static Sk=0;static Mk=0;static{for(let t=0;t<32;t++)r.Ok[t]=(1<>>=1:i=i>>>1^r.Ck;r.Tk[t]=i}}static Bo=t=>{let i=4294967295;for(let s=0;s>>8^r.Tk[255&(i^t[s])];return~i};view;data;Fc=0;Bm=0;random=null;constructor(t){if(!t)throw new Error('Input src packet array was null!');super(),t instanceof Int8Array?this.data=new Uint8Array(t):this.data=t,this.view=new DataView(this.data.buffer,this.data.byteOffset,this.data.byteLength)}get length(){return this.view.byteLength}get available(){return this.length-this.Fc}static Ut=t=>{let i=null;return 0===t&&r.Rk>0?(r.Rk--,i=r.bk.ev()):1===t&&r.Sk>0?(r.Sk--,i=r.vk.ev()):2===t&&r.Mk>0&&(r.Mk--,i=r.Lk.ev()),i?(i.Fc=0,i):new r(0===t?new Uint8Array(100):1===t?new Uint8Array(5e3):new Uint8Array(3e4))};release(){this.Fc=0,100===this.view.byteLength&&r.Rk<1e3?(r.bk.n_(this),r.Rk++):5e3===this.view.byteLength&&r.Sk<250?(r.vk.n_(this),r.Sk++):3e4===this.view.byteLength&&r.Mk<50&&(r.Lk.n_(this),r.Mk++)}get ZA(){return this.view.getUint8(this.Fc++)}get zA(){return this.view.getInt8(this.Fc++)}get KA(){const t=this.view.getUint16(this.Fc);return this.Fc+=2,t}get tp(){const t=this.view.getInt16(this.Fc);return this.Fc+=2,t}get dg(){const t=this.view.getUint8(this.Fc++)<<16|this.view.getUint16(this.Fc);return this.Fc+=2,t}get Ko(){const t=this.view.getInt32(this.Fc);return this.Fc+=4,t}get Uc(){const t=this.view.getBigInt64(this.Fc);return this.Fc+=8,t}get kR(){return this.view.getUint8(this.Fc)<128?this.ZA-64:this.KA-49152}get nO(){return this.view.getUint8(this.Fc)<128?this.ZA:this.KA-32768}get ly(){const t=this.view,i=t.byteLength;let s,h='';for(;10!==(s=t.getUint8(this.Fc++))&&this.Fc>16),this.view.setUint16(this.Fc,t),this.Fc+=2}p4(t){this.view.setInt32(this.Fc,t),this.Fc+=4}xk(t){this.view.setInt32(this.Fc,t,!0),this.Fc+=4}nA(t){this.view.setBigInt64(this.Fc,t),this.Fc+=8}Bc(t){const i=this.view,s=t.length;for(let h=0;h>>3,s=8-(7&this.Bm),h=0;for(this.Bm+=t;t>s;s=8)h+=(this.view.getUint8(i++)&r.Ok[s])<>>s-t&r.Ok[t],h}Gc(t,i){const s=this.Fc;this.Fc=0;const e=new Uint8Array(s);this.xy(s,0,e);const n=(0,h.Dk)(e),r=(0,h.Nk)(n,i,t),o=(0,h.Pk)(r);this.Fc=0,this.p1(o.length),this.Hc(o,o.length,0)}}},353:(t,i,s)=>{s.d(i,{A:()=>h});class h{static Fk=[95,218,67,50,253,222,194,60,101,128,8,251,92,111,24,33,223,66,232,59,227,113,153,105,126,98,167,102,177,238,62,190,147,23,150,151,156,144,193,155,81,0,198,22,137,210,179,16,168,170,32,181,248,141,58,87,208,106,180,191,221,241,40,176,196,154,65,145,230,78,30,161,188,41,14,129,18,199,47,247,225,34,51,10,159,75,12,56,61,31,39,91,46,242,134,5,122,123,209,228,104,195,21,3,11,44,107,172,6,186,110,215,205,103,27,185,124,77,252,117,86,115,127,207,52,79,43,97,219,116,169,7,118,162,108,36,20,233,88,135,80,19,42,237,57,152,71,9,250,17,4,119,234,130,26,200,189,163,254,245,197,171,220,235,140,244,184,94,211,231,99,246,121,212,112,204,63,148,83,178,1,255,131,13,183,142,236,45,55,35,243,136,37,85,100,160,38,224,146,174,82,48,109,132,125,90,143,138,240,173,165,164,192,175,29,74,28,114,213,73,64,206,76,139,96,2,229,15,93,25,239,202,49,70,214,201,72,203,68,89,69,157,216,217,249,120,226,84,149,187,54,53,158,166,182,133,0];static VA=[0,-2,4,6,-1,0,0,2,0,0,0,0,5,4,2,2,0,0,0,0,2,-2,2,14,0,6,3,0,4,0,0,0,3,0,0,0,0,0,0,0,0,-1,4,2,6,0,6,0,0,3,7,0,0,0,-1,0,0,0,0,4,0,0,0,0,0,0,0,0,1,15,0,0,0,0,6,0,2,0,0,0,2,0,0,0,1,0,0,4,0,0,0,0,0,0,0,0,0,0,-2,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,-2,0,0,2,0,0,0,2,9,0,0,0,0,0,4,0,0,0,3,7,9,0,0,0,0,0,0,0,0,0,-2,0,0,0,0,3,2,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,-2,2,0,0,0,0,0,6,0,0,0,2,0,2,0,0,0,-2,0,0,4,0,0,0,0,6,0,0,-2,-2,0,0,0,0,0,0,-2,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,-2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0]}},2215:(t,i,s)=>{s.d(i,{A:()=>h});class h{static Jy=14;static Ly=28;static Op=129;static My=167;static Ip=168;static qy=195;static _p=2;static gp=26;static Ap=46;static dp=84;static ap=87;static jy=103;static Sy=146;static hy=197;static bp=201;static Xy=204;static Qy=209;static Hy=126;static cp=185;static By=15;static Ny=98;static Mp=213;static up=74;static Sp=13;static ip=3;static Tp=239;static JA=1;static kp=184;static Dy=133;static Py=226;static wp=4;static Cp=21;static Zy=32;static fA=41;static jA=152;static Ay=19;static Rp=22;static ny=25;static qA=43;static vp=44;static fp=68;static Ep=136;static yy=139;static Gy=140;static uy=142;static Uy=243;static Yy=254;static wy=20;static $A=80;static op=132;static ky=220;static ty=237;static XA=150;static Ry=175;static lp=193;static Vy=12;static oy=54;static Wy=212;static zy=7;static sp=135;static Lp=162;static my=23;static Ty=42;static gy=49;static Iy=50;static by=59;static Ey=69;static Oy=76;static py=151;static _y=191;static Cy=223}},3937:(t,i,s)=>{s.d(i,{A:()=>o});class h{start=0;end=0;form=0;length=0;Uk=null;Bk=null;threshold=0;position=0;delta=0;amplitude=0;Gk=0;read(t){this.form=t.ZA,this.start=t.Ko,this.end=t.Ko,this.length=t.ZA,this.Uk=new Int32Array(this.length),this.Bk=new Int32Array(this.length);for(let i=0;i=this.threshold&&this.Bk&&this.Uk&&(this.amplitude=this.Bk[this.position++]<<15,this.position>=this.length&&(this.position=this.length-1),this.threshold=this.Uk[this.position]/65536*t|0,this.threshold>this.Gk&&(this.delta=((this.Bk[this.position]<<15)-this.amplitude)/(this.threshold-this.Gk)|0)),this.amplitude+=this.delta,this.Gk++,this.amplitude-this.delta>>15}}class e{static buffer=null;static PT=null;static sin=null;static Hk=new Int32Array(5);static Wk=new Int32Array(5);static Yk=new Int32Array(5);static Vk=new Int32Array(5);static Kk=new Int32Array(5);Xk=null;zk=null;jk=null;Zk=null;qk=null;$k=null;release=null;attack=null;Jk=new Int32Array(5);Qk=new Int32Array(5);tx=new Int32Array(5);start=0;length=500;ix=100;sx=0;static init=()=>{this.PT=new Int32Array(32768);for(let t=0;t<32768;t++)Math.random()>.5?this.PT[t]=1:this.PT[t]=-1;this.sin=new Int32Array(32768);for(let t=0;t<32768;t++)this.sin[t]=16384*Math.sin(t/5215.1903)|0;this.buffer=new Int32Array(220500)};Xc(t,i){for(let i=0;i>1,r+=(i*h>>16)+n}if(this.qk&&this.$k){const i=this.qk.evaluate(t),s=this.$k.evaluate(t);c=c*(32768+(this.hx(s,a,this.qk.form)>>1))>>15,a+=(i*o>>16)+l}for(let h=0;h<5;h++)if(0!==this.Jk[h]){const n=i+e.Wk[h];n>15,e.Hk[h],this.Xk.form),e.Hk[h]+=(s*e.Vk[h]>>16)+e.Kk[h])}}if(this.release&&this.attack){this.release.reset(),this.attack.reset();let i=0,s=!0;for(let h=0;h>8):this.release.start+((this.release.end-this.release.start)*r>>8),i+=256,i>=o&&(i=0,s=!s),s&&(e.buffer[h]=0)}}if(this.sx>0&&this.ix>0){const i=this.sx*s;for(let s=i;s32767&&(e.buffer[i]=32767);return e.buffer}hx(t,i,s){return 1===s?(32767&i)<16384?t:-t:2===s?e.sin[32767&i]*t>>14:3===s?((32767&i)*t>>14)-t:4===s?e.PT[i/2607&32767]*t:0}read(t){this.Xk=new h,this.Xk.read(t),this.zk=new h,this.zk.read(t),0!==t.ZA&&(t.Fc--,this.jk=new h,this.jk.read(t),this.Zk=new h,this.Zk.read(t)),0!==t.ZA&&(t.Fc--,this.qk=new h,this.qk.read(t),this.$k=new h,this.$k.read(t)),0!==t.ZA&&(t.Fc--,this.release=new h,this.release.read(t),this.attack=new h,this.attack.read(t));for(let i=0;i<10;i++){const s=t.nO;if(0===s)break;this.Jk[i]=s,this.Qk[i]=t.kR,this.tx[i]=t.nO}this.sx=t.nO,this.ix=t.nO,this.length=t.KA,this.start=t.KA}}var n=s(1069),r=s(3867);class o{static Ky=new Int32Array(1e3);static nx=null;static ox=null;static lx=new r.ds(1e3,null);ux=new r.ds(10,null);wx=0;loopEnd=0;static ec=t=>{const i=new n.A(t.read('sounds.dat'));for(this.nx=new Uint8Array(441e3),this.ox=new n.A(this.nx),e.init();;){const t=i.KA;if(65535===t)break;const s=new o;s.read(i),this.lx[t]=s,this.Ky[t]=s.trim()}};static Xc=(t,i)=>{if(!this.lx[t])return null;const s=this.lx[t];return s?.Ax(i)??null};read(t){for(let i=0;i<10;i++)0!==t.ZA&&(t.Fc--,this.ux[i]=new e,this.ux[i]?.read(t));this.wx=t.KA,this.loopEnd=t.KA}trim(){let t=9999999;for(let i=0;i<10;i++)this.ux[i]&&(this.ux[i].start/20|0)i&&(i=this.ux[t].length+this.ux[t].start);if(0===i)return 0;let s=22050*i/1e3|0,h=22050*this.wx/1e3|0,e=22050*this.loopEnd/1e3|0;(h<0||e<0||e>s||h>=e)&&(t=0);let n=s+(e-h)*(t-1);for(let t=44;t>8<<24>>24)}if(t>1){h+=44,e+=44,s+=44,n+=44;const i=n-s;for(let t=s-1;t>=e;t--)o.nx&&(o.nx[t+i]=o.nx[t]);for(let i=1;i{s.d(i,{$a:()=>a,qa:()=>o,ds:()=>h,uO:()=>e,Cr:()=>n,aO:()=>r,Kn:()=>l});class h extends Array{constructor(t,i){super(t);for(let s=0;s{s.d(i,{Pk:()=>l,Ho:()=>e,Dk:()=>o,Wo:()=>h,Xa:()=>n,Oc:()=>r,Nk:()=>a});const h=async t=>new Promise((i=>setTimeout(i,t))),e=async t=>new Int8Array(await(await fetch(t)).arrayBuffer()),n=async t=>(await fetch(t)).text();function r(t,i,s,h,e){for(;e--;)s[h++]=t[i++]}function o(t){let i=0n;for(let s=0;s0n;)i.unshift(Number(0xffn&t)),t>>=8n;return 128&i[0]&&i.unshift(0),new Uint8Array(i)}function a(t,i,s){let h=1n;for(;i>0n;)i%2n===1n&&(h=h*t%s),t=t*t%s,i>>=1n;return h}},7953:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1069);class e{static yx=new Uint16Array(['d','o','t'].join('').split('').map((t=>t.charCodeAt(0))));static mx=new Uint16Array(['(','a',')'].join('').split('').map((t=>t.charCodeAt(0))));static Ix=new Uint16Array(['s','l','a','s','h'].join('').split('').map((t=>t.charCodeAt(0))));static _x=['cook',"cook's",'cooks','seeks','sheet'];static Ex=[];static gx=[];static Cx=[];static Tx=[];static Ox=[];static bx=[];static ec=t=>{const i=new h.A(t.read('fragmentsenc.txt')),s=new h.A(t.read('badenc.txt')),e=new h.A(t.read('domainenc.txt')),n=new h.A(t.read('tldlist.txt'));this.read(s,e,i,n)};static filter=t=>{const i=[...t];this.format(i);const s=i.join('').trim(),h=s.toLowerCase(),e=[...h];this.vx(e),this.Lx(e),this.Rx(e),this.Sx(e);for(let t=0;t{this.xx(t),this.Dx(i),this.Nx(s),this.Px(h)};static Px=t=>{const i=t.Ko;for(let s=0;st.ZA))};static xx=t=>{const i=t.Ko;for(let s=0;st.ZA));const i=new Array(t.ZA).fill([]).map((()=>[t.zA,t.zA]));i.length>0&&(this.Tx[s]=i)}};static Dx=t=>{const i=t.Ko;for(let s=0;st.ZA))};static Nx=t=>{const i=t.Ko;for(let s=0;s{const i=[...t],s=[...t];this.Fx(null,i,this.yx),this.Fx(null,s,this.Ix);for(let h=0;h{for(let i=0;i<2;i++)for(let i=this.Cx.length-1;i>=0;i--)this.Fx(this.Tx[i],t,this.Cx[i])};static Rx=t=>{const i=[...t],s=[...t];this.Fx(null,i,this.mx),this.Fx(null,s,this.yx);for(let h=this.Ox.length-1;h>=0;h--)this.Bx(s,i,this.Ox[h],t)};static Sx=t=>{for(let i=0;i=0&&e{if(this.Xx(t))return!0;const i=this.zx(t),s=this.bx,h=s.length;if(i===s[0]||i===s[h-1])return!0;let e=0,n=h-1;for(;e<=n;){const t=(e+n)/2|0;if(i===s[t])return!0;i{if(t.length>6)return 0;let i=0;for(let s=0;s{for(let s=i;s=0;s++)if(this.Zx(t[s]))return s;return-1};static Vx=(t,i)=>{for(let s=t;s=0;s++)if(!this.Zx(i[s]))return s;return i.length};static qx=(t,i,s)=>i===s||'o'===i&&'0'===s?1:'o'===i&&'('===s&&')'===t?2:'c'!==i||'('!==s&&'<'!==s&&'['!==s?'e'===i&&'€'===s||'s'===i&&'$'===s||'l'===i&&'i'===s?1:0:1;static Bx=(t,i,s,h)=>{const e=s.length,n=h.length;for(let r=0;r<=n-e;r++){const{$x:e,Jx:n}=this.Qx(r,s,h);if(!e)continue;const o=this.tD(r,h,3,i,['@']),l=this.iD(n-1,h,3,t,['.',',']);(o>2||l>2)&&this.Yx(r,n,h)}};static Qx=(t,i,s)=>{const h=i.length;let e=t,n=0;for(;e0)e+=l,n++;else{if(0===n)break;const s=this.qx(o,String.fromCharCode(i[n-1]),r);if(s>0)e+=s,1===n&&t++;else{if(n>=h||!this.Hx(r))break;e++}}}return{$x:n>=h,Jx:e}};static Fx=(t,i,s)=>{if(!(s.length>i.length))for(let h=0;h<=i.length-s.length;h++){let e=h;const{Jx:n,sD:r,hD:o,eD:l,nD:a}=this.rD(i,s,e);e=n;let c=i[e],f=e+1=s.length)||l&&a)continue;let u,d=!0;if(o){let t=!1,s=!1;if((h-1<0||this.Hx(i[h-1])&&"'"!==i[h-1])&&(t=!0),(e>=i.length||this.Hx(i[e])&&"'"!==i[e])&&(s=!0),!t||!s){let s=!1;for(u=h-2,t&&(u=h);!s&&u=0&&(!this.Hx(i[u])||"'"===i[u])){const t=[];let h;for(h=0;h<3&&u+h=0&&(!this.Hx(i[u-1])||"'"===i[u-1])&&(e=!1),e&&!this.Kx(t)&&(s=!0)}u++}s||(d=!1)}}else{c=' ',h-1>=0&&(c=i[h-1]),f=' ',e{let h=s,e=0,n=0,r=!1,o=!1,l=!1;for(;h=t.length||o&&l);){const a=t[h],c=h+10)1===f&&this.Zx(a)&&(o=!0),2===f&&(this.Zx(a)||this.Zx(c))&&(o=!0),h+=f,e++;else{if(0===e)break;let t;if((t=this.cD(c,String.fromCharCode(i[e-1]),a))>0)h+=t;else{if(e>=i.length||!this.Wx(a))break;if(this.Hx(a)&&"'"!==a&&(r=!0),this.Zx(a)&&(l=!0),h++,n++,(100*n/(h-s)|0)>90)break}}}return{Jx:h,sD:e,hD:r,eD:o,nD:l}};static cD=(t,i,s)=>{if(i===s)return 1;if(i>='a'&&i<='m'){if('a'===i)return'4'!==s&&'@'!==s&&'^'!==s?'/'===s&&'\\'===t?2:0:1;if('b'===i)return'6'!==s&&'8'!==s?'1'===s&&'3'===t?2:0:1;if('c'===i)return'('!==s&&'<'!==s&&'{'!==s&&'['!==s?0:1;if('d'===i)return'['===s&&')'===t?2:0;if('e'===i)return'3'!==s&&'€'!==s?0:1;if('f'===i)return'p'===s&&'h'===t?2:'£'===s?1:0;if('g'===i)return'9'!==s&&'6'!==s?0:1;if('h'===i)return'#'===s?1:0;if('i'===i)return'y'!==s&&'l'!==s&&'j'!==s&&'1'!==s&&'!'!==s&&':'!==s&&';'!==s&&'|'!==s?0:1;if('j'===i)return 0;if('k'===i)return 0;if('l'===i)return'1'!==s&&'|'!==s&&'i'!==s?0:1;if('m'===i)return 0}if(i>='n'&&i<='z'){if('n'===i)return 0;if('o'===i)return'0'!==s&&'*'!==s?'('===s&&')'===t||'['===s&&']'===t||'{'===s&&'}'===t||'<'===s&&'>'===t?2:0:1;if('p'===i)return 0;if('q'===i)return 0;if('r'===i)return 0;if('s'===i)return'5'!==s&&'z'!==s&&'$'!==s&&'2'!==s?0:1;if('t'===i)return'7'!==s&&'+'!==s?0:1;if('u'===i)return'v'===s?1:'\\'===s&&'/'===t||'\\'===s&&'|'===t||'|'===s&&'/'===t?2:0;if('v'===i)return'\\'===s&&'/'===t||'\\'===s&&'|'===t||'|'===s&&'/'===t?2:0;if('w'===i)return'v'===s&&'v'===t?2:0;if('x'===i)return')'===s&&'('===t||'}'===s&&'{'===t||']'===s&&'['===t||'>'===s&&'<'===t?2:0;if('y'===i)return 0;if('z'===i)return 0}return i>='0'&&i<='9'?'0'===i?'o'===s||'O'===s?1:'('===s&&')'===t||'{'===s&&'}'===t||'['===s&&']'===t?2:0:'1'===i&&'l'===s?1:0:','===i?'.'===s?1:0:'.'===i?','===s?1:0:'!'===i&&'i'===s?1:0};static lD=(t,i,s)=>{let h=0,e=i.length-1;for(;h<=e;){const n=(h+e)/2|0;if(i[n][0]===t&&i[n][1]===s)return!0;tthis.jx(t)?t.charCodeAt(0)+1-'a'.charCodeAt(0):"'"===t?28:this.Zx(t)?t.charCodeAt(0)+29-'0'.charCodeAt(0):27;static Ux=(t,i,s,h,e)=>{if(!(h.length>s.length))for(let n=0;n<=s.length-h.length;n++){const{Jx:r,fD:o}=this.uD(s,h,n);if(o0&&c>0&&(l=!0),2===i&&(a>2&&c>0||a>0&&c>2)&&(l=!0),3===i&&a>0&&c>2&&(l=!0),!l)continue;let f,u=n,d=r-1,w=!1;if(a>2){if(4===a)for(w=!1,f=n-1;f>=0;f--)if(w){if('*'!==e[f])break;u=f}else'*'===e[f]&&(u=f,w=!0);for(w=!1,f=u-1;f>=0;f--)if(w){if(this.Hx(s[f]))break;u=f}else this.Hx(s[f])||(w=!0,u=f)}if(c>2){if(4===c)for(w=!1,f=d+1;f{let h=0;for(;s0)s+=r,h++;else{if(0===h)break;let t;if((t=this.qx(n,String.fromCharCode(i[h-1]),e))>0)s+=t;else{if(!this.Hx(e))break;s++}}}return{Jx:s,fD:h}};static Hx=t=>!this.aD(t)&&!this.Zx(t);static Wx=t=>!this.jx(t)||('v'===t||'x'===t||'j'===t||'q'===t||'z'===t);static aD=t=>this.jx(t)||this.dD(t);static Zx=t=>t>='0'&&t<='9';static jx=t=>t>='a'&&t<='z';static dD=t=>t>='A'&&t<='Z';static Xx=t=>{for(let i=0;i{for(let h=t;h{let s=0;for(let h=i-1;h>=0&&this.Hx(t[h]);h--)'*'===t[h]&&s++;return s};static AD=(t,i)=>{let s=0;for(let h=i+1;h(e?this.wD(i,s):this.AD(i,s))>=h?4:this.Hx(e?t[s-1]:t[s+1])?1:0;static tD=(t,i,s,h,e)=>{if(0===t)return 2;for(let s=t-1;s>=0&&this.Hx(i[s]);s--)if(e.includes(i[s]))return 3;return this.yD(i,h,t,s,!0)};static iD=(t,i,s,h,e)=>{if(t+1===i.length)return 2;for(let s=t+1;s{let i=0;for(let s=0;st>=' '&&t<=''||' '===t||'\n'===t||'\t'===t||'£'===t||'€'===t;static Mx=(t,i)=>{for(let s=0;s{let i=!0;for(let s=0;s{s.d(i,{A:()=>h});class h{static mD=[' ','e','t','a','o','i','h','n','s','r','d','l','u','m','w','c','y','f','g','p','b','v','k','x','j','q','z','0','1','2','3','4','5','6','7','8','9',' ','!','?','.',',',':',';','(',')','-','&','*','\\','\'','@','#','+','=','£','$','%','"','[',']'];static ID=[];static ec=(t,i)=>{let s,h=0,e=-1;for(let n=0;n>4&15,-1!==e?(this.ID[h++]=this.mD[(e<<4)+s-195],e=-1):s<13?this.ID[h++]=this.mD[s]:e=s,s=15&i,-1!==e?(this.ID[h++]=this.mD[(e<<4)+s-195],e=-1):s<13?this.ID[h++]=this.mD[s]:e=s}let n=!0;for(let t=0;t='a'&&i<='z'&&(this.ID[t]=i.toUpperCase(),n=!1),'.'!==i&&'!'!==i||(n=!0)}return this.ID.slice(0,h).join('')};static uA=(t,i)=>{i.length>80&&(i=i.substring(0,80)),i=i.toLowerCase();let s=-1;for(let h=0;h12&&(n+=195),-1===s?n<13?s=n:t.p1(n):n<13?(t.p1((s<<4)+n),s=-1):(t.p1((s<<4)+(n>>4)),s=15&n)}-1!==s&&t.p1(s<<4)}}},1908:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(9763);class e{static _D=null;static load=async t=>{this._D=await(0,h.F)(new WebAssembly.Module(t),{env:void 0})};static read=(t,i,s,h)=>{if(!this._D)throw new Error('bz2 not found!!');return Int8Array.from(this._D.read(t,i,s,h))}}},123:(t,i,s)=>{let h;async function e(t,i){n(i);try{const i=await window.audioContext.decodeAudioData(Uint8Array.from(t).buffer);let s=window.audioContext.createBufferSource();s.buffer=i,s.connect(h),s.start()}catch(t){console.log(t)}}function n(t){h||(h=window.audioContext.createGain(),h.connect(window.audioContext.destination)),h.gain.value=t/256}function r(t,i){window._tinyMidiPlay&&window._tinyMidiPlay(t,i/256)}function o(t){window._tinyMidiVolume&&window._tinyMidiVolume(t/256)}function l(){window._tinyMidiStop&&window._tinyMidiStop()}s.d(i,{zc:()=>e,Xo:()=>r,jp:()=>n,vo:()=>l,zp:()=>o})},9763:(t,i,s)=>{async function h(t,i={}){const s={env:Object.assign(Object.create(globalThis),i.env||{},{abort(t,i,s,h){t=r(t>>>0),i=r(i>>>0),s>>>=0,h>>>=0,(()=>{throw Error(`${t} in ${i}:${s}:${h}`)})()}})},{exports:h}=await WebAssembly.instantiate(t,s),e=h.memory||i.env.memory,n=Object.setPrototypeOf({read:(t,i,s,n)=>(i=function(t,i,s,n,r){if(null==n)return 0;const o=n.length,l=h.__pin(h.__new(o<>>0;if(r)new r(e.buffer,l,o).set(n);else for(let i=0;i>>0),n[i]);return h.__unpin(l),l}(l,6,0,i,Int8Array)||function(){throw TypeError("value must not be null")}(),function(t,i,s){if(!s)return null;const h=function(t){try{return o.getUint32(t,!0)}catch{return o=new DataView(e.buffer),o.getUint32(t,!0)}}(s-4)>>>i,n=new Array(h);for(let e=0;e>>0));return n}(a,0,h.read(t,i,s,n)>>>0))},h);function r(t){if(!t)return null;const i=t+new Uint32Array(e.buffer)[t-4>>>2]>>>1,s=new Uint16Array(e.buffer);let h=t>>>1,n="";for(;i-h>1024;)n+=String.fromCharCode(...s.subarray(h,h+=1024));return n+String.fromCharCode(...s.subarray(h,i))}let o=new DataView(e.buffer);function l(t,i){try{o.setUint8(t,i,!0)}catch{o=new DataView(e.buffer),o.setUint8(t,i,!0)}}function a(t){try{return o.getInt8(t,!0)}catch{return o=new DataView(e.buffer),o.getInt8(t,!0)}}return n}s.d(i,{F:()=>h})},9896:(t,i,s)=>{var h=s(8151);!function(){window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioContext&&(window.audioContext=new window.AudioContext);var t=function(i){if(window.audioContext){var s=window.audioContext.createBuffer(1,1,22050),h=window.audioContext.createBufferSource();h.buffer=s,h.connect(window.audioContext.destination),h.start?h.start(0):h.play?h.play(0):h.noteOn&&h.noteOn(0)}document.removeEventListener('touchstart',t),document.removeEventListener('touchend',t),document.removeEventListener('click',t)};document.addEventListener('touchstart',t),document.addEventListener('touchend',t),document.addEventListener('click',t)}(),(async()=>{let t=new Float32Array,i=window.audioContext.createGain();i.gain.value=.1,i.connect(window.audioContext.destination);let s=window.audioContext.currentTime,e=[];const n=new h.A({ED:30,gD:i=>{let s=new Float32Array(i.buffer),h=new Float32Array(t.length+s.length);h.set(t,0),h.set(s,t.length),t=h},CD:t=>{},bufferSize:102400});await n.init();const r=await fetch('./SCC1_Florestan.sf2'),o=new Uint8Array(await r.arrayBuffer());function l(){if(!window.audioContext||!t.length)return;let h=window.audioContext.createBufferSource();const n=t.length/2,r=window.audioContext.createBuffer(2,n,44100);for(let i=0;i<2;i++){const s=r.getChannelData(i);let h=i;for(let i=0;i{if(a&&clearInterval(a),t=new Float32Array,e.length){let t=i.gain.value;i.gain.value=0,e.forEach((t=>{t.stop(window.audioContext.currentTime)})),e=[],i.gain.value=t}},window._tinyMidiVolume=(t=1)=>{i.gain.value=t},window._tinyMidiPlay=async(t,i=1)=>{t&&(await window._tinyMidiStop(),-1!=i&&window._tinyMidiVolume(i),s=window.audioContext.currentTime,a=setInterval(l,250),n.OD(t))}})()},8151:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(5473);const e=class{constructor(t={}){this.bD=void 0,this.vD=0,this.LD=0,this.RD=0,this.ED=t.ED||100,this.sampleRate=t.sampleRate||44100,this.SD=t.SD||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.MD(1),this.gD=t.gD||(()=>{}),this.CD=t.CD||(()=>{}),this.kD=void 0,this.test=0}async init(){if(!this.bD){if('undefined'!=typeof process){const{xD:t}=await import('path'),{DD:i}=await import('module');globalThis.__dirname=t("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js"),globalThis.require=i("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js")}this.bD=await(0,h.A)(),this.ND=this.bD._malloc(this.bufferSize),this.PD=this.bD._malloc(8)}}MD(t){this.bufferSize=4*this.sampleRate*this.SD*t}FD(){if(!this.bD)throw new Error(`${this.constructor.name} not initalized. call .init()`)}TD(t){this.FD();const{_malloc:i,_free:s,_tsf_load_memory:h,_tsf_set_output:e,_tsf_channel_set_bank_preset:n,_tsf_set_max_voices:r,_tsf_channel_set_presetnumber:o}=this.bD;s(this.vD),this.vD=i(t.length),this.bD.HEAPU8.set(t,this.vD),this.LD=h(this.vD,t.length),e(this.LD,2===this.SD?0:2,this.sampleRate,this.gain)}UD(){this.FD();const t=new Uint8Array(this.bufferSize);return t.set(this.bD.HEAPU8.subarray(this.ND,this.ND+this.bufferSize)),t}BD(t){const{_malloc:i,_free:s,_tml_load_memory:h}=this.bD;return s(this.RD),this.RD=i(t.length),this.bD.HEAPU8.set(t,this.RD),h(this.RD,t.length)}GD(t){const{_midi_render:i}=this.bD;return i(this.LD,t,this.SD,this.sampleRate,this.ND,this.bufferSize,this.PD)}OD(t){if(this.FD(),!this.LD)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.kD);const{setValue:i,getValue:s}=this.bD;i(this.PD,0,'double'),this.bD._tsf_reset(this.LD),this.bD._tsf_channel_set_bank_preset(this.LD,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let h=this.BD(t);const e=()=>{h=this.GD(h);const t=this.UD();this.gD(t),h?this.kD=setTimeout(e,this.ED):this.CD(s(this.PD,'double'))};this.kD=setTimeout(e,16)}}},8227:(t,i,s)=>{t.exports=s.p+"9f86b5397894e28b5ae2.wasm"},5473:(t,i,s)=>{var h;s.d(i,{A:()=>e});const e=(h="file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/tinymidipcm.mjs",function(t){var i,e,n=void 0!==(t=t||{})?t:{};n.ready=new Promise((function(t,s){i=t,e=s})),["_tsf_load_memory","_tsf_set_output","_tsf_channel_set_bank_preset","_tsf_set_max_voices","_tsf_channel_set_presetnumber","_tsf_reset","_tsf_close","_tml_load_memory","_midi_render","_malloc","_realloc","_free","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(n.ready,t)||Object.defineProperty(n.ready,t,{get:()=>z('You are getting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),set:()=>z('You are setting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js')})}));var r=Object.assign({},n),o=[],l='object'==typeof window,a='function'==typeof importScripts,c='object'==typeof process&&'object'==typeof process.versions&&'string'==typeof process.versions.node,f=!l&&!c&&!a;if(n.ENVIRONMENT)throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');var u,d,w,A='';if(c){if('undefined'==typeof process||!process.release||'node'!==process.release.name)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');var y,p;A=a?require('path').xD(A)+'/':__dirname+'/';var m=()=>{p||(y=require('fs'),p=require('path'))};u=(t,i)=>(m(),t=p.normalize(t),y.HD(t,i?void 0:'utf8')),w=t=>{var i=u(t,!0);return i.buffer||(i=new Uint8Array(i)),D(i.buffer),i},d=(t,i,s)=>{m(),t=p.normalize(t),y.WD(t,(function(t,h){t?s(t):i(h.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,'/'),o=process.argv.slice(2),process.on('uncaughtException',(function(t){if(!(t instanceof et))throw t})),process.on('unhandledRejection',(function(t){throw t})),n.inspect=function(){return'[Emscripten Module object]'}}else if(f){if('object'==typeof process&&'function'==typeof require||'object'==typeof window||'function'==typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');'undefined'!=typeof read&&(u=function(t){return read(t)}),w=function(t){let i;return'function'==typeof readbuffer?new Uint8Array(readbuffer(t)):(i=read(t,'binary'),D('object'==typeof i),i)},d=function(t,i,s){setTimeout((()=>i(w(t))),0)},'undefined'!=typeof scriptArgs?o=scriptArgs:void 0!==arguments&&(o=arguments),'undefined'!=typeof print&&('undefined'==typeof console&&(console={}),console.log=print,console.warn=console.error='undefined'!=typeof printErr?printErr:print)}else{if(!l&&!a)throw new Error('environment detection error');if(a?A=self.location.href:'undefined'!=typeof document&&document.currentScript&&(A=document.currentScript.src),h&&(A=h),A=0!==A.indexOf('blob:')?A.substr(0,A.replace(/[?#].*/,"").lastIndexOf('/')+1):'','object'!=typeof window&&'function'!=typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');u=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.send(null),i.responseText},a&&(w=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.responseType='arraybuffer',i.send(null),new Uint8Array(i.response)}),d=(t,i,s)=>{var h=new XMLHttpRequest;h.open('GET',t,!0),h.responseType='arraybuffer',h.onload=()=>{200==h.status||0==h.status&&h.response?i(h.response):s()},h.onerror=s,h.send(null)}}n.print||console.log.bind(console);var I,_,E=n.printErr||console.warn.bind(console);function g(t,i){Object.getOwnPropertyDescriptor(n,t)||Object.defineProperty(n,t,{configurable:!0,get:function(){z('Module.'+t+' has been replaced with plain '+i+' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')}})}function C(t){return'FS_createPath'===t||'FS_createDataFile'===t||'FS_createPreloadedFile'===t||'FS_unlink'===t||'addRunDependency'===t||'FS_createLazyFile'===t||'FS_createDevice'===t||'removeRunDependency'===t}Object.assign(n,r),r=null,I='fetchSettings',Object.getOwnPropertyDescriptor(n,I)&&z('`Module.'+I+'` was supplied but `'+I+'` not included in INCOMING_MODULE_JS_API'),n.arguments&&(o=n.arguments),g('arguments','arguments_'),n.thisProgram&&n.thisProgram,g('thisProgram','thisProgram'),n.quit&&n.quit,g('quit','quit_'),D(void 0===n.memoryInitializerPrefixURL,'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===n.pthreadMainPrefixURL,'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'),D(void 0===n.cdInitializerPrefixURL,'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===n.filePackagePrefixURL,'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'),D(void 0===n.read,'Module.read option was removed (modify read_ in JS)'),D(void 0===n.readAsync,'Module.readAsync option was removed (modify readAsync in JS)'),D(void 0===n.readBinary,'Module.readBinary option was removed (modify readBinary in JS)'),D(void 0===n.setWindowTitle,'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'),D(void 0===n.TOTAL_MEMORY,'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'),g('read','read_'),g('readAsync','readAsync'),g('readBinary','readBinary'),g('setWindowTitle','setWindowTitle'),D(!f,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),n.wasmBinary&&(_=n.wasmBinary),g('wasmBinary','wasmBinary');var T;n.noExitRuntime;g('noExitRuntime','noExitRuntime'),'object'!=typeof WebAssembly&&z('no native wasm support detected');var O,b,v,L,R,S,M,k,x=!1;function D(t,i){t||z('Assertion failed'+(i?': '+i:''))}function N(t){O=t,n.HEAP8=b=new Int8Array(t),n.HEAP16=L=new Int16Array(t),n.HEAP32=R=new Int32Array(t),n.HEAPU8=v=new Uint8Array(t),n.HEAPU16=new Uint16Array(t),n.HEAPU32=S=new Uint32Array(t),n.HEAPF32=M=new Float32Array(t),n.HEAPF64=k=new Float64Array(t)}'undefined'!=typeof TextDecoder&&new TextDecoder('utf8');var P=5242880;n.TOTAL_STACK&&D(P===n.TOTAL_STACK,'the stack size can no longer be determined at runtime');var F=n.INITIAL_MEMORY||16777216;function U(){if(!x){var t=ft(),i=S[t>>2],s=S[t+4>>2];34821223==i&&2310721022==s||z('Stack overflow! Stack cookie has been overwritten at 0x'+t.toString(16)+', expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+s.toString(16)+' 0x'+i.toString(16)),1668509029!==S[0]&&z('Runtime error: The application has corrupted its heap memory area (address zero)!')}}g('INITIAL_MEMORY','INITIAL_MEMORY'),D(F>=P,'INITIAL_MEMORY should be larger than TOTAL_STACK, was '+F+'! (TOTAL_STACK='+P+')'),D('undefined'!=typeof Int32Array&&'undefined'!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,'JS engine does not provide full typed array support'),D(!n.wasmMemory,'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'),D(16777216==F,'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'),function(){var t=new Int16Array(1),i=new Int8Array(t.buffer);if(t[0]=25459,115!==i[0]||99!==i[1])throw'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'}();var B=[],G=[],H=[],W=!1;D(Math.imul,'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.fround,'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.clz32,'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.trunc,'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');var Y=0,V=null,K=null,X={};function z(t){n.onAbort&&n.onAbort(t),E(t='Aborted('+t+')'),x=!0;var i=new WebAssembly.RuntimeError(t);throw e(i),i}var j={error:function(){z('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM')},init:function(){j.error()},YD:function(){j.error()},VD:function(){j.error()},KD:function(){j.error()},open:function(){j.error()},XD:function(){j.error()},zD:function(){j.error()},jD:function(){j.error()},ZD:function(){j.error()},qD:function(){j.error()}};n.FS_createDataFile=j.YD,n.FS_createPreloadedFile=j.VD;var Z,q,$,J,Q='data:application/octet-stream;base64,';function tt(t){return t.startsWith(Q)}function it(t){return t.startsWith('file://')}function st(t,i){return function(){var s=t,h=i;return i||(h=n.asm),D(W,'native function `'+s+'` called before runtime initialization'),h[t]||D(h[t],'exported native function `'+s+'` not found'),h[t].apply(null,arguments)}}function ht(t){try{if(t==Z&&_)return new Uint8Array(_);if(w)return w(t);throw"both async and sync fetching of the wasm failed"}catch(t){z(t)}}function et(t){this.name='ExitStatus',this.message='Program terminated with exit('+t+')',this.status=t}function nt(t){for(;t.length>0;)t.shift()(n)}function rt(t){rt.$D||(rt.$D={}),rt.$D[t]||(rt.$D[t]=1,c&&(t='warning: '+t),E(t))}function ot(t){try{return T.JD(t-O.byteLength+65535>>>16),N(T.buffer),1}catch(i){E('emscripten_realloc_buffer: Attempted to grow heap from '+O.byteLength+' bytes to '+t+' bytes, but got error: '+i)}}n.locateFile?tt(Z='tinymidipcm.wasm')||(q=Z,Z=n.locateFile?n.locateFile(q,A):A+q):Z=new URL(s(8227),s.b).toString();var lt,at={"emscripten_memcpy_big":function(t,i,s){v.copyWithin(t,i,i+s)},"emscripten_resize_heap":function(t){var i=v.length;D((t>>>=0)>i);var s,h,e=2147483648;if(t>e)return E('Cannot enlarge memory, asked to go up to '+t+' bytes, but the limit is '+e+' bytes!'),!1;for(var n=1;n<=4;n*=2){var r=i*(1+.2/n);r=Math.min(r,t+100663296);var o=Math.min(e,(s=Math.max(t,r))+((h=65536)-s%h)%h);if(ot(o))return!0}return E('Failed to grow the heap from '+i+' bytes to '+o+' bytes, not enough memory!'),!1}},ct=(function(){var t,i={'env':at,'wasi_snapshot_preview1':at};function s(t,i){var s,h=t.exports;n.asm=h,D(T=n.asm.memory,"memory not found in wasm exports"),N(T.buffer),D(n.asm.__indirect_function_table,"table not found in wasm exports"),s=n.asm.__wasm_call_ctors,G.unshift(s),function(t){if(Y--,n.monitorRunDependencies&&n.monitorRunDependencies(Y),t?(D(X[t]),delete X[t]):E('warning: run dependency removed without ID'),0==Y&&(null!==V&&(clearInterval(V),V=null),K)){var i=K;K=null,i()}}('wasm-instantiate')}t='wasm-instantiate',Y++,n.monitorRunDependencies&&n.monitorRunDependencies(Y),t?(D(!X[t]),X[t]=1,null===V&&'undefined'!=typeof setInterval&&(V=setInterval((function(){if(x)return clearInterval(V),void(V=null);var t=!1;for(var i in X)t||(t=!0,E('still waiting on run dependencies:')),E('dependency: '+i);t&&E('(end of list)')}),1e4))):E('warning: run dependency added without ID');var h=n;function r(t){D(n===h,'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'),h=null,s(t.instance)}function o(t){return function(){if(!_&&(l||a)){if('function'==typeof fetch&&!it(Z))return fetch(Z,{credentials:'same-origin'}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+Z+"'";return t.arrayBuffer()})).catch((function(){return ht(Z)}));if(d)return new Promise((function(t,i){d(Z,(function(i){t(new Uint8Array(i))}),i)}))}return Promise.resolve().then((function(){return ht(Z)}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){E('failed to asynchronously prepare wasm: '+t),it(Z)&&E('warning: Loading from a file URI ('+Z+') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing'),z(t)}))}if(n.instantiateWasm)try{return n.instantiateWasm(i,s)}catch(t){E('Module.instantiateWasm callback failed with error: '+t),e(t)}(_||'function'!=typeof WebAssembly.instantiateStreaming||tt(Z)||it(Z)||c||'function'!=typeof fetch?o(r):fetch(Z,{credentials:'same-origin'}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(r,(function(t){return E('wasm streaming compile failed: '+t),E('falling back to ArrayBuffer instantiation'),o(r)}))}))).catch(e)}(),n.___wasm_call_ctors=st("__wasm_call_ctors"),n._malloc=st("malloc"),n._free=st("free"),n._tsf_load_memory=st("tsf_load_memory"),n._tsf_close=st("tsf_close"),n._tsf_reset=st("tsf_reset"),n._tsf_set_output=st("tsf_set_output"),n._tsf_set_max_voices=st("tsf_set_max_voices"),n._realloc=st("realloc"),n._tsf_channel_set_presetnumber=st("tsf_channel_set_presetnumber"),n._tsf_channel_set_bank_preset=st("tsf_channel_set_bank_preset"),n._tml_load_memory=st("tml_load_memory"),n._midi_render=st("midi_render"),n.___errno_location=st("__errno_location"),n._fflush=st("fflush"),n._emscripten_stack_init=function(){return(ct=n._emscripten_stack_init=n.asm.emscripten_stack_init).apply(null,arguments)}),ft=(n._emscripten_stack_get_free=function(){return(n._emscripten_stack_get_free=n.asm.emscripten_stack_get_free).apply(null,arguments)},n._emscripten_stack_get_base=function(){return(n._emscripten_stack_get_base=n.asm.emscripten_stack_get_base).apply(null,arguments)},n._emscripten_stack_get_end=function(){return(ft=n._emscripten_stack_get_end=n.asm.emscripten_stack_get_end).apply(null,arguments)});function ut(){var t;ct(),D(!(3&(t=ft()))),S[t>>2]=34821223,S[t+4>>2]=2310721022,S[0]=1668509029}function dt(t){function s(){lt||(lt=!0,n.calledRun=!0,x||(D(!W),W=!0,U(),nt(G),i(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),D(!n._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(U(),n.postRun)for('function'==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)t=n.postRun.shift(),H.unshift(t);var t;nt(H)}()))}t=t||o,Y>0||(ut(),function(){if(n.preRun)for('function'==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)t=n.preRun.shift(),B.unshift(t);var t;nt(B)}(),Y>0||(n.setStatus?(n.setStatus('Running...'),setTimeout((function(){setTimeout((function(){n.setStatus('')}),1),s()}),1)):s(),U()))}if(n.stackSave=st("stackSave"),n.stackRestore=st("stackRestore"),n.stackAlloc=st("stackAlloc"),n.setValue=function(t,i,s="i8"){switch(s.endsWith('*')&&(s='*'),s){case'i1':case'i8':b[0|t]=i;break;case'i16':L[t>>1]=i;break;case'i32':R[t>>2]=i;break;case'i64':J=[i>>>0,($=i,+Math.abs($)>=1?$>0?(0|Math.min(+Math.floor($/4294967296),4294967295))>>>0:~~+Math.ceil(($-+(~~$>>>0))/4294967296)>>>0:0)],R[t>>2]=J[0],R[t+4>>2]=J[1];break;case'float':M[t>>2]=i;break;case'double':k[t>>3]=i;break;case'*':S[t>>2]=i;break;default:z('invalid type for setValue: '+s)}},n.getValue=function(t,i="i8"){switch(i.endsWith('*')&&(i='*'),i){case'i1':case'i8':return b[0|t];case'i16':return L[t>>1];case'i32':case'i64':return R[t>>2];case'float':return M[t>>2];case'double':return k[t>>3];case'*':return S[t>>2];default:z('invalid type for getValue: '+i)}return null},['run','UTF8ArrayToString','UTF8ToString','stringToUTF8Array','stringToUTF8','lengthBytesUTF8','addOnPreRun','addOnInit','addOnPreMain','addOnExit','addOnPostRun','addRunDependency','removeRunDependency','FS_createFolder','FS_createPath','FS_createDataFile','FS_createPreloadedFile','FS_createLazyFile','FS_createLink','FS_createDevice','FS_unlink','getLEB','getFunctionTables','alignFunctionTables','registerFunctions','prettyPrint','getCompilerSetting','print','printErr','callMain','abort','keepRuntimeAlive','wasmMemory','stackAlloc','stackSave','stackRestore','getTempRet0','setTempRet0','writeStackCookie','checkStackCookie','ptrToString','zeroMemory','stringToNewUTF8','exitJS','getHeapMax','emscripten_realloc_buffer','ENV','ERRNO_CODES','ERRNO_MESSAGES','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','DNS','getHostByName','Protocols','Sockets','getRandomDevice','warnOnce','traverseStack','UNWIND_CACHE','convertPCtoSourceLocation','readAsmConstArgsArray','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','handleException','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','freeTableIndexes','functionsInTableMap','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','PATH','PATH_FS','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16Decoder','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeArrayToMemory','writeAsciiToMemory','SYSCALLS','getSocketFromFD','getSocketAddress','JSEvents','registerKeyEventCallback','specialHTMLTargets','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','currentFullscreenStrategy','restoreOldWindowedStyle','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','demangle','demangleAll','jsStackTrace','stackTrace','ExitStatus','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','dlopenMissingError','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','uncaughtExceptionCount','exceptionLast','exceptionCaught','ExceptionInfo','exception_addRef','exception_decRef','Browser','setMainLoop','wget','FS','MEMFS','TTY','PIPEFS','SOCKFS','_setNetworkCallback','tempFixedLengthArray','miniTempWebGLFloatBuffers','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','GL','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','AL','SDL_unicode','SDL_ttfContext','SDL_audio','SDL','SDL_gfx','GLUT','EGL','GLFW_Window','GLFW','GLEW','IDBStore','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){Object.getOwnPropertyDescriptor(n,t)||Object.defineProperty(n,t,{configurable:!0,get:function(){var i="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";C(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),z(i)}})})),['ptrToString','zeroMemory','stringToNewUTF8','exitJS','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','getHostByName','getRandomDevice','traverseStack','convertPCtoSourceLocation','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeAsciiToMemory','getSocketFromFD','getSocketAddress','registerKeyEventCallback','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','ExceptionInfo','exception_addRef','exception_decRef','setMainLoop','_setNetworkCallback','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','SDL_unicode','SDL_ttfContext','SDL_audio','GLFW_Window','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){'undefined'==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var i='`'+t+'` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line';C(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),rt(i)}})})),K=function t(){lt||dt(),lt||(K=t)},n.preInit)for('function'==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return dt(),t.ready})}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var s=n[t]={exports:{}};return e[t](s,s.exports,r),s.exports}r.m=e,t="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",i="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",s="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",h=t=>{t&&t.d<1&&(t.d=1,t.forEach((t=>t.r--)),t.forEach((t=>t.r--?t.r++:t())))},r.a=(e,n,r)=>{var o;r&&((o=[]).d=-1);var l,a,c,f=new Set,u=e.exports,d=new Promise(((t,i)=>{c=i,a=t}));d[i]=u,d[t]=t=>(o&&t(o),f.forEach(t),d.catch((t=>{}))),e.exports=d,n((e=>{var n;l=(e=>e.map((e=>{if(null!==e&&"object"==typeof e){if(e[t])return e;if(e.then){var n=[];n.d=0,e.then((t=>{r[i]=t,h(n)}),(t=>{r[s]=t,h(n)}));var r={};return r[t]=t=>t(n),r}}var o={};return o[t]=t=>{},o[i]=e,o})))(e);var r=()=>l.map((t=>{if(t[s])throw t[s];return t[i]})),a=new Promise((i=>{(n=()=>i(r)).r=0;var s=t=>t!==o&&!f.has(t)&&(f.add(t),t&&!t.d&&(n.r++,t.push(n)));l.map((i=>i[t](s)))}));return n.r?a:r()}),(t=>(t?c(d[s]=t):a(u),h(o)))),o&&o.d<0&&(o.d=0)},r.d=(t,i)=>{for(var s in i)r.o(i,s)&&!r.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:i[s]})},r.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),r.p="/Client2/",r.b=document.baseURI||self.location.href;r(7906)})(); \ No newline at end of file diff --git a/interface-editor.js b/interface-editor.js index b8f106fd..0a980595 100644 --- a/interface-editor.js +++ b/interface-editor.js @@ -1 +1 @@ -(()=>{"use strict";var t,i,e,s,n={1651:(t,i,e)=>{e.d(i,{K:()=>k});var s=e(1120),n=e(4583),r=e(2901),h=e(1069),o=e(7046),l=(e(9896),e(6666)),a=e(3045),c=e(818),f=e(670),u=e(8268),d=e(3867),w=e(7854),y=e(8950),A=e(1302),m=e(9298),p=e(8665),g=e(1312),I=e(3819),_=e(8317),C=e(9234),E=e(1908),v=e(123),b=e(5637),T=e(6948),R=e(2164),O=e(8738),L=e(3764),S=e(8534),x=e(6730);class k extends o.A{static tt=225;static it=10;static portOffset=0;static members=!0;static et=!1;static st='';static nt='';static rt=!1;static ht=2;static ot=!1;static lt='https://raw.githubusercontent.com/2004scape/Server/main';static exponent=58778699976184461502525193738213253649000149147835990136706041084440742975821n;static ct=7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789n;static ft=0;static ut=0;static dt=0;static wt=0;static yt=0;static At=0;static gt=0;static It=0;static _t=0;static Ct=0;static Et=0;static vt=0;static bt=0;static Tt=0;static Rt=0;static Ot=()=>{a.A.et=!1,n.A.et=!1,k.et=!1,c.A.et=!1};static Lt=()=>{a.A.et=!0,n.A.et=!0,k.et=!0,c.A.et=!0};St=2048;xt=2047;kt=!1;Mt=!1;Dt=!1;Nt=!1;db=null;Ft=0;Bt=[];stream=null;in=h.A.Ut(1);Pt=h.A.Ut(1);Gt=h.A.Ut(1);Wt=0n;Yt=0;Ht=0;Vt=0;Kt=null;Xt=0;packetSize=0;jt=0;zt=0;Zt=0;qt=null;Jt=!0;$t=0;Qt=0;ti=null;ii=null;ei=null;si=null;ni=null;ri=null;hi=null;oi=null;li=null;ai=null;ci=null;fi='';ui='';username='';password='';di=null;wi=null;yi=null;Ai=null;mi=[];pi=!1;gi=null;Ii=null;_i=null;Ci=null;Ei=null;vi=null;bi=null;Ti=null;Ri=null;Oi=null;Li=new Int32Array(256);Si=0;xi=0;ki=0;Mi=null;Di=null;Ni=null;Fi=null;Bi=null;Ui=null;Pi=null;Gi=null;Wi=null;Yi=null;Hi=null;Vi=null;Ki=null;Xi=null;ji=null;zi=null;Zi=null;qi=null;Ji=null;$i=null;Qi=null;te=new Int32Array(33);ie=new Int32Array(33);ee=new Int32Array(151);se=new Int32Array(151);ne=null;re=null;he=null;oe=null;le=null;ae=null;ce=new d.fe(13,null);ue=null;de=null;we=new d.fe(50,null);ye=new d.fe(50,null);Ae=new d.fe(20,null);me=new d.fe(20,null);pe=null;ge=new d.fe(8,null);Ie=null;_e=null;Ce=null;Ee=null;ve=null;be=null;Te=null;Re=null;Oe=null;Le=null;Se=null;xe=null;ke=null;Me=null;De=null;Ne=null;Fe=null;Be=null;Ue=new d.fe(1e3,null);Pe=!1;Ge=!1;We=!1;Ye=!1;He=-1;Ve=0;Ke=0;Xe=0;je=0;ze=0;Ze=0;qe=!1;Je=0;$e=0;Qe=0;ts=0;es=0;ss=0;ns=[];rs=-1;hs=-1;os=new s.A;ls=78;cs=0;fs=0;us=[];ds=0;ws=0;ys=0;As=0;ps=0;gs=0;Is=0;_s=0;Cs=[];Es=[];vs=[];bs=[];Ts=null;Rs=-1;Os=3;Ls=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];Ss=0;xs=0;ks=0;Ms=!1;Ds=0;Ns=!1;Fs='';Bs='';Us=0;Ps='';Gs=!1;Ws=-1;Ys=new d.fe(100,null);Hs=new d.fe(100,null);messageType=new Int32Array(100);Vs=new Int32Array(100);Ks=0;Xs=0;js=0;zs='';Zs=0;qs=0;Js=0;$s=0;Qs=0;tn=0;en=0;sn=0;nn=0;rn=!1;hn=0;ln=0;an=0;cn=0;fn=null;un=0;dn=0;wn=0;yn=0;An=!1;mn=[];pn=[];gn=0;In=0;_n=0;Cn=null;En=0;vn=new Int32Array(500);bn=new Int32Array(500);Tn=new Int32Array(500);Rn=new Int32Array(500);On=0;Ln=0;Sn=0;xn='';kn=!1;Mn=-1;Dn=0;Nn=0;Fn=0;Bn=0;Un=0;Pn=new Int32Array(1e3);Gn=new Int32Array(1e3);Wn=null;Yn=0;Hn=0;Vn=0;Kn=0;Xn=0;jn=!1;zn=0;Zn=0;qn=0;Jn=0;$n=2;Qn=2;tr=1;ir=new Int32Array(5);er=new d.fe(5,!1);sr=new Int32Array(5);nr=new Int32Array(5);rr=new Int32Array(5);hr=0;lr=0;ar=0;cr=0;ur=0;dr=0;wr=0;yr=0;Ar=0;mr=1;pr=2;gr=-1;Ir=0;_r=0;Cr=0;Er=0;vr=0;br=0;Tr=null;Rr=null;Or=null;Lr=0;Sr=0;kr=new Int8Array(16384);Mr=new d.fe(f.A.Dr,null);Nr=0;Fr=0;Br=128;Ur=0;Pr=0;Gr=0;Wr=0;Yr=0;Hr=null;Vr=null;Kr=new d.Xr(f.A.jr,f.A.jr);zr=0;Zr=0;qr=0;Jr=0;$r=0;Qr=0;th=0;ih=0;eh=0;sh=0;nh=0;rh=0;hh=new d.fe(this.St,null);oh=0;lh=new Int32Array(this.St);ah=0;fh=0;uh=new Int32Array(this.St);dh=new Int32Array(1e3);wh=new d.fe(this.St,null);yh=new d.fe(8192,null);Ah=0;mh=new Int32Array(8192);ph=new l.A;gh=new l.A;Ih=new l.A;_h=new l.A;Ch=new d.Eh(f.A.Dr,f.A.jr,f.A.jr,null);bh=new l.A;Th=new Int32Array(4e3);Rh=new Int32Array(4e3);Oh=new Int32Array(f.A.jr*f.A.jr);Lh=new Int32Array(f.A.jr*f.A.jr);Sh=0;xh=null;kh=0;Mh=0;Dh=-1;Nh=0;Fh=0;Bh=0;Uh=0;Ph=!1;Gh=!0;Wh=!1;Yh=new Int32Array(7);Hh=new Int32Array(5);Vh=0;Kh=0;static Xh=50;jh=new Int32Array(k.Xh);zh=new Int32Array(k.Xh);Zh=new Int32Array(k.Xh);qh=new Int32Array(k.Xh);Jh=new Int32Array(k.Xh);$h=new Int32Array(k.Xh);Qh=new Int32Array(k.Xh);io=new d.fe(k.Xh,null);eo=new d.fe(100,null);so=new BigInt64Array(100);no=new Int32Array(100);ro=null;ho=0;oo=!0;lo=new Int32Array(50);ao=new Int32Array(50);co=new Int32Array(50);fo=192;uo=-1;do=-1;wo=0;yo=0;Ao=0;mo=!0;po=null;Io=0;_o=0;Co=192;Eo=new d.fe(16,null);vo=0;bo=!1;To=()=>{try{this.stream&&this.stream.close()}catch(t){}this.stream=null,(0,v.Ro)(),this.Pt=null,this.Gt=null,this.in=null,this.Or=null,this.Tr=null,this.Rr=null,this.Hr=null,this.Vr=null,this.Wn=null,this.Mr=null,this.Oh=null,this.Lh=null,this.Th=null,this.Rh=null,this.kr=null,this.Di=null,this.Ni=null,this.Fi=null,this.Bi=null,this.Ui=null,this.Pi=null,this.Gi=null,this.Wi=null,this.Yi=null,this.Hi=null,this.Vi=null,this.Ki=null,this.Xi=null,this.ji=null,this.zi=null,this.Zi=null,this.qi=null,this.ne=null,this.he=null,this.re=null,this.oe=null,this.le=null,this.ae=null,this.ce=null,this.Te=null,this.Re=null,this.Oe=null,this.Le=null,this.Se=null,this.xe=null,this.ke=null,this.Me=null,this.De=null,this.Ne=null,this.de=null,this.Ae=null,this.me=null,this.ge=null,this.Ie=null,this._e=null,this.Ce=null,this.Ee=null,this.we=null,this.ye=null,this.Kr=null,this.hh=null,this.lh=null,this.uh=null,this.wh=null,this.dh=null,this.yh=null,this.mh=null,this.Ch=null,this.bh=null,this._h=null,this.ph=null,this.gh=null,this.Ih=null,this.Tn=null,this.Rn=null,this.vn=null,this.bn=null,this.ns=null,this.mn=null,this.Pn=null,this.Gn=null,this.Ue=null,this.ue=null,this.eo=null,this.so=null,this.no=null,this.si=null,this.ni=null,this.ti=null,this.ii=null,this.ei=null,this.ri=null,this.hi=null,this.oi=null,this.li=null,this.Oo(),b.A.To(),T.A.To(),A.A.To(),R.A.Lo=null,_.A.Lo=null,s.A.Lo=null,g.A.Lo=null,O.A.Lo=null,O.A.So=null,L.A.Lo=null,this.xo=null,u.A.So=null,n.A.To(),a.A.To(),p.A.To(),S.A.Lo=[],x.A.Lo=[]};ko(){return this.$t}Mo(){return this.Gs}Do(){return this.Ns}No(){return this.hs}Fo(){return this.He}Oo=()=>{this.pi=!1,this.Mi&&(clearInterval(this.Mi),this.Mi=null),this.ai=null,this.ci=null,this.mi=[],this.bi=null,this.Ti=null,this.Ri=null,this.Oi=null,this.Ci=null,this._i=null,this.Ei=null,this.vi=null,this.gi=null,this.Ii=null};Bo=async(t,i,e,s)=>{let n=5,o=await(this.db?.Uo(t));if(o&&h.A.Po(o)!==e&&(o=void 0),o)return new r.A(o);for(;!o;){await this.Go(s,`Requesting ${i}`);try{o=await(0,C.Wo)(`${k.nt}/${t}${e}`)}catch(t){o=void 0;for(let t=n;t>0;t--)await this.Go(s,`Error loading - Will retry in ${t} secs.`),await(0,C.Yo)(1e3);n*=2,n>60&&(n=60)}}return await(this.db?.Ho(t,o)),new r.A(o)};Vo=async(t,i,e)=>{let s=await(this.db?.Uo(t+'.mid'));if(s&&12345678!==i&&h.A.Po(s)!==i&&(s=void 0),!s)try{s=await(0,C.Wo)(`${k.nt}/${t}_${i}.mid`),e!==s.length&&(s=s.slice(0,e))}catch(t){}if(!s)return;await(this.db?.Ho(t+'.mid',s));const n=new h.A(Uint8Array.from(s)).Ko,r=E.A.read(n,s,e,4);(0,v.Xo)(r,this.Co)};jo=()=>{if(w.zo.fillStyle='black',w.zo.fillRect(0,0,this.width,this.height),this.Zo(1),this.Dt){this.pi=!1,w.zo.font='bold 16px helvetica, sans-serif',w.zo.textAlign='left',w.zo.fillStyle='yellow';let t=35;w.zo.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,w.zo.fillStyle='white',w.zo.fillText('To fix this try the following (in order):',30,t),t+=50,w.zo.font='bold 12px helvetica, sans-serif',w.zo.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.zo.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,w.zo.fillText('3: Try using a different game-world',30,t),t+=30,w.zo.fillText('4: Try rebooting your computer',30,t),t+=30,w.zo.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.Nt&&(this.pi=!1,w.zo.font='bold 20px helvetica, sans-serif',w.zo.textAlign='left',w.zo.fillStyle='white',w.zo.fillText('Error - unable to load game!',50,50),w.zo.fillText('To play RuneScape make sure you play from',50,100),w.zo.fillText('https://2004scape.org',50,150)),this.Mt){this.pi=!1,w.zo.font='bold 13px helvetica, sans-serif',w.zo.textAlign='left',w.zo.fillStyle='yellow';let t=35;w.zo.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,w.zo.fillStyle='white',w.zo.fillText('To fix this try the following (in order):',30,t),t+=50,w.zo.font='bold 12px helvetica, sans-serif',w.zo.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.zo.fillText('2: Try rebooting your computer, and reloading',30,t)}};qo=t=>{if(!t.Jo)return!1;for(let i=0;i=s)return!1}else if(3===t.Jo[i]){if(e<=s)return!1}else if(4===t.Jo[i]){if(e===s)return!1}else if(e!==s)return!1}return!0};tl=(t,i,e,s,n)=>{this.ve?.draw(t,i),this.be?.draw(t,i+n-16),y.A.fillRect(t,i+16,16,n-32,m.A.il);let r=(n-32)*n/s|0;r<8&&(r=8);const h=(n-r-32)*e/(s-n)|0;y.A.fillRect(t,i+h+16,16,r,m.A.el),y.A.sl(t,i+h+16,m.A.nl,r),y.A.sl(t+1,i+h+16,m.A.nl,r),y.A.rl(t,i+h+16,m.A.nl,16),y.A.rl(t,i+h+17,m.A.nl,16),y.A.sl(t+15,i+h+16,m.A.hl,r),y.A.sl(t+14,i+h+17,m.A.hl,r-1),y.A.rl(t,i+h+r+15,m.A.hl,16),y.A.rl(t+1,i+h+r+14,m.A.hl,15)};ol=(t,i)=>{let e=!1;const n=s.A.Lo[t];if(!n.ll)return!1;for(let t=0;ts.delay[r.ul];)r.fl-=s.delay[r.ul]+1,r.ul++,r.ul>=s.dl&&(r.ul-=s.wl,(r.ul<0||r.ul>=s.dl)&&(r.ul=0)),e=!0}}}return e};yl=(t,i,e,r,h=!1)=>{if(0!==t.type||!t.ll||t.hide&&this.Zs!==t.id&&this.qs!==t.id&&this.Js!==t.id)return;const o=y.A.left,l=y.A.top,a=y.A.right,c=y.A.bottom;y.A.Al(i,e,i+t.width,e+t.height);const f=t.ll.length;for(let o=0;o0&&this.Cl(c),c.type===s.A.El)c.vl>c.scroll-c.height&&(c.vl=c.scroll-c.height),c.vl<0&&(c.vl=0),this.yl(c,l,a,c.vl,h),c.scroll>c.height&&this.tl(l+c.width,a,c.vl,c.scroll,c.height);else if(c.type===s.A.bl){let t=0;for(let i=0;i0){let i=0,e=0;const r=c.Ol[t]-1;if(s>=-32&&s<=512&&n>=-32&&n<=334||0!==this.tn&&this.Qs===t){const h=A.A.kl(r,c.Ll[t]);if(0!==this.tn&&this.Qs===t&&this.$s===c.id?(i=this.Ml-this.en,e=this.Dl-this.sn,i<5&&i>-5&&(i=0),e<5&&e>-5&&(e=0),this.nn<5&&(i=0,e=0),h.Nl(128,s+i,n+e)):0!==this.un&&this.dn===t&&this.wn===c.id?h.Nl(128,s,n):h.draw(s,n),33===h.Fl||1!==c.Ll[t]){const r=c.Ll[t];this.di?.Bl(s+i+1,n+10+e,this.Ul(r),m.A.Pl),this.di?.Bl(s+i,n+9+e,this.Ul(r),m.A.Gl)}}}else if(c.Wl&&t<20){const i=c.Wl[t];i?.draw(s,n)}t++}}else if(c.type===s.A.Yl)c.fill?y.A.fillRect(l,a,c.width,c.height,c.Hl):y.A.gl(l,a,c.width,c.height,c.Hl);else if(c.type===s.A.Vl){const t=c.font;let i=c.Hl,e=c.text;if(this.Js!==c.id&&this.qs!==c.id&&this.Zs!==c.id||0===c.Kl||(i=c.Kl),this.qo(c)&&(i=c.Xl,c.jl&&c.jl.length>0&&(e=c.jl)),c.zl===s.A.Zl&&this.An&&(e='Please wait...',i=c.Hl),!t||!e)continue;for(let s=a+t.height;e.length>0;s+=t.height){if(-1!==e.indexOf('%')){for(;;){const t=e.indexOf('%1');if(-1===t)break;e=e.substring(0,t)+this.ql(this.$o(c,0))+e.substring(t+2)}for(;;){const t=e.indexOf('%2');if(-1===t)break;e=e.substring(0,t)+this.ql(this.$o(c,1))+e.substring(t+2)}for(;;){const t=e.indexOf('%3');if(-1===t)break;e=e.substring(0,t)+this.ql(this.$o(c,2))+e.substring(t+2)}for(;;){const t=e.indexOf('%4');if(-1===t)break;e=e.substring(0,t)+this.ql(this.$o(c,3))+e.substring(t+2)}for(;;){const t=e.indexOf('%5');if(-1===t)break;e=e.substring(0,t)+this.ql(this.$o(c,4))+e.substring(t+2)}}const n=e.indexOf('\\n');let r;-1!==n?(r=e.substring(0,n),e=e.substring(n+2)):(r=e,e=''),c.Jl?t.$l(l+(c.width/2|0),s,r,i,c.Ql):t.ta(l,s,r,i,c.Ql)}}else if(c.type===s.A.ia){let t;t=this.qo(c)?c.ea:c.sa,t?.draw(l,a)}else if(c.type===s.A.na){const t=n.A.ra,i=n.A.ha;n.A.ra=l+(c.width/2|0),n.A.ha=a+(c.height/2|0);const e=n.A.sin[c.oa]*c.zoom>>16,s=n.A.cos[c.oa]*c.zoom>>16,r=this.qo(c);let h;h=r?c.cl:c.al;let o=null;if(-1===h)o=c.la(-1,-1,r);else{const t=g.A.Lo[h];t.frames&&t.aa&&(o=c.la(t.frames[c.ul],t.aa[c.ul],r))}o&&o.ca(0,c.fa,0,c.oa,0,e,s),n.A.ra=t,n.A.ha=i}else if(c.type===s.A.ua){const t=c.font;if(!t||!c.Ol||!c.Ll)continue;let i=0;for(let e=0;e0){const n=A.A.get(c.Ol[i]-1);let r=n.name;if((n.da||1!==c.Ll[i])&&(r=r+' x'+this.wa(c.Ll[i])),!r)continue;const h=l+s*(c.Sl+115),o=a+e*(c.xl+12);c.Jl?t.$l(h+(c.width/2|0),o,r,c.Hl,c.Ql):t.ta(h,o,r,c.Hl,c.Ql)}i++}}}y.A.Al(o,l,a,c)};Cl=t=>{let i=t._l;if(i>=s.A.ya&&i<=s.A.Aa)i--,i>=this.Vh?(t.text='',t.zl=0):(t.text=this.eo[i],t.zl=1);else if(i>=s.A.ma&&i<=s.A.pa)i-=s.A.ma,i>=this.Vh?(t.text='',t.zl=0):(0===this.no[i]?t.text='@red@Offline':this.no[i]===k.it?t.text='@gre@World-'+(this.no[i]-9):t.text='@yel@World-'+(this.no[i]-9),t.zl=1);else if(i===s.A.ga)t.scroll=15*this.Vh+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i>=s.A.Ia&&i<=s.A._a)i-=s.A.Ia,i>=this.fs?(t.text='',t.zl=0):(t.text=I.A.Ca(I.A.Ea(this.us[i])),t.zl=1);else if(i===s.A.va)t.scroll=15*this.fs+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i===s.A.ba){if(t.oa=150,t.fa=256*Math.sin(this.Ft/40)&2047,this.Wh){this.Wh=!1;const i=new d.fe(7,null);let e=0;for(let t=0;t<7;t++){const s=this.Yh[t];s>=0&&(i[e++]=_.A.Lo[s].la())}const s=p.A.Ta(i,e);for(let t=0;t<5;t++)0!==this.Hh[t]&&(s.Ra(u.A.Oa[t][0],u.A.Oa[t][this.Hh[t]]),1===t&&s.Ra(u.A.La[0],u.A.La[this.Hh[t]]));if(this.xh){const i=g.A.Lo[this.xh.Sa].frames;i&&(s.xa(),s.ka(i[0]),s.Ma(64,850,-30,-50,-30,!0),t.model=s)}}}else if(i===s.A.Da)this.Fe||(this.Fe=t.sa,this.Be=t.ea),this.Gh?t.sa=this.Be:t.sa=this.Fe;else if(i===s.A.Na)this.Fe||(this.Fe=t.sa,this.Be=t.ea),this.Gh?t.sa=this.Fe:t.sa=this.Be;else if(i===s.A.Fa)t.text=this.xn,this.Ft%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(i===s.A.Ba)this.Ph?this.kn?(t.Hl=m.A.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.Hl=m.A.Il,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(i===s.A.Ua||i===s.A.Pa)if(0===this.Dn)t.text='';else{let i;i=0===this.Nn?'earlier today':1===this.Nn?'yesterday':this.Nn+' days ago',t.text='You last logged in '+i+' from: '+I.A.Ga(this.Dn)}else if(i===s.A.Wa)0===this.Bn&&(t.text='0 unread messages',t.Hl=m.A.Gl),1===this.Bn&&(t.text='1 unread message',t.Hl=m.A.GREEN),this.Bn>1&&(t.text=this.Bn+' unread messages',t.Hl=m.A.GREEN);else if(i===s.A.Ya)if(201===this.Fn)t.text='';else if(200===this.Fn)t.text='You have not yet set any password recovery questions.';else{let i;i=0===this.Fn?'Earlier today':1===this.Fn?'Yesterday':this.Fn+' days ago',t.text=i+' you changed your recovery questions'}else i===s.A.Ha?201===this.Fn?t.text='':200===this.Fn?t.text='We strongly recommend you do so now to secure your account.':t.text='If you do not remember making this change then cancel it immediately':i===s.A.Va&&(201===this.Fn?t.text='':(this.Fn,t.text="Do this from the 'account management' area on our front webpage"))};$o=(t,i)=>{if(!t.scripts||i>=t.scripts.length)return-2;try{const e=t.scripts[i];if(!e)return-1;let n=0,r=0;for(;;){const t=e[r++];if(0===t)return n;if(1===t)n+=this.Es[e[r++]];else if(2===t)n+=this.vs[e[r++]];else if(3===t)n+=this.Cs[e[r++]];else if(4===t){const t=s.A.Lo[e[r++]],i=e[r++]+1;if(t.Ol&&t.Ll)for(let e=0;et<999999999?String(t):'*';wa=t=>{let i=String(t);for(let t=i.length-3;t>0;t-=3)i=i.substring(0,t)+','+i.substring(t);return i.length>8?i='@gre@'+i.substring(0,i.length-8)+' million @whi@('+i+')':i.length>4&&(i='@cya@'+i.substring(0,i.length-4)+'K @whi@('+i+')'),' '+i};Ul=t=>t<1e5?String(t):t<1e7?(t/1e3|0)+'K':(t/1e6|0)+'M'}},7604:(t,i,e)=>{e.d(i,{w:()=>h});var s=e(7046),n=e(1651),r=e(9234);async function h(){await async function(){0===s.A.getParameter('world').length&&s.A.setParameter('world','1');'localhost'===window.location.hostname&&'0'===s.A.getParameter('world')?(n.K.st='http://localhost',n.K.nt='http://localhost',n.K.portOffset=0):await async function(t){const i=await o(t,parseInt(s.A.getParameter('world'),10)),e=new URL(i.address);n.K.it=10+i.id-1,n.K.st=`${e.protocol}//${e.hostname}`,n.K.nt=`${e.protocol}//${e.hostname}:${e.port}`,t||(n.K.st=n.K.st.replace('https:','http:'));n.K.portOffset=i.portOffset,n.K.members=!0===i?.members,s.A.setParameter('world',i.id.toString(10))}(window.location.protocol.startsWith('https'))}(),function(){0===s.A.getParameter('detail').length&&s.A.setParameter('detail','high');'low'===s.A.getParameter('detail')?n.K.Lt():n.K.Ot()}(),0===s.A.getParameter('method').length&&s.A.setParameter('method','0')}async function o(t,i,e=0){if(e>=10)throw new Error('could not find world to connect!');const s=t?'https:':'http:';let n;try{n=JSON.parse(await(0,r.Xa)(`${s}//2004scape.org/api/v1/worldlist`))}catch(s){return await(0,r.Yo)(1e3),o(t,i,++e)}n.push({id:0,region:'Local Development',address:'http://localhost',portOffset:0,members:!0,hh:0});const h=n.find((t=>t.id===i));return h||o(t,i,10)}},1375:(t,i,e)=>{e.a(t,(async(t,i)=>{try{var s=e(1312),n=e(5637),r=e(2164),h=e(1302),o=e(6948),l=e(8317),a=e(8738),c=e(3764),f=e(1120),u=e(4583),d=e(2682),w=e(8665),y=e(8534),A=e(6730),m=e(7953),p=e(9234),g=e(8950),I=e(1069),_=e(3937),C=e(4544),E=e(1908),v=e(9298),b=e(1651),T=e(7604),R=e(1673);class t extends b.K{constructor(){super(!1)}ja=null;za=null;Za=!1;qa=!1;Ja=0;$a=0;Qa='';load=async()=>{try{await this.Go(10,'Connecting to fileserver'),await E.A.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new C.A(await C.A.openDatabase());const t=new I.A(new Uint8Array(await(0,p.Wo)(`${b.K.nt}/crc`))),i=[];for(let e=0;e<9;e++)i[e]=t.Ko;const e=await this.Bo('title','title screen',i[1],10);this.di=d.A.tc(e,'p11'),this.wi=d.A.tc(e,'p12'),this.yi=d.A.tc(e,'b12'),this.Ai=d.A.tc(e,'q8');const g=await this.Bo('config','config',i[2],15),v=await this.Bo('interface','interface',i[3],20),T=await this.Bo('media','2d graphics',i[4],30),O=await this.Bo('models','3d graphics',i[5],40),L=await this.Bo('textures','textures',i[6],60),S=await this.Bo('wordenc','chat system',i[7],65),x=await this.Bo('sounds','sound effects',i[8],70);await this.Go(75,'Unpacking media'),this.ve=R.A.tc(T,'scrollbar',0),this.be=R.A.tc(T,'scrollbar',1),await this.Go(80,'Unpacking textures'),u.A.ic(L),u.A.ec(.8),u.A.sc(20),await this.Go(83,'Unpacking models'),w.A.nc(O),y.A.nc(O),A.A.nc(O),await this.Go(86,'Unpacking config'),s.A.nc(g),n.A.nc(g),r.A.nc(g),h.A.nc(g,!0),o.A.nc(g),l.A.nc(g),a.A.nc(g),c.A.nc(g),await this.Go(90,'Unpacking sounds'),_.A.nc(x),await this.Go(92,'Unpacking interfaces'),f.A.nc(v,T,[this.di,this.wi,this.yi,this.Ai]),await this.Go(97,'Preparing game engine'),m.A.nc(S);for(let t=0;t{this.Mt||this.Dt||this.Nt||(!this.qa&&this.ja&&(this.Qa='',this.hc(this.ja,this.Ml,this.Dl,0,0,0),this.Zs=this.Sn,this.Sn=-1,this.Za||(this.za=this.oc(this.ja,this.Ml,this.Dl,0,0,0))),this.za&&(1===this.lc?(this.qa||(this.Ja=this.za.ac()-this.Ml,this.$a=this.za.cc()-this.Dl),this.qa=!0):this.qa=!1,this.qa&&this.za.move(this.Ml+this.Ja,this.Dl+this.$a)),this.fc(),this.uc(),this.dc=-1,this.wc=-1,this.yc=0)};draw=async()=>{this.Mt||this.Dt||this.Nt?this.jo():(g.A.clear(),g.A.fillRect(0,0,this.width,this.height,0),this.Ac(8,8,16,16,5263440),this.ja&&(this.yl(this.ja,0,0,0,!1),this.yi?.mc(4,15,this.Qa,v.A.Il,!0,0)),this.za&&this.za.outline(65535),this.xo?.draw(0,0))};fc(){for(;;){const t=this.gc();if(-1===t)break;this.za&&(8===t?(this.za.delete(),this.za=null,this.Za=!1):9===t&&(this.Za=!1))}}uc(){if(this.za){if(this.Ic[1]){const t=this.za.ac();this.za.move(t-1,this.za.cc())}else if(this.Ic[2]){const t=this.za.ac();this.za.move(t+1,this.za.cc())}if(this.Ic[3]){const t=this.za.cc();this.za.move(this.za.ac(),t-1)}else if(this.Ic[4]){const t=this.za.cc();this.za.move(this.za.ac(),t+1)}}}Ac=(t,i,e,s,n)=>{const r=(this.width+t)/e,h=(this.height+i)/s;t=-t,i=-i;for(let o=0;o{if(0!==t.type||!t.ll||!t.ml||!t.pl||is+t.width||e>n+t.height)return;const h=t.ll.length;for(let o=0;o=0||0!==a.Kl)&&i>=h&&e>=l&&i=0?this.Sn=a.Cc:this.Sn=a.id),0===a.type?this.hc(a,i,e,h,l,a.vl):i>=h&&e>=l&&i{if(0!==t.type||!t.ll||!t.ml||!t.pl||is+t.width||e>n+t.height)return null;let h=null;const o=t.ll.length;for(let l=0;l=o&&e>=a&&i{})),i()}catch(t){i(t)}}),1)},7046:(t,i,e)=>{e.d(i,{A:()=>a});var s=e(1183),n=e(4583),r=e(9234),h=e(9091),o=e(2595),l=e(7854);class a{static getParameter(t){return new URLSearchParams(window.location.search).get(t)??''}static setParameter(t,i){const e=new URL(window.location.toString());e.searchParams.set(t,i),window.history.pushState(null,'',e.toString())}Tc=0;Rc=[];Oc=0;xo=null;state=0;Lc=20;Sc=1;xc=[];kc=0;Mc=0;Dc=[];Nc=!0;Fc=!1;Bc=50;hasFocus=!0;Uc=!1;Pc=0;lc=0;Ml=0;Dl=0;yc=0;dc=0;wc=0;Ic=[];Gc=[];Wc=0;Yc=0;input=null;Hc=!1;Vc=!1;Kc=!1;time=-1;Xc=0;jc=0;zc=0;Zc=0;qc=0;Jc=0;constructor(t=!1){l.$c.tabIndex=-1,l.zo.fillStyle='black',l.zo.fillRect(0,0,l.$c.width,l.$c.height),this.Fc=t,this.Fc?this.resize(window.innerWidth,window.innerHeight):this.resize(l.$c.width,l.$c.height)}get width(){return l.$c.width}get height(){return l.$c.height}resize=(t,i)=>{l.$c.width=t,l.$c.height=i,this.xo=new s.A(t,i),n.A.rc()};bc=async()=>{l.$c.addEventListener('resize',(()=>{this.Fc&&this.resize(window.innerWidth,window.innerHeight)}),!1),l.$c.onmousedown=this.onmousedown,l.$c.onmouseup=this.onmouseup,l.$c.onmouseenter=this.onmouseenter,l.$c.onmouseleave=this.onmouseleave,l.$c.onmousemove=this.onmousemove,window.onbeforeunload=this.To,l.$c.onfocus=this.onfocus,l.$c.onblur=this.onblur,this.Qc?(l.$c.ontouchstart=this.ontouchstart,l.$c.ontouchend=this.ontouchend,l.$c.ontouchmove=this.ontouchmove):(l.$c.onkeydown=this.onkeydown,l.$c.onkeyup=this.onkeyup),l.$c.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.Qc&&'low'===a.getParameter('detail')&&(this.Bc=30),await this.Go(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.xc[t]=performance.now();let t,i=0,e=256,s=1,n=0;for(;this.state>=0;){if(this.state>0&&(this.state--,0===this.state))return void this.tf();const h=e,o=s;e=300,s=1,t=performance.now();const l=this.xc[i];if(0===l?(e=h,s=o):t>l&&(e=2560*this.Lc/(t-l)|0),e<25?e=25:e>256&&(e=256,s=this.Lc-(t-l)/10|0),this.xc[i]=t,i=(i+1)%10,s>1)for(let t=0;t<10;t++)0!==this.xc[t]&&(this.xc[t]+=s);for(s0&&(this.kc=1e3*e/(256*this.Lc)|0);const a=performance.now();if(this.Nc&&this.refresh(),await this.draw(),this.Dc[this.Mc]=(performance.now()-a)/1e3,this.Mc=(this.Mc+1)%this.Dc.length,this.Bc<50){const i=1e3/this.Bc-(performance.now()-t);i>0&&await(0,r.Yo)(i)}}-1===this.state&&this.tf()};tf=()=>{this.state=-2,this.To()};Zo=t=>{this.Lc=1e3/t|0};if=t=>{this.Bc=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.Lc|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};To=()=>{};draw=async()=>{};refresh=()=>{};async Go(t,i){const e=this.width,s=this.height;this.Nc&&(l.zo.fillStyle='black',l.zo.fillRect(0,0,e,s),this.Nc=!1);const n=s/2-18;l.zo.fillStyle='rgb(140, 17, 17)',l.zo.rect((e/2|0)-152,n,304,34),l.zo.fillRect((e/2|0)-150,n+2,3*t,30),l.zo.fillStyle='black',l.zo.fillRect((e/2|0)-150+3*t,n+2,300-3*t,30),l.zo.font='bold 13px helvetica, sans-serif',l.zo.textAlign='center',l.zo.fillStyle='white',l.zo.fillText(i,e/2|0,n+22),await(0,r.Yo)(5)}gc=()=>{let t=-1;return this.Yc!==this.Wc&&(t=this.Gc[this.Wc],this.Wc=this.Wc+1&127),t};get ms(){const t=this.Dc.length;let i=0;for(let e=0;ethis.Tc&&(this.Tc=e),this.Rc[this.Oc]=e,this.Oc=(this.Oc+1)%250,e}get ef(){return this.Rc.reduce(((t,i)=>t+i),0)/250}onkeydown=t=>{const i=t.key;h.p.includes(i)&&t.preventDefault(),this.Pc=0;const e=h.L[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;t.ctrlKey&&(n>='A'.charCodeAt(0)&&n<=']'.charCodeAt(0)||n=='_'.charCodeAt(0)?n-='A'.charCodeAt(0)-1:n>='a'.charCodeAt(0)&&n<='z'.charCodeAt(0)&&(n-='a'.charCodeAt(0)-1)),n<30&&(n=0),s===h.L.ArrowLeft.code?n=1:s===h.L.ArrowRight.code?n=2:s===h.L.ArrowUp.code?n=3:s===h.L.ArrowDown.code?n=4:s===h.L.Control.code?n=5:s===h.L.Shift.code?n=6:s===h.L.Alt.code?n=7:s===h.L.Backspace.code||s===h.L.Delete.code?n=8:s===h.L.Tab.code?n=9:s===h.L.Enter.code?n=10:s>=h.L.F1.code&&s<=h.L.F12.code?n=s+1008-h.L.F1.code:s===h.L.Home.code?n=1e3:s===h.L.End.code?n=1001:s===h.L.PageUp.code?n=1002:s===h.L.PageDown.code&&(n=1003),n>0&&n<128&&(this.Ic[n]=1),n>4&&(this.Gc[this.Yc]=n,this.Yc=this.Yc+1&127),o.A.enabled&&o.A.sf(n)};onkeyup=t=>{const i=t.key;h.p.includes(i)&&t.preventDefault(),this.Pc=0;const e=h.L[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;n<30&&(n=0),s===h.L.ArrowLeft.code?n=1:s===h.L.ArrowRight.code?n=2:s===h.L.ArrowUp.code?n=3:s===h.L.ArrowDown.code?n=4:s===h.L.Control.code?n=5:s===h.L.Shift.code?n=6:s===h.L.Alt.code?n=7:s===h.L.Backspace.code||s===h.L.Delete.code?n=8:s===h.L.Tab.code?n=9:s===h.L.Enter.code?n=10:s>=h.L.F1.code&&s<=h.L.F12.code?n=s+1008-h.L.F1.code:s===h.L.Home.code?n=1e3:s===h.L.End.code?n=1001:s===h.L.PageUp.code?n=1002:s===h.L.PageDown.code&&(n=1003),n>0&&n<128&&(this.Ic[n]=0),o.A.enabled&&o.A.nf(n)};onmousedown=t=>{if(this.Hc=!1,(t.clientX>0||t.clientY>0)&&this.rf(t),this.Pc=0,this.dc=this.Ml,this.wc=this.Dl,this.Qc&&!this.hf){if(this.lf()||this.af()||this.cf())return this.yc=1,void(this.lc=1);t.timeStamp>=this.time+500?(this.yc=2,this.lc=2):(this.yc=1,this.lc=1)}else 2===t.button?(this.yc=2,this.lc=2):(this.yc=1,this.lc=1);o.A.enabled&&o.A.ff(this.dc,this.wc,t.buttons)};onmouseup=t=>{this.rf(t),this.Pc=0,this.lc=0,o.A.enabled&&o.A.uf(t.buttons)};onmouseenter=t=>{this.rf(t),o.A.enabled&&o.A.df()};onmouseleave=t=>{this.rf(t),this.Pc=0,this.Ml=-1,this.Dl=-1,this.lc=0,this.dc=-1,this.wc=-1,o.A.enabled&&o.A.wf()};onmousemove=t=>{this.rf(t),this.Pc=0,o.A.enabled&&o.A.yf(this.Ml,this.Dl)};onfocus=t=>{this.hasFocus=!0,this.Nc=!0,this.refresh(),o.A.enabled&&o.A.Af()};onblur=t=>{this.hasFocus=!1,o.A.enabled&&o.A.mf()};ontouchstart=t=>{if(!this.Qc)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.Hc=!0;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.Xc=this.qc=this.zc=0|i.screenX,this.jc=this.Jc=this.Zc=0|i.screenY,this.time=t.timeStamp,this.Vc=this.pf(),this.Kc=this.gf()};ontouchend=t=>{if(!this.Qc||!this.Hc)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;if(this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.qc=0|i.screenX,this.Jc=0|i.screenY,this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.Vc&&!this.pf())return void(this.Hc=!1);if(this.Kc&&!this.gf())return void(this.Hc=!1);if(this.lf()||this.If()||this.af()||this.cf()){null!==this.input&&(this.input.parentNode?.contains(this.input)&&this.input.parentNode?.removeChild(this.input),this.input=null);const t=document.createElement('input');return this.af()?(t.setAttribute('id','username'),t.setAttribute('placeholder','Username')):this.cf()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.lf()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.If()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this._f?t.setAttribute('type','password'):t.setAttribute('type',this.cf()?'password':'text'),t.setAttribute('autofocus','autofocus'),t.setAttribute('spellcheck','false'),t.setAttribute('autocomplete','off'),t.setAttribute('style',`position: fixed; left: ${e}px; top: ${s}px; width: 1px; height: 1px; opacity: 0;`),document.body.appendChild(t),t.focus(),t.click(),this._f&&(t.oninput=t=>{if(!(t instanceof InputEvent))return;const i=t,e=i.data;null!==e&&'insertText'===i.inputType&&this.onkeydown(new KeyboardEvent('keydown',{key:e,code:e}))}),t.onkeydown=t=>{this._f&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this._f&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeyup(new KeyboardEvent('keyup',{key:t.key,code:t.key}))},t.onfocus=t=>{this.input?.parentNode?.removeChild(this.input),this.input=null,this.onfocus(t)},this.input=t,void(this.Hc=!1)}const n=t.timeStamp>=this.time+500,r=Math.abs(this.Xc-this.qc)>16||Math.abs(this.jc-this.Jc)>16;n&&!r?(this.Hc=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.lc=0,this.Hc=!1)};ontouchmove=t=>{if(!this.Qc||!this.Hc)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.qc=0|i.screenX,this.Jc=0|i.screenY,this.Vc&&-1===this.Fo()?(this.zc-this.qc>0?this.rotate(2):this.zc-this.qc<0&&this.rotate(0),this.Zc-this.Jc>0?this.rotate(3):this.Zc-this.Jc<0&&this.rotate(1)):(this.Kc||-1!==this.Fo())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this.zc=this.qc,this.Zc=this.Jc};get Qc(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get _f(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get hf(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}pf=()=>this.Uc&&this.Ml>=8&&this.Ml<=520&&this.Dl>=11&&this.Dl<=345;lf=()=>this.Uc&&-1===this.No()&&!this.Mo()&&!this.Do()&&this.Ml>=11&&this.Ml<=506&&this.Dl>=449&&this.Dl<=482;If=()=>this.Uc&&(this.Mo()||this.Do())&&this.Ml>=11&&this.Ml<=506&&this.Dl>=383&&this.Dl<=482;gf=()=>this.Uc&&this.Ml>=562&&this.Ml<=752&&this.Dl>=231&&this.Dl<=492;af=()=>!this.Uc&&2===this.ko()&&this.Ml>=301&&this.Ml<=562&&this.Dl>=262&&this.Dl<=279;cf=()=>!this.Uc&&2===this.ko()&&this.Ml>=301&&this.Ml<=562&&this.Dl>=279&&this.Dl<=296;rotate=t=>{0===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowLeft',code:'ArrowLeft'}))):1===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowUp',code:'ArrowUp'}))):2===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowRight',code:'ArrowRight'}))):3===t&&(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowDown',code:'ArrowDown'})))};Cf=()=>null!==document.fullscreenElement;rf=t=>{if(this.Cf()){const i=t.target.getBoundingClientRect(),e=window.innerHeight/l.$c.height,s=(window.innerWidth-l.$c.width*e)/2;this.Ml=0|this.Ef(t.clientX-i.left-s,0,l.$c.width*e,0,789),this.Dl=0|this.Ef(t.clientY-i.top,0,l.$c.height*e,0,532)}else{const i=l.$c.getBoundingClientRect(),e=l.$c.width/i.width,s=l.$c.height/i.height;this.Ml=(t.clientX-i.left)*e|0,this.Dl=(t.clientY-i.top)*s|0}this.Ml<0&&(this.Ml=0),this.Dl<0&&(this.Dl=0),this.Ml>789&&(this.Ml=789),this.Dl>532&&(this.Dl=532)};Ef=(t,i,e,s,n)=>(t-i)*(n-s)/(e-i)+s}},2595:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1069);class n{static enabled=!1;static vf=null;static bf=null;static Tf=0;static Rf=0;static Of=0;static Lf=0;static Sf=0;static xf=()=>{this.vf=s.A.Ut(1),this.bf=null,this.Tf=performance.now(),this.enabled=!0};static kf=()=>{this.enabled=!1,this.vf=null};static flush=()=>{let t=null;return this.bf&&this.enabled&&(t=this.bf),this.bf=null,t};static stop=()=>{let t=null;return this.vf&&this.vf.Mf>0&&this.enabled&&(t=this.vf),this.kf(),t};static ff=(t,i,e)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;this.Rf++;const s=performance.now();let n=(s-this.Tf)/10|0;n>250&&(n=250),this.Tf=s,this.Df(5),1===e?this.vf?.p1(1):this.vf?.p1(2),this.vf?.p1(n),this.vf?.p3(t+(i<<10))};static uf=t=>{if(!this.enabled)return;this.Rf++;const i=performance.now();let e=(i-this.Tf)/10|0;e>250&&(e=250),this.Tf=i,this.Df(2),1===t?this.vf?.p1(3):this.vf?.p1(4),this.vf?.p1(e)};static yf=(t,i)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;const e=performance.now();if(e-this.Of>=50){this.Of=e,this.Rf++;let s=(e-this.Tf)/10|0;s>250&&(s=250),this.Tf=e,t-this.Lf<8&&t-this.Lf>=-8&&i-this.Sf<8&&i-this.Sf>=-8?(this.Df(3),this.vf?.p1(5),this.vf?.p1(s),this.vf?.p1(t+(i-this.Sf+8<<4)+8-this.Lf)):t-this.Lf<128&&t-this.Lf>=-128&&i-this.Sf<128&&i-this.Sf>=-128?(this.Df(4),this.vf?.p1(6),this.vf?.p1(s),this.vf?.p1(t+128-this.Lf),this.vf?.p1(i+128-this.Sf)):(this.Df(5),this.vf?.p1(7),this.vf?.p1(s),this.vf?.p3(t+(i<<10))),this.Lf=t,this.Sf=i}};static sf=t=>{if(!this.enabled)return;this.Rf++;const i=performance.now();let e=(i-this.Tf)/10|0;e>250&&(e=250),this.Tf=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.Df(3),this.vf?.p1(8),this.vf?.p1(e),this.vf?.p1(t)};static nf=t=>{if(!this.enabled)return;this.Rf++;const i=performance.now();let e=(i-this.Tf)/10|0;e>250&&(e=250),this.Tf=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.Df(3),this.vf?.p1(9),this.vf?.p1(e),this.vf?.p1(t)};static Af=()=>{if(!this.enabled)return;this.Rf++;const t=performance.now();let i=(t-this.Tf)/10|0;i>250&&(i=250),this.Tf=t,this.Df(2),this.vf?.p1(10),this.vf?.p1(i)};static mf=()=>{if(!this.enabled)return;this.Rf++;const t=performance.now();let i=(t-this.Tf)/10|0;i>250&&(i=250),this.Tf=t,this.Df(2),this.vf?.p1(11),this.vf?.p1(i)};static df=()=>{if(!this.enabled)return;this.Rf++;const t=performance.now();let i=(t-this.Tf)/10|0;i>250&&(i=250),this.Tf=t,this.Df(2),this.vf?.p1(12),this.vf?.p1(i)};static wf=()=>{if(!this.enabled)return;this.Rf++;const t=performance.now();let i=(t-this.Tf)/10|0;i>250&&(i=250),this.Tf=t,this.Df(2),this.vf?.p1(13),this.vf?.p1(i)};static Df=t=>{if(this.vf&&this.vf.Mf+t>=500){const t=this.vf;this.vf=s.A.Ut(1),this.bf=t}}}},9091:(t,i,e)=>{e.d(i,{L:()=>s,p:()=>n});const s={'Backspace':{code:8,ch:8},'Enter':{code:10,ch:10},'Shift':{code:16,ch:65535},'Escape':{code:27,ch:27},'Tab':{code:9,ch:9},'CapsLock':{code:20,ch:65535},' ':{code:32,ch:32},'Control':{code:17,ch:65535},'Alt':{code:18,ch:65535},'Meta':{code:524,ch:65535},'ArrowLeft':{code:37,ch:65535},'ArrowRight':{code:39,ch:65535},'ArrowUp':{code:38,ch:65535},'ArrowDown':{code:40,ch:65535},'Insert':{code:155,ch:65535},'Home':{code:36,ch:65535},'PageUp':{code:33,ch:65535},'Delete':{code:127,ch:127},'End':{code:35,ch:65535},'PageDown':{code:34,ch:65535},'`':{code:192,ch:96},'~':{code:192,ch:126},'!':{code:49,ch:33},'@':{code:50,ch:64},'#':{code:51,ch:35},'$':{code:52,ch:36},'%':{code:53,ch:37},'^':{code:54,ch:94},'&':{code:55,ch:38},'*':{code:56,ch:42},'(':{code:57,ch:40},')':{code:48,ch:41},'-':{code:45,ch:45},'_':{code:45,ch:95},'=':{code:61,ch:61},'+':{code:61,ch:43},'[':{code:91,ch:91},'{':{code:91,ch:123},']':{code:93,ch:93},'}':{code:93,ch:125},'\\':{code:92,ch:92},'|':{code:92,ch:124},';':{code:59,ch:59},':':{code:59,ch:58},"'":{code:222,ch:39},'"':{code:222,ch:34},',':{code:44,ch:44},'<':{code:44,ch:60},'.':{code:46,ch:46},'>':{code:46,ch:62},'/':{code:47,ch:47},'?':{code:47,ch:63},'F1':{code:112,ch:65535},'F2':{code:113,ch:65535},'F3':{code:114,ch:65535},'F4':{code:115,ch:65535},'F5':{code:116,ch:65535},'F6':{code:117,ch:65535},'F7':{code:118,ch:65535},'F8':{code:119,ch:65535},'F9':{code:120,ch:65535},'F10':{code:121,ch:65535},'F11':{code:122,ch:65535},'F12':{code:123,ch:65535},0:{code:48,ch:48},1:{code:49,ch:49},2:{code:50,ch:50},3:{code:51,ch:51},4:{code:52,ch:52},5:{code:53,ch:53},6:{code:54,ch:54},7:{code:55,ch:55},8:{code:56,ch:56},9:{code:57,ch:57},'a':{code:65,ch:97},'b':{code:66,ch:98},'c':{code:67,ch:99},'d':{code:68,ch:100},'e':{code:69,ch:101},'f':{code:70,ch:102},'g':{code:71,ch:103},'h':{code:72,ch:104},'i':{code:73,ch:105},'j':{code:74,ch:106},'k':{code:75,ch:107},'l':{code:76,ch:108},'m':{code:77,ch:109},'n':{code:78,ch:110},'o':{code:79,ch:111},'p':{code:80,ch:112},'q':{code:81,ch:113},'r':{code:82,ch:114},'s':{code:83,ch:115},'t':{code:84,ch:116},'u':{code:85,ch:117},'v':{code:86,ch:118},'w':{code:87,ch:119},'x':{code:88,ch:120},'y':{code:89,ch:121},'z':{code:90,ch:122},'A':{code:65,ch:65},'B':{code:66,ch:66},'C':{code:67,ch:67},'D':{code:68,ch:68},'E':{code:69,ch:69},'F':{code:70,ch:70},'G':{code:71,ch:71},'H':{code:72,ch:72},'I':{code:73,ch:73},'J':{code:74,ch:74},'K':{code:75,ch:75},'L':{code:76,ch:76},'M':{code:77,ch:77},'N':{code:78,ch:78},'O':{code:79,ch:79},'P':{code:80,ch:80},'Q':{code:81,ch:81},'R':{code:82,ch:82},'S':{code:83,ch:83},'T':{code:84,ch:84},'U':{code:85,ch:85},'V':{code:86,ch:86},'W':{code:87,ch:87},'X':{code:88,ch:88},'Y':{code:89,ch:89},'Z':{code:90,ch:90}},n=['Tab','F1','F2','F3','F4','F5','F6','F7','F8','F9','F10','ArrowLeft','ArrowRight','ArrowUp','ArrowDown']},1120:(t,i,e)=>{e.d(i,{A:()=>c});var s=e(1069),n=e(8665),r=e(2679),h=e(2511),o=e(3819),l=e(3867),a=e(8950);class c{static Lo=[];static Nf=null;static So=null;static El=0;static Ff=1;static bl=2;static Yl=3;static Vl=4;static ia=5;static na=6;static ua=7;static Bf=1;static Uf=2;static vc=3;static Pf=4;static Gf=5;static Zl=6;static ya=1;static Aa=100;static ma=101;static pa=200;static Wf=201;static Yf=202;static ga=203;static Hf=205;static Vf=300;static Kf=301;static Xf=302;static jf=303;static zf=304;static Zf=305;static qf=306;static Jf=307;static $f=308;static Qf=309;static tu=310;static iu=311;static eu=312;static su=313;static nu=314;static ru=315;static hu=316;static ou=317;static lu=318;static au=319;static cu=320;static fu=321;static uu=322;static du=323;static Da=324;static Na=325;static wu=326;static ba=327;static Ia=401;static _a=500;static yu=501;static Au=502;static va=503;static Fa=600;static mu=601;static pu=602;static gu=603;static Iu=604;static _u=605;static Cu=606;static Eu=607;static vu=608;static bu=609;static Tu=610;static Ru=611;static Ou=612;static Ba=613;static Ua=650;static Wa=651;static Ya=652;static Ha=653;static Va=654;static Pa=655;static nc=(t,i,e)=>{this.Nf=new r.A(5e4),this.So=new r.A(5e4);const n=new s.A(t.read('data'));let h=-1;for(n.Mf+=2;n.Mf0){s.Jo=new Uint8Array(r),s.Qo=new Uint16Array(r);for(let t=0;t0){s.scripts=new l.fe(o,null);for(let t=0;t0){const n=e.lastIndexOf(',');s.Wl[t]=this.Fu(i,e.substring(0,n),parseInt(e.substring(n+1),10))}}s.Bu=new l.fe(5,null);for(let t=0;t<5;t++){const i=n.Nu;s.Bu[t]=i,0===i.length&&(s.Bu[t]=null)}}if(s.type===c.Yl&&(s.fill=1===n.xu),s.type===c.Vl||s.type===c.Ff){s.Jl=1===n.xu;const t=n.xu;e&&(s.font=e[t]),s.Ql=1===n.xu}if(s.type===c.Vl&&(s.text=n.Nu,s.jl=n.Nu),s.type!==c.Ff&&s.type!==c.Yl&&s.type!==c.Vl||(s.Hl=n.Ko),s.type!==c.Yl&&s.type!==c.Vl||(s.Xl=n.Ko,s.Kl=n.Ko),s.type===c.ia){const t=n.Nu;if(t.length>0){const e=t.lastIndexOf(',');s.sa=this.Fu(i,t.substring(0,e),parseInt(t.substring(e+1),10))}const e=n.Nu;if(e.length>0){const t=e.lastIndexOf(',');s.ea=this.Fu(i,e.substring(0,t),parseInt(e.substring(t+1),10))}}if(s.type===c.na){const t=n.xu;0!==t&&(s.model=this.la((t-1<<8)+n.xu));const i=n.xu;0!==i&&(s.Uu=this.la((i-1<<8)+n.xu)),s.al=n.xu,0===s.al?s.al=-1:s.al=(s.al-1<<8)+n.xu,s.cl=n.xu,0===s.cl?s.cl=-1:s.cl=(s.cl-1<<8)+n.xu,s.zoom=n.Lu,s.oa=n.Lu,s.fa=n.Lu}if(s.type===c.ua){s.Ol=new Int32Array(s.width*s.height),s.Ll=new Int32Array(s.width*s.height),s.Jl=1===n.xu;const t=n.xu;e&&(s.font=e[t]),s.Ql=1===n.xu,s.Hl=n.Ko,s.Sl=n.ku,s.xl=n.ku,s.Mu=1===n.xu,s.Bu=new l.fe(5,null);for(let t=0;t<5;t++){const i=n.Nu;s.Bu[t]=i,0===i.length&&(s.Bu[t]=null)}}s.zl!==c.Uf&&s.type!==c.bl||(s.Pu=n.Nu,s.action=n.Nu,s.Gu=n.Lu),s.zl!==c.Bf&&s.zl!==c.Pf&&s.zl!==c.Gf&&s.zl!==c.Zl||(s.Ec=n.Nu,0===s.Ec.length&&(s.zl===c.Bf?s.Ec='Ok':s.zl===c.Pf||s.zl===c.Gf?s.Ec='Select':s.zl===c.Zl&&(s.Ec='Continue')))}this.Nf=null,this.So=null};static Fu=(t,i,e)=>{const s=o.A.Wu(i)<<8n|BigInt(e);if(this.Nf){const t=this.Nf.get(s);if(t)return t}let n;try{n=h.A.tc(t,i,e),this.Nf?.put(s,n)}catch(t){return null}return n};static la=t=>{if(this.So){const i=this.So.get(BigInt(t));if(i)return i}const i=n.A.model(t);return this.So?.put(BigInt(t),i),i};id=-1;Su=-1;type=-1;zl=-1;_l=0;width=0;height=0;Cc=-1;Jo=null;Qo=null;scripts=null;scroll=0;hide=!1;draggable=!1;Mu=!1;Du=!1;Sl=0;xl=0;Tl=null;Rl=null;Wl=null;Bu=null;fill=!1;Jl=!1;font=null;Ql=!1;text=null;jl=null;Hl=0;Xl=0;Kl=0;sa=null;ea=null;model=null;Uu=null;al=-1;cl=-1;zoom=0;oa=0;fa=0;Pu=null;action=null;Gu=-1;Ec=null;ll=null;ml=null;pl=null;x=0;y=0;vl=0;Ol=null;Ll=null;ul=0;fl=0;la(t,i,e){let s=this.model;if(e&&(s=this.Uu),!s)return null;if(-1===t&&-1===i&&!s.Yu)return s;const r=n.A.Hu(s,!0,!0,!1);return-1===t&&-1===i||r.xa(),-1!==t&&r.ka(t),-1!==i&&r.ka(i),r.Ma(64,768,-50,-10,-50,!0),r}ac(){if(this.Su===this.id)return this.x;let t=c.Lo[this.Su];if(!t.ll||!t.ml||!t.pl)return this.x;let i=t.ll.indexOf(this.id);if(-1===i)return this.x;let e=t.ml[i];for(;t.Su!==t.id;){const s=c.Lo[t.Su];s.ll&&s.ml&&s.pl&&(i=s.ll.indexOf(t.id),-1!==i&&(e+=s.ml[i])),t=s}return e}cc(){if(this.Su===this.id)return this.y;let t=c.Lo[this.Su];if(!t.ll||!t.ml||!t.pl)return this.y;let i=t.ll.indexOf(this.id);if(-1===i)return this.y;let e=t.pl[i];for(;t.Su!==t.id;){const s=c.Lo[t.Su];s.ll&&s.ml&&s.pl&&(i=s.ll.indexOf(t.id),-1!==i&&(e+=s.pl[i])),t=s}return e}outline(t){const i=this.ac(),e=this.cc();a.A.gl(i,e,this.width,this.height,t)}move(t,i){if(this.Su===this.id)return;this.x=0,this.y=0;const e=c.Lo[this.Su];if(e.ll&&e.ml&&e.pl){const s=e.ll.indexOf(this.id);-1!==s&&(e.ml[s]=t,e.pl[s]=i)}}delete(){if(this.Su===this.id)return;const t=c.Lo[this.Su];if(t.ll&&t.ml&&t.pl){const i=t.ll.indexOf(this.id);-1!==i&&(t.ll.splice(i,1),t.ml.splice(i,1),t.pl.splice(i,1))}}}},6333:(t,i,e)=>{e.d(i,{$:()=>s});class s{id;Vu=null;constructor(t){this.id=t}Ku(t){for(;;){const i=t.xu;if(0===i)break;this.decode(i,t)}return this}}},2164:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(6333);class r extends n.${static count=0;static Lo=[];static nc=t=>{const i=new s.A(t.read('flo.dat'));this.count=i.Lu;for(let t=0;t(e>179&&(i=i/2|0),e>192&&(i=i/2|0),e>217&&(i=i/2|0),e>243&&(i=i/2|0),(t/4<<10)+(i/32<<7)+(e/2|0));static ju=(t,i)=>-1===t?12345678:((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);static zu=(t,i)=>-2===t?12345678:-1===t?(i<0?i=0:i>127&&(i=127),127-i):((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);Zu=0;texture=-1;qu=!1;Ju=!0;$u=0;Qu=0;td=0;ed=0;sd=0;nd=0;decode(t,i){1===t?(this.Zu=i.rd,this.setColor(this.Zu)):2===t?this.texture=i.xu:3===t?this.qu=!0:5===t?this.Ju=!1:6===t?this.Vu=i.Nu:console.log('Error unrecognised config code: ',t)}setColor(t){const i=(t>>16&255)/256,e=(t>>8&255)/256,s=(255&t)/256;let n=i;ei&&(h=e),s>h&&(h=s);let o=0,l=0;const a=(n+h)/2;n!==h&&(a<.5&&(l=(h-n)/(h+n)),a>=.5&&(l=(h-n)/(2-h-n)),i===h?o=(e-s)/(h-n):e===h?o=(s-i)/(h-n)+2:s===h&&(o=(i-e)/(h-n)+4)),o/=6,this.$u=256*o|0,this.Qu=256*l|0,this.td=256*a|0,this.Qu<0?this.Qu=0:this.Qu>255&&(this.Qu=255),this.td<0?this.td=0:this.td>255&&(this.td=255),this.ed=a>.5?(1-a)*l*512|0:a*l*512|0,this.ed<1&&(this.ed=1),this.sd=o*this.ed|0;let c=this.$u+(16*Math.random()|0)-8;c<0?c=0:c>255&&(c=255);let f=this.Qu+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255);let u=this.td+(48*Math.random()|0)-24;u<0?u=0:u>255&&(u=255),this.nd=r.Xu(c,f,u)}}},8317:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(1069),n=e(6333),r=e(8665),h=e(3867);class o extends n.${static count=0;static Lo=[];static nc=t=>{const i=new s.A(t.read('idk.dat'));this.count=i.Lu;for(let t=0;t=40&&t<50)this.ld[t-40]=i.Lu;else if(t>=50&&t<60)this.ad[t-50]=i.Lu;else{if(!(t>=60&&t<70))throw new Error(`Unrecognized idk config code: ${t}`);this.od[t-60]=i.Lu}}la(){if(!this.hd)return null;const t=new h.fe(this.hd.length,null);for(let i=0;i{e.d(i,{A:()=>c});var s=e(6333),n=e(1069),r=e(2679),h=e(8665),o=e(1023),l=e(6169),a=e(3867);class c extends s.${static count=0;static cache=null;static ud=null;static dd=null;static wd=0;static yd=new r.A(500);static Ad=new r.A(30);static nc=t=>{this.ud=new n.A(t.read('loc.dat'));const i=new n.A(t.read('loc.idx'));this.count=i.Lu,this.dd=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.dd||!this.ud)throw new Error('LocType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.wd=(this.wd+1)%10;const i=this.cache[this.wd];return this.ud.Mf=this.dd[t],i.id=t,i.reset(),i.Ku(this.ud),i.md||(i.md=new Int32Array(1)),-1===i.pd&&i.md&&(i.active=i.md.length>0&&i.md[0]===o.A.gd.id,i.Id&&(i.active=!0)),i};static To=()=>{this.yd=null,this.Ad=null,this.dd=null,this.cache=null,this.ud=null};hd=null;md=null;name=null;_d=null;ld=null;ad=null;width=1;length=1;Cd=!0;Ed=!0;active=!1;pd=-1;vd=!1;bd=!1;Ju=!1;al=-1;Td=!1;Rd=16;Od=0;Ld=0;Id=null;Sd=-1;xd=-1;kd=!1;Md=!0;Dd=128;Nd=128;Fd=128;Bd=0;Ud=0;Pd=0;Gd=0;Wd=!1;decode(t,i){if(1===t){const t=i.xu;this.hd=new Int32Array(t),this.md=new Int32Array(t);for(let e=0;e=30&&t<39)this.Id||(this.Id=new a.fe(5,null)),this.Id[t-30]=i.Nu,'hidden'===this.Id[t-30]?.toLowerCase()&&(this.Id[t-30]=null);else if(40===t){const t=i.xu;this.ld=new Uint16Array(t),this.ad=new Uint16Array(t);for(let e=0;e=this.hd.length)return null;let d=this.hd[a];if(-1===d)return null;const w=this.kd!==i>3;w&&(d+=65536);let y=c.yd?.get(BigInt(d));y||(y=h.A.model(65535&d),w&&y.Zd(),c.yd?.put(BigInt(d),y));const A=128!==this.Dd||128!==this.Nd||128!==this.Fd,m=0!==this.Ud||0!==this.Pd||0!==this.Gd;let p=h.A.Hu(y,!this.ld,!this.Td,i===l.A.qd&&-1===o&&!A&&!m);for(-1!==o&&(p.xa(),p.ka(o),p.Jd=null,p.$d=null);i-- >0;)p.Qd();if(this.ld&&this.ad)for(let t=0;t{e.d(i,{A:()=>l});var s=e(6333),n=e(1069),r=e(2679),h=e(8665),o=e(3867);class l extends s.${static count=0;static cache=null;static ud=null;static dd=null;static wd=0;static So=new r.A(30);static nc=t=>{this.ud=new n.A(t.read('npc.dat'));const i=new n.A(t.read('npc.idx'));this.count=i.Lu,this.dd=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.dd||!this.ud)throw new Error('NpcType not loaded!!!');for(let i=0;i<20;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.wd=(this.wd+1)%20;const i=this.cache[this.wd]=new l(t);return this.ud.Mf=this.dd[t],i.Ku(this.ud),i};static To=()=>{this.So=null,this.dd=null,this.cache=null,this.ud=null};name=null;_d=null;size=1;hd=null;od=null;Td=!1;ew=-1;sw=-1;nw=-1;rw=-1;hw=-1;ld=null;ad=null;Id=null;Dd=-1;Nd=-1;Fd=-1;ow=!0;lw=-1;aw=128;cw=128;decode(t,i){if(1===t){const t=i.xu;this.hd=new Uint16Array(t);for(let e=0;e=30&&t<40)this.Id||(this.Id=new o.fe(5,null)),this.Id[t-30]=i.Nu,'hidden'===this.Id[t-30]?.toLowerCase()&&(this.Id[t-30]=null);else if(40===t){const t=i.xu;this.ld=new Uint16Array(t),this.ad=new Uint16Array(t);for(let e=0;e{e.d(i,{A:()=>u});var s=e(6333),n=e(1069),r=e(2511),h=e(2679),o=e(8665),l=e(4583),a=e(8950),c=e(9298),f=e(3867);class u extends s.${static count=0;static cache=null;static ud=null;static dd=null;static wd=0;static Aw=!0;static So=new h.A(50);static mw=new h.A(200);static nc=(t,i)=>{this.Aw=i,this.ud=new n.A(t.read('obj.dat'));const e=new n.A(t.read('obj.idx'));this.count=e.Lu,this.dd=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.dd||!this.ud)throw new Error('ObjType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.wd=(this.wd+1)%10;const i=this.cache[this.wd];return this.ud.Mf=this.dd[t],i.id=t,i.reset(),i.Ku(this.ud),-1!==i.pw&&i.gw(),!this.Aw&&i.members&&(i.name='Members Object',i._d="Login to a members' server to use this object.",i.Id=null,i.Iw=null),i};static To=()=>{this.So=null,this.mw=null,this.dd=null,this.cache=null,this.ud=null};static kl=(t,i)=>{if(u.mw){let e=u.mw.get(BigInt(t));if(e&&e._w!==i&&-1!==e._w&&(e.Cw(),e=null),e)return e}let e=u.get(t);if(e.Ew||(i=-1),e.Ew&&e.bw&&i>1){let t=-1;for(let s=0;s<10;s++)i>=e.bw[s]&&0!==e.bw[s]&&(t=e.Ew[s]);-1!==t&&(e=u.get(t))}const s=new r.A(32,32),n=l.A.ra,h=l.A.ha,o=l.A.Tw,f=a.A.Rw,d=a.A.Ow,w=a.A.Lw,y=a.A.left,A=a.A.right,m=a.A.top,p=a.A.bottom;l.A.Sw=!1,a.A.bind(s.Rw,32,32),a.A.fillRect(0,0,32,32,c.A.Pl),l.A.rc();const g=e.xw(1),I=l.A.sin[e.kw]*e.Mw>>16,_=l.A.cos[e.kw]*e.Mw>>16;g.ca(0,e.Dw,e.Nw,e.kw,e.Fw,I+(g.iw/2|0)+e.Bw,_+e.Bw);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.Rw[t+32*i]&&(t>0&&s.Rw[t+32*i-1]>1||i>0&&s.Rw[t+32*(i-1)]>1||t<31&&s.Rw[t+32*i+1]>1||i<31&&s.Rw[t+32*(i+1)]>1)&&(s.Rw[t+32*i]=1);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.Rw[t+32*i]&&t>0&&i>0&&s.Rw[t+32*(i-1)-1]>0&&(s.Rw[t+32*i]=3153952);if(-1!==e.pw){const t=this.kl(e.Uw,10),i=t.Fl,s=t._w;t.Fl=32,t._w=32,t.Pw(5,5,22,22),t.Fl=i,t._w=s}return u.mw?.put(BigInt(t),s),a.A.bind(f,d,w),a.A.Al(y,m,A,p),l.A.ra=n,l.A.ha=h,l.A.Tw=o,l.A.Sw=!0,e.da?s.Fl=33:s.Fl=32,s._w=i,s};model=0;name=null;_d=null;ld=null;ad=null;Mw=2e3;kw=0;Dw=0;Nw=0;Fw=0;Bw=0;Gw=!1;Ww=-1;da=!1;Yw=1;members=!1;Id=null;Iw=null;Hw=-1;Vw=-1;Kw=0;Xw=-1;jw=-1;zw=0;Zw=-1;qw=-1;Jw=-1;$w=-1;Qw=-1;ty=-1;Ew=null;bw=null;Uw=-1;pw=-1;decode(t,i){if(1===t)this.model=i.Lu;else if(2===t)this.name=i.Nu;else if(3===t)this._d=i.Nu;else if(4===t)this.Mw=i.Lu;else if(5===t)this.kw=i.Lu;else if(6===t)this.Dw=i.Lu;else if(7===t)this.Fw=i.ku,this.Fw>32767&&(this.Fw-=65536);else if(8===t)this.Bw=i.ku,this.Bw>32767&&(this.Bw-=65536);else if(9===t)this.Gw=!0;else if(10===t)this.Ww=i.Lu;else if(11===t)this.da=!0;else if(12===t)this.Yw=i.Ko;else if(16===t)this.members=!0;else if(23===t)this.Hw=i.Lu,this.Kw=i.Yd;else if(24===t)this.Vw=i.Lu;else if(25===t)this.Xw=i.Lu,this.zw=i.Yd;else if(26===t)this.jw=i.Lu;else if(t>=30&&t<35)this.Id||(this.Id=new f.fe(5,null)),this.Id[t-30]=i.Nu,'hidden'===this.Id[t-30]?.toLowerCase()&&(this.Id[t-30]=null);else if(t>=35&&t<40)this.Iw||(this.Iw=new f.fe(5,null)),this.Iw[t-35]=i.Nu;else if(40===t){const t=i.xu;this.ld=new Uint16Array(t),this.ad=new Uint16Array(t);for(let e=0;e=100&&t<110&&(this.Ew&&this.bw||(this.Ew=new Uint16Array(10),this.bw=new Uint16Array(10)),this.Ew[t-100]=i.Lu,this.bw[t-100]=i.Lu)}iy(t){let i=this.Hw;if(1===t&&(i=this.Xw),-1===i)return null;let e=this.Vw,s=this.Zw;1===t&&(e=this.jw,s=this.qw);let n=o.A.model(i);if(-1!==e){const t=o.A.model(e);if(-1===s){const i=[n,t];n=o.A.Ta(i,2)}else{const i=[n,t,o.A.model(s)];n=o.A.Ta(i,3)}}if(0===t&&0!==this.Kw&&n.translate(this.Kw,0,0),1===t&&0!==this.zw&&n.translate(this.zw,0,0),this.ld&&this.ad)for(let t=0;t1){let i=-1;for(let e=0;e<10;e++)t>=this.bw[e]&&0!==this.bw[e]&&(i=this.Ew[e]);if(-1!==i)return u.get(i).xw(1)}if(u.So){const t=u.So.get(BigInt(this.id));if(t)return t}const i=o.A.model(this.model);if(this.ld&&this.ad)for(let t=0;t{e.d(i,{A:()=>h});var s=e(6333),n=e(1069),r=e(6730);class h extends s.${static count=0;static Lo=[];static nc=t=>{const i=new n.A(t.read('seq.dat'));this.count=i.Lu;for(let t=0;t{e.d(i,{A:()=>l});var s=e(6333),n=e(1069),r=e(1312),h=e(8665),o=e(2679);class l extends s.${static count=0;static Lo=[];static So=new o.A(30);static nc=t=>{const i=new n.A(t.read('spotanim.dat'));this.count=i.Lu;for(let t=0;t=40&&t<50)this.ld[t-40]=i.Lu;else{if(!(t>=50&&t<60))throw new Error(`Unrecognized spotanim config code: ${t}`);this.ad[t-50]=i.Lu}}la(){let t=l.So?.get(BigInt(this.id));if(t)return t;t=h.A.model(this.model);for(let i=0;i<6;i++)0!==this.ld[0]&&t.Ra(this.ld[i],this.ad[i]);return l.So?.put(BigInt(this.id),t),t}}},3764:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(6333),n=e(1069);class r extends s.${static count=0;static Lo=[];static uy=[];static wy=0;static nc=t=>{const i=new n.A(t.read('varp.dat'));this.count=i.Lu;for(let t=0;t{e.d(i,{A:()=>s});class s{static OPEN=0;static Iy=1;static _y=2;static Cy=4;static Ey=8;static vy=s.Iy<<4;static by=s._y<<4;static Ty=s.Cy<<4;static Ry=s.Ey<<4;static Oy=256;static Ly=512;static Sy=1024;static xy=2048;static ky=4096;static My=s.Ly<<4;static Dy=s.Sy<<4;static Ny=s.xy<<4;static Fy=s.ky<<4;static By=s.Oy<<9;static Uy=524288;static Py=2097152;static Gy=s.Py|s.Uy;static Wy=s.Oy|s.Gy;static Yy=s._y|s.Wy;static Hy=s.Ey|s.Wy;static Vy=s._y|s.Cy|s.Hy;static Ky=s.by|s.Wy;static Xy=s.Ey|s.vy|s.Ky;static jy=s.Ry|s.Wy;static zy=s.Iy|s._y|s.jy;static Zy=s.by|s.Ty|s.jy;static qy=16777215}},670:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(9456),n=e(6169),r=e(1023),h=e(4909);class o{static Dr=4;static jr=104;static index=(t,i)=>t*o.jr+i;offsetX;Jy;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.Jy=0,this.sizeX=o.jr,this.sizeZ=o.jr,this.flags=new Int32Array(this.sizeX*this.sizeZ),this.reset()}reset=()=>{for(let t=0;t{this.flags[o.index(t-this.offsetX,i-this.Jy)]|=s.A.Py};Qy=(t,i)=>{this.flags[o.index(t-this.offsetX,i-this.Jy)]&=~s.A.Py};tA=(t,i,e,r,h,o)=>{let l=s.A.Oy;o&&(l|=s.A.By);const a=t-this.offsetX,c=i-this.Jy;if(h===n.A.iA||h===n.A.eA){const t=e;e=r,r=t}for(let t=a;t=0&&t=0&&i{let l=s.A.Oy;o&&(l|=s.A.By);const a=t-this.offsetX,c=i-this.Jy;if(h===n.A.iA||h===n.A.eA){const t=e;e=r,r=t}for(let t=a;t=0&&t=0&&i{const l=t-this.offsetX,a=i-this.Jy,c=o?s.A.Fy:s.A.Ry,f=o?s.A.ky:s.A.Ey,u=o?s.A.Sy:s.A._y,d=o?s.A.Dy:s.A.by,w=o?s.A.Ly:s.A.Iy,y=o?s.A.My:s.A.vy,A=o?s.A.xy:s.A.Cy,m=o?s.A.Ny:s.A.Ty;e===r.A.rA.id?h===n.A.qd?(this.add(l,a,c),this.add(l-1,a,f)):h===n.A.iA?(this.add(l,a,u),this.add(l,a+1,d)):h===n.A.hA?(this.add(l,a,f),this.add(l+1,a,c)):h===n.A.eA&&(this.add(l,a,d),this.add(l,a-1,u)):e===r.A.oA.id||e===r.A.lA.id?h===n.A.qd?(this.add(l,a,w),this.add(l-1,a+1,y)):h===n.A.iA?(this.add(l,a,A),this.add(l+1,a+1,m)):h===n.A.hA?(this.add(l,a,y),this.add(l+1,a-1,w)):h===n.A.eA&&(this.add(l,a,m),this.add(l-1,a-1,A)):e===r.A.aA.id&&(h===n.A.qd?(this.add(l,a,u|c),this.add(l-1,a,f),this.add(l,a+1,d)):h===n.A.iA?(this.add(l,a,u|f),this.add(l,a+1,d),this.add(l+1,a,c)):h===n.A.hA?(this.add(l,a,d|f),this.add(l+1,a,c),this.add(l,a-1,u)):h===n.A.eA&&(this.add(l,a,d|c),this.add(l,a-1,u),this.add(l-1,a,f))),o&&this.nA(t,i,e,h,!1)};cA=(t,i,e,h,o)=>{const l=t-this.offsetX,a=i-this.Jy,c=o?s.A.Fy:s.A.Ry,f=o?s.A.ky:s.A.Ey,u=o?s.A.Sy:s.A._y,d=o?s.A.Dy:s.A.by,w=o?s.A.Ly:s.A.Iy,y=o?s.A.My:s.A.vy,A=o?s.A.xy:s.A.Cy,m=o?s.A.Ny:s.A.Ty;e===r.A.rA.id?h===n.A.qd?(this.remove(l,a,c),this.remove(l-1,a,f)):h===n.A.iA?(this.remove(l,a,u),this.remove(l,a+1,d)):h===n.A.hA?(this.remove(l,a,f),this.remove(l+1,a,c)):h===n.A.eA&&(this.remove(l,a,d),this.remove(l,a-1,u)):e===r.A.oA.id||e===r.A.lA.id?h===n.A.qd?(this.remove(l,a,w),this.remove(l-1,a+1,y)):h===n.A.iA?(this.remove(l,a,A),this.remove(l+1,a+1,m)):h===n.A.hA?(this.remove(l,a,y),this.remove(l+1,a-1,w)):h===n.A.eA&&(this.remove(l,a,m),this.remove(l-1,a-1,A)):e===r.A.aA.id&&(h===n.A.qd?(this.remove(l,a,u|c),this.remove(l-1,a,f),this.remove(l,a+1,d)):h===n.A.iA?(this.remove(l,a,u|f),this.remove(l,a+1,d),this.remove(l+1,a,c)):h===n.A.hA?(this.remove(l,a,d|f),this.remove(l+1,a,c),this.remove(l,a-1,u)):h===n.A.eA&&(this.remove(l,a,d|c),this.remove(l,a-1,u),this.remove(l-1,a,f))),o&&this.cA(t,i,e,h,!1)};fA=(t,i,e,h,l,a)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.Jy,u=e-this.offsetX,d=h-this.Jy,w=o.index(c,f);if(l===r.A.rA.id){if(a===n.A.qd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Ky)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Yy)===s.A.OPEN)return!0}else if(a===n.A.iA){if(c===u&&f===d+1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Hy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.jy)===s.A.OPEN)return!0}else if(a===n.A.hA){if(c===u+1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Ky)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Yy)===s.A.OPEN)return!0}else if(a===n.A.eA){if(c===u&&f===d-1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Hy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.jy)===s.A.OPEN)return!0}}else if(l===r.A.aA.id){if(a===n.A.qd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.jy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Yy)===s.A.OPEN)return!0}else if(a===n.A.iA){if(c===u-1&&f===d&&(this.flags[w]&s.A.Hy)===s.A.OPEN)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Yy)===s.A.OPEN)return!0}else if(a===n.A.hA){if(c===u-1&&f===d&&(this.flags[w]&s.A.Hy)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Ky)===s.A.OPEN)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1)return!0}else if(a===n.A.eA){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Ky)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.jy)===s.A.OPEN)return!0;if(c===u&&f===d-1)return!0}}else if(l===r.A.uA.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.by)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A._y)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Ey)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Ry)===s.A.OPEN)return!0}return!1};dA=(t,i,e,h,l,a)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.Jy,u=e-this.offsetX,d=h-this.Jy,w=o.index(c,f);if(l===r.A.wA.id||l===r.A.yA.id){if(l===r.A.yA.id&&(a=a+2&3),a===n.A.qd){if(c===u+1&&f===d&&(this.flags[w]&s.A.Ry)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A._y)===s.A.OPEN)return!0}else if(a===n.A.iA){if(c===u-1&&f===d&&(this.flags[w]&s.A.Ey)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A._y)===s.A.OPEN)return!0}else if(a===n.A.hA){if(c===u-1&&f===d&&(this.flags[w]&s.A.Ey)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.by)===s.A.OPEN)return!0}else if(a===n.A.eA){if(c===u+1&&f===d&&(this.flags[w]&s.A.Ry)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.by)===s.A.OPEN)return!0}}else if(l===r.A.AA.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.by)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A._y)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Ey)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Ry)===s.A.OPEN)return!0}return!1};mA=(t,i,e,n,r,l,a)=>{const c=e+r-1,f=n+l-1,u=o.index(t-this.offsetX,i-this.Jy);return t>=e&&t<=c&&i>=n&&i<=f||(t===e-1&&i>=n&&i<=f&&(this.flags[u]&s.A.Ey)===s.A.OPEN&&(a&h.A.qd)===s.A.OPEN||(t===c+1&&i>=n&&i<=f&&(this.flags[u]&s.A.Ry)===s.A.OPEN&&(a&h.A.hA)===s.A.OPEN||(i===n-1&&t>=e&&t<=c&&(this.flags[u]&s.A._y)===s.A.OPEN&&(a&h.A.eA)===s.A.OPEN||i===f+1&&t>=e&&t<=c&&(this.flags[u]&s.A.by)===s.A.OPEN&&(a&h.A.iA)===s.A.OPEN)))};add=(t,i,e)=>{this.flags[o.index(t,i)]|=e};remove=(t,i,e)=>{this.flags[o.index(t,i)]&=s.A.qy-e}}},4909:(t,i,e)=>{e.d(i,{A:()=>s});class s{static iA=1;static hA=2;static eA=4;static qd=8}},6169:(t,i,e)=>{e.d(i,{A:()=>s});class s{static qd=0;static iA=1;static hA=2;static eA=3}},5599:(t,i,e)=>{e.d(i,{A:()=>s});class s{static pA=0;static gA=1;static IA=2;static _A=3}},1023:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5599);class n{static rA=new n(0,s.A.pA);static oA=new n(1,s.A.pA);static aA=new n(2,s.A.pA);static lA=new n(3,s.A.pA);static CA=new n(4,s.A.gA);static EA=new n(5,s.A.gA);static wA=new n(6,s.A.gA);static yA=new n(7,s.A.gA);static AA=new n(8,s.A.gA);static uA=new n(9,s.A.IA);static gd=new n(10,s.A.IA);static vA=new n(11,s.A.IA);static bA=new n(12,s.A.IA);static TA=new n(13,s.A.IA);static RA=new n(14,s.A.IA);static OA=new n(15,s.A.IA);static LA=new n(16,s.A.IA);static SA=new n(17,s.A.IA);static xA=new n(18,s.A.IA);static kA=new n(19,s.A.IA);static MA=new n(20,s.A.IA);static DA=new n(21,s.A.IA);static _A=new n(22,s.A._A);static values(){return[this.rA,this.oA,this.SA,this.OA,this.aA,this.RA,this.uA,this.lA,this._A,this.bA,this.vA,this.wA,this.MA,this.gd,this.EA,this.TA,this.yA,this.CA,this.LA,this.AA,this.kA,this.DA,this.xA]}static of(t){const i=this.values();for(let e=0;e{e.d(i,{A:()=>A});var s=e(670),n=e(2164),r=e(1069),h=e(4583),o=e(3045),l=e(5637),a=e(4197),c=e(1312),f=e(1023),u=e(6169),d=e(9298),w=e(5518),y=e(3867);class A{static NA=Int8Array.of(1,2,4,8);static FA=Uint8Array.of(16,32,64,128);static BA=Int8Array.of(1,0,-1,0);static UA=Int8Array.of(0,-1,0,1);static PA=(17*Math.random()|0)-8;static GA=(33*Math.random()|0)-16;static et=!0;static WA=0;static YA=!1;static HA=(t,i)=>{let e=this.VA(t+45365,i+91923,4)+(this.VA(t+10294,i+37821,2)-128>>1)+(this.VA(t,i,1)-128>>2)-128;return e=35+(.3*e|0),e<10?e=10:e>60&&(e=60),e};static VA=(t,i,e)=>{const s=t/e|0,n=t&e-1,r=i/e|0,h=i&e-1,o=this.KA(s,r),l=this.KA(s+1,r),a=this.KA(s,r+1),c=this.KA(s+1,r+1),f=this.XA(o,l,n,e),u=this.XA(a,c,n,e);return this.XA(f,u,h,e)};static XA=(t,i,e,s)=>{const n=65536-h.A.cos[1024*e/s|0]>>1;return(t*(65536-n)>>16)+(i*n>>16)};static KA=(t,i)=>((this.jA(t-1,i-1)+this.jA(t+1,i-1)+this.jA(t-1,i+1)+this.jA(t+1,i+1))/16|0)+((this.jA(t-1,i)+this.jA(t+1,i)+this.jA(t,i-1)+this.jA(t,i+1))/8|0)+(this.jA(t,i)/4|0);static jA=(t,i)=>{const e=t+57*i,s=BigInt(e<<13^e);return 255&Number((s*(s*s*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static tA=(t,i,e,s,n,r,h,o,d,w,y)=>{const m=n[y][i][e],p=n[y][i+1][e],g=n[y][i+1][e+1],I=n[y][i][e+1],_=m+p+g+I>>2,C=l.A.get(o);let E=i+(e<<7)+(o<<14)+1073741824|0;C.active||(E+=-2147483648),E|=0;const v=(w<<6)+d<<24>>24;if(d===f.A._A.id)s?.zA(C.la(f.A._A.id,w,m,p,g,I,-1),t,i,e,_,E,v),C.Cd&&C.active&&h?.$y(i,e),-1!==C.al&&r.ZA(new a.A(o,t,3,i,e,c.A.Lo[C.al],!0));else if(d===f.A.gd.id||d===f.A.vA.id){const n=C.la(f.A.gd.id,w,m,p,g,I,-1);if(n){let r,h,o=0;d===f.A.vA.id&&(o+=256),w===u.A.iA||w===u.A.eA?(r=C.length,h=C.width):(r=C.width,h=C.length),s?.tA(t,i,e,_,n,null,E,v,r,h,o)}C.Cd&&h?.tA(i,e,C.width,C.length,w,C.Ed),-1!==C.al&&r.ZA(new a.A(o,t,2,i,e,c.A.Lo[C.al],!0))}else if(d>=f.A.bA.id)s?.tA(t,i,e,_,C.la(d,w,m,p,g,I,-1),null,E,v,1,1,0),C.Cd&&h?.tA(i,e,C.width,C.length,w,C.Ed),-1!==C.al&&r.ZA(new a.A(o,t,2,i,e,c.A.Lo[C.al],!0));else if(d===f.A.rA.id)s?.nA(t,i,e,_,A.NA[w],0,C.la(f.A.rA.id,w,m,p,g,I,-1),null,E,v),C.Cd&&h?.nA(i,e,d,w,C.Ed),-1!==C.al&&r.ZA(new a.A(o,t,0,i,e,c.A.Lo[C.al],!0));else if(d===f.A.oA.id)s?.nA(t,i,e,_,A.FA[w],0,C.la(f.A.oA.id,w,m,p,g,I,-1),null,E,v),C.Cd&&h?.nA(i,e,d,w,C.Ed),-1!==C.al&&r.ZA(new a.A(o,t,0,i,e,c.A.Lo[C.al],!0));else if(d===f.A.aA.id){const n=w+1&3;s?.nA(t,i,e,_,A.NA[w],A.NA[n],C.la(f.A.aA.id,w+4,m,p,g,I,-1),C.la(f.A.aA.id,n,m,p,g,I,-1),E,v),C.Cd&&h?.nA(i,e,d,w,C.Ed),-1!==C.al&&r.ZA(new a.A(o,t,0,i,e,c.A.Lo[C.al],!0))}else if(d===f.A.lA.id)s?.nA(t,i,e,_,A.FA[w],0,C.la(f.A.lA.id,w,m,p,g,I,-1),null,E,v),C.Cd&&h?.nA(i,e,d,w,C.Ed),-1!==C.al&&r.ZA(new a.A(o,t,0,i,e,c.A.Lo[C.al],!0));else if(d===f.A.uA.id)s?.tA(t,i,e,_,C.la(d,w,m,p,g,I,-1),null,E,v,1,1,0),C.Cd&&h?.tA(i,e,C.width,C.length,w,C.Ed),-1!==C.al&&r.ZA(new a.A(o,t,2,i,e,c.A.Lo[C.al],!0));else if(d===f.A.CA.id)s?.qA(t,i,e,_,0,0,E,C.la(f.A.CA.id,u.A.qd,m,p,g,I,-1),v,512*w,A.NA[w]),-1!==C.al&&r.ZA(new a.A(o,t,1,i,e,c.A.Lo[C.al],!0));else if(d===f.A.EA.id){let n=16;if(s){const r=s.JA(t,i,e);r>0&&(n=l.A.get(r>>14&32767).Rd)}s?.qA(t,i,e,_,A.BA[w]*n,A.UA[w]*n,E,C.la(f.A.CA.id,u.A.qd,m,p,g,I,-1),v,512*w,A.NA[w]),-1!==C.al&&r.ZA(new a.A(o,t,1,i,e,c.A.Lo[C.al],!0))}else d===f.A.wA.id?(s?.qA(t,i,e,_,0,0,E,C.la(f.A.CA.id,u.A.qd,m,p,g,I,-1),v,w,256),-1!==C.al&&r.ZA(new a.A(o,t,1,i,e,c.A.Lo[C.al],!0))):d===f.A.yA.id?(s?.qA(t,i,e,_,0,0,E,C.la(f.A.CA.id,u.A.qd,m,p,g,I,-1),v,w,512),-1!==C.al&&r.ZA(new a.A(o,t,1,i,e,c.A.Lo[C.al],!0))):d===f.A.AA.id&&(s?.qA(t,i,e,_,0,0,E,C.la(f.A.CA.id,u.A.qd,m,p,g,I,-1),v,w,768),-1!==C.al&&r.ZA(new a.A(o,t,1,i,e,c.A.Lo[C.al],!0)))};$A;QA;Hr;Vr;tm;im;sm;nm;rm;hm;om;lm;am;fm;um;dm;constructor(t,i,e,n){this.$A=t,this.QA=i,this.Hr=e,this.Vr=n,this.tm=new y.wm(s.A.Dr,t,i),this.im=new y.wm(s.A.Dr,t,i),this.sm=new y.wm(s.A.Dr,t,i),this.nm=new y.wm(s.A.Dr,t,i),this.dm=new y.ym(s.A.Dr,t+1,i+1),this.rm=new y.wm(s.A.Dr,t+1,i+1),this.hm=new y.Xr(t+1,i+1),this.om=new Int32Array(i),this.lm=new Int32Array(i),this.am=new Int32Array(i),this.fm=new Int32Array(i),this.um=new Int32Array(i)}Am=(t,i)=>{for(let t=0;t=0&&i[s]?.$y(e,n)}A.PA+=(5*Math.random()|0)-2,A.PA<-8?A.PA=-8:A.PA>8&&(A.PA=8),A.GA+=(5*Math.random()|0)-2,A.GA<-16?A.GA=-16:A.GA>16&&(A.GA=16);for(let i=0;i>8;for(let t=1;t>2)+(e[n+1][t]>>3)+(e[n][t-1]>>2)+(e[n][t+1]>>3)+(e[n][t]>>1);this.hm[n][t]=u-d}for(let t=0;t=0&&s0){const i=n.A.Lo[e-1];this.om[t]+=i.sd,this.lm[t]+=i.Qu,this.am[t]+=i.td,this.fm[t]+=i.ed,r=this.um[t]++}}const h=e-5;if(h>=0&&h0){const i=n.A.Lo[e-1];this.om[t]-=i.sd,this.lm[t]-=i.Qu,this.am[t]-=i.td,this.fm[t]-=i.ed,r=this.um[t]--}}}if(e>=1&&e=0&&f=0&&y=1&&c0||y>0){const m=this.Hr[i][e][c],p=this.Hr[i][e+1][c],g=this.Hr[i][e+1][c+1],I=this.Hr[i][e][c+1],_=this.hm[e][c],C=this.hm[e+1][c],E=this.hm[e+1][c+1],v=this.hm[e][c+1];let b=-1,T=-1;if(f>0){const t=256*s/l|0,i=r/a|0;let e=o/a|0;b=n.A.Xu(t,i,e);const h=t+A.PA&255;e+=A.GA,e<0?e=0:e>255&&(e=255),T=n.A.Xu(h,i,e)}if(i>0){let t=0!==f||this.sm[i][e][c]===w.A.gm;y>0&&!n.A.Lo[y-1].Ju&&(t=!1),t&&m===p&&m===g&&m===I&&(this.dm[i][e][c]|=2340)}let R=0;if(-1!==b&&(R=h.A.palette[n.A.ju(T,96)]),0===y)t?.Im(i,e,c,w.A.gm,u.A.qd,-1,m,p,g,I,n.A.ju(b,_),n.A.ju(b,C),n.A.ju(b,E),n.A.ju(b,v),d.A.Pl,d.A.Pl,d.A.Pl,d.A.Pl,R,d.A.Pl);else{const s=this.sm[i][e][c]+1,r=this.nm[i][e][c],o=n.A.Lo[y-1];let l,a,f=o.texture;f>=0?(a=h.A._m(f),l=-1):o.Zu===d.A.Cm?(a=0,l=-2,f=-1):(l=n.A.Xu(o.$u,o.Qu,o.td),a=h.A.palette[n.A.zu(o.nd,96)]),t?.Im(i,e,c,s,r,f,m,p,g,I,n.A.ju(b,_),n.A.ju(b,C),n.A.ju(b,E),n.A.ju(b,v),n.A.zu(l,_),n.A.zu(l,C),n.A.zu(l,E),n.A.zu(l,v),R,a)}}}}}}for(let e=1;e0&&(t<<=3,i<<=3,e<<=3);for(let s=0;s<=n;s++)for(let r=0;r<=this.QA;r++)for(let h=0;h<=this.$A;h++){if(this.dm[s][h][r]&t){let i=r,e=r,l=s,a=s;for(;i>0&&this.dm[s][h][i-1]&t;)i--;for(;e0;){for(let s=i;s<=e;s++)if(!(this.dm[l-1][h][s]&t))break t;l--}t:for(;a=8){const s=this.Hr[a][h][i]-240,r=this.Hr[l][h][i];o.A.Tm(n,1,128*h,s,128*i,128*h,r,128*e+128);for(let s=l;s<=a;s++)for(let n=i;n<=e;n++)this.dm[s][h][n]&=~t}}if(this.dm[s][h][r]&i){let t=h,e=h,l=s,a=s;for(;t>0&&this.dm[s][t-1][r]&i;)t--;for(;e0;){for(let s=t;s<=e;s++)if(!(this.dm[l-1][s][r]&i))break t;l--}t:for(;a=8){const s=this.Hr[a][t][r]-240,h=this.Hr[l][t][r];o.A.Tm(n,2,128*t,s,128*r,128*e+128,h,128*r);for(let s=l;s<=a;s++)for(let n=t;n<=e;n++)this.dm[s][n][r]&=~i}}if(this.dm[s][h][r]&e){let t=h,i=h,l=r,a=r;for(;l>0&&this.dm[s][h][l-1]&e;)l--;for(;a0;){for(let i=l;i<=a;i++)if(!(this.dm[s][t-1][i]&e))break t;t--}t:for(;i=4){const r=this.Hr[s][t][l];o.A.Tm(n,4,128*t,r,128*l,128*i+128,r,128*a+128);for(let n=t;n<=i;n++)for(let t=l;t<=a;t++)this.dm[s][n][t]&=~e}}}}}};Rm=(t,i,e,r)=>{let h=0;for(let t=0;t>24;break}for(let n=t;n=0&&t=0&&n{const o=new r.A(new Uint8Array(h));for(let r=0;r=0&&a=0&&c>24,this.nm[r][a][c]=(f-2&3)<<24>>24):f<=81?this.Vr[r][a][c]=f-49<<24>>24:this.tm[r][a][c]=f-81<<24>>24}else for(;f=o.xu,0!==f;){if(1===f){o.xu;break}f<=49&&o.xu}}};Lm=(t,i,e,n,h,o)=>{const l=new r.A(new Uint8Array(n));let a=-1;for(;;){const n=l.Sm;if(0===n)return;a+=n;let r=0;for(;;){const n=l.Sm;if(0===n)break;r+=n-1;const c=63&r,f=r>>6&63,u=r>>12,d=l.xu,w=d>>2,y=3&d,A=f+h,m=c+o;if(A>0&&m>0&&A=0&&(n=e[s]),this.tA(u,A,m,t,i,n,a,w,y)}}}};tA=(t,i,e,s,n,r,h,o,d)=>{if(A.et){if(16&this.Vr[t][i][e])return;if(this.pm(t,i,e)!==A.WA)return}const w=this.Hr[t][i][e],y=this.Hr[t][i+1][e],m=this.Hr[t][i+1][e+1],p=this.Hr[t][i][e+1],g=w+y+m+p>>2,I=l.A.get(h);let _=i+(e<<7)+(h<<14)+1073741824|0;I.active||(_+=-2147483648),_|=0;const C=(d<<6)+o<<24>>24;if(o===f.A._A.id)(!A.et||I.active||I.Wd)&&(s?.zA(I.la(f.A._A.id,d,w,y,m,p,-1),t,i,e,g,_,C),I.Cd&&I.active&&r?.$y(i,e),-1!==I.al&&n.ZA(new a.A(h,t,3,i,e,c.A.Lo[I.al],!0)));else if(o===f.A.gd.id||o===f.A.vA.id){const l=I.la(f.A.gd.id,d,w,y,m,p,-1);if(l){let n,r,h=0;if(o===f.A.vA.id&&(h+=256),d===u.A.iA||d===u.A.eA?(n=I.length,r=I.width):(n=I.width,r=I.length),s?.tA(t,i,e,g,l,null,_,C,n,r,h)&&I.Md)for(let s=0;s<=n;s++)for(let n=0;n<=r;n++){let r=l.xm/4|0;r>30&&(r=30),r>this.rm[t][i+s][e+n]&&(this.rm[t][i+s][e+n]=r<<24>>24)}}I.Cd&&r?.tA(i,e,I.width,I.length,d,I.Ed),-1!==I.al&&n.ZA(new a.A(h,t,2,i,e,c.A.Lo[I.al],!0))}else if(o>=f.A.bA.id)s?.tA(t,i,e,g,I.la(o,d,w,y,m,p,-1),null,_,C,1,1,0),o>=f.A.bA.id&&o<=f.A.SA.id&&o!==f.A.TA.id&&t>0&&(this.dm[t][i][e]|=2340),I.Cd&&r?.tA(i,e,I.width,I.length,d,I.Ed),-1!==I.al&&n.ZA(new a.A(h,t,2,i,e,c.A.Lo[I.al],!0));else if(o===f.A.rA.id)s?.nA(t,i,e,g,A.NA[d],0,I.la(f.A.rA.id,d,w,y,m,p,-1),null,_,C),d===u.A.qd?(I.Md&&(this.rm[t][i][e]=50,this.rm[t][i][e+1]=50),I.Ju&&(this.dm[t][i][e]|=585)):d===u.A.iA?(I.Md&&(this.rm[t][i][e+1]=50,this.rm[t][i+1][e+1]=50),I.Ju&&(this.dm[t][i][e+1]|=1170)):d===u.A.hA?(I.Md&&(this.rm[t][i+1][e]=50,this.rm[t][i+1][e+1]=50),I.Ju&&(this.dm[t][i+1][e]|=585)):d===u.A.eA&&(I.Md&&(this.rm[t][i][e]=50,this.rm[t][i+1][e]=50),I.Ju&&(this.dm[t][i][e]|=1170)),I.Cd&&r?.nA(i,e,o,d,I.Ed),-1!==I.al&&n.ZA(new a.A(h,t,0,i,e,c.A.Lo[I.al],!0)),16!==I.Rd&&s?.km(t,i,e,I.Rd);else if(o===f.A.oA.id)s?.nA(t,i,e,g,A.FA[d],0,I.la(f.A.oA.id,d,w,y,m,p,-1),null,_,C),I.Md&&(d===u.A.qd?this.rm[t][i][e+1]=50:d===u.A.iA?this.rm[t][i+1][e+1]=50:d===u.A.hA?this.rm[t][i+1][e]=50:d===u.A.eA&&(this.rm[t][i][e]=50)),I.Cd&&r?.nA(i,e,o,d,I.Ed),-1!==I.al&&n.ZA(new a.A(h,t,0,i,e,c.A.Lo[I.al],!0));else if(o===f.A.aA.id){const l=d+1&3;s?.nA(t,i,e,g,A.NA[d],A.NA[l],I.la(f.A.aA.id,d+4,w,y,m,p,-1),I.la(f.A.aA.id,l,w,y,m,p,-1),_,C),I.Ju&&(d===u.A.qd?(this.dm[t][i][e]|=265,this.dm[t][i][e+1]|=1170):d===u.A.iA?(this.dm[t][i][e+1]|=1170,this.dm[t][i+1][e]|=585):d===u.A.hA?(this.dm[t][i+1][e]|=585,this.dm[t][i][e]|=1170):d===u.A.eA&&(this.dm[t][i][e]|=1170,this.dm[t][i][e]|=585)),I.Cd&&r?.nA(i,e,o,d,I.Ed),-1!==I.al&&n.ZA(new a.A(h,t,0,i,e,c.A.Lo[I.al],!0)),16!==I.Rd&&s?.km(t,i,e,I.Rd)}else if(o===f.A.lA.id)s?.nA(t,i,e,g,A.FA[d],0,I.la(f.A.lA.id,d,w,y,m,p,-1),null,_,C),I.Md&&(d===u.A.qd?this.rm[t][i][e+1]=50:d===u.A.iA?this.rm[t][i+1][e+1]=50:d===u.A.hA?this.rm[t][i+1][e]=50:d===u.A.eA&&(this.rm[t][i][e]=50)),I.Cd&&r?.nA(i,e,o,d,I.Ed),-1!==I.al&&n.ZA(new a.A(h,t,0,i,e,c.A.Lo[I.al],!0));else if(o===f.A.uA.id)s?.tA(t,i,e,g,I.la(o,d,w,y,m,p,-1),null,_,C,1,1,0),I.Cd&&r?.tA(i,e,I.width,I.length,d,I.Ed),-1!==I.al&&n.ZA(new a.A(h,t,2,i,e,c.A.Lo[I.al],!0));else if(o===f.A.CA.id)s?.qA(t,i,e,g,0,0,_,I.la(f.A.CA.id,u.A.qd,w,y,m,p,-1),C,512*d,A.NA[d]),-1!==I.al&&n.ZA(new a.A(h,t,1,i,e,c.A.Lo[I.al],!0));else if(o===f.A.EA.id){let r=16;if(s){const n=s.JA(t,i,e);n>0&&(r=l.A.get(n>>14&32767).Rd)}s?.qA(t,i,e,g,A.BA[d]*r,A.UA[d]*r,_,I.la(f.A.CA.id,u.A.qd,w,y,m,p,-1),C,512*d,A.NA[d]),-1!==I.al&&n.ZA(new a.A(h,t,1,i,e,c.A.Lo[I.al],!0))}else o===f.A.wA.id?(s?.qA(t,i,e,g,0,0,_,I.la(f.A.CA.id,u.A.qd,w,y,m,p,-1),C,d,256),-1!==I.al&&n.ZA(new a.A(h,t,1,i,e,c.A.Lo[I.al],!0))):o===f.A.yA.id?(s?.qA(t,i,e,g,0,0,_,I.la(f.A.CA.id,u.A.qd,w,y,m,p,-1),C,d,512),-1!==I.al&&n.ZA(new a.A(h,t,1,i,e,c.A.Lo[I.al],!0))):o===f.A.AA.id&&(s?.qA(t,i,e,g,0,0,_,I.la(f.A.CA.id,u.A.qd,w,y,m,p,-1),C,d,768),-1!==I.al&&n.ZA(new a.A(h,t,1,i,e,c.A.Lo[I.al],!0)))};pm=(t,i,e)=>8&this.Vr[t][i][e]?0:t<=0||!(2&this.Vr[1][i][e])?t:t-1}},3045:(t,i,e)=>{e.d(i,{A:()=>g});var s=e(4583),n=e(1161),r=e(3795),h=e(8256),o=e(670),l=e(9222),a=e(6855),c=e(7441),f=e(6666),u=e(5748),d=e(3479),w=e(8950),y=e(2771),A=e(5518),m=e(6169),p=e(3867);class g{static Mm=new p.Dm(8,32,51,51,!1);static Nm=new p.fe(100,null);static Fm=new Int32Array(o.A.Dr);static Bm=new p.Um(o.A.Dr,500,null);static Pm=new p.fe(500,null);static Gm=new f.A;static Wm=0;static Ym=0;static Hm=0;static Vm=0;static Km=0;static Xm=0;static jm=0;static zm=0;static Zm=0;static qm=0;static Jm=0;static $m=0;static Qm=0;static tp=0;static ip=0;static ep=0;static sp=0;static np=0;static rp=0;static hp=0;static op=0;static lp=0;static ap=!1;static cp=null;static fp=Uint8Array.of(19,55,38,155,255,110,137,205,76);static up=Uint8Array.of(160,192,80,96,0,144,80,48,160);static dp=Uint8Array.of(76,8,137,4,0,1,38,2,19);static wp=Int8Array.of(0,0,2,0,0,2,1,1,0);static yp=Int8Array.of(2,0,0,2,0,0,0,4,4);static Ap=Int8Array.of(0,4,4,8,0,0,8,0,0);static mp=Int8Array.of(1,1,0,0,0,8,0,0,8);static pp=Int8Array.of(53,-53,-53,53);static gp=Int8Array.of(-53,-53,53,53);static Ip=Int8Array.of(-45,45,45,-45);static _p=Int8Array.of(45,45,-45,-45);static Cp=[new Int8Array(16),Int8Array.of(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,0,0,0,1,1,0,0,1,1,1,0,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1),Int8Array.of(0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0),Int8Array.of(0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0),Int8Array.of(1,1,1,1,1,1,1,1,0,1,1,1,0,0,1,1),Int8Array.of(1,1,1,1,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,0,0,0,0,1,1,0,1,1,1,0,1,1,1),Int8Array.of(0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1)];static Ep=[Int8Array.of(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),Int8Array.of(12,8,4,0,13,9,5,1,14,10,6,2,15,11,7,3),Int8Array.of(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0),Int8Array.of(3,7,11,15,2,6,10,14,1,5,9,13,0,4,8,12)];static vp=Int32Array.of(41,39248,41,4643,41,41,41,41,41,41,41,41,41,41,41,43086,41,41,41,41,41,41,41,8602,41,28992,41,41,41,41,41,5056,41,41,41,41,41,41,41,41,41,41,41,41,41,41,3131,41,41,41);static bp=0;static Ml=0;static Dl=0;static Tp=-1;static Rp=-1;static et=!0;static init=(t,i,e,n,r)=>{this.Ym=0,this.Hm=0,this.Vm=t,this.Km=i,this.Xm=t/2|0,this.jm=i/2|0;const h=new p.Dm(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let i=0;i<2048;i+=64){this.zm=s.A.sin[t],this.Zm=s.A.cos[t],this.qm=s.A.sin[i],this.Jm=s.A.cos[i];const o=(t-128)/32|0,l=i/64|0;for(let t=-26;t<=26;t++)for(let i=-26;i<=26;i++){const s=128*t,a=128*i;let c=!1;for(let t=-e;t<=n;t+=128)if(this.Op(s,a,r[o]+t)){c=!0;break}h[o][l][t+25+1][i+25+1]=c}}for(let t=0;t<8;t++)for(let i=0;i<32;i++)for(let e=-25;e<25;e++)for(let s=-25;s<25;s++){let n=!1;t:for(let r=-1;r<=1;r++)for(let o=-1;o<=1;o++){if(h[t][i][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t][(i+1)%31][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][i][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][(i+1)%31][e+r+25+1][s+o+25+1]){n=!0;break t}}this.Mm[t][i][e+25][s+25]=n}};static To=()=>{this.Nm=null,this.Fm=null,this.Bm=null,this.Gm=null,this.Mm=null,this.Pm=null,this.cp=null,console.log('World3D unloaded!')};static Tm=(t,i,e,s,n,r,o,l)=>{g.Bm[t][g.Fm[t]++]=new h.A(e/128|0,r/128|0,n/128|0,l/128|0,i,e,r,n,l,s,o)};static Op=(t,i,e)=>{const s=i*this.qm+t*this.Jm>>16,n=i*this.Jm-t*this.qm>>16,r=e*this.zm+n*this.Zm>>16,h=e*this.Zm-n*this.zm>>16;if(r<50||r>3500)return!1;const o=this.Xm+((s<<9)/r|0),l=this.jm+((h<<9)/r|0);return o>=this.Ym&&o<=this.Vm&&l>=this.Hm&&l<=this.Km};Lp;$A;QA;Sp;xp;_h;kp;Mp;Dp;Np=0;Fp=0;Bp=0;constructor(t,i,e,s){this.Lp=e,this.$A=s,this.QA=i,this.xp=new p.Eh(e,s,i,null),this.kp=new p.ym(e,s+1,i+1),this.Sp=t,this._h=new p.fe(5e3,null),this.Mp=new Int32Array(1e4),this.Dp=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this.Fp=t;for(let i=0;i{const e=this.xp[0][t][i];for(let e=0;e<3;e++){this.xp[e][t][i]=this.xp[e+1][t][i];const s=this.xp[e][t][i];s&&s.level--}this.xp[0][t][i]||(this.xp[0][t][i]=new r.A(0,t,i));const s=this.xp[0][t][i];s&&(s.Pp=e),this.xp[3][t][i]=null};Em=(t,i,e,s)=>{const n=this.xp[t][i][e];n&&(n.Gp=s)};Im=(t,i,e,s,n,h,o,l,a,c,f,u,w,m,p,g,I,_,C,E)=>{if(s===A.A.gm){for(let s=t;s>=0;s--)this.xp[s][i][e]||(this.xp[s][i][e]=new r.A(s,i,e));const s=this.xp[t][i][e];s&&(s.Wp=new d.A(f,u,w,m,-1,C,!1))}else if(s===A.A.Yp){for(let s=t;s>=0;s--)this.xp[s][i][e]||(this.xp[s][i][e]=new r.A(s,i,e));const s=this.xp[t][i][e];s&&(s.Wp=new d.A(p,g,I,_,h,E,o===l&&o===a&&o===c))}else{for(let s=t;s>=0;s--)this.xp[s][i][e]||(this.xp[s][i][e]=new r.A(s,i,e));const d=this.xp[t][i][e];d&&(d.Hp=new y.A(i,s,g,l,w,n,f,c,E,p,h,_,C,a,I,m,o,e,u))}};zA=(t,i,e,s,n,h,o)=>{this.xp[i][e][s]||(this.xp[i][e][s]=new r.A(i,e,s));const a=this.xp[i][e][s];a&&(a.Vp=new l.A(n,128*e+64,128*s+64,t,h,o))};Kp=(t,i,e)=>{const s=this.xp[t][i][e];s&&(s.Vp=null)};Xp=(t,i,e,s,n,h,o,l)=>{let a=0;const c=this.xp[s][t][i];if(c)for(let t=0;ta&&(a=e)}else this.xp[s][t][i]=new r.A(s,t,i);const f=this.xp[s][t][i];f&&(f.Zp=new u.A(e,128*t+64,128*i+64,h,o,l,n,a))};qp=(t,i,e)=>{const s=this.xp[t][i][e];s&&(s.Zp=null)};nA=(t,i,e,s,n,h,o,l,c,f)=>{if(!o&&!l)return;for(let s=t;s>=0;s--)this.xp[s][i][e]||(this.xp[s][i][e]=new r.A(s,i,e));const u=this.xp[t][i][e];u&&(u.Jp=new a.A(s,128*i+64,128*e+64,n,h,o,l,c,f))};cA=(t,i,e,s)=>{const n=this.xp[t][i][e];1===s&&n&&(n.Jp=null)};qA=(t,i,e,s,n,h,o,l,a,f,u)=>{if(!l)return;for(let s=t;s>=0;s--)this.xp[s][i][e]||(this.xp[s][i][e]=new r.A(s,i,e));const d=this.xp[t][i][e];d&&(d.$p=new c.A(s,128*i+n+64,128*e+h+64,u,f,l,o,a))};Qp=(t,i,e)=>{const s=this.xp[t][i][e];s&&(s.$p=null)};km=(t,i,e,s)=>{const n=this.xp[t][i][e];if(!n)return;const r=n.$p;if(!r)return;const h=128*i+64,o=128*e+64;r.x=h+((r.x-h)*s/16|0),r.z=o+((r.z-o)*s/16|0)};tg=(t,i,e,s)=>{if(!s)return;const n=this.xp[t][i][e];if(!n)return;const r=n.$p;r&&(r.model=s)};ig=(t,i,e,s)=>{if(!s)return;const n=this.xp[t][i][e];if(!n)return;const r=n.Vp;r&&(r.model=s)};eg=(t,i,e,s)=>{if(!s)return;const n=this.xp[t][i][e];if(!n)return;const r=n.Jp;r&&(r.sg=s)};ng=(t,i,e,s,n)=>{if(!s)return;const r=this.xp[e][t][i];if(!r)return;const h=r.Jp;h&&(h.sg=s,h.rg=n)};tA=(t,i,e,s,n,r,h,o,l,a,c)=>{if(!n&&!r)return!0;const f=128*i+64*l,u=128*e+64*a;return this.hg(f,u,s,t,i,e,l,a,n,r,h,o,c,!1)};og=(t,i,e,s,n,r,h,o,l,a)=>{if(!n&&!r)return!0;let c=i-l,f=s-l,u=i+l,d=s+l;return a&&(o>640&&o<1408&&(d+=128),o>1152&&o<1920&&(u+=128),(o>1664||o<384)&&(f-=128),o>128&&o<896&&(c-=128)),c=c/128|0,f=f/128|0,u=u/128|0,d=d/128|0,this.hg(i,s,e,t,c,f,u+1-c,d-f+1,n,r,h,0,o,!0)};lg=(t,i,e,s,n,r,h,o,l,a,c,f)=>!l&&!a||this.hg(i,s,e,t,n,r,h+1-n,o-r+1,l,a,c,0,f,!0);sA=(t,i,e)=>{const s=this.xp[t][i][e];if(s)for(let t=0;t>29&3)&&n.cg===i&&n.fg===e)return void this.ug(n)}};dg=(t,i,e,s)=>{if(!s)return;const n=this.xp[t][i][e];if(n)for(let t=0;t>29&3))return void(i.model=s)}};wg=()=>{for(let t=0;t{const s=this.xp[t][i][e];return s&&s.Jp?s.Jp.ag:0};yg=(t,i,e)=>{const s=this.xp[t][e][i];return s&&s.$p?s.$p.ag:0};Ag=(t,i,e)=>{const s=this.xp[t][i][e];if(!s)return 0;for(let t=0;t>29&3)&&n.cg===i&&n.fg===e)return n.ag}return 0};mg=(t,i,e)=>{const s=this.xp[t][i][e];return s&&s.Vp?s.Vp.ag:0};pg=(t,i,e,s)=>{const n=this.xp[t][i][e];if(n){if(n.Jp&&n.Jp.ag===s)return 255&n.Jp.info;if(n.$p&&n.$p.ag===s)return 255&n.$p.info;if(n.Vp&&n.Vp.ag===s)return 255&n.Vp.info;for(let t=0;t{const r=i*(0|Math.sqrt(e*e+s*s+n*n))>>8;for(let i=0;i{if(i0){const n=this.xp[t][i+1][e-1];n&&n.Vp&&n.Vp.model&&n.Vp.model.gg&&this._g(s,n.Vp.model,128,0,-128,!0)}};Ig=(t,i,e,s,n,r)=>{let h=!0,o=i;const l=i+s,a=e-1,c=e+n;for(let f=t;f<=t+1;f++)if(f!==this.Lp){for(let u=o;u<=l;u++)if(!(u<0||u>=this.$A))for(let o=a;o<=c;o++){if(o<0||o>=this.QA||h&&u=e||u===i))continue;const a=this.xp[f][u][o];if(!a)continue;const d=128*(u-i)+64*(1-s),w=128*(o-e)+64*(1-n),y=((this.Sp[f][u][o]+this.Sp[f][u+1][o]+this.Sp[f][u][o+1]+this.Sp[f][u+1][o+1])/4|0)-((this.Sp[t][i][e]+this.Sp[t][i+1][e]+this.Sp[t][i][e+1]+this.Sp[t][i+1][e+1])/4|0),A=a.Jp;A&&A.sg&&A.sg.gg&&this._g(r,A.sg,d,y,w,h),A&&A.rg&&A.rg.gg&&this._g(r,A.rg,d,y,w,h);for(let t=0;t{this.Bp++;let h=0;const o=i.Kd,l=i.Vd;if(t.gg&&t.Tg)for(let r=0;ri.Rg)continue;const u=t.Kd[r]-e;if(ui.Lg)continue;const d=t.Xd[r]-n;if(di.xg)continue;if(i.gg&&i.Tg)for(let t=0;t{const h=this.xp[t][i][e];if(!h)return;const o=h.Wp;if(o){const t=o.color;if(0!==t)for(let i=0;i<4;i++)s[n]=t,s[n+1]=t,s[n+2]=t,s[n+3]=t,n+=r;return}const l=h.Hp;if(!l)return;const a=l.shape,c=l.angle,f=l.Ug,u=l.Pg,d=g.Cp[a],w=g.Ep[c];let y=0;if(0===f)for(let t=0;t<4;t++)0!==d[w[y++]]&&(s[n]=u),0!==d[w[y++]]&&(s[n+1]=u),0!==d[w[y++]]&&(s[n+2]=u),0!==d[w[y++]]&&(s[n+3]=u),n+=r;else for(let t=0;t<4;t++)s[n]=0===d[w[y++]]?f:u,s[n+1]=0===d[w[y++]]?f:u,s[n+2]=0===d[w[y++]]?f:u,s[n+3]=0===d[w[y++]]?f:u,n+=r};click=(t,i)=>{g.ap=!0,g.Ml=t,g.Dl=i,g.Tp=-1,g.Rp=-1};draw=(t,i,e,n,r,h,o)=>{t<0?t=0:t>=128*this.$A&&(t=128*this.$A-1),e<0?e=0:e>=128*this.QA&&(e=128*this.QA-1),g.Wm++,g.zm=s.A.sin[h],g.Zm=s.A.cos[h],g.qm=s.A.sin[r],g.Jm=s.A.cos[r],g.cp=g.Mm[(h-128)/32|0][r/64|0],g.$m=t,g.Qm=i,g.tp=e,g.ip=t/128|0,g.ep=e/128|0,g.op=n,g.sp=g.ip-25,g.sp<0&&(g.sp=0),g.rp=g.ep-25,g.rp<0&&(g.rp=0),g.np=g.ip+25,g.np>this.$A&&(g.np=this.$A),g.hp=g.ep+25,g.hp>this.QA&&(g.hp=this.QA),this.Gg(),g.lp=0;for(let t=this.Fp;t=2e3)?(h.visible=!0,h.update=!0,h.Wg=h.jp>0,g.lp++):(h.visible=!1,h.update=!1,h.Yg=0))}}for(let t=this.Fp;t=g.np))for(let t=-25;t<=0;t++){const n=g.ep+t,r=g.ep-t;let h;if(e>=g.sp&&(n>=g.rp&&(h=i[e][n],h&&h.visible&&this.Hg(h,!0,o)),r=g.rp&&(h=i[s][n],h&&h.visible&&this.Hg(h,!0,o)),r=g.np))for(let t=-25;t<=0;t++){const n=g.ep+t,r=g.ep-t;let h;if(e>=g.sp&&(n>=g.rp&&(h=i[e][n],h&&h.visible&&this.Hg(h,!1,o)),r=g.rp&&(h=i[s][n],h&&h.visible&&this.Hg(h,!1,o)),r{if(!c&&!f)return!1;for(let t=h;t=this.$A||i>=this.QA)return!1;const e=this.xp[s][t][i];if(e&&e.jp>=5)return!1}const A=new n.A(s,e,t,i,c,f,w,h,h+l-1,o,o+a-1,u,d);for(let t=h;th&&(e|=1),to&&(e+=8),i=0;e--)this.xp[e][t][i]||(this.xp[e][t][i]=new r.A(e,t,i));const n=this.xp[s][t][i];n&&(n.zp[n.jp]=A,n.Vg[n.jp]=e,n.Kg|=e,n.jp++)}return y&&(this._h[this.Np++]=A),!0};ug=t=>{for(let i=t.cg;i<=t.Eg;i++)for(let e=t.fg;e<=t.vg;e++){const s=this.xp[t.level][i][e];if(s){for(let i=0;i{const t=g.Fm[g.op],i=g.Bm[g.op];g.bp=0;for(let e=0;e=0&&s<=50){n=t.jg+25-g.ep,n<0&&(n=0),r=t.QA+25-g.ep,r>50&&(r=50);let i=!1;for(;n<=r;)if(g.cp&&g.cp[s][n++]){i=!0;break}if(i){if(h=g.$m-t.Og,h>32)t.mode=1;else{if(h>=-32)continue;t.mode=2,h=-h}t.zg=(t.Sg-g.tp<<8)/h|0,t.Zg=(t.xg-g.tp<<8)/h|0,t.qg=(t.Rg-g.Qm<<8)/h|0,t.Jg=(t.iw-g.Qm<<8)/h|0,g.Pm[g.bp++]=t}}}else if(2===t.type){if(s=t.jg+25-g.ep,s>=0&&s<=50){n=t.Xg+25-g.ip,n<0&&(n=0),r=t.$A+25-g.ip,r>50&&(r=50);let i=!1;for(;n<=r;)if(g.cp&&g.cp[n++][s]){i=!0;break}if(i){if(h=g.tp-t.Sg,h>32)t.mode=3;else{if(h>=-32)continue;t.mode=4,h=-h}t.$g=(t.Og-g.$m<<8)/h|0,t.Qg=(t.Lg-g.$m<<8)/h|0,t.qg=(t.Rg-g.Qm<<8)/h|0,t.Jg=(t.iw-g.Qm<<8)/h|0,g.Pm[g.bp++]=t}}}else if(4===t.type&&(s=t.Rg-g.Qm,s>128&&(n=t.jg+25-g.ep,n<0&&(n=0),r=t.QA+25-g.ep,r>50&&(r=50),n<=r))){let i=t.Xg+25-g.ip;i<0&&(i=0),h=t.$A+25-g.ip,h>50&&(h=50);let e=!1;t:for(let t=i;t<=h;t++)for(let i=n;i<=r;i++)if(g.cp&&g.cp[t][i]){e=!0;break t}e&&(t.mode=5,t.$g=(t.Og-g.$m<<8)/s|0,t.Qg=(t.Lg-g.$m<<8)/s|0,t.zg=(t.Sg-g.tp<<8)/s|0,t.Zg=(t.xg-g.tp<<8)/s|0,g.Pm[g.bp++]=t)}}};Hg=(t,i,e)=>{for(g.Gm.ZA(t);;){let t;do{if(t=g.Gm.tI(),!t)return}while(!t.update);const s=t.x,n=t.z,r=t.level,h=t.iI,o=this.xp[r];if(t.visible){if(i){if(r>0){const t=this.xp[r-1][s][n];if(t&&t.update)continue}if(s<=g.ip&&s>g.sp){const i=o[s-1][n];if(i&&i.update&&(i.visible||!(1&t.Kg)))continue}if(s>=g.ip&&sg.rp){const i=o[s][n-1];if(i&&i.update&&(i.visible||!(8&t.Kg)))continue}if(n>=g.ep&&nn&&(a+=6),c=g.fp[a],t.oI=g.dp[a]),f&&(f.lI&g.up[a]?16===f.lI?(t.Yg=3,t.aI=g.wp[a],t.cI=3-t.aI):32===f.lI?(t.Yg=6,t.aI=g.yp[a],t.cI=6-t.aI):64===f.lI?(t.Yg=12,t.aI=g.Ap[a],t.cI=12-t.aI):(t.Yg=9,t.aI=g.mp[a],t.cI=9-t.aI):t.Yg=0,f.lI&c&&!this.fI(h,s,n,f.lI)&&f.sg?.draw(0,g.zm,g.Zm,g.qm,g.Jm,f.x-g.$m,f.y-g.Qm,f.z-g.tp,f.ag),f.uI&c&&!this.fI(h,s,n,f.uI)&&f.rg?.draw(0,g.zm,g.Zm,g.qm,g.Jm,f.x-g.$m,f.y-g.Qm,f.z-g.tp,f.ag)),u&&!this.visible(h,s,n,u.model.iw))if(u.type&c)u.model.draw(u.angle,g.zm,g.Zm,g.qm,g.Jm,u.x-g.$m,u.y-g.Qm,u.z-g.tp,u.ag);else if(768&u.type){const t=u.x-g.$m,i=u.y-g.Qm,e=u.z-g.tp,s=u.angle;let n,r;if(n=s===m.A.iA||s===m.A.hA?-t:t,r=s===m.A.hA||s===m.A.eA?-e:e,256&u.type&&rn){const n=t+g.Ip[s],r=e+g._p[s];u.model.draw(512*s+1280&2047,g.zm,g.Zm,g.qm,g.Jm,n,i,r,u.ag)}}if(l){const i=t.Vp;i&&i.model?.draw(0,g.zm,g.Zm,g.qm,g.Jm,i.x-g.$m,i.y-g.Qm,i.z-g.tp,i.ag);const e=t.Zp;e&&0===e.offset&&(e.dI&&e.dI.draw(0,g.zm,g.Zm,g.qm,g.Jm,e.x-g.$m,e.y-g.Qm,e.z-g.tp,e.ag),e.wI&&e.wI.draw(0,g.zm,g.Zm,g.qm,g.Jm,e.x-g.$m,e.y-g.Qm,e.z-g.tp,e.ag),e.yI&&e.yI.draw(0,g.zm,g.Zm,g.qm,g.Jm,e.x-g.$m,e.y-g.Qm,e.z-g.tp,e.ag))}const d=t.Kg;if(0!==d){if(sg.ip&&1&d){const t=o[s-1][n];t&&t.update&&g.Gm.ZA(t)}if(n>g.ep&&8&d){const t=o[s][n-1];t&&t.update&&g.Gm.ZA(t)}}}if(0!==t.Yg){let i=!0;for(let e=0;ei.cg&&(r+=1),ei.fg&&(r+=8),ss&&(s=n);const h=g.ep-i.fg,l=i.vg-g.ep;i.AI=l>h?s+l:s+h}for(;;){let t=-50,i=-1;for(let e=0;et&&(t=s.AI,i=e))}if(-1===i)break;const l=g.Nm[i];if(l){l.Wm=g.Wm;let t=l.model;t||(t=l.rI?.draw(e)??null),t&&!this.mI(h,l.cg,l.Eg,l.fg,l.vg,t.iw)&&t.draw(l.hI,g.zm,g.Zm,g.qm,g.Jm,l.x-g.$m,l.y-g.Qm,l.z-g.tp,l.ag);for(let t=l.cg;t<=l.Eg;t++)for(let i=l.fg;i<=l.vg;i++){const e=o[t][i];e&&(0!==e.Yg?g.Gm.ZA(e):t===s&&i===n||!e.update||g.Gm.ZA(e))}}}if(t.Wg)continue}if(!t.update||0!==t.Yg)continue;if(s<=g.ip&&s>g.sp){const t=o[s-1][n];if(t&&t.update)continue}if(s>=g.ip&&sg.rp){const t=o[s][n-1];if(t&&t.update)continue}if(n>=g.ep&&n=r){const r=t+g.pp[n],h=s+g.gp[n];i.model.draw(512*n+256,g.zm,g.Zm,g.qm,g.Jm,r,e,h,i.ag)}if(512&i.type&&h<=r){const r=t+g.Ip[n],h=s+g._p[n];i.model.draw(512*n+1280&2047,g.zm,g.Zm,g.qm,g.Jm,r,e,h,i.ag)}}const e=t.Jp;e&&(e.uI&t.oI&&!this.fI(h,s,n,e.uI)&&e.rg?.draw(0,g.zm,g.Zm,g.qm,g.Jm,e.x-g.$m,e.y-g.Qm,e.z-g.tp,e.ag),e.lI&t.oI&&!this.fI(h,s,n,e.lI)&&e.sg?.draw(0,g.zm,g.Zm,g.qm,g.Jm,e.x-g.$m,e.y-g.Qm,e.z-g.tp,e.ag))}if(rg.ip){const t=o[s-1][n];t&&t.update&&g.Gm.ZA(t)}if(n>g.ep){const t=o[s][n-1];t&&t.update&&g.Gm.ZA(t)}}};sI=(t,i,e,n,r,h,o,l)=>{let a,c,f,u,d=a=(e<<7)-g.$m,y=c=(n<<7)-g.tp,A=f=d+128,m=u=y+128,p=this.Sp[i][e][n]-g.Qm,I=this.Sp[i][e+1][n]-g.Qm,_=this.Sp[i][e+1][n+1]-g.Qm,C=this.Sp[i][e][n+1]-g.Qm,E=y*o+d*l>>16;if(y=y*l-d*o>>16,d=E,E=p*h-y*r>>16,y=p*r+y*h>>16,p=E,y<50)return;if(E=c*o+A*l>>16,c=c*l-A*o>>16,A=E,E=I*h-c*r>>16,c=I*r+c*h>>16,I=E,c<50)return;if(E=m*o+f*l>>16,m=m*l-f*o>>16,f=E,E=_*h-m*r>>16,m=_*r+m*h>>16,_=E,m<50)return;if(E=u*o+a*l>>16,u=u*l-a*o>>16,a=E,E=C*h-u*r>>16,u=C*r+u*h>>16,C=E,u<50)return;const v=s.A.ra+((d<<9)/y|0),b=s.A.ha+((p<<9)/y|0),T=s.A.ra+((A<<9)/c|0),R=s.A.ha+((I<<9)/c|0),O=s.A.ra+((f<<9)/m|0),L=s.A.ha+((_<<9)/m|0),S=s.A.ra+((a<<9)/u|0),x=s.A.ha+((C<<9)/u|0);if(s.A.alpha=0,(O-S)*(R-x)-(L-x)*(T-S)>0)if(s.A.pI=O<0||S<0||T<0||O>w.A.gI||S>w.A.gI||T>w.A.gI,g.ap&&this.II(g.Ml,g.Dl,L,x,R,O,S,T)&&(g.Tp=e,g.Rp=n),-1===t._I)12345678!==t.CI&&s.A.EI(O,S,T,L,x,R,t.CI,t.vI,t.bI);else if(g.et){const i=g.vp[t._I];s.A.EI(O,S,T,L,x,R,this.TI(i,t.CI),this.TI(i,t.vI),this.TI(i,t.bI))}else t.flat?s.A.RI(O,S,T,L,x,R,t.CI,t.vI,t.bI,d,p,y,A,a,I,C,c,u,t._I):s.A.RI(O,S,T,L,x,R,t.CI,t.vI,t.bI,f,_,m,a,A,C,I,u,c,t._I);if(!((v-T)*(x-R)-(b-R)*(S-T)<=0))if(s.A.pI=v<0||T<0||S<0||v>w.A.gI||T>w.A.gI||S>w.A.gI,g.ap&&this.II(g.Ml,g.Dl,b,R,x,v,T,S)&&(g.Tp=e,g.Rp=n),-1!==t._I){if(!g.et)return void s.A.RI(v,T,S,b,R,x,t.OI,t.bI,t.vI,d,p,y,A,a,I,C,c,u,t._I);const i=g.vp[t._I];s.A.EI(v,T,S,b,R,x,this.TI(i,t.OI),this.TI(i,t.bI),this.TI(i,t.vI))}else 12345678!==t.OI&&s.A.EI(v,T,S,b,R,x,t.OI,t.bI,t.vI)};nI=(t,i,e,n,r,h,o)=>{let l=e.Kd.length;for(let t=0;t>16;if(a=a*o-i*h>>16,i=c,c=l*r-a*n>>16,a=l*n+a*r>>16,l=c,a<50)return;e.LI&&(y.A.SI[t]=i,y.A.xI[t]=l,y.A.kI[t]=a),y.A.MI[t]=s.A.ra+((i<<9)/a|0),y.A.DI[t]=s.A.ha+((l<<9)/a|0)}s.A.alpha=0,l=e.NI.length;for(let n=0;n0)if(s.A.pI=l<0||a<0||c<0||l>w.A.gI||a>w.A.gI||c>w.A.gI,g.ap&&this.II(g.Ml,g.Dl,f,u,d,l,a,c)&&(g.Tp=t,g.Rp=i),e.LI&&-1!==e.LI[n])if(g.et){const t=g.vp[e.LI[n]];s.A.EI(l,a,c,f,u,d,this.TI(t,e.UI[n]),this.TI(t,e.GI[n]),this.TI(t,e.WI[n]))}else e.flat?s.A.RI(l,a,c,f,u,d,e.UI[n],e.GI[n],e.WI[n],y.A.SI[0],y.A.xI[0],y.A.kI[0],y.A.SI[1],y.A.SI[3],y.A.xI[1],y.A.xI[3],y.A.kI[1],y.A.kI[3],e.LI[n]):s.A.RI(l,a,c,f,u,d,e.UI[n],e.GI[n],e.WI[n],y.A.SI[r],y.A.xI[r],y.A.kI[r],y.A.SI[h],y.A.SI[o],y.A.xI[h],y.A.xI[o],y.A.kI[h],y.A.kI[o],e.LI[n]);else 12345678!==e.UI[n]&&s.A.EI(l,a,c,f,u,d,e.UI[n],e.GI[n],e.WI[n])}};eI=(t,i,e)=>{const s=this.kp[t][i][e];if(s===-g.Wm)return!1;if(s===g.Wm)return!0;{const s=i<<7,n=e<<7;return this.YI(s+1,this.Sp[t][i][e],n+1)&&this.YI(s+128-1,this.Sp[t][i+1][e],n+1)&&this.YI(s+128-1,this.Sp[t][i+1][e+1],n+128-1)&&this.YI(s+1,this.Sp[t][i][e+1],n+128-1)?(this.kp[t][i][e]=g.Wm,!0):(this.kp[t][i][e]=-g.Wm,!1)}};fI=(t,i,e,s)=>{if(!this.eI(t,i,e))return!1;const n=i<<7,r=e<<7,h=this.Sp[t][i][e]-1,o=h-120,l=h-230,a=h-238;if(s<16){if(1===s){if(n>g.$m){if(!this.YI(n,h,r))return!1;if(!this.YI(n,h,r+128))return!1}if(t>0){if(!this.YI(n,o,r))return!1;if(!this.YI(n,o,r+128))return!1}return!!this.YI(n,l,r)&&this.YI(n,l,r+128)}if(2===s){if(r0){if(!this.YI(n,o,r+128))return!1;if(!this.YI(n+128,o,r+128))return!1}return!!this.YI(n,l,r+128)&&this.YI(n+128,l,r+128)}if(4===s){if(n0){if(!this.YI(n+128,o,r))return!1;if(!this.YI(n+128,o,r+128))return!1}return!!this.YI(n+128,l,r)&&this.YI(n+128,l,r+128)}if(8===s){if(r>g.tp){if(!this.YI(n,h,r))return!1;if(!this.YI(n+128,h,r))return!1}if(t>0){if(!this.YI(n,o,r))return!1;if(!this.YI(n+128,o,r))return!1}return!!this.YI(n,l,r)&&this.YI(n+128,l,r)}}return!!this.YI(n+64,a,r+64)&&(16===s?this.YI(n,l,r+128):32===s?this.YI(n+128,l,r+128):64===s?this.YI(n+128,l,r):128===s?this.YI(n,l,r):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,i,e,s)=>{if(this.eI(t,i,e)){const n=i<<7,r=e<<7;return this.YI(n+1,this.Sp[t][i][e]-s,r+1)&&this.YI(n+128-1,this.Sp[t][i+1][e]-s,r+1)&&this.YI(n+128-1,this.Sp[t][i+1][e+1]-s,r+128-1)&&this.YI(n+1,this.Sp[t][i][e+1]-s,r+128-1)}return!1};mI=(t,i,e,s,n,r)=>{let h,o;if(i!==e||s!==n){for(h=i;h<=e;h++)for(o=s;o<=n;o++)if(this.kp[t][h][o]===-g.Wm)return!1;o=1+(i<<7);const l=2+(s<<7),a=this.Sp[t][i][s]-r;if(!this.YI(o,a,l))return!1;const c=(e<<7)-1;if(!this.YI(c,a,l))return!1;const f=(n<<7)-1;return!!this.YI(o,a,f)&&this.YI(c,a,f)}return!!this.eI(t,i,s)&&(h=i<<7,o=s<<7,this.YI(h+1,this.Sp[t][i][s]-r,o+1)&&this.YI(h+128-1,this.Sp[t][i+1][s]-r,o+1)&&this.YI(h+128-1,this.Sp[t][i+1][s+1]-r,o+128-1)&&this.YI(h+1,this.Sp[t][i][s+1]-r,o+128-1))};YI=(t,i,e)=>{for(let s=0;s0){const t=n.Sg+(n.zg*s>>8),r=n.xg+(n.Zg*s>>8),h=n.Rg+(n.qg*s>>8),o=n.iw+(n.Jg*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(2===n.mode){const s=t-n.Og;if(s>0){const t=n.Sg+(n.zg*s>>8),r=n.xg+(n.Zg*s>>8),h=n.Rg+(n.qg*s>>8),o=n.iw+(n.Jg*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(3===n.mode){const s=n.Sg-e;if(s>0){const e=n.Og+(n.$g*s>>8),r=n.Lg+(n.Qg*s>>8),h=n.Rg+(n.qg*s>>8),o=n.iw+(n.Jg*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(4===n.mode){const s=e-n.Sg;if(s>0){const e=n.Og+(n.$g*s>>8),r=n.Lg+(n.Qg*s>>8),h=n.Rg+(n.qg*s>>8),o=n.iw+(n.Jg*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(5===n.mode){const s=i-n.Rg;if(s>0){const i=n.Og+(n.$g*s>>8),r=n.Lg+(n.Qg*s>>8),h=n.Sg+(n.zg*s>>8),o=n.xg+(n.Zg*s>>8);if(t>=i&&t<=r&&e>=h&&e<=o)return!0}}}return!1};II=(t,i,e,s,n,r,h,o)=>{if(ie&&i>s&&i>n)return!1;if(tr&&t>h&&t>o)return!1;const l=(i-s)*(o-h)-(t-h)*(n-s);return((i-e)*(h-r)-(t-r)*(s-e))*l>0&&l*((i-n)*(r-o)-(t-o)*(e-n))>0};TI=(t,i)=>((i=(127-i)*(127&t)/160|0)<2?i=2:i>126&&(i=126),(65408&t)+i)}},7121:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{}},4197:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{HI;VI;KI;XI;index;ly;ul;fl;constructor(t,i,e,s,n,r,h){super(),this.HI=i,this.VI=e,this.KI=s,this.XI=n,this.index=t,this.ly=r,h&&-1!==r.wl&&this.ly.delay?(this.ul=Math.random()*this.ly.dl|0,this.fl=Math.random()*this.ly.delay[this.ul]|0):(this.ul=-1,this.fl=0)}}},9418:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(7121),n=e(1312),r=e(3867);class h extends s.A{x=0;z=0;hI=0;jI=!1;size=1;Sa=-1;zI=-1;ZI=-1;qI=-1;JI=-1;$I=-1;QI=-1;t_=null;i_=100;e_=0;s_=0;n_=0;r_=0;h_=-1e3;o_=0;l_=0;a_=-1;c_=0;f_=0;u_=-1;d_=0;w_=0;y_=-1;A_=0;m_=0;p_=0;g_=0;I_=-1;__=0;C_=0;E_=0;v_=0;b_=0;T_=0;R_=0;O_=0;L_=0;S_=0;x_=0;Wm=0;height=0;k_=0;pathLength=0;M_=new Int32Array(10);D_=new Int32Array(10);N_=new r.fe(10,!1);F_=0;B_=-1;U_=-1;P_=-1;G_=-1;move(t,i,e){if(-1!==this.y_&&n.A.Lo[this.y_].priority<=1&&(this.y_=-1),!t){const t=i-this.M_[0],s=e-this.D_[0];if(t>=-8&&t<=8&&s>=-8&&s<=8){this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.M_[t]=this.M_[t-1],this.D_[t]=this.D_[t-1],this.N_[t]=this.N_[t-1];return this.M_[0]=i,this.D_[0]=e,void(this.N_[0]=!1)}}this.pathLength=0,this.F_=0,this.M_[0]=i,this.D_[0]=e,this.x=128*this.M_[0]+64*this.size,this.z=128*this.D_[0]+64*this.size}step(t,i){let e=this.M_[0],s=this.D_[0];0===i?(e--,s++):1===i?s++:2===i?(e++,s++):3===i?e--:4===i?e++:5===i?(e--,s--):6===i?s--:7===i&&(e++,s--),-1!==this.y_&&n.A.Lo[this.y_].priority<=1&&(this.y_=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.M_[t]=this.M_[t-1],this.D_[t]=this.D_[t-1],this.N_[t]=this.N_[t-1];this.M_[0]=e,this.D_[0]=s,this.N_[0]=t}}},8268:(t,i,e)=>{e.d(i,{A:()=>d});var s=e(9418),n=e(8665),r=e(2679),h=e(8738),o=e(1312),l=e(8317),a=e(1302),c=e(3819),f=e(3867),u=e(9298);class d extends s.A{static W_=1;static Y_=2;static H_=4;static V_=8;static K_=16;static X_=32;static j_=64;static z_=128;static Z_=256;static q_=512;static La=[u.A.J_,u.A.Q_,u.A.tC,u.A.iC,u.A.eC,u.A.sC,u.A.nC,u.A.rC,u.A.hC,u.A.oC,u.A.lC,u.A.aC,u.A.cC,u.A.fC,u.A.uC,u.A.dC];static Oa=[[u.A.wC,u.A.yC,u.A.AC,u.A.mC,u.A.pC,u.A.gC,u.A.IC,u.A._C,u.A.CC,u.A.EC,u.A.vC,u.A.bC],[u.A.TC,u.A.RC,u.A.OC,u.A.LC,u.A.SC,u.A.xC,u.A.kC,u.A.MC,u.A.DC,u.A.NC,u.A.FC,u.A.BC,u.A.UC,u.A.PC,u.A.GC,u.A.WC],[u.A.WC-1,u.A.TC+1,u.A.RC,u.A.OC,u.A.LC,u.A.SC,u.A.xC,u.A.kC,u.A.MC,u.A.DC,u.A.NC,u.A.FC,u.A.BC,u.A.UC,u.A.PC,u.A.GC],[u.A.YC,u.A.HC,u.A.VC,u.A.KC,u.A.XC,u.A.jC],[u.A.zC,u.A.ZC,u.A.qC,u.A.JC,u.A.$C,u.A.QC,u.A.tE,u.A.iE]];static So=new r.A(200);name=null;visible=!1;eE=0;sE=0;nE=new Uint16Array(12);rE=new Uint16Array(5);Ka=0;hE=0n;y=0;oE=0;lE=0;aE=0;cE=0;fE=0;uE=null;Xg=0;jg=0;$A=0;QA=0;et=!1;draw(t){if(!this.visible)return null;let i=this.fw();if(this.height=i.iw,i.yw=!0,this.et)return i;if(-1!==this.I_&&-1!==this.__){const t=h.A.Lo[this.I_],e=n.A.Hu(t.la(),!0,!t.Td,!1);e.translate(-this.v_,0,0),e.xa(),t.ly&&t.ly.frames&&e.ka(t.ly.frames[this.__]),e.Jd=null,e.$d=null,128===t.aw&&128===t.cw||e.scale(t.aw,t.cw,t.aw),e.Ma(t.Od+64,t.Ld+850,-30,-50,-30,!0);const s=[i,e];i=n.A.dE(s,2)}if(this.uE&&(t>=this.lE&&(this.uE=null),t>=this.oE&&t=d.Oa[i].length)&&(e=0),this.rE[i]=e}this.Sa=t.Lu,65535===this.Sa&&(this.Sa=-1),this.zI=t.Lu,65535===this.zI&&(this.zI=-1),this.ZI=t.Lu,65535===this.ZI&&(this.ZI=-1),this.qI=t.Lu,65535===this.qI&&(this.qI=-1),this.JI=t.Lu,65535===this.JI&&(this.JI=-1),this.$I=t.Lu,65535===this.$I&&(this.$I=-1),this.QI=t.Lu,65535===this.QI&&(this.QI=-1),this.name=c.A.Ca(c.A.Ea(t.wE)),this.Ka=t.xu,this.visible=!0,this.hE=0n;for(let t=0;t<12;t++)this.hE<<=0x4n,this.nE[t]>=256&&(this.hE+=BigInt(this.nE[t])-256n);this.nE[0]>=256&&(this.hE+=BigInt(this.nE[0])-256n>>4n),this.nE[1]>=256&&(this.hE+=BigInt(this.nE[1])-256n>>8n);for(let t=0;t<5;t++)this.hE<<=0x3n,this.hE+=BigInt(this.rE[t]);this.hE<<=0x1n,this.hE+=BigInt(this.eE)}fd(){if(!this.visible)return null;const t=new f.fe(12,null);let i=0;for(let e=0;e<12;e++){const s=this.nE[e];if(s>=256&&s<512&&(t[i++]=l.A.Lo[s-256].fd()),s>=512){const e=a.A.get(s-512).fd(this.eE);e&&(t[i++]=e)}}const e=n.A.Ta(t,i);for(let t=0;t<5;t++)0!==this.rE[t]&&(e.Ra(d.Oa[t][0],d.Oa[t][this.rE[t]]),1===t&&e.Ra(d.La[0],d.La[this.rE[t]]));return e}fw(){let t=this.hE,i=-1,e=-1,s=-1,r=-1;if(this.y_>=0&&0===this.p_){const n=o.A.Lo[this.y_];if(n.frames&&(i=n.frames[this.A_]),this.u_>=0&&this.u_!==this.Sa){const t=o.A.Lo[this.u_].frames;t&&(e=t[this.d_])}n.ny>=0&&(s=n.ny,t+=BigInt(s-this.nE[5])<<8n),n.hy>=0&&(r=n.hy,t+=BigInt(r-this.nE[3])<<16n)}else if(this.u_>=0){const t=o.A.Lo[this.u_].frames;t&&(i=t[this.d_])}let h=d.So?.get(t);if(!h){const i=new f.fe(12,null);let e=0;for(let t=0;t<12;t++){let n=this.nE[t];if(r>=0&&3===t&&(n=r),s>=0&&5===t&&(n=s),n>=256&&n<512){const t=l.A.Lo[n-256].la();t&&(i[e++]=t)}if(n>=512){const t=a.A.get(n-512).iy(this.eE);t&&(i[e++]=t)}}h=n.A.Ta(i,e);for(let t=0;t<5;t++)0!==this.rE[t]&&(h.Ra(d.Oa[t][0],d.Oa[t][this.rE[t]]),1===t&&h.Ra(d.La[0],d.La[this.rE[t]]));h.xa(),h.Ma(64,850,-30,-50,-30,!0),d.So?.put(t,h)}if(this.et)return h;const c=n.A.uw(h,!0);return-1!==i&&-1!==e?c.dw(i,e,o.A.Lo[this.y_].ey):-1!==i&&c.ka(i),c.ww(),c.Jd=null,c.$d=null,c}}},9222:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;model;ag;info;constructor(t,i,e,s,n,r){this.y=t,this.x=i,this.z=e,this.model=s,this.ag=n,this.info=r}}},1161:(t,i,e)=>{e.d(i,{A:()=>s});class s{level;y;x;z;model;rI;hI;cg;Eg;fg;vg;ag;info;AI=0;Wm=0;constructor(t,i,e,s,n,r,h,o,l,a,c,f,u){this.level=t,this.y=i,this.x=e,this.z=s,this.model=n,this.rI=r,this.hI=h,this.cg=o,this.Eg=l,this.fg=a,this.vg=c,this.ag=f,this.info=u}}},5748:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;yI;wI;dI;ag;offset;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.yI=s,this.wI=n,this.dI=r,this.ag=h,this.offset=o}}},8256:(t,i,e)=>{e.d(i,{A:()=>s});class s{Xg;$A;jg;QA;type;Og;Lg;Sg;xg;Rg;iw;mode=0;$g=0;Qg=0;zg=0;Zg=0;qg=0;Jg=0;constructor(t,i,e,s,n,r,h,o,l,a,c){this.Xg=t,this.$A=i,this.jg=e,this.QA=s,this.type=n,this.Og=r,this.Lg=h,this.Sg=o,this.xg=l,this.Rg=a,this.iw=c}}},3795:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1982),n=e(3867);class r extends s.A{level;x;z;iI;zp;Vg;Wp=null;Hp=null;Jp=null;$p=null;Vp=null;Zp=null;Pp=null;jp=0;Kg=0;Gp=0;visible=!1;update=!1;Wg=!1;Yg=0;aI=0;cI=0;oI=0;constructor(t,i,e){super(),this.iI=this.level=t,this.x=i,this.z=e,this.zp=new n.fe(5,null),this.Vg=new Int32Array(5)}}},2771:(t,i,e)=>{e.d(i,{A:()=>s});class s{static MI=new Int32Array(6);static DI=new Int32Array(6);static SI=new Int32Array(6);static xI=new Int32Array(6);static kI=new Int32Array(6);static yE=[Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,2,6),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,13,14)];static AE=[Int8Array.of(0,1,2,3,0,0,1,3),Int8Array.of(1,1,2,3,1,0,1,3),Int8Array.of(0,1,2,3,1,0,1,3),Int8Array.of(0,0,1,2,0,0,2,4,1,0,4,3),Int8Array.of(0,0,1,4,0,0,4,3,1,1,2,4),Int8Array.of(0,0,4,3,1,0,1,2,1,0,2,4),Int8Array.of(0,1,2,4,1,0,1,4,1,0,4,3),Int8Array.of(0,4,1,2,0,4,2,5,1,0,4,5,1,0,5,3),Int8Array.of(0,4,1,2,0,4,2,3,0,4,3,5,1,0,4,5),Int8Array.of(0,0,4,5,1,4,1,2,1,4,2,3,1,4,3,5),Int8Array.of(0,0,1,5,0,1,4,5,0,1,2,4,1,0,5,3,1,5,4,3,1,4,2,3),Int8Array.of(1,0,1,5,1,1,4,5,1,1,2,4,0,0,5,3,0,5,4,3,0,4,2,3),Int8Array.of(1,0,5,4,1,0,1,5,0,0,4,3,0,4,5,3,0,5,2,3,0,1,2,5)];static mE=128;static pE=this.mE/2|0;static gE=this.mE/4|0;static IE=3*this.mE/4|0;Kd;jd;Xd;UI;GI;WI;NI;FI;BI;LI;flat;shape;angle;Ug;Pg;constructor(t,i,e,n,r,h,o,l,a,c,f,u,d,w,y,A,m,p,g){this.flat=!(m!==n||m!==w||m!==l),this.shape=i,this.angle=h,this.Ug=d,this.Pg=a;const I=s.yE[i],_=I.length;this.Kd=new Int32Array(_),this.jd=new Int32Array(_),this.Xd=new Int32Array(_);const C=new Int32Array(_),E=new Int32Array(_),v=t*s.mE,b=p*s.mE;for(let t=0;t<_;t++){let i,a,f,d,p,_=I[t];!(1&_)&&_<=8&&(_=1+(_-h-h-1&7)),_>8&&_<=12&&(_=9+(_-h-9&3)),_>12&&_<=16&&(_=13+(_-h-13&3)),1===_?(i=v,a=b,f=m,d=o,p=c):2===_?(i=v+s.pE,a=b,f=m+n>>1,d=o+g>>1,p=c+e>>1):3===_?(i=v+s.mE,a=b,f=n,d=g,p=e):4===_?(i=v+s.mE,a=b+s.pE,f=n+w>>1,d=g+r>>1,p=e+y>>1):5===_?(i=v+s.mE,a=b+s.mE,f=w,d=r,p=y):6===_?(i=v+s.pE,a=b+s.mE,f=w+l>>1,d=r+A>>1,p=y+u>>1):7===_?(i=v,a=b+s.mE,f=l,d=A,p=u):8===_?(i=v,a=b+s.pE,f=l+m>>1,d=A+o>>1,p=u+c>>1):9===_?(i=v+s.pE,a=b+s.gE,f=m+n>>1,d=o+g>>1,p=c+e>>1):10===_?(i=v+s.IE,a=b+s.pE,f=n+w>>1,d=g+r>>1,p=e+y>>1):11===_?(i=v+s.pE,a=b+s.IE,f=w+l>>1,d=r+A>>1,p=y+u>>1):12===_?(i=v+s.gE,a=b+s.pE,f=l+m>>1,d=A+o>>1,p=u+c>>1):13===_?(i=v+s.gE,a=b+s.gE,f=m,d=o,p=c):14===_?(i=v+s.IE,a=b+s.gE,f=n,d=g,p=e):15===_?(i=v+s.IE,a=b+s.IE,f=w,d=r,p=y):(i=v+s.gE,a=b+s.IE,f=l,d=A,p=u),this.Kd[t]=i,this.jd[t]=f,this.Xd[t]=a,C[t]=d,E[t]=p}const T=s.AE[i],R=T.length/4|0;this.NI=new Int32Array(R),this.FI=new Int32Array(R),this.BI=new Int32Array(R),this.UI=new Int32Array(R),this.GI=new Int32Array(R),this.WI=new Int32Array(R),this.LI=-1!==f?new Int32Array(R):null;let O=0;for(let t=0;t{e.d(i,{A:()=>s});class s{static gm=0;static Yp=1;static _E=2;static CE=3;static EE=4;static vE=5;static pE=6;static gE=7;static IE=8;static bE=9;static TE=10;static RE=11}},3479:(t,i,e)=>{e.d(i,{A:()=>s});class s{OI;bI;CI;vI;_I;color;flat;constructor(t,i,e,s,n,r,h){this.OI=t,this.bI=i,this.CI=e,this.vI=s,this._I=n,this.color=r,this.flat=h}}},6855:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;lI;uI;sg;rg;ag;info;constructor(t,i,e,s,n,r,h,o,l){this.y=t,this.x=i,this.z=e,this.lI=s,this.uI=n,this.sg=r,this.rg=h,this.ag=o,this.info=l}}},7441:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;type;angle;model;ag;info;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.type=s,this.angle=n,this.model=r,this.ag=h,this.info=o}}},7536:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n{OE;LE;constructor(t){this.LE=[],this.OE=t;for(let i=0;i{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{xE;kE;constructor(){super(),this.xE=this,this.kE=this}ME(){this.kE&&this.xE&&(this.kE.xE=this.xE,this.xE.kE=this.kE,this.xE=null,this.kE=null)}}},3819:(t,i,e)=>{e.d(i,{A:()=>s});class s{static DE=['_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9'];static NE=t=>{t=t.trim();let i=0n;for(let e=0;e=65&&s<=90?i+=BigInt(s+1-65):s>=97&&s<=122?i+=BigInt(s+1-97):s>=48&&s<=57&&(i+=BigInt(s+27-48))}return i};static Ea=t=>{if(t<0n||t>=6582952005840035281n)return'invalid_name';if(t%37n===0n)return'invalid_name';let i=0;const e=Array(12);for(;0n!==t;){const s=t;t/=37n,e[11-i++]=this.DE[Number(s-37n*t)]}return e.slice(12-i).join('')};static FE=t=>{const i=[...t.toLowerCase()];let e=!0;for(let t=0;t='a'&&s<='z'&&(i[t]=s.toUpperCase(),e=!1),'.'!==s&&'!'!==s||(e=!0)}return i.join('')};static BE=t=>{let i='';for(let e=0;e(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static Ca=t=>{if(0===t.length)return t;const i=[...t];for(let t=0;t='a'&&i[t+1]<='z'&&(i[t+1]=String.fromCharCode(i[t+1].charCodeAt(0)+'A'.charCodeAt(0)-97)));return i[0]>='a'&&i[0]<='z'&&(i[0]=String.fromCharCode(i[0].charCodeAt(0)+'A'.charCodeAt(0)-97)),i.join('')};static Wu=t=>{const i=t.toUpperCase();let e=0n;for(let t=0;t>56n)&0xffffffffffffffn;return e}}},6666:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n{UE;cursor=null;constructor(){const t=new s.A;t.next=t,t.SE=t,this.UE=t}ZA(t){t.SE&&t.Cw(),t.SE=this.UE.SE,t.next=this.UE,t.SE&&(t.SE.next=t),t.next.SE=t}PE(t){t.SE&&t.Cw(),t.SE=this.UE,t.next=this.UE.next,t.SE.next=t,t.next&&(t.next.SE=t)}tI(){const t=this.UE.next;return t===this.UE?null:(t?.Cw(),t)}head(){const t=this.UE.next;return t===this.UE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}GE(){const t=this.UE.SE;return t===this.UE?(this.cursor=null,null):(this.cursor=t?.SE||null,t)}next(){const t=this.cursor;return t===this.UE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}SE(){const t=this.cursor;return t===this.UE?(this.cursor=null,null):(this.cursor=t?.SE||null,t)}clear(){for(;;){const t=this.UE.next;if(t===this.UE)return;t?.Cw()}}}},1982:(t,i,e)=>{e.d(i,{A:()=>s});class s{key;next;SE;constructor(){this.key=0n,this.next=this,this.SE=this}Cw(){this.SE&&this.next&&(this.SE.next=this.next,this.next.SE=this.SE,this.next=null,this.SE=null)}}},2679:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(2512),n=e(7536);class r{WE;YE;history;available;constructor(t){this.WE=t,this.available=t,this.YE=new n.A(1024),this.history=new s.A}get(t){const i=this.YE.get(t);return i&&this.history.push(i),i}put(t,i){if(0===this.available){const t=this.history.pop();t?.Cw(),t?.ME()}else this.available--;this.YE.put(t,i),this.history.push(i)}clear(){const t=this.history.pop();t?(t.Cw(),t.ME()):this.available=this.WE}}},2512:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n{head;constructor(){this.head=new s.A}push(t){t.kE&&t.ME(),t.kE=this.head.kE,t.xE=this.head,t.kE&&(t.kE.xE=t),t.xE.kE=t}pop(){const t=this.head.xE;return t===this.head?null:(t?.ME(),t)}}},8534:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(3867);class r{static Lo=[];static nc=t=>{const i=new s.A(t.read('base_head.dat')),e=new s.A(t.read('base_type.dat')),h=new s.A(t.read('base_label.dat')),o=i.Lu;i.Mf+=2;for(let t=0;t{e.d(i,{A:()=>r});var s=e(8534),n=e(1069);class r{static Lo=[];static nc=t=>{const i=new n.A(t.read('frame_head.dat')),e=new n.A(t.read('frame_tran1.dat')),h=new n.A(t.read('frame_tran2.dat')),o=new n.A(t.read('frame_del.dat')),l=i.Lu;i.Mf+=2;const a=new Int32Array(500),c=new Int32Array(500),f=new Int32Array(500),u=new Int32Array(500);for(let t=0;t0){if(0!==d.types[t])for(let i=t-1;i>y;i--)if(0===d.types[i]){a[A]=i,c[A]=0,f[A]=0,u[A]=0,A++;break}a[A]=t;let e=0;3===d.types[a[A]]&&(e=128),c[A]=1&i?h.VE:e,f[A]=2&i?h.VE:e,u[A]=4&i?h.VE:e,y=t,A++}}n.length=A,n.KE=new Int32Array(A),n.x=new Int32Array(A),n.y=new Int32Array(A),n.z=new Int32Array(A);for(let t=0;t{e.d(i,{$c:()=>s,zo:()=>n,XE:()=>o,jE:()=>h,zE:()=>r});const s=document.getElementById('canvas'),n=s.getContext('2d',{willReadFrequently:!0}),r=document.createElement('canvas'),h=document.createElement('img'),o=r.getContext('2d',{willReadFrequently:!0})},9298:(t,i,e)=>{e.d(i,{A:()=>s});class s{static RED=16711680;static GREEN=65280;static BLUE=255;static Gl=16776960;static ZE=65535;static Cm=16711935;static Il=16777215;static Pl=0;static qE=16748608;static JE=8388608;static $E=128;static QE=16756736;static tv=16740352;static iv=16723968;static ev=12648192;static sv=8453888;static nv=4259584;static rv=9179409;static hv=6116423;static il=2301979;static el=5063219;static nl=7759444;static hl=3353893;static ov=8388736;static lv=13350793;static av=Int32Array.of(s.Gl,s.RED,s.GREEN,s.ZE,s.Cm,s.Il);static wC=6798;static yC=107;static AC=10283;static mC=16;static pC=4797;static gC=7744;static IC=5799;static _C=4634;static CC=33697;static EC=22433;static vC=2983;static bC=54193;static TC=8741;static RC=12;static OC=64030;static LC=43162;static SC=7735;static xC=8404;static kC=1701;static MC=38430;static DC=24094;static NC=10153;static FC=56621;static BC=4783;static UC=1341;static PC=16578;static GC=35003;static WC=25239;static J_=9104;static Q_=10275;static tC=7595;static iC=3610;static eC=7975;static sC=8526;static nC=918;static rC=38802;static hC=24466;static oC=10145;static lC=58654;static aC=5027;static cC=1457;static fC=16565;static uC=34991;static dC=25486;static YC=4626;static HC=11146;static VC=6439;static KC=12;static XC=4758;static jC=10270;static iE=4574;static zC=4550;static ZC=4537;static qC=5681;static JC=5673;static $C=5790;static QC=6806;static tE=8076}},8950:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n extends s.A{static Rw=new Int32Array;static Ow=0;static Lw=0;static top=0;static bottom=0;static left=0;static right=0;static gI=0;static cv=0;static fv=0;static bind=(t,i,e)=>{this.Rw=t,this.Ow=i,this.Lw=e,this.Al(0,0,i,e)};static uv=()=>{this.left=0,this.top=0,this.right=this.Ow,this.bottom=this.Lw,this.gI=this.right-1,this.cv=this.right/2|0};static Al=(t,i,e,s)=>{t<0&&(t=0),i<0&&(i=0),e>this.Ow&&(e=this.Ow),s>this.Lw&&(s=this.Lw),this.top=i,this.bottom=s,this.left=t,this.right=e,this.gI=this.right-1,this.cv=this.right/2|0,this.fv=this.bottom/2|0};static clear=()=>{const t=this.Ow*this.Lw;for(let i=0;i{this.rl(t,i,n,e),this.rl(t,i+s-1,n,e),this.sl(t,i,n,s),this.sl(t+e-1,i,n,s)};static rl=(t,i,e,s)=>{if(i=this.bottom)return;tthis.right&&(s=this.right-t);const n=t+i*this.Ow;for(let t=0;t{if(t=this.right)return;ithis.bottom&&(s=this.bottom-i);const n=t+i*this.Ow;for(let t=0;t{const r=Math.abs(e-t),h=Math.abs(s-i),o=t=this.left&&t=this.top&&i-h&&(a-=h,t+=o),e{tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const r=this.Ow-e;let h=t+i*this.Ow;for(let t=-s;t<0;t++){for(let t=-e;t<0;t++)this.Rw[h++]=n;h+=r}};static dv(t,i,e,s,n,r){tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const h=256-r,o=(n>>16&255)*r,l=(n>>8&255)*r,a=(255&n)*r,c=this.Ow-e;let f=t+i*this.Ow;for(let t=0;t>16&255)*h>>8<<16)+(l+(this.Rw[f]>>8&255)*h>>8<<8)+(a+(255&this.Rw[f])*h>>8);this.Rw[f++]=t}f+=c}}static wv(t,i,e,s,n){const r=256-n,h=(s>>16&255)*n,o=(s>>8&255)*n,l=(255&s)*n;let a=i-e;a<0&&(a=0);let c=i+e;c>=this.Lw&&(c=this.Lw-1);for(let s=a;s<=c;s++){const n=s-i,a=0|Math.sqrt(e*e-n*n);let c=t-a;c<0&&(c=0);let f=t+a;f>=this.Ow&&(f=this.Ow-1);let u=c+s*this.Ow;for(let t=c;t<=f;t++){const t=(h+(this.Rw[u]>>16&255)*r>>8<<16)+(o+(this.Rw[u]>>8&255)*r>>8<<8)+(l+(255&this.Rw[u])*r>>8);this.Rw[u++]=t}}}static yv=(t,i,e)=>{t=this.right||i=this.bottom||(this.Rw[t+i*this.Ow]=e)}}},4583:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(8950),n=e(1673),r=e(3867);class h extends s.A{static et=!1;static Av=new Int32Array(512);static mv=new Int32Array(2048);static sin=new Int32Array(2048);static cos=new Int32Array(2048);static palette=new Int32Array(65536);static pv=new r.fe(50,null);static gv=0;static Tw=new Int32Array;static ra=0;static ha=0;static Sw=!0;static pI=!1;static alpha=0;static Iv=null;static _v=new r.fe(50,null);static Cv=0;static Wm=0;static Ev=new Int32Array(50);static vv=new r.fe(50,null);static bv=!1;static Tv=new r.fe(50,!1);static Rv=new Int32Array(50);static{for(let t=1;t<512;t++)this.Av[t]=32768/t|0;for(let t=1;t<2048;t++)this.mv[t]=65536/t|0;for(let t=0;t<2048;t++)this.sin[t]=65536*Math.sin(.0030679615757712823*t)|0,this.cos[t]=65536*Math.cos(.0030679615757712823*t)|0}static To=()=>{this.Av=null,this.Av=null,this.sin=null,this.cos=null,this.Tw=null,this.pv=null,this.Tv=null,this.Rv=null,this.Iv=null,this._v=null,this.Ev=null,this.palette=null,this.vv=null,console.log('Draw3D unloaded!')};static rc=()=>{this.Tw=new Int32Array(this.Lw);for(let t=0;t{this.Tw=new Int32Array(i);for(let e=0;e{this.Iv=null,this._v.fill(null)};static ic=t=>{this.gv=0;for(let i=0;i<50;i++)try{this.pv[i]=n.A.tc(t,i.toString()),this.et&&128===this.pv[i]?.Fl?this.pv[i]?.Sv():this.pv[i]?.Pw(),this.gv++}catch(t){}};static _m=t=>{if(0!==this.Rv[t])return this.Rv[t];const i=this.vv[t];if(!i)return 0;let e=0,s=0,n=0;const r=i.length;for(let t=0;t>16&255,s+=i[t]>>8&255,n+=255&i[t];let h=(e/r<<16)+(s/r<<8)+(n/r|0);return h=this.xv(h,1.4),0===h&&(h=1),this.Rv[t]=h,h};static ec=t=>{const i=t+.03*Math.random()-.015;let e=0;for(let t=0;t<512;t++){const s=(t/8|0)/64+.0078125,n=(7&t)/8+.0625;for(let t=0;t<128;t++){const r=t/128;let h=r,o=r,l=r;if(0!==n){let t;t=r<.5?r*(n+1):r+n-r*n;const i=2*r-t;let e=s+.3333333333333333;e>1&&e--;let a=s-.3333333333333333;a<0&&a++,h=6*e<1?i+6*(t-i)*e:2*e<1?t:3*e<2?i+(t-i)*(.6666666666666666-e)*6:i,o=6*s<1?i+6*(t-i)*s:2*s<1?t:3*s<2?i+(t-i)*(.6666666666666666-s)*6:i,l=6*a<1?i+6*(t-i)*a:2*a<1?t:3*a<2?i+(t-i)*(.6666666666666666-a)*6:i}const a=((256*h|0)<<16)+((256*o|0)<<8)+(256*l|0);this.palette[e++]=this.xv(a,i)}}for(let t=0;t<50;t++){const e=this.pv[t];if(!e)continue;const s=e.palette;this.vv[t]=new Int32Array(s.length);for(let e=0;e{const e=(t>>16)/256,s=(t>>8&255)/256,n=(255&t)/256;return((256*Math.pow(e,i)|0)<<16)+((256*Math.pow(s,i)|0)<<8)+(256*Math.pow(n,i)|0)};static sc=t=>{this.Iv||(this.Cv=t,this.et?this.Iv=new r.Xr(t,16384):this.Iv=new r.Xr(t,65536),this._v.fill(null))};static EI=(t,i,e,s,n,r,h,o,l)=>{let a=0,c=0;n!==s&&(a=(i-t<<16)/(n-s)|0,c=(o-h<<15)/(n-s)|0);let f=0,u=0;r!==n&&(f=(e-i<<16)/(r-n)|0,u=(l-o<<15)/(r-n)|0);let d=0,w=0;if(r!==s&&(d=(t-e<<16)/(s-r)|0,w=(h-l<<15)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),nf)for(r-=n,n-=s,s=this.Tw[s];;){if(--n<0)for(;;){if(--r<0)return;this.Mv(e>>16,i>>16,l>>7,o>>7,this.Rw,s,0),e+=d,i+=f,l+=w,o+=u,s+=this.Ow}this.Mv(e>>16,t>>16,l>>7,h>>7,this.Rw,s,0),e+=d,t+=a,l+=w,h+=c,s+=this.Ow}else for(r-=n,n-=s,s=this.Tw[s];;){if(--n<0)for(;;){if(--r<0)return;this.Mv(i>>16,e>>16,o>>7,l>>7,this.Rw,s,0),e+=d,i+=f,l+=w,o+=u,s+=this.Ow}this.Mv(t>>16,e>>16,h>>7,l>>7,this.Rw,s,0),e+=d,t+=a,l+=w,h+=c,s+=this.Ow}else if(i=t<<=16,o=h<<=15,s<0&&(i-=d*s,t-=a*s,o-=w*s,h-=c*s,s=0),e<<=16,l<<=15,r<0&&(e-=f*r,l-=u*r,r=0),s!==r&&da)for(n-=r,r-=s,s=this.Tw[s];;){if(--r<0)for(;;){if(--n<0)return;this.Mv(e>>16,t>>16,l>>7,h>>7,this.Rw,s,0),e+=f,t+=a,l+=u,h+=c,s+=this.Ow}this.Mv(i>>16,t>>16,o>>7,h>>7,this.Rw,s,0),i+=d,t+=a,o+=w,h+=c,s+=this.Ow}else for(n-=r,r-=s,s=this.Tw[s];;){if(--r<0)for(;;){if(--n<0)return;this.Mv(t>>16,e>>16,h>>7,l>>7,this.Rw,s,0),e+=f,t+=a,l+=u,h+=c,s+=this.Ow}this.Mv(t>>16,i>>16,h>>7,o>>7,this.Rw,s,0),i+=d,t+=a,o+=w,h+=c,s+=this.Ow}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),rd)for(s-=r,r-=n,n=this.Tw[n];;){if(--r<0)for(;;){if(--s<0)return;this.Mv(t>>16,e>>16,h>>7,l>>7,this.Rw,n,0),t+=a,e+=d,h+=c,l+=w,n+=this.Ow}this.Mv(t>>16,i>>16,h>>7,o>>7,this.Rw,n,0),t+=a,i+=f,h+=c,o+=u,n+=this.Ow}else for(s-=r,r-=n,n=this.Tw[n];;){if(--r<0)for(;;){if(--s<0)return;this.Mv(e>>16,t>>16,l>>7,h>>7,this.Rw,n,0),t+=a,e+=d,h+=c,l+=w,n+=this.Ow}this.Mv(i>>16,t>>16,o>>7,h>>7,this.Rw,n,0),t+=a,i+=f,h+=c,o+=u,n+=this.Ow}else if(e=i<<=16,l=o<<=15,n<0&&(e-=a*n,i-=f*n,l-=c*n,o-=u*n,n=0),t<<=16,h<<=15,s<0&&(t-=d*s,h-=w*s,s=0),r-=s,s-=n,n=this.Tw[n],a>16,i>>16,h>>7,o>>7,this.Rw,n,0),t+=d,i+=f,h+=w,o+=u,n+=this.Ow}this.Mv(e>>16,i>>16,l>>7,o>>7,this.Rw,n,0),e+=a,i+=f,l+=c,o+=u,n+=this.Ow}else for(;;){if(--s<0)for(;;){if(--r<0)return;this.Mv(i>>16,t>>16,o>>7,h>>7,this.Rw,n,0),t+=d,i+=f,h+=w,o+=u,n+=this.Ow}this.Mv(i>>16,e>>16,o>>7,l>>7,this.Rw,n,0),e+=a,i+=f,l+=c,o+=u,n+=this.Ow}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,o>>7,h>>7,this.Rw,r,0),i+=f,t+=a,o+=u,h+=c,r+=this.Ow}this.Mv(i>>16,e>>16,o>>7,l>>7,this.Rw,r,0),i+=f,e+=d,o+=u,l+=w,r+=this.Ow}else for(;;){if(--s<0)for(;;){if(--n<0)return;this.Mv(t>>16,i>>16,h>>7,o>>7,this.Rw,r,0),i+=f,t+=a,o+=u,h+=c,r+=this.Ow}this.Mv(e>>16,i>>16,l>>7,o>>7,this.Rw,r,0),i+=f,e+=d,o+=u,l+=w,r+=this.Ow}else if(t=e<<=16,h=l<<=15,r<0&&(t-=f*r,e-=d*r,h-=u*r,l-=w*r,r=0),i<<=16,o<<=15,n<0&&(i-=a*n,o-=c*n,n=0),s-=n,n-=r,r=this.Tw[r],f>16,e>>16,o>>7,l>>7,this.Rw,r,0),i+=a,e+=d,o+=c,l+=w,r+=this.Ow}this.Mv(t>>16,e>>16,h>>7,l>>7,this.Rw,r,0),t+=f,e+=d,h+=u,l+=w,r+=this.Ow}else for(;;){if(--n<0)for(;;){if(--s<0)return;this.Mv(e>>16,i>>16,l>>7,o>>7,this.Rw,r,0),i+=a,e+=d,o+=c,l+=w,r+=this.Ow}this.Mv(e>>16,t>>16,l>>7,h>>7,this.Rw,r,0),t+=f,e+=d,h+=u,l+=w,r+=this.Ow}};static Mv=(t,i,e,s,n,r,h)=>{let o;if(this.Sw){let l;if(this.pI){if(l=i-t>3?(s-e)/(i-t)|0:0,i>this.gI&&(i=this.gI),t<0&&(e-=t*l,t=0),t>=i)return;r+=t,h=i-t>>2,l<<=2}else{if(!(t>2)>0?(s-e)*this.Av[h]>>15:0}if(0===this.alpha)for(;;){if(--h<0){if((h=i-t&3)>0){o=this.palette[e>>8];do{n[r++]=o,h--}while(h>0);return}break}o=this.palette[e>>8],e+=l,n[r++]=o,n[r++]=o,n[r++]=o,n[r++]=o}else{const s=this.alpha,a=256-this.alpha;for(;;){if(--h<0){if((h=i-t&3)>0){o=this.palette[e>>8],o=((16711935&o)*a>>8&16711935)+((65280&o)*a>>8&65280);do{n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),h--}while(h>0)}break}o=this.palette[e>>8],e+=l,o=((16711935&o)*a>>8&16711935)+((65280&o)*a>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280)}}}else if(tthis.gI&&(i=this.gI),t<0&&(e-=t*l,t=0),t>=i))return;if(r+=t,h=i-t,0===this.alpha)do{n[r++]=this.palette[e>>8],e+=l,h--}while(h>0);else{const t=this.alpha,i=256-this.alpha;do{o=this.palette[e>>8],e+=l,o=((16711935&o)*i>>8&16711935)+((65280&o)*i>>8&65280),n[r++]=o+((16711935&n[r])*t>>8&16711935)+((65280&n[r])*t>>8&65280),h--}while(h>0)}}};static Dv=(t,i,e,s,n,r,h)=>{let o=0;n!==s&&(o=(i-t<<16)/(n-s)|0);let l=0;r!==n&&(l=(e-i<<16)/(r-n)|0);let a=0;if(r!==s&&(a=(t-e<<16)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),nl)for(r-=n,n-=s,s=this.Tw[s];;){if(--n<0)for(;;){if(--r<0)return;this.Nv(e>>16,i>>16,this.Rw,s,h),e+=a,i+=l,s+=this.Ow}this.Nv(e>>16,t>>16,this.Rw,s,h),e+=a,t+=o,s+=this.Ow}else for(r-=n,n-=s,s=this.Tw[s];;){if(--n<0)for(;;){if(--r<0)return;this.Nv(i>>16,e>>16,this.Rw,s,h),e+=a,i+=l,s+=this.Ow}this.Nv(t>>16,e>>16,this.Rw,s,h),e+=a,t+=o,s+=this.Ow}else if(i=t<<=16,s<0&&(i-=a*s,t-=o*s,s=0),e<<=16,r<0&&(e-=l*r,r=0),s!==r&&ao)for(n-=r,r-=s,s=this.Tw[s];;){if(--r<0)for(;;){if(--n<0)return;this.Nv(e>>16,t>>16,this.Rw,s,h),e+=l,t+=o,s+=this.Ow}this.Nv(i>>16,t>>16,this.Rw,s,h),i+=a,t+=o,s+=this.Ow}else for(n-=r,r-=s,s=this.Tw[s];;){if(--r<0)for(;;){if(--n<0)return;this.Nv(t>>16,e>>16,this.Rw,s,h),e+=l,t+=o,s+=this.Ow}this.Nv(t>>16,i>>16,this.Rw,s,h),i+=a,t+=o,s+=this.Ow}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),ra)for(s-=r,r-=n,n=this.Tw[n];;){if(--r<0)for(;;){if(--s<0)return;this.Nv(t>>16,e>>16,this.Rw,n,h),t+=o,e+=a,n+=this.Ow}this.Nv(t>>16,i>>16,this.Rw,n,h),t+=o,i+=l,n+=this.Ow}else for(s-=r,r-=n,n=this.Tw[n];;){if(--r<0)for(;;){if(--s<0)return;this.Nv(e>>16,t>>16,this.Rw,n,h),t+=o,e+=a,n+=this.Ow}this.Nv(i>>16,t>>16,this.Rw,n,h),t+=o,i+=l,n+=this.Ow}else if(e=i<<=16,n<0&&(e-=o*n,i-=l*n,n=0),t<<=16,s<0&&(t-=a*s,s=0),o>16,i>>16,this.Rw,n,h),t+=a,i+=l,n+=this.Ow}this.Nv(e>>16,i>>16,this.Rw,n,h),e+=o,i+=l,n+=this.Ow}else for(r-=s,s-=n,n=this.Tw[n];;){if(--s<0)for(;;){if(--r<0)return;this.Nv(i>>16,t>>16,this.Rw,n,h),t+=a,i+=l,n+=this.Ow}this.Nv(i>>16,e>>16,this.Rw,n,h),e+=o,i+=l,n+=this.Ow}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,this.Rw,r,h),i+=l,t+=o,r+=this.Ow}this.Nv(i>>16,e>>16,this.Rw,r,h),i+=l,e+=a,r+=this.Ow}else for(n-=s,s-=r,r=this.Tw[r];;){if(--s<0)for(;;){if(--n<0)return;this.Nv(t>>16,i>>16,this.Rw,r,h),i+=l,t+=o,r+=this.Ow}this.Nv(e>>16,i>>16,this.Rw,r,h),i+=l,e+=a,r+=this.Ow}else if(t=e<<=16,r<0&&(t-=l*r,e-=a*r,r=0),i<<=16,n<0&&(i-=o*n,n=0),l>16,e>>16,this.Rw,r,h),i+=o,e+=a,r+=this.Ow}this.Nv(t>>16,e>>16,this.Rw,r,h),t+=l,e+=a,r+=this.Ow}else for(s-=n,n-=r,r=this.Tw[r];;){if(--n<0)for(;;){if(--s<0)return;this.Nv(e>>16,i>>16,this.Rw,r,h),i+=o,e+=a,r+=this.Ow}this.Nv(e>>16,t>>16,this.Rw,r,h),t+=l,e+=a,r+=this.Ow}};static RI=(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w,y,A,m,p)=>{const g=this.Fv(p);this.bv=!this.Tv[p];const I=a-u,_=c-w,C=f-A,E=d-a,v=y-c,b=m-f;let T=E*c-v*a<<14;const R=v*f-b*c<<8,O=b*a-E*f<<5;let L=I*c-_*a<<14;const S=_*f-C*c<<8,x=C*a-I*f<<5;let k=_*E-I*v<<14;const M=C*v-_*b<<8,D=I*b-C*E<<5;let N=0,F=0;n!==s&&(N=(i-t<<16)/(n-s)|0,F=(o-h<<16)/(n-s)|0);let B=0,U=0;r!==n&&(B=(e-i<<16)/(r-n)|0,U=(l-o<<16)/(r-n)|0);let P=0,G=0;if(r!==s&&(P=(t-e<<16)/(s-r)|0,G=(h-l<<16)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),nB)for(r-=n,n-=s,s=this.Tw[s];;){if(--n<0)for(;;){if(--r<0)return;this.Bv(e>>16,i>>16,this.Rw,s,g,0,0,T,L,k,R,S,M,l>>8,o>>8),e+=P,i+=B,l+=G,o+=U,s+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.Bv(e>>16,t>>16,this.Rw,s,g,0,0,T,L,k,R,S,M,l>>8,h>>8),e+=P,t+=N,l+=G,h+=F,s+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}else for(r-=n,n-=s,s=this.Tw[s];;){if(--n<0)for(;;){if(--r<0)return;this.Bv(i>>16,e>>16,this.Rw,s,g,0,0,T,L,k,R,S,M,o>>8,l>>8),e+=P,i+=B,l+=G,o+=U,s+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.Bv(t>>16,e>>16,this.Rw,s,g,0,0,T,L,k,R,S,M,h>>8,l>>8),e+=P,t+=N,l+=G,h+=F,s+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}}else{i=t<<=16,o=h<<=16,s<0&&(i-=P*s,t-=N*s,o-=G*s,h-=F*s,s=0),e<<=16,l<<=16,r<0&&(e-=B*r,l-=U*r,r=0);const a=s-this.ha;if(T+=O*a,L+=x*a,k+=D*a,T|=0,L|=0,k|=0,(s===r||P>=N)&&(s!==r||B<=N))for(n-=r,r-=s,s=this.Tw[s];;){if(--r<0)for(;;){if(--n<0)return;this.Bv(t>>16,e>>16,this.Rw,s,g,0,0,T,L,k,R,S,M,h>>8,l>>8),e+=B,t+=N,l+=U,h+=F,s+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.Bv(t>>16,i>>16,this.Rw,s,g,0,0,T,L,k,R,S,M,h>>8,o>>8),i+=P,t+=N,o+=G,h+=F,s+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}else for(n-=r,r-=s,s=this.Tw[s];;){if(--r<0)for(;;){if(--n<0)return;this.Bv(e>>16,t>>16,this.Rw,s,g,0,0,T,L,k,R,S,M,l>>8,h>>8),e+=B,t+=N,l+=U,h+=F,s+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.Bv(i>>16,t>>16,this.Rw,s,g,0,0,T,L,k,R,S,M,o>>8,h>>8),i+=P,t+=N,o+=G,h+=F,s+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),rP)for(s-=r,r-=n,n=this.Tw[n];;){if(--r<0)for(;;){if(--s<0)return;this.Bv(t>>16,e>>16,this.Rw,n,g,0,0,T,L,k,R,S,M,h>>8,l>>8),t+=N,e+=P,h+=F,l+=G,n+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.Bv(t>>16,i>>16,this.Rw,n,g,0,0,T,L,k,R,S,M,h>>8,o>>8),t+=N,i+=B,h+=F,o+=U,n+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}else for(s-=r,r-=n,n=this.Tw[n];;){if(--r<0)for(;;){if(--s<0)return;this.Bv(e>>16,t>>16,this.Rw,n,g,0,0,T,L,k,R,S,M,l>>8,h>>8),t+=N,e+=P,h+=F,l+=G,n+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.Bv(i>>16,t>>16,this.Rw,n,g,0,0,T,L,k,R,S,M,o>>8,h>>8),t+=N,i+=B,h+=F,o+=U,n+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}}else{e=i<<=16,l=o<<=16,n<0&&(e-=N*n,i-=B*n,l-=F*n,o-=U*n,n=0),t<<=16,h<<=16,s<0&&(t-=P*s,h-=G*s,s=0);const a=n-this.ha;if(T+=O*a,L+=x*a,k+=D*a,T|=0,L|=0,k|=0,r-=s,s-=n,n=this.Tw[n],N>16,i>>16,this.Rw,n,g,0,0,T,L,k,R,S,M,h>>8,o>>8),t+=P,i+=B,h+=G,o+=U,n+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.Bv(e>>16,i>>16,this.Rw,n,g,0,0,T,L,k,R,S,M,l>>8,o>>8),e+=N,i+=B,l+=F,o+=U,n+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}else for(;;){if(--s<0)for(;;){if(--r<0)return;this.Bv(i>>16,t>>16,this.Rw,n,g,0,0,T,L,k,R,S,M,o>>8,h>>8),t+=P,i+=B,h+=G,o+=U,n+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.Bv(i>>16,e>>16,this.Rw,n,g,0,0,T,L,k,R,S,M,o>>8,l>>8),e+=N,i+=B,l+=F,o+=U,n+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,this.Rw,r,g,0,0,T,L,k,R,S,M,o>>8,h>>8),i+=B,t+=N,o+=U,h+=F,r+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.Bv(i>>16,e>>16,this.Rw,r,g,0,0,T,L,k,R,S,M,o>>8,l>>8),i+=B,e+=P,o+=U,l+=G,r+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}else for(;;){if(--s<0)for(;;){if(--n<0)return;this.Bv(t>>16,i>>16,this.Rw,r,g,0,0,T,L,k,R,S,M,h>>8,o>>8),i+=B,t+=N,o+=U,h+=F,r+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.Bv(e>>16,i>>16,this.Rw,r,g,0,0,T,L,k,R,S,M,l>>8,o>>8),i+=B,e+=P,o+=U,l+=G,r+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}}else{t=e<<=16,h=l<<=16,r<0&&(t-=B*r,e-=P*r,h-=U*r,l-=G*r,r=0),i<<=16,o<<=16,n<0&&(i-=N*n,o-=F*n,n=0);const a=r-this.ha;if(T+=O*a,L+=x*a,k+=D*a,T|=0,L|=0,k|=0,s-=n,n-=r,r=this.Tw[r],B>16,e>>16,this.Rw,r,g,0,0,T,L,k,R,S,M,o>>8,l>>8),i+=N,e+=P,o+=F,l+=G,r+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.Bv(t>>16,e>>16,this.Rw,r,g,0,0,T,L,k,R,S,M,h>>8,l>>8),t+=B,e+=P,h+=U,l+=G,r+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}else for(;;){if(--n<0)for(;;){if(--s<0)return;this.Bv(e>>16,i>>16,this.Rw,r,g,0,0,T,L,k,R,S,M,l>>8,o>>8),i+=N,e+=P,o+=F,l+=G,r+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.Bv(e>>16,t>>16,this.Rw,r,g,0,0,T,L,k,R,S,M,l>>8,h>>8),t+=B,e+=P,h+=U,l+=G,r+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}}};static Bv=(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w)=>{if(t>=i)return;let y,A,m,p,g,I,_,C,E;if(this.pI){if(y=(w-d)/(i-t)|0,i>this.gI&&(i=this.gI),t<0&&(d-=t*y,t=0),t>=i)return;A=i-t>>3,y<<=12}else i-t>7?(A=i-t>>3,y=(w-d)*this.Av[A]>>6):(A=0,y=0);if(d<<=9,s+=t,this.et&&n)if(m=0,p=0,I=t-this.ra,o+=(c>>3)*I,l+=(f>>3)*I,a+=(u>>3)*I,o|=0,l|=0,g=(a|=0)>>12,0!==g&&(h=l/g|0,(r=o/g|0)<0?r=0:r>4032&&(r=4032)),o+=c,l+=f,a+=u,o|=0,l|=0,g=(a|=0)>>12,0!==g&&(m=o/g|0,p=l/g|0,m<7?m=7:m>4032&&(m=4032)),_=m-r>>3,C=p-h>>3,r+=d>>3&786432,E=d>>23,this.bv){for(;A-- >0;)e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r=m,h=p,o+=c,l+=f,g=(a+=u)>>12,0!==g&&(m=o/g|0,p=l/g|0,m<7?m=7:m>4032&&(m=4032)),_=m-r>>3,C=p-h>>3,r+=(d+=y)>>3&786432,E=d>>23;for(A=i-t&7;A-- >0;)e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C}else{for(;A-- >0;){let t;0!=(t=n[(4032&h)+(r>>6)]>>>E)&&(e[s]=t),s+=1,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s+=1,r=m,h=p,o+=c,l+=f,a+=u,o|=0,l|=0,g=(a|=0)>>12,0!==g&&(m=o/g|0,p=l/g|0,m<7?m=7:m>4032&&(m=4032)),_=m-r>>3,C=p-h>>3,r+=(d+=y)>>3&786432,E=d>>23}for(A=i-t&7;A-- >0;){let t;0!=(t=n[(4032&h)+(r>>6)]>>>E)&&(e[s]=t),s++,r+=_,h+=C}}else if(m=0,p=0,I=t-this.ra,o+=(c>>3)*I,l+=(f>>3)*I,a+=(u>>3)*I,o|=0,l|=0,g=(a|=0)>>14,0!==g&&(h=l/g|0,(r=o/g|0)<0?r=0:r>16256&&(r=16256)),o+=c,l+=f,a+=u,o|=0,l|=0,g=(a|=0)>>14,0!==g&&(m=o/g|0,p=l/g|0,m<7?m=7:m>16256&&(m=16256)),_=m-r>>3,C=p-h>>3,r+=6291456&d,E=d>>23,this.bv&&n){for(;A-- >0;)e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r=m,h=p,o+=c,l+=f,a+=u,o|=0,l|=0,g=(a|=0)>>14,0!==g&&(m=o/g|0,p=l/g|0,m<7?m=7:m>16256&&(m=16256)),_=m-r>>3,C=p-h>>3,r+=6291456&(d+=y),E=d>>23;for(A=i-t&7;A-- >0;)e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C}else{for(;A-- >0&&n;){let t;0!=(t=n[(16256&h)+(r>>7)]>>>E)&&(e[s]=t),s+=1,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,r=m,h=p,o+=c,l+=f,a+=u,o|=0,l|=0,g=(a|=0)>>14,0!==g&&(m=o/g|0,p=l/g|0,m<7?m=7:m>16256&&(m=16256)),_=m-r>>3,C=p-h>>3,r+=6291456&(d+=y),E=d>>23}for(A=i-t&7;A-- >0&&n;){let t;0!=(t=n[(16256&h)+(r>>7)]>>>E)&&(e[s]=t),s++,r+=_,h+=C}}};static Nv=(t,i,e,s,n)=>{if(this.pI&&(i>this.gI&&(i=this.gI),t<0&&(t=0)),t>=i)return;s+=t;let r=i-t>>2;if(0===this.alpha)for(;;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;e[s++]=n}e[s++]=n,e[s++]=n,e[s++]=n,e[s++]=n}const h=this.alpha,o=256-this.alpha;for(n=((16711935&n)*o>>8&16711935)+((65280&n)*o>>8&65280);;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280)}e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280)}};static kv=t=>{this._v[t]&&this.Iv&&(this.Iv[this.Cv++]=this._v[t],this._v[t]=null)};static Fv=t=>{if(this.Ev[t]=this.Wm++,this._v[t])return this._v[t];let i;if(this.Cv>0&&this.Iv)i=this.Iv[--this.Cv],this.Iv[this.Cv]=null;else{let t=0,e=-1;for(let i=0;i>>3)&16316671,i[n+8192]=r-(r>>>2)&16316671,i[n+12288]=r-(r>>>2)-(r>>>3)&16316671}}else{if(64===e.width)for(let t=0;t<128;t++)for(let n=0;n<128;n++)i[n+(t<<7)]=s[e.Rw[(n>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)i[t]=s[e.Rw[t]];this.Tv[t]=!1;for(let e=0;e<16384;e++){i[e]&=16316671;const s=i[e];0===s&&(this.Tv[t]=!0),i[e+16384]=s-(s>>>3)&16316671,i[e+32768]=s-(s>>>2)&16316671,i[e+49152]=s-(s>>>2)-(s>>>3)&16316671}}return i}}},880:(t,i,e)=>{e.d(i,{r:()=>n});var s=e(7854);const n=async t=>{255!==t[0]&&(t[0]=255),URL.revokeObjectURL(s.jE.src),s.jE.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>s.jE.onload=()=>t())),s.XE.clearRect(0,0,s.zE.width,s.zE.height);const i=s.jE.naturalWidth,e=s.jE.naturalHeight;return s.zE.width=i,s.zE.height=e,s.XE.drawImage(s.jE,0,0),s.XE.getImageData(0,0,i,e)}},8665:(t,i,e)=>{e.d(i,{A:()=>f});var s=e(1069),n=e(8950),r=e(4583),h=e(6730),o=e(4474),l=e(3867);class a{Vd=0;Mg=0;Uv=0;Pv=-1;Gv=-1;Wv=-1;Yv=-1;Hv=-1;Vv=-1;Kv=-1;Xv=-1;jv=-1;zv=0;Zv=-1;qv=-1;Jv=-1;data=null}class c{x=0;y=0;z=0;w=0}class f extends o.A{static metadata=null;static head=null;static $v=null;static Qv=null;static tb=null;static ib=null;static eb=null;static sb=null;static nb=null;static rb=null;static hb=null;static ob=null;static lb=null;static ab=null;static axis=null;static cb=new l.fe(4096,!1);static fb=new l.fe(4096,!1);static ub=new Int32Array(4096);static wb=new Int32Array(4096);static yb=new Int32Array(4096);static Ab=new Int32Array(4096);static mb=new Int32Array(4096);static pb=new Int32Array(4096);static gb=new Int32Array(1500);static Ib=new l.Xr(1500,512);static _b=new Int32Array(12);static Cb=new l.Xr(12,2e3);static Eb=new Int32Array(2e3);static vb=new Int32Array(2e3);static bb=new Int32Array(12);static Tb=new Int32Array(10);static Rb=new Int32Array(10);static Ob=new Int32Array(10);static Ir=0;static Lb=0;static _r=0;static Sb=!1;static Ml=0;static Dl=0;static xb=0;static kb=new Int32Array(1e3);static Mb=!1;static nc(t){try{f.head=new s.A(t.read('ob_head.dat')),f.$v=new s.A(t.read('ob_face1.dat')),f.Qv=new s.A(t.read('ob_face2.dat')),f.tb=new s.A(t.read('ob_face3.dat')),f.ib=new s.A(t.read('ob_face4.dat')),f.eb=new s.A(t.read('ob_face5.dat')),f.sb=new s.A(t.read('ob_point1.dat')),f.nb=new s.A(t.read('ob_point2.dat')),f.rb=new s.A(t.read('ob_point3.dat')),f.hb=new s.A(t.read('ob_point4.dat')),f.ob=new s.A(t.read('ob_point5.dat')),f.lb=new s.A(t.read('ob_vertex1.dat')),f.ab=new s.A(t.read('ob_vertex2.dat')),f.axis=new s.A(t.read('ob_axis.dat')),f.head.Mf=0,f.sb.Mf=0,f.nb.Mf=0,f.rb.Mf=0,f.hb.Mf=0,f.lb.Mf=0,f.ab.Mf=0;const i=f.head.Lu;f.metadata=new l.fe(i+100,null);let e=0,n=0,r=0,h=0,o=0,c=0,u=0;for(let t=0;t>7)<2?i=2:i>126&&(i=126),(65408&t)+i):(i<0?i=0:i>127&&(i=127),127-i)}static Hd=(t,i,e)=>{const s=t.Vd,n=t.Mg,r=t.Uv;let h,o,a,u,d;if(i){h=new Int32Array(s);for(let i=0;i{const n=t.Vd,r=t.Mg,h=t.Uv;let o,l,a,c,u;if(s)o=t.Kd,l=t.jd,a=t.Xd;else{o=new Int32Array(n),l=new Int32Array(n),a=new Int32Array(n);for(let i=0;i{const e=t.Vd,s=t.Mg,n=t.Uv,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e);for(let i=0;i{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,l=0,a=-1;for(let c=0;c{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,l=0,a=-1;for(let c=0;c{let o=-1;const l=t.Kd[i],a=t.jd[i],c=t.Xd[i];for(let t=0;t{if(!f.metadata)throw new Error('cant loading model metadata!!!!!');const i=f.metadata[t];if(!i)throw console.log(`Error model:${t} not found!`),new Error('cant loading model metadata!!!!!');if(!(f.head&&f.$v&&f.Qv&&f.tb&&f.ib&&f.eb&&f.sb&&f.nb&&f.rb&&f.hb&&f.ob&&f.lb&&f.ab&&f.axis))throw new Error('cant loading model!!!!!');const e=i.Vd,s=i.Mg,n=i.Uv,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e),l=new Int32Array(s),a=new Int32Array(s),c=new Int32Array(s),u=new Int32Array(n),d=new Int32Array(n),w=new Int32Array(n);let y=null;i.Hv>=0&&(y=new Int32Array(e));let A=null;i.jv>=0&&(A=new Int32Array(s));let m=null,p=0;i.zv>=0?m=new Int32Array(s):p=-i.zv-1;let g=null;i.Zv>=0&&(g=new Int32Array(s));let I=null;i.qv>=0&&(I=new Int32Array(s));const _=new Int32Array(s);f.sb.Mf=i.Pv,f.nb.Mf=i.Gv,f.rb.Mf=i.Wv,f.hb.Mf=i.Yv,f.ob.Mf=i.Hv;let C,E,v,b=0,T=0,R=0;for(let t=0;t{if(!f.metadata||!f.metadata[i])throw new Error('No model metadata');const e=f.metadata[i];if(e.data=t,!e.data.length)throw new Error('No model data');const n=e.Vd,r=e.Mg,h=e.Uv,o=new Int32Array(n),l=new Int32Array(n),a=new Int32Array(n),c=new Int32Array(r),u=new Int32Array(r),d=new Int32Array(r),w=new Int32Array(h),y=new Int32Array(h),A=new Int32Array(h);let m=null;e.Hv>=0&&(m=new Int32Array(n));let p=null;e.jv>=0&&(p=new Int32Array(r));let g=null,I=0;e.zv>=0?g=new Int32Array(r):I=-e.zv-1;let _=null;e.Zv>=0&&(_=new Int32Array(r));let C=null;e.qv>=0&&(C=new Int32Array(r));const E=new Int32Array(r),v=new s.A(e.data);v.Mf=e.Pv;const b=new s.A(e.data);b.Mf=e.Gv;const T=new s.A(e.data);T.Mf=e.Wv;const R=new s.A(e.data);R.Mf=e.Yv;const O=new s.A(e.data);O.Mf=e.Hv;let L,S,x,k=0,M=0,D=0;for(let t=0;tthis.iw&&(this.iw=-e),e>this.Rg&&(this.Rg=e);const n=i*i+s*s;n>this.xm&&(this.xm=n)}this.xm=Math.sqrt(this.xm)+.99|0,this.Kb=Math.sqrt(this.xm*this.xm+this.iw*this.iw)+.99|0,this.Vb=this.Kb+(Math.sqrt(this.xm*this.xm+this.Rg*this.Rg)+.99|0)}zd(){this.iw=0,this.Rg=0;for(let t=0;tthis.iw&&(this.iw=-i),i>this.Rg&&(this.Rg=i)}this.Kb=Math.sqrt(this.xm*this.xm+this.iw*this.iw)+.99|0,this.Vb=this.Kb+(Math.sqrt(this.xm*this.xm+this.Rg*this.Rg)+.99|0)}xa(){if(this.Xb){const t=new Int32Array(256);let i=0;for(let e=0;ei&&(i=s)}this.$d=new l.fe(i+1,null);for(let e=0;e<=i;e++)this.$d[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;ei&&(i=s)}this.Jd=new l.fe(i+1,null);for(let e=0;e<=i;e++)this.Jd[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;el;)l=e[o++];r&&r.types&&s.x&&s.y&&s.z&&r.labels&&(i!==l||0===r.types[i])&&this.Jb(s.x[t],s.y[t],s.z[t],r.labels[i],r.types[i])}f.Ir=0,f.Lb=0,f._r=0,o=0,l=e[o++];for(let t=0;tl;)l=e[o++];r&&r.types&&n.x&&n.y&&n.z&&r.labels&&(i===l||0===r.types[i])&&this.Jb(n.x[t],n.y[t],n.z[t],r.labels[i],r.types[i])}}else this.ka(t)}ka(t){if(!this.$d||-1===t||!h.A.Lo[t])return;const i=h.A.Lo[t],e=i.HE;f.Ir=0,f.Lb=0,f._r=0;for(let t=0;t>16;this.Xd[t]=this.jd[t]*i+this.Xd[t]*e>>16,this.jd[t]=s}}translate(t,i,e){for(let s=0;s>8;if(this.Fb&&this.Bb&&this.Ub||(this.Fb=new Int32Array(this.Mg),this.Bb=new Int32Array(this.Mg),this.Ub=new Int32Array(this.Mg)),!this.gg){this.gg=new l.fe(this.Vd,null);for(let t=0;t8192||m>8192||p>8192||A<-8192||m<-8192||p<-8192;)A>>=1,m>>=1,p>>=1;let g=0|Math.sqrt(A*A+m*m+p*p);if(g<=0&&(g=1),A=256*A/g|0,m=256*m/g|0,p=256*p/g|0,this.kg&&1&this.kg[i]){const r=t+((e*A+s*m+n*p)/(h+(h/2|0))|0);this.Yu&&(this.Fb[i]=f.Nb(this.Yu[i],r,this.kg[i]))}else{let t=this.gg[r];t&&(t.x+=A,t.y+=m,t.z+=p,t.w++),t=this.gg[o],t&&(t.x+=A,t.y+=m,t.z+=p,t.w++),t=this.gg[l],t&&(t.x+=A,t.y+=m,t.z+=p,t.w++)}}if(r)this.Cg(t,h,e,s,n);else{this.Tg=new l.fe(this.Vd,null);for(let t=0;t>16;for(let s=0;s>16,I=I*w-g*d>>16,g=p),0!==t&&(p=I*a-_*l>>16,_=I*l+_*a>>16,I=p),0!==i&&(p=_*c+g*u>>16,_=_*u-g*c>>16,g=p),g+=n,I+=h,_+=o,p=I*A-_*y>>16,_=I*y+_*A>>16,I=p,f.ub&&f.wb&&f.yb&&(f.yb[s]=_-m,f.ub[s]=r.A.ra+((g<<9)/_|0),f.wb[s]=r.A.ha+((I<<9)/_|0)),this.Uv>0&&f.Ab&&f.mb&&f.pb&&(f.Ab[s]=g,f.mb[s]=I,f.pb[s]=_)}try{this.tT(!1,!1,0)}catch(t){}}draw(t,i,e,s,h,o,l,a,c){const u=a*h-o*s>>16,d=l*i+u*e>>16,w=this.xm*e>>16,y=d+w;if(y<=50||d>=3500)return;const A=a*s+o*h>>16;let m=A-this.xm<<9;if((m/y|0)>=n.A.cv)return;let p=A+this.xm<<9;if((p/y|0)<=-n.A.cv)return;const g=l*e-u*i>>16,I=this.xm*i>>16;let _=g+I<<9;if((_/y|0)<=-n.A.fv)return;let C=g-(I+(this.iw*e>>16))<<9;if((C/y|0)>=n.A.fv)return;let E=d-(w+(this.iw*i>>16))<=50,v=!1;if(c>0&&f.Sb){let t=d-w;t<=50&&(t=50),A>0?(m=m/y|0,p=p/t|0):(p=p/y|0,m=m/t|0),g>0?(C=C/y|0,_=_/t|0):(_=_/y|0,C=C/t|0);const i=f.Ml-r.A.ra,e=f.Dl-r.A.ha;i>m&&iC&&e<_&&(this.yw?f.kb[f.xb++]=c:v=!0)}const b=r.A.ra,T=r.A.ha;let R=0,O=0;0!==t&&(R=r.A.sin[t],O=r.A.cos[t]);for(let n=0;n>16,w=w*O-c*R>>16,c=r),c+=o,u+=l,w+=a,r=w*s+c*h>>16,w=w*h-c*s>>16,c=r,r=u*e-w*i>>16,w=u*i+w*e>>16,u=r,f.yb&&(f.yb[n]=w-d),w>=50&&f.ub&&f.wb?(f.ub[n]=b+((c<<9)/w|0),f.wb[n]=T+((u<<9)/w|0)):f.ub&&(f.ub[n]=-5e3,E=!0),(E||this.Uv>0)&&f.Ab&&f.mb&&f.pb&&(f.Ab[n]=c,f.mb[n]=u,f.pb[n]=w)}try{this.tT(E,v,c)}catch(t){}}tT(t,i,e,s=!1){f.Mb&&(this.Zb=-1,this.qb=-1);for(let t=0;tn.A.gI||a>n.A.gI||c>n.A.gI),f.Ib&&f.gb){const t=((y+A+m)/3|0)+this.Kb;f.Ib[t][f.gb[t]++]=s,f.Mb&&this.iT(f.Ml,f.Dl,u,d,w,l,a,c)&&this.qb=0;t--){const i=f.gb[t];if(!(i<=0)&&f.Ib){const e=f.Ib[t];for(let t=0;t=0;t--){const i=f.gb[t];if(i>0&&f.Ib){const e=f.Ib[t];for(let s=0;s0||f._b[2]>0)&&(r=(f.bb[1]+f.bb[2])/(f._b[1]+f._b[2])|0);let h=0;f._b&&f.bb&&(f._b[3]>0||f._b[4]>0)&&(h=(f.bb[3]+f.bb[4])/(f._b[3]+f._b[4])|0);let o=0;if(f._b&&f.bb&&(f._b[6]>0||f._b[8]>0)&&(o=(f.bb[6]+f.bb[8])/(f._b[6]+f._b[8])|0),f._b&&f.Cb){let t,i=0,e=f._b[10],n=f.Cb[10],l=f.Eb;i===e&&(i=0,e=f._b[11],n=f.Cb[11],l=f.vb),t=ir;)this.eT(n[i++],s),i===e&&n!==f.Cb[11]&&(i=0,e=f._b[11],n=f.Cb[11],l=f.vb),t=ih;)this.eT(n[i++],s),i===e&&n!==f.Cb[11]&&(i=0,e=f._b[11],n=f.Cb[11],l=f.vb),t=io;)this.eT(n[i++],s),i===e&&n!==f.Cb[11]&&(i=0,e=f._b[11],n=f.Cb[11],l=f.vb),t=i>2,h=this.Wb[i],o=this.Yb[i],l=this.Hb[i];r.A.RI(f.ub[e],f.ub[s],f.ub[n],f.wb[e],f.wb[s],f.wb[n],this.Fb[t],this.Bb[t],this.Ub[t],f.Ab[h],f.mb[h],f.pb[h],f.Ab[o],f.Ab[l],f.mb[o],f.mb[l],f.pb[o],f.pb[l],this.Yu[t])}else if(3===h&&this.kg&&this.Yu&&this.Fb&&f.ub&&f.wb&&f.Ab&&f.mb&&f.pb){const i=this.kg[t]>>2,h=this.Wb[i],o=this.Yb[i],l=this.Hb[i];r.A.RI(f.ub[e],f.ub[s],f.ub[n],f.wb[e],f.wb[s],f.wb[n],this.Fb[t],this.Fb[t],this.Fb[t],f.Ab[h],f.mb[h],f.pb[h],f.Ab[o],f.Ab[l],f.mb[o],f.mb[l],f.pb[o],f.pb[l],this.Yu[t])}}sT(t,i=!1){let e=0;if(f.pb){const i=r.A.ra,s=r.A.ha,n=this.Dg[t],h=this.Ng[t],o=this.Fg[t],l=f.pb[n],a=f.pb[h],c=f.pb[o];if(l>=50&&f.ub&&f.wb&&this.Fb)f.Tb[e]=f.ub[n],f.Rb[e]=f.wb[n],f.Ob[e++]=this.Fb[t];else if(f.Ab&&f.mb&&this.Fb){const u=f.Ab[n],d=f.mb[n],w=this.Fb[t];if(c>=50&&this.Ub){const n=(50-l)*r.A.mv[c-l];f.Tb[e]=i+((u+((f.Ab[o]-u)*n>>16)<<9)/50|0),f.Rb[e]=s+((d+((f.mb[o]-d)*n>>16)<<9)/50|0),f.Ob[e++]=w+((this.Ub[t]-w)*n>>16)}if(a>=50&&this.Bb){const n=(50-l)*r.A.mv[a-l];f.Tb[e]=i+((u+((f.Ab[h]-u)*n>>16)<<9)/50|0),f.Rb[e]=s+((d+((f.mb[h]-d)*n>>16)<<9)/50|0),f.Ob[e++]=w+((this.Bb[t]-w)*n>>16)}}if(a>=50&&f.ub&&f.wb&&this.Bb)f.Tb[e]=f.ub[h],f.Rb[e]=f.wb[h],f.Ob[e++]=this.Bb[t];else if(f.Ab&&f.mb&&this.Bb){const u=f.Ab[h],d=f.mb[h],w=this.Bb[t];if(l>=50&&this.Fb){const h=(50-a)*r.A.mv[l-a];f.Tb[e]=i+((u+((f.Ab[n]-u)*h>>16)<<9)/50|0),f.Rb[e]=s+((d+((f.mb[n]-d)*h>>16)<<9)/50|0),f.Ob[e++]=w+((this.Fb[t]-w)*h>>16)}if(c>=50&&this.Ub){const n=(50-a)*r.A.mv[c-a];f.Tb[e]=i+((u+((f.Ab[o]-u)*n>>16)<<9)/50|0),f.Rb[e]=s+((d+((f.mb[o]-d)*n>>16)<<9)/50|0),f.Ob[e++]=w+((this.Ub[t]-w)*n>>16)}}if(c>=50&&f.ub&&f.wb&&this.Ub)f.Tb[e]=f.ub[o],f.Rb[e]=f.wb[o],f.Ob[e++]=this.Ub[t];else if(f.Ab&&f.mb&&this.Ub){const u=f.Ab[o],d=f.mb[o],w=this.Ub[t];if(a>=50&&this.Bb){const n=(50-c)*r.A.mv[a-c];f.Tb[e]=i+((u+((f.Ab[h]-u)*n>>16)<<9)/50|0),f.Rb[e]=s+((d+((f.mb[h]-d)*n>>16)<<9)/50|0),f.Ob[e++]=w+((this.Bb[t]-w)*n>>16)}if(l>=50&&this.Fb){const h=(50-c)*r.A.mv[l-c];f.Tb[e]=i+((u+((f.Ab[n]-u)*h>>16)<<9)/50|0),f.Rb[e]=s+((d+((f.mb[n]-d)*h>>16)<<9)/50|0),f.Ob[e++]=w+((this.Fb[t]-w)*h>>16)}}}const s=f.Tb[0],h=f.Tb[1],o=f.Tb[2],l=f.Rb[0],a=f.Rb[1],c=f.Rb[2];if(!((s-h)*(c-a)-(l-a)*(o-h)<=0))if(r.A.pI=!1,3===e){let e;if((s<0||h<0||o<0||s>n.A.gI||h>n.A.gI||o>n.A.gI)&&(r.A.pI=!0),e=this.kg?3&this.kg[t]:0,i)r.A._c(s,h,l,a,f.Ob[0]),r.A._c(h,o,a,c,f.Ob[1]),r.A._c(o,s,c,l,f.Ob[2]);else if(0===e)r.A.EI(s,h,o,l,a,c,f.Ob[0],f.Ob[1],f.Ob[2]);else if(1===e&&this.Fb)r.A.Dv(s,h,o,l,a,c,r.A.palette[this.Fb[t]]);else if(2===e&&this.kg&&this.Yu&&f.Ab&&f.mb&&f.pb){const i=this.kg[t]>>2,e=this.Wb[i],n=this.Yb[i],u=this.Hb[i];r.A.RI(s,h,o,l,a,c,f.Ob[0],f.Ob[1],f.Ob[2],f.Ab[e],f.mb[e],f.pb[e],f.Ab[n],f.Ab[u],f.mb[n],f.mb[u],f.pb[n],f.pb[u],this.Yu[t])}else if(3===e&&this.kg&&this.Yu&&this.Fb&&f.Ab&&f.mb&&f.pb){const i=this.kg[t]>>2,e=this.Wb[i],n=this.Yb[i],u=this.Hb[i];r.A.RI(s,h,o,l,a,c,this.Fb[t],this.Fb[t],this.Fb[t],f.Ab[e],f.mb[e],f.pb[e],f.Ab[n],f.Ab[u],f.mb[n],f.mb[u],f.pb[n],f.pb[u],this.Yu[t])}}else if(4===e){let e;if((s<0||h<0||o<0||s>n.A.gI||h>n.A.gI||o>n.A.gI||f.Tb[3]<0||f.Tb[3]>n.A.gI)&&(r.A.pI=!0),e=this.kg?3&this.kg[t]:0,i)r.A._c(s,h,l,a,f.Ob[0]),r.A._c(h,o,a,c,f.Ob[1]),r.A._c(o,f.Tb[3],c,f.Rb[3],f.Ob[2]),r.A._c(f.Tb[3],s,f.Rb[3],l,f.Ob[3]);else if(0===e)r.A.EI(s,h,o,l,a,c,f.Ob[0],f.Ob[1],f.Ob[2]),r.A.EI(s,o,f.Tb[3],l,c,f.Rb[3],f.Ob[0],f.Ob[2],f.Ob[3]);else if(1===e){if(this.Fb){const i=r.A.palette[this.Fb[t]];r.A.Dv(s,h,o,l,a,c,i),r.A.Dv(s,o,f.Tb[3],l,c,f.Rb[3],i)}}else if(2===e&&this.kg&&this.Yu&&f.Ab&&f.mb&&f.pb){const i=this.kg[t]>>2,e=this.Wb[i],n=this.Yb[i],u=this.Hb[i];r.A.RI(s,h,o,l,a,c,f.Ob[0],f.Ob[1],f.Ob[2],f.Ab[e],f.mb[e],f.pb[e],f.Ab[n],f.Ab[u],f.mb[n],f.mb[u],f.pb[n],f.pb[u],this.Yu[t]),r.A.RI(s,o,f.Tb[3],l,c,f.Rb[3],f.Ob[0],f.Ob[2],f.Ob[3],f.Ab[e],f.mb[e],f.pb[e],f.Ab[n],f.Ab[u],f.mb[n],f.mb[u],f.pb[n],f.pb[u],this.Yu[t])}else if(3===e&&this.kg&&this.Yu&&this.Fb&&f.Ab&&f.mb&&f.pb){const i=this.kg[t]>>2,e=this.Wb[i],n=this.Yb[i],u=this.Hb[i];r.A.RI(s,h,o,l,a,c,this.Fb[t],this.Fb[t],this.Fb[t],f.Ab[e],f.mb[e],f.pb[e],f.Ab[n],f.Ab[u],f.mb[n],f.mb[u],f.pb[n],f.pb[u],this.Yu[t]),r.A.RI(s,o,f.Tb[3],l,c,f.Rb[3],this.Fb[t],this.Fb[t],this.Fb[t],f.Ab[e],f.mb[e],f.pb[e],f.Ab[n],f.Ab[u],f.mb[n],f.mb[u],f.pb[n],f.pb[u],this.Yu[t])}}}Jb(t,i,e,s,n){if(!s)return;const h=s.length;if(0===n){let n=0;f.Ir=0,f.Lb=0,f._r=0;for(let t=0;t0?(f.Ir=(f.Ir/n|0)+t,f.Lb=(f.Lb/n|0)+i,f._r=(f._r/n|0)+e):(f.Ir=t,f.Lb=i,f._r=e)}else if(1===n)for(let n=0;n=this.$d.length)continue;const h=this.$d[r];if(h)for(let s=0;s=this.$d.length)continue;const o=this.$d[h];if(o)for(let s=0;s>16;this.jd[n]=this.jd[n]*u-this.Kd[n]*c>>16,this.Kd[n]=t}if(0!==h){c=r.A.sin[h],u=r.A.cos[h];const t=this.jd[n]*u-this.Xd[n]*c>>16;this.Xd[n]=this.jd[n]*c+this.Xd[n]*u>>16,this.jd[n]=t}if(0!==l){c=r.A.sin[l],u=r.A.cos[l];const t=this.Xd[n]*c+this.Kd[n]*u>>16;this.Xd[n]=this.Xd[n]*u-this.Kd[n]*c>>16,this.Kd[n]=t}this.Kd[n]+=f.Ir,this.jd[n]+=f.Lb,this.Xd[n]+=f._r}}else if(3===n)for(let n=0;n=this.$d.length)continue;const h=this.$d[r];if(h)for(let s=0;s=this.Jd.length)continue;const n=this.Jd[e];if(n)for(let i=0;i255&&(this.Gb[e]=255)}}}Qb(){this.iw=0,this.xm=0,this.Rg=0,this.Og=999999,this.Lg=-999999,this.xg=-99999,this.Sg=99999;for(let t=0;tthis.Lg&&(this.Lg=i),sthis.xg&&(this.xg=s),-e>this.iw&&(this.iw=-e),e>this.Rg&&(this.Rg=e);const n=i*i+s*s;n>this.xm&&(this.xm=n)}this.xm=0|Math.sqrt(this.xm),this.Kb=0|Math.sqrt(this.xm*this.xm+this.iw*this.iw),this.Vb=this.Kb+(0|Math.sqrt(this.xm*this.xm+this.Rg*this.Rg))}iT(t,i,e,s,n,r,h,o){return!(ie&&i>s&&i>n)&&(!(t{e.d(i,{A:()=>o});var s=e(8950),n=e(1069),r=e(4474),h=e(880);class o extends r.A{Rw;width;height;rT;hT;Fl;_w;constructor(t,i){super(),this.Rw=new Int32Array(t*i),this.width=this.Fl=t,this.height=this._w=i,this.rT=this.hT=0}static oT=async(t,i)=>{const e=t.read(i+'.dat');if(!e)throw new Error(`${i} jpeg not found!`);const s=await(0,h.r)(e),n=new o(s.width,s.height),r=new Uint32Array(s.data.buffer),l=n.Rw;for(let t=0;t>24&255)<<24|(255&i)<<16|(i>>8&255)<<8|i>>16&255}return n};static tc=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.Mf=s.Lu;const h=r.Lu,l=r.Lu,a=[],c=r.xu-1;for(let t=0;ts.length||r.Mf>r.length)throw new Error;const f=r.xu,u=r.xu,d=r.Lu,w=r.Lu,y=new o(d,w);y.rT=f,y.hT=u,y.Fl=h,y._w=l;const A=r.xu;if(0===A){const t=y.width*y.height;for(let i=0;is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,l+=i,o+=i}h>0&&r>0&&this.lT(h,r,this.Rw,n,l,s.A.Rw,e,o)}Nl(t,i,e){i|=0,e|=0;let n=(i+=this.rT)+(e+=this.hT)*s.A.Ow,r=0,h=this.height,o=this.width,l=s.A.Ow-o,a=0;if(es.A.bottom&&(h-=e+h-s.A.bottom),is.A.right){const t=i+o-s.A.right;o-=t,a+=t,l+=t}o>0&&h>0&&this.aT(o,h,this.Rw,r,a,s.A.Rw,n,l,t)}cT(t,i){t|=0,i|=0;let e=(t+=this.rT)+(i+=this.hT)*s.A.Ow,n=0,r=this.height,h=this.width,o=s.A.Ow-h,l=0;if(is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,l+=i,o+=i}h>0&&r>0&&this.fT(h,r,this.Rw,n,l,s.A.Rw,e,o)}uT(){const t=this.Rw,i=this.width,e=this.height;for(let s=0;s>16&255;r+=t,r<1?r=1:r>255&&(r=255);let h=n>>8&255;h+=i,h<1?h=1:h>255&&(h=255);let o=255&n;o+=e,o<1?o=1:o>255&&(o=255),this.Rw[s]=(r<<16)+(h<<8)+o}}}Pw(t,i,e,n){t|=0,i|=0,e|=0,n|=0;try{const r=this.width;let h=0,o=0;const l=this.Fl,a=this._w,c=(l<<16)/e|0,f=(a<<16)/n|0;t+=(this.rT*e+l-1)/l|0,i+=(this.hT*n+a-1)/a|0,this.rT*e%l!=0&&(h=(l-this.rT*e%l<<16)/e|0),this.hT*n%a!=0&&(o=(a-this.hT*n%a<<16)/n|0),e=e*(this.width-(h>>16))/l|0,n=n*(this.height-(o>>16))/a|0;let u=t+i*s.A.Ow,d=s.A.Ow-e;if(is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right){const i=t+e-s.A.right;e-=i,d+=i}this.scale(e,n,this.Rw,h,o,s.A.Rw,d,u,r,c,f)}catch(t){console.error('error in sprite clipping routine')}}wT(t,i,e,n,r,h,o,l,a,c){t|=0,i|=0,e|=0,n|=0;try{const f=-e/2|0,u=-n/2|0,d=65536*Math.sin(a/326.11)|0,w=65536*Math.cos(a/326.11)|0,y=d*c>>8,A=w*c>>8;let m=(o<<16)+u*y+f*A,p=u*A-f*y+(l<<16),g=t+i*s.A.Ow;for(let t=0;t>16)+(o>>16)*this.width],n+=A,o-=y;m+=y,p+=A,g+=s.A.Ow}}catch(t){}}yT(t,i,e){t|=0,i|=0;let n=(t+=this.rT)+(i+=this.hT)*s.A.Ow,r=0,h=this.height,o=this.width,l=s.A.Ow-o,a=0;if(is.A.bottom&&(h-=i+h-s.A.bottom),ts.A.right){const i=t+o-s.A.right;o-=i,a+=i,l+=i}o>0&&h>0&&this.AT(o,h,this.Rw,a,r,s.A.Rw,n,l,e.Rw)}scale(t,i,e,s,n,r,h,o,l,a,c){try{const f=s;for(let u=-i;u<0;u++){const i=(n>>16)*l;for(let n=-t;n<0;n++){const t=e[(s>>16)+i];0===t?o++:r[o++]=t,s+=a}n+=c,s=f,o+=h}}catch(t){console.error('error in plot_scale')}}fT(t,i,e,s,n,r,h,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++)r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++];for(let i=t;i<0;i++)r[h++]=e[s++];h+=o,s+=n}}aT(t,i,e,s,n,r,h,o,l){const a=256-l;for(let c=-i;c<0;c++){for(let i=-t;i<0;i++){const t=e[s++];if(0===t)h++;else{const i=r[h];r[h++]=((16711935&t)*l+(16711935&i)*a&4278255360)+((65280&t)*l+(65280&i)*a&16711680)>>8}}h+=o,s+=n}}lT(t,i,e,s,n,r,h,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=e[s++];0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=t}h+=o,s+=n}}AT(t,i,e,s,n,r,h,o,l){const a=-(t>>2);t=-(3&t);for(let c=-i;c<0;c++){for(let t=a;t<0;t++){let t=e[n++];0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++}for(let i=t;i<0;i++){const t=e[n++];0!==t&&0===l[h]?r[h++]=t:h++}h+=o,n+=s}}}},1673:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(8950),n=e(1069),r=e(4474);class h extends r.A{Rw;width;height;rT;hT;Fl;_w;palette;constructor(t,i,e){super(),this.Rw=new Int8Array(t*i),this.width=this.Fl=t,this.height=this._w=i,this.rT=this.hT=0,this.palette=e}static tc=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.Mf=s.Lu;const o=r.Lu,l=r.Lu,a=r.xu,c=new Int32Array(a);for(let t=1;ts.length||r.Mf>r.length)throw new Error;const f=r.xu,u=r.xu,d=r.Lu,w=r.Lu,y=new h(d,w,c);y.rT=f,y.hT=u,y.Fl=o,y._w=l;const A=y.Rw,m=r.xu;if(0===m){const t=y.width*y.height;for(let i=0;is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,l+=i,o+=i}h>0&&r>0&&this.mT(h,r,this.Rw,n,l,s.A.Rw,e,o)}uT(){const t=this.Rw,i=this.width,e=this.height;for(let s=0;s>16&255;n+=t,n<0?n=0:n>255&&(n=255);let r=this.palette[s]>>8&255;r+=i,r<0?r=0:r>255&&(r=255);let h=255&this.palette[s];h+=e,h<0?h=0:h>255&&(h=255),this.palette[s]=(n<<16)+(r<<8)+h}}Sv(){this.Fl|=0,this._w|=0,this.Fl/=2,this._w/=2,this.Fl|=0,this._w|=0;const t=new Int8Array(this.Fl*this._w);let i=0;for(let e=0;e>1)+(e+this.hT>>1)*this.Fl]=this.Rw[i++];this.Rw=t,this.width=this.Fl,this.height=this._w,this.rT=0,this.hT=0}Pw(){if(this.width===this.Fl&&this.height===this._w)return;const t=new Int8Array(this.Fl*this._w);let i=0;for(let e=0;e>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=e[s++];0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t]}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=this.palette[255&t]}h+=o,s+=n}}clip(t,i,e,n){try{const r=this.width;this.height;let h=0,o=0;const l=this.Fl,a=this._w,c=(l<<16)/e|0,f=(a<<16)/n|0;t=t+(this.rT*e+l-1)/l|0,i=i+(this.hT*n+a-1)/a|0,this.rT*e%l!=0&&(h=(l-this.rT*e%l<<16)/e|0),this.hT*n%a!=0&&(o=(a-this.hT*n%a<<16)/n|0),e=e*(this.width-(h>>16))/l|0,n=n*(this.height-(o>>16))/a|0;let u,d=t+i*s.A.Ow,w=s.A.Ow-e;is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right&&(u=t+e-s.A.right,e-=u,w+=u),this.pT(s.A.Rw,this.Rw,this.palette,h,o,d,w,e,n,c,f,r)}catch(t){console.log('error in sprite clipping routine')}}pT(t,i,e,s,n,r,h,o,l,a,c,f){try{const u=s;for(let d=-l;d<0;d++){const l=(n>>16)*f;for(let n=-o;n<0;n++){const n=i[(s>>16)+l];0==n?r++:t[r++]=e[255&n],s+=a}n+=c,s=u,r+=h}}catch(t){console.log('error in plot_scale')}}}},2682:(t,i,e)=>{e.d(i,{A:()=>l});var s=e(8950),n=e(1069),r=e(4474);class h{seed;constructor(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}gT(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}IT(){return this.next(32)}next(t){return this.seed=0x5deece66dn*this.seed+0xbn&(1n<<48n)-1n,Number(this.seed)>>>48-t}}var o=e(9298);class l extends r.A{static _T='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!"£$%^&*()-_=+[{]};:\'@#~,<.>/?\\| ';static CT=[];static{const t=navigator.userAgent.includes('Capacitor');for(let i=0;i<256;i++){let e=l._T.indexOf(String.fromCharCode(i));t&&e>=63&&e--,-1===e&&(e=74),l.CT[i]=e}}ET=[];vT=new Int32Array(94);bT=new Int32Array(94);TT=new Int32Array(94);RT=new Int32Array(94);OT=new Int32Array(95);LT=new Int32Array(256);random=new h(BigInt(Date.now()));height=0;static tc=(t,i)=>{const e=new n.A(t.read(i+'.dat')),s=new n.A(t.read('index.dat'));s.Mf=e.Lu+4;const r=s.xu;r>0&&(s.Mf+=3*(r-1));const h=new l;for(let t=0;t<94;t++){h.TT[t]=s.xu,h.RT[t]=s.xu;const i=h.vT[t]=s.Lu,n=h.bT[t]=s.Lu,r=s.xu,o=i*n;if(h.ET[t]=new Int8Array(o),0===r)for(let s=0;sh.height&&(h.height=n),h.TT[t]=1,h.OT[t]=i+2;{let e=0;for(let s=n/7|0;s=s.A.bottom&&(r-=e+r+1-s.A.bottom),i=s.A.right){const t=i+n+1-s.A.right;n-=t,a+=t,l+=t}n>0&&r>0&&this.BT(n,r,t,c,a,s.A.Rw,o,l,h)}DT(t,i,e,n,r,h,o){e|=0,n|=0;let l=(t|=0)+(i|=0)*s.A.Ow,a=s.A.Ow-e,c=0,f=0;if(i=s.A.bottom&&(n-=i+n+1-s.A.bottom),t=s.A.right){const i=t+e+1-s.A.right;e-=i,c+=i,a+=i}e>0&&n>0&&this.UT(e,n,s.A.Rw,l,a,o,f,c,r,h)}BT(t,i,e,s,n,r,h,o,l){const a=-((t|=0)>>2);t=-(3&t);for(let c=-(i|=0);c<0;c++){for(let t=a;t<0;t++)0===e[s++]?h++:r[h++]=l,0===e[s++]?h++:r[h++]=l,0===e[s++]?h++:r[h++]=l,0===e[s++]?h++:r[h++]=l;for(let i=t;i<0;i++)0===e[s++]?h++:r[h++]=l;h+=o,s+=n}}UT(t,i,e,s,n,r,h,o,l,a){t|=0;const c=((16711935&l)*a&4278255360)+((65280&l)*a&16711680)>>8,f=256-a;for(let l=-(i|=0);l<0;l++){for(let i=-t;i<0;i++)if(0===r[h++])s++;else{const t=e[s];e[s++]=(((16711935&t)*f&4278255360)+((65280&t)*f&16711680)>>8)+c}s+=n,h+=o}}xT(t){return'red'===t?o.A.RED:'gre'===t?o.A.GREEN:'blu'===t?o.A.BLUE:'yel'===t?o.A.Gl:'cya'===t?o.A.ZE:'mag'===t?o.A.Cm:'whi'===t?o.A.Il:'bla'===t?o.A.Pl:'lre'===t?o.A.qE:'dre'===t?o.A.JE:'dbl'===t?o.A.$E:'or1'===t?o.A.QE:'or2'===t?o.A.tv:'or3'===t?o.A.iv:'gr1'===t?o.A.ev:'gr2'===t?o.A.sv:'gr3'===t?o.A.nv:o.A.Pl}split(t,i){if(0===t.length)return[t];const e=[];for(;t.length>0;){if(this.kT(t)<=i&&-1===t.indexOf('|')){e.push(t);break}let s=t.length;for(let e=0;ei)break;s=e}else if('|'===t[e]){s=e;break}e.push(t.substring(0,s)),t=t.substring(s+1)}return e}}},1183:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(8950),n=e(7854);class r{PT;width;height;GT;WT;Rw;constructor(t,i,e=n.zo){this.GT=e,this.PT=this.GT.getImageData(0,0,t,i),this.WT=new Uint32Array(this.PT.data.buffer),this.Rw=new Int32Array(t*i),this.width=t,this.height=i,this.bind()}clear(){this.Rw.fill(0)}bind(){s.A.bind(this.Rw,this.width,this.height)}draw(t,i){this.#t(),this.GT.putImageData(this.PT,t,i)}#t(){const t=this.Rw.length,i=this.Rw,e=this.WT;for(let s=0;s>16&255|(t>>8&255)<<8|(255&t)<<16|4278190080}}}},4544:(t,i,e)=>{e.d(i,{A:()=>s});class s{db;constructor(t){t.onerror=this.onerror,t.onclose=this.onclose,this.db=t}static openDatabase=async()=>await new Promise(((t,i)=>{const e=indexedDB.open('lostcity',1);e.onsuccess=i=>{const e=i.target;console.log('database success!'),t(e.result)},e.onupgradeneeded=t=>{t.target.result.createObjectStore('cache')},e.onerror=t=>{const e=t.target;console.error('database error!: ',e.error),i(e.result)}}));Uo=async t=>await new Promise((i=>{const e=this.db.transaction('cache','readonly').objectStore('cache').get(t);e.onsuccess=()=>{i(e.result)},e.onerror=t=>{i(void 0)}}));Ho=async(t,i)=>await new Promise(((e,s)=>{const n=this.db.transaction('cache','readwrite').objectStore('cache').put(i,t);n.onsuccess=()=>{e()},n.onerror=t=>{s()}}));onclose=t=>{console.log('database close!')};onerror=t=>{console.log('database error!')};YT=t=>{const i=t.trim();let e=0;for(let t=0;t='A'&&s<='Z'?e+=s.charCodeAt(0)+1-65:s>='a'&&s<='z'?e+=s.charCodeAt(0)+1-97:s>='0'&&s<='9'&&(e+=s.charCodeAt(0)+27-48)}return e}}},2901:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(1908);class r{static YT=t=>{let i=0;t=t.toUpperCase();for(let e=0;e=this.VT)return null;if(this.ZT[t])return this.ZT[t];const i=this.zT[t],e=i+this.jT[t];if(this.HT){const s=Uint8Array.from(this.buffer.subarray(i,i+e));return this.ZT[t]=s,s}{const i=Uint8Array.from(n.A.read(this.XT[t],this.buffer,this.jT[t],this.zT[t]));return this.ZT[t]=i,i}}}},1069:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(9234),n=e(6666),r=e(4474);class h extends r.A{static JT=3988292384;static $T=new Int32Array(256);static QT=new Uint32Array(33);static tR=new n.A;static iR=new n.A;static eR=new n.A;static sR=0;static nR=0;static rR=0;static{for(let t=0;t<32;t++)h.QT[t]=(1<>>=1:i=i>>>1^h.JT;h.$T[t]=i}}static Po=t=>{let i=4294967295;for(let e=0;e>>8^h.$T[255&(i^t[e])];return~i};view;data;Mf=0;hR=0;random=null;constructor(t){if(!t)throw new Error('Input src packet array was null!');super(),t instanceof Int8Array?this.data=new Uint8Array(t):this.data=t,this.view=new DataView(this.data.buffer,this.data.byteOffset,this.data.byteLength)}get length(){return this.view.byteLength}get available(){return this.length-this.Mf}static Ut=t=>{let i=null;return 0===t&&h.sR>0?(h.sR--,i=h.tR.tI()):1===t&&h.nR>0?(h.nR--,i=h.iR.tI()):2===t&&h.rR>0&&(h.rR--,i=h.eR.tI()),i?(i.Mf=0,i):new h(0===t?new Uint8Array(100):1===t?new Uint8Array(5e3):new Uint8Array(3e4))};release(){this.Mf=0,100===this.view.byteLength&&h.sR<1e3?(h.tR.ZA(this),h.sR++):5e3===this.view.byteLength&&h.nR<250?(h.iR.ZA(this),h.nR++):3e4===this.view.byteLength&&h.rR<50&&(h.eR.ZA(this),h.rR++)}get xu(){return this.view.getUint8(this.Mf++)}get Yd(){return this.view.getInt8(this.Mf++)}get Lu(){const t=this.view.getUint16(this.Mf);return this.Mf+=2,t}get ku(){const t=this.view.getInt16(this.Mf);return this.Mf+=2,t}get rd(){const t=this.view.getUint8(this.Mf++)<<16|this.view.getUint16(this.Mf);return this.Mf+=2,t}get Ko(){const t=this.view.getInt32(this.Mf);return this.Mf+=4,t}get wE(){const t=this.view.getBigInt64(this.Mf);return this.Mf+=8,t}get VE(){return this.view.getUint8(this.Mf)<128?this.xu-64:this.Lu-49152}get Sm(){return this.view.getUint8(this.Mf)<128?this.xu:this.Lu-32768}get Nu(){const t=this.view,i=t.byteLength;let e,s='';for(;10!==(e=t.getUint8(this.Mf++))&&this.Mf>16),this.view.setUint16(this.Mf,t),this.Mf+=2}p4(t){this.view.setInt32(this.Mf,t),this.Mf+=4}cR(t){this.view.setInt32(this.Mf,t,!0),this.Mf+=4}fR(t){this.view.setBigInt64(this.Mf,t),this.Mf+=8}uR(t){const i=this.view,e=t.length;for(let s=0;s>>3,e=8-(7&this.hR),s=0;for(this.hR+=t;t>e;e=8)s+=(this.view.getUint8(i++)&h.QT[e])<>>e-t&h.QT[t],s}pR(t,i){const e=this.Mf;this.Mf=0;const n=new Uint8Array(e);this.oR(e,0,n);const r=(0,s.gR)(n),h=(0,s.IR)(r,i,t),o=(0,s._R)(h);this.Mf=0,this.p1(o.length),this.dR(o,o.length,0)}}},3937:(t,i,e)=>{e.d(i,{A:()=>o});class s{start=0;end=0;form=0;length=0;CR=null;ER=null;threshold=0;position=0;delta=0;amplitude=0;vR=0;read(t){this.form=t.xu,this.start=t.Ko,this.end=t.Ko,this.length=t.xu,this.CR=new Int32Array(this.length),this.ER=new Int32Array(this.length);for(let i=0;i=this.threshold&&this.ER&&this.CR&&(this.amplitude=this.ER[this.position++]<<15,this.position>=this.length&&(this.position=this.length-1),this.threshold=this.CR[this.position]/65536*t|0,this.threshold>this.vR&&(this.delta=((this.ER[this.position]<<15)-this.amplitude)/(this.threshold-this.vR)|0)),this.amplitude+=this.delta,this.vR++,this.amplitude-this.delta>>15}}class n{static buffer=null;static jA=null;static sin=null;static bR=new Int32Array(5);static TR=new Int32Array(5);static RR=new Int32Array(5);static OR=new Int32Array(5);static LR=new Int32Array(5);SR=null;xR=null;kR=null;MR=null;DR=null;NR=null;release=null;attack=null;FR=new Int32Array(5);BR=new Int32Array(5);UR=new Int32Array(5);start=0;length=500;PR=100;GR=0;static init=()=>{this.jA=new Int32Array(32768);for(let t=0;t<32768;t++)Math.random()>.5?this.jA[t]=1:this.jA[t]=-1;this.sin=new Int32Array(32768);for(let t=0;t<32768;t++)this.sin[t]=16384*Math.sin(t/5215.1903)|0;this.buffer=new Int32Array(220500)};WR(t,i){for(let i=0;i>1,h+=(i*s>>16)+r}if(this.DR&&this.NR){const i=this.DR.evaluate(t),e=this.NR.evaluate(t);c=c*(32768+(this.YR(e,a,this.DR.form)>>1))>>15,a+=(i*o>>16)+l}for(let s=0;s<5;s++)if(0!==this.FR[s]){const r=i+n.TR[s];r>15,n.bR[s],this.SR.form),n.bR[s]+=(e*n.OR[s]>>16)+n.LR[s])}}if(this.release&&this.attack){this.release.reset(),this.attack.reset();let i=0,e=!0;for(let s=0;s>8):this.release.start+((this.release.end-this.release.start)*h>>8),i+=256,i>=o&&(i=0,e=!e),e&&(n.buffer[s]=0)}}if(this.GR>0&&this.PR>0){const i=this.GR*e;for(let e=i;e32767&&(n.buffer[i]=32767);return n.buffer}YR(t,i,e){return 1===e?(32767&i)<16384?t:-t:2===e?n.sin[32767&i]*t>>14:3===e?((32767&i)*t>>14)-t:4===e?n.jA[i/2607&32767]*t:0}read(t){this.SR=new s,this.SR.read(t),this.xR=new s,this.xR.read(t),0!==t.xu&&(t.Mf--,this.kR=new s,this.kR.read(t),this.MR=new s,this.MR.read(t)),0!==t.xu&&(t.Mf--,this.DR=new s,this.DR.read(t),this.NR=new s,this.NR.read(t)),0!==t.xu&&(t.Mf--,this.release=new s,this.release.read(t),this.attack=new s,this.attack.read(t));for(let i=0;i<10;i++){const e=t.Sm;if(0===e)break;this.FR[i]=e,this.BR[i]=t.VE,this.UR[i]=t.Sm}this.GR=t.Sm,this.PR=t.Sm,this.length=t.Lu,this.start=t.Lu}}var r=e(1069),h=e(3867);class o{static HR=new Int32Array(1e3);static VR=null;static KR=null;static XR=new h.fe(1e3,null);jR=new h.fe(10,null);zR=0;loopEnd=0;static nc=t=>{const i=new r.A(t.read('sounds.dat'));for(this.VR=new Uint8Array(441e3),this.KR=new r.A(this.VR),n.init();;){const t=i.Lu;if(65535===t)break;const e=new o;e.read(i),this.XR[t]=e,this.HR[t]=e.trim()}};static WR=(t,i)=>{if(!this.XR[t])return null;const e=this.XR[t];return e?.ZR(i)??null};read(t){for(let i=0;i<10;i++)0!==t.xu&&(t.Mf--,this.jR[i]=new n,this.jR[i]?.read(t));this.zR=t.Lu,this.loopEnd=t.Lu}trim(){let t=9999999;for(let i=0;i<10;i++)this.jR[i]&&(this.jR[i].start/20|0)i&&(i=this.jR[t].length+this.jR[t].start);if(0===i)return 0;let e=22050*i/1e3|0,s=22050*this.zR/1e3|0,n=22050*this.loopEnd/1e3|0;(s<0||n<0||n>e||s>=n)&&(t=0);let r=e+(n-s)*(t-1);for(let t=44;t>8<<24>>24)}if(t>1){s+=44,n+=44,e+=44,r+=44;const i=r-e;for(let t=e-1;t>=n;t--)o.VR&&(o.VR[t+i]=o.VR[t]);for(let i=1;i{e.d(i,{ym:()=>a,wm:()=>o,fe:()=>s,Um:()=>n,Eh:()=>r,Dm:()=>h,Xr:()=>l});class s extends Array{constructor(t,i){super(t);for(let e=0;e{e.d(i,{_R:()=>o,Wo:()=>n,gR:()=>h,Yo:()=>s,Xa:()=>r,IR:()=>l});const s=async t=>new Promise((i=>setTimeout(i,t))),n=async t=>new Int8Array(await(await fetch(t)).arrayBuffer()),r=async t=>(await fetch(t)).text();function h(t){let i=0n;for(let e=0;e0n;)i.unshift(Number(0xffn&t)),t>>=8n;return 128&i[0]&&i.unshift(0),new Uint8Array(i)}function l(t,i,e){let s=1n;for(;i>0n;)i%2n===1n&&(s=s*t%e),t=t*t%e,i>>=1n;return s}},7953:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1069);class n{static qR=new Uint16Array(['d','o','t'].join('').split('').map((t=>t.charCodeAt(0))));static JR=new Uint16Array(['(','a',')'].join('').split('').map((t=>t.charCodeAt(0))));static $R=new Uint16Array(['s','l','a','s','h'].join('').split('').map((t=>t.charCodeAt(0))));static QR=['cook',"cook's",'cooks','seeks','sheet'];static tO=[];static iO=[];static eO=[];static sO=[];static nO=[];static rO=[];static nc=t=>{const i=new s.A(t.read('fragmentsenc.txt')),e=new s.A(t.read('badenc.txt')),n=new s.A(t.read('domainenc.txt')),r=new s.A(t.read('tldlist.txt'));this.read(e,n,i,r)};static filter=t=>{const i=[...t];this.format(i);const e=i.join('').trim(),s=e.toLowerCase(),n=[...s];this.hO(n),this.oO(n),this.lO(n),this.aO(n);for(let t=0;t{this.uO(t),this.dO(i),this.wO(e),this.yO(s)};static yO=t=>{const i=t.Ko;for(let e=0;et.xu))};static uO=t=>{const i=t.Ko;for(let e=0;et.xu));const i=new Array(t.xu).fill([]).map((()=>[t.Yd,t.Yd]));i.length>0&&(this.sO[e]=i)}};static dO=t=>{const i=t.Ko;for(let e=0;et.xu))};static wO=t=>{const i=t.Ko;for(let e=0;e{const i=[...t],e=[...t];this.AO(null,i,this.qR),this.AO(null,e,this.$R);for(let s=0;s{for(let i=0;i<2;i++)for(let i=this.eO.length-1;i>=0;i--)this.AO(this.sO[i],t,this.eO[i])};static lO=t=>{const i=[...t],e=[...t];this.AO(null,i,this.JR),this.AO(null,e,this.qR);for(let s=this.nO.length-1;s>=0;s--)this.pO(e,i,this.nO[s],t)};static aO=t=>{for(let i=0;i=0&&n{if(this.bO(t))return!0;const i=this.TO(t),e=this.rO,s=e.length;if(i===e[0]||i===e[s-1])return!0;let n=0,r=s-1;for(;n<=r;){const t=(n+r)/2|0;if(i===e[t])return!0;i{if(t.length>6)return 0;let i=0;for(let e=0;e{for(let e=i;e=0;e++)if(this.OO(t[e]))return e;return-1};static EO=(t,i)=>{for(let e=t;e=0;e++)if(!this.OO(i[e]))return e;return i.length};static LO=(t,i,e)=>i===e||'o'===i&&'0'===e?1:'o'===i&&'('===e&&')'===t?2:'c'!==i||'('!==e&&'<'!==e&&'['!==e?'e'===i&&'€'===e||'s'===i&&'$'===e||'l'===i&&'i'===e?1:0:1;static pO=(t,i,e,s)=>{const n=e.length,r=s.length;for(let h=0;h<=r-n;h++){const{SO:n,xO:r}=this.kO(h,e,s);if(!n)continue;const o=this.MO(h,s,3,i,['@']),l=this.DO(r-1,s,3,t,['.',',']);(o>2||l>2)&&this.CO(h,r,s)}};static kO=(t,i,e)=>{const s=i.length;let n=t,r=0;for(;n0)n+=l,r++;else{if(0===r)break;const e=this.LO(o,String.fromCharCode(i[r-1]),h);if(e>0)n+=e,1===r&&t++;else{if(r>=s||!this.IO(h))break;n++}}}return{SO:r>=s,xO:n}};static AO=(t,i,e)=>{if(!(e.length>i.length))for(let s=0;s<=i.length-e.length;s++){let n=s;const{xO:r,NO:h,FO:o,BO:l,UO:a}=this.PO(i,e,n);n=r;let c=i[n],f=n+1=e.length)||l&&a)continue;let u,d=!0;if(o){let t=!1,e=!1;if((s-1<0||this.IO(i[s-1])&&"'"!==i[s-1])&&(t=!0),(n>=i.length||this.IO(i[n])&&"'"!==i[n])&&(e=!0),!t||!e){let e=!1;for(u=s-2,t&&(u=s);!e&&u=0&&(!this.IO(i[u])||"'"===i[u])){const t=[];let s;for(s=0;s<3&&u+s=0&&(!this.IO(i[u-1])||"'"===i[u-1])&&(n=!1),n&&!this.vO(t)&&(e=!0)}u++}e||(d=!1)}}else{c=' ',s-1>=0&&(c=i[s-1]),f=' ',n{let s=e,n=0,r=0,h=!1,o=!1,l=!1;for(;s=t.length||o&&l);){const a=t[s],c=s+10)1===f&&this.OO(a)&&(o=!0),2===f&&(this.OO(a)||this.OO(c))&&(o=!0),s+=f,n++;else{if(0===n)break;let t;if((t=this.HO(c,String.fromCharCode(i[n-1]),a))>0)s+=t;else{if(n>=i.length||!this._O(a))break;if(this.IO(a)&&"'"!==a&&(h=!0),this.OO(a)&&(l=!0),s++,r++,(100*r/(s-e)|0)>90)break}}}return{xO:s,NO:n,FO:h,BO:o,UO:l}};static HO=(t,i,e)=>{if(i===e)return 1;if(i>='a'&&i<='m'){if('a'===i)return'4'!==e&&'@'!==e&&'^'!==e?'/'===e&&'\\'===t?2:0:1;if('b'===i)return'6'!==e&&'8'!==e?'1'===e&&'3'===t?2:0:1;if('c'===i)return'('!==e&&'<'!==e&&'{'!==e&&'['!==e?0:1;if('d'===i)return'['===e&&')'===t?2:0;if('e'===i)return'3'!==e&&'€'!==e?0:1;if('f'===i)return'p'===e&&'h'===t?2:'£'===e?1:0;if('g'===i)return'9'!==e&&'6'!==e?0:1;if('h'===i)return'#'===e?1:0;if('i'===i)return'y'!==e&&'l'!==e&&'j'!==e&&'1'!==e&&'!'!==e&&':'!==e&&';'!==e&&'|'!==e?0:1;if('j'===i)return 0;if('k'===i)return 0;if('l'===i)return'1'!==e&&'|'!==e&&'i'!==e?0:1;if('m'===i)return 0}if(i>='n'&&i<='z'){if('n'===i)return 0;if('o'===i)return'0'!==e&&'*'!==e?'('===e&&')'===t||'['===e&&']'===t||'{'===e&&'}'===t||'<'===e&&'>'===t?2:0:1;if('p'===i)return 0;if('q'===i)return 0;if('r'===i)return 0;if('s'===i)return'5'!==e&&'z'!==e&&'$'!==e&&'2'!==e?0:1;if('t'===i)return'7'!==e&&'+'!==e?0:1;if('u'===i)return'v'===e?1:'\\'===e&&'/'===t||'\\'===e&&'|'===t||'|'===e&&'/'===t?2:0;if('v'===i)return'\\'===e&&'/'===t||'\\'===e&&'|'===t||'|'===e&&'/'===t?2:0;if('w'===i)return'v'===e&&'v'===t?2:0;if('x'===i)return')'===e&&'('===t||'}'===e&&'{'===t||']'===e&&'['===t||'>'===e&&'<'===t?2:0;if('y'===i)return 0;if('z'===i)return 0}return i>='0'&&i<='9'?'0'===i?'o'===e||'O'===e?1:'('===e&&')'===t||'{'===e&&'}'===t||'['===e&&']'===t?2:0:'1'===i&&'l'===e?1:0:','===i?'.'===e?1:0:'.'===i?','===e?1:0:'!'===i&&'i'===e?1:0};static WO=(t,i,e)=>{let s=0,n=i.length-1;for(;s<=n;){const r=(s+n)/2|0;if(i[r][0]===t&&i[r][1]===e)return!0;tthis.RO(t)?t.charCodeAt(0)+1-'a'.charCodeAt(0):"'"===t?28:this.OO(t)?t.charCodeAt(0)+29-'0'.charCodeAt(0):27;static mO=(t,i,e,s,n)=>{if(!(s.length>e.length))for(let r=0;r<=e.length-s.length;r++){const{xO:h,VO:o}=this.KO(e,s,r);if(o0&&c>0&&(l=!0),2===i&&(a>2&&c>0||a>0&&c>2)&&(l=!0),3===i&&a>0&&c>2&&(l=!0),!l)continue;let f,u=r,d=h-1,w=!1;if(a>2){if(4===a)for(w=!1,f=r-1;f>=0;f--)if(w){if('*'!==n[f])break;u=f}else'*'===n[f]&&(u=f,w=!0);for(w=!1,f=u-1;f>=0;f--)if(w){if(this.IO(e[f]))break;u=f}else this.IO(e[f])||(w=!0,u=f)}if(c>2){if(4===c)for(w=!1,f=d+1;f{let s=0;for(;e0)e+=h,s++;else{if(0===s)break;let t;if((t=this.LO(r,String.fromCharCode(i[s-1]),n))>0)e+=t;else{if(!this.IO(n))break;e++}}}return{xO:e,VO:s}};static IO=t=>!this.YO(t)&&!this.OO(t);static _O=t=>!this.RO(t)||('v'===t||'x'===t||'j'===t||'q'===t||'z'===t);static YO=t=>this.RO(t)||this.XO(t);static OO=t=>t>='0'&&t<='9';static RO=t=>t>='a'&&t<='z';static XO=t=>t>='A'&&t<='Z';static bO=t=>{for(let i=0;i{for(let s=t;s{let e=0;for(let s=i-1;s>=0&&this.IO(t[s]);s--)'*'===t[s]&&e++;return e};static zO=(t,i)=>{let e=0;for(let s=i+1;s(n?this.jO(i,e):this.zO(i,e))>=s?4:this.IO(n?t[e-1]:t[e+1])?1:0;static MO=(t,i,e,s,n)=>{if(0===t)return 2;for(let e=t-1;e>=0&&this.IO(i[e]);e--)if(n.includes(i[e]))return 3;return this.ZO(i,s,t,e,!0)};static DO=(t,i,e,s,n)=>{if(t+1===i.length)return 2;for(let e=t+1;e{let i=0;for(let e=0;et>=' '&&t<=''||' '===t||'\n'===t||'\t'===t||'£'===t||'€'===t;static cO=(t,i)=>{for(let e=0;e{let i=!0;for(let e=0;e{e.d(i,{A:()=>n});var s=e(9763);class n{static JO=null;static load=async t=>{this.JO=await(0,s.F)(new WebAssembly.Module(t),{env:void 0})};static read=(t,i,e,s)=>{if(!this.JO)throw new Error('bz2 not found!!');return Int8Array.from(this.JO.read(t,i,e,s))}}},123:(t,i,e)=>{function s(t,i){window._tinyMidiPlay&&window._tinyMidiPlay(t,i/256)}function n(){window._tinyMidiStop&&window._tinyMidiStop()}e.d(i,{Xo:()=>s,Ro:()=>n})},9763:(t,i,e)=>{async function s(t,i={}){const e={env:Object.assign(Object.create(globalThis),i.env||{},{abort(t,i,e,s){t=h(t>>>0),i=h(i>>>0),e>>>=0,s>>>=0,(()=>{throw Error(`${t} in ${i}:${e}:${s}`)})()}})},{exports:s}=await WebAssembly.instantiate(t,e),n=s.memory||i.env.memory,r=Object.setPrototypeOf({read:(t,i,e,r)=>(i=function(t,i,e,r,h){if(null==r)return 0;const o=r.length,l=s.__pin(s.__new(o<>>0;if(h)new h(n.buffer,l,o).set(r);else for(let i=0;i>>0),r[i]);return s.__unpin(l),l}(l,6,0,i,Int8Array)||function(){throw TypeError("value must not be null")}(),function(t,i,e){if(!e)return null;const s=function(t){try{return o.getUint32(t,!0)}catch{return o=new DataView(n.buffer),o.getUint32(t,!0)}}(e-4)>>>i,r=new Array(s);for(let n=0;n>>0));return r}(a,0,s.read(t,i,e,r)>>>0))},s);function h(t){if(!t)return null;const i=t+new Uint32Array(n.buffer)[t-4>>>2]>>>1,e=new Uint16Array(n.buffer);let s=t>>>1,r="";for(;i-s>1024;)r+=String.fromCharCode(...e.subarray(s,s+=1024));return r+String.fromCharCode(...e.subarray(s,i))}let o=new DataView(n.buffer);function l(t,i){try{o.setUint8(t,i,!0)}catch{o=new DataView(n.buffer),o.setUint8(t,i,!0)}}function a(t){try{return o.getInt8(t,!0)}catch{return o=new DataView(n.buffer),o.getInt8(t,!0)}}return r}e.d(i,{F:()=>s})},9896:(t,i,e)=>{var s=e(8151);!function(){window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioContext&&(window.audioContext=new window.AudioContext);var t=function(i){if(window.audioContext){var e=window.audioContext.createBuffer(1,1,22050),s=window.audioContext.createBufferSource();s.buffer=e,s.connect(window.audioContext.destination),s.start?s.start(0):s.play?s.play(0):s.noteOn&&s.noteOn(0)}document.removeEventListener('touchstart',t),document.removeEventListener('touchend',t),document.removeEventListener('click',t)};document.addEventListener('touchstart',t),document.addEventListener('touchend',t),document.addEventListener('click',t)}(),(async()=>{let t=new Float32Array,i=window.audioContext.createGain();i.gain.value=.1,i.connect(window.audioContext.destination);let e=window.audioContext.currentTime,n=[];const r=new s.A({$O:30,QO:i=>{let e=new Float32Array(i.buffer),s=new Float32Array(t.length+e.length);s.set(t,0),s.set(e,t.length),t=s},tL:t=>{},bufferSize:102400});await r.init();const h=await fetch('./SCC1_Florestan.sf2'),o=new Uint8Array(await h.arrayBuffer());function l(){if(!window.audioContext||!t.length)return;let s=window.audioContext.createBufferSource();const r=t.length/2,h=window.audioContext.createBuffer(2,r,44100);for(let i=0;i<2;i++){const e=h.getChannelData(i);let s=i;for(let i=0;i{if(a&&clearInterval(a),t=new Float32Array,n.length){let t=i.gain.value;i.gain.value=0,n.forEach((t=>{t.stop(window.audioContext.currentTime)})),n=[],i.gain.value=t}},window._tinyMidiVolume=(t=1)=>{i.gain.value=t},window._tinyMidiPlay=async(t,i=1)=>{t&&(await window._tinyMidiStop(),-1!=i&&window._tinyMidiVolume(i),e=window.audioContext.currentTime,a=setInterval(l,250),r.eL(t))}})()},8151:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5473);const n=class{constructor(t={}){this.sL=void 0,this.nL=0,this.rL=0,this.hL=0,this.$O=t.$O||100,this.sampleRate=t.sampleRate||44100,this.oL=t.oL||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.lL(1),this.QO=t.QO||(()=>{}),this.tL=t.tL||(()=>{}),this.aL=void 0,this.test=0}async init(){if(!this.sL){if('undefined'!=typeof process){const{cL:t}=await import('path'),{fL:i}=await import('module');globalThis.__dirname=t("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js"),globalThis.require=i("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js")}this.sL=await(0,s.A)(),this.uL=this.sL._malloc(this.bufferSize),this.dL=this.sL._malloc(8)}}lL(t){this.bufferSize=4*this.sampleRate*this.oL*t}wL(){if(!this.sL)throw new Error(`${this.constructor.name} not initalized. call .init()`)}iL(t){this.wL();const{_malloc:i,_free:e,_tsf_load_memory:s,_tsf_set_output:n,_tsf_channel_set_bank_preset:r,_tsf_set_max_voices:h,_tsf_channel_set_presetnumber:o}=this.sL;e(this.nL),this.nL=i(t.length),this.sL.HEAPU8.set(t,this.nL),this.rL=s(this.nL,t.length),n(this.rL,2===this.oL?0:2,this.sampleRate,this.gain)}yL(){this.wL();const t=new Uint8Array(this.bufferSize);return t.set(this.sL.HEAPU8.subarray(this.uL,this.uL+this.bufferSize)),t}AL(t){const{_malloc:i,_free:e,_tml_load_memory:s}=this.sL;return e(this.hL),this.hL=i(t.length),this.sL.HEAPU8.set(t,this.hL),s(this.hL,t.length)}mL(t){const{_midi_render:i}=this.sL;return i(this.rL,t,this.oL,this.sampleRate,this.uL,this.bufferSize,this.dL)}eL(t){if(this.wL(),!this.rL)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.aL);const{setValue:i,getValue:e}=this.sL;i(this.dL,0,'double'),this.sL._tsf_reset(this.rL),this.sL._tsf_channel_set_bank_preset(this.rL,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let s=this.AL(t);const n=()=>{s=this.mL(s);const t=this.yL();this.QO(t),s?this.aL=setTimeout(n,this.$O):this.tL(e(this.dL,'double'))};this.aL=setTimeout(n,16)}}},8227:(t,i,e)=>{t.exports=e.p+"9f86b5397894e28b5ae2.wasm"},5473:(t,i,e)=>{var s;e.d(i,{A:()=>n});const n=(s="file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/tinymidipcm.mjs",function(t){var i,n,r=void 0!==(t=t||{})?t:{};r.ready=new Promise((function(t,e){i=t,n=e})),["_tsf_load_memory","_tsf_set_output","_tsf_channel_set_bank_preset","_tsf_set_max_voices","_tsf_channel_set_presetnumber","_tsf_reset","_tsf_close","_tml_load_memory","_midi_render","_malloc","_realloc","_free","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(r.ready,t)||Object.defineProperty(r.ready,t,{get:()=>j('You are getting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),set:()=>j('You are setting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js')})}));var h=Object.assign({},r),o=[],l='object'==typeof window,a='function'==typeof importScripts,c='object'==typeof process&&'object'==typeof process.versions&&'string'==typeof process.versions.node,f=!l&&!c&&!a;if(r.ENVIRONMENT)throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');var u,d,w,y='';if(c){if('undefined'==typeof process||!process.release||'node'!==process.release.name)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');var A,m;y=a?require('path').cL(y)+'/':__dirname+'/';var p=()=>{m||(A=require('fs'),m=require('path'))};u=(t,i)=>(p(),t=m.normalize(t),A.pL(t,i?void 0:'utf8')),w=t=>{var i=u(t,!0);return i.buffer||(i=new Uint8Array(i)),D(i.buffer),i},d=(t,i,e)=>{p(),t=m.normalize(t),A.gL(t,(function(t,s){t?e(t):i(s.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,'/'),o=process.argv.slice(2),process.on('uncaughtException',(function(t){if(!(t instanceof nt))throw t})),process.on('unhandledRejection',(function(t){throw t})),r.inspect=function(){return'[Emscripten Module object]'}}else if(f){if('object'==typeof process&&'function'==typeof require||'object'==typeof window||'function'==typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');'undefined'!=typeof read&&(u=function(t){return read(t)}),w=function(t){let i;return'function'==typeof readbuffer?new Uint8Array(readbuffer(t)):(i=read(t,'binary'),D('object'==typeof i),i)},d=function(t,i,e){setTimeout((()=>i(w(t))),0)},'undefined'!=typeof scriptArgs?o=scriptArgs:void 0!==arguments&&(o=arguments),'undefined'!=typeof print&&('undefined'==typeof console&&(console={}),console.log=print,console.warn=console.error='undefined'!=typeof printErr?printErr:print)}else{if(!l&&!a)throw new Error('environment detection error');if(a?y=self.location.href:'undefined'!=typeof document&&document.currentScript&&(y=document.currentScript.src),s&&(y=s),y=0!==y.indexOf('blob:')?y.substr(0,y.replace(/[?#].*/,"").lastIndexOf('/')+1):'','object'!=typeof window&&'function'!=typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');u=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.send(null),i.responseText},a&&(w=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.responseType='arraybuffer',i.send(null),new Uint8Array(i.response)}),d=(t,i,e)=>{var s=new XMLHttpRequest;s.open('GET',t,!0),s.responseType='arraybuffer',s.onload=()=>{200==s.status||0==s.status&&s.response?i(s.response):e()},s.onerror=e,s.send(null)}}r.print||console.log.bind(console);var g,I,_=r.printErr||console.warn.bind(console);function C(t,i){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){j('Module.'+t+' has been replaced with plain '+i+' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')}})}function E(t){return'FS_createPath'===t||'FS_createDataFile'===t||'FS_createPreloadedFile'===t||'FS_unlink'===t||'addRunDependency'===t||'FS_createLazyFile'===t||'FS_createDevice'===t||'removeRunDependency'===t}Object.assign(r,h),h=null,g='fetchSettings',Object.getOwnPropertyDescriptor(r,g)&&j('`Module.'+g+'` was supplied but `'+g+'` not included in INCOMING_MODULE_JS_API'),r.arguments&&(o=r.arguments),C('arguments','arguments_'),r.thisProgram&&r.thisProgram,C('thisProgram','thisProgram'),r.quit&&r.quit,C('quit','quit_'),D(void 0===r.memoryInitializerPrefixURL,'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.pthreadMainPrefixURL,'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.cdInitializerPrefixURL,'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.filePackagePrefixURL,'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.read,'Module.read option was removed (modify read_ in JS)'),D(void 0===r.readAsync,'Module.readAsync option was removed (modify readAsync in JS)'),D(void 0===r.readBinary,'Module.readBinary option was removed (modify readBinary in JS)'),D(void 0===r.setWindowTitle,'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'),D(void 0===r.TOTAL_MEMORY,'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'),C('read','read_'),C('readAsync','readAsync'),C('readBinary','readBinary'),C('setWindowTitle','setWindowTitle'),D(!f,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),r.wasmBinary&&(I=r.wasmBinary),C('wasmBinary','wasmBinary');var v;r.noExitRuntime;C('noExitRuntime','noExitRuntime'),'object'!=typeof WebAssembly&&j('no native wasm support detected');var b,T,R,O,L,S,x,k,M=!1;function D(t,i){t||j('Assertion failed'+(i?': '+i:''))}function N(t){b=t,r.HEAP8=T=new Int8Array(t),r.HEAP16=O=new Int16Array(t),r.HEAP32=L=new Int32Array(t),r.HEAPU8=R=new Uint8Array(t),r.HEAPU16=new Uint16Array(t),r.HEAPU32=S=new Uint32Array(t),r.HEAPF32=x=new Float32Array(t),r.HEAPF64=k=new Float64Array(t)}'undefined'!=typeof TextDecoder&&new TextDecoder('utf8');var F=5242880;r.TOTAL_STACK&&D(F===r.TOTAL_STACK,'the stack size can no longer be determined at runtime');var B=r.INITIAL_MEMORY||16777216;function U(){if(!M){var t=ft(),i=S[t>>2],e=S[t+4>>2];34821223==i&&2310721022==e||j('Stack overflow! Stack cookie has been overwritten at 0x'+t.toString(16)+', expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+e.toString(16)+' 0x'+i.toString(16)),1668509029!==S[0]&&j('Runtime error: The application has corrupted its heap memory area (address zero)!')}}C('INITIAL_MEMORY','INITIAL_MEMORY'),D(B>=F,'INITIAL_MEMORY should be larger than TOTAL_STACK, was '+B+'! (TOTAL_STACK='+F+')'),D('undefined'!=typeof Int32Array&&'undefined'!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,'JS engine does not provide full typed array support'),D(!r.wasmMemory,'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'),D(16777216==B,'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'),function(){var t=new Int16Array(1),i=new Int8Array(t.buffer);if(t[0]=25459,115!==i[0]||99!==i[1])throw'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'}();var P=[],G=[],W=[],Y=!1;D(Math.imul,'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.fround,'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.clz32,'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.trunc,'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');var H=0,V=null,K=null,X={};function j(t){r.onAbort&&r.onAbort(t),_(t='Aborted('+t+')'),M=!0;var i=new WebAssembly.RuntimeError(t);throw n(i),i}var z={error:function(){j('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM')},init:function(){z.error()},IL:function(){z.error()},_L:function(){z.error()},CL:function(){z.error()},open:function(){z.error()},EL:function(){z.error()},vL:function(){z.error()},bL:function(){z.error()},TL:function(){z.error()},RL:function(){z.error()}};r.FS_createDataFile=z.IL,r.FS_createPreloadedFile=z._L;var Z,q,J,$,Q='data:application/octet-stream;base64,';function tt(t){return t.startsWith(Q)}function it(t){return t.startsWith('file://')}function et(t,i){return function(){var e=t,s=i;return i||(s=r.asm),D(Y,'native function `'+e+'` called before runtime initialization'),s[t]||D(s[t],'exported native function `'+e+'` not found'),s[t].apply(null,arguments)}}function st(t){try{if(t==Z&&I)return new Uint8Array(I);if(w)return w(t);throw"both async and sync fetching of the wasm failed"}catch(t){j(t)}}function nt(t){this.name='ExitStatus',this.message='Program terminated with exit('+t+')',this.status=t}function rt(t){for(;t.length>0;)t.shift()(r)}function ht(t){ht.OL||(ht.OL={}),ht.OL[t]||(ht.OL[t]=1,c&&(t='warning: '+t),_(t))}function ot(t){try{return v.LL(t-b.byteLength+65535>>>16),N(v.buffer),1}catch(i){_('emscripten_realloc_buffer: Attempted to grow heap from '+b.byteLength+' bytes to '+t+' bytes, but got error: '+i)}}r.locateFile?tt(Z='tinymidipcm.wasm')||(q=Z,Z=r.locateFile?r.locateFile(q,y):y+q):Z=new URL(e(8227),e.b).toString();var lt,at={"emscripten_memcpy_big":function(t,i,e){R.copyWithin(t,i,i+e)},"emscripten_resize_heap":function(t){var i=R.length;D((t>>>=0)>i);var e,s,n=2147483648;if(t>n)return _('Cannot enlarge memory, asked to go up to '+t+' bytes, but the limit is '+n+' bytes!'),!1;for(var r=1;r<=4;r*=2){var h=i*(1+.2/r);h=Math.min(h,t+100663296);var o=Math.min(n,(e=Math.max(t,h))+((s=65536)-e%s)%s);if(ot(o))return!0}return _('Failed to grow the heap from '+i+' bytes to '+o+' bytes, not enough memory!'),!1}},ct=(function(){var t,i={'env':at,'wasi_snapshot_preview1':at};function e(t,i){var e,s=t.exports;r.asm=s,D(v=r.asm.memory,"memory not found in wasm exports"),N(v.buffer),D(r.asm.__indirect_function_table,"table not found in wasm exports"),e=r.asm.__wasm_call_ctors,G.unshift(e),function(t){if(H--,r.monitorRunDependencies&&r.monitorRunDependencies(H),t?(D(X[t]),delete X[t]):_('warning: run dependency removed without ID'),0==H&&(null!==V&&(clearInterval(V),V=null),K)){var i=K;K=null,i()}}('wasm-instantiate')}t='wasm-instantiate',H++,r.monitorRunDependencies&&r.monitorRunDependencies(H),t?(D(!X[t]),X[t]=1,null===V&&'undefined'!=typeof setInterval&&(V=setInterval((function(){if(M)return clearInterval(V),void(V=null);var t=!1;for(var i in X)t||(t=!0,_('still waiting on run dependencies:')),_('dependency: '+i);t&&_('(end of list)')}),1e4))):_('warning: run dependency added without ID');var s=r;function h(t){D(r===s,'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'),s=null,e(t.instance)}function o(t){return function(){if(!I&&(l||a)){if('function'==typeof fetch&&!it(Z))return fetch(Z,{credentials:'same-origin'}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+Z+"'";return t.arrayBuffer()})).catch((function(){return st(Z)}));if(d)return new Promise((function(t,i){d(Z,(function(i){t(new Uint8Array(i))}),i)}))}return Promise.resolve().then((function(){return st(Z)}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){_('failed to asynchronously prepare wasm: '+t),it(Z)&&_('warning: Loading from a file URI ('+Z+') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing'),j(t)}))}if(r.instantiateWasm)try{return r.instantiateWasm(i,e)}catch(t){_('Module.instantiateWasm callback failed with error: '+t),n(t)}(I||'function'!=typeof WebAssembly.instantiateStreaming||tt(Z)||it(Z)||c||'function'!=typeof fetch?o(h):fetch(Z,{credentials:'same-origin'}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(h,(function(t){return _('wasm streaming compile failed: '+t),_('falling back to ArrayBuffer instantiation'),o(h)}))}))).catch(n)}(),r.___wasm_call_ctors=et("__wasm_call_ctors"),r._malloc=et("malloc"),r._free=et("free"),r._tsf_load_memory=et("tsf_load_memory"),r._tsf_close=et("tsf_close"),r._tsf_reset=et("tsf_reset"),r._tsf_set_output=et("tsf_set_output"),r._tsf_set_max_voices=et("tsf_set_max_voices"),r._realloc=et("realloc"),r._tsf_channel_set_presetnumber=et("tsf_channel_set_presetnumber"),r._tsf_channel_set_bank_preset=et("tsf_channel_set_bank_preset"),r._tml_load_memory=et("tml_load_memory"),r._midi_render=et("midi_render"),r.___errno_location=et("__errno_location"),r._fflush=et("fflush"),r._emscripten_stack_init=function(){return(ct=r._emscripten_stack_init=r.asm.emscripten_stack_init).apply(null,arguments)}),ft=(r._emscripten_stack_get_free=function(){return(r._emscripten_stack_get_free=r.asm.emscripten_stack_get_free).apply(null,arguments)},r._emscripten_stack_get_base=function(){return(r._emscripten_stack_get_base=r.asm.emscripten_stack_get_base).apply(null,arguments)},r._emscripten_stack_get_end=function(){return(ft=r._emscripten_stack_get_end=r.asm.emscripten_stack_get_end).apply(null,arguments)});function ut(){var t;ct(),D(!(3&(t=ft()))),S[t>>2]=34821223,S[t+4>>2]=2310721022,S[0]=1668509029}function dt(t){function e(){lt||(lt=!0,r.calledRun=!0,M||(D(!Y),Y=!0,U(),rt(G),i(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),D(!r._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(U(),r.postRun)for('function'==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)t=r.postRun.shift(),W.unshift(t);var t;rt(W)}()))}t=t||o,H>0||(ut(),function(){if(r.preRun)for('function'==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)t=r.preRun.shift(),P.unshift(t);var t;rt(P)}(),H>0||(r.setStatus?(r.setStatus('Running...'),setTimeout((function(){setTimeout((function(){r.setStatus('')}),1),e()}),1)):e(),U()))}if(r.stackSave=et("stackSave"),r.stackRestore=et("stackRestore"),r.stackAlloc=et("stackAlloc"),r.setValue=function(t,i,e="i8"){switch(e.endsWith('*')&&(e='*'),e){case'i1':case'i8':T[0|t]=i;break;case'i16':O[t>>1]=i;break;case'i32':L[t>>2]=i;break;case'i64':$=[i>>>0,(J=i,+Math.abs(J)>=1?J>0?(0|Math.min(+Math.floor(J/4294967296),4294967295))>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],L[t>>2]=$[0],L[t+4>>2]=$[1];break;case'float':x[t>>2]=i;break;case'double':k[t>>3]=i;break;case'*':S[t>>2]=i;break;default:j('invalid type for setValue: '+e)}},r.getValue=function(t,i="i8"){switch(i.endsWith('*')&&(i='*'),i){case'i1':case'i8':return T[0|t];case'i16':return O[t>>1];case'i32':case'i64':return L[t>>2];case'float':return x[t>>2];case'double':return k[t>>3];case'*':return S[t>>2];default:j('invalid type for getValue: '+i)}return null},['run','UTF8ArrayToString','UTF8ToString','stringToUTF8Array','stringToUTF8','lengthBytesUTF8','addOnPreRun','addOnInit','addOnPreMain','addOnExit','addOnPostRun','addRunDependency','removeRunDependency','FS_createFolder','FS_createPath','FS_createDataFile','FS_createPreloadedFile','FS_createLazyFile','FS_createLink','FS_createDevice','FS_unlink','getLEB','getFunctionTables','alignFunctionTables','registerFunctions','prettyPrint','getCompilerSetting','print','printErr','callMain','abort','keepRuntimeAlive','wasmMemory','stackAlloc','stackSave','stackRestore','getTempRet0','setTempRet0','writeStackCookie','checkStackCookie','ptrToString','zeroMemory','stringToNewUTF8','exitJS','getHeapMax','emscripten_realloc_buffer','ENV','ERRNO_CODES','ERRNO_MESSAGES','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','DNS','getHostByName','Protocols','Sockets','getRandomDevice','warnOnce','traverseStack','UNWIND_CACHE','convertPCtoSourceLocation','readAsmConstArgsArray','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','handleException','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','freeTableIndexes','functionsInTableMap','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','PATH','PATH_FS','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16Decoder','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeArrayToMemory','writeAsciiToMemory','SYSCALLS','getSocketFromFD','getSocketAddress','JSEvents','registerKeyEventCallback','specialHTMLTargets','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','currentFullscreenStrategy','restoreOldWindowedStyle','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','demangle','demangleAll','jsStackTrace','stackTrace','ExitStatus','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','dlopenMissingError','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','uncaughtExceptionCount','exceptionLast','exceptionCaught','ExceptionInfo','exception_addRef','exception_decRef','Browser','setMainLoop','wget','FS','MEMFS','TTY','PIPEFS','SOCKFS','_setNetworkCallback','tempFixedLengthArray','miniTempWebGLFloatBuffers','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','GL','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','AL','SDL_unicode','SDL_ttfContext','SDL_audio','SDL','SDL_gfx','GLUT','EGL','GLFW_Window','GLFW','GLEW','IDBStore','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){var i="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),j(i)}})})),['ptrToString','zeroMemory','stringToNewUTF8','exitJS','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','getHostByName','getRandomDevice','traverseStack','convertPCtoSourceLocation','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeAsciiToMemory','getSocketFromFD','getSocketAddress','registerKeyEventCallback','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','ExceptionInfo','exception_addRef','exception_decRef','setMainLoop','_setNetworkCallback','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','SDL_unicode','SDL_ttfContext','SDL_audio','GLFW_Window','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){'undefined'==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var i='`'+t+'` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line';E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),ht(i)}})})),K=function t(){lt||dt(),lt||(K=t)},r.preInit)for('function'==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return dt(),t.ready})}},r={};function h(t){var i=r[t];if(void 0!==i)return i.exports;var e=r[t]={exports:{}};return n[t](e,e.exports,h),e.exports}h.m=n,t="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",i="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",e="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",s=t=>{t&&t.d<1&&(t.d=1,t.forEach((t=>t.r--)),t.forEach((t=>t.r--?t.r++:t())))},h.a=(n,r,h)=>{var o;h&&((o=[]).d=-1);var l,a,c,f=new Set,u=n.exports,d=new Promise(((t,i)=>{c=i,a=t}));d[i]=u,d[t]=t=>(o&&t(o),f.forEach(t),d.catch((t=>{}))),n.exports=d,r((n=>{var r;l=(n=>n.map((n=>{if(null!==n&&"object"==typeof n){if(n[t])return n;if(n.then){var r=[];r.d=0,n.then((t=>{h[i]=t,s(r)}),(t=>{h[e]=t,s(r)}));var h={};return h[t]=t=>t(r),h}}var o={};return o[t]=t=>{},o[i]=n,o})))(n);var h=()=>l.map((t=>{if(t[e])throw t[e];return t[i]})),a=new Promise((i=>{(r=()=>i(h)).r=0;var e=t=>t!==o&&!f.has(t)&&(f.add(t),t&&!t.d&&(r.r++,t.push(r)));l.map((i=>i[t](e)))}));return r.r?a:h()}),(t=>(t?c(d[e]=t):a(u),s(o)))),o&&o.d<0&&(o.d=0)},h.d=(t,i)=>{for(var e in i)h.o(i,e)&&!h.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:i[e]})},h.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),h.p="/Client2/",h.b=document.baseURI||self.location.href;h(1375)})(); \ No newline at end of file +(()=>{"use strict";var t,i,e,s,n={1651:(t,i,e)=>{e.d(i,{K:()=>k});var s=e(1120),n=e(4583),r=e(2901),h=e(1069),o=e(7046),l=(e(9896),e(6666)),a=e(3045),c=e(818),f=e(670),u=e(8268),d=e(3867),w=e(7854),y=e(8950),A=e(1302),m=e(9298),p=e(8665),g=e(1312),I=e(3819),_=e(8317),C=e(9234),E=e(1908),v=e(123),b=e(5637),T=e(6948),R=e(2164),O=e(8738),L=e(3764),S=e(8534),x=e(6730);class k extends o.A{static tt=225;static it=10;static portOffset=0;static members=!0;static et=!1;static st='';static nt='';static rt=!1;static ht=2;static ot=!1;static lt='https://raw.githubusercontent.com/2004scape/Server/main';static exponent=58778699976184461502525193738213253649000149147835990136706041084440742975821n;static ct=7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789n;static ft=0;static ut=0;static dt=0;static wt=0;static yt=0;static At=0;static gt=0;static It=0;static _t=0;static Ct=0;static Et=0;static vt=0;static bt=0;static Tt=0;static Rt=0;static Ot=()=>{a.A.et=!1,n.A.et=!1,k.et=!1,c.A.et=!1};static Lt=()=>{a.A.et=!0,n.A.et=!0,k.et=!0,c.A.et=!0};St=2048;xt=2047;kt=!1;Mt=!1;Dt=!1;Nt=!1;db=null;Ft=0;Bt=[];stream=null;in=h.A.Ut(1);Pt=h.A.Ut(1);Gt=h.A.Ut(1);Wt=0n;Yt=0;Ht=0;Vt=0;Kt=null;Xt=0;packetSize=0;jt=0;zt=0;Zt=0;qt=null;Jt=!0;$t=0;Qt=0;ti=null;ii=null;ei=null;si=null;ni=null;ri=null;hi=null;oi=null;li=null;ai=null;ci=null;fi='';ui='';username='';password='';di=null;wi=null;yi=null;Ai=null;mi=[];pi=!1;gi=null;Ii=null;_i=null;Ci=null;Ei=null;vi=null;bi=null;Ti=null;Ri=null;Oi=null;Li=new Int32Array(256);Si=0;xi=0;ki=0;Mi=null;Di=null;Ni=null;Fi=null;Bi=null;Ui=null;Pi=null;Gi=null;Wi=null;Yi=null;Hi=null;Vi=null;Ki=null;Xi=null;ji=null;zi=null;Zi=null;qi=null;Ji=null;$i=null;Qi=null;te=new Int32Array(33);ie=new Int32Array(33);ee=new Int32Array(151);se=new Int32Array(151);ne=null;re=null;he=null;oe=null;le=null;ae=null;ce=new d.fe(13,null);ue=null;de=null;we=new d.fe(50,null);ye=new d.fe(50,null);Ae=new d.fe(20,null);me=new d.fe(20,null);pe=null;ge=new d.fe(8,null);Ie=null;_e=null;Ce=null;Ee=null;ve=null;be=null;Te=null;Re=null;Oe=null;Le=null;Se=null;xe=null;ke=null;Me=null;De=null;Ne=null;Fe=null;Be=null;Ue=new d.fe(1e3,null);Pe=!1;Ge=!1;We=!1;Ye=!1;He=-1;Ve=0;Ke=0;Xe=0;je=0;ze=0;Ze=0;qe=!1;Je=0;$e=0;Qe=0;ts=0;es=0;ss=0;ns=[];rs=-1;hs=-1;os=new s.A;ls=78;cs=0;fs=0;us=[];ds=0;ws=0;ys=0;As=0;ps=0;gs=0;Is=0;_s=0;Cs=[];Es=[];vs=[];bs=[];Ts=null;Rs=-1;Os=3;Ls=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];Ss=0;xs=0;ks=0;Ms=!1;Ds=0;Ns=!1;Fs='';Bs='';Us=0;Ps='';Gs=!1;Ws=-1;Ys=new d.fe(100,null);Hs=new d.fe(100,null);messageType=new Int32Array(100);Vs=new Int32Array(100);Ks=0;Xs=0;js=0;zs='';Zs=0;qs=0;Js=0;$s=0;Qs=0;tn=0;en=0;sn=0;nn=0;rn=!1;hn=0;ln=0;an=0;cn=0;fn=null;un=0;dn=0;wn=0;yn=0;An=!1;mn=[];pn=[];gn=0;In=0;_n=0;Cn=null;En=0;vn=new Int32Array(500);bn=new Int32Array(500);Tn=new Int32Array(500);Rn=new Int32Array(500);On=0;Ln=0;Sn=0;xn='';kn=!1;Mn=-1;Dn=0;Nn=0;Fn=0;Bn=0;Un=0;Pn=new Int32Array(1e3);Gn=new Int32Array(1e3);Wn=null;Yn=0;Hn=0;Vn=0;Kn=0;Xn=0;jn=!1;zn=0;Zn=0;qn=0;Jn=0;$n=2;Qn=2;tr=1;ir=new Int32Array(5);er=new d.fe(5,!1);sr=new Int32Array(5);nr=new Int32Array(5);rr=new Int32Array(5);hr=0;lr=0;ar=0;cr=0;ur=0;dr=0;wr=0;yr=0;Ar=0;mr=1;pr=2;gr=-1;Ir=0;_r=0;Cr=0;Er=0;vr=0;br=0;Tr=null;Rr=null;Or=null;Lr=0;Sr=0;kr=new Int8Array(16384);Mr=new d.fe(f.A.Dr,null);Nr=0;Fr=0;Br=128;Ur=0;Pr=0;Gr=0;Wr=0;Yr=0;Hr=null;Vr=null;Kr=new d.Xr(f.A.jr,f.A.jr);zr=0;Zr=0;qr=0;Jr=0;$r=0;Qr=0;th=0;ih=0;eh=0;sh=0;nh=0;rh=0;hh=new d.fe(this.St,null);oh=0;lh=new Int32Array(this.St);ah=0;fh=0;uh=new Int32Array(this.St);dh=new Int32Array(1e3);wh=new d.fe(this.St,null);yh=new d.fe(8192,null);Ah=0;mh=new Int32Array(8192);ph=new l.A;gh=new l.A;Ih=new l.A;_h=new l.A;Ch=new d.Eh(f.A.Dr,f.A.jr,f.A.jr,null);bh=new l.A;Th=new Int32Array(4e3);Rh=new Int32Array(4e3);Oh=new Int32Array(f.A.jr*f.A.jr);Lh=new Int32Array(f.A.jr*f.A.jr);Sh=0;xh=null;kh=0;Mh=0;Dh=-1;Nh=0;Fh=0;Bh=0;Uh=0;Ph=!1;Gh=!0;Wh=!1;Yh=new Int32Array(7);Hh=new Int32Array(5);Vh=0;Kh=0;static Xh=50;jh=new Int32Array(k.Xh);zh=new Int32Array(k.Xh);Zh=new Int32Array(k.Xh);qh=new Int32Array(k.Xh);Jh=new Int32Array(k.Xh);$h=new Int32Array(k.Xh);Qh=new Int32Array(k.Xh);io=new d.fe(k.Xh,null);eo=new d.fe(100,null);so=new BigInt64Array(100);no=new Int32Array(100);ro=null;ho=0;oo=!0;lo=new Int32Array(50);ao=new Int32Array(50);co=new Int32Array(50);fo=192;uo=-1;do=-1;wo=0;yo=0;Ao=0;mo=!0;po=null;Io=0;_o=0;Co=192;Eo=new d.fe(16,null);vo=0;bo=!1;To=()=>{try{this.stream&&this.stream.close()}catch(t){}this.stream=null,(0,v.Ro)(),this.Pt=null,this.Gt=null,this.in=null,this.Or=null,this.Tr=null,this.Rr=null,this.Hr=null,this.Vr=null,this.Wn=null,this.Mr=null,this.Oh=null,this.Lh=null,this.Th=null,this.Rh=null,this.kr=null,this.Di=null,this.Ni=null,this.Fi=null,this.Bi=null,this.Ui=null,this.Pi=null,this.Gi=null,this.Wi=null,this.Yi=null,this.Hi=null,this.Vi=null,this.Ki=null,this.Xi=null,this.ji=null,this.zi=null,this.Zi=null,this.qi=null,this.ne=null,this.he=null,this.re=null,this.oe=null,this.le=null,this.ae=null,this.ce=null,this.Te=null,this.Re=null,this.Oe=null,this.Le=null,this.Se=null,this.xe=null,this.ke=null,this.Me=null,this.De=null,this.Ne=null,this.de=null,this.Ae=null,this.me=null,this.ge=null,this.Ie=null,this._e=null,this.Ce=null,this.Ee=null,this.we=null,this.ye=null,this.Kr=null,this.hh=null,this.lh=null,this.uh=null,this.wh=null,this.dh=null,this.yh=null,this.mh=null,this.Ch=null,this.bh=null,this._h=null,this.ph=null,this.gh=null,this.Ih=null,this.Tn=null,this.Rn=null,this.vn=null,this.bn=null,this.ns=null,this.mn=null,this.Pn=null,this.Gn=null,this.Ue=null,this.ue=null,this.eo=null,this.so=null,this.no=null,this.si=null,this.ni=null,this.ti=null,this.ii=null,this.ei=null,this.ri=null,this.hi=null,this.oi=null,this.li=null,this.Oo(),b.A.To(),T.A.To(),A.A.To(),R.A.Lo=null,_.A.Lo=null,s.A.Lo=null,g.A.Lo=null,O.A.Lo=null,O.A.So=null,L.A.Lo=null,this.xo=null,u.A.So=null,n.A.To(),a.A.To(),p.A.To(),S.A.Lo=[],x.A.Lo=[]};ko(){return this.$t}Mo(){return this.Gs}Do(){return this.Ns}No(){return this.hs}Fo(){return this.He}Oo=()=>{this.pi=!1,this.Mi&&(clearInterval(this.Mi),this.Mi=null),this.ai=null,this.ci=null,this.mi=[],this.bi=null,this.Ti=null,this.Ri=null,this.Oi=null,this.Ci=null,this._i=null,this.Ei=null,this.vi=null,this.gi=null,this.Ii=null};Bo=async(t,i,e,s)=>{let n=5,o=await(this.db?.Uo(t));if(o&&h.A.Po(o)!==e&&(o=void 0),o)return new r.A(o);for(;!o;){await this.Go(s,`Requesting ${i}`);try{o=await(0,C.Wo)(`${k.nt}/${t}${e}`)}catch(t){o=void 0;for(let t=n;t>0;t--)await this.Go(s,`Error loading - Will retry in ${t} secs.`),await(0,C.Yo)(1e3);n*=2,n>60&&(n=60)}}return await(this.db?.Ho(t,o)),new r.A(o)};Vo=async(t,i,e)=>{let s=await(this.db?.Uo(t+'.mid'));if(s&&12345678!==i&&h.A.Po(s)!==i&&(s=void 0),!s)try{s=await(0,C.Wo)(`${k.nt}/${t}_${i}.mid`),e!==s.length&&(s=s.slice(0,e))}catch(t){}if(!s)return;await(this.db?.Ho(t+'.mid',s));const n=new h.A(Uint8Array.from(s)).Ko,r=E.A.read(n,s,e,4);(0,v.Xo)(r,this.Co)};jo=()=>{if(w.zo.fillStyle='black',w.zo.fillRect(0,0,this.width,this.height),this.Zo(1),this.Dt){this.pi=!1,w.zo.font='bold 16px helvetica, sans-serif',w.zo.textAlign='left',w.zo.fillStyle='yellow';let t=35;w.zo.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,w.zo.fillStyle='white',w.zo.fillText('To fix this try the following (in order):',30,t),t+=50,w.zo.font='bold 12px helvetica, sans-serif',w.zo.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.zo.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,w.zo.fillText('3: Try using a different game-world',30,t),t+=30,w.zo.fillText('4: Try rebooting your computer',30,t),t+=30,w.zo.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.Nt&&(this.pi=!1,w.zo.font='bold 20px helvetica, sans-serif',w.zo.textAlign='left',w.zo.fillStyle='white',w.zo.fillText('Error - unable to load game!',50,50),w.zo.fillText('To play RuneScape make sure you play from',50,100),w.zo.fillText('https://2004scape.org',50,150)),this.Mt){this.pi=!1,w.zo.font='bold 13px helvetica, sans-serif',w.zo.textAlign='left',w.zo.fillStyle='yellow';let t=35;w.zo.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,w.zo.fillStyle='white',w.zo.fillText('To fix this try the following (in order):',30,t),t+=50,w.zo.font='bold 12px helvetica, sans-serif',w.zo.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.zo.fillText('2: Try rebooting your computer, and reloading',30,t)}};qo=t=>{if(!t.Jo)return!1;for(let i=0;i=s)return!1}else if(3===t.Jo[i]){if(e<=s)return!1}else if(4===t.Jo[i]){if(e===s)return!1}else if(e!==s)return!1}return!0};tl=(t,i,e,s,n)=>{this.ve?.draw(t,i),this.be?.draw(t,i+n-16),y.A.fillRect(t,i+16,16,n-32,m.A.il);let r=(n-32)*n/s|0;r<8&&(r=8);const h=(n-r-32)*e/(s-n)|0;y.A.fillRect(t,i+h+16,16,r,m.A.el),y.A.sl(t,i+h+16,m.A.nl,r),y.A.sl(t+1,i+h+16,m.A.nl,r),y.A.rl(t,i+h+16,m.A.nl,16),y.A.rl(t,i+h+17,m.A.nl,16),y.A.sl(t+15,i+h+16,m.A.hl,r),y.A.sl(t+14,i+h+17,m.A.hl,r-1),y.A.rl(t,i+h+r+15,m.A.hl,16),y.A.rl(t+1,i+h+r+14,m.A.hl,15)};ol=(t,i)=>{let e=!1;const n=s.A.Lo[t];if(!n.ll)return!1;for(let t=0;ts.delay[r.ul];)r.fl-=s.delay[r.ul]+1,r.ul++,r.ul>=s.dl&&(r.ul-=s.wl,(r.ul<0||r.ul>=s.dl)&&(r.ul=0)),e=!0}}}return e};yl=(t,i,e,r,h=!1)=>{if(0!==t.type||!t.ll||t.hide&&this.Zs!==t.id&&this.qs!==t.id&&this.Js!==t.id)return;const o=y.A.left,l=y.A.top,a=y.A.right,c=y.A.bottom;y.A.Al(i,e,i+t.width,e+t.height);const f=t.ll.length;for(let o=0;o0&&this.Cl(c),c.type===s.A.El)c.vl>c.scroll-c.height&&(c.vl=c.scroll-c.height),c.vl<0&&(c.vl=0),this.yl(c,l,a,c.vl,h),c.scroll>c.height&&this.tl(l+c.width,a,c.vl,c.scroll,c.height);else if(c.type===s.A.bl){let t=0;for(let i=0;i0){let i=0,e=0;const r=c.Ol[t]-1;if(s>=-32&&s<=512&&n>=-32&&n<=334||0!==this.tn&&this.Qs===t){const h=A.A.kl(r,c.Ll[t]);if(0!==this.tn&&this.Qs===t&&this.$s===c.id?(i=this.Ml-this.en,e=this.Dl-this.sn,i<5&&i>-5&&(i=0),e<5&&e>-5&&(e=0),this.nn<5&&(i=0,e=0),h.Nl(128,s+i,n+e)):0!==this.un&&this.dn===t&&this.wn===c.id?h.Nl(128,s,n):h.draw(s,n),33===h.Fl||1!==c.Ll[t]){const r=c.Ll[t];this.di?.Bl(s+i+1,n+10+e,this.Ul(r),m.A.Pl),this.di?.Bl(s+i,n+9+e,this.Ul(r),m.A.Gl)}}}else if(c.Wl&&t<20){const i=c.Wl[t];i?.draw(s,n)}t++}}else if(c.type===s.A.Yl)c.fill?y.A.fillRect(l,a,c.width,c.height,c.Hl):y.A.gl(l,a,c.width,c.height,c.Hl);else if(c.type===s.A.Vl){const t=c.font;let i=c.Hl,e=c.text;if(this.Js!==c.id&&this.qs!==c.id&&this.Zs!==c.id||0===c.Kl||(i=c.Kl),this.qo(c)&&(i=c.Xl,c.jl&&c.jl.length>0&&(e=c.jl)),c.zl===s.A.Zl&&this.An&&(e='Please wait...',i=c.Hl),!t||!e)continue;for(let s=a+t.height;e.length>0;s+=t.height){if(-1!==e.indexOf('%')){for(;;){const t=e.indexOf('%1');if(-1===t)break;e=e.substring(0,t)+this.ql(this.$o(c,0))+e.substring(t+2)}for(;;){const t=e.indexOf('%2');if(-1===t)break;e=e.substring(0,t)+this.ql(this.$o(c,1))+e.substring(t+2)}for(;;){const t=e.indexOf('%3');if(-1===t)break;e=e.substring(0,t)+this.ql(this.$o(c,2))+e.substring(t+2)}for(;;){const t=e.indexOf('%4');if(-1===t)break;e=e.substring(0,t)+this.ql(this.$o(c,3))+e.substring(t+2)}for(;;){const t=e.indexOf('%5');if(-1===t)break;e=e.substring(0,t)+this.ql(this.$o(c,4))+e.substring(t+2)}}const n=e.indexOf('\\n');let r;-1!==n?(r=e.substring(0,n),e=e.substring(n+2)):(r=e,e=''),c.Jl?t.$l(l+(c.width/2|0),s,r,i,c.Ql):t.ta(l,s,r,i,c.Ql)}}else if(c.type===s.A.ia){let t;t=this.qo(c)?c.ea:c.sa,t?.draw(l,a)}else if(c.type===s.A.na){const t=n.A.ra,i=n.A.ha;n.A.ra=l+(c.width/2|0),n.A.ha=a+(c.height/2|0);const e=n.A.sin[c.oa]*c.zoom>>16,s=n.A.cos[c.oa]*c.zoom>>16,r=this.qo(c);let h;h=r?c.cl:c.al;let o=null;if(-1===h)o=c.la(-1,-1,r);else{const t=g.A.Lo[h];t.frames&&t.aa&&(o=c.la(t.frames[c.ul],t.aa[c.ul],r))}o&&o.ca(0,c.fa,0,c.oa,0,e,s),n.A.ra=t,n.A.ha=i}else if(c.type===s.A.ua){const t=c.font;if(!t||!c.Ol||!c.Ll)continue;let i=0;for(let e=0;e0){const n=A.A.get(c.Ol[i]-1);let r=n.name;if((n.da||1!==c.Ll[i])&&(r=r+' x'+this.wa(c.Ll[i])),!r)continue;const h=l+s*(c.Sl+115),o=a+e*(c.xl+12);c.Jl?t.$l(h+(c.width/2|0),o,r,c.Hl,c.Ql):t.ta(h,o,r,c.Hl,c.Ql)}i++}}}y.A.Al(o,l,a,c)};Cl=t=>{let i=t._l;if(i>=s.A.ya&&i<=s.A.Aa)i--,i>=this.Vh?(t.text='',t.zl=0):(t.text=this.eo[i],t.zl=1);else if(i>=s.A.ma&&i<=s.A.pa)i-=s.A.ma,i>=this.Vh?(t.text='',t.zl=0):(0===this.no[i]?t.text='@red@Offline':this.no[i]===k.it?t.text='@gre@World-'+(this.no[i]-9):t.text='@yel@World-'+(this.no[i]-9),t.zl=1);else if(i===s.A.ga)t.scroll=15*this.Vh+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i>=s.A.Ia&&i<=s.A._a)i-=s.A.Ia,i>=this.fs?(t.text='',t.zl=0):(t.text=I.A.Ca(I.A.Ea(this.us[i])),t.zl=1);else if(i===s.A.va)t.scroll=15*this.fs+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i===s.A.ba){if(t.oa=150,t.fa=256*Math.sin(this.Ft/40)&2047,this.Wh){this.Wh=!1;const i=new d.fe(7,null);let e=0;for(let t=0;t<7;t++){const s=this.Yh[t];s>=0&&(i[e++]=_.A.Lo[s].la())}const s=p.A.Ta(i,e);for(let t=0;t<5;t++)0!==this.Hh[t]&&(s.Ra(u.A.Oa[t][0],u.A.Oa[t][this.Hh[t]]),1===t&&s.Ra(u.A.La[0],u.A.La[this.Hh[t]]));if(this.xh){const i=g.A.Lo[this.xh.Sa].frames;i&&(s.xa(),s.ka(i[0]),s.Ma(64,850,-30,-50,-30,!0),t.model=s)}}}else if(i===s.A.Da)this.Fe||(this.Fe=t.sa,this.Be=t.ea),this.Gh?t.sa=this.Be:t.sa=this.Fe;else if(i===s.A.Na)this.Fe||(this.Fe=t.sa,this.Be=t.ea),this.Gh?t.sa=this.Fe:t.sa=this.Be;else if(i===s.A.Fa)t.text=this.xn,this.Ft%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(i===s.A.Ba)this.Ph?this.kn?(t.Hl=m.A.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.Hl=m.A.Il,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(i===s.A.Ua||i===s.A.Pa)if(0===this.Dn)t.text='';else{let i;i=0===this.Nn?'earlier today':1===this.Nn?'yesterday':this.Nn+' days ago',t.text='You last logged in '+i+' from: '+I.A.Ga(this.Dn)}else if(i===s.A.Wa)0===this.Bn&&(t.text='0 unread messages',t.Hl=m.A.Gl),1===this.Bn&&(t.text='1 unread message',t.Hl=m.A.GREEN),this.Bn>1&&(t.text=this.Bn+' unread messages',t.Hl=m.A.GREEN);else if(i===s.A.Ya)if(201===this.Fn)t.text='';else if(200===this.Fn)t.text='You have not yet set any password recovery questions.';else{let i;i=0===this.Fn?'Earlier today':1===this.Fn?'Yesterday':this.Fn+' days ago',t.text=i+' you changed your recovery questions'}else i===s.A.Ha?201===this.Fn?t.text='':200===this.Fn?t.text='We strongly recommend you do so now to secure your account.':t.text='If you do not remember making this change then cancel it immediately':i===s.A.Va&&(201===this.Fn?t.text='':(this.Fn,t.text="Do this from the 'account management' area on our front webpage"))};$o=(t,i)=>{if(!t.scripts||i>=t.scripts.length)return-2;try{const e=t.scripts[i];if(!e)return-1;let n=0,r=0;for(;;){const t=e[r++];if(0===t)return n;if(1===t)n+=this.Es[e[r++]];else if(2===t)n+=this.vs[e[r++]];else if(3===t)n+=this.Cs[e[r++]];else if(4===t){const t=s.A.Lo[e[r++]],i=e[r++]+1;if(t.Ol&&t.Ll)for(let e=0;et<999999999?String(t):'*';wa=t=>{let i=String(t);for(let t=i.length-3;t>0;t-=3)i=i.substring(0,t)+','+i.substring(t);return i.length>8?i='@gre@'+i.substring(0,i.length-8)+' million @whi@('+i+')':i.length>4&&(i='@cya@'+i.substring(0,i.length-4)+'K @whi@('+i+')'),' '+i};Ul=t=>t<1e5?String(t):t<1e7?(t/1e3|0)+'K':(t/1e6|0)+'M'}},7604:(t,i,e)=>{e.d(i,{w:()=>h});var s=e(7046),n=e(1651),r=e(9234);async function h(){await async function(){0===s.A.getParameter('world').length&&s.A.setParameter('world','1');'localhost'===window.location.hostname&&'0'===s.A.getParameter('world')?(n.K.st='http://localhost',n.K.nt='http://localhost',n.K.portOffset=0):await async function(t){const i=await o(t,parseInt(s.A.getParameter('world'),10)),e=new URL(i.address);n.K.it=10+i.id-1,n.K.st=`${e.protocol}//${e.hostname}`,n.K.nt=`${e.protocol}//${e.hostname}:${e.port}`,t||(n.K.st=n.K.st.replace('https:','http:'));n.K.portOffset=i.portOffset,n.K.members=!0===i?.members,s.A.setParameter('world',i.id.toString(10))}(window.location.protocol.startsWith('https'))}(),function(){0===s.A.getParameter('detail').length&&s.A.setParameter('detail','high');'low'===s.A.getParameter('detail')?n.K.Lt():n.K.Ot()}(),0===s.A.getParameter('method').length&&s.A.setParameter('method','0')}async function o(t,i,e=0){if(e>=10)throw new Error('could not find world to connect!');const s=t?'https:':'http:';let n;try{n=JSON.parse(await(0,r.Xa)(`${s}//2004scape.org/api/v1/worldlist`))}catch(s){return await(0,r.Yo)(1e3),o(t,i,++e)}n.push({id:0,region:'Local Development',address:'http://localhost',portOffset:0,members:!0,hh:0});const h=n.find((t=>t.id===i));return h||o(t,i,10)}},1375:(t,i,e)=>{e.a(t,(async(t,i)=>{try{var s=e(1312),n=e(5637),r=e(2164),h=e(1302),o=e(6948),l=e(8317),a=e(8738),c=e(3764),f=e(1120),u=e(4583),d=e(2682),w=e(8665),y=e(8534),A=e(6730),m=e(7953),p=e(9234),g=e(8950),I=e(1069),_=e(3937),C=e(4544),E=e(1908),v=e(9298),b=e(1651),T=e(7604),R=e(1673);class t extends b.K{constructor(){super(!1)}ja=null;za=null;Za=!1;qa=!1;Ja=0;$a=0;Qa='';load=async()=>{try{await this.Go(10,'Connecting to fileserver'),await E.A.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new C.A(await C.A.openDatabase());const t=new I.A(new Uint8Array(await(0,p.Wo)(`${b.K.nt}/crc`))),i=[];for(let e=0;e<9;e++)i[e]=t.Ko;const e=await this.Bo('title','title screen',i[1],10);this.di=d.A.tc(e,'p11'),this.wi=d.A.tc(e,'p12'),this.yi=d.A.tc(e,'b12'),this.Ai=d.A.tc(e,'q8');const g=await this.Bo('config','config',i[2],15),v=await this.Bo('interface','interface',i[3],20),T=await this.Bo('media','2d graphics',i[4],30),O=await this.Bo('models','3d graphics',i[5],40),L=await this.Bo('textures','textures',i[6],60),S=await this.Bo('wordenc','chat system',i[7],65),x=await this.Bo('sounds','sound effects',i[8],70);await this.Go(75,'Unpacking media'),this.ve=R.A.tc(T,'scrollbar',0),this.be=R.A.tc(T,'scrollbar',1),await this.Go(80,'Unpacking textures'),u.A.ic(L),u.A.ec(.8),u.A.sc(20),await this.Go(83,'Unpacking models'),w.A.nc(O),y.A.nc(O),A.A.nc(O),await this.Go(86,'Unpacking config'),s.A.nc(g),n.A.nc(g),r.A.nc(g),h.A.nc(g,!0),o.A.nc(g),l.A.nc(g),a.A.nc(g),c.A.nc(g),await this.Go(90,'Unpacking sounds'),_.A.nc(x),await this.Go(92,'Unpacking interfaces'),f.A.nc(v,T,[this.di,this.wi,this.yi,this.Ai]),await this.Go(97,'Preparing game engine'),m.A.nc(S);for(let t=0;t{this.Mt||this.Dt||this.Nt||(!this.qa&&this.ja&&(this.Qa='',this.hc(this.ja,this.Ml,this.Dl,0,0,0),this.Zs=this.Sn,this.Sn=-1,this.Za||(this.za=this.oc(this.ja,this.Ml,this.Dl,0,0,0))),this.za&&(1===this.lc?(this.qa||(this.Ja=this.za.ac()-this.Ml,this.$a=this.za.cc()-this.Dl),this.qa=!0):this.qa=!1,this.qa&&this.za.move(this.Ml+this.Ja,this.Dl+this.$a)),this.fc(),this.uc(),this.dc=-1,this.wc=-1,this.yc=0)};draw=async()=>{this.Mt||this.Dt||this.Nt?this.jo():(g.A.clear(),g.A.fillRect(0,0,this.width,this.height,0),this.Ac(8,8,16,16,5263440),this.ja&&(this.yl(this.ja,0,0,0,!1),this.yi?.mc(4,15,this.Qa,v.A.Il,!0,0)),this.za&&this.za.outline(65535),this.xo?.draw(0,0))};fc(){for(;;){const t=this.gc();if(-1===t)break;this.za&&(8===t?(this.za.delete(),this.za=null,this.Za=!1):9===t&&(this.Za=!1))}}uc(){if(this.za){if(this.Ic[1]){const t=this.za.ac();this.za.move(t-1,this.za.cc())}else if(this.Ic[2]){const t=this.za.ac();this.za.move(t+1,this.za.cc())}if(this.Ic[3]){const t=this.za.cc();this.za.move(this.za.ac(),t-1)}else if(this.Ic[4]){const t=this.za.cc();this.za.move(this.za.ac(),t+1)}}}Ac=(t,i,e,s,n)=>{const r=(this.width+t)/e,h=(this.height+i)/s;t=-t,i=-i;for(let o=0;o{if(0!==t.type||!t.ll||!t.ml||!t.pl||is+t.width||e>n+t.height)return;const h=t.ll.length;for(let o=0;o=0||0!==a.Kl)&&i>=h&&e>=l&&i=0?this.Sn=a.Cc:this.Sn=a.id),0===a.type?this.hc(a,i,e,h,l,a.vl):i>=h&&e>=l&&i{if(0!==t.type||!t.ll||!t.ml||!t.pl||is+t.width||e>n+t.height)return null;let h=null;const o=t.ll.length;for(let l=0;l=o&&e>=a&&i{})),i()}catch(t){i(t)}}),1)},7046:(t,i,e)=>{e.d(i,{A:()=>a});var s=e(1183),n=e(4583),r=e(9234),h=e(9091),o=e(2595),l=e(7854);class a{static getParameter(t){return new URLSearchParams(window.location.search).get(t)??''}static setParameter(t,i){const e=new URL(window.location.toString());e.searchParams.set(t,i),window.history.pushState(null,'',e.toString())}Tc=0;Rc=[];Oc=0;xo=null;state=0;Lc=20;Sc=1;xc=[];kc=0;Mc=0;Dc=[];Nc=!0;Fc=!1;Bc=50;hasFocus=!0;Uc=!1;Pc=0;lc=0;Ml=0;Dl=0;yc=0;dc=0;wc=0;Ic=[];Gc=[];Wc=0;Yc=0;input=null;Hc=!1;Vc=!1;Kc=!1;time=-1;Xc=0;jc=0;zc=0;Zc=0;qc=0;Jc=0;constructor(t=!1){l.$c.tabIndex=-1,l.zo.fillStyle='black',l.zo.fillRect(0,0,l.$c.width,l.$c.height),this.Fc=t,this.Fc?this.resize(window.innerWidth,window.innerHeight):this.resize(l.$c.width,l.$c.height)}get width(){return l.$c.width}get height(){return l.$c.height}resize=(t,i)=>{l.$c.width=t,l.$c.height=i,this.xo=new s.A(t,i),n.A.rc()};bc=async()=>{l.$c.addEventListener('resize',(()=>{this.Fc&&this.resize(window.innerWidth,window.innerHeight)}),!1),l.$c.onmousedown=this.onmousedown,l.$c.onmouseup=this.onmouseup,l.$c.onmouseenter=this.onmouseenter,l.$c.onmouseleave=this.onmouseleave,l.$c.onmousemove=this.onmousemove,window.onbeforeunload=this.To,l.$c.onfocus=this.onfocus,l.$c.onblur=this.onblur,this.Qc?(l.$c.ontouchstart=this.ontouchstart,l.$c.ontouchend=this.ontouchend,l.$c.ontouchmove=this.ontouchmove):(l.$c.onkeydown=this.onkeydown,l.$c.onkeyup=this.onkeyup),l.$c.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.Qc&&'low'===a.getParameter('detail')&&(this.Bc=30),await this.Go(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.xc[t]=performance.now();let t,i=0,e=256,s=1,n=0;for(;this.state>=0;){if(this.state>0&&(this.state--,0===this.state))return void this.tf();const h=e,o=s;e=300,s=1,t=performance.now();const l=this.xc[i];if(0===l?(e=h,s=o):t>l&&(e=2560*this.Lc/(t-l)|0),e<25?e=25:e>256&&(e=256,s=this.Lc-(t-l)/10|0),this.xc[i]=t,i=(i+1)%10,s>1)for(let t=0;t<10;t++)0!==this.xc[t]&&(this.xc[t]+=s);for(s0&&(this.kc=1e3*e/(256*this.Lc)|0);const a=performance.now();if(this.Nc&&this.refresh(),await this.draw(),this.Dc[this.Mc]=(performance.now()-a)/1e3,this.Mc=(this.Mc+1)%this.Dc.length,this.Bc<50){const i=1e3/this.Bc-(performance.now()-t);i>0&&await(0,r.Yo)(i)}}-1===this.state&&this.tf()};tf=()=>{this.state=-2,this.To()};Zo=t=>{this.Lc=1e3/t|0};if=t=>{this.Bc=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.Lc|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};To=()=>{};draw=async()=>{};refresh=()=>{};async Go(t,i){const e=this.width,s=this.height;this.Nc&&(l.zo.fillStyle='black',l.zo.fillRect(0,0,e,s),this.Nc=!1);const n=s/2-18;l.zo.fillStyle='rgb(140, 17, 17)',l.zo.rect((e/2|0)-152,n,304,34),l.zo.fillRect((e/2|0)-150,n+2,3*t,30),l.zo.fillStyle='black',l.zo.fillRect((e/2|0)-150+3*t,n+2,300-3*t,30),l.zo.font='bold 13px helvetica, sans-serif',l.zo.textAlign='center',l.zo.fillStyle='white',l.zo.fillText(i,e/2|0,n+22),await(0,r.Yo)(5)}gc=()=>{let t=-1;return this.Yc!==this.Wc&&(t=this.Gc[this.Wc],this.Wc=this.Wc+1&127),t};get ms(){const t=this.Dc.length;let i=0;for(let e=0;ethis.Tc&&(this.Tc=e),this.Rc[this.Oc]=e,this.Oc=(this.Oc+1)%250,e}get ef(){return this.Rc.reduce(((t,i)=>t+i),0)/250}onkeydown=t=>{const i=t.key;this.Pc=0;const e=h.c[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;t.ctrlKey&&(n>='A'.charCodeAt(0)&&n<=']'.charCodeAt(0)||n=='_'.charCodeAt(0)?n-='A'.charCodeAt(0)-1:n>='a'.charCodeAt(0)&&n<='z'.charCodeAt(0)&&(n-='a'.charCodeAt(0)-1)),n<30&&(n=0),s===h.c.ArrowLeft.code?n=1:s===h.c.ArrowRight.code?n=2:s===h.c.ArrowUp.code?n=3:s===h.c.ArrowDown.code?n=4:s===h.c.Control.code?n=5:s===h.c.Shift.code?n=6:s===h.c.Alt.code?n=7:s===h.c.Backspace.code||s===h.c.Delete.code?n=8:s===h.c.Tab.code?n=9:s===h.c.Enter.code?n=10:s>=h.c.F1.code&&s<=h.c.F12.code?n=s+1008-h.c.F1.code:s===h.c.Home.code?n=1e3:s===h.c.End.code?n=1001:s===h.c.PageUp.code?n=1002:s===h.c.PageDown.code&&(n=1003),n>0&&n<128&&(this.Ic[n]=1),n>4&&(this.Gc[this.Yc]=n,this.Yc=this.Yc+1&127),o.A.enabled&&o.A.sf(n),h.g.includes(i)||t.preventDefault()};onkeyup=t=>{const i=t.key;this.Pc=0;const e=h.c[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;n<30&&(n=0),s===h.c.ArrowLeft.code?n=1:s===h.c.ArrowRight.code?n=2:s===h.c.ArrowUp.code?n=3:s===h.c.ArrowDown.code?n=4:s===h.c.Control.code?n=5:s===h.c.Shift.code?n=6:s===h.c.Alt.code?n=7:s===h.c.Backspace.code||s===h.c.Delete.code?n=8:s===h.c.Tab.code?n=9:s===h.c.Enter.code?n=10:s>=h.c.F1.code&&s<=h.c.F12.code?n=s+1008-h.c.F1.code:s===h.c.Home.code?n=1e3:s===h.c.End.code?n=1001:s===h.c.PageUp.code?n=1002:s===h.c.PageDown.code&&(n=1003),n>0&&n<128&&(this.Ic[n]=0),o.A.enabled&&o.A.nf(n),h.g.includes(i)||t.preventDefault()};onmousedown=t=>{if(this.Hc=!1,(t.clientX>0||t.clientY>0)&&this.rf(t),this.Pc=0,this.dc=this.Ml,this.wc=this.Dl,this.Qc&&!this.hf){if(this.lf()||this.af()||this.cf())return this.yc=1,void(this.lc=1);t.timeStamp>=this.time+500?(this.yc=2,this.lc=2):(this.yc=1,this.lc=1)}else 2===t.button?(this.yc=2,this.lc=2):(this.yc=1,this.lc=1);o.A.enabled&&o.A.ff(this.dc,this.wc,t.buttons)};onmouseup=t=>{this.rf(t),this.Pc=0,this.lc=0,o.A.enabled&&o.A.uf(t.buttons)};onmouseenter=t=>{this.rf(t),o.A.enabled&&o.A.df()};onmouseleave=t=>{this.rf(t),this.Pc=0,this.Ml=-1,this.Dl=-1,this.lc=0,this.dc=-1,this.wc=-1,o.A.enabled&&o.A.wf()};onmousemove=t=>{this.rf(t),this.Pc=0,o.A.enabled&&o.A.yf(this.Ml,this.Dl)};onfocus=t=>{this.hasFocus=!0,this.Nc=!0,this.refresh(),o.A.enabled&&o.A.Af()};onblur=t=>{this.hasFocus=!1,o.A.enabled&&o.A.mf()};ontouchstart=t=>{if(!this.Qc)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.Hc=!0;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.Xc=this.qc=this.zc=0|i.screenX,this.jc=this.Jc=this.Zc=0|i.screenY,this.time=t.timeStamp,this.Vc=this.pf(),this.Kc=this.gf()};ontouchend=t=>{if(!this.Qc||!this.Hc)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;if(this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.qc=0|i.screenX,this.Jc=0|i.screenY,this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.Vc&&!this.pf())return void(this.Hc=!1);if(this.Kc&&!this.gf())return void(this.Hc=!1);if(this.lf()||this.If()||this.af()||this.cf()){null!==this.input&&(this.input.parentNode?.contains(this.input)&&this.input.parentNode?.removeChild(this.input),this.input=null);const t=document.createElement('input');return this.af()?(t.setAttribute('id','username'),t.setAttribute('placeholder','Username')):this.cf()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.lf()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.If()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this._f?t.setAttribute('type','password'):t.setAttribute('type',this.cf()?'password':'text'),t.setAttribute('autofocus','autofocus'),t.setAttribute('spellcheck','false'),t.setAttribute('autocomplete','off'),t.setAttribute('style',`position: fixed; left: ${e}px; top: ${s}px; width: 1px; height: 1px; opacity: 0;`),document.body.appendChild(t),t.focus(),t.click(),this._f&&(t.oninput=t=>{if(!(t instanceof InputEvent))return;const i=t,e=i.data;null!==e&&'insertText'===i.inputType&&this.onkeydown(new KeyboardEvent('keydown',{key:e,code:e}))}),t.onkeydown=t=>{this._f&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this._f&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeyup(new KeyboardEvent('keyup',{key:t.key,code:t.key}))},t.onfocus=t=>{this.input?.parentNode?.removeChild(this.input),this.input=null,this.onfocus(t)},this.input=t,void(this.Hc=!1)}const n=t.timeStamp>=this.time+500,r=Math.abs(this.Xc-this.qc)>16||Math.abs(this.jc-this.Jc)>16;n&&!r?(this.Hc=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.lc=0,this.Hc=!1)};ontouchmove=t=>{if(!this.Qc||!this.Hc)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.qc=0|i.screenX,this.Jc=0|i.screenY,this.Vc&&-1===this.Fo()?(this.zc-this.qc>0?this.rotate(2):this.zc-this.qc<0&&this.rotate(0),this.Zc-this.Jc>0?this.rotate(3):this.Zc-this.Jc<0&&this.rotate(1)):(this.Kc||-1!==this.Fo())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this.zc=this.qc,this.Zc=this.Jc};get Qc(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get _f(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get hf(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}pf=()=>this.Uc&&this.Ml>=8&&this.Ml<=520&&this.Dl>=11&&this.Dl<=345;lf=()=>this.Uc&&-1===this.No()&&!this.Mo()&&!this.Do()&&this.Ml>=11&&this.Ml<=506&&this.Dl>=449&&this.Dl<=482;If=()=>this.Uc&&(this.Mo()||this.Do())&&this.Ml>=11&&this.Ml<=506&&this.Dl>=383&&this.Dl<=482;gf=()=>this.Uc&&this.Ml>=562&&this.Ml<=752&&this.Dl>=231&&this.Dl<=492;af=()=>!this.Uc&&2===this.ko()&&this.Ml>=301&&this.Ml<=562&&this.Dl>=262&&this.Dl<=279;cf=()=>!this.Uc&&2===this.ko()&&this.Ml>=301&&this.Ml<=562&&this.Dl>=279&&this.Dl<=296;rotate=t=>{0===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowLeft',code:'ArrowLeft'}))):1===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowUp',code:'ArrowUp'}))):2===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowRight',code:'ArrowRight'}))):3===t&&(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowDown',code:'ArrowDown'})))};Cf=()=>null!==document.fullscreenElement;rf=t=>{if(this.Cf()){const i=t.target.getBoundingClientRect(),e=window.innerHeight/l.$c.height,s=(window.innerWidth-l.$c.width*e)/2;this.Ml=0|this.Ef(t.clientX-i.left-s,0,l.$c.width*e,0,789),this.Dl=0|this.Ef(t.clientY-i.top,0,l.$c.height*e,0,532)}else{const i=l.$c.getBoundingClientRect(),e=l.$c.width/i.width,s=l.$c.height/i.height;this.Ml=(t.clientX-i.left)*e|0,this.Dl=(t.clientY-i.top)*s|0}this.Ml<0&&(this.Ml=0),this.Dl<0&&(this.Dl=0),this.Ml>789&&(this.Ml=789),this.Dl>532&&(this.Dl=532)};Ef=(t,i,e,s,n)=>(t-i)*(n-s)/(e-i)+s}},2595:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1069);class n{static enabled=!1;static vf=null;static bf=null;static Tf=0;static Rf=0;static Of=0;static Lf=0;static Sf=0;static xf=()=>{this.vf=s.A.Ut(1),this.bf=null,this.Tf=performance.now(),this.enabled=!0};static kf=()=>{this.enabled=!1,this.vf=null};static flush=()=>{let t=null;return this.bf&&this.enabled&&(t=this.bf),this.bf=null,t};static stop=()=>{let t=null;return this.vf&&this.vf.Mf>0&&this.enabled&&(t=this.vf),this.kf(),t};static ff=(t,i,e)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;this.Rf++;const s=performance.now();let n=(s-this.Tf)/10|0;n>250&&(n=250),this.Tf=s,this.Df(5),1===e?this.vf?.p1(1):this.vf?.p1(2),this.vf?.p1(n),this.vf?.p3(t+(i<<10))};static uf=t=>{if(!this.enabled)return;this.Rf++;const i=performance.now();let e=(i-this.Tf)/10|0;e>250&&(e=250),this.Tf=i,this.Df(2),1===t?this.vf?.p1(3):this.vf?.p1(4),this.vf?.p1(e)};static yf=(t,i)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;const e=performance.now();if(e-this.Of>=50){this.Of=e,this.Rf++;let s=(e-this.Tf)/10|0;s>250&&(s=250),this.Tf=e,t-this.Lf<8&&t-this.Lf>=-8&&i-this.Sf<8&&i-this.Sf>=-8?(this.Df(3),this.vf?.p1(5),this.vf?.p1(s),this.vf?.p1(t+(i-this.Sf+8<<4)+8-this.Lf)):t-this.Lf<128&&t-this.Lf>=-128&&i-this.Sf<128&&i-this.Sf>=-128?(this.Df(4),this.vf?.p1(6),this.vf?.p1(s),this.vf?.p1(t+128-this.Lf),this.vf?.p1(i+128-this.Sf)):(this.Df(5),this.vf?.p1(7),this.vf?.p1(s),this.vf?.p3(t+(i<<10))),this.Lf=t,this.Sf=i}};static sf=t=>{if(!this.enabled)return;this.Rf++;const i=performance.now();let e=(i-this.Tf)/10|0;e>250&&(e=250),this.Tf=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.Df(3),this.vf?.p1(8),this.vf?.p1(e),this.vf?.p1(t)};static nf=t=>{if(!this.enabled)return;this.Rf++;const i=performance.now();let e=(i-this.Tf)/10|0;e>250&&(e=250),this.Tf=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.Df(3),this.vf?.p1(9),this.vf?.p1(e),this.vf?.p1(t)};static Af=()=>{if(!this.enabled)return;this.Rf++;const t=performance.now();let i=(t-this.Tf)/10|0;i>250&&(i=250),this.Tf=t,this.Df(2),this.vf?.p1(10),this.vf?.p1(i)};static mf=()=>{if(!this.enabled)return;this.Rf++;const t=performance.now();let i=(t-this.Tf)/10|0;i>250&&(i=250),this.Tf=t,this.Df(2),this.vf?.p1(11),this.vf?.p1(i)};static df=()=>{if(!this.enabled)return;this.Rf++;const t=performance.now();let i=(t-this.Tf)/10|0;i>250&&(i=250),this.Tf=t,this.Df(2),this.vf?.p1(12),this.vf?.p1(i)};static wf=()=>{if(!this.enabled)return;this.Rf++;const t=performance.now();let i=(t-this.Tf)/10|0;i>250&&(i=250),this.Tf=t,this.Df(2),this.vf?.p1(13),this.vf?.p1(i)};static Df=t=>{if(this.vf&&this.vf.Mf+t>=500){const t=this.vf;this.vf=s.A.Ut(1),this.bf=t}}}},9091:(t,i,e)=>{e.d(i,{c:()=>n,g:()=>s});const s=['F11','F12'],n={'Backspace':{code:8,ch:8},'Enter':{code:10,ch:10},'Shift':{code:16,ch:65535},'Escape':{code:27,ch:27},'Tab':{code:9,ch:9},'CapsLock':{code:20,ch:65535},' ':{code:32,ch:32},'Control':{code:17,ch:65535},'Alt':{code:18,ch:65535},'Meta':{code:524,ch:65535},'ArrowLeft':{code:37,ch:65535},'ArrowRight':{code:39,ch:65535},'ArrowUp':{code:38,ch:65535},'ArrowDown':{code:40,ch:65535},'Insert':{code:155,ch:65535},'Home':{code:36,ch:65535},'PageUp':{code:33,ch:65535},'Delete':{code:127,ch:127},'End':{code:35,ch:65535},'PageDown':{code:34,ch:65535},'`':{code:192,ch:96},'~':{code:192,ch:126},'!':{code:49,ch:33},'@':{code:50,ch:64},'#':{code:51,ch:35},'$':{code:52,ch:36},'%':{code:53,ch:37},'^':{code:54,ch:94},'&':{code:55,ch:38},'*':{code:56,ch:42},'(':{code:57,ch:40},')':{code:48,ch:41},'-':{code:45,ch:45},'_':{code:45,ch:95},'=':{code:61,ch:61},'+':{code:61,ch:43},'[':{code:91,ch:91},'{':{code:91,ch:123},']':{code:93,ch:93},'}':{code:93,ch:125},'\\':{code:92,ch:92},'|':{code:92,ch:124},';':{code:59,ch:59},':':{code:59,ch:58},"'":{code:222,ch:39},'"':{code:222,ch:34},',':{code:44,ch:44},'<':{code:44,ch:60},'.':{code:46,ch:46},'>':{code:46,ch:62},'/':{code:47,ch:47},'?':{code:47,ch:63},'F1':{code:112,ch:65535},'F2':{code:113,ch:65535},'F3':{code:114,ch:65535},'F4':{code:115,ch:65535},'F5':{code:116,ch:65535},'F6':{code:117,ch:65535},'F7':{code:118,ch:65535},'F8':{code:119,ch:65535},'F9':{code:120,ch:65535},'F10':{code:121,ch:65535},'F11':{code:122,ch:65535},'F12':{code:123,ch:65535},0:{code:48,ch:48},1:{code:49,ch:49},2:{code:50,ch:50},3:{code:51,ch:51},4:{code:52,ch:52},5:{code:53,ch:53},6:{code:54,ch:54},7:{code:55,ch:55},8:{code:56,ch:56},9:{code:57,ch:57},'a':{code:65,ch:97},'b':{code:66,ch:98},'c':{code:67,ch:99},'d':{code:68,ch:100},'e':{code:69,ch:101},'f':{code:70,ch:102},'g':{code:71,ch:103},'h':{code:72,ch:104},'i':{code:73,ch:105},'j':{code:74,ch:106},'k':{code:75,ch:107},'l':{code:76,ch:108},'m':{code:77,ch:109},'n':{code:78,ch:110},'o':{code:79,ch:111},'p':{code:80,ch:112},'q':{code:81,ch:113},'r':{code:82,ch:114},'s':{code:83,ch:115},'t':{code:84,ch:116},'u':{code:85,ch:117},'v':{code:86,ch:118},'w':{code:87,ch:119},'x':{code:88,ch:120},'y':{code:89,ch:121},'z':{code:90,ch:122},'A':{code:65,ch:65},'B':{code:66,ch:66},'C':{code:67,ch:67},'D':{code:68,ch:68},'E':{code:69,ch:69},'F':{code:70,ch:70},'G':{code:71,ch:71},'H':{code:72,ch:72},'I':{code:73,ch:73},'J':{code:74,ch:74},'K':{code:75,ch:75},'L':{code:76,ch:76},'M':{code:77,ch:77},'N':{code:78,ch:78},'O':{code:79,ch:79},'P':{code:80,ch:80},'Q':{code:81,ch:81},'R':{code:82,ch:82},'S':{code:83,ch:83},'T':{code:84,ch:84},'U':{code:85,ch:85},'V':{code:86,ch:86},'W':{code:87,ch:87},'X':{code:88,ch:88},'Y':{code:89,ch:89},'Z':{code:90,ch:90}}},1120:(t,i,e)=>{e.d(i,{A:()=>c});var s=e(1069),n=e(8665),r=e(2679),h=e(2511),o=e(3819),l=e(3867),a=e(8950);class c{static Lo=[];static Nf=null;static So=null;static El=0;static Ff=1;static bl=2;static Yl=3;static Vl=4;static ia=5;static na=6;static ua=7;static Bf=1;static Uf=2;static vc=3;static Pf=4;static Gf=5;static Zl=6;static ya=1;static Aa=100;static ma=101;static pa=200;static Wf=201;static Yf=202;static ga=203;static Hf=205;static Vf=300;static Kf=301;static Xf=302;static jf=303;static zf=304;static Zf=305;static qf=306;static Jf=307;static $f=308;static Qf=309;static tu=310;static iu=311;static eu=312;static su=313;static nu=314;static ru=315;static hu=316;static ou=317;static lu=318;static au=319;static cu=320;static fu=321;static uu=322;static du=323;static Da=324;static Na=325;static wu=326;static ba=327;static Ia=401;static _a=500;static yu=501;static Au=502;static va=503;static Fa=600;static mu=601;static pu=602;static gu=603;static Iu=604;static _u=605;static Cu=606;static Eu=607;static vu=608;static bu=609;static Tu=610;static Ru=611;static Ou=612;static Ba=613;static Ua=650;static Wa=651;static Ya=652;static Ha=653;static Va=654;static Pa=655;static nc=(t,i,e)=>{this.Nf=new r.A(5e4),this.So=new r.A(5e4);const n=new s.A(t.read('data'));let h=-1;for(n.Mf+=2;n.Mf0){s.Jo=new Uint8Array(r),s.Qo=new Uint16Array(r);for(let t=0;t0){s.scripts=new l.fe(o,null);for(let t=0;t0){const n=e.lastIndexOf(',');s.Wl[t]=this.Fu(i,e.substring(0,n),parseInt(e.substring(n+1),10))}}s.Bu=new l.fe(5,null);for(let t=0;t<5;t++){const i=n.Nu;s.Bu[t]=i,0===i.length&&(s.Bu[t]=null)}}if(s.type===c.Yl&&(s.fill=1===n.xu),s.type===c.Vl||s.type===c.Ff){s.Jl=1===n.xu;const t=n.xu;e&&(s.font=e[t]),s.Ql=1===n.xu}if(s.type===c.Vl&&(s.text=n.Nu,s.jl=n.Nu),s.type!==c.Ff&&s.type!==c.Yl&&s.type!==c.Vl||(s.Hl=n.Ko),s.type!==c.Yl&&s.type!==c.Vl||(s.Xl=n.Ko,s.Kl=n.Ko),s.type===c.ia){const t=n.Nu;if(t.length>0){const e=t.lastIndexOf(',');s.sa=this.Fu(i,t.substring(0,e),parseInt(t.substring(e+1),10))}const e=n.Nu;if(e.length>0){const t=e.lastIndexOf(',');s.ea=this.Fu(i,e.substring(0,t),parseInt(e.substring(t+1),10))}}if(s.type===c.na){const t=n.xu;0!==t&&(s.model=this.la((t-1<<8)+n.xu));const i=n.xu;0!==i&&(s.Uu=this.la((i-1<<8)+n.xu)),s.al=n.xu,0===s.al?s.al=-1:s.al=(s.al-1<<8)+n.xu,s.cl=n.xu,0===s.cl?s.cl=-1:s.cl=(s.cl-1<<8)+n.xu,s.zoom=n.Lu,s.oa=n.Lu,s.fa=n.Lu}if(s.type===c.ua){s.Ol=new Int32Array(s.width*s.height),s.Ll=new Int32Array(s.width*s.height),s.Jl=1===n.xu;const t=n.xu;e&&(s.font=e[t]),s.Ql=1===n.xu,s.Hl=n.Ko,s.Sl=n.ku,s.xl=n.ku,s.Mu=1===n.xu,s.Bu=new l.fe(5,null);for(let t=0;t<5;t++){const i=n.Nu;s.Bu[t]=i,0===i.length&&(s.Bu[t]=null)}}s.zl!==c.Uf&&s.type!==c.bl||(s.Pu=n.Nu,s.action=n.Nu,s.Gu=n.Lu),s.zl!==c.Bf&&s.zl!==c.Pf&&s.zl!==c.Gf&&s.zl!==c.Zl||(s.Ec=n.Nu,0===s.Ec.length&&(s.zl===c.Bf?s.Ec='Ok':s.zl===c.Pf||s.zl===c.Gf?s.Ec='Select':s.zl===c.Zl&&(s.Ec='Continue')))}this.Nf=null,this.So=null};static Fu=(t,i,e)=>{const s=o.A.Wu(i)<<8n|BigInt(e);if(this.Nf){const t=this.Nf.get(s);if(t)return t}let n;try{n=h.A.tc(t,i,e),this.Nf?.put(s,n)}catch(t){return null}return n};static la=t=>{if(this.So){const i=this.So.get(BigInt(t));if(i)return i}const i=n.A.model(t);return this.So?.put(BigInt(t),i),i};id=-1;Su=-1;type=-1;zl=-1;_l=0;width=0;height=0;Cc=-1;Jo=null;Qo=null;scripts=null;scroll=0;hide=!1;draggable=!1;Mu=!1;Du=!1;Sl=0;xl=0;Tl=null;Rl=null;Wl=null;Bu=null;fill=!1;Jl=!1;font=null;Ql=!1;text=null;jl=null;Hl=0;Xl=0;Kl=0;sa=null;ea=null;model=null;Uu=null;al=-1;cl=-1;zoom=0;oa=0;fa=0;Pu=null;action=null;Gu=-1;Ec=null;ll=null;ml=null;pl=null;x=0;y=0;vl=0;Ol=null;Ll=null;ul=0;fl=0;la(t,i,e){let s=this.model;if(e&&(s=this.Uu),!s)return null;if(-1===t&&-1===i&&!s.Yu)return s;const r=n.A.Hu(s,!0,!0,!1);return-1===t&&-1===i||r.xa(),-1!==t&&r.ka(t),-1!==i&&r.ka(i),r.Ma(64,768,-50,-10,-50,!0),r}ac(){if(this.Su===this.id)return this.x;let t=c.Lo[this.Su];if(!t.ll||!t.ml||!t.pl)return this.x;let i=t.ll.indexOf(this.id);if(-1===i)return this.x;let e=t.ml[i];for(;t.Su!==t.id;){const s=c.Lo[t.Su];s.ll&&s.ml&&s.pl&&(i=s.ll.indexOf(t.id),-1!==i&&(e+=s.ml[i])),t=s}return e}cc(){if(this.Su===this.id)return this.y;let t=c.Lo[this.Su];if(!t.ll||!t.ml||!t.pl)return this.y;let i=t.ll.indexOf(this.id);if(-1===i)return this.y;let e=t.pl[i];for(;t.Su!==t.id;){const s=c.Lo[t.Su];s.ll&&s.ml&&s.pl&&(i=s.ll.indexOf(t.id),-1!==i&&(e+=s.pl[i])),t=s}return e}outline(t){const i=this.ac(),e=this.cc();a.A.gl(i,e,this.width,this.height,t)}move(t,i){if(this.Su===this.id)return;this.x=0,this.y=0;const e=c.Lo[this.Su];if(e.ll&&e.ml&&e.pl){const s=e.ll.indexOf(this.id);-1!==s&&(e.ml[s]=t,e.pl[s]=i)}}delete(){if(this.Su===this.id)return;const t=c.Lo[this.Su];if(t.ll&&t.ml&&t.pl){const i=t.ll.indexOf(this.id);-1!==i&&(t.ll.splice(i,1),t.ml.splice(i,1),t.pl.splice(i,1))}}}},6333:(t,i,e)=>{e.d(i,{$:()=>s});class s{id;Vu=null;constructor(t){this.id=t}Ku(t){for(;;){const i=t.xu;if(0===i)break;this.decode(i,t)}return this}}},2164:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(6333);class r extends n.${static count=0;static Lo=[];static nc=t=>{const i=new s.A(t.read('flo.dat'));this.count=i.Lu;for(let t=0;t(e>179&&(i=i/2|0),e>192&&(i=i/2|0),e>217&&(i=i/2|0),e>243&&(i=i/2|0),(t/4<<10)+(i/32<<7)+(e/2|0));static ju=(t,i)=>-1===t?12345678:((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);static zu=(t,i)=>-2===t?12345678:-1===t?(i<0?i=0:i>127&&(i=127),127-i):((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);Zu=0;texture=-1;qu=!1;Ju=!0;$u=0;Qu=0;td=0;ed=0;sd=0;nd=0;decode(t,i){1===t?(this.Zu=i.rd,this.setColor(this.Zu)):2===t?this.texture=i.xu:3===t?this.qu=!0:5===t?this.Ju=!1:6===t?this.Vu=i.Nu:console.log('Error unrecognised config code: ',t)}setColor(t){const i=(t>>16&255)/256,e=(t>>8&255)/256,s=(255&t)/256;let n=i;ei&&(h=e),s>h&&(h=s);let o=0,l=0;const a=(n+h)/2;n!==h&&(a<.5&&(l=(h-n)/(h+n)),a>=.5&&(l=(h-n)/(2-h-n)),i===h?o=(e-s)/(h-n):e===h?o=(s-i)/(h-n)+2:s===h&&(o=(i-e)/(h-n)+4)),o/=6,this.$u=256*o|0,this.Qu=256*l|0,this.td=256*a|0,this.Qu<0?this.Qu=0:this.Qu>255&&(this.Qu=255),this.td<0?this.td=0:this.td>255&&(this.td=255),this.ed=a>.5?(1-a)*l*512|0:a*l*512|0,this.ed<1&&(this.ed=1),this.sd=o*this.ed|0;let c=this.$u+(16*Math.random()|0)-8;c<0?c=0:c>255&&(c=255);let f=this.Qu+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255);let u=this.td+(48*Math.random()|0)-24;u<0?u=0:u>255&&(u=255),this.nd=r.Xu(c,f,u)}}},8317:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(1069),n=e(6333),r=e(8665),h=e(3867);class o extends n.${static count=0;static Lo=[];static nc=t=>{const i=new s.A(t.read('idk.dat'));this.count=i.Lu;for(let t=0;t=40&&t<50)this.ld[t-40]=i.Lu;else if(t>=50&&t<60)this.ad[t-50]=i.Lu;else{if(!(t>=60&&t<70))throw new Error(`Unrecognized idk config code: ${t}`);this.od[t-60]=i.Lu}}la(){if(!this.hd)return null;const t=new h.fe(this.hd.length,null);for(let i=0;i{e.d(i,{A:()=>c});var s=e(6333),n=e(1069),r=e(2679),h=e(8665),o=e(1023),l=e(6169),a=e(3867);class c extends s.${static count=0;static cache=null;static ud=null;static dd=null;static wd=0;static yd=new r.A(500);static Ad=new r.A(30);static nc=t=>{this.ud=new n.A(t.read('loc.dat'));const i=new n.A(t.read('loc.idx'));this.count=i.Lu,this.dd=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.dd||!this.ud)throw new Error('LocType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.wd=(this.wd+1)%10;const i=this.cache[this.wd];return this.ud.Mf=this.dd[t],i.id=t,i.reset(),i.Ku(this.ud),i.md||(i.md=new Int32Array(1)),-1===i.pd&&i.md&&(i.active=i.md.length>0&&i.md[0]===o.A.gd.id,i.Id&&(i.active=!0)),i};static To=()=>{this.yd=null,this.Ad=null,this.dd=null,this.cache=null,this.ud=null};hd=null;md=null;name=null;_d=null;ld=null;ad=null;width=1;length=1;Cd=!0;Ed=!0;active=!1;pd=-1;vd=!1;bd=!1;Ju=!1;al=-1;Td=!1;Rd=16;Od=0;Ld=0;Id=null;Sd=-1;xd=-1;kd=!1;Md=!0;Dd=128;Nd=128;Fd=128;Bd=0;Ud=0;Pd=0;Gd=0;Wd=!1;decode(t,i){if(1===t){const t=i.xu;this.hd=new Int32Array(t),this.md=new Int32Array(t);for(let e=0;e=30&&t<39)this.Id||(this.Id=new a.fe(5,null)),this.Id[t-30]=i.Nu,'hidden'===this.Id[t-30]?.toLowerCase()&&(this.Id[t-30]=null);else if(40===t){const t=i.xu;this.ld=new Uint16Array(t),this.ad=new Uint16Array(t);for(let e=0;e=this.hd.length)return null;let d=this.hd[a];if(-1===d)return null;const w=this.kd!==i>3;w&&(d+=65536);let y=c.yd?.get(BigInt(d));y||(y=h.A.model(65535&d),w&&y.Zd(),c.yd?.put(BigInt(d),y));const A=128!==this.Dd||128!==this.Nd||128!==this.Fd,m=0!==this.Ud||0!==this.Pd||0!==this.Gd;let p=h.A.Hu(y,!this.ld,!this.Td,i===l.A.qd&&-1===o&&!A&&!m);for(-1!==o&&(p.xa(),p.ka(o),p.Jd=null,p.$d=null);i-- >0;)p.Qd();if(this.ld&&this.ad)for(let t=0;t{e.d(i,{A:()=>l});var s=e(6333),n=e(1069),r=e(2679),h=e(8665),o=e(3867);class l extends s.${static count=0;static cache=null;static ud=null;static dd=null;static wd=0;static So=new r.A(30);static nc=t=>{this.ud=new n.A(t.read('npc.dat'));const i=new n.A(t.read('npc.idx'));this.count=i.Lu,this.dd=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.dd||!this.ud)throw new Error('NpcType not loaded!!!');for(let i=0;i<20;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.wd=(this.wd+1)%20;const i=this.cache[this.wd]=new l(t);return this.ud.Mf=this.dd[t],i.Ku(this.ud),i};static To=()=>{this.So=null,this.dd=null,this.cache=null,this.ud=null};name=null;_d=null;size=1;hd=null;od=null;Td=!1;ew=-1;sw=-1;nw=-1;rw=-1;hw=-1;ld=null;ad=null;Id=null;Dd=-1;Nd=-1;Fd=-1;ow=!0;lw=-1;aw=128;cw=128;decode(t,i){if(1===t){const t=i.xu;this.hd=new Uint16Array(t);for(let e=0;e=30&&t<40)this.Id||(this.Id=new o.fe(5,null)),this.Id[t-30]=i.Nu,'hidden'===this.Id[t-30]?.toLowerCase()&&(this.Id[t-30]=null);else if(40===t){const t=i.xu;this.ld=new Uint16Array(t),this.ad=new Uint16Array(t);for(let e=0;e{e.d(i,{A:()=>u});var s=e(6333),n=e(1069),r=e(2511),h=e(2679),o=e(8665),l=e(4583),a=e(8950),c=e(9298),f=e(3867);class u extends s.${static count=0;static cache=null;static ud=null;static dd=null;static wd=0;static Aw=!0;static So=new h.A(50);static mw=new h.A(200);static nc=(t,i)=>{this.Aw=i,this.ud=new n.A(t.read('obj.dat'));const e=new n.A(t.read('obj.idx'));this.count=e.Lu,this.dd=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.dd||!this.ud)throw new Error('ObjType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.wd=(this.wd+1)%10;const i=this.cache[this.wd];return this.ud.Mf=this.dd[t],i.id=t,i.reset(),i.Ku(this.ud),-1!==i.pw&&i.gw(),!this.Aw&&i.members&&(i.name='Members Object',i._d="Login to a members' server to use this object.",i.Id=null,i.Iw=null),i};static To=()=>{this.So=null,this.mw=null,this.dd=null,this.cache=null,this.ud=null};static kl=(t,i)=>{if(u.mw){let e=u.mw.get(BigInt(t));if(e&&e._w!==i&&-1!==e._w&&(e.Cw(),e=null),e)return e}let e=u.get(t);if(e.Ew||(i=-1),e.Ew&&e.bw&&i>1){let t=-1;for(let s=0;s<10;s++)i>=e.bw[s]&&0!==e.bw[s]&&(t=e.Ew[s]);-1!==t&&(e=u.get(t))}const s=new r.A(32,32),n=l.A.ra,h=l.A.ha,o=l.A.Tw,f=a.A.Rw,d=a.A.Ow,w=a.A.Lw,y=a.A.left,A=a.A.right,m=a.A.top,p=a.A.bottom;l.A.Sw=!1,a.A.bind(s.Rw,32,32),a.A.fillRect(0,0,32,32,c.A.Pl),l.A.rc();const g=e.xw(1),I=l.A.sin[e.kw]*e.Mw>>16,_=l.A.cos[e.kw]*e.Mw>>16;g.ca(0,e.Dw,e.Nw,e.kw,e.Fw,I+(g.iw/2|0)+e.Bw,_+e.Bw);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.Rw[t+32*i]&&(t>0&&s.Rw[t+32*i-1]>1||i>0&&s.Rw[t+32*(i-1)]>1||t<31&&s.Rw[t+32*i+1]>1||i<31&&s.Rw[t+32*(i+1)]>1)&&(s.Rw[t+32*i]=1);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.Rw[t+32*i]&&t>0&&i>0&&s.Rw[t+32*(i-1)-1]>0&&(s.Rw[t+32*i]=3153952);if(-1!==e.pw){const t=this.kl(e.Uw,10),i=t.Fl,s=t._w;t.Fl=32,t._w=32,t.Pw(5,5,22,22),t.Fl=i,t._w=s}return u.mw?.put(BigInt(t),s),a.A.bind(f,d,w),a.A.Al(y,m,A,p),l.A.ra=n,l.A.ha=h,l.A.Tw=o,l.A.Sw=!0,e.da?s.Fl=33:s.Fl=32,s._w=i,s};model=0;name=null;_d=null;ld=null;ad=null;Mw=2e3;kw=0;Dw=0;Nw=0;Fw=0;Bw=0;Gw=!1;Ww=-1;da=!1;Yw=1;members=!1;Id=null;Iw=null;Hw=-1;Vw=-1;Kw=0;Xw=-1;jw=-1;zw=0;Zw=-1;qw=-1;Jw=-1;$w=-1;Qw=-1;ty=-1;Ew=null;bw=null;Uw=-1;pw=-1;decode(t,i){if(1===t)this.model=i.Lu;else if(2===t)this.name=i.Nu;else if(3===t)this._d=i.Nu;else if(4===t)this.Mw=i.Lu;else if(5===t)this.kw=i.Lu;else if(6===t)this.Dw=i.Lu;else if(7===t)this.Fw=i.ku,this.Fw>32767&&(this.Fw-=65536);else if(8===t)this.Bw=i.ku,this.Bw>32767&&(this.Bw-=65536);else if(9===t)this.Gw=!0;else if(10===t)this.Ww=i.Lu;else if(11===t)this.da=!0;else if(12===t)this.Yw=i.Ko;else if(16===t)this.members=!0;else if(23===t)this.Hw=i.Lu,this.Kw=i.Yd;else if(24===t)this.Vw=i.Lu;else if(25===t)this.Xw=i.Lu,this.zw=i.Yd;else if(26===t)this.jw=i.Lu;else if(t>=30&&t<35)this.Id||(this.Id=new f.fe(5,null)),this.Id[t-30]=i.Nu,'hidden'===this.Id[t-30]?.toLowerCase()&&(this.Id[t-30]=null);else if(t>=35&&t<40)this.Iw||(this.Iw=new f.fe(5,null)),this.Iw[t-35]=i.Nu;else if(40===t){const t=i.xu;this.ld=new Uint16Array(t),this.ad=new Uint16Array(t);for(let e=0;e=100&&t<110&&(this.Ew&&this.bw||(this.Ew=new Uint16Array(10),this.bw=new Uint16Array(10)),this.Ew[t-100]=i.Lu,this.bw[t-100]=i.Lu)}iy(t){let i=this.Hw;if(1===t&&(i=this.Xw),-1===i)return null;let e=this.Vw,s=this.Zw;1===t&&(e=this.jw,s=this.qw);let n=o.A.model(i);if(-1!==e){const t=o.A.model(e);if(-1===s){const i=[n,t];n=o.A.Ta(i,2)}else{const i=[n,t,o.A.model(s)];n=o.A.Ta(i,3)}}if(0===t&&0!==this.Kw&&n.translate(this.Kw,0,0),1===t&&0!==this.zw&&n.translate(this.zw,0,0),this.ld&&this.ad)for(let t=0;t1){let i=-1;for(let e=0;e<10;e++)t>=this.bw[e]&&0!==this.bw[e]&&(i=this.Ew[e]);if(-1!==i)return u.get(i).xw(1)}if(u.So){const t=u.So.get(BigInt(this.id));if(t)return t}const i=o.A.model(this.model);if(this.ld&&this.ad)for(let t=0;t{e.d(i,{A:()=>h});var s=e(6333),n=e(1069),r=e(6730);class h extends s.${static count=0;static Lo=[];static nc=t=>{const i=new n.A(t.read('seq.dat'));this.count=i.Lu;for(let t=0;t{e.d(i,{A:()=>l});var s=e(6333),n=e(1069),r=e(1312),h=e(8665),o=e(2679);class l extends s.${static count=0;static Lo=[];static So=new o.A(30);static nc=t=>{const i=new n.A(t.read('spotanim.dat'));this.count=i.Lu;for(let t=0;t=40&&t<50)this.ld[t-40]=i.Lu;else{if(!(t>=50&&t<60))throw new Error(`Unrecognized spotanim config code: ${t}`);this.ad[t-50]=i.Lu}}la(){let t=l.So?.get(BigInt(this.id));if(t)return t;t=h.A.model(this.model);for(let i=0;i<6;i++)0!==this.ld[0]&&t.Ra(this.ld[i],this.ad[i]);return l.So?.put(BigInt(this.id),t),t}}},3764:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(6333),n=e(1069);class r extends s.${static count=0;static Lo=[];static uy=[];static wy=0;static nc=t=>{const i=new n.A(t.read('varp.dat'));this.count=i.Lu;for(let t=0;t{e.d(i,{A:()=>s});class s{static OPEN=0;static Iy=1;static _y=2;static Cy=4;static Ey=8;static vy=s.Iy<<4;static by=s._y<<4;static Ty=s.Cy<<4;static Ry=s.Ey<<4;static Oy=256;static Ly=512;static Sy=1024;static xy=2048;static ky=4096;static My=s.Ly<<4;static Dy=s.Sy<<4;static Ny=s.xy<<4;static Fy=s.ky<<4;static By=s.Oy<<9;static Uy=524288;static Py=2097152;static Gy=s.Py|s.Uy;static Wy=s.Oy|s.Gy;static Yy=s._y|s.Wy;static Hy=s.Ey|s.Wy;static Vy=s._y|s.Cy|s.Hy;static Ky=s.by|s.Wy;static Xy=s.Ey|s.vy|s.Ky;static jy=s.Ry|s.Wy;static zy=s.Iy|s._y|s.jy;static Zy=s.by|s.Ty|s.jy;static qy=16777215}},670:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(9456),n=e(6169),r=e(1023),h=e(4909);class o{static Dr=4;static jr=104;static index=(t,i)=>t*o.jr+i;offsetX;Jy;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.Jy=0,this.sizeX=o.jr,this.sizeZ=o.jr,this.flags=new Int32Array(this.sizeX*this.sizeZ),this.reset()}reset=()=>{for(let t=0;t{this.flags[o.index(t-this.offsetX,i-this.Jy)]|=s.A.Py};Qy=(t,i)=>{this.flags[o.index(t-this.offsetX,i-this.Jy)]&=~s.A.Py};tA=(t,i,e,r,h,o)=>{let l=s.A.Oy;o&&(l|=s.A.By);const a=t-this.offsetX,c=i-this.Jy;if(h===n.A.iA||h===n.A.eA){const t=e;e=r,r=t}for(let t=a;t=0&&t=0&&i{let l=s.A.Oy;o&&(l|=s.A.By);const a=t-this.offsetX,c=i-this.Jy;if(h===n.A.iA||h===n.A.eA){const t=e;e=r,r=t}for(let t=a;t=0&&t=0&&i{const l=t-this.offsetX,a=i-this.Jy,c=o?s.A.Fy:s.A.Ry,f=o?s.A.ky:s.A.Ey,u=o?s.A.Sy:s.A._y,d=o?s.A.Dy:s.A.by,w=o?s.A.Ly:s.A.Iy,y=o?s.A.My:s.A.vy,A=o?s.A.xy:s.A.Cy,m=o?s.A.Ny:s.A.Ty;e===r.A.rA.id?h===n.A.qd?(this.add(l,a,c),this.add(l-1,a,f)):h===n.A.iA?(this.add(l,a,u),this.add(l,a+1,d)):h===n.A.hA?(this.add(l,a,f),this.add(l+1,a,c)):h===n.A.eA&&(this.add(l,a,d),this.add(l,a-1,u)):e===r.A.oA.id||e===r.A.lA.id?h===n.A.qd?(this.add(l,a,w),this.add(l-1,a+1,y)):h===n.A.iA?(this.add(l,a,A),this.add(l+1,a+1,m)):h===n.A.hA?(this.add(l,a,y),this.add(l+1,a-1,w)):h===n.A.eA&&(this.add(l,a,m),this.add(l-1,a-1,A)):e===r.A.aA.id&&(h===n.A.qd?(this.add(l,a,u|c),this.add(l-1,a,f),this.add(l,a+1,d)):h===n.A.iA?(this.add(l,a,u|f),this.add(l,a+1,d),this.add(l+1,a,c)):h===n.A.hA?(this.add(l,a,d|f),this.add(l+1,a,c),this.add(l,a-1,u)):h===n.A.eA&&(this.add(l,a,d|c),this.add(l,a-1,u),this.add(l-1,a,f))),o&&this.nA(t,i,e,h,!1)};cA=(t,i,e,h,o)=>{const l=t-this.offsetX,a=i-this.Jy,c=o?s.A.Fy:s.A.Ry,f=o?s.A.ky:s.A.Ey,u=o?s.A.Sy:s.A._y,d=o?s.A.Dy:s.A.by,w=o?s.A.Ly:s.A.Iy,y=o?s.A.My:s.A.vy,A=o?s.A.xy:s.A.Cy,m=o?s.A.Ny:s.A.Ty;e===r.A.rA.id?h===n.A.qd?(this.remove(l,a,c),this.remove(l-1,a,f)):h===n.A.iA?(this.remove(l,a,u),this.remove(l,a+1,d)):h===n.A.hA?(this.remove(l,a,f),this.remove(l+1,a,c)):h===n.A.eA&&(this.remove(l,a,d),this.remove(l,a-1,u)):e===r.A.oA.id||e===r.A.lA.id?h===n.A.qd?(this.remove(l,a,w),this.remove(l-1,a+1,y)):h===n.A.iA?(this.remove(l,a,A),this.remove(l+1,a+1,m)):h===n.A.hA?(this.remove(l,a,y),this.remove(l+1,a-1,w)):h===n.A.eA&&(this.remove(l,a,m),this.remove(l-1,a-1,A)):e===r.A.aA.id&&(h===n.A.qd?(this.remove(l,a,u|c),this.remove(l-1,a,f),this.remove(l,a+1,d)):h===n.A.iA?(this.remove(l,a,u|f),this.remove(l,a+1,d),this.remove(l+1,a,c)):h===n.A.hA?(this.remove(l,a,d|f),this.remove(l+1,a,c),this.remove(l,a-1,u)):h===n.A.eA&&(this.remove(l,a,d|c),this.remove(l,a-1,u),this.remove(l-1,a,f))),o&&this.cA(t,i,e,h,!1)};fA=(t,i,e,h,l,a)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.Jy,u=e-this.offsetX,d=h-this.Jy,w=o.index(c,f);if(l===r.A.rA.id){if(a===n.A.qd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Ky)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Yy)===s.A.OPEN)return!0}else if(a===n.A.iA){if(c===u&&f===d+1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Hy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.jy)===s.A.OPEN)return!0}else if(a===n.A.hA){if(c===u+1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Ky)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Yy)===s.A.OPEN)return!0}else if(a===n.A.eA){if(c===u&&f===d-1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Hy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.jy)===s.A.OPEN)return!0}}else if(l===r.A.aA.id){if(a===n.A.qd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.jy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Yy)===s.A.OPEN)return!0}else if(a===n.A.iA){if(c===u-1&&f===d&&(this.flags[w]&s.A.Hy)===s.A.OPEN)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Yy)===s.A.OPEN)return!0}else if(a===n.A.hA){if(c===u-1&&f===d&&(this.flags[w]&s.A.Hy)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Ky)===s.A.OPEN)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1)return!0}else if(a===n.A.eA){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Ky)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.jy)===s.A.OPEN)return!0;if(c===u&&f===d-1)return!0}}else if(l===r.A.uA.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.by)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A._y)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Ey)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Ry)===s.A.OPEN)return!0}return!1};dA=(t,i,e,h,l,a)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.Jy,u=e-this.offsetX,d=h-this.Jy,w=o.index(c,f);if(l===r.A.wA.id||l===r.A.yA.id){if(l===r.A.yA.id&&(a=a+2&3),a===n.A.qd){if(c===u+1&&f===d&&(this.flags[w]&s.A.Ry)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A._y)===s.A.OPEN)return!0}else if(a===n.A.iA){if(c===u-1&&f===d&&(this.flags[w]&s.A.Ey)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A._y)===s.A.OPEN)return!0}else if(a===n.A.hA){if(c===u-1&&f===d&&(this.flags[w]&s.A.Ey)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.by)===s.A.OPEN)return!0}else if(a===n.A.eA){if(c===u+1&&f===d&&(this.flags[w]&s.A.Ry)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.by)===s.A.OPEN)return!0}}else if(l===r.A.AA.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.by)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A._y)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Ey)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Ry)===s.A.OPEN)return!0}return!1};mA=(t,i,e,n,r,l,a)=>{const c=e+r-1,f=n+l-1,u=o.index(t-this.offsetX,i-this.Jy);return t>=e&&t<=c&&i>=n&&i<=f||(t===e-1&&i>=n&&i<=f&&(this.flags[u]&s.A.Ey)===s.A.OPEN&&(a&h.A.qd)===s.A.OPEN||(t===c+1&&i>=n&&i<=f&&(this.flags[u]&s.A.Ry)===s.A.OPEN&&(a&h.A.hA)===s.A.OPEN||(i===n-1&&t>=e&&t<=c&&(this.flags[u]&s.A._y)===s.A.OPEN&&(a&h.A.eA)===s.A.OPEN||i===f+1&&t>=e&&t<=c&&(this.flags[u]&s.A.by)===s.A.OPEN&&(a&h.A.iA)===s.A.OPEN)))};add=(t,i,e)=>{this.flags[o.index(t,i)]|=e};remove=(t,i,e)=>{this.flags[o.index(t,i)]&=s.A.qy-e}}},4909:(t,i,e)=>{e.d(i,{A:()=>s});class s{static iA=1;static hA=2;static eA=4;static qd=8}},6169:(t,i,e)=>{e.d(i,{A:()=>s});class s{static qd=0;static iA=1;static hA=2;static eA=3}},5599:(t,i,e)=>{e.d(i,{A:()=>s});class s{static pA=0;static gA=1;static IA=2;static _A=3}},1023:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5599);class n{static rA=new n(0,s.A.pA);static oA=new n(1,s.A.pA);static aA=new n(2,s.A.pA);static lA=new n(3,s.A.pA);static CA=new n(4,s.A.gA);static EA=new n(5,s.A.gA);static wA=new n(6,s.A.gA);static yA=new n(7,s.A.gA);static AA=new n(8,s.A.gA);static uA=new n(9,s.A.IA);static gd=new n(10,s.A.IA);static vA=new n(11,s.A.IA);static bA=new n(12,s.A.IA);static TA=new n(13,s.A.IA);static RA=new n(14,s.A.IA);static OA=new n(15,s.A.IA);static LA=new n(16,s.A.IA);static SA=new n(17,s.A.IA);static xA=new n(18,s.A.IA);static kA=new n(19,s.A.IA);static MA=new n(20,s.A.IA);static DA=new n(21,s.A.IA);static _A=new n(22,s.A._A);static values(){return[this.rA,this.oA,this.SA,this.OA,this.aA,this.RA,this.uA,this.lA,this._A,this.bA,this.vA,this.wA,this.MA,this.gd,this.EA,this.TA,this.yA,this.CA,this.LA,this.AA,this.kA,this.DA,this.xA]}static of(t){const i=this.values();for(let e=0;e{e.d(i,{A:()=>A});var s=e(670),n=e(2164),r=e(1069),h=e(4583),o=e(3045),l=e(5637),a=e(4197),c=e(1312),f=e(1023),u=e(6169),d=e(9298),w=e(5518),y=e(3867);class A{static NA=Int8Array.of(1,2,4,8);static FA=Uint8Array.of(16,32,64,128);static BA=Int8Array.of(1,0,-1,0);static UA=Int8Array.of(0,-1,0,1);static PA=(17*Math.random()|0)-8;static GA=(33*Math.random()|0)-16;static et=!0;static WA=0;static YA=!1;static HA=(t,i)=>{let e=this.VA(t+45365,i+91923,4)+(this.VA(t+10294,i+37821,2)-128>>1)+(this.VA(t,i,1)-128>>2)-128;return e=35+(.3*e|0),e<10?e=10:e>60&&(e=60),e};static VA=(t,i,e)=>{const s=t/e|0,n=t&e-1,r=i/e|0,h=i&e-1,o=this.KA(s,r),l=this.KA(s+1,r),a=this.KA(s,r+1),c=this.KA(s+1,r+1),f=this.XA(o,l,n,e),u=this.XA(a,c,n,e);return this.XA(f,u,h,e)};static XA=(t,i,e,s)=>{const n=65536-h.A.cos[1024*e/s|0]>>1;return(t*(65536-n)>>16)+(i*n>>16)};static KA=(t,i)=>((this.jA(t-1,i-1)+this.jA(t+1,i-1)+this.jA(t-1,i+1)+this.jA(t+1,i+1))/16|0)+((this.jA(t-1,i)+this.jA(t+1,i)+this.jA(t,i-1)+this.jA(t,i+1))/8|0)+(this.jA(t,i)/4|0);static jA=(t,i)=>{const e=t+57*i,s=BigInt(e<<13^e);return 255&Number((s*(s*s*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static tA=(t,i,e,s,n,r,h,o,d,w,y)=>{const m=n[y][i][e],p=n[y][i+1][e],g=n[y][i+1][e+1],I=n[y][i][e+1],_=m+p+g+I>>2,C=l.A.get(o);let E=i+(e<<7)+(o<<14)+1073741824|0;C.active||(E+=-2147483648),E|=0;const v=(w<<6)+d<<24>>24;if(d===f.A._A.id)s?.zA(C.la(f.A._A.id,w,m,p,g,I,-1),t,i,e,_,E,v),C.Cd&&C.active&&h?.$y(i,e),-1!==C.al&&r.ZA(new a.A(o,t,3,i,e,c.A.Lo[C.al],!0));else if(d===f.A.gd.id||d===f.A.vA.id){const n=C.la(f.A.gd.id,w,m,p,g,I,-1);if(n){let r,h,o=0;d===f.A.vA.id&&(o+=256),w===u.A.iA||w===u.A.eA?(r=C.length,h=C.width):(r=C.width,h=C.length),s?.tA(t,i,e,_,n,null,E,v,r,h,o)}C.Cd&&h?.tA(i,e,C.width,C.length,w,C.Ed),-1!==C.al&&r.ZA(new a.A(o,t,2,i,e,c.A.Lo[C.al],!0))}else if(d>=f.A.bA.id)s?.tA(t,i,e,_,C.la(d,w,m,p,g,I,-1),null,E,v,1,1,0),C.Cd&&h?.tA(i,e,C.width,C.length,w,C.Ed),-1!==C.al&&r.ZA(new a.A(o,t,2,i,e,c.A.Lo[C.al],!0));else if(d===f.A.rA.id)s?.nA(t,i,e,_,A.NA[w],0,C.la(f.A.rA.id,w,m,p,g,I,-1),null,E,v),C.Cd&&h?.nA(i,e,d,w,C.Ed),-1!==C.al&&r.ZA(new a.A(o,t,0,i,e,c.A.Lo[C.al],!0));else if(d===f.A.oA.id)s?.nA(t,i,e,_,A.FA[w],0,C.la(f.A.oA.id,w,m,p,g,I,-1),null,E,v),C.Cd&&h?.nA(i,e,d,w,C.Ed),-1!==C.al&&r.ZA(new a.A(o,t,0,i,e,c.A.Lo[C.al],!0));else if(d===f.A.aA.id){const n=w+1&3;s?.nA(t,i,e,_,A.NA[w],A.NA[n],C.la(f.A.aA.id,w+4,m,p,g,I,-1),C.la(f.A.aA.id,n,m,p,g,I,-1),E,v),C.Cd&&h?.nA(i,e,d,w,C.Ed),-1!==C.al&&r.ZA(new a.A(o,t,0,i,e,c.A.Lo[C.al],!0))}else if(d===f.A.lA.id)s?.nA(t,i,e,_,A.FA[w],0,C.la(f.A.lA.id,w,m,p,g,I,-1),null,E,v),C.Cd&&h?.nA(i,e,d,w,C.Ed),-1!==C.al&&r.ZA(new a.A(o,t,0,i,e,c.A.Lo[C.al],!0));else if(d===f.A.uA.id)s?.tA(t,i,e,_,C.la(d,w,m,p,g,I,-1),null,E,v,1,1,0),C.Cd&&h?.tA(i,e,C.width,C.length,w,C.Ed),-1!==C.al&&r.ZA(new a.A(o,t,2,i,e,c.A.Lo[C.al],!0));else if(d===f.A.CA.id)s?.qA(t,i,e,_,0,0,E,C.la(f.A.CA.id,u.A.qd,m,p,g,I,-1),v,512*w,A.NA[w]),-1!==C.al&&r.ZA(new a.A(o,t,1,i,e,c.A.Lo[C.al],!0));else if(d===f.A.EA.id){let n=16;if(s){const r=s.JA(t,i,e);r>0&&(n=l.A.get(r>>14&32767).Rd)}s?.qA(t,i,e,_,A.BA[w]*n,A.UA[w]*n,E,C.la(f.A.CA.id,u.A.qd,m,p,g,I,-1),v,512*w,A.NA[w]),-1!==C.al&&r.ZA(new a.A(o,t,1,i,e,c.A.Lo[C.al],!0))}else d===f.A.wA.id?(s?.qA(t,i,e,_,0,0,E,C.la(f.A.CA.id,u.A.qd,m,p,g,I,-1),v,w,256),-1!==C.al&&r.ZA(new a.A(o,t,1,i,e,c.A.Lo[C.al],!0))):d===f.A.yA.id?(s?.qA(t,i,e,_,0,0,E,C.la(f.A.CA.id,u.A.qd,m,p,g,I,-1),v,w,512),-1!==C.al&&r.ZA(new a.A(o,t,1,i,e,c.A.Lo[C.al],!0))):d===f.A.AA.id&&(s?.qA(t,i,e,_,0,0,E,C.la(f.A.CA.id,u.A.qd,m,p,g,I,-1),v,w,768),-1!==C.al&&r.ZA(new a.A(o,t,1,i,e,c.A.Lo[C.al],!0)))};$A;QA;Hr;Vr;tm;im;sm;nm;rm;hm;om;lm;am;fm;um;dm;constructor(t,i,e,n){this.$A=t,this.QA=i,this.Hr=e,this.Vr=n,this.tm=new y.wm(s.A.Dr,t,i),this.im=new y.wm(s.A.Dr,t,i),this.sm=new y.wm(s.A.Dr,t,i),this.nm=new y.wm(s.A.Dr,t,i),this.dm=new y.ym(s.A.Dr,t+1,i+1),this.rm=new y.wm(s.A.Dr,t+1,i+1),this.hm=new y.Xr(t+1,i+1),this.om=new Int32Array(i),this.lm=new Int32Array(i),this.am=new Int32Array(i),this.fm=new Int32Array(i),this.um=new Int32Array(i)}Am=(t,i)=>{for(let t=0;t=0&&i[s]?.$y(e,n)}A.PA+=(5*Math.random()|0)-2,A.PA<-8?A.PA=-8:A.PA>8&&(A.PA=8),A.GA+=(5*Math.random()|0)-2,A.GA<-16?A.GA=-16:A.GA>16&&(A.GA=16);for(let i=0;i>8;for(let t=1;t>2)+(e[n+1][t]>>3)+(e[n][t-1]>>2)+(e[n][t+1]>>3)+(e[n][t]>>1);this.hm[n][t]=u-d}for(let t=0;t=0&&s0){const i=n.A.Lo[e-1];this.om[t]+=i.sd,this.lm[t]+=i.Qu,this.am[t]+=i.td,this.fm[t]+=i.ed,r=this.um[t]++}}const h=e-5;if(h>=0&&h0){const i=n.A.Lo[e-1];this.om[t]-=i.sd,this.lm[t]-=i.Qu,this.am[t]-=i.td,this.fm[t]-=i.ed,r=this.um[t]--}}}if(e>=1&&e=0&&f=0&&y=1&&c0||y>0){const m=this.Hr[i][e][c],p=this.Hr[i][e+1][c],g=this.Hr[i][e+1][c+1],I=this.Hr[i][e][c+1],_=this.hm[e][c],C=this.hm[e+1][c],E=this.hm[e+1][c+1],v=this.hm[e][c+1];let b=-1,T=-1;if(f>0){const t=256*s/l|0,i=r/a|0;let e=o/a|0;b=n.A.Xu(t,i,e);const h=t+A.PA&255;e+=A.GA,e<0?e=0:e>255&&(e=255),T=n.A.Xu(h,i,e)}if(i>0){let t=0!==f||this.sm[i][e][c]===w.A.gm;y>0&&!n.A.Lo[y-1].Ju&&(t=!1),t&&m===p&&m===g&&m===I&&(this.dm[i][e][c]|=2340)}let R=0;if(-1!==b&&(R=h.A.palette[n.A.ju(T,96)]),0===y)t?.Im(i,e,c,w.A.gm,u.A.qd,-1,m,p,g,I,n.A.ju(b,_),n.A.ju(b,C),n.A.ju(b,E),n.A.ju(b,v),d.A.Pl,d.A.Pl,d.A.Pl,d.A.Pl,R,d.A.Pl);else{const s=this.sm[i][e][c]+1,r=this.nm[i][e][c],o=n.A.Lo[y-1];let l,a,f=o.texture;f>=0?(a=h.A._m(f),l=-1):o.Zu===d.A.Cm?(a=0,l=-2,f=-1):(l=n.A.Xu(o.$u,o.Qu,o.td),a=h.A.palette[n.A.zu(o.nd,96)]),t?.Im(i,e,c,s,r,f,m,p,g,I,n.A.ju(b,_),n.A.ju(b,C),n.A.ju(b,E),n.A.ju(b,v),n.A.zu(l,_),n.A.zu(l,C),n.A.zu(l,E),n.A.zu(l,v),R,a)}}}}}}for(let e=1;e0&&(t<<=3,i<<=3,e<<=3);for(let s=0;s<=n;s++)for(let r=0;r<=this.QA;r++)for(let h=0;h<=this.$A;h++){if(this.dm[s][h][r]&t){let i=r,e=r,l=s,a=s;for(;i>0&&this.dm[s][h][i-1]&t;)i--;for(;e0;){for(let s=i;s<=e;s++)if(!(this.dm[l-1][h][s]&t))break t;l--}t:for(;a=8){const s=this.Hr[a][h][i]-240,r=this.Hr[l][h][i];o.A.Tm(n,1,128*h,s,128*i,128*h,r,128*e+128);for(let s=l;s<=a;s++)for(let n=i;n<=e;n++)this.dm[s][h][n]&=~t}}if(this.dm[s][h][r]&i){let t=h,e=h,l=s,a=s;for(;t>0&&this.dm[s][t-1][r]&i;)t--;for(;e0;){for(let s=t;s<=e;s++)if(!(this.dm[l-1][s][r]&i))break t;l--}t:for(;a=8){const s=this.Hr[a][t][r]-240,h=this.Hr[l][t][r];o.A.Tm(n,2,128*t,s,128*r,128*e+128,h,128*r);for(let s=l;s<=a;s++)for(let n=t;n<=e;n++)this.dm[s][n][r]&=~i}}if(this.dm[s][h][r]&e){let t=h,i=h,l=r,a=r;for(;l>0&&this.dm[s][h][l-1]&e;)l--;for(;a0;){for(let i=l;i<=a;i++)if(!(this.dm[s][t-1][i]&e))break t;t--}t:for(;i=4){const r=this.Hr[s][t][l];o.A.Tm(n,4,128*t,r,128*l,128*i+128,r,128*a+128);for(let n=t;n<=i;n++)for(let t=l;t<=a;t++)this.dm[s][n][t]&=~e}}}}}};Rm=(t,i,e,r)=>{let h=0;for(let t=0;t>24;break}for(let n=t;n=0&&t=0&&n{const o=new r.A(new Uint8Array(h));for(let r=0;r=0&&a=0&&c>24,this.nm[r][a][c]=(f-2&3)<<24>>24):f<=81?this.Vr[r][a][c]=f-49<<24>>24:this.tm[r][a][c]=f-81<<24>>24}else for(;f=o.xu,0!==f;){if(1===f){o.xu;break}f<=49&&o.xu}}};Lm=(t,i,e,n,h,o)=>{const l=new r.A(new Uint8Array(n));let a=-1;for(;;){const n=l.Sm;if(0===n)return;a+=n;let r=0;for(;;){const n=l.Sm;if(0===n)break;r+=n-1;const c=63&r,f=r>>6&63,u=r>>12,d=l.xu,w=d>>2,y=3&d,A=f+h,m=c+o;if(A>0&&m>0&&A=0&&(n=e[s]),this.tA(u,A,m,t,i,n,a,w,y)}}}};tA=(t,i,e,s,n,r,h,o,d)=>{if(A.et){if(16&this.Vr[t][i][e])return;if(this.pm(t,i,e)!==A.WA)return}const w=this.Hr[t][i][e],y=this.Hr[t][i+1][e],m=this.Hr[t][i+1][e+1],p=this.Hr[t][i][e+1],g=w+y+m+p>>2,I=l.A.get(h);let _=i+(e<<7)+(h<<14)+1073741824|0;I.active||(_+=-2147483648),_|=0;const C=(d<<6)+o<<24>>24;if(o===f.A._A.id)(!A.et||I.active||I.Wd)&&(s?.zA(I.la(f.A._A.id,d,w,y,m,p,-1),t,i,e,g,_,C),I.Cd&&I.active&&r?.$y(i,e),-1!==I.al&&n.ZA(new a.A(h,t,3,i,e,c.A.Lo[I.al],!0)));else if(o===f.A.gd.id||o===f.A.vA.id){const l=I.la(f.A.gd.id,d,w,y,m,p,-1);if(l){let n,r,h=0;if(o===f.A.vA.id&&(h+=256),d===u.A.iA||d===u.A.eA?(n=I.length,r=I.width):(n=I.width,r=I.length),s?.tA(t,i,e,g,l,null,_,C,n,r,h)&&I.Md)for(let s=0;s<=n;s++)for(let n=0;n<=r;n++){let r=l.xm/4|0;r>30&&(r=30),r>this.rm[t][i+s][e+n]&&(this.rm[t][i+s][e+n]=r<<24>>24)}}I.Cd&&r?.tA(i,e,I.width,I.length,d,I.Ed),-1!==I.al&&n.ZA(new a.A(h,t,2,i,e,c.A.Lo[I.al],!0))}else if(o>=f.A.bA.id)s?.tA(t,i,e,g,I.la(o,d,w,y,m,p,-1),null,_,C,1,1,0),o>=f.A.bA.id&&o<=f.A.SA.id&&o!==f.A.TA.id&&t>0&&(this.dm[t][i][e]|=2340),I.Cd&&r?.tA(i,e,I.width,I.length,d,I.Ed),-1!==I.al&&n.ZA(new a.A(h,t,2,i,e,c.A.Lo[I.al],!0));else if(o===f.A.rA.id)s?.nA(t,i,e,g,A.NA[d],0,I.la(f.A.rA.id,d,w,y,m,p,-1),null,_,C),d===u.A.qd?(I.Md&&(this.rm[t][i][e]=50,this.rm[t][i][e+1]=50),I.Ju&&(this.dm[t][i][e]|=585)):d===u.A.iA?(I.Md&&(this.rm[t][i][e+1]=50,this.rm[t][i+1][e+1]=50),I.Ju&&(this.dm[t][i][e+1]|=1170)):d===u.A.hA?(I.Md&&(this.rm[t][i+1][e]=50,this.rm[t][i+1][e+1]=50),I.Ju&&(this.dm[t][i+1][e]|=585)):d===u.A.eA&&(I.Md&&(this.rm[t][i][e]=50,this.rm[t][i+1][e]=50),I.Ju&&(this.dm[t][i][e]|=1170)),I.Cd&&r?.nA(i,e,o,d,I.Ed),-1!==I.al&&n.ZA(new a.A(h,t,0,i,e,c.A.Lo[I.al],!0)),16!==I.Rd&&s?.km(t,i,e,I.Rd);else if(o===f.A.oA.id)s?.nA(t,i,e,g,A.FA[d],0,I.la(f.A.oA.id,d,w,y,m,p,-1),null,_,C),I.Md&&(d===u.A.qd?this.rm[t][i][e+1]=50:d===u.A.iA?this.rm[t][i+1][e+1]=50:d===u.A.hA?this.rm[t][i+1][e]=50:d===u.A.eA&&(this.rm[t][i][e]=50)),I.Cd&&r?.nA(i,e,o,d,I.Ed),-1!==I.al&&n.ZA(new a.A(h,t,0,i,e,c.A.Lo[I.al],!0));else if(o===f.A.aA.id){const l=d+1&3;s?.nA(t,i,e,g,A.NA[d],A.NA[l],I.la(f.A.aA.id,d+4,w,y,m,p,-1),I.la(f.A.aA.id,l,w,y,m,p,-1),_,C),I.Ju&&(d===u.A.qd?(this.dm[t][i][e]|=265,this.dm[t][i][e+1]|=1170):d===u.A.iA?(this.dm[t][i][e+1]|=1170,this.dm[t][i+1][e]|=585):d===u.A.hA?(this.dm[t][i+1][e]|=585,this.dm[t][i][e]|=1170):d===u.A.eA&&(this.dm[t][i][e]|=1170,this.dm[t][i][e]|=585)),I.Cd&&r?.nA(i,e,o,d,I.Ed),-1!==I.al&&n.ZA(new a.A(h,t,0,i,e,c.A.Lo[I.al],!0)),16!==I.Rd&&s?.km(t,i,e,I.Rd)}else if(o===f.A.lA.id)s?.nA(t,i,e,g,A.FA[d],0,I.la(f.A.lA.id,d,w,y,m,p,-1),null,_,C),I.Md&&(d===u.A.qd?this.rm[t][i][e+1]=50:d===u.A.iA?this.rm[t][i+1][e+1]=50:d===u.A.hA?this.rm[t][i+1][e]=50:d===u.A.eA&&(this.rm[t][i][e]=50)),I.Cd&&r?.nA(i,e,o,d,I.Ed),-1!==I.al&&n.ZA(new a.A(h,t,0,i,e,c.A.Lo[I.al],!0));else if(o===f.A.uA.id)s?.tA(t,i,e,g,I.la(o,d,w,y,m,p,-1),null,_,C,1,1,0),I.Cd&&r?.tA(i,e,I.width,I.length,d,I.Ed),-1!==I.al&&n.ZA(new a.A(h,t,2,i,e,c.A.Lo[I.al],!0));else if(o===f.A.CA.id)s?.qA(t,i,e,g,0,0,_,I.la(f.A.CA.id,u.A.qd,w,y,m,p,-1),C,512*d,A.NA[d]),-1!==I.al&&n.ZA(new a.A(h,t,1,i,e,c.A.Lo[I.al],!0));else if(o===f.A.EA.id){let r=16;if(s){const n=s.JA(t,i,e);n>0&&(r=l.A.get(n>>14&32767).Rd)}s?.qA(t,i,e,g,A.BA[d]*r,A.UA[d]*r,_,I.la(f.A.CA.id,u.A.qd,w,y,m,p,-1),C,512*d,A.NA[d]),-1!==I.al&&n.ZA(new a.A(h,t,1,i,e,c.A.Lo[I.al],!0))}else o===f.A.wA.id?(s?.qA(t,i,e,g,0,0,_,I.la(f.A.CA.id,u.A.qd,w,y,m,p,-1),C,d,256),-1!==I.al&&n.ZA(new a.A(h,t,1,i,e,c.A.Lo[I.al],!0))):o===f.A.yA.id?(s?.qA(t,i,e,g,0,0,_,I.la(f.A.CA.id,u.A.qd,w,y,m,p,-1),C,d,512),-1!==I.al&&n.ZA(new a.A(h,t,1,i,e,c.A.Lo[I.al],!0))):o===f.A.AA.id&&(s?.qA(t,i,e,g,0,0,_,I.la(f.A.CA.id,u.A.qd,w,y,m,p,-1),C,d,768),-1!==I.al&&n.ZA(new a.A(h,t,1,i,e,c.A.Lo[I.al],!0)))};pm=(t,i,e)=>8&this.Vr[t][i][e]?0:t<=0||!(2&this.Vr[1][i][e])?t:t-1}},3045:(t,i,e)=>{e.d(i,{A:()=>g});var s=e(4583),n=e(1161),r=e(3795),h=e(8256),o=e(670),l=e(9222),a=e(6855),c=e(7441),f=e(6666),u=e(5748),d=e(3479),w=e(8950),y=e(2771),A=e(5518),m=e(6169),p=e(3867);class g{static Mm=new p.Dm(8,32,51,51,!1);static Nm=new p.fe(100,null);static Fm=new Int32Array(o.A.Dr);static Bm=new p.Um(o.A.Dr,500,null);static Pm=new p.fe(500,null);static Gm=new f.A;static Wm=0;static Ym=0;static Hm=0;static Vm=0;static Km=0;static Xm=0;static jm=0;static zm=0;static Zm=0;static qm=0;static Jm=0;static $m=0;static Qm=0;static tp=0;static ip=0;static ep=0;static sp=0;static np=0;static rp=0;static hp=0;static op=0;static lp=0;static ap=!1;static cp=null;static fp=Uint8Array.of(19,55,38,155,255,110,137,205,76);static up=Uint8Array.of(160,192,80,96,0,144,80,48,160);static dp=Uint8Array.of(76,8,137,4,0,1,38,2,19);static wp=Int8Array.of(0,0,2,0,0,2,1,1,0);static yp=Int8Array.of(2,0,0,2,0,0,0,4,4);static Ap=Int8Array.of(0,4,4,8,0,0,8,0,0);static mp=Int8Array.of(1,1,0,0,0,8,0,0,8);static pp=Int8Array.of(53,-53,-53,53);static gp=Int8Array.of(-53,-53,53,53);static Ip=Int8Array.of(-45,45,45,-45);static _p=Int8Array.of(45,45,-45,-45);static Cp=[new Int8Array(16),Int8Array.of(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,0,0,0,1,1,0,0,1,1,1,0,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1),Int8Array.of(0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0),Int8Array.of(0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0),Int8Array.of(1,1,1,1,1,1,1,1,0,1,1,1,0,0,1,1),Int8Array.of(1,1,1,1,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,0,0,0,0,1,1,0,1,1,1,0,1,1,1),Int8Array.of(0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1)];static Ep=[Int8Array.of(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),Int8Array.of(12,8,4,0,13,9,5,1,14,10,6,2,15,11,7,3),Int8Array.of(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0),Int8Array.of(3,7,11,15,2,6,10,14,1,5,9,13,0,4,8,12)];static vp=Int32Array.of(41,39248,41,4643,41,41,41,41,41,41,41,41,41,41,41,43086,41,41,41,41,41,41,41,8602,41,28992,41,41,41,41,41,5056,41,41,41,41,41,41,41,41,41,41,41,41,41,41,3131,41,41,41);static bp=0;static Ml=0;static Dl=0;static Tp=-1;static Rp=-1;static et=!0;static init=(t,i,e,n,r)=>{this.Ym=0,this.Hm=0,this.Vm=t,this.Km=i,this.Xm=t/2|0,this.jm=i/2|0;const h=new p.Dm(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let i=0;i<2048;i+=64){this.zm=s.A.sin[t],this.Zm=s.A.cos[t],this.qm=s.A.sin[i],this.Jm=s.A.cos[i];const o=(t-128)/32|0,l=i/64|0;for(let t=-26;t<=26;t++)for(let i=-26;i<=26;i++){const s=128*t,a=128*i;let c=!1;for(let t=-e;t<=n;t+=128)if(this.Op(s,a,r[o]+t)){c=!0;break}h[o][l][t+25+1][i+25+1]=c}}for(let t=0;t<8;t++)for(let i=0;i<32;i++)for(let e=-25;e<25;e++)for(let s=-25;s<25;s++){let n=!1;t:for(let r=-1;r<=1;r++)for(let o=-1;o<=1;o++){if(h[t][i][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t][(i+1)%31][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][i][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][(i+1)%31][e+r+25+1][s+o+25+1]){n=!0;break t}}this.Mm[t][i][e+25][s+25]=n}};static To=()=>{this.Nm=null,this.Fm=null,this.Bm=null,this.Gm=null,this.Mm=null,this.Pm=null,this.cp=null,console.log('World3D unloaded!')};static Tm=(t,i,e,s,n,r,o,l)=>{g.Bm[t][g.Fm[t]++]=new h.A(e/128|0,r/128|0,n/128|0,l/128|0,i,e,r,n,l,s,o)};static Op=(t,i,e)=>{const s=i*this.qm+t*this.Jm>>16,n=i*this.Jm-t*this.qm>>16,r=e*this.zm+n*this.Zm>>16,h=e*this.Zm-n*this.zm>>16;if(r<50||r>3500)return!1;const o=this.Xm+((s<<9)/r|0),l=this.jm+((h<<9)/r|0);return o>=this.Ym&&o<=this.Vm&&l>=this.Hm&&l<=this.Km};Lp;$A;QA;Sp;xp;_h;kp;Mp;Dp;Np=0;Fp=0;Bp=0;constructor(t,i,e,s){this.Lp=e,this.$A=s,this.QA=i,this.xp=new p.Eh(e,s,i,null),this.kp=new p.ym(e,s+1,i+1),this.Sp=t,this._h=new p.fe(5e3,null),this.Mp=new Int32Array(1e4),this.Dp=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this.Fp=t;for(let i=0;i{const e=this.xp[0][t][i];for(let e=0;e<3;e++){this.xp[e][t][i]=this.xp[e+1][t][i];const s=this.xp[e][t][i];s&&s.level--}this.xp[0][t][i]||(this.xp[0][t][i]=new r.A(0,t,i));const s=this.xp[0][t][i];s&&(s.Pp=e),this.xp[3][t][i]=null};Em=(t,i,e,s)=>{const n=this.xp[t][i][e];n&&(n.Gp=s)};Im=(t,i,e,s,n,h,o,l,a,c,f,u,w,m,p,g,I,_,C,E)=>{if(s===A.A.gm){for(let s=t;s>=0;s--)this.xp[s][i][e]||(this.xp[s][i][e]=new r.A(s,i,e));const s=this.xp[t][i][e];s&&(s.Wp=new d.A(f,u,w,m,-1,C,!1))}else if(s===A.A.Yp){for(let s=t;s>=0;s--)this.xp[s][i][e]||(this.xp[s][i][e]=new r.A(s,i,e));const s=this.xp[t][i][e];s&&(s.Wp=new d.A(p,g,I,_,h,E,o===l&&o===a&&o===c))}else{for(let s=t;s>=0;s--)this.xp[s][i][e]||(this.xp[s][i][e]=new r.A(s,i,e));const d=this.xp[t][i][e];d&&(d.Hp=new y.A(i,s,g,l,w,n,f,c,E,p,h,_,C,a,I,m,o,e,u))}};zA=(t,i,e,s,n,h,o)=>{this.xp[i][e][s]||(this.xp[i][e][s]=new r.A(i,e,s));const a=this.xp[i][e][s];a&&(a.Vp=new l.A(n,128*e+64,128*s+64,t,h,o))};Kp=(t,i,e)=>{const s=this.xp[t][i][e];s&&(s.Vp=null)};Xp=(t,i,e,s,n,h,o,l)=>{let a=0;const c=this.xp[s][t][i];if(c)for(let t=0;ta&&(a=e)}else this.xp[s][t][i]=new r.A(s,t,i);const f=this.xp[s][t][i];f&&(f.Zp=new u.A(e,128*t+64,128*i+64,h,o,l,n,a))};qp=(t,i,e)=>{const s=this.xp[t][i][e];s&&(s.Zp=null)};nA=(t,i,e,s,n,h,o,l,c,f)=>{if(!o&&!l)return;for(let s=t;s>=0;s--)this.xp[s][i][e]||(this.xp[s][i][e]=new r.A(s,i,e));const u=this.xp[t][i][e];u&&(u.Jp=new a.A(s,128*i+64,128*e+64,n,h,o,l,c,f))};cA=(t,i,e,s)=>{const n=this.xp[t][i][e];1===s&&n&&(n.Jp=null)};qA=(t,i,e,s,n,h,o,l,a,f,u)=>{if(!l)return;for(let s=t;s>=0;s--)this.xp[s][i][e]||(this.xp[s][i][e]=new r.A(s,i,e));const d=this.xp[t][i][e];d&&(d.$p=new c.A(s,128*i+n+64,128*e+h+64,u,f,l,o,a))};Qp=(t,i,e)=>{const s=this.xp[t][i][e];s&&(s.$p=null)};km=(t,i,e,s)=>{const n=this.xp[t][i][e];if(!n)return;const r=n.$p;if(!r)return;const h=128*i+64,o=128*e+64;r.x=h+((r.x-h)*s/16|0),r.z=o+((r.z-o)*s/16|0)};tg=(t,i,e,s)=>{if(!s)return;const n=this.xp[t][i][e];if(!n)return;const r=n.$p;r&&(r.model=s)};ig=(t,i,e,s)=>{if(!s)return;const n=this.xp[t][i][e];if(!n)return;const r=n.Vp;r&&(r.model=s)};eg=(t,i,e,s)=>{if(!s)return;const n=this.xp[t][i][e];if(!n)return;const r=n.Jp;r&&(r.sg=s)};ng=(t,i,e,s,n)=>{if(!s)return;const r=this.xp[e][t][i];if(!r)return;const h=r.Jp;h&&(h.sg=s,h.rg=n)};tA=(t,i,e,s,n,r,h,o,l,a,c)=>{if(!n&&!r)return!0;const f=128*i+64*l,u=128*e+64*a;return this.hg(f,u,s,t,i,e,l,a,n,r,h,o,c,!1)};og=(t,i,e,s,n,r,h,o,l,a)=>{if(!n&&!r)return!0;let c=i-l,f=s-l,u=i+l,d=s+l;return a&&(o>640&&o<1408&&(d+=128),o>1152&&o<1920&&(u+=128),(o>1664||o<384)&&(f-=128),o>128&&o<896&&(c-=128)),c=c/128|0,f=f/128|0,u=u/128|0,d=d/128|0,this.hg(i,s,e,t,c,f,u+1-c,d-f+1,n,r,h,0,o,!0)};lg=(t,i,e,s,n,r,h,o,l,a,c,f)=>!l&&!a||this.hg(i,s,e,t,n,r,h+1-n,o-r+1,l,a,c,0,f,!0);sA=(t,i,e)=>{const s=this.xp[t][i][e];if(s)for(let t=0;t>29&3)&&n.cg===i&&n.fg===e)return void this.ug(n)}};dg=(t,i,e,s)=>{if(!s)return;const n=this.xp[t][i][e];if(n)for(let t=0;t>29&3))return void(i.model=s)}};wg=()=>{for(let t=0;t{const s=this.xp[t][i][e];return s&&s.Jp?s.Jp.ag:0};yg=(t,i,e)=>{const s=this.xp[t][e][i];return s&&s.$p?s.$p.ag:0};Ag=(t,i,e)=>{const s=this.xp[t][i][e];if(!s)return 0;for(let t=0;t>29&3)&&n.cg===i&&n.fg===e)return n.ag}return 0};mg=(t,i,e)=>{const s=this.xp[t][i][e];return s&&s.Vp?s.Vp.ag:0};pg=(t,i,e,s)=>{const n=this.xp[t][i][e];if(n){if(n.Jp&&n.Jp.ag===s)return 255&n.Jp.info;if(n.$p&&n.$p.ag===s)return 255&n.$p.info;if(n.Vp&&n.Vp.ag===s)return 255&n.Vp.info;for(let t=0;t{const r=i*(0|Math.sqrt(e*e+s*s+n*n))>>8;for(let i=0;i{if(i0){const n=this.xp[t][i+1][e-1];n&&n.Vp&&n.Vp.model&&n.Vp.model.gg&&this._g(s,n.Vp.model,128,0,-128,!0)}};Ig=(t,i,e,s,n,r)=>{let h=!0,o=i;const l=i+s,a=e-1,c=e+n;for(let f=t;f<=t+1;f++)if(f!==this.Lp){for(let u=o;u<=l;u++)if(!(u<0||u>=this.$A))for(let o=a;o<=c;o++){if(o<0||o>=this.QA||h&&u=e||u===i))continue;const a=this.xp[f][u][o];if(!a)continue;const d=128*(u-i)+64*(1-s),w=128*(o-e)+64*(1-n),y=((this.Sp[f][u][o]+this.Sp[f][u+1][o]+this.Sp[f][u][o+1]+this.Sp[f][u+1][o+1])/4|0)-((this.Sp[t][i][e]+this.Sp[t][i+1][e]+this.Sp[t][i][e+1]+this.Sp[t][i+1][e+1])/4|0),A=a.Jp;A&&A.sg&&A.sg.gg&&this._g(r,A.sg,d,y,w,h),A&&A.rg&&A.rg.gg&&this._g(r,A.rg,d,y,w,h);for(let t=0;t{this.Bp++;let h=0;const o=i.Kd,l=i.Vd;if(t.gg&&t.Tg)for(let r=0;ri.Rg)continue;const u=t.Kd[r]-e;if(ui.Lg)continue;const d=t.Xd[r]-n;if(di.xg)continue;if(i.gg&&i.Tg)for(let t=0;t{const h=this.xp[t][i][e];if(!h)return;const o=h.Wp;if(o){const t=o.color;if(0!==t)for(let i=0;i<4;i++)s[n]=t,s[n+1]=t,s[n+2]=t,s[n+3]=t,n+=r;return}const l=h.Hp;if(!l)return;const a=l.shape,c=l.angle,f=l.Ug,u=l.Pg,d=g.Cp[a],w=g.Ep[c];let y=0;if(0===f)for(let t=0;t<4;t++)0!==d[w[y++]]&&(s[n]=u),0!==d[w[y++]]&&(s[n+1]=u),0!==d[w[y++]]&&(s[n+2]=u),0!==d[w[y++]]&&(s[n+3]=u),n+=r;else for(let t=0;t<4;t++)s[n]=0===d[w[y++]]?f:u,s[n+1]=0===d[w[y++]]?f:u,s[n+2]=0===d[w[y++]]?f:u,s[n+3]=0===d[w[y++]]?f:u,n+=r};click=(t,i)=>{g.ap=!0,g.Ml=t,g.Dl=i,g.Tp=-1,g.Rp=-1};draw=(t,i,e,n,r,h,o)=>{t<0?t=0:t>=128*this.$A&&(t=128*this.$A-1),e<0?e=0:e>=128*this.QA&&(e=128*this.QA-1),g.Wm++,g.zm=s.A.sin[h],g.Zm=s.A.cos[h],g.qm=s.A.sin[r],g.Jm=s.A.cos[r],g.cp=g.Mm[(h-128)/32|0][r/64|0],g.$m=t,g.Qm=i,g.tp=e,g.ip=t/128|0,g.ep=e/128|0,g.op=n,g.sp=g.ip-25,g.sp<0&&(g.sp=0),g.rp=g.ep-25,g.rp<0&&(g.rp=0),g.np=g.ip+25,g.np>this.$A&&(g.np=this.$A),g.hp=g.ep+25,g.hp>this.QA&&(g.hp=this.QA),this.Gg(),g.lp=0;for(let t=this.Fp;t=2e3)?(h.visible=!0,h.update=!0,h.Wg=h.jp>0,g.lp++):(h.visible=!1,h.update=!1,h.Yg=0))}}for(let t=this.Fp;t=g.np))for(let t=-25;t<=0;t++){const n=g.ep+t,r=g.ep-t;let h;if(e>=g.sp&&(n>=g.rp&&(h=i[e][n],h&&h.visible&&this.Hg(h,!0,o)),r=g.rp&&(h=i[s][n],h&&h.visible&&this.Hg(h,!0,o)),r=g.np))for(let t=-25;t<=0;t++){const n=g.ep+t,r=g.ep-t;let h;if(e>=g.sp&&(n>=g.rp&&(h=i[e][n],h&&h.visible&&this.Hg(h,!1,o)),r=g.rp&&(h=i[s][n],h&&h.visible&&this.Hg(h,!1,o)),r{if(!c&&!f)return!1;for(let t=h;t=this.$A||i>=this.QA)return!1;const e=this.xp[s][t][i];if(e&&e.jp>=5)return!1}const A=new n.A(s,e,t,i,c,f,w,h,h+l-1,o,o+a-1,u,d);for(let t=h;th&&(e|=1),to&&(e+=8),i=0;e--)this.xp[e][t][i]||(this.xp[e][t][i]=new r.A(e,t,i));const n=this.xp[s][t][i];n&&(n.zp[n.jp]=A,n.Vg[n.jp]=e,n.Kg|=e,n.jp++)}return y&&(this._h[this.Np++]=A),!0};ug=t=>{for(let i=t.cg;i<=t.Eg;i++)for(let e=t.fg;e<=t.vg;e++){const s=this.xp[t.level][i][e];if(s){for(let i=0;i{const t=g.Fm[g.op],i=g.Bm[g.op];g.bp=0;for(let e=0;e=0&&s<=50){n=t.jg+25-g.ep,n<0&&(n=0),r=t.QA+25-g.ep,r>50&&(r=50);let i=!1;for(;n<=r;)if(g.cp&&g.cp[s][n++]){i=!0;break}if(i){if(h=g.$m-t.Og,h>32)t.mode=1;else{if(h>=-32)continue;t.mode=2,h=-h}t.zg=(t.Sg-g.tp<<8)/h|0,t.Zg=(t.xg-g.tp<<8)/h|0,t.qg=(t.Rg-g.Qm<<8)/h|0,t.Jg=(t.iw-g.Qm<<8)/h|0,g.Pm[g.bp++]=t}}}else if(2===t.type){if(s=t.jg+25-g.ep,s>=0&&s<=50){n=t.Xg+25-g.ip,n<0&&(n=0),r=t.$A+25-g.ip,r>50&&(r=50);let i=!1;for(;n<=r;)if(g.cp&&g.cp[n++][s]){i=!0;break}if(i){if(h=g.tp-t.Sg,h>32)t.mode=3;else{if(h>=-32)continue;t.mode=4,h=-h}t.$g=(t.Og-g.$m<<8)/h|0,t.Qg=(t.Lg-g.$m<<8)/h|0,t.qg=(t.Rg-g.Qm<<8)/h|0,t.Jg=(t.iw-g.Qm<<8)/h|0,g.Pm[g.bp++]=t}}}else if(4===t.type&&(s=t.Rg-g.Qm,s>128&&(n=t.jg+25-g.ep,n<0&&(n=0),r=t.QA+25-g.ep,r>50&&(r=50),n<=r))){let i=t.Xg+25-g.ip;i<0&&(i=0),h=t.$A+25-g.ip,h>50&&(h=50);let e=!1;t:for(let t=i;t<=h;t++)for(let i=n;i<=r;i++)if(g.cp&&g.cp[t][i]){e=!0;break t}e&&(t.mode=5,t.$g=(t.Og-g.$m<<8)/s|0,t.Qg=(t.Lg-g.$m<<8)/s|0,t.zg=(t.Sg-g.tp<<8)/s|0,t.Zg=(t.xg-g.tp<<8)/s|0,g.Pm[g.bp++]=t)}}};Hg=(t,i,e)=>{for(g.Gm.ZA(t);;){let t;do{if(t=g.Gm.tI(),!t)return}while(!t.update);const s=t.x,n=t.z,r=t.level,h=t.iI,o=this.xp[r];if(t.visible){if(i){if(r>0){const t=this.xp[r-1][s][n];if(t&&t.update)continue}if(s<=g.ip&&s>g.sp){const i=o[s-1][n];if(i&&i.update&&(i.visible||!(1&t.Kg)))continue}if(s>=g.ip&&sg.rp){const i=o[s][n-1];if(i&&i.update&&(i.visible||!(8&t.Kg)))continue}if(n>=g.ep&&nn&&(a+=6),c=g.fp[a],t.oI=g.dp[a]),f&&(f.lI&g.up[a]?16===f.lI?(t.Yg=3,t.aI=g.wp[a],t.cI=3-t.aI):32===f.lI?(t.Yg=6,t.aI=g.yp[a],t.cI=6-t.aI):64===f.lI?(t.Yg=12,t.aI=g.Ap[a],t.cI=12-t.aI):(t.Yg=9,t.aI=g.mp[a],t.cI=9-t.aI):t.Yg=0,f.lI&c&&!this.fI(h,s,n,f.lI)&&f.sg?.draw(0,g.zm,g.Zm,g.qm,g.Jm,f.x-g.$m,f.y-g.Qm,f.z-g.tp,f.ag),f.uI&c&&!this.fI(h,s,n,f.uI)&&f.rg?.draw(0,g.zm,g.Zm,g.qm,g.Jm,f.x-g.$m,f.y-g.Qm,f.z-g.tp,f.ag)),u&&!this.visible(h,s,n,u.model.iw))if(u.type&c)u.model.draw(u.angle,g.zm,g.Zm,g.qm,g.Jm,u.x-g.$m,u.y-g.Qm,u.z-g.tp,u.ag);else if(768&u.type){const t=u.x-g.$m,i=u.y-g.Qm,e=u.z-g.tp,s=u.angle;let n,r;if(n=s===m.A.iA||s===m.A.hA?-t:t,r=s===m.A.hA||s===m.A.eA?-e:e,256&u.type&&rn){const n=t+g.Ip[s],r=e+g._p[s];u.model.draw(512*s+1280&2047,g.zm,g.Zm,g.qm,g.Jm,n,i,r,u.ag)}}if(l){const i=t.Vp;i&&i.model?.draw(0,g.zm,g.Zm,g.qm,g.Jm,i.x-g.$m,i.y-g.Qm,i.z-g.tp,i.ag);const e=t.Zp;e&&0===e.offset&&(e.dI&&e.dI.draw(0,g.zm,g.Zm,g.qm,g.Jm,e.x-g.$m,e.y-g.Qm,e.z-g.tp,e.ag),e.wI&&e.wI.draw(0,g.zm,g.Zm,g.qm,g.Jm,e.x-g.$m,e.y-g.Qm,e.z-g.tp,e.ag),e.yI&&e.yI.draw(0,g.zm,g.Zm,g.qm,g.Jm,e.x-g.$m,e.y-g.Qm,e.z-g.tp,e.ag))}const d=t.Kg;if(0!==d){if(sg.ip&&1&d){const t=o[s-1][n];t&&t.update&&g.Gm.ZA(t)}if(n>g.ep&&8&d){const t=o[s][n-1];t&&t.update&&g.Gm.ZA(t)}}}if(0!==t.Yg){let i=!0;for(let e=0;ei.cg&&(r+=1),ei.fg&&(r+=8),ss&&(s=n);const h=g.ep-i.fg,l=i.vg-g.ep;i.AI=l>h?s+l:s+h}for(;;){let t=-50,i=-1;for(let e=0;et&&(t=s.AI,i=e))}if(-1===i)break;const l=g.Nm[i];if(l){l.Wm=g.Wm;let t=l.model;t||(t=l.rI?.draw(e)??null),t&&!this.mI(h,l.cg,l.Eg,l.fg,l.vg,t.iw)&&t.draw(l.hI,g.zm,g.Zm,g.qm,g.Jm,l.x-g.$m,l.y-g.Qm,l.z-g.tp,l.ag);for(let t=l.cg;t<=l.Eg;t++)for(let i=l.fg;i<=l.vg;i++){const e=o[t][i];e&&(0!==e.Yg?g.Gm.ZA(e):t===s&&i===n||!e.update||g.Gm.ZA(e))}}}if(t.Wg)continue}if(!t.update||0!==t.Yg)continue;if(s<=g.ip&&s>g.sp){const t=o[s-1][n];if(t&&t.update)continue}if(s>=g.ip&&sg.rp){const t=o[s][n-1];if(t&&t.update)continue}if(n>=g.ep&&n=r){const r=t+g.pp[n],h=s+g.gp[n];i.model.draw(512*n+256,g.zm,g.Zm,g.qm,g.Jm,r,e,h,i.ag)}if(512&i.type&&h<=r){const r=t+g.Ip[n],h=s+g._p[n];i.model.draw(512*n+1280&2047,g.zm,g.Zm,g.qm,g.Jm,r,e,h,i.ag)}}const e=t.Jp;e&&(e.uI&t.oI&&!this.fI(h,s,n,e.uI)&&e.rg?.draw(0,g.zm,g.Zm,g.qm,g.Jm,e.x-g.$m,e.y-g.Qm,e.z-g.tp,e.ag),e.lI&t.oI&&!this.fI(h,s,n,e.lI)&&e.sg?.draw(0,g.zm,g.Zm,g.qm,g.Jm,e.x-g.$m,e.y-g.Qm,e.z-g.tp,e.ag))}if(rg.ip){const t=o[s-1][n];t&&t.update&&g.Gm.ZA(t)}if(n>g.ep){const t=o[s][n-1];t&&t.update&&g.Gm.ZA(t)}}};sI=(t,i,e,n,r,h,o,l)=>{let a,c,f,u,d=a=(e<<7)-g.$m,y=c=(n<<7)-g.tp,A=f=d+128,m=u=y+128,p=this.Sp[i][e][n]-g.Qm,I=this.Sp[i][e+1][n]-g.Qm,_=this.Sp[i][e+1][n+1]-g.Qm,C=this.Sp[i][e][n+1]-g.Qm,E=y*o+d*l>>16;if(y=y*l-d*o>>16,d=E,E=p*h-y*r>>16,y=p*r+y*h>>16,p=E,y<50)return;if(E=c*o+A*l>>16,c=c*l-A*o>>16,A=E,E=I*h-c*r>>16,c=I*r+c*h>>16,I=E,c<50)return;if(E=m*o+f*l>>16,m=m*l-f*o>>16,f=E,E=_*h-m*r>>16,m=_*r+m*h>>16,_=E,m<50)return;if(E=u*o+a*l>>16,u=u*l-a*o>>16,a=E,E=C*h-u*r>>16,u=C*r+u*h>>16,C=E,u<50)return;const v=s.A.ra+((d<<9)/y|0),b=s.A.ha+((p<<9)/y|0),T=s.A.ra+((A<<9)/c|0),R=s.A.ha+((I<<9)/c|0),O=s.A.ra+((f<<9)/m|0),L=s.A.ha+((_<<9)/m|0),S=s.A.ra+((a<<9)/u|0),x=s.A.ha+((C<<9)/u|0);if(s.A.alpha=0,(O-S)*(R-x)-(L-x)*(T-S)>0)if(s.A.pI=O<0||S<0||T<0||O>w.A.gI||S>w.A.gI||T>w.A.gI,g.ap&&this.II(g.Ml,g.Dl,L,x,R,O,S,T)&&(g.Tp=e,g.Rp=n),-1===t._I)12345678!==t.CI&&s.A.EI(O,S,T,L,x,R,t.CI,t.vI,t.bI);else if(g.et){const i=g.vp[t._I];s.A.EI(O,S,T,L,x,R,this.TI(i,t.CI),this.TI(i,t.vI),this.TI(i,t.bI))}else t.flat?s.A.RI(O,S,T,L,x,R,t.CI,t.vI,t.bI,d,p,y,A,a,I,C,c,u,t._I):s.A.RI(O,S,T,L,x,R,t.CI,t.vI,t.bI,f,_,m,a,A,C,I,u,c,t._I);if(!((v-T)*(x-R)-(b-R)*(S-T)<=0))if(s.A.pI=v<0||T<0||S<0||v>w.A.gI||T>w.A.gI||S>w.A.gI,g.ap&&this.II(g.Ml,g.Dl,b,R,x,v,T,S)&&(g.Tp=e,g.Rp=n),-1!==t._I){if(!g.et)return void s.A.RI(v,T,S,b,R,x,t.OI,t.bI,t.vI,d,p,y,A,a,I,C,c,u,t._I);const i=g.vp[t._I];s.A.EI(v,T,S,b,R,x,this.TI(i,t.OI),this.TI(i,t.bI),this.TI(i,t.vI))}else 12345678!==t.OI&&s.A.EI(v,T,S,b,R,x,t.OI,t.bI,t.vI)};nI=(t,i,e,n,r,h,o)=>{let l=e.Kd.length;for(let t=0;t>16;if(a=a*o-i*h>>16,i=c,c=l*r-a*n>>16,a=l*n+a*r>>16,l=c,a<50)return;e.LI&&(y.A.SI[t]=i,y.A.xI[t]=l,y.A.kI[t]=a),y.A.MI[t]=s.A.ra+((i<<9)/a|0),y.A.DI[t]=s.A.ha+((l<<9)/a|0)}s.A.alpha=0,l=e.NI.length;for(let n=0;n0)if(s.A.pI=l<0||a<0||c<0||l>w.A.gI||a>w.A.gI||c>w.A.gI,g.ap&&this.II(g.Ml,g.Dl,f,u,d,l,a,c)&&(g.Tp=t,g.Rp=i),e.LI&&-1!==e.LI[n])if(g.et){const t=g.vp[e.LI[n]];s.A.EI(l,a,c,f,u,d,this.TI(t,e.UI[n]),this.TI(t,e.GI[n]),this.TI(t,e.WI[n]))}else e.flat?s.A.RI(l,a,c,f,u,d,e.UI[n],e.GI[n],e.WI[n],y.A.SI[0],y.A.xI[0],y.A.kI[0],y.A.SI[1],y.A.SI[3],y.A.xI[1],y.A.xI[3],y.A.kI[1],y.A.kI[3],e.LI[n]):s.A.RI(l,a,c,f,u,d,e.UI[n],e.GI[n],e.WI[n],y.A.SI[r],y.A.xI[r],y.A.kI[r],y.A.SI[h],y.A.SI[o],y.A.xI[h],y.A.xI[o],y.A.kI[h],y.A.kI[o],e.LI[n]);else 12345678!==e.UI[n]&&s.A.EI(l,a,c,f,u,d,e.UI[n],e.GI[n],e.WI[n])}};eI=(t,i,e)=>{const s=this.kp[t][i][e];if(s===-g.Wm)return!1;if(s===g.Wm)return!0;{const s=i<<7,n=e<<7;return this.YI(s+1,this.Sp[t][i][e],n+1)&&this.YI(s+128-1,this.Sp[t][i+1][e],n+1)&&this.YI(s+128-1,this.Sp[t][i+1][e+1],n+128-1)&&this.YI(s+1,this.Sp[t][i][e+1],n+128-1)?(this.kp[t][i][e]=g.Wm,!0):(this.kp[t][i][e]=-g.Wm,!1)}};fI=(t,i,e,s)=>{if(!this.eI(t,i,e))return!1;const n=i<<7,r=e<<7,h=this.Sp[t][i][e]-1,o=h-120,l=h-230,a=h-238;if(s<16){if(1===s){if(n>g.$m){if(!this.YI(n,h,r))return!1;if(!this.YI(n,h,r+128))return!1}if(t>0){if(!this.YI(n,o,r))return!1;if(!this.YI(n,o,r+128))return!1}return!!this.YI(n,l,r)&&this.YI(n,l,r+128)}if(2===s){if(r0){if(!this.YI(n,o,r+128))return!1;if(!this.YI(n+128,o,r+128))return!1}return!!this.YI(n,l,r+128)&&this.YI(n+128,l,r+128)}if(4===s){if(n0){if(!this.YI(n+128,o,r))return!1;if(!this.YI(n+128,o,r+128))return!1}return!!this.YI(n+128,l,r)&&this.YI(n+128,l,r+128)}if(8===s){if(r>g.tp){if(!this.YI(n,h,r))return!1;if(!this.YI(n+128,h,r))return!1}if(t>0){if(!this.YI(n,o,r))return!1;if(!this.YI(n+128,o,r))return!1}return!!this.YI(n,l,r)&&this.YI(n+128,l,r)}}return!!this.YI(n+64,a,r+64)&&(16===s?this.YI(n,l,r+128):32===s?this.YI(n+128,l,r+128):64===s?this.YI(n+128,l,r):128===s?this.YI(n,l,r):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,i,e,s)=>{if(this.eI(t,i,e)){const n=i<<7,r=e<<7;return this.YI(n+1,this.Sp[t][i][e]-s,r+1)&&this.YI(n+128-1,this.Sp[t][i+1][e]-s,r+1)&&this.YI(n+128-1,this.Sp[t][i+1][e+1]-s,r+128-1)&&this.YI(n+1,this.Sp[t][i][e+1]-s,r+128-1)}return!1};mI=(t,i,e,s,n,r)=>{let h,o;if(i!==e||s!==n){for(h=i;h<=e;h++)for(o=s;o<=n;o++)if(this.kp[t][h][o]===-g.Wm)return!1;o=1+(i<<7);const l=2+(s<<7),a=this.Sp[t][i][s]-r;if(!this.YI(o,a,l))return!1;const c=(e<<7)-1;if(!this.YI(c,a,l))return!1;const f=(n<<7)-1;return!!this.YI(o,a,f)&&this.YI(c,a,f)}return!!this.eI(t,i,s)&&(h=i<<7,o=s<<7,this.YI(h+1,this.Sp[t][i][s]-r,o+1)&&this.YI(h+128-1,this.Sp[t][i+1][s]-r,o+1)&&this.YI(h+128-1,this.Sp[t][i+1][s+1]-r,o+128-1)&&this.YI(h+1,this.Sp[t][i][s+1]-r,o+128-1))};YI=(t,i,e)=>{for(let s=0;s0){const t=n.Sg+(n.zg*s>>8),r=n.xg+(n.Zg*s>>8),h=n.Rg+(n.qg*s>>8),o=n.iw+(n.Jg*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(2===n.mode){const s=t-n.Og;if(s>0){const t=n.Sg+(n.zg*s>>8),r=n.xg+(n.Zg*s>>8),h=n.Rg+(n.qg*s>>8),o=n.iw+(n.Jg*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(3===n.mode){const s=n.Sg-e;if(s>0){const e=n.Og+(n.$g*s>>8),r=n.Lg+(n.Qg*s>>8),h=n.Rg+(n.qg*s>>8),o=n.iw+(n.Jg*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(4===n.mode){const s=e-n.Sg;if(s>0){const e=n.Og+(n.$g*s>>8),r=n.Lg+(n.Qg*s>>8),h=n.Rg+(n.qg*s>>8),o=n.iw+(n.Jg*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(5===n.mode){const s=i-n.Rg;if(s>0){const i=n.Og+(n.$g*s>>8),r=n.Lg+(n.Qg*s>>8),h=n.Sg+(n.zg*s>>8),o=n.xg+(n.Zg*s>>8);if(t>=i&&t<=r&&e>=h&&e<=o)return!0}}}return!1};II=(t,i,e,s,n,r,h,o)=>{if(ie&&i>s&&i>n)return!1;if(tr&&t>h&&t>o)return!1;const l=(i-s)*(o-h)-(t-h)*(n-s);return((i-e)*(h-r)-(t-r)*(s-e))*l>0&&l*((i-n)*(r-o)-(t-o)*(e-n))>0};TI=(t,i)=>((i=(127-i)*(127&t)/160|0)<2?i=2:i>126&&(i=126),(65408&t)+i)}},7121:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{}},4197:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{HI;VI;KI;XI;index;ly;ul;fl;constructor(t,i,e,s,n,r,h){super(),this.HI=i,this.VI=e,this.KI=s,this.XI=n,this.index=t,this.ly=r,h&&-1!==r.wl&&this.ly.delay?(this.ul=Math.random()*this.ly.dl|0,this.fl=Math.random()*this.ly.delay[this.ul]|0):(this.ul=-1,this.fl=0)}}},9418:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(7121),n=e(1312),r=e(3867);class h extends s.A{x=0;z=0;hI=0;jI=!1;size=1;Sa=-1;zI=-1;ZI=-1;qI=-1;JI=-1;$I=-1;QI=-1;t_=null;i_=100;e_=0;s_=0;n_=0;r_=0;h_=-1e3;o_=0;l_=0;a_=-1;c_=0;f_=0;u_=-1;d_=0;w_=0;y_=-1;A_=0;m_=0;p_=0;g_=0;I_=-1;__=0;C_=0;E_=0;v_=0;b_=0;T_=0;R_=0;O_=0;L_=0;S_=0;x_=0;Wm=0;height=0;k_=0;pathLength=0;M_=new Int32Array(10);D_=new Int32Array(10);N_=new r.fe(10,!1);F_=0;B_=-1;U_=-1;P_=-1;G_=-1;move(t,i,e){if(-1!==this.y_&&n.A.Lo[this.y_].priority<=1&&(this.y_=-1),!t){const t=i-this.M_[0],s=e-this.D_[0];if(t>=-8&&t<=8&&s>=-8&&s<=8){this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.M_[t]=this.M_[t-1],this.D_[t]=this.D_[t-1],this.N_[t]=this.N_[t-1];return this.M_[0]=i,this.D_[0]=e,void(this.N_[0]=!1)}}this.pathLength=0,this.F_=0,this.M_[0]=i,this.D_[0]=e,this.x=128*this.M_[0]+64*this.size,this.z=128*this.D_[0]+64*this.size}step(t,i){let e=this.M_[0],s=this.D_[0];0===i?(e--,s++):1===i?s++:2===i?(e++,s++):3===i?e--:4===i?e++:5===i?(e--,s--):6===i?s--:7===i&&(e++,s--),-1!==this.y_&&n.A.Lo[this.y_].priority<=1&&(this.y_=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.M_[t]=this.M_[t-1],this.D_[t]=this.D_[t-1],this.N_[t]=this.N_[t-1];this.M_[0]=e,this.D_[0]=s,this.N_[0]=t}}},8268:(t,i,e)=>{e.d(i,{A:()=>d});var s=e(9418),n=e(8665),r=e(2679),h=e(8738),o=e(1312),l=e(8317),a=e(1302),c=e(3819),f=e(3867),u=e(9298);class d extends s.A{static W_=1;static Y_=2;static H_=4;static V_=8;static K_=16;static X_=32;static j_=64;static z_=128;static Z_=256;static q_=512;static La=[u.A.J_,u.A.Q_,u.A.tC,u.A.iC,u.A.eC,u.A.sC,u.A.nC,u.A.rC,u.A.hC,u.A.oC,u.A.lC,u.A.aC,u.A.cC,u.A.fC,u.A.uC,u.A.dC];static Oa=[[u.A.wC,u.A.yC,u.A.AC,u.A.mC,u.A.pC,u.A.gC,u.A.IC,u.A._C,u.A.CC,u.A.EC,u.A.vC,u.A.bC],[u.A.TC,u.A.RC,u.A.OC,u.A.LC,u.A.SC,u.A.xC,u.A.kC,u.A.MC,u.A.DC,u.A.NC,u.A.FC,u.A.BC,u.A.UC,u.A.PC,u.A.GC,u.A.WC],[u.A.WC-1,u.A.TC+1,u.A.RC,u.A.OC,u.A.LC,u.A.SC,u.A.xC,u.A.kC,u.A.MC,u.A.DC,u.A.NC,u.A.FC,u.A.BC,u.A.UC,u.A.PC,u.A.GC],[u.A.YC,u.A.HC,u.A.VC,u.A.KC,u.A.XC,u.A.jC],[u.A.zC,u.A.ZC,u.A.qC,u.A.JC,u.A.$C,u.A.QC,u.A.tE,u.A.iE]];static So=new r.A(200);name=null;visible=!1;eE=0;sE=0;nE=new Uint16Array(12);rE=new Uint16Array(5);Ka=0;hE=0n;y=0;oE=0;lE=0;aE=0;cE=0;fE=0;uE=null;Xg=0;jg=0;$A=0;QA=0;et=!1;draw(t){if(!this.visible)return null;let i=this.fw();if(this.height=i.iw,i.yw=!0,this.et)return i;if(-1!==this.I_&&-1!==this.__){const t=h.A.Lo[this.I_],e=n.A.Hu(t.la(),!0,!t.Td,!1);e.translate(-this.v_,0,0),e.xa(),t.ly&&t.ly.frames&&e.ka(t.ly.frames[this.__]),e.Jd=null,e.$d=null,128===t.aw&&128===t.cw||e.scale(t.aw,t.cw,t.aw),e.Ma(t.Od+64,t.Ld+850,-30,-50,-30,!0);const s=[i,e];i=n.A.dE(s,2)}if(this.uE&&(t>=this.lE&&(this.uE=null),t>=this.oE&&t=d.Oa[i].length)&&(e=0),this.rE[i]=e}this.Sa=t.Lu,65535===this.Sa&&(this.Sa=-1),this.zI=t.Lu,65535===this.zI&&(this.zI=-1),this.ZI=t.Lu,65535===this.ZI&&(this.ZI=-1),this.qI=t.Lu,65535===this.qI&&(this.qI=-1),this.JI=t.Lu,65535===this.JI&&(this.JI=-1),this.$I=t.Lu,65535===this.$I&&(this.$I=-1),this.QI=t.Lu,65535===this.QI&&(this.QI=-1),this.name=c.A.Ca(c.A.Ea(t.wE)),this.Ka=t.xu,this.visible=!0,this.hE=0n;for(let t=0;t<12;t++)this.hE<<=0x4n,this.nE[t]>=256&&(this.hE+=BigInt(this.nE[t])-256n);this.nE[0]>=256&&(this.hE+=BigInt(this.nE[0])-256n>>4n),this.nE[1]>=256&&(this.hE+=BigInt(this.nE[1])-256n>>8n);for(let t=0;t<5;t++)this.hE<<=0x3n,this.hE+=BigInt(this.rE[t]);this.hE<<=0x1n,this.hE+=BigInt(this.eE)}fd(){if(!this.visible)return null;const t=new f.fe(12,null);let i=0;for(let e=0;e<12;e++){const s=this.nE[e];if(s>=256&&s<512&&(t[i++]=l.A.Lo[s-256].fd()),s>=512){const e=a.A.get(s-512).fd(this.eE);e&&(t[i++]=e)}}const e=n.A.Ta(t,i);for(let t=0;t<5;t++)0!==this.rE[t]&&(e.Ra(d.Oa[t][0],d.Oa[t][this.rE[t]]),1===t&&e.Ra(d.La[0],d.La[this.rE[t]]));return e}fw(){let t=this.hE,i=-1,e=-1,s=-1,r=-1;if(this.y_>=0&&0===this.p_){const n=o.A.Lo[this.y_];if(n.frames&&(i=n.frames[this.A_]),this.u_>=0&&this.u_!==this.Sa){const t=o.A.Lo[this.u_].frames;t&&(e=t[this.d_])}n.ny>=0&&(s=n.ny,t+=BigInt(s-this.nE[5])<<8n),n.hy>=0&&(r=n.hy,t+=BigInt(r-this.nE[3])<<16n)}else if(this.u_>=0){const t=o.A.Lo[this.u_].frames;t&&(i=t[this.d_])}let h=d.So?.get(t);if(!h){const i=new f.fe(12,null);let e=0;for(let t=0;t<12;t++){let n=this.nE[t];if(r>=0&&3===t&&(n=r),s>=0&&5===t&&(n=s),n>=256&&n<512){const t=l.A.Lo[n-256].la();t&&(i[e++]=t)}if(n>=512){const t=a.A.get(n-512).iy(this.eE);t&&(i[e++]=t)}}h=n.A.Ta(i,e);for(let t=0;t<5;t++)0!==this.rE[t]&&(h.Ra(d.Oa[t][0],d.Oa[t][this.rE[t]]),1===t&&h.Ra(d.La[0],d.La[this.rE[t]]));h.xa(),h.Ma(64,850,-30,-50,-30,!0),d.So?.put(t,h)}if(this.et)return h;const c=n.A.uw(h,!0);return-1!==i&&-1!==e?c.dw(i,e,o.A.Lo[this.y_].ey):-1!==i&&c.ka(i),c.ww(),c.Jd=null,c.$d=null,c}}},9222:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;model;ag;info;constructor(t,i,e,s,n,r){this.y=t,this.x=i,this.z=e,this.model=s,this.ag=n,this.info=r}}},1161:(t,i,e)=>{e.d(i,{A:()=>s});class s{level;y;x;z;model;rI;hI;cg;Eg;fg;vg;ag;info;AI=0;Wm=0;constructor(t,i,e,s,n,r,h,o,l,a,c,f,u){this.level=t,this.y=i,this.x=e,this.z=s,this.model=n,this.rI=r,this.hI=h,this.cg=o,this.Eg=l,this.fg=a,this.vg=c,this.ag=f,this.info=u}}},5748:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;yI;wI;dI;ag;offset;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.yI=s,this.wI=n,this.dI=r,this.ag=h,this.offset=o}}},8256:(t,i,e)=>{e.d(i,{A:()=>s});class s{Xg;$A;jg;QA;type;Og;Lg;Sg;xg;Rg;iw;mode=0;$g=0;Qg=0;zg=0;Zg=0;qg=0;Jg=0;constructor(t,i,e,s,n,r,h,o,l,a,c){this.Xg=t,this.$A=i,this.jg=e,this.QA=s,this.type=n,this.Og=r,this.Lg=h,this.Sg=o,this.xg=l,this.Rg=a,this.iw=c}}},3795:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1982),n=e(3867);class r extends s.A{level;x;z;iI;zp;Vg;Wp=null;Hp=null;Jp=null;$p=null;Vp=null;Zp=null;Pp=null;jp=0;Kg=0;Gp=0;visible=!1;update=!1;Wg=!1;Yg=0;aI=0;cI=0;oI=0;constructor(t,i,e){super(),this.iI=this.level=t,this.x=i,this.z=e,this.zp=new n.fe(5,null),this.Vg=new Int32Array(5)}}},2771:(t,i,e)=>{e.d(i,{A:()=>s});class s{static MI=new Int32Array(6);static DI=new Int32Array(6);static SI=new Int32Array(6);static xI=new Int32Array(6);static kI=new Int32Array(6);static yE=[Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,2,6),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,13,14)];static AE=[Int8Array.of(0,1,2,3,0,0,1,3),Int8Array.of(1,1,2,3,1,0,1,3),Int8Array.of(0,1,2,3,1,0,1,3),Int8Array.of(0,0,1,2,0,0,2,4,1,0,4,3),Int8Array.of(0,0,1,4,0,0,4,3,1,1,2,4),Int8Array.of(0,0,4,3,1,0,1,2,1,0,2,4),Int8Array.of(0,1,2,4,1,0,1,4,1,0,4,3),Int8Array.of(0,4,1,2,0,4,2,5,1,0,4,5,1,0,5,3),Int8Array.of(0,4,1,2,0,4,2,3,0,4,3,5,1,0,4,5),Int8Array.of(0,0,4,5,1,4,1,2,1,4,2,3,1,4,3,5),Int8Array.of(0,0,1,5,0,1,4,5,0,1,2,4,1,0,5,3,1,5,4,3,1,4,2,3),Int8Array.of(1,0,1,5,1,1,4,5,1,1,2,4,0,0,5,3,0,5,4,3,0,4,2,3),Int8Array.of(1,0,5,4,1,0,1,5,0,0,4,3,0,4,5,3,0,5,2,3,0,1,2,5)];static mE=128;static pE=this.mE/2|0;static gE=this.mE/4|0;static IE=3*this.mE/4|0;Kd;jd;Xd;UI;GI;WI;NI;FI;BI;LI;flat;shape;angle;Ug;Pg;constructor(t,i,e,n,r,h,o,l,a,c,f,u,d,w,y,A,m,p,g){this.flat=!(m!==n||m!==w||m!==l),this.shape=i,this.angle=h,this.Ug=d,this.Pg=a;const I=s.yE[i],_=I.length;this.Kd=new Int32Array(_),this.jd=new Int32Array(_),this.Xd=new Int32Array(_);const C=new Int32Array(_),E=new Int32Array(_),v=t*s.mE,b=p*s.mE;for(let t=0;t<_;t++){let i,a,f,d,p,_=I[t];!(1&_)&&_<=8&&(_=1+(_-h-h-1&7)),_>8&&_<=12&&(_=9+(_-h-9&3)),_>12&&_<=16&&(_=13+(_-h-13&3)),1===_?(i=v,a=b,f=m,d=o,p=c):2===_?(i=v+s.pE,a=b,f=m+n>>1,d=o+g>>1,p=c+e>>1):3===_?(i=v+s.mE,a=b,f=n,d=g,p=e):4===_?(i=v+s.mE,a=b+s.pE,f=n+w>>1,d=g+r>>1,p=e+y>>1):5===_?(i=v+s.mE,a=b+s.mE,f=w,d=r,p=y):6===_?(i=v+s.pE,a=b+s.mE,f=w+l>>1,d=r+A>>1,p=y+u>>1):7===_?(i=v,a=b+s.mE,f=l,d=A,p=u):8===_?(i=v,a=b+s.pE,f=l+m>>1,d=A+o>>1,p=u+c>>1):9===_?(i=v+s.pE,a=b+s.gE,f=m+n>>1,d=o+g>>1,p=c+e>>1):10===_?(i=v+s.IE,a=b+s.pE,f=n+w>>1,d=g+r>>1,p=e+y>>1):11===_?(i=v+s.pE,a=b+s.IE,f=w+l>>1,d=r+A>>1,p=y+u>>1):12===_?(i=v+s.gE,a=b+s.pE,f=l+m>>1,d=A+o>>1,p=u+c>>1):13===_?(i=v+s.gE,a=b+s.gE,f=m,d=o,p=c):14===_?(i=v+s.IE,a=b+s.gE,f=n,d=g,p=e):15===_?(i=v+s.IE,a=b+s.IE,f=w,d=r,p=y):(i=v+s.gE,a=b+s.IE,f=l,d=A,p=u),this.Kd[t]=i,this.jd[t]=f,this.Xd[t]=a,C[t]=d,E[t]=p}const T=s.AE[i],R=T.length/4|0;this.NI=new Int32Array(R),this.FI=new Int32Array(R),this.BI=new Int32Array(R),this.UI=new Int32Array(R),this.GI=new Int32Array(R),this.WI=new Int32Array(R),this.LI=-1!==f?new Int32Array(R):null;let O=0;for(let t=0;t{e.d(i,{A:()=>s});class s{static gm=0;static Yp=1;static _E=2;static CE=3;static EE=4;static vE=5;static pE=6;static gE=7;static IE=8;static bE=9;static TE=10;static RE=11}},3479:(t,i,e)=>{e.d(i,{A:()=>s});class s{OI;bI;CI;vI;_I;color;flat;constructor(t,i,e,s,n,r,h){this.OI=t,this.bI=i,this.CI=e,this.vI=s,this._I=n,this.color=r,this.flat=h}}},6855:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;lI;uI;sg;rg;ag;info;constructor(t,i,e,s,n,r,h,o,l){this.y=t,this.x=i,this.z=e,this.lI=s,this.uI=n,this.sg=r,this.rg=h,this.ag=o,this.info=l}}},7441:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;type;angle;model;ag;info;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.type=s,this.angle=n,this.model=r,this.ag=h,this.info=o}}},7536:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n{OE;LE;constructor(t){this.LE=[],this.OE=t;for(let i=0;i{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{xE;kE;constructor(){super(),this.xE=this,this.kE=this}ME(){this.kE&&this.xE&&(this.kE.xE=this.xE,this.xE.kE=this.kE,this.xE=null,this.kE=null)}}},3819:(t,i,e)=>{e.d(i,{A:()=>s});class s{static DE=['_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9'];static NE=t=>{t=t.trim();let i=0n;for(let e=0;e=65&&s<=90?i+=BigInt(s+1-65):s>=97&&s<=122?i+=BigInt(s+1-97):s>=48&&s<=57&&(i+=BigInt(s+27-48))}return i};static Ea=t=>{if(t<0n||t>=6582952005840035281n)return'invalid_name';if(t%37n===0n)return'invalid_name';let i=0;const e=Array(12);for(;0n!==t;){const s=t;t/=37n,e[11-i++]=this.DE[Number(s-37n*t)]}return e.slice(12-i).join('')};static FE=t=>{const i=[...t.toLowerCase()];let e=!0;for(let t=0;t='a'&&s<='z'&&(i[t]=s.toUpperCase(),e=!1),'.'!==s&&'!'!==s||(e=!0)}return i.join('')};static BE=t=>{let i='';for(let e=0;e(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static Ca=t=>{if(0===t.length)return t;const i=[...t];for(let t=0;t='a'&&i[t+1]<='z'&&(i[t+1]=String.fromCharCode(i[t+1].charCodeAt(0)+'A'.charCodeAt(0)-97)));return i[0]>='a'&&i[0]<='z'&&(i[0]=String.fromCharCode(i[0].charCodeAt(0)+'A'.charCodeAt(0)-97)),i.join('')};static Wu=t=>{const i=t.toUpperCase();let e=0n;for(let t=0;t>56n)&0xffffffffffffffn;return e}}},6666:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n{UE;cursor=null;constructor(){const t=new s.A;t.next=t,t.SE=t,this.UE=t}ZA(t){t.SE&&t.Cw(),t.SE=this.UE.SE,t.next=this.UE,t.SE&&(t.SE.next=t),t.next.SE=t}PE(t){t.SE&&t.Cw(),t.SE=this.UE,t.next=this.UE.next,t.SE.next=t,t.next&&(t.next.SE=t)}tI(){const t=this.UE.next;return t===this.UE?null:(t?.Cw(),t)}head(){const t=this.UE.next;return t===this.UE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}GE(){const t=this.UE.SE;return t===this.UE?(this.cursor=null,null):(this.cursor=t?.SE||null,t)}next(){const t=this.cursor;return t===this.UE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}SE(){const t=this.cursor;return t===this.UE?(this.cursor=null,null):(this.cursor=t?.SE||null,t)}clear(){for(;;){const t=this.UE.next;if(t===this.UE)return;t?.Cw()}}}},1982:(t,i,e)=>{e.d(i,{A:()=>s});class s{key;next;SE;constructor(){this.key=0n,this.next=this,this.SE=this}Cw(){this.SE&&this.next&&(this.SE.next=this.next,this.next.SE=this.SE,this.next=null,this.SE=null)}}},2679:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(2512),n=e(7536);class r{WE;YE;history;available;constructor(t){this.WE=t,this.available=t,this.YE=new n.A(1024),this.history=new s.A}get(t){const i=this.YE.get(t);return i&&this.history.push(i),i}put(t,i){if(0===this.available){const t=this.history.pop();t?.Cw(),t?.ME()}else this.available--;this.YE.put(t,i),this.history.push(i)}clear(){const t=this.history.pop();t?(t.Cw(),t.ME()):this.available=this.WE}}},2512:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n{head;constructor(){this.head=new s.A}push(t){t.kE&&t.ME(),t.kE=this.head.kE,t.xE=this.head,t.kE&&(t.kE.xE=t),t.xE.kE=t}pop(){const t=this.head.xE;return t===this.head?null:(t?.ME(),t)}}},8534:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(3867);class r{static Lo=[];static nc=t=>{const i=new s.A(t.read('base_head.dat')),e=new s.A(t.read('base_type.dat')),h=new s.A(t.read('base_label.dat')),o=i.Lu;i.Mf+=2;for(let t=0;t{e.d(i,{A:()=>r});var s=e(8534),n=e(1069);class r{static Lo=[];static nc=t=>{const i=new n.A(t.read('frame_head.dat')),e=new n.A(t.read('frame_tran1.dat')),h=new n.A(t.read('frame_tran2.dat')),o=new n.A(t.read('frame_del.dat')),l=i.Lu;i.Mf+=2;const a=new Int32Array(500),c=new Int32Array(500),f=new Int32Array(500),u=new Int32Array(500);for(let t=0;t0){if(0!==d.types[t])for(let i=t-1;i>y;i--)if(0===d.types[i]){a[A]=i,c[A]=0,f[A]=0,u[A]=0,A++;break}a[A]=t;let e=0;3===d.types[a[A]]&&(e=128),c[A]=1&i?h.VE:e,f[A]=2&i?h.VE:e,u[A]=4&i?h.VE:e,y=t,A++}}n.length=A,n.KE=new Int32Array(A),n.x=new Int32Array(A),n.y=new Int32Array(A),n.z=new Int32Array(A);for(let t=0;t{e.d(i,{$c:()=>s,zo:()=>n,XE:()=>o,jE:()=>h,zE:()=>r});const s=document.getElementById('canvas'),n=s.getContext('2d',{willReadFrequently:!0}),r=document.createElement('canvas'),h=document.createElement('img'),o=r.getContext('2d',{willReadFrequently:!0})},9298:(t,i,e)=>{e.d(i,{A:()=>s});class s{static RED=16711680;static GREEN=65280;static BLUE=255;static Gl=16776960;static ZE=65535;static Cm=16711935;static Il=16777215;static Pl=0;static qE=16748608;static JE=8388608;static $E=128;static QE=16756736;static tv=16740352;static iv=16723968;static ev=12648192;static sv=8453888;static nv=4259584;static rv=9179409;static hv=6116423;static il=2301979;static el=5063219;static nl=7759444;static hl=3353893;static ov=8388736;static lv=13350793;static av=Int32Array.of(s.Gl,s.RED,s.GREEN,s.ZE,s.Cm,s.Il);static wC=6798;static yC=107;static AC=10283;static mC=16;static pC=4797;static gC=7744;static IC=5799;static _C=4634;static CC=33697;static EC=22433;static vC=2983;static bC=54193;static TC=8741;static RC=12;static OC=64030;static LC=43162;static SC=7735;static xC=8404;static kC=1701;static MC=38430;static DC=24094;static NC=10153;static FC=56621;static BC=4783;static UC=1341;static PC=16578;static GC=35003;static WC=25239;static J_=9104;static Q_=10275;static tC=7595;static iC=3610;static eC=7975;static sC=8526;static nC=918;static rC=38802;static hC=24466;static oC=10145;static lC=58654;static aC=5027;static cC=1457;static fC=16565;static uC=34991;static dC=25486;static YC=4626;static HC=11146;static VC=6439;static KC=12;static XC=4758;static jC=10270;static iE=4574;static zC=4550;static ZC=4537;static qC=5681;static JC=5673;static $C=5790;static QC=6806;static tE=8076}},8950:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n extends s.A{static Rw=new Int32Array;static Ow=0;static Lw=0;static top=0;static bottom=0;static left=0;static right=0;static gI=0;static cv=0;static fv=0;static bind=(t,i,e)=>{this.Rw=t,this.Ow=i,this.Lw=e,this.Al(0,0,i,e)};static uv=()=>{this.left=0,this.top=0,this.right=this.Ow,this.bottom=this.Lw,this.gI=this.right-1,this.cv=this.right/2|0};static Al=(t,i,e,s)=>{t<0&&(t=0),i<0&&(i=0),e>this.Ow&&(e=this.Ow),s>this.Lw&&(s=this.Lw),this.top=i,this.bottom=s,this.left=t,this.right=e,this.gI=this.right-1,this.cv=this.right/2|0,this.fv=this.bottom/2|0};static clear=()=>{const t=this.Ow*this.Lw;for(let i=0;i{this.rl(t,i,n,e),this.rl(t,i+s-1,n,e),this.sl(t,i,n,s),this.sl(t+e-1,i,n,s)};static rl=(t,i,e,s)=>{if(i=this.bottom)return;tthis.right&&(s=this.right-t);const n=t+i*this.Ow;for(let t=0;t{if(t=this.right)return;ithis.bottom&&(s=this.bottom-i);const n=t+i*this.Ow;for(let t=0;t{const r=Math.abs(e-t),h=Math.abs(s-i),o=t=this.left&&t=this.top&&i-h&&(a-=h,t+=o),e{tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const r=this.Ow-e;let h=t+i*this.Ow;for(let t=-s;t<0;t++){for(let t=-e;t<0;t++)this.Rw[h++]=n;h+=r}};static dv(t,i,e,s,n,r){tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const h=256-r,o=(n>>16&255)*r,l=(n>>8&255)*r,a=(255&n)*r,c=this.Ow-e;let f=t+i*this.Ow;for(let t=0;t>16&255)*h>>8<<16)+(l+(this.Rw[f]>>8&255)*h>>8<<8)+(a+(255&this.Rw[f])*h>>8);this.Rw[f++]=t}f+=c}}static wv(t,i,e,s,n){const r=256-n,h=(s>>16&255)*n,o=(s>>8&255)*n,l=(255&s)*n;let a=i-e;a<0&&(a=0);let c=i+e;c>=this.Lw&&(c=this.Lw-1);for(let s=a;s<=c;s++){const n=s-i,a=0|Math.sqrt(e*e-n*n);let c=t-a;c<0&&(c=0);let f=t+a;f>=this.Ow&&(f=this.Ow-1);let u=c+s*this.Ow;for(let t=c;t<=f;t++){const t=(h+(this.Rw[u]>>16&255)*r>>8<<16)+(o+(this.Rw[u]>>8&255)*r>>8<<8)+(l+(255&this.Rw[u])*r>>8);this.Rw[u++]=t}}}static yv=(t,i,e)=>{t=this.right||i=this.bottom||(this.Rw[t+i*this.Ow]=e)}}},4583:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(8950),n=e(1673),r=e(3867);class h extends s.A{static et=!1;static Av=new Int32Array(512);static mv=new Int32Array(2048);static sin=new Int32Array(2048);static cos=new Int32Array(2048);static palette=new Int32Array(65536);static pv=new r.fe(50,null);static gv=0;static Tw=new Int32Array;static ra=0;static ha=0;static Sw=!0;static pI=!1;static alpha=0;static Iv=null;static _v=new r.fe(50,null);static Cv=0;static Wm=0;static Ev=new Int32Array(50);static vv=new r.fe(50,null);static bv=!1;static Tv=new r.fe(50,!1);static Rv=new Int32Array(50);static{for(let t=1;t<512;t++)this.Av[t]=32768/t|0;for(let t=1;t<2048;t++)this.mv[t]=65536/t|0;for(let t=0;t<2048;t++)this.sin[t]=65536*Math.sin(.0030679615757712823*t)|0,this.cos[t]=65536*Math.cos(.0030679615757712823*t)|0}static To=()=>{this.Av=null,this.Av=null,this.sin=null,this.cos=null,this.Tw=null,this.pv=null,this.Tv=null,this.Rv=null,this.Iv=null,this._v=null,this.Ev=null,this.palette=null,this.vv=null,console.log('Draw3D unloaded!')};static rc=()=>{this.Tw=new Int32Array(this.Lw);for(let t=0;t{this.Tw=new Int32Array(i);for(let e=0;e{this.Iv=null,this._v.fill(null)};static ic=t=>{this.gv=0;for(let i=0;i<50;i++)try{this.pv[i]=n.A.tc(t,i.toString()),this.et&&128===this.pv[i]?.Fl?this.pv[i]?.Sv():this.pv[i]?.Pw(),this.gv++}catch(t){}};static _m=t=>{if(0!==this.Rv[t])return this.Rv[t];const i=this.vv[t];if(!i)return 0;let e=0,s=0,n=0;const r=i.length;for(let t=0;t>16&255,s+=i[t]>>8&255,n+=255&i[t];let h=(e/r<<16)+(s/r<<8)+(n/r|0);return h=this.xv(h,1.4),0===h&&(h=1),this.Rv[t]=h,h};static ec=t=>{const i=t+.03*Math.random()-.015;let e=0;for(let t=0;t<512;t++){const s=(t/8|0)/64+.0078125,n=(7&t)/8+.0625;for(let t=0;t<128;t++){const r=t/128;let h=r,o=r,l=r;if(0!==n){let t;t=r<.5?r*(n+1):r+n-r*n;const i=2*r-t;let e=s+.3333333333333333;e>1&&e--;let a=s-.3333333333333333;a<0&&a++,h=6*e<1?i+6*(t-i)*e:2*e<1?t:3*e<2?i+(t-i)*(.6666666666666666-e)*6:i,o=6*s<1?i+6*(t-i)*s:2*s<1?t:3*s<2?i+(t-i)*(.6666666666666666-s)*6:i,l=6*a<1?i+6*(t-i)*a:2*a<1?t:3*a<2?i+(t-i)*(.6666666666666666-a)*6:i}const a=((256*h|0)<<16)+((256*o|0)<<8)+(256*l|0);this.palette[e++]=this.xv(a,i)}}for(let t=0;t<50;t++){const e=this.pv[t];if(!e)continue;const s=e.palette;this.vv[t]=new Int32Array(s.length);for(let e=0;e{const e=(t>>16)/256,s=(t>>8&255)/256,n=(255&t)/256;return((256*Math.pow(e,i)|0)<<16)+((256*Math.pow(s,i)|0)<<8)+(256*Math.pow(n,i)|0)};static sc=t=>{this.Iv||(this.Cv=t,this.et?this.Iv=new r.Xr(t,16384):this.Iv=new r.Xr(t,65536),this._v.fill(null))};static EI=(t,i,e,s,n,r,h,o,l)=>{let a=0,c=0;n!==s&&(a=(i-t<<16)/(n-s)|0,c=(o-h<<15)/(n-s)|0);let f=0,u=0;r!==n&&(f=(e-i<<16)/(r-n)|0,u=(l-o<<15)/(r-n)|0);let d=0,w=0;if(r!==s&&(d=(t-e<<16)/(s-r)|0,w=(h-l<<15)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),nf)for(r-=n,n-=s,s=this.Tw[s];;){if(--n<0)for(;;){if(--r<0)return;this.Mv(e>>16,i>>16,l>>7,o>>7,this.Rw,s,0),e+=d,i+=f,l+=w,o+=u,s+=this.Ow}this.Mv(e>>16,t>>16,l>>7,h>>7,this.Rw,s,0),e+=d,t+=a,l+=w,h+=c,s+=this.Ow}else for(r-=n,n-=s,s=this.Tw[s];;){if(--n<0)for(;;){if(--r<0)return;this.Mv(i>>16,e>>16,o>>7,l>>7,this.Rw,s,0),e+=d,i+=f,l+=w,o+=u,s+=this.Ow}this.Mv(t>>16,e>>16,h>>7,l>>7,this.Rw,s,0),e+=d,t+=a,l+=w,h+=c,s+=this.Ow}else if(i=t<<=16,o=h<<=15,s<0&&(i-=d*s,t-=a*s,o-=w*s,h-=c*s,s=0),e<<=16,l<<=15,r<0&&(e-=f*r,l-=u*r,r=0),s!==r&&da)for(n-=r,r-=s,s=this.Tw[s];;){if(--r<0)for(;;){if(--n<0)return;this.Mv(e>>16,t>>16,l>>7,h>>7,this.Rw,s,0),e+=f,t+=a,l+=u,h+=c,s+=this.Ow}this.Mv(i>>16,t>>16,o>>7,h>>7,this.Rw,s,0),i+=d,t+=a,o+=w,h+=c,s+=this.Ow}else for(n-=r,r-=s,s=this.Tw[s];;){if(--r<0)for(;;){if(--n<0)return;this.Mv(t>>16,e>>16,h>>7,l>>7,this.Rw,s,0),e+=f,t+=a,l+=u,h+=c,s+=this.Ow}this.Mv(t>>16,i>>16,h>>7,o>>7,this.Rw,s,0),i+=d,t+=a,o+=w,h+=c,s+=this.Ow}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),rd)for(s-=r,r-=n,n=this.Tw[n];;){if(--r<0)for(;;){if(--s<0)return;this.Mv(t>>16,e>>16,h>>7,l>>7,this.Rw,n,0),t+=a,e+=d,h+=c,l+=w,n+=this.Ow}this.Mv(t>>16,i>>16,h>>7,o>>7,this.Rw,n,0),t+=a,i+=f,h+=c,o+=u,n+=this.Ow}else for(s-=r,r-=n,n=this.Tw[n];;){if(--r<0)for(;;){if(--s<0)return;this.Mv(e>>16,t>>16,l>>7,h>>7,this.Rw,n,0),t+=a,e+=d,h+=c,l+=w,n+=this.Ow}this.Mv(i>>16,t>>16,o>>7,h>>7,this.Rw,n,0),t+=a,i+=f,h+=c,o+=u,n+=this.Ow}else if(e=i<<=16,l=o<<=15,n<0&&(e-=a*n,i-=f*n,l-=c*n,o-=u*n,n=0),t<<=16,h<<=15,s<0&&(t-=d*s,h-=w*s,s=0),r-=s,s-=n,n=this.Tw[n],a>16,i>>16,h>>7,o>>7,this.Rw,n,0),t+=d,i+=f,h+=w,o+=u,n+=this.Ow}this.Mv(e>>16,i>>16,l>>7,o>>7,this.Rw,n,0),e+=a,i+=f,l+=c,o+=u,n+=this.Ow}else for(;;){if(--s<0)for(;;){if(--r<0)return;this.Mv(i>>16,t>>16,o>>7,h>>7,this.Rw,n,0),t+=d,i+=f,h+=w,o+=u,n+=this.Ow}this.Mv(i>>16,e>>16,o>>7,l>>7,this.Rw,n,0),e+=a,i+=f,l+=c,o+=u,n+=this.Ow}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,o>>7,h>>7,this.Rw,r,0),i+=f,t+=a,o+=u,h+=c,r+=this.Ow}this.Mv(i>>16,e>>16,o>>7,l>>7,this.Rw,r,0),i+=f,e+=d,o+=u,l+=w,r+=this.Ow}else for(;;){if(--s<0)for(;;){if(--n<0)return;this.Mv(t>>16,i>>16,h>>7,o>>7,this.Rw,r,0),i+=f,t+=a,o+=u,h+=c,r+=this.Ow}this.Mv(e>>16,i>>16,l>>7,o>>7,this.Rw,r,0),i+=f,e+=d,o+=u,l+=w,r+=this.Ow}else if(t=e<<=16,h=l<<=15,r<0&&(t-=f*r,e-=d*r,h-=u*r,l-=w*r,r=0),i<<=16,o<<=15,n<0&&(i-=a*n,o-=c*n,n=0),s-=n,n-=r,r=this.Tw[r],f>16,e>>16,o>>7,l>>7,this.Rw,r,0),i+=a,e+=d,o+=c,l+=w,r+=this.Ow}this.Mv(t>>16,e>>16,h>>7,l>>7,this.Rw,r,0),t+=f,e+=d,h+=u,l+=w,r+=this.Ow}else for(;;){if(--n<0)for(;;){if(--s<0)return;this.Mv(e>>16,i>>16,l>>7,o>>7,this.Rw,r,0),i+=a,e+=d,o+=c,l+=w,r+=this.Ow}this.Mv(e>>16,t>>16,l>>7,h>>7,this.Rw,r,0),t+=f,e+=d,h+=u,l+=w,r+=this.Ow}};static Mv=(t,i,e,s,n,r,h)=>{let o;if(this.Sw){let l;if(this.pI){if(l=i-t>3?(s-e)/(i-t)|0:0,i>this.gI&&(i=this.gI),t<0&&(e-=t*l,t=0),t>=i)return;r+=t,h=i-t>>2,l<<=2}else{if(!(t>2)>0?(s-e)*this.Av[h]>>15:0}if(0===this.alpha)for(;;){if(--h<0){if((h=i-t&3)>0){o=this.palette[e>>8];do{n[r++]=o,h--}while(h>0);return}break}o=this.palette[e>>8],e+=l,n[r++]=o,n[r++]=o,n[r++]=o,n[r++]=o}else{const s=this.alpha,a=256-this.alpha;for(;;){if(--h<0){if((h=i-t&3)>0){o=this.palette[e>>8],o=((16711935&o)*a>>8&16711935)+((65280&o)*a>>8&65280);do{n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),h--}while(h>0)}break}o=this.palette[e>>8],e+=l,o=((16711935&o)*a>>8&16711935)+((65280&o)*a>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280)}}}else if(tthis.gI&&(i=this.gI),t<0&&(e-=t*l,t=0),t>=i))return;if(r+=t,h=i-t,0===this.alpha)do{n[r++]=this.palette[e>>8],e+=l,h--}while(h>0);else{const t=this.alpha,i=256-this.alpha;do{o=this.palette[e>>8],e+=l,o=((16711935&o)*i>>8&16711935)+((65280&o)*i>>8&65280),n[r++]=o+((16711935&n[r])*t>>8&16711935)+((65280&n[r])*t>>8&65280),h--}while(h>0)}}};static Dv=(t,i,e,s,n,r,h)=>{let o=0;n!==s&&(o=(i-t<<16)/(n-s)|0);let l=0;r!==n&&(l=(e-i<<16)/(r-n)|0);let a=0;if(r!==s&&(a=(t-e<<16)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),nl)for(r-=n,n-=s,s=this.Tw[s];;){if(--n<0)for(;;){if(--r<0)return;this.Nv(e>>16,i>>16,this.Rw,s,h),e+=a,i+=l,s+=this.Ow}this.Nv(e>>16,t>>16,this.Rw,s,h),e+=a,t+=o,s+=this.Ow}else for(r-=n,n-=s,s=this.Tw[s];;){if(--n<0)for(;;){if(--r<0)return;this.Nv(i>>16,e>>16,this.Rw,s,h),e+=a,i+=l,s+=this.Ow}this.Nv(t>>16,e>>16,this.Rw,s,h),e+=a,t+=o,s+=this.Ow}else if(i=t<<=16,s<0&&(i-=a*s,t-=o*s,s=0),e<<=16,r<0&&(e-=l*r,r=0),s!==r&&ao)for(n-=r,r-=s,s=this.Tw[s];;){if(--r<0)for(;;){if(--n<0)return;this.Nv(e>>16,t>>16,this.Rw,s,h),e+=l,t+=o,s+=this.Ow}this.Nv(i>>16,t>>16,this.Rw,s,h),i+=a,t+=o,s+=this.Ow}else for(n-=r,r-=s,s=this.Tw[s];;){if(--r<0)for(;;){if(--n<0)return;this.Nv(t>>16,e>>16,this.Rw,s,h),e+=l,t+=o,s+=this.Ow}this.Nv(t>>16,i>>16,this.Rw,s,h),i+=a,t+=o,s+=this.Ow}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),ra)for(s-=r,r-=n,n=this.Tw[n];;){if(--r<0)for(;;){if(--s<0)return;this.Nv(t>>16,e>>16,this.Rw,n,h),t+=o,e+=a,n+=this.Ow}this.Nv(t>>16,i>>16,this.Rw,n,h),t+=o,i+=l,n+=this.Ow}else for(s-=r,r-=n,n=this.Tw[n];;){if(--r<0)for(;;){if(--s<0)return;this.Nv(e>>16,t>>16,this.Rw,n,h),t+=o,e+=a,n+=this.Ow}this.Nv(i>>16,t>>16,this.Rw,n,h),t+=o,i+=l,n+=this.Ow}else if(e=i<<=16,n<0&&(e-=o*n,i-=l*n,n=0),t<<=16,s<0&&(t-=a*s,s=0),o>16,i>>16,this.Rw,n,h),t+=a,i+=l,n+=this.Ow}this.Nv(e>>16,i>>16,this.Rw,n,h),e+=o,i+=l,n+=this.Ow}else for(r-=s,s-=n,n=this.Tw[n];;){if(--s<0)for(;;){if(--r<0)return;this.Nv(i>>16,t>>16,this.Rw,n,h),t+=a,i+=l,n+=this.Ow}this.Nv(i>>16,e>>16,this.Rw,n,h),e+=o,i+=l,n+=this.Ow}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,this.Rw,r,h),i+=l,t+=o,r+=this.Ow}this.Nv(i>>16,e>>16,this.Rw,r,h),i+=l,e+=a,r+=this.Ow}else for(n-=s,s-=r,r=this.Tw[r];;){if(--s<0)for(;;){if(--n<0)return;this.Nv(t>>16,i>>16,this.Rw,r,h),i+=l,t+=o,r+=this.Ow}this.Nv(e>>16,i>>16,this.Rw,r,h),i+=l,e+=a,r+=this.Ow}else if(t=e<<=16,r<0&&(t-=l*r,e-=a*r,r=0),i<<=16,n<0&&(i-=o*n,n=0),l>16,e>>16,this.Rw,r,h),i+=o,e+=a,r+=this.Ow}this.Nv(t>>16,e>>16,this.Rw,r,h),t+=l,e+=a,r+=this.Ow}else for(s-=n,n-=r,r=this.Tw[r];;){if(--n<0)for(;;){if(--s<0)return;this.Nv(e>>16,i>>16,this.Rw,r,h),i+=o,e+=a,r+=this.Ow}this.Nv(e>>16,t>>16,this.Rw,r,h),t+=l,e+=a,r+=this.Ow}};static RI=(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w,y,A,m,p)=>{const g=this.Fv(p);this.bv=!this.Tv[p];const I=a-u,_=c-w,C=f-A,E=d-a,v=y-c,b=m-f;let T=E*c-v*a<<14;const R=v*f-b*c<<8,O=b*a-E*f<<5;let L=I*c-_*a<<14;const S=_*f-C*c<<8,x=C*a-I*f<<5;let k=_*E-I*v<<14;const M=C*v-_*b<<8,D=I*b-C*E<<5;let N=0,F=0;n!==s&&(N=(i-t<<16)/(n-s)|0,F=(o-h<<16)/(n-s)|0);let B=0,U=0;r!==n&&(B=(e-i<<16)/(r-n)|0,U=(l-o<<16)/(r-n)|0);let P=0,G=0;if(r!==s&&(P=(t-e<<16)/(s-r)|0,G=(h-l<<16)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),nB)for(r-=n,n-=s,s=this.Tw[s];;){if(--n<0)for(;;){if(--r<0)return;this.Bv(e>>16,i>>16,this.Rw,s,g,0,0,T,L,k,R,S,M,l>>8,o>>8),e+=P,i+=B,l+=G,o+=U,s+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.Bv(e>>16,t>>16,this.Rw,s,g,0,0,T,L,k,R,S,M,l>>8,h>>8),e+=P,t+=N,l+=G,h+=F,s+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}else for(r-=n,n-=s,s=this.Tw[s];;){if(--n<0)for(;;){if(--r<0)return;this.Bv(i>>16,e>>16,this.Rw,s,g,0,0,T,L,k,R,S,M,o>>8,l>>8),e+=P,i+=B,l+=G,o+=U,s+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.Bv(t>>16,e>>16,this.Rw,s,g,0,0,T,L,k,R,S,M,h>>8,l>>8),e+=P,t+=N,l+=G,h+=F,s+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}}else{i=t<<=16,o=h<<=16,s<0&&(i-=P*s,t-=N*s,o-=G*s,h-=F*s,s=0),e<<=16,l<<=16,r<0&&(e-=B*r,l-=U*r,r=0);const a=s-this.ha;if(T+=O*a,L+=x*a,k+=D*a,T|=0,L|=0,k|=0,(s===r||P>=N)&&(s!==r||B<=N))for(n-=r,r-=s,s=this.Tw[s];;){if(--r<0)for(;;){if(--n<0)return;this.Bv(t>>16,e>>16,this.Rw,s,g,0,0,T,L,k,R,S,M,h>>8,l>>8),e+=B,t+=N,l+=U,h+=F,s+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.Bv(t>>16,i>>16,this.Rw,s,g,0,0,T,L,k,R,S,M,h>>8,o>>8),i+=P,t+=N,o+=G,h+=F,s+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}else for(n-=r,r-=s,s=this.Tw[s];;){if(--r<0)for(;;){if(--n<0)return;this.Bv(e>>16,t>>16,this.Rw,s,g,0,0,T,L,k,R,S,M,l>>8,h>>8),e+=B,t+=N,l+=U,h+=F,s+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.Bv(i>>16,t>>16,this.Rw,s,g,0,0,T,L,k,R,S,M,o>>8,h>>8),i+=P,t+=N,o+=G,h+=F,s+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),rP)for(s-=r,r-=n,n=this.Tw[n];;){if(--r<0)for(;;){if(--s<0)return;this.Bv(t>>16,e>>16,this.Rw,n,g,0,0,T,L,k,R,S,M,h>>8,l>>8),t+=N,e+=P,h+=F,l+=G,n+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.Bv(t>>16,i>>16,this.Rw,n,g,0,0,T,L,k,R,S,M,h>>8,o>>8),t+=N,i+=B,h+=F,o+=U,n+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}else for(s-=r,r-=n,n=this.Tw[n];;){if(--r<0)for(;;){if(--s<0)return;this.Bv(e>>16,t>>16,this.Rw,n,g,0,0,T,L,k,R,S,M,l>>8,h>>8),t+=N,e+=P,h+=F,l+=G,n+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.Bv(i>>16,t>>16,this.Rw,n,g,0,0,T,L,k,R,S,M,o>>8,h>>8),t+=N,i+=B,h+=F,o+=U,n+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}}else{e=i<<=16,l=o<<=16,n<0&&(e-=N*n,i-=B*n,l-=F*n,o-=U*n,n=0),t<<=16,h<<=16,s<0&&(t-=P*s,h-=G*s,s=0);const a=n-this.ha;if(T+=O*a,L+=x*a,k+=D*a,T|=0,L|=0,k|=0,r-=s,s-=n,n=this.Tw[n],N>16,i>>16,this.Rw,n,g,0,0,T,L,k,R,S,M,h>>8,o>>8),t+=P,i+=B,h+=G,o+=U,n+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.Bv(e>>16,i>>16,this.Rw,n,g,0,0,T,L,k,R,S,M,l>>8,o>>8),e+=N,i+=B,l+=F,o+=U,n+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}else for(;;){if(--s<0)for(;;){if(--r<0)return;this.Bv(i>>16,t>>16,this.Rw,n,g,0,0,T,L,k,R,S,M,o>>8,h>>8),t+=P,i+=B,h+=G,o+=U,n+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.Bv(i>>16,e>>16,this.Rw,n,g,0,0,T,L,k,R,S,M,o>>8,l>>8),e+=N,i+=B,l+=F,o+=U,n+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,this.Rw,r,g,0,0,T,L,k,R,S,M,o>>8,h>>8),i+=B,t+=N,o+=U,h+=F,r+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.Bv(i>>16,e>>16,this.Rw,r,g,0,0,T,L,k,R,S,M,o>>8,l>>8),i+=B,e+=P,o+=U,l+=G,r+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}else for(;;){if(--s<0)for(;;){if(--n<0)return;this.Bv(t>>16,i>>16,this.Rw,r,g,0,0,T,L,k,R,S,M,h>>8,o>>8),i+=B,t+=N,o+=U,h+=F,r+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.Bv(e>>16,i>>16,this.Rw,r,g,0,0,T,L,k,R,S,M,l>>8,o>>8),i+=B,e+=P,o+=U,l+=G,r+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}}else{t=e<<=16,h=l<<=16,r<0&&(t-=B*r,e-=P*r,h-=U*r,l-=G*r,r=0),i<<=16,o<<=16,n<0&&(i-=N*n,o-=F*n,n=0);const a=r-this.ha;if(T+=O*a,L+=x*a,k+=D*a,T|=0,L|=0,k|=0,s-=n,n-=r,r=this.Tw[r],B>16,e>>16,this.Rw,r,g,0,0,T,L,k,R,S,M,o>>8,l>>8),i+=N,e+=P,o+=F,l+=G,r+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.Bv(t>>16,e>>16,this.Rw,r,g,0,0,T,L,k,R,S,M,h>>8,l>>8),t+=B,e+=P,h+=U,l+=G,r+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}else for(;;){if(--n<0)for(;;){if(--s<0)return;this.Bv(e>>16,i>>16,this.Rw,r,g,0,0,T,L,k,R,S,M,l>>8,o>>8),i+=N,e+=P,o+=F,l+=G,r+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.Bv(e>>16,t>>16,this.Rw,r,g,0,0,T,L,k,R,S,M,l>>8,h>>8),t+=B,e+=P,h+=U,l+=G,r+=this.Ow,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}}};static Bv=(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w)=>{if(t>=i)return;let y,A,m,p,g,I,_,C,E;if(this.pI){if(y=(w-d)/(i-t)|0,i>this.gI&&(i=this.gI),t<0&&(d-=t*y,t=0),t>=i)return;A=i-t>>3,y<<=12}else i-t>7?(A=i-t>>3,y=(w-d)*this.Av[A]>>6):(A=0,y=0);if(d<<=9,s+=t,this.et&&n)if(m=0,p=0,I=t-this.ra,o+=(c>>3)*I,l+=(f>>3)*I,a+=(u>>3)*I,o|=0,l|=0,g=(a|=0)>>12,0!==g&&(h=l/g|0,(r=o/g|0)<0?r=0:r>4032&&(r=4032)),o+=c,l+=f,a+=u,o|=0,l|=0,g=(a|=0)>>12,0!==g&&(m=o/g|0,p=l/g|0,m<7?m=7:m>4032&&(m=4032)),_=m-r>>3,C=p-h>>3,r+=d>>3&786432,E=d>>23,this.bv){for(;A-- >0;)e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r=m,h=p,o+=c,l+=f,g=(a+=u)>>12,0!==g&&(m=o/g|0,p=l/g|0,m<7?m=7:m>4032&&(m=4032)),_=m-r>>3,C=p-h>>3,r+=(d+=y)>>3&786432,E=d>>23;for(A=i-t&7;A-- >0;)e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C}else{for(;A-- >0;){let t;0!=(t=n[(4032&h)+(r>>6)]>>>E)&&(e[s]=t),s+=1,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s+=1,r=m,h=p,o+=c,l+=f,a+=u,o|=0,l|=0,g=(a|=0)>>12,0!==g&&(m=o/g|0,p=l/g|0,m<7?m=7:m>4032&&(m=4032)),_=m-r>>3,C=p-h>>3,r+=(d+=y)>>3&786432,E=d>>23}for(A=i-t&7;A-- >0;){let t;0!=(t=n[(4032&h)+(r>>6)]>>>E)&&(e[s]=t),s++,r+=_,h+=C}}else if(m=0,p=0,I=t-this.ra,o+=(c>>3)*I,l+=(f>>3)*I,a+=(u>>3)*I,o|=0,l|=0,g=(a|=0)>>14,0!==g&&(h=l/g|0,(r=o/g|0)<0?r=0:r>16256&&(r=16256)),o+=c,l+=f,a+=u,o|=0,l|=0,g=(a|=0)>>14,0!==g&&(m=o/g|0,p=l/g|0,m<7?m=7:m>16256&&(m=16256)),_=m-r>>3,C=p-h>>3,r+=6291456&d,E=d>>23,this.bv&&n){for(;A-- >0;)e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r=m,h=p,o+=c,l+=f,a+=u,o|=0,l|=0,g=(a|=0)>>14,0!==g&&(m=o/g|0,p=l/g|0,m<7?m=7:m>16256&&(m=16256)),_=m-r>>3,C=p-h>>3,r+=6291456&(d+=y),E=d>>23;for(A=i-t&7;A-- >0;)e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C}else{for(;A-- >0&&n;){let t;0!=(t=n[(16256&h)+(r>>7)]>>>E)&&(e[s]=t),s+=1,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,r=m,h=p,o+=c,l+=f,a+=u,o|=0,l|=0,g=(a|=0)>>14,0!==g&&(m=o/g|0,p=l/g|0,m<7?m=7:m>16256&&(m=16256)),_=m-r>>3,C=p-h>>3,r+=6291456&(d+=y),E=d>>23}for(A=i-t&7;A-- >0&&n;){let t;0!=(t=n[(16256&h)+(r>>7)]>>>E)&&(e[s]=t),s++,r+=_,h+=C}}};static Nv=(t,i,e,s,n)=>{if(this.pI&&(i>this.gI&&(i=this.gI),t<0&&(t=0)),t>=i)return;s+=t;let r=i-t>>2;if(0===this.alpha)for(;;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;e[s++]=n}e[s++]=n,e[s++]=n,e[s++]=n,e[s++]=n}const h=this.alpha,o=256-this.alpha;for(n=((16711935&n)*o>>8&16711935)+((65280&n)*o>>8&65280);;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280)}e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280)}};static kv=t=>{this._v[t]&&this.Iv&&(this.Iv[this.Cv++]=this._v[t],this._v[t]=null)};static Fv=t=>{if(this.Ev[t]=this.Wm++,this._v[t])return this._v[t];let i;if(this.Cv>0&&this.Iv)i=this.Iv[--this.Cv],this.Iv[this.Cv]=null;else{let t=0,e=-1;for(let i=0;i>>3)&16316671,i[n+8192]=r-(r>>>2)&16316671,i[n+12288]=r-(r>>>2)-(r>>>3)&16316671}}else{if(64===e.width)for(let t=0;t<128;t++)for(let n=0;n<128;n++)i[n+(t<<7)]=s[e.Rw[(n>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)i[t]=s[e.Rw[t]];this.Tv[t]=!1;for(let e=0;e<16384;e++){i[e]&=16316671;const s=i[e];0===s&&(this.Tv[t]=!0),i[e+16384]=s-(s>>>3)&16316671,i[e+32768]=s-(s>>>2)&16316671,i[e+49152]=s-(s>>>2)-(s>>>3)&16316671}}return i}}},880:(t,i,e)=>{e.d(i,{r:()=>n});var s=e(7854);const n=async t=>{255!==t[0]&&(t[0]=255),URL.revokeObjectURL(s.jE.src),s.jE.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>s.jE.onload=()=>t())),s.XE.clearRect(0,0,s.zE.width,s.zE.height);const i=s.jE.naturalWidth,e=s.jE.naturalHeight;return s.zE.width=i,s.zE.height=e,s.XE.drawImage(s.jE,0,0),s.XE.getImageData(0,0,i,e)}},8665:(t,i,e)=>{e.d(i,{A:()=>f});var s=e(1069),n=e(8950),r=e(4583),h=e(6730),o=e(4474),l=e(3867);class a{Vd=0;Mg=0;Uv=0;Pv=-1;Gv=-1;Wv=-1;Yv=-1;Hv=-1;Vv=-1;Kv=-1;Xv=-1;jv=-1;zv=0;Zv=-1;qv=-1;Jv=-1;data=null}class c{x=0;y=0;z=0;w=0}class f extends o.A{static metadata=null;static head=null;static $v=null;static Qv=null;static tb=null;static ib=null;static eb=null;static sb=null;static nb=null;static rb=null;static hb=null;static ob=null;static lb=null;static ab=null;static axis=null;static cb=new l.fe(4096,!1);static fb=new l.fe(4096,!1);static ub=new Int32Array(4096);static wb=new Int32Array(4096);static yb=new Int32Array(4096);static Ab=new Int32Array(4096);static mb=new Int32Array(4096);static pb=new Int32Array(4096);static gb=new Int32Array(1500);static Ib=new l.Xr(1500,512);static _b=new Int32Array(12);static Cb=new l.Xr(12,2e3);static Eb=new Int32Array(2e3);static vb=new Int32Array(2e3);static bb=new Int32Array(12);static Tb=new Int32Array(10);static Rb=new Int32Array(10);static Ob=new Int32Array(10);static Ir=0;static Lb=0;static _r=0;static Sb=!1;static Ml=0;static Dl=0;static xb=0;static kb=new Int32Array(1e3);static Mb=!1;static nc(t){try{f.head=new s.A(t.read('ob_head.dat')),f.$v=new s.A(t.read('ob_face1.dat')),f.Qv=new s.A(t.read('ob_face2.dat')),f.tb=new s.A(t.read('ob_face3.dat')),f.ib=new s.A(t.read('ob_face4.dat')),f.eb=new s.A(t.read('ob_face5.dat')),f.sb=new s.A(t.read('ob_point1.dat')),f.nb=new s.A(t.read('ob_point2.dat')),f.rb=new s.A(t.read('ob_point3.dat')),f.hb=new s.A(t.read('ob_point4.dat')),f.ob=new s.A(t.read('ob_point5.dat')),f.lb=new s.A(t.read('ob_vertex1.dat')),f.ab=new s.A(t.read('ob_vertex2.dat')),f.axis=new s.A(t.read('ob_axis.dat')),f.head.Mf=0,f.sb.Mf=0,f.nb.Mf=0,f.rb.Mf=0,f.hb.Mf=0,f.lb.Mf=0,f.ab.Mf=0;const i=f.head.Lu;f.metadata=new l.fe(i+100,null);let e=0,n=0,r=0,h=0,o=0,c=0,u=0;for(let t=0;t>7)<2?i=2:i>126&&(i=126),(65408&t)+i):(i<0?i=0:i>127&&(i=127),127-i)}static Hd=(t,i,e)=>{const s=t.Vd,n=t.Mg,r=t.Uv;let h,o,a,u,d;if(i){h=new Int32Array(s);for(let i=0;i{const n=t.Vd,r=t.Mg,h=t.Uv;let o,l,a,c,u;if(s)o=t.Kd,l=t.jd,a=t.Xd;else{o=new Int32Array(n),l=new Int32Array(n),a=new Int32Array(n);for(let i=0;i{const e=t.Vd,s=t.Mg,n=t.Uv,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e);for(let i=0;i{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,l=0,a=-1;for(let c=0;c{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,l=0,a=-1;for(let c=0;c{let o=-1;const l=t.Kd[i],a=t.jd[i],c=t.Xd[i];for(let t=0;t{if(!f.metadata)throw new Error('cant loading model metadata!!!!!');const i=f.metadata[t];if(!i)throw console.log(`Error model:${t} not found!`),new Error('cant loading model metadata!!!!!');if(!(f.head&&f.$v&&f.Qv&&f.tb&&f.ib&&f.eb&&f.sb&&f.nb&&f.rb&&f.hb&&f.ob&&f.lb&&f.ab&&f.axis))throw new Error('cant loading model!!!!!');const e=i.Vd,s=i.Mg,n=i.Uv,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e),l=new Int32Array(s),a=new Int32Array(s),c=new Int32Array(s),u=new Int32Array(n),d=new Int32Array(n),w=new Int32Array(n);let y=null;i.Hv>=0&&(y=new Int32Array(e));let A=null;i.jv>=0&&(A=new Int32Array(s));let m=null,p=0;i.zv>=0?m=new Int32Array(s):p=-i.zv-1;let g=null;i.Zv>=0&&(g=new Int32Array(s));let I=null;i.qv>=0&&(I=new Int32Array(s));const _=new Int32Array(s);f.sb.Mf=i.Pv,f.nb.Mf=i.Gv,f.rb.Mf=i.Wv,f.hb.Mf=i.Yv,f.ob.Mf=i.Hv;let C,E,v,b=0,T=0,R=0;for(let t=0;t{if(!f.metadata||!f.metadata[i])throw new Error('No model metadata');const e=f.metadata[i];if(e.data=t,!e.data.length)throw new Error('No model data');const n=e.Vd,r=e.Mg,h=e.Uv,o=new Int32Array(n),l=new Int32Array(n),a=new Int32Array(n),c=new Int32Array(r),u=new Int32Array(r),d=new Int32Array(r),w=new Int32Array(h),y=new Int32Array(h),A=new Int32Array(h);let m=null;e.Hv>=0&&(m=new Int32Array(n));let p=null;e.jv>=0&&(p=new Int32Array(r));let g=null,I=0;e.zv>=0?g=new Int32Array(r):I=-e.zv-1;let _=null;e.Zv>=0&&(_=new Int32Array(r));let C=null;e.qv>=0&&(C=new Int32Array(r));const E=new Int32Array(r),v=new s.A(e.data);v.Mf=e.Pv;const b=new s.A(e.data);b.Mf=e.Gv;const T=new s.A(e.data);T.Mf=e.Wv;const R=new s.A(e.data);R.Mf=e.Yv;const O=new s.A(e.data);O.Mf=e.Hv;let L,S,x,k=0,M=0,D=0;for(let t=0;tthis.iw&&(this.iw=-e),e>this.Rg&&(this.Rg=e);const n=i*i+s*s;n>this.xm&&(this.xm=n)}this.xm=Math.sqrt(this.xm)+.99|0,this.Kb=Math.sqrt(this.xm*this.xm+this.iw*this.iw)+.99|0,this.Vb=this.Kb+(Math.sqrt(this.xm*this.xm+this.Rg*this.Rg)+.99|0)}zd(){this.iw=0,this.Rg=0;for(let t=0;tthis.iw&&(this.iw=-i),i>this.Rg&&(this.Rg=i)}this.Kb=Math.sqrt(this.xm*this.xm+this.iw*this.iw)+.99|0,this.Vb=this.Kb+(Math.sqrt(this.xm*this.xm+this.Rg*this.Rg)+.99|0)}xa(){if(this.Xb){const t=new Int32Array(256);let i=0;for(let e=0;ei&&(i=s)}this.$d=new l.fe(i+1,null);for(let e=0;e<=i;e++)this.$d[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;ei&&(i=s)}this.Jd=new l.fe(i+1,null);for(let e=0;e<=i;e++)this.Jd[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;el;)l=e[o++];r&&r.types&&s.x&&s.y&&s.z&&r.labels&&(i!==l||0===r.types[i])&&this.Jb(s.x[t],s.y[t],s.z[t],r.labels[i],r.types[i])}f.Ir=0,f.Lb=0,f._r=0,o=0,l=e[o++];for(let t=0;tl;)l=e[o++];r&&r.types&&n.x&&n.y&&n.z&&r.labels&&(i===l||0===r.types[i])&&this.Jb(n.x[t],n.y[t],n.z[t],r.labels[i],r.types[i])}}else this.ka(t)}ka(t){if(!this.$d||-1===t||!h.A.Lo[t])return;const i=h.A.Lo[t],e=i.HE;f.Ir=0,f.Lb=0,f._r=0;for(let t=0;t>16;this.Xd[t]=this.jd[t]*i+this.Xd[t]*e>>16,this.jd[t]=s}}translate(t,i,e){for(let s=0;s>8;if(this.Fb&&this.Bb&&this.Ub||(this.Fb=new Int32Array(this.Mg),this.Bb=new Int32Array(this.Mg),this.Ub=new Int32Array(this.Mg)),!this.gg){this.gg=new l.fe(this.Vd,null);for(let t=0;t8192||m>8192||p>8192||A<-8192||m<-8192||p<-8192;)A>>=1,m>>=1,p>>=1;let g=0|Math.sqrt(A*A+m*m+p*p);if(g<=0&&(g=1),A=256*A/g|0,m=256*m/g|0,p=256*p/g|0,this.kg&&1&this.kg[i]){const r=t+((e*A+s*m+n*p)/(h+(h/2|0))|0);this.Yu&&(this.Fb[i]=f.Nb(this.Yu[i],r,this.kg[i]))}else{let t=this.gg[r];t&&(t.x+=A,t.y+=m,t.z+=p,t.w++),t=this.gg[o],t&&(t.x+=A,t.y+=m,t.z+=p,t.w++),t=this.gg[l],t&&(t.x+=A,t.y+=m,t.z+=p,t.w++)}}if(r)this.Cg(t,h,e,s,n);else{this.Tg=new l.fe(this.Vd,null);for(let t=0;t>16;for(let s=0;s>16,I=I*w-g*d>>16,g=p),0!==t&&(p=I*a-_*l>>16,_=I*l+_*a>>16,I=p),0!==i&&(p=_*c+g*u>>16,_=_*u-g*c>>16,g=p),g+=n,I+=h,_+=o,p=I*A-_*y>>16,_=I*y+_*A>>16,I=p,f.ub&&f.wb&&f.yb&&(f.yb[s]=_-m,f.ub[s]=r.A.ra+((g<<9)/_|0),f.wb[s]=r.A.ha+((I<<9)/_|0)),this.Uv>0&&f.Ab&&f.mb&&f.pb&&(f.Ab[s]=g,f.mb[s]=I,f.pb[s]=_)}try{this.tT(!1,!1,0)}catch(t){}}draw(t,i,e,s,h,o,l,a,c){const u=a*h-o*s>>16,d=l*i+u*e>>16,w=this.xm*e>>16,y=d+w;if(y<=50||d>=3500)return;const A=a*s+o*h>>16;let m=A-this.xm<<9;if((m/y|0)>=n.A.cv)return;let p=A+this.xm<<9;if((p/y|0)<=-n.A.cv)return;const g=l*e-u*i>>16,I=this.xm*i>>16;let _=g+I<<9;if((_/y|0)<=-n.A.fv)return;let C=g-(I+(this.iw*e>>16))<<9;if((C/y|0)>=n.A.fv)return;let E=d-(w+(this.iw*i>>16))<=50,v=!1;if(c>0&&f.Sb){let t=d-w;t<=50&&(t=50),A>0?(m=m/y|0,p=p/t|0):(p=p/y|0,m=m/t|0),g>0?(C=C/y|0,_=_/t|0):(_=_/y|0,C=C/t|0);const i=f.Ml-r.A.ra,e=f.Dl-r.A.ha;i>m&&iC&&e<_&&(this.yw?f.kb[f.xb++]=c:v=!0)}const b=r.A.ra,T=r.A.ha;let R=0,O=0;0!==t&&(R=r.A.sin[t],O=r.A.cos[t]);for(let n=0;n>16,w=w*O-c*R>>16,c=r),c+=o,u+=l,w+=a,r=w*s+c*h>>16,w=w*h-c*s>>16,c=r,r=u*e-w*i>>16,w=u*i+w*e>>16,u=r,f.yb&&(f.yb[n]=w-d),w>=50&&f.ub&&f.wb?(f.ub[n]=b+((c<<9)/w|0),f.wb[n]=T+((u<<9)/w|0)):f.ub&&(f.ub[n]=-5e3,E=!0),(E||this.Uv>0)&&f.Ab&&f.mb&&f.pb&&(f.Ab[n]=c,f.mb[n]=u,f.pb[n]=w)}try{this.tT(E,v,c)}catch(t){}}tT(t,i,e,s=!1){f.Mb&&(this.Zb=-1,this.qb=-1);for(let t=0;tn.A.gI||a>n.A.gI||c>n.A.gI),f.Ib&&f.gb){const t=((y+A+m)/3|0)+this.Kb;f.Ib[t][f.gb[t]++]=s,f.Mb&&this.iT(f.Ml,f.Dl,u,d,w,l,a,c)&&this.qb=0;t--){const i=f.gb[t];if(!(i<=0)&&f.Ib){const e=f.Ib[t];for(let t=0;t=0;t--){const i=f.gb[t];if(i>0&&f.Ib){const e=f.Ib[t];for(let s=0;s0||f._b[2]>0)&&(r=(f.bb[1]+f.bb[2])/(f._b[1]+f._b[2])|0);let h=0;f._b&&f.bb&&(f._b[3]>0||f._b[4]>0)&&(h=(f.bb[3]+f.bb[4])/(f._b[3]+f._b[4])|0);let o=0;if(f._b&&f.bb&&(f._b[6]>0||f._b[8]>0)&&(o=(f.bb[6]+f.bb[8])/(f._b[6]+f._b[8])|0),f._b&&f.Cb){let t,i=0,e=f._b[10],n=f.Cb[10],l=f.Eb;i===e&&(i=0,e=f._b[11],n=f.Cb[11],l=f.vb),t=ir;)this.eT(n[i++],s),i===e&&n!==f.Cb[11]&&(i=0,e=f._b[11],n=f.Cb[11],l=f.vb),t=ih;)this.eT(n[i++],s),i===e&&n!==f.Cb[11]&&(i=0,e=f._b[11],n=f.Cb[11],l=f.vb),t=io;)this.eT(n[i++],s),i===e&&n!==f.Cb[11]&&(i=0,e=f._b[11],n=f.Cb[11],l=f.vb),t=i>2,h=this.Wb[i],o=this.Yb[i],l=this.Hb[i];r.A.RI(f.ub[e],f.ub[s],f.ub[n],f.wb[e],f.wb[s],f.wb[n],this.Fb[t],this.Bb[t],this.Ub[t],f.Ab[h],f.mb[h],f.pb[h],f.Ab[o],f.Ab[l],f.mb[o],f.mb[l],f.pb[o],f.pb[l],this.Yu[t])}else if(3===h&&this.kg&&this.Yu&&this.Fb&&f.ub&&f.wb&&f.Ab&&f.mb&&f.pb){const i=this.kg[t]>>2,h=this.Wb[i],o=this.Yb[i],l=this.Hb[i];r.A.RI(f.ub[e],f.ub[s],f.ub[n],f.wb[e],f.wb[s],f.wb[n],this.Fb[t],this.Fb[t],this.Fb[t],f.Ab[h],f.mb[h],f.pb[h],f.Ab[o],f.Ab[l],f.mb[o],f.mb[l],f.pb[o],f.pb[l],this.Yu[t])}}sT(t,i=!1){let e=0;if(f.pb){const i=r.A.ra,s=r.A.ha,n=this.Dg[t],h=this.Ng[t],o=this.Fg[t],l=f.pb[n],a=f.pb[h],c=f.pb[o];if(l>=50&&f.ub&&f.wb&&this.Fb)f.Tb[e]=f.ub[n],f.Rb[e]=f.wb[n],f.Ob[e++]=this.Fb[t];else if(f.Ab&&f.mb&&this.Fb){const u=f.Ab[n],d=f.mb[n],w=this.Fb[t];if(c>=50&&this.Ub){const n=(50-l)*r.A.mv[c-l];f.Tb[e]=i+((u+((f.Ab[o]-u)*n>>16)<<9)/50|0),f.Rb[e]=s+((d+((f.mb[o]-d)*n>>16)<<9)/50|0),f.Ob[e++]=w+((this.Ub[t]-w)*n>>16)}if(a>=50&&this.Bb){const n=(50-l)*r.A.mv[a-l];f.Tb[e]=i+((u+((f.Ab[h]-u)*n>>16)<<9)/50|0),f.Rb[e]=s+((d+((f.mb[h]-d)*n>>16)<<9)/50|0),f.Ob[e++]=w+((this.Bb[t]-w)*n>>16)}}if(a>=50&&f.ub&&f.wb&&this.Bb)f.Tb[e]=f.ub[h],f.Rb[e]=f.wb[h],f.Ob[e++]=this.Bb[t];else if(f.Ab&&f.mb&&this.Bb){const u=f.Ab[h],d=f.mb[h],w=this.Bb[t];if(l>=50&&this.Fb){const h=(50-a)*r.A.mv[l-a];f.Tb[e]=i+((u+((f.Ab[n]-u)*h>>16)<<9)/50|0),f.Rb[e]=s+((d+((f.mb[n]-d)*h>>16)<<9)/50|0),f.Ob[e++]=w+((this.Fb[t]-w)*h>>16)}if(c>=50&&this.Ub){const n=(50-a)*r.A.mv[c-a];f.Tb[e]=i+((u+((f.Ab[o]-u)*n>>16)<<9)/50|0),f.Rb[e]=s+((d+((f.mb[o]-d)*n>>16)<<9)/50|0),f.Ob[e++]=w+((this.Ub[t]-w)*n>>16)}}if(c>=50&&f.ub&&f.wb&&this.Ub)f.Tb[e]=f.ub[o],f.Rb[e]=f.wb[o],f.Ob[e++]=this.Ub[t];else if(f.Ab&&f.mb&&this.Ub){const u=f.Ab[o],d=f.mb[o],w=this.Ub[t];if(a>=50&&this.Bb){const n=(50-c)*r.A.mv[a-c];f.Tb[e]=i+((u+((f.Ab[h]-u)*n>>16)<<9)/50|0),f.Rb[e]=s+((d+((f.mb[h]-d)*n>>16)<<9)/50|0),f.Ob[e++]=w+((this.Bb[t]-w)*n>>16)}if(l>=50&&this.Fb){const h=(50-c)*r.A.mv[l-c];f.Tb[e]=i+((u+((f.Ab[n]-u)*h>>16)<<9)/50|0),f.Rb[e]=s+((d+((f.mb[n]-d)*h>>16)<<9)/50|0),f.Ob[e++]=w+((this.Fb[t]-w)*h>>16)}}}const s=f.Tb[0],h=f.Tb[1],o=f.Tb[2],l=f.Rb[0],a=f.Rb[1],c=f.Rb[2];if(!((s-h)*(c-a)-(l-a)*(o-h)<=0))if(r.A.pI=!1,3===e){let e;if((s<0||h<0||o<0||s>n.A.gI||h>n.A.gI||o>n.A.gI)&&(r.A.pI=!0),e=this.kg?3&this.kg[t]:0,i)r.A._c(s,h,l,a,f.Ob[0]),r.A._c(h,o,a,c,f.Ob[1]),r.A._c(o,s,c,l,f.Ob[2]);else if(0===e)r.A.EI(s,h,o,l,a,c,f.Ob[0],f.Ob[1],f.Ob[2]);else if(1===e&&this.Fb)r.A.Dv(s,h,o,l,a,c,r.A.palette[this.Fb[t]]);else if(2===e&&this.kg&&this.Yu&&f.Ab&&f.mb&&f.pb){const i=this.kg[t]>>2,e=this.Wb[i],n=this.Yb[i],u=this.Hb[i];r.A.RI(s,h,o,l,a,c,f.Ob[0],f.Ob[1],f.Ob[2],f.Ab[e],f.mb[e],f.pb[e],f.Ab[n],f.Ab[u],f.mb[n],f.mb[u],f.pb[n],f.pb[u],this.Yu[t])}else if(3===e&&this.kg&&this.Yu&&this.Fb&&f.Ab&&f.mb&&f.pb){const i=this.kg[t]>>2,e=this.Wb[i],n=this.Yb[i],u=this.Hb[i];r.A.RI(s,h,o,l,a,c,this.Fb[t],this.Fb[t],this.Fb[t],f.Ab[e],f.mb[e],f.pb[e],f.Ab[n],f.Ab[u],f.mb[n],f.mb[u],f.pb[n],f.pb[u],this.Yu[t])}}else if(4===e){let e;if((s<0||h<0||o<0||s>n.A.gI||h>n.A.gI||o>n.A.gI||f.Tb[3]<0||f.Tb[3]>n.A.gI)&&(r.A.pI=!0),e=this.kg?3&this.kg[t]:0,i)r.A._c(s,h,l,a,f.Ob[0]),r.A._c(h,o,a,c,f.Ob[1]),r.A._c(o,f.Tb[3],c,f.Rb[3],f.Ob[2]),r.A._c(f.Tb[3],s,f.Rb[3],l,f.Ob[3]);else if(0===e)r.A.EI(s,h,o,l,a,c,f.Ob[0],f.Ob[1],f.Ob[2]),r.A.EI(s,o,f.Tb[3],l,c,f.Rb[3],f.Ob[0],f.Ob[2],f.Ob[3]);else if(1===e){if(this.Fb){const i=r.A.palette[this.Fb[t]];r.A.Dv(s,h,o,l,a,c,i),r.A.Dv(s,o,f.Tb[3],l,c,f.Rb[3],i)}}else if(2===e&&this.kg&&this.Yu&&f.Ab&&f.mb&&f.pb){const i=this.kg[t]>>2,e=this.Wb[i],n=this.Yb[i],u=this.Hb[i];r.A.RI(s,h,o,l,a,c,f.Ob[0],f.Ob[1],f.Ob[2],f.Ab[e],f.mb[e],f.pb[e],f.Ab[n],f.Ab[u],f.mb[n],f.mb[u],f.pb[n],f.pb[u],this.Yu[t]),r.A.RI(s,o,f.Tb[3],l,c,f.Rb[3],f.Ob[0],f.Ob[2],f.Ob[3],f.Ab[e],f.mb[e],f.pb[e],f.Ab[n],f.Ab[u],f.mb[n],f.mb[u],f.pb[n],f.pb[u],this.Yu[t])}else if(3===e&&this.kg&&this.Yu&&this.Fb&&f.Ab&&f.mb&&f.pb){const i=this.kg[t]>>2,e=this.Wb[i],n=this.Yb[i],u=this.Hb[i];r.A.RI(s,h,o,l,a,c,this.Fb[t],this.Fb[t],this.Fb[t],f.Ab[e],f.mb[e],f.pb[e],f.Ab[n],f.Ab[u],f.mb[n],f.mb[u],f.pb[n],f.pb[u],this.Yu[t]),r.A.RI(s,o,f.Tb[3],l,c,f.Rb[3],this.Fb[t],this.Fb[t],this.Fb[t],f.Ab[e],f.mb[e],f.pb[e],f.Ab[n],f.Ab[u],f.mb[n],f.mb[u],f.pb[n],f.pb[u],this.Yu[t])}}}Jb(t,i,e,s,n){if(!s)return;const h=s.length;if(0===n){let n=0;f.Ir=0,f.Lb=0,f._r=0;for(let t=0;t0?(f.Ir=(f.Ir/n|0)+t,f.Lb=(f.Lb/n|0)+i,f._r=(f._r/n|0)+e):(f.Ir=t,f.Lb=i,f._r=e)}else if(1===n)for(let n=0;n=this.$d.length)continue;const h=this.$d[r];if(h)for(let s=0;s=this.$d.length)continue;const o=this.$d[h];if(o)for(let s=0;s>16;this.jd[n]=this.jd[n]*u-this.Kd[n]*c>>16,this.Kd[n]=t}if(0!==h){c=r.A.sin[h],u=r.A.cos[h];const t=this.jd[n]*u-this.Xd[n]*c>>16;this.Xd[n]=this.jd[n]*c+this.Xd[n]*u>>16,this.jd[n]=t}if(0!==l){c=r.A.sin[l],u=r.A.cos[l];const t=this.Xd[n]*c+this.Kd[n]*u>>16;this.Xd[n]=this.Xd[n]*u-this.Kd[n]*c>>16,this.Kd[n]=t}this.Kd[n]+=f.Ir,this.jd[n]+=f.Lb,this.Xd[n]+=f._r}}else if(3===n)for(let n=0;n=this.$d.length)continue;const h=this.$d[r];if(h)for(let s=0;s=this.Jd.length)continue;const n=this.Jd[e];if(n)for(let i=0;i255&&(this.Gb[e]=255)}}}Qb(){this.iw=0,this.xm=0,this.Rg=0,this.Og=999999,this.Lg=-999999,this.xg=-99999,this.Sg=99999;for(let t=0;tthis.Lg&&(this.Lg=i),sthis.xg&&(this.xg=s),-e>this.iw&&(this.iw=-e),e>this.Rg&&(this.Rg=e);const n=i*i+s*s;n>this.xm&&(this.xm=n)}this.xm=0|Math.sqrt(this.xm),this.Kb=0|Math.sqrt(this.xm*this.xm+this.iw*this.iw),this.Vb=this.Kb+(0|Math.sqrt(this.xm*this.xm+this.Rg*this.Rg))}iT(t,i,e,s,n,r,h,o){return!(ie&&i>s&&i>n)&&(!(t{e.d(i,{A:()=>o});var s=e(8950),n=e(1069),r=e(4474),h=e(880);class o extends r.A{Rw;width;height;rT;hT;Fl;_w;constructor(t,i){super(),this.Rw=new Int32Array(t*i),this.width=this.Fl=t,this.height=this._w=i,this.rT=this.hT=0}static oT=async(t,i)=>{const e=t.read(i+'.dat');if(!e)throw new Error(`${i} jpeg not found!`);const s=await(0,h.r)(e),n=new o(s.width,s.height),r=new Uint32Array(s.data.buffer),l=n.Rw;for(let t=0;t>24&255)<<24|(255&i)<<16|(i>>8&255)<<8|i>>16&255}return n};static tc=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.Mf=s.Lu;const h=r.Lu,l=r.Lu,a=[],c=r.xu-1;for(let t=0;ts.length||r.Mf>r.length)throw new Error;const f=r.xu,u=r.xu,d=r.Lu,w=r.Lu,y=new o(d,w);y.rT=f,y.hT=u,y.Fl=h,y._w=l;const A=r.xu;if(0===A){const t=y.width*y.height;for(let i=0;is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,l+=i,o+=i}h>0&&r>0&&this.lT(h,r,this.Rw,n,l,s.A.Rw,e,o)}Nl(t,i,e){i|=0,e|=0;let n=(i+=this.rT)+(e+=this.hT)*s.A.Ow,r=0,h=this.height,o=this.width,l=s.A.Ow-o,a=0;if(es.A.bottom&&(h-=e+h-s.A.bottom),is.A.right){const t=i+o-s.A.right;o-=t,a+=t,l+=t}o>0&&h>0&&this.aT(o,h,this.Rw,r,a,s.A.Rw,n,l,t)}cT(t,i){t|=0,i|=0;let e=(t+=this.rT)+(i+=this.hT)*s.A.Ow,n=0,r=this.height,h=this.width,o=s.A.Ow-h,l=0;if(is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,l+=i,o+=i}h>0&&r>0&&this.fT(h,r,this.Rw,n,l,s.A.Rw,e,o)}uT(){const t=this.Rw,i=this.width,e=this.height;for(let s=0;s>16&255;r+=t,r<1?r=1:r>255&&(r=255);let h=n>>8&255;h+=i,h<1?h=1:h>255&&(h=255);let o=255&n;o+=e,o<1?o=1:o>255&&(o=255),this.Rw[s]=(r<<16)+(h<<8)+o}}}Pw(t,i,e,n){t|=0,i|=0,e|=0,n|=0;try{const r=this.width;let h=0,o=0;const l=this.Fl,a=this._w,c=(l<<16)/e|0,f=(a<<16)/n|0;t+=(this.rT*e+l-1)/l|0,i+=(this.hT*n+a-1)/a|0,this.rT*e%l!=0&&(h=(l-this.rT*e%l<<16)/e|0),this.hT*n%a!=0&&(o=(a-this.hT*n%a<<16)/n|0),e=e*(this.width-(h>>16))/l|0,n=n*(this.height-(o>>16))/a|0;let u=t+i*s.A.Ow,d=s.A.Ow-e;if(is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right){const i=t+e-s.A.right;e-=i,d+=i}this.scale(e,n,this.Rw,h,o,s.A.Rw,d,u,r,c,f)}catch(t){console.error('error in sprite clipping routine')}}wT(t,i,e,n,r,h,o,l,a,c){t|=0,i|=0,e|=0,n|=0;try{const f=-e/2|0,u=-n/2|0,d=65536*Math.sin(a/326.11)|0,w=65536*Math.cos(a/326.11)|0,y=d*c>>8,A=w*c>>8;let m=(o<<16)+u*y+f*A,p=u*A-f*y+(l<<16),g=t+i*s.A.Ow;for(let t=0;t>16)+(o>>16)*this.width],n+=A,o-=y;m+=y,p+=A,g+=s.A.Ow}}catch(t){}}yT(t,i,e){t|=0,i|=0;let n=(t+=this.rT)+(i+=this.hT)*s.A.Ow,r=0,h=this.height,o=this.width,l=s.A.Ow-o,a=0;if(is.A.bottom&&(h-=i+h-s.A.bottom),ts.A.right){const i=t+o-s.A.right;o-=i,a+=i,l+=i}o>0&&h>0&&this.AT(o,h,this.Rw,a,r,s.A.Rw,n,l,e.Rw)}scale(t,i,e,s,n,r,h,o,l,a,c){try{const f=s;for(let u=-i;u<0;u++){const i=(n>>16)*l;for(let n=-t;n<0;n++){const t=e[(s>>16)+i];0===t?o++:r[o++]=t,s+=a}n+=c,s=f,o+=h}}catch(t){console.error('error in plot_scale')}}fT(t,i,e,s,n,r,h,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++)r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++];for(let i=t;i<0;i++)r[h++]=e[s++];h+=o,s+=n}}aT(t,i,e,s,n,r,h,o,l){const a=256-l;for(let c=-i;c<0;c++){for(let i=-t;i<0;i++){const t=e[s++];if(0===t)h++;else{const i=r[h];r[h++]=((16711935&t)*l+(16711935&i)*a&4278255360)+((65280&t)*l+(65280&i)*a&16711680)>>8}}h+=o,s+=n}}lT(t,i,e,s,n,r,h,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=e[s++];0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=t}h+=o,s+=n}}AT(t,i,e,s,n,r,h,o,l){const a=-(t>>2);t=-(3&t);for(let c=-i;c<0;c++){for(let t=a;t<0;t++){let t=e[n++];0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++}for(let i=t;i<0;i++){const t=e[n++];0!==t&&0===l[h]?r[h++]=t:h++}h+=o,n+=s}}}},1673:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(8950),n=e(1069),r=e(4474);class h extends r.A{Rw;width;height;rT;hT;Fl;_w;palette;constructor(t,i,e){super(),this.Rw=new Int8Array(t*i),this.width=this.Fl=t,this.height=this._w=i,this.rT=this.hT=0,this.palette=e}static tc=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.Mf=s.Lu;const o=r.Lu,l=r.Lu,a=r.xu,c=new Int32Array(a);for(let t=1;ts.length||r.Mf>r.length)throw new Error;const f=r.xu,u=r.xu,d=r.Lu,w=r.Lu,y=new h(d,w,c);y.rT=f,y.hT=u,y.Fl=o,y._w=l;const A=y.Rw,m=r.xu;if(0===m){const t=y.width*y.height;for(let i=0;is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,l+=i,o+=i}h>0&&r>0&&this.mT(h,r,this.Rw,n,l,s.A.Rw,e,o)}uT(){const t=this.Rw,i=this.width,e=this.height;for(let s=0;s>16&255;n+=t,n<0?n=0:n>255&&(n=255);let r=this.palette[s]>>8&255;r+=i,r<0?r=0:r>255&&(r=255);let h=255&this.palette[s];h+=e,h<0?h=0:h>255&&(h=255),this.palette[s]=(n<<16)+(r<<8)+h}}Sv(){this.Fl|=0,this._w|=0,this.Fl/=2,this._w/=2,this.Fl|=0,this._w|=0;const t=new Int8Array(this.Fl*this._w);let i=0;for(let e=0;e>1)+(e+this.hT>>1)*this.Fl]=this.Rw[i++];this.Rw=t,this.width=this.Fl,this.height=this._w,this.rT=0,this.hT=0}Pw(){if(this.width===this.Fl&&this.height===this._w)return;const t=new Int8Array(this.Fl*this._w);let i=0;for(let e=0;e>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=e[s++];0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t]}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=this.palette[255&t]}h+=o,s+=n}}clip(t,i,e,n){try{const r=this.width;this.height;let h=0,o=0;const l=this.Fl,a=this._w,c=(l<<16)/e|0,f=(a<<16)/n|0;t=t+(this.rT*e+l-1)/l|0,i=i+(this.hT*n+a-1)/a|0,this.rT*e%l!=0&&(h=(l-this.rT*e%l<<16)/e|0),this.hT*n%a!=0&&(o=(a-this.hT*n%a<<16)/n|0),e=e*(this.width-(h>>16))/l|0,n=n*(this.height-(o>>16))/a|0;let u,d=t+i*s.A.Ow,w=s.A.Ow-e;is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right&&(u=t+e-s.A.right,e-=u,w+=u),this.pT(s.A.Rw,this.Rw,this.palette,h,o,d,w,e,n,c,f,r)}catch(t){console.log('error in sprite clipping routine')}}pT(t,i,e,s,n,r,h,o,l,a,c,f){try{const u=s;for(let d=-l;d<0;d++){const l=(n>>16)*f;for(let n=-o;n<0;n++){const n=i[(s>>16)+l];0==n?r++:t[r++]=e[255&n],s+=a}n+=c,s=u,r+=h}}catch(t){console.log('error in plot_scale')}}}},2682:(t,i,e)=>{e.d(i,{A:()=>l});var s=e(8950),n=e(1069),r=e(4474);class h{seed;constructor(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}gT(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}IT(){return this.next(32)}next(t){return this.seed=0x5deece66dn*this.seed+0xbn&(1n<<48n)-1n,Number(this.seed)>>>48-t}}var o=e(9298);class l extends r.A{static _T='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!"£$%^&*()-_=+[{]};:\'@#~,<.>/?\\| ';static CT=[];static{const t=navigator.userAgent.includes('Capacitor');for(let i=0;i<256;i++){let e=l._T.indexOf(String.fromCharCode(i));t&&e>=63&&e--,-1===e&&(e=74),l.CT[i]=e}}ET=[];vT=new Int32Array(94);bT=new Int32Array(94);TT=new Int32Array(94);RT=new Int32Array(94);OT=new Int32Array(95);LT=new Int32Array(256);random=new h(BigInt(Date.now()));height=0;static tc=(t,i)=>{const e=new n.A(t.read(i+'.dat')),s=new n.A(t.read('index.dat'));s.Mf=e.Lu+4;const r=s.xu;r>0&&(s.Mf+=3*(r-1));const h=new l;for(let t=0;t<94;t++){h.TT[t]=s.xu,h.RT[t]=s.xu;const i=h.vT[t]=s.Lu,n=h.bT[t]=s.Lu,r=s.xu,o=i*n;if(h.ET[t]=new Int8Array(o),0===r)for(let s=0;sh.height&&(h.height=n),h.TT[t]=1,h.OT[t]=i+2;{let e=0;for(let s=n/7|0;s=s.A.bottom&&(r-=e+r+1-s.A.bottom),i=s.A.right){const t=i+n+1-s.A.right;n-=t,a+=t,l+=t}n>0&&r>0&&this.BT(n,r,t,c,a,s.A.Rw,o,l,h)}DT(t,i,e,n,r,h,o){e|=0,n|=0;let l=(t|=0)+(i|=0)*s.A.Ow,a=s.A.Ow-e,c=0,f=0;if(i=s.A.bottom&&(n-=i+n+1-s.A.bottom),t=s.A.right){const i=t+e+1-s.A.right;e-=i,c+=i,a+=i}e>0&&n>0&&this.UT(e,n,s.A.Rw,l,a,o,f,c,r,h)}BT(t,i,e,s,n,r,h,o,l){const a=-((t|=0)>>2);t=-(3&t);for(let c=-(i|=0);c<0;c++){for(let t=a;t<0;t++)0===e[s++]?h++:r[h++]=l,0===e[s++]?h++:r[h++]=l,0===e[s++]?h++:r[h++]=l,0===e[s++]?h++:r[h++]=l;for(let i=t;i<0;i++)0===e[s++]?h++:r[h++]=l;h+=o,s+=n}}UT(t,i,e,s,n,r,h,o,l,a){t|=0;const c=((16711935&l)*a&4278255360)+((65280&l)*a&16711680)>>8,f=256-a;for(let l=-(i|=0);l<0;l++){for(let i=-t;i<0;i++)if(0===r[h++])s++;else{const t=e[s];e[s++]=(((16711935&t)*f&4278255360)+((65280&t)*f&16711680)>>8)+c}s+=n,h+=o}}xT(t){return'red'===t?o.A.RED:'gre'===t?o.A.GREEN:'blu'===t?o.A.BLUE:'yel'===t?o.A.Gl:'cya'===t?o.A.ZE:'mag'===t?o.A.Cm:'whi'===t?o.A.Il:'bla'===t?o.A.Pl:'lre'===t?o.A.qE:'dre'===t?o.A.JE:'dbl'===t?o.A.$E:'or1'===t?o.A.QE:'or2'===t?o.A.tv:'or3'===t?o.A.iv:'gr1'===t?o.A.ev:'gr2'===t?o.A.sv:'gr3'===t?o.A.nv:o.A.Pl}split(t,i){if(0===t.length)return[t];const e=[];for(;t.length>0;){if(this.kT(t)<=i&&-1===t.indexOf('|')){e.push(t);break}let s=t.length;for(let e=0;ei)break;s=e}else if('|'===t[e]){s=e;break}e.push(t.substring(0,s)),t=t.substring(s+1)}return e}}},1183:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(8950),n=e(7854);class r{PT;width;height;GT;WT;Rw;constructor(t,i,e=n.zo){this.GT=e,this.PT=this.GT.getImageData(0,0,t,i),this.WT=new Uint32Array(this.PT.data.buffer),this.Rw=new Int32Array(t*i),this.width=t,this.height=i,this.bind()}clear(){this.Rw.fill(0)}bind(){s.A.bind(this.Rw,this.width,this.height)}draw(t,i){this.#t(),this.GT.putImageData(this.PT,t,i)}#t(){const t=this.Rw.length,i=this.Rw,e=this.WT;for(let s=0;s>16&255|(t>>8&255)<<8|(255&t)<<16|4278190080}}}},4544:(t,i,e)=>{e.d(i,{A:()=>s});class s{db;constructor(t){t.onerror=this.onerror,t.onclose=this.onclose,this.db=t}static openDatabase=async()=>await new Promise(((t,i)=>{const e=indexedDB.open('lostcity',1);e.onsuccess=i=>{const e=i.target;console.log('database success!'),t(e.result)},e.onupgradeneeded=t=>{t.target.result.createObjectStore('cache')},e.onerror=t=>{const e=t.target;console.error('database error!: ',e.error),i(e.result)}}));Uo=async t=>await new Promise((i=>{const e=this.db.transaction('cache','readonly').objectStore('cache').get(t);e.onsuccess=()=>{i(e.result)},e.onerror=t=>{i(void 0)}}));Ho=async(t,i)=>await new Promise(((e,s)=>{const n=this.db.transaction('cache','readwrite').objectStore('cache').put(i,t);n.onsuccess=()=>{e()},n.onerror=t=>{s()}}));onclose=t=>{console.log('database close!')};onerror=t=>{console.log('database error!')};YT=t=>{const i=t.trim();let e=0;for(let t=0;t='A'&&s<='Z'?e+=s.charCodeAt(0)+1-65:s>='a'&&s<='z'?e+=s.charCodeAt(0)+1-97:s>='0'&&s<='9'&&(e+=s.charCodeAt(0)+27-48)}return e}}},2901:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(1908);class r{static YT=t=>{let i=0;t=t.toUpperCase();for(let e=0;e=this.VT)return null;if(this.ZT[t])return this.ZT[t];const i=this.zT[t],e=i+this.jT[t];if(this.HT){const s=Uint8Array.from(this.buffer.subarray(i,i+e));return this.ZT[t]=s,s}{const i=Uint8Array.from(n.A.read(this.XT[t],this.buffer,this.jT[t],this.zT[t]));return this.ZT[t]=i,i}}}},1069:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(9234),n=e(6666),r=e(4474);class h extends r.A{static JT=3988292384;static $T=new Int32Array(256);static QT=new Uint32Array(33);static tR=new n.A;static iR=new n.A;static eR=new n.A;static sR=0;static nR=0;static rR=0;static{for(let t=0;t<32;t++)h.QT[t]=(1<>>=1:i=i>>>1^h.JT;h.$T[t]=i}}static Po=t=>{let i=4294967295;for(let e=0;e>>8^h.$T[255&(i^t[e])];return~i};view;data;Mf=0;hR=0;random=null;constructor(t){if(!t)throw new Error('Input src packet array was null!');super(),t instanceof Int8Array?this.data=new Uint8Array(t):this.data=t,this.view=new DataView(this.data.buffer,this.data.byteOffset,this.data.byteLength)}get length(){return this.view.byteLength}get available(){return this.length-this.Mf}static Ut=t=>{let i=null;return 0===t&&h.sR>0?(h.sR--,i=h.tR.tI()):1===t&&h.nR>0?(h.nR--,i=h.iR.tI()):2===t&&h.rR>0&&(h.rR--,i=h.eR.tI()),i?(i.Mf=0,i):new h(0===t?new Uint8Array(100):1===t?new Uint8Array(5e3):new Uint8Array(3e4))};release(){this.Mf=0,100===this.view.byteLength&&h.sR<1e3?(h.tR.ZA(this),h.sR++):5e3===this.view.byteLength&&h.nR<250?(h.iR.ZA(this),h.nR++):3e4===this.view.byteLength&&h.rR<50&&(h.eR.ZA(this),h.rR++)}get xu(){return this.view.getUint8(this.Mf++)}get Yd(){return this.view.getInt8(this.Mf++)}get Lu(){const t=this.view.getUint16(this.Mf);return this.Mf+=2,t}get ku(){const t=this.view.getInt16(this.Mf);return this.Mf+=2,t}get rd(){const t=this.view.getUint8(this.Mf++)<<16|this.view.getUint16(this.Mf);return this.Mf+=2,t}get Ko(){const t=this.view.getInt32(this.Mf);return this.Mf+=4,t}get wE(){const t=this.view.getBigInt64(this.Mf);return this.Mf+=8,t}get VE(){return this.view.getUint8(this.Mf)<128?this.xu-64:this.Lu-49152}get Sm(){return this.view.getUint8(this.Mf)<128?this.xu:this.Lu-32768}get Nu(){const t=this.view,i=t.byteLength;let e,s='';for(;10!==(e=t.getUint8(this.Mf++))&&this.Mf>16),this.view.setUint16(this.Mf,t),this.Mf+=2}p4(t){this.view.setInt32(this.Mf,t),this.Mf+=4}cR(t){this.view.setInt32(this.Mf,t,!0),this.Mf+=4}fR(t){this.view.setBigInt64(this.Mf,t),this.Mf+=8}uR(t){const i=this.view,e=t.length;for(let s=0;s>>3,e=8-(7&this.hR),s=0;for(this.hR+=t;t>e;e=8)s+=(this.view.getUint8(i++)&h.QT[e])<>>e-t&h.QT[t],s}pR(t,i){const e=this.Mf;this.Mf=0;const n=new Uint8Array(e);this.oR(e,0,n);const r=(0,s.gR)(n),h=(0,s.IR)(r,i,t),o=(0,s._R)(h);this.Mf=0,this.p1(o.length),this.dR(o,o.length,0)}}},3937:(t,i,e)=>{e.d(i,{A:()=>o});class s{start=0;end=0;form=0;length=0;CR=null;ER=null;threshold=0;position=0;delta=0;amplitude=0;vR=0;read(t){this.form=t.xu,this.start=t.Ko,this.end=t.Ko,this.length=t.xu,this.CR=new Int32Array(this.length),this.ER=new Int32Array(this.length);for(let i=0;i=this.threshold&&this.ER&&this.CR&&(this.amplitude=this.ER[this.position++]<<15,this.position>=this.length&&(this.position=this.length-1),this.threshold=this.CR[this.position]/65536*t|0,this.threshold>this.vR&&(this.delta=((this.ER[this.position]<<15)-this.amplitude)/(this.threshold-this.vR)|0)),this.amplitude+=this.delta,this.vR++,this.amplitude-this.delta>>15}}class n{static buffer=null;static jA=null;static sin=null;static bR=new Int32Array(5);static TR=new Int32Array(5);static RR=new Int32Array(5);static OR=new Int32Array(5);static LR=new Int32Array(5);SR=null;xR=null;kR=null;MR=null;DR=null;NR=null;release=null;attack=null;FR=new Int32Array(5);BR=new Int32Array(5);UR=new Int32Array(5);start=0;length=500;PR=100;GR=0;static init=()=>{this.jA=new Int32Array(32768);for(let t=0;t<32768;t++)Math.random()>.5?this.jA[t]=1:this.jA[t]=-1;this.sin=new Int32Array(32768);for(let t=0;t<32768;t++)this.sin[t]=16384*Math.sin(t/5215.1903)|0;this.buffer=new Int32Array(220500)};WR(t,i){for(let i=0;i>1,h+=(i*s>>16)+r}if(this.DR&&this.NR){const i=this.DR.evaluate(t),e=this.NR.evaluate(t);c=c*(32768+(this.YR(e,a,this.DR.form)>>1))>>15,a+=(i*o>>16)+l}for(let s=0;s<5;s++)if(0!==this.FR[s]){const r=i+n.TR[s];r>15,n.bR[s],this.SR.form),n.bR[s]+=(e*n.OR[s]>>16)+n.LR[s])}}if(this.release&&this.attack){this.release.reset(),this.attack.reset();let i=0,e=!0;for(let s=0;s>8):this.release.start+((this.release.end-this.release.start)*h>>8),i+=256,i>=o&&(i=0,e=!e),e&&(n.buffer[s]=0)}}if(this.GR>0&&this.PR>0){const i=this.GR*e;for(let e=i;e32767&&(n.buffer[i]=32767);return n.buffer}YR(t,i,e){return 1===e?(32767&i)<16384?t:-t:2===e?n.sin[32767&i]*t>>14:3===e?((32767&i)*t>>14)-t:4===e?n.jA[i/2607&32767]*t:0}read(t){this.SR=new s,this.SR.read(t),this.xR=new s,this.xR.read(t),0!==t.xu&&(t.Mf--,this.kR=new s,this.kR.read(t),this.MR=new s,this.MR.read(t)),0!==t.xu&&(t.Mf--,this.DR=new s,this.DR.read(t),this.NR=new s,this.NR.read(t)),0!==t.xu&&(t.Mf--,this.release=new s,this.release.read(t),this.attack=new s,this.attack.read(t));for(let i=0;i<10;i++){const e=t.Sm;if(0===e)break;this.FR[i]=e,this.BR[i]=t.VE,this.UR[i]=t.Sm}this.GR=t.Sm,this.PR=t.Sm,this.length=t.Lu,this.start=t.Lu}}var r=e(1069),h=e(3867);class o{static HR=new Int32Array(1e3);static VR=null;static KR=null;static XR=new h.fe(1e3,null);jR=new h.fe(10,null);zR=0;loopEnd=0;static nc=t=>{const i=new r.A(t.read('sounds.dat'));for(this.VR=new Uint8Array(441e3),this.KR=new r.A(this.VR),n.init();;){const t=i.Lu;if(65535===t)break;const e=new o;e.read(i),this.XR[t]=e,this.HR[t]=e.trim()}};static WR=(t,i)=>{if(!this.XR[t])return null;const e=this.XR[t];return e?.ZR(i)??null};read(t){for(let i=0;i<10;i++)0!==t.xu&&(t.Mf--,this.jR[i]=new n,this.jR[i]?.read(t));this.zR=t.Lu,this.loopEnd=t.Lu}trim(){let t=9999999;for(let i=0;i<10;i++)this.jR[i]&&(this.jR[i].start/20|0)i&&(i=this.jR[t].length+this.jR[t].start);if(0===i)return 0;let e=22050*i/1e3|0,s=22050*this.zR/1e3|0,n=22050*this.loopEnd/1e3|0;(s<0||n<0||n>e||s>=n)&&(t=0);let r=e+(n-s)*(t-1);for(let t=44;t>8<<24>>24)}if(t>1){s+=44,n+=44,e+=44,r+=44;const i=r-e;for(let t=e-1;t>=n;t--)o.VR&&(o.VR[t+i]=o.VR[t]);for(let i=1;i{e.d(i,{ym:()=>a,wm:()=>o,fe:()=>s,Um:()=>n,Eh:()=>r,Dm:()=>h,Xr:()=>l});class s extends Array{constructor(t,i){super(t);for(let e=0;e{e.d(i,{_R:()=>o,Wo:()=>n,gR:()=>h,Yo:()=>s,Xa:()=>r,IR:()=>l});const s=async t=>new Promise((i=>setTimeout(i,t))),n=async t=>new Int8Array(await(await fetch(t)).arrayBuffer()),r=async t=>(await fetch(t)).text();function h(t){let i=0n;for(let e=0;e0n;)i.unshift(Number(0xffn&t)),t>>=8n;return 128&i[0]&&i.unshift(0),new Uint8Array(i)}function l(t,i,e){let s=1n;for(;i>0n;)i%2n===1n&&(s=s*t%e),t=t*t%e,i>>=1n;return s}},7953:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1069);class n{static qR=new Uint16Array(['d','o','t'].join('').split('').map((t=>t.charCodeAt(0))));static JR=new Uint16Array(['(','a',')'].join('').split('').map((t=>t.charCodeAt(0))));static $R=new Uint16Array(['s','l','a','s','h'].join('').split('').map((t=>t.charCodeAt(0))));static QR=['cook',"cook's",'cooks','seeks','sheet'];static tO=[];static iO=[];static eO=[];static sO=[];static nO=[];static rO=[];static nc=t=>{const i=new s.A(t.read('fragmentsenc.txt')),e=new s.A(t.read('badenc.txt')),n=new s.A(t.read('domainenc.txt')),r=new s.A(t.read('tldlist.txt'));this.read(e,n,i,r)};static filter=t=>{const i=[...t];this.format(i);const e=i.join('').trim(),s=e.toLowerCase(),n=[...s];this.hO(n),this.oO(n),this.lO(n),this.aO(n);for(let t=0;t{this.uO(t),this.dO(i),this.wO(e),this.yO(s)};static yO=t=>{const i=t.Ko;for(let e=0;et.xu))};static uO=t=>{const i=t.Ko;for(let e=0;et.xu));const i=new Array(t.xu).fill([]).map((()=>[t.Yd,t.Yd]));i.length>0&&(this.sO[e]=i)}};static dO=t=>{const i=t.Ko;for(let e=0;et.xu))};static wO=t=>{const i=t.Ko;for(let e=0;e{const i=[...t],e=[...t];this.AO(null,i,this.qR),this.AO(null,e,this.$R);for(let s=0;s{for(let i=0;i<2;i++)for(let i=this.eO.length-1;i>=0;i--)this.AO(this.sO[i],t,this.eO[i])};static lO=t=>{const i=[...t],e=[...t];this.AO(null,i,this.JR),this.AO(null,e,this.qR);for(let s=this.nO.length-1;s>=0;s--)this.pO(e,i,this.nO[s],t)};static aO=t=>{for(let i=0;i=0&&n{if(this.bO(t))return!0;const i=this.TO(t),e=this.rO,s=e.length;if(i===e[0]||i===e[s-1])return!0;let n=0,r=s-1;for(;n<=r;){const t=(n+r)/2|0;if(i===e[t])return!0;i{if(t.length>6)return 0;let i=0;for(let e=0;e{for(let e=i;e=0;e++)if(this.OO(t[e]))return e;return-1};static EO=(t,i)=>{for(let e=t;e=0;e++)if(!this.OO(i[e]))return e;return i.length};static LO=(t,i,e)=>i===e||'o'===i&&'0'===e?1:'o'===i&&'('===e&&')'===t?2:'c'!==i||'('!==e&&'<'!==e&&'['!==e?'e'===i&&'€'===e||'s'===i&&'$'===e||'l'===i&&'i'===e?1:0:1;static pO=(t,i,e,s)=>{const n=e.length,r=s.length;for(let h=0;h<=r-n;h++){const{SO:n,xO:r}=this.kO(h,e,s);if(!n)continue;const o=this.MO(h,s,3,i,['@']),l=this.DO(r-1,s,3,t,['.',',']);(o>2||l>2)&&this.CO(h,r,s)}};static kO=(t,i,e)=>{const s=i.length;let n=t,r=0;for(;n0)n+=l,r++;else{if(0===r)break;const e=this.LO(o,String.fromCharCode(i[r-1]),h);if(e>0)n+=e,1===r&&t++;else{if(r>=s||!this.IO(h))break;n++}}}return{SO:r>=s,xO:n}};static AO=(t,i,e)=>{if(!(e.length>i.length))for(let s=0;s<=i.length-e.length;s++){let n=s;const{xO:r,NO:h,FO:o,BO:l,UO:a}=this.PO(i,e,n);n=r;let c=i[n],f=n+1=e.length)||l&&a)continue;let u,d=!0;if(o){let t=!1,e=!1;if((s-1<0||this.IO(i[s-1])&&"'"!==i[s-1])&&(t=!0),(n>=i.length||this.IO(i[n])&&"'"!==i[n])&&(e=!0),!t||!e){let e=!1;for(u=s-2,t&&(u=s);!e&&u=0&&(!this.IO(i[u])||"'"===i[u])){const t=[];let s;for(s=0;s<3&&u+s=0&&(!this.IO(i[u-1])||"'"===i[u-1])&&(n=!1),n&&!this.vO(t)&&(e=!0)}u++}e||(d=!1)}}else{c=' ',s-1>=0&&(c=i[s-1]),f=' ',n{let s=e,n=0,r=0,h=!1,o=!1,l=!1;for(;s=t.length||o&&l);){const a=t[s],c=s+10)1===f&&this.OO(a)&&(o=!0),2===f&&(this.OO(a)||this.OO(c))&&(o=!0),s+=f,n++;else{if(0===n)break;let t;if((t=this.HO(c,String.fromCharCode(i[n-1]),a))>0)s+=t;else{if(n>=i.length||!this._O(a))break;if(this.IO(a)&&"'"!==a&&(h=!0),this.OO(a)&&(l=!0),s++,r++,(100*r/(s-e)|0)>90)break}}}return{xO:s,NO:n,FO:h,BO:o,UO:l}};static HO=(t,i,e)=>{if(i===e)return 1;if(i>='a'&&i<='m'){if('a'===i)return'4'!==e&&'@'!==e&&'^'!==e?'/'===e&&'\\'===t?2:0:1;if('b'===i)return'6'!==e&&'8'!==e?'1'===e&&'3'===t?2:0:1;if('c'===i)return'('!==e&&'<'!==e&&'{'!==e&&'['!==e?0:1;if('d'===i)return'['===e&&')'===t?2:0;if('e'===i)return'3'!==e&&'€'!==e?0:1;if('f'===i)return'p'===e&&'h'===t?2:'£'===e?1:0;if('g'===i)return'9'!==e&&'6'!==e?0:1;if('h'===i)return'#'===e?1:0;if('i'===i)return'y'!==e&&'l'!==e&&'j'!==e&&'1'!==e&&'!'!==e&&':'!==e&&';'!==e&&'|'!==e?0:1;if('j'===i)return 0;if('k'===i)return 0;if('l'===i)return'1'!==e&&'|'!==e&&'i'!==e?0:1;if('m'===i)return 0}if(i>='n'&&i<='z'){if('n'===i)return 0;if('o'===i)return'0'!==e&&'*'!==e?'('===e&&')'===t||'['===e&&']'===t||'{'===e&&'}'===t||'<'===e&&'>'===t?2:0:1;if('p'===i)return 0;if('q'===i)return 0;if('r'===i)return 0;if('s'===i)return'5'!==e&&'z'!==e&&'$'!==e&&'2'!==e?0:1;if('t'===i)return'7'!==e&&'+'!==e?0:1;if('u'===i)return'v'===e?1:'\\'===e&&'/'===t||'\\'===e&&'|'===t||'|'===e&&'/'===t?2:0;if('v'===i)return'\\'===e&&'/'===t||'\\'===e&&'|'===t||'|'===e&&'/'===t?2:0;if('w'===i)return'v'===e&&'v'===t?2:0;if('x'===i)return')'===e&&'('===t||'}'===e&&'{'===t||']'===e&&'['===t||'>'===e&&'<'===t?2:0;if('y'===i)return 0;if('z'===i)return 0}return i>='0'&&i<='9'?'0'===i?'o'===e||'O'===e?1:'('===e&&')'===t||'{'===e&&'}'===t||'['===e&&']'===t?2:0:'1'===i&&'l'===e?1:0:','===i?'.'===e?1:0:'.'===i?','===e?1:0:'!'===i&&'i'===e?1:0};static WO=(t,i,e)=>{let s=0,n=i.length-1;for(;s<=n;){const r=(s+n)/2|0;if(i[r][0]===t&&i[r][1]===e)return!0;tthis.RO(t)?t.charCodeAt(0)+1-'a'.charCodeAt(0):"'"===t?28:this.OO(t)?t.charCodeAt(0)+29-'0'.charCodeAt(0):27;static mO=(t,i,e,s,n)=>{if(!(s.length>e.length))for(let r=0;r<=e.length-s.length;r++){const{xO:h,VO:o}=this.KO(e,s,r);if(o0&&c>0&&(l=!0),2===i&&(a>2&&c>0||a>0&&c>2)&&(l=!0),3===i&&a>0&&c>2&&(l=!0),!l)continue;let f,u=r,d=h-1,w=!1;if(a>2){if(4===a)for(w=!1,f=r-1;f>=0;f--)if(w){if('*'!==n[f])break;u=f}else'*'===n[f]&&(u=f,w=!0);for(w=!1,f=u-1;f>=0;f--)if(w){if(this.IO(e[f]))break;u=f}else this.IO(e[f])||(w=!0,u=f)}if(c>2){if(4===c)for(w=!1,f=d+1;f{let s=0;for(;e0)e+=h,s++;else{if(0===s)break;let t;if((t=this.LO(r,String.fromCharCode(i[s-1]),n))>0)e+=t;else{if(!this.IO(n))break;e++}}}return{xO:e,VO:s}};static IO=t=>!this.YO(t)&&!this.OO(t);static _O=t=>!this.RO(t)||('v'===t||'x'===t||'j'===t||'q'===t||'z'===t);static YO=t=>this.RO(t)||this.XO(t);static OO=t=>t>='0'&&t<='9';static RO=t=>t>='a'&&t<='z';static XO=t=>t>='A'&&t<='Z';static bO=t=>{for(let i=0;i{for(let s=t;s{let e=0;for(let s=i-1;s>=0&&this.IO(t[s]);s--)'*'===t[s]&&e++;return e};static zO=(t,i)=>{let e=0;for(let s=i+1;s(n?this.jO(i,e):this.zO(i,e))>=s?4:this.IO(n?t[e-1]:t[e+1])?1:0;static MO=(t,i,e,s,n)=>{if(0===t)return 2;for(let e=t-1;e>=0&&this.IO(i[e]);e--)if(n.includes(i[e]))return 3;return this.ZO(i,s,t,e,!0)};static DO=(t,i,e,s,n)=>{if(t+1===i.length)return 2;for(let e=t+1;e{let i=0;for(let e=0;et>=' '&&t<=''||' '===t||'\n'===t||'\t'===t||'£'===t||'€'===t;static cO=(t,i)=>{for(let e=0;e{let i=!0;for(let e=0;e{e.d(i,{A:()=>n});var s=e(9763);class n{static JO=null;static load=async t=>{this.JO=await(0,s.F)(new WebAssembly.Module(t),{env:void 0})};static read=(t,i,e,s)=>{if(!this.JO)throw new Error('bz2 not found!!');return Int8Array.from(this.JO.read(t,i,e,s))}}},123:(t,i,e)=>{function s(t,i){window._tinyMidiPlay&&window._tinyMidiPlay(t,i/256)}function n(){window._tinyMidiStop&&window._tinyMidiStop()}e.d(i,{Xo:()=>s,Ro:()=>n})},9763:(t,i,e)=>{async function s(t,i={}){const e={env:Object.assign(Object.create(globalThis),i.env||{},{abort(t,i,e,s){t=h(t>>>0),i=h(i>>>0),e>>>=0,s>>>=0,(()=>{throw Error(`${t} in ${i}:${e}:${s}`)})()}})},{exports:s}=await WebAssembly.instantiate(t,e),n=s.memory||i.env.memory,r=Object.setPrototypeOf({read:(t,i,e,r)=>(i=function(t,i,e,r,h){if(null==r)return 0;const o=r.length,l=s.__pin(s.__new(o<>>0;if(h)new h(n.buffer,l,o).set(r);else for(let i=0;i>>0),r[i]);return s.__unpin(l),l}(l,6,0,i,Int8Array)||function(){throw TypeError("value must not be null")}(),function(t,i,e){if(!e)return null;const s=function(t){try{return o.getUint32(t,!0)}catch{return o=new DataView(n.buffer),o.getUint32(t,!0)}}(e-4)>>>i,r=new Array(s);for(let n=0;n>>0));return r}(a,0,s.read(t,i,e,r)>>>0))},s);function h(t){if(!t)return null;const i=t+new Uint32Array(n.buffer)[t-4>>>2]>>>1,e=new Uint16Array(n.buffer);let s=t>>>1,r="";for(;i-s>1024;)r+=String.fromCharCode(...e.subarray(s,s+=1024));return r+String.fromCharCode(...e.subarray(s,i))}let o=new DataView(n.buffer);function l(t,i){try{o.setUint8(t,i,!0)}catch{o=new DataView(n.buffer),o.setUint8(t,i,!0)}}function a(t){try{return o.getInt8(t,!0)}catch{return o=new DataView(n.buffer),o.getInt8(t,!0)}}return r}e.d(i,{F:()=>s})},9896:(t,i,e)=>{var s=e(8151);!function(){window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioContext&&(window.audioContext=new window.AudioContext);var t=function(i){if(window.audioContext){var e=window.audioContext.createBuffer(1,1,22050),s=window.audioContext.createBufferSource();s.buffer=e,s.connect(window.audioContext.destination),s.start?s.start(0):s.play?s.play(0):s.noteOn&&s.noteOn(0)}document.removeEventListener('touchstart',t),document.removeEventListener('touchend',t),document.removeEventListener('click',t)};document.addEventListener('touchstart',t),document.addEventListener('touchend',t),document.addEventListener('click',t)}(),(async()=>{let t=new Float32Array,i=window.audioContext.createGain();i.gain.value=.1,i.connect(window.audioContext.destination);let e=window.audioContext.currentTime,n=[];const r=new s.A({$O:30,QO:i=>{let e=new Float32Array(i.buffer),s=new Float32Array(t.length+e.length);s.set(t,0),s.set(e,t.length),t=s},tL:t=>{},bufferSize:102400});await r.init();const h=await fetch('./SCC1_Florestan.sf2'),o=new Uint8Array(await h.arrayBuffer());function l(){if(!window.audioContext||!t.length)return;let s=window.audioContext.createBufferSource();const r=t.length/2,h=window.audioContext.createBuffer(2,r,44100);for(let i=0;i<2;i++){const e=h.getChannelData(i);let s=i;for(let i=0;i{if(a&&clearInterval(a),t=new Float32Array,n.length){let t=i.gain.value;i.gain.value=0,n.forEach((t=>{t.stop(window.audioContext.currentTime)})),n=[],i.gain.value=t}},window._tinyMidiVolume=(t=1)=>{i.gain.value=t},window._tinyMidiPlay=async(t,i=1)=>{t&&(await window._tinyMidiStop(),-1!=i&&window._tinyMidiVolume(i),e=window.audioContext.currentTime,a=setInterval(l,250),r.eL(t))}})()},8151:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5473);const n=class{constructor(t={}){this.sL=void 0,this.nL=0,this.rL=0,this.hL=0,this.$O=t.$O||100,this.sampleRate=t.sampleRate||44100,this.oL=t.oL||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.lL(1),this.QO=t.QO||(()=>{}),this.tL=t.tL||(()=>{}),this.aL=void 0,this.test=0}async init(){if(!this.sL){if('undefined'!=typeof process){const{cL:t}=await import('path'),{fL:i}=await import('module');globalThis.__dirname=t("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js"),globalThis.require=i("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js")}this.sL=await(0,s.A)(),this.uL=this.sL._malloc(this.bufferSize),this.dL=this.sL._malloc(8)}}lL(t){this.bufferSize=4*this.sampleRate*this.oL*t}wL(){if(!this.sL)throw new Error(`${this.constructor.name} not initalized. call .init()`)}iL(t){this.wL();const{_malloc:i,_free:e,_tsf_load_memory:s,_tsf_set_output:n,_tsf_channel_set_bank_preset:r,_tsf_set_max_voices:h,_tsf_channel_set_presetnumber:o}=this.sL;e(this.nL),this.nL=i(t.length),this.sL.HEAPU8.set(t,this.nL),this.rL=s(this.nL,t.length),n(this.rL,2===this.oL?0:2,this.sampleRate,this.gain)}yL(){this.wL();const t=new Uint8Array(this.bufferSize);return t.set(this.sL.HEAPU8.subarray(this.uL,this.uL+this.bufferSize)),t}AL(t){const{_malloc:i,_free:e,_tml_load_memory:s}=this.sL;return e(this.hL),this.hL=i(t.length),this.sL.HEAPU8.set(t,this.hL),s(this.hL,t.length)}mL(t){const{_midi_render:i}=this.sL;return i(this.rL,t,this.oL,this.sampleRate,this.uL,this.bufferSize,this.dL)}eL(t){if(this.wL(),!this.rL)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.aL);const{setValue:i,getValue:e}=this.sL;i(this.dL,0,'double'),this.sL._tsf_reset(this.rL),this.sL._tsf_channel_set_bank_preset(this.rL,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let s=this.AL(t);const n=()=>{s=this.mL(s);const t=this.yL();this.QO(t),s?this.aL=setTimeout(n,this.$O):this.tL(e(this.dL,'double'))};this.aL=setTimeout(n,16)}}},8227:(t,i,e)=>{t.exports=e.p+"9f86b5397894e28b5ae2.wasm"},5473:(t,i,e)=>{var s;e.d(i,{A:()=>n});const n=(s="file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/tinymidipcm.mjs",function(t){var i,n,r=void 0!==(t=t||{})?t:{};r.ready=new Promise((function(t,e){i=t,n=e})),["_tsf_load_memory","_tsf_set_output","_tsf_channel_set_bank_preset","_tsf_set_max_voices","_tsf_channel_set_presetnumber","_tsf_reset","_tsf_close","_tml_load_memory","_midi_render","_malloc","_realloc","_free","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(r.ready,t)||Object.defineProperty(r.ready,t,{get:()=>j('You are getting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),set:()=>j('You are setting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js')})}));var h=Object.assign({},r),o=[],l='object'==typeof window,a='function'==typeof importScripts,c='object'==typeof process&&'object'==typeof process.versions&&'string'==typeof process.versions.node,f=!l&&!c&&!a;if(r.ENVIRONMENT)throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');var u,d,w,y='';if(c){if('undefined'==typeof process||!process.release||'node'!==process.release.name)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');var A,m;y=a?require('path').cL(y)+'/':__dirname+'/';var p=()=>{m||(A=require('fs'),m=require('path'))};u=(t,i)=>(p(),t=m.normalize(t),A.pL(t,i?void 0:'utf8')),w=t=>{var i=u(t,!0);return i.buffer||(i=new Uint8Array(i)),D(i.buffer),i},d=(t,i,e)=>{p(),t=m.normalize(t),A.gL(t,(function(t,s){t?e(t):i(s.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,'/'),o=process.argv.slice(2),process.on('uncaughtException',(function(t){if(!(t instanceof nt))throw t})),process.on('unhandledRejection',(function(t){throw t})),r.inspect=function(){return'[Emscripten Module object]'}}else if(f){if('object'==typeof process&&'function'==typeof require||'object'==typeof window||'function'==typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');'undefined'!=typeof read&&(u=function(t){return read(t)}),w=function(t){let i;return'function'==typeof readbuffer?new Uint8Array(readbuffer(t)):(i=read(t,'binary'),D('object'==typeof i),i)},d=function(t,i,e){setTimeout((()=>i(w(t))),0)},'undefined'!=typeof scriptArgs?o=scriptArgs:void 0!==arguments&&(o=arguments),'undefined'!=typeof print&&('undefined'==typeof console&&(console={}),console.log=print,console.warn=console.error='undefined'!=typeof printErr?printErr:print)}else{if(!l&&!a)throw new Error('environment detection error');if(a?y=self.location.href:'undefined'!=typeof document&&document.currentScript&&(y=document.currentScript.src),s&&(y=s),y=0!==y.indexOf('blob:')?y.substr(0,y.replace(/[?#].*/,"").lastIndexOf('/')+1):'','object'!=typeof window&&'function'!=typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');u=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.send(null),i.responseText},a&&(w=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.responseType='arraybuffer',i.send(null),new Uint8Array(i.response)}),d=(t,i,e)=>{var s=new XMLHttpRequest;s.open('GET',t,!0),s.responseType='arraybuffer',s.onload=()=>{200==s.status||0==s.status&&s.response?i(s.response):e()},s.onerror=e,s.send(null)}}r.print||console.log.bind(console);var g,I,_=r.printErr||console.warn.bind(console);function C(t,i){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){j('Module.'+t+' has been replaced with plain '+i+' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')}})}function E(t){return'FS_createPath'===t||'FS_createDataFile'===t||'FS_createPreloadedFile'===t||'FS_unlink'===t||'addRunDependency'===t||'FS_createLazyFile'===t||'FS_createDevice'===t||'removeRunDependency'===t}Object.assign(r,h),h=null,g='fetchSettings',Object.getOwnPropertyDescriptor(r,g)&&j('`Module.'+g+'` was supplied but `'+g+'` not included in INCOMING_MODULE_JS_API'),r.arguments&&(o=r.arguments),C('arguments','arguments_'),r.thisProgram&&r.thisProgram,C('thisProgram','thisProgram'),r.quit&&r.quit,C('quit','quit_'),D(void 0===r.memoryInitializerPrefixURL,'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.pthreadMainPrefixURL,'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.cdInitializerPrefixURL,'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.filePackagePrefixURL,'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.read,'Module.read option was removed (modify read_ in JS)'),D(void 0===r.readAsync,'Module.readAsync option was removed (modify readAsync in JS)'),D(void 0===r.readBinary,'Module.readBinary option was removed (modify readBinary in JS)'),D(void 0===r.setWindowTitle,'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'),D(void 0===r.TOTAL_MEMORY,'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'),C('read','read_'),C('readAsync','readAsync'),C('readBinary','readBinary'),C('setWindowTitle','setWindowTitle'),D(!f,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),r.wasmBinary&&(I=r.wasmBinary),C('wasmBinary','wasmBinary');var v;r.noExitRuntime;C('noExitRuntime','noExitRuntime'),'object'!=typeof WebAssembly&&j('no native wasm support detected');var b,T,R,O,L,S,x,k,M=!1;function D(t,i){t||j('Assertion failed'+(i?': '+i:''))}function N(t){b=t,r.HEAP8=T=new Int8Array(t),r.HEAP16=O=new Int16Array(t),r.HEAP32=L=new Int32Array(t),r.HEAPU8=R=new Uint8Array(t),r.HEAPU16=new Uint16Array(t),r.HEAPU32=S=new Uint32Array(t),r.HEAPF32=x=new Float32Array(t),r.HEAPF64=k=new Float64Array(t)}'undefined'!=typeof TextDecoder&&new TextDecoder('utf8');var F=5242880;r.TOTAL_STACK&&D(F===r.TOTAL_STACK,'the stack size can no longer be determined at runtime');var B=r.INITIAL_MEMORY||16777216;function U(){if(!M){var t=ft(),i=S[t>>2],e=S[t+4>>2];34821223==i&&2310721022==e||j('Stack overflow! Stack cookie has been overwritten at 0x'+t.toString(16)+', expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+e.toString(16)+' 0x'+i.toString(16)),1668509029!==S[0]&&j('Runtime error: The application has corrupted its heap memory area (address zero)!')}}C('INITIAL_MEMORY','INITIAL_MEMORY'),D(B>=F,'INITIAL_MEMORY should be larger than TOTAL_STACK, was '+B+'! (TOTAL_STACK='+F+')'),D('undefined'!=typeof Int32Array&&'undefined'!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,'JS engine does not provide full typed array support'),D(!r.wasmMemory,'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'),D(16777216==B,'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'),function(){var t=new Int16Array(1),i=new Int8Array(t.buffer);if(t[0]=25459,115!==i[0]||99!==i[1])throw'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'}();var P=[],G=[],W=[],Y=!1;D(Math.imul,'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.fround,'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.clz32,'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.trunc,'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');var H=0,V=null,K=null,X={};function j(t){r.onAbort&&r.onAbort(t),_(t='Aborted('+t+')'),M=!0;var i=new WebAssembly.RuntimeError(t);throw n(i),i}var z={error:function(){j('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM')},init:function(){z.error()},IL:function(){z.error()},_L:function(){z.error()},CL:function(){z.error()},open:function(){z.error()},EL:function(){z.error()},vL:function(){z.error()},bL:function(){z.error()},TL:function(){z.error()},RL:function(){z.error()}};r.FS_createDataFile=z.IL,r.FS_createPreloadedFile=z._L;var Z,q,J,$,Q='data:application/octet-stream;base64,';function tt(t){return t.startsWith(Q)}function it(t){return t.startsWith('file://')}function et(t,i){return function(){var e=t,s=i;return i||(s=r.asm),D(Y,'native function `'+e+'` called before runtime initialization'),s[t]||D(s[t],'exported native function `'+e+'` not found'),s[t].apply(null,arguments)}}function st(t){try{if(t==Z&&I)return new Uint8Array(I);if(w)return w(t);throw"both async and sync fetching of the wasm failed"}catch(t){j(t)}}function nt(t){this.name='ExitStatus',this.message='Program terminated with exit('+t+')',this.status=t}function rt(t){for(;t.length>0;)t.shift()(r)}function ht(t){ht.OL||(ht.OL={}),ht.OL[t]||(ht.OL[t]=1,c&&(t='warning: '+t),_(t))}function ot(t){try{return v.LL(t-b.byteLength+65535>>>16),N(v.buffer),1}catch(i){_('emscripten_realloc_buffer: Attempted to grow heap from '+b.byteLength+' bytes to '+t+' bytes, but got error: '+i)}}r.locateFile?tt(Z='tinymidipcm.wasm')||(q=Z,Z=r.locateFile?r.locateFile(q,y):y+q):Z=new URL(e(8227),e.b).toString();var lt,at={"emscripten_memcpy_big":function(t,i,e){R.copyWithin(t,i,i+e)},"emscripten_resize_heap":function(t){var i=R.length;D((t>>>=0)>i);var e,s,n=2147483648;if(t>n)return _('Cannot enlarge memory, asked to go up to '+t+' bytes, but the limit is '+n+' bytes!'),!1;for(var r=1;r<=4;r*=2){var h=i*(1+.2/r);h=Math.min(h,t+100663296);var o=Math.min(n,(e=Math.max(t,h))+((s=65536)-e%s)%s);if(ot(o))return!0}return _('Failed to grow the heap from '+i+' bytes to '+o+' bytes, not enough memory!'),!1}},ct=(function(){var t,i={'env':at,'wasi_snapshot_preview1':at};function e(t,i){var e,s=t.exports;r.asm=s,D(v=r.asm.memory,"memory not found in wasm exports"),N(v.buffer),D(r.asm.__indirect_function_table,"table not found in wasm exports"),e=r.asm.__wasm_call_ctors,G.unshift(e),function(t){if(H--,r.monitorRunDependencies&&r.monitorRunDependencies(H),t?(D(X[t]),delete X[t]):_('warning: run dependency removed without ID'),0==H&&(null!==V&&(clearInterval(V),V=null),K)){var i=K;K=null,i()}}('wasm-instantiate')}t='wasm-instantiate',H++,r.monitorRunDependencies&&r.monitorRunDependencies(H),t?(D(!X[t]),X[t]=1,null===V&&'undefined'!=typeof setInterval&&(V=setInterval((function(){if(M)return clearInterval(V),void(V=null);var t=!1;for(var i in X)t||(t=!0,_('still waiting on run dependencies:')),_('dependency: '+i);t&&_('(end of list)')}),1e4))):_('warning: run dependency added without ID');var s=r;function h(t){D(r===s,'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'),s=null,e(t.instance)}function o(t){return function(){if(!I&&(l||a)){if('function'==typeof fetch&&!it(Z))return fetch(Z,{credentials:'same-origin'}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+Z+"'";return t.arrayBuffer()})).catch((function(){return st(Z)}));if(d)return new Promise((function(t,i){d(Z,(function(i){t(new Uint8Array(i))}),i)}))}return Promise.resolve().then((function(){return st(Z)}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){_('failed to asynchronously prepare wasm: '+t),it(Z)&&_('warning: Loading from a file URI ('+Z+') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing'),j(t)}))}if(r.instantiateWasm)try{return r.instantiateWasm(i,e)}catch(t){_('Module.instantiateWasm callback failed with error: '+t),n(t)}(I||'function'!=typeof WebAssembly.instantiateStreaming||tt(Z)||it(Z)||c||'function'!=typeof fetch?o(h):fetch(Z,{credentials:'same-origin'}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(h,(function(t){return _('wasm streaming compile failed: '+t),_('falling back to ArrayBuffer instantiation'),o(h)}))}))).catch(n)}(),r.___wasm_call_ctors=et("__wasm_call_ctors"),r._malloc=et("malloc"),r._free=et("free"),r._tsf_load_memory=et("tsf_load_memory"),r._tsf_close=et("tsf_close"),r._tsf_reset=et("tsf_reset"),r._tsf_set_output=et("tsf_set_output"),r._tsf_set_max_voices=et("tsf_set_max_voices"),r._realloc=et("realloc"),r._tsf_channel_set_presetnumber=et("tsf_channel_set_presetnumber"),r._tsf_channel_set_bank_preset=et("tsf_channel_set_bank_preset"),r._tml_load_memory=et("tml_load_memory"),r._midi_render=et("midi_render"),r.___errno_location=et("__errno_location"),r._fflush=et("fflush"),r._emscripten_stack_init=function(){return(ct=r._emscripten_stack_init=r.asm.emscripten_stack_init).apply(null,arguments)}),ft=(r._emscripten_stack_get_free=function(){return(r._emscripten_stack_get_free=r.asm.emscripten_stack_get_free).apply(null,arguments)},r._emscripten_stack_get_base=function(){return(r._emscripten_stack_get_base=r.asm.emscripten_stack_get_base).apply(null,arguments)},r._emscripten_stack_get_end=function(){return(ft=r._emscripten_stack_get_end=r.asm.emscripten_stack_get_end).apply(null,arguments)});function ut(){var t;ct(),D(!(3&(t=ft()))),S[t>>2]=34821223,S[t+4>>2]=2310721022,S[0]=1668509029}function dt(t){function e(){lt||(lt=!0,r.calledRun=!0,M||(D(!Y),Y=!0,U(),rt(G),i(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),D(!r._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(U(),r.postRun)for('function'==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)t=r.postRun.shift(),W.unshift(t);var t;rt(W)}()))}t=t||o,H>0||(ut(),function(){if(r.preRun)for('function'==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)t=r.preRun.shift(),P.unshift(t);var t;rt(P)}(),H>0||(r.setStatus?(r.setStatus('Running...'),setTimeout((function(){setTimeout((function(){r.setStatus('')}),1),e()}),1)):e(),U()))}if(r.stackSave=et("stackSave"),r.stackRestore=et("stackRestore"),r.stackAlloc=et("stackAlloc"),r.setValue=function(t,i,e="i8"){switch(e.endsWith('*')&&(e='*'),e){case'i1':case'i8':T[0|t]=i;break;case'i16':O[t>>1]=i;break;case'i32':L[t>>2]=i;break;case'i64':$=[i>>>0,(J=i,+Math.abs(J)>=1?J>0?(0|Math.min(+Math.floor(J/4294967296),4294967295))>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],L[t>>2]=$[0],L[t+4>>2]=$[1];break;case'float':x[t>>2]=i;break;case'double':k[t>>3]=i;break;case'*':S[t>>2]=i;break;default:j('invalid type for setValue: '+e)}},r.getValue=function(t,i="i8"){switch(i.endsWith('*')&&(i='*'),i){case'i1':case'i8':return T[0|t];case'i16':return O[t>>1];case'i32':case'i64':return L[t>>2];case'float':return x[t>>2];case'double':return k[t>>3];case'*':return S[t>>2];default:j('invalid type for getValue: '+i)}return null},['run','UTF8ArrayToString','UTF8ToString','stringToUTF8Array','stringToUTF8','lengthBytesUTF8','addOnPreRun','addOnInit','addOnPreMain','addOnExit','addOnPostRun','addRunDependency','removeRunDependency','FS_createFolder','FS_createPath','FS_createDataFile','FS_createPreloadedFile','FS_createLazyFile','FS_createLink','FS_createDevice','FS_unlink','getLEB','getFunctionTables','alignFunctionTables','registerFunctions','prettyPrint','getCompilerSetting','print','printErr','callMain','abort','keepRuntimeAlive','wasmMemory','stackAlloc','stackSave','stackRestore','getTempRet0','setTempRet0','writeStackCookie','checkStackCookie','ptrToString','zeroMemory','stringToNewUTF8','exitJS','getHeapMax','emscripten_realloc_buffer','ENV','ERRNO_CODES','ERRNO_MESSAGES','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','DNS','getHostByName','Protocols','Sockets','getRandomDevice','warnOnce','traverseStack','UNWIND_CACHE','convertPCtoSourceLocation','readAsmConstArgsArray','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','handleException','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','freeTableIndexes','functionsInTableMap','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','PATH','PATH_FS','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16Decoder','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeArrayToMemory','writeAsciiToMemory','SYSCALLS','getSocketFromFD','getSocketAddress','JSEvents','registerKeyEventCallback','specialHTMLTargets','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','currentFullscreenStrategy','restoreOldWindowedStyle','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','demangle','demangleAll','jsStackTrace','stackTrace','ExitStatus','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','dlopenMissingError','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','uncaughtExceptionCount','exceptionLast','exceptionCaught','ExceptionInfo','exception_addRef','exception_decRef','Browser','setMainLoop','wget','FS','MEMFS','TTY','PIPEFS','SOCKFS','_setNetworkCallback','tempFixedLengthArray','miniTempWebGLFloatBuffers','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','GL','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','AL','SDL_unicode','SDL_ttfContext','SDL_audio','SDL','SDL_gfx','GLUT','EGL','GLFW_Window','GLFW','GLEW','IDBStore','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){var i="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),j(i)}})})),['ptrToString','zeroMemory','stringToNewUTF8','exitJS','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','getHostByName','getRandomDevice','traverseStack','convertPCtoSourceLocation','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeAsciiToMemory','getSocketFromFD','getSocketAddress','registerKeyEventCallback','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','ExceptionInfo','exception_addRef','exception_decRef','setMainLoop','_setNetworkCallback','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','SDL_unicode','SDL_ttfContext','SDL_audio','GLFW_Window','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){'undefined'==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var i='`'+t+'` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line';E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),ht(i)}})})),K=function t(){lt||dt(),lt||(K=t)},r.preInit)for('function'==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return dt(),t.ready})}},r={};function h(t){var i=r[t];if(void 0!==i)return i.exports;var e=r[t]={exports:{}};return n[t](e,e.exports,h),e.exports}h.m=n,t="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",i="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",e="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",s=t=>{t&&t.d<1&&(t.d=1,t.forEach((t=>t.r--)),t.forEach((t=>t.r--?t.r++:t())))},h.a=(n,r,h)=>{var o;h&&((o=[]).d=-1);var l,a,c,f=new Set,u=n.exports,d=new Promise(((t,i)=>{c=i,a=t}));d[i]=u,d[t]=t=>(o&&t(o),f.forEach(t),d.catch((t=>{}))),n.exports=d,r((n=>{var r;l=(n=>n.map((n=>{if(null!==n&&"object"==typeof n){if(n[t])return n;if(n.then){var r=[];r.d=0,n.then((t=>{h[i]=t,s(r)}),(t=>{h[e]=t,s(r)}));var h={};return h[t]=t=>t(r),h}}var o={};return o[t]=t=>{},o[i]=n,o})))(n);var h=()=>l.map((t=>{if(t[e])throw t[e];return t[i]})),a=new Promise((i=>{(r=()=>i(h)).r=0;var e=t=>t!==o&&!f.has(t)&&(f.add(t),t&&!t.d&&(r.r++,t.push(r)));l.map((i=>i[t](e)))}));return r.r?a:h()}),(t=>(t?c(d[e]=t):a(u),s(o)))),o&&o.d<0&&(o.d=0)},h.d=(t,i)=>{for(var e in i)h.o(i,e)&&!h.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:i[e]})},h.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),h.p="/Client2/",h.b=document.baseURI||self.location.href;h(1375)})(); \ No newline at end of file diff --git a/items.js b/items.js index e9b0ee97..74cc62d1 100644 --- a/items.js +++ b/items.js @@ -1 +1 @@ -(()=>{"use strict";var t,i,e,s,n={1651:(t,i,e)=>{e.d(i,{K:()=>M});var s=e(1120),n=e(4583),r=e(2901),h=e(1069),o=e(7046),l=(e(9896),e(6666)),a=e(3045),c=e(818),f=e(670),u=e(8268),d=e(3867),w=e(7854),y=e(8950),A=e(1302),m=e(9298),p=e(8665),_=e(1312),g=e(3819),I=e(8317),C=e(9234),E=e(1908),v=e(123),b=e(5637),T=e(6948),R=e(2164),O=e(8738),L=e(3764),S=e(8534),x=e(6730);class M extends o.A{static tt=225;static it=10;static portOffset=0;static members=!0;static et=!1;static st='';static nt='';static rt=!1;static ht=2;static ot=!1;static lt='https://raw.githubusercontent.com/2004scape/Server/main';static exponent=58778699976184461502525193738213253649000149147835990136706041084440742975821n;static ct=7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789n;static ft=0;static ut=0;static dt=0;static wt=0;static yt=0;static At=0;static _t=0;static gt=0;static It=0;static Ct=0;static Et=0;static vt=0;static bt=0;static Tt=0;static Rt=0;static Ot=()=>{a.A.et=!1,n.A.et=!1,M.et=!1,c.A.et=!1};static Lt=()=>{a.A.et=!0,n.A.et=!0,M.et=!0,c.A.et=!0};St=2048;xt=2047;Mt=!1;kt=!1;Dt=!1;Ft=!1;db=null;Nt=0;Bt=[];stream=null;in=h.A.Ut(1);Pt=h.A.Ut(1);Gt=h.A.Ut(1);Wt=0n;Yt=0;Ht=0;Vt=0;Kt=null;Xt=0;packetSize=0;jt=0;zt=0;Zt=0;qt=null;$t=!0;Jt=0;Qt=0;ti=null;ii=null;ei=null;si=null;ni=null;ri=null;hi=null;oi=null;li=null;ai=null;ci=null;fi='';ui='';username='';password='';di=null;wi=null;yi=null;Ai=null;mi=[];pi=!1;_i=null;gi=null;Ii=null;Ci=null;Ei=null;vi=null;bi=null;Ti=null;Ri=null;Oi=null;Li=new Int32Array(256);Si=0;xi=0;Mi=0;ki=null;Di=null;Fi=null;Ni=null;Bi=null;Ui=null;Pi=null;Gi=null;Wi=null;Yi=null;Hi=null;Vi=null;Ki=null;Xi=null;ji=null;zi=null;Zi=null;qi=null;$i=null;Ji=null;Qi=null;te=new Int32Array(33);ie=new Int32Array(33);ee=new Int32Array(151);se=new Int32Array(151);ne=null;re=null;he=null;oe=null;le=null;ae=null;ce=new d.fe(13,null);ue=null;de=null;we=new d.fe(50,null);ye=new d.fe(50,null);Ae=new d.fe(20,null);me=new d.fe(20,null);pe=null;_e=new d.fe(8,null);ge=null;Ie=null;Ce=null;Ee=null;ve=null;be=null;Te=null;Re=null;Oe=null;Le=null;Se=null;xe=null;Me=null;ke=null;De=null;Fe=null;Ne=null;Be=null;Ue=new d.fe(1e3,null);Pe=!1;Ge=!1;We=!1;Ye=!1;He=-1;Ve=0;Ke=0;Xe=0;je=0;ze=0;Ze=0;qe=!1;$e=0;Je=0;Qe=0;ts=0;es=0;ss=0;ns=[];rs=-1;hs=-1;os=new s.A;ls=78;cs=0;fs=0;us=[];ds=0;ws=0;ys=0;As=0;ps=0;_s=0;gs=0;Is=0;Cs=[];Es=[];vs=[];bs=[];Ts=null;Rs=-1;Os=3;Ls=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];Ss=0;xs=0;Ms=0;ks=!1;Ds=0;Fs=!1;Ns='';Bs='';Us=0;Ps='';Gs=!1;Ws=-1;Ys=new d.fe(100,null);Hs=new d.fe(100,null);messageType=new Int32Array(100);Vs=new Int32Array(100);Ks=0;Xs=0;js=0;zs='';Zs=0;qs=0;$s=0;Js=0;Qs=0;tn=0;en=0;sn=0;nn=0;rn=!1;hn=0;ln=0;an=0;cn=0;fn=null;un=0;dn=0;wn=0;yn=0;An=!1;mn=[];pn=[];_n=0;gn=0;In=0;Cn=null;En=0;vn=new Int32Array(500);bn=new Int32Array(500);Tn=new Int32Array(500);Rn=new Int32Array(500);On=0;Ln=0;Sn=0;xn='';Mn=!1;kn=-1;Dn=0;Fn=0;Nn=0;Bn=0;Un=0;Pn=new Int32Array(1e3);Gn=new Int32Array(1e3);Wn=null;Yn=0;Hn=0;Vn=0;Kn=0;Xn=0;jn=!1;zn=0;Zn=0;qn=0;$n=0;Jn=2;Qn=2;tr=1;ir=new Int32Array(5);er=new d.fe(5,!1);sr=new Int32Array(5);nr=new Int32Array(5);rr=new Int32Array(5);hr=0;lr=0;ar=0;cr=0;ur=0;dr=0;wr=0;yr=0;Ar=0;mr=1;pr=2;_r=-1;gr=0;Ir=0;Cr=0;Er=0;vr=0;br=0;Tr=null;Rr=null;Or=null;Lr=0;Sr=0;Mr=new Int8Array(16384);kr=new d.fe(f.A.Dr,null);Fr=0;Nr=0;Br=128;Ur=0;Pr=0;Gr=0;Wr=0;Yr=0;Hr=null;Vr=null;Kr=new d.Xr(f.A.jr,f.A.jr);zr=0;Zr=0;qr=0;$r=0;Jr=0;Qr=0;th=0;ih=0;eh=0;sh=0;nh=0;rh=0;hh=new d.fe(this.St,null);oh=0;lh=new Int32Array(this.St);ah=0;fh=0;uh=new Int32Array(this.St);dh=new Int32Array(1e3);wh=new d.fe(this.St,null);yh=new d.fe(8192,null);Ah=0;mh=new Int32Array(8192);ph=new l.A;_h=new l.A;gh=new l.A;Ih=new l.A;Ch=new d.Eh(f.A.Dr,f.A.jr,f.A.jr,null);bh=new l.A;Th=new Int32Array(4e3);Rh=new Int32Array(4e3);Oh=new Int32Array(f.A.jr*f.A.jr);Lh=new Int32Array(f.A.jr*f.A.jr);Sh=0;xh=null;Mh=0;kh=0;Dh=-1;Fh=0;Nh=0;Bh=0;Uh=0;Ph=!1;Gh=!0;Wh=!1;Yh=new Int32Array(7);Hh=new Int32Array(5);Vh=0;Kh=0;static Xh=50;jh=new Int32Array(M.Xh);zh=new Int32Array(M.Xh);Zh=new Int32Array(M.Xh);qh=new Int32Array(M.Xh);$h=new Int32Array(M.Xh);Jh=new Int32Array(M.Xh);Qh=new Int32Array(M.Xh);io=new d.fe(M.Xh,null);eo=new d.fe(100,null);so=new BigInt64Array(100);no=new Int32Array(100);ro=null;ho=0;oo=!0;lo=new Int32Array(50);ao=new Int32Array(50);co=new Int32Array(50);fo=192;uo=-1;do=-1;wo=0;yo=0;Ao=0;mo=!0;po=null;_o=0;Io=0;Co=192;Eo=new d.fe(16,null);vo=0;bo=!1;To=()=>{try{this.stream&&this.stream.close()}catch(t){}this.stream=null,(0,v.Ro)(),this.Pt=null,this.Gt=null,this.in=null,this.Or=null,this.Tr=null,this.Rr=null,this.Hr=null,this.Vr=null,this.Wn=null,this.kr=null,this.Oh=null,this.Lh=null,this.Th=null,this.Rh=null,this.Mr=null,this.Di=null,this.Fi=null,this.Ni=null,this.Bi=null,this.Ui=null,this.Pi=null,this.Gi=null,this.Wi=null,this.Yi=null,this.Hi=null,this.Vi=null,this.Ki=null,this.Xi=null,this.ji=null,this.zi=null,this.Zi=null,this.qi=null,this.ne=null,this.he=null,this.re=null,this.oe=null,this.le=null,this.ae=null,this.ce=null,this.Te=null,this.Re=null,this.Oe=null,this.Le=null,this.Se=null,this.xe=null,this.Me=null,this.ke=null,this.De=null,this.Fe=null,this.de=null,this.Ae=null,this.me=null,this._e=null,this.ge=null,this.Ie=null,this.Ce=null,this.Ee=null,this.we=null,this.ye=null,this.Kr=null,this.hh=null,this.lh=null,this.uh=null,this.wh=null,this.dh=null,this.yh=null,this.mh=null,this.Ch=null,this.bh=null,this.Ih=null,this.ph=null,this._h=null,this.gh=null,this.Tn=null,this.Rn=null,this.vn=null,this.bn=null,this.ns=null,this.mn=null,this.Pn=null,this.Gn=null,this.Ue=null,this.ue=null,this.eo=null,this.so=null,this.no=null,this.si=null,this.ni=null,this.ti=null,this.ii=null,this.ei=null,this.ri=null,this.hi=null,this.oi=null,this.li=null,this.Oo(),b.A.To(),T.A.To(),A.A.To(),R.A.Lo=null,I.A.Lo=null,s.A.Lo=null,_.A.Lo=null,O.A.Lo=null,O.A.So=null,L.A.Lo=null,this.xo=null,u.A.So=null,n.A.To(),a.A.To(),p.A.To(),S.A.Lo=[],x.A.Lo=[]};Mo(){return this.Jt}ko(){return this.Gs}Do(){return this.Fs}Fo(){return this.hs}No(){return this.He}Oo=()=>{this.pi=!1,this.ki&&(clearInterval(this.ki),this.ki=null),this.ai=null,this.ci=null,this.mi=[],this.bi=null,this.Ti=null,this.Ri=null,this.Oi=null,this.Ci=null,this.Ii=null,this.Ei=null,this.vi=null,this._i=null,this.gi=null};Bo=async(t,i,e,s)=>{let n=5,o=await(this.db?.Uo(t));if(o&&h.A.Po(o)!==e&&(o=void 0),o)return new r.A(o);for(;!o;){await this.Go(s,`Requesting ${i}`);try{o=await(0,C.Wo)(`${M.nt}/${t}${e}`)}catch(t){o=void 0;for(let t=n;t>0;t--)await this.Go(s,`Error loading - Will retry in ${t} secs.`),await(0,C.Yo)(1e3);n*=2,n>60&&(n=60)}}return await(this.db?.Ho(t,o)),new r.A(o)};Vo=async(t,i,e)=>{let s=await(this.db?.Uo(t+'.mid'));if(s&&12345678!==i&&h.A.Po(s)!==i&&(s=void 0),!s)try{s=await(0,C.Wo)(`${M.nt}/${t}_${i}.mid`),e!==s.length&&(s=s.slice(0,e))}catch(t){}if(!s)return;await(this.db?.Ho(t+'.mid',s));const n=new h.A(Uint8Array.from(s)).Ko,r=E.A.read(n,s,e,4);(0,v.Xo)(r,this.Co)};jo=()=>{if(w.zo.fillStyle='black',w.zo.fillRect(0,0,this.width,this.height),this.Zo(1),this.Dt){this.pi=!1,w.zo.font='bold 16px helvetica, sans-serif',w.zo.textAlign='left',w.zo.fillStyle='yellow';let t=35;w.zo.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,w.zo.fillStyle='white',w.zo.fillText('To fix this try the following (in order):',30,t),t+=50,w.zo.font='bold 12px helvetica, sans-serif',w.zo.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.zo.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,w.zo.fillText('3: Try using a different game-world',30,t),t+=30,w.zo.fillText('4: Try rebooting your computer',30,t),t+=30,w.zo.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.Ft&&(this.pi=!1,w.zo.font='bold 20px helvetica, sans-serif',w.zo.textAlign='left',w.zo.fillStyle='white',w.zo.fillText('Error - unable to load game!',50,50),w.zo.fillText('To play RuneScape make sure you play from',50,100),w.zo.fillText('https://2004scape.org',50,150)),this.kt){this.pi=!1,w.zo.font='bold 13px helvetica, sans-serif',w.zo.textAlign='left',w.zo.fillStyle='yellow';let t=35;w.zo.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,w.zo.fillStyle='white',w.zo.fillText('To fix this try the following (in order):',30,t),t+=50,w.zo.font='bold 12px helvetica, sans-serif',w.zo.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.zo.fillText('2: Try rebooting your computer, and reloading',30,t)}};qo=t=>{if(!t.$o)return!1;for(let i=0;i=s)return!1}else if(3===t.$o[i]){if(e<=s)return!1}else if(4===t.$o[i]){if(e===s)return!1}else if(e!==s)return!1}return!0};tl=(t,i,e,s,n)=>{this.ve?.draw(t,i),this.be?.draw(t,i+n-16),y.A.fillRect(t,i+16,16,n-32,m.A.il);let r=(n-32)*n/s|0;r<8&&(r=8);const h=(n-r-32)*e/(s-n)|0;y.A.fillRect(t,i+h+16,16,r,m.A.el),y.A.sl(t,i+h+16,m.A.nl,r),y.A.sl(t+1,i+h+16,m.A.nl,r),y.A.rl(t,i+h+16,m.A.nl,16),y.A.rl(t,i+h+17,m.A.nl,16),y.A.sl(t+15,i+h+16,m.A.hl,r),y.A.sl(t+14,i+h+17,m.A.hl,r-1),y.A.rl(t,i+h+r+15,m.A.hl,16),y.A.rl(t+1,i+h+r+14,m.A.hl,15)};ol=(t,i)=>{let e=!1;const n=s.A.Lo[t];if(!n.ll)return!1;for(let t=0;ts.delay[r.ul];)r.fl-=s.delay[r.ul]+1,r.ul++,r.ul>=s.dl&&(r.ul-=s.wl,(r.ul<0||r.ul>=s.dl)&&(r.ul=0)),e=!0}}}return e};yl=(t,i,e,r,h=!1)=>{if(0!==t.type||!t.ll||t.hide&&this.Zs!==t.id&&this.qs!==t.id&&this.$s!==t.id)return;const o=y.A.left,l=y.A.top,a=y.A.right,c=y.A.bottom;y.A.Al(i,e,i+t.width,e+t.height);const f=t.ll.length;for(let o=0;o0&&this.Cl(c),c.type===s.A.El)c.vl>c.scroll-c.height&&(c.vl=c.scroll-c.height),c.vl<0&&(c.vl=0),this.yl(c,l,a,c.vl,h),c.scroll>c.height&&this.tl(l+c.width,a,c.vl,c.scroll,c.height);else if(c.type===s.A.bl){let t=0;for(let i=0;i0){let i=0,e=0;const r=c.Ol[t]-1;if(s>=-32&&s<=512&&n>=-32&&n<=334||0!==this.tn&&this.Qs===t){const h=A.A.Ml(r,c.Ll[t]);if(0!==this.tn&&this.Qs===t&&this.Js===c.id?(i=this.kl-this.en,e=this.Dl-this.sn,i<5&&i>-5&&(i=0),e<5&&e>-5&&(e=0),this.nn<5&&(i=0,e=0),h.Fl(128,s+i,n+e)):0!==this.un&&this.dn===t&&this.wn===c.id?h.Fl(128,s,n):h.draw(s,n),33===h.Nl||1!==c.Ll[t]){const r=c.Ll[t];this.di?.Bl(s+i+1,n+10+e,this.Ul(r),m.A.Pl),this.di?.Bl(s+i,n+9+e,this.Ul(r),m.A.Gl)}}}else if(c.Wl&&t<20){const i=c.Wl[t];i?.draw(s,n)}t++}}else if(c.type===s.A.Yl)c.fill?y.A.fillRect(l,a,c.width,c.height,c.Hl):y.A._l(l,a,c.width,c.height,c.Hl);else if(c.type===s.A.Vl){const t=c.font;let i=c.Hl,e=c.text;if(this.$s!==c.id&&this.qs!==c.id&&this.Zs!==c.id||0===c.Kl||(i=c.Kl),this.qo(c)&&(i=c.Xl,c.jl&&c.jl.length>0&&(e=c.jl)),c.zl===s.A.Zl&&this.An&&(e='Please wait...',i=c.Hl),!t||!e)continue;for(let s=a+t.height;e.length>0;s+=t.height){if(-1!==e.indexOf('%')){for(;;){const t=e.indexOf('%1');if(-1===t)break;e=e.substring(0,t)+this.ql(this.Jo(c,0))+e.substring(t+2)}for(;;){const t=e.indexOf('%2');if(-1===t)break;e=e.substring(0,t)+this.ql(this.Jo(c,1))+e.substring(t+2)}for(;;){const t=e.indexOf('%3');if(-1===t)break;e=e.substring(0,t)+this.ql(this.Jo(c,2))+e.substring(t+2)}for(;;){const t=e.indexOf('%4');if(-1===t)break;e=e.substring(0,t)+this.ql(this.Jo(c,3))+e.substring(t+2)}for(;;){const t=e.indexOf('%5');if(-1===t)break;e=e.substring(0,t)+this.ql(this.Jo(c,4))+e.substring(t+2)}}const n=e.indexOf('\\n');let r;-1!==n?(r=e.substring(0,n),e=e.substring(n+2)):(r=e,e=''),c.$l?t.Jl(l+(c.width/2|0),s,r,i,c.Ql):t.ta(l,s,r,i,c.Ql)}}else if(c.type===s.A.ia){let t;t=this.qo(c)?c.ea:c.sa,t?.draw(l,a)}else if(c.type===s.A.na){const t=n.A.ra,i=n.A.ha;n.A.ra=l+(c.width/2|0),n.A.ha=a+(c.height/2|0);const e=n.A.sin[c.oa]*c.zoom>>16,s=n.A.cos[c.oa]*c.zoom>>16,r=this.qo(c);let h;h=r?c.cl:c.al;let o=null;if(-1===h)o=c.la(-1,-1,r);else{const t=_.A.Lo[h];t.frames&&t.aa&&(o=c.la(t.frames[c.ul],t.aa[c.ul],r))}o&&o.ca(0,c.fa,0,c.oa,0,e,s),n.A.ra=t,n.A.ha=i}else if(c.type===s.A.ua){const t=c.font;if(!t||!c.Ol||!c.Ll)continue;let i=0;for(let e=0;e0){const n=A.A.get(c.Ol[i]-1);let r=n.name;if((n.da||1!==c.Ll[i])&&(r=r+' x'+this.wa(c.Ll[i])),!r)continue;const h=l+s*(c.Sl+115),o=a+e*(c.xl+12);c.$l?t.Jl(h+(c.width/2|0),o,r,c.Hl,c.Ql):t.ta(h,o,r,c.Hl,c.Ql)}i++}}}y.A.Al(o,l,a,c)};Cl=t=>{let i=t.Il;if(i>=s.A.ya&&i<=s.A.Aa)i--,i>=this.Vh?(t.text='',t.zl=0):(t.text=this.eo[i],t.zl=1);else if(i>=s.A.ma&&i<=s.A.pa)i-=s.A.ma,i>=this.Vh?(t.text='',t.zl=0):(0===this.no[i]?t.text='@red@Offline':this.no[i]===M.it?t.text='@gre@World-'+(this.no[i]-9):t.text='@yel@World-'+(this.no[i]-9),t.zl=1);else if(i===s.A._a)t.scroll=15*this.Vh+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i>=s.A.ga&&i<=s.A.Ia)i-=s.A.ga,i>=this.fs?(t.text='',t.zl=0):(t.text=g.A.Ca(g.A.Ea(this.us[i])),t.zl=1);else if(i===s.A.va)t.scroll=15*this.fs+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i===s.A.ba){if(t.oa=150,t.fa=256*Math.sin(this.Nt/40)&2047,this.Wh){this.Wh=!1;const i=new d.fe(7,null);let e=0;for(let t=0;t<7;t++){const s=this.Yh[t];s>=0&&(i[e++]=I.A.Lo[s].la())}const s=p.A.Ta(i,e);for(let t=0;t<5;t++)0!==this.Hh[t]&&(s.Ra(u.A.Oa[t][0],u.A.Oa[t][this.Hh[t]]),1===t&&s.Ra(u.A.La[0],u.A.La[this.Hh[t]]));if(this.xh){const i=_.A.Lo[this.xh.Sa].frames;i&&(s.xa(),s.Ma(i[0]),s.ka(64,850,-30,-50,-30,!0),t.model=s)}}}else if(i===s.A.Da)this.Ne||(this.Ne=t.sa,this.Be=t.ea),this.Gh?t.sa=this.Be:t.sa=this.Ne;else if(i===s.A.Fa)this.Ne||(this.Ne=t.sa,this.Be=t.ea),this.Gh?t.sa=this.Ne:t.sa=this.Be;else if(i===s.A.Na)t.text=this.xn,this.Nt%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(i===s.A.Ba)this.Ph?this.Mn?(t.Hl=m.A.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.Hl=m.A.gl,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(i===s.A.Ua||i===s.A.Pa)if(0===this.Dn)t.text='';else{let i;i=0===this.Fn?'earlier today':1===this.Fn?'yesterday':this.Fn+' days ago',t.text='You last logged in '+i+' from: '+g.A.Ga(this.Dn)}else if(i===s.A.Wa)0===this.Bn&&(t.text='0 unread messages',t.Hl=m.A.Gl),1===this.Bn&&(t.text='1 unread message',t.Hl=m.A.GREEN),this.Bn>1&&(t.text=this.Bn+' unread messages',t.Hl=m.A.GREEN);else if(i===s.A.Ya)if(201===this.Nn)t.text='';else if(200===this.Nn)t.text='You have not yet set any password recovery questions.';else{let i;i=0===this.Nn?'Earlier today':1===this.Nn?'Yesterday':this.Nn+' days ago',t.text=i+' you changed your recovery questions'}else i===s.A.Ha?201===this.Nn?t.text='':200===this.Nn?t.text='We strongly recommend you do so now to secure your account.':t.text='If you do not remember making this change then cancel it immediately':i===s.A.Va&&(201===this.Nn?t.text='':(this.Nn,t.text="Do this from the 'account management' area on our front webpage"))};Jo=(t,i)=>{if(!t.scripts||i>=t.scripts.length)return-2;try{const e=t.scripts[i];if(!e)return-1;let n=0,r=0;for(;;){const t=e[r++];if(0===t)return n;if(1===t)n+=this.Es[e[r++]];else if(2===t)n+=this.vs[e[r++]];else if(3===t)n+=this.Cs[e[r++]];else if(4===t){const t=s.A.Lo[e[r++]],i=e[r++]+1;if(t.Ol&&t.Ll)for(let e=0;et<999999999?String(t):'*';wa=t=>{let i=String(t);for(let t=i.length-3;t>0;t-=3)i=i.substring(0,t)+','+i.substring(t);return i.length>8?i='@gre@'+i.substring(0,i.length-8)+' million @whi@('+i+')':i.length>4&&(i='@cya@'+i.substring(0,i.length-4)+'K @whi@('+i+')'),' '+i};Ul=t=>t<1e5?String(t):t<1e7?(t/1e3|0)+'K':(t/1e6|0)+'M'}},7604:(t,i,e)=>{e.d(i,{w:()=>h});var s=e(7046),n=e(1651),r=e(9234);async function h(){await async function(){0===s.A.getParameter('world').length&&s.A.setParameter('world','1');'localhost'===window.location.hostname&&'0'===s.A.getParameter('world')?(n.K.st='http://localhost',n.K.nt='http://localhost',n.K.portOffset=0):await async function(t){const i=await o(t,parseInt(s.A.getParameter('world'),10)),e=new URL(i.address);n.K.it=10+i.id-1,n.K.st=`${e.protocol}//${e.hostname}`,n.K.nt=`${e.protocol}//${e.hostname}:${e.port}`,t||(n.K.st=n.K.st.replace('https:','http:'));n.K.portOffset=i.portOffset,n.K.members=!0===i?.members,s.A.setParameter('world',i.id.toString(10))}(window.location.protocol.startsWith('https'))}(),function(){0===s.A.getParameter('detail').length&&s.A.setParameter('detail','high');'low'===s.A.getParameter('detail')?n.K.Lt():n.K.Ot()}(),0===s.A.getParameter('method').length&&s.A.setParameter('method','0')}async function o(t,i,e=0){if(e>=10)throw new Error('could not find world to connect!');const s=t?'https:':'http:';let n;try{n=JSON.parse(await(0,r.Xa)(`${s}//2004scape.org/api/v1/worldlist`))}catch(s){return await(0,r.Yo)(1e3),o(t,i,++e)}n.push({id:0,region:'Local Development',address:'http://localhost',portOffset:0,members:!0,hh:0});const h=n.find((t=>t.id===i));return h||o(t,i,10)}},9858:(t,i,e)=>{e.a(t,(async(t,i)=>{try{var s=e(1312),n=e(1302),r=e(4583),h=e(2682),o=e(8665),l=e(8534),a=e(6730),c=e(9234),f=e(1069),u=e(4544),d=e(7854),w=e(1908),y=e(1183),A=e(1651),m=e(7604);class t extends A.K{ja=[];async za(t){const i=new Map,e=(await(0,c.Xa)(t)).split('\n');for(let t=0;t{if(this.Mt)this.kt=!0;else{this.Mt=!0;try{await this.Go(10,'Connecting to fileserver'),await w.A.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new u.A(await u.A.openDatabase());const t=new f.A(new Uint8Array(await(0,c.Wo)(`${A.K.nt}/crc`)));for(let i=0;i<9;i++)this.Bt[i]=t.Ko;const i=await this.Bo('title','title screen',this.Bt[1],10);this.di=h.A.Za(i,'p11'),this.wi=h.A.Za(i,'p12'),this.yi=h.A.Za(i,'b12'),this.Ai=h.A.Za(i,'q8');const e=await this.Bo('config','config',this.Bt[2],15),d=await this.Bo('models','3d graphics',this.Bt[5],40),y=await this.Bo('textures','textures',this.Bt[6],60);await this.Go(80,'Unpacking textures'),r.A.qa(y),r.A.$a(.8),r.A.Ja(20),await this.Go(83,'Unpacking models'),o.A.Qa(d),l.A.Qa(d),a.A.Qa(d),await this.Go(86,'Unpacking config'),s.A.Qa(e),n.A.Qa(e,!0),await this.Go(100,'Getting ready to start...'),await this.tc()}catch(t){this.Dt=!0,console.error(t)}}};async tc(){const t=document.getElementById('items');if(!t)return;t.innerHTML='',this.ja[1]=await this.za(`${A.K.lt}/data/src/pack/obj.pack`);const i=document.createElement('input');i.type='text',i.placeholder='::give',i.tabIndex=-1,t.appendChild(i);const e=document.createElement('input');e.type='search',e.placeholder='Search',e.tabIndex=1,e.oninput=()=>{const t=document.querySelector('#itemList');if(!t)return;const i=e.value.toLowerCase().replaceAll(' ','_');for(let e=0;e-1||n.indexOf(i)>-1||r.indexOf(i)>-1||h.indexOf(i)>-1?s.style.display='':s.style.display='none'}},t.appendChild(e);const s=document.createElement('ul');s.id='itemList',s.className='list-group',t.appendChild(s);const h=new Set;for(const[t,i]of this.ja[1]){const i=n.A.get(t);if(null!==i.ic&&null!==i.ec)for(let t=0;t{const t=s.querySelector('.active');t&&(t.className='list-group-item list-group-item-center'),l.className='list-group-item list-group-item-center active',i.value=`::give ${e} 1`};const a=document.createElement('canvas');a.className='icon',a.width=32,a.height=32,l.appendChild(a);const c=document.createElement('p');null===o.name?c.innerText=e:c.innerText=o.name+' - '+e,l.appendChild(c);const f=new y.A(32,32,a.getContext('2d',{willReadFrequently:!0})??d.zo),u=n.A.Ml(t,1e4);f.bind(),r.A.nc(),u.draw(0,0),f.draw(0,0),s.appendChild(l)}}}await(0,m.w)(),(new t).rc().then((()=>{})),window.onkeydown=function(t){return!(' '===t.key&&t.target===document.body)},i()}catch(t){i(t)}}),1)},7046:(t,i,e)=>{e.d(i,{A:()=>a});var s=e(1183),n=e(4583),r=e(9234),h=e(9091),o=e(2595),l=e(7854);class a{static getParameter(t){return new URLSearchParams(window.location.search).get(t)??''}static setParameter(t,i){const e=new URL(window.location.toString());e.searchParams.set(t,i),window.history.pushState(null,'',e.toString())}hc=0;oc=[];lc=0;xo=null;state=0;ac=20;cc=1;fc=[];uc=0;dc=0;wc=[];yc=!0;Ac=!1;mc=50;hasFocus=!0;_c=!1;gc=0;Ic=0;kl=0;Dl=0;Cc=0;Ec=0;vc=0;bc=[];Tc=[];Rc=0;Oc=0;input=null;Lc=!1;Sc=!1;xc=!1;time=-1;Mc=0;kc=0;Dc=0;Fc=0;Nc=0;Bc=0;constructor(t=!1){l.Uc.tabIndex=-1,l.zo.fillStyle='black',l.zo.fillRect(0,0,l.Uc.width,l.Uc.height),this.Ac=t,this.Ac?this.resize(window.innerWidth,window.innerHeight):this.resize(l.Uc.width,l.Uc.height)}get width(){return l.Uc.width}get height(){return l.Uc.height}resize=(t,i)=>{l.Uc.width=t,l.Uc.height=i,this.xo=new s.A(t,i),n.A.nc()};rc=async()=>{l.Uc.addEventListener('resize',(()=>{this.Ac&&this.resize(window.innerWidth,window.innerHeight)}),!1),l.Uc.onmousedown=this.onmousedown,l.Uc.onmouseup=this.onmouseup,l.Uc.onmouseenter=this.onmouseenter,l.Uc.onmouseleave=this.onmouseleave,l.Uc.onmousemove=this.onmousemove,window.onbeforeunload=this.To,l.Uc.onfocus=this.onfocus,l.Uc.onblur=this.onblur,this.Pc?(l.Uc.ontouchstart=this.ontouchstart,l.Uc.ontouchend=this.ontouchend,l.Uc.ontouchmove=this.ontouchmove):(l.Uc.onkeydown=this.onkeydown,l.Uc.onkeyup=this.onkeyup),l.Uc.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.Pc&&'low'===a.getParameter('detail')&&(this.mc=30),await this.Go(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.fc[t]=performance.now();let t,i=0,e=256,s=1,n=0;for(;this.state>=0;){if(this.state>0&&(this.state--,0===this.state))return void this.Gc();const h=e,o=s;e=300,s=1,t=performance.now();const l=this.fc[i];if(0===l?(e=h,s=o):t>l&&(e=2560*this.ac/(t-l)|0),e<25?e=25:e>256&&(e=256,s=this.ac-(t-l)/10|0),this.fc[i]=t,i=(i+1)%10,s>1)for(let t=0;t<10;t++)0!==this.fc[t]&&(this.fc[t]+=s);for(s0&&(this.uc=1e3*e/(256*this.ac)|0);const a=performance.now();if(this.yc&&this.refresh(),await this.draw(),this.wc[this.dc]=(performance.now()-a)/1e3,this.dc=(this.dc+1)%this.wc.length,this.mc<50){const i=1e3/this.mc-(performance.now()-t);i>0&&await(0,r.Yo)(i)}}-1===this.state&&this.Gc()};Gc=()=>{this.state=-2,this.To()};Zo=t=>{this.ac=1e3/t|0};Wc=t=>{this.mc=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.ac|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};To=()=>{};draw=async()=>{};refresh=()=>{};async Go(t,i){const e=this.width,s=this.height;this.yc&&(l.zo.fillStyle='black',l.zo.fillRect(0,0,e,s),this.yc=!1);const n=s/2-18;l.zo.fillStyle='rgb(140, 17, 17)',l.zo.rect((e/2|0)-152,n,304,34),l.zo.fillRect((e/2|0)-150,n+2,3*t,30),l.zo.fillStyle='black',l.zo.fillRect((e/2|0)-150+3*t,n+2,300-3*t,30),l.zo.font='bold 13px helvetica, sans-serif',l.zo.textAlign='center',l.zo.fillStyle='white',l.zo.fillText(i,e/2|0,n+22),await(0,r.Yo)(5)}Yc=()=>{let t=-1;return this.Oc!==this.Rc&&(t=this.Tc[this.Rc],this.Rc=this.Rc+1&127),t};get ms(){const t=this.wc.length;let i=0;for(let e=0;ethis.hc&&(this.hc=e),this.oc[this.lc]=e,this.lc=(this.lc+1)%250,e}get Hc(){return this.oc.reduce(((t,i)=>t+i),0)/250}onkeydown=t=>{const i=t.key;h.p.includes(i)&&t.preventDefault(),this.gc=0;const e=h.L[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;t.ctrlKey&&(n>='A'.charCodeAt(0)&&n<=']'.charCodeAt(0)||n=='_'.charCodeAt(0)?n-='A'.charCodeAt(0)-1:n>='a'.charCodeAt(0)&&n<='z'.charCodeAt(0)&&(n-='a'.charCodeAt(0)-1)),n<30&&(n=0),s===h.L.ArrowLeft.code?n=1:s===h.L.ArrowRight.code?n=2:s===h.L.ArrowUp.code?n=3:s===h.L.ArrowDown.code?n=4:s===h.L.Control.code?n=5:s===h.L.Shift.code?n=6:s===h.L.Alt.code?n=7:s===h.L.Backspace.code||s===h.L.Delete.code?n=8:s===h.L.Tab.code?n=9:s===h.L.Enter.code?n=10:s>=h.L.F1.code&&s<=h.L.F12.code?n=s+1008-h.L.F1.code:s===h.L.Home.code?n=1e3:s===h.L.End.code?n=1001:s===h.L.PageUp.code?n=1002:s===h.L.PageDown.code&&(n=1003),n>0&&n<128&&(this.bc[n]=1),n>4&&(this.Tc[this.Oc]=n,this.Oc=this.Oc+1&127),o.A.enabled&&o.A.Vc(n)};onkeyup=t=>{const i=t.key;h.p.includes(i)&&t.preventDefault(),this.gc=0;const e=h.L[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;n<30&&(n=0),s===h.L.ArrowLeft.code?n=1:s===h.L.ArrowRight.code?n=2:s===h.L.ArrowUp.code?n=3:s===h.L.ArrowDown.code?n=4:s===h.L.Control.code?n=5:s===h.L.Shift.code?n=6:s===h.L.Alt.code?n=7:s===h.L.Backspace.code||s===h.L.Delete.code?n=8:s===h.L.Tab.code?n=9:s===h.L.Enter.code?n=10:s>=h.L.F1.code&&s<=h.L.F12.code?n=s+1008-h.L.F1.code:s===h.L.Home.code?n=1e3:s===h.L.End.code?n=1001:s===h.L.PageUp.code?n=1002:s===h.L.PageDown.code&&(n=1003),n>0&&n<128&&(this.bc[n]=0),o.A.enabled&&o.A.Kc(n)};onmousedown=t=>{if(this.Lc=!1,(t.clientX>0||t.clientY>0)&&this.Xc(t),this.gc=0,this.Ec=this.kl,this.vc=this.Dl,this.Pc&&!this.jc){if(this.zc()||this.Zc()||this.qc())return this.Cc=1,void(this.Ic=1);t.timeStamp>=this.time+500?(this.Cc=2,this.Ic=2):(this.Cc=1,this.Ic=1)}else 2===t.button?(this.Cc=2,this.Ic=2):(this.Cc=1,this.Ic=1);o.A.enabled&&o.A.$c(this.Ec,this.vc,t.buttons)};onmouseup=t=>{this.Xc(t),this.gc=0,this.Ic=0,o.A.enabled&&o.A.Jc(t.buttons)};onmouseenter=t=>{this.Xc(t),o.A.enabled&&o.A.Qc()};onmouseleave=t=>{this.Xc(t),this.gc=0,this.kl=-1,this.Dl=-1,this.Ic=0,this.Ec=-1,this.vc=-1,o.A.enabled&&o.A.tf()};onmousemove=t=>{this.Xc(t),this.gc=0,o.A.enabled&&o.A.if(this.kl,this.Dl)};onfocus=t=>{this.hasFocus=!0,this.yc=!0,this.refresh(),o.A.enabled&&o.A.ef()};onblur=t=>{this.hasFocus=!1,o.A.enabled&&o.A.sf()};ontouchstart=t=>{if(!this.Pc)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.Lc=!0;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.Mc=this.Nc=this.Dc=0|i.screenX,this.kc=this.Bc=this.Fc=0|i.screenY,this.time=t.timeStamp,this.Sc=this.nf(),this.xc=this.rf()};ontouchend=t=>{if(!this.Pc||!this.Lc)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;if(this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.Nc=0|i.screenX,this.Bc=0|i.screenY,this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.Sc&&!this.nf())return void(this.Lc=!1);if(this.xc&&!this.rf())return void(this.Lc=!1);if(this.zc()||this.hf()||this.Zc()||this.qc()){null!==this.input&&(this.input.parentNode?.contains(this.input)&&this.input.parentNode?.removeChild(this.input),this.input=null);const t=document.createElement('input');return this.Zc()?(t.setAttribute('id','username'),t.setAttribute('placeholder','Username')):this.qc()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.zc()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.hf()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this.lf?t.setAttribute('type','password'):t.setAttribute('type',this.qc()?'password':'text'),t.setAttribute('autofocus','autofocus'),t.setAttribute('spellcheck','false'),t.setAttribute('autocomplete','off'),t.setAttribute('style',`position: fixed; left: ${e}px; top: ${s}px; width: 1px; height: 1px; opacity: 0;`),document.body.appendChild(t),t.focus(),t.click(),this.lf&&(t.oninput=t=>{if(!(t instanceof InputEvent))return;const i=t,e=i.data;null!==e&&'insertText'===i.inputType&&this.onkeydown(new KeyboardEvent('keydown',{key:e,code:e}))}),t.onkeydown=t=>{this.lf&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this.lf&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeyup(new KeyboardEvent('keyup',{key:t.key,code:t.key}))},t.onfocus=t=>{this.input?.parentNode?.removeChild(this.input),this.input=null,this.onfocus(t)},this.input=t,void(this.Lc=!1)}const n=t.timeStamp>=this.time+500,r=Math.abs(this.Mc-this.Nc)>16||Math.abs(this.kc-this.Bc)>16;n&&!r?(this.Lc=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.Ic=0,this.Lc=!1)};ontouchmove=t=>{if(!this.Pc||!this.Lc)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.Nc=0|i.screenX,this.Bc=0|i.screenY,this.Sc&&-1===this.No()?(this.Dc-this.Nc>0?this.rotate(2):this.Dc-this.Nc<0&&this.rotate(0),this.Fc-this.Bc>0?this.rotate(3):this.Fc-this.Bc<0&&this.rotate(1)):(this.xc||-1!==this.No())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this.Dc=this.Nc,this.Fc=this.Bc};get Pc(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get lf(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get jc(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}nf=()=>this._c&&this.kl>=8&&this.kl<=520&&this.Dl>=11&&this.Dl<=345;zc=()=>this._c&&-1===this.Fo()&&!this.ko()&&!this.Do()&&this.kl>=11&&this.kl<=506&&this.Dl>=449&&this.Dl<=482;hf=()=>this._c&&(this.ko()||this.Do())&&this.kl>=11&&this.kl<=506&&this.Dl>=383&&this.Dl<=482;rf=()=>this._c&&this.kl>=562&&this.kl<=752&&this.Dl>=231&&this.Dl<=492;Zc=()=>!this._c&&2===this.Mo()&&this.kl>=301&&this.kl<=562&&this.Dl>=262&&this.Dl<=279;qc=()=>!this._c&&2===this.Mo()&&this.kl>=301&&this.kl<=562&&this.Dl>=279&&this.Dl<=296;rotate=t=>{0===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowLeft',code:'ArrowLeft'}))):1===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowUp',code:'ArrowUp'}))):2===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowRight',code:'ArrowRight'}))):3===t&&(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowDown',code:'ArrowDown'})))};af=()=>null!==document.fullscreenElement;Xc=t=>{if(this.af()){const i=t.target.getBoundingClientRect(),e=window.innerHeight/l.Uc.height,s=(window.innerWidth-l.Uc.width*e)/2;this.kl=0|this.cf(t.clientX-i.left-s,0,l.Uc.width*e,0,789),this.Dl=0|this.cf(t.clientY-i.top,0,l.Uc.height*e,0,532)}else{const i=l.Uc.getBoundingClientRect(),e=l.Uc.width/i.width,s=l.Uc.height/i.height;this.kl=(t.clientX-i.left)*e|0,this.Dl=(t.clientY-i.top)*s|0}this.kl<0&&(this.kl=0),this.Dl<0&&(this.Dl=0),this.kl>789&&(this.kl=789),this.Dl>532&&(this.Dl=532)};cf=(t,i,e,s,n)=>(t-i)*(n-s)/(e-i)+s}},2595:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1069);class n{static enabled=!1;static ff=null;static uf=null;static df=0;static wf=0;static yf=0;static Af=0;static mf=0;static pf=()=>{this.ff=s.A.Ut(1),this.uf=null,this.df=performance.now(),this.enabled=!0};static _f=()=>{this.enabled=!1,this.ff=null};static flush=()=>{let t=null;return this.uf&&this.enabled&&(t=this.uf),this.uf=null,t};static stop=()=>{let t=null;return this.ff&&this.ff.gf>0&&this.enabled&&(t=this.ff),this._f(),t};static $c=(t,i,e)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;this.wf++;const s=performance.now();let n=(s-this.df)/10|0;n>250&&(n=250),this.df=s,this.If(5),1===e?this.ff?.p1(1):this.ff?.p1(2),this.ff?.p1(n),this.ff?.p3(t+(i<<10))};static Jc=t=>{if(!this.enabled)return;this.wf++;const i=performance.now();let e=(i-this.df)/10|0;e>250&&(e=250),this.df=i,this.If(2),1===t?this.ff?.p1(3):this.ff?.p1(4),this.ff?.p1(e)};static if=(t,i)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;const e=performance.now();if(e-this.yf>=50){this.yf=e,this.wf++;let s=(e-this.df)/10|0;s>250&&(s=250),this.df=e,t-this.Af<8&&t-this.Af>=-8&&i-this.mf<8&&i-this.mf>=-8?(this.If(3),this.ff?.p1(5),this.ff?.p1(s),this.ff?.p1(t+(i-this.mf+8<<4)+8-this.Af)):t-this.Af<128&&t-this.Af>=-128&&i-this.mf<128&&i-this.mf>=-128?(this.If(4),this.ff?.p1(6),this.ff?.p1(s),this.ff?.p1(t+128-this.Af),this.ff?.p1(i+128-this.mf)):(this.If(5),this.ff?.p1(7),this.ff?.p1(s),this.ff?.p3(t+(i<<10))),this.Af=t,this.mf=i}};static Vc=t=>{if(!this.enabled)return;this.wf++;const i=performance.now();let e=(i-this.df)/10|0;e>250&&(e=250),this.df=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.If(3),this.ff?.p1(8),this.ff?.p1(e),this.ff?.p1(t)};static Kc=t=>{if(!this.enabled)return;this.wf++;const i=performance.now();let e=(i-this.df)/10|0;e>250&&(e=250),this.df=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.If(3),this.ff?.p1(9),this.ff?.p1(e),this.ff?.p1(t)};static ef=()=>{if(!this.enabled)return;this.wf++;const t=performance.now();let i=(t-this.df)/10|0;i>250&&(i=250),this.df=t,this.If(2),this.ff?.p1(10),this.ff?.p1(i)};static sf=()=>{if(!this.enabled)return;this.wf++;const t=performance.now();let i=(t-this.df)/10|0;i>250&&(i=250),this.df=t,this.If(2),this.ff?.p1(11),this.ff?.p1(i)};static Qc=()=>{if(!this.enabled)return;this.wf++;const t=performance.now();let i=(t-this.df)/10|0;i>250&&(i=250),this.df=t,this.If(2),this.ff?.p1(12),this.ff?.p1(i)};static tf=()=>{if(!this.enabled)return;this.wf++;const t=performance.now();let i=(t-this.df)/10|0;i>250&&(i=250),this.df=t,this.If(2),this.ff?.p1(13),this.ff?.p1(i)};static If=t=>{if(this.ff&&this.ff.gf+t>=500){const t=this.ff;this.ff=s.A.Ut(1),this.uf=t}}}},9091:(t,i,e)=>{e.d(i,{L:()=>s,p:()=>n});const s={'Backspace':{code:8,ch:8},'Enter':{code:10,ch:10},'Shift':{code:16,ch:65535},'Escape':{code:27,ch:27},'Tab':{code:9,ch:9},'CapsLock':{code:20,ch:65535},' ':{code:32,ch:32},'Control':{code:17,ch:65535},'Alt':{code:18,ch:65535},'Meta':{code:524,ch:65535},'ArrowLeft':{code:37,ch:65535},'ArrowRight':{code:39,ch:65535},'ArrowUp':{code:38,ch:65535},'ArrowDown':{code:40,ch:65535},'Insert':{code:155,ch:65535},'Home':{code:36,ch:65535},'PageUp':{code:33,ch:65535},'Delete':{code:127,ch:127},'End':{code:35,ch:65535},'PageDown':{code:34,ch:65535},'`':{code:192,ch:96},'~':{code:192,ch:126},'!':{code:49,ch:33},'@':{code:50,ch:64},'#':{code:51,ch:35},'$':{code:52,ch:36},'%':{code:53,ch:37},'^':{code:54,ch:94},'&':{code:55,ch:38},'*':{code:56,ch:42},'(':{code:57,ch:40},')':{code:48,ch:41},'-':{code:45,ch:45},'_':{code:45,ch:95},'=':{code:61,ch:61},'+':{code:61,ch:43},'[':{code:91,ch:91},'{':{code:91,ch:123},']':{code:93,ch:93},'}':{code:93,ch:125},'\\':{code:92,ch:92},'|':{code:92,ch:124},';':{code:59,ch:59},':':{code:59,ch:58},"'":{code:222,ch:39},'"':{code:222,ch:34},',':{code:44,ch:44},'<':{code:44,ch:60},'.':{code:46,ch:46},'>':{code:46,ch:62},'/':{code:47,ch:47},'?':{code:47,ch:63},'F1':{code:112,ch:65535},'F2':{code:113,ch:65535},'F3':{code:114,ch:65535},'F4':{code:115,ch:65535},'F5':{code:116,ch:65535},'F6':{code:117,ch:65535},'F7':{code:118,ch:65535},'F8':{code:119,ch:65535},'F9':{code:120,ch:65535},'F10':{code:121,ch:65535},'F11':{code:122,ch:65535},'F12':{code:123,ch:65535},0:{code:48,ch:48},1:{code:49,ch:49},2:{code:50,ch:50},3:{code:51,ch:51},4:{code:52,ch:52},5:{code:53,ch:53},6:{code:54,ch:54},7:{code:55,ch:55},8:{code:56,ch:56},9:{code:57,ch:57},'a':{code:65,ch:97},'b':{code:66,ch:98},'c':{code:67,ch:99},'d':{code:68,ch:100},'e':{code:69,ch:101},'f':{code:70,ch:102},'g':{code:71,ch:103},'h':{code:72,ch:104},'i':{code:73,ch:105},'j':{code:74,ch:106},'k':{code:75,ch:107},'l':{code:76,ch:108},'m':{code:77,ch:109},'n':{code:78,ch:110},'o':{code:79,ch:111},'p':{code:80,ch:112},'q':{code:81,ch:113},'r':{code:82,ch:114},'s':{code:83,ch:115},'t':{code:84,ch:116},'u':{code:85,ch:117},'v':{code:86,ch:118},'w':{code:87,ch:119},'x':{code:88,ch:120},'y':{code:89,ch:121},'z':{code:90,ch:122},'A':{code:65,ch:65},'B':{code:66,ch:66},'C':{code:67,ch:67},'D':{code:68,ch:68},'E':{code:69,ch:69},'F':{code:70,ch:70},'G':{code:71,ch:71},'H':{code:72,ch:72},'I':{code:73,ch:73},'J':{code:74,ch:74},'K':{code:75,ch:75},'L':{code:76,ch:76},'M':{code:77,ch:77},'N':{code:78,ch:78},'O':{code:79,ch:79},'P':{code:80,ch:80},'Q':{code:81,ch:81},'R':{code:82,ch:82},'S':{code:83,ch:83},'T':{code:84,ch:84},'U':{code:85,ch:85},'V':{code:86,ch:86},'W':{code:87,ch:87},'X':{code:88,ch:88},'Y':{code:89,ch:89},'Z':{code:90,ch:90}},n=['Tab','F1','F2','F3','F4','F5','F6','F7','F8','F9','F10','ArrowLeft','ArrowRight','ArrowUp','ArrowDown']},1120:(t,i,e)=>{e.d(i,{A:()=>c});var s=e(1069),n=e(8665),r=e(2679),h=e(2511),o=e(3819),l=e(3867),a=e(8950);class c{static Lo=[];static Cf=null;static So=null;static El=0;static Ef=1;static bl=2;static Yl=3;static Vl=4;static ia=5;static na=6;static ua=7;static vf=1;static bf=2;static Tf=3;static Rf=4;static Of=5;static Zl=6;static ya=1;static Aa=100;static ma=101;static pa=200;static Lf=201;static Sf=202;static _a=203;static xf=205;static Mf=300;static kf=301;static Df=302;static Ff=303;static Nf=304;static Bf=305;static Uf=306;static Pf=307;static Gf=308;static Wf=309;static Yf=310;static Hf=311;static Vf=312;static Kf=313;static Xf=314;static jf=315;static zf=316;static Zf=317;static qf=318;static $f=319;static Jf=320;static Qf=321;static tu=322;static iu=323;static Da=324;static Fa=325;static eu=326;static ba=327;static ga=401;static Ia=500;static su=501;static nu=502;static va=503;static Na=600;static ru=601;static hu=602;static ou=603;static lu=604;static au=605;static cu=606;static fu=607;static uu=608;static du=609;static wu=610;static yu=611;static Au=612;static Ba=613;static Ua=650;static Wa=651;static Ya=652;static Ha=653;static Va=654;static Pa=655;static Qa=(t,i,e)=>{this.Cf=new r.A(5e4),this.So=new r.A(5e4);const n=new s.A(t.read('data'));let h=-1;for(n.gf+=2;n.gf0){s.$o=new Uint8Array(r),s.Qo=new Uint16Array(r);for(let t=0;t0){s.scripts=new l.fe(o,null);for(let t=0;t0){const n=e.lastIndexOf(',');s.Wl[t]=this.bu(i,e.substring(0,n),parseInt(e.substring(n+1),10))}}s.Tu=new l.fe(5,null);for(let t=0;t<5;t++){const i=n.vu;s.Tu[t]=i,0===i.length&&(s.Tu[t]=null)}}if(s.type===c.Yl&&(s.fill=1===n._u),s.type===c.Vl||s.type===c.Ef){s.$l=1===n._u;const t=n._u;e&&(s.font=e[t]),s.Ql=1===n._u}if(s.type===c.Vl&&(s.text=n.vu,s.jl=n.vu),s.type!==c.Ef&&s.type!==c.Yl&&s.type!==c.Vl||(s.Hl=n.Ko),s.type!==c.Yl&&s.type!==c.Vl||(s.Xl=n.Ko,s.Kl=n.Ko),s.type===c.ia){const t=n.vu;if(t.length>0){const e=t.lastIndexOf(',');s.sa=this.bu(i,t.substring(0,e),parseInt(t.substring(e+1),10))}const e=n.vu;if(e.length>0){const t=e.lastIndexOf(',');s.ea=this.bu(i,e.substring(0,t),parseInt(e.substring(t+1),10))}}if(s.type===c.na){const t=n._u;0!==t&&(s.model=this.la((t-1<<8)+n._u));const i=n._u;0!==i&&(s.Ru=this.la((i-1<<8)+n._u)),s.al=n._u,0===s.al?s.al=-1:s.al=(s.al-1<<8)+n._u,s.cl=n._u,0===s.cl?s.cl=-1:s.cl=(s.cl-1<<8)+n._u,s.zoom=n.mu,s.oa=n.mu,s.fa=n.mu}if(s.type===c.ua){s.Ol=new Int32Array(s.width*s.height),s.Ll=new Int32Array(s.width*s.height),s.$l=1===n._u;const t=n._u;e&&(s.font=e[t]),s.Ql=1===n._u,s.Hl=n.Ko,s.Sl=n.Iu,s.xl=n.Iu,s.Cu=1===n._u,s.Tu=new l.fe(5,null);for(let t=0;t<5;t++){const i=n.vu;s.Tu[t]=i,0===i.length&&(s.Tu[t]=null)}}s.zl!==c.bf&&s.type!==c.bl||(s.Ou=n.vu,s.action=n.vu,s.Lu=n.mu),s.zl!==c.vf&&s.zl!==c.Rf&&s.zl!==c.Of&&s.zl!==c.Zl||(s.Su=n.vu,0===s.Su.length&&(s.zl===c.vf?s.Su='Ok':s.zl===c.Rf||s.zl===c.Of?s.Su='Select':s.zl===c.Zl&&(s.Su='Continue')))}this.Cf=null,this.So=null};static bu=(t,i,e)=>{const s=o.A.xu(i)<<8n|BigInt(e);if(this.Cf){const t=this.Cf.get(s);if(t)return t}let n;try{n=h.A.Za(t,i,e),this.Cf?.put(s,n)}catch(t){return null}return n};static la=t=>{if(this.So){const i=this.So.get(BigInt(t));if(i)return i}const i=n.A.model(t);return this.So?.put(BigInt(t),i),i};id=-1;pu=-1;type=-1;zl=-1;Il=0;width=0;height=0;gu=-1;$o=null;Qo=null;scripts=null;scroll=0;hide=!1;draggable=!1;Cu=!1;Eu=!1;Sl=0;xl=0;Tl=null;Rl=null;Wl=null;Tu=null;fill=!1;$l=!1;font=null;Ql=!1;text=null;jl=null;Hl=0;Xl=0;Kl=0;sa=null;ea=null;model=null;Ru=null;al=-1;cl=-1;zoom=0;oa=0;fa=0;Ou=null;action=null;Lu=-1;Su=null;ll=null;ml=null;pl=null;x=0;y=0;vl=0;Ol=null;Ll=null;ul=0;fl=0;la(t,i,e){let s=this.model;if(e&&(s=this.Ru),!s)return null;if(-1===t&&-1===i&&!s.Mu)return s;const r=n.A.ku(s,!0,!0,!1);return-1===t&&-1===i||r.xa(),-1!==t&&r.Ma(t),-1!==i&&r.Ma(i),r.ka(64,768,-50,-10,-50,!0),r}Du(){if(this.pu===this.id)return this.x;let t=c.Lo[this.pu];if(!t.ll||!t.ml||!t.pl)return this.x;let i=t.ll.indexOf(this.id);if(-1===i)return this.x;let e=t.ml[i];for(;t.pu!==t.id;){const s=c.Lo[t.pu];s.ll&&s.ml&&s.pl&&(i=s.ll.indexOf(t.id),-1!==i&&(e+=s.ml[i])),t=s}return e}Fu(){if(this.pu===this.id)return this.y;let t=c.Lo[this.pu];if(!t.ll||!t.ml||!t.pl)return this.y;let i=t.ll.indexOf(this.id);if(-1===i)return this.y;let e=t.pl[i];for(;t.pu!==t.id;){const s=c.Lo[t.pu];s.ll&&s.ml&&s.pl&&(i=s.ll.indexOf(t.id),-1!==i&&(e+=s.pl[i])),t=s}return e}outline(t){const i=this.Du(),e=this.Fu();a.A._l(i,e,this.width,this.height,t)}move(t,i){if(this.pu===this.id)return;this.x=0,this.y=0;const e=c.Lo[this.pu];if(e.ll&&e.ml&&e.pl){const s=e.ll.indexOf(this.id);-1!==s&&(e.ml[s]=t,e.pl[s]=i)}}delete(){if(this.pu===this.id)return;const t=c.Lo[this.pu];if(t.ll&&t.ml&&t.pl){const i=t.ll.indexOf(this.id);-1!==i&&(t.ll.splice(i,1),t.ml.splice(i,1),t.pl.splice(i,1))}}}},6333:(t,i,e)=>{e.d(i,{$:()=>s});class s{id;Nu=null;constructor(t){this.id=t}Bu(t){for(;;){const i=t._u;if(0===i)break;this.decode(i,t)}return this}}},2164:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(6333);class r extends n.${static count=0;static Lo=[];static Qa=t=>{const i=new s.A(t.read('flo.dat'));this.count=i.mu;for(let t=0;t(e>179&&(i=i/2|0),e>192&&(i=i/2|0),e>217&&(i=i/2|0),e>243&&(i=i/2|0),(t/4<<10)+(i/32<<7)+(e/2|0));static Pu=(t,i)=>-1===t?12345678:((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);static Gu=(t,i)=>-2===t?12345678:-1===t?(i<0?i=0:i>127&&(i=127),127-i):((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);Wu=0;texture=-1;Yu=!1;Hu=!0;Vu=0;Ku=0;Xu=0;ju=0;zu=0;Zu=0;decode(t,i){1===t?(this.Wu=i.qu,this.setColor(this.Wu)):2===t?this.texture=i._u:3===t?this.Yu=!0:5===t?this.Hu=!1:6===t?this.Nu=i.vu:console.log('Error unrecognised config code: ',t)}setColor(t){const i=(t>>16&255)/256,e=(t>>8&255)/256,s=(255&t)/256;let n=i;ei&&(h=e),s>h&&(h=s);let o=0,l=0;const a=(n+h)/2;n!==h&&(a<.5&&(l=(h-n)/(h+n)),a>=.5&&(l=(h-n)/(2-h-n)),i===h?o=(e-s)/(h-n):e===h?o=(s-i)/(h-n)+2:s===h&&(o=(i-e)/(h-n)+4)),o/=6,this.Vu=256*o|0,this.Ku=256*l|0,this.Xu=256*a|0,this.Ku<0?this.Ku=0:this.Ku>255&&(this.Ku=255),this.Xu<0?this.Xu=0:this.Xu>255&&(this.Xu=255),this.ju=a>.5?(1-a)*l*512|0:a*l*512|0,this.ju<1&&(this.ju=1),this.zu=o*this.ju|0;let c=this.Vu+(16*Math.random()|0)-8;c<0?c=0:c>255&&(c=255);let f=this.Ku+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255);let u=this.Xu+(48*Math.random()|0)-24;u<0?u=0:u>255&&(u=255),this.Zu=r.Uu(c,f,u)}}},8317:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(1069),n=e(6333),r=e(8665),h=e(3867);class o extends n.${static count=0;static Lo=[];static Qa=t=>{const i=new s.A(t.read('idk.dat'));this.count=i.mu;for(let t=0;t=40&&t<50)this.Qu[t-40]=i.mu;else if(t>=50&&t<60)this.td[t-50]=i.mu;else{if(!(t>=60&&t<70))throw new Error(`Unrecognized idk config code: ${t}`);this.Ju[t-60]=i.mu}}la(){if(!this.$u)return null;const t=new h.fe(this.$u.length,null);for(let i=0;i{e.d(i,{A:()=>c});var s=e(6333),n=e(1069),r=e(2679),h=e(8665),o=e(1023),l=e(6169),a=e(3867);class c extends s.${static count=0;static cache=null;static sd=null;static nd=null;static rd=0;static hd=new r.A(500);static od=new r.A(30);static Qa=t=>{this.sd=new n.A(t.read('loc.dat'));const i=new n.A(t.read('loc.idx'));this.count=i.mu,this.nd=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.nd||!this.sd)throw new Error('LocType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.rd=(this.rd+1)%10;const i=this.cache[this.rd];return this.sd.gf=this.nd[t],i.id=t,i.reset(),i.Bu(this.sd),i.ld||(i.ld=new Int32Array(1)),-1===i.ad&&i.ld&&(i.active=i.ld.length>0&&i.ld[0]===o.A.fd.id,i.ud&&(i.active=!0)),i};static To=()=>{this.hd=null,this.od=null,this.nd=null,this.cache=null,this.sd=null};$u=null;ld=null;name=null;dd=null;Qu=null;td=null;width=1;length=1;wd=!0;yd=!0;active=!1;ad=-1;Ad=!1;md=!1;Hu=!1;al=-1;pd=!1;_d=16;gd=0;Id=0;ud=null;Cd=-1;Ed=-1;vd=!1;bd=!0;Td=128;Rd=128;Od=128;Ld=0;Sd=0;xd=0;Md=0;kd=!1;decode(t,i){if(1===t){const t=i._u;this.$u=new Int32Array(t),this.ld=new Int32Array(t);for(let e=0;e=30&&t<39)this.ud||(this.ud=new a.fe(5,null)),this.ud[t-30]=i.vu,'hidden'===this.ud[t-30]?.toLowerCase()&&(this.ud[t-30]=null);else if(40===t){const t=i._u;this.Qu=new Uint16Array(t),this.td=new Uint16Array(t);for(let e=0;e=this.$u.length)return null;let d=this.$u[a];if(-1===d)return null;const w=this.vd!==i>3;w&&(d+=65536);let y=c.hd?.get(BigInt(d));y||(y=h.A.model(65535&d),w&&y.Wd(),c.hd?.put(BigInt(d),y));const A=128!==this.Td||128!==this.Rd||128!==this.Od,m=0!==this.Sd||0!==this.xd||0!==this.Md;let p=h.A.ku(y,!this.Qu,!this.pd,i===l.A.Yd&&-1===o&&!A&&!m);for(-1!==o&&(p.xa(),p.Ma(o),p.Hd=null,p.Vd=null);i-- >0;)p.Kd();if(this.Qu&&this.td)for(let t=0;t{e.d(i,{A:()=>l});var s=e(6333),n=e(1069),r=e(2679),h=e(8665),o=e(3867);class l extends s.${static count=0;static cache=null;static sd=null;static nd=null;static rd=0;static So=new r.A(30);static Qa=t=>{this.sd=new n.A(t.read('npc.dat'));const i=new n.A(t.read('npc.idx'));this.count=i.mu,this.nd=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.nd||!this.sd)throw new Error('NpcType not loaded!!!');for(let i=0;i<20;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.rd=(this.rd+1)%20;const i=this.cache[this.rd]=new l(t);return this.sd.gf=this.nd[t],i.Bu(this.sd),i};static To=()=>{this.So=null,this.nd=null,this.cache=null,this.sd=null};name=null;dd=null;size=1;$u=null;Ju=null;pd=!1;zd=-1;Zd=-1;qd=-1;$d=-1;Jd=-1;Qu=null;td=null;ud=null;Td=-1;Rd=-1;Od=-1;Qd=!0;tw=-1;iw=128;ew=128;decode(t,i){if(1===t){const t=i._u;this.$u=new Uint16Array(t);for(let e=0;e=30&&t<40)this.ud||(this.ud=new o.fe(5,null)),this.ud[t-30]=i.vu,'hidden'===this.ud[t-30]?.toLowerCase()&&(this.ud[t-30]=null);else if(40===t){const t=i._u;this.Qu=new Uint16Array(t),this.td=new Uint16Array(t);for(let e=0;e{e.d(i,{A:()=>u});var s=e(6333),n=e(1069),r=e(2511),h=e(2679),o=e(8665),l=e(4583),a=e(8950),c=e(9298),f=e(3867);class u extends s.${static count=0;static cache=null;static sd=null;static nd=null;static rd=0;static lw=!0;static So=new h.A(50);static aw=new h.A(200);static Qa=(t,i)=>{this.lw=i,this.sd=new n.A(t.read('obj.dat'));const e=new n.A(t.read('obj.idx'));this.count=e.mu,this.nd=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.nd||!this.sd)throw new Error('ObjType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.rd=(this.rd+1)%10;const i=this.cache[this.rd];return this.sd.gf=this.nd[t],i.id=t,i.reset(),i.Bu(this.sd),-1!==i.sc&&i.cw(),!this.lw&&i.members&&(i.name='Members Object',i.dd="Login to a members' server to use this object.",i.ud=null,i.fw=null),i};static To=()=>{this.So=null,this.aw=null,this.nd=null,this.cache=null,this.sd=null};static Ml=(t,i)=>{if(u.aw){let e=u.aw.get(BigInt(t));if(e&&e.uw!==i&&-1!==e.uw&&(e.dw(),e=null),e)return e}let e=u.get(t);if(e.ic||(i=-1),e.ic&&e.ec&&i>1){let t=-1;for(let s=0;s<10;s++)i>=e.ec[s]&&0!==e.ec[s]&&(t=e.ic[s]);-1!==t&&(e=u.get(t))}const s=new r.A(32,32),n=l.A.ra,h=l.A.ha,o=l.A.ww,f=a.A.yw,d=a.A.Aw,w=a.A.mw,y=a.A.left,A=a.A.right,m=a.A.top,p=a.A.bottom;l.A.pw=!1,a.A.bind(s.yw,32,32),a.A.fillRect(0,0,32,32,c.A.Pl),l.A.nc();const _=e._w(1),g=l.A.sin[e.gw]*e.Iw>>16,I=l.A.cos[e.gw]*e.Iw>>16;_.ca(0,e.Cw,e.Ew,e.gw,e.bw,g+(_.jd/2|0)+e.Tw,I+e.Tw);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.yw[t+32*i]&&(t>0&&s.yw[t+32*i-1]>1||i>0&&s.yw[t+32*(i-1)]>1||t<31&&s.yw[t+32*i+1]>1||i<31&&s.yw[t+32*(i+1)]>1)&&(s.yw[t+32*i]=1);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.yw[t+32*i]&&t>0&&i>0&&s.yw[t+32*(i-1)-1]>0&&(s.yw[t+32*i]=3153952);if(-1!==e.sc){const t=this.Ml(e.Rw,10),i=t.Nl,s=t.uw;t.Nl=32,t.uw=32,t.Ow(5,5,22,22),t.Nl=i,t.uw=s}return u.aw?.put(BigInt(t),s),a.A.bind(f,d,w),a.A.Al(y,m,A,p),l.A.ra=n,l.A.ha=h,l.A.ww=o,l.A.pw=!0,e.da?s.Nl=33:s.Nl=32,s.uw=i,s};model=0;name=null;dd=null;Qu=null;td=null;Iw=2e3;gw=0;Cw=0;Ew=0;bw=0;Tw=0;Lw=!1;Sw=-1;da=!1;xw=1;members=!1;ud=null;fw=null;Mw=-1;kw=-1;Dw=0;Fw=-1;Nw=-1;Bw=0;Uw=-1;Pw=-1;Gw=-1;Ww=-1;Yw=-1;Hw=-1;ic=null;ec=null;Rw=-1;sc=-1;decode(t,i){if(1===t)this.model=i.mu;else if(2===t)this.name=i.vu;else if(3===t)this.dd=i.vu;else if(4===t)this.Iw=i.mu;else if(5===t)this.gw=i.mu;else if(6===t)this.Cw=i.mu;else if(7===t)this.bw=i.Iu,this.bw>32767&&(this.bw-=65536);else if(8===t)this.Tw=i.Iu,this.Tw>32767&&(this.Tw-=65536);else if(9===t)this.Lw=!0;else if(10===t)this.Sw=i.mu;else if(11===t)this.da=!0;else if(12===t)this.xw=i.Ko;else if(16===t)this.members=!0;else if(23===t)this.Mw=i.mu,this.Dw=i.Dd;else if(24===t)this.kw=i.mu;else if(25===t)this.Fw=i.mu,this.Bw=i.Dd;else if(26===t)this.Nw=i.mu;else if(t>=30&&t<35)this.ud||(this.ud=new f.fe(5,null)),this.ud[t-30]=i.vu,'hidden'===this.ud[t-30]?.toLowerCase()&&(this.ud[t-30]=null);else if(t>=35&&t<40)this.fw||(this.fw=new f.fe(5,null)),this.fw[t-35]=i.vu;else if(40===t){const t=i._u;this.Qu=new Uint16Array(t),this.td=new Uint16Array(t);for(let e=0;e=100&&t<110&&(this.ic&&this.ec||(this.ic=new Uint16Array(10),this.ec=new Uint16Array(10)),this.ic[t-100]=i.mu,this.ec[t-100]=i.mu)}Vw(t){let i=this.Mw;if(1===t&&(i=this.Fw),-1===i)return null;let e=this.kw,s=this.Uw;1===t&&(e=this.Nw,s=this.Pw);let n=o.A.model(i);if(-1!==e){const t=o.A.model(e);if(-1===s){const i=[n,t];n=o.A.Ta(i,2)}else{const i=[n,t,o.A.model(s)];n=o.A.Ta(i,3)}}if(0===t&&0!==this.Dw&&n.translate(this.Dw,0,0),1===t&&0!==this.Bw&&n.translate(this.Bw,0,0),this.Qu&&this.td)for(let t=0;t1){let i=-1;for(let e=0;e<10;e++)t>=this.ec[e]&&0!==this.ec[e]&&(i=this.ic[e]);if(-1!==i)return u.get(i)._w(1)}if(u.So){const t=u.So.get(BigInt(this.id));if(t)return t}const i=o.A.model(this.model);if(this.Qu&&this.td)for(let t=0;t{e.d(i,{A:()=>h});var s=e(6333),n=e(1069),r=e(6730);class h extends s.${static count=0;static Lo=[];static Qa=t=>{const i=new n.A(t.read('seq.dat'));this.count=i.mu;for(let t=0;t{e.d(i,{A:()=>l});var s=e(6333),n=e(1069),r=e(1312),h=e(8665),o=e(2679);class l extends s.${static count=0;static Lo=[];static So=new o.A(30);static Qa=t=>{const i=new n.A(t.read('spotanim.dat'));this.count=i.mu;for(let t=0;t=40&&t<50)this.Qu[t-40]=i.mu;else{if(!(t>=50&&t<60))throw new Error(`Unrecognized spotanim config code: ${t}`);this.td[t-50]=i.mu}}la(){let t=l.So?.get(BigInt(this.id));if(t)return t;t=h.A.model(this.model);for(let i=0;i<6;i++)0!==this.Qu[0]&&t.Ra(this.Qu[i],this.td[i]);return l.So?.put(BigInt(this.id),t),t}}},3764:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(6333),n=e(1069);class r extends s.${static count=0;static Lo=[];static $w=[];static Jw=0;static Qa=t=>{const i=new n.A(t.read('varp.dat'));this.count=i.mu;for(let t=0;t{e.d(i,{A:()=>s});class s{static OPEN=0;static ny=1;static hy=2;static oy=4;static ly=8;static uy=s.ny<<4;static wy=s.hy<<4;static yy=s.oy<<4;static Ay=s.ly<<4;static my=256;static py=512;static _y=1024;static gy=2048;static Iy=4096;static Cy=s.py<<4;static Ey=s._y<<4;static vy=s.gy<<4;static by=s.Iy<<4;static Ty=s.my<<9;static Ry=524288;static Oy=2097152;static Ly=s.Oy|s.Ry;static Sy=s.my|s.Ly;static xy=s.hy|s.Sy;static My=s.ly|s.Sy;static ky=s.hy|s.oy|s.My;static Dy=s.wy|s.Sy;static Fy=s.ly|s.uy|s.Dy;static Ny=s.Ay|s.Sy;static By=s.ny|s.hy|s.Ny;static Uy=s.wy|s.yy|s.Ny;static Py=16777215}},670:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(9456),n=e(6169),r=e(1023),h=e(4909);class o{static Dr=4;static jr=104;static index=(t,i)=>t*o.jr+i;offsetX;Gy;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.Gy=0,this.sizeX=o.jr,this.sizeZ=o.jr,this.flags=new Int32Array(this.sizeX*this.sizeZ),this.reset()}reset=()=>{for(let t=0;t{this.flags[o.index(t-this.offsetX,i-this.Gy)]|=s.A.Oy};Yy=(t,i)=>{this.flags[o.index(t-this.offsetX,i-this.Gy)]&=~s.A.Oy};Hy=(t,i,e,r,h,o)=>{let l=s.A.my;o&&(l|=s.A.Ty);const a=t-this.offsetX,c=i-this.Gy;if(h===n.A.Vy||h===n.A.Ky){const t=e;e=r,r=t}for(let t=a;t=0&&t=0&&i{let l=s.A.my;o&&(l|=s.A.Ty);const a=t-this.offsetX,c=i-this.Gy;if(h===n.A.Vy||h===n.A.Ky){const t=e;e=r,r=t}for(let t=a;t=0&&t=0&&i{const l=t-this.offsetX,a=i-this.Gy,c=o?s.A.by:s.A.Ay,f=o?s.A.Iy:s.A.ly,u=o?s.A._y:s.A.hy,d=o?s.A.Ey:s.A.wy,w=o?s.A.py:s.A.ny,y=o?s.A.Cy:s.A.uy,A=o?s.A.gy:s.A.oy,m=o?s.A.vy:s.A.yy;e===r.A.zy.id?h===n.A.Yd?(this.add(l,a,c),this.add(l-1,a,f)):h===n.A.Vy?(this.add(l,a,u),this.add(l,a+1,d)):h===n.A.Zy?(this.add(l,a,f),this.add(l+1,a,c)):h===n.A.Ky&&(this.add(l,a,d),this.add(l,a-1,u)):e===r.A.qy.id||e===r.A.$y.id?h===n.A.Yd?(this.add(l,a,w),this.add(l-1,a+1,y)):h===n.A.Vy?(this.add(l,a,A),this.add(l+1,a+1,m)):h===n.A.Zy?(this.add(l,a,y),this.add(l+1,a-1,w)):h===n.A.Ky&&(this.add(l,a,m),this.add(l-1,a-1,A)):e===r.A.Jy.id&&(h===n.A.Yd?(this.add(l,a,u|c),this.add(l-1,a,f),this.add(l,a+1,d)):h===n.A.Vy?(this.add(l,a,u|f),this.add(l,a+1,d),this.add(l+1,a,c)):h===n.A.Zy?(this.add(l,a,d|f),this.add(l+1,a,c),this.add(l,a-1,u)):h===n.A.Ky&&(this.add(l,a,d|c),this.add(l,a-1,u),this.add(l-1,a,f))),o&&this.jy(t,i,e,h,!1)};Qy=(t,i,e,h,o)=>{const l=t-this.offsetX,a=i-this.Gy,c=o?s.A.by:s.A.Ay,f=o?s.A.Iy:s.A.ly,u=o?s.A._y:s.A.hy,d=o?s.A.Ey:s.A.wy,w=o?s.A.py:s.A.ny,y=o?s.A.Cy:s.A.uy,A=o?s.A.gy:s.A.oy,m=o?s.A.vy:s.A.yy;e===r.A.zy.id?h===n.A.Yd?(this.remove(l,a,c),this.remove(l-1,a,f)):h===n.A.Vy?(this.remove(l,a,u),this.remove(l,a+1,d)):h===n.A.Zy?(this.remove(l,a,f),this.remove(l+1,a,c)):h===n.A.Ky&&(this.remove(l,a,d),this.remove(l,a-1,u)):e===r.A.qy.id||e===r.A.$y.id?h===n.A.Yd?(this.remove(l,a,w),this.remove(l-1,a+1,y)):h===n.A.Vy?(this.remove(l,a,A),this.remove(l+1,a+1,m)):h===n.A.Zy?(this.remove(l,a,y),this.remove(l+1,a-1,w)):h===n.A.Ky&&(this.remove(l,a,m),this.remove(l-1,a-1,A)):e===r.A.Jy.id&&(h===n.A.Yd?(this.remove(l,a,u|c),this.remove(l-1,a,f),this.remove(l,a+1,d)):h===n.A.Vy?(this.remove(l,a,u|f),this.remove(l,a+1,d),this.remove(l+1,a,c)):h===n.A.Zy?(this.remove(l,a,d|f),this.remove(l+1,a,c),this.remove(l,a-1,u)):h===n.A.Ky&&(this.remove(l,a,d|c),this.remove(l,a-1,u),this.remove(l-1,a,f))),o&&this.Qy(t,i,e,h,!1)};tA=(t,i,e,h,l,a)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.Gy,u=e-this.offsetX,d=h-this.Gy,w=o.index(c,f);if(l===r.A.zy.id){if(a===n.A.Yd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Dy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.xy)===s.A.OPEN)return!0}else if(a===n.A.Vy){if(c===u&&f===d+1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.My)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Ny)===s.A.OPEN)return!0}else if(a===n.A.Zy){if(c===u+1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Dy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.xy)===s.A.OPEN)return!0}else if(a===n.A.Ky){if(c===u&&f===d-1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.My)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Ny)===s.A.OPEN)return!0}}else if(l===r.A.Jy.id){if(a===n.A.Yd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Ny)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.xy)===s.A.OPEN)return!0}else if(a===n.A.Vy){if(c===u-1&&f===d&&(this.flags[w]&s.A.My)===s.A.OPEN)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.xy)===s.A.OPEN)return!0}else if(a===n.A.Zy){if(c===u-1&&f===d&&(this.flags[w]&s.A.My)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Dy)===s.A.OPEN)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1)return!0}else if(a===n.A.Ky){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Dy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Ny)===s.A.OPEN)return!0;if(c===u&&f===d-1)return!0}}else if(l===r.A.iA.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.wy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.hy)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.ly)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Ay)===s.A.OPEN)return!0}return!1};eA=(t,i,e,h,l,a)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.Gy,u=e-this.offsetX,d=h-this.Gy,w=o.index(c,f);if(l===r.A.sA.id||l===r.A.nA.id){if(l===r.A.nA.id&&(a=a+2&3),a===n.A.Yd){if(c===u+1&&f===d&&(this.flags[w]&s.A.Ay)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.hy)===s.A.OPEN)return!0}else if(a===n.A.Vy){if(c===u-1&&f===d&&(this.flags[w]&s.A.ly)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.hy)===s.A.OPEN)return!0}else if(a===n.A.Zy){if(c===u-1&&f===d&&(this.flags[w]&s.A.ly)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.wy)===s.A.OPEN)return!0}else if(a===n.A.Ky){if(c===u+1&&f===d&&(this.flags[w]&s.A.Ay)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.wy)===s.A.OPEN)return!0}}else if(l===r.A.rA.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.wy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.hy)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.ly)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Ay)===s.A.OPEN)return!0}return!1};hA=(t,i,e,n,r,l,a)=>{const c=e+r-1,f=n+l-1,u=o.index(t-this.offsetX,i-this.Gy);return t>=e&&t<=c&&i>=n&&i<=f||(t===e-1&&i>=n&&i<=f&&(this.flags[u]&s.A.ly)===s.A.OPEN&&(a&h.A.Yd)===s.A.OPEN||(t===c+1&&i>=n&&i<=f&&(this.flags[u]&s.A.Ay)===s.A.OPEN&&(a&h.A.Zy)===s.A.OPEN||(i===n-1&&t>=e&&t<=c&&(this.flags[u]&s.A.hy)===s.A.OPEN&&(a&h.A.Ky)===s.A.OPEN||i===f+1&&t>=e&&t<=c&&(this.flags[u]&s.A.wy)===s.A.OPEN&&(a&h.A.Vy)===s.A.OPEN)))};add=(t,i,e)=>{this.flags[o.index(t,i)]|=e};remove=(t,i,e)=>{this.flags[o.index(t,i)]&=s.A.Py-e}}},4909:(t,i,e)=>{e.d(i,{A:()=>s});class s{static Vy=1;static Zy=2;static Ky=4;static Yd=8}},6169:(t,i,e)=>{e.d(i,{A:()=>s});class s{static Yd=0;static Vy=1;static Zy=2;static Ky=3}},5599:(t,i,e)=>{e.d(i,{A:()=>s});class s{static oA=0;static lA=1;static aA=2;static cA=3}},1023:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5599);class n{static zy=new n(0,s.A.oA);static qy=new n(1,s.A.oA);static Jy=new n(2,s.A.oA);static $y=new n(3,s.A.oA);static fA=new n(4,s.A.lA);static uA=new n(5,s.A.lA);static sA=new n(6,s.A.lA);static nA=new n(7,s.A.lA);static rA=new n(8,s.A.lA);static iA=new n(9,s.A.aA);static fd=new n(10,s.A.aA);static dA=new n(11,s.A.aA);static wA=new n(12,s.A.aA);static yA=new n(13,s.A.aA);static AA=new n(14,s.A.aA);static mA=new n(15,s.A.aA);static pA=new n(16,s.A.aA);static _A=new n(17,s.A.aA);static gA=new n(18,s.A.aA);static IA=new n(19,s.A.aA);static CA=new n(20,s.A.aA);static EA=new n(21,s.A.aA);static cA=new n(22,s.A.cA);static values(){return[this.zy,this.qy,this._A,this.mA,this.Jy,this.AA,this.iA,this.$y,this.cA,this.wA,this.dA,this.sA,this.CA,this.fd,this.uA,this.yA,this.nA,this.fA,this.pA,this.rA,this.IA,this.EA,this.gA]}static of(t){const i=this.values();for(let e=0;e{e.d(i,{A:()=>A});var s=e(670),n=e(2164),r=e(1069),h=e(4583),o=e(3045),l=e(5637),a=e(4197),c=e(1312),f=e(1023),u=e(6169),d=e(9298),w=e(5518),y=e(3867);class A{static vA=Int8Array.of(1,2,4,8);static bA=Uint8Array.of(16,32,64,128);static TA=Int8Array.of(1,0,-1,0);static RA=Int8Array.of(0,-1,0,1);static OA=(17*Math.random()|0)-8;static LA=(33*Math.random()|0)-16;static et=!0;static SA=0;static xA=!1;static MA=(t,i)=>{let e=this.kA(t+45365,i+91923,4)+(this.kA(t+10294,i+37821,2)-128>>1)+(this.kA(t,i,1)-128>>2)-128;return e=35+(.3*e|0),e<10?e=10:e>60&&(e=60),e};static kA=(t,i,e)=>{const s=t/e|0,n=t&e-1,r=i/e|0,h=i&e-1,o=this.DA(s,r),l=this.DA(s+1,r),a=this.DA(s,r+1),c=this.DA(s+1,r+1),f=this.FA(o,l,n,e),u=this.FA(a,c,n,e);return this.FA(f,u,h,e)};static FA=(t,i,e,s)=>{const n=65536-h.A.cos[1024*e/s|0]>>1;return(t*(65536-n)>>16)+(i*n>>16)};static DA=(t,i)=>((this.NA(t-1,i-1)+this.NA(t+1,i-1)+this.NA(t-1,i+1)+this.NA(t+1,i+1))/16|0)+((this.NA(t-1,i)+this.NA(t+1,i)+this.NA(t,i-1)+this.NA(t,i+1))/8|0)+(this.NA(t,i)/4|0);static NA=(t,i)=>{const e=t+57*i,s=BigInt(e<<13^e);return 255&Number((s*(s*s*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static Hy=(t,i,e,s,n,r,h,o,d,w,y)=>{const m=n[y][i][e],p=n[y][i+1][e],_=n[y][i+1][e+1],g=n[y][i][e+1],I=m+p+_+g>>2,C=l.A.get(o);let E=i+(e<<7)+(o<<14)+1073741824|0;C.active||(E+=-2147483648),E|=0;const v=(w<<6)+d<<24>>24;if(d===f.A.cA.id)s?.BA(C.la(f.A.cA.id,w,m,p,_,g,-1),t,i,e,I,E,v),C.wd&&C.active&&h?.Wy(i,e),-1!==C.al&&r.UA(new a.A(o,t,3,i,e,c.A.Lo[C.al],!0));else if(d===f.A.fd.id||d===f.A.dA.id){const n=C.la(f.A.fd.id,w,m,p,_,g,-1);if(n){let r,h,o=0;d===f.A.dA.id&&(o+=256),w===u.A.Vy||w===u.A.Ky?(r=C.length,h=C.width):(r=C.width,h=C.length),s?.Hy(t,i,e,I,n,null,E,v,r,h,o)}C.wd&&h?.Hy(i,e,C.width,C.length,w,C.yd),-1!==C.al&&r.UA(new a.A(o,t,2,i,e,c.A.Lo[C.al],!0))}else if(d>=f.A.wA.id)s?.Hy(t,i,e,I,C.la(d,w,m,p,_,g,-1),null,E,v,1,1,0),C.wd&&h?.Hy(i,e,C.width,C.length,w,C.yd),-1!==C.al&&r.UA(new a.A(o,t,2,i,e,c.A.Lo[C.al],!0));else if(d===f.A.zy.id)s?.jy(t,i,e,I,A.vA[w],0,C.la(f.A.zy.id,w,m,p,_,g,-1),null,E,v),C.wd&&h?.jy(i,e,d,w,C.yd),-1!==C.al&&r.UA(new a.A(o,t,0,i,e,c.A.Lo[C.al],!0));else if(d===f.A.qy.id)s?.jy(t,i,e,I,A.bA[w],0,C.la(f.A.qy.id,w,m,p,_,g,-1),null,E,v),C.wd&&h?.jy(i,e,d,w,C.yd),-1!==C.al&&r.UA(new a.A(o,t,0,i,e,c.A.Lo[C.al],!0));else if(d===f.A.Jy.id){const n=w+1&3;s?.jy(t,i,e,I,A.vA[w],A.vA[n],C.la(f.A.Jy.id,w+4,m,p,_,g,-1),C.la(f.A.Jy.id,n,m,p,_,g,-1),E,v),C.wd&&h?.jy(i,e,d,w,C.yd),-1!==C.al&&r.UA(new a.A(o,t,0,i,e,c.A.Lo[C.al],!0))}else if(d===f.A.$y.id)s?.jy(t,i,e,I,A.bA[w],0,C.la(f.A.$y.id,w,m,p,_,g,-1),null,E,v),C.wd&&h?.jy(i,e,d,w,C.yd),-1!==C.al&&r.UA(new a.A(o,t,0,i,e,c.A.Lo[C.al],!0));else if(d===f.A.iA.id)s?.Hy(t,i,e,I,C.la(d,w,m,p,_,g,-1),null,E,v,1,1,0),C.wd&&h?.Hy(i,e,C.width,C.length,w,C.yd),-1!==C.al&&r.UA(new a.A(o,t,2,i,e,c.A.Lo[C.al],!0));else if(d===f.A.fA.id)s?.PA(t,i,e,I,0,0,E,C.la(f.A.fA.id,u.A.Yd,m,p,_,g,-1),v,512*w,A.vA[w]),-1!==C.al&&r.UA(new a.A(o,t,1,i,e,c.A.Lo[C.al],!0));else if(d===f.A.uA.id){let n=16;if(s){const r=s.GA(t,i,e);r>0&&(n=l.A.get(r>>14&32767)._d)}s?.PA(t,i,e,I,A.TA[w]*n,A.RA[w]*n,E,C.la(f.A.fA.id,u.A.Yd,m,p,_,g,-1),v,512*w,A.vA[w]),-1!==C.al&&r.UA(new a.A(o,t,1,i,e,c.A.Lo[C.al],!0))}else d===f.A.sA.id?(s?.PA(t,i,e,I,0,0,E,C.la(f.A.fA.id,u.A.Yd,m,p,_,g,-1),v,w,256),-1!==C.al&&r.UA(new a.A(o,t,1,i,e,c.A.Lo[C.al],!0))):d===f.A.nA.id?(s?.PA(t,i,e,I,0,0,E,C.la(f.A.fA.id,u.A.Yd,m,p,_,g,-1),v,w,512),-1!==C.al&&r.UA(new a.A(o,t,1,i,e,c.A.Lo[C.al],!0))):d===f.A.rA.id&&(s?.PA(t,i,e,I,0,0,E,C.la(f.A.fA.id,u.A.Yd,m,p,_,g,-1),v,w,768),-1!==C.al&&r.UA(new a.A(o,t,1,i,e,c.A.Lo[C.al],!0)))};WA;YA;Hr;Vr;HA;VA;KA;XA;jA;zA;ZA;qA;$A;JA;QA;tm;constructor(t,i,e,n){this.WA=t,this.YA=i,this.Hr=e,this.Vr=n,this.HA=new y.im(s.A.Dr,t,i),this.VA=new y.im(s.A.Dr,t,i),this.KA=new y.im(s.A.Dr,t,i),this.XA=new y.im(s.A.Dr,t,i),this.tm=new y.sm(s.A.Dr,t+1,i+1),this.jA=new y.im(s.A.Dr,t+1,i+1),this.zA=new y.Xr(t+1,i+1),this.ZA=new Int32Array(i),this.qA=new Int32Array(i),this.$A=new Int32Array(i),this.JA=new Int32Array(i),this.QA=new Int32Array(i)}nm=(t,i)=>{for(let t=0;t=0&&i[s]?.Wy(e,n)}A.OA+=(5*Math.random()|0)-2,A.OA<-8?A.OA=-8:A.OA>8&&(A.OA=8),A.LA+=(5*Math.random()|0)-2,A.LA<-16?A.LA=-16:A.LA>16&&(A.LA=16);for(let i=0;i>8;for(let t=1;t>2)+(e[n+1][t]>>3)+(e[n][t-1]>>2)+(e[n][t+1]>>3)+(e[n][t]>>1);this.zA[n][t]=u-d}for(let t=0;t=0&&s0){const i=n.A.Lo[e-1];this.ZA[t]+=i.zu,this.qA[t]+=i.Ku,this.$A[t]+=i.Xu,this.JA[t]+=i.ju,r=this.QA[t]++}}const h=e-5;if(h>=0&&h0){const i=n.A.Lo[e-1];this.ZA[t]-=i.zu,this.qA[t]-=i.Ku,this.$A[t]-=i.Xu,this.JA[t]-=i.ju,r=this.QA[t]--}}}if(e>=1&&e=0&&f=0&&y=1&&c0||y>0){const m=this.Hr[i][e][c],p=this.Hr[i][e+1][c],_=this.Hr[i][e+1][c+1],g=this.Hr[i][e][c+1],I=this.zA[e][c],C=this.zA[e+1][c],E=this.zA[e+1][c+1],v=this.zA[e][c+1];let b=-1,T=-1;if(f>0){const t=256*s/l|0,i=r/a|0;let e=o/a|0;b=n.A.Uu(t,i,e);const h=t+A.OA&255;e+=A.LA,e<0?e=0:e>255&&(e=255),T=n.A.Uu(h,i,e)}if(i>0){let t=0!==f||this.KA[i][e][c]===w.A.hm;y>0&&!n.A.Lo[y-1].Hu&&(t=!1),t&&m===p&&m===_&&m===g&&(this.tm[i][e][c]|=2340)}let R=0;if(-1!==b&&(R=h.A.palette[n.A.Pu(T,96)]),0===y)t?.om(i,e,c,w.A.hm,u.A.Yd,-1,m,p,_,g,n.A.Pu(b,I),n.A.Pu(b,C),n.A.Pu(b,E),n.A.Pu(b,v),d.A.Pl,d.A.Pl,d.A.Pl,d.A.Pl,R,d.A.Pl);else{const s=this.KA[i][e][c]+1,r=this.XA[i][e][c],o=n.A.Lo[y-1];let l,a,f=o.texture;f>=0?(a=h.A.lm(f),l=-1):o.Wu===d.A.am?(a=0,l=-2,f=-1):(l=n.A.Uu(o.Vu,o.Ku,o.Xu),a=h.A.palette[n.A.Gu(o.Zu,96)]),t?.om(i,e,c,s,r,f,m,p,_,g,n.A.Pu(b,I),n.A.Pu(b,C),n.A.Pu(b,E),n.A.Pu(b,v),n.A.Gu(l,I),n.A.Gu(l,C),n.A.Gu(l,E),n.A.Gu(l,v),R,a)}}}}}}for(let e=1;e0&&(t<<=3,i<<=3,e<<=3);for(let s=0;s<=n;s++)for(let r=0;r<=this.YA;r++)for(let h=0;h<=this.WA;h++){if(this.tm[s][h][r]&t){let i=r,e=r,l=s,a=s;for(;i>0&&this.tm[s][h][i-1]&t;)i--;for(;e0;){for(let s=i;s<=e;s++)if(!(this.tm[l-1][h][s]&t))break t;l--}t:for(;a=8){const s=this.Hr[a][h][i]-240,r=this.Hr[l][h][i];o.A.wm(n,1,128*h,s,128*i,128*h,r,128*e+128);for(let s=l;s<=a;s++)for(let n=i;n<=e;n++)this.tm[s][h][n]&=~t}}if(this.tm[s][h][r]&i){let t=h,e=h,l=s,a=s;for(;t>0&&this.tm[s][t-1][r]&i;)t--;for(;e0;){for(let s=t;s<=e;s++)if(!(this.tm[l-1][s][r]&i))break t;l--}t:for(;a=8){const s=this.Hr[a][t][r]-240,h=this.Hr[l][t][r];o.A.wm(n,2,128*t,s,128*r,128*e+128,h,128*r);for(let s=l;s<=a;s++)for(let n=t;n<=e;n++)this.tm[s][n][r]&=~i}}if(this.tm[s][h][r]&e){let t=h,i=h,l=r,a=r;for(;l>0&&this.tm[s][h][l-1]&e;)l--;for(;a0;){for(let i=l;i<=a;i++)if(!(this.tm[s][t-1][i]&e))break t;t--}t:for(;i=4){const r=this.Hr[s][t][l];o.A.wm(n,4,128*t,r,128*l,128*i+128,r,128*a+128);for(let n=t;n<=i;n++)for(let t=l;t<=a;t++)this.tm[s][n][t]&=~e}}}}}};ym=(t,i,e,r)=>{let h=0;for(let t=0;t>24;break}for(let n=t;n=0&&t=0&&n{const o=new r.A(new Uint8Array(h));for(let r=0;r=0&&a=0&&c>24,this.XA[r][a][c]=(f-2&3)<<24>>24):f<=81?this.Vr[r][a][c]=f-49<<24>>24:this.HA[r][a][c]=f-81<<24>>24}else for(;f=o._u,0!==f;){if(1===f){o._u;break}f<=49&&o._u}}};pm=(t,i,e,n,h,o)=>{const l=new r.A(new Uint8Array(n));let a=-1;for(;;){const n=l._m;if(0===n)return;a+=n;let r=0;for(;;){const n=l._m;if(0===n)break;r+=n-1;const c=63&r,f=r>>6&63,u=r>>12,d=l._u,w=d>>2,y=3&d,A=f+h,m=c+o;if(A>0&&m>0&&A=0&&(n=e[s]),this.Hy(u,A,m,t,i,n,a,w,y)}}}};Hy=(t,i,e,s,n,r,h,o,d)=>{if(A.et){if(16&this.Vr[t][i][e])return;if(this.rm(t,i,e)!==A.SA)return}const w=this.Hr[t][i][e],y=this.Hr[t][i+1][e],m=this.Hr[t][i+1][e+1],p=this.Hr[t][i][e+1],_=w+y+m+p>>2,g=l.A.get(h);let I=i+(e<<7)+(h<<14)+1073741824|0;g.active||(I+=-2147483648),I|=0;const C=(d<<6)+o<<24>>24;if(o===f.A.cA.id)(!A.et||g.active||g.kd)&&(s?.BA(g.la(f.A.cA.id,d,w,y,m,p,-1),t,i,e,_,I,C),g.wd&&g.active&&r?.Wy(i,e),-1!==g.al&&n.UA(new a.A(h,t,3,i,e,c.A.Lo[g.al],!0)));else if(o===f.A.fd.id||o===f.A.dA.id){const l=g.la(f.A.fd.id,d,w,y,m,p,-1);if(l){let n,r,h=0;if(o===f.A.dA.id&&(h+=256),d===u.A.Vy||d===u.A.Ky?(n=g.length,r=g.width):(n=g.width,r=g.length),s?.Hy(t,i,e,_,l,null,I,C,n,r,h)&&g.bd)for(let s=0;s<=n;s++)for(let n=0;n<=r;n++){let r=l.gm/4|0;r>30&&(r=30),r>this.jA[t][i+s][e+n]&&(this.jA[t][i+s][e+n]=r<<24>>24)}}g.wd&&r?.Hy(i,e,g.width,g.length,d,g.yd),-1!==g.al&&n.UA(new a.A(h,t,2,i,e,c.A.Lo[g.al],!0))}else if(o>=f.A.wA.id)s?.Hy(t,i,e,_,g.la(o,d,w,y,m,p,-1),null,I,C,1,1,0),o>=f.A.wA.id&&o<=f.A._A.id&&o!==f.A.yA.id&&t>0&&(this.tm[t][i][e]|=2340),g.wd&&r?.Hy(i,e,g.width,g.length,d,g.yd),-1!==g.al&&n.UA(new a.A(h,t,2,i,e,c.A.Lo[g.al],!0));else if(o===f.A.zy.id)s?.jy(t,i,e,_,A.vA[d],0,g.la(f.A.zy.id,d,w,y,m,p,-1),null,I,C),d===u.A.Yd?(g.bd&&(this.jA[t][i][e]=50,this.jA[t][i][e+1]=50),g.Hu&&(this.tm[t][i][e]|=585)):d===u.A.Vy?(g.bd&&(this.jA[t][i][e+1]=50,this.jA[t][i+1][e+1]=50),g.Hu&&(this.tm[t][i][e+1]|=1170)):d===u.A.Zy?(g.bd&&(this.jA[t][i+1][e]=50,this.jA[t][i+1][e+1]=50),g.Hu&&(this.tm[t][i+1][e]|=585)):d===u.A.Ky&&(g.bd&&(this.jA[t][i][e]=50,this.jA[t][i+1][e]=50),g.Hu&&(this.tm[t][i][e]|=1170)),g.wd&&r?.jy(i,e,o,d,g.yd),-1!==g.al&&n.UA(new a.A(h,t,0,i,e,c.A.Lo[g.al],!0)),16!==g._d&&s?.Im(t,i,e,g._d);else if(o===f.A.qy.id)s?.jy(t,i,e,_,A.bA[d],0,g.la(f.A.qy.id,d,w,y,m,p,-1),null,I,C),g.bd&&(d===u.A.Yd?this.jA[t][i][e+1]=50:d===u.A.Vy?this.jA[t][i+1][e+1]=50:d===u.A.Zy?this.jA[t][i+1][e]=50:d===u.A.Ky&&(this.jA[t][i][e]=50)),g.wd&&r?.jy(i,e,o,d,g.yd),-1!==g.al&&n.UA(new a.A(h,t,0,i,e,c.A.Lo[g.al],!0));else if(o===f.A.Jy.id){const l=d+1&3;s?.jy(t,i,e,_,A.vA[d],A.vA[l],g.la(f.A.Jy.id,d+4,w,y,m,p,-1),g.la(f.A.Jy.id,l,w,y,m,p,-1),I,C),g.Hu&&(d===u.A.Yd?(this.tm[t][i][e]|=265,this.tm[t][i][e+1]|=1170):d===u.A.Vy?(this.tm[t][i][e+1]|=1170,this.tm[t][i+1][e]|=585):d===u.A.Zy?(this.tm[t][i+1][e]|=585,this.tm[t][i][e]|=1170):d===u.A.Ky&&(this.tm[t][i][e]|=1170,this.tm[t][i][e]|=585)),g.wd&&r?.jy(i,e,o,d,g.yd),-1!==g.al&&n.UA(new a.A(h,t,0,i,e,c.A.Lo[g.al],!0)),16!==g._d&&s?.Im(t,i,e,g._d)}else if(o===f.A.$y.id)s?.jy(t,i,e,_,A.bA[d],0,g.la(f.A.$y.id,d,w,y,m,p,-1),null,I,C),g.bd&&(d===u.A.Yd?this.jA[t][i][e+1]=50:d===u.A.Vy?this.jA[t][i+1][e+1]=50:d===u.A.Zy?this.jA[t][i+1][e]=50:d===u.A.Ky&&(this.jA[t][i][e]=50)),g.wd&&r?.jy(i,e,o,d,g.yd),-1!==g.al&&n.UA(new a.A(h,t,0,i,e,c.A.Lo[g.al],!0));else if(o===f.A.iA.id)s?.Hy(t,i,e,_,g.la(o,d,w,y,m,p,-1),null,I,C,1,1,0),g.wd&&r?.Hy(i,e,g.width,g.length,d,g.yd),-1!==g.al&&n.UA(new a.A(h,t,2,i,e,c.A.Lo[g.al],!0));else if(o===f.A.fA.id)s?.PA(t,i,e,_,0,0,I,g.la(f.A.fA.id,u.A.Yd,w,y,m,p,-1),C,512*d,A.vA[d]),-1!==g.al&&n.UA(new a.A(h,t,1,i,e,c.A.Lo[g.al],!0));else if(o===f.A.uA.id){let r=16;if(s){const n=s.GA(t,i,e);n>0&&(r=l.A.get(n>>14&32767)._d)}s?.PA(t,i,e,_,A.TA[d]*r,A.RA[d]*r,I,g.la(f.A.fA.id,u.A.Yd,w,y,m,p,-1),C,512*d,A.vA[d]),-1!==g.al&&n.UA(new a.A(h,t,1,i,e,c.A.Lo[g.al],!0))}else o===f.A.sA.id?(s?.PA(t,i,e,_,0,0,I,g.la(f.A.fA.id,u.A.Yd,w,y,m,p,-1),C,d,256),-1!==g.al&&n.UA(new a.A(h,t,1,i,e,c.A.Lo[g.al],!0))):o===f.A.nA.id?(s?.PA(t,i,e,_,0,0,I,g.la(f.A.fA.id,u.A.Yd,w,y,m,p,-1),C,d,512),-1!==g.al&&n.UA(new a.A(h,t,1,i,e,c.A.Lo[g.al],!0))):o===f.A.rA.id&&(s?.PA(t,i,e,_,0,0,I,g.la(f.A.fA.id,u.A.Yd,w,y,m,p,-1),C,d,768),-1!==g.al&&n.UA(new a.A(h,t,1,i,e,c.A.Lo[g.al],!0)))};rm=(t,i,e)=>8&this.Vr[t][i][e]?0:t<=0||!(2&this.Vr[1][i][e])?t:t-1}},3045:(t,i,e)=>{e.d(i,{A:()=>_});var s=e(4583),n=e(1161),r=e(3795),h=e(8256),o=e(670),l=e(9222),a=e(6855),c=e(7441),f=e(6666),u=e(5748),d=e(3479),w=e(8950),y=e(2771),A=e(5518),m=e(6169),p=e(3867);class _{static Cm=new p.Em(8,32,51,51,!1);static vm=new p.fe(100,null);static bm=new Int32Array(o.A.Dr);static Tm=new p.Rm(o.A.Dr,500,null);static Om=new p.fe(500,null);static Lm=new f.A;static Sm=0;static xm=0;static Mm=0;static km=0;static Dm=0;static Fm=0;static Nm=0;static Bm=0;static Um=0;static Pm=0;static Gm=0;static Wm=0;static Ym=0;static Hm=0;static Vm=0;static Km=0;static Xm=0;static jm=0;static zm=0;static Zm=0;static qm=0;static $m=0;static Jm=!1;static Qm=null;static tp=Uint8Array.of(19,55,38,155,255,110,137,205,76);static ip=Uint8Array.of(160,192,80,96,0,144,80,48,160);static ep=Uint8Array.of(76,8,137,4,0,1,38,2,19);static sp=Int8Array.of(0,0,2,0,0,2,1,1,0);static np=Int8Array.of(2,0,0,2,0,0,0,4,4);static rp=Int8Array.of(0,4,4,8,0,0,8,0,0);static hp=Int8Array.of(1,1,0,0,0,8,0,0,8);static op=Int8Array.of(53,-53,-53,53);static lp=Int8Array.of(-53,-53,53,53);static ap=Int8Array.of(-45,45,45,-45);static cp=Int8Array.of(45,45,-45,-45);static fp=[new Int8Array(16),Int8Array.of(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,0,0,0,1,1,0,0,1,1,1,0,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1),Int8Array.of(0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0),Int8Array.of(0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0),Int8Array.of(1,1,1,1,1,1,1,1,0,1,1,1,0,0,1,1),Int8Array.of(1,1,1,1,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,0,0,0,0,1,1,0,1,1,1,0,1,1,1),Int8Array.of(0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1)];static up=[Int8Array.of(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),Int8Array.of(12,8,4,0,13,9,5,1,14,10,6,2,15,11,7,3),Int8Array.of(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0),Int8Array.of(3,7,11,15,2,6,10,14,1,5,9,13,0,4,8,12)];static dp=Int32Array.of(41,39248,41,4643,41,41,41,41,41,41,41,41,41,41,41,43086,41,41,41,41,41,41,41,8602,41,28992,41,41,41,41,41,5056,41,41,41,41,41,41,41,41,41,41,41,41,41,41,3131,41,41,41);static wp=0;static kl=0;static Dl=0;static yp=-1;static Ap=-1;static et=!0;static init=(t,i,e,n,r)=>{this.xm=0,this.Mm=0,this.km=t,this.Dm=i,this.Fm=t/2|0,this.Nm=i/2|0;const h=new p.Em(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let i=0;i<2048;i+=64){this.Bm=s.A.sin[t],this.Um=s.A.cos[t],this.Pm=s.A.sin[i],this.Gm=s.A.cos[i];const o=(t-128)/32|0,l=i/64|0;for(let t=-26;t<=26;t++)for(let i=-26;i<=26;i++){const s=128*t,a=128*i;let c=!1;for(let t=-e;t<=n;t+=128)if(this.mp(s,a,r[o]+t)){c=!0;break}h[o][l][t+25+1][i+25+1]=c}}for(let t=0;t<8;t++)for(let i=0;i<32;i++)for(let e=-25;e<25;e++)for(let s=-25;s<25;s++){let n=!1;t:for(let r=-1;r<=1;r++)for(let o=-1;o<=1;o++){if(h[t][i][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t][(i+1)%31][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][i][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][(i+1)%31][e+r+25+1][s+o+25+1]){n=!0;break t}}this.Cm[t][i][e+25][s+25]=n}};static To=()=>{this.vm=null,this.bm=null,this.Tm=null,this.Lm=null,this.Cm=null,this.Om=null,this.Qm=null,console.log('World3D unloaded!')};static wm=(t,i,e,s,n,r,o,l)=>{_.Tm[t][_.bm[t]++]=new h.A(e/128|0,r/128|0,n/128|0,l/128|0,i,e,r,n,l,s,o)};static mp=(t,i,e)=>{const s=i*this.Pm+t*this.Gm>>16,n=i*this.Gm-t*this.Pm>>16,r=e*this.Bm+n*this.Um>>16,h=e*this.Um-n*this.Bm>>16;if(r<50||r>3500)return!1;const o=this.Fm+((s<<9)/r|0),l=this.Nm+((h<<9)/r|0);return o>=this.xm&&o<=this.km&&l>=this.Mm&&l<=this.Dm};pp;WA;YA;_p;gp;Ih;Ip;Cp;Ep;vp=0;bp=0;Tp=0;constructor(t,i,e,s){this.pp=e,this.WA=s,this.YA=i,this.gp=new p.Eh(e,s,i,null),this.Ip=new p.sm(e,s+1,i+1),this._p=t,this.Ih=new p.fe(5e3,null),this.Cp=new Int32Array(1e4),this.Ep=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this.bp=t;for(let i=0;i{const e=this.gp[0][t][i];for(let e=0;e<3;e++){this.gp[e][t][i]=this.gp[e+1][t][i];const s=this.gp[e][t][i];s&&s.level--}this.gp[0][t][i]||(this.gp[0][t][i]=new r.A(0,t,i));const s=this.gp[0][t][i];s&&(s.Op=e),this.gp[3][t][i]=null};fm=(t,i,e,s)=>{const n=this.gp[t][i][e];n&&(n.Lp=s)};om=(t,i,e,s,n,h,o,l,a,c,f,u,w,m,p,_,g,I,C,E)=>{if(s===A.A.hm){for(let s=t;s>=0;s--)this.gp[s][i][e]||(this.gp[s][i][e]=new r.A(s,i,e));const s=this.gp[t][i][e];s&&(s.Sp=new d.A(f,u,w,m,-1,C,!1))}else if(s===A.A.xp){for(let s=t;s>=0;s--)this.gp[s][i][e]||(this.gp[s][i][e]=new r.A(s,i,e));const s=this.gp[t][i][e];s&&(s.Sp=new d.A(p,_,g,I,h,E,o===l&&o===a&&o===c))}else{for(let s=t;s>=0;s--)this.gp[s][i][e]||(this.gp[s][i][e]=new r.A(s,i,e));const d=this.gp[t][i][e];d&&(d.Mp=new y.A(i,s,_,l,w,n,f,c,E,p,h,I,C,a,g,m,o,e,u))}};BA=(t,i,e,s,n,h,o)=>{this.gp[i][e][s]||(this.gp[i][e][s]=new r.A(i,e,s));const a=this.gp[i][e][s];a&&(a.kp=new l.A(n,128*e+64,128*s+64,t,h,o))};Dp=(t,i,e)=>{const s=this.gp[t][i][e];s&&(s.kp=null)};Fp=(t,i,e,s,n,h,o,l)=>{let a=0;const c=this.gp[s][t][i];if(c)for(let t=0;ta&&(a=e)}else this.gp[s][t][i]=new r.A(s,t,i);const f=this.gp[s][t][i];f&&(f.Up=new u.A(e,128*t+64,128*i+64,h,o,l,n,a))};Pp=(t,i,e)=>{const s=this.gp[t][i][e];s&&(s.Up=null)};jy=(t,i,e,s,n,h,o,l,c,f)=>{if(!o&&!l)return;for(let s=t;s>=0;s--)this.gp[s][i][e]||(this.gp[s][i][e]=new r.A(s,i,e));const u=this.gp[t][i][e];u&&(u.Gp=new a.A(s,128*i+64,128*e+64,n,h,o,l,c,f))};Qy=(t,i,e,s)=>{const n=this.gp[t][i][e];1===s&&n&&(n.Gp=null)};PA=(t,i,e,s,n,h,o,l,a,f,u)=>{if(!l)return;for(let s=t;s>=0;s--)this.gp[s][i][e]||(this.gp[s][i][e]=new r.A(s,i,e));const d=this.gp[t][i][e];d&&(d.Wp=new c.A(s,128*i+n+64,128*e+h+64,u,f,l,o,a))};Yp=(t,i,e)=>{const s=this.gp[t][i][e];s&&(s.Wp=null)};Im=(t,i,e,s)=>{const n=this.gp[t][i][e];if(!n)return;const r=n.Wp;if(!r)return;const h=128*i+64,o=128*e+64;r.x=h+((r.x-h)*s/16|0),r.z=o+((r.z-o)*s/16|0)};Hp=(t,i,e,s)=>{if(!s)return;const n=this.gp[t][i][e];if(!n)return;const r=n.Wp;r&&(r.model=s)};Vp=(t,i,e,s)=>{if(!s)return;const n=this.gp[t][i][e];if(!n)return;const r=n.kp;r&&(r.model=s)};Kp=(t,i,e,s)=>{if(!s)return;const n=this.gp[t][i][e];if(!n)return;const r=n.Gp;r&&(r.Xp=s)};jp=(t,i,e,s,n)=>{if(!s)return;const r=this.gp[e][t][i];if(!r)return;const h=r.Gp;h&&(h.Xp=s,h.zp=n)};Hy=(t,i,e,s,n,r,h,o,l,a,c)=>{if(!n&&!r)return!0;const f=128*i+64*l,u=128*e+64*a;return this.Zp(f,u,s,t,i,e,l,a,n,r,h,o,c,!1)};qp=(t,i,e,s,n,r,h,o,l,a)=>{if(!n&&!r)return!0;let c=i-l,f=s-l,u=i+l,d=s+l;return a&&(o>640&&o<1408&&(d+=128),o>1152&&o<1920&&(u+=128),(o>1664||o<384)&&(f-=128),o>128&&o<896&&(c-=128)),c=c/128|0,f=f/128|0,u=u/128|0,d=d/128|0,this.Zp(i,s,e,t,c,f,u+1-c,d-f+1,n,r,h,0,o,!0)};$p=(t,i,e,s,n,r,h,o,l,a,c,f)=>!l&&!a||this.Zp(i,s,e,t,n,r,h+1-n,o-r+1,l,a,c,0,f,!0);Xy=(t,i,e)=>{const s=this.gp[t][i][e];if(s)for(let t=0;t>29&3)&&n.Qp===i&&n.t_===e)return void this.i_(n)}};e_=(t,i,e,s)=>{if(!s)return;const n=this.gp[t][i][e];if(n)for(let t=0;t>29&3))return void(i.model=s)}};s_=()=>{for(let t=0;t{const s=this.gp[t][i][e];return s&&s.Gp?s.Gp.Jp:0};n_=(t,i,e)=>{const s=this.gp[t][e][i];return s&&s.Wp?s.Wp.Jp:0};r_=(t,i,e)=>{const s=this.gp[t][i][e];if(!s)return 0;for(let t=0;t>29&3)&&n.Qp===i&&n.t_===e)return n.Jp}return 0};h_=(t,i,e)=>{const s=this.gp[t][i][e];return s&&s.kp?s.kp.Jp:0};o_=(t,i,e,s)=>{const n=this.gp[t][i][e];if(n){if(n.Gp&&n.Gp.Jp===s)return 255&n.Gp.info;if(n.Wp&&n.Wp.Jp===s)return 255&n.Wp.info;if(n.kp&&n.kp.Jp===s)return 255&n.kp.info;for(let t=0;t{const r=i*(0|Math.sqrt(e*e+s*s+n*n))>>8;for(let i=0;i{if(i0){const n=this.gp[t][i+1][e-1];n&&n.kp&&n.kp.model&&n.kp.model.l_&&this.c_(s,n.kp.model,128,0,-128,!0)}};a_=(t,i,e,s,n,r)=>{let h=!0,o=i;const l=i+s,a=e-1,c=e+n;for(let f=t;f<=t+1;f++)if(f!==this.pp){for(let u=o;u<=l;u++)if(!(u<0||u>=this.WA))for(let o=a;o<=c;o++){if(o<0||o>=this.YA||h&&u=e||u===i))continue;const a=this.gp[f][u][o];if(!a)continue;const d=128*(u-i)+64*(1-s),w=128*(o-e)+64*(1-n),y=((this._p[f][u][o]+this._p[f][u+1][o]+this._p[f][u][o+1]+this._p[f][u+1][o+1])/4|0)-((this._p[t][i][e]+this._p[t][i+1][e]+this._p[t][i][e+1]+this._p[t][i+1][e+1])/4|0),A=a.Gp;A&&A.Xp&&A.Xp.l_&&this.c_(r,A.Xp,d,y,w,h),A&&A.zp&&A.zp.l_&&this.c_(r,A.zp,d,y,w,h);for(let t=0;t{this.Tp++;let h=0;const o=i.Bd,l=i.Nd;if(t.l_&&t.y_)for(let r=0;ri.A_)continue;const u=t.Bd[r]-e;if(ui.p_)continue;const d=t.Ud[r]-n;if(di.g_)continue;if(i.l_&&i.y_)for(let t=0;t{const h=this.gp[t][i][e];if(!h)return;const o=h.Sp;if(o){const t=o.color;if(0!==t)for(let i=0;i<4;i++)s[n]=t,s[n+1]=t,s[n+2]=t,s[n+3]=t,n+=r;return}const l=h.Mp;if(!l)return;const a=l.shape,c=l.angle,f=l.R_,u=l.O_,d=_.fp[a],w=_.up[c];let y=0;if(0===f)for(let t=0;t<4;t++)0!==d[w[y++]]&&(s[n]=u),0!==d[w[y++]]&&(s[n+1]=u),0!==d[w[y++]]&&(s[n+2]=u),0!==d[w[y++]]&&(s[n+3]=u),n+=r;else for(let t=0;t<4;t++)s[n]=0===d[w[y++]]?f:u,s[n+1]=0===d[w[y++]]?f:u,s[n+2]=0===d[w[y++]]?f:u,s[n+3]=0===d[w[y++]]?f:u,n+=r};click=(t,i)=>{_.Jm=!0,_.kl=t,_.Dl=i,_.yp=-1,_.Ap=-1};draw=(t,i,e,n,r,h,o)=>{t<0?t=0:t>=128*this.WA&&(t=128*this.WA-1),e<0?e=0:e>=128*this.YA&&(e=128*this.YA-1),_.Sm++,_.Bm=s.A.sin[h],_.Um=s.A.cos[h],_.Pm=s.A.sin[r],_.Gm=s.A.cos[r],_.Qm=_.Cm[(h-128)/32|0][r/64|0],_.Wm=t,_.Ym=i,_.Hm=e,_.Vm=t/128|0,_.Km=e/128|0,_.qm=n,_.Xm=_.Vm-25,_.Xm<0&&(_.Xm=0),_.zm=_.Km-25,_.zm<0&&(_.zm=0),_.jm=_.Vm+25,_.jm>this.WA&&(_.jm=this.WA),_.Zm=_.Km+25,_.Zm>this.YA&&(_.Zm=this.YA),this.L_(),_.$m=0;for(let t=this.bp;t=2e3)?(h.visible=!0,h.update=!0,h.S_=h.Np>0,_.$m++):(h.visible=!1,h.update=!1,h.x_=0))}}for(let t=this.bp;t=_.jm))for(let t=-25;t<=0;t++){const n=_.Km+t,r=_.Km-t;let h;if(e>=_.Xm&&(n>=_.zm&&(h=i[e][n],h&&h.visible&&this.M_(h,!0,o)),r<_.Zm&&(h=i[e][r],h&&h.visible&&this.M_(h,!0,o))),s<_.jm&&(n>=_.zm&&(h=i[s][n],h&&h.visible&&this.M_(h,!0,o)),r<_.Zm&&(h=i[s][r],h&&h.visible&&this.M_(h,!0,o))),0===_.$m)return void(_.Jm=!1)}}}for(let t=this.bp;t=_.jm))for(let t=-25;t<=0;t++){const n=_.Km+t,r=_.Km-t;let h;if(e>=_.Xm&&(n>=_.zm&&(h=i[e][n],h&&h.visible&&this.M_(h,!1,o)),r<_.Zm&&(h=i[e][r],h&&h.visible&&this.M_(h,!1,o))),s<_.jm&&(n>=_.zm&&(h=i[s][n],h&&h.visible&&this.M_(h,!1,o)),r<_.Zm&&(h=i[s][r],h&&h.visible&&this.M_(h,!1,o))),0===_.$m)return void(_.Jm=!1)}}}};Zp=(t,i,e,s,h,o,l,a,c,f,u,d,w,y)=>{if(!c&&!f)return!1;for(let t=h;t=this.WA||i>=this.YA)return!1;const e=this.gp[s][t][i];if(e&&e.Np>=5)return!1}const A=new n.A(s,e,t,i,c,f,w,h,h+l-1,o,o+a-1,u,d);for(let t=h;th&&(e|=1),to&&(e+=8),i=0;e--)this.gp[e][t][i]||(this.gp[e][t][i]=new r.A(e,t,i));const n=this.gp[s][t][i];n&&(n.Bp[n.Np]=A,n.k_[n.Np]=e,n.D_|=e,n.Np++)}return y&&(this.Ih[this.vp++]=A),!0};i_=t=>{for(let i=t.Qp;i<=t.u_;i++)for(let e=t.t_;e<=t.d_;e++){const s=this.gp[t.level][i][e];if(s){for(let i=0;i{const t=_.bm[_.qm],i=_.Tm[_.qm];_.wp=0;for(let e=0;e=0&&s<=50){n=t.N_+25-_.Km,n<0&&(n=0),r=t.YA+25-_.Km,r>50&&(r=50);let i=!1;for(;n<=r;)if(_.Qm&&_.Qm[s][n++]){i=!0;break}if(i){if(h=_.Wm-t.m_,h>32)t.mode=1;else{if(h>=-32)continue;t.mode=2,h=-h}t.B_=(t.__-_.Hm<<8)/h|0,t.U_=(t.g_-_.Hm<<8)/h|0,t.P_=(t.A_-_.Ym<<8)/h|0,t.G_=(t.jd-_.Ym<<8)/h|0,_.Om[_.wp++]=t}}}else if(2===t.type){if(s=t.N_+25-_.Km,s>=0&&s<=50){n=t.F_+25-_.Vm,n<0&&(n=0),r=t.WA+25-_.Vm,r>50&&(r=50);let i=!1;for(;n<=r;)if(_.Qm&&_.Qm[n++][s]){i=!0;break}if(i){if(h=_.Hm-t.__,h>32)t.mode=3;else{if(h>=-32)continue;t.mode=4,h=-h}t.W_=(t.m_-_.Wm<<8)/h|0,t.Y_=(t.p_-_.Wm<<8)/h|0,t.P_=(t.A_-_.Ym<<8)/h|0,t.G_=(t.jd-_.Ym<<8)/h|0,_.Om[_.wp++]=t}}}else if(4===t.type&&(s=t.A_-_.Ym,s>128&&(n=t.N_+25-_.Km,n<0&&(n=0),r=t.YA+25-_.Km,r>50&&(r=50),n<=r))){let i=t.F_+25-_.Vm;i<0&&(i=0),h=t.WA+25-_.Vm,h>50&&(h=50);let e=!1;t:for(let t=i;t<=h;t++)for(let i=n;i<=r;i++)if(_.Qm&&_.Qm[t][i]){e=!0;break t}e&&(t.mode=5,t.W_=(t.m_-_.Wm<<8)/s|0,t.Y_=(t.p_-_.Wm<<8)/s|0,t.B_=(t.__-_.Hm<<8)/s|0,t.U_=(t.g_-_.Hm<<8)/s|0,_.Om[_.wp++]=t)}}};M_=(t,i,e)=>{for(_.Lm.UA(t);;){let t;do{if(t=_.Lm.H_(),!t)return}while(!t.update);const s=t.x,n=t.z,r=t.level,h=t.V_,o=this.gp[r];if(t.visible){if(i){if(r>0){const t=this.gp[r-1][s][n];if(t&&t.update)continue}if(s<=_.Vm&&s>_.Xm){const i=o[s-1][n];if(i&&i.update&&(i.visible||!(1&t.D_)))continue}if(s>=_.Vm&&s<_.jm-1){const i=o[s+1][n];if(i&&i.update&&(i.visible||!(4&t.D_)))continue}if(n<=_.Km&&n>_.zm){const i=o[s][n-1];if(i&&i.update&&(i.visible||!(8&t.D_)))continue}if(n>=_.Km&&n<_.Zm-1){const i=o[s][n+1];if(i&&i.update&&(i.visible||!(2&t.D_)))continue}}else i=!0;if(t.visible=!1,t.Op){const i=t.Op;i.Sp?this.K_(0,s,n)||this.X_(i.Sp,0,s,n,_.Bm,_.Um,_.Pm,_.Gm):i.Mp&&!this.K_(0,s,n)&&this.j_(s,n,i.Mp,_.Bm,_.Um,_.Pm,_.Gm);const r=i.Gp;r&&r.Xp?.draw(0,_.Bm,_.Um,_.Pm,_.Gm,r.x-_.Wm,r.y-_.Ym,r.z-_.Hm,r.Jp);for(let t=0;tn&&(a+=6),c=_.tp[a],t.q_=_.ep[a]),f&&(f.J_&_.ip[a]?16===f.J_?(t.x_=3,t.Q_=_.sp[a],t.tg=3-t.Q_):32===f.J_?(t.x_=6,t.Q_=_.np[a],t.tg=6-t.Q_):64===f.J_?(t.x_=12,t.Q_=_.rp[a],t.tg=12-t.Q_):(t.x_=9,t.Q_=_.hp[a],t.tg=9-t.Q_):t.x_=0,f.J_&c&&!this.ig(h,s,n,f.J_)&&f.Xp?.draw(0,_.Bm,_.Um,_.Pm,_.Gm,f.x-_.Wm,f.y-_.Ym,f.z-_.Hm,f.Jp),f.eg&c&&!this.ig(h,s,n,f.eg)&&f.zp?.draw(0,_.Bm,_.Um,_.Pm,_.Gm,f.x-_.Wm,f.y-_.Ym,f.z-_.Hm,f.Jp)),u&&!this.visible(h,s,n,u.model.jd))if(u.type&c)u.model.draw(u.angle,_.Bm,_.Um,_.Pm,_.Gm,u.x-_.Wm,u.y-_.Ym,u.z-_.Hm,u.Jp);else if(768&u.type){const t=u.x-_.Wm,i=u.y-_.Ym,e=u.z-_.Hm,s=u.angle;let n,r;if(n=s===m.A.Vy||s===m.A.Zy?-t:t,r=s===m.A.Zy||s===m.A.Ky?-e:e,256&u.type&&rn){const n=t+_.ap[s],r=e+_.cp[s];u.model.draw(512*s+1280&2047,_.Bm,_.Um,_.Pm,_.Gm,n,i,r,u.Jp)}}if(l){const i=t.kp;i&&i.model?.draw(0,_.Bm,_.Um,_.Pm,_.Gm,i.x-_.Wm,i.y-_.Ym,i.z-_.Hm,i.Jp);const e=t.Up;e&&0===e.offset&&(e.sg&&e.sg.draw(0,_.Bm,_.Um,_.Pm,_.Gm,e.x-_.Wm,e.y-_.Ym,e.z-_.Hm,e.Jp),e.ng&&e.ng.draw(0,_.Bm,_.Um,_.Pm,_.Gm,e.x-_.Wm,e.y-_.Ym,e.z-_.Hm,e.Jp),e.rg&&e.rg.draw(0,_.Bm,_.Um,_.Pm,_.Gm,e.x-_.Wm,e.y-_.Ym,e.z-_.Hm,e.Jp))}const d=t.D_;if(0!==d){if(s<_.Vm&&4&d){const t=o[s+1][n];t&&t.update&&_.Lm.UA(t)}if(n<_.Km&&2&d){const t=o[s][n+1];t&&t.update&&_.Lm.UA(t)}if(s>_.Vm&&1&d){const t=o[s-1][n];t&&t.update&&_.Lm.UA(t)}if(n>_.Km&&8&d){const t=o[s][n-1];t&&t.update&&_.Lm.UA(t)}}}if(0!==t.x_){let i=!0;for(let e=0;ei.Qp&&(r+=1),ei.t_&&(r+=8),ss&&(s=n);const h=_.Km-i.t_,l=i.d_-_.Km;i.hg=l>h?s+l:s+h}for(;;){let t=-50,i=-1;for(let e=0;et&&(t=s.hg,i=e))}if(-1===i)break;const l=_.vm[i];if(l){l.Sm=_.Sm;let t=l.model;t||(t=l.z_?.draw(e)??null),t&&!this.og(h,l.Qp,l.u_,l.t_,l.d_,t.jd)&&t.draw(l.Z_,_.Bm,_.Um,_.Pm,_.Gm,l.x-_.Wm,l.y-_.Ym,l.z-_.Hm,l.Jp);for(let t=l.Qp;t<=l.u_;t++)for(let i=l.t_;i<=l.d_;i++){const e=o[t][i];e&&(0!==e.x_?_.Lm.UA(e):t===s&&i===n||!e.update||_.Lm.UA(e))}}}if(t.S_)continue}if(!t.update||0!==t.x_)continue;if(s<=_.Vm&&s>_.Xm){const t=o[s-1][n];if(t&&t.update)continue}if(s>=_.Vm&&s<_.jm-1){const t=o[s+1][n];if(t&&t.update)continue}if(n<=_.Km&&n>_.zm){const t=o[s][n-1];if(t&&t.update)continue}if(n>=_.Km&&n<_.Zm-1){const t=o[s][n+1];if(t&&t.update)continue}t.update=!1,_.$m--;const l=t.Up;if(l&&0!==l.offset&&(l.sg&&l.sg.draw(0,_.Bm,_.Um,_.Pm,_.Gm,l.x-_.Wm,l.y-_.Ym-l.offset,l.z-_.Hm,l.Jp),l.ng&&l.ng.draw(0,_.Bm,_.Um,_.Pm,_.Gm,l.x-_.Wm,l.y-_.Ym-l.offset,l.z-_.Hm,l.Jp),l.rg&&l.rg.draw(0,_.Bm,_.Um,_.Pm,_.Gm,l.x-_.Wm,l.y-_.Ym-l.offset,l.z-_.Hm,l.Jp)),0!==t.q_){const i=t.Wp;if(i&&!this.visible(h,s,n,i.model.jd))if(i.type&t.q_)i.model.draw(i.angle,_.Bm,_.Um,_.Pm,_.Gm,i.x-_.Wm,i.y-_.Ym,i.z-_.Hm,i.Jp);else if(768&i.type){const t=i.x-_.Wm,e=i.y-_.Ym,s=i.z-_.Hm,n=i.angle;let r,h;if(r=n===m.A.Vy||n===m.A.Zy?-t:t,h=n===m.A.Zy||n===m.A.Ky?-s:s,256&i.type&&h>=r){const r=t+_.op[n],h=s+_.lp[n];i.model.draw(512*n+256,_.Bm,_.Um,_.Pm,_.Gm,r,e,h,i.Jp)}if(512&i.type&&h<=r){const r=t+_.ap[n],h=s+_.cp[n];i.model.draw(512*n+1280&2047,_.Bm,_.Um,_.Pm,_.Gm,r,e,h,i.Jp)}}const e=t.Gp;e&&(e.eg&t.q_&&!this.ig(h,s,n,e.eg)&&e.zp?.draw(0,_.Bm,_.Um,_.Pm,_.Gm,e.x-_.Wm,e.y-_.Ym,e.z-_.Hm,e.Jp),e.J_&t.q_&&!this.ig(h,s,n,e.J_)&&e.Xp?.draw(0,_.Bm,_.Um,_.Pm,_.Gm,e.x-_.Wm,e.y-_.Ym,e.z-_.Hm,e.Jp))}if(r_.Vm){const t=o[s-1][n];t&&t.update&&_.Lm.UA(t)}if(n>_.Km){const t=o[s][n-1];t&&t.update&&_.Lm.UA(t)}}};X_=(t,i,e,n,r,h,o,l)=>{let a,c,f,u,d=a=(e<<7)-_.Wm,y=c=(n<<7)-_.Hm,A=f=d+128,m=u=y+128,p=this._p[i][e][n]-_.Ym,g=this._p[i][e+1][n]-_.Ym,I=this._p[i][e+1][n+1]-_.Ym,C=this._p[i][e][n+1]-_.Ym,E=y*o+d*l>>16;if(y=y*l-d*o>>16,d=E,E=p*h-y*r>>16,y=p*r+y*h>>16,p=E,y<50)return;if(E=c*o+A*l>>16,c=c*l-A*o>>16,A=E,E=g*h-c*r>>16,c=g*r+c*h>>16,g=E,c<50)return;if(E=m*o+f*l>>16,m=m*l-f*o>>16,f=E,E=I*h-m*r>>16,m=I*r+m*h>>16,I=E,m<50)return;if(E=u*o+a*l>>16,u=u*l-a*o>>16,a=E,E=C*h-u*r>>16,u=C*r+u*h>>16,C=E,u<50)return;const v=s.A.ra+((d<<9)/y|0),b=s.A.ha+((p<<9)/y|0),T=s.A.ra+((A<<9)/c|0),R=s.A.ha+((g<<9)/c|0),O=s.A.ra+((f<<9)/m|0),L=s.A.ha+((I<<9)/m|0),S=s.A.ra+((a<<9)/u|0),x=s.A.ha+((C<<9)/u|0);if(s.A.alpha=0,(O-S)*(R-x)-(L-x)*(T-S)>0)if(s.A.lg=O<0||S<0||T<0||O>w.A.ag||S>w.A.ag||T>w.A.ag,_.Jm&&this.cg(_.kl,_.Dl,L,x,R,O,S,T)&&(_.yp=e,_.Ap=n),-1===t.fg)12345678!==t.ug&&s.A.dg(O,S,T,L,x,R,t.ug,t.wg,t.yg);else if(_.et){const i=_.dp[t.fg];s.A.dg(O,S,T,L,x,R,this.Ag(i,t.ug),this.Ag(i,t.wg),this.Ag(i,t.yg))}else t.flat?s.A.mg(O,S,T,L,x,R,t.ug,t.wg,t.yg,d,p,y,A,a,g,C,c,u,t.fg):s.A.mg(O,S,T,L,x,R,t.ug,t.wg,t.yg,f,I,m,a,A,C,g,u,c,t.fg);if(!((v-T)*(x-R)-(b-R)*(S-T)<=0))if(s.A.lg=v<0||T<0||S<0||v>w.A.ag||T>w.A.ag||S>w.A.ag,_.Jm&&this.cg(_.kl,_.Dl,b,R,x,v,T,S)&&(_.yp=e,_.Ap=n),-1!==t.fg){if(!_.et)return void s.A.mg(v,T,S,b,R,x,t.pg,t.yg,t.wg,d,p,y,A,a,g,C,c,u,t.fg);const i=_.dp[t.fg];s.A.dg(v,T,S,b,R,x,this.Ag(i,t.pg),this.Ag(i,t.yg),this.Ag(i,t.wg))}else 12345678!==t.pg&&s.A.dg(v,T,S,b,R,x,t.pg,t.yg,t.wg)};j_=(t,i,e,n,r,h,o)=>{let l=e.Bd.length;for(let t=0;t>16;if(a=a*o-i*h>>16,i=c,c=l*r-a*n>>16,a=l*n+a*r>>16,l=c,a<50)return;e._g&&(y.A.gg[t]=i,y.A.Ig[t]=l,y.A.Cg[t]=a),y.A.Eg[t]=s.A.ra+((i<<9)/a|0),y.A.vg[t]=s.A.ha+((l<<9)/a|0)}s.A.alpha=0,l=e.bg.length;for(let n=0;n0)if(s.A.lg=l<0||a<0||c<0||l>w.A.ag||a>w.A.ag||c>w.A.ag,_.Jm&&this.cg(_.kl,_.Dl,f,u,d,l,a,c)&&(_.yp=t,_.Ap=i),e._g&&-1!==e._g[n])if(_.et){const t=_.dp[e._g[n]];s.A.dg(l,a,c,f,u,d,this.Ag(t,e.Og[n]),this.Ag(t,e.Lg[n]),this.Ag(t,e.Sg[n]))}else e.flat?s.A.mg(l,a,c,f,u,d,e.Og[n],e.Lg[n],e.Sg[n],y.A.gg[0],y.A.Ig[0],y.A.Cg[0],y.A.gg[1],y.A.gg[3],y.A.Ig[1],y.A.Ig[3],y.A.Cg[1],y.A.Cg[3],e._g[n]):s.A.mg(l,a,c,f,u,d,e.Og[n],e.Lg[n],e.Sg[n],y.A.gg[r],y.A.Ig[r],y.A.Cg[r],y.A.gg[h],y.A.gg[o],y.A.Ig[h],y.A.Ig[o],y.A.Cg[h],y.A.Cg[o],e._g[n]);else 12345678!==e.Og[n]&&s.A.dg(l,a,c,f,u,d,e.Og[n],e.Lg[n],e.Sg[n])}};K_=(t,i,e)=>{const s=this.Ip[t][i][e];if(s===-_.Sm)return!1;if(s===_.Sm)return!0;{const s=i<<7,n=e<<7;return this.xg(s+1,this._p[t][i][e],n+1)&&this.xg(s+128-1,this._p[t][i+1][e],n+1)&&this.xg(s+128-1,this._p[t][i+1][e+1],n+128-1)&&this.xg(s+1,this._p[t][i][e+1],n+128-1)?(this.Ip[t][i][e]=_.Sm,!0):(this.Ip[t][i][e]=-_.Sm,!1)}};ig=(t,i,e,s)=>{if(!this.K_(t,i,e))return!1;const n=i<<7,r=e<<7,h=this._p[t][i][e]-1,o=h-120,l=h-230,a=h-238;if(s<16){if(1===s){if(n>_.Wm){if(!this.xg(n,h,r))return!1;if(!this.xg(n,h,r+128))return!1}if(t>0){if(!this.xg(n,o,r))return!1;if(!this.xg(n,o,r+128))return!1}return!!this.xg(n,l,r)&&this.xg(n,l,r+128)}if(2===s){if(r<_.Hm){if(!this.xg(n,h,r+128))return!1;if(!this.xg(n+128,h,r+128))return!1}if(t>0){if(!this.xg(n,o,r+128))return!1;if(!this.xg(n+128,o,r+128))return!1}return!!this.xg(n,l,r+128)&&this.xg(n+128,l,r+128)}if(4===s){if(n<_.Wm){if(!this.xg(n+128,h,r))return!1;if(!this.xg(n+128,h,r+128))return!1}if(t>0){if(!this.xg(n+128,o,r))return!1;if(!this.xg(n+128,o,r+128))return!1}return!!this.xg(n+128,l,r)&&this.xg(n+128,l,r+128)}if(8===s){if(r>_.Hm){if(!this.xg(n,h,r))return!1;if(!this.xg(n+128,h,r))return!1}if(t>0){if(!this.xg(n,o,r))return!1;if(!this.xg(n+128,o,r))return!1}return!!this.xg(n,l,r)&&this.xg(n+128,l,r)}}return!!this.xg(n+64,a,r+64)&&(16===s?this.xg(n,l,r+128):32===s?this.xg(n+128,l,r+128):64===s?this.xg(n+128,l,r):128===s?this.xg(n,l,r):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,i,e,s)=>{if(this.K_(t,i,e)){const n=i<<7,r=e<<7;return this.xg(n+1,this._p[t][i][e]-s,r+1)&&this.xg(n+128-1,this._p[t][i+1][e]-s,r+1)&&this.xg(n+128-1,this._p[t][i+1][e+1]-s,r+128-1)&&this.xg(n+1,this._p[t][i][e+1]-s,r+128-1)}return!1};og=(t,i,e,s,n,r)=>{let h,o;if(i!==e||s!==n){for(h=i;h<=e;h++)for(o=s;o<=n;o++)if(this.Ip[t][h][o]===-_.Sm)return!1;o=1+(i<<7);const l=2+(s<<7),a=this._p[t][i][s]-r;if(!this.xg(o,a,l))return!1;const c=(e<<7)-1;if(!this.xg(c,a,l))return!1;const f=(n<<7)-1;return!!this.xg(o,a,f)&&this.xg(c,a,f)}return!!this.K_(t,i,s)&&(h=i<<7,o=s<<7,this.xg(h+1,this._p[t][i][s]-r,o+1)&&this.xg(h+128-1,this._p[t][i+1][s]-r,o+1)&&this.xg(h+128-1,this._p[t][i+1][s+1]-r,o+128-1)&&this.xg(h+1,this._p[t][i][s+1]-r,o+128-1))};xg=(t,i,e)=>{for(let s=0;s<_.wp;s++){const n=_.Om[s];if(n)if(1===n.mode){const s=n.m_-t;if(s>0){const t=n.__+(n.B_*s>>8),r=n.g_+(n.U_*s>>8),h=n.A_+(n.P_*s>>8),o=n.jd+(n.G_*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(2===n.mode){const s=t-n.m_;if(s>0){const t=n.__+(n.B_*s>>8),r=n.g_+(n.U_*s>>8),h=n.A_+(n.P_*s>>8),o=n.jd+(n.G_*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(3===n.mode){const s=n.__-e;if(s>0){const e=n.m_+(n.W_*s>>8),r=n.p_+(n.Y_*s>>8),h=n.A_+(n.P_*s>>8),o=n.jd+(n.G_*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(4===n.mode){const s=e-n.__;if(s>0){const e=n.m_+(n.W_*s>>8),r=n.p_+(n.Y_*s>>8),h=n.A_+(n.P_*s>>8),o=n.jd+(n.G_*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(5===n.mode){const s=i-n.A_;if(s>0){const i=n.m_+(n.W_*s>>8),r=n.p_+(n.Y_*s>>8),h=n.__+(n.B_*s>>8),o=n.g_+(n.U_*s>>8);if(t>=i&&t<=r&&e>=h&&e<=o)return!0}}}return!1};cg=(t,i,e,s,n,r,h,o)=>{if(ie&&i>s&&i>n)return!1;if(tr&&t>h&&t>o)return!1;const l=(i-s)*(o-h)-(t-h)*(n-s);return((i-e)*(h-r)-(t-r)*(s-e))*l>0&&l*((i-n)*(r-o)-(t-o)*(e-n))>0};Ag=(t,i)=>((i=(127-i)*(127&t)/160|0)<2?i=2:i>126&&(i=126),(65408&t)+i)}},7121:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{}},4197:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{Mg;kg;Dg;Fg;index;qw;ul;fl;constructor(t,i,e,s,n,r,h){super(),this.Mg=i,this.kg=e,this.Dg=s,this.Fg=n,this.index=t,this.qw=r,h&&-1!==r.wl&&this.qw.delay?(this.ul=Math.random()*this.qw.dl|0,this.fl=Math.random()*this.qw.delay[this.ul]|0):(this.ul=-1,this.fl=0)}}},9418:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(7121),n=e(1312),r=e(3867);class h extends s.A{x=0;z=0;Z_=0;Ng=!1;size=1;Sa=-1;Bg=-1;Ug=-1;Pg=-1;Gg=-1;Wg=-1;Yg=-1;Hg=null;Vg=100;Kg=0;Xg=0;jg=0;zg=0;Zg=-1e3;qg=0;$g=0;Jg=-1;Qg=0;tI=0;iI=-1;eI=0;sI=0;nI=-1;rI=0;hI=0;oI=0;lI=0;aI=-1;cI=0;fI=0;uI=0;dI=0;wI=0;yI=0;AI=0;mI=0;pI=0;_I=0;gI=0;Sm=0;height=0;II=0;pathLength=0;CI=new Int32Array(10);EI=new Int32Array(10);vI=new r.fe(10,!1);bI=0;TI=-1;RI=-1;OI=-1;LI=-1;move(t,i,e){if(-1!==this.nI&&n.A.Lo[this.nI].priority<=1&&(this.nI=-1),!t){const t=i-this.CI[0],s=e-this.EI[0];if(t>=-8&&t<=8&&s>=-8&&s<=8){this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.CI[t]=this.CI[t-1],this.EI[t]=this.EI[t-1],this.vI[t]=this.vI[t-1];return this.CI[0]=i,this.EI[0]=e,void(this.vI[0]=!1)}}this.pathLength=0,this.bI=0,this.CI[0]=i,this.EI[0]=e,this.x=128*this.CI[0]+64*this.size,this.z=128*this.EI[0]+64*this.size}step(t,i){let e=this.CI[0],s=this.EI[0];0===i?(e--,s++):1===i?s++:2===i?(e++,s++):3===i?e--:4===i?e++:5===i?(e--,s--):6===i?s--:7===i&&(e++,s--),-1!==this.nI&&n.A.Lo[this.nI].priority<=1&&(this.nI=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.CI[t]=this.CI[t-1],this.EI[t]=this.EI[t-1],this.vI[t]=this.vI[t-1];this.CI[0]=e,this.EI[0]=s,this.vI[0]=t}}},8268:(t,i,e)=>{e.d(i,{A:()=>d});var s=e(9418),n=e(8665),r=e(2679),h=e(8738),o=e(1312),l=e(8317),a=e(1302),c=e(3819),f=e(3867),u=e(9298);class d extends s.A{static SI=1;static xI=2;static MI=4;static kI=8;static DI=16;static FI=32;static NI=64;static BI=128;static UI=256;static GI=512;static La=[u.A.WI,u.A.YI,u.A.HI,u.A.VI,u.A.KI,u.A.XI,u.A.jI,u.A.zI,u.A.ZI,u.A.qI,u.A.$I,u.A.JI,u.A.QI,u.A.tC,u.A.iC,u.A.eC];static Oa=[[u.A.sC,u.A.nC,u.A.rC,u.A.hC,u.A.oC,u.A.lC,u.A.aC,u.A.cC,u.A.fC,u.A.uC,u.A.dC,u.A.wC],[u.A.yC,u.A.AC,u.A.mC,u.A.pC,u.A._C,u.A.gC,u.A.IC,u.A.CC,u.A.EC,u.A.vC,u.A.bC,u.A.TC,u.A.RC,u.A.OC,u.A.LC,u.A.SC],[u.A.SC-1,u.A.yC+1,u.A.AC,u.A.mC,u.A.pC,u.A._C,u.A.gC,u.A.IC,u.A.CC,u.A.EC,u.A.vC,u.A.bC,u.A.TC,u.A.RC,u.A.OC,u.A.LC],[u.A.xC,u.A.MC,u.A.kC,u.A.DC,u.A.FC,u.A.NC],[u.A.BC,u.A.UC,u.A.PC,u.A.GC,u.A.WC,u.A.YC,u.A.HC,u.A.VC]];static So=new r.A(200);name=null;visible=!1;KC=0;XC=0;jC=new Uint16Array(12);zC=new Uint16Array(5);Ka=0;ZC=0n;y=0;qC=0;$C=0;JC=0;QC=0;tE=0;iE=null;F_=0;N_=0;WA=0;YA=0;et=!1;draw(t){if(!this.visible)return null;let i=this.sw();if(this.height=i.jd,i.ow=!0,this.et)return i;if(-1!==this.aI&&-1!==this.cI){const t=h.A.Lo[this.aI],e=n.A.ku(t.la(),!0,!t.pd,!1);e.translate(-this.dI,0,0),e.xa(),t.qw&&t.qw.frames&&e.Ma(t.qw.frames[this.cI]),e.Hd=null,e.Vd=null,128===t.iw&&128===t.ew||e.scale(t.iw,t.ew,t.iw),e.ka(t.gd+64,t.Id+850,-30,-50,-30,!0);const s=[i,e];i=n.A.eE(s,2)}if(this.iE&&(t>=this.$C&&(this.iE=null),t>=this.qC&&t=d.Oa[i].length)&&(e=0),this.zC[i]=e}this.Sa=t.mu,65535===this.Sa&&(this.Sa=-1),this.Bg=t.mu,65535===this.Bg&&(this.Bg=-1),this.Ug=t.mu,65535===this.Ug&&(this.Ug=-1),this.Pg=t.mu,65535===this.Pg&&(this.Pg=-1),this.Gg=t.mu,65535===this.Gg&&(this.Gg=-1),this.Wg=t.mu,65535===this.Wg&&(this.Wg=-1),this.Yg=t.mu,65535===this.Yg&&(this.Yg=-1),this.name=c.A.Ca(c.A.Ea(t.sE)),this.Ka=t._u,this.visible=!0,this.ZC=0n;for(let t=0;t<12;t++)this.ZC<<=0x4n,this.jC[t]>=256&&(this.ZC+=BigInt(this.jC[t])-256n);this.jC[0]>=256&&(this.ZC+=BigInt(this.jC[0])-256n>>4n),this.jC[1]>=256&&(this.ZC+=BigInt(this.jC[1])-256n>>8n);for(let t=0;t<5;t++)this.ZC<<=0x3n,this.ZC+=BigInt(this.zC[t]);this.ZC<<=0x1n,this.ZC+=BigInt(this.KC)}ed(){if(!this.visible)return null;const t=new f.fe(12,null);let i=0;for(let e=0;e<12;e++){const s=this.jC[e];if(s>=256&&s<512&&(t[i++]=l.A.Lo[s-256].ed()),s>=512){const e=a.A.get(s-512).ed(this.KC);e&&(t[i++]=e)}}const e=n.A.Ta(t,i);for(let t=0;t<5;t++)0!==this.zC[t]&&(e.Ra(d.Oa[t][0],d.Oa[t][this.zC[t]]),1===t&&e.Ra(d.La[0],d.La[this.zC[t]]));return e}sw(){let t=this.ZC,i=-1,e=-1,s=-1,r=-1;if(this.nI>=0&&0===this.oI){const n=o.A.Lo[this.nI];if(n.frames&&(i=n.frames[this.rI]),this.iI>=0&&this.iI!==this.Sa){const t=o.A.Lo[this.iI].frames;t&&(e=t[this.eI])}n.jw>=0&&(s=n.jw,t+=BigInt(s-this.jC[5])<<8n),n.zw>=0&&(r=n.zw,t+=BigInt(r-this.jC[3])<<16n)}else if(this.iI>=0){const t=o.A.Lo[this.iI].frames;t&&(i=t[this.eI])}let h=d.So?.get(t);if(!h){const i=new f.fe(12,null);let e=0;for(let t=0;t<12;t++){let n=this.jC[t];if(r>=0&&3===t&&(n=r),s>=0&&5===t&&(n=s),n>=256&&n<512){const t=l.A.Lo[n-256].la();t&&(i[e++]=t)}if(n>=512){const t=a.A.get(n-512).Vw(this.KC);t&&(i[e++]=t)}}h=n.A.Ta(i,e);for(let t=0;t<5;t++)0!==this.zC[t]&&(h.Ra(d.Oa[t][0],d.Oa[t][this.zC[t]]),1===t&&h.Ra(d.La[0],d.La[this.zC[t]]));h.xa(),h.ka(64,850,-30,-50,-30,!0),d.So?.put(t,h)}if(this.et)return h;const c=n.A.nw(h,!0);return-1!==i&&-1!==e?c.rw(i,e,o.A.Lo[this.nI].Kw):-1!==i&&c.Ma(i),c.hw(),c.Hd=null,c.Vd=null,c}}},9222:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;model;Jp;info;constructor(t,i,e,s,n,r){this.y=t,this.x=i,this.z=e,this.model=s,this.Jp=n,this.info=r}}},1161:(t,i,e)=>{e.d(i,{A:()=>s});class s{level;y;x;z;model;z_;Z_;Qp;u_;t_;d_;Jp;info;hg=0;Sm=0;constructor(t,i,e,s,n,r,h,o,l,a,c,f,u){this.level=t,this.y=i,this.x=e,this.z=s,this.model=n,this.z_=r,this.Z_=h,this.Qp=o,this.u_=l,this.t_=a,this.d_=c,this.Jp=f,this.info=u}}},5748:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;rg;ng;sg;Jp;offset;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.rg=s,this.ng=n,this.sg=r,this.Jp=h,this.offset=o}}},8256:(t,i,e)=>{e.d(i,{A:()=>s});class s{F_;WA;N_;YA;type;m_;p_;__;g_;A_;jd;mode=0;W_=0;Y_=0;B_=0;U_=0;P_=0;G_=0;constructor(t,i,e,s,n,r,h,o,l,a,c){this.F_=t,this.WA=i,this.N_=e,this.YA=s,this.type=n,this.m_=r,this.p_=h,this.__=o,this.g_=l,this.A_=a,this.jd=c}}},3795:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1982),n=e(3867);class r extends s.A{level;x;z;V_;Bp;k_;Sp=null;Mp=null;Gp=null;Wp=null;kp=null;Up=null;Op=null;Np=0;D_=0;Lp=0;visible=!1;update=!1;S_=!1;x_=0;Q_=0;tg=0;q_=0;constructor(t,i,e){super(),this.V_=this.level=t,this.x=i,this.z=e,this.Bp=new n.fe(5,null),this.k_=new Int32Array(5)}}},2771:(t,i,e)=>{e.d(i,{A:()=>s});class s{static Eg=new Int32Array(6);static vg=new Int32Array(6);static gg=new Int32Array(6);static Ig=new Int32Array(6);static Cg=new Int32Array(6);static nE=[Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,2,6),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,13,14)];static rE=[Int8Array.of(0,1,2,3,0,0,1,3),Int8Array.of(1,1,2,3,1,0,1,3),Int8Array.of(0,1,2,3,1,0,1,3),Int8Array.of(0,0,1,2,0,0,2,4,1,0,4,3),Int8Array.of(0,0,1,4,0,0,4,3,1,1,2,4),Int8Array.of(0,0,4,3,1,0,1,2,1,0,2,4),Int8Array.of(0,1,2,4,1,0,1,4,1,0,4,3),Int8Array.of(0,4,1,2,0,4,2,5,1,0,4,5,1,0,5,3),Int8Array.of(0,4,1,2,0,4,2,3,0,4,3,5,1,0,4,5),Int8Array.of(0,0,4,5,1,4,1,2,1,4,2,3,1,4,3,5),Int8Array.of(0,0,1,5,0,1,4,5,0,1,2,4,1,0,5,3,1,5,4,3,1,4,2,3),Int8Array.of(1,0,1,5,1,1,4,5,1,1,2,4,0,0,5,3,0,5,4,3,0,4,2,3),Int8Array.of(1,0,5,4,1,0,1,5,0,0,4,3,0,4,5,3,0,5,2,3,0,1,2,5)];static hE=128;static oE=this.hE/2|0;static lE=this.hE/4|0;static aE=3*this.hE/4|0;Bd;Pd;Ud;Og;Lg;Sg;bg;Tg;Rg;_g;flat;shape;angle;R_;O_;constructor(t,i,e,n,r,h,o,l,a,c,f,u,d,w,y,A,m,p,_){this.flat=!(m!==n||m!==w||m!==l),this.shape=i,this.angle=h,this.R_=d,this.O_=a;const g=s.nE[i],I=g.length;this.Bd=new Int32Array(I),this.Pd=new Int32Array(I),this.Ud=new Int32Array(I);const C=new Int32Array(I),E=new Int32Array(I),v=t*s.hE,b=p*s.hE;for(let t=0;t8&&I<=12&&(I=9+(I-h-9&3)),I>12&&I<=16&&(I=13+(I-h-13&3)),1===I?(i=v,a=b,f=m,d=o,p=c):2===I?(i=v+s.oE,a=b,f=m+n>>1,d=o+_>>1,p=c+e>>1):3===I?(i=v+s.hE,a=b,f=n,d=_,p=e):4===I?(i=v+s.hE,a=b+s.oE,f=n+w>>1,d=_+r>>1,p=e+y>>1):5===I?(i=v+s.hE,a=b+s.hE,f=w,d=r,p=y):6===I?(i=v+s.oE,a=b+s.hE,f=w+l>>1,d=r+A>>1,p=y+u>>1):7===I?(i=v,a=b+s.hE,f=l,d=A,p=u):8===I?(i=v,a=b+s.oE,f=l+m>>1,d=A+o>>1,p=u+c>>1):9===I?(i=v+s.oE,a=b+s.lE,f=m+n>>1,d=o+_>>1,p=c+e>>1):10===I?(i=v+s.aE,a=b+s.oE,f=n+w>>1,d=_+r>>1,p=e+y>>1):11===I?(i=v+s.oE,a=b+s.aE,f=w+l>>1,d=r+A>>1,p=y+u>>1):12===I?(i=v+s.lE,a=b+s.oE,f=l+m>>1,d=A+o>>1,p=u+c>>1):13===I?(i=v+s.lE,a=b+s.lE,f=m,d=o,p=c):14===I?(i=v+s.aE,a=b+s.lE,f=n,d=_,p=e):15===I?(i=v+s.aE,a=b+s.aE,f=w,d=r,p=y):(i=v+s.lE,a=b+s.aE,f=l,d=A,p=u),this.Bd[t]=i,this.Pd[t]=f,this.Ud[t]=a,C[t]=d,E[t]=p}const T=s.rE[i],R=T.length/4|0;this.bg=new Int32Array(R),this.Tg=new Int32Array(R),this.Rg=new Int32Array(R),this.Og=new Int32Array(R),this.Lg=new Int32Array(R),this.Sg=new Int32Array(R),this._g=-1!==f?new Int32Array(R):null;let O=0;for(let t=0;t{e.d(i,{A:()=>s});class s{static hm=0;static xp=1;static cE=2;static fE=3;static uE=4;static dE=5;static oE=6;static lE=7;static aE=8;static wE=9;static yE=10;static AE=11}},3479:(t,i,e)=>{e.d(i,{A:()=>s});class s{pg;yg;ug;wg;fg;color;flat;constructor(t,i,e,s,n,r,h){this.pg=t,this.yg=i,this.ug=e,this.wg=s,this.fg=n,this.color=r,this.flat=h}}},6855:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;J_;eg;Xp;zp;Jp;info;constructor(t,i,e,s,n,r,h,o,l){this.y=t,this.x=i,this.z=e,this.J_=s,this.eg=n,this.Xp=r,this.zp=h,this.Jp=o,this.info=l}}},7441:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;type;angle;model;Jp;info;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.type=s,this.angle=n,this.model=r,this.Jp=h,this.info=o}}},7536:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n{mE;pE;constructor(t){this.pE=[],this.mE=t;for(let i=0;i{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{gE;IE;constructor(){super(),this.gE=this,this.IE=this}CE(){this.IE&&this.gE&&(this.IE.gE=this.gE,this.gE.IE=this.IE,this.gE=null,this.IE=null)}}},3819:(t,i,e)=>{e.d(i,{A:()=>s});class s{static EE=['_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9'];static vE=t=>{t=t.trim();let i=0n;for(let e=0;e=65&&s<=90?i+=BigInt(s+1-65):s>=97&&s<=122?i+=BigInt(s+1-97):s>=48&&s<=57&&(i+=BigInt(s+27-48))}return i};static Ea=t=>{if(t<0n||t>=6582952005840035281n)return'invalid_name';if(t%37n===0n)return'invalid_name';let i=0;const e=Array(12);for(;0n!==t;){const s=t;t/=37n,e[11-i++]=this.EE[Number(s-37n*t)]}return e.slice(12-i).join('')};static bE=t=>{const i=[...t.toLowerCase()];let e=!0;for(let t=0;t='a'&&s<='z'&&(i[t]=s.toUpperCase(),e=!1),'.'!==s&&'!'!==s||(e=!0)}return i.join('')};static TE=t=>{let i='';for(let e=0;e(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static Ca=t=>{if(0===t.length)return t;const i=[...t];for(let t=0;t='a'&&i[t+1]<='z'&&(i[t+1]=String.fromCharCode(i[t+1].charCodeAt(0)+'A'.charCodeAt(0)-97)));return i[0]>='a'&&i[0]<='z'&&(i[0]=String.fromCharCode(i[0].charCodeAt(0)+'A'.charCodeAt(0)-97)),i.join('')};static xu=t=>{const i=t.toUpperCase();let e=0n;for(let t=0;t>56n)&0xffffffffffffffn;return e}}},6666:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n{RE;cursor=null;constructor(){const t=new s.A;t.next=t,t._E=t,this.RE=t}UA(t){t._E&&t.dw(),t._E=this.RE._E,t.next=this.RE,t._E&&(t._E.next=t),t.next._E=t}OE(t){t._E&&t.dw(),t._E=this.RE,t.next=this.RE.next,t._E.next=t,t.next&&(t.next._E=t)}H_(){const t=this.RE.next;return t===this.RE?null:(t?.dw(),t)}head(){const t=this.RE.next;return t===this.RE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}LE(){const t=this.RE._E;return t===this.RE?(this.cursor=null,null):(this.cursor=t?._E||null,t)}next(){const t=this.cursor;return t===this.RE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}_E(){const t=this.cursor;return t===this.RE?(this.cursor=null,null):(this.cursor=t?._E||null,t)}clear(){for(;;){const t=this.RE.next;if(t===this.RE)return;t?.dw()}}}},1982:(t,i,e)=>{e.d(i,{A:()=>s});class s{key;next;_E;constructor(){this.key=0n,this.next=this,this._E=this}dw(){this._E&&this.next&&(this._E.next=this.next,this.next._E=this._E,this.next=null,this._E=null)}}},2679:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(2512),n=e(7536);class r{SE;xE;history;available;constructor(t){this.SE=t,this.available=t,this.xE=new n.A(1024),this.history=new s.A}get(t){const i=this.xE.get(t);return i&&this.history.push(i),i}put(t,i){if(0===this.available){const t=this.history.pop();t?.dw(),t?.CE()}else this.available--;this.xE.put(t,i),this.history.push(i)}clear(){const t=this.history.pop();t?(t.dw(),t.CE()):this.available=this.SE}}},2512:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n{head;constructor(){this.head=new s.A}push(t){t.IE&&t.CE(),t.IE=this.head.IE,t.gE=this.head,t.IE&&(t.IE.gE=t),t.gE.IE=t}pop(){const t=this.head.gE;return t===this.head?null:(t?.CE(),t)}}},8534:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(3867);class r{static Lo=[];static Qa=t=>{const i=new s.A(t.read('base_head.dat')),e=new s.A(t.read('base_type.dat')),h=new s.A(t.read('base_label.dat')),o=i.mu;i.gf+=2;for(let t=0;t{e.d(i,{A:()=>r});var s=e(8534),n=e(1069);class r{static Lo=[];static Qa=t=>{const i=new n.A(t.read('frame_head.dat')),e=new n.A(t.read('frame_tran1.dat')),h=new n.A(t.read('frame_tran2.dat')),o=new n.A(t.read('frame_del.dat')),l=i.mu;i.gf+=2;const a=new Int32Array(500),c=new Int32Array(500),f=new Int32Array(500),u=new Int32Array(500);for(let t=0;t0){if(0!==d.types[t])for(let i=t-1;i>y;i--)if(0===d.types[i]){a[A]=i,c[A]=0,f[A]=0,u[A]=0,A++;break}a[A]=t;let e=0;3===d.types[a[A]]&&(e=128),c[A]=1&i?h.kE:e,f[A]=2&i?h.kE:e,u[A]=4&i?h.kE:e,y=t,A++}}n.length=A,n.DE=new Int32Array(A),n.x=new Int32Array(A),n.y=new Int32Array(A),n.z=new Int32Array(A);for(let t=0;t{e.d(i,{Uc:()=>s,zo:()=>n,FE:()=>o,NE:()=>h,BE:()=>r});const s=document.getElementById('canvas'),n=s.getContext('2d',{willReadFrequently:!0}),r=document.createElement('canvas'),h=document.createElement('img'),o=r.getContext('2d',{willReadFrequently:!0})},9298:(t,i,e)=>{e.d(i,{A:()=>s});class s{static RED=16711680;static GREEN=65280;static BLUE=255;static Gl=16776960;static UE=65535;static am=16711935;static gl=16777215;static Pl=0;static PE=16748608;static GE=8388608;static WE=128;static YE=16756736;static HE=16740352;static VE=16723968;static KE=12648192;static XE=8453888;static jE=4259584;static zE=9179409;static ZE=6116423;static il=2301979;static el=5063219;static nl=7759444;static hl=3353893;static qE=8388736;static $E=13350793;static JE=Int32Array.of(s.Gl,s.RED,s.GREEN,s.UE,s.am,s.gl);static sC=6798;static nC=107;static rC=10283;static hC=16;static oC=4797;static lC=7744;static aC=5799;static cC=4634;static fC=33697;static uC=22433;static dC=2983;static wC=54193;static yC=8741;static AC=12;static mC=64030;static pC=43162;static _C=7735;static gC=8404;static IC=1701;static CC=38430;static EC=24094;static vC=10153;static bC=56621;static TC=4783;static RC=1341;static OC=16578;static LC=35003;static SC=25239;static WI=9104;static YI=10275;static HI=7595;static VI=3610;static KI=7975;static XI=8526;static jI=918;static zI=38802;static ZI=24466;static qI=10145;static $I=58654;static JI=5027;static QI=1457;static tC=16565;static iC=34991;static eC=25486;static xC=4626;static MC=11146;static kC=6439;static DC=12;static FC=4758;static NC=10270;static VC=4574;static BC=4550;static UC=4537;static PC=5681;static GC=5673;static WC=5790;static YC=6806;static HC=8076}},8950:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n extends s.A{static yw=new Int32Array;static Aw=0;static mw=0;static top=0;static bottom=0;static left=0;static right=0;static ag=0;static QE=0;static tv=0;static bind=(t,i,e)=>{this.yw=t,this.Aw=i,this.mw=e,this.Al(0,0,i,e)};static iv=()=>{this.left=0,this.top=0,this.right=this.Aw,this.bottom=this.mw,this.ag=this.right-1,this.QE=this.right/2|0};static Al=(t,i,e,s)=>{t<0&&(t=0),i<0&&(i=0),e>this.Aw&&(e=this.Aw),s>this.mw&&(s=this.mw),this.top=i,this.bottom=s,this.left=t,this.right=e,this.ag=this.right-1,this.QE=this.right/2|0,this.tv=this.bottom/2|0};static clear=()=>{const t=this.Aw*this.mw;for(let i=0;i{this.rl(t,i,n,e),this.rl(t,i+s-1,n,e),this.sl(t,i,n,s),this.sl(t+e-1,i,n,s)};static rl=(t,i,e,s)=>{if(i=this.bottom)return;tthis.right&&(s=this.right-t);const n=t+i*this.Aw;for(let t=0;t{if(t=this.right)return;ithis.bottom&&(s=this.bottom-i);const n=t+i*this.Aw;for(let t=0;t{const r=Math.abs(e-t),h=Math.abs(s-i),o=t=this.left&&t=this.top&&i-h&&(a-=h,t+=o),e{tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const r=this.Aw-e;let h=t+i*this.Aw;for(let t=-s;t<0;t++){for(let t=-e;t<0;t++)this.yw[h++]=n;h+=r}};static sv(t,i,e,s,n,r){tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const h=256-r,o=(n>>16&255)*r,l=(n>>8&255)*r,a=(255&n)*r,c=this.Aw-e;let f=t+i*this.Aw;for(let t=0;t>16&255)*h>>8<<16)+(l+(this.yw[f]>>8&255)*h>>8<<8)+(a+(255&this.yw[f])*h>>8);this.yw[f++]=t}f+=c}}static nv(t,i,e,s,n){const r=256-n,h=(s>>16&255)*n,o=(s>>8&255)*n,l=(255&s)*n;let a=i-e;a<0&&(a=0);let c=i+e;c>=this.mw&&(c=this.mw-1);for(let s=a;s<=c;s++){const n=s-i,a=0|Math.sqrt(e*e-n*n);let c=t-a;c<0&&(c=0);let f=t+a;f>=this.Aw&&(f=this.Aw-1);let u=c+s*this.Aw;for(let t=c;t<=f;t++){const t=(h+(this.yw[u]>>16&255)*r>>8<<16)+(o+(this.yw[u]>>8&255)*r>>8<<8)+(l+(255&this.yw[u])*r>>8);this.yw[u++]=t}}}static rv=(t,i,e)=>{t=this.right||i=this.bottom||(this.yw[t+i*this.Aw]=e)}}},4583:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(8950),n=e(1673),r=e(3867);class h extends s.A{static et=!1;static hv=new Int32Array(512);static ov=new Int32Array(2048);static sin=new Int32Array(2048);static cos=new Int32Array(2048);static palette=new Int32Array(65536);static lv=new r.fe(50,null);static av=0;static ww=new Int32Array;static ra=0;static ha=0;static pw=!0;static lg=!1;static alpha=0;static cv=null;static fv=new r.fe(50,null);static uv=0;static Sm=0;static dv=new Int32Array(50);static wv=new r.fe(50,null);static yv=!1;static Av=new r.fe(50,!1);static mv=new Int32Array(50);static{for(let t=1;t<512;t++)this.hv[t]=32768/t|0;for(let t=1;t<2048;t++)this.ov[t]=65536/t|0;for(let t=0;t<2048;t++)this.sin[t]=65536*Math.sin(.0030679615757712823*t)|0,this.cos[t]=65536*Math.cos(.0030679615757712823*t)|0}static To=()=>{this.hv=null,this.hv=null,this.sin=null,this.cos=null,this.ww=null,this.lv=null,this.Av=null,this.mv=null,this.cv=null,this.fv=null,this.dv=null,this.palette=null,this.wv=null,console.log('Draw3D unloaded!')};static nc=()=>{this.ww=new Int32Array(this.mw);for(let t=0;t{this.ww=new Int32Array(i);for(let e=0;e{this.cv=null,this.fv.fill(null)};static qa=t=>{this.av=0;for(let i=0;i<50;i++)try{this.lv[i]=n.A.Za(t,i.toString()),this.et&&128===this.lv[i]?.Nl?this.lv[i]?.gv():this.lv[i]?.Ow(),this.av++}catch(t){}};static lm=t=>{if(0!==this.mv[t])return this.mv[t];const i=this.wv[t];if(!i)return 0;let e=0,s=0,n=0;const r=i.length;for(let t=0;t>16&255,s+=i[t]>>8&255,n+=255&i[t];let h=(e/r<<16)+(s/r<<8)+(n/r|0);return h=this.Iv(h,1.4),0===h&&(h=1),this.mv[t]=h,h};static $a=t=>{const i=t+.03*Math.random()-.015;let e=0;for(let t=0;t<512;t++){const s=(t/8|0)/64+.0078125,n=(7&t)/8+.0625;for(let t=0;t<128;t++){const r=t/128;let h=r,o=r,l=r;if(0!==n){let t;t=r<.5?r*(n+1):r+n-r*n;const i=2*r-t;let e=s+.3333333333333333;e>1&&e--;let a=s-.3333333333333333;a<0&&a++,h=6*e<1?i+6*(t-i)*e:2*e<1?t:3*e<2?i+(t-i)*(.6666666666666666-e)*6:i,o=6*s<1?i+6*(t-i)*s:2*s<1?t:3*s<2?i+(t-i)*(.6666666666666666-s)*6:i,l=6*a<1?i+6*(t-i)*a:2*a<1?t:3*a<2?i+(t-i)*(.6666666666666666-a)*6:i}const a=((256*h|0)<<16)+((256*o|0)<<8)+(256*l|0);this.palette[e++]=this.Iv(a,i)}}for(let t=0;t<50;t++){const e=this.lv[t];if(!e)continue;const s=e.palette;this.wv[t]=new Int32Array(s.length);for(let e=0;e{const e=(t>>16)/256,s=(t>>8&255)/256,n=(255&t)/256;return((256*Math.pow(e,i)|0)<<16)+((256*Math.pow(s,i)|0)<<8)+(256*Math.pow(n,i)|0)};static Ja=t=>{this.cv||(this.uv=t,this.et?this.cv=new r.Xr(t,16384):this.cv=new r.Xr(t,65536),this.fv.fill(null))};static dg=(t,i,e,s,n,r,h,o,l)=>{let a=0,c=0;n!==s&&(a=(i-t<<16)/(n-s)|0,c=(o-h<<15)/(n-s)|0);let f=0,u=0;r!==n&&(f=(e-i<<16)/(r-n)|0,u=(l-o<<15)/(r-n)|0);let d=0,w=0;if(r!==s&&(d=(t-e<<16)/(s-r)|0,w=(h-l<<15)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),nf)for(r-=n,n-=s,s=this.ww[s];;){if(--n<0)for(;;){if(--r<0)return;this.Ev(e>>16,i>>16,l>>7,o>>7,this.yw,s,0),e+=d,i+=f,l+=w,o+=u,s+=this.Aw}this.Ev(e>>16,t>>16,l>>7,h>>7,this.yw,s,0),e+=d,t+=a,l+=w,h+=c,s+=this.Aw}else for(r-=n,n-=s,s=this.ww[s];;){if(--n<0)for(;;){if(--r<0)return;this.Ev(i>>16,e>>16,o>>7,l>>7,this.yw,s,0),e+=d,i+=f,l+=w,o+=u,s+=this.Aw}this.Ev(t>>16,e>>16,h>>7,l>>7,this.yw,s,0),e+=d,t+=a,l+=w,h+=c,s+=this.Aw}else if(i=t<<=16,o=h<<=15,s<0&&(i-=d*s,t-=a*s,o-=w*s,h-=c*s,s=0),e<<=16,l<<=15,r<0&&(e-=f*r,l-=u*r,r=0),s!==r&&da)for(n-=r,r-=s,s=this.ww[s];;){if(--r<0)for(;;){if(--n<0)return;this.Ev(e>>16,t>>16,l>>7,h>>7,this.yw,s,0),e+=f,t+=a,l+=u,h+=c,s+=this.Aw}this.Ev(i>>16,t>>16,o>>7,h>>7,this.yw,s,0),i+=d,t+=a,o+=w,h+=c,s+=this.Aw}else for(n-=r,r-=s,s=this.ww[s];;){if(--r<0)for(;;){if(--n<0)return;this.Ev(t>>16,e>>16,h>>7,l>>7,this.yw,s,0),e+=f,t+=a,l+=u,h+=c,s+=this.Aw}this.Ev(t>>16,i>>16,h>>7,o>>7,this.yw,s,0),i+=d,t+=a,o+=w,h+=c,s+=this.Aw}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),rd)for(s-=r,r-=n,n=this.ww[n];;){if(--r<0)for(;;){if(--s<0)return;this.Ev(t>>16,e>>16,h>>7,l>>7,this.yw,n,0),t+=a,e+=d,h+=c,l+=w,n+=this.Aw}this.Ev(t>>16,i>>16,h>>7,o>>7,this.yw,n,0),t+=a,i+=f,h+=c,o+=u,n+=this.Aw}else for(s-=r,r-=n,n=this.ww[n];;){if(--r<0)for(;;){if(--s<0)return;this.Ev(e>>16,t>>16,l>>7,h>>7,this.yw,n,0),t+=a,e+=d,h+=c,l+=w,n+=this.Aw}this.Ev(i>>16,t>>16,o>>7,h>>7,this.yw,n,0),t+=a,i+=f,h+=c,o+=u,n+=this.Aw}else if(e=i<<=16,l=o<<=15,n<0&&(e-=a*n,i-=f*n,l-=c*n,o-=u*n,n=0),t<<=16,h<<=15,s<0&&(t-=d*s,h-=w*s,s=0),r-=s,s-=n,n=this.ww[n],a>16,i>>16,h>>7,o>>7,this.yw,n,0),t+=d,i+=f,h+=w,o+=u,n+=this.Aw}this.Ev(e>>16,i>>16,l>>7,o>>7,this.yw,n,0),e+=a,i+=f,l+=c,o+=u,n+=this.Aw}else for(;;){if(--s<0)for(;;){if(--r<0)return;this.Ev(i>>16,t>>16,o>>7,h>>7,this.yw,n,0),t+=d,i+=f,h+=w,o+=u,n+=this.Aw}this.Ev(i>>16,e>>16,o>>7,l>>7,this.yw,n,0),e+=a,i+=f,l+=c,o+=u,n+=this.Aw}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,o>>7,h>>7,this.yw,r,0),i+=f,t+=a,o+=u,h+=c,r+=this.Aw}this.Ev(i>>16,e>>16,o>>7,l>>7,this.yw,r,0),i+=f,e+=d,o+=u,l+=w,r+=this.Aw}else for(;;){if(--s<0)for(;;){if(--n<0)return;this.Ev(t>>16,i>>16,h>>7,o>>7,this.yw,r,0),i+=f,t+=a,o+=u,h+=c,r+=this.Aw}this.Ev(e>>16,i>>16,l>>7,o>>7,this.yw,r,0),i+=f,e+=d,o+=u,l+=w,r+=this.Aw}else if(t=e<<=16,h=l<<=15,r<0&&(t-=f*r,e-=d*r,h-=u*r,l-=w*r,r=0),i<<=16,o<<=15,n<0&&(i-=a*n,o-=c*n,n=0),s-=n,n-=r,r=this.ww[r],f>16,e>>16,o>>7,l>>7,this.yw,r,0),i+=a,e+=d,o+=c,l+=w,r+=this.Aw}this.Ev(t>>16,e>>16,h>>7,l>>7,this.yw,r,0),t+=f,e+=d,h+=u,l+=w,r+=this.Aw}else for(;;){if(--n<0)for(;;){if(--s<0)return;this.Ev(e>>16,i>>16,l>>7,o>>7,this.yw,r,0),i+=a,e+=d,o+=c,l+=w,r+=this.Aw}this.Ev(e>>16,t>>16,l>>7,h>>7,this.yw,r,0),t+=f,e+=d,h+=u,l+=w,r+=this.Aw}};static Ev=(t,i,e,s,n,r,h)=>{let o;if(this.pw){let l;if(this.lg){if(l=i-t>3?(s-e)/(i-t)|0:0,i>this.ag&&(i=this.ag),t<0&&(e-=t*l,t=0),t>=i)return;r+=t,h=i-t>>2,l<<=2}else{if(!(t>2)>0?(s-e)*this.hv[h]>>15:0}if(0===this.alpha)for(;;){if(--h<0){if((h=i-t&3)>0){o=this.palette[e>>8];do{n[r++]=o,h--}while(h>0);return}break}o=this.palette[e>>8],e+=l,n[r++]=o,n[r++]=o,n[r++]=o,n[r++]=o}else{const s=this.alpha,a=256-this.alpha;for(;;){if(--h<0){if((h=i-t&3)>0){o=this.palette[e>>8],o=((16711935&o)*a>>8&16711935)+((65280&o)*a>>8&65280);do{n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),h--}while(h>0)}break}o=this.palette[e>>8],e+=l,o=((16711935&o)*a>>8&16711935)+((65280&o)*a>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280)}}}else if(tthis.ag&&(i=this.ag),t<0&&(e-=t*l,t=0),t>=i))return;if(r+=t,h=i-t,0===this.alpha)do{n[r++]=this.palette[e>>8],e+=l,h--}while(h>0);else{const t=this.alpha,i=256-this.alpha;do{o=this.palette[e>>8],e+=l,o=((16711935&o)*i>>8&16711935)+((65280&o)*i>>8&65280),n[r++]=o+((16711935&n[r])*t>>8&16711935)+((65280&n[r])*t>>8&65280),h--}while(h>0)}}};static vv=(t,i,e,s,n,r,h)=>{let o=0;n!==s&&(o=(i-t<<16)/(n-s)|0);let l=0;r!==n&&(l=(e-i<<16)/(r-n)|0);let a=0;if(r!==s&&(a=(t-e<<16)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),nl)for(r-=n,n-=s,s=this.ww[s];;){if(--n<0)for(;;){if(--r<0)return;this.bv(e>>16,i>>16,this.yw,s,h),e+=a,i+=l,s+=this.Aw}this.bv(e>>16,t>>16,this.yw,s,h),e+=a,t+=o,s+=this.Aw}else for(r-=n,n-=s,s=this.ww[s];;){if(--n<0)for(;;){if(--r<0)return;this.bv(i>>16,e>>16,this.yw,s,h),e+=a,i+=l,s+=this.Aw}this.bv(t>>16,e>>16,this.yw,s,h),e+=a,t+=o,s+=this.Aw}else if(i=t<<=16,s<0&&(i-=a*s,t-=o*s,s=0),e<<=16,r<0&&(e-=l*r,r=0),s!==r&&ao)for(n-=r,r-=s,s=this.ww[s];;){if(--r<0)for(;;){if(--n<0)return;this.bv(e>>16,t>>16,this.yw,s,h),e+=l,t+=o,s+=this.Aw}this.bv(i>>16,t>>16,this.yw,s,h),i+=a,t+=o,s+=this.Aw}else for(n-=r,r-=s,s=this.ww[s];;){if(--r<0)for(;;){if(--n<0)return;this.bv(t>>16,e>>16,this.yw,s,h),e+=l,t+=o,s+=this.Aw}this.bv(t>>16,i>>16,this.yw,s,h),i+=a,t+=o,s+=this.Aw}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),ra)for(s-=r,r-=n,n=this.ww[n];;){if(--r<0)for(;;){if(--s<0)return;this.bv(t>>16,e>>16,this.yw,n,h),t+=o,e+=a,n+=this.Aw}this.bv(t>>16,i>>16,this.yw,n,h),t+=o,i+=l,n+=this.Aw}else for(s-=r,r-=n,n=this.ww[n];;){if(--r<0)for(;;){if(--s<0)return;this.bv(e>>16,t>>16,this.yw,n,h),t+=o,e+=a,n+=this.Aw}this.bv(i>>16,t>>16,this.yw,n,h),t+=o,i+=l,n+=this.Aw}else if(e=i<<=16,n<0&&(e-=o*n,i-=l*n,n=0),t<<=16,s<0&&(t-=a*s,s=0),o>16,i>>16,this.yw,n,h),t+=a,i+=l,n+=this.Aw}this.bv(e>>16,i>>16,this.yw,n,h),e+=o,i+=l,n+=this.Aw}else for(r-=s,s-=n,n=this.ww[n];;){if(--s<0)for(;;){if(--r<0)return;this.bv(i>>16,t>>16,this.yw,n,h),t+=a,i+=l,n+=this.Aw}this.bv(i>>16,e>>16,this.yw,n,h),e+=o,i+=l,n+=this.Aw}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,this.yw,r,h),i+=l,t+=o,r+=this.Aw}this.bv(i>>16,e>>16,this.yw,r,h),i+=l,e+=a,r+=this.Aw}else for(n-=s,s-=r,r=this.ww[r];;){if(--s<0)for(;;){if(--n<0)return;this.bv(t>>16,i>>16,this.yw,r,h),i+=l,t+=o,r+=this.Aw}this.bv(e>>16,i>>16,this.yw,r,h),i+=l,e+=a,r+=this.Aw}else if(t=e<<=16,r<0&&(t-=l*r,e-=a*r,r=0),i<<=16,n<0&&(i-=o*n,n=0),l>16,e>>16,this.yw,r,h),i+=o,e+=a,r+=this.Aw}this.bv(t>>16,e>>16,this.yw,r,h),t+=l,e+=a,r+=this.Aw}else for(s-=n,n-=r,r=this.ww[r];;){if(--n<0)for(;;){if(--s<0)return;this.bv(e>>16,i>>16,this.yw,r,h),i+=o,e+=a,r+=this.Aw}this.bv(e>>16,t>>16,this.yw,r,h),t+=l,e+=a,r+=this.Aw}};static mg=(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w,y,A,m,p)=>{const _=this.Tv(p);this.yv=!this.Av[p];const g=a-u,I=c-w,C=f-A,E=d-a,v=y-c,b=m-f;let T=E*c-v*a<<14;const R=v*f-b*c<<8,O=b*a-E*f<<5;let L=g*c-I*a<<14;const S=I*f-C*c<<8,x=C*a-g*f<<5;let M=I*E-g*v<<14;const k=C*v-I*b<<8,D=g*b-C*E<<5;let F=0,N=0;n!==s&&(F=(i-t<<16)/(n-s)|0,N=(o-h<<16)/(n-s)|0);let B=0,U=0;r!==n&&(B=(e-i<<16)/(r-n)|0,U=(l-o<<16)/(r-n)|0);let P=0,G=0;if(r!==s&&(P=(t-e<<16)/(s-r)|0,G=(h-l<<16)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),nB)for(r-=n,n-=s,s=this.ww[s];;){if(--n<0)for(;;){if(--r<0)return;this.Rv(e>>16,i>>16,this.yw,s,_,0,0,T,L,M,R,S,k,l>>8,o>>8),e+=P,i+=B,l+=G,o+=U,s+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.Rv(e>>16,t>>16,this.yw,s,_,0,0,T,L,M,R,S,k,l>>8,h>>8),e+=P,t+=F,l+=G,h+=N,s+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}else for(r-=n,n-=s,s=this.ww[s];;){if(--n<0)for(;;){if(--r<0)return;this.Rv(i>>16,e>>16,this.yw,s,_,0,0,T,L,M,R,S,k,o>>8,l>>8),e+=P,i+=B,l+=G,o+=U,s+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.Rv(t>>16,e>>16,this.yw,s,_,0,0,T,L,M,R,S,k,h>>8,l>>8),e+=P,t+=F,l+=G,h+=N,s+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}}else{i=t<<=16,o=h<<=16,s<0&&(i-=P*s,t-=F*s,o-=G*s,h-=N*s,s=0),e<<=16,l<<=16,r<0&&(e-=B*r,l-=U*r,r=0);const a=s-this.ha;if(T+=O*a,L+=x*a,M+=D*a,T|=0,L|=0,M|=0,(s===r||P>=F)&&(s!==r||B<=F))for(n-=r,r-=s,s=this.ww[s];;){if(--r<0)for(;;){if(--n<0)return;this.Rv(t>>16,e>>16,this.yw,s,_,0,0,T,L,M,R,S,k,h>>8,l>>8),e+=B,t+=F,l+=U,h+=N,s+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.Rv(t>>16,i>>16,this.yw,s,_,0,0,T,L,M,R,S,k,h>>8,o>>8),i+=P,t+=F,o+=G,h+=N,s+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}else for(n-=r,r-=s,s=this.ww[s];;){if(--r<0)for(;;){if(--n<0)return;this.Rv(e>>16,t>>16,this.yw,s,_,0,0,T,L,M,R,S,k,l>>8,h>>8),e+=B,t+=F,l+=U,h+=N,s+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.Rv(i>>16,t>>16,this.yw,s,_,0,0,T,L,M,R,S,k,o>>8,h>>8),i+=P,t+=F,o+=G,h+=N,s+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),rP)for(s-=r,r-=n,n=this.ww[n];;){if(--r<0)for(;;){if(--s<0)return;this.Rv(t>>16,e>>16,this.yw,n,_,0,0,T,L,M,R,S,k,h>>8,l>>8),t+=F,e+=P,h+=N,l+=G,n+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.Rv(t>>16,i>>16,this.yw,n,_,0,0,T,L,M,R,S,k,h>>8,o>>8),t+=F,i+=B,h+=N,o+=U,n+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}else for(s-=r,r-=n,n=this.ww[n];;){if(--r<0)for(;;){if(--s<0)return;this.Rv(e>>16,t>>16,this.yw,n,_,0,0,T,L,M,R,S,k,l>>8,h>>8),t+=F,e+=P,h+=N,l+=G,n+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.Rv(i>>16,t>>16,this.yw,n,_,0,0,T,L,M,R,S,k,o>>8,h>>8),t+=F,i+=B,h+=N,o+=U,n+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}}else{e=i<<=16,l=o<<=16,n<0&&(e-=F*n,i-=B*n,l-=N*n,o-=U*n,n=0),t<<=16,h<<=16,s<0&&(t-=P*s,h-=G*s,s=0);const a=n-this.ha;if(T+=O*a,L+=x*a,M+=D*a,T|=0,L|=0,M|=0,r-=s,s-=n,n=this.ww[n],F>16,i>>16,this.yw,n,_,0,0,T,L,M,R,S,k,h>>8,o>>8),t+=P,i+=B,h+=G,o+=U,n+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.Rv(e>>16,i>>16,this.yw,n,_,0,0,T,L,M,R,S,k,l>>8,o>>8),e+=F,i+=B,l+=N,o+=U,n+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}else for(;;){if(--s<0)for(;;){if(--r<0)return;this.Rv(i>>16,t>>16,this.yw,n,_,0,0,T,L,M,R,S,k,o>>8,h>>8),t+=P,i+=B,h+=G,o+=U,n+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.Rv(i>>16,e>>16,this.yw,n,_,0,0,T,L,M,R,S,k,o>>8,l>>8),e+=F,i+=B,l+=N,o+=U,n+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,this.yw,r,_,0,0,T,L,M,R,S,k,o>>8,h>>8),i+=B,t+=F,o+=U,h+=N,r+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.Rv(i>>16,e>>16,this.yw,r,_,0,0,T,L,M,R,S,k,o>>8,l>>8),i+=B,e+=P,o+=U,l+=G,r+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}else for(;;){if(--s<0)for(;;){if(--n<0)return;this.Rv(t>>16,i>>16,this.yw,r,_,0,0,T,L,M,R,S,k,h>>8,o>>8),i+=B,t+=F,o+=U,h+=N,r+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.Rv(e>>16,i>>16,this.yw,r,_,0,0,T,L,M,R,S,k,l>>8,o>>8),i+=B,e+=P,o+=U,l+=G,r+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}}else{t=e<<=16,h=l<<=16,r<0&&(t-=B*r,e-=P*r,h-=U*r,l-=G*r,r=0),i<<=16,o<<=16,n<0&&(i-=F*n,o-=N*n,n=0);const a=r-this.ha;if(T+=O*a,L+=x*a,M+=D*a,T|=0,L|=0,M|=0,s-=n,n-=r,r=this.ww[r],B>16,e>>16,this.yw,r,_,0,0,T,L,M,R,S,k,o>>8,l>>8),i+=F,e+=P,o+=N,l+=G,r+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.Rv(t>>16,e>>16,this.yw,r,_,0,0,T,L,M,R,S,k,h>>8,l>>8),t+=B,e+=P,h+=U,l+=G,r+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}else for(;;){if(--n<0)for(;;){if(--s<0)return;this.Rv(e>>16,i>>16,this.yw,r,_,0,0,T,L,M,R,S,k,l>>8,o>>8),i+=F,e+=P,o+=N,l+=G,r+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.Rv(e>>16,t>>16,this.yw,r,_,0,0,T,L,M,R,S,k,l>>8,h>>8),t+=B,e+=P,h+=U,l+=G,r+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}}};static Rv=(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w)=>{if(t>=i)return;let y,A,m,p,_,g,I,C,E;if(this.lg){if(y=(w-d)/(i-t)|0,i>this.ag&&(i=this.ag),t<0&&(d-=t*y,t=0),t>=i)return;A=i-t>>3,y<<=12}else i-t>7?(A=i-t>>3,y=(w-d)*this.hv[A]>>6):(A=0,y=0);if(d<<=9,s+=t,this.et&&n)if(m=0,p=0,g=t-this.ra,o+=(c>>3)*g,l+=(f>>3)*g,a+=(u>>3)*g,o|=0,l|=0,_=(a|=0)>>12,0!==_&&(h=l/_|0,(r=o/_|0)<0?r=0:r>4032&&(r=4032)),o+=c,l+=f,a+=u,o|=0,l|=0,_=(a|=0)>>12,0!==_&&(m=o/_|0,p=l/_|0,m<7?m=7:m>4032&&(m=4032)),I=m-r>>3,C=p-h>>3,r+=d>>3&786432,E=d>>23,this.yv){for(;A-- >0;)e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=I,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=I,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=I,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=I,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=I,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=I,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=I,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r=m,h=p,o+=c,l+=f,_=(a+=u)>>12,0!==_&&(m=o/_|0,p=l/_|0,m<7?m=7:m>4032&&(m=4032)),I=m-r>>3,C=p-h>>3,r+=(d+=y)>>3&786432,E=d>>23;for(A=i-t&7;A-- >0;)e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=I,h+=C}else{for(;A-- >0;){let t;0!=(t=n[(4032&h)+(r>>6)]>>>E)&&(e[s]=t),s+=1,0!=(t=n[(4032&(h+=C))+((r+=I)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=I)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=I)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=I)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=I)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=I)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=I)>>6)]>>>E)&&(e[s]=t),s+=1,r=m,h=p,o+=c,l+=f,a+=u,o|=0,l|=0,_=(a|=0)>>12,0!==_&&(m=o/_|0,p=l/_|0,m<7?m=7:m>4032&&(m=4032)),I=m-r>>3,C=p-h>>3,r+=(d+=y)>>3&786432,E=d>>23}for(A=i-t&7;A-- >0;){let t;0!=(t=n[(4032&h)+(r>>6)]>>>E)&&(e[s]=t),s++,r+=I,h+=C}}else if(m=0,p=0,g=t-this.ra,o+=(c>>3)*g,l+=(f>>3)*g,a+=(u>>3)*g,o|=0,l|=0,_=(a|=0)>>14,0!==_&&(h=l/_|0,(r=o/_|0)<0?r=0:r>16256&&(r=16256)),o+=c,l+=f,a+=u,o|=0,l|=0,_=(a|=0)>>14,0!==_&&(m=o/_|0,p=l/_|0,m<7?m=7:m>16256&&(m=16256)),I=m-r>>3,C=p-h>>3,r+=6291456&d,E=d>>23,this.yv&&n){for(;A-- >0;)e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=I,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=I,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=I,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=I,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=I,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=I,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=I,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r=m,h=p,o+=c,l+=f,a+=u,o|=0,l|=0,_=(a|=0)>>14,0!==_&&(m=o/_|0,p=l/_|0,m<7?m=7:m>16256&&(m=16256)),I=m-r>>3,C=p-h>>3,r+=6291456&(d+=y),E=d>>23;for(A=i-t&7;A-- >0;)e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=I,h+=C}else{for(;A-- >0&&n;){let t;0!=(t=n[(16256&h)+(r>>7)]>>>E)&&(e[s]=t),s+=1,0!=(t=n[(16256&(h+=C))+((r+=I)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=I)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=I)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=I)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=I)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=I)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=I)>>7)]>>>E)&&(e[s]=t),s++,r=m,h=p,o+=c,l+=f,a+=u,o|=0,l|=0,_=(a|=0)>>14,0!==_&&(m=o/_|0,p=l/_|0,m<7?m=7:m>16256&&(m=16256)),I=m-r>>3,C=p-h>>3,r+=6291456&(d+=y),E=d>>23}for(A=i-t&7;A-- >0&&n;){let t;0!=(t=n[(16256&h)+(r>>7)]>>>E)&&(e[s]=t),s++,r+=I,h+=C}}};static bv=(t,i,e,s,n)=>{if(this.lg&&(i>this.ag&&(i=this.ag),t<0&&(t=0)),t>=i)return;s+=t;let r=i-t>>2;if(0===this.alpha)for(;;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;e[s++]=n}e[s++]=n,e[s++]=n,e[s++]=n,e[s++]=n}const h=this.alpha,o=256-this.alpha;for(n=((16711935&n)*o>>8&16711935)+((65280&n)*o>>8&65280);;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280)}e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280)}};static Cv=t=>{this.fv[t]&&this.cv&&(this.cv[this.uv++]=this.fv[t],this.fv[t]=null)};static Tv=t=>{if(this.dv[t]=this.Sm++,this.fv[t])return this.fv[t];let i;if(this.uv>0&&this.cv)i=this.cv[--this.uv],this.cv[this.uv]=null;else{let t=0,e=-1;for(let i=0;i>>3)&16316671,i[n+8192]=r-(r>>>2)&16316671,i[n+12288]=r-(r>>>2)-(r>>>3)&16316671}}else{if(64===e.width)for(let t=0;t<128;t++)for(let n=0;n<128;n++)i[n+(t<<7)]=s[e.yw[(n>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)i[t]=s[e.yw[t]];this.Av[t]=!1;for(let e=0;e<16384;e++){i[e]&=16316671;const s=i[e];0===s&&(this.Av[t]=!0),i[e+16384]=s-(s>>>3)&16316671,i[e+32768]=s-(s>>>2)&16316671,i[e+49152]=s-(s>>>2)-(s>>>3)&16316671}}return i}}},880:(t,i,e)=>{e.d(i,{r:()=>n});var s=e(7854);const n=async t=>{255!==t[0]&&(t[0]=255),URL.revokeObjectURL(s.NE.src),s.NE.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>s.NE.onload=()=>t())),s.FE.clearRect(0,0,s.BE.width,s.BE.height);const i=s.NE.naturalWidth,e=s.NE.naturalHeight;return s.BE.width=i,s.BE.height=e,s.FE.drawImage(s.NE,0,0),s.FE.getImageData(0,0,i,e)}},8665:(t,i,e)=>{e.d(i,{A:()=>f});var s=e(1069),n=e(8950),r=e(4583),h=e(6730),o=e(4474),l=e(3867);class a{Nd=0;C_=0;Ov=0;Lv=-1;Sv=-1;xv=-1;Mv=-1;kv=-1;Dv=-1;Fv=-1;Nv=-1;Bv=-1;Uv=0;Pv=-1;Gv=-1;Wv=-1;data=null}class c{x=0;y=0;z=0;w=0}class f extends o.A{static metadata=null;static head=null;static Yv=null;static Hv=null;static Vv=null;static Kv=null;static Xv=null;static jv=null;static zv=null;static Zv=null;static qv=null;static $v=null;static Jv=null;static Qv=null;static axis=null;static tb=new l.fe(4096,!1);static ib=new l.fe(4096,!1);static eb=new Int32Array(4096);static sb=new Int32Array(4096);static nb=new Int32Array(4096);static rb=new Int32Array(4096);static hb=new Int32Array(4096);static ob=new Int32Array(4096);static lb=new Int32Array(1500);static ab=new l.Xr(1500,512);static cb=new Int32Array(12);static fb=new l.Xr(12,2e3);static ub=new Int32Array(2e3);static wb=new Int32Array(2e3);static yb=new Int32Array(12);static Ab=new Int32Array(10);static mb=new Int32Array(10);static pb=new Int32Array(10);static gr=0;static _b=0;static Ir=0;static gb=!1;static kl=0;static Dl=0;static Ib=0;static Cb=new Int32Array(1e3);static Eb=!1;static Qa(t){try{f.head=new s.A(t.read('ob_head.dat')),f.Yv=new s.A(t.read('ob_face1.dat')),f.Hv=new s.A(t.read('ob_face2.dat')),f.Vv=new s.A(t.read('ob_face3.dat')),f.Kv=new s.A(t.read('ob_face4.dat')),f.Xv=new s.A(t.read('ob_face5.dat')),f.jv=new s.A(t.read('ob_point1.dat')),f.zv=new s.A(t.read('ob_point2.dat')),f.Zv=new s.A(t.read('ob_point3.dat')),f.qv=new s.A(t.read('ob_point4.dat')),f.$v=new s.A(t.read('ob_point5.dat')),f.Jv=new s.A(t.read('ob_vertex1.dat')),f.Qv=new s.A(t.read('ob_vertex2.dat')),f.axis=new s.A(t.read('ob_axis.dat')),f.head.gf=0,f.jv.gf=0,f.zv.gf=0,f.Zv.gf=0,f.qv.gf=0,f.Jv.gf=0,f.Qv.gf=0;const i=f.head.mu;f.metadata=new l.fe(i+100,null);let e=0,n=0,r=0,h=0,o=0,c=0,u=0;for(let t=0;t>7)<2?i=2:i>126&&(i=126),(65408&t)+i):(i<0?i=0:i>127&&(i=127),127-i)}static Fd=(t,i,e)=>{const s=t.Nd,n=t.C_,r=t.Ov;let h,o,a,u,d;if(i){h=new Int32Array(s);for(let i=0;i{const n=t.Nd,r=t.C_,h=t.Ov;let o,l,a,c,u;if(s)o=t.Bd,l=t.Pd,a=t.Ud;else{o=new Int32Array(n),l=new Int32Array(n),a=new Int32Array(n);for(let i=0;i{const e=t.Nd,s=t.C_,n=t.Ov,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e);for(let i=0;i{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,l=0,a=-1;for(let c=0;c{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,l=0,a=-1;for(let c=0;c{let o=-1;const l=t.Bd[i],a=t.Pd[i],c=t.Ud[i];for(let t=0;t{if(!f.metadata)throw new Error('cant loading model metadata!!!!!');const i=f.metadata[t];if(!i)throw console.log(`Error model:${t} not found!`),new Error('cant loading model metadata!!!!!');if(!(f.head&&f.Yv&&f.Hv&&f.Vv&&f.Kv&&f.Xv&&f.jv&&f.zv&&f.Zv&&f.qv&&f.$v&&f.Jv&&f.Qv&&f.axis))throw new Error('cant loading model!!!!!');const e=i.Nd,s=i.C_,n=i.Ov,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e),l=new Int32Array(s),a=new Int32Array(s),c=new Int32Array(s),u=new Int32Array(n),d=new Int32Array(n),w=new Int32Array(n);let y=null;i.kv>=0&&(y=new Int32Array(e));let A=null;i.Bv>=0&&(A=new Int32Array(s));let m=null,p=0;i.Uv>=0?m=new Int32Array(s):p=-i.Uv-1;let _=null;i.Pv>=0&&(_=new Int32Array(s));let g=null;i.Gv>=0&&(g=new Int32Array(s));const I=new Int32Array(s);f.jv.gf=i.Lv,f.zv.gf=i.Sv,f.Zv.gf=i.xv,f.qv.gf=i.Mv,f.$v.gf=i.kv;let C,E,v,b=0,T=0,R=0;for(let t=0;t{if(!f.metadata||!f.metadata[i])throw new Error('No model metadata');const e=f.metadata[i];if(e.data=t,!e.data.length)throw new Error('No model data');const n=e.Nd,r=e.C_,h=e.Ov,o=new Int32Array(n),l=new Int32Array(n),a=new Int32Array(n),c=new Int32Array(r),u=new Int32Array(r),d=new Int32Array(r),w=new Int32Array(h),y=new Int32Array(h),A=new Int32Array(h);let m=null;e.kv>=0&&(m=new Int32Array(n));let p=null;e.Bv>=0&&(p=new Int32Array(r));let _=null,g=0;e.Uv>=0?_=new Int32Array(r):g=-e.Uv-1;let I=null;e.Pv>=0&&(I=new Int32Array(r));let C=null;e.Gv>=0&&(C=new Int32Array(r));const E=new Int32Array(r),v=new s.A(e.data);v.gf=e.Lv;const b=new s.A(e.data);b.gf=e.Sv;const T=new s.A(e.data);T.gf=e.xv;const R=new s.A(e.data);R.gf=e.Mv;const O=new s.A(e.data);O.gf=e.kv;let L,S,x,M=0,k=0,D=0;for(let t=0;tthis.jd&&(this.jd=-e),e>this.A_&&(this.A_=e);const n=i*i+s*s;n>this.gm&&(this.gm=n)}this.gm=Math.sqrt(this.gm)+.99|0,this.Fb=Math.sqrt(this.gm*this.gm+this.jd*this.jd)+.99|0,this.Db=this.Fb+(Math.sqrt(this.gm*this.gm+this.A_*this.A_)+.99|0)}Gd(){this.jd=0,this.A_=0;for(let t=0;tthis.jd&&(this.jd=-i),i>this.A_&&(this.A_=i)}this.Fb=Math.sqrt(this.gm*this.gm+this.jd*this.jd)+.99|0,this.Db=this.Fb+(Math.sqrt(this.gm*this.gm+this.A_*this.A_)+.99|0)}xa(){if(this.Nb){const t=new Int32Array(256);let i=0;for(let e=0;ei&&(i=s)}this.Vd=new l.fe(i+1,null);for(let e=0;e<=i;e++)this.Vd[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;ei&&(i=s)}this.Hd=new l.fe(i+1,null);for(let e=0;e<=i;e++)this.Hd[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;el;)l=e[o++];r&&r.types&&s.x&&s.y&&s.z&&r.labels&&(i!==l||0===r.types[i])&&this.Wb(s.x[t],s.y[t],s.z[t],r.labels[i],r.types[i])}f.gr=0,f._b=0,f.Ir=0,o=0,l=e[o++];for(let t=0;tl;)l=e[o++];r&&r.types&&n.x&&n.y&&n.z&&r.labels&&(i===l||0===r.types[i])&&this.Wb(n.x[t],n.y[t],n.z[t],r.labels[i],r.types[i])}}else this.Ma(t)}Ma(t){if(!this.Vd||-1===t||!h.A.Lo[t])return;const i=h.A.Lo[t],e=i.ME;f.gr=0,f._b=0,f.Ir=0;for(let t=0;t>16;this.Ud[t]=this.Pd[t]*i+this.Ud[t]*e>>16,this.Pd[t]=s}}translate(t,i,e){for(let s=0;s>8;if(this.Tb&&this.Rb&&this.Ob||(this.Tb=new Int32Array(this.C_),this.Rb=new Int32Array(this.C_),this.Ob=new Int32Array(this.C_)),!this.l_){this.l_=new l.fe(this.Nd,null);for(let t=0;t8192||m>8192||p>8192||A<-8192||m<-8192||p<-8192;)A>>=1,m>>=1,p>>=1;let _=0|Math.sqrt(A*A+m*m+p*p);if(_<=0&&(_=1),A=256*A/_|0,m=256*m/_|0,p=256*p/_|0,this.I_&&1&this.I_[i]){const r=t+((e*A+s*m+n*p)/(h+(h/2|0))|0);this.Mu&&(this.Tb[i]=f.bb(this.Mu[i],r,this.I_[i]))}else{let t=this.l_[r];t&&(t.x+=A,t.y+=m,t.z+=p,t.w++),t=this.l_[o],t&&(t.x+=A,t.y+=m,t.z+=p,t.w++),t=this.l_[l],t&&(t.x+=A,t.y+=m,t.z+=p,t.w++)}}if(r)this.f_(t,h,e,s,n);else{this.y_=new l.fe(this.Nd,null);for(let t=0;t>16;for(let s=0;s>16,g=g*w-_*d>>16,_=p),0!==t&&(p=g*a-I*l>>16,I=g*l+I*a>>16,g=p),0!==i&&(p=I*c+_*u>>16,I=I*u-_*c>>16,_=p),_+=n,g+=h,I+=o,p=g*A-I*y>>16,I=g*y+I*A>>16,g=p,f.eb&&f.sb&&f.nb&&(f.nb[s]=I-m,f.eb[s]=r.A.ra+((_<<9)/I|0),f.sb[s]=r.A.ha+((g<<9)/I|0)),this.Ov>0&&f.rb&&f.hb&&f.ob&&(f.rb[s]=_,f.hb[s]=g,f.ob[s]=I)}try{this.Vb(!1,!1,0)}catch(t){}}draw(t,i,e,s,h,o,l,a,c){const u=a*h-o*s>>16,d=l*i+u*e>>16,w=this.gm*e>>16,y=d+w;if(y<=50||d>=3500)return;const A=a*s+o*h>>16;let m=A-this.gm<<9;if((m/y|0)>=n.A.QE)return;let p=A+this.gm<<9;if((p/y|0)<=-n.A.QE)return;const _=l*e-u*i>>16,g=this.gm*i>>16;let I=_+g<<9;if((I/y|0)<=-n.A.tv)return;let C=_-(g+(this.jd*e>>16))<<9;if((C/y|0)>=n.A.tv)return;let E=d-(w+(this.jd*i>>16))<=50,v=!1;if(c>0&&f.gb){let t=d-w;t<=50&&(t=50),A>0?(m=m/y|0,p=p/t|0):(p=p/y|0,m=m/t|0),_>0?(C=C/y|0,I=I/t|0):(I=I/y|0,C=C/t|0);const i=f.kl-r.A.ra,e=f.Dl-r.A.ha;i>m&&iC&&e>16,w=w*O-c*R>>16,c=r),c+=o,u+=l,w+=a,r=w*s+c*h>>16,w=w*h-c*s>>16,c=r,r=u*e-w*i>>16,w=u*i+w*e>>16,u=r,f.nb&&(f.nb[n]=w-d),w>=50&&f.eb&&f.sb?(f.eb[n]=b+((c<<9)/w|0),f.sb[n]=T+((u<<9)/w|0)):f.eb&&(f.eb[n]=-5e3,E=!0),(E||this.Ov>0)&&f.rb&&f.hb&&f.ob&&(f.rb[n]=c,f.hb[n]=u,f.ob[n]=w)}try{this.Vb(E,v,c)}catch(t){}}Vb(t,i,e,s=!1){f.Eb&&(this.Pb=-1,this.Gb=-1);for(let t=0;tn.A.ag||a>n.A.ag||c>n.A.ag),f.ab&&f.lb){const t=((y+A+m)/3|0)+this.Fb;f.ab[t][f.lb[t]++]=s,f.Eb&&this.Kb(f.kl,f.Dl,u,d,w,l,a,c)&&this.Gb=0;t--){const i=f.lb[t];if(!(i<=0)&&f.ab){const e=f.ab[t];for(let t=0;t=0;t--){const i=f.lb[t];if(i>0&&f.ab){const e=f.ab[t];for(let s=0;s0||f.cb[2]>0)&&(r=(f.yb[1]+f.yb[2])/(f.cb[1]+f.cb[2])|0);let h=0;f.cb&&f.yb&&(f.cb[3]>0||f.cb[4]>0)&&(h=(f.yb[3]+f.yb[4])/(f.cb[3]+f.cb[4])|0);let o=0;if(f.cb&&f.yb&&(f.cb[6]>0||f.cb[8]>0)&&(o=(f.yb[6]+f.yb[8])/(f.cb[6]+f.cb[8])|0),f.cb&&f.fb){let t,i=0,e=f.cb[10],n=f.fb[10],l=f.ub;i===e&&(i=0,e=f.cb[11],n=f.fb[11],l=f.wb),t=ir;)this.Xb(n[i++],s),i===e&&n!==f.fb[11]&&(i=0,e=f.cb[11],n=f.fb[11],l=f.wb),t=ih;)this.Xb(n[i++],s),i===e&&n!==f.fb[11]&&(i=0,e=f.cb[11],n=f.fb[11],l=f.wb),t=io;)this.Xb(n[i++],s),i===e&&n!==f.fb[11]&&(i=0,e=f.cb[11],n=f.fb[11],l=f.wb),t=i>2,h=this.xb[i],o=this.Mb[i],l=this.kb[i];r.A.mg(f.eb[e],f.eb[s],f.eb[n],f.sb[e],f.sb[s],f.sb[n],this.Tb[t],this.Rb[t],this.Ob[t],f.rb[h],f.hb[h],f.ob[h],f.rb[o],f.rb[l],f.hb[o],f.hb[l],f.ob[o],f.ob[l],this.Mu[t])}else if(3===h&&this.I_&&this.Mu&&this.Tb&&f.eb&&f.sb&&f.rb&&f.hb&&f.ob){const i=this.I_[t]>>2,h=this.xb[i],o=this.Mb[i],l=this.kb[i];r.A.mg(f.eb[e],f.eb[s],f.eb[n],f.sb[e],f.sb[s],f.sb[n],this.Tb[t],this.Tb[t],this.Tb[t],f.rb[h],f.hb[h],f.ob[h],f.rb[o],f.rb[l],f.hb[o],f.hb[l],f.ob[o],f.ob[l],this.Mu[t])}}jb(t,i=!1){let e=0;if(f.ob){const i=r.A.ra,s=r.A.ha,n=this.E_[t],h=this.v_[t],o=this.b_[t],l=f.ob[n],a=f.ob[h],c=f.ob[o];if(l>=50&&f.eb&&f.sb&&this.Tb)f.Ab[e]=f.eb[n],f.mb[e]=f.sb[n],f.pb[e++]=this.Tb[t];else if(f.rb&&f.hb&&this.Tb){const u=f.rb[n],d=f.hb[n],w=this.Tb[t];if(c>=50&&this.Ob){const n=(50-l)*r.A.ov[c-l];f.Ab[e]=i+((u+((f.rb[o]-u)*n>>16)<<9)/50|0),f.mb[e]=s+((d+((f.hb[o]-d)*n>>16)<<9)/50|0),f.pb[e++]=w+((this.Ob[t]-w)*n>>16)}if(a>=50&&this.Rb){const n=(50-l)*r.A.ov[a-l];f.Ab[e]=i+((u+((f.rb[h]-u)*n>>16)<<9)/50|0),f.mb[e]=s+((d+((f.hb[h]-d)*n>>16)<<9)/50|0),f.pb[e++]=w+((this.Rb[t]-w)*n>>16)}}if(a>=50&&f.eb&&f.sb&&this.Rb)f.Ab[e]=f.eb[h],f.mb[e]=f.sb[h],f.pb[e++]=this.Rb[t];else if(f.rb&&f.hb&&this.Rb){const u=f.rb[h],d=f.hb[h],w=this.Rb[t];if(l>=50&&this.Tb){const h=(50-a)*r.A.ov[l-a];f.Ab[e]=i+((u+((f.rb[n]-u)*h>>16)<<9)/50|0),f.mb[e]=s+((d+((f.hb[n]-d)*h>>16)<<9)/50|0),f.pb[e++]=w+((this.Tb[t]-w)*h>>16)}if(c>=50&&this.Ob){const n=(50-a)*r.A.ov[c-a];f.Ab[e]=i+((u+((f.rb[o]-u)*n>>16)<<9)/50|0),f.mb[e]=s+((d+((f.hb[o]-d)*n>>16)<<9)/50|0),f.pb[e++]=w+((this.Ob[t]-w)*n>>16)}}if(c>=50&&f.eb&&f.sb&&this.Ob)f.Ab[e]=f.eb[o],f.mb[e]=f.sb[o],f.pb[e++]=this.Ob[t];else if(f.rb&&f.hb&&this.Ob){const u=f.rb[o],d=f.hb[o],w=this.Ob[t];if(a>=50&&this.Rb){const n=(50-c)*r.A.ov[a-c];f.Ab[e]=i+((u+((f.rb[h]-u)*n>>16)<<9)/50|0),f.mb[e]=s+((d+((f.hb[h]-d)*n>>16)<<9)/50|0),f.pb[e++]=w+((this.Rb[t]-w)*n>>16)}if(l>=50&&this.Tb){const h=(50-c)*r.A.ov[l-c];f.Ab[e]=i+((u+((f.rb[n]-u)*h>>16)<<9)/50|0),f.mb[e]=s+((d+((f.hb[n]-d)*h>>16)<<9)/50|0),f.pb[e++]=w+((this.Tb[t]-w)*h>>16)}}}const s=f.Ab[0],h=f.Ab[1],o=f.Ab[2],l=f.mb[0],a=f.mb[1],c=f.mb[2];if(!((s-h)*(c-a)-(l-a)*(o-h)<=0))if(r.A.lg=!1,3===e){let e;if((s<0||h<0||o<0||s>n.A.ag||h>n.A.ag||o>n.A.ag)&&(r.A.lg=!0),e=this.I_?3&this.I_[t]:0,i)r.A.ev(s,h,l,a,f.pb[0]),r.A.ev(h,o,a,c,f.pb[1]),r.A.ev(o,s,c,l,f.pb[2]);else if(0===e)r.A.dg(s,h,o,l,a,c,f.pb[0],f.pb[1],f.pb[2]);else if(1===e&&this.Tb)r.A.vv(s,h,o,l,a,c,r.A.palette[this.Tb[t]]);else if(2===e&&this.I_&&this.Mu&&f.rb&&f.hb&&f.ob){const i=this.I_[t]>>2,e=this.xb[i],n=this.Mb[i],u=this.kb[i];r.A.mg(s,h,o,l,a,c,f.pb[0],f.pb[1],f.pb[2],f.rb[e],f.hb[e],f.ob[e],f.rb[n],f.rb[u],f.hb[n],f.hb[u],f.ob[n],f.ob[u],this.Mu[t])}else if(3===e&&this.I_&&this.Mu&&this.Tb&&f.rb&&f.hb&&f.ob){const i=this.I_[t]>>2,e=this.xb[i],n=this.Mb[i],u=this.kb[i];r.A.mg(s,h,o,l,a,c,this.Tb[t],this.Tb[t],this.Tb[t],f.rb[e],f.hb[e],f.ob[e],f.rb[n],f.rb[u],f.hb[n],f.hb[u],f.ob[n],f.ob[u],this.Mu[t])}}else if(4===e){let e;if((s<0||h<0||o<0||s>n.A.ag||h>n.A.ag||o>n.A.ag||f.Ab[3]<0||f.Ab[3]>n.A.ag)&&(r.A.lg=!0),e=this.I_?3&this.I_[t]:0,i)r.A.ev(s,h,l,a,f.pb[0]),r.A.ev(h,o,a,c,f.pb[1]),r.A.ev(o,f.Ab[3],c,f.mb[3],f.pb[2]),r.A.ev(f.Ab[3],s,f.mb[3],l,f.pb[3]);else if(0===e)r.A.dg(s,h,o,l,a,c,f.pb[0],f.pb[1],f.pb[2]),r.A.dg(s,o,f.Ab[3],l,c,f.mb[3],f.pb[0],f.pb[2],f.pb[3]);else if(1===e){if(this.Tb){const i=r.A.palette[this.Tb[t]];r.A.vv(s,h,o,l,a,c,i),r.A.vv(s,o,f.Ab[3],l,c,f.mb[3],i)}}else if(2===e&&this.I_&&this.Mu&&f.rb&&f.hb&&f.ob){const i=this.I_[t]>>2,e=this.xb[i],n=this.Mb[i],u=this.kb[i];r.A.mg(s,h,o,l,a,c,f.pb[0],f.pb[1],f.pb[2],f.rb[e],f.hb[e],f.ob[e],f.rb[n],f.rb[u],f.hb[n],f.hb[u],f.ob[n],f.ob[u],this.Mu[t]),r.A.mg(s,o,f.Ab[3],l,c,f.mb[3],f.pb[0],f.pb[2],f.pb[3],f.rb[e],f.hb[e],f.ob[e],f.rb[n],f.rb[u],f.hb[n],f.hb[u],f.ob[n],f.ob[u],this.Mu[t])}else if(3===e&&this.I_&&this.Mu&&this.Tb&&f.rb&&f.hb&&f.ob){const i=this.I_[t]>>2,e=this.xb[i],n=this.Mb[i],u=this.kb[i];r.A.mg(s,h,o,l,a,c,this.Tb[t],this.Tb[t],this.Tb[t],f.rb[e],f.hb[e],f.ob[e],f.rb[n],f.rb[u],f.hb[n],f.hb[u],f.ob[n],f.ob[u],this.Mu[t]),r.A.mg(s,o,f.Ab[3],l,c,f.mb[3],this.Tb[t],this.Tb[t],this.Tb[t],f.rb[e],f.hb[e],f.ob[e],f.rb[n],f.rb[u],f.hb[n],f.hb[u],f.ob[n],f.ob[u],this.Mu[t])}}}Wb(t,i,e,s,n){if(!s)return;const h=s.length;if(0===n){let n=0;f.gr=0,f._b=0,f.Ir=0;for(let t=0;t0?(f.gr=(f.gr/n|0)+t,f._b=(f._b/n|0)+i,f.Ir=(f.Ir/n|0)+e):(f.gr=t,f._b=i,f.Ir=e)}else if(1===n)for(let n=0;n=this.Vd.length)continue;const h=this.Vd[r];if(h)for(let s=0;s=this.Vd.length)continue;const o=this.Vd[h];if(o)for(let s=0;s>16;this.Pd[n]=this.Pd[n]*u-this.Bd[n]*c>>16,this.Bd[n]=t}if(0!==h){c=r.A.sin[h],u=r.A.cos[h];const t=this.Pd[n]*u-this.Ud[n]*c>>16;this.Ud[n]=this.Pd[n]*c+this.Ud[n]*u>>16,this.Pd[n]=t}if(0!==l){c=r.A.sin[l],u=r.A.cos[l];const t=this.Ud[n]*c+this.Bd[n]*u>>16;this.Ud[n]=this.Ud[n]*u-this.Bd[n]*c>>16,this.Bd[n]=t}this.Bd[n]+=f.gr,this.Pd[n]+=f._b,this.Ud[n]+=f.Ir}}else if(3===n)for(let n=0;n=this.Vd.length)continue;const h=this.Vd[r];if(h)for(let s=0;s=this.Hd.length)continue;const n=this.Hd[e];if(n)for(let i=0;i255&&(this.Sb[e]=255)}}}Hb(){this.jd=0,this.gm=0,this.A_=0,this.m_=999999,this.p_=-999999,this.g_=-99999,this.__=99999;for(let t=0;tthis.p_&&(this.p_=i),sthis.g_&&(this.g_=s),-e>this.jd&&(this.jd=-e),e>this.A_&&(this.A_=e);const n=i*i+s*s;n>this.gm&&(this.gm=n)}this.gm=0|Math.sqrt(this.gm),this.Fb=0|Math.sqrt(this.gm*this.gm+this.jd*this.jd),this.Db=this.Fb+(0|Math.sqrt(this.gm*this.gm+this.A_*this.A_))}Kb(t,i,e,s,n,r,h,o){return!(ie&&i>s&&i>n)&&(!(t{e.d(i,{A:()=>o});var s=e(8950),n=e(1069),r=e(4474),h=e(880);class o extends r.A{yw;width;height;Zb;qb;Nl;uw;constructor(t,i){super(),this.yw=new Int32Array(t*i),this.width=this.Nl=t,this.height=this.uw=i,this.Zb=this.qb=0}static $b=async(t,i)=>{const e=t.read(i+'.dat');if(!e)throw new Error(`${i} jpeg not found!`);const s=await(0,h.r)(e),n=new o(s.width,s.height),r=new Uint32Array(s.data.buffer),l=n.yw;for(let t=0;t>24&255)<<24|(255&i)<<16|(i>>8&255)<<8|i>>16&255}return n};static Za=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.gf=s.mu;const h=r.mu,l=r.mu,a=[],c=r._u-1;for(let t=0;ts.length||r.gf>r.length)throw new Error;const f=r._u,u=r._u,d=r.mu,w=r.mu,y=new o(d,w);y.Zb=f,y.qb=u,y.Nl=h,y.uw=l;const A=r._u;if(0===A){const t=y.width*y.height;for(let i=0;is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,l+=i,o+=i}h>0&&r>0&&this.Jb(h,r,this.yw,n,l,s.A.yw,e,o)}Fl(t,i,e){i|=0,e|=0;let n=(i+=this.Zb)+(e+=this.qb)*s.A.Aw,r=0,h=this.height,o=this.width,l=s.A.Aw-o,a=0;if(es.A.bottom&&(h-=e+h-s.A.bottom),is.A.right){const t=i+o-s.A.right;o-=t,a+=t,l+=t}o>0&&h>0&&this.Qb(o,h,this.yw,r,a,s.A.yw,n,l,t)}tT(t,i){t|=0,i|=0;let e=(t+=this.Zb)+(i+=this.qb)*s.A.Aw,n=0,r=this.height,h=this.width,o=s.A.Aw-h,l=0;if(is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,l+=i,o+=i}h>0&&r>0&&this.iT(h,r,this.yw,n,l,s.A.yw,e,o)}eT(){const t=this.yw,i=this.width,e=this.height;for(let s=0;s>16&255;r+=t,r<1?r=1:r>255&&(r=255);let h=n>>8&255;h+=i,h<1?h=1:h>255&&(h=255);let o=255&n;o+=e,o<1?o=1:o>255&&(o=255),this.yw[s]=(r<<16)+(h<<8)+o}}}Ow(t,i,e,n){t|=0,i|=0,e|=0,n|=0;try{const r=this.width;let h=0,o=0;const l=this.Nl,a=this.uw,c=(l<<16)/e|0,f=(a<<16)/n|0;t+=(this.Zb*e+l-1)/l|0,i+=(this.qb*n+a-1)/a|0,this.Zb*e%l!=0&&(h=(l-this.Zb*e%l<<16)/e|0),this.qb*n%a!=0&&(o=(a-this.qb*n%a<<16)/n|0),e=e*(this.width-(h>>16))/l|0,n=n*(this.height-(o>>16))/a|0;let u=t+i*s.A.Aw,d=s.A.Aw-e;if(is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right){const i=t+e-s.A.right;e-=i,d+=i}this.scale(e,n,this.yw,h,o,s.A.yw,d,u,r,c,f)}catch(t){console.error('error in sprite clipping routine')}}nT(t,i,e,n,r,h,o,l,a,c){t|=0,i|=0,e|=0,n|=0;try{const f=-e/2|0,u=-n/2|0,d=65536*Math.sin(a/326.11)|0,w=65536*Math.cos(a/326.11)|0,y=d*c>>8,A=w*c>>8;let m=(o<<16)+u*y+f*A,p=u*A-f*y+(l<<16),_=t+i*s.A.Aw;for(let t=0;t>16)+(o>>16)*this.width],n+=A,o-=y;m+=y,p+=A,_+=s.A.Aw}}catch(t){}}rT(t,i,e){t|=0,i|=0;let n=(t+=this.Zb)+(i+=this.qb)*s.A.Aw,r=0,h=this.height,o=this.width,l=s.A.Aw-o,a=0;if(is.A.bottom&&(h-=i+h-s.A.bottom),ts.A.right){const i=t+o-s.A.right;o-=i,a+=i,l+=i}o>0&&h>0&&this.hT(o,h,this.yw,a,r,s.A.yw,n,l,e.yw)}scale(t,i,e,s,n,r,h,o,l,a,c){try{const f=s;for(let u=-i;u<0;u++){const i=(n>>16)*l;for(let n=-t;n<0;n++){const t=e[(s>>16)+i];0===t?o++:r[o++]=t,s+=a}n+=c,s=f,o+=h}}catch(t){console.error('error in plot_scale')}}iT(t,i,e,s,n,r,h,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++)r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++];for(let i=t;i<0;i++)r[h++]=e[s++];h+=o,s+=n}}Qb(t,i,e,s,n,r,h,o,l){const a=256-l;for(let c=-i;c<0;c++){for(let i=-t;i<0;i++){const t=e[s++];if(0===t)h++;else{const i=r[h];r[h++]=((16711935&t)*l+(16711935&i)*a&4278255360)+((65280&t)*l+(65280&i)*a&16711680)>>8}}h+=o,s+=n}}Jb(t,i,e,s,n,r,h,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=e[s++];0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=t}h+=o,s+=n}}hT(t,i,e,s,n,r,h,o,l){const a=-(t>>2);t=-(3&t);for(let c=-i;c<0;c++){for(let t=a;t<0;t++){let t=e[n++];0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++}for(let i=t;i<0;i++){const t=e[n++];0!==t&&0===l[h]?r[h++]=t:h++}h+=o,n+=s}}}},1673:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(8950),n=e(1069),r=e(4474);class h extends r.A{yw;width;height;Zb;qb;Nl;uw;palette;constructor(t,i,e){super(),this.yw=new Int8Array(t*i),this.width=this.Nl=t,this.height=this.uw=i,this.Zb=this.qb=0,this.palette=e}static Za=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.gf=s.mu;const o=r.mu,l=r.mu,a=r._u,c=new Int32Array(a);for(let t=1;ts.length||r.gf>r.length)throw new Error;const f=r._u,u=r._u,d=r.mu,w=r.mu,y=new h(d,w,c);y.Zb=f,y.qb=u,y.Nl=o,y.uw=l;const A=y.yw,m=r._u;if(0===m){const t=y.width*y.height;for(let i=0;is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,l+=i,o+=i}h>0&&r>0&&this.oT(h,r,this.yw,n,l,s.A.yw,e,o)}eT(){const t=this.yw,i=this.width,e=this.height;for(let s=0;s>16&255;n+=t,n<0?n=0:n>255&&(n=255);let r=this.palette[s]>>8&255;r+=i,r<0?r=0:r>255&&(r=255);let h=255&this.palette[s];h+=e,h<0?h=0:h>255&&(h=255),this.palette[s]=(n<<16)+(r<<8)+h}}gv(){this.Nl|=0,this.uw|=0,this.Nl/=2,this.uw/=2,this.Nl|=0,this.uw|=0;const t=new Int8Array(this.Nl*this.uw);let i=0;for(let e=0;e>1)+(e+this.qb>>1)*this.Nl]=this.yw[i++];this.yw=t,this.width=this.Nl,this.height=this.uw,this.Zb=0,this.qb=0}Ow(){if(this.width===this.Nl&&this.height===this.uw)return;const t=new Int8Array(this.Nl*this.uw);let i=0;for(let e=0;e>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=e[s++];0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t]}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=this.palette[255&t]}h+=o,s+=n}}clip(t,i,e,n){try{const r=this.width;this.height;let h=0,o=0;const l=this.Nl,a=this.uw,c=(l<<16)/e|0,f=(a<<16)/n|0;t=t+(this.Zb*e+l-1)/l|0,i=i+(this.qb*n+a-1)/a|0,this.Zb*e%l!=0&&(h=(l-this.Zb*e%l<<16)/e|0),this.qb*n%a!=0&&(o=(a-this.qb*n%a<<16)/n|0),e=e*(this.width-(h>>16))/l|0,n=n*(this.height-(o>>16))/a|0;let u,d=t+i*s.A.Aw,w=s.A.Aw-e;is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right&&(u=t+e-s.A.right,e-=u,w+=u),this.lT(s.A.yw,this.yw,this.palette,h,o,d,w,e,n,c,f,r)}catch(t){console.log('error in sprite clipping routine')}}lT(t,i,e,s,n,r,h,o,l,a,c,f){try{const u=s;for(let d=-l;d<0;d++){const l=(n>>16)*f;for(let n=-o;n<0;n++){const n=i[(s>>16)+l];0==n?r++:t[r++]=e[255&n],s+=a}n+=c,s=u,r+=h}}catch(t){console.log('error in plot_scale')}}}},2682:(t,i,e)=>{e.d(i,{A:()=>l});var s=e(8950),n=e(1069),r=e(4474);class h{seed;constructor(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}aT(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}cT(){return this.next(32)}next(t){return this.seed=0x5deece66dn*this.seed+0xbn&(1n<<48n)-1n,Number(this.seed)>>>48-t}}var o=e(9298);class l extends r.A{static fT='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!"£$%^&*()-_=+[{]};:\'@#~,<.>/?\\| ';static uT=[];static{const t=navigator.userAgent.includes('Capacitor');for(let i=0;i<256;i++){let e=l.fT.indexOf(String.fromCharCode(i));t&&e>=63&&e--,-1===e&&(e=74),l.uT[i]=e}}dT=[];wT=new Int32Array(94);yT=new Int32Array(94);AT=new Int32Array(94);mT=new Int32Array(94);pT=new Int32Array(95);_T=new Int32Array(256);random=new h(BigInt(Date.now()));height=0;static Za=(t,i)=>{const e=new n.A(t.read(i+'.dat')),s=new n.A(t.read('index.dat'));s.gf=e.mu+4;const r=s._u;r>0&&(s.gf+=3*(r-1));const h=new l;for(let t=0;t<94;t++){h.AT[t]=s._u,h.mT[t]=s._u;const i=h.wT[t]=s.mu,n=h.yT[t]=s.mu,r=s._u,o=i*n;if(h.dT[t]=new Int8Array(o),0===r)for(let s=0;sh.height&&(h.height=n),h.AT[t]=1,h.pT[t]=i+2;{let e=0;for(let s=n/7|0;s=s.A.bottom&&(r-=e+r+1-s.A.bottom),i=s.A.right){const t=i+n+1-s.A.right;n-=t,a+=t,l+=t}n>0&&r>0&&this.OT(n,r,t,c,a,s.A.yw,o,l,h)}bT(t,i,e,n,r,h,o){e|=0,n|=0;let l=(t|=0)+(i|=0)*s.A.Aw,a=s.A.Aw-e,c=0,f=0;if(i=s.A.bottom&&(n-=i+n+1-s.A.bottom),t=s.A.right){const i=t+e+1-s.A.right;e-=i,c+=i,a+=i}e>0&&n>0&&this.LT(e,n,s.A.yw,l,a,o,f,c,r,h)}OT(t,i,e,s,n,r,h,o,l){const a=-((t|=0)>>2);t=-(3&t);for(let c=-(i|=0);c<0;c++){for(let t=a;t<0;t++)0===e[s++]?h++:r[h++]=l,0===e[s++]?h++:r[h++]=l,0===e[s++]?h++:r[h++]=l,0===e[s++]?h++:r[h++]=l;for(let i=t;i<0;i++)0===e[s++]?h++:r[h++]=l;h+=o,s+=n}}LT(t,i,e,s,n,r,h,o,l,a){t|=0;const c=((16711935&l)*a&4278255360)+((65280&l)*a&16711680)>>8,f=256-a;for(let l=-(i|=0);l<0;l++){for(let i=-t;i<0;i++)if(0===r[h++])s++;else{const t=e[s];e[s++]=(((16711935&t)*f&4278255360)+((65280&t)*f&16711680)>>8)+c}s+=n,h+=o}}IT(t){return'red'===t?o.A.RED:'gre'===t?o.A.GREEN:'blu'===t?o.A.BLUE:'yel'===t?o.A.Gl:'cya'===t?o.A.UE:'mag'===t?o.A.am:'whi'===t?o.A.gl:'bla'===t?o.A.Pl:'lre'===t?o.A.PE:'dre'===t?o.A.GE:'dbl'===t?o.A.WE:'or1'===t?o.A.YE:'or2'===t?o.A.HE:'or3'===t?o.A.VE:'gr1'===t?o.A.KE:'gr2'===t?o.A.XE:'gr3'===t?o.A.jE:o.A.Pl}split(t,i){if(0===t.length)return[t];const e=[];for(;t.length>0;){if(this.CT(t)<=i&&-1===t.indexOf('|')){e.push(t);break}let s=t.length;for(let e=0;ei)break;s=e}else if('|'===t[e]){s=e;break}e.push(t.substring(0,s)),t=t.substring(s+1)}return e}}},1183:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(8950),n=e(7854);class r{ST;width;height;xT;MT;yw;constructor(t,i,e=n.zo){this.xT=e,this.ST=this.xT.getImageData(0,0,t,i),this.MT=new Uint32Array(this.ST.data.buffer),this.yw=new Int32Array(t*i),this.width=t,this.height=i,this.bind()}clear(){this.yw.fill(0)}bind(){s.A.bind(this.yw,this.width,this.height)}draw(t,i){this.#t(),this.xT.putImageData(this.ST,t,i)}#t(){const t=this.yw.length,i=this.yw,e=this.MT;for(let s=0;s>16&255|(t>>8&255)<<8|(255&t)<<16|4278190080}}}},4544:(t,i,e)=>{e.d(i,{A:()=>s});class s{db;constructor(t){t.onerror=this.onerror,t.onclose=this.onclose,this.db=t}static openDatabase=async()=>await new Promise(((t,i)=>{const e=indexedDB.open('lostcity',1);e.onsuccess=i=>{const e=i.target;console.log('database success!'),t(e.result)},e.onupgradeneeded=t=>{t.target.result.createObjectStore('cache')},e.onerror=t=>{const e=t.target;console.error('database error!: ',e.error),i(e.result)}}));Uo=async t=>await new Promise((i=>{const e=this.db.transaction('cache','readonly').objectStore('cache').get(t);e.onsuccess=()=>{i(e.result)},e.onerror=t=>{i(void 0)}}));Ho=async(t,i)=>await new Promise(((e,s)=>{const n=this.db.transaction('cache','readwrite').objectStore('cache').put(i,t);n.onsuccess=()=>{e()},n.onerror=t=>{s()}}));onclose=t=>{console.log('database close!')};onerror=t=>{console.log('database error!')};kT=t=>{const i=t.trim();let e=0;for(let t=0;t='A'&&s<='Z'?e+=s.charCodeAt(0)+1-65:s>='a'&&s<='z'?e+=s.charCodeAt(0)+1-97:s>='0'&&s<='9'&&(e+=s.charCodeAt(0)+27-48)}return e}}},2901:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(1908);class r{static kT=t=>{let i=0;t=t.toUpperCase();for(let e=0;e=this.FT)return null;if(this.GT[t])return this.GT[t];const i=this.PT[t],e=i+this.UT[t];if(this.DT){const s=Uint8Array.from(this.buffer.subarray(i,i+e));return this.GT[t]=s,s}{const i=Uint8Array.from(n.A.read(this.BT[t],this.buffer,this.UT[t],this.PT[t]));return this.GT[t]=i,i}}}},1069:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(9234),n=e(6666),r=e(4474);class h extends r.A{static YT=3988292384;static HT=new Int32Array(256);static VT=new Uint32Array(33);static KT=new n.A;static XT=new n.A;static jT=new n.A;static zT=0;static ZT=0;static qT=0;static{for(let t=0;t<32;t++)h.VT[t]=(1<>>=1:i=i>>>1^h.YT;h.HT[t]=i}}static Po=t=>{let i=4294967295;for(let e=0;e>>8^h.HT[255&(i^t[e])];return~i};view;data;gf=0;$T=0;random=null;constructor(t){if(!t)throw new Error('Input src packet array was null!');super(),t instanceof Int8Array?this.data=new Uint8Array(t):this.data=t,this.view=new DataView(this.data.buffer,this.data.byteOffset,this.data.byteLength)}get length(){return this.view.byteLength}get available(){return this.length-this.gf}static Ut=t=>{let i=null;return 0===t&&h.zT>0?(h.zT--,i=h.KT.H_()):1===t&&h.ZT>0?(h.ZT--,i=h.XT.H_()):2===t&&h.qT>0&&(h.qT--,i=h.jT.H_()),i?(i.gf=0,i):new h(0===t?new Uint8Array(100):1===t?new Uint8Array(5e3):new Uint8Array(3e4))};release(){this.gf=0,100===this.view.byteLength&&h.zT<1e3?(h.KT.UA(this),h.zT++):5e3===this.view.byteLength&&h.ZT<250?(h.XT.UA(this),h.ZT++):3e4===this.view.byteLength&&h.qT<50&&(h.jT.UA(this),h.qT++)}get _u(){return this.view.getUint8(this.gf++)}get Dd(){return this.view.getInt8(this.gf++)}get mu(){const t=this.view.getUint16(this.gf);return this.gf+=2,t}get Iu(){const t=this.view.getInt16(this.gf);return this.gf+=2,t}get qu(){const t=this.view.getUint8(this.gf++)<<16|this.view.getUint16(this.gf);return this.gf+=2,t}get Ko(){const t=this.view.getInt32(this.gf);return this.gf+=4,t}get sE(){const t=this.view.getBigInt64(this.gf);return this.gf+=8,t}get kE(){return this.view.getUint8(this.gf)<128?this._u-64:this.mu-49152}get _m(){return this.view.getUint8(this.gf)<128?this._u:this.mu-32768}get vu(){const t=this.view,i=t.byteLength;let e,s='';for(;10!==(e=t.getUint8(this.gf++))&&this.gf>16),this.view.setUint16(this.gf,t),this.gf+=2}p4(t){this.view.setInt32(this.gf,t),this.gf+=4}iR(t){this.view.setInt32(this.gf,t,!0),this.gf+=4}eR(t){this.view.setBigInt64(this.gf,t),this.gf+=8}sR(t){const i=this.view,e=t.length;for(let s=0;s>>3,e=8-(7&this.$T),s=0;for(this.$T+=t;t>e;e=8)s+=(this.view.getUint8(i++)&h.VT[e])<>>e-t&h.VT[t],s}aR(t,i){const e=this.gf;this.gf=0;const n=new Uint8Array(e);this.JT(e,0,n);const r=(0,s.cR)(n),h=(0,s.fR)(r,i,t),o=(0,s.uR)(h);this.gf=0,this.p1(o.length),this.nR(o,o.length,0)}}},3867:(t,i,e)=>{e.d(i,{sm:()=>a,im:()=>o,fe:()=>s,Rm:()=>n,Eh:()=>r,Em:()=>h,Xr:()=>l});class s extends Array{constructor(t,i){super(t);for(let e=0;e{e.d(i,{uR:()=>o,Wo:()=>n,cR:()=>h,Yo:()=>s,Xa:()=>r,fR:()=>l});const s=async t=>new Promise((i=>setTimeout(i,t))),n=async t=>new Int8Array(await(await fetch(t)).arrayBuffer()),r=async t=>(await fetch(t)).text();function h(t){let i=0n;for(let e=0;e0n;)i.unshift(Number(0xffn&t)),t>>=8n;return 128&i[0]&&i.unshift(0),new Uint8Array(i)}function l(t,i,e){let s=1n;for(;i>0n;)i%2n===1n&&(s=s*t%e),t=t*t%e,i>>=1n;return s}},1908:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(9763);class n{static dR=null;static load=async t=>{this.dR=await(0,s.F)(new WebAssembly.Module(t),{env:void 0})};static read=(t,i,e,s)=>{if(!this.dR)throw new Error('bz2 not found!!');return Int8Array.from(this.dR.read(t,i,e,s))}}},123:(t,i,e)=>{function s(t,i){window._tinyMidiPlay&&window._tinyMidiPlay(t,i/256)}function n(){window._tinyMidiStop&&window._tinyMidiStop()}e.d(i,{Xo:()=>s,Ro:()=>n})},9763:(t,i,e)=>{async function s(t,i={}){const e={env:Object.assign(Object.create(globalThis),i.env||{},{abort(t,i,e,s){t=h(t>>>0),i=h(i>>>0),e>>>=0,s>>>=0,(()=>{throw Error(`${t} in ${i}:${e}:${s}`)})()}})},{exports:s}=await WebAssembly.instantiate(t,e),n=s.memory||i.env.memory,r=Object.setPrototypeOf({read:(t,i,e,r)=>(i=function(t,i,e,r,h){if(null==r)return 0;const o=r.length,l=s.__pin(s.__new(o<>>0;if(h)new h(n.buffer,l,o).set(r);else for(let i=0;i>>0),r[i]);return s.__unpin(l),l}(l,6,0,i,Int8Array)||function(){throw TypeError("value must not be null")}(),function(t,i,e){if(!e)return null;const s=function(t){try{return o.getUint32(t,!0)}catch{return o=new DataView(n.buffer),o.getUint32(t,!0)}}(e-4)>>>i,r=new Array(s);for(let n=0;n>>0));return r}(a,0,s.read(t,i,e,r)>>>0))},s);function h(t){if(!t)return null;const i=t+new Uint32Array(n.buffer)[t-4>>>2]>>>1,e=new Uint16Array(n.buffer);let s=t>>>1,r="";for(;i-s>1024;)r+=String.fromCharCode(...e.subarray(s,s+=1024));return r+String.fromCharCode(...e.subarray(s,i))}let o=new DataView(n.buffer);function l(t,i){try{o.setUint8(t,i,!0)}catch{o=new DataView(n.buffer),o.setUint8(t,i,!0)}}function a(t){try{return o.getInt8(t,!0)}catch{return o=new DataView(n.buffer),o.getInt8(t,!0)}}return r}e.d(i,{F:()=>s})},9896:(t,i,e)=>{var s=e(8151);!function(){window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioContext&&(window.audioContext=new window.AudioContext);var t=function(i){if(window.audioContext){var e=window.audioContext.createBuffer(1,1,22050),s=window.audioContext.createBufferSource();s.buffer=e,s.connect(window.audioContext.destination),s.start?s.start(0):s.play?s.play(0):s.noteOn&&s.noteOn(0)}document.removeEventListener('touchstart',t),document.removeEventListener('touchend',t),document.removeEventListener('click',t)};document.addEventListener('touchstart',t),document.addEventListener('touchend',t),document.addEventListener('click',t)}(),(async()=>{let t=new Float32Array,i=window.audioContext.createGain();i.gain.value=.1,i.connect(window.audioContext.destination);let e=window.audioContext.currentTime,n=[];const r=new s.A({wR:30,yR:i=>{let e=new Float32Array(i.buffer),s=new Float32Array(t.length+e.length);s.set(t,0),s.set(e,t.length),t=s},AR:t=>{},bufferSize:102400});await r.init();const h=await fetch('./SCC1_Florestan.sf2'),o=new Uint8Array(await h.arrayBuffer());function l(){if(!window.audioContext||!t.length)return;let s=window.audioContext.createBufferSource();const r=t.length/2,h=window.audioContext.createBuffer(2,r,44100);for(let i=0;i<2;i++){const e=h.getChannelData(i);let s=i;for(let i=0;i{if(a&&clearInterval(a),t=new Float32Array,n.length){let t=i.gain.value;i.gain.value=0,n.forEach((t=>{t.stop(window.audioContext.currentTime)})),n=[],i.gain.value=t}},window._tinyMidiVolume=(t=1)=>{i.gain.value=t},window._tinyMidiPlay=async(t,i=1)=>{t&&(await window._tinyMidiStop(),-1!=i&&window._tinyMidiVolume(i),e=window.audioContext.currentTime,a=setInterval(l,250),r.pR(t))}})()},8151:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5473);const n=class{constructor(t={}){this._R=void 0,this.gR=0,this.IR=0,this.CR=0,this.wR=t.wR||100,this.sampleRate=t.sampleRate||44100,this.ER=t.ER||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.vR(1),this.yR=t.yR||(()=>{}),this.AR=t.AR||(()=>{}),this.bR=void 0,this.test=0}async init(){if(!this._R){if('undefined'!=typeof process){const{TR:t}=await import('path'),{RR:i}=await import('module');globalThis.__dirname=t("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js"),globalThis.require=i("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js")}this._R=await(0,s.A)(),this.OR=this._R._malloc(this.bufferSize),this.LR=this._R._malloc(8)}}vR(t){this.bufferSize=4*this.sampleRate*this.ER*t}SR(){if(!this._R)throw new Error(`${this.constructor.name} not initalized. call .init()`)}mR(t){this.SR();const{_malloc:i,_free:e,_tsf_load_memory:s,_tsf_set_output:n,_tsf_channel_set_bank_preset:r,_tsf_set_max_voices:h,_tsf_channel_set_presetnumber:o}=this._R;e(this.gR),this.gR=i(t.length),this._R.HEAPU8.set(t,this.gR),this.IR=s(this.gR,t.length),n(this.IR,2===this.ER?0:2,this.sampleRate,this.gain)}xR(){this.SR();const t=new Uint8Array(this.bufferSize);return t.set(this._R.HEAPU8.subarray(this.OR,this.OR+this.bufferSize)),t}MR(t){const{_malloc:i,_free:e,_tml_load_memory:s}=this._R;return e(this.CR),this.CR=i(t.length),this._R.HEAPU8.set(t,this.CR),s(this.CR,t.length)}kR(t){const{_midi_render:i}=this._R;return i(this.IR,t,this.ER,this.sampleRate,this.OR,this.bufferSize,this.LR)}pR(t){if(this.SR(),!this.IR)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.bR);const{setValue:i,getValue:e}=this._R;i(this.LR,0,'double'),this._R._tsf_reset(this.IR),this._R._tsf_channel_set_bank_preset(this.IR,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let s=this.MR(t);const n=()=>{s=this.kR(s);const t=this.xR();this.yR(t),s?this.bR=setTimeout(n,this.wR):this.AR(e(this.LR,'double'))};this.bR=setTimeout(n,16)}}},8227:(t,i,e)=>{t.exports=e.p+"9f86b5397894e28b5ae2.wasm"},5473:(t,i,e)=>{var s;e.d(i,{A:()=>n});const n=(s="file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/tinymidipcm.mjs",function(t){var i,n,r=void 0!==(t=t||{})?t:{};r.ready=new Promise((function(t,e){i=t,n=e})),["_tsf_load_memory","_tsf_set_output","_tsf_channel_set_bank_preset","_tsf_set_max_voices","_tsf_channel_set_presetnumber","_tsf_reset","_tsf_close","_tml_load_memory","_midi_render","_malloc","_realloc","_free","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(r.ready,t)||Object.defineProperty(r.ready,t,{get:()=>j('You are getting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),set:()=>j('You are setting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js')})}));var h=Object.assign({},r),o=[],l='object'==typeof window,a='function'==typeof importScripts,c='object'==typeof process&&'object'==typeof process.versions&&'string'==typeof process.versions.node,f=!l&&!c&&!a;if(r.ENVIRONMENT)throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');var u,d,w,y='';if(c){if('undefined'==typeof process||!process.release||'node'!==process.release.name)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');var A,m;y=a?require('path').TR(y)+'/':__dirname+'/';var p=()=>{m||(A=require('fs'),m=require('path'))};u=(t,i)=>(p(),t=m.normalize(t),A.DR(t,i?void 0:'utf8')),w=t=>{var i=u(t,!0);return i.buffer||(i=new Uint8Array(i)),D(i.buffer),i},d=(t,i,e)=>{p(),t=m.normalize(t),A.FR(t,(function(t,s){t?e(t):i(s.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,'/'),o=process.argv.slice(2),process.on('uncaughtException',(function(t){if(!(t instanceof nt))throw t})),process.on('unhandledRejection',(function(t){throw t})),r.inspect=function(){return'[Emscripten Module object]'}}else if(f){if('object'==typeof process&&'function'==typeof require||'object'==typeof window||'function'==typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');'undefined'!=typeof read&&(u=function(t){return read(t)}),w=function(t){let i;return'function'==typeof readbuffer?new Uint8Array(readbuffer(t)):(i=read(t,'binary'),D('object'==typeof i),i)},d=function(t,i,e){setTimeout((()=>i(w(t))),0)},'undefined'!=typeof scriptArgs?o=scriptArgs:void 0!==arguments&&(o=arguments),'undefined'!=typeof print&&('undefined'==typeof console&&(console={}),console.log=print,console.warn=console.error='undefined'!=typeof printErr?printErr:print)}else{if(!l&&!a)throw new Error('environment detection error');if(a?y=self.location.href:'undefined'!=typeof document&&document.currentScript&&(y=document.currentScript.src),s&&(y=s),y=0!==y.indexOf('blob:')?y.substr(0,y.replace(/[?#].*/,"").lastIndexOf('/')+1):'','object'!=typeof window&&'function'!=typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');u=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.send(null),i.responseText},a&&(w=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.responseType='arraybuffer',i.send(null),new Uint8Array(i.response)}),d=(t,i,e)=>{var s=new XMLHttpRequest;s.open('GET',t,!0),s.responseType='arraybuffer',s.onload=()=>{200==s.status||0==s.status&&s.response?i(s.response):e()},s.onerror=e,s.send(null)}}r.print||console.log.bind(console);var _,g,I=r.printErr||console.warn.bind(console);function C(t,i){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){j('Module.'+t+' has been replaced with plain '+i+' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')}})}function E(t){return'FS_createPath'===t||'FS_createDataFile'===t||'FS_createPreloadedFile'===t||'FS_unlink'===t||'addRunDependency'===t||'FS_createLazyFile'===t||'FS_createDevice'===t||'removeRunDependency'===t}Object.assign(r,h),h=null,_='fetchSettings',Object.getOwnPropertyDescriptor(r,_)&&j('`Module.'+_+'` was supplied but `'+_+'` not included in INCOMING_MODULE_JS_API'),r.arguments&&(o=r.arguments),C('arguments','arguments_'),r.thisProgram&&r.thisProgram,C('thisProgram','thisProgram'),r.quit&&r.quit,C('quit','quit_'),D(void 0===r.memoryInitializerPrefixURL,'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.pthreadMainPrefixURL,'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.cdInitializerPrefixURL,'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.filePackagePrefixURL,'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.read,'Module.read option was removed (modify read_ in JS)'),D(void 0===r.readAsync,'Module.readAsync option was removed (modify readAsync in JS)'),D(void 0===r.readBinary,'Module.readBinary option was removed (modify readBinary in JS)'),D(void 0===r.setWindowTitle,'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'),D(void 0===r.TOTAL_MEMORY,'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'),C('read','read_'),C('readAsync','readAsync'),C('readBinary','readBinary'),C('setWindowTitle','setWindowTitle'),D(!f,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),r.wasmBinary&&(g=r.wasmBinary),C('wasmBinary','wasmBinary');var v;r.noExitRuntime;C('noExitRuntime','noExitRuntime'),'object'!=typeof WebAssembly&&j('no native wasm support detected');var b,T,R,O,L,S,x,M,k=!1;function D(t,i){t||j('Assertion failed'+(i?': '+i:''))}function F(t){b=t,r.HEAP8=T=new Int8Array(t),r.HEAP16=O=new Int16Array(t),r.HEAP32=L=new Int32Array(t),r.HEAPU8=R=new Uint8Array(t),r.HEAPU16=new Uint16Array(t),r.HEAPU32=S=new Uint32Array(t),r.HEAPF32=x=new Float32Array(t),r.HEAPF64=M=new Float64Array(t)}'undefined'!=typeof TextDecoder&&new TextDecoder('utf8');var N=5242880;r.TOTAL_STACK&&D(N===r.TOTAL_STACK,'the stack size can no longer be determined at runtime');var B=r.INITIAL_MEMORY||16777216;function U(){if(!k){var t=ft(),i=S[t>>2],e=S[t+4>>2];34821223==i&&2310721022==e||j('Stack overflow! Stack cookie has been overwritten at 0x'+t.toString(16)+', expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+e.toString(16)+' 0x'+i.toString(16)),1668509029!==S[0]&&j('Runtime error: The application has corrupted its heap memory area (address zero)!')}}C('INITIAL_MEMORY','INITIAL_MEMORY'),D(B>=N,'INITIAL_MEMORY should be larger than TOTAL_STACK, was '+B+'! (TOTAL_STACK='+N+')'),D('undefined'!=typeof Int32Array&&'undefined'!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,'JS engine does not provide full typed array support'),D(!r.wasmMemory,'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'),D(16777216==B,'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'),function(){var t=new Int16Array(1),i=new Int8Array(t.buffer);if(t[0]=25459,115!==i[0]||99!==i[1])throw'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'}();var P=[],G=[],W=[],Y=!1;D(Math.imul,'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.fround,'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.clz32,'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.trunc,'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');var H=0,V=null,K=null,X={};function j(t){r.onAbort&&r.onAbort(t),I(t='Aborted('+t+')'),k=!0;var i=new WebAssembly.RuntimeError(t);throw n(i),i}var z={error:function(){j('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM')},init:function(){z.error()},NR:function(){z.error()},BR:function(){z.error()},UR:function(){z.error()},open:function(){z.error()},PR:function(){z.error()},GR:function(){z.error()},WR:function(){z.error()},YR:function(){z.error()},HR:function(){z.error()}};r.FS_createDataFile=z.NR,r.FS_createPreloadedFile=z.BR;var Z,q,$,J,Q='data:application/octet-stream;base64,';function tt(t){return t.startsWith(Q)}function it(t){return t.startsWith('file://')}function et(t,i){return function(){var e=t,s=i;return i||(s=r.asm),D(Y,'native function `'+e+'` called before runtime initialization'),s[t]||D(s[t],'exported native function `'+e+'` not found'),s[t].apply(null,arguments)}}function st(t){try{if(t==Z&&g)return new Uint8Array(g);if(w)return w(t);throw"both async and sync fetching of the wasm failed"}catch(t){j(t)}}function nt(t){this.name='ExitStatus',this.message='Program terminated with exit('+t+')',this.status=t}function rt(t){for(;t.length>0;)t.shift()(r)}function ht(t){ht.VR||(ht.VR={}),ht.VR[t]||(ht.VR[t]=1,c&&(t='warning: '+t),I(t))}function ot(t){try{return v.KR(t-b.byteLength+65535>>>16),F(v.buffer),1}catch(i){I('emscripten_realloc_buffer: Attempted to grow heap from '+b.byteLength+' bytes to '+t+' bytes, but got error: '+i)}}r.locateFile?tt(Z='tinymidipcm.wasm')||(q=Z,Z=r.locateFile?r.locateFile(q,y):y+q):Z=new URL(e(8227),e.b).toString();var lt,at={"emscripten_memcpy_big":function(t,i,e){R.copyWithin(t,i,i+e)},"emscripten_resize_heap":function(t){var i=R.length;D((t>>>=0)>i);var e,s,n=2147483648;if(t>n)return I('Cannot enlarge memory, asked to go up to '+t+' bytes, but the limit is '+n+' bytes!'),!1;for(var r=1;r<=4;r*=2){var h=i*(1+.2/r);h=Math.min(h,t+100663296);var o=Math.min(n,(e=Math.max(t,h))+((s=65536)-e%s)%s);if(ot(o))return!0}return I('Failed to grow the heap from '+i+' bytes to '+o+' bytes, not enough memory!'),!1}},ct=(function(){var t,i={'env':at,'wasi_snapshot_preview1':at};function e(t,i){var e,s=t.exports;r.asm=s,D(v=r.asm.memory,"memory not found in wasm exports"),F(v.buffer),D(r.asm.__indirect_function_table,"table not found in wasm exports"),e=r.asm.__wasm_call_ctors,G.unshift(e),function(t){if(H--,r.monitorRunDependencies&&r.monitorRunDependencies(H),t?(D(X[t]),delete X[t]):I('warning: run dependency removed without ID'),0==H&&(null!==V&&(clearInterval(V),V=null),K)){var i=K;K=null,i()}}('wasm-instantiate')}t='wasm-instantiate',H++,r.monitorRunDependencies&&r.monitorRunDependencies(H),t?(D(!X[t]),X[t]=1,null===V&&'undefined'!=typeof setInterval&&(V=setInterval((function(){if(k)return clearInterval(V),void(V=null);var t=!1;for(var i in X)t||(t=!0,I('still waiting on run dependencies:')),I('dependency: '+i);t&&I('(end of list)')}),1e4))):I('warning: run dependency added without ID');var s=r;function h(t){D(r===s,'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'),s=null,e(t.instance)}function o(t){return function(){if(!g&&(l||a)){if('function'==typeof fetch&&!it(Z))return fetch(Z,{credentials:'same-origin'}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+Z+"'";return t.arrayBuffer()})).catch((function(){return st(Z)}));if(d)return new Promise((function(t,i){d(Z,(function(i){t(new Uint8Array(i))}),i)}))}return Promise.resolve().then((function(){return st(Z)}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){I('failed to asynchronously prepare wasm: '+t),it(Z)&&I('warning: Loading from a file URI ('+Z+') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing'),j(t)}))}if(r.instantiateWasm)try{return r.instantiateWasm(i,e)}catch(t){I('Module.instantiateWasm callback failed with error: '+t),n(t)}(g||'function'!=typeof WebAssembly.instantiateStreaming||tt(Z)||it(Z)||c||'function'!=typeof fetch?o(h):fetch(Z,{credentials:'same-origin'}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(h,(function(t){return I('wasm streaming compile failed: '+t),I('falling back to ArrayBuffer instantiation'),o(h)}))}))).catch(n)}(),r.___wasm_call_ctors=et("__wasm_call_ctors"),r._malloc=et("malloc"),r._free=et("free"),r._tsf_load_memory=et("tsf_load_memory"),r._tsf_close=et("tsf_close"),r._tsf_reset=et("tsf_reset"),r._tsf_set_output=et("tsf_set_output"),r._tsf_set_max_voices=et("tsf_set_max_voices"),r._realloc=et("realloc"),r._tsf_channel_set_presetnumber=et("tsf_channel_set_presetnumber"),r._tsf_channel_set_bank_preset=et("tsf_channel_set_bank_preset"),r._tml_load_memory=et("tml_load_memory"),r._midi_render=et("midi_render"),r.___errno_location=et("__errno_location"),r._fflush=et("fflush"),r._emscripten_stack_init=function(){return(ct=r._emscripten_stack_init=r.asm.emscripten_stack_init).apply(null,arguments)}),ft=(r._emscripten_stack_get_free=function(){return(r._emscripten_stack_get_free=r.asm.emscripten_stack_get_free).apply(null,arguments)},r._emscripten_stack_get_base=function(){return(r._emscripten_stack_get_base=r.asm.emscripten_stack_get_base).apply(null,arguments)},r._emscripten_stack_get_end=function(){return(ft=r._emscripten_stack_get_end=r.asm.emscripten_stack_get_end).apply(null,arguments)});function ut(){var t;ct(),D(!(3&(t=ft()))),S[t>>2]=34821223,S[t+4>>2]=2310721022,S[0]=1668509029}function dt(t){function e(){lt||(lt=!0,r.calledRun=!0,k||(D(!Y),Y=!0,U(),rt(G),i(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),D(!r._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(U(),r.postRun)for('function'==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)t=r.postRun.shift(),W.unshift(t);var t;rt(W)}()))}t=t||o,H>0||(ut(),function(){if(r.preRun)for('function'==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)t=r.preRun.shift(),P.unshift(t);var t;rt(P)}(),H>0||(r.setStatus?(r.setStatus('Running...'),setTimeout((function(){setTimeout((function(){r.setStatus('')}),1),e()}),1)):e(),U()))}if(r.stackSave=et("stackSave"),r.stackRestore=et("stackRestore"),r.stackAlloc=et("stackAlloc"),r.setValue=function(t,i,e="i8"){switch(e.endsWith('*')&&(e='*'),e){case'i1':case'i8':T[0|t]=i;break;case'i16':O[t>>1]=i;break;case'i32':L[t>>2]=i;break;case'i64':J=[i>>>0,($=i,+Math.abs($)>=1?$>0?(0|Math.min(+Math.floor($/4294967296),4294967295))>>>0:~~+Math.ceil(($-+(~~$>>>0))/4294967296)>>>0:0)],L[t>>2]=J[0],L[t+4>>2]=J[1];break;case'float':x[t>>2]=i;break;case'double':M[t>>3]=i;break;case'*':S[t>>2]=i;break;default:j('invalid type for setValue: '+e)}},r.getValue=function(t,i="i8"){switch(i.endsWith('*')&&(i='*'),i){case'i1':case'i8':return T[0|t];case'i16':return O[t>>1];case'i32':case'i64':return L[t>>2];case'float':return x[t>>2];case'double':return M[t>>3];case'*':return S[t>>2];default:j('invalid type for getValue: '+i)}return null},['run','UTF8ArrayToString','UTF8ToString','stringToUTF8Array','stringToUTF8','lengthBytesUTF8','addOnPreRun','addOnInit','addOnPreMain','addOnExit','addOnPostRun','addRunDependency','removeRunDependency','FS_createFolder','FS_createPath','FS_createDataFile','FS_createPreloadedFile','FS_createLazyFile','FS_createLink','FS_createDevice','FS_unlink','getLEB','getFunctionTables','alignFunctionTables','registerFunctions','prettyPrint','getCompilerSetting','print','printErr','callMain','abort','keepRuntimeAlive','wasmMemory','stackAlloc','stackSave','stackRestore','getTempRet0','setTempRet0','writeStackCookie','checkStackCookie','ptrToString','zeroMemory','stringToNewUTF8','exitJS','getHeapMax','emscripten_realloc_buffer','ENV','ERRNO_CODES','ERRNO_MESSAGES','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','DNS','getHostByName','Protocols','Sockets','getRandomDevice','warnOnce','traverseStack','UNWIND_CACHE','convertPCtoSourceLocation','readAsmConstArgsArray','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','handleException','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','freeTableIndexes','functionsInTableMap','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','PATH','PATH_FS','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16Decoder','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeArrayToMemory','writeAsciiToMemory','SYSCALLS','getSocketFromFD','getSocketAddress','JSEvents','registerKeyEventCallback','specialHTMLTargets','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','currentFullscreenStrategy','restoreOldWindowedStyle','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','demangle','demangleAll','jsStackTrace','stackTrace','ExitStatus','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','dlopenMissingError','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','uncaughtExceptionCount','exceptionLast','exceptionCaught','ExceptionInfo','exception_addRef','exception_decRef','Browser','setMainLoop','wget','FS','MEMFS','TTY','PIPEFS','SOCKFS','_setNetworkCallback','tempFixedLengthArray','miniTempWebGLFloatBuffers','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','GL','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','AL','SDL_unicode','SDL_ttfContext','SDL_audio','SDL','SDL_gfx','GLUT','EGL','GLFW_Window','GLFW','GLEW','IDBStore','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){var i="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),j(i)}})})),['ptrToString','zeroMemory','stringToNewUTF8','exitJS','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','getHostByName','getRandomDevice','traverseStack','convertPCtoSourceLocation','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeAsciiToMemory','getSocketFromFD','getSocketAddress','registerKeyEventCallback','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','ExceptionInfo','exception_addRef','exception_decRef','setMainLoop','_setNetworkCallback','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','SDL_unicode','SDL_ttfContext','SDL_audio','GLFW_Window','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){'undefined'==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var i='`'+t+'` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line';E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),ht(i)}})})),K=function t(){lt||dt(),lt||(K=t)},r.preInit)for('function'==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return dt(),t.ready})}},r={};function h(t){var i=r[t];if(void 0!==i)return i.exports;var e=r[t]={exports:{}};return n[t](e,e.exports,h),e.exports}h.m=n,t="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",i="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",e="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",s=t=>{t&&t.d<1&&(t.d=1,t.forEach((t=>t.r--)),t.forEach((t=>t.r--?t.r++:t())))},h.a=(n,r,h)=>{var o;h&&((o=[]).d=-1);var l,a,c,f=new Set,u=n.exports,d=new Promise(((t,i)=>{c=i,a=t}));d[i]=u,d[t]=t=>(o&&t(o),f.forEach(t),d.catch((t=>{}))),n.exports=d,r((n=>{var r;l=(n=>n.map((n=>{if(null!==n&&"object"==typeof n){if(n[t])return n;if(n.then){var r=[];r.d=0,n.then((t=>{h[i]=t,s(r)}),(t=>{h[e]=t,s(r)}));var h={};return h[t]=t=>t(r),h}}var o={};return o[t]=t=>{},o[i]=n,o})))(n);var h=()=>l.map((t=>{if(t[e])throw t[e];return t[i]})),a=new Promise((i=>{(r=()=>i(h)).r=0;var e=t=>t!==o&&!f.has(t)&&(f.add(t),t&&!t.d&&(r.r++,t.push(r)));l.map((i=>i[t](e)))}));return r.r?a:h()}),(t=>(t?c(d[e]=t):a(u),s(o)))),o&&o.d<0&&(o.d=0)},h.d=(t,i)=>{for(var e in i)h.o(i,e)&&!h.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:i[e]})},h.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),h.p="/Client2/",h.b=document.baseURI||self.location.href;h(9858)})(); \ No newline at end of file +(()=>{"use strict";var t,i,e,s,n={1651:(t,i,e)=>{e.d(i,{K:()=>M});var s=e(1120),n=e(4583),r=e(2901),h=e(1069),o=e(7046),l=(e(9896),e(6666)),a=e(3045),c=e(818),f=e(670),u=e(8268),d=e(3867),w=e(7854),y=e(8950),A=e(1302),m=e(9298),p=e(8665),_=e(1312),g=e(3819),I=e(8317),C=e(9234),E=e(1908),v=e(123),b=e(5637),T=e(6948),R=e(2164),O=e(8738),L=e(3764),S=e(8534),x=e(6730);class M extends o.A{static tt=225;static it=10;static portOffset=0;static members=!0;static et=!1;static st='';static nt='';static rt=!1;static ht=2;static ot=!1;static lt='https://raw.githubusercontent.com/2004scape/Server/main';static exponent=58778699976184461502525193738213253649000149147835990136706041084440742975821n;static ct=7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789n;static ft=0;static ut=0;static dt=0;static wt=0;static yt=0;static At=0;static _t=0;static gt=0;static It=0;static Ct=0;static Et=0;static vt=0;static bt=0;static Tt=0;static Rt=0;static Ot=()=>{a.A.et=!1,n.A.et=!1,M.et=!1,c.A.et=!1};static Lt=()=>{a.A.et=!0,n.A.et=!0,M.et=!0,c.A.et=!0};St=2048;xt=2047;Mt=!1;kt=!1;Dt=!1;Nt=!1;db=null;Ft=0;Bt=[];stream=null;in=h.A.Ut(1);Pt=h.A.Ut(1);Gt=h.A.Ut(1);Wt=0n;Yt=0;Ht=0;Vt=0;Kt=null;Xt=0;packetSize=0;jt=0;zt=0;Zt=0;qt=null;$t=!0;Jt=0;Qt=0;ti=null;ii=null;ei=null;si=null;ni=null;ri=null;hi=null;oi=null;li=null;ai=null;ci=null;fi='';ui='';username='';password='';di=null;wi=null;yi=null;Ai=null;mi=[];pi=!1;_i=null;gi=null;Ii=null;Ci=null;Ei=null;vi=null;bi=null;Ti=null;Ri=null;Oi=null;Li=new Int32Array(256);Si=0;xi=0;Mi=0;ki=null;Di=null;Ni=null;Fi=null;Bi=null;Ui=null;Pi=null;Gi=null;Wi=null;Yi=null;Hi=null;Vi=null;Ki=null;Xi=null;ji=null;zi=null;Zi=null;qi=null;$i=null;Ji=null;Qi=null;te=new Int32Array(33);ie=new Int32Array(33);ee=new Int32Array(151);se=new Int32Array(151);ne=null;re=null;he=null;oe=null;le=null;ae=null;ce=new d.fe(13,null);ue=null;de=null;we=new d.fe(50,null);ye=new d.fe(50,null);Ae=new d.fe(20,null);me=new d.fe(20,null);pe=null;_e=new d.fe(8,null);ge=null;Ie=null;Ce=null;Ee=null;ve=null;be=null;Te=null;Re=null;Oe=null;Le=null;Se=null;xe=null;Me=null;ke=null;De=null;Ne=null;Fe=null;Be=null;Ue=new d.fe(1e3,null);Pe=!1;Ge=!1;We=!1;Ye=!1;He=-1;Ve=0;Ke=0;Xe=0;je=0;ze=0;Ze=0;qe=!1;$e=0;Je=0;Qe=0;ts=0;es=0;ss=0;ns=[];rs=-1;hs=-1;os=new s.A;ls=78;cs=0;fs=0;us=[];ds=0;ws=0;ys=0;As=0;ps=0;_s=0;gs=0;Is=0;Cs=[];Es=[];vs=[];bs=[];Ts=null;Rs=-1;Os=3;Ls=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];Ss=0;xs=0;Ms=0;ks=!1;Ds=0;Ns=!1;Fs='';Bs='';Us=0;Ps='';Gs=!1;Ws=-1;Ys=new d.fe(100,null);Hs=new d.fe(100,null);messageType=new Int32Array(100);Vs=new Int32Array(100);Ks=0;Xs=0;js=0;zs='';Zs=0;qs=0;$s=0;Js=0;Qs=0;tn=0;en=0;sn=0;nn=0;rn=!1;hn=0;ln=0;an=0;cn=0;fn=null;un=0;dn=0;wn=0;yn=0;An=!1;mn=[];pn=[];_n=0;gn=0;In=0;Cn=null;En=0;vn=new Int32Array(500);bn=new Int32Array(500);Tn=new Int32Array(500);Rn=new Int32Array(500);On=0;Ln=0;Sn=0;xn='';Mn=!1;kn=-1;Dn=0;Nn=0;Fn=0;Bn=0;Un=0;Pn=new Int32Array(1e3);Gn=new Int32Array(1e3);Wn=null;Yn=0;Hn=0;Vn=0;Kn=0;Xn=0;jn=!1;zn=0;Zn=0;qn=0;$n=0;Jn=2;Qn=2;tr=1;ir=new Int32Array(5);er=new d.fe(5,!1);sr=new Int32Array(5);nr=new Int32Array(5);rr=new Int32Array(5);hr=0;lr=0;ar=0;cr=0;ur=0;dr=0;wr=0;yr=0;Ar=0;mr=1;pr=2;_r=-1;gr=0;Ir=0;Cr=0;Er=0;vr=0;br=0;Tr=null;Rr=null;Or=null;Lr=0;Sr=0;Mr=new Int8Array(16384);kr=new d.fe(f.A.Dr,null);Nr=0;Fr=0;Br=128;Ur=0;Pr=0;Gr=0;Wr=0;Yr=0;Hr=null;Vr=null;Kr=new d.Xr(f.A.jr,f.A.jr);zr=0;Zr=0;qr=0;$r=0;Jr=0;Qr=0;th=0;ih=0;eh=0;sh=0;nh=0;rh=0;hh=new d.fe(this.St,null);oh=0;lh=new Int32Array(this.St);ah=0;fh=0;uh=new Int32Array(this.St);dh=new Int32Array(1e3);wh=new d.fe(this.St,null);yh=new d.fe(8192,null);Ah=0;mh=new Int32Array(8192);ph=new l.A;_h=new l.A;gh=new l.A;Ih=new l.A;Ch=new d.Eh(f.A.Dr,f.A.jr,f.A.jr,null);bh=new l.A;Th=new Int32Array(4e3);Rh=new Int32Array(4e3);Oh=new Int32Array(f.A.jr*f.A.jr);Lh=new Int32Array(f.A.jr*f.A.jr);Sh=0;xh=null;Mh=0;kh=0;Dh=-1;Nh=0;Fh=0;Bh=0;Uh=0;Ph=!1;Gh=!0;Wh=!1;Yh=new Int32Array(7);Hh=new Int32Array(5);Vh=0;Kh=0;static Xh=50;jh=new Int32Array(M.Xh);zh=new Int32Array(M.Xh);Zh=new Int32Array(M.Xh);qh=new Int32Array(M.Xh);$h=new Int32Array(M.Xh);Jh=new Int32Array(M.Xh);Qh=new Int32Array(M.Xh);io=new d.fe(M.Xh,null);eo=new d.fe(100,null);so=new BigInt64Array(100);no=new Int32Array(100);ro=null;ho=0;oo=!0;lo=new Int32Array(50);ao=new Int32Array(50);co=new Int32Array(50);fo=192;uo=-1;do=-1;wo=0;yo=0;Ao=0;mo=!0;po=null;_o=0;Io=0;Co=192;Eo=new d.fe(16,null);vo=0;bo=!1;To=()=>{try{this.stream&&this.stream.close()}catch(t){}this.stream=null,(0,v.Ro)(),this.Pt=null,this.Gt=null,this.in=null,this.Or=null,this.Tr=null,this.Rr=null,this.Hr=null,this.Vr=null,this.Wn=null,this.kr=null,this.Oh=null,this.Lh=null,this.Th=null,this.Rh=null,this.Mr=null,this.Di=null,this.Ni=null,this.Fi=null,this.Bi=null,this.Ui=null,this.Pi=null,this.Gi=null,this.Wi=null,this.Yi=null,this.Hi=null,this.Vi=null,this.Ki=null,this.Xi=null,this.ji=null,this.zi=null,this.Zi=null,this.qi=null,this.ne=null,this.he=null,this.re=null,this.oe=null,this.le=null,this.ae=null,this.ce=null,this.Te=null,this.Re=null,this.Oe=null,this.Le=null,this.Se=null,this.xe=null,this.Me=null,this.ke=null,this.De=null,this.Ne=null,this.de=null,this.Ae=null,this.me=null,this._e=null,this.ge=null,this.Ie=null,this.Ce=null,this.Ee=null,this.we=null,this.ye=null,this.Kr=null,this.hh=null,this.lh=null,this.uh=null,this.wh=null,this.dh=null,this.yh=null,this.mh=null,this.Ch=null,this.bh=null,this.Ih=null,this.ph=null,this._h=null,this.gh=null,this.Tn=null,this.Rn=null,this.vn=null,this.bn=null,this.ns=null,this.mn=null,this.Pn=null,this.Gn=null,this.Ue=null,this.ue=null,this.eo=null,this.so=null,this.no=null,this.si=null,this.ni=null,this.ti=null,this.ii=null,this.ei=null,this.ri=null,this.hi=null,this.oi=null,this.li=null,this.Oo(),b.A.To(),T.A.To(),A.A.To(),R.A.Lo=null,I.A.Lo=null,s.A.Lo=null,_.A.Lo=null,O.A.Lo=null,O.A.So=null,L.A.Lo=null,this.xo=null,u.A.So=null,n.A.To(),a.A.To(),p.A.To(),S.A.Lo=[],x.A.Lo=[]};Mo(){return this.Jt}ko(){return this.Gs}Do(){return this.Ns}No(){return this.hs}Fo(){return this.He}Oo=()=>{this.pi=!1,this.ki&&(clearInterval(this.ki),this.ki=null),this.ai=null,this.ci=null,this.mi=[],this.bi=null,this.Ti=null,this.Ri=null,this.Oi=null,this.Ci=null,this.Ii=null,this.Ei=null,this.vi=null,this._i=null,this.gi=null};Bo=async(t,i,e,s)=>{let n=5,o=await(this.db?.Uo(t));if(o&&h.A.Po(o)!==e&&(o=void 0),o)return new r.A(o);for(;!o;){await this.Go(s,`Requesting ${i}`);try{o=await(0,C.Wo)(`${M.nt}/${t}${e}`)}catch(t){o=void 0;for(let t=n;t>0;t--)await this.Go(s,`Error loading - Will retry in ${t} secs.`),await(0,C.Yo)(1e3);n*=2,n>60&&(n=60)}}return await(this.db?.Ho(t,o)),new r.A(o)};Vo=async(t,i,e)=>{let s=await(this.db?.Uo(t+'.mid'));if(s&&12345678!==i&&h.A.Po(s)!==i&&(s=void 0),!s)try{s=await(0,C.Wo)(`${M.nt}/${t}_${i}.mid`),e!==s.length&&(s=s.slice(0,e))}catch(t){}if(!s)return;await(this.db?.Ho(t+'.mid',s));const n=new h.A(Uint8Array.from(s)).Ko,r=E.A.read(n,s,e,4);(0,v.Xo)(r,this.Co)};jo=()=>{if(w.zo.fillStyle='black',w.zo.fillRect(0,0,this.width,this.height),this.Zo(1),this.Dt){this.pi=!1,w.zo.font='bold 16px helvetica, sans-serif',w.zo.textAlign='left',w.zo.fillStyle='yellow';let t=35;w.zo.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,w.zo.fillStyle='white',w.zo.fillText('To fix this try the following (in order):',30,t),t+=50,w.zo.font='bold 12px helvetica, sans-serif',w.zo.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.zo.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,w.zo.fillText('3: Try using a different game-world',30,t),t+=30,w.zo.fillText('4: Try rebooting your computer',30,t),t+=30,w.zo.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.Nt&&(this.pi=!1,w.zo.font='bold 20px helvetica, sans-serif',w.zo.textAlign='left',w.zo.fillStyle='white',w.zo.fillText('Error - unable to load game!',50,50),w.zo.fillText('To play RuneScape make sure you play from',50,100),w.zo.fillText('https://2004scape.org',50,150)),this.kt){this.pi=!1,w.zo.font='bold 13px helvetica, sans-serif',w.zo.textAlign='left',w.zo.fillStyle='yellow';let t=35;w.zo.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,w.zo.fillStyle='white',w.zo.fillText('To fix this try the following (in order):',30,t),t+=50,w.zo.font='bold 12px helvetica, sans-serif',w.zo.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.zo.fillText('2: Try rebooting your computer, and reloading',30,t)}};qo=t=>{if(!t.$o)return!1;for(let i=0;i=s)return!1}else if(3===t.$o[i]){if(e<=s)return!1}else if(4===t.$o[i]){if(e===s)return!1}else if(e!==s)return!1}return!0};tl=(t,i,e,s,n)=>{this.ve?.draw(t,i),this.be?.draw(t,i+n-16),y.A.fillRect(t,i+16,16,n-32,m.A.il);let r=(n-32)*n/s|0;r<8&&(r=8);const h=(n-r-32)*e/(s-n)|0;y.A.fillRect(t,i+h+16,16,r,m.A.el),y.A.sl(t,i+h+16,m.A.nl,r),y.A.sl(t+1,i+h+16,m.A.nl,r),y.A.rl(t,i+h+16,m.A.nl,16),y.A.rl(t,i+h+17,m.A.nl,16),y.A.sl(t+15,i+h+16,m.A.hl,r),y.A.sl(t+14,i+h+17,m.A.hl,r-1),y.A.rl(t,i+h+r+15,m.A.hl,16),y.A.rl(t+1,i+h+r+14,m.A.hl,15)};ol=(t,i)=>{let e=!1;const n=s.A.Lo[t];if(!n.ll)return!1;for(let t=0;ts.delay[r.ul];)r.fl-=s.delay[r.ul]+1,r.ul++,r.ul>=s.dl&&(r.ul-=s.wl,(r.ul<0||r.ul>=s.dl)&&(r.ul=0)),e=!0}}}return e};yl=(t,i,e,r,h=!1)=>{if(0!==t.type||!t.ll||t.hide&&this.Zs!==t.id&&this.qs!==t.id&&this.$s!==t.id)return;const o=y.A.left,l=y.A.top,a=y.A.right,c=y.A.bottom;y.A.Al(i,e,i+t.width,e+t.height);const f=t.ll.length;for(let o=0;o0&&this.Cl(c),c.type===s.A.El)c.vl>c.scroll-c.height&&(c.vl=c.scroll-c.height),c.vl<0&&(c.vl=0),this.yl(c,l,a,c.vl,h),c.scroll>c.height&&this.tl(l+c.width,a,c.vl,c.scroll,c.height);else if(c.type===s.A.bl){let t=0;for(let i=0;i0){let i=0,e=0;const r=c.Ol[t]-1;if(s>=-32&&s<=512&&n>=-32&&n<=334||0!==this.tn&&this.Qs===t){const h=A.A.Ml(r,c.Ll[t]);if(0!==this.tn&&this.Qs===t&&this.Js===c.id?(i=this.kl-this.en,e=this.Dl-this.sn,i<5&&i>-5&&(i=0),e<5&&e>-5&&(e=0),this.nn<5&&(i=0,e=0),h.Nl(128,s+i,n+e)):0!==this.un&&this.dn===t&&this.wn===c.id?h.Nl(128,s,n):h.draw(s,n),33===h.Fl||1!==c.Ll[t]){const r=c.Ll[t];this.di?.Bl(s+i+1,n+10+e,this.Ul(r),m.A.Pl),this.di?.Bl(s+i,n+9+e,this.Ul(r),m.A.Gl)}}}else if(c.Wl&&t<20){const i=c.Wl[t];i?.draw(s,n)}t++}}else if(c.type===s.A.Yl)c.fill?y.A.fillRect(l,a,c.width,c.height,c.Hl):y.A._l(l,a,c.width,c.height,c.Hl);else if(c.type===s.A.Vl){const t=c.font;let i=c.Hl,e=c.text;if(this.$s!==c.id&&this.qs!==c.id&&this.Zs!==c.id||0===c.Kl||(i=c.Kl),this.qo(c)&&(i=c.Xl,c.jl&&c.jl.length>0&&(e=c.jl)),c.zl===s.A.Zl&&this.An&&(e='Please wait...',i=c.Hl),!t||!e)continue;for(let s=a+t.height;e.length>0;s+=t.height){if(-1!==e.indexOf('%')){for(;;){const t=e.indexOf('%1');if(-1===t)break;e=e.substring(0,t)+this.ql(this.Jo(c,0))+e.substring(t+2)}for(;;){const t=e.indexOf('%2');if(-1===t)break;e=e.substring(0,t)+this.ql(this.Jo(c,1))+e.substring(t+2)}for(;;){const t=e.indexOf('%3');if(-1===t)break;e=e.substring(0,t)+this.ql(this.Jo(c,2))+e.substring(t+2)}for(;;){const t=e.indexOf('%4');if(-1===t)break;e=e.substring(0,t)+this.ql(this.Jo(c,3))+e.substring(t+2)}for(;;){const t=e.indexOf('%5');if(-1===t)break;e=e.substring(0,t)+this.ql(this.Jo(c,4))+e.substring(t+2)}}const n=e.indexOf('\\n');let r;-1!==n?(r=e.substring(0,n),e=e.substring(n+2)):(r=e,e=''),c.$l?t.Jl(l+(c.width/2|0),s,r,i,c.Ql):t.ta(l,s,r,i,c.Ql)}}else if(c.type===s.A.ia){let t;t=this.qo(c)?c.ea:c.sa,t?.draw(l,a)}else if(c.type===s.A.na){const t=n.A.ra,i=n.A.ha;n.A.ra=l+(c.width/2|0),n.A.ha=a+(c.height/2|0);const e=n.A.sin[c.oa]*c.zoom>>16,s=n.A.cos[c.oa]*c.zoom>>16,r=this.qo(c);let h;h=r?c.cl:c.al;let o=null;if(-1===h)o=c.la(-1,-1,r);else{const t=_.A.Lo[h];t.frames&&t.aa&&(o=c.la(t.frames[c.ul],t.aa[c.ul],r))}o&&o.ca(0,c.fa,0,c.oa,0,e,s),n.A.ra=t,n.A.ha=i}else if(c.type===s.A.ua){const t=c.font;if(!t||!c.Ol||!c.Ll)continue;let i=0;for(let e=0;e0){const n=A.A.get(c.Ol[i]-1);let r=n.name;if((n.da||1!==c.Ll[i])&&(r=r+' x'+this.wa(c.Ll[i])),!r)continue;const h=l+s*(c.Sl+115),o=a+e*(c.xl+12);c.$l?t.Jl(h+(c.width/2|0),o,r,c.Hl,c.Ql):t.ta(h,o,r,c.Hl,c.Ql)}i++}}}y.A.Al(o,l,a,c)};Cl=t=>{let i=t.Il;if(i>=s.A.ya&&i<=s.A.Aa)i--,i>=this.Vh?(t.text='',t.zl=0):(t.text=this.eo[i],t.zl=1);else if(i>=s.A.ma&&i<=s.A.pa)i-=s.A.ma,i>=this.Vh?(t.text='',t.zl=0):(0===this.no[i]?t.text='@red@Offline':this.no[i]===M.it?t.text='@gre@World-'+(this.no[i]-9):t.text='@yel@World-'+(this.no[i]-9),t.zl=1);else if(i===s.A._a)t.scroll=15*this.Vh+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i>=s.A.ga&&i<=s.A.Ia)i-=s.A.ga,i>=this.fs?(t.text='',t.zl=0):(t.text=g.A.Ca(g.A.Ea(this.us[i])),t.zl=1);else if(i===s.A.va)t.scroll=15*this.fs+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i===s.A.ba){if(t.oa=150,t.fa=256*Math.sin(this.Ft/40)&2047,this.Wh){this.Wh=!1;const i=new d.fe(7,null);let e=0;for(let t=0;t<7;t++){const s=this.Yh[t];s>=0&&(i[e++]=I.A.Lo[s].la())}const s=p.A.Ta(i,e);for(let t=0;t<5;t++)0!==this.Hh[t]&&(s.Ra(u.A.Oa[t][0],u.A.Oa[t][this.Hh[t]]),1===t&&s.Ra(u.A.La[0],u.A.La[this.Hh[t]]));if(this.xh){const i=_.A.Lo[this.xh.Sa].frames;i&&(s.xa(),s.Ma(i[0]),s.ka(64,850,-30,-50,-30,!0),t.model=s)}}}else if(i===s.A.Da)this.Fe||(this.Fe=t.sa,this.Be=t.ea),this.Gh?t.sa=this.Be:t.sa=this.Fe;else if(i===s.A.Na)this.Fe||(this.Fe=t.sa,this.Be=t.ea),this.Gh?t.sa=this.Fe:t.sa=this.Be;else if(i===s.A.Fa)t.text=this.xn,this.Ft%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(i===s.A.Ba)this.Ph?this.Mn?(t.Hl=m.A.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.Hl=m.A.gl,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(i===s.A.Ua||i===s.A.Pa)if(0===this.Dn)t.text='';else{let i;i=0===this.Nn?'earlier today':1===this.Nn?'yesterday':this.Nn+' days ago',t.text='You last logged in '+i+' from: '+g.A.Ga(this.Dn)}else if(i===s.A.Wa)0===this.Bn&&(t.text='0 unread messages',t.Hl=m.A.Gl),1===this.Bn&&(t.text='1 unread message',t.Hl=m.A.GREEN),this.Bn>1&&(t.text=this.Bn+' unread messages',t.Hl=m.A.GREEN);else if(i===s.A.Ya)if(201===this.Fn)t.text='';else if(200===this.Fn)t.text='You have not yet set any password recovery questions.';else{let i;i=0===this.Fn?'Earlier today':1===this.Fn?'Yesterday':this.Fn+' days ago',t.text=i+' you changed your recovery questions'}else i===s.A.Ha?201===this.Fn?t.text='':200===this.Fn?t.text='We strongly recommend you do so now to secure your account.':t.text='If you do not remember making this change then cancel it immediately':i===s.A.Va&&(201===this.Fn?t.text='':(this.Fn,t.text="Do this from the 'account management' area on our front webpage"))};Jo=(t,i)=>{if(!t.scripts||i>=t.scripts.length)return-2;try{const e=t.scripts[i];if(!e)return-1;let n=0,r=0;for(;;){const t=e[r++];if(0===t)return n;if(1===t)n+=this.Es[e[r++]];else if(2===t)n+=this.vs[e[r++]];else if(3===t)n+=this.Cs[e[r++]];else if(4===t){const t=s.A.Lo[e[r++]],i=e[r++]+1;if(t.Ol&&t.Ll)for(let e=0;et<999999999?String(t):'*';wa=t=>{let i=String(t);for(let t=i.length-3;t>0;t-=3)i=i.substring(0,t)+','+i.substring(t);return i.length>8?i='@gre@'+i.substring(0,i.length-8)+' million @whi@('+i+')':i.length>4&&(i='@cya@'+i.substring(0,i.length-4)+'K @whi@('+i+')'),' '+i};Ul=t=>t<1e5?String(t):t<1e7?(t/1e3|0)+'K':(t/1e6|0)+'M'}},7604:(t,i,e)=>{e.d(i,{w:()=>h});var s=e(7046),n=e(1651),r=e(9234);async function h(){await async function(){0===s.A.getParameter('world').length&&s.A.setParameter('world','1');'localhost'===window.location.hostname&&'0'===s.A.getParameter('world')?(n.K.st='http://localhost',n.K.nt='http://localhost',n.K.portOffset=0):await async function(t){const i=await o(t,parseInt(s.A.getParameter('world'),10)),e=new URL(i.address);n.K.it=10+i.id-1,n.K.st=`${e.protocol}//${e.hostname}`,n.K.nt=`${e.protocol}//${e.hostname}:${e.port}`,t||(n.K.st=n.K.st.replace('https:','http:'));n.K.portOffset=i.portOffset,n.K.members=!0===i?.members,s.A.setParameter('world',i.id.toString(10))}(window.location.protocol.startsWith('https'))}(),function(){0===s.A.getParameter('detail').length&&s.A.setParameter('detail','high');'low'===s.A.getParameter('detail')?n.K.Lt():n.K.Ot()}(),0===s.A.getParameter('method').length&&s.A.setParameter('method','0')}async function o(t,i,e=0){if(e>=10)throw new Error('could not find world to connect!');const s=t?'https:':'http:';let n;try{n=JSON.parse(await(0,r.Xa)(`${s}//2004scape.org/api/v1/worldlist`))}catch(s){return await(0,r.Yo)(1e3),o(t,i,++e)}n.push({id:0,region:'Local Development',address:'http://localhost',portOffset:0,members:!0,hh:0});const h=n.find((t=>t.id===i));return h||o(t,i,10)}},9858:(t,i,e)=>{e.a(t,(async(t,i)=>{try{var s=e(1312),n=e(1302),r=e(4583),h=e(2682),o=e(8665),l=e(8534),a=e(6730),c=e(9234),f=e(1069),u=e(4544),d=e(7854),w=e(1908),y=e(1183),A=e(1651),m=e(7604);class t extends A.K{ja=[];async za(t){const i=new Map,e=(await(0,c.Xa)(t)).split('\n');for(let t=0;t{if(this.Mt)this.kt=!0;else{this.Mt=!0;try{await this.Go(10,'Connecting to fileserver'),await w.A.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new u.A(await u.A.openDatabase());const t=new f.A(new Uint8Array(await(0,c.Wo)(`${A.K.nt}/crc`)));for(let i=0;i<9;i++)this.Bt[i]=t.Ko;const i=await this.Bo('title','title screen',this.Bt[1],10);this.di=h.A.Za(i,'p11'),this.wi=h.A.Za(i,'p12'),this.yi=h.A.Za(i,'b12'),this.Ai=h.A.Za(i,'q8');const e=await this.Bo('config','config',this.Bt[2],15),d=await this.Bo('models','3d graphics',this.Bt[5],40),y=await this.Bo('textures','textures',this.Bt[6],60);await this.Go(80,'Unpacking textures'),r.A.qa(y),r.A.$a(.8),r.A.Ja(20),await this.Go(83,'Unpacking models'),o.A.Qa(d),l.A.Qa(d),a.A.Qa(d),await this.Go(86,'Unpacking config'),s.A.Qa(e),n.A.Qa(e,!0),await this.Go(100,'Getting ready to start...'),await this.tc()}catch(t){this.Dt=!0,console.error(t)}}};async tc(){const t=document.getElementById('items');if(!t)return;t.innerHTML='',this.ja[1]=await this.za(`${A.K.lt}/data/src/pack/obj.pack`);const i=document.createElement('input');i.type='text',i.placeholder='::give',i.tabIndex=-1,t.appendChild(i);const e=document.createElement('input');e.type='search',e.placeholder='Search',e.tabIndex=1,e.oninput=()=>{const t=document.querySelector('#itemList');if(!t)return;const i=e.value.toLowerCase().replaceAll(' ','_');for(let e=0;e-1||n.indexOf(i)>-1||r.indexOf(i)>-1||h.indexOf(i)>-1?s.style.display='':s.style.display='none'}},t.appendChild(e);const s=document.createElement('ul');s.id='itemList',s.className='list-group',t.appendChild(s);const h=new Set;for(const[t,i]of this.ja[1]){const i=n.A.get(t);if(null!==i.ic&&null!==i.ec)for(let t=0;t{const t=s.querySelector('.active');t&&(t.className='list-group-item list-group-item-center'),l.className='list-group-item list-group-item-center active',i.value=`::give ${e} 1`};const a=document.createElement('canvas');a.className='icon',a.width=32,a.height=32,l.appendChild(a);const c=document.createElement('p');null===o.name?c.innerText=e:c.innerText=o.name+' - '+e,l.appendChild(c);const f=new y.A(32,32,a.getContext('2d',{willReadFrequently:!0})??d.zo),u=n.A.Ml(t,1e4);f.bind(),r.A.nc(),u.draw(0,0),f.draw(0,0),s.appendChild(l)}}}await(0,m.w)(),(new t).rc().then((()=>{})),window.onkeydown=function(t){return!(' '===t.key&&t.target===document.body)},i()}catch(t){i(t)}}),1)},7046:(t,i,e)=>{e.d(i,{A:()=>a});var s=e(1183),n=e(4583),r=e(9234),h=e(9091),o=e(2595),l=e(7854);class a{static getParameter(t){return new URLSearchParams(window.location.search).get(t)??''}static setParameter(t,i){const e=new URL(window.location.toString());e.searchParams.set(t,i),window.history.pushState(null,'',e.toString())}hc=0;oc=[];lc=0;xo=null;state=0;ac=20;cc=1;fc=[];uc=0;dc=0;wc=[];yc=!0;Ac=!1;mc=50;hasFocus=!0;_c=!1;gc=0;Ic=0;kl=0;Dl=0;Cc=0;Ec=0;vc=0;bc=[];Tc=[];Rc=0;Oc=0;input=null;Lc=!1;Sc=!1;xc=!1;time=-1;Mc=0;kc=0;Dc=0;Nc=0;Fc=0;Bc=0;constructor(t=!1){l.Uc.tabIndex=-1,l.zo.fillStyle='black',l.zo.fillRect(0,0,l.Uc.width,l.Uc.height),this.Ac=t,this.Ac?this.resize(window.innerWidth,window.innerHeight):this.resize(l.Uc.width,l.Uc.height)}get width(){return l.Uc.width}get height(){return l.Uc.height}resize=(t,i)=>{l.Uc.width=t,l.Uc.height=i,this.xo=new s.A(t,i),n.A.nc()};rc=async()=>{l.Uc.addEventListener('resize',(()=>{this.Ac&&this.resize(window.innerWidth,window.innerHeight)}),!1),l.Uc.onmousedown=this.onmousedown,l.Uc.onmouseup=this.onmouseup,l.Uc.onmouseenter=this.onmouseenter,l.Uc.onmouseleave=this.onmouseleave,l.Uc.onmousemove=this.onmousemove,window.onbeforeunload=this.To,l.Uc.onfocus=this.onfocus,l.Uc.onblur=this.onblur,this.Pc?(l.Uc.ontouchstart=this.ontouchstart,l.Uc.ontouchend=this.ontouchend,l.Uc.ontouchmove=this.ontouchmove):(l.Uc.onkeydown=this.onkeydown,l.Uc.onkeyup=this.onkeyup),l.Uc.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.Pc&&'low'===a.getParameter('detail')&&(this.mc=30),await this.Go(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.fc[t]=performance.now();let t,i=0,e=256,s=1,n=0;for(;this.state>=0;){if(this.state>0&&(this.state--,0===this.state))return void this.Gc();const h=e,o=s;e=300,s=1,t=performance.now();const l=this.fc[i];if(0===l?(e=h,s=o):t>l&&(e=2560*this.ac/(t-l)|0),e<25?e=25:e>256&&(e=256,s=this.ac-(t-l)/10|0),this.fc[i]=t,i=(i+1)%10,s>1)for(let t=0;t<10;t++)0!==this.fc[t]&&(this.fc[t]+=s);for(s0&&(this.uc=1e3*e/(256*this.ac)|0);const a=performance.now();if(this.yc&&this.refresh(),await this.draw(),this.wc[this.dc]=(performance.now()-a)/1e3,this.dc=(this.dc+1)%this.wc.length,this.mc<50){const i=1e3/this.mc-(performance.now()-t);i>0&&await(0,r.Yo)(i)}}-1===this.state&&this.Gc()};Gc=()=>{this.state=-2,this.To()};Zo=t=>{this.ac=1e3/t|0};Wc=t=>{this.mc=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.ac|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};To=()=>{};draw=async()=>{};refresh=()=>{};async Go(t,i){const e=this.width,s=this.height;this.yc&&(l.zo.fillStyle='black',l.zo.fillRect(0,0,e,s),this.yc=!1);const n=s/2-18;l.zo.fillStyle='rgb(140, 17, 17)',l.zo.rect((e/2|0)-152,n,304,34),l.zo.fillRect((e/2|0)-150,n+2,3*t,30),l.zo.fillStyle='black',l.zo.fillRect((e/2|0)-150+3*t,n+2,300-3*t,30),l.zo.font='bold 13px helvetica, sans-serif',l.zo.textAlign='center',l.zo.fillStyle='white',l.zo.fillText(i,e/2|0,n+22),await(0,r.Yo)(5)}Yc=()=>{let t=-1;return this.Oc!==this.Rc&&(t=this.Tc[this.Rc],this.Rc=this.Rc+1&127),t};get ms(){const t=this.wc.length;let i=0;for(let e=0;ethis.hc&&(this.hc=e),this.oc[this.lc]=e,this.lc=(this.lc+1)%250,e}get Hc(){return this.oc.reduce(((t,i)=>t+i),0)/250}onkeydown=t=>{const i=t.key;this.gc=0;const e=h.c[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;t.ctrlKey&&(n>='A'.charCodeAt(0)&&n<=']'.charCodeAt(0)||n=='_'.charCodeAt(0)?n-='A'.charCodeAt(0)-1:n>='a'.charCodeAt(0)&&n<='z'.charCodeAt(0)&&(n-='a'.charCodeAt(0)-1)),n<30&&(n=0),s===h.c.ArrowLeft.code?n=1:s===h.c.ArrowRight.code?n=2:s===h.c.ArrowUp.code?n=3:s===h.c.ArrowDown.code?n=4:s===h.c.Control.code?n=5:s===h.c.Shift.code?n=6:s===h.c.Alt.code?n=7:s===h.c.Backspace.code||s===h.c.Delete.code?n=8:s===h.c.Tab.code?n=9:s===h.c.Enter.code?n=10:s>=h.c.F1.code&&s<=h.c.F12.code?n=s+1008-h.c.F1.code:s===h.c.Home.code?n=1e3:s===h.c.End.code?n=1001:s===h.c.PageUp.code?n=1002:s===h.c.PageDown.code&&(n=1003),n>0&&n<128&&(this.bc[n]=1),n>4&&(this.Tc[this.Oc]=n,this.Oc=this.Oc+1&127),o.A.enabled&&o.A.Vc(n),h.g.includes(i)||t.preventDefault()};onkeyup=t=>{const i=t.key;this.gc=0;const e=h.c[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;n<30&&(n=0),s===h.c.ArrowLeft.code?n=1:s===h.c.ArrowRight.code?n=2:s===h.c.ArrowUp.code?n=3:s===h.c.ArrowDown.code?n=4:s===h.c.Control.code?n=5:s===h.c.Shift.code?n=6:s===h.c.Alt.code?n=7:s===h.c.Backspace.code||s===h.c.Delete.code?n=8:s===h.c.Tab.code?n=9:s===h.c.Enter.code?n=10:s>=h.c.F1.code&&s<=h.c.F12.code?n=s+1008-h.c.F1.code:s===h.c.Home.code?n=1e3:s===h.c.End.code?n=1001:s===h.c.PageUp.code?n=1002:s===h.c.PageDown.code&&(n=1003),n>0&&n<128&&(this.bc[n]=0),o.A.enabled&&o.A.Kc(n),h.g.includes(i)||t.preventDefault()};onmousedown=t=>{if(this.Lc=!1,(t.clientX>0||t.clientY>0)&&this.Xc(t),this.gc=0,this.Ec=this.kl,this.vc=this.Dl,this.Pc&&!this.jc){if(this.zc()||this.Zc()||this.qc())return this.Cc=1,void(this.Ic=1);t.timeStamp>=this.time+500?(this.Cc=2,this.Ic=2):(this.Cc=1,this.Ic=1)}else 2===t.button?(this.Cc=2,this.Ic=2):(this.Cc=1,this.Ic=1);o.A.enabled&&o.A.$c(this.Ec,this.vc,t.buttons)};onmouseup=t=>{this.Xc(t),this.gc=0,this.Ic=0,o.A.enabled&&o.A.Jc(t.buttons)};onmouseenter=t=>{this.Xc(t),o.A.enabled&&o.A.Qc()};onmouseleave=t=>{this.Xc(t),this.gc=0,this.kl=-1,this.Dl=-1,this.Ic=0,this.Ec=-1,this.vc=-1,o.A.enabled&&o.A.tf()};onmousemove=t=>{this.Xc(t),this.gc=0,o.A.enabled&&o.A.if(this.kl,this.Dl)};onfocus=t=>{this.hasFocus=!0,this.yc=!0,this.refresh(),o.A.enabled&&o.A.ef()};onblur=t=>{this.hasFocus=!1,o.A.enabled&&o.A.sf()};ontouchstart=t=>{if(!this.Pc)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.Lc=!0;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.Mc=this.Fc=this.Dc=0|i.screenX,this.kc=this.Bc=this.Nc=0|i.screenY,this.time=t.timeStamp,this.Sc=this.nf(),this.xc=this.rf()};ontouchend=t=>{if(!this.Pc||!this.Lc)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;if(this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.Fc=0|i.screenX,this.Bc=0|i.screenY,this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.Sc&&!this.nf())return void(this.Lc=!1);if(this.xc&&!this.rf())return void(this.Lc=!1);if(this.zc()||this.hf()||this.Zc()||this.qc()){null!==this.input&&(this.input.parentNode?.contains(this.input)&&this.input.parentNode?.removeChild(this.input),this.input=null);const t=document.createElement('input');return this.Zc()?(t.setAttribute('id','username'),t.setAttribute('placeholder','Username')):this.qc()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.zc()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.hf()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this.lf?t.setAttribute('type','password'):t.setAttribute('type',this.qc()?'password':'text'),t.setAttribute('autofocus','autofocus'),t.setAttribute('spellcheck','false'),t.setAttribute('autocomplete','off'),t.setAttribute('style',`position: fixed; left: ${e}px; top: ${s}px; width: 1px; height: 1px; opacity: 0;`),document.body.appendChild(t),t.focus(),t.click(),this.lf&&(t.oninput=t=>{if(!(t instanceof InputEvent))return;const i=t,e=i.data;null!==e&&'insertText'===i.inputType&&this.onkeydown(new KeyboardEvent('keydown',{key:e,code:e}))}),t.onkeydown=t=>{this.lf&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this.lf&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeyup(new KeyboardEvent('keyup',{key:t.key,code:t.key}))},t.onfocus=t=>{this.input?.parentNode?.removeChild(this.input),this.input=null,this.onfocus(t)},this.input=t,void(this.Lc=!1)}const n=t.timeStamp>=this.time+500,r=Math.abs(this.Mc-this.Fc)>16||Math.abs(this.kc-this.Bc)>16;n&&!r?(this.Lc=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.Ic=0,this.Lc=!1)};ontouchmove=t=>{if(!this.Pc||!this.Lc)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.Fc=0|i.screenX,this.Bc=0|i.screenY,this.Sc&&-1===this.Fo()?(this.Dc-this.Fc>0?this.rotate(2):this.Dc-this.Fc<0&&this.rotate(0),this.Nc-this.Bc>0?this.rotate(3):this.Nc-this.Bc<0&&this.rotate(1)):(this.xc||-1!==this.Fo())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this.Dc=this.Fc,this.Nc=this.Bc};get Pc(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get lf(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get jc(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}nf=()=>this._c&&this.kl>=8&&this.kl<=520&&this.Dl>=11&&this.Dl<=345;zc=()=>this._c&&-1===this.No()&&!this.ko()&&!this.Do()&&this.kl>=11&&this.kl<=506&&this.Dl>=449&&this.Dl<=482;hf=()=>this._c&&(this.ko()||this.Do())&&this.kl>=11&&this.kl<=506&&this.Dl>=383&&this.Dl<=482;rf=()=>this._c&&this.kl>=562&&this.kl<=752&&this.Dl>=231&&this.Dl<=492;Zc=()=>!this._c&&2===this.Mo()&&this.kl>=301&&this.kl<=562&&this.Dl>=262&&this.Dl<=279;qc=()=>!this._c&&2===this.Mo()&&this.kl>=301&&this.kl<=562&&this.Dl>=279&&this.Dl<=296;rotate=t=>{0===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowLeft',code:'ArrowLeft'}))):1===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowUp',code:'ArrowUp'}))):2===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowRight',code:'ArrowRight'}))):3===t&&(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowDown',code:'ArrowDown'})))};af=()=>null!==document.fullscreenElement;Xc=t=>{if(this.af()){const i=t.target.getBoundingClientRect(),e=window.innerHeight/l.Uc.height,s=(window.innerWidth-l.Uc.width*e)/2;this.kl=0|this.cf(t.clientX-i.left-s,0,l.Uc.width*e,0,789),this.Dl=0|this.cf(t.clientY-i.top,0,l.Uc.height*e,0,532)}else{const i=l.Uc.getBoundingClientRect(),e=l.Uc.width/i.width,s=l.Uc.height/i.height;this.kl=(t.clientX-i.left)*e|0,this.Dl=(t.clientY-i.top)*s|0}this.kl<0&&(this.kl=0),this.Dl<0&&(this.Dl=0),this.kl>789&&(this.kl=789),this.Dl>532&&(this.Dl=532)};cf=(t,i,e,s,n)=>(t-i)*(n-s)/(e-i)+s}},2595:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1069);class n{static enabled=!1;static ff=null;static uf=null;static df=0;static wf=0;static yf=0;static Af=0;static mf=0;static pf=()=>{this.ff=s.A.Ut(1),this.uf=null,this.df=performance.now(),this.enabled=!0};static _f=()=>{this.enabled=!1,this.ff=null};static flush=()=>{let t=null;return this.uf&&this.enabled&&(t=this.uf),this.uf=null,t};static stop=()=>{let t=null;return this.ff&&this.ff.gf>0&&this.enabled&&(t=this.ff),this._f(),t};static $c=(t,i,e)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;this.wf++;const s=performance.now();let n=(s-this.df)/10|0;n>250&&(n=250),this.df=s,this.If(5),1===e?this.ff?.p1(1):this.ff?.p1(2),this.ff?.p1(n),this.ff?.p3(t+(i<<10))};static Jc=t=>{if(!this.enabled)return;this.wf++;const i=performance.now();let e=(i-this.df)/10|0;e>250&&(e=250),this.df=i,this.If(2),1===t?this.ff?.p1(3):this.ff?.p1(4),this.ff?.p1(e)};static if=(t,i)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;const e=performance.now();if(e-this.yf>=50){this.yf=e,this.wf++;let s=(e-this.df)/10|0;s>250&&(s=250),this.df=e,t-this.Af<8&&t-this.Af>=-8&&i-this.mf<8&&i-this.mf>=-8?(this.If(3),this.ff?.p1(5),this.ff?.p1(s),this.ff?.p1(t+(i-this.mf+8<<4)+8-this.Af)):t-this.Af<128&&t-this.Af>=-128&&i-this.mf<128&&i-this.mf>=-128?(this.If(4),this.ff?.p1(6),this.ff?.p1(s),this.ff?.p1(t+128-this.Af),this.ff?.p1(i+128-this.mf)):(this.If(5),this.ff?.p1(7),this.ff?.p1(s),this.ff?.p3(t+(i<<10))),this.Af=t,this.mf=i}};static Vc=t=>{if(!this.enabled)return;this.wf++;const i=performance.now();let e=(i-this.df)/10|0;e>250&&(e=250),this.df=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.If(3),this.ff?.p1(8),this.ff?.p1(e),this.ff?.p1(t)};static Kc=t=>{if(!this.enabled)return;this.wf++;const i=performance.now();let e=(i-this.df)/10|0;e>250&&(e=250),this.df=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.If(3),this.ff?.p1(9),this.ff?.p1(e),this.ff?.p1(t)};static ef=()=>{if(!this.enabled)return;this.wf++;const t=performance.now();let i=(t-this.df)/10|0;i>250&&(i=250),this.df=t,this.If(2),this.ff?.p1(10),this.ff?.p1(i)};static sf=()=>{if(!this.enabled)return;this.wf++;const t=performance.now();let i=(t-this.df)/10|0;i>250&&(i=250),this.df=t,this.If(2),this.ff?.p1(11),this.ff?.p1(i)};static Qc=()=>{if(!this.enabled)return;this.wf++;const t=performance.now();let i=(t-this.df)/10|0;i>250&&(i=250),this.df=t,this.If(2),this.ff?.p1(12),this.ff?.p1(i)};static tf=()=>{if(!this.enabled)return;this.wf++;const t=performance.now();let i=(t-this.df)/10|0;i>250&&(i=250),this.df=t,this.If(2),this.ff?.p1(13),this.ff?.p1(i)};static If=t=>{if(this.ff&&this.ff.gf+t>=500){const t=this.ff;this.ff=s.A.Ut(1),this.uf=t}}}},9091:(t,i,e)=>{e.d(i,{c:()=>n,g:()=>s});const s=['F11','F12'],n={'Backspace':{code:8,ch:8},'Enter':{code:10,ch:10},'Shift':{code:16,ch:65535},'Escape':{code:27,ch:27},'Tab':{code:9,ch:9},'CapsLock':{code:20,ch:65535},' ':{code:32,ch:32},'Control':{code:17,ch:65535},'Alt':{code:18,ch:65535},'Meta':{code:524,ch:65535},'ArrowLeft':{code:37,ch:65535},'ArrowRight':{code:39,ch:65535},'ArrowUp':{code:38,ch:65535},'ArrowDown':{code:40,ch:65535},'Insert':{code:155,ch:65535},'Home':{code:36,ch:65535},'PageUp':{code:33,ch:65535},'Delete':{code:127,ch:127},'End':{code:35,ch:65535},'PageDown':{code:34,ch:65535},'`':{code:192,ch:96},'~':{code:192,ch:126},'!':{code:49,ch:33},'@':{code:50,ch:64},'#':{code:51,ch:35},'$':{code:52,ch:36},'%':{code:53,ch:37},'^':{code:54,ch:94},'&':{code:55,ch:38},'*':{code:56,ch:42},'(':{code:57,ch:40},')':{code:48,ch:41},'-':{code:45,ch:45},'_':{code:45,ch:95},'=':{code:61,ch:61},'+':{code:61,ch:43},'[':{code:91,ch:91},'{':{code:91,ch:123},']':{code:93,ch:93},'}':{code:93,ch:125},'\\':{code:92,ch:92},'|':{code:92,ch:124},';':{code:59,ch:59},':':{code:59,ch:58},"'":{code:222,ch:39},'"':{code:222,ch:34},',':{code:44,ch:44},'<':{code:44,ch:60},'.':{code:46,ch:46},'>':{code:46,ch:62},'/':{code:47,ch:47},'?':{code:47,ch:63},'F1':{code:112,ch:65535},'F2':{code:113,ch:65535},'F3':{code:114,ch:65535},'F4':{code:115,ch:65535},'F5':{code:116,ch:65535},'F6':{code:117,ch:65535},'F7':{code:118,ch:65535},'F8':{code:119,ch:65535},'F9':{code:120,ch:65535},'F10':{code:121,ch:65535},'F11':{code:122,ch:65535},'F12':{code:123,ch:65535},0:{code:48,ch:48},1:{code:49,ch:49},2:{code:50,ch:50},3:{code:51,ch:51},4:{code:52,ch:52},5:{code:53,ch:53},6:{code:54,ch:54},7:{code:55,ch:55},8:{code:56,ch:56},9:{code:57,ch:57},'a':{code:65,ch:97},'b':{code:66,ch:98},'c':{code:67,ch:99},'d':{code:68,ch:100},'e':{code:69,ch:101},'f':{code:70,ch:102},'g':{code:71,ch:103},'h':{code:72,ch:104},'i':{code:73,ch:105},'j':{code:74,ch:106},'k':{code:75,ch:107},'l':{code:76,ch:108},'m':{code:77,ch:109},'n':{code:78,ch:110},'o':{code:79,ch:111},'p':{code:80,ch:112},'q':{code:81,ch:113},'r':{code:82,ch:114},'s':{code:83,ch:115},'t':{code:84,ch:116},'u':{code:85,ch:117},'v':{code:86,ch:118},'w':{code:87,ch:119},'x':{code:88,ch:120},'y':{code:89,ch:121},'z':{code:90,ch:122},'A':{code:65,ch:65},'B':{code:66,ch:66},'C':{code:67,ch:67},'D':{code:68,ch:68},'E':{code:69,ch:69},'F':{code:70,ch:70},'G':{code:71,ch:71},'H':{code:72,ch:72},'I':{code:73,ch:73},'J':{code:74,ch:74},'K':{code:75,ch:75},'L':{code:76,ch:76},'M':{code:77,ch:77},'N':{code:78,ch:78},'O':{code:79,ch:79},'P':{code:80,ch:80},'Q':{code:81,ch:81},'R':{code:82,ch:82},'S':{code:83,ch:83},'T':{code:84,ch:84},'U':{code:85,ch:85},'V':{code:86,ch:86},'W':{code:87,ch:87},'X':{code:88,ch:88},'Y':{code:89,ch:89},'Z':{code:90,ch:90}}},1120:(t,i,e)=>{e.d(i,{A:()=>c});var s=e(1069),n=e(8665),r=e(2679),h=e(2511),o=e(3819),l=e(3867),a=e(8950);class c{static Lo=[];static Cf=null;static So=null;static El=0;static Ef=1;static bl=2;static Yl=3;static Vl=4;static ia=5;static na=6;static ua=7;static vf=1;static bf=2;static Tf=3;static Rf=4;static Of=5;static Zl=6;static ya=1;static Aa=100;static ma=101;static pa=200;static Lf=201;static Sf=202;static _a=203;static xf=205;static Mf=300;static kf=301;static Df=302;static Nf=303;static Ff=304;static Bf=305;static Uf=306;static Pf=307;static Gf=308;static Wf=309;static Yf=310;static Hf=311;static Vf=312;static Kf=313;static Xf=314;static jf=315;static zf=316;static Zf=317;static qf=318;static $f=319;static Jf=320;static Qf=321;static tu=322;static iu=323;static Da=324;static Na=325;static eu=326;static ba=327;static ga=401;static Ia=500;static su=501;static nu=502;static va=503;static Fa=600;static ru=601;static hu=602;static ou=603;static lu=604;static au=605;static cu=606;static fu=607;static uu=608;static du=609;static wu=610;static yu=611;static Au=612;static Ba=613;static Ua=650;static Wa=651;static Ya=652;static Ha=653;static Va=654;static Pa=655;static Qa=(t,i,e)=>{this.Cf=new r.A(5e4),this.So=new r.A(5e4);const n=new s.A(t.read('data'));let h=-1;for(n.gf+=2;n.gf0){s.$o=new Uint8Array(r),s.Qo=new Uint16Array(r);for(let t=0;t0){s.scripts=new l.fe(o,null);for(let t=0;t0){const n=e.lastIndexOf(',');s.Wl[t]=this.bu(i,e.substring(0,n),parseInt(e.substring(n+1),10))}}s.Tu=new l.fe(5,null);for(let t=0;t<5;t++){const i=n.vu;s.Tu[t]=i,0===i.length&&(s.Tu[t]=null)}}if(s.type===c.Yl&&(s.fill=1===n._u),s.type===c.Vl||s.type===c.Ef){s.$l=1===n._u;const t=n._u;e&&(s.font=e[t]),s.Ql=1===n._u}if(s.type===c.Vl&&(s.text=n.vu,s.jl=n.vu),s.type!==c.Ef&&s.type!==c.Yl&&s.type!==c.Vl||(s.Hl=n.Ko),s.type!==c.Yl&&s.type!==c.Vl||(s.Xl=n.Ko,s.Kl=n.Ko),s.type===c.ia){const t=n.vu;if(t.length>0){const e=t.lastIndexOf(',');s.sa=this.bu(i,t.substring(0,e),parseInt(t.substring(e+1),10))}const e=n.vu;if(e.length>0){const t=e.lastIndexOf(',');s.ea=this.bu(i,e.substring(0,t),parseInt(e.substring(t+1),10))}}if(s.type===c.na){const t=n._u;0!==t&&(s.model=this.la((t-1<<8)+n._u));const i=n._u;0!==i&&(s.Ru=this.la((i-1<<8)+n._u)),s.al=n._u,0===s.al?s.al=-1:s.al=(s.al-1<<8)+n._u,s.cl=n._u,0===s.cl?s.cl=-1:s.cl=(s.cl-1<<8)+n._u,s.zoom=n.mu,s.oa=n.mu,s.fa=n.mu}if(s.type===c.ua){s.Ol=new Int32Array(s.width*s.height),s.Ll=new Int32Array(s.width*s.height),s.$l=1===n._u;const t=n._u;e&&(s.font=e[t]),s.Ql=1===n._u,s.Hl=n.Ko,s.Sl=n.Iu,s.xl=n.Iu,s.Cu=1===n._u,s.Tu=new l.fe(5,null);for(let t=0;t<5;t++){const i=n.vu;s.Tu[t]=i,0===i.length&&(s.Tu[t]=null)}}s.zl!==c.bf&&s.type!==c.bl||(s.Ou=n.vu,s.action=n.vu,s.Lu=n.mu),s.zl!==c.vf&&s.zl!==c.Rf&&s.zl!==c.Of&&s.zl!==c.Zl||(s.Su=n.vu,0===s.Su.length&&(s.zl===c.vf?s.Su='Ok':s.zl===c.Rf||s.zl===c.Of?s.Su='Select':s.zl===c.Zl&&(s.Su='Continue')))}this.Cf=null,this.So=null};static bu=(t,i,e)=>{const s=o.A.xu(i)<<8n|BigInt(e);if(this.Cf){const t=this.Cf.get(s);if(t)return t}let n;try{n=h.A.Za(t,i,e),this.Cf?.put(s,n)}catch(t){return null}return n};static la=t=>{if(this.So){const i=this.So.get(BigInt(t));if(i)return i}const i=n.A.model(t);return this.So?.put(BigInt(t),i),i};id=-1;pu=-1;type=-1;zl=-1;Il=0;width=0;height=0;gu=-1;$o=null;Qo=null;scripts=null;scroll=0;hide=!1;draggable=!1;Cu=!1;Eu=!1;Sl=0;xl=0;Tl=null;Rl=null;Wl=null;Tu=null;fill=!1;$l=!1;font=null;Ql=!1;text=null;jl=null;Hl=0;Xl=0;Kl=0;sa=null;ea=null;model=null;Ru=null;al=-1;cl=-1;zoom=0;oa=0;fa=0;Ou=null;action=null;Lu=-1;Su=null;ll=null;ml=null;pl=null;x=0;y=0;vl=0;Ol=null;Ll=null;ul=0;fl=0;la(t,i,e){let s=this.model;if(e&&(s=this.Ru),!s)return null;if(-1===t&&-1===i&&!s.Mu)return s;const r=n.A.ku(s,!0,!0,!1);return-1===t&&-1===i||r.xa(),-1!==t&&r.Ma(t),-1!==i&&r.Ma(i),r.ka(64,768,-50,-10,-50,!0),r}Du(){if(this.pu===this.id)return this.x;let t=c.Lo[this.pu];if(!t.ll||!t.ml||!t.pl)return this.x;let i=t.ll.indexOf(this.id);if(-1===i)return this.x;let e=t.ml[i];for(;t.pu!==t.id;){const s=c.Lo[t.pu];s.ll&&s.ml&&s.pl&&(i=s.ll.indexOf(t.id),-1!==i&&(e+=s.ml[i])),t=s}return e}Nu(){if(this.pu===this.id)return this.y;let t=c.Lo[this.pu];if(!t.ll||!t.ml||!t.pl)return this.y;let i=t.ll.indexOf(this.id);if(-1===i)return this.y;let e=t.pl[i];for(;t.pu!==t.id;){const s=c.Lo[t.pu];s.ll&&s.ml&&s.pl&&(i=s.ll.indexOf(t.id),-1!==i&&(e+=s.pl[i])),t=s}return e}outline(t){const i=this.Du(),e=this.Nu();a.A._l(i,e,this.width,this.height,t)}move(t,i){if(this.pu===this.id)return;this.x=0,this.y=0;const e=c.Lo[this.pu];if(e.ll&&e.ml&&e.pl){const s=e.ll.indexOf(this.id);-1!==s&&(e.ml[s]=t,e.pl[s]=i)}}delete(){if(this.pu===this.id)return;const t=c.Lo[this.pu];if(t.ll&&t.ml&&t.pl){const i=t.ll.indexOf(this.id);-1!==i&&(t.ll.splice(i,1),t.ml.splice(i,1),t.pl.splice(i,1))}}}},6333:(t,i,e)=>{e.d(i,{$:()=>s});class s{id;Fu=null;constructor(t){this.id=t}Bu(t){for(;;){const i=t._u;if(0===i)break;this.decode(i,t)}return this}}},2164:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(6333);class r extends n.${static count=0;static Lo=[];static Qa=t=>{const i=new s.A(t.read('flo.dat'));this.count=i.mu;for(let t=0;t(e>179&&(i=i/2|0),e>192&&(i=i/2|0),e>217&&(i=i/2|0),e>243&&(i=i/2|0),(t/4<<10)+(i/32<<7)+(e/2|0));static Pu=(t,i)=>-1===t?12345678:((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);static Gu=(t,i)=>-2===t?12345678:-1===t?(i<0?i=0:i>127&&(i=127),127-i):((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);Wu=0;texture=-1;Yu=!1;Hu=!0;Vu=0;Ku=0;Xu=0;ju=0;zu=0;Zu=0;decode(t,i){1===t?(this.Wu=i.qu,this.setColor(this.Wu)):2===t?this.texture=i._u:3===t?this.Yu=!0:5===t?this.Hu=!1:6===t?this.Fu=i.vu:console.log('Error unrecognised config code: ',t)}setColor(t){const i=(t>>16&255)/256,e=(t>>8&255)/256,s=(255&t)/256;let n=i;ei&&(h=e),s>h&&(h=s);let o=0,l=0;const a=(n+h)/2;n!==h&&(a<.5&&(l=(h-n)/(h+n)),a>=.5&&(l=(h-n)/(2-h-n)),i===h?o=(e-s)/(h-n):e===h?o=(s-i)/(h-n)+2:s===h&&(o=(i-e)/(h-n)+4)),o/=6,this.Vu=256*o|0,this.Ku=256*l|0,this.Xu=256*a|0,this.Ku<0?this.Ku=0:this.Ku>255&&(this.Ku=255),this.Xu<0?this.Xu=0:this.Xu>255&&(this.Xu=255),this.ju=a>.5?(1-a)*l*512|0:a*l*512|0,this.ju<1&&(this.ju=1),this.zu=o*this.ju|0;let c=this.Vu+(16*Math.random()|0)-8;c<0?c=0:c>255&&(c=255);let f=this.Ku+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255);let u=this.Xu+(48*Math.random()|0)-24;u<0?u=0:u>255&&(u=255),this.Zu=r.Uu(c,f,u)}}},8317:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(1069),n=e(6333),r=e(8665),h=e(3867);class o extends n.${static count=0;static Lo=[];static Qa=t=>{const i=new s.A(t.read('idk.dat'));this.count=i.mu;for(let t=0;t=40&&t<50)this.Qu[t-40]=i.mu;else if(t>=50&&t<60)this.td[t-50]=i.mu;else{if(!(t>=60&&t<70))throw new Error(`Unrecognized idk config code: ${t}`);this.Ju[t-60]=i.mu}}la(){if(!this.$u)return null;const t=new h.fe(this.$u.length,null);for(let i=0;i{e.d(i,{A:()=>c});var s=e(6333),n=e(1069),r=e(2679),h=e(8665),o=e(1023),l=e(6169),a=e(3867);class c extends s.${static count=0;static cache=null;static sd=null;static nd=null;static rd=0;static hd=new r.A(500);static od=new r.A(30);static Qa=t=>{this.sd=new n.A(t.read('loc.dat'));const i=new n.A(t.read('loc.idx'));this.count=i.mu,this.nd=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.nd||!this.sd)throw new Error('LocType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.rd=(this.rd+1)%10;const i=this.cache[this.rd];return this.sd.gf=this.nd[t],i.id=t,i.reset(),i.Bu(this.sd),i.ld||(i.ld=new Int32Array(1)),-1===i.ad&&i.ld&&(i.active=i.ld.length>0&&i.ld[0]===o.A.fd.id,i.ud&&(i.active=!0)),i};static To=()=>{this.hd=null,this.od=null,this.nd=null,this.cache=null,this.sd=null};$u=null;ld=null;name=null;dd=null;Qu=null;td=null;width=1;length=1;wd=!0;yd=!0;active=!1;ad=-1;Ad=!1;md=!1;Hu=!1;al=-1;pd=!1;_d=16;gd=0;Id=0;ud=null;Cd=-1;Ed=-1;vd=!1;bd=!0;Td=128;Rd=128;Od=128;Ld=0;Sd=0;xd=0;Md=0;kd=!1;decode(t,i){if(1===t){const t=i._u;this.$u=new Int32Array(t),this.ld=new Int32Array(t);for(let e=0;e=30&&t<39)this.ud||(this.ud=new a.fe(5,null)),this.ud[t-30]=i.vu,'hidden'===this.ud[t-30]?.toLowerCase()&&(this.ud[t-30]=null);else if(40===t){const t=i._u;this.Qu=new Uint16Array(t),this.td=new Uint16Array(t);for(let e=0;e=this.$u.length)return null;let d=this.$u[a];if(-1===d)return null;const w=this.vd!==i>3;w&&(d+=65536);let y=c.hd?.get(BigInt(d));y||(y=h.A.model(65535&d),w&&y.Wd(),c.hd?.put(BigInt(d),y));const A=128!==this.Td||128!==this.Rd||128!==this.Od,m=0!==this.Sd||0!==this.xd||0!==this.Md;let p=h.A.ku(y,!this.Qu,!this.pd,i===l.A.Yd&&-1===o&&!A&&!m);for(-1!==o&&(p.xa(),p.Ma(o),p.Hd=null,p.Vd=null);i-- >0;)p.Kd();if(this.Qu&&this.td)for(let t=0;t{e.d(i,{A:()=>l});var s=e(6333),n=e(1069),r=e(2679),h=e(8665),o=e(3867);class l extends s.${static count=0;static cache=null;static sd=null;static nd=null;static rd=0;static So=new r.A(30);static Qa=t=>{this.sd=new n.A(t.read('npc.dat'));const i=new n.A(t.read('npc.idx'));this.count=i.mu,this.nd=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.nd||!this.sd)throw new Error('NpcType not loaded!!!');for(let i=0;i<20;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.rd=(this.rd+1)%20;const i=this.cache[this.rd]=new l(t);return this.sd.gf=this.nd[t],i.Bu(this.sd),i};static To=()=>{this.So=null,this.nd=null,this.cache=null,this.sd=null};name=null;dd=null;size=1;$u=null;Ju=null;pd=!1;zd=-1;Zd=-1;qd=-1;$d=-1;Jd=-1;Qu=null;td=null;ud=null;Td=-1;Rd=-1;Od=-1;Qd=!0;tw=-1;iw=128;ew=128;decode(t,i){if(1===t){const t=i._u;this.$u=new Uint16Array(t);for(let e=0;e=30&&t<40)this.ud||(this.ud=new o.fe(5,null)),this.ud[t-30]=i.vu,'hidden'===this.ud[t-30]?.toLowerCase()&&(this.ud[t-30]=null);else if(40===t){const t=i._u;this.Qu=new Uint16Array(t),this.td=new Uint16Array(t);for(let e=0;e{e.d(i,{A:()=>u});var s=e(6333),n=e(1069),r=e(2511),h=e(2679),o=e(8665),l=e(4583),a=e(8950),c=e(9298),f=e(3867);class u extends s.${static count=0;static cache=null;static sd=null;static nd=null;static rd=0;static lw=!0;static So=new h.A(50);static aw=new h.A(200);static Qa=(t,i)=>{this.lw=i,this.sd=new n.A(t.read('obj.dat'));const e=new n.A(t.read('obj.idx'));this.count=e.mu,this.nd=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.nd||!this.sd)throw new Error('ObjType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.rd=(this.rd+1)%10;const i=this.cache[this.rd];return this.sd.gf=this.nd[t],i.id=t,i.reset(),i.Bu(this.sd),-1!==i.sc&&i.cw(),!this.lw&&i.members&&(i.name='Members Object',i.dd="Login to a members' server to use this object.",i.ud=null,i.fw=null),i};static To=()=>{this.So=null,this.aw=null,this.nd=null,this.cache=null,this.sd=null};static Ml=(t,i)=>{if(u.aw){let e=u.aw.get(BigInt(t));if(e&&e.uw!==i&&-1!==e.uw&&(e.dw(),e=null),e)return e}let e=u.get(t);if(e.ic||(i=-1),e.ic&&e.ec&&i>1){let t=-1;for(let s=0;s<10;s++)i>=e.ec[s]&&0!==e.ec[s]&&(t=e.ic[s]);-1!==t&&(e=u.get(t))}const s=new r.A(32,32),n=l.A.ra,h=l.A.ha,o=l.A.ww,f=a.A.yw,d=a.A.Aw,w=a.A.mw,y=a.A.left,A=a.A.right,m=a.A.top,p=a.A.bottom;l.A.pw=!1,a.A.bind(s.yw,32,32),a.A.fillRect(0,0,32,32,c.A.Pl),l.A.nc();const _=e._w(1),g=l.A.sin[e.gw]*e.Iw>>16,I=l.A.cos[e.gw]*e.Iw>>16;_.ca(0,e.Cw,e.Ew,e.gw,e.bw,g+(_.jd/2|0)+e.Tw,I+e.Tw);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.yw[t+32*i]&&(t>0&&s.yw[t+32*i-1]>1||i>0&&s.yw[t+32*(i-1)]>1||t<31&&s.yw[t+32*i+1]>1||i<31&&s.yw[t+32*(i+1)]>1)&&(s.yw[t+32*i]=1);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.yw[t+32*i]&&t>0&&i>0&&s.yw[t+32*(i-1)-1]>0&&(s.yw[t+32*i]=3153952);if(-1!==e.sc){const t=this.Ml(e.Rw,10),i=t.Fl,s=t.uw;t.Fl=32,t.uw=32,t.Ow(5,5,22,22),t.Fl=i,t.uw=s}return u.aw?.put(BigInt(t),s),a.A.bind(f,d,w),a.A.Al(y,m,A,p),l.A.ra=n,l.A.ha=h,l.A.ww=o,l.A.pw=!0,e.da?s.Fl=33:s.Fl=32,s.uw=i,s};model=0;name=null;dd=null;Qu=null;td=null;Iw=2e3;gw=0;Cw=0;Ew=0;bw=0;Tw=0;Lw=!1;Sw=-1;da=!1;xw=1;members=!1;ud=null;fw=null;Mw=-1;kw=-1;Dw=0;Nw=-1;Fw=-1;Bw=0;Uw=-1;Pw=-1;Gw=-1;Ww=-1;Yw=-1;Hw=-1;ic=null;ec=null;Rw=-1;sc=-1;decode(t,i){if(1===t)this.model=i.mu;else if(2===t)this.name=i.vu;else if(3===t)this.dd=i.vu;else if(4===t)this.Iw=i.mu;else if(5===t)this.gw=i.mu;else if(6===t)this.Cw=i.mu;else if(7===t)this.bw=i.Iu,this.bw>32767&&(this.bw-=65536);else if(8===t)this.Tw=i.Iu,this.Tw>32767&&(this.Tw-=65536);else if(9===t)this.Lw=!0;else if(10===t)this.Sw=i.mu;else if(11===t)this.da=!0;else if(12===t)this.xw=i.Ko;else if(16===t)this.members=!0;else if(23===t)this.Mw=i.mu,this.Dw=i.Dd;else if(24===t)this.kw=i.mu;else if(25===t)this.Nw=i.mu,this.Bw=i.Dd;else if(26===t)this.Fw=i.mu;else if(t>=30&&t<35)this.ud||(this.ud=new f.fe(5,null)),this.ud[t-30]=i.vu,'hidden'===this.ud[t-30]?.toLowerCase()&&(this.ud[t-30]=null);else if(t>=35&&t<40)this.fw||(this.fw=new f.fe(5,null)),this.fw[t-35]=i.vu;else if(40===t){const t=i._u;this.Qu=new Uint16Array(t),this.td=new Uint16Array(t);for(let e=0;e=100&&t<110&&(this.ic&&this.ec||(this.ic=new Uint16Array(10),this.ec=new Uint16Array(10)),this.ic[t-100]=i.mu,this.ec[t-100]=i.mu)}Vw(t){let i=this.Mw;if(1===t&&(i=this.Nw),-1===i)return null;let e=this.kw,s=this.Uw;1===t&&(e=this.Fw,s=this.Pw);let n=o.A.model(i);if(-1!==e){const t=o.A.model(e);if(-1===s){const i=[n,t];n=o.A.Ta(i,2)}else{const i=[n,t,o.A.model(s)];n=o.A.Ta(i,3)}}if(0===t&&0!==this.Dw&&n.translate(this.Dw,0,0),1===t&&0!==this.Bw&&n.translate(this.Bw,0,0),this.Qu&&this.td)for(let t=0;t1){let i=-1;for(let e=0;e<10;e++)t>=this.ec[e]&&0!==this.ec[e]&&(i=this.ic[e]);if(-1!==i)return u.get(i)._w(1)}if(u.So){const t=u.So.get(BigInt(this.id));if(t)return t}const i=o.A.model(this.model);if(this.Qu&&this.td)for(let t=0;t{e.d(i,{A:()=>h});var s=e(6333),n=e(1069),r=e(6730);class h extends s.${static count=0;static Lo=[];static Qa=t=>{const i=new n.A(t.read('seq.dat'));this.count=i.mu;for(let t=0;t{e.d(i,{A:()=>l});var s=e(6333),n=e(1069),r=e(1312),h=e(8665),o=e(2679);class l extends s.${static count=0;static Lo=[];static So=new o.A(30);static Qa=t=>{const i=new n.A(t.read('spotanim.dat'));this.count=i.mu;for(let t=0;t=40&&t<50)this.Qu[t-40]=i.mu;else{if(!(t>=50&&t<60))throw new Error(`Unrecognized spotanim config code: ${t}`);this.td[t-50]=i.mu}}la(){let t=l.So?.get(BigInt(this.id));if(t)return t;t=h.A.model(this.model);for(let i=0;i<6;i++)0!==this.Qu[0]&&t.Ra(this.Qu[i],this.td[i]);return l.So?.put(BigInt(this.id),t),t}}},3764:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(6333),n=e(1069);class r extends s.${static count=0;static Lo=[];static $w=[];static Jw=0;static Qa=t=>{const i=new n.A(t.read('varp.dat'));this.count=i.mu;for(let t=0;t{e.d(i,{A:()=>s});class s{static OPEN=0;static ny=1;static hy=2;static oy=4;static ly=8;static uy=s.ny<<4;static wy=s.hy<<4;static yy=s.oy<<4;static Ay=s.ly<<4;static my=256;static py=512;static _y=1024;static gy=2048;static Iy=4096;static Cy=s.py<<4;static Ey=s._y<<4;static vy=s.gy<<4;static by=s.Iy<<4;static Ty=s.my<<9;static Ry=524288;static Oy=2097152;static Ly=s.Oy|s.Ry;static Sy=s.my|s.Ly;static xy=s.hy|s.Sy;static My=s.ly|s.Sy;static ky=s.hy|s.oy|s.My;static Dy=s.wy|s.Sy;static Ny=s.ly|s.uy|s.Dy;static Fy=s.Ay|s.Sy;static By=s.ny|s.hy|s.Fy;static Uy=s.wy|s.yy|s.Fy;static Py=16777215}},670:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(9456),n=e(6169),r=e(1023),h=e(4909);class o{static Dr=4;static jr=104;static index=(t,i)=>t*o.jr+i;offsetX;Gy;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.Gy=0,this.sizeX=o.jr,this.sizeZ=o.jr,this.flags=new Int32Array(this.sizeX*this.sizeZ),this.reset()}reset=()=>{for(let t=0;t{this.flags[o.index(t-this.offsetX,i-this.Gy)]|=s.A.Oy};Yy=(t,i)=>{this.flags[o.index(t-this.offsetX,i-this.Gy)]&=~s.A.Oy};Hy=(t,i,e,r,h,o)=>{let l=s.A.my;o&&(l|=s.A.Ty);const a=t-this.offsetX,c=i-this.Gy;if(h===n.A.Vy||h===n.A.Ky){const t=e;e=r,r=t}for(let t=a;t=0&&t=0&&i{let l=s.A.my;o&&(l|=s.A.Ty);const a=t-this.offsetX,c=i-this.Gy;if(h===n.A.Vy||h===n.A.Ky){const t=e;e=r,r=t}for(let t=a;t=0&&t=0&&i{const l=t-this.offsetX,a=i-this.Gy,c=o?s.A.by:s.A.Ay,f=o?s.A.Iy:s.A.ly,u=o?s.A._y:s.A.hy,d=o?s.A.Ey:s.A.wy,w=o?s.A.py:s.A.ny,y=o?s.A.Cy:s.A.uy,A=o?s.A.gy:s.A.oy,m=o?s.A.vy:s.A.yy;e===r.A.zy.id?h===n.A.Yd?(this.add(l,a,c),this.add(l-1,a,f)):h===n.A.Vy?(this.add(l,a,u),this.add(l,a+1,d)):h===n.A.Zy?(this.add(l,a,f),this.add(l+1,a,c)):h===n.A.Ky&&(this.add(l,a,d),this.add(l,a-1,u)):e===r.A.qy.id||e===r.A.$y.id?h===n.A.Yd?(this.add(l,a,w),this.add(l-1,a+1,y)):h===n.A.Vy?(this.add(l,a,A),this.add(l+1,a+1,m)):h===n.A.Zy?(this.add(l,a,y),this.add(l+1,a-1,w)):h===n.A.Ky&&(this.add(l,a,m),this.add(l-1,a-1,A)):e===r.A.Jy.id&&(h===n.A.Yd?(this.add(l,a,u|c),this.add(l-1,a,f),this.add(l,a+1,d)):h===n.A.Vy?(this.add(l,a,u|f),this.add(l,a+1,d),this.add(l+1,a,c)):h===n.A.Zy?(this.add(l,a,d|f),this.add(l+1,a,c),this.add(l,a-1,u)):h===n.A.Ky&&(this.add(l,a,d|c),this.add(l,a-1,u),this.add(l-1,a,f))),o&&this.jy(t,i,e,h,!1)};Qy=(t,i,e,h,o)=>{const l=t-this.offsetX,a=i-this.Gy,c=o?s.A.by:s.A.Ay,f=o?s.A.Iy:s.A.ly,u=o?s.A._y:s.A.hy,d=o?s.A.Ey:s.A.wy,w=o?s.A.py:s.A.ny,y=o?s.A.Cy:s.A.uy,A=o?s.A.gy:s.A.oy,m=o?s.A.vy:s.A.yy;e===r.A.zy.id?h===n.A.Yd?(this.remove(l,a,c),this.remove(l-1,a,f)):h===n.A.Vy?(this.remove(l,a,u),this.remove(l,a+1,d)):h===n.A.Zy?(this.remove(l,a,f),this.remove(l+1,a,c)):h===n.A.Ky&&(this.remove(l,a,d),this.remove(l,a-1,u)):e===r.A.qy.id||e===r.A.$y.id?h===n.A.Yd?(this.remove(l,a,w),this.remove(l-1,a+1,y)):h===n.A.Vy?(this.remove(l,a,A),this.remove(l+1,a+1,m)):h===n.A.Zy?(this.remove(l,a,y),this.remove(l+1,a-1,w)):h===n.A.Ky&&(this.remove(l,a,m),this.remove(l-1,a-1,A)):e===r.A.Jy.id&&(h===n.A.Yd?(this.remove(l,a,u|c),this.remove(l-1,a,f),this.remove(l,a+1,d)):h===n.A.Vy?(this.remove(l,a,u|f),this.remove(l,a+1,d),this.remove(l+1,a,c)):h===n.A.Zy?(this.remove(l,a,d|f),this.remove(l+1,a,c),this.remove(l,a-1,u)):h===n.A.Ky&&(this.remove(l,a,d|c),this.remove(l,a-1,u),this.remove(l-1,a,f))),o&&this.Qy(t,i,e,h,!1)};tA=(t,i,e,h,l,a)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.Gy,u=e-this.offsetX,d=h-this.Gy,w=o.index(c,f);if(l===r.A.zy.id){if(a===n.A.Yd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Dy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.xy)===s.A.OPEN)return!0}else if(a===n.A.Vy){if(c===u&&f===d+1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.My)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Fy)===s.A.OPEN)return!0}else if(a===n.A.Zy){if(c===u+1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Dy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.xy)===s.A.OPEN)return!0}else if(a===n.A.Ky){if(c===u&&f===d-1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.My)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Fy)===s.A.OPEN)return!0}}else if(l===r.A.Jy.id){if(a===n.A.Yd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Fy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.xy)===s.A.OPEN)return!0}else if(a===n.A.Vy){if(c===u-1&&f===d&&(this.flags[w]&s.A.My)===s.A.OPEN)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.xy)===s.A.OPEN)return!0}else if(a===n.A.Zy){if(c===u-1&&f===d&&(this.flags[w]&s.A.My)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Dy)===s.A.OPEN)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1)return!0}else if(a===n.A.Ky){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Dy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Fy)===s.A.OPEN)return!0;if(c===u&&f===d-1)return!0}}else if(l===r.A.iA.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.wy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.hy)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.ly)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Ay)===s.A.OPEN)return!0}return!1};eA=(t,i,e,h,l,a)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.Gy,u=e-this.offsetX,d=h-this.Gy,w=o.index(c,f);if(l===r.A.sA.id||l===r.A.nA.id){if(l===r.A.nA.id&&(a=a+2&3),a===n.A.Yd){if(c===u+1&&f===d&&(this.flags[w]&s.A.Ay)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.hy)===s.A.OPEN)return!0}else if(a===n.A.Vy){if(c===u-1&&f===d&&(this.flags[w]&s.A.ly)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.hy)===s.A.OPEN)return!0}else if(a===n.A.Zy){if(c===u-1&&f===d&&(this.flags[w]&s.A.ly)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.wy)===s.A.OPEN)return!0}else if(a===n.A.Ky){if(c===u+1&&f===d&&(this.flags[w]&s.A.Ay)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.wy)===s.A.OPEN)return!0}}else if(l===r.A.rA.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.wy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.hy)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.ly)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Ay)===s.A.OPEN)return!0}return!1};hA=(t,i,e,n,r,l,a)=>{const c=e+r-1,f=n+l-1,u=o.index(t-this.offsetX,i-this.Gy);return t>=e&&t<=c&&i>=n&&i<=f||(t===e-1&&i>=n&&i<=f&&(this.flags[u]&s.A.ly)===s.A.OPEN&&(a&h.A.Yd)===s.A.OPEN||(t===c+1&&i>=n&&i<=f&&(this.flags[u]&s.A.Ay)===s.A.OPEN&&(a&h.A.Zy)===s.A.OPEN||(i===n-1&&t>=e&&t<=c&&(this.flags[u]&s.A.hy)===s.A.OPEN&&(a&h.A.Ky)===s.A.OPEN||i===f+1&&t>=e&&t<=c&&(this.flags[u]&s.A.wy)===s.A.OPEN&&(a&h.A.Vy)===s.A.OPEN)))};add=(t,i,e)=>{this.flags[o.index(t,i)]|=e};remove=(t,i,e)=>{this.flags[o.index(t,i)]&=s.A.Py-e}}},4909:(t,i,e)=>{e.d(i,{A:()=>s});class s{static Vy=1;static Zy=2;static Ky=4;static Yd=8}},6169:(t,i,e)=>{e.d(i,{A:()=>s});class s{static Yd=0;static Vy=1;static Zy=2;static Ky=3}},5599:(t,i,e)=>{e.d(i,{A:()=>s});class s{static oA=0;static lA=1;static aA=2;static cA=3}},1023:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5599);class n{static zy=new n(0,s.A.oA);static qy=new n(1,s.A.oA);static Jy=new n(2,s.A.oA);static $y=new n(3,s.A.oA);static fA=new n(4,s.A.lA);static uA=new n(5,s.A.lA);static sA=new n(6,s.A.lA);static nA=new n(7,s.A.lA);static rA=new n(8,s.A.lA);static iA=new n(9,s.A.aA);static fd=new n(10,s.A.aA);static dA=new n(11,s.A.aA);static wA=new n(12,s.A.aA);static yA=new n(13,s.A.aA);static AA=new n(14,s.A.aA);static mA=new n(15,s.A.aA);static pA=new n(16,s.A.aA);static _A=new n(17,s.A.aA);static gA=new n(18,s.A.aA);static IA=new n(19,s.A.aA);static CA=new n(20,s.A.aA);static EA=new n(21,s.A.aA);static cA=new n(22,s.A.cA);static values(){return[this.zy,this.qy,this._A,this.mA,this.Jy,this.AA,this.iA,this.$y,this.cA,this.wA,this.dA,this.sA,this.CA,this.fd,this.uA,this.yA,this.nA,this.fA,this.pA,this.rA,this.IA,this.EA,this.gA]}static of(t){const i=this.values();for(let e=0;e{e.d(i,{A:()=>A});var s=e(670),n=e(2164),r=e(1069),h=e(4583),o=e(3045),l=e(5637),a=e(4197),c=e(1312),f=e(1023),u=e(6169),d=e(9298),w=e(5518),y=e(3867);class A{static vA=Int8Array.of(1,2,4,8);static bA=Uint8Array.of(16,32,64,128);static TA=Int8Array.of(1,0,-1,0);static RA=Int8Array.of(0,-1,0,1);static OA=(17*Math.random()|0)-8;static LA=(33*Math.random()|0)-16;static et=!0;static SA=0;static xA=!1;static MA=(t,i)=>{let e=this.kA(t+45365,i+91923,4)+(this.kA(t+10294,i+37821,2)-128>>1)+(this.kA(t,i,1)-128>>2)-128;return e=35+(.3*e|0),e<10?e=10:e>60&&(e=60),e};static kA=(t,i,e)=>{const s=t/e|0,n=t&e-1,r=i/e|0,h=i&e-1,o=this.DA(s,r),l=this.DA(s+1,r),a=this.DA(s,r+1),c=this.DA(s+1,r+1),f=this.NA(o,l,n,e),u=this.NA(a,c,n,e);return this.NA(f,u,h,e)};static NA=(t,i,e,s)=>{const n=65536-h.A.cos[1024*e/s|0]>>1;return(t*(65536-n)>>16)+(i*n>>16)};static DA=(t,i)=>((this.FA(t-1,i-1)+this.FA(t+1,i-1)+this.FA(t-1,i+1)+this.FA(t+1,i+1))/16|0)+((this.FA(t-1,i)+this.FA(t+1,i)+this.FA(t,i-1)+this.FA(t,i+1))/8|0)+(this.FA(t,i)/4|0);static FA=(t,i)=>{const e=t+57*i,s=BigInt(e<<13^e);return 255&Number((s*(s*s*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static Hy=(t,i,e,s,n,r,h,o,d,w,y)=>{const m=n[y][i][e],p=n[y][i+1][e],_=n[y][i+1][e+1],g=n[y][i][e+1],I=m+p+_+g>>2,C=l.A.get(o);let E=i+(e<<7)+(o<<14)+1073741824|0;C.active||(E+=-2147483648),E|=0;const v=(w<<6)+d<<24>>24;if(d===f.A.cA.id)s?.BA(C.la(f.A.cA.id,w,m,p,_,g,-1),t,i,e,I,E,v),C.wd&&C.active&&h?.Wy(i,e),-1!==C.al&&r.UA(new a.A(o,t,3,i,e,c.A.Lo[C.al],!0));else if(d===f.A.fd.id||d===f.A.dA.id){const n=C.la(f.A.fd.id,w,m,p,_,g,-1);if(n){let r,h,o=0;d===f.A.dA.id&&(o+=256),w===u.A.Vy||w===u.A.Ky?(r=C.length,h=C.width):(r=C.width,h=C.length),s?.Hy(t,i,e,I,n,null,E,v,r,h,o)}C.wd&&h?.Hy(i,e,C.width,C.length,w,C.yd),-1!==C.al&&r.UA(new a.A(o,t,2,i,e,c.A.Lo[C.al],!0))}else if(d>=f.A.wA.id)s?.Hy(t,i,e,I,C.la(d,w,m,p,_,g,-1),null,E,v,1,1,0),C.wd&&h?.Hy(i,e,C.width,C.length,w,C.yd),-1!==C.al&&r.UA(new a.A(o,t,2,i,e,c.A.Lo[C.al],!0));else if(d===f.A.zy.id)s?.jy(t,i,e,I,A.vA[w],0,C.la(f.A.zy.id,w,m,p,_,g,-1),null,E,v),C.wd&&h?.jy(i,e,d,w,C.yd),-1!==C.al&&r.UA(new a.A(o,t,0,i,e,c.A.Lo[C.al],!0));else if(d===f.A.qy.id)s?.jy(t,i,e,I,A.bA[w],0,C.la(f.A.qy.id,w,m,p,_,g,-1),null,E,v),C.wd&&h?.jy(i,e,d,w,C.yd),-1!==C.al&&r.UA(new a.A(o,t,0,i,e,c.A.Lo[C.al],!0));else if(d===f.A.Jy.id){const n=w+1&3;s?.jy(t,i,e,I,A.vA[w],A.vA[n],C.la(f.A.Jy.id,w+4,m,p,_,g,-1),C.la(f.A.Jy.id,n,m,p,_,g,-1),E,v),C.wd&&h?.jy(i,e,d,w,C.yd),-1!==C.al&&r.UA(new a.A(o,t,0,i,e,c.A.Lo[C.al],!0))}else if(d===f.A.$y.id)s?.jy(t,i,e,I,A.bA[w],0,C.la(f.A.$y.id,w,m,p,_,g,-1),null,E,v),C.wd&&h?.jy(i,e,d,w,C.yd),-1!==C.al&&r.UA(new a.A(o,t,0,i,e,c.A.Lo[C.al],!0));else if(d===f.A.iA.id)s?.Hy(t,i,e,I,C.la(d,w,m,p,_,g,-1),null,E,v,1,1,0),C.wd&&h?.Hy(i,e,C.width,C.length,w,C.yd),-1!==C.al&&r.UA(new a.A(o,t,2,i,e,c.A.Lo[C.al],!0));else if(d===f.A.fA.id)s?.PA(t,i,e,I,0,0,E,C.la(f.A.fA.id,u.A.Yd,m,p,_,g,-1),v,512*w,A.vA[w]),-1!==C.al&&r.UA(new a.A(o,t,1,i,e,c.A.Lo[C.al],!0));else if(d===f.A.uA.id){let n=16;if(s){const r=s.GA(t,i,e);r>0&&(n=l.A.get(r>>14&32767)._d)}s?.PA(t,i,e,I,A.TA[w]*n,A.RA[w]*n,E,C.la(f.A.fA.id,u.A.Yd,m,p,_,g,-1),v,512*w,A.vA[w]),-1!==C.al&&r.UA(new a.A(o,t,1,i,e,c.A.Lo[C.al],!0))}else d===f.A.sA.id?(s?.PA(t,i,e,I,0,0,E,C.la(f.A.fA.id,u.A.Yd,m,p,_,g,-1),v,w,256),-1!==C.al&&r.UA(new a.A(o,t,1,i,e,c.A.Lo[C.al],!0))):d===f.A.nA.id?(s?.PA(t,i,e,I,0,0,E,C.la(f.A.fA.id,u.A.Yd,m,p,_,g,-1),v,w,512),-1!==C.al&&r.UA(new a.A(o,t,1,i,e,c.A.Lo[C.al],!0))):d===f.A.rA.id&&(s?.PA(t,i,e,I,0,0,E,C.la(f.A.fA.id,u.A.Yd,m,p,_,g,-1),v,w,768),-1!==C.al&&r.UA(new a.A(o,t,1,i,e,c.A.Lo[C.al],!0)))};WA;YA;Hr;Vr;HA;VA;KA;XA;jA;zA;ZA;qA;$A;JA;QA;tm;constructor(t,i,e,n){this.WA=t,this.YA=i,this.Hr=e,this.Vr=n,this.HA=new y.im(s.A.Dr,t,i),this.VA=new y.im(s.A.Dr,t,i),this.KA=new y.im(s.A.Dr,t,i),this.XA=new y.im(s.A.Dr,t,i),this.tm=new y.sm(s.A.Dr,t+1,i+1),this.jA=new y.im(s.A.Dr,t+1,i+1),this.zA=new y.Xr(t+1,i+1),this.ZA=new Int32Array(i),this.qA=new Int32Array(i),this.$A=new Int32Array(i),this.JA=new Int32Array(i),this.QA=new Int32Array(i)}nm=(t,i)=>{for(let t=0;t=0&&i[s]?.Wy(e,n)}A.OA+=(5*Math.random()|0)-2,A.OA<-8?A.OA=-8:A.OA>8&&(A.OA=8),A.LA+=(5*Math.random()|0)-2,A.LA<-16?A.LA=-16:A.LA>16&&(A.LA=16);for(let i=0;i>8;for(let t=1;t>2)+(e[n+1][t]>>3)+(e[n][t-1]>>2)+(e[n][t+1]>>3)+(e[n][t]>>1);this.zA[n][t]=u-d}for(let t=0;t=0&&s0){const i=n.A.Lo[e-1];this.ZA[t]+=i.zu,this.qA[t]+=i.Ku,this.$A[t]+=i.Xu,this.JA[t]+=i.ju,r=this.QA[t]++}}const h=e-5;if(h>=0&&h0){const i=n.A.Lo[e-1];this.ZA[t]-=i.zu,this.qA[t]-=i.Ku,this.$A[t]-=i.Xu,this.JA[t]-=i.ju,r=this.QA[t]--}}}if(e>=1&&e=0&&f=0&&y=1&&c0||y>0){const m=this.Hr[i][e][c],p=this.Hr[i][e+1][c],_=this.Hr[i][e+1][c+1],g=this.Hr[i][e][c+1],I=this.zA[e][c],C=this.zA[e+1][c],E=this.zA[e+1][c+1],v=this.zA[e][c+1];let b=-1,T=-1;if(f>0){const t=256*s/l|0,i=r/a|0;let e=o/a|0;b=n.A.Uu(t,i,e);const h=t+A.OA&255;e+=A.LA,e<0?e=0:e>255&&(e=255),T=n.A.Uu(h,i,e)}if(i>0){let t=0!==f||this.KA[i][e][c]===w.A.hm;y>0&&!n.A.Lo[y-1].Hu&&(t=!1),t&&m===p&&m===_&&m===g&&(this.tm[i][e][c]|=2340)}let R=0;if(-1!==b&&(R=h.A.palette[n.A.Pu(T,96)]),0===y)t?.om(i,e,c,w.A.hm,u.A.Yd,-1,m,p,_,g,n.A.Pu(b,I),n.A.Pu(b,C),n.A.Pu(b,E),n.A.Pu(b,v),d.A.Pl,d.A.Pl,d.A.Pl,d.A.Pl,R,d.A.Pl);else{const s=this.KA[i][e][c]+1,r=this.XA[i][e][c],o=n.A.Lo[y-1];let l,a,f=o.texture;f>=0?(a=h.A.lm(f),l=-1):o.Wu===d.A.am?(a=0,l=-2,f=-1):(l=n.A.Uu(o.Vu,o.Ku,o.Xu),a=h.A.palette[n.A.Gu(o.Zu,96)]),t?.om(i,e,c,s,r,f,m,p,_,g,n.A.Pu(b,I),n.A.Pu(b,C),n.A.Pu(b,E),n.A.Pu(b,v),n.A.Gu(l,I),n.A.Gu(l,C),n.A.Gu(l,E),n.A.Gu(l,v),R,a)}}}}}}for(let e=1;e0&&(t<<=3,i<<=3,e<<=3);for(let s=0;s<=n;s++)for(let r=0;r<=this.YA;r++)for(let h=0;h<=this.WA;h++){if(this.tm[s][h][r]&t){let i=r,e=r,l=s,a=s;for(;i>0&&this.tm[s][h][i-1]&t;)i--;for(;e0;){for(let s=i;s<=e;s++)if(!(this.tm[l-1][h][s]&t))break t;l--}t:for(;a=8){const s=this.Hr[a][h][i]-240,r=this.Hr[l][h][i];o.A.wm(n,1,128*h,s,128*i,128*h,r,128*e+128);for(let s=l;s<=a;s++)for(let n=i;n<=e;n++)this.tm[s][h][n]&=~t}}if(this.tm[s][h][r]&i){let t=h,e=h,l=s,a=s;for(;t>0&&this.tm[s][t-1][r]&i;)t--;for(;e0;){for(let s=t;s<=e;s++)if(!(this.tm[l-1][s][r]&i))break t;l--}t:for(;a=8){const s=this.Hr[a][t][r]-240,h=this.Hr[l][t][r];o.A.wm(n,2,128*t,s,128*r,128*e+128,h,128*r);for(let s=l;s<=a;s++)for(let n=t;n<=e;n++)this.tm[s][n][r]&=~i}}if(this.tm[s][h][r]&e){let t=h,i=h,l=r,a=r;for(;l>0&&this.tm[s][h][l-1]&e;)l--;for(;a0;){for(let i=l;i<=a;i++)if(!(this.tm[s][t-1][i]&e))break t;t--}t:for(;i=4){const r=this.Hr[s][t][l];o.A.wm(n,4,128*t,r,128*l,128*i+128,r,128*a+128);for(let n=t;n<=i;n++)for(let t=l;t<=a;t++)this.tm[s][n][t]&=~e}}}}}};ym=(t,i,e,r)=>{let h=0;for(let t=0;t>24;break}for(let n=t;n=0&&t=0&&n{const o=new r.A(new Uint8Array(h));for(let r=0;r=0&&a=0&&c>24,this.XA[r][a][c]=(f-2&3)<<24>>24):f<=81?this.Vr[r][a][c]=f-49<<24>>24:this.HA[r][a][c]=f-81<<24>>24}else for(;f=o._u,0!==f;){if(1===f){o._u;break}f<=49&&o._u}}};pm=(t,i,e,n,h,o)=>{const l=new r.A(new Uint8Array(n));let a=-1;for(;;){const n=l._m;if(0===n)return;a+=n;let r=0;for(;;){const n=l._m;if(0===n)break;r+=n-1;const c=63&r,f=r>>6&63,u=r>>12,d=l._u,w=d>>2,y=3&d,A=f+h,m=c+o;if(A>0&&m>0&&A=0&&(n=e[s]),this.Hy(u,A,m,t,i,n,a,w,y)}}}};Hy=(t,i,e,s,n,r,h,o,d)=>{if(A.et){if(16&this.Vr[t][i][e])return;if(this.rm(t,i,e)!==A.SA)return}const w=this.Hr[t][i][e],y=this.Hr[t][i+1][e],m=this.Hr[t][i+1][e+1],p=this.Hr[t][i][e+1],_=w+y+m+p>>2,g=l.A.get(h);let I=i+(e<<7)+(h<<14)+1073741824|0;g.active||(I+=-2147483648),I|=0;const C=(d<<6)+o<<24>>24;if(o===f.A.cA.id)(!A.et||g.active||g.kd)&&(s?.BA(g.la(f.A.cA.id,d,w,y,m,p,-1),t,i,e,_,I,C),g.wd&&g.active&&r?.Wy(i,e),-1!==g.al&&n.UA(new a.A(h,t,3,i,e,c.A.Lo[g.al],!0)));else if(o===f.A.fd.id||o===f.A.dA.id){const l=g.la(f.A.fd.id,d,w,y,m,p,-1);if(l){let n,r,h=0;if(o===f.A.dA.id&&(h+=256),d===u.A.Vy||d===u.A.Ky?(n=g.length,r=g.width):(n=g.width,r=g.length),s?.Hy(t,i,e,_,l,null,I,C,n,r,h)&&g.bd)for(let s=0;s<=n;s++)for(let n=0;n<=r;n++){let r=l.gm/4|0;r>30&&(r=30),r>this.jA[t][i+s][e+n]&&(this.jA[t][i+s][e+n]=r<<24>>24)}}g.wd&&r?.Hy(i,e,g.width,g.length,d,g.yd),-1!==g.al&&n.UA(new a.A(h,t,2,i,e,c.A.Lo[g.al],!0))}else if(o>=f.A.wA.id)s?.Hy(t,i,e,_,g.la(o,d,w,y,m,p,-1),null,I,C,1,1,0),o>=f.A.wA.id&&o<=f.A._A.id&&o!==f.A.yA.id&&t>0&&(this.tm[t][i][e]|=2340),g.wd&&r?.Hy(i,e,g.width,g.length,d,g.yd),-1!==g.al&&n.UA(new a.A(h,t,2,i,e,c.A.Lo[g.al],!0));else if(o===f.A.zy.id)s?.jy(t,i,e,_,A.vA[d],0,g.la(f.A.zy.id,d,w,y,m,p,-1),null,I,C),d===u.A.Yd?(g.bd&&(this.jA[t][i][e]=50,this.jA[t][i][e+1]=50),g.Hu&&(this.tm[t][i][e]|=585)):d===u.A.Vy?(g.bd&&(this.jA[t][i][e+1]=50,this.jA[t][i+1][e+1]=50),g.Hu&&(this.tm[t][i][e+1]|=1170)):d===u.A.Zy?(g.bd&&(this.jA[t][i+1][e]=50,this.jA[t][i+1][e+1]=50),g.Hu&&(this.tm[t][i+1][e]|=585)):d===u.A.Ky&&(g.bd&&(this.jA[t][i][e]=50,this.jA[t][i+1][e]=50),g.Hu&&(this.tm[t][i][e]|=1170)),g.wd&&r?.jy(i,e,o,d,g.yd),-1!==g.al&&n.UA(new a.A(h,t,0,i,e,c.A.Lo[g.al],!0)),16!==g._d&&s?.Im(t,i,e,g._d);else if(o===f.A.qy.id)s?.jy(t,i,e,_,A.bA[d],0,g.la(f.A.qy.id,d,w,y,m,p,-1),null,I,C),g.bd&&(d===u.A.Yd?this.jA[t][i][e+1]=50:d===u.A.Vy?this.jA[t][i+1][e+1]=50:d===u.A.Zy?this.jA[t][i+1][e]=50:d===u.A.Ky&&(this.jA[t][i][e]=50)),g.wd&&r?.jy(i,e,o,d,g.yd),-1!==g.al&&n.UA(new a.A(h,t,0,i,e,c.A.Lo[g.al],!0));else if(o===f.A.Jy.id){const l=d+1&3;s?.jy(t,i,e,_,A.vA[d],A.vA[l],g.la(f.A.Jy.id,d+4,w,y,m,p,-1),g.la(f.A.Jy.id,l,w,y,m,p,-1),I,C),g.Hu&&(d===u.A.Yd?(this.tm[t][i][e]|=265,this.tm[t][i][e+1]|=1170):d===u.A.Vy?(this.tm[t][i][e+1]|=1170,this.tm[t][i+1][e]|=585):d===u.A.Zy?(this.tm[t][i+1][e]|=585,this.tm[t][i][e]|=1170):d===u.A.Ky&&(this.tm[t][i][e]|=1170,this.tm[t][i][e]|=585)),g.wd&&r?.jy(i,e,o,d,g.yd),-1!==g.al&&n.UA(new a.A(h,t,0,i,e,c.A.Lo[g.al],!0)),16!==g._d&&s?.Im(t,i,e,g._d)}else if(o===f.A.$y.id)s?.jy(t,i,e,_,A.bA[d],0,g.la(f.A.$y.id,d,w,y,m,p,-1),null,I,C),g.bd&&(d===u.A.Yd?this.jA[t][i][e+1]=50:d===u.A.Vy?this.jA[t][i+1][e+1]=50:d===u.A.Zy?this.jA[t][i+1][e]=50:d===u.A.Ky&&(this.jA[t][i][e]=50)),g.wd&&r?.jy(i,e,o,d,g.yd),-1!==g.al&&n.UA(new a.A(h,t,0,i,e,c.A.Lo[g.al],!0));else if(o===f.A.iA.id)s?.Hy(t,i,e,_,g.la(o,d,w,y,m,p,-1),null,I,C,1,1,0),g.wd&&r?.Hy(i,e,g.width,g.length,d,g.yd),-1!==g.al&&n.UA(new a.A(h,t,2,i,e,c.A.Lo[g.al],!0));else if(o===f.A.fA.id)s?.PA(t,i,e,_,0,0,I,g.la(f.A.fA.id,u.A.Yd,w,y,m,p,-1),C,512*d,A.vA[d]),-1!==g.al&&n.UA(new a.A(h,t,1,i,e,c.A.Lo[g.al],!0));else if(o===f.A.uA.id){let r=16;if(s){const n=s.GA(t,i,e);n>0&&(r=l.A.get(n>>14&32767)._d)}s?.PA(t,i,e,_,A.TA[d]*r,A.RA[d]*r,I,g.la(f.A.fA.id,u.A.Yd,w,y,m,p,-1),C,512*d,A.vA[d]),-1!==g.al&&n.UA(new a.A(h,t,1,i,e,c.A.Lo[g.al],!0))}else o===f.A.sA.id?(s?.PA(t,i,e,_,0,0,I,g.la(f.A.fA.id,u.A.Yd,w,y,m,p,-1),C,d,256),-1!==g.al&&n.UA(new a.A(h,t,1,i,e,c.A.Lo[g.al],!0))):o===f.A.nA.id?(s?.PA(t,i,e,_,0,0,I,g.la(f.A.fA.id,u.A.Yd,w,y,m,p,-1),C,d,512),-1!==g.al&&n.UA(new a.A(h,t,1,i,e,c.A.Lo[g.al],!0))):o===f.A.rA.id&&(s?.PA(t,i,e,_,0,0,I,g.la(f.A.fA.id,u.A.Yd,w,y,m,p,-1),C,d,768),-1!==g.al&&n.UA(new a.A(h,t,1,i,e,c.A.Lo[g.al],!0)))};rm=(t,i,e)=>8&this.Vr[t][i][e]?0:t<=0||!(2&this.Vr[1][i][e])?t:t-1}},3045:(t,i,e)=>{e.d(i,{A:()=>_});var s=e(4583),n=e(1161),r=e(3795),h=e(8256),o=e(670),l=e(9222),a=e(6855),c=e(7441),f=e(6666),u=e(5748),d=e(3479),w=e(8950),y=e(2771),A=e(5518),m=e(6169),p=e(3867);class _{static Cm=new p.Em(8,32,51,51,!1);static vm=new p.fe(100,null);static bm=new Int32Array(o.A.Dr);static Tm=new p.Rm(o.A.Dr,500,null);static Om=new p.fe(500,null);static Lm=new f.A;static Sm=0;static xm=0;static Mm=0;static km=0;static Dm=0;static Nm=0;static Fm=0;static Bm=0;static Um=0;static Pm=0;static Gm=0;static Wm=0;static Ym=0;static Hm=0;static Vm=0;static Km=0;static Xm=0;static jm=0;static zm=0;static Zm=0;static qm=0;static $m=0;static Jm=!1;static Qm=null;static tp=Uint8Array.of(19,55,38,155,255,110,137,205,76);static ip=Uint8Array.of(160,192,80,96,0,144,80,48,160);static ep=Uint8Array.of(76,8,137,4,0,1,38,2,19);static sp=Int8Array.of(0,0,2,0,0,2,1,1,0);static np=Int8Array.of(2,0,0,2,0,0,0,4,4);static rp=Int8Array.of(0,4,4,8,0,0,8,0,0);static hp=Int8Array.of(1,1,0,0,0,8,0,0,8);static op=Int8Array.of(53,-53,-53,53);static lp=Int8Array.of(-53,-53,53,53);static ap=Int8Array.of(-45,45,45,-45);static cp=Int8Array.of(45,45,-45,-45);static fp=[new Int8Array(16),Int8Array.of(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,0,0,0,1,1,0,0,1,1,1,0,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1),Int8Array.of(0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0),Int8Array.of(0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0),Int8Array.of(1,1,1,1,1,1,1,1,0,1,1,1,0,0,1,1),Int8Array.of(1,1,1,1,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,0,0,0,0,1,1,0,1,1,1,0,1,1,1),Int8Array.of(0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1)];static up=[Int8Array.of(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),Int8Array.of(12,8,4,0,13,9,5,1,14,10,6,2,15,11,7,3),Int8Array.of(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0),Int8Array.of(3,7,11,15,2,6,10,14,1,5,9,13,0,4,8,12)];static dp=Int32Array.of(41,39248,41,4643,41,41,41,41,41,41,41,41,41,41,41,43086,41,41,41,41,41,41,41,8602,41,28992,41,41,41,41,41,5056,41,41,41,41,41,41,41,41,41,41,41,41,41,41,3131,41,41,41);static wp=0;static kl=0;static Dl=0;static yp=-1;static Ap=-1;static et=!0;static init=(t,i,e,n,r)=>{this.xm=0,this.Mm=0,this.km=t,this.Dm=i,this.Nm=t/2|0,this.Fm=i/2|0;const h=new p.Em(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let i=0;i<2048;i+=64){this.Bm=s.A.sin[t],this.Um=s.A.cos[t],this.Pm=s.A.sin[i],this.Gm=s.A.cos[i];const o=(t-128)/32|0,l=i/64|0;for(let t=-26;t<=26;t++)for(let i=-26;i<=26;i++){const s=128*t,a=128*i;let c=!1;for(let t=-e;t<=n;t+=128)if(this.mp(s,a,r[o]+t)){c=!0;break}h[o][l][t+25+1][i+25+1]=c}}for(let t=0;t<8;t++)for(let i=0;i<32;i++)for(let e=-25;e<25;e++)for(let s=-25;s<25;s++){let n=!1;t:for(let r=-1;r<=1;r++)for(let o=-1;o<=1;o++){if(h[t][i][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t][(i+1)%31][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][i][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][(i+1)%31][e+r+25+1][s+o+25+1]){n=!0;break t}}this.Cm[t][i][e+25][s+25]=n}};static To=()=>{this.vm=null,this.bm=null,this.Tm=null,this.Lm=null,this.Cm=null,this.Om=null,this.Qm=null,console.log('World3D unloaded!')};static wm=(t,i,e,s,n,r,o,l)=>{_.Tm[t][_.bm[t]++]=new h.A(e/128|0,r/128|0,n/128|0,l/128|0,i,e,r,n,l,s,o)};static mp=(t,i,e)=>{const s=i*this.Pm+t*this.Gm>>16,n=i*this.Gm-t*this.Pm>>16,r=e*this.Bm+n*this.Um>>16,h=e*this.Um-n*this.Bm>>16;if(r<50||r>3500)return!1;const o=this.Nm+((s<<9)/r|0),l=this.Fm+((h<<9)/r|0);return o>=this.xm&&o<=this.km&&l>=this.Mm&&l<=this.Dm};pp;WA;YA;_p;gp;Ih;Ip;Cp;Ep;vp=0;bp=0;Tp=0;constructor(t,i,e,s){this.pp=e,this.WA=s,this.YA=i,this.gp=new p.Eh(e,s,i,null),this.Ip=new p.sm(e,s+1,i+1),this._p=t,this.Ih=new p.fe(5e3,null),this.Cp=new Int32Array(1e4),this.Ep=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this.bp=t;for(let i=0;i{const e=this.gp[0][t][i];for(let e=0;e<3;e++){this.gp[e][t][i]=this.gp[e+1][t][i];const s=this.gp[e][t][i];s&&s.level--}this.gp[0][t][i]||(this.gp[0][t][i]=new r.A(0,t,i));const s=this.gp[0][t][i];s&&(s.Op=e),this.gp[3][t][i]=null};fm=(t,i,e,s)=>{const n=this.gp[t][i][e];n&&(n.Lp=s)};om=(t,i,e,s,n,h,o,l,a,c,f,u,w,m,p,_,g,I,C,E)=>{if(s===A.A.hm){for(let s=t;s>=0;s--)this.gp[s][i][e]||(this.gp[s][i][e]=new r.A(s,i,e));const s=this.gp[t][i][e];s&&(s.Sp=new d.A(f,u,w,m,-1,C,!1))}else if(s===A.A.xp){for(let s=t;s>=0;s--)this.gp[s][i][e]||(this.gp[s][i][e]=new r.A(s,i,e));const s=this.gp[t][i][e];s&&(s.Sp=new d.A(p,_,g,I,h,E,o===l&&o===a&&o===c))}else{for(let s=t;s>=0;s--)this.gp[s][i][e]||(this.gp[s][i][e]=new r.A(s,i,e));const d=this.gp[t][i][e];d&&(d.Mp=new y.A(i,s,_,l,w,n,f,c,E,p,h,I,C,a,g,m,o,e,u))}};BA=(t,i,e,s,n,h,o)=>{this.gp[i][e][s]||(this.gp[i][e][s]=new r.A(i,e,s));const a=this.gp[i][e][s];a&&(a.kp=new l.A(n,128*e+64,128*s+64,t,h,o))};Dp=(t,i,e)=>{const s=this.gp[t][i][e];s&&(s.kp=null)};Np=(t,i,e,s,n,h,o,l)=>{let a=0;const c=this.gp[s][t][i];if(c)for(let t=0;ta&&(a=e)}else this.gp[s][t][i]=new r.A(s,t,i);const f=this.gp[s][t][i];f&&(f.Up=new u.A(e,128*t+64,128*i+64,h,o,l,n,a))};Pp=(t,i,e)=>{const s=this.gp[t][i][e];s&&(s.Up=null)};jy=(t,i,e,s,n,h,o,l,c,f)=>{if(!o&&!l)return;for(let s=t;s>=0;s--)this.gp[s][i][e]||(this.gp[s][i][e]=new r.A(s,i,e));const u=this.gp[t][i][e];u&&(u.Gp=new a.A(s,128*i+64,128*e+64,n,h,o,l,c,f))};Qy=(t,i,e,s)=>{const n=this.gp[t][i][e];1===s&&n&&(n.Gp=null)};PA=(t,i,e,s,n,h,o,l,a,f,u)=>{if(!l)return;for(let s=t;s>=0;s--)this.gp[s][i][e]||(this.gp[s][i][e]=new r.A(s,i,e));const d=this.gp[t][i][e];d&&(d.Wp=new c.A(s,128*i+n+64,128*e+h+64,u,f,l,o,a))};Yp=(t,i,e)=>{const s=this.gp[t][i][e];s&&(s.Wp=null)};Im=(t,i,e,s)=>{const n=this.gp[t][i][e];if(!n)return;const r=n.Wp;if(!r)return;const h=128*i+64,o=128*e+64;r.x=h+((r.x-h)*s/16|0),r.z=o+((r.z-o)*s/16|0)};Hp=(t,i,e,s)=>{if(!s)return;const n=this.gp[t][i][e];if(!n)return;const r=n.Wp;r&&(r.model=s)};Vp=(t,i,e,s)=>{if(!s)return;const n=this.gp[t][i][e];if(!n)return;const r=n.kp;r&&(r.model=s)};Kp=(t,i,e,s)=>{if(!s)return;const n=this.gp[t][i][e];if(!n)return;const r=n.Gp;r&&(r.Xp=s)};jp=(t,i,e,s,n)=>{if(!s)return;const r=this.gp[e][t][i];if(!r)return;const h=r.Gp;h&&(h.Xp=s,h.zp=n)};Hy=(t,i,e,s,n,r,h,o,l,a,c)=>{if(!n&&!r)return!0;const f=128*i+64*l,u=128*e+64*a;return this.Zp(f,u,s,t,i,e,l,a,n,r,h,o,c,!1)};qp=(t,i,e,s,n,r,h,o,l,a)=>{if(!n&&!r)return!0;let c=i-l,f=s-l,u=i+l,d=s+l;return a&&(o>640&&o<1408&&(d+=128),o>1152&&o<1920&&(u+=128),(o>1664||o<384)&&(f-=128),o>128&&o<896&&(c-=128)),c=c/128|0,f=f/128|0,u=u/128|0,d=d/128|0,this.Zp(i,s,e,t,c,f,u+1-c,d-f+1,n,r,h,0,o,!0)};$p=(t,i,e,s,n,r,h,o,l,a,c,f)=>!l&&!a||this.Zp(i,s,e,t,n,r,h+1-n,o-r+1,l,a,c,0,f,!0);Xy=(t,i,e)=>{const s=this.gp[t][i][e];if(s)for(let t=0;t>29&3)&&n.Qp===i&&n.t_===e)return void this.i_(n)}};e_=(t,i,e,s)=>{if(!s)return;const n=this.gp[t][i][e];if(n)for(let t=0;t>29&3))return void(i.model=s)}};s_=()=>{for(let t=0;t{const s=this.gp[t][i][e];return s&&s.Gp?s.Gp.Jp:0};n_=(t,i,e)=>{const s=this.gp[t][e][i];return s&&s.Wp?s.Wp.Jp:0};r_=(t,i,e)=>{const s=this.gp[t][i][e];if(!s)return 0;for(let t=0;t>29&3)&&n.Qp===i&&n.t_===e)return n.Jp}return 0};h_=(t,i,e)=>{const s=this.gp[t][i][e];return s&&s.kp?s.kp.Jp:0};o_=(t,i,e,s)=>{const n=this.gp[t][i][e];if(n){if(n.Gp&&n.Gp.Jp===s)return 255&n.Gp.info;if(n.Wp&&n.Wp.Jp===s)return 255&n.Wp.info;if(n.kp&&n.kp.Jp===s)return 255&n.kp.info;for(let t=0;t{const r=i*(0|Math.sqrt(e*e+s*s+n*n))>>8;for(let i=0;i{if(i0){const n=this.gp[t][i+1][e-1];n&&n.kp&&n.kp.model&&n.kp.model.l_&&this.c_(s,n.kp.model,128,0,-128,!0)}};a_=(t,i,e,s,n,r)=>{let h=!0,o=i;const l=i+s,a=e-1,c=e+n;for(let f=t;f<=t+1;f++)if(f!==this.pp){for(let u=o;u<=l;u++)if(!(u<0||u>=this.WA))for(let o=a;o<=c;o++){if(o<0||o>=this.YA||h&&u=e||u===i))continue;const a=this.gp[f][u][o];if(!a)continue;const d=128*(u-i)+64*(1-s),w=128*(o-e)+64*(1-n),y=((this._p[f][u][o]+this._p[f][u+1][o]+this._p[f][u][o+1]+this._p[f][u+1][o+1])/4|0)-((this._p[t][i][e]+this._p[t][i+1][e]+this._p[t][i][e+1]+this._p[t][i+1][e+1])/4|0),A=a.Gp;A&&A.Xp&&A.Xp.l_&&this.c_(r,A.Xp,d,y,w,h),A&&A.zp&&A.zp.l_&&this.c_(r,A.zp,d,y,w,h);for(let t=0;t{this.Tp++;let h=0;const o=i.Bd,l=i.Fd;if(t.l_&&t.y_)for(let r=0;ri.A_)continue;const u=t.Bd[r]-e;if(ui.p_)continue;const d=t.Ud[r]-n;if(di.g_)continue;if(i.l_&&i.y_)for(let t=0;t{const h=this.gp[t][i][e];if(!h)return;const o=h.Sp;if(o){const t=o.color;if(0!==t)for(let i=0;i<4;i++)s[n]=t,s[n+1]=t,s[n+2]=t,s[n+3]=t,n+=r;return}const l=h.Mp;if(!l)return;const a=l.shape,c=l.angle,f=l.R_,u=l.O_,d=_.fp[a],w=_.up[c];let y=0;if(0===f)for(let t=0;t<4;t++)0!==d[w[y++]]&&(s[n]=u),0!==d[w[y++]]&&(s[n+1]=u),0!==d[w[y++]]&&(s[n+2]=u),0!==d[w[y++]]&&(s[n+3]=u),n+=r;else for(let t=0;t<4;t++)s[n]=0===d[w[y++]]?f:u,s[n+1]=0===d[w[y++]]?f:u,s[n+2]=0===d[w[y++]]?f:u,s[n+3]=0===d[w[y++]]?f:u,n+=r};click=(t,i)=>{_.Jm=!0,_.kl=t,_.Dl=i,_.yp=-1,_.Ap=-1};draw=(t,i,e,n,r,h,o)=>{t<0?t=0:t>=128*this.WA&&(t=128*this.WA-1),e<0?e=0:e>=128*this.YA&&(e=128*this.YA-1),_.Sm++,_.Bm=s.A.sin[h],_.Um=s.A.cos[h],_.Pm=s.A.sin[r],_.Gm=s.A.cos[r],_.Qm=_.Cm[(h-128)/32|0][r/64|0],_.Wm=t,_.Ym=i,_.Hm=e,_.Vm=t/128|0,_.Km=e/128|0,_.qm=n,_.Xm=_.Vm-25,_.Xm<0&&(_.Xm=0),_.zm=_.Km-25,_.zm<0&&(_.zm=0),_.jm=_.Vm+25,_.jm>this.WA&&(_.jm=this.WA),_.Zm=_.Km+25,_.Zm>this.YA&&(_.Zm=this.YA),this.L_(),_.$m=0;for(let t=this.bp;t=2e3)?(h.visible=!0,h.update=!0,h.S_=h.Fp>0,_.$m++):(h.visible=!1,h.update=!1,h.x_=0))}}for(let t=this.bp;t=_.jm))for(let t=-25;t<=0;t++){const n=_.Km+t,r=_.Km-t;let h;if(e>=_.Xm&&(n>=_.zm&&(h=i[e][n],h&&h.visible&&this.M_(h,!0,o)),r<_.Zm&&(h=i[e][r],h&&h.visible&&this.M_(h,!0,o))),s<_.jm&&(n>=_.zm&&(h=i[s][n],h&&h.visible&&this.M_(h,!0,o)),r<_.Zm&&(h=i[s][r],h&&h.visible&&this.M_(h,!0,o))),0===_.$m)return void(_.Jm=!1)}}}for(let t=this.bp;t=_.jm))for(let t=-25;t<=0;t++){const n=_.Km+t,r=_.Km-t;let h;if(e>=_.Xm&&(n>=_.zm&&(h=i[e][n],h&&h.visible&&this.M_(h,!1,o)),r<_.Zm&&(h=i[e][r],h&&h.visible&&this.M_(h,!1,o))),s<_.jm&&(n>=_.zm&&(h=i[s][n],h&&h.visible&&this.M_(h,!1,o)),r<_.Zm&&(h=i[s][r],h&&h.visible&&this.M_(h,!1,o))),0===_.$m)return void(_.Jm=!1)}}}};Zp=(t,i,e,s,h,o,l,a,c,f,u,d,w,y)=>{if(!c&&!f)return!1;for(let t=h;t=this.WA||i>=this.YA)return!1;const e=this.gp[s][t][i];if(e&&e.Fp>=5)return!1}const A=new n.A(s,e,t,i,c,f,w,h,h+l-1,o,o+a-1,u,d);for(let t=h;th&&(e|=1),to&&(e+=8),i=0;e--)this.gp[e][t][i]||(this.gp[e][t][i]=new r.A(e,t,i));const n=this.gp[s][t][i];n&&(n.Bp[n.Fp]=A,n.k_[n.Fp]=e,n.D_|=e,n.Fp++)}return y&&(this.Ih[this.vp++]=A),!0};i_=t=>{for(let i=t.Qp;i<=t.u_;i++)for(let e=t.t_;e<=t.d_;e++){const s=this.gp[t.level][i][e];if(s){for(let i=0;i{const t=_.bm[_.qm],i=_.Tm[_.qm];_.wp=0;for(let e=0;e=0&&s<=50){n=t.F_+25-_.Km,n<0&&(n=0),r=t.YA+25-_.Km,r>50&&(r=50);let i=!1;for(;n<=r;)if(_.Qm&&_.Qm[s][n++]){i=!0;break}if(i){if(h=_.Wm-t.m_,h>32)t.mode=1;else{if(h>=-32)continue;t.mode=2,h=-h}t.B_=(t.__-_.Hm<<8)/h|0,t.U_=(t.g_-_.Hm<<8)/h|0,t.P_=(t.A_-_.Ym<<8)/h|0,t.G_=(t.jd-_.Ym<<8)/h|0,_.Om[_.wp++]=t}}}else if(2===t.type){if(s=t.F_+25-_.Km,s>=0&&s<=50){n=t.N_+25-_.Vm,n<0&&(n=0),r=t.WA+25-_.Vm,r>50&&(r=50);let i=!1;for(;n<=r;)if(_.Qm&&_.Qm[n++][s]){i=!0;break}if(i){if(h=_.Hm-t.__,h>32)t.mode=3;else{if(h>=-32)continue;t.mode=4,h=-h}t.W_=(t.m_-_.Wm<<8)/h|0,t.Y_=(t.p_-_.Wm<<8)/h|0,t.P_=(t.A_-_.Ym<<8)/h|0,t.G_=(t.jd-_.Ym<<8)/h|0,_.Om[_.wp++]=t}}}else if(4===t.type&&(s=t.A_-_.Ym,s>128&&(n=t.F_+25-_.Km,n<0&&(n=0),r=t.YA+25-_.Km,r>50&&(r=50),n<=r))){let i=t.N_+25-_.Vm;i<0&&(i=0),h=t.WA+25-_.Vm,h>50&&(h=50);let e=!1;t:for(let t=i;t<=h;t++)for(let i=n;i<=r;i++)if(_.Qm&&_.Qm[t][i]){e=!0;break t}e&&(t.mode=5,t.W_=(t.m_-_.Wm<<8)/s|0,t.Y_=(t.p_-_.Wm<<8)/s|0,t.B_=(t.__-_.Hm<<8)/s|0,t.U_=(t.g_-_.Hm<<8)/s|0,_.Om[_.wp++]=t)}}};M_=(t,i,e)=>{for(_.Lm.UA(t);;){let t;do{if(t=_.Lm.H_(),!t)return}while(!t.update);const s=t.x,n=t.z,r=t.level,h=t.V_,o=this.gp[r];if(t.visible){if(i){if(r>0){const t=this.gp[r-1][s][n];if(t&&t.update)continue}if(s<=_.Vm&&s>_.Xm){const i=o[s-1][n];if(i&&i.update&&(i.visible||!(1&t.D_)))continue}if(s>=_.Vm&&s<_.jm-1){const i=o[s+1][n];if(i&&i.update&&(i.visible||!(4&t.D_)))continue}if(n<=_.Km&&n>_.zm){const i=o[s][n-1];if(i&&i.update&&(i.visible||!(8&t.D_)))continue}if(n>=_.Km&&n<_.Zm-1){const i=o[s][n+1];if(i&&i.update&&(i.visible||!(2&t.D_)))continue}}else i=!0;if(t.visible=!1,t.Op){const i=t.Op;i.Sp?this.K_(0,s,n)||this.X_(i.Sp,0,s,n,_.Bm,_.Um,_.Pm,_.Gm):i.Mp&&!this.K_(0,s,n)&&this.j_(s,n,i.Mp,_.Bm,_.Um,_.Pm,_.Gm);const r=i.Gp;r&&r.Xp?.draw(0,_.Bm,_.Um,_.Pm,_.Gm,r.x-_.Wm,r.y-_.Ym,r.z-_.Hm,r.Jp);for(let t=0;tn&&(a+=6),c=_.tp[a],t.q_=_.ep[a]),f&&(f.J_&_.ip[a]?16===f.J_?(t.x_=3,t.Q_=_.sp[a],t.tg=3-t.Q_):32===f.J_?(t.x_=6,t.Q_=_.np[a],t.tg=6-t.Q_):64===f.J_?(t.x_=12,t.Q_=_.rp[a],t.tg=12-t.Q_):(t.x_=9,t.Q_=_.hp[a],t.tg=9-t.Q_):t.x_=0,f.J_&c&&!this.ig(h,s,n,f.J_)&&f.Xp?.draw(0,_.Bm,_.Um,_.Pm,_.Gm,f.x-_.Wm,f.y-_.Ym,f.z-_.Hm,f.Jp),f.eg&c&&!this.ig(h,s,n,f.eg)&&f.zp?.draw(0,_.Bm,_.Um,_.Pm,_.Gm,f.x-_.Wm,f.y-_.Ym,f.z-_.Hm,f.Jp)),u&&!this.visible(h,s,n,u.model.jd))if(u.type&c)u.model.draw(u.angle,_.Bm,_.Um,_.Pm,_.Gm,u.x-_.Wm,u.y-_.Ym,u.z-_.Hm,u.Jp);else if(768&u.type){const t=u.x-_.Wm,i=u.y-_.Ym,e=u.z-_.Hm,s=u.angle;let n,r;if(n=s===m.A.Vy||s===m.A.Zy?-t:t,r=s===m.A.Zy||s===m.A.Ky?-e:e,256&u.type&&rn){const n=t+_.ap[s],r=e+_.cp[s];u.model.draw(512*s+1280&2047,_.Bm,_.Um,_.Pm,_.Gm,n,i,r,u.Jp)}}if(l){const i=t.kp;i&&i.model?.draw(0,_.Bm,_.Um,_.Pm,_.Gm,i.x-_.Wm,i.y-_.Ym,i.z-_.Hm,i.Jp);const e=t.Up;e&&0===e.offset&&(e.sg&&e.sg.draw(0,_.Bm,_.Um,_.Pm,_.Gm,e.x-_.Wm,e.y-_.Ym,e.z-_.Hm,e.Jp),e.ng&&e.ng.draw(0,_.Bm,_.Um,_.Pm,_.Gm,e.x-_.Wm,e.y-_.Ym,e.z-_.Hm,e.Jp),e.rg&&e.rg.draw(0,_.Bm,_.Um,_.Pm,_.Gm,e.x-_.Wm,e.y-_.Ym,e.z-_.Hm,e.Jp))}const d=t.D_;if(0!==d){if(s<_.Vm&&4&d){const t=o[s+1][n];t&&t.update&&_.Lm.UA(t)}if(n<_.Km&&2&d){const t=o[s][n+1];t&&t.update&&_.Lm.UA(t)}if(s>_.Vm&&1&d){const t=o[s-1][n];t&&t.update&&_.Lm.UA(t)}if(n>_.Km&&8&d){const t=o[s][n-1];t&&t.update&&_.Lm.UA(t)}}}if(0!==t.x_){let i=!0;for(let e=0;ei.Qp&&(r+=1),ei.t_&&(r+=8),ss&&(s=n);const h=_.Km-i.t_,l=i.d_-_.Km;i.hg=l>h?s+l:s+h}for(;;){let t=-50,i=-1;for(let e=0;et&&(t=s.hg,i=e))}if(-1===i)break;const l=_.vm[i];if(l){l.Sm=_.Sm;let t=l.model;t||(t=l.z_?.draw(e)??null),t&&!this.og(h,l.Qp,l.u_,l.t_,l.d_,t.jd)&&t.draw(l.Z_,_.Bm,_.Um,_.Pm,_.Gm,l.x-_.Wm,l.y-_.Ym,l.z-_.Hm,l.Jp);for(let t=l.Qp;t<=l.u_;t++)for(let i=l.t_;i<=l.d_;i++){const e=o[t][i];e&&(0!==e.x_?_.Lm.UA(e):t===s&&i===n||!e.update||_.Lm.UA(e))}}}if(t.S_)continue}if(!t.update||0!==t.x_)continue;if(s<=_.Vm&&s>_.Xm){const t=o[s-1][n];if(t&&t.update)continue}if(s>=_.Vm&&s<_.jm-1){const t=o[s+1][n];if(t&&t.update)continue}if(n<=_.Km&&n>_.zm){const t=o[s][n-1];if(t&&t.update)continue}if(n>=_.Km&&n<_.Zm-1){const t=o[s][n+1];if(t&&t.update)continue}t.update=!1,_.$m--;const l=t.Up;if(l&&0!==l.offset&&(l.sg&&l.sg.draw(0,_.Bm,_.Um,_.Pm,_.Gm,l.x-_.Wm,l.y-_.Ym-l.offset,l.z-_.Hm,l.Jp),l.ng&&l.ng.draw(0,_.Bm,_.Um,_.Pm,_.Gm,l.x-_.Wm,l.y-_.Ym-l.offset,l.z-_.Hm,l.Jp),l.rg&&l.rg.draw(0,_.Bm,_.Um,_.Pm,_.Gm,l.x-_.Wm,l.y-_.Ym-l.offset,l.z-_.Hm,l.Jp)),0!==t.q_){const i=t.Wp;if(i&&!this.visible(h,s,n,i.model.jd))if(i.type&t.q_)i.model.draw(i.angle,_.Bm,_.Um,_.Pm,_.Gm,i.x-_.Wm,i.y-_.Ym,i.z-_.Hm,i.Jp);else if(768&i.type){const t=i.x-_.Wm,e=i.y-_.Ym,s=i.z-_.Hm,n=i.angle;let r,h;if(r=n===m.A.Vy||n===m.A.Zy?-t:t,h=n===m.A.Zy||n===m.A.Ky?-s:s,256&i.type&&h>=r){const r=t+_.op[n],h=s+_.lp[n];i.model.draw(512*n+256,_.Bm,_.Um,_.Pm,_.Gm,r,e,h,i.Jp)}if(512&i.type&&h<=r){const r=t+_.ap[n],h=s+_.cp[n];i.model.draw(512*n+1280&2047,_.Bm,_.Um,_.Pm,_.Gm,r,e,h,i.Jp)}}const e=t.Gp;e&&(e.eg&t.q_&&!this.ig(h,s,n,e.eg)&&e.zp?.draw(0,_.Bm,_.Um,_.Pm,_.Gm,e.x-_.Wm,e.y-_.Ym,e.z-_.Hm,e.Jp),e.J_&t.q_&&!this.ig(h,s,n,e.J_)&&e.Xp?.draw(0,_.Bm,_.Um,_.Pm,_.Gm,e.x-_.Wm,e.y-_.Ym,e.z-_.Hm,e.Jp))}if(r_.Vm){const t=o[s-1][n];t&&t.update&&_.Lm.UA(t)}if(n>_.Km){const t=o[s][n-1];t&&t.update&&_.Lm.UA(t)}}};X_=(t,i,e,n,r,h,o,l)=>{let a,c,f,u,d=a=(e<<7)-_.Wm,y=c=(n<<7)-_.Hm,A=f=d+128,m=u=y+128,p=this._p[i][e][n]-_.Ym,g=this._p[i][e+1][n]-_.Ym,I=this._p[i][e+1][n+1]-_.Ym,C=this._p[i][e][n+1]-_.Ym,E=y*o+d*l>>16;if(y=y*l-d*o>>16,d=E,E=p*h-y*r>>16,y=p*r+y*h>>16,p=E,y<50)return;if(E=c*o+A*l>>16,c=c*l-A*o>>16,A=E,E=g*h-c*r>>16,c=g*r+c*h>>16,g=E,c<50)return;if(E=m*o+f*l>>16,m=m*l-f*o>>16,f=E,E=I*h-m*r>>16,m=I*r+m*h>>16,I=E,m<50)return;if(E=u*o+a*l>>16,u=u*l-a*o>>16,a=E,E=C*h-u*r>>16,u=C*r+u*h>>16,C=E,u<50)return;const v=s.A.ra+((d<<9)/y|0),b=s.A.ha+((p<<9)/y|0),T=s.A.ra+((A<<9)/c|0),R=s.A.ha+((g<<9)/c|0),O=s.A.ra+((f<<9)/m|0),L=s.A.ha+((I<<9)/m|0),S=s.A.ra+((a<<9)/u|0),x=s.A.ha+((C<<9)/u|0);if(s.A.alpha=0,(O-S)*(R-x)-(L-x)*(T-S)>0)if(s.A.lg=O<0||S<0||T<0||O>w.A.ag||S>w.A.ag||T>w.A.ag,_.Jm&&this.cg(_.kl,_.Dl,L,x,R,O,S,T)&&(_.yp=e,_.Ap=n),-1===t.fg)12345678!==t.ug&&s.A.dg(O,S,T,L,x,R,t.ug,t.wg,t.yg);else if(_.et){const i=_.dp[t.fg];s.A.dg(O,S,T,L,x,R,this.Ag(i,t.ug),this.Ag(i,t.wg),this.Ag(i,t.yg))}else t.flat?s.A.mg(O,S,T,L,x,R,t.ug,t.wg,t.yg,d,p,y,A,a,g,C,c,u,t.fg):s.A.mg(O,S,T,L,x,R,t.ug,t.wg,t.yg,f,I,m,a,A,C,g,u,c,t.fg);if(!((v-T)*(x-R)-(b-R)*(S-T)<=0))if(s.A.lg=v<0||T<0||S<0||v>w.A.ag||T>w.A.ag||S>w.A.ag,_.Jm&&this.cg(_.kl,_.Dl,b,R,x,v,T,S)&&(_.yp=e,_.Ap=n),-1!==t.fg){if(!_.et)return void s.A.mg(v,T,S,b,R,x,t.pg,t.yg,t.wg,d,p,y,A,a,g,C,c,u,t.fg);const i=_.dp[t.fg];s.A.dg(v,T,S,b,R,x,this.Ag(i,t.pg),this.Ag(i,t.yg),this.Ag(i,t.wg))}else 12345678!==t.pg&&s.A.dg(v,T,S,b,R,x,t.pg,t.yg,t.wg)};j_=(t,i,e,n,r,h,o)=>{let l=e.Bd.length;for(let t=0;t>16;if(a=a*o-i*h>>16,i=c,c=l*r-a*n>>16,a=l*n+a*r>>16,l=c,a<50)return;e._g&&(y.A.gg[t]=i,y.A.Ig[t]=l,y.A.Cg[t]=a),y.A.Eg[t]=s.A.ra+((i<<9)/a|0),y.A.vg[t]=s.A.ha+((l<<9)/a|0)}s.A.alpha=0,l=e.bg.length;for(let n=0;n0)if(s.A.lg=l<0||a<0||c<0||l>w.A.ag||a>w.A.ag||c>w.A.ag,_.Jm&&this.cg(_.kl,_.Dl,f,u,d,l,a,c)&&(_.yp=t,_.Ap=i),e._g&&-1!==e._g[n])if(_.et){const t=_.dp[e._g[n]];s.A.dg(l,a,c,f,u,d,this.Ag(t,e.Og[n]),this.Ag(t,e.Lg[n]),this.Ag(t,e.Sg[n]))}else e.flat?s.A.mg(l,a,c,f,u,d,e.Og[n],e.Lg[n],e.Sg[n],y.A.gg[0],y.A.Ig[0],y.A.Cg[0],y.A.gg[1],y.A.gg[3],y.A.Ig[1],y.A.Ig[3],y.A.Cg[1],y.A.Cg[3],e._g[n]):s.A.mg(l,a,c,f,u,d,e.Og[n],e.Lg[n],e.Sg[n],y.A.gg[r],y.A.Ig[r],y.A.Cg[r],y.A.gg[h],y.A.gg[o],y.A.Ig[h],y.A.Ig[o],y.A.Cg[h],y.A.Cg[o],e._g[n]);else 12345678!==e.Og[n]&&s.A.dg(l,a,c,f,u,d,e.Og[n],e.Lg[n],e.Sg[n])}};K_=(t,i,e)=>{const s=this.Ip[t][i][e];if(s===-_.Sm)return!1;if(s===_.Sm)return!0;{const s=i<<7,n=e<<7;return this.xg(s+1,this._p[t][i][e],n+1)&&this.xg(s+128-1,this._p[t][i+1][e],n+1)&&this.xg(s+128-1,this._p[t][i+1][e+1],n+128-1)&&this.xg(s+1,this._p[t][i][e+1],n+128-1)?(this.Ip[t][i][e]=_.Sm,!0):(this.Ip[t][i][e]=-_.Sm,!1)}};ig=(t,i,e,s)=>{if(!this.K_(t,i,e))return!1;const n=i<<7,r=e<<7,h=this._p[t][i][e]-1,o=h-120,l=h-230,a=h-238;if(s<16){if(1===s){if(n>_.Wm){if(!this.xg(n,h,r))return!1;if(!this.xg(n,h,r+128))return!1}if(t>0){if(!this.xg(n,o,r))return!1;if(!this.xg(n,o,r+128))return!1}return!!this.xg(n,l,r)&&this.xg(n,l,r+128)}if(2===s){if(r<_.Hm){if(!this.xg(n,h,r+128))return!1;if(!this.xg(n+128,h,r+128))return!1}if(t>0){if(!this.xg(n,o,r+128))return!1;if(!this.xg(n+128,o,r+128))return!1}return!!this.xg(n,l,r+128)&&this.xg(n+128,l,r+128)}if(4===s){if(n<_.Wm){if(!this.xg(n+128,h,r))return!1;if(!this.xg(n+128,h,r+128))return!1}if(t>0){if(!this.xg(n+128,o,r))return!1;if(!this.xg(n+128,o,r+128))return!1}return!!this.xg(n+128,l,r)&&this.xg(n+128,l,r+128)}if(8===s){if(r>_.Hm){if(!this.xg(n,h,r))return!1;if(!this.xg(n+128,h,r))return!1}if(t>0){if(!this.xg(n,o,r))return!1;if(!this.xg(n+128,o,r))return!1}return!!this.xg(n,l,r)&&this.xg(n+128,l,r)}}return!!this.xg(n+64,a,r+64)&&(16===s?this.xg(n,l,r+128):32===s?this.xg(n+128,l,r+128):64===s?this.xg(n+128,l,r):128===s?this.xg(n,l,r):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,i,e,s)=>{if(this.K_(t,i,e)){const n=i<<7,r=e<<7;return this.xg(n+1,this._p[t][i][e]-s,r+1)&&this.xg(n+128-1,this._p[t][i+1][e]-s,r+1)&&this.xg(n+128-1,this._p[t][i+1][e+1]-s,r+128-1)&&this.xg(n+1,this._p[t][i][e+1]-s,r+128-1)}return!1};og=(t,i,e,s,n,r)=>{let h,o;if(i!==e||s!==n){for(h=i;h<=e;h++)for(o=s;o<=n;o++)if(this.Ip[t][h][o]===-_.Sm)return!1;o=1+(i<<7);const l=2+(s<<7),a=this._p[t][i][s]-r;if(!this.xg(o,a,l))return!1;const c=(e<<7)-1;if(!this.xg(c,a,l))return!1;const f=(n<<7)-1;return!!this.xg(o,a,f)&&this.xg(c,a,f)}return!!this.K_(t,i,s)&&(h=i<<7,o=s<<7,this.xg(h+1,this._p[t][i][s]-r,o+1)&&this.xg(h+128-1,this._p[t][i+1][s]-r,o+1)&&this.xg(h+128-1,this._p[t][i+1][s+1]-r,o+128-1)&&this.xg(h+1,this._p[t][i][s+1]-r,o+128-1))};xg=(t,i,e)=>{for(let s=0;s<_.wp;s++){const n=_.Om[s];if(n)if(1===n.mode){const s=n.m_-t;if(s>0){const t=n.__+(n.B_*s>>8),r=n.g_+(n.U_*s>>8),h=n.A_+(n.P_*s>>8),o=n.jd+(n.G_*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(2===n.mode){const s=t-n.m_;if(s>0){const t=n.__+(n.B_*s>>8),r=n.g_+(n.U_*s>>8),h=n.A_+(n.P_*s>>8),o=n.jd+(n.G_*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(3===n.mode){const s=n.__-e;if(s>0){const e=n.m_+(n.W_*s>>8),r=n.p_+(n.Y_*s>>8),h=n.A_+(n.P_*s>>8),o=n.jd+(n.G_*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(4===n.mode){const s=e-n.__;if(s>0){const e=n.m_+(n.W_*s>>8),r=n.p_+(n.Y_*s>>8),h=n.A_+(n.P_*s>>8),o=n.jd+(n.G_*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(5===n.mode){const s=i-n.A_;if(s>0){const i=n.m_+(n.W_*s>>8),r=n.p_+(n.Y_*s>>8),h=n.__+(n.B_*s>>8),o=n.g_+(n.U_*s>>8);if(t>=i&&t<=r&&e>=h&&e<=o)return!0}}}return!1};cg=(t,i,e,s,n,r,h,o)=>{if(ie&&i>s&&i>n)return!1;if(tr&&t>h&&t>o)return!1;const l=(i-s)*(o-h)-(t-h)*(n-s);return((i-e)*(h-r)-(t-r)*(s-e))*l>0&&l*((i-n)*(r-o)-(t-o)*(e-n))>0};Ag=(t,i)=>((i=(127-i)*(127&t)/160|0)<2?i=2:i>126&&(i=126),(65408&t)+i)}},7121:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{}},4197:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{Mg;kg;Dg;Ng;index;qw;ul;fl;constructor(t,i,e,s,n,r,h){super(),this.Mg=i,this.kg=e,this.Dg=s,this.Ng=n,this.index=t,this.qw=r,h&&-1!==r.wl&&this.qw.delay?(this.ul=Math.random()*this.qw.dl|0,this.fl=Math.random()*this.qw.delay[this.ul]|0):(this.ul=-1,this.fl=0)}}},9418:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(7121),n=e(1312),r=e(3867);class h extends s.A{x=0;z=0;Z_=0;Fg=!1;size=1;Sa=-1;Bg=-1;Ug=-1;Pg=-1;Gg=-1;Wg=-1;Yg=-1;Hg=null;Vg=100;Kg=0;Xg=0;jg=0;zg=0;Zg=-1e3;qg=0;$g=0;Jg=-1;Qg=0;tI=0;iI=-1;eI=0;sI=0;nI=-1;rI=0;hI=0;oI=0;lI=0;aI=-1;cI=0;fI=0;uI=0;dI=0;wI=0;yI=0;AI=0;mI=0;pI=0;_I=0;gI=0;Sm=0;height=0;II=0;pathLength=0;CI=new Int32Array(10);EI=new Int32Array(10);vI=new r.fe(10,!1);bI=0;TI=-1;RI=-1;OI=-1;LI=-1;move(t,i,e){if(-1!==this.nI&&n.A.Lo[this.nI].priority<=1&&(this.nI=-1),!t){const t=i-this.CI[0],s=e-this.EI[0];if(t>=-8&&t<=8&&s>=-8&&s<=8){this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.CI[t]=this.CI[t-1],this.EI[t]=this.EI[t-1],this.vI[t]=this.vI[t-1];return this.CI[0]=i,this.EI[0]=e,void(this.vI[0]=!1)}}this.pathLength=0,this.bI=0,this.CI[0]=i,this.EI[0]=e,this.x=128*this.CI[0]+64*this.size,this.z=128*this.EI[0]+64*this.size}step(t,i){let e=this.CI[0],s=this.EI[0];0===i?(e--,s++):1===i?s++:2===i?(e++,s++):3===i?e--:4===i?e++:5===i?(e--,s--):6===i?s--:7===i&&(e++,s--),-1!==this.nI&&n.A.Lo[this.nI].priority<=1&&(this.nI=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.CI[t]=this.CI[t-1],this.EI[t]=this.EI[t-1],this.vI[t]=this.vI[t-1];this.CI[0]=e,this.EI[0]=s,this.vI[0]=t}}},8268:(t,i,e)=>{e.d(i,{A:()=>d});var s=e(9418),n=e(8665),r=e(2679),h=e(8738),o=e(1312),l=e(8317),a=e(1302),c=e(3819),f=e(3867),u=e(9298);class d extends s.A{static SI=1;static xI=2;static MI=4;static kI=8;static DI=16;static NI=32;static FI=64;static BI=128;static UI=256;static GI=512;static La=[u.A.WI,u.A.YI,u.A.HI,u.A.VI,u.A.KI,u.A.XI,u.A.jI,u.A.zI,u.A.ZI,u.A.qI,u.A.$I,u.A.JI,u.A.QI,u.A.tC,u.A.iC,u.A.eC];static Oa=[[u.A.sC,u.A.nC,u.A.rC,u.A.hC,u.A.oC,u.A.lC,u.A.aC,u.A.cC,u.A.fC,u.A.uC,u.A.dC,u.A.wC],[u.A.yC,u.A.AC,u.A.mC,u.A.pC,u.A._C,u.A.gC,u.A.IC,u.A.CC,u.A.EC,u.A.vC,u.A.bC,u.A.TC,u.A.RC,u.A.OC,u.A.LC,u.A.SC],[u.A.SC-1,u.A.yC+1,u.A.AC,u.A.mC,u.A.pC,u.A._C,u.A.gC,u.A.IC,u.A.CC,u.A.EC,u.A.vC,u.A.bC,u.A.TC,u.A.RC,u.A.OC,u.A.LC],[u.A.xC,u.A.MC,u.A.kC,u.A.DC,u.A.NC,u.A.FC],[u.A.BC,u.A.UC,u.A.PC,u.A.GC,u.A.WC,u.A.YC,u.A.HC,u.A.VC]];static So=new r.A(200);name=null;visible=!1;KC=0;XC=0;jC=new Uint16Array(12);zC=new Uint16Array(5);Ka=0;ZC=0n;y=0;qC=0;$C=0;JC=0;QC=0;tE=0;iE=null;N_=0;F_=0;WA=0;YA=0;et=!1;draw(t){if(!this.visible)return null;let i=this.sw();if(this.height=i.jd,i.ow=!0,this.et)return i;if(-1!==this.aI&&-1!==this.cI){const t=h.A.Lo[this.aI],e=n.A.ku(t.la(),!0,!t.pd,!1);e.translate(-this.dI,0,0),e.xa(),t.qw&&t.qw.frames&&e.Ma(t.qw.frames[this.cI]),e.Hd=null,e.Vd=null,128===t.iw&&128===t.ew||e.scale(t.iw,t.ew,t.iw),e.ka(t.gd+64,t.Id+850,-30,-50,-30,!0);const s=[i,e];i=n.A.eE(s,2)}if(this.iE&&(t>=this.$C&&(this.iE=null),t>=this.qC&&t=d.Oa[i].length)&&(e=0),this.zC[i]=e}this.Sa=t.mu,65535===this.Sa&&(this.Sa=-1),this.Bg=t.mu,65535===this.Bg&&(this.Bg=-1),this.Ug=t.mu,65535===this.Ug&&(this.Ug=-1),this.Pg=t.mu,65535===this.Pg&&(this.Pg=-1),this.Gg=t.mu,65535===this.Gg&&(this.Gg=-1),this.Wg=t.mu,65535===this.Wg&&(this.Wg=-1),this.Yg=t.mu,65535===this.Yg&&(this.Yg=-1),this.name=c.A.Ca(c.A.Ea(t.sE)),this.Ka=t._u,this.visible=!0,this.ZC=0n;for(let t=0;t<12;t++)this.ZC<<=0x4n,this.jC[t]>=256&&(this.ZC+=BigInt(this.jC[t])-256n);this.jC[0]>=256&&(this.ZC+=BigInt(this.jC[0])-256n>>4n),this.jC[1]>=256&&(this.ZC+=BigInt(this.jC[1])-256n>>8n);for(let t=0;t<5;t++)this.ZC<<=0x3n,this.ZC+=BigInt(this.zC[t]);this.ZC<<=0x1n,this.ZC+=BigInt(this.KC)}ed(){if(!this.visible)return null;const t=new f.fe(12,null);let i=0;for(let e=0;e<12;e++){const s=this.jC[e];if(s>=256&&s<512&&(t[i++]=l.A.Lo[s-256].ed()),s>=512){const e=a.A.get(s-512).ed(this.KC);e&&(t[i++]=e)}}const e=n.A.Ta(t,i);for(let t=0;t<5;t++)0!==this.zC[t]&&(e.Ra(d.Oa[t][0],d.Oa[t][this.zC[t]]),1===t&&e.Ra(d.La[0],d.La[this.zC[t]]));return e}sw(){let t=this.ZC,i=-1,e=-1,s=-1,r=-1;if(this.nI>=0&&0===this.oI){const n=o.A.Lo[this.nI];if(n.frames&&(i=n.frames[this.rI]),this.iI>=0&&this.iI!==this.Sa){const t=o.A.Lo[this.iI].frames;t&&(e=t[this.eI])}n.jw>=0&&(s=n.jw,t+=BigInt(s-this.jC[5])<<8n),n.zw>=0&&(r=n.zw,t+=BigInt(r-this.jC[3])<<16n)}else if(this.iI>=0){const t=o.A.Lo[this.iI].frames;t&&(i=t[this.eI])}let h=d.So?.get(t);if(!h){const i=new f.fe(12,null);let e=0;for(let t=0;t<12;t++){let n=this.jC[t];if(r>=0&&3===t&&(n=r),s>=0&&5===t&&(n=s),n>=256&&n<512){const t=l.A.Lo[n-256].la();t&&(i[e++]=t)}if(n>=512){const t=a.A.get(n-512).Vw(this.KC);t&&(i[e++]=t)}}h=n.A.Ta(i,e);for(let t=0;t<5;t++)0!==this.zC[t]&&(h.Ra(d.Oa[t][0],d.Oa[t][this.zC[t]]),1===t&&h.Ra(d.La[0],d.La[this.zC[t]]));h.xa(),h.ka(64,850,-30,-50,-30,!0),d.So?.put(t,h)}if(this.et)return h;const c=n.A.nw(h,!0);return-1!==i&&-1!==e?c.rw(i,e,o.A.Lo[this.nI].Kw):-1!==i&&c.Ma(i),c.hw(),c.Hd=null,c.Vd=null,c}}},9222:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;model;Jp;info;constructor(t,i,e,s,n,r){this.y=t,this.x=i,this.z=e,this.model=s,this.Jp=n,this.info=r}}},1161:(t,i,e)=>{e.d(i,{A:()=>s});class s{level;y;x;z;model;z_;Z_;Qp;u_;t_;d_;Jp;info;hg=0;Sm=0;constructor(t,i,e,s,n,r,h,o,l,a,c,f,u){this.level=t,this.y=i,this.x=e,this.z=s,this.model=n,this.z_=r,this.Z_=h,this.Qp=o,this.u_=l,this.t_=a,this.d_=c,this.Jp=f,this.info=u}}},5748:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;rg;ng;sg;Jp;offset;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.rg=s,this.ng=n,this.sg=r,this.Jp=h,this.offset=o}}},8256:(t,i,e)=>{e.d(i,{A:()=>s});class s{N_;WA;F_;YA;type;m_;p_;__;g_;A_;jd;mode=0;W_=0;Y_=0;B_=0;U_=0;P_=0;G_=0;constructor(t,i,e,s,n,r,h,o,l,a,c){this.N_=t,this.WA=i,this.F_=e,this.YA=s,this.type=n,this.m_=r,this.p_=h,this.__=o,this.g_=l,this.A_=a,this.jd=c}}},3795:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1982),n=e(3867);class r extends s.A{level;x;z;V_;Bp;k_;Sp=null;Mp=null;Gp=null;Wp=null;kp=null;Up=null;Op=null;Fp=0;D_=0;Lp=0;visible=!1;update=!1;S_=!1;x_=0;Q_=0;tg=0;q_=0;constructor(t,i,e){super(),this.V_=this.level=t,this.x=i,this.z=e,this.Bp=new n.fe(5,null),this.k_=new Int32Array(5)}}},2771:(t,i,e)=>{e.d(i,{A:()=>s});class s{static Eg=new Int32Array(6);static vg=new Int32Array(6);static gg=new Int32Array(6);static Ig=new Int32Array(6);static Cg=new Int32Array(6);static nE=[Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,2,6),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,13,14)];static rE=[Int8Array.of(0,1,2,3,0,0,1,3),Int8Array.of(1,1,2,3,1,0,1,3),Int8Array.of(0,1,2,3,1,0,1,3),Int8Array.of(0,0,1,2,0,0,2,4,1,0,4,3),Int8Array.of(0,0,1,4,0,0,4,3,1,1,2,4),Int8Array.of(0,0,4,3,1,0,1,2,1,0,2,4),Int8Array.of(0,1,2,4,1,0,1,4,1,0,4,3),Int8Array.of(0,4,1,2,0,4,2,5,1,0,4,5,1,0,5,3),Int8Array.of(0,4,1,2,0,4,2,3,0,4,3,5,1,0,4,5),Int8Array.of(0,0,4,5,1,4,1,2,1,4,2,3,1,4,3,5),Int8Array.of(0,0,1,5,0,1,4,5,0,1,2,4,1,0,5,3,1,5,4,3,1,4,2,3),Int8Array.of(1,0,1,5,1,1,4,5,1,1,2,4,0,0,5,3,0,5,4,3,0,4,2,3),Int8Array.of(1,0,5,4,1,0,1,5,0,0,4,3,0,4,5,3,0,5,2,3,0,1,2,5)];static hE=128;static oE=this.hE/2|0;static lE=this.hE/4|0;static aE=3*this.hE/4|0;Bd;Pd;Ud;Og;Lg;Sg;bg;Tg;Rg;_g;flat;shape;angle;R_;O_;constructor(t,i,e,n,r,h,o,l,a,c,f,u,d,w,y,A,m,p,_){this.flat=!(m!==n||m!==w||m!==l),this.shape=i,this.angle=h,this.R_=d,this.O_=a;const g=s.nE[i],I=g.length;this.Bd=new Int32Array(I),this.Pd=new Int32Array(I),this.Ud=new Int32Array(I);const C=new Int32Array(I),E=new Int32Array(I),v=t*s.hE,b=p*s.hE;for(let t=0;t8&&I<=12&&(I=9+(I-h-9&3)),I>12&&I<=16&&(I=13+(I-h-13&3)),1===I?(i=v,a=b,f=m,d=o,p=c):2===I?(i=v+s.oE,a=b,f=m+n>>1,d=o+_>>1,p=c+e>>1):3===I?(i=v+s.hE,a=b,f=n,d=_,p=e):4===I?(i=v+s.hE,a=b+s.oE,f=n+w>>1,d=_+r>>1,p=e+y>>1):5===I?(i=v+s.hE,a=b+s.hE,f=w,d=r,p=y):6===I?(i=v+s.oE,a=b+s.hE,f=w+l>>1,d=r+A>>1,p=y+u>>1):7===I?(i=v,a=b+s.hE,f=l,d=A,p=u):8===I?(i=v,a=b+s.oE,f=l+m>>1,d=A+o>>1,p=u+c>>1):9===I?(i=v+s.oE,a=b+s.lE,f=m+n>>1,d=o+_>>1,p=c+e>>1):10===I?(i=v+s.aE,a=b+s.oE,f=n+w>>1,d=_+r>>1,p=e+y>>1):11===I?(i=v+s.oE,a=b+s.aE,f=w+l>>1,d=r+A>>1,p=y+u>>1):12===I?(i=v+s.lE,a=b+s.oE,f=l+m>>1,d=A+o>>1,p=u+c>>1):13===I?(i=v+s.lE,a=b+s.lE,f=m,d=o,p=c):14===I?(i=v+s.aE,a=b+s.lE,f=n,d=_,p=e):15===I?(i=v+s.aE,a=b+s.aE,f=w,d=r,p=y):(i=v+s.lE,a=b+s.aE,f=l,d=A,p=u),this.Bd[t]=i,this.Pd[t]=f,this.Ud[t]=a,C[t]=d,E[t]=p}const T=s.rE[i],R=T.length/4|0;this.bg=new Int32Array(R),this.Tg=new Int32Array(R),this.Rg=new Int32Array(R),this.Og=new Int32Array(R),this.Lg=new Int32Array(R),this.Sg=new Int32Array(R),this._g=-1!==f?new Int32Array(R):null;let O=0;for(let t=0;t{e.d(i,{A:()=>s});class s{static hm=0;static xp=1;static cE=2;static fE=3;static uE=4;static dE=5;static oE=6;static lE=7;static aE=8;static wE=9;static yE=10;static AE=11}},3479:(t,i,e)=>{e.d(i,{A:()=>s});class s{pg;yg;ug;wg;fg;color;flat;constructor(t,i,e,s,n,r,h){this.pg=t,this.yg=i,this.ug=e,this.wg=s,this.fg=n,this.color=r,this.flat=h}}},6855:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;J_;eg;Xp;zp;Jp;info;constructor(t,i,e,s,n,r,h,o,l){this.y=t,this.x=i,this.z=e,this.J_=s,this.eg=n,this.Xp=r,this.zp=h,this.Jp=o,this.info=l}}},7441:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;type;angle;model;Jp;info;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.type=s,this.angle=n,this.model=r,this.Jp=h,this.info=o}}},7536:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n{mE;pE;constructor(t){this.pE=[],this.mE=t;for(let i=0;i{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{gE;IE;constructor(){super(),this.gE=this,this.IE=this}CE(){this.IE&&this.gE&&(this.IE.gE=this.gE,this.gE.IE=this.IE,this.gE=null,this.IE=null)}}},3819:(t,i,e)=>{e.d(i,{A:()=>s});class s{static EE=['_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9'];static vE=t=>{t=t.trim();let i=0n;for(let e=0;e=65&&s<=90?i+=BigInt(s+1-65):s>=97&&s<=122?i+=BigInt(s+1-97):s>=48&&s<=57&&(i+=BigInt(s+27-48))}return i};static Ea=t=>{if(t<0n||t>=6582952005840035281n)return'invalid_name';if(t%37n===0n)return'invalid_name';let i=0;const e=Array(12);for(;0n!==t;){const s=t;t/=37n,e[11-i++]=this.EE[Number(s-37n*t)]}return e.slice(12-i).join('')};static bE=t=>{const i=[...t.toLowerCase()];let e=!0;for(let t=0;t='a'&&s<='z'&&(i[t]=s.toUpperCase(),e=!1),'.'!==s&&'!'!==s||(e=!0)}return i.join('')};static TE=t=>{let i='';for(let e=0;e(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static Ca=t=>{if(0===t.length)return t;const i=[...t];for(let t=0;t='a'&&i[t+1]<='z'&&(i[t+1]=String.fromCharCode(i[t+1].charCodeAt(0)+'A'.charCodeAt(0)-97)));return i[0]>='a'&&i[0]<='z'&&(i[0]=String.fromCharCode(i[0].charCodeAt(0)+'A'.charCodeAt(0)-97)),i.join('')};static xu=t=>{const i=t.toUpperCase();let e=0n;for(let t=0;t>56n)&0xffffffffffffffn;return e}}},6666:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n{RE;cursor=null;constructor(){const t=new s.A;t.next=t,t._E=t,this.RE=t}UA(t){t._E&&t.dw(),t._E=this.RE._E,t.next=this.RE,t._E&&(t._E.next=t),t.next._E=t}OE(t){t._E&&t.dw(),t._E=this.RE,t.next=this.RE.next,t._E.next=t,t.next&&(t.next._E=t)}H_(){const t=this.RE.next;return t===this.RE?null:(t?.dw(),t)}head(){const t=this.RE.next;return t===this.RE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}LE(){const t=this.RE._E;return t===this.RE?(this.cursor=null,null):(this.cursor=t?._E||null,t)}next(){const t=this.cursor;return t===this.RE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}_E(){const t=this.cursor;return t===this.RE?(this.cursor=null,null):(this.cursor=t?._E||null,t)}clear(){for(;;){const t=this.RE.next;if(t===this.RE)return;t?.dw()}}}},1982:(t,i,e)=>{e.d(i,{A:()=>s});class s{key;next;_E;constructor(){this.key=0n,this.next=this,this._E=this}dw(){this._E&&this.next&&(this._E.next=this.next,this.next._E=this._E,this.next=null,this._E=null)}}},2679:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(2512),n=e(7536);class r{SE;xE;history;available;constructor(t){this.SE=t,this.available=t,this.xE=new n.A(1024),this.history=new s.A}get(t){const i=this.xE.get(t);return i&&this.history.push(i),i}put(t,i){if(0===this.available){const t=this.history.pop();t?.dw(),t?.CE()}else this.available--;this.xE.put(t,i),this.history.push(i)}clear(){const t=this.history.pop();t?(t.dw(),t.CE()):this.available=this.SE}}},2512:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n{head;constructor(){this.head=new s.A}push(t){t.IE&&t.CE(),t.IE=this.head.IE,t.gE=this.head,t.IE&&(t.IE.gE=t),t.gE.IE=t}pop(){const t=this.head.gE;return t===this.head?null:(t?.CE(),t)}}},8534:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(3867);class r{static Lo=[];static Qa=t=>{const i=new s.A(t.read('base_head.dat')),e=new s.A(t.read('base_type.dat')),h=new s.A(t.read('base_label.dat')),o=i.mu;i.gf+=2;for(let t=0;t{e.d(i,{A:()=>r});var s=e(8534),n=e(1069);class r{static Lo=[];static Qa=t=>{const i=new n.A(t.read('frame_head.dat')),e=new n.A(t.read('frame_tran1.dat')),h=new n.A(t.read('frame_tran2.dat')),o=new n.A(t.read('frame_del.dat')),l=i.mu;i.gf+=2;const a=new Int32Array(500),c=new Int32Array(500),f=new Int32Array(500),u=new Int32Array(500);for(let t=0;t0){if(0!==d.types[t])for(let i=t-1;i>y;i--)if(0===d.types[i]){a[A]=i,c[A]=0,f[A]=0,u[A]=0,A++;break}a[A]=t;let e=0;3===d.types[a[A]]&&(e=128),c[A]=1&i?h.kE:e,f[A]=2&i?h.kE:e,u[A]=4&i?h.kE:e,y=t,A++}}n.length=A,n.DE=new Int32Array(A),n.x=new Int32Array(A),n.y=new Int32Array(A),n.z=new Int32Array(A);for(let t=0;t{e.d(i,{Uc:()=>s,zo:()=>n,NE:()=>o,FE:()=>h,BE:()=>r});const s=document.getElementById('canvas'),n=s.getContext('2d',{willReadFrequently:!0}),r=document.createElement('canvas'),h=document.createElement('img'),o=r.getContext('2d',{willReadFrequently:!0})},9298:(t,i,e)=>{e.d(i,{A:()=>s});class s{static RED=16711680;static GREEN=65280;static BLUE=255;static Gl=16776960;static UE=65535;static am=16711935;static gl=16777215;static Pl=0;static PE=16748608;static GE=8388608;static WE=128;static YE=16756736;static HE=16740352;static VE=16723968;static KE=12648192;static XE=8453888;static jE=4259584;static zE=9179409;static ZE=6116423;static il=2301979;static el=5063219;static nl=7759444;static hl=3353893;static qE=8388736;static $E=13350793;static JE=Int32Array.of(s.Gl,s.RED,s.GREEN,s.UE,s.am,s.gl);static sC=6798;static nC=107;static rC=10283;static hC=16;static oC=4797;static lC=7744;static aC=5799;static cC=4634;static fC=33697;static uC=22433;static dC=2983;static wC=54193;static yC=8741;static AC=12;static mC=64030;static pC=43162;static _C=7735;static gC=8404;static IC=1701;static CC=38430;static EC=24094;static vC=10153;static bC=56621;static TC=4783;static RC=1341;static OC=16578;static LC=35003;static SC=25239;static WI=9104;static YI=10275;static HI=7595;static VI=3610;static KI=7975;static XI=8526;static jI=918;static zI=38802;static ZI=24466;static qI=10145;static $I=58654;static JI=5027;static QI=1457;static tC=16565;static iC=34991;static eC=25486;static xC=4626;static MC=11146;static kC=6439;static DC=12;static NC=4758;static FC=10270;static VC=4574;static BC=4550;static UC=4537;static PC=5681;static GC=5673;static WC=5790;static YC=6806;static HC=8076}},8950:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n extends s.A{static yw=new Int32Array;static Aw=0;static mw=0;static top=0;static bottom=0;static left=0;static right=0;static ag=0;static QE=0;static tv=0;static bind=(t,i,e)=>{this.yw=t,this.Aw=i,this.mw=e,this.Al(0,0,i,e)};static iv=()=>{this.left=0,this.top=0,this.right=this.Aw,this.bottom=this.mw,this.ag=this.right-1,this.QE=this.right/2|0};static Al=(t,i,e,s)=>{t<0&&(t=0),i<0&&(i=0),e>this.Aw&&(e=this.Aw),s>this.mw&&(s=this.mw),this.top=i,this.bottom=s,this.left=t,this.right=e,this.ag=this.right-1,this.QE=this.right/2|0,this.tv=this.bottom/2|0};static clear=()=>{const t=this.Aw*this.mw;for(let i=0;i{this.rl(t,i,n,e),this.rl(t,i+s-1,n,e),this.sl(t,i,n,s),this.sl(t+e-1,i,n,s)};static rl=(t,i,e,s)=>{if(i=this.bottom)return;tthis.right&&(s=this.right-t);const n=t+i*this.Aw;for(let t=0;t{if(t=this.right)return;ithis.bottom&&(s=this.bottom-i);const n=t+i*this.Aw;for(let t=0;t{const r=Math.abs(e-t),h=Math.abs(s-i),o=t=this.left&&t=this.top&&i-h&&(a-=h,t+=o),e{tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const r=this.Aw-e;let h=t+i*this.Aw;for(let t=-s;t<0;t++){for(let t=-e;t<0;t++)this.yw[h++]=n;h+=r}};static sv(t,i,e,s,n,r){tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const h=256-r,o=(n>>16&255)*r,l=(n>>8&255)*r,a=(255&n)*r,c=this.Aw-e;let f=t+i*this.Aw;for(let t=0;t>16&255)*h>>8<<16)+(l+(this.yw[f]>>8&255)*h>>8<<8)+(a+(255&this.yw[f])*h>>8);this.yw[f++]=t}f+=c}}static nv(t,i,e,s,n){const r=256-n,h=(s>>16&255)*n,o=(s>>8&255)*n,l=(255&s)*n;let a=i-e;a<0&&(a=0);let c=i+e;c>=this.mw&&(c=this.mw-1);for(let s=a;s<=c;s++){const n=s-i,a=0|Math.sqrt(e*e-n*n);let c=t-a;c<0&&(c=0);let f=t+a;f>=this.Aw&&(f=this.Aw-1);let u=c+s*this.Aw;for(let t=c;t<=f;t++){const t=(h+(this.yw[u]>>16&255)*r>>8<<16)+(o+(this.yw[u]>>8&255)*r>>8<<8)+(l+(255&this.yw[u])*r>>8);this.yw[u++]=t}}}static rv=(t,i,e)=>{t=this.right||i=this.bottom||(this.yw[t+i*this.Aw]=e)}}},4583:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(8950),n=e(1673),r=e(3867);class h extends s.A{static et=!1;static hv=new Int32Array(512);static ov=new Int32Array(2048);static sin=new Int32Array(2048);static cos=new Int32Array(2048);static palette=new Int32Array(65536);static lv=new r.fe(50,null);static av=0;static ww=new Int32Array;static ra=0;static ha=0;static pw=!0;static lg=!1;static alpha=0;static cv=null;static fv=new r.fe(50,null);static uv=0;static Sm=0;static dv=new Int32Array(50);static wv=new r.fe(50,null);static yv=!1;static Av=new r.fe(50,!1);static mv=new Int32Array(50);static{for(let t=1;t<512;t++)this.hv[t]=32768/t|0;for(let t=1;t<2048;t++)this.ov[t]=65536/t|0;for(let t=0;t<2048;t++)this.sin[t]=65536*Math.sin(.0030679615757712823*t)|0,this.cos[t]=65536*Math.cos(.0030679615757712823*t)|0}static To=()=>{this.hv=null,this.hv=null,this.sin=null,this.cos=null,this.ww=null,this.lv=null,this.Av=null,this.mv=null,this.cv=null,this.fv=null,this.dv=null,this.palette=null,this.wv=null,console.log('Draw3D unloaded!')};static nc=()=>{this.ww=new Int32Array(this.mw);for(let t=0;t{this.ww=new Int32Array(i);for(let e=0;e{this.cv=null,this.fv.fill(null)};static qa=t=>{this.av=0;for(let i=0;i<50;i++)try{this.lv[i]=n.A.Za(t,i.toString()),this.et&&128===this.lv[i]?.Fl?this.lv[i]?.gv():this.lv[i]?.Ow(),this.av++}catch(t){}};static lm=t=>{if(0!==this.mv[t])return this.mv[t];const i=this.wv[t];if(!i)return 0;let e=0,s=0,n=0;const r=i.length;for(let t=0;t>16&255,s+=i[t]>>8&255,n+=255&i[t];let h=(e/r<<16)+(s/r<<8)+(n/r|0);return h=this.Iv(h,1.4),0===h&&(h=1),this.mv[t]=h,h};static $a=t=>{const i=t+.03*Math.random()-.015;let e=0;for(let t=0;t<512;t++){const s=(t/8|0)/64+.0078125,n=(7&t)/8+.0625;for(let t=0;t<128;t++){const r=t/128;let h=r,o=r,l=r;if(0!==n){let t;t=r<.5?r*(n+1):r+n-r*n;const i=2*r-t;let e=s+.3333333333333333;e>1&&e--;let a=s-.3333333333333333;a<0&&a++,h=6*e<1?i+6*(t-i)*e:2*e<1?t:3*e<2?i+(t-i)*(.6666666666666666-e)*6:i,o=6*s<1?i+6*(t-i)*s:2*s<1?t:3*s<2?i+(t-i)*(.6666666666666666-s)*6:i,l=6*a<1?i+6*(t-i)*a:2*a<1?t:3*a<2?i+(t-i)*(.6666666666666666-a)*6:i}const a=((256*h|0)<<16)+((256*o|0)<<8)+(256*l|0);this.palette[e++]=this.Iv(a,i)}}for(let t=0;t<50;t++){const e=this.lv[t];if(!e)continue;const s=e.palette;this.wv[t]=new Int32Array(s.length);for(let e=0;e{const e=(t>>16)/256,s=(t>>8&255)/256,n=(255&t)/256;return((256*Math.pow(e,i)|0)<<16)+((256*Math.pow(s,i)|0)<<8)+(256*Math.pow(n,i)|0)};static Ja=t=>{this.cv||(this.uv=t,this.et?this.cv=new r.Xr(t,16384):this.cv=new r.Xr(t,65536),this.fv.fill(null))};static dg=(t,i,e,s,n,r,h,o,l)=>{let a=0,c=0;n!==s&&(a=(i-t<<16)/(n-s)|0,c=(o-h<<15)/(n-s)|0);let f=0,u=0;r!==n&&(f=(e-i<<16)/(r-n)|0,u=(l-o<<15)/(r-n)|0);let d=0,w=0;if(r!==s&&(d=(t-e<<16)/(s-r)|0,w=(h-l<<15)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),nf)for(r-=n,n-=s,s=this.ww[s];;){if(--n<0)for(;;){if(--r<0)return;this.Ev(e>>16,i>>16,l>>7,o>>7,this.yw,s,0),e+=d,i+=f,l+=w,o+=u,s+=this.Aw}this.Ev(e>>16,t>>16,l>>7,h>>7,this.yw,s,0),e+=d,t+=a,l+=w,h+=c,s+=this.Aw}else for(r-=n,n-=s,s=this.ww[s];;){if(--n<0)for(;;){if(--r<0)return;this.Ev(i>>16,e>>16,o>>7,l>>7,this.yw,s,0),e+=d,i+=f,l+=w,o+=u,s+=this.Aw}this.Ev(t>>16,e>>16,h>>7,l>>7,this.yw,s,0),e+=d,t+=a,l+=w,h+=c,s+=this.Aw}else if(i=t<<=16,o=h<<=15,s<0&&(i-=d*s,t-=a*s,o-=w*s,h-=c*s,s=0),e<<=16,l<<=15,r<0&&(e-=f*r,l-=u*r,r=0),s!==r&&da)for(n-=r,r-=s,s=this.ww[s];;){if(--r<0)for(;;){if(--n<0)return;this.Ev(e>>16,t>>16,l>>7,h>>7,this.yw,s,0),e+=f,t+=a,l+=u,h+=c,s+=this.Aw}this.Ev(i>>16,t>>16,o>>7,h>>7,this.yw,s,0),i+=d,t+=a,o+=w,h+=c,s+=this.Aw}else for(n-=r,r-=s,s=this.ww[s];;){if(--r<0)for(;;){if(--n<0)return;this.Ev(t>>16,e>>16,h>>7,l>>7,this.yw,s,0),e+=f,t+=a,l+=u,h+=c,s+=this.Aw}this.Ev(t>>16,i>>16,h>>7,o>>7,this.yw,s,0),i+=d,t+=a,o+=w,h+=c,s+=this.Aw}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),rd)for(s-=r,r-=n,n=this.ww[n];;){if(--r<0)for(;;){if(--s<0)return;this.Ev(t>>16,e>>16,h>>7,l>>7,this.yw,n,0),t+=a,e+=d,h+=c,l+=w,n+=this.Aw}this.Ev(t>>16,i>>16,h>>7,o>>7,this.yw,n,0),t+=a,i+=f,h+=c,o+=u,n+=this.Aw}else for(s-=r,r-=n,n=this.ww[n];;){if(--r<0)for(;;){if(--s<0)return;this.Ev(e>>16,t>>16,l>>7,h>>7,this.yw,n,0),t+=a,e+=d,h+=c,l+=w,n+=this.Aw}this.Ev(i>>16,t>>16,o>>7,h>>7,this.yw,n,0),t+=a,i+=f,h+=c,o+=u,n+=this.Aw}else if(e=i<<=16,l=o<<=15,n<0&&(e-=a*n,i-=f*n,l-=c*n,o-=u*n,n=0),t<<=16,h<<=15,s<0&&(t-=d*s,h-=w*s,s=0),r-=s,s-=n,n=this.ww[n],a>16,i>>16,h>>7,o>>7,this.yw,n,0),t+=d,i+=f,h+=w,o+=u,n+=this.Aw}this.Ev(e>>16,i>>16,l>>7,o>>7,this.yw,n,0),e+=a,i+=f,l+=c,o+=u,n+=this.Aw}else for(;;){if(--s<0)for(;;){if(--r<0)return;this.Ev(i>>16,t>>16,o>>7,h>>7,this.yw,n,0),t+=d,i+=f,h+=w,o+=u,n+=this.Aw}this.Ev(i>>16,e>>16,o>>7,l>>7,this.yw,n,0),e+=a,i+=f,l+=c,o+=u,n+=this.Aw}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,o>>7,h>>7,this.yw,r,0),i+=f,t+=a,o+=u,h+=c,r+=this.Aw}this.Ev(i>>16,e>>16,o>>7,l>>7,this.yw,r,0),i+=f,e+=d,o+=u,l+=w,r+=this.Aw}else for(;;){if(--s<0)for(;;){if(--n<0)return;this.Ev(t>>16,i>>16,h>>7,o>>7,this.yw,r,0),i+=f,t+=a,o+=u,h+=c,r+=this.Aw}this.Ev(e>>16,i>>16,l>>7,o>>7,this.yw,r,0),i+=f,e+=d,o+=u,l+=w,r+=this.Aw}else if(t=e<<=16,h=l<<=15,r<0&&(t-=f*r,e-=d*r,h-=u*r,l-=w*r,r=0),i<<=16,o<<=15,n<0&&(i-=a*n,o-=c*n,n=0),s-=n,n-=r,r=this.ww[r],f>16,e>>16,o>>7,l>>7,this.yw,r,0),i+=a,e+=d,o+=c,l+=w,r+=this.Aw}this.Ev(t>>16,e>>16,h>>7,l>>7,this.yw,r,0),t+=f,e+=d,h+=u,l+=w,r+=this.Aw}else for(;;){if(--n<0)for(;;){if(--s<0)return;this.Ev(e>>16,i>>16,l>>7,o>>7,this.yw,r,0),i+=a,e+=d,o+=c,l+=w,r+=this.Aw}this.Ev(e>>16,t>>16,l>>7,h>>7,this.yw,r,0),t+=f,e+=d,h+=u,l+=w,r+=this.Aw}};static Ev=(t,i,e,s,n,r,h)=>{let o;if(this.pw){let l;if(this.lg){if(l=i-t>3?(s-e)/(i-t)|0:0,i>this.ag&&(i=this.ag),t<0&&(e-=t*l,t=0),t>=i)return;r+=t,h=i-t>>2,l<<=2}else{if(!(t>2)>0?(s-e)*this.hv[h]>>15:0}if(0===this.alpha)for(;;){if(--h<0){if((h=i-t&3)>0){o=this.palette[e>>8];do{n[r++]=o,h--}while(h>0);return}break}o=this.palette[e>>8],e+=l,n[r++]=o,n[r++]=o,n[r++]=o,n[r++]=o}else{const s=this.alpha,a=256-this.alpha;for(;;){if(--h<0){if((h=i-t&3)>0){o=this.palette[e>>8],o=((16711935&o)*a>>8&16711935)+((65280&o)*a>>8&65280);do{n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),h--}while(h>0)}break}o=this.palette[e>>8],e+=l,o=((16711935&o)*a>>8&16711935)+((65280&o)*a>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280)}}}else if(tthis.ag&&(i=this.ag),t<0&&(e-=t*l,t=0),t>=i))return;if(r+=t,h=i-t,0===this.alpha)do{n[r++]=this.palette[e>>8],e+=l,h--}while(h>0);else{const t=this.alpha,i=256-this.alpha;do{o=this.palette[e>>8],e+=l,o=((16711935&o)*i>>8&16711935)+((65280&o)*i>>8&65280),n[r++]=o+((16711935&n[r])*t>>8&16711935)+((65280&n[r])*t>>8&65280),h--}while(h>0)}}};static vv=(t,i,e,s,n,r,h)=>{let o=0;n!==s&&(o=(i-t<<16)/(n-s)|0);let l=0;r!==n&&(l=(e-i<<16)/(r-n)|0);let a=0;if(r!==s&&(a=(t-e<<16)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),nl)for(r-=n,n-=s,s=this.ww[s];;){if(--n<0)for(;;){if(--r<0)return;this.bv(e>>16,i>>16,this.yw,s,h),e+=a,i+=l,s+=this.Aw}this.bv(e>>16,t>>16,this.yw,s,h),e+=a,t+=o,s+=this.Aw}else for(r-=n,n-=s,s=this.ww[s];;){if(--n<0)for(;;){if(--r<0)return;this.bv(i>>16,e>>16,this.yw,s,h),e+=a,i+=l,s+=this.Aw}this.bv(t>>16,e>>16,this.yw,s,h),e+=a,t+=o,s+=this.Aw}else if(i=t<<=16,s<0&&(i-=a*s,t-=o*s,s=0),e<<=16,r<0&&(e-=l*r,r=0),s!==r&&ao)for(n-=r,r-=s,s=this.ww[s];;){if(--r<0)for(;;){if(--n<0)return;this.bv(e>>16,t>>16,this.yw,s,h),e+=l,t+=o,s+=this.Aw}this.bv(i>>16,t>>16,this.yw,s,h),i+=a,t+=o,s+=this.Aw}else for(n-=r,r-=s,s=this.ww[s];;){if(--r<0)for(;;){if(--n<0)return;this.bv(t>>16,e>>16,this.yw,s,h),e+=l,t+=o,s+=this.Aw}this.bv(t>>16,i>>16,this.yw,s,h),i+=a,t+=o,s+=this.Aw}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),ra)for(s-=r,r-=n,n=this.ww[n];;){if(--r<0)for(;;){if(--s<0)return;this.bv(t>>16,e>>16,this.yw,n,h),t+=o,e+=a,n+=this.Aw}this.bv(t>>16,i>>16,this.yw,n,h),t+=o,i+=l,n+=this.Aw}else for(s-=r,r-=n,n=this.ww[n];;){if(--r<0)for(;;){if(--s<0)return;this.bv(e>>16,t>>16,this.yw,n,h),t+=o,e+=a,n+=this.Aw}this.bv(i>>16,t>>16,this.yw,n,h),t+=o,i+=l,n+=this.Aw}else if(e=i<<=16,n<0&&(e-=o*n,i-=l*n,n=0),t<<=16,s<0&&(t-=a*s,s=0),o>16,i>>16,this.yw,n,h),t+=a,i+=l,n+=this.Aw}this.bv(e>>16,i>>16,this.yw,n,h),e+=o,i+=l,n+=this.Aw}else for(r-=s,s-=n,n=this.ww[n];;){if(--s<0)for(;;){if(--r<0)return;this.bv(i>>16,t>>16,this.yw,n,h),t+=a,i+=l,n+=this.Aw}this.bv(i>>16,e>>16,this.yw,n,h),e+=o,i+=l,n+=this.Aw}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,this.yw,r,h),i+=l,t+=o,r+=this.Aw}this.bv(i>>16,e>>16,this.yw,r,h),i+=l,e+=a,r+=this.Aw}else for(n-=s,s-=r,r=this.ww[r];;){if(--s<0)for(;;){if(--n<0)return;this.bv(t>>16,i>>16,this.yw,r,h),i+=l,t+=o,r+=this.Aw}this.bv(e>>16,i>>16,this.yw,r,h),i+=l,e+=a,r+=this.Aw}else if(t=e<<=16,r<0&&(t-=l*r,e-=a*r,r=0),i<<=16,n<0&&(i-=o*n,n=0),l>16,e>>16,this.yw,r,h),i+=o,e+=a,r+=this.Aw}this.bv(t>>16,e>>16,this.yw,r,h),t+=l,e+=a,r+=this.Aw}else for(s-=n,n-=r,r=this.ww[r];;){if(--n<0)for(;;){if(--s<0)return;this.bv(e>>16,i>>16,this.yw,r,h),i+=o,e+=a,r+=this.Aw}this.bv(e>>16,t>>16,this.yw,r,h),t+=l,e+=a,r+=this.Aw}};static mg=(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w,y,A,m,p)=>{const _=this.Tv(p);this.yv=!this.Av[p];const g=a-u,I=c-w,C=f-A,E=d-a,v=y-c,b=m-f;let T=E*c-v*a<<14;const R=v*f-b*c<<8,O=b*a-E*f<<5;let L=g*c-I*a<<14;const S=I*f-C*c<<8,x=C*a-g*f<<5;let M=I*E-g*v<<14;const k=C*v-I*b<<8,D=g*b-C*E<<5;let N=0,F=0;n!==s&&(N=(i-t<<16)/(n-s)|0,F=(o-h<<16)/(n-s)|0);let B=0,U=0;r!==n&&(B=(e-i<<16)/(r-n)|0,U=(l-o<<16)/(r-n)|0);let P=0,G=0;if(r!==s&&(P=(t-e<<16)/(s-r)|0,G=(h-l<<16)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),nB)for(r-=n,n-=s,s=this.ww[s];;){if(--n<0)for(;;){if(--r<0)return;this.Rv(e>>16,i>>16,this.yw,s,_,0,0,T,L,M,R,S,k,l>>8,o>>8),e+=P,i+=B,l+=G,o+=U,s+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.Rv(e>>16,t>>16,this.yw,s,_,0,0,T,L,M,R,S,k,l>>8,h>>8),e+=P,t+=N,l+=G,h+=F,s+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}else for(r-=n,n-=s,s=this.ww[s];;){if(--n<0)for(;;){if(--r<0)return;this.Rv(i>>16,e>>16,this.yw,s,_,0,0,T,L,M,R,S,k,o>>8,l>>8),e+=P,i+=B,l+=G,o+=U,s+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.Rv(t>>16,e>>16,this.yw,s,_,0,0,T,L,M,R,S,k,h>>8,l>>8),e+=P,t+=N,l+=G,h+=F,s+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}}else{i=t<<=16,o=h<<=16,s<0&&(i-=P*s,t-=N*s,o-=G*s,h-=F*s,s=0),e<<=16,l<<=16,r<0&&(e-=B*r,l-=U*r,r=0);const a=s-this.ha;if(T+=O*a,L+=x*a,M+=D*a,T|=0,L|=0,M|=0,(s===r||P>=N)&&(s!==r||B<=N))for(n-=r,r-=s,s=this.ww[s];;){if(--r<0)for(;;){if(--n<0)return;this.Rv(t>>16,e>>16,this.yw,s,_,0,0,T,L,M,R,S,k,h>>8,l>>8),e+=B,t+=N,l+=U,h+=F,s+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.Rv(t>>16,i>>16,this.yw,s,_,0,0,T,L,M,R,S,k,h>>8,o>>8),i+=P,t+=N,o+=G,h+=F,s+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}else for(n-=r,r-=s,s=this.ww[s];;){if(--r<0)for(;;){if(--n<0)return;this.Rv(e>>16,t>>16,this.yw,s,_,0,0,T,L,M,R,S,k,l>>8,h>>8),e+=B,t+=N,l+=U,h+=F,s+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.Rv(i>>16,t>>16,this.yw,s,_,0,0,T,L,M,R,S,k,o>>8,h>>8),i+=P,t+=N,o+=G,h+=F,s+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),rP)for(s-=r,r-=n,n=this.ww[n];;){if(--r<0)for(;;){if(--s<0)return;this.Rv(t>>16,e>>16,this.yw,n,_,0,0,T,L,M,R,S,k,h>>8,l>>8),t+=N,e+=P,h+=F,l+=G,n+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.Rv(t>>16,i>>16,this.yw,n,_,0,0,T,L,M,R,S,k,h>>8,o>>8),t+=N,i+=B,h+=F,o+=U,n+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}else for(s-=r,r-=n,n=this.ww[n];;){if(--r<0)for(;;){if(--s<0)return;this.Rv(e>>16,t>>16,this.yw,n,_,0,0,T,L,M,R,S,k,l>>8,h>>8),t+=N,e+=P,h+=F,l+=G,n+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.Rv(i>>16,t>>16,this.yw,n,_,0,0,T,L,M,R,S,k,o>>8,h>>8),t+=N,i+=B,h+=F,o+=U,n+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}}else{e=i<<=16,l=o<<=16,n<0&&(e-=N*n,i-=B*n,l-=F*n,o-=U*n,n=0),t<<=16,h<<=16,s<0&&(t-=P*s,h-=G*s,s=0);const a=n-this.ha;if(T+=O*a,L+=x*a,M+=D*a,T|=0,L|=0,M|=0,r-=s,s-=n,n=this.ww[n],N>16,i>>16,this.yw,n,_,0,0,T,L,M,R,S,k,h>>8,o>>8),t+=P,i+=B,h+=G,o+=U,n+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.Rv(e>>16,i>>16,this.yw,n,_,0,0,T,L,M,R,S,k,l>>8,o>>8),e+=N,i+=B,l+=F,o+=U,n+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}else for(;;){if(--s<0)for(;;){if(--r<0)return;this.Rv(i>>16,t>>16,this.yw,n,_,0,0,T,L,M,R,S,k,o>>8,h>>8),t+=P,i+=B,h+=G,o+=U,n+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.Rv(i>>16,e>>16,this.yw,n,_,0,0,T,L,M,R,S,k,o>>8,l>>8),e+=N,i+=B,l+=F,o+=U,n+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,this.yw,r,_,0,0,T,L,M,R,S,k,o>>8,h>>8),i+=B,t+=N,o+=U,h+=F,r+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.Rv(i>>16,e>>16,this.yw,r,_,0,0,T,L,M,R,S,k,o>>8,l>>8),i+=B,e+=P,o+=U,l+=G,r+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}else for(;;){if(--s<0)for(;;){if(--n<0)return;this.Rv(t>>16,i>>16,this.yw,r,_,0,0,T,L,M,R,S,k,h>>8,o>>8),i+=B,t+=N,o+=U,h+=F,r+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.Rv(e>>16,i>>16,this.yw,r,_,0,0,T,L,M,R,S,k,l>>8,o>>8),i+=B,e+=P,o+=U,l+=G,r+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}}else{t=e<<=16,h=l<<=16,r<0&&(t-=B*r,e-=P*r,h-=U*r,l-=G*r,r=0),i<<=16,o<<=16,n<0&&(i-=N*n,o-=F*n,n=0);const a=r-this.ha;if(T+=O*a,L+=x*a,M+=D*a,T|=0,L|=0,M|=0,s-=n,n-=r,r=this.ww[r],B>16,e>>16,this.yw,r,_,0,0,T,L,M,R,S,k,o>>8,l>>8),i+=N,e+=P,o+=F,l+=G,r+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.Rv(t>>16,e>>16,this.yw,r,_,0,0,T,L,M,R,S,k,h>>8,l>>8),t+=B,e+=P,h+=U,l+=G,r+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}else for(;;){if(--n<0)for(;;){if(--s<0)return;this.Rv(e>>16,i>>16,this.yw,r,_,0,0,T,L,M,R,S,k,l>>8,o>>8),i+=N,e+=P,o+=F,l+=G,r+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.Rv(e>>16,t>>16,this.yw,r,_,0,0,T,L,M,R,S,k,l>>8,h>>8),t+=B,e+=P,h+=U,l+=G,r+=this.Aw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}}};static Rv=(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w)=>{if(t>=i)return;let y,A,m,p,_,g,I,C,E;if(this.lg){if(y=(w-d)/(i-t)|0,i>this.ag&&(i=this.ag),t<0&&(d-=t*y,t=0),t>=i)return;A=i-t>>3,y<<=12}else i-t>7?(A=i-t>>3,y=(w-d)*this.hv[A]>>6):(A=0,y=0);if(d<<=9,s+=t,this.et&&n)if(m=0,p=0,g=t-this.ra,o+=(c>>3)*g,l+=(f>>3)*g,a+=(u>>3)*g,o|=0,l|=0,_=(a|=0)>>12,0!==_&&(h=l/_|0,(r=o/_|0)<0?r=0:r>4032&&(r=4032)),o+=c,l+=f,a+=u,o|=0,l|=0,_=(a|=0)>>12,0!==_&&(m=o/_|0,p=l/_|0,m<7?m=7:m>4032&&(m=4032)),I=m-r>>3,C=p-h>>3,r+=d>>3&786432,E=d>>23,this.yv){for(;A-- >0;)e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=I,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=I,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=I,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=I,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=I,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=I,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=I,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r=m,h=p,o+=c,l+=f,_=(a+=u)>>12,0!==_&&(m=o/_|0,p=l/_|0,m<7?m=7:m>4032&&(m=4032)),I=m-r>>3,C=p-h>>3,r+=(d+=y)>>3&786432,E=d>>23;for(A=i-t&7;A-- >0;)e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=I,h+=C}else{for(;A-- >0;){let t;0!=(t=n[(4032&h)+(r>>6)]>>>E)&&(e[s]=t),s+=1,0!=(t=n[(4032&(h+=C))+((r+=I)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=I)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=I)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=I)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=I)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=I)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=I)>>6)]>>>E)&&(e[s]=t),s+=1,r=m,h=p,o+=c,l+=f,a+=u,o|=0,l|=0,_=(a|=0)>>12,0!==_&&(m=o/_|0,p=l/_|0,m<7?m=7:m>4032&&(m=4032)),I=m-r>>3,C=p-h>>3,r+=(d+=y)>>3&786432,E=d>>23}for(A=i-t&7;A-- >0;){let t;0!=(t=n[(4032&h)+(r>>6)]>>>E)&&(e[s]=t),s++,r+=I,h+=C}}else if(m=0,p=0,g=t-this.ra,o+=(c>>3)*g,l+=(f>>3)*g,a+=(u>>3)*g,o|=0,l|=0,_=(a|=0)>>14,0!==_&&(h=l/_|0,(r=o/_|0)<0?r=0:r>16256&&(r=16256)),o+=c,l+=f,a+=u,o|=0,l|=0,_=(a|=0)>>14,0!==_&&(m=o/_|0,p=l/_|0,m<7?m=7:m>16256&&(m=16256)),I=m-r>>3,C=p-h>>3,r+=6291456&d,E=d>>23,this.yv&&n){for(;A-- >0;)e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=I,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=I,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=I,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=I,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=I,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=I,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=I,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r=m,h=p,o+=c,l+=f,a+=u,o|=0,l|=0,_=(a|=0)>>14,0!==_&&(m=o/_|0,p=l/_|0,m<7?m=7:m>16256&&(m=16256)),I=m-r>>3,C=p-h>>3,r+=6291456&(d+=y),E=d>>23;for(A=i-t&7;A-- >0;)e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=I,h+=C}else{for(;A-- >0&&n;){let t;0!=(t=n[(16256&h)+(r>>7)]>>>E)&&(e[s]=t),s+=1,0!=(t=n[(16256&(h+=C))+((r+=I)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=I)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=I)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=I)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=I)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=I)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=I)>>7)]>>>E)&&(e[s]=t),s++,r=m,h=p,o+=c,l+=f,a+=u,o|=0,l|=0,_=(a|=0)>>14,0!==_&&(m=o/_|0,p=l/_|0,m<7?m=7:m>16256&&(m=16256)),I=m-r>>3,C=p-h>>3,r+=6291456&(d+=y),E=d>>23}for(A=i-t&7;A-- >0&&n;){let t;0!=(t=n[(16256&h)+(r>>7)]>>>E)&&(e[s]=t),s++,r+=I,h+=C}}};static bv=(t,i,e,s,n)=>{if(this.lg&&(i>this.ag&&(i=this.ag),t<0&&(t=0)),t>=i)return;s+=t;let r=i-t>>2;if(0===this.alpha)for(;;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;e[s++]=n}e[s++]=n,e[s++]=n,e[s++]=n,e[s++]=n}const h=this.alpha,o=256-this.alpha;for(n=((16711935&n)*o>>8&16711935)+((65280&n)*o>>8&65280);;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280)}e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280)}};static Cv=t=>{this.fv[t]&&this.cv&&(this.cv[this.uv++]=this.fv[t],this.fv[t]=null)};static Tv=t=>{if(this.dv[t]=this.Sm++,this.fv[t])return this.fv[t];let i;if(this.uv>0&&this.cv)i=this.cv[--this.uv],this.cv[this.uv]=null;else{let t=0,e=-1;for(let i=0;i>>3)&16316671,i[n+8192]=r-(r>>>2)&16316671,i[n+12288]=r-(r>>>2)-(r>>>3)&16316671}}else{if(64===e.width)for(let t=0;t<128;t++)for(let n=0;n<128;n++)i[n+(t<<7)]=s[e.yw[(n>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)i[t]=s[e.yw[t]];this.Av[t]=!1;for(let e=0;e<16384;e++){i[e]&=16316671;const s=i[e];0===s&&(this.Av[t]=!0),i[e+16384]=s-(s>>>3)&16316671,i[e+32768]=s-(s>>>2)&16316671,i[e+49152]=s-(s>>>2)-(s>>>3)&16316671}}return i}}},880:(t,i,e)=>{e.d(i,{r:()=>n});var s=e(7854);const n=async t=>{255!==t[0]&&(t[0]=255),URL.revokeObjectURL(s.FE.src),s.FE.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>s.FE.onload=()=>t())),s.NE.clearRect(0,0,s.BE.width,s.BE.height);const i=s.FE.naturalWidth,e=s.FE.naturalHeight;return s.BE.width=i,s.BE.height=e,s.NE.drawImage(s.FE,0,0),s.NE.getImageData(0,0,i,e)}},8665:(t,i,e)=>{e.d(i,{A:()=>f});var s=e(1069),n=e(8950),r=e(4583),h=e(6730),o=e(4474),l=e(3867);class a{Fd=0;C_=0;Ov=0;Lv=-1;Sv=-1;xv=-1;Mv=-1;kv=-1;Dv=-1;Nv=-1;Fv=-1;Bv=-1;Uv=0;Pv=-1;Gv=-1;Wv=-1;data=null}class c{x=0;y=0;z=0;w=0}class f extends o.A{static metadata=null;static head=null;static Yv=null;static Hv=null;static Vv=null;static Kv=null;static Xv=null;static jv=null;static zv=null;static Zv=null;static qv=null;static $v=null;static Jv=null;static Qv=null;static axis=null;static tb=new l.fe(4096,!1);static ib=new l.fe(4096,!1);static eb=new Int32Array(4096);static sb=new Int32Array(4096);static nb=new Int32Array(4096);static rb=new Int32Array(4096);static hb=new Int32Array(4096);static ob=new Int32Array(4096);static lb=new Int32Array(1500);static ab=new l.Xr(1500,512);static cb=new Int32Array(12);static fb=new l.Xr(12,2e3);static ub=new Int32Array(2e3);static wb=new Int32Array(2e3);static yb=new Int32Array(12);static Ab=new Int32Array(10);static mb=new Int32Array(10);static pb=new Int32Array(10);static gr=0;static _b=0;static Ir=0;static gb=!1;static kl=0;static Dl=0;static Ib=0;static Cb=new Int32Array(1e3);static Eb=!1;static Qa(t){try{f.head=new s.A(t.read('ob_head.dat')),f.Yv=new s.A(t.read('ob_face1.dat')),f.Hv=new s.A(t.read('ob_face2.dat')),f.Vv=new s.A(t.read('ob_face3.dat')),f.Kv=new s.A(t.read('ob_face4.dat')),f.Xv=new s.A(t.read('ob_face5.dat')),f.jv=new s.A(t.read('ob_point1.dat')),f.zv=new s.A(t.read('ob_point2.dat')),f.Zv=new s.A(t.read('ob_point3.dat')),f.qv=new s.A(t.read('ob_point4.dat')),f.$v=new s.A(t.read('ob_point5.dat')),f.Jv=new s.A(t.read('ob_vertex1.dat')),f.Qv=new s.A(t.read('ob_vertex2.dat')),f.axis=new s.A(t.read('ob_axis.dat')),f.head.gf=0,f.jv.gf=0,f.zv.gf=0,f.Zv.gf=0,f.qv.gf=0,f.Jv.gf=0,f.Qv.gf=0;const i=f.head.mu;f.metadata=new l.fe(i+100,null);let e=0,n=0,r=0,h=0,o=0,c=0,u=0;for(let t=0;t>7)<2?i=2:i>126&&(i=126),(65408&t)+i):(i<0?i=0:i>127&&(i=127),127-i)}static Nd=(t,i,e)=>{const s=t.Fd,n=t.C_,r=t.Ov;let h,o,a,u,d;if(i){h=new Int32Array(s);for(let i=0;i{const n=t.Fd,r=t.C_,h=t.Ov;let o,l,a,c,u;if(s)o=t.Bd,l=t.Pd,a=t.Ud;else{o=new Int32Array(n),l=new Int32Array(n),a=new Int32Array(n);for(let i=0;i{const e=t.Fd,s=t.C_,n=t.Ov,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e);for(let i=0;i{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,l=0,a=-1;for(let c=0;c{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,l=0,a=-1;for(let c=0;c{let o=-1;const l=t.Bd[i],a=t.Pd[i],c=t.Ud[i];for(let t=0;t{if(!f.metadata)throw new Error('cant loading model metadata!!!!!');const i=f.metadata[t];if(!i)throw console.log(`Error model:${t} not found!`),new Error('cant loading model metadata!!!!!');if(!(f.head&&f.Yv&&f.Hv&&f.Vv&&f.Kv&&f.Xv&&f.jv&&f.zv&&f.Zv&&f.qv&&f.$v&&f.Jv&&f.Qv&&f.axis))throw new Error('cant loading model!!!!!');const e=i.Fd,s=i.C_,n=i.Ov,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e),l=new Int32Array(s),a=new Int32Array(s),c=new Int32Array(s),u=new Int32Array(n),d=new Int32Array(n),w=new Int32Array(n);let y=null;i.kv>=0&&(y=new Int32Array(e));let A=null;i.Bv>=0&&(A=new Int32Array(s));let m=null,p=0;i.Uv>=0?m=new Int32Array(s):p=-i.Uv-1;let _=null;i.Pv>=0&&(_=new Int32Array(s));let g=null;i.Gv>=0&&(g=new Int32Array(s));const I=new Int32Array(s);f.jv.gf=i.Lv,f.zv.gf=i.Sv,f.Zv.gf=i.xv,f.qv.gf=i.Mv,f.$v.gf=i.kv;let C,E,v,b=0,T=0,R=0;for(let t=0;t{if(!f.metadata||!f.metadata[i])throw new Error('No model metadata');const e=f.metadata[i];if(e.data=t,!e.data.length)throw new Error('No model data');const n=e.Fd,r=e.C_,h=e.Ov,o=new Int32Array(n),l=new Int32Array(n),a=new Int32Array(n),c=new Int32Array(r),u=new Int32Array(r),d=new Int32Array(r),w=new Int32Array(h),y=new Int32Array(h),A=new Int32Array(h);let m=null;e.kv>=0&&(m=new Int32Array(n));let p=null;e.Bv>=0&&(p=new Int32Array(r));let _=null,g=0;e.Uv>=0?_=new Int32Array(r):g=-e.Uv-1;let I=null;e.Pv>=0&&(I=new Int32Array(r));let C=null;e.Gv>=0&&(C=new Int32Array(r));const E=new Int32Array(r),v=new s.A(e.data);v.gf=e.Lv;const b=new s.A(e.data);b.gf=e.Sv;const T=new s.A(e.data);T.gf=e.xv;const R=new s.A(e.data);R.gf=e.Mv;const O=new s.A(e.data);O.gf=e.kv;let L,S,x,M=0,k=0,D=0;for(let t=0;tthis.jd&&(this.jd=-e),e>this.A_&&(this.A_=e);const n=i*i+s*s;n>this.gm&&(this.gm=n)}this.gm=Math.sqrt(this.gm)+.99|0,this.Nb=Math.sqrt(this.gm*this.gm+this.jd*this.jd)+.99|0,this.Db=this.Nb+(Math.sqrt(this.gm*this.gm+this.A_*this.A_)+.99|0)}Gd(){this.jd=0,this.A_=0;for(let t=0;tthis.jd&&(this.jd=-i),i>this.A_&&(this.A_=i)}this.Nb=Math.sqrt(this.gm*this.gm+this.jd*this.jd)+.99|0,this.Db=this.Nb+(Math.sqrt(this.gm*this.gm+this.A_*this.A_)+.99|0)}xa(){if(this.Fb){const t=new Int32Array(256);let i=0;for(let e=0;ei&&(i=s)}this.Vd=new l.fe(i+1,null);for(let e=0;e<=i;e++)this.Vd[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;ei&&(i=s)}this.Hd=new l.fe(i+1,null);for(let e=0;e<=i;e++)this.Hd[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;el;)l=e[o++];r&&r.types&&s.x&&s.y&&s.z&&r.labels&&(i!==l||0===r.types[i])&&this.Wb(s.x[t],s.y[t],s.z[t],r.labels[i],r.types[i])}f.gr=0,f._b=0,f.Ir=0,o=0,l=e[o++];for(let t=0;tl;)l=e[o++];r&&r.types&&n.x&&n.y&&n.z&&r.labels&&(i===l||0===r.types[i])&&this.Wb(n.x[t],n.y[t],n.z[t],r.labels[i],r.types[i])}}else this.Ma(t)}Ma(t){if(!this.Vd||-1===t||!h.A.Lo[t])return;const i=h.A.Lo[t],e=i.ME;f.gr=0,f._b=0,f.Ir=0;for(let t=0;t>16;this.Ud[t]=this.Pd[t]*i+this.Ud[t]*e>>16,this.Pd[t]=s}}translate(t,i,e){for(let s=0;s>8;if(this.Tb&&this.Rb&&this.Ob||(this.Tb=new Int32Array(this.C_),this.Rb=new Int32Array(this.C_),this.Ob=new Int32Array(this.C_)),!this.l_){this.l_=new l.fe(this.Fd,null);for(let t=0;t8192||m>8192||p>8192||A<-8192||m<-8192||p<-8192;)A>>=1,m>>=1,p>>=1;let _=0|Math.sqrt(A*A+m*m+p*p);if(_<=0&&(_=1),A=256*A/_|0,m=256*m/_|0,p=256*p/_|0,this.I_&&1&this.I_[i]){const r=t+((e*A+s*m+n*p)/(h+(h/2|0))|0);this.Mu&&(this.Tb[i]=f.bb(this.Mu[i],r,this.I_[i]))}else{let t=this.l_[r];t&&(t.x+=A,t.y+=m,t.z+=p,t.w++),t=this.l_[o],t&&(t.x+=A,t.y+=m,t.z+=p,t.w++),t=this.l_[l],t&&(t.x+=A,t.y+=m,t.z+=p,t.w++)}}if(r)this.f_(t,h,e,s,n);else{this.y_=new l.fe(this.Fd,null);for(let t=0;t>16;for(let s=0;s>16,g=g*w-_*d>>16,_=p),0!==t&&(p=g*a-I*l>>16,I=g*l+I*a>>16,g=p),0!==i&&(p=I*c+_*u>>16,I=I*u-_*c>>16,_=p),_+=n,g+=h,I+=o,p=g*A-I*y>>16,I=g*y+I*A>>16,g=p,f.eb&&f.sb&&f.nb&&(f.nb[s]=I-m,f.eb[s]=r.A.ra+((_<<9)/I|0),f.sb[s]=r.A.ha+((g<<9)/I|0)),this.Ov>0&&f.rb&&f.hb&&f.ob&&(f.rb[s]=_,f.hb[s]=g,f.ob[s]=I)}try{this.Vb(!1,!1,0)}catch(t){}}draw(t,i,e,s,h,o,l,a,c){const u=a*h-o*s>>16,d=l*i+u*e>>16,w=this.gm*e>>16,y=d+w;if(y<=50||d>=3500)return;const A=a*s+o*h>>16;let m=A-this.gm<<9;if((m/y|0)>=n.A.QE)return;let p=A+this.gm<<9;if((p/y|0)<=-n.A.QE)return;const _=l*e-u*i>>16,g=this.gm*i>>16;let I=_+g<<9;if((I/y|0)<=-n.A.tv)return;let C=_-(g+(this.jd*e>>16))<<9;if((C/y|0)>=n.A.tv)return;let E=d-(w+(this.jd*i>>16))<=50,v=!1;if(c>0&&f.gb){let t=d-w;t<=50&&(t=50),A>0?(m=m/y|0,p=p/t|0):(p=p/y|0,m=m/t|0),_>0?(C=C/y|0,I=I/t|0):(I=I/y|0,C=C/t|0);const i=f.kl-r.A.ra,e=f.Dl-r.A.ha;i>m&&iC&&e>16,w=w*O-c*R>>16,c=r),c+=o,u+=l,w+=a,r=w*s+c*h>>16,w=w*h-c*s>>16,c=r,r=u*e-w*i>>16,w=u*i+w*e>>16,u=r,f.nb&&(f.nb[n]=w-d),w>=50&&f.eb&&f.sb?(f.eb[n]=b+((c<<9)/w|0),f.sb[n]=T+((u<<9)/w|0)):f.eb&&(f.eb[n]=-5e3,E=!0),(E||this.Ov>0)&&f.rb&&f.hb&&f.ob&&(f.rb[n]=c,f.hb[n]=u,f.ob[n]=w)}try{this.Vb(E,v,c)}catch(t){}}Vb(t,i,e,s=!1){f.Eb&&(this.Pb=-1,this.Gb=-1);for(let t=0;tn.A.ag||a>n.A.ag||c>n.A.ag),f.ab&&f.lb){const t=((y+A+m)/3|0)+this.Nb;f.ab[t][f.lb[t]++]=s,f.Eb&&this.Kb(f.kl,f.Dl,u,d,w,l,a,c)&&this.Gb=0;t--){const i=f.lb[t];if(!(i<=0)&&f.ab){const e=f.ab[t];for(let t=0;t=0;t--){const i=f.lb[t];if(i>0&&f.ab){const e=f.ab[t];for(let s=0;s0||f.cb[2]>0)&&(r=(f.yb[1]+f.yb[2])/(f.cb[1]+f.cb[2])|0);let h=0;f.cb&&f.yb&&(f.cb[3]>0||f.cb[4]>0)&&(h=(f.yb[3]+f.yb[4])/(f.cb[3]+f.cb[4])|0);let o=0;if(f.cb&&f.yb&&(f.cb[6]>0||f.cb[8]>0)&&(o=(f.yb[6]+f.yb[8])/(f.cb[6]+f.cb[8])|0),f.cb&&f.fb){let t,i=0,e=f.cb[10],n=f.fb[10],l=f.ub;i===e&&(i=0,e=f.cb[11],n=f.fb[11],l=f.wb),t=ir;)this.Xb(n[i++],s),i===e&&n!==f.fb[11]&&(i=0,e=f.cb[11],n=f.fb[11],l=f.wb),t=ih;)this.Xb(n[i++],s),i===e&&n!==f.fb[11]&&(i=0,e=f.cb[11],n=f.fb[11],l=f.wb),t=io;)this.Xb(n[i++],s),i===e&&n!==f.fb[11]&&(i=0,e=f.cb[11],n=f.fb[11],l=f.wb),t=i>2,h=this.xb[i],o=this.Mb[i],l=this.kb[i];r.A.mg(f.eb[e],f.eb[s],f.eb[n],f.sb[e],f.sb[s],f.sb[n],this.Tb[t],this.Rb[t],this.Ob[t],f.rb[h],f.hb[h],f.ob[h],f.rb[o],f.rb[l],f.hb[o],f.hb[l],f.ob[o],f.ob[l],this.Mu[t])}else if(3===h&&this.I_&&this.Mu&&this.Tb&&f.eb&&f.sb&&f.rb&&f.hb&&f.ob){const i=this.I_[t]>>2,h=this.xb[i],o=this.Mb[i],l=this.kb[i];r.A.mg(f.eb[e],f.eb[s],f.eb[n],f.sb[e],f.sb[s],f.sb[n],this.Tb[t],this.Tb[t],this.Tb[t],f.rb[h],f.hb[h],f.ob[h],f.rb[o],f.rb[l],f.hb[o],f.hb[l],f.ob[o],f.ob[l],this.Mu[t])}}jb(t,i=!1){let e=0;if(f.ob){const i=r.A.ra,s=r.A.ha,n=this.E_[t],h=this.v_[t],o=this.b_[t],l=f.ob[n],a=f.ob[h],c=f.ob[o];if(l>=50&&f.eb&&f.sb&&this.Tb)f.Ab[e]=f.eb[n],f.mb[e]=f.sb[n],f.pb[e++]=this.Tb[t];else if(f.rb&&f.hb&&this.Tb){const u=f.rb[n],d=f.hb[n],w=this.Tb[t];if(c>=50&&this.Ob){const n=(50-l)*r.A.ov[c-l];f.Ab[e]=i+((u+((f.rb[o]-u)*n>>16)<<9)/50|0),f.mb[e]=s+((d+((f.hb[o]-d)*n>>16)<<9)/50|0),f.pb[e++]=w+((this.Ob[t]-w)*n>>16)}if(a>=50&&this.Rb){const n=(50-l)*r.A.ov[a-l];f.Ab[e]=i+((u+((f.rb[h]-u)*n>>16)<<9)/50|0),f.mb[e]=s+((d+((f.hb[h]-d)*n>>16)<<9)/50|0),f.pb[e++]=w+((this.Rb[t]-w)*n>>16)}}if(a>=50&&f.eb&&f.sb&&this.Rb)f.Ab[e]=f.eb[h],f.mb[e]=f.sb[h],f.pb[e++]=this.Rb[t];else if(f.rb&&f.hb&&this.Rb){const u=f.rb[h],d=f.hb[h],w=this.Rb[t];if(l>=50&&this.Tb){const h=(50-a)*r.A.ov[l-a];f.Ab[e]=i+((u+((f.rb[n]-u)*h>>16)<<9)/50|0),f.mb[e]=s+((d+((f.hb[n]-d)*h>>16)<<9)/50|0),f.pb[e++]=w+((this.Tb[t]-w)*h>>16)}if(c>=50&&this.Ob){const n=(50-a)*r.A.ov[c-a];f.Ab[e]=i+((u+((f.rb[o]-u)*n>>16)<<9)/50|0),f.mb[e]=s+((d+((f.hb[o]-d)*n>>16)<<9)/50|0),f.pb[e++]=w+((this.Ob[t]-w)*n>>16)}}if(c>=50&&f.eb&&f.sb&&this.Ob)f.Ab[e]=f.eb[o],f.mb[e]=f.sb[o],f.pb[e++]=this.Ob[t];else if(f.rb&&f.hb&&this.Ob){const u=f.rb[o],d=f.hb[o],w=this.Ob[t];if(a>=50&&this.Rb){const n=(50-c)*r.A.ov[a-c];f.Ab[e]=i+((u+((f.rb[h]-u)*n>>16)<<9)/50|0),f.mb[e]=s+((d+((f.hb[h]-d)*n>>16)<<9)/50|0),f.pb[e++]=w+((this.Rb[t]-w)*n>>16)}if(l>=50&&this.Tb){const h=(50-c)*r.A.ov[l-c];f.Ab[e]=i+((u+((f.rb[n]-u)*h>>16)<<9)/50|0),f.mb[e]=s+((d+((f.hb[n]-d)*h>>16)<<9)/50|0),f.pb[e++]=w+((this.Tb[t]-w)*h>>16)}}}const s=f.Ab[0],h=f.Ab[1],o=f.Ab[2],l=f.mb[0],a=f.mb[1],c=f.mb[2];if(!((s-h)*(c-a)-(l-a)*(o-h)<=0))if(r.A.lg=!1,3===e){let e;if((s<0||h<0||o<0||s>n.A.ag||h>n.A.ag||o>n.A.ag)&&(r.A.lg=!0),e=this.I_?3&this.I_[t]:0,i)r.A.ev(s,h,l,a,f.pb[0]),r.A.ev(h,o,a,c,f.pb[1]),r.A.ev(o,s,c,l,f.pb[2]);else if(0===e)r.A.dg(s,h,o,l,a,c,f.pb[0],f.pb[1],f.pb[2]);else if(1===e&&this.Tb)r.A.vv(s,h,o,l,a,c,r.A.palette[this.Tb[t]]);else if(2===e&&this.I_&&this.Mu&&f.rb&&f.hb&&f.ob){const i=this.I_[t]>>2,e=this.xb[i],n=this.Mb[i],u=this.kb[i];r.A.mg(s,h,o,l,a,c,f.pb[0],f.pb[1],f.pb[2],f.rb[e],f.hb[e],f.ob[e],f.rb[n],f.rb[u],f.hb[n],f.hb[u],f.ob[n],f.ob[u],this.Mu[t])}else if(3===e&&this.I_&&this.Mu&&this.Tb&&f.rb&&f.hb&&f.ob){const i=this.I_[t]>>2,e=this.xb[i],n=this.Mb[i],u=this.kb[i];r.A.mg(s,h,o,l,a,c,this.Tb[t],this.Tb[t],this.Tb[t],f.rb[e],f.hb[e],f.ob[e],f.rb[n],f.rb[u],f.hb[n],f.hb[u],f.ob[n],f.ob[u],this.Mu[t])}}else if(4===e){let e;if((s<0||h<0||o<0||s>n.A.ag||h>n.A.ag||o>n.A.ag||f.Ab[3]<0||f.Ab[3]>n.A.ag)&&(r.A.lg=!0),e=this.I_?3&this.I_[t]:0,i)r.A.ev(s,h,l,a,f.pb[0]),r.A.ev(h,o,a,c,f.pb[1]),r.A.ev(o,f.Ab[3],c,f.mb[3],f.pb[2]),r.A.ev(f.Ab[3],s,f.mb[3],l,f.pb[3]);else if(0===e)r.A.dg(s,h,o,l,a,c,f.pb[0],f.pb[1],f.pb[2]),r.A.dg(s,o,f.Ab[3],l,c,f.mb[3],f.pb[0],f.pb[2],f.pb[3]);else if(1===e){if(this.Tb){const i=r.A.palette[this.Tb[t]];r.A.vv(s,h,o,l,a,c,i),r.A.vv(s,o,f.Ab[3],l,c,f.mb[3],i)}}else if(2===e&&this.I_&&this.Mu&&f.rb&&f.hb&&f.ob){const i=this.I_[t]>>2,e=this.xb[i],n=this.Mb[i],u=this.kb[i];r.A.mg(s,h,o,l,a,c,f.pb[0],f.pb[1],f.pb[2],f.rb[e],f.hb[e],f.ob[e],f.rb[n],f.rb[u],f.hb[n],f.hb[u],f.ob[n],f.ob[u],this.Mu[t]),r.A.mg(s,o,f.Ab[3],l,c,f.mb[3],f.pb[0],f.pb[2],f.pb[3],f.rb[e],f.hb[e],f.ob[e],f.rb[n],f.rb[u],f.hb[n],f.hb[u],f.ob[n],f.ob[u],this.Mu[t])}else if(3===e&&this.I_&&this.Mu&&this.Tb&&f.rb&&f.hb&&f.ob){const i=this.I_[t]>>2,e=this.xb[i],n=this.Mb[i],u=this.kb[i];r.A.mg(s,h,o,l,a,c,this.Tb[t],this.Tb[t],this.Tb[t],f.rb[e],f.hb[e],f.ob[e],f.rb[n],f.rb[u],f.hb[n],f.hb[u],f.ob[n],f.ob[u],this.Mu[t]),r.A.mg(s,o,f.Ab[3],l,c,f.mb[3],this.Tb[t],this.Tb[t],this.Tb[t],f.rb[e],f.hb[e],f.ob[e],f.rb[n],f.rb[u],f.hb[n],f.hb[u],f.ob[n],f.ob[u],this.Mu[t])}}}Wb(t,i,e,s,n){if(!s)return;const h=s.length;if(0===n){let n=0;f.gr=0,f._b=0,f.Ir=0;for(let t=0;t0?(f.gr=(f.gr/n|0)+t,f._b=(f._b/n|0)+i,f.Ir=(f.Ir/n|0)+e):(f.gr=t,f._b=i,f.Ir=e)}else if(1===n)for(let n=0;n=this.Vd.length)continue;const h=this.Vd[r];if(h)for(let s=0;s=this.Vd.length)continue;const o=this.Vd[h];if(o)for(let s=0;s>16;this.Pd[n]=this.Pd[n]*u-this.Bd[n]*c>>16,this.Bd[n]=t}if(0!==h){c=r.A.sin[h],u=r.A.cos[h];const t=this.Pd[n]*u-this.Ud[n]*c>>16;this.Ud[n]=this.Pd[n]*c+this.Ud[n]*u>>16,this.Pd[n]=t}if(0!==l){c=r.A.sin[l],u=r.A.cos[l];const t=this.Ud[n]*c+this.Bd[n]*u>>16;this.Ud[n]=this.Ud[n]*u-this.Bd[n]*c>>16,this.Bd[n]=t}this.Bd[n]+=f.gr,this.Pd[n]+=f._b,this.Ud[n]+=f.Ir}}else if(3===n)for(let n=0;n=this.Vd.length)continue;const h=this.Vd[r];if(h)for(let s=0;s=this.Hd.length)continue;const n=this.Hd[e];if(n)for(let i=0;i255&&(this.Sb[e]=255)}}}Hb(){this.jd=0,this.gm=0,this.A_=0,this.m_=999999,this.p_=-999999,this.g_=-99999,this.__=99999;for(let t=0;tthis.p_&&(this.p_=i),sthis.g_&&(this.g_=s),-e>this.jd&&(this.jd=-e),e>this.A_&&(this.A_=e);const n=i*i+s*s;n>this.gm&&(this.gm=n)}this.gm=0|Math.sqrt(this.gm),this.Nb=0|Math.sqrt(this.gm*this.gm+this.jd*this.jd),this.Db=this.Nb+(0|Math.sqrt(this.gm*this.gm+this.A_*this.A_))}Kb(t,i,e,s,n,r,h,o){return!(ie&&i>s&&i>n)&&(!(t{e.d(i,{A:()=>o});var s=e(8950),n=e(1069),r=e(4474),h=e(880);class o extends r.A{yw;width;height;Zb;qb;Fl;uw;constructor(t,i){super(),this.yw=new Int32Array(t*i),this.width=this.Fl=t,this.height=this.uw=i,this.Zb=this.qb=0}static $b=async(t,i)=>{const e=t.read(i+'.dat');if(!e)throw new Error(`${i} jpeg not found!`);const s=await(0,h.r)(e),n=new o(s.width,s.height),r=new Uint32Array(s.data.buffer),l=n.yw;for(let t=0;t>24&255)<<24|(255&i)<<16|(i>>8&255)<<8|i>>16&255}return n};static Za=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.gf=s.mu;const h=r.mu,l=r.mu,a=[],c=r._u-1;for(let t=0;ts.length||r.gf>r.length)throw new Error;const f=r._u,u=r._u,d=r.mu,w=r.mu,y=new o(d,w);y.Zb=f,y.qb=u,y.Fl=h,y.uw=l;const A=r._u;if(0===A){const t=y.width*y.height;for(let i=0;is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,l+=i,o+=i}h>0&&r>0&&this.Jb(h,r,this.yw,n,l,s.A.yw,e,o)}Nl(t,i,e){i|=0,e|=0;let n=(i+=this.Zb)+(e+=this.qb)*s.A.Aw,r=0,h=this.height,o=this.width,l=s.A.Aw-o,a=0;if(es.A.bottom&&(h-=e+h-s.A.bottom),is.A.right){const t=i+o-s.A.right;o-=t,a+=t,l+=t}o>0&&h>0&&this.Qb(o,h,this.yw,r,a,s.A.yw,n,l,t)}tT(t,i){t|=0,i|=0;let e=(t+=this.Zb)+(i+=this.qb)*s.A.Aw,n=0,r=this.height,h=this.width,o=s.A.Aw-h,l=0;if(is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,l+=i,o+=i}h>0&&r>0&&this.iT(h,r,this.yw,n,l,s.A.yw,e,o)}eT(){const t=this.yw,i=this.width,e=this.height;for(let s=0;s>16&255;r+=t,r<1?r=1:r>255&&(r=255);let h=n>>8&255;h+=i,h<1?h=1:h>255&&(h=255);let o=255&n;o+=e,o<1?o=1:o>255&&(o=255),this.yw[s]=(r<<16)+(h<<8)+o}}}Ow(t,i,e,n){t|=0,i|=0,e|=0,n|=0;try{const r=this.width;let h=0,o=0;const l=this.Fl,a=this.uw,c=(l<<16)/e|0,f=(a<<16)/n|0;t+=(this.Zb*e+l-1)/l|0,i+=(this.qb*n+a-1)/a|0,this.Zb*e%l!=0&&(h=(l-this.Zb*e%l<<16)/e|0),this.qb*n%a!=0&&(o=(a-this.qb*n%a<<16)/n|0),e=e*(this.width-(h>>16))/l|0,n=n*(this.height-(o>>16))/a|0;let u=t+i*s.A.Aw,d=s.A.Aw-e;if(is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right){const i=t+e-s.A.right;e-=i,d+=i}this.scale(e,n,this.yw,h,o,s.A.yw,d,u,r,c,f)}catch(t){console.error('error in sprite clipping routine')}}nT(t,i,e,n,r,h,o,l,a,c){t|=0,i|=0,e|=0,n|=0;try{const f=-e/2|0,u=-n/2|0,d=65536*Math.sin(a/326.11)|0,w=65536*Math.cos(a/326.11)|0,y=d*c>>8,A=w*c>>8;let m=(o<<16)+u*y+f*A,p=u*A-f*y+(l<<16),_=t+i*s.A.Aw;for(let t=0;t>16)+(o>>16)*this.width],n+=A,o-=y;m+=y,p+=A,_+=s.A.Aw}}catch(t){}}rT(t,i,e){t|=0,i|=0;let n=(t+=this.Zb)+(i+=this.qb)*s.A.Aw,r=0,h=this.height,o=this.width,l=s.A.Aw-o,a=0;if(is.A.bottom&&(h-=i+h-s.A.bottom),ts.A.right){const i=t+o-s.A.right;o-=i,a+=i,l+=i}o>0&&h>0&&this.hT(o,h,this.yw,a,r,s.A.yw,n,l,e.yw)}scale(t,i,e,s,n,r,h,o,l,a,c){try{const f=s;for(let u=-i;u<0;u++){const i=(n>>16)*l;for(let n=-t;n<0;n++){const t=e[(s>>16)+i];0===t?o++:r[o++]=t,s+=a}n+=c,s=f,o+=h}}catch(t){console.error('error in plot_scale')}}iT(t,i,e,s,n,r,h,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++)r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++];for(let i=t;i<0;i++)r[h++]=e[s++];h+=o,s+=n}}Qb(t,i,e,s,n,r,h,o,l){const a=256-l;for(let c=-i;c<0;c++){for(let i=-t;i<0;i++){const t=e[s++];if(0===t)h++;else{const i=r[h];r[h++]=((16711935&t)*l+(16711935&i)*a&4278255360)+((65280&t)*l+(65280&i)*a&16711680)>>8}}h+=o,s+=n}}Jb(t,i,e,s,n,r,h,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=e[s++];0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=t}h+=o,s+=n}}hT(t,i,e,s,n,r,h,o,l){const a=-(t>>2);t=-(3&t);for(let c=-i;c<0;c++){for(let t=a;t<0;t++){let t=e[n++];0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++}for(let i=t;i<0;i++){const t=e[n++];0!==t&&0===l[h]?r[h++]=t:h++}h+=o,n+=s}}}},1673:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(8950),n=e(1069),r=e(4474);class h extends r.A{yw;width;height;Zb;qb;Fl;uw;palette;constructor(t,i,e){super(),this.yw=new Int8Array(t*i),this.width=this.Fl=t,this.height=this.uw=i,this.Zb=this.qb=0,this.palette=e}static Za=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.gf=s.mu;const o=r.mu,l=r.mu,a=r._u,c=new Int32Array(a);for(let t=1;ts.length||r.gf>r.length)throw new Error;const f=r._u,u=r._u,d=r.mu,w=r.mu,y=new h(d,w,c);y.Zb=f,y.qb=u,y.Fl=o,y.uw=l;const A=y.yw,m=r._u;if(0===m){const t=y.width*y.height;for(let i=0;is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,l+=i,o+=i}h>0&&r>0&&this.oT(h,r,this.yw,n,l,s.A.yw,e,o)}eT(){const t=this.yw,i=this.width,e=this.height;for(let s=0;s>16&255;n+=t,n<0?n=0:n>255&&(n=255);let r=this.palette[s]>>8&255;r+=i,r<0?r=0:r>255&&(r=255);let h=255&this.palette[s];h+=e,h<0?h=0:h>255&&(h=255),this.palette[s]=(n<<16)+(r<<8)+h}}gv(){this.Fl|=0,this.uw|=0,this.Fl/=2,this.uw/=2,this.Fl|=0,this.uw|=0;const t=new Int8Array(this.Fl*this.uw);let i=0;for(let e=0;e>1)+(e+this.qb>>1)*this.Fl]=this.yw[i++];this.yw=t,this.width=this.Fl,this.height=this.uw,this.Zb=0,this.qb=0}Ow(){if(this.width===this.Fl&&this.height===this.uw)return;const t=new Int8Array(this.Fl*this.uw);let i=0;for(let e=0;e>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=e[s++];0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t]}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=this.palette[255&t]}h+=o,s+=n}}clip(t,i,e,n){try{const r=this.width;this.height;let h=0,o=0;const l=this.Fl,a=this.uw,c=(l<<16)/e|0,f=(a<<16)/n|0;t=t+(this.Zb*e+l-1)/l|0,i=i+(this.qb*n+a-1)/a|0,this.Zb*e%l!=0&&(h=(l-this.Zb*e%l<<16)/e|0),this.qb*n%a!=0&&(o=(a-this.qb*n%a<<16)/n|0),e=e*(this.width-(h>>16))/l|0,n=n*(this.height-(o>>16))/a|0;let u,d=t+i*s.A.Aw,w=s.A.Aw-e;is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right&&(u=t+e-s.A.right,e-=u,w+=u),this.lT(s.A.yw,this.yw,this.palette,h,o,d,w,e,n,c,f,r)}catch(t){console.log('error in sprite clipping routine')}}lT(t,i,e,s,n,r,h,o,l,a,c,f){try{const u=s;for(let d=-l;d<0;d++){const l=(n>>16)*f;for(let n=-o;n<0;n++){const n=i[(s>>16)+l];0==n?r++:t[r++]=e[255&n],s+=a}n+=c,s=u,r+=h}}catch(t){console.log('error in plot_scale')}}}},2682:(t,i,e)=>{e.d(i,{A:()=>l});var s=e(8950),n=e(1069),r=e(4474);class h{seed;constructor(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}aT(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}cT(){return this.next(32)}next(t){return this.seed=0x5deece66dn*this.seed+0xbn&(1n<<48n)-1n,Number(this.seed)>>>48-t}}var o=e(9298);class l extends r.A{static fT='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!"£$%^&*()-_=+[{]};:\'@#~,<.>/?\\| ';static uT=[];static{const t=navigator.userAgent.includes('Capacitor');for(let i=0;i<256;i++){let e=l.fT.indexOf(String.fromCharCode(i));t&&e>=63&&e--,-1===e&&(e=74),l.uT[i]=e}}dT=[];wT=new Int32Array(94);yT=new Int32Array(94);AT=new Int32Array(94);mT=new Int32Array(94);pT=new Int32Array(95);_T=new Int32Array(256);random=new h(BigInt(Date.now()));height=0;static Za=(t,i)=>{const e=new n.A(t.read(i+'.dat')),s=new n.A(t.read('index.dat'));s.gf=e.mu+4;const r=s._u;r>0&&(s.gf+=3*(r-1));const h=new l;for(let t=0;t<94;t++){h.AT[t]=s._u,h.mT[t]=s._u;const i=h.wT[t]=s.mu,n=h.yT[t]=s.mu,r=s._u,o=i*n;if(h.dT[t]=new Int8Array(o),0===r)for(let s=0;sh.height&&(h.height=n),h.AT[t]=1,h.pT[t]=i+2;{let e=0;for(let s=n/7|0;s=s.A.bottom&&(r-=e+r+1-s.A.bottom),i=s.A.right){const t=i+n+1-s.A.right;n-=t,a+=t,l+=t}n>0&&r>0&&this.OT(n,r,t,c,a,s.A.yw,o,l,h)}bT(t,i,e,n,r,h,o){e|=0,n|=0;let l=(t|=0)+(i|=0)*s.A.Aw,a=s.A.Aw-e,c=0,f=0;if(i=s.A.bottom&&(n-=i+n+1-s.A.bottom),t=s.A.right){const i=t+e+1-s.A.right;e-=i,c+=i,a+=i}e>0&&n>0&&this.LT(e,n,s.A.yw,l,a,o,f,c,r,h)}OT(t,i,e,s,n,r,h,o,l){const a=-((t|=0)>>2);t=-(3&t);for(let c=-(i|=0);c<0;c++){for(let t=a;t<0;t++)0===e[s++]?h++:r[h++]=l,0===e[s++]?h++:r[h++]=l,0===e[s++]?h++:r[h++]=l,0===e[s++]?h++:r[h++]=l;for(let i=t;i<0;i++)0===e[s++]?h++:r[h++]=l;h+=o,s+=n}}LT(t,i,e,s,n,r,h,o,l,a){t|=0;const c=((16711935&l)*a&4278255360)+((65280&l)*a&16711680)>>8,f=256-a;for(let l=-(i|=0);l<0;l++){for(let i=-t;i<0;i++)if(0===r[h++])s++;else{const t=e[s];e[s++]=(((16711935&t)*f&4278255360)+((65280&t)*f&16711680)>>8)+c}s+=n,h+=o}}IT(t){return'red'===t?o.A.RED:'gre'===t?o.A.GREEN:'blu'===t?o.A.BLUE:'yel'===t?o.A.Gl:'cya'===t?o.A.UE:'mag'===t?o.A.am:'whi'===t?o.A.gl:'bla'===t?o.A.Pl:'lre'===t?o.A.PE:'dre'===t?o.A.GE:'dbl'===t?o.A.WE:'or1'===t?o.A.YE:'or2'===t?o.A.HE:'or3'===t?o.A.VE:'gr1'===t?o.A.KE:'gr2'===t?o.A.XE:'gr3'===t?o.A.jE:o.A.Pl}split(t,i){if(0===t.length)return[t];const e=[];for(;t.length>0;){if(this.CT(t)<=i&&-1===t.indexOf('|')){e.push(t);break}let s=t.length;for(let e=0;ei)break;s=e}else if('|'===t[e]){s=e;break}e.push(t.substring(0,s)),t=t.substring(s+1)}return e}}},1183:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(8950),n=e(7854);class r{ST;width;height;xT;MT;yw;constructor(t,i,e=n.zo){this.xT=e,this.ST=this.xT.getImageData(0,0,t,i),this.MT=new Uint32Array(this.ST.data.buffer),this.yw=new Int32Array(t*i),this.width=t,this.height=i,this.bind()}clear(){this.yw.fill(0)}bind(){s.A.bind(this.yw,this.width,this.height)}draw(t,i){this.#t(),this.xT.putImageData(this.ST,t,i)}#t(){const t=this.yw.length,i=this.yw,e=this.MT;for(let s=0;s>16&255|(t>>8&255)<<8|(255&t)<<16|4278190080}}}},4544:(t,i,e)=>{e.d(i,{A:()=>s});class s{db;constructor(t){t.onerror=this.onerror,t.onclose=this.onclose,this.db=t}static openDatabase=async()=>await new Promise(((t,i)=>{const e=indexedDB.open('lostcity',1);e.onsuccess=i=>{const e=i.target;console.log('database success!'),t(e.result)},e.onupgradeneeded=t=>{t.target.result.createObjectStore('cache')},e.onerror=t=>{const e=t.target;console.error('database error!: ',e.error),i(e.result)}}));Uo=async t=>await new Promise((i=>{const e=this.db.transaction('cache','readonly').objectStore('cache').get(t);e.onsuccess=()=>{i(e.result)},e.onerror=t=>{i(void 0)}}));Ho=async(t,i)=>await new Promise(((e,s)=>{const n=this.db.transaction('cache','readwrite').objectStore('cache').put(i,t);n.onsuccess=()=>{e()},n.onerror=t=>{s()}}));onclose=t=>{console.log('database close!')};onerror=t=>{console.log('database error!')};kT=t=>{const i=t.trim();let e=0;for(let t=0;t='A'&&s<='Z'?e+=s.charCodeAt(0)+1-65:s>='a'&&s<='z'?e+=s.charCodeAt(0)+1-97:s>='0'&&s<='9'&&(e+=s.charCodeAt(0)+27-48)}return e}}},2901:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(1908);class r{static kT=t=>{let i=0;t=t.toUpperCase();for(let e=0;e=this.NT)return null;if(this.GT[t])return this.GT[t];const i=this.PT[t],e=i+this.UT[t];if(this.DT){const s=Uint8Array.from(this.buffer.subarray(i,i+e));return this.GT[t]=s,s}{const i=Uint8Array.from(n.A.read(this.BT[t],this.buffer,this.UT[t],this.PT[t]));return this.GT[t]=i,i}}}},1069:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(9234),n=e(6666),r=e(4474);class h extends r.A{static YT=3988292384;static HT=new Int32Array(256);static VT=new Uint32Array(33);static KT=new n.A;static XT=new n.A;static jT=new n.A;static zT=0;static ZT=0;static qT=0;static{for(let t=0;t<32;t++)h.VT[t]=(1<>>=1:i=i>>>1^h.YT;h.HT[t]=i}}static Po=t=>{let i=4294967295;for(let e=0;e>>8^h.HT[255&(i^t[e])];return~i};view;data;gf=0;$T=0;random=null;constructor(t){if(!t)throw new Error('Input src packet array was null!');super(),t instanceof Int8Array?this.data=new Uint8Array(t):this.data=t,this.view=new DataView(this.data.buffer,this.data.byteOffset,this.data.byteLength)}get length(){return this.view.byteLength}get available(){return this.length-this.gf}static Ut=t=>{let i=null;return 0===t&&h.zT>0?(h.zT--,i=h.KT.H_()):1===t&&h.ZT>0?(h.ZT--,i=h.XT.H_()):2===t&&h.qT>0&&(h.qT--,i=h.jT.H_()),i?(i.gf=0,i):new h(0===t?new Uint8Array(100):1===t?new Uint8Array(5e3):new Uint8Array(3e4))};release(){this.gf=0,100===this.view.byteLength&&h.zT<1e3?(h.KT.UA(this),h.zT++):5e3===this.view.byteLength&&h.ZT<250?(h.XT.UA(this),h.ZT++):3e4===this.view.byteLength&&h.qT<50&&(h.jT.UA(this),h.qT++)}get _u(){return this.view.getUint8(this.gf++)}get Dd(){return this.view.getInt8(this.gf++)}get mu(){const t=this.view.getUint16(this.gf);return this.gf+=2,t}get Iu(){const t=this.view.getInt16(this.gf);return this.gf+=2,t}get qu(){const t=this.view.getUint8(this.gf++)<<16|this.view.getUint16(this.gf);return this.gf+=2,t}get Ko(){const t=this.view.getInt32(this.gf);return this.gf+=4,t}get sE(){const t=this.view.getBigInt64(this.gf);return this.gf+=8,t}get kE(){return this.view.getUint8(this.gf)<128?this._u-64:this.mu-49152}get _m(){return this.view.getUint8(this.gf)<128?this._u:this.mu-32768}get vu(){const t=this.view,i=t.byteLength;let e,s='';for(;10!==(e=t.getUint8(this.gf++))&&this.gf>16),this.view.setUint16(this.gf,t),this.gf+=2}p4(t){this.view.setInt32(this.gf,t),this.gf+=4}iR(t){this.view.setInt32(this.gf,t,!0),this.gf+=4}eR(t){this.view.setBigInt64(this.gf,t),this.gf+=8}sR(t){const i=this.view,e=t.length;for(let s=0;s>>3,e=8-(7&this.$T),s=0;for(this.$T+=t;t>e;e=8)s+=(this.view.getUint8(i++)&h.VT[e])<>>e-t&h.VT[t],s}aR(t,i){const e=this.gf;this.gf=0;const n=new Uint8Array(e);this.JT(e,0,n);const r=(0,s.cR)(n),h=(0,s.fR)(r,i,t),o=(0,s.uR)(h);this.gf=0,this.p1(o.length),this.nR(o,o.length,0)}}},3867:(t,i,e)=>{e.d(i,{sm:()=>a,im:()=>o,fe:()=>s,Rm:()=>n,Eh:()=>r,Em:()=>h,Xr:()=>l});class s extends Array{constructor(t,i){super(t);for(let e=0;e{e.d(i,{uR:()=>o,Wo:()=>n,cR:()=>h,Yo:()=>s,Xa:()=>r,fR:()=>l});const s=async t=>new Promise((i=>setTimeout(i,t))),n=async t=>new Int8Array(await(await fetch(t)).arrayBuffer()),r=async t=>(await fetch(t)).text();function h(t){let i=0n;for(let e=0;e0n;)i.unshift(Number(0xffn&t)),t>>=8n;return 128&i[0]&&i.unshift(0),new Uint8Array(i)}function l(t,i,e){let s=1n;for(;i>0n;)i%2n===1n&&(s=s*t%e),t=t*t%e,i>>=1n;return s}},1908:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(9763);class n{static dR=null;static load=async t=>{this.dR=await(0,s.F)(new WebAssembly.Module(t),{env:void 0})};static read=(t,i,e,s)=>{if(!this.dR)throw new Error('bz2 not found!!');return Int8Array.from(this.dR.read(t,i,e,s))}}},123:(t,i,e)=>{function s(t,i){window._tinyMidiPlay&&window._tinyMidiPlay(t,i/256)}function n(){window._tinyMidiStop&&window._tinyMidiStop()}e.d(i,{Xo:()=>s,Ro:()=>n})},9763:(t,i,e)=>{async function s(t,i={}){const e={env:Object.assign(Object.create(globalThis),i.env||{},{abort(t,i,e,s){t=h(t>>>0),i=h(i>>>0),e>>>=0,s>>>=0,(()=>{throw Error(`${t} in ${i}:${e}:${s}`)})()}})},{exports:s}=await WebAssembly.instantiate(t,e),n=s.memory||i.env.memory,r=Object.setPrototypeOf({read:(t,i,e,r)=>(i=function(t,i,e,r,h){if(null==r)return 0;const o=r.length,l=s.__pin(s.__new(o<>>0;if(h)new h(n.buffer,l,o).set(r);else for(let i=0;i>>0),r[i]);return s.__unpin(l),l}(l,6,0,i,Int8Array)||function(){throw TypeError("value must not be null")}(),function(t,i,e){if(!e)return null;const s=function(t){try{return o.getUint32(t,!0)}catch{return o=new DataView(n.buffer),o.getUint32(t,!0)}}(e-4)>>>i,r=new Array(s);for(let n=0;n>>0));return r}(a,0,s.read(t,i,e,r)>>>0))},s);function h(t){if(!t)return null;const i=t+new Uint32Array(n.buffer)[t-4>>>2]>>>1,e=new Uint16Array(n.buffer);let s=t>>>1,r="";for(;i-s>1024;)r+=String.fromCharCode(...e.subarray(s,s+=1024));return r+String.fromCharCode(...e.subarray(s,i))}let o=new DataView(n.buffer);function l(t,i){try{o.setUint8(t,i,!0)}catch{o=new DataView(n.buffer),o.setUint8(t,i,!0)}}function a(t){try{return o.getInt8(t,!0)}catch{return o=new DataView(n.buffer),o.getInt8(t,!0)}}return r}e.d(i,{F:()=>s})},9896:(t,i,e)=>{var s=e(8151);!function(){window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioContext&&(window.audioContext=new window.AudioContext);var t=function(i){if(window.audioContext){var e=window.audioContext.createBuffer(1,1,22050),s=window.audioContext.createBufferSource();s.buffer=e,s.connect(window.audioContext.destination),s.start?s.start(0):s.play?s.play(0):s.noteOn&&s.noteOn(0)}document.removeEventListener('touchstart',t),document.removeEventListener('touchend',t),document.removeEventListener('click',t)};document.addEventListener('touchstart',t),document.addEventListener('touchend',t),document.addEventListener('click',t)}(),(async()=>{let t=new Float32Array,i=window.audioContext.createGain();i.gain.value=.1,i.connect(window.audioContext.destination);let e=window.audioContext.currentTime,n=[];const r=new s.A({wR:30,yR:i=>{let e=new Float32Array(i.buffer),s=new Float32Array(t.length+e.length);s.set(t,0),s.set(e,t.length),t=s},AR:t=>{},bufferSize:102400});await r.init();const h=await fetch('./SCC1_Florestan.sf2'),o=new Uint8Array(await h.arrayBuffer());function l(){if(!window.audioContext||!t.length)return;let s=window.audioContext.createBufferSource();const r=t.length/2,h=window.audioContext.createBuffer(2,r,44100);for(let i=0;i<2;i++){const e=h.getChannelData(i);let s=i;for(let i=0;i{if(a&&clearInterval(a),t=new Float32Array,n.length){let t=i.gain.value;i.gain.value=0,n.forEach((t=>{t.stop(window.audioContext.currentTime)})),n=[],i.gain.value=t}},window._tinyMidiVolume=(t=1)=>{i.gain.value=t},window._tinyMidiPlay=async(t,i=1)=>{t&&(await window._tinyMidiStop(),-1!=i&&window._tinyMidiVolume(i),e=window.audioContext.currentTime,a=setInterval(l,250),r.pR(t))}})()},8151:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5473);const n=class{constructor(t={}){this._R=void 0,this.gR=0,this.IR=0,this.CR=0,this.wR=t.wR||100,this.sampleRate=t.sampleRate||44100,this.ER=t.ER||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.vR(1),this.yR=t.yR||(()=>{}),this.AR=t.AR||(()=>{}),this.bR=void 0,this.test=0}async init(){if(!this._R){if('undefined'!=typeof process){const{TR:t}=await import('path'),{RR:i}=await import('module');globalThis.__dirname=t("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js"),globalThis.require=i("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js")}this._R=await(0,s.A)(),this.OR=this._R._malloc(this.bufferSize),this.LR=this._R._malloc(8)}}vR(t){this.bufferSize=4*this.sampleRate*this.ER*t}SR(){if(!this._R)throw new Error(`${this.constructor.name} not initalized. call .init()`)}mR(t){this.SR();const{_malloc:i,_free:e,_tsf_load_memory:s,_tsf_set_output:n,_tsf_channel_set_bank_preset:r,_tsf_set_max_voices:h,_tsf_channel_set_presetnumber:o}=this._R;e(this.gR),this.gR=i(t.length),this._R.HEAPU8.set(t,this.gR),this.IR=s(this.gR,t.length),n(this.IR,2===this.ER?0:2,this.sampleRate,this.gain)}xR(){this.SR();const t=new Uint8Array(this.bufferSize);return t.set(this._R.HEAPU8.subarray(this.OR,this.OR+this.bufferSize)),t}MR(t){const{_malloc:i,_free:e,_tml_load_memory:s}=this._R;return e(this.CR),this.CR=i(t.length),this._R.HEAPU8.set(t,this.CR),s(this.CR,t.length)}kR(t){const{_midi_render:i}=this._R;return i(this.IR,t,this.ER,this.sampleRate,this.OR,this.bufferSize,this.LR)}pR(t){if(this.SR(),!this.IR)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.bR);const{setValue:i,getValue:e}=this._R;i(this.LR,0,'double'),this._R._tsf_reset(this.IR),this._R._tsf_channel_set_bank_preset(this.IR,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let s=this.MR(t);const n=()=>{s=this.kR(s);const t=this.xR();this.yR(t),s?this.bR=setTimeout(n,this.wR):this.AR(e(this.LR,'double'))};this.bR=setTimeout(n,16)}}},8227:(t,i,e)=>{t.exports=e.p+"9f86b5397894e28b5ae2.wasm"},5473:(t,i,e)=>{var s;e.d(i,{A:()=>n});const n=(s="file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/tinymidipcm.mjs",function(t){var i,n,r=void 0!==(t=t||{})?t:{};r.ready=new Promise((function(t,e){i=t,n=e})),["_tsf_load_memory","_tsf_set_output","_tsf_channel_set_bank_preset","_tsf_set_max_voices","_tsf_channel_set_presetnumber","_tsf_reset","_tsf_close","_tml_load_memory","_midi_render","_malloc","_realloc","_free","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(r.ready,t)||Object.defineProperty(r.ready,t,{get:()=>j('You are getting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),set:()=>j('You are setting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js')})}));var h=Object.assign({},r),o=[],l='object'==typeof window,a='function'==typeof importScripts,c='object'==typeof process&&'object'==typeof process.versions&&'string'==typeof process.versions.node,f=!l&&!c&&!a;if(r.ENVIRONMENT)throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');var u,d,w,y='';if(c){if('undefined'==typeof process||!process.release||'node'!==process.release.name)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');var A,m;y=a?require('path').TR(y)+'/':__dirname+'/';var p=()=>{m||(A=require('fs'),m=require('path'))};u=(t,i)=>(p(),t=m.normalize(t),A.DR(t,i?void 0:'utf8')),w=t=>{var i=u(t,!0);return i.buffer||(i=new Uint8Array(i)),D(i.buffer),i},d=(t,i,e)=>{p(),t=m.normalize(t),A.NR(t,(function(t,s){t?e(t):i(s.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,'/'),o=process.argv.slice(2),process.on('uncaughtException',(function(t){if(!(t instanceof nt))throw t})),process.on('unhandledRejection',(function(t){throw t})),r.inspect=function(){return'[Emscripten Module object]'}}else if(f){if('object'==typeof process&&'function'==typeof require||'object'==typeof window||'function'==typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');'undefined'!=typeof read&&(u=function(t){return read(t)}),w=function(t){let i;return'function'==typeof readbuffer?new Uint8Array(readbuffer(t)):(i=read(t,'binary'),D('object'==typeof i),i)},d=function(t,i,e){setTimeout((()=>i(w(t))),0)},'undefined'!=typeof scriptArgs?o=scriptArgs:void 0!==arguments&&(o=arguments),'undefined'!=typeof print&&('undefined'==typeof console&&(console={}),console.log=print,console.warn=console.error='undefined'!=typeof printErr?printErr:print)}else{if(!l&&!a)throw new Error('environment detection error');if(a?y=self.location.href:'undefined'!=typeof document&&document.currentScript&&(y=document.currentScript.src),s&&(y=s),y=0!==y.indexOf('blob:')?y.substr(0,y.replace(/[?#].*/,"").lastIndexOf('/')+1):'','object'!=typeof window&&'function'!=typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');u=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.send(null),i.responseText},a&&(w=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.responseType='arraybuffer',i.send(null),new Uint8Array(i.response)}),d=(t,i,e)=>{var s=new XMLHttpRequest;s.open('GET',t,!0),s.responseType='arraybuffer',s.onload=()=>{200==s.status||0==s.status&&s.response?i(s.response):e()},s.onerror=e,s.send(null)}}r.print||console.log.bind(console);var _,g,I=r.printErr||console.warn.bind(console);function C(t,i){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){j('Module.'+t+' has been replaced with plain '+i+' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')}})}function E(t){return'FS_createPath'===t||'FS_createDataFile'===t||'FS_createPreloadedFile'===t||'FS_unlink'===t||'addRunDependency'===t||'FS_createLazyFile'===t||'FS_createDevice'===t||'removeRunDependency'===t}Object.assign(r,h),h=null,_='fetchSettings',Object.getOwnPropertyDescriptor(r,_)&&j('`Module.'+_+'` was supplied but `'+_+'` not included in INCOMING_MODULE_JS_API'),r.arguments&&(o=r.arguments),C('arguments','arguments_'),r.thisProgram&&r.thisProgram,C('thisProgram','thisProgram'),r.quit&&r.quit,C('quit','quit_'),D(void 0===r.memoryInitializerPrefixURL,'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.pthreadMainPrefixURL,'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.cdInitializerPrefixURL,'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.filePackagePrefixURL,'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.read,'Module.read option was removed (modify read_ in JS)'),D(void 0===r.readAsync,'Module.readAsync option was removed (modify readAsync in JS)'),D(void 0===r.readBinary,'Module.readBinary option was removed (modify readBinary in JS)'),D(void 0===r.setWindowTitle,'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'),D(void 0===r.TOTAL_MEMORY,'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'),C('read','read_'),C('readAsync','readAsync'),C('readBinary','readBinary'),C('setWindowTitle','setWindowTitle'),D(!f,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),r.wasmBinary&&(g=r.wasmBinary),C('wasmBinary','wasmBinary');var v;r.noExitRuntime;C('noExitRuntime','noExitRuntime'),'object'!=typeof WebAssembly&&j('no native wasm support detected');var b,T,R,O,L,S,x,M,k=!1;function D(t,i){t||j('Assertion failed'+(i?': '+i:''))}function N(t){b=t,r.HEAP8=T=new Int8Array(t),r.HEAP16=O=new Int16Array(t),r.HEAP32=L=new Int32Array(t),r.HEAPU8=R=new Uint8Array(t),r.HEAPU16=new Uint16Array(t),r.HEAPU32=S=new Uint32Array(t),r.HEAPF32=x=new Float32Array(t),r.HEAPF64=M=new Float64Array(t)}'undefined'!=typeof TextDecoder&&new TextDecoder('utf8');var F=5242880;r.TOTAL_STACK&&D(F===r.TOTAL_STACK,'the stack size can no longer be determined at runtime');var B=r.INITIAL_MEMORY||16777216;function U(){if(!k){var t=ft(),i=S[t>>2],e=S[t+4>>2];34821223==i&&2310721022==e||j('Stack overflow! Stack cookie has been overwritten at 0x'+t.toString(16)+', expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+e.toString(16)+' 0x'+i.toString(16)),1668509029!==S[0]&&j('Runtime error: The application has corrupted its heap memory area (address zero)!')}}C('INITIAL_MEMORY','INITIAL_MEMORY'),D(B>=F,'INITIAL_MEMORY should be larger than TOTAL_STACK, was '+B+'! (TOTAL_STACK='+F+')'),D('undefined'!=typeof Int32Array&&'undefined'!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,'JS engine does not provide full typed array support'),D(!r.wasmMemory,'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'),D(16777216==B,'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'),function(){var t=new Int16Array(1),i=new Int8Array(t.buffer);if(t[0]=25459,115!==i[0]||99!==i[1])throw'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'}();var P=[],G=[],W=[],Y=!1;D(Math.imul,'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.fround,'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.clz32,'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.trunc,'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');var H=0,V=null,K=null,X={};function j(t){r.onAbort&&r.onAbort(t),I(t='Aborted('+t+')'),k=!0;var i=new WebAssembly.RuntimeError(t);throw n(i),i}var z={error:function(){j('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM')},init:function(){z.error()},FR:function(){z.error()},BR:function(){z.error()},UR:function(){z.error()},open:function(){z.error()},PR:function(){z.error()},GR:function(){z.error()},WR:function(){z.error()},YR:function(){z.error()},HR:function(){z.error()}};r.FS_createDataFile=z.FR,r.FS_createPreloadedFile=z.BR;var Z,q,$,J,Q='data:application/octet-stream;base64,';function tt(t){return t.startsWith(Q)}function it(t){return t.startsWith('file://')}function et(t,i){return function(){var e=t,s=i;return i||(s=r.asm),D(Y,'native function `'+e+'` called before runtime initialization'),s[t]||D(s[t],'exported native function `'+e+'` not found'),s[t].apply(null,arguments)}}function st(t){try{if(t==Z&&g)return new Uint8Array(g);if(w)return w(t);throw"both async and sync fetching of the wasm failed"}catch(t){j(t)}}function nt(t){this.name='ExitStatus',this.message='Program terminated with exit('+t+')',this.status=t}function rt(t){for(;t.length>0;)t.shift()(r)}function ht(t){ht.VR||(ht.VR={}),ht.VR[t]||(ht.VR[t]=1,c&&(t='warning: '+t),I(t))}function ot(t){try{return v.KR(t-b.byteLength+65535>>>16),N(v.buffer),1}catch(i){I('emscripten_realloc_buffer: Attempted to grow heap from '+b.byteLength+' bytes to '+t+' bytes, but got error: '+i)}}r.locateFile?tt(Z='tinymidipcm.wasm')||(q=Z,Z=r.locateFile?r.locateFile(q,y):y+q):Z=new URL(e(8227),e.b).toString();var lt,at={"emscripten_memcpy_big":function(t,i,e){R.copyWithin(t,i,i+e)},"emscripten_resize_heap":function(t){var i=R.length;D((t>>>=0)>i);var e,s,n=2147483648;if(t>n)return I('Cannot enlarge memory, asked to go up to '+t+' bytes, but the limit is '+n+' bytes!'),!1;for(var r=1;r<=4;r*=2){var h=i*(1+.2/r);h=Math.min(h,t+100663296);var o=Math.min(n,(e=Math.max(t,h))+((s=65536)-e%s)%s);if(ot(o))return!0}return I('Failed to grow the heap from '+i+' bytes to '+o+' bytes, not enough memory!'),!1}},ct=(function(){var t,i={'env':at,'wasi_snapshot_preview1':at};function e(t,i){var e,s=t.exports;r.asm=s,D(v=r.asm.memory,"memory not found in wasm exports"),N(v.buffer),D(r.asm.__indirect_function_table,"table not found in wasm exports"),e=r.asm.__wasm_call_ctors,G.unshift(e),function(t){if(H--,r.monitorRunDependencies&&r.monitorRunDependencies(H),t?(D(X[t]),delete X[t]):I('warning: run dependency removed without ID'),0==H&&(null!==V&&(clearInterval(V),V=null),K)){var i=K;K=null,i()}}('wasm-instantiate')}t='wasm-instantiate',H++,r.monitorRunDependencies&&r.monitorRunDependencies(H),t?(D(!X[t]),X[t]=1,null===V&&'undefined'!=typeof setInterval&&(V=setInterval((function(){if(k)return clearInterval(V),void(V=null);var t=!1;for(var i in X)t||(t=!0,I('still waiting on run dependencies:')),I('dependency: '+i);t&&I('(end of list)')}),1e4))):I('warning: run dependency added without ID');var s=r;function h(t){D(r===s,'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'),s=null,e(t.instance)}function o(t){return function(){if(!g&&(l||a)){if('function'==typeof fetch&&!it(Z))return fetch(Z,{credentials:'same-origin'}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+Z+"'";return t.arrayBuffer()})).catch((function(){return st(Z)}));if(d)return new Promise((function(t,i){d(Z,(function(i){t(new Uint8Array(i))}),i)}))}return Promise.resolve().then((function(){return st(Z)}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){I('failed to asynchronously prepare wasm: '+t),it(Z)&&I('warning: Loading from a file URI ('+Z+') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing'),j(t)}))}if(r.instantiateWasm)try{return r.instantiateWasm(i,e)}catch(t){I('Module.instantiateWasm callback failed with error: '+t),n(t)}(g||'function'!=typeof WebAssembly.instantiateStreaming||tt(Z)||it(Z)||c||'function'!=typeof fetch?o(h):fetch(Z,{credentials:'same-origin'}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(h,(function(t){return I('wasm streaming compile failed: '+t),I('falling back to ArrayBuffer instantiation'),o(h)}))}))).catch(n)}(),r.___wasm_call_ctors=et("__wasm_call_ctors"),r._malloc=et("malloc"),r._free=et("free"),r._tsf_load_memory=et("tsf_load_memory"),r._tsf_close=et("tsf_close"),r._tsf_reset=et("tsf_reset"),r._tsf_set_output=et("tsf_set_output"),r._tsf_set_max_voices=et("tsf_set_max_voices"),r._realloc=et("realloc"),r._tsf_channel_set_presetnumber=et("tsf_channel_set_presetnumber"),r._tsf_channel_set_bank_preset=et("tsf_channel_set_bank_preset"),r._tml_load_memory=et("tml_load_memory"),r._midi_render=et("midi_render"),r.___errno_location=et("__errno_location"),r._fflush=et("fflush"),r._emscripten_stack_init=function(){return(ct=r._emscripten_stack_init=r.asm.emscripten_stack_init).apply(null,arguments)}),ft=(r._emscripten_stack_get_free=function(){return(r._emscripten_stack_get_free=r.asm.emscripten_stack_get_free).apply(null,arguments)},r._emscripten_stack_get_base=function(){return(r._emscripten_stack_get_base=r.asm.emscripten_stack_get_base).apply(null,arguments)},r._emscripten_stack_get_end=function(){return(ft=r._emscripten_stack_get_end=r.asm.emscripten_stack_get_end).apply(null,arguments)});function ut(){var t;ct(),D(!(3&(t=ft()))),S[t>>2]=34821223,S[t+4>>2]=2310721022,S[0]=1668509029}function dt(t){function e(){lt||(lt=!0,r.calledRun=!0,k||(D(!Y),Y=!0,U(),rt(G),i(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),D(!r._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(U(),r.postRun)for('function'==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)t=r.postRun.shift(),W.unshift(t);var t;rt(W)}()))}t=t||o,H>0||(ut(),function(){if(r.preRun)for('function'==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)t=r.preRun.shift(),P.unshift(t);var t;rt(P)}(),H>0||(r.setStatus?(r.setStatus('Running...'),setTimeout((function(){setTimeout((function(){r.setStatus('')}),1),e()}),1)):e(),U()))}if(r.stackSave=et("stackSave"),r.stackRestore=et("stackRestore"),r.stackAlloc=et("stackAlloc"),r.setValue=function(t,i,e="i8"){switch(e.endsWith('*')&&(e='*'),e){case'i1':case'i8':T[0|t]=i;break;case'i16':O[t>>1]=i;break;case'i32':L[t>>2]=i;break;case'i64':J=[i>>>0,($=i,+Math.abs($)>=1?$>0?(0|Math.min(+Math.floor($/4294967296),4294967295))>>>0:~~+Math.ceil(($-+(~~$>>>0))/4294967296)>>>0:0)],L[t>>2]=J[0],L[t+4>>2]=J[1];break;case'float':x[t>>2]=i;break;case'double':M[t>>3]=i;break;case'*':S[t>>2]=i;break;default:j('invalid type for setValue: '+e)}},r.getValue=function(t,i="i8"){switch(i.endsWith('*')&&(i='*'),i){case'i1':case'i8':return T[0|t];case'i16':return O[t>>1];case'i32':case'i64':return L[t>>2];case'float':return x[t>>2];case'double':return M[t>>3];case'*':return S[t>>2];default:j('invalid type for getValue: '+i)}return null},['run','UTF8ArrayToString','UTF8ToString','stringToUTF8Array','stringToUTF8','lengthBytesUTF8','addOnPreRun','addOnInit','addOnPreMain','addOnExit','addOnPostRun','addRunDependency','removeRunDependency','FS_createFolder','FS_createPath','FS_createDataFile','FS_createPreloadedFile','FS_createLazyFile','FS_createLink','FS_createDevice','FS_unlink','getLEB','getFunctionTables','alignFunctionTables','registerFunctions','prettyPrint','getCompilerSetting','print','printErr','callMain','abort','keepRuntimeAlive','wasmMemory','stackAlloc','stackSave','stackRestore','getTempRet0','setTempRet0','writeStackCookie','checkStackCookie','ptrToString','zeroMemory','stringToNewUTF8','exitJS','getHeapMax','emscripten_realloc_buffer','ENV','ERRNO_CODES','ERRNO_MESSAGES','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','DNS','getHostByName','Protocols','Sockets','getRandomDevice','warnOnce','traverseStack','UNWIND_CACHE','convertPCtoSourceLocation','readAsmConstArgsArray','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','handleException','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','freeTableIndexes','functionsInTableMap','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','PATH','PATH_FS','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16Decoder','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeArrayToMemory','writeAsciiToMemory','SYSCALLS','getSocketFromFD','getSocketAddress','JSEvents','registerKeyEventCallback','specialHTMLTargets','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','currentFullscreenStrategy','restoreOldWindowedStyle','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','demangle','demangleAll','jsStackTrace','stackTrace','ExitStatus','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','dlopenMissingError','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','uncaughtExceptionCount','exceptionLast','exceptionCaught','ExceptionInfo','exception_addRef','exception_decRef','Browser','setMainLoop','wget','FS','MEMFS','TTY','PIPEFS','SOCKFS','_setNetworkCallback','tempFixedLengthArray','miniTempWebGLFloatBuffers','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','GL','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','AL','SDL_unicode','SDL_ttfContext','SDL_audio','SDL','SDL_gfx','GLUT','EGL','GLFW_Window','GLFW','GLEW','IDBStore','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){var i="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),j(i)}})})),['ptrToString','zeroMemory','stringToNewUTF8','exitJS','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','getHostByName','getRandomDevice','traverseStack','convertPCtoSourceLocation','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeAsciiToMemory','getSocketFromFD','getSocketAddress','registerKeyEventCallback','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','ExceptionInfo','exception_addRef','exception_decRef','setMainLoop','_setNetworkCallback','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','SDL_unicode','SDL_ttfContext','SDL_audio','GLFW_Window','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){'undefined'==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var i='`'+t+'` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line';E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),ht(i)}})})),K=function t(){lt||dt(),lt||(K=t)},r.preInit)for('function'==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return dt(),t.ready})}},r={};function h(t){var i=r[t];if(void 0!==i)return i.exports;var e=r[t]={exports:{}};return n[t](e,e.exports,h),e.exports}h.m=n,t="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",i="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",e="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",s=t=>{t&&t.d<1&&(t.d=1,t.forEach((t=>t.r--)),t.forEach((t=>t.r--?t.r++:t())))},h.a=(n,r,h)=>{var o;h&&((o=[]).d=-1);var l,a,c,f=new Set,u=n.exports,d=new Promise(((t,i)=>{c=i,a=t}));d[i]=u,d[t]=t=>(o&&t(o),f.forEach(t),d.catch((t=>{}))),n.exports=d,r((n=>{var r;l=(n=>n.map((n=>{if(null!==n&&"object"==typeof n){if(n[t])return n;if(n.then){var r=[];r.d=0,n.then((t=>{h[i]=t,s(r)}),(t=>{h[e]=t,s(r)}));var h={};return h[t]=t=>t(r),h}}var o={};return o[t]=t=>{},o[i]=n,o})))(n);var h=()=>l.map((t=>{if(t[e])throw t[e];return t[i]})),a=new Promise((i=>{(r=()=>i(h)).r=0;var e=t=>t!==o&&!f.has(t)&&(f.add(t),t&&!t.d&&(r.r++,t.push(r)));l.map((i=>i[t](e)))}));return r.r?a:h()}),(t=>(t?c(d[e]=t):a(u),s(o)))),o&&o.d<0&&(o.d=0)},h.d=(t,i)=>{for(var e in i)h.o(i,e)&&!h.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:i[e]})},h.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),h.p="/Client2/",h.b=document.baseURI||self.location.href;h(9858)})(); \ No newline at end of file diff --git a/mapview.js b/mapview.js index 8882b71f..a5ede9cb 100644 --- a/mapview.js +++ b/mapview.js @@ -1 +1 @@ -(()=>{"use strict";var t,i,s,e,n={1651:(t,i,s)=>{s.d(i,{K:()=>M});var e=s(1120),n=s(4583),h=s(2901),r=s(1069),o=s(7046),l=(s(9896),s(6666)),a=s(3045),c=s(818),f=s(670),u=s(8268),d=s(3867),w=s(7854),y=s(8950),A=s(1302),p=s(9298),m=s(8665),g=s(1312),_=s(3819),I=s(8317),C=s(9234),E=s(1908),v=s(123),b=s(5637),T=s(6948),O=s(2164),R=s(8738),S=s(3764),L=s(8534),x=s(6730);class M extends o.A{static tt=225;static it=10;static portOffset=0;static members=!0;static st=!1;static et='';static nt='';static ht=!1;static rt=2;static ot=!1;static lt='https://raw.githubusercontent.com/2004scape/Server/main';static exponent=58778699976184461502525193738213253649000149147835990136706041084440742975821n;static ct=7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789n;static ft=0;static ut=0;static dt=0;static wt=0;static yt=0;static At=0;static gt=0;static _t=0;static It=0;static Ct=0;static Et=0;static vt=0;static bt=0;static Tt=0;static Ot=0;static Rt=()=>{a.A.st=!1,n.A.st=!1,M.st=!1,c.A.st=!1};static St=()=>{a.A.st=!0,n.A.st=!0,M.st=!0,c.A.st=!0};Lt=2048;xt=2047;Mt=!1;kt=!1;Dt=!1;Ft=!1;db=null;Nt=0;Bt=[];stream=null;in=r.A.Pt(1);Ut=r.A.Pt(1);Wt=r.A.Pt(1);Gt=0n;Ht=0;Yt=0;Vt=0;Kt=null;Xt=0;packetSize=0;jt=0;zt=0;Zt=0;qt=null;Jt=!0;$t=0;Qt=0;ti=null;ii=null;si=null;ei=null;ni=null;hi=null;ri=null;oi=null;li=null;ai=null;ci=null;fi='';ui='';username='';password='';di=null;wi=null;yi=null;Ai=null;pi=[];mi=!1;gi=null;_i=null;Ii=null;Ci=null;Ei=null;vi=null;bi=null;Ti=null;Oi=null;Ri=null;Si=new Int32Array(256);Li=0;xi=0;Mi=0;ki=null;Di=null;Fi=null;Ni=null;Bi=null;Pi=null;Ui=null;Wi=null;Gi=null;Hi=null;Yi=null;Vi=null;Ki=null;Xi=null;ji=null;zi=null;Zi=null;qi=null;Ji=null;$i=null;Qi=null;ts=new Int32Array(33);ss=new Int32Array(33);es=new Int32Array(151);ns=new Int32Array(151);hs=null;rs=null;os=null;ls=null;cs=null;fs=null;us=new d.ds(13,null);ws=null;ys=null;As=new d.ds(50,null);ps=new d.ds(50,null);gs=new d.ds(20,null);_s=new d.ds(20,null);Is=null;Cs=new d.ds(8,null);Es=null;vs=null;bs=null;Ts=null;Os=null;Rs=null;Ss=null;Ls=null;xs=null;Ms=null;ks=null;Ds=null;Fs=null;Ns=null;Bs=null;Ps=null;Us=null;Ws=null;Gs=new d.ds(1e3,null);Hs=!1;Ys=!1;Vs=!1;Ks=!1;Xs=-1;js=0;zs=0;Zs=0;qs=0;Js=0;$s=0;Qs=!1;te=0;ie=0;se=0;ee=0;ne=0;he=0;re=[];oe=-1;le=-1;ae=new e.A;ce=78;fe=0;ue=0;de=[];we=0;ye=0;Ae=0;pe=0;me=0;ge=0;_e=0;Ie=0;Ce=[];Ee=[];ve=[];be=[];Te=null;Oe=-1;Re=3;Se=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];Le=0;xe=0;Me=0;ke=!1;De=0;Fe=!1;Ne='';Be='';Pe=0;Ue='';We=!1;Ge=-1;He=new d.ds(100,null);Ye=new d.ds(100,null);messageType=new Int32Array(100);Ve=new Int32Array(100);Ke=0;Xe=0;je=0;ze='';Ze=0;qe=0;Je=0;$e=0;Qe=0;tn=0;sn=0;en=0;nn=0;hn=!1;rn=0;ln=0;an=0;cn=0;fn=null;un=0;dn=0;wn=0;yn=0;An=!1;pn=[];mn=[];gn=0;_n=0;In=0;Cn=null;En=0;vn=new Int32Array(500);bn=new Int32Array(500);Tn=new Int32Array(500);On=new Int32Array(500);Rn=0;Sn=0;Ln=0;xn='';Mn=!1;kn=-1;Dn=0;Fn=0;Nn=0;Bn=0;Pn=0;Un=new Int32Array(1e3);Wn=new Int32Array(1e3);Gn=null;Hn=0;Yn=0;Vn=0;Kn=0;Xn=0;jn=!1;zn=0;Zn=0;qn=0;Jn=0;$n=2;Qn=2;th=1;ih=new Int32Array(5);sh=new d.ds(5,!1);eh=new Int32Array(5);nh=new Int32Array(5);hh=new Int32Array(5);rh=0;oh=0;lh=0;ah=0;fh=0;uh=0;dh=0;wh=0;yh=0;Ah=1;ph=2;mh=-1;gh=0;_h=0;Ih=0;Ch=0;Eh=0;bh=0;Th=null;Oh=null;Rh=null;Sh=0;Lh=0;xh=new Int8Array(16384);Mh=new d.ds(f.A.kh,null);Dh=0;Fh=0;Nh=128;Bh=0;Ph=0;Uh=0;Wh=0;Gh=0;Hh=null;Yh=null;Vh=new d.Kh(f.A.Xh,f.A.Xh);jh=0;zh=0;Zh=0;qh=0;Jh=0;$h=0;Qh=0;tr=0;ir=0;sr=0;er=0;nr=0;hr=new d.ds(this.Lt,null);rr=0;lr=new Int32Array(this.Lt);ar=0;cr=0;ur=new Int32Array(this.Lt);dr=new Int32Array(1e3);wr=new d.ds(this.Lt,null);yr=new d.ds(8192,null);Ar=0;pr=new Int32Array(8192);mr=new l.A;gr=new l.A;_r=new l.A;Ir=new l.A;Cr=new d.Er(f.A.kh,f.A.Xh,f.A.Xh,null);vr=new l.A;br=new Int32Array(4e3);Tr=new Int32Array(4e3);Or=new Int32Array(f.A.Xh*f.A.Xh);Rr=new Int32Array(f.A.Xh*f.A.Xh);Sr=0;Lr=null;Mr=0;kr=0;Dr=-1;Fr=0;Nr=0;Br=0;Pr=0;Ur=!1;Wr=!0;Gr=!1;Hr=new Int32Array(7);Yr=new Int32Array(5);Vr=0;Kr=0;static Xr=50;jr=new Int32Array(M.Xr);zr=new Int32Array(M.Xr);Zr=new Int32Array(M.Xr);qr=new Int32Array(M.Xr);Jr=new Int32Array(M.Xr);$r=new Int32Array(M.Xr);Qr=new Int32Array(M.Xr);io=new d.ds(M.Xr,null);so=new d.ds(100,null);eo=new BigInt64Array(100);no=new Int32Array(100);ho=null;ro=0;oo=!0;lo=new Int32Array(50);ao=new Int32Array(50);co=new Int32Array(50);fo=192;uo=-1;do=-1;wo=0;yo=0;Ao=0;po=!0;mo=null;_o=0;Io=0;Co=192;Eo=new d.ds(16,null);vo=0;bo=!1;To=()=>{try{this.stream&&this.stream.close()}catch(t){}this.stream=null,(0,v.Oo)(),this.Ut=null,this.Wt=null,this.in=null,this.Rh=null,this.Th=null,this.Oh=null,this.Hh=null,this.Yh=null,this.Gn=null,this.Mh=null,this.Or=null,this.Rr=null,this.br=null,this.Tr=null,this.xh=null,this.Di=null,this.Fi=null,this.Ni=null,this.Bi=null,this.Pi=null,this.Ui=null,this.Wi=null,this.Gi=null,this.Hi=null,this.Yi=null,this.Vi=null,this.Ki=null,this.Xi=null,this.ji=null,this.zi=null,this.Zi=null,this.qi=null,this.hs=null,this.os=null,this.rs=null,this.ls=null,this.cs=null,this.fs=null,this.us=null,this.Ss=null,this.Ls=null,this.xs=null,this.Ms=null,this.ks=null,this.Ds=null,this.Fs=null,this.Ns=null,this.Bs=null,this.Ps=null,this.ys=null,this.gs=null,this._s=null,this.Cs=null,this.Es=null,this.vs=null,this.bs=null,this.Ts=null,this.As=null,this.ps=null,this.Vh=null,this.hr=null,this.lr=null,this.ur=null,this.wr=null,this.dr=null,this.yr=null,this.pr=null,this.Cr=null,this.vr=null,this.Ir=null,this.mr=null,this.gr=null,this._r=null,this.Tn=null,this.On=null,this.vn=null,this.bn=null,this.re=null,this.pn=null,this.Un=null,this.Wn=null,this.Gs=null,this.ws=null,this.so=null,this.eo=null,this.no=null,this.ei=null,this.ni=null,this.ti=null,this.ii=null,this.si=null,this.hi=null,this.ri=null,this.oi=null,this.li=null,this.Ro(),b.A.To(),T.A.To(),A.A.To(),O.A.So=null,I.A.So=null,e.A.So=null,g.A.So=null,R.A.So=null,R.A.Lo=null,S.A.So=null,this.xo=null,u.A.Lo=null,n.A.To(),a.A.To(),m.A.To(),L.A.So=[],x.A.So=[]};Mo(){return this.$t}ko(){return this.We}Do(){return this.Fe}Fo(){return this.le}No(){return this.Xs}Ro=()=>{this.mi=!1,this.ki&&(clearInterval(this.ki),this.ki=null),this.ai=null,this.ci=null,this.pi=[],this.bi=null,this.Ti=null,this.Oi=null,this.Ri=null,this.Ci=null,this.Ii=null,this.Ei=null,this.vi=null,this.gi=null,this._i=null};Bo=async(t,i,s,e)=>{let n=5,o=await(this.db?.Po(t));if(o&&r.A.Uo(o)!==s&&(o=void 0),o)return new h.A(o);for(;!o;){await this.Wo(e,`Requesting ${i}`);try{o=await(0,C.Go)(`${M.nt}/${t}${s}`)}catch(t){o=void 0;for(let t=n;t>0;t--)await this.Wo(e,`Error loading - Will retry in ${t} secs.`),await(0,C.Ho)(1e3);n*=2,n>60&&(n=60)}}return await(this.db?.Yo(t,o)),new h.A(o)};Vo=async(t,i,s)=>{let e=await(this.db?.Po(t+'.mid'));if(e&&12345678!==i&&r.A.Uo(e)!==i&&(e=void 0),!e)try{e=await(0,C.Go)(`${M.nt}/${t}_${i}.mid`),s!==e.length&&(e=e.slice(0,s))}catch(t){}if(!e)return;await(this.db?.Yo(t+'.mid',e));const n=new r.A(Uint8Array.from(e)).Ko,h=E.A.read(n,e,s,4);(0,v.Xo)(h,this.Co)};jo=()=>{if(w.zo.fillStyle='black',w.zo.fillRect(0,0,this.width,this.height),this.Zo(1),this.Dt){this.mi=!1,w.zo.font='bold 16px helvetica, sans-serif',w.zo.textAlign='left',w.zo.fillStyle='yellow';let t=35;w.zo.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,w.zo.fillStyle='white',w.zo.fillText('To fix this try the following (in order):',30,t),t+=50,w.zo.font='bold 12px helvetica, sans-serif',w.zo.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.zo.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,w.zo.fillText('3: Try using a different game-world',30,t),t+=30,w.zo.fillText('4: Try rebooting your computer',30,t),t+=30,w.zo.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.Ft&&(this.mi=!1,w.zo.font='bold 20px helvetica, sans-serif',w.zo.textAlign='left',w.zo.fillStyle='white',w.zo.fillText('Error - unable to load game!',50,50),w.zo.fillText('To play RuneScape make sure you play from',50,100),w.zo.fillText('https://2004scape.org',50,150)),this.kt){this.mi=!1,w.zo.font='bold 13px helvetica, sans-serif',w.zo.textAlign='left',w.zo.fillStyle='yellow';let t=35;w.zo.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,w.zo.fillStyle='white',w.zo.fillText('To fix this try the following (in order):',30,t),t+=50,w.zo.font='bold 12px helvetica, sans-serif',w.zo.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.zo.fillText('2: Try rebooting your computer, and reloading',30,t)}};qo=t=>{if(!t.Jo)return!1;for(let i=0;i=e)return!1}else if(3===t.Jo[i]){if(s<=e)return!1}else if(4===t.Jo[i]){if(s===e)return!1}else if(s!==e)return!1}return!0};tl=(t,i,s,e,n)=>{this.Os?.draw(t,i),this.Rs?.draw(t,i+n-16),y.A.fillRect(t,i+16,16,n-32,p.A.il);let h=(n-32)*n/e|0;h<8&&(h=8);const r=(n-h-32)*s/(e-n)|0;y.A.fillRect(t,i+r+16,16,h,p.A.sl),y.A.el(t,i+r+16,p.A.nl,h),y.A.el(t+1,i+r+16,p.A.nl,h),y.A.hl(t,i+r+16,p.A.nl,16),y.A.hl(t,i+r+17,p.A.nl,16),y.A.el(t+15,i+r+16,p.A.rl,h),y.A.el(t+14,i+r+17,p.A.rl,h-1),y.A.hl(t,i+r+h+15,p.A.rl,16),y.A.hl(t+1,i+r+h+14,p.A.rl,15)};ol=(t,i)=>{let s=!1;const n=e.A.So[t];if(!n.ll)return!1;for(let t=0;te.delay[h.ul];)h.fl-=e.delay[h.ul]+1,h.ul++,h.ul>=e.dl&&(h.ul-=e.wl,(h.ul<0||h.ul>=e.dl)&&(h.ul=0)),s=!0}}}return s};yl=(t,i,s,h,r=!1)=>{if(0!==t.type||!t.ll||t.hide&&this.Ze!==t.id&&this.qe!==t.id&&this.Je!==t.id)return;const o=y.A.left,l=y.A.top,a=y.A.right,c=y.A.bottom;y.A.Al(i,s,i+t.width,s+t.height);const f=t.ll.length;for(let o=0;o0&&this.Cl(c),c.type===e.A.El)c.vl>c.scroll-c.height&&(c.vl=c.scroll-c.height),c.vl<0&&(c.vl=0),this.yl(c,l,a,c.vl,r),c.scroll>c.height&&this.tl(l+c.width,a,c.vl,c.scroll,c.height);else if(c.type===e.A.bl){let t=0;for(let i=0;i0){let i=0,s=0;const h=c.Rl[t]-1;if(e>=-32&&e<=512&&n>=-32&&n<=334||0!==this.tn&&this.Qe===t){const r=A.A.Ml(h,c.Sl[t]);if(0!==this.tn&&this.Qe===t&&this.$e===c.id?(i=this.kl-this.sn,s=this.Dl-this.en,i<5&&i>-5&&(i=0),s<5&&s>-5&&(s=0),this.nn<5&&(i=0,s=0),r.Fl(128,e+i,n+s)):0!==this.un&&this.dn===t&&this.wn===c.id?r.Fl(128,e,n):r.draw(e,n),33===r.Nl||1!==c.Sl[t]){const h=c.Sl[t];this.di?.Bl(e+i+1,n+10+s,this.Pl(h),p.A.Ul),this.di?.Bl(e+i,n+9+s,this.Pl(h),p.A.Wl)}}}else if(c.Gl&&t<20){const i=c.Gl[t];i?.draw(e,n)}t++}}else if(c.type===e.A.Hl)c.fill?y.A.fillRect(l,a,c.width,c.height,c.Yl):y.A.gl(l,a,c.width,c.height,c.Yl);else if(c.type===e.A.Vl){const t=c.font;let i=c.Yl,s=c.text;if(this.Je!==c.id&&this.qe!==c.id&&this.Ze!==c.id||0===c.Kl||(i=c.Kl),this.qo(c)&&(i=c.Xl,c.jl&&c.jl.length>0&&(s=c.jl)),c.zl===e.A.Zl&&this.An&&(s='Please wait...',i=c.Yl),!t||!s)continue;for(let e=a+t.height;s.length>0;e+=t.height){if(-1!==s.indexOf('%')){for(;;){const t=s.indexOf('%1');if(-1===t)break;s=s.substring(0,t)+this.ql(this.$o(c,0))+s.substring(t+2)}for(;;){const t=s.indexOf('%2');if(-1===t)break;s=s.substring(0,t)+this.ql(this.$o(c,1))+s.substring(t+2)}for(;;){const t=s.indexOf('%3');if(-1===t)break;s=s.substring(0,t)+this.ql(this.$o(c,2))+s.substring(t+2)}for(;;){const t=s.indexOf('%4');if(-1===t)break;s=s.substring(0,t)+this.ql(this.$o(c,3))+s.substring(t+2)}for(;;){const t=s.indexOf('%5');if(-1===t)break;s=s.substring(0,t)+this.ql(this.$o(c,4))+s.substring(t+2)}}const n=s.indexOf('\\n');let h;-1!==n?(h=s.substring(0,n),s=s.substring(n+2)):(h=s,s=''),c.Jl?t.$l(l+(c.width/2|0),e,h,i,c.Ql):t.ta(l,e,h,i,c.Ql)}}else if(c.type===e.A.ia){let t;t=this.qo(c)?c.sa:c.ea,t?.draw(l,a)}else if(c.type===e.A.na){const t=n.A.ha,i=n.A.ra;n.A.ha=l+(c.width/2|0),n.A.ra=a+(c.height/2|0);const s=n.A.sin[c.oa]*c.zoom>>16,e=n.A.cos[c.oa]*c.zoom>>16,h=this.qo(c);let r;r=h?c.cl:c.al;let o=null;if(-1===r)o=c.la(-1,-1,h);else{const t=g.A.So[r];t.frames&&t.aa&&(o=c.la(t.frames[c.ul],t.aa[c.ul],h))}o&&o.ca(0,c.fa,0,c.oa,0,s,e),n.A.ha=t,n.A.ra=i}else if(c.type===e.A.ua){const t=c.font;if(!t||!c.Rl||!c.Sl)continue;let i=0;for(let s=0;s0){const n=A.A.get(c.Rl[i]-1);let h=n.name;if((n.da||1!==c.Sl[i])&&(h=h+' x'+this.wa(c.Sl[i])),!h)continue;const r=l+e*(c.Ll+115),o=a+s*(c.xl+12);c.Jl?t.$l(r+(c.width/2|0),o,h,c.Yl,c.Ql):t.ta(r,o,h,c.Yl,c.Ql)}i++}}}y.A.Al(o,l,a,c)};Cl=t=>{let i=t.Il;if(i>=e.A.ya&&i<=e.A.Aa)i--,i>=this.Vr?(t.text='',t.zl=0):(t.text=this.so[i],t.zl=1);else if(i>=e.A.pa&&i<=e.A.ma)i-=e.A.pa,i>=this.Vr?(t.text='',t.zl=0):(0===this.no[i]?t.text='@red@Offline':this.no[i]===M.it?t.text='@gre@World-'+(this.no[i]-9):t.text='@yel@World-'+(this.no[i]-9),t.zl=1);else if(i===e.A.ga)t.scroll=15*this.Vr+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i>=e.A._a&&i<=e.A.Ia)i-=e.A._a,i>=this.ue?(t.text='',t.zl=0):(t.text=_.A.Ca(_.A.Ea(this.de[i])),t.zl=1);else if(i===e.A.va)t.scroll=15*this.ue+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i===e.A.ba){if(t.oa=150,t.fa=256*Math.sin(this.Nt/40)&2047,this.Gr){this.Gr=!1;const i=new d.ds(7,null);let s=0;for(let t=0;t<7;t++){const e=this.Hr[t];e>=0&&(i[s++]=I.A.So[e].la())}const e=m.A.Ta(i,s);for(let t=0;t<5;t++)0!==this.Yr[t]&&(e.Oa(u.A.Ra[t][0],u.A.Ra[t][this.Yr[t]]),1===t&&e.Oa(u.A.Sa[0],u.A.Sa[this.Yr[t]]));if(this.Lr){const i=g.A.So[this.Lr.La].frames;i&&(e.xa(),e.Ma(i[0]),e.ka(64,850,-30,-50,-30,!0),t.model=e)}}}else if(i===e.A.Da)this.Us||(this.Us=t.ea,this.Ws=t.sa),this.Wr?t.ea=this.Ws:t.ea=this.Us;else if(i===e.A.Fa)this.Us||(this.Us=t.ea,this.Ws=t.sa),this.Wr?t.ea=this.Us:t.ea=this.Ws;else if(i===e.A.Na)t.text=this.xn,this.Nt%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(i===e.A.Ba)this.Ur?this.Mn?(t.Yl=p.A.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.Yl=p.A._l,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(i===e.A.Pa||i===e.A.Ua)if(0===this.Dn)t.text='';else{let i;i=0===this.Fn?'earlier today':1===this.Fn?'yesterday':this.Fn+' days ago',t.text='You last logged in '+i+' from: '+_.A.Wa(this.Dn)}else if(i===e.A.Ga)0===this.Bn&&(t.text='0 unread messages',t.Yl=p.A.Wl),1===this.Bn&&(t.text='1 unread message',t.Yl=p.A.GREEN),this.Bn>1&&(t.text=this.Bn+' unread messages',t.Yl=p.A.GREEN);else if(i===e.A.Ha)if(201===this.Nn)t.text='';else if(200===this.Nn)t.text='You have not yet set any password recovery questions.';else{let i;i=0===this.Nn?'Earlier today':1===this.Nn?'Yesterday':this.Nn+' days ago',t.text=i+' you changed your recovery questions'}else i===e.A.Ya?201===this.Nn?t.text='':200===this.Nn?t.text='We strongly recommend you do so now to secure your account.':t.text='If you do not remember making this change then cancel it immediately':i===e.A.Va&&(201===this.Nn?t.text='':(this.Nn,t.text="Do this from the 'account management' area on our front webpage"))};$o=(t,i)=>{if(!t.scripts||i>=t.scripts.length)return-2;try{const s=t.scripts[i];if(!s)return-1;let n=0,h=0;for(;;){const t=s[h++];if(0===t)return n;if(1===t)n+=this.Ee[s[h++]];else if(2===t)n+=this.ve[s[h++]];else if(3===t)n+=this.Ce[s[h++]];else if(4===t){const t=e.A.So[s[h++]],i=s[h++]+1;if(t.Rl&&t.Sl)for(let s=0;st<999999999?String(t):'*';wa=t=>{let i=String(t);for(let t=i.length-3;t>0;t-=3)i=i.substring(0,t)+','+i.substring(t);return i.length>8?i='@gre@'+i.substring(0,i.length-8)+' million @whi@('+i+')':i.length>4&&(i='@cya@'+i.substring(0,i.length-4)+'K @whi@('+i+')'),' '+i};Pl=t=>t<1e5?String(t):t<1e7?(t/1e3|0)+'K':(t/1e6|0)+'M'}},7604:(t,i,s)=>{s.d(i,{w:()=>r});var e=s(7046),n=s(1651),h=s(9234);async function r(){await async function(){0===e.A.getParameter('world').length&&e.A.setParameter('world','1');'localhost'===window.location.hostname&&'0'===e.A.getParameter('world')?(n.K.et='http://localhost',n.K.nt='http://localhost',n.K.portOffset=0):await async function(t){const i=await o(t,parseInt(e.A.getParameter('world'),10)),s=new URL(i.address);n.K.it=10+i.id-1,n.K.et=`${s.protocol}//${s.hostname}`,n.K.nt=`${s.protocol}//${s.hostname}:${s.port}`,t||(n.K.et=n.K.et.replace('https:','http:'));n.K.portOffset=i.portOffset,n.K.members=!0===i?.members,e.A.setParameter('world',i.id.toString(10))}(window.location.protocol.startsWith('https'))}(),function(){0===e.A.getParameter('detail').length&&e.A.setParameter('detail','high');'low'===e.A.getParameter('detail')?n.K.St():n.K.Rt()}(),0===e.A.getParameter('method').length&&e.A.setParameter('method','0')}async function o(t,i,s=0){if(s>=10)throw new Error('could not find world to connect!');const e=t?'https:':'http:';let n;try{n=JSON.parse(await(0,h.Xa)(`${e}//2004scape.org/api/v1/worldlist`))}catch(e){return await(0,h.Ho)(1e3),o(t,i,++s)}n.push({id:0,region:'Local Development',address:'http://localhost',portOffset:0,members:!0,hr:0});const r=n.find((t=>t.id===i));return r||o(t,i,10)}},7046:(t,i,s)=>{s.d(i,{A:()=>a});var e=s(1183),n=s(4583),h=s(9234),r=s(9091),o=s(2595),l=s(7854);class a{static getParameter(t){return new URLSearchParams(window.location.search).get(t)??''}static setParameter(t,i){const s=new URL(window.location.toString());s.searchParams.set(t,i),window.history.pushState(null,'',s.toString())}ja=0;za=[];Za=0;xo=null;state=0;qa=20;Ja=1;$a=[];Qa=0;tc=0;ic=[];sc=!0;ec=!1;nc=50;hasFocus=!0;hc=!1;rc=0;oc=0;kl=0;Dl=0;lc=0;ac=0;cc=0;fc=[];uc=[];dc=0;wc=0;input=null;yc=!1;Ac=!1;mc=!1;time=-1;gc=0;_c=0;Ic=0;Cc=0;Ec=0;vc=0;constructor(t=!1){l.bc.tabIndex=-1,l.zo.fillStyle='black',l.zo.fillRect(0,0,l.bc.width,l.bc.height),this.ec=t,this.ec?this.resize(window.innerWidth,window.innerHeight):this.resize(l.bc.width,l.bc.height)}get width(){return l.bc.width}get height(){return l.bc.height}resize=(t,i)=>{l.bc.width=t,l.bc.height=i,this.xo=new e.A(t,i),n.A.Tc()};Oc=async()=>{l.bc.addEventListener('resize',(()=>{this.ec&&this.resize(window.innerWidth,window.innerHeight)}),!1),l.bc.onmousedown=this.onmousedown,l.bc.onmouseup=this.onmouseup,l.bc.onmouseenter=this.onmouseenter,l.bc.onmouseleave=this.onmouseleave,l.bc.onmousemove=this.onmousemove,window.onbeforeunload=this.To,l.bc.onfocus=this.onfocus,l.bc.onblur=this.onblur,this.Rc?(l.bc.ontouchstart=this.ontouchstart,l.bc.ontouchend=this.ontouchend,l.bc.ontouchmove=this.ontouchmove):(l.bc.onkeydown=this.onkeydown,l.bc.onkeyup=this.onkeyup),l.bc.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.Rc&&'low'===a.getParameter('detail')&&(this.nc=30),await this.Wo(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.$a[t]=performance.now();let t,i=0,s=256,e=1,n=0;for(;this.state>=0;){if(this.state>0&&(this.state--,0===this.state))return void this.Sc();const r=s,o=e;s=300,e=1,t=performance.now();const l=this.$a[i];if(0===l?(s=r,e=o):t>l&&(s=2560*this.qa/(t-l)|0),s<25?s=25:s>256&&(s=256,e=this.qa-(t-l)/10|0),this.$a[i]=t,i=(i+1)%10,e>1)for(let t=0;t<10;t++)0!==this.$a[t]&&(this.$a[t]+=e);for(e0&&(this.Qa=1e3*s/(256*this.qa)|0);const a=performance.now();if(this.sc&&this.refresh(),await this.draw(),this.ic[this.tc]=(performance.now()-a)/1e3,this.tc=(this.tc+1)%this.ic.length,this.nc<50){const i=1e3/this.nc-(performance.now()-t);i>0&&await(0,h.Ho)(i)}}-1===this.state&&this.Sc()};Sc=()=>{this.state=-2,this.To()};Zo=t=>{this.qa=1e3/t|0};Lc=t=>{this.nc=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.qa|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};To=()=>{};draw=async()=>{};refresh=()=>{};async Wo(t,i){const s=this.width,e=this.height;this.sc&&(l.zo.fillStyle='black',l.zo.fillRect(0,0,s,e),this.sc=!1);const n=e/2-18;l.zo.fillStyle='rgb(140, 17, 17)',l.zo.rect((s/2|0)-152,n,304,34),l.zo.fillRect((s/2|0)-150,n+2,3*t,30),l.zo.fillStyle='black',l.zo.fillRect((s/2|0)-150+3*t,n+2,300-3*t,30),l.zo.font='bold 13px helvetica, sans-serif',l.zo.textAlign='center',l.zo.fillStyle='white',l.zo.fillText(i,s/2|0,n+22),await(0,h.Ho)(5)}xc=()=>{let t=-1;return this.wc!==this.dc&&(t=this.uc[this.dc],this.dc=this.dc+1&127),t};get ms(){const t=this.ic.length;let i=0;for(let s=0;sthis.ja&&(this.ja=s),this.za[this.Za]=s,this.Za=(this.Za+1)%250,s}get Mc(){return this.za.reduce(((t,i)=>t+i),0)/250}onkeydown=t=>{const i=t.key;r.p.includes(i)&&t.preventDefault(),this.rc=0;const s=r.L[i];if(!s||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const e=s.code;let n=s.ch;t.ctrlKey&&(n>='A'.charCodeAt(0)&&n<=']'.charCodeAt(0)||n=='_'.charCodeAt(0)?n-='A'.charCodeAt(0)-1:n>='a'.charCodeAt(0)&&n<='z'.charCodeAt(0)&&(n-='a'.charCodeAt(0)-1)),n<30&&(n=0),e===r.L.ArrowLeft.code?n=1:e===r.L.ArrowRight.code?n=2:e===r.L.ArrowUp.code?n=3:e===r.L.ArrowDown.code?n=4:e===r.L.Control.code?n=5:e===r.L.Shift.code?n=6:e===r.L.Alt.code?n=7:e===r.L.Backspace.code||e===r.L.Delete.code?n=8:e===r.L.Tab.code?n=9:e===r.L.Enter.code?n=10:e>=r.L.F1.code&&e<=r.L.F12.code?n=e+1008-r.L.F1.code:e===r.L.Home.code?n=1e3:e===r.L.End.code?n=1001:e===r.L.PageUp.code?n=1002:e===r.L.PageDown.code&&(n=1003),n>0&&n<128&&(this.fc[n]=1),n>4&&(this.uc[this.wc]=n,this.wc=this.wc+1&127),o.A.enabled&&o.A.kc(n)};onkeyup=t=>{const i=t.key;r.p.includes(i)&&t.preventDefault(),this.rc=0;const s=r.L[i];if(!s||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const e=s.code;let n=s.ch;n<30&&(n=0),e===r.L.ArrowLeft.code?n=1:e===r.L.ArrowRight.code?n=2:e===r.L.ArrowUp.code?n=3:e===r.L.ArrowDown.code?n=4:e===r.L.Control.code?n=5:e===r.L.Shift.code?n=6:e===r.L.Alt.code?n=7:e===r.L.Backspace.code||e===r.L.Delete.code?n=8:e===r.L.Tab.code?n=9:e===r.L.Enter.code?n=10:e>=r.L.F1.code&&e<=r.L.F12.code?n=e+1008-r.L.F1.code:e===r.L.Home.code?n=1e3:e===r.L.End.code?n=1001:e===r.L.PageUp.code?n=1002:e===r.L.PageDown.code&&(n=1003),n>0&&n<128&&(this.fc[n]=0),o.A.enabled&&o.A.Dc(n)};onmousedown=t=>{if(this.yc=!1,(t.clientX>0||t.clientY>0)&&this.Fc(t),this.rc=0,this.ac=this.kl,this.cc=this.Dl,this.Rc&&!this.Nc){if(this.Bc()||this.Pc()||this.Uc())return this.lc=1,void(this.oc=1);t.timeStamp>=this.time+500?(this.lc=2,this.oc=2):(this.lc=1,this.oc=1)}else 2===t.button?(this.lc=2,this.oc=2):(this.lc=1,this.oc=1);o.A.enabled&&o.A.Wc(this.ac,this.cc,t.buttons)};onmouseup=t=>{this.Fc(t),this.rc=0,this.oc=0,o.A.enabled&&o.A.Gc(t.buttons)};onmouseenter=t=>{this.Fc(t),o.A.enabled&&o.A.Hc()};onmouseleave=t=>{this.Fc(t),this.rc=0,this.kl=-1,this.Dl=-1,this.oc=0,this.ac=-1,this.cc=-1,o.A.enabled&&o.A.Yc()};onmousemove=t=>{this.Fc(t),this.rc=0,o.A.enabled&&o.A.Vc(this.kl,this.Dl)};onfocus=t=>{this.hasFocus=!0,this.sc=!0,this.refresh(),o.A.enabled&&o.A.Kc()};onblur=t=>{this.hasFocus=!1,o.A.enabled&&o.A.Xc()};ontouchstart=t=>{if(!this.Rc)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.yc=!0;const i=t.changedTouches[0],s=0|i.clientX,e=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:s,clientY:e})),this.gc=this.Ec=this.Ic=0|i.screenX,this._c=this.vc=this.Cc=0|i.screenY,this.time=t.timeStamp,this.Ac=this.jc(),this.mc=this.zc()};ontouchend=t=>{if(!this.Rc||!this.yc)return;const i=t.changedTouches[0],s=0|i.clientX,e=0|i.clientY;if(this.onmousemove(new MouseEvent('mousemove',{clientX:s,clientY:e})),this.Ec=0|i.screenX,this.vc=0|i.screenY,this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.Ac&&!this.jc())return void(this.yc=!1);if(this.mc&&!this.zc())return void(this.yc=!1);if(this.Bc()||this.Zc()||this.Pc()||this.Uc()){null!==this.input&&(this.input.parentNode?.contains(this.input)&&this.input.parentNode?.removeChild(this.input),this.input=null);const t=document.createElement('input');return this.Pc()?(t.setAttribute('id','username'),t.setAttribute('placeholder','Username')):this.Uc()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.Bc()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.Zc()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this.qc?t.setAttribute('type','password'):t.setAttribute('type',this.Uc()?'password':'text'),t.setAttribute('autofocus','autofocus'),t.setAttribute('spellcheck','false'),t.setAttribute('autocomplete','off'),t.setAttribute('style',`position: fixed; left: ${s}px; top: ${e}px; width: 1px; height: 1px; opacity: 0;`),document.body.appendChild(t),t.focus(),t.click(),this.qc&&(t.oninput=t=>{if(!(t instanceof InputEvent))return;const i=t,s=i.data;null!==s&&'insertText'===i.inputType&&this.onkeydown(new KeyboardEvent('keydown',{key:s,code:s}))}),t.onkeydown=t=>{this.qc&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this.qc&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeyup(new KeyboardEvent('keyup',{key:t.key,code:t.key}))},t.onfocus=t=>{this.input?.parentNode?.removeChild(this.input),this.input=null,this.onfocus(t)},this.input=t,void(this.yc=!1)}const n=t.timeStamp>=this.time+500,h=Math.abs(this.gc-this.Ec)>16||Math.abs(this._c-this.vc)>16;n&&!h?(this.yc=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.oc=0,this.yc=!1)};ontouchmove=t=>{if(!this.Rc||!this.yc)return;const i=t.changedTouches[0],s=0|i.clientX,e=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:s,clientY:e})),this.Ec=0|i.screenX,this.vc=0|i.screenY,this.Ac&&-1===this.No()?(this.Ic-this.Ec>0?this.rotate(2):this.Ic-this.Ec<0&&this.rotate(0),this.Cc-this.vc>0?this.rotate(3):this.Cc-this.vc<0&&this.rotate(1)):(this.mc||-1!==this.No())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this.Ic=this.Ec,this.Cc=this.vc};get Rc(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get qc(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get Nc(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}jc=()=>this.hc&&this.kl>=8&&this.kl<=520&&this.Dl>=11&&this.Dl<=345;Bc=()=>this.hc&&-1===this.Fo()&&!this.ko()&&!this.Do()&&this.kl>=11&&this.kl<=506&&this.Dl>=449&&this.Dl<=482;Zc=()=>this.hc&&(this.ko()||this.Do())&&this.kl>=11&&this.kl<=506&&this.Dl>=383&&this.Dl<=482;zc=()=>this.hc&&this.kl>=562&&this.kl<=752&&this.Dl>=231&&this.Dl<=492;Pc=()=>!this.hc&&2===this.Mo()&&this.kl>=301&&this.kl<=562&&this.Dl>=262&&this.Dl<=279;Uc=()=>!this.hc&&2===this.Mo()&&this.kl>=301&&this.kl<=562&&this.Dl>=279&&this.Dl<=296;rotate=t=>{0===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowLeft',code:'ArrowLeft'}))):1===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowUp',code:'ArrowUp'}))):2===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowRight',code:'ArrowRight'}))):3===t&&(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowDown',code:'ArrowDown'})))};Jc=()=>null!==document.fullscreenElement;Fc=t=>{if(this.Jc()){const i=t.target.getBoundingClientRect(),s=window.innerHeight/l.bc.height,e=(window.innerWidth-l.bc.width*s)/2;this.kl=0|this.$c(t.clientX-i.left-e,0,l.bc.width*s,0,789),this.Dl=0|this.$c(t.clientY-i.top,0,l.bc.height*s,0,532)}else{const i=l.bc.getBoundingClientRect(),s=l.bc.width/i.width,e=l.bc.height/i.height;this.kl=(t.clientX-i.left)*s|0,this.Dl=(t.clientY-i.top)*e|0}this.kl<0&&(this.kl=0),this.Dl<0&&(this.Dl=0),this.kl>789&&(this.kl=789),this.Dl>532&&(this.Dl=532)};$c=(t,i,s,e,n)=>(t-i)*(n-e)/(s-i)+e}},2595:(t,i,s)=>{s.d(i,{A:()=>n});var e=s(1069);class n{static enabled=!1;static Qc=null;static tf=null;static if=0;static sf=0;static ef=0;static nf=0;static hf=0;static rf=()=>{this.Qc=e.A.Pt(1),this.tf=null,this.if=performance.now(),this.enabled=!0};static lf=()=>{this.enabled=!1,this.Qc=null};static flush=()=>{let t=null;return this.tf&&this.enabled&&(t=this.tf),this.tf=null,t};static stop=()=>{let t=null;return this.Qc&&this.Qc.af>0&&this.enabled&&(t=this.Qc),this.lf(),t};static Wc=(t,i,s)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;this.sf++;const e=performance.now();let n=(e-this.if)/10|0;n>250&&(n=250),this.if=e,this.cf(5),1===s?this.Qc?.p1(1):this.Qc?.p1(2),this.Qc?.p1(n),this.Qc?.p3(t+(i<<10))};static Gc=t=>{if(!this.enabled)return;this.sf++;const i=performance.now();let s=(i-this.if)/10|0;s>250&&(s=250),this.if=i,this.cf(2),1===t?this.Qc?.p1(3):this.Qc?.p1(4),this.Qc?.p1(s)};static Vc=(t,i)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;const s=performance.now();if(s-this.ef>=50){this.ef=s,this.sf++;let e=(s-this.if)/10|0;e>250&&(e=250),this.if=s,t-this.nf<8&&t-this.nf>=-8&&i-this.hf<8&&i-this.hf>=-8?(this.cf(3),this.Qc?.p1(5),this.Qc?.p1(e),this.Qc?.p1(t+(i-this.hf+8<<4)+8-this.nf)):t-this.nf<128&&t-this.nf>=-128&&i-this.hf<128&&i-this.hf>=-128?(this.cf(4),this.Qc?.p1(6),this.Qc?.p1(e),this.Qc?.p1(t+128-this.nf),this.Qc?.p1(i+128-this.hf)):(this.cf(5),this.Qc?.p1(7),this.Qc?.p1(e),this.Qc?.p3(t+(i<<10))),this.nf=t,this.hf=i}};static kc=t=>{if(!this.enabled)return;this.sf++;const i=performance.now();let s=(i-this.if)/10|0;s>250&&(s=250),this.if=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.cf(3),this.Qc?.p1(8),this.Qc?.p1(s),this.Qc?.p1(t)};static Dc=t=>{if(!this.enabled)return;this.sf++;const i=performance.now();let s=(i-this.if)/10|0;s>250&&(s=250),this.if=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.cf(3),this.Qc?.p1(9),this.Qc?.p1(s),this.Qc?.p1(t)};static Kc=()=>{if(!this.enabled)return;this.sf++;const t=performance.now();let i=(t-this.if)/10|0;i>250&&(i=250),this.if=t,this.cf(2),this.Qc?.p1(10),this.Qc?.p1(i)};static Xc=()=>{if(!this.enabled)return;this.sf++;const t=performance.now();let i=(t-this.if)/10|0;i>250&&(i=250),this.if=t,this.cf(2),this.Qc?.p1(11),this.Qc?.p1(i)};static Hc=()=>{if(!this.enabled)return;this.sf++;const t=performance.now();let i=(t-this.if)/10|0;i>250&&(i=250),this.if=t,this.cf(2),this.Qc?.p1(12),this.Qc?.p1(i)};static Yc=()=>{if(!this.enabled)return;this.sf++;const t=performance.now();let i=(t-this.if)/10|0;i>250&&(i=250),this.if=t,this.cf(2),this.Qc?.p1(13),this.Qc?.p1(i)};static cf=t=>{if(this.Qc&&this.Qc.af+t>=500){const t=this.Qc;this.Qc=e.A.Pt(1),this.tf=t}}}},9091:(t,i,s)=>{s.d(i,{L:()=>e,p:()=>n});const e={'Backspace':{code:8,ch:8},'Enter':{code:10,ch:10},'Shift':{code:16,ch:65535},'Escape':{code:27,ch:27},'Tab':{code:9,ch:9},'CapsLock':{code:20,ch:65535},' ':{code:32,ch:32},'Control':{code:17,ch:65535},'Alt':{code:18,ch:65535},'Meta':{code:524,ch:65535},'ArrowLeft':{code:37,ch:65535},'ArrowRight':{code:39,ch:65535},'ArrowUp':{code:38,ch:65535},'ArrowDown':{code:40,ch:65535},'Insert':{code:155,ch:65535},'Home':{code:36,ch:65535},'PageUp':{code:33,ch:65535},'Delete':{code:127,ch:127},'End':{code:35,ch:65535},'PageDown':{code:34,ch:65535},'`':{code:192,ch:96},'~':{code:192,ch:126},'!':{code:49,ch:33},'@':{code:50,ch:64},'#':{code:51,ch:35},'$':{code:52,ch:36},'%':{code:53,ch:37},'^':{code:54,ch:94},'&':{code:55,ch:38},'*':{code:56,ch:42},'(':{code:57,ch:40},')':{code:48,ch:41},'-':{code:45,ch:45},'_':{code:45,ch:95},'=':{code:61,ch:61},'+':{code:61,ch:43},'[':{code:91,ch:91},'{':{code:91,ch:123},']':{code:93,ch:93},'}':{code:93,ch:125},'\\':{code:92,ch:92},'|':{code:92,ch:124},';':{code:59,ch:59},':':{code:59,ch:58},"'":{code:222,ch:39},'"':{code:222,ch:34},',':{code:44,ch:44},'<':{code:44,ch:60},'.':{code:46,ch:46},'>':{code:46,ch:62},'/':{code:47,ch:47},'?':{code:47,ch:63},'F1':{code:112,ch:65535},'F2':{code:113,ch:65535},'F3':{code:114,ch:65535},'F4':{code:115,ch:65535},'F5':{code:116,ch:65535},'F6':{code:117,ch:65535},'F7':{code:118,ch:65535},'F8':{code:119,ch:65535},'F9':{code:120,ch:65535},'F10':{code:121,ch:65535},'F11':{code:122,ch:65535},'F12':{code:123,ch:65535},0:{code:48,ch:48},1:{code:49,ch:49},2:{code:50,ch:50},3:{code:51,ch:51},4:{code:52,ch:52},5:{code:53,ch:53},6:{code:54,ch:54},7:{code:55,ch:55},8:{code:56,ch:56},9:{code:57,ch:57},'a':{code:65,ch:97},'b':{code:66,ch:98},'c':{code:67,ch:99},'d':{code:68,ch:100},'e':{code:69,ch:101},'f':{code:70,ch:102},'g':{code:71,ch:103},'h':{code:72,ch:104},'i':{code:73,ch:105},'j':{code:74,ch:106},'k':{code:75,ch:107},'l':{code:76,ch:108},'m':{code:77,ch:109},'n':{code:78,ch:110},'o':{code:79,ch:111},'p':{code:80,ch:112},'q':{code:81,ch:113},'r':{code:82,ch:114},'s':{code:83,ch:115},'t':{code:84,ch:116},'u':{code:85,ch:117},'v':{code:86,ch:118},'w':{code:87,ch:119},'x':{code:88,ch:120},'y':{code:89,ch:121},'z':{code:90,ch:122},'A':{code:65,ch:65},'B':{code:66,ch:66},'C':{code:67,ch:67},'D':{code:68,ch:68},'E':{code:69,ch:69},'F':{code:70,ch:70},'G':{code:71,ch:71},'H':{code:72,ch:72},'I':{code:73,ch:73},'J':{code:74,ch:74},'K':{code:75,ch:75},'L':{code:76,ch:76},'M':{code:77,ch:77},'N':{code:78,ch:78},'O':{code:79,ch:79},'P':{code:80,ch:80},'Q':{code:81,ch:81},'R':{code:82,ch:82},'S':{code:83,ch:83},'T':{code:84,ch:84},'U':{code:85,ch:85},'V':{code:86,ch:86},'W':{code:87,ch:87},'X':{code:88,ch:88},'Y':{code:89,ch:89},'Z':{code:90,ch:90}},n=['Tab','F1','F2','F3','F4','F5','F6','F7','F8','F9','F10','ArrowLeft','ArrowRight','ArrowUp','ArrowDown']},1120:(t,i,s)=>{s.d(i,{A:()=>c});var e=s(1069),n=s(8665),h=s(2679),r=s(2511),o=s(3819),l=s(3867),a=s(8950);class c{static So=[];static ff=null;static Lo=null;static El=0;static uf=1;static bl=2;static Hl=3;static Vl=4;static ia=5;static na=6;static ua=7;static df=1;static wf=2;static yf=3;static Af=4;static pf=5;static Zl=6;static ya=1;static Aa=100;static pa=101;static ma=200;static mf=201;static gf=202;static ga=203;static _f=205;static If=300;static Cf=301;static Ef=302;static vf=303;static bf=304;static Tf=305;static Of=306;static Rf=307;static Sf=308;static Lf=309;static xf=310;static Mf=311;static kf=312;static Df=313;static Ff=314;static Nf=315;static Bf=316;static Pf=317;static Uf=318;static Wf=319;static Gf=320;static Hf=321;static Yf=322;static Vf=323;static Da=324;static Fa=325;static Kf=326;static ba=327;static _a=401;static Ia=500;static Xf=501;static jf=502;static va=503;static Na=600;static zf=601;static Zf=602;static qf=603;static Jf=604;static $f=605;static Qf=606;static tu=607;static iu=608;static su=609;static eu=610;static nu=611;static hu=612;static Ba=613;static Pa=650;static Ga=651;static Ha=652;static Ya=653;static Va=654;static Ua=655;static ru=(t,i,s)=>{this.ff=new h.A(5e4),this.Lo=new h.A(5e4);const n=new e.A(t.read('data'));let r=-1;for(n.af+=2;n.af0){e.Jo=new Uint8Array(h),e.Qo=new Uint16Array(h);for(let t=0;t0){e.scripts=new l.ds(o,null);for(let t=0;t0){const n=s.lastIndexOf(',');e.Gl[t]=this.yu(i,s.substring(0,n),parseInt(s.substring(n+1),10))}}e.Au=new l.ds(5,null);for(let t=0;t<5;t++){const i=n.wu;e.Au[t]=i,0===i.length&&(e.Au[t]=null)}}if(e.type===c.Hl&&(e.fill=1===n.au),e.type===c.Vl||e.type===c.uf){e.Jl=1===n.au;const t=n.au;s&&(e.font=s[t]),e.Ql=1===n.au}if(e.type===c.Vl&&(e.text=n.wu,e.jl=n.wu),e.type!==c.uf&&e.type!==c.Hl&&e.type!==c.Vl||(e.Yl=n.Ko),e.type!==c.Hl&&e.type!==c.Vl||(e.Xl=n.Ko,e.Kl=n.Ko),e.type===c.ia){const t=n.wu;if(t.length>0){const s=t.lastIndexOf(',');e.ea=this.yu(i,t.substring(0,s),parseInt(t.substring(s+1),10))}const s=n.wu;if(s.length>0){const t=s.lastIndexOf(',');e.sa=this.yu(i,s.substring(0,t),parseInt(s.substring(t+1),10))}}if(e.type===c.na){const t=n.au;0!==t&&(e.model=this.la((t-1<<8)+n.au));const i=n.au;0!==i&&(e.pu=this.la((i-1<<8)+n.au)),e.al=n.au,0===e.al?e.al=-1:e.al=(e.al-1<<8)+n.au,e.cl=n.au,0===e.cl?e.cl=-1:e.cl=(e.cl-1<<8)+n.au,e.zoom=n.ou,e.oa=n.ou,e.fa=n.ou}if(e.type===c.ua){e.Rl=new Int32Array(e.width*e.height),e.Sl=new Int32Array(e.width*e.height),e.Jl=1===n.au;const t=n.au;s&&(e.font=s[t]),e.Ql=1===n.au,e.Yl=n.Ko,e.Ll=n.fu,e.xl=n.fu,e.uu=1===n.au,e.Au=new l.ds(5,null);for(let t=0;t<5;t++){const i=n.wu;e.Au[t]=i,0===i.length&&(e.Au[t]=null)}}e.zl!==c.wf&&e.type!==c.bl||(e.mu=n.wu,e.action=n.wu,e.gu=n.ou),e.zl!==c.df&&e.zl!==c.Af&&e.zl!==c.pf&&e.zl!==c.Zl||(e._u=n.wu,0===e._u.length&&(e.zl===c.df?e._u='Ok':e.zl===c.Af||e.zl===c.pf?e._u='Select':e.zl===c.Zl&&(e._u='Continue')))}this.ff=null,this.Lo=null};static yu=(t,i,s)=>{const e=o.A.Iu(i)<<8n|BigInt(s);if(this.ff){const t=this.ff.get(e);if(t)return t}let n;try{n=r.A.Cu(t,i,s),this.ff?.put(e,n)}catch(t){return null}return n};static la=t=>{if(this.Lo){const i=this.Lo.get(BigInt(t));if(i)return i}const i=n.A.model(t);return this.Lo?.put(BigInt(t),i),i};id=-1;lu=-1;type=-1;zl=-1;Il=0;width=0;height=0;cu=-1;Jo=null;Qo=null;scripts=null;scroll=0;hide=!1;draggable=!1;uu=!1;du=!1;Ll=0;xl=0;Tl=null;Ol=null;Gl=null;Au=null;fill=!1;Jl=!1;font=null;Ql=!1;text=null;jl=null;Yl=0;Xl=0;Kl=0;ea=null;sa=null;model=null;pu=null;al=-1;cl=-1;zoom=0;oa=0;fa=0;mu=null;action=null;gu=-1;_u=null;ll=null;pl=null;ml=null;x=0;y=0;vl=0;Rl=null;Sl=null;ul=0;fl=0;la(t,i,s){let e=this.model;if(s&&(e=this.pu),!e)return null;if(-1===t&&-1===i&&!e.Eu)return e;const h=n.A.vu(e,!0,!0,!1);return-1===t&&-1===i||h.xa(),-1!==t&&h.Ma(t),-1!==i&&h.Ma(i),h.ka(64,768,-50,-10,-50,!0),h}bu(){if(this.lu===this.id)return this.x;let t=c.So[this.lu];if(!t.ll||!t.pl||!t.ml)return this.x;let i=t.ll.indexOf(this.id);if(-1===i)return this.x;let s=t.pl[i];for(;t.lu!==t.id;){const e=c.So[t.lu];e.ll&&e.pl&&e.ml&&(i=e.ll.indexOf(t.id),-1!==i&&(s+=e.pl[i])),t=e}return s}Tu(){if(this.lu===this.id)return this.y;let t=c.So[this.lu];if(!t.ll||!t.pl||!t.ml)return this.y;let i=t.ll.indexOf(this.id);if(-1===i)return this.y;let s=t.ml[i];for(;t.lu!==t.id;){const e=c.So[t.lu];e.ll&&e.pl&&e.ml&&(i=e.ll.indexOf(t.id),-1!==i&&(s+=e.ml[i])),t=e}return s}outline(t){const i=this.bu(),s=this.Tu();a.A.gl(i,s,this.width,this.height,t)}move(t,i){if(this.lu===this.id)return;this.x=0,this.y=0;const s=c.So[this.lu];if(s.ll&&s.pl&&s.ml){const e=s.ll.indexOf(this.id);-1!==e&&(s.pl[e]=t,s.ml[e]=i)}}delete(){if(this.lu===this.id)return;const t=c.So[this.lu];if(t.ll&&t.pl&&t.ml){const i=t.ll.indexOf(this.id);-1!==i&&(t.ll.splice(i,1),t.pl.splice(i,1),t.ml.splice(i,1))}}}},6333:(t,i,s)=>{s.d(i,{$:()=>e});class e{id;Ou=null;constructor(t){this.id=t}Ru(t){for(;;){const i=t.au;if(0===i)break;this.decode(i,t)}return this}}},2164:(t,i,s)=>{s.d(i,{A:()=>h});var e=s(1069),n=s(6333);class h extends n.${static count=0;static So=[];static ru=t=>{const i=new e.A(t.read('flo.dat'));this.count=i.ou;for(let t=0;t(s>179&&(i=i/2|0),s>192&&(i=i/2|0),s>217&&(i=i/2|0),s>243&&(i=i/2|0),(t/4<<10)+(i/32<<7)+(s/2|0));static Lu=(t,i)=>-1===t?12345678:((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);static xu=(t,i)=>-2===t?12345678:-1===t?(i<0?i=0:i>127&&(i=127),127-i):((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);Mu=0;texture=-1;ku=!1;Du=!0;Fu=0;Nu=0;Bu=0;Pu=0;Uu=0;Wu=0;decode(t,i){1===t?(this.Mu=i.Gu,this.setColor(this.Mu)):2===t?this.texture=i.au:3===t?this.ku=!0:5===t?this.Du=!1:6===t?this.Ou=i.wu:console.log('Error unrecognised config code: ',t)}setColor(t){const i=(t>>16&255)/256,s=(t>>8&255)/256,e=(255&t)/256;let n=i;si&&(r=s),e>r&&(r=e);let o=0,l=0;const a=(n+r)/2;n!==r&&(a<.5&&(l=(r-n)/(r+n)),a>=.5&&(l=(r-n)/(2-r-n)),i===r?o=(s-e)/(r-n):s===r?o=(e-i)/(r-n)+2:e===r&&(o=(i-s)/(r-n)+4)),o/=6,this.Fu=256*o|0,this.Nu=256*l|0,this.Bu=256*a|0,this.Nu<0?this.Nu=0:this.Nu>255&&(this.Nu=255),this.Bu<0?this.Bu=0:this.Bu>255&&(this.Bu=255),this.Pu=a>.5?(1-a)*l*512|0:a*l*512|0,this.Pu<1&&(this.Pu=1),this.Uu=o*this.Pu|0;let c=this.Fu+(16*Math.random()|0)-8;c<0?c=0:c>255&&(c=255);let f=this.Nu+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255);let u=this.Bu+(48*Math.random()|0)-24;u<0?u=0:u>255&&(u=255),this.Wu=h.Su(c,f,u)}}},8317:(t,i,s)=>{s.d(i,{A:()=>o});var e=s(1069),n=s(6333),h=s(8665),r=s(3867);class o extends n.${static count=0;static So=[];static ru=t=>{const i=new e.A(t.read('idk.dat'));this.count=i.ou;for(let t=0;t=40&&t<50)this.Vu[t-40]=i.ou;else if(t>=50&&t<60)this.Ku[t-50]=i.ou;else{if(!(t>=60&&t<70))throw new Error(`Unrecognized idk config code: ${t}`);this.Yu[t-60]=i.ou}}la(){if(!this.Hu)return null;const t=new r.ds(this.Hu.length,null);for(let i=0;i{s.d(i,{A:()=>c});var e=s(6333),n=s(1069),h=s(2679),r=s(8665),o=s(1023),l=s(6169),a=s(3867);class c extends e.${static count=0;static cache=null;static ju=null;static zu=null;static Zu=0;static qu=new h.A(500);static Ju=new h.A(30);static ru=t=>{this.ju=new n.A(t.read('loc.dat'));const i=new n.A(t.read('loc.idx'));this.count=i.ou,this.zu=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.zu||!this.ju)throw new Error('LocType not loaded!!!');for(let i=0;i<10;i++){const s=this.cache[i];if(s&&s.id===t)return s}this.Zu=(this.Zu+1)%10;const i=this.cache[this.Zu];return this.ju.af=this.zu[t],i.id=t,i.reset(),i.Ru(this.ju),i.$u||(i.$u=new Int32Array(1)),-1===i.Qu&&i.$u&&(i.active=i.$u.length>0&&i.$u[0]===o.A.td.id,i.sd&&(i.active=!0)),i};static To=()=>{this.qu=null,this.Ju=null,this.zu=null,this.cache=null,this.ju=null};Hu=null;$u=null;name=null;ed=null;Vu=null;Ku=null;width=1;length=1;nd=!0;hd=!0;active=!1;Qu=-1;rd=!1;od=!1;Du=!1;al=-1;ld=!1;ad=16;fd=0;ud=0;sd=null;dd=-1;wd=-1;yd=!1;Ad=!0;pd=128;md=128;gd=128;_d=0;Id=0;Cd=0;Ed=0;vd=!1;decode(t,i){if(1===t){const t=i.au;this.Hu=new Int32Array(t),this.$u=new Int32Array(t);for(let s=0;s=30&&t<39)this.sd||(this.sd=new a.ds(5,null)),this.sd[t-30]=i.wu,'hidden'===this.sd[t-30]?.toLowerCase()&&(this.sd[t-30]=null);else if(40===t){const t=i.au;this.Vu=new Uint16Array(t),this.Ku=new Uint16Array(t);for(let s=0;s=this.Hu.length)return null;let d=this.Hu[a];if(-1===d)return null;const w=this.yd!==i>3;w&&(d+=65536);let y=c.qu?.get(BigInt(d));y||(y=r.A.model(65535&d),w&&y.Md(),c.qu?.put(BigInt(d),y));const A=128!==this.pd||128!==this.md||128!==this.gd,p=0!==this.Id||0!==this.Cd||0!==this.Ed;let m=r.A.vu(y,!this.Vu,!this.ld,i===l.A.kd&&-1===o&&!A&&!p);for(-1!==o&&(m.xa(),m.Ma(o),m.Dd=null,m.Fd=null);i-- >0;)m.Nd();if(this.Vu&&this.Ku)for(let t=0;t{s.d(i,{A:()=>l});var e=s(6333),n=s(1069),h=s(2679),r=s(8665),o=s(3867);class l extends e.${static count=0;static cache=null;static ju=null;static zu=null;static Zu=0;static Lo=new h.A(30);static ru=t=>{this.ju=new n.A(t.read('npc.dat'));const i=new n.A(t.read('npc.idx'));this.count=i.ou,this.zu=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.zu||!this.ju)throw new Error('NpcType not loaded!!!');for(let i=0;i<20;i++){const s=this.cache[i];if(s&&s.id===t)return s}this.Zu=(this.Zu+1)%20;const i=this.cache[this.Zu]=new l(t);return this.ju.af=this.zu[t],i.Ru(this.ju),i};static To=()=>{this.Lo=null,this.zu=null,this.cache=null,this.ju=null};name=null;ed=null;size=1;Hu=null;Yu=null;ld=!1;Ud=-1;Wd=-1;Gd=-1;Hd=-1;Yd=-1;Vu=null;Ku=null;sd=null;pd=-1;md=-1;gd=-1;Vd=!0;Kd=-1;Xd=128;jd=128;decode(t,i){if(1===t){const t=i.au;this.Hu=new Uint16Array(t);for(let s=0;s=30&&t<40)this.sd||(this.sd=new o.ds(5,null)),this.sd[t-30]=i.wu,'hidden'===this.sd[t-30]?.toLowerCase()&&(this.sd[t-30]=null);else if(40===t){const t=i.au;this.Vu=new Uint16Array(t),this.Ku=new Uint16Array(t);for(let s=0;s{s.d(i,{A:()=>u});var e=s(6333),n=s(1069),h=s(2511),r=s(2679),o=s(8665),l=s(4583),a=s(8950),c=s(9298),f=s(3867);class u extends e.${static count=0;static cache=null;static ju=null;static zu=null;static Zu=0;static Qd=!0;static Lo=new r.A(50);static tw=new r.A(200);static ru=(t,i)=>{this.Qd=i,this.ju=new n.A(t.read('obj.dat'));const s=new n.A(t.read('obj.idx'));this.count=s.ou,this.zu=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.zu||!this.ju)throw new Error('ObjType not loaded!!!');for(let i=0;i<10;i++){const s=this.cache[i];if(s&&s.id===t)return s}this.Zu=(this.Zu+1)%10;const i=this.cache[this.Zu];return this.ju.af=this.zu[t],i.id=t,i.reset(),i.Ru(this.ju),-1!==i.iw&&i.sw(),!this.Qd&&i.members&&(i.name='Members Object',i.ed="Login to a members' server to use this object.",i.sd=null,i.ew=null),i};static To=()=>{this.Lo=null,this.tw=null,this.zu=null,this.cache=null,this.ju=null};static Ml=(t,i)=>{if(u.tw){let s=u.tw.get(BigInt(t));if(s&&s.nw!==i&&-1!==s.nw&&(s.hw(),s=null),s)return s}let s=u.get(t);if(s.rw||(i=-1),s.rw&&s.ow&&i>1){let t=-1;for(let e=0;e<10;e++)i>=s.ow[e]&&0!==s.ow[e]&&(t=s.rw[e]);-1!==t&&(s=u.get(t))}const e=new h.A(32,32),n=l.A.ha,r=l.A.ra,o=l.A.lw,f=a.A.aw,d=a.A.cw,w=a.A.fw,y=a.A.left,A=a.A.right,p=a.A.top,m=a.A.bottom;l.A.uw=!1,a.A.bind(e.aw,32,32),a.A.fillRect(0,0,32,32,c.A.Ul),l.A.Tc();const g=s.dw(1),_=l.A.sin[s.ww]*s.yw>>16,I=l.A.cos[s.ww]*s.yw>>16;g.ca(0,s.Aw,s.pw,s.ww,s.mw,_+(g.Pd/2|0)+s.gw,I+s.gw);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===e.aw[t+32*i]&&(t>0&&e.aw[t+32*i-1]>1||i>0&&e.aw[t+32*(i-1)]>1||t<31&&e.aw[t+32*i+1]>1||i<31&&e.aw[t+32*(i+1)]>1)&&(e.aw[t+32*i]=1);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===e.aw[t+32*i]&&t>0&&i>0&&e.aw[t+32*(i-1)-1]>0&&(e.aw[t+32*i]=3153952);if(-1!==s.iw){const t=this.Ml(s._w,10),i=t.Nl,e=t.nw;t.Nl=32,t.nw=32,t.Iw(5,5,22,22),t.Nl=i,t.nw=e}return u.tw?.put(BigInt(t),e),a.A.bind(f,d,w),a.A.Al(y,p,A,m),l.A.ha=n,l.A.ra=r,l.A.lw=o,l.A.uw=!0,s.da?e.Nl=33:e.Nl=32,e.nw=i,e};model=0;name=null;ed=null;Vu=null;Ku=null;yw=2e3;ww=0;Aw=0;pw=0;mw=0;gw=0;Cw=!1;Ew=-1;da=!1;bw=1;members=!1;sd=null;ew=null;Tw=-1;Ow=-1;Rw=0;Sw=-1;Lw=-1;xw=0;Mw=-1;kw=-1;Dw=-1;Fw=-1;Nw=-1;Bw=-1;rw=null;ow=null;_w=-1;iw=-1;decode(t,i){if(1===t)this.model=i.ou;else if(2===t)this.name=i.wu;else if(3===t)this.ed=i.wu;else if(4===t)this.yw=i.ou;else if(5===t)this.ww=i.ou;else if(6===t)this.Aw=i.ou;else if(7===t)this.mw=i.fu,this.mw>32767&&(this.mw-=65536);else if(8===t)this.gw=i.fu,this.gw>32767&&(this.gw-=65536);else if(9===t)this.Cw=!0;else if(10===t)this.Ew=i.ou;else if(11===t)this.da=!0;else if(12===t)this.bw=i.Ko;else if(16===t)this.members=!0;else if(23===t)this.Tw=i.ou,this.Rw=i.bd;else if(24===t)this.Ow=i.ou;else if(25===t)this.Sw=i.ou,this.xw=i.bd;else if(26===t)this.Lw=i.ou;else if(t>=30&&t<35)this.sd||(this.sd=new f.ds(5,null)),this.sd[t-30]=i.wu,'hidden'===this.sd[t-30]?.toLowerCase()&&(this.sd[t-30]=null);else if(t>=35&&t<40)this.ew||(this.ew=new f.ds(5,null)),this.ew[t-35]=i.wu;else if(40===t){const t=i.au;this.Vu=new Uint16Array(t),this.Ku=new Uint16Array(t);for(let s=0;s=100&&t<110&&(this.rw&&this.ow||(this.rw=new Uint16Array(10),this.ow=new Uint16Array(10)),this.rw[t-100]=i.ou,this.ow[t-100]=i.ou)}Pw(t){let i=this.Tw;if(1===t&&(i=this.Sw),-1===i)return null;let s=this.Ow,e=this.Mw;1===t&&(s=this.Lw,e=this.kw);let n=o.A.model(i);if(-1!==s){const t=o.A.model(s);if(-1===e){const i=[n,t];n=o.A.Ta(i,2)}else{const i=[n,t,o.A.model(e)];n=o.A.Ta(i,3)}}if(0===t&&0!==this.Rw&&n.translate(this.Rw,0,0),1===t&&0!==this.xw&&n.translate(this.xw,0,0),this.Vu&&this.Ku)for(let t=0;t1){let i=-1;for(let s=0;s<10;s++)t>=this.ow[s]&&0!==this.ow[s]&&(i=this.rw[s]);if(-1!==i)return u.get(i).dw(1)}if(u.Lo){const t=u.Lo.get(BigInt(this.id));if(t)return t}const i=o.A.model(this.model);if(this.Vu&&this.Ku)for(let t=0;t{s.d(i,{A:()=>r});var e=s(6333),n=s(1069),h=s(6730);class r extends e.${static count=0;static So=[];static ru=t=>{const i=new n.A(t.read('seq.dat'));this.count=i.ou;for(let t=0;t{s.d(i,{A:()=>l});var e=s(6333),n=s(1069),h=s(1312),r=s(8665),o=s(2679);class l extends e.${static count=0;static So=[];static Lo=new o.A(30);static ru=t=>{const i=new n.A(t.read('spotanim.dat'));this.count=i.ou;for(let t=0;t=40&&t<50)this.Vu[t-40]=i.ou;else{if(!(t>=50&&t<60))throw new Error(`Unrecognized spotanim config code: ${t}`);this.Ku[t-50]=i.ou}}la(){let t=l.Lo?.get(BigInt(this.id));if(t)return t;t=r.A.model(this.model);for(let i=0;i<6;i++)0!==this.Vu[0]&&t.Oa(this.Vu[i],this.Ku[i]);return l.Lo?.put(BigInt(this.id),t),t}}},3764:(t,i,s)=>{s.d(i,{A:()=>h});var e=s(6333),n=s(1069);class h extends e.${static count=0;static So=[];static Kw=[];static Xw=0;static ru=t=>{const i=new n.A(t.read('varp.dat'));this.count=i.ou;for(let t=0;t{s.d(i,{A:()=>e});class e{static OPEN=0;static $w=1;static Qw=2;static ty=4;static iy=8;static sy=e.$w<<4;static ey=e.Qw<<4;static ny=e.ty<<4;static hy=e.iy<<4;static oy=256;static ly=512;static uy=1024;static wy=2048;static yy=4096;static Ay=e.ly<<4;static py=e.uy<<4;static my=e.wy<<4;static gy=e.yy<<4;static _y=e.oy<<9;static Iy=524288;static Cy=2097152;static Ey=e.Cy|e.Iy;static vy=e.oy|e.Ey;static by=e.Qw|e.vy;static Ty=e.iy|e.vy;static Oy=e.Qw|e.ty|e.Ty;static Ry=e.ey|e.vy;static Sy=e.iy|e.sy|e.Ry;static Ly=e.hy|e.vy;static xy=e.$w|e.Qw|e.Ly;static My=e.ey|e.ny|e.Ly;static ky=16777215}},670:(t,i,s)=>{s.d(i,{A:()=>o});var e=s(9456),n=s(6169),h=s(1023),r=s(4909);class o{static kh=4;static Xh=104;static index=(t,i)=>t*o.Xh+i;offsetX;Dy;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.Dy=0,this.sizeX=o.Xh,this.sizeZ=o.Xh,this.flags=new Int32Array(this.sizeX*this.sizeZ),this.reset()}reset=()=>{for(let t=0;t{this.flags[o.index(t-this.offsetX,i-this.Dy)]|=e.A.Cy};Ny=(t,i)=>{this.flags[o.index(t-this.offsetX,i-this.Dy)]&=~e.A.Cy};By=(t,i,s,h,r,o)=>{let l=e.A.oy;o&&(l|=e.A._y);const a=t-this.offsetX,c=i-this.Dy;if(r===n.A.Py||r===n.A.Uy){const t=s;s=h,h=t}for(let t=a;t=0&&t=0&&i{let l=e.A.oy;o&&(l|=e.A._y);const a=t-this.offsetX,c=i-this.Dy;if(r===n.A.Py||r===n.A.Uy){const t=s;s=h,h=t}for(let t=a;t=0&&t=0&&i{const l=t-this.offsetX,a=i-this.Dy,c=o?e.A.gy:e.A.hy,f=o?e.A.yy:e.A.iy,u=o?e.A.uy:e.A.Qw,d=o?e.A.py:e.A.ey,w=o?e.A.ly:e.A.$w,y=o?e.A.Ay:e.A.sy,A=o?e.A.wy:e.A.ty,p=o?e.A.my:e.A.ny;s===h.A.Hy.id?r===n.A.kd?(this.add(l,a,c),this.add(l-1,a,f)):r===n.A.Py?(this.add(l,a,u),this.add(l,a+1,d)):r===n.A.Yy?(this.add(l,a,f),this.add(l+1,a,c)):r===n.A.Uy&&(this.add(l,a,d),this.add(l,a-1,u)):s===h.A.Vy.id||s===h.A.Ky.id?r===n.A.kd?(this.add(l,a,w),this.add(l-1,a+1,y)):r===n.A.Py?(this.add(l,a,A),this.add(l+1,a+1,p)):r===n.A.Yy?(this.add(l,a,y),this.add(l+1,a-1,w)):r===n.A.Uy&&(this.add(l,a,p),this.add(l-1,a-1,A)):s===h.A.Xy.id&&(r===n.A.kd?(this.add(l,a,u|c),this.add(l-1,a,f),this.add(l,a+1,d)):r===n.A.Py?(this.add(l,a,u|f),this.add(l,a+1,d),this.add(l+1,a,c)):r===n.A.Yy?(this.add(l,a,d|f),this.add(l+1,a,c),this.add(l,a-1,u)):r===n.A.Uy&&(this.add(l,a,d|c),this.add(l,a-1,u),this.add(l-1,a,f))),o&&this.Gy(t,i,s,r,!1)};jy=(t,i,s,r,o)=>{const l=t-this.offsetX,a=i-this.Dy,c=o?e.A.gy:e.A.hy,f=o?e.A.yy:e.A.iy,u=o?e.A.uy:e.A.Qw,d=o?e.A.py:e.A.ey,w=o?e.A.ly:e.A.$w,y=o?e.A.Ay:e.A.sy,A=o?e.A.wy:e.A.ty,p=o?e.A.my:e.A.ny;s===h.A.Hy.id?r===n.A.kd?(this.remove(l,a,c),this.remove(l-1,a,f)):r===n.A.Py?(this.remove(l,a,u),this.remove(l,a+1,d)):r===n.A.Yy?(this.remove(l,a,f),this.remove(l+1,a,c)):r===n.A.Uy&&(this.remove(l,a,d),this.remove(l,a-1,u)):s===h.A.Vy.id||s===h.A.Ky.id?r===n.A.kd?(this.remove(l,a,w),this.remove(l-1,a+1,y)):r===n.A.Py?(this.remove(l,a,A),this.remove(l+1,a+1,p)):r===n.A.Yy?(this.remove(l,a,y),this.remove(l+1,a-1,w)):r===n.A.Uy&&(this.remove(l,a,p),this.remove(l-1,a-1,A)):s===h.A.Xy.id&&(r===n.A.kd?(this.remove(l,a,u|c),this.remove(l-1,a,f),this.remove(l,a+1,d)):r===n.A.Py?(this.remove(l,a,u|f),this.remove(l,a+1,d),this.remove(l+1,a,c)):r===n.A.Yy?(this.remove(l,a,d|f),this.remove(l+1,a,c),this.remove(l,a-1,u)):r===n.A.Uy&&(this.remove(l,a,d|c),this.remove(l,a-1,u),this.remove(l-1,a,f))),o&&this.jy(t,i,s,r,!1)};zy=(t,i,s,r,l,a)=>{if(t===s&&i===r)return!0;const c=t-this.offsetX,f=i-this.Dy,u=s-this.offsetX,d=r-this.Dy,w=o.index(c,f);if(l===h.A.Hy.id){if(a===n.A.kd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&e.A.Ry)===e.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&e.A.by)===e.A.OPEN)return!0}else if(a===n.A.Py){if(c===u&&f===d+1)return!0;if(c===u-1&&f===d&&(this.flags[w]&e.A.Ty)===e.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&e.A.Ly)===e.A.OPEN)return!0}else if(a===n.A.Yy){if(c===u+1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&e.A.Ry)===e.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&e.A.by)===e.A.OPEN)return!0}else if(a===n.A.Uy){if(c===u&&f===d-1)return!0;if(c===u-1&&f===d&&(this.flags[w]&e.A.Ty)===e.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&e.A.Ly)===e.A.OPEN)return!0}}else if(l===h.A.Xy.id){if(a===n.A.kd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d&&(this.flags[w]&e.A.Ly)===e.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&e.A.by)===e.A.OPEN)return!0}else if(a===n.A.Py){if(c===u-1&&f===d&&(this.flags[w]&e.A.Ty)===e.A.OPEN)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1&&(this.flags[w]&e.A.by)===e.A.OPEN)return!0}else if(a===n.A.Yy){if(c===u-1&&f===d&&(this.flags[w]&e.A.Ty)===e.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&e.A.Ry)===e.A.OPEN)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1)return!0}else if(a===n.A.Uy){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&e.A.Ry)===e.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&e.A.Ly)===e.A.OPEN)return!0;if(c===u&&f===d-1)return!0}}else if(l===h.A.Zy.id){if(c===u&&f===d+1&&(this.flags[w]&e.A.ey)===e.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&e.A.Qw)===e.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&e.A.iy)===e.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&e.A.hy)===e.A.OPEN)return!0}return!1};qy=(t,i,s,r,l,a)=>{if(t===s&&i===r)return!0;const c=t-this.offsetX,f=i-this.Dy,u=s-this.offsetX,d=r-this.Dy,w=o.index(c,f);if(l===h.A.Jy.id||l===h.A.$y.id){if(l===h.A.$y.id&&(a=a+2&3),a===n.A.kd){if(c===u+1&&f===d&&(this.flags[w]&e.A.hy)===e.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&e.A.Qw)===e.A.OPEN)return!0}else if(a===n.A.Py){if(c===u-1&&f===d&&(this.flags[w]&e.A.iy)===e.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&e.A.Qw)===e.A.OPEN)return!0}else if(a===n.A.Yy){if(c===u-1&&f===d&&(this.flags[w]&e.A.iy)===e.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&e.A.ey)===e.A.OPEN)return!0}else if(a===n.A.Uy){if(c===u+1&&f===d&&(this.flags[w]&e.A.hy)===e.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&e.A.ey)===e.A.OPEN)return!0}}else if(l===h.A.Qy.id){if(c===u&&f===d+1&&(this.flags[w]&e.A.ey)===e.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&e.A.Qw)===e.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&e.A.iy)===e.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&e.A.hy)===e.A.OPEN)return!0}return!1};tA=(t,i,s,n,h,l,a)=>{const c=s+h-1,f=n+l-1,u=o.index(t-this.offsetX,i-this.Dy);return t>=s&&t<=c&&i>=n&&i<=f||(t===s-1&&i>=n&&i<=f&&(this.flags[u]&e.A.iy)===e.A.OPEN&&(a&r.A.kd)===e.A.OPEN||(t===c+1&&i>=n&&i<=f&&(this.flags[u]&e.A.hy)===e.A.OPEN&&(a&r.A.Yy)===e.A.OPEN||(i===n-1&&t>=s&&t<=c&&(this.flags[u]&e.A.Qw)===e.A.OPEN&&(a&r.A.Uy)===e.A.OPEN||i===f+1&&t>=s&&t<=c&&(this.flags[u]&e.A.ey)===e.A.OPEN&&(a&r.A.Py)===e.A.OPEN)))};add=(t,i,s)=>{this.flags[o.index(t,i)]|=s};remove=(t,i,s)=>{this.flags[o.index(t,i)]&=e.A.ky-s}}},4909:(t,i,s)=>{s.d(i,{A:()=>e});class e{static Py=1;static Yy=2;static Uy=4;static kd=8}},6169:(t,i,s)=>{s.d(i,{A:()=>e});class e{static kd=0;static Py=1;static Yy=2;static Uy=3}},5599:(t,i,s)=>{s.d(i,{A:()=>e});class e{static iA=0;static sA=1;static eA=2;static nA=3}},1023:(t,i,s)=>{s.d(i,{A:()=>n});var e=s(5599);class n{static Hy=new n(0,e.A.iA);static Vy=new n(1,e.A.iA);static Xy=new n(2,e.A.iA);static Ky=new n(3,e.A.iA);static hA=new n(4,e.A.sA);static rA=new n(5,e.A.sA);static Jy=new n(6,e.A.sA);static $y=new n(7,e.A.sA);static Qy=new n(8,e.A.sA);static Zy=new n(9,e.A.eA);static td=new n(10,e.A.eA);static oA=new n(11,e.A.eA);static lA=new n(12,e.A.eA);static aA=new n(13,e.A.eA);static cA=new n(14,e.A.eA);static fA=new n(15,e.A.eA);static uA=new n(16,e.A.eA);static dA=new n(17,e.A.eA);static wA=new n(18,e.A.eA);static yA=new n(19,e.A.eA);static AA=new n(20,e.A.eA);static pA=new n(21,e.A.eA);static nA=new n(22,e.A.nA);static values(){return[this.Hy,this.Vy,this.dA,this.fA,this.Xy,this.cA,this.Zy,this.Ky,this.nA,this.lA,this.oA,this.Jy,this.AA,this.td,this.rA,this.aA,this.$y,this.hA,this.uA,this.Qy,this.yA,this.pA,this.wA]}static of(t){const i=this.values();for(let s=0;s{s.d(i,{A:()=>A});var e=s(670),n=s(2164),h=s(1069),r=s(4583),o=s(3045),l=s(5637),a=s(4197),c=s(1312),f=s(1023),u=s(6169),d=s(9298),w=s(5518),y=s(3867);class A{static mA=Int8Array.of(1,2,4,8);static gA=Uint8Array.of(16,32,64,128);static _A=Int8Array.of(1,0,-1,0);static IA=Int8Array.of(0,-1,0,1);static CA=(17*Math.random()|0)-8;static EA=(33*Math.random()|0)-16;static st=!0;static vA=0;static bA=!1;static TA=(t,i)=>{let s=this.OA(t+45365,i+91923,4)+(this.OA(t+10294,i+37821,2)-128>>1)+(this.OA(t,i,1)-128>>2)-128;return s=35+(.3*s|0),s<10?s=10:s>60&&(s=60),s};static OA=(t,i,s)=>{const e=t/s|0,n=t&s-1,h=i/s|0,r=i&s-1,o=this.RA(e,h),l=this.RA(e+1,h),a=this.RA(e,h+1),c=this.RA(e+1,h+1),f=this.SA(o,l,n,s),u=this.SA(a,c,n,s);return this.SA(f,u,r,s)};static SA=(t,i,s,e)=>{const n=65536-r.A.cos[1024*s/e|0]>>1;return(t*(65536-n)>>16)+(i*n>>16)};static RA=(t,i)=>((this.LA(t-1,i-1)+this.LA(t+1,i-1)+this.LA(t-1,i+1)+this.LA(t+1,i+1))/16|0)+((this.LA(t-1,i)+this.LA(t+1,i)+this.LA(t,i-1)+this.LA(t,i+1))/8|0)+(this.LA(t,i)/4|0);static LA=(t,i)=>{const s=t+57*i,e=BigInt(s<<13^s);return 255&Number((e*(e*e*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static By=(t,i,s,e,n,h,r,o,d,w,y)=>{const p=n[y][i][s],m=n[y][i+1][s],g=n[y][i+1][s+1],_=n[y][i][s+1],I=p+m+g+_>>2,C=l.A.get(o);let E=i+(s<<7)+(o<<14)+1073741824|0;C.active||(E+=-2147483648),E|=0;const v=(w<<6)+d<<24>>24;if(d===f.A.nA.id)e?.xA(C.la(f.A.nA.id,w,p,m,g,_,-1),t,i,s,I,E,v),C.nd&&C.active&&r?.Fy(i,s),-1!==C.al&&h.MA(new a.A(o,t,3,i,s,c.A.So[C.al],!0));else if(d===f.A.td.id||d===f.A.oA.id){const n=C.la(f.A.td.id,w,p,m,g,_,-1);if(n){let h,r,o=0;d===f.A.oA.id&&(o+=256),w===u.A.Py||w===u.A.Uy?(h=C.length,r=C.width):(h=C.width,r=C.length),e?.By(t,i,s,I,n,null,E,v,h,r,o)}C.nd&&r?.By(i,s,C.width,C.length,w,C.hd),-1!==C.al&&h.MA(new a.A(o,t,2,i,s,c.A.So[C.al],!0))}else if(d>=f.A.lA.id)e?.By(t,i,s,I,C.la(d,w,p,m,g,_,-1),null,E,v,1,1,0),C.nd&&r?.By(i,s,C.width,C.length,w,C.hd),-1!==C.al&&h.MA(new a.A(o,t,2,i,s,c.A.So[C.al],!0));else if(d===f.A.Hy.id)e?.Gy(t,i,s,I,A.mA[w],0,C.la(f.A.Hy.id,w,p,m,g,_,-1),null,E,v),C.nd&&r?.Gy(i,s,d,w,C.hd),-1!==C.al&&h.MA(new a.A(o,t,0,i,s,c.A.So[C.al],!0));else if(d===f.A.Vy.id)e?.Gy(t,i,s,I,A.gA[w],0,C.la(f.A.Vy.id,w,p,m,g,_,-1),null,E,v),C.nd&&r?.Gy(i,s,d,w,C.hd),-1!==C.al&&h.MA(new a.A(o,t,0,i,s,c.A.So[C.al],!0));else if(d===f.A.Xy.id){const n=w+1&3;e?.Gy(t,i,s,I,A.mA[w],A.mA[n],C.la(f.A.Xy.id,w+4,p,m,g,_,-1),C.la(f.A.Xy.id,n,p,m,g,_,-1),E,v),C.nd&&r?.Gy(i,s,d,w,C.hd),-1!==C.al&&h.MA(new a.A(o,t,0,i,s,c.A.So[C.al],!0))}else if(d===f.A.Ky.id)e?.Gy(t,i,s,I,A.gA[w],0,C.la(f.A.Ky.id,w,p,m,g,_,-1),null,E,v),C.nd&&r?.Gy(i,s,d,w,C.hd),-1!==C.al&&h.MA(new a.A(o,t,0,i,s,c.A.So[C.al],!0));else if(d===f.A.Zy.id)e?.By(t,i,s,I,C.la(d,w,p,m,g,_,-1),null,E,v,1,1,0),C.nd&&r?.By(i,s,C.width,C.length,w,C.hd),-1!==C.al&&h.MA(new a.A(o,t,2,i,s,c.A.So[C.al],!0));else if(d===f.A.hA.id)e?.kA(t,i,s,I,0,0,E,C.la(f.A.hA.id,u.A.kd,p,m,g,_,-1),v,512*w,A.mA[w]),-1!==C.al&&h.MA(new a.A(o,t,1,i,s,c.A.So[C.al],!0));else if(d===f.A.rA.id){let n=16;if(e){const h=e.DA(t,i,s);h>0&&(n=l.A.get(h>>14&32767).ad)}e?.kA(t,i,s,I,A._A[w]*n,A.IA[w]*n,E,C.la(f.A.hA.id,u.A.kd,p,m,g,_,-1),v,512*w,A.mA[w]),-1!==C.al&&h.MA(new a.A(o,t,1,i,s,c.A.So[C.al],!0))}else d===f.A.Jy.id?(e?.kA(t,i,s,I,0,0,E,C.la(f.A.hA.id,u.A.kd,p,m,g,_,-1),v,w,256),-1!==C.al&&h.MA(new a.A(o,t,1,i,s,c.A.So[C.al],!0))):d===f.A.$y.id?(e?.kA(t,i,s,I,0,0,E,C.la(f.A.hA.id,u.A.kd,p,m,g,_,-1),v,w,512),-1!==C.al&&h.MA(new a.A(o,t,1,i,s,c.A.So[C.al],!0))):d===f.A.Qy.id&&(e?.kA(t,i,s,I,0,0,E,C.la(f.A.hA.id,u.A.kd,p,m,g,_,-1),v,w,768),-1!==C.al&&h.MA(new a.A(o,t,1,i,s,c.A.So[C.al],!0)))};FA;NA;Hh;Yh;BA;PA;UA;WA;GA;HA;YA;VA;KA;XA;jA;zA;constructor(t,i,s,n){this.FA=t,this.NA=i,this.Hh=s,this.Yh=n,this.BA=new y.ZA(e.A.kh,t,i),this.PA=new y.ZA(e.A.kh,t,i),this.UA=new y.ZA(e.A.kh,t,i),this.WA=new y.ZA(e.A.kh,t,i),this.zA=new y.qA(e.A.kh,t+1,i+1),this.GA=new y.ZA(e.A.kh,t+1,i+1),this.HA=new y.Kh(t+1,i+1),this.YA=new Int32Array(i),this.VA=new Int32Array(i),this.KA=new Int32Array(i),this.XA=new Int32Array(i),this.jA=new Int32Array(i)}JA=(t,i)=>{for(let t=0;t=0&&i[e]?.Fy(s,n)}A.CA+=(5*Math.random()|0)-2,A.CA<-8?A.CA=-8:A.CA>8&&(A.CA=8),A.EA+=(5*Math.random()|0)-2,A.EA<-16?A.EA=-16:A.EA>16&&(A.EA=16);for(let i=0;i>8;for(let t=1;t>2)+(s[n+1][t]>>3)+(s[n][t-1]>>2)+(s[n][t+1]>>3)+(s[n][t]>>1);this.HA[n][t]=u-d}for(let t=0;t=0&&e0){const i=n.A.So[s-1];this.YA[t]+=i.Uu,this.VA[t]+=i.Nu,this.KA[t]+=i.Bu,this.XA[t]+=i.Pu,h=this.jA[t]++}}const r=s-5;if(r>=0&&r0){const i=n.A.So[s-1];this.YA[t]-=i.Uu,this.VA[t]-=i.Nu,this.KA[t]-=i.Bu,this.XA[t]-=i.Pu,h=this.jA[t]--}}}if(s>=1&&s=0&&f=0&&y=1&&c0||y>0){const p=this.Hh[i][s][c],m=this.Hh[i][s+1][c],g=this.Hh[i][s+1][c+1],_=this.Hh[i][s][c+1],I=this.HA[s][c],C=this.HA[s+1][c],E=this.HA[s+1][c+1],v=this.HA[s][c+1];let b=-1,T=-1;if(f>0){const t=256*e/l|0,i=h/a|0;let s=o/a|0;b=n.A.Su(t,i,s);const r=t+A.CA&255;s+=A.EA,s<0?s=0:s>255&&(s=255),T=n.A.Su(r,i,s)}if(i>0){let t=0!==f||this.UA[i][s][c]===w.A.QA;y>0&&!n.A.So[y-1].Du&&(t=!1),t&&p===m&&p===g&&p===_&&(this.zA[i][s][c]|=2340)}let O=0;if(-1!==b&&(O=r.A.palette[n.A.Lu(T,96)]),0===y)t?.tp(i,s,c,w.A.QA,u.A.kd,-1,p,m,g,_,n.A.Lu(b,I),n.A.Lu(b,C),n.A.Lu(b,E),n.A.Lu(b,v),d.A.Ul,d.A.Ul,d.A.Ul,d.A.Ul,O,d.A.Ul);else{const e=this.UA[i][s][c]+1,h=this.WA[i][s][c],o=n.A.So[y-1];let l,a,f=o.texture;f>=0?(a=r.A.ip(f),l=-1):o.Mu===d.A.sp?(a=0,l=-2,f=-1):(l=n.A.Su(o.Fu,o.Nu,o.Bu),a=r.A.palette[n.A.xu(o.Wu,96)]),t?.tp(i,s,c,e,h,f,p,m,g,_,n.A.Lu(b,I),n.A.Lu(b,C),n.A.Lu(b,E),n.A.Lu(b,v),n.A.xu(l,I),n.A.xu(l,C),n.A.xu(l,E),n.A.xu(l,v),O,a)}}}}}}for(let s=1;s0&&(t<<=3,i<<=3,s<<=3);for(let e=0;e<=n;e++)for(let h=0;h<=this.NA;h++)for(let r=0;r<=this.FA;r++){if(this.zA[e][r][h]&t){let i=h,s=h,l=e,a=e;for(;i>0&&this.zA[e][r][i-1]&t;)i--;for(;s0;){for(let e=i;e<=s;e++)if(!(this.zA[l-1][r][e]&t))break t;l--}t:for(;a=8){const e=this.Hh[a][r][i]-240,h=this.Hh[l][r][i];o.A.rp(n,1,128*r,e,128*i,128*r,h,128*s+128);for(let e=l;e<=a;e++)for(let n=i;n<=s;n++)this.zA[e][r][n]&=~t}}if(this.zA[e][r][h]&i){let t=r,s=r,l=e,a=e;for(;t>0&&this.zA[e][t-1][h]&i;)t--;for(;s0;){for(let e=t;e<=s;e++)if(!(this.zA[l-1][e][h]&i))break t;l--}t:for(;a=8){const e=this.Hh[a][t][h]-240,r=this.Hh[l][t][h];o.A.rp(n,2,128*t,e,128*h,128*s+128,r,128*h);for(let e=l;e<=a;e++)for(let n=t;n<=s;n++)this.zA[e][n][h]&=~i}}if(this.zA[e][r][h]&s){let t=r,i=r,l=h,a=h;for(;l>0&&this.zA[e][r][l-1]&s;)l--;for(;a0;){for(let i=l;i<=a;i++)if(!(this.zA[e][t-1][i]&s))break t;t--}t:for(;i=4){const h=this.Hh[e][t][l];o.A.rp(n,4,128*t,h,128*l,128*i+128,h,128*a+128);for(let n=t;n<=i;n++)for(let t=l;t<=a;t++)this.zA[e][n][t]&=~s}}}}}};op=(t,i,s,h)=>{let r=0;for(let t=0;t>24;break}for(let n=t;n=0&&t=0&&n{const o=new h.A(new Uint8Array(r));for(let h=0;h=0&&a=0&&c>24,this.WA[h][a][c]=(f-2&3)<<24>>24):f<=81?this.Yh[h][a][c]=f-49<<24>>24:this.BA[h][a][c]=f-81<<24>>24}else for(;f=o.au,0!==f;){if(1===f){o.au;break}f<=49&&o.au}}};ap=(t,i,s,n,r,o)=>{const l=new h.A(new Uint8Array(n));let a=-1;for(;;){const n=l.cp;if(0===n)return;a+=n;let h=0;for(;;){const n=l.cp;if(0===n)break;h+=n-1;const c=63&h,f=h>>6&63,u=h>>12,d=l.au,w=d>>2,y=3&d,A=f+r,p=c+o;if(A>0&&p>0&&A=0&&(n=s[e]),this.By(u,A,p,t,i,n,a,w,y)}}}};By=(t,i,s,e,n,h,r,o,d)=>{if(A.st){if(16&this.Yh[t][i][s])return;if(this.$A(t,i,s)!==A.vA)return}const w=this.Hh[t][i][s],y=this.Hh[t][i+1][s],p=this.Hh[t][i+1][s+1],m=this.Hh[t][i][s+1],g=w+y+p+m>>2,_=l.A.get(r);let I=i+(s<<7)+(r<<14)+1073741824|0;_.active||(I+=-2147483648),I|=0;const C=(d<<6)+o<<24>>24;if(o===f.A.nA.id)(!A.st||_.active||_.vd)&&(e?.xA(_.la(f.A.nA.id,d,w,y,p,m,-1),t,i,s,g,I,C),_.nd&&_.active&&h?.Fy(i,s),-1!==_.al&&n.MA(new a.A(r,t,3,i,s,c.A.So[_.al],!0)));else if(o===f.A.td.id||o===f.A.oA.id){const l=_.la(f.A.td.id,d,w,y,p,m,-1);if(l){let n,h,r=0;if(o===f.A.oA.id&&(r+=256),d===u.A.Py||d===u.A.Uy?(n=_.length,h=_.width):(n=_.width,h=_.length),e?.By(t,i,s,g,l,null,I,C,n,h,r)&&_.Ad)for(let e=0;e<=n;e++)for(let n=0;n<=h;n++){let h=l.fp/4|0;h>30&&(h=30),h>this.GA[t][i+e][s+n]&&(this.GA[t][i+e][s+n]=h<<24>>24)}}_.nd&&h?.By(i,s,_.width,_.length,d,_.hd),-1!==_.al&&n.MA(new a.A(r,t,2,i,s,c.A.So[_.al],!0))}else if(o>=f.A.lA.id)e?.By(t,i,s,g,_.la(o,d,w,y,p,m,-1),null,I,C,1,1,0),o>=f.A.lA.id&&o<=f.A.dA.id&&o!==f.A.aA.id&&t>0&&(this.zA[t][i][s]|=2340),_.nd&&h?.By(i,s,_.width,_.length,d,_.hd),-1!==_.al&&n.MA(new a.A(r,t,2,i,s,c.A.So[_.al],!0));else if(o===f.A.Hy.id)e?.Gy(t,i,s,g,A.mA[d],0,_.la(f.A.Hy.id,d,w,y,p,m,-1),null,I,C),d===u.A.kd?(_.Ad&&(this.GA[t][i][s]=50,this.GA[t][i][s+1]=50),_.Du&&(this.zA[t][i][s]|=585)):d===u.A.Py?(_.Ad&&(this.GA[t][i][s+1]=50,this.GA[t][i+1][s+1]=50),_.Du&&(this.zA[t][i][s+1]|=1170)):d===u.A.Yy?(_.Ad&&(this.GA[t][i+1][s]=50,this.GA[t][i+1][s+1]=50),_.Du&&(this.zA[t][i+1][s]|=585)):d===u.A.Uy&&(_.Ad&&(this.GA[t][i][s]=50,this.GA[t][i+1][s]=50),_.Du&&(this.zA[t][i][s]|=1170)),_.nd&&h?.Gy(i,s,o,d,_.hd),-1!==_.al&&n.MA(new a.A(r,t,0,i,s,c.A.So[_.al],!0)),16!==_.ad&&e?.up(t,i,s,_.ad);else if(o===f.A.Vy.id)e?.Gy(t,i,s,g,A.gA[d],0,_.la(f.A.Vy.id,d,w,y,p,m,-1),null,I,C),_.Ad&&(d===u.A.kd?this.GA[t][i][s+1]=50:d===u.A.Py?this.GA[t][i+1][s+1]=50:d===u.A.Yy?this.GA[t][i+1][s]=50:d===u.A.Uy&&(this.GA[t][i][s]=50)),_.nd&&h?.Gy(i,s,o,d,_.hd),-1!==_.al&&n.MA(new a.A(r,t,0,i,s,c.A.So[_.al],!0));else if(o===f.A.Xy.id){const l=d+1&3;e?.Gy(t,i,s,g,A.mA[d],A.mA[l],_.la(f.A.Xy.id,d+4,w,y,p,m,-1),_.la(f.A.Xy.id,l,w,y,p,m,-1),I,C),_.Du&&(d===u.A.kd?(this.zA[t][i][s]|=265,this.zA[t][i][s+1]|=1170):d===u.A.Py?(this.zA[t][i][s+1]|=1170,this.zA[t][i+1][s]|=585):d===u.A.Yy?(this.zA[t][i+1][s]|=585,this.zA[t][i][s]|=1170):d===u.A.Uy&&(this.zA[t][i][s]|=1170,this.zA[t][i][s]|=585)),_.nd&&h?.Gy(i,s,o,d,_.hd),-1!==_.al&&n.MA(new a.A(r,t,0,i,s,c.A.So[_.al],!0)),16!==_.ad&&e?.up(t,i,s,_.ad)}else if(o===f.A.Ky.id)e?.Gy(t,i,s,g,A.gA[d],0,_.la(f.A.Ky.id,d,w,y,p,m,-1),null,I,C),_.Ad&&(d===u.A.kd?this.GA[t][i][s+1]=50:d===u.A.Py?this.GA[t][i+1][s+1]=50:d===u.A.Yy?this.GA[t][i+1][s]=50:d===u.A.Uy&&(this.GA[t][i][s]=50)),_.nd&&h?.Gy(i,s,o,d,_.hd),-1!==_.al&&n.MA(new a.A(r,t,0,i,s,c.A.So[_.al],!0));else if(o===f.A.Zy.id)e?.By(t,i,s,g,_.la(o,d,w,y,p,m,-1),null,I,C,1,1,0),_.nd&&h?.By(i,s,_.width,_.length,d,_.hd),-1!==_.al&&n.MA(new a.A(r,t,2,i,s,c.A.So[_.al],!0));else if(o===f.A.hA.id)e?.kA(t,i,s,g,0,0,I,_.la(f.A.hA.id,u.A.kd,w,y,p,m,-1),C,512*d,A.mA[d]),-1!==_.al&&n.MA(new a.A(r,t,1,i,s,c.A.So[_.al],!0));else if(o===f.A.rA.id){let h=16;if(e){const n=e.DA(t,i,s);n>0&&(h=l.A.get(n>>14&32767).ad)}e?.kA(t,i,s,g,A._A[d]*h,A.IA[d]*h,I,_.la(f.A.hA.id,u.A.kd,w,y,p,m,-1),C,512*d,A.mA[d]),-1!==_.al&&n.MA(new a.A(r,t,1,i,s,c.A.So[_.al],!0))}else o===f.A.Jy.id?(e?.kA(t,i,s,g,0,0,I,_.la(f.A.hA.id,u.A.kd,w,y,p,m,-1),C,d,256),-1!==_.al&&n.MA(new a.A(r,t,1,i,s,c.A.So[_.al],!0))):o===f.A.$y.id?(e?.kA(t,i,s,g,0,0,I,_.la(f.A.hA.id,u.A.kd,w,y,p,m,-1),C,d,512),-1!==_.al&&n.MA(new a.A(r,t,1,i,s,c.A.So[_.al],!0))):o===f.A.Qy.id&&(e?.kA(t,i,s,g,0,0,I,_.la(f.A.hA.id,u.A.kd,w,y,p,m,-1),C,d,768),-1!==_.al&&n.MA(new a.A(r,t,1,i,s,c.A.So[_.al],!0)))};$A=(t,i,s)=>8&this.Yh[t][i][s]?0:t<=0||!(2&this.Yh[1][i][s])?t:t-1}},3045:(t,i,s)=>{s.d(i,{A:()=>g});var e=s(4583),n=s(1161),h=s(3795),r=s(8256),o=s(670),l=s(9222),a=s(6855),c=s(7441),f=s(6666),u=s(5748),d=s(3479),w=s(8950),y=s(2771),A=s(5518),p=s(6169),m=s(3867);class g{static dp=new m.wp(8,32,51,51,!1);static yp=new m.ds(100,null);static Ap=new Int32Array(o.A.kh);static pp=new m.mp(o.A.kh,500,null);static gp=new m.ds(500,null);static _p=new f.A;static Ip=0;static Cp=0;static Ep=0;static vp=0;static bp=0;static Tp=0;static Op=0;static Rp=0;static Sp=0;static Lp=0;static xp=0;static Mp=0;static kp=0;static Dp=0;static Fp=0;static Np=0;static Bp=0;static Pp=0;static Up=0;static Wp=0;static Gp=0;static Hp=0;static Yp=!1;static Vp=null;static Kp=Uint8Array.of(19,55,38,155,255,110,137,205,76);static Xp=Uint8Array.of(160,192,80,96,0,144,80,48,160);static jp=Uint8Array.of(76,8,137,4,0,1,38,2,19);static zp=Int8Array.of(0,0,2,0,0,2,1,1,0);static Zp=Int8Array.of(2,0,0,2,0,0,0,4,4);static qp=Int8Array.of(0,4,4,8,0,0,8,0,0);static Jp=Int8Array.of(1,1,0,0,0,8,0,0,8);static $p=Int8Array.of(53,-53,-53,53);static Qp=Int8Array.of(-53,-53,53,53);static tm=Int8Array.of(-45,45,45,-45);static im=Int8Array.of(45,45,-45,-45);static sm=[new Int8Array(16),Int8Array.of(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,0,0,0,1,1,0,0,1,1,1,0,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1),Int8Array.of(0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0),Int8Array.of(0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0),Int8Array.of(1,1,1,1,1,1,1,1,0,1,1,1,0,0,1,1),Int8Array.of(1,1,1,1,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,0,0,0,0,1,1,0,1,1,1,0,1,1,1),Int8Array.of(0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1)];static nm=[Int8Array.of(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),Int8Array.of(12,8,4,0,13,9,5,1,14,10,6,2,15,11,7,3),Int8Array.of(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0),Int8Array.of(3,7,11,15,2,6,10,14,1,5,9,13,0,4,8,12)];static hm=Int32Array.of(41,39248,41,4643,41,41,41,41,41,41,41,41,41,41,41,43086,41,41,41,41,41,41,41,8602,41,28992,41,41,41,41,41,5056,41,41,41,41,41,41,41,41,41,41,41,41,41,41,3131,41,41,41);static rm=0;static kl=0;static Dl=0;static om=-1;static lm=-1;static st=!0;static init=(t,i,s,n,h)=>{this.Cp=0,this.Ep=0,this.vp=t,this.bp=i,this.Tp=t/2|0,this.Op=i/2|0;const r=new m.wp(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let i=0;i<2048;i+=64){this.Rp=e.A.sin[t],this.Sp=e.A.cos[t],this.Lp=e.A.sin[i],this.xp=e.A.cos[i];const o=(t-128)/32|0,l=i/64|0;for(let t=-26;t<=26;t++)for(let i=-26;i<=26;i++){const e=128*t,a=128*i;let c=!1;for(let t=-s;t<=n;t+=128)if(this.am(e,a,h[o]+t)){c=!0;break}r[o][l][t+25+1][i+25+1]=c}}for(let t=0;t<8;t++)for(let i=0;i<32;i++)for(let s=-25;s<25;s++)for(let e=-25;e<25;e++){let n=!1;t:for(let h=-1;h<=1;h++)for(let o=-1;o<=1;o++){if(r[t][i][s+h+25+1][e+o+25+1]){n=!0;break t}if(r[t][(i+1)%31][s+h+25+1][e+o+25+1]){n=!0;break t}if(r[t+1][i][s+h+25+1][e+o+25+1]){n=!0;break t}if(r[t+1][(i+1)%31][s+h+25+1][e+o+25+1]){n=!0;break t}}this.dp[t][i][s+25][e+25]=n}};static To=()=>{this.yp=null,this.Ap=null,this.pp=null,this._p=null,this.dp=null,this.gp=null,this.Vp=null,console.log('World3D unloaded!')};static rp=(t,i,s,e,n,h,o,l)=>{g.pp[t][g.Ap[t]++]=new r.A(s/128|0,h/128|0,n/128|0,l/128|0,i,s,h,n,l,e,o)};static am=(t,i,s)=>{const e=i*this.Lp+t*this.xp>>16,n=i*this.xp-t*this.Lp>>16,h=s*this.Rp+n*this.Sp>>16,r=s*this.Sp-n*this.Rp>>16;if(h<50||h>3500)return!1;const o=this.Tp+((e<<9)/h|0),l=this.Op+((r<<9)/h|0);return o>=this.Cp&&o<=this.vp&&l>=this.Ep&&l<=this.bp};fm;FA;NA;um;dm;Ir;wm;ym;Am;pm=0;gm=0;_m=0;constructor(t,i,s,e){this.fm=s,this.FA=e,this.NA=i,this.dm=new m.Er(s,e,i,null),this.wm=new m.qA(s,e+1,i+1),this.um=t,this.Ir=new m.ds(5e3,null),this.ym=new Int32Array(1e4),this.Am=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this.gm=t;for(let i=0;i{const s=this.dm[0][t][i];for(let s=0;s<3;s++){this.dm[s][t][i]=this.dm[s+1][t][i];const e=this.dm[s][t][i];e&&e.level--}this.dm[0][t][i]||(this.dm[0][t][i]=new h.A(0,t,i));const e=this.dm[0][t][i];e&&(e.Cm=s),this.dm[3][t][i]=null};ep=(t,i,s,e)=>{const n=this.dm[t][i][s];n&&(n.Em=e)};tp=(t,i,s,e,n,r,o,l,a,c,f,u,w,p,m,g,_,I,C,E)=>{if(e===A.A.QA){for(let e=t;e>=0;e--)this.dm[e][i][s]||(this.dm[e][i][s]=new h.A(e,i,s));const e=this.dm[t][i][s];e&&(e.vm=new d.A(f,u,w,p,-1,C,!1))}else if(e===A.A.bm){for(let e=t;e>=0;e--)this.dm[e][i][s]||(this.dm[e][i][s]=new h.A(e,i,s));const e=this.dm[t][i][s];e&&(e.vm=new d.A(m,g,_,I,r,E,o===l&&o===a&&o===c))}else{for(let e=t;e>=0;e--)this.dm[e][i][s]||(this.dm[e][i][s]=new h.A(e,i,s));const d=this.dm[t][i][s];d&&(d.Tm=new y.A(i,e,g,l,w,n,f,c,E,m,r,I,C,a,_,p,o,s,u))}};xA=(t,i,s,e,n,r,o)=>{this.dm[i][s][e]||(this.dm[i][s][e]=new h.A(i,s,e));const a=this.dm[i][s][e];a&&(a.Om=new l.A(n,128*s+64,128*e+64,t,r,o))};Rm=(t,i,s)=>{const e=this.dm[t][i][s];e&&(e.Om=null)};Sm=(t,i,s,e,n,r,o,l)=>{let a=0;const c=this.dm[e][t][i];if(c)for(let t=0;ta&&(a=s)}else this.dm[e][t][i]=new h.A(e,t,i);const f=this.dm[e][t][i];f&&(f.Mm=new u.A(s,128*t+64,128*i+64,r,o,l,n,a))};km=(t,i,s)=>{const e=this.dm[t][i][s];e&&(e.Mm=null)};Gy=(t,i,s,e,n,r,o,l,c,f)=>{if(!o&&!l)return;for(let e=t;e>=0;e--)this.dm[e][i][s]||(this.dm[e][i][s]=new h.A(e,i,s));const u=this.dm[t][i][s];u&&(u.Dm=new a.A(e,128*i+64,128*s+64,n,r,o,l,c,f))};jy=(t,i,s,e)=>{const n=this.dm[t][i][s];1===e&&n&&(n.Dm=null)};kA=(t,i,s,e,n,r,o,l,a,f,u)=>{if(!l)return;for(let e=t;e>=0;e--)this.dm[e][i][s]||(this.dm[e][i][s]=new h.A(e,i,s));const d=this.dm[t][i][s];d&&(d.Fm=new c.A(e,128*i+n+64,128*s+r+64,u,f,l,o,a))};Nm=(t,i,s)=>{const e=this.dm[t][i][s];e&&(e.Fm=null)};up=(t,i,s,e)=>{const n=this.dm[t][i][s];if(!n)return;const h=n.Fm;if(!h)return;const r=128*i+64,o=128*s+64;h.x=r+((h.x-r)*e/16|0),h.z=o+((h.z-o)*e/16|0)};Bm=(t,i,s,e)=>{if(!e)return;const n=this.dm[t][i][s];if(!n)return;const h=n.Fm;h&&(h.model=e)};Pm=(t,i,s,e)=>{if(!e)return;const n=this.dm[t][i][s];if(!n)return;const h=n.Om;h&&(h.model=e)};Um=(t,i,s,e)=>{if(!e)return;const n=this.dm[t][i][s];if(!n)return;const h=n.Dm;h&&(h.Wm=e)};Gm=(t,i,s,e,n)=>{if(!e)return;const h=this.dm[s][t][i];if(!h)return;const r=h.Dm;r&&(r.Wm=e,r.Hm=n)};By=(t,i,s,e,n,h,r,o,l,a,c)=>{if(!n&&!h)return!0;const f=128*i+64*l,u=128*s+64*a;return this.Ym(f,u,e,t,i,s,l,a,n,h,r,o,c,!1)};Vm=(t,i,s,e,n,h,r,o,l,a)=>{if(!n&&!h)return!0;let c=i-l,f=e-l,u=i+l,d=e+l;return a&&(o>640&&o<1408&&(d+=128),o>1152&&o<1920&&(u+=128),(o>1664||o<384)&&(f-=128),o>128&&o<896&&(c-=128)),c=c/128|0,f=f/128|0,u=u/128|0,d=d/128|0,this.Ym(i,e,s,t,c,f,u+1-c,d-f+1,n,h,r,0,o,!0)};Km=(t,i,s,e,n,h,r,o,l,a,c,f)=>!l&&!a||this.Ym(i,e,s,t,n,h,r+1-n,o-h+1,l,a,c,0,f,!0);Wy=(t,i,s)=>{const e=this.dm[t][i][s];if(e)for(let t=0;t>29&3)&&n.jm===i&&n.zm===s)return void this.Zm(n)}};qm=(t,i,s,e)=>{if(!e)return;const n=this.dm[t][i][s];if(n)for(let t=0;t>29&3))return void(i.model=e)}};Jm=()=>{for(let t=0;t{const e=this.dm[t][i][s];return e&&e.Dm?e.Dm.Xm:0};$m=(t,i,s)=>{const e=this.dm[t][s][i];return e&&e.Fm?e.Fm.Xm:0};Qm=(t,i,s)=>{const e=this.dm[t][i][s];if(!e)return 0;for(let t=0;t>29&3)&&n.jm===i&&n.zm===s)return n.Xm}return 0};tg=(t,i,s)=>{const e=this.dm[t][i][s];return e&&e.Om?e.Om.Xm:0};ig=(t,i,s,e)=>{const n=this.dm[t][i][s];if(n){if(n.Dm&&n.Dm.Xm===e)return 255&n.Dm.info;if(n.Fm&&n.Fm.Xm===e)return 255&n.Fm.info;if(n.Om&&n.Om.Xm===e)return 255&n.Om.info;for(let t=0;t{const h=i*(0|Math.sqrt(s*s+e*e+n*n))>>8;for(let i=0;i{if(i0){const n=this.dm[t][i+1][s-1];n&&n.Om&&n.Om.model&&n.Om.model.sg&&this.ng(e,n.Om.model,128,0,-128,!0)}};eg=(t,i,s,e,n,h)=>{let r=!0,o=i;const l=i+e,a=s-1,c=s+n;for(let f=t;f<=t+1;f++)if(f!==this.fm){for(let u=o;u<=l;u++)if(!(u<0||u>=this.FA))for(let o=a;o<=c;o++){if(o<0||o>=this.NA||r&&u=s||u===i))continue;const a=this.dm[f][u][o];if(!a)continue;const d=128*(u-i)+64*(1-e),w=128*(o-s)+64*(1-n),y=((this.um[f][u][o]+this.um[f][u+1][o]+this.um[f][u][o+1]+this.um[f][u+1][o+1])/4|0)-((this.um[t][i][s]+this.um[t][i+1][s]+this.um[t][i][s+1]+this.um[t][i+1][s+1])/4|0),A=a.Dm;A&&A.Wm&&A.Wm.sg&&this.ng(h,A.Wm,d,y,w,r),A&&A.Hm&&A.Hm.sg&&this.ng(h,A.Hm,d,y,w,r);for(let t=0;t{this._m++;let r=0;const o=i.Rd,l=i.Od;if(t.sg&&t.ag)for(let h=0;hi.cg)continue;const u=t.Rd[h]-s;if(ui.ug)continue;const d=t.Sd[h]-n;if(di.wg)continue;if(i.sg&&i.ag)for(let t=0;t{const r=this.dm[t][i][s];if(!r)return;const o=r.vm;if(o){const t=o.color;if(0!==t)for(let i=0;i<4;i++)e[n]=t,e[n+1]=t,e[n+2]=t,e[n+3]=t,n+=h;return}const l=r.Tm;if(!l)return;const a=l.shape,c=l.angle,f=l.Ig,u=l.Cg,d=g.sm[a],w=g.nm[c];let y=0;if(0===f)for(let t=0;t<4;t++)0!==d[w[y++]]&&(e[n]=u),0!==d[w[y++]]&&(e[n+1]=u),0!==d[w[y++]]&&(e[n+2]=u),0!==d[w[y++]]&&(e[n+3]=u),n+=h;else for(let t=0;t<4;t++)e[n]=0===d[w[y++]]?f:u,e[n+1]=0===d[w[y++]]?f:u,e[n+2]=0===d[w[y++]]?f:u,e[n+3]=0===d[w[y++]]?f:u,n+=h};click=(t,i)=>{g.Yp=!0,g.kl=t,g.Dl=i,g.om=-1,g.lm=-1};draw=(t,i,s,n,h,r,o)=>{t<0?t=0:t>=128*this.FA&&(t=128*this.FA-1),s<0?s=0:s>=128*this.NA&&(s=128*this.NA-1),g.Ip++,g.Rp=e.A.sin[r],g.Sp=e.A.cos[r],g.Lp=e.A.sin[h],g.xp=e.A.cos[h],g.Vp=g.dp[(r-128)/32|0][h/64|0],g.Mp=t,g.kp=i,g.Dp=s,g.Fp=t/128|0,g.Np=s/128|0,g.Gp=n,g.Bp=g.Fp-25,g.Bp<0&&(g.Bp=0),g.Up=g.Np-25,g.Up<0&&(g.Up=0),g.Pp=g.Fp+25,g.Pp>this.FA&&(g.Pp=this.FA),g.Wp=g.Np+25,g.Wp>this.NA&&(g.Wp=this.NA),this.Eg(),g.Hp=0;for(let t=this.gm;t=2e3)?(r.visible=!0,r.update=!0,r.vg=r.Lm>0,g.Hp++):(r.visible=!1,r.update=!1,r.bg=0))}}for(let t=this.gm;t=g.Pp))for(let t=-25;t<=0;t++){const n=g.Np+t,h=g.Np-t;let r;if(s>=g.Bp&&(n>=g.Up&&(r=i[s][n],r&&r.visible&&this.Tg(r,!0,o)),h=g.Up&&(r=i[e][n],r&&r.visible&&this.Tg(r,!0,o)),h=g.Pp))for(let t=-25;t<=0;t++){const n=g.Np+t,h=g.Np-t;let r;if(s>=g.Bp&&(n>=g.Up&&(r=i[s][n],r&&r.visible&&this.Tg(r,!1,o)),h=g.Up&&(r=i[e][n],r&&r.visible&&this.Tg(r,!1,o)),h{if(!c&&!f)return!1;for(let t=r;t=this.FA||i>=this.NA)return!1;const s=this.dm[e][t][i];if(s&&s.Lm>=5)return!1}const A=new n.A(e,s,t,i,c,f,w,r,r+l-1,o,o+a-1,u,d);for(let t=r;tr&&(s|=1),to&&(s+=8),i=0;s--)this.dm[s][t][i]||(this.dm[s][t][i]=new h.A(s,t,i));const n=this.dm[e][t][i];n&&(n.xm[n.Lm]=A,n.Og[n.Lm]=s,n.Rg|=s,n.Lm++)}return y&&(this.Ir[this.pm++]=A),!0};Zm=t=>{for(let i=t.jm;i<=t.rg;i++)for(let s=t.zm;s<=t.og;s++){const e=this.dm[t.level][i][s];if(e){for(let i=0;i{const t=g.Ap[g.Gp],i=g.pp[g.Gp];g.rm=0;for(let s=0;s=0&&e<=50){n=t.Lg+25-g.Np,n<0&&(n=0),h=t.NA+25-g.Np,h>50&&(h=50);let i=!1;for(;n<=h;)if(g.Vp&&g.Vp[e][n++]){i=!0;break}if(i){if(r=g.Mp-t.fg,r>32)t.mode=1;else{if(r>=-32)continue;t.mode=2,r=-r}t.xg=(t.dg-g.Dp<<8)/r|0,t.Mg=(t.wg-g.Dp<<8)/r|0,t.kg=(t.cg-g.kp<<8)/r|0,t.Dg=(t.Pd-g.kp<<8)/r|0,g.gp[g.rm++]=t}}}else if(2===t.type){if(e=t.Lg+25-g.Np,e>=0&&e<=50){n=t.Sg+25-g.Fp,n<0&&(n=0),h=t.FA+25-g.Fp,h>50&&(h=50);let i=!1;for(;n<=h;)if(g.Vp&&g.Vp[n++][e]){i=!0;break}if(i){if(r=g.Dp-t.dg,r>32)t.mode=3;else{if(r>=-32)continue;t.mode=4,r=-r}t.Fg=(t.fg-g.Mp<<8)/r|0,t.Ng=(t.ug-g.Mp<<8)/r|0,t.kg=(t.cg-g.kp<<8)/r|0,t.Dg=(t.Pd-g.kp<<8)/r|0,g.gp[g.rm++]=t}}}else if(4===t.type&&(e=t.cg-g.kp,e>128&&(n=t.Lg+25-g.Np,n<0&&(n=0),h=t.NA+25-g.Np,h>50&&(h=50),n<=h))){let i=t.Sg+25-g.Fp;i<0&&(i=0),r=t.FA+25-g.Fp,r>50&&(r=50);let s=!1;t:for(let t=i;t<=r;t++)for(let i=n;i<=h;i++)if(g.Vp&&g.Vp[t][i]){s=!0;break t}s&&(t.mode=5,t.Fg=(t.fg-g.Mp<<8)/e|0,t.Ng=(t.ug-g.Mp<<8)/e|0,t.xg=(t.dg-g.Dp<<8)/e|0,t.Mg=(t.wg-g.Dp<<8)/e|0,g.gp[g.rm++]=t)}}};Tg=(t,i,s)=>{for(g._p.MA(t);;){let t;do{if(t=g._p.Bg(),!t)return}while(!t.update);const e=t.x,n=t.z,h=t.level,r=t.Pg,o=this.dm[h];if(t.visible){if(i){if(h>0){const t=this.dm[h-1][e][n];if(t&&t.update)continue}if(e<=g.Fp&&e>g.Bp){const i=o[e-1][n];if(i&&i.update&&(i.visible||!(1&t.Rg)))continue}if(e>=g.Fp&&eg.Up){const i=o[e][n-1];if(i&&i.update&&(i.visible||!(8&t.Rg)))continue}if(n>=g.Np&&nn&&(a+=6),c=g.Kp[a],t.Vg=g.jp[a]),f&&(f.Kg&g.Xp[a]?16===f.Kg?(t.bg=3,t.Xg=g.zp[a],t.jg=3-t.Xg):32===f.Kg?(t.bg=6,t.Xg=g.Zp[a],t.jg=6-t.Xg):64===f.Kg?(t.bg=12,t.Xg=g.qp[a],t.jg=12-t.Xg):(t.bg=9,t.Xg=g.Jp[a],t.jg=9-t.Xg):t.bg=0,f.Kg&c&&!this.zg(r,e,n,f.Kg)&&f.Wm?.draw(0,g.Rp,g.Sp,g.Lp,g.xp,f.x-g.Mp,f.y-g.kp,f.z-g.Dp,f.Xm),f.Zg&c&&!this.zg(r,e,n,f.Zg)&&f.Hm?.draw(0,g.Rp,g.Sp,g.Lp,g.xp,f.x-g.Mp,f.y-g.kp,f.z-g.Dp,f.Xm)),u&&!this.visible(r,e,n,u.model.Pd))if(u.type&c)u.model.draw(u.angle,g.Rp,g.Sp,g.Lp,g.xp,u.x-g.Mp,u.y-g.kp,u.z-g.Dp,u.Xm);else if(768&u.type){const t=u.x-g.Mp,i=u.y-g.kp,s=u.z-g.Dp,e=u.angle;let n,h;if(n=e===p.A.Py||e===p.A.Yy?-t:t,h=e===p.A.Yy||e===p.A.Uy?-s:s,256&u.type&&hn){const n=t+g.tm[e],h=s+g.im[e];u.model.draw(512*e+1280&2047,g.Rp,g.Sp,g.Lp,g.xp,n,i,h,u.Xm)}}if(l){const i=t.Om;i&&i.model?.draw(0,g.Rp,g.Sp,g.Lp,g.xp,i.x-g.Mp,i.y-g.kp,i.z-g.Dp,i.Xm);const s=t.Mm;s&&0===s.offset&&(s.qg&&s.qg.draw(0,g.Rp,g.Sp,g.Lp,g.xp,s.x-g.Mp,s.y-g.kp,s.z-g.Dp,s.Xm),s.Jg&&s.Jg.draw(0,g.Rp,g.Sp,g.Lp,g.xp,s.x-g.Mp,s.y-g.kp,s.z-g.Dp,s.Xm),s.$g&&s.$g.draw(0,g.Rp,g.Sp,g.Lp,g.xp,s.x-g.Mp,s.y-g.kp,s.z-g.Dp,s.Xm))}const d=t.Rg;if(0!==d){if(eg.Fp&&1&d){const t=o[e-1][n];t&&t.update&&g._p.MA(t)}if(n>g.Np&&8&d){const t=o[e][n-1];t&&t.update&&g._p.MA(t)}}}if(0!==t.bg){let i=!0;for(let s=0;si.jm&&(h+=1),si.zm&&(h+=8),ee&&(e=n);const r=g.Np-i.zm,l=i.og-g.Np;i.Qg=l>r?e+l:e+r}for(;;){let t=-50,i=-1;for(let s=0;st&&(t=e.Qg,i=s))}if(-1===i)break;const l=g.yp[i];if(l){l.Ip=g.Ip;let t=l.model;t||(t=l.Hg?.draw(s)??null),t&&!this.t_(r,l.jm,l.rg,l.zm,l.og,t.Pd)&&t.draw(l.Yg,g.Rp,g.Sp,g.Lp,g.xp,l.x-g.Mp,l.y-g.kp,l.z-g.Dp,l.Xm);for(let t=l.jm;t<=l.rg;t++)for(let i=l.zm;i<=l.og;i++){const s=o[t][i];s&&(0!==s.bg?g._p.MA(s):t===e&&i===n||!s.update||g._p.MA(s))}}}if(t.vg)continue}if(!t.update||0!==t.bg)continue;if(e<=g.Fp&&e>g.Bp){const t=o[e-1][n];if(t&&t.update)continue}if(e>=g.Fp&&eg.Up){const t=o[e][n-1];if(t&&t.update)continue}if(n>=g.Np&&n=h){const h=t+g.$p[n],r=e+g.Qp[n];i.model.draw(512*n+256,g.Rp,g.Sp,g.Lp,g.xp,h,s,r,i.Xm)}if(512&i.type&&r<=h){const h=t+g.tm[n],r=e+g.im[n];i.model.draw(512*n+1280&2047,g.Rp,g.Sp,g.Lp,g.xp,h,s,r,i.Xm)}}const s=t.Dm;s&&(s.Zg&t.Vg&&!this.zg(r,e,n,s.Zg)&&s.Hm?.draw(0,g.Rp,g.Sp,g.Lp,g.xp,s.x-g.Mp,s.y-g.kp,s.z-g.Dp,s.Xm),s.Kg&t.Vg&&!this.zg(r,e,n,s.Kg)&&s.Wm?.draw(0,g.Rp,g.Sp,g.Lp,g.xp,s.x-g.Mp,s.y-g.kp,s.z-g.Dp,s.Xm))}if(hg.Fp){const t=o[e-1][n];t&&t.update&&g._p.MA(t)}if(n>g.Np){const t=o[e][n-1];t&&t.update&&g._p.MA(t)}}};Wg=(t,i,s,n,h,r,o,l)=>{let a,c,f,u,d=a=(s<<7)-g.Mp,y=c=(n<<7)-g.Dp,A=f=d+128,p=u=y+128,m=this.um[i][s][n]-g.kp,_=this.um[i][s+1][n]-g.kp,I=this.um[i][s+1][n+1]-g.kp,C=this.um[i][s][n+1]-g.kp,E=y*o+d*l>>16;if(y=y*l-d*o>>16,d=E,E=m*r-y*h>>16,y=m*h+y*r>>16,m=E,y<50)return;if(E=c*o+A*l>>16,c=c*l-A*o>>16,A=E,E=_*r-c*h>>16,c=_*h+c*r>>16,_=E,c<50)return;if(E=p*o+f*l>>16,p=p*l-f*o>>16,f=E,E=I*r-p*h>>16,p=I*h+p*r>>16,I=E,p<50)return;if(E=u*o+a*l>>16,u=u*l-a*o>>16,a=E,E=C*r-u*h>>16,u=C*h+u*r>>16,C=E,u<50)return;const v=e.A.ha+((d<<9)/y|0),b=e.A.ra+((m<<9)/y|0),T=e.A.ha+((A<<9)/c|0),O=e.A.ra+((_<<9)/c|0),R=e.A.ha+((f<<9)/p|0),S=e.A.ra+((I<<9)/p|0),L=e.A.ha+((a<<9)/u|0),x=e.A.ra+((C<<9)/u|0);if(e.A.alpha=0,(R-L)*(O-x)-(S-x)*(T-L)>0)if(e.A.i_=R<0||L<0||T<0||R>w.A.s_||L>w.A.s_||T>w.A.s_,g.Yp&&this.e_(g.kl,g.Dl,S,x,O,R,L,T)&&(g.om=s,g.lm=n),-1===t.n_)12345678!==t.h_&&e.A.r_(R,L,T,S,x,O,t.h_,t.o_,t.l_);else if(g.st){const i=g.hm[t.n_];e.A.r_(R,L,T,S,x,O,this.a_(i,t.h_),this.a_(i,t.o_),this.a_(i,t.l_))}else t.flat?e.A.c_(R,L,T,S,x,O,t.h_,t.o_,t.l_,d,m,y,A,a,_,C,c,u,t.n_):e.A.c_(R,L,T,S,x,O,t.h_,t.o_,t.l_,f,I,p,a,A,C,_,u,c,t.n_);if(!((v-T)*(x-O)-(b-O)*(L-T)<=0))if(e.A.i_=v<0||T<0||L<0||v>w.A.s_||T>w.A.s_||L>w.A.s_,g.Yp&&this.e_(g.kl,g.Dl,b,O,x,v,T,L)&&(g.om=s,g.lm=n),-1!==t.n_){if(!g.st)return void e.A.c_(v,T,L,b,O,x,t.f_,t.l_,t.o_,d,m,y,A,a,_,C,c,u,t.n_);const i=g.hm[t.n_];e.A.r_(v,T,L,b,O,x,this.a_(i,t.f_),this.a_(i,t.l_),this.a_(i,t.o_))}else 12345678!==t.f_&&e.A.r_(v,T,L,b,O,x,t.f_,t.l_,t.o_)};Gg=(t,i,s,n,h,r,o)=>{let l=s.Rd.length;for(let t=0;t>16;if(a=a*o-i*r>>16,i=c,c=l*h-a*n>>16,a=l*n+a*h>>16,l=c,a<50)return;s.u_&&(y.A.d_[t]=i,y.A.w_[t]=l,y.A.y_[t]=a),y.A.A_[t]=e.A.ha+((i<<9)/a|0),y.A.p_[t]=e.A.ra+((l<<9)/a|0)}e.A.alpha=0,l=s.m_.length;for(let n=0;n0)if(e.A.i_=l<0||a<0||c<0||l>w.A.s_||a>w.A.s_||c>w.A.s_,g.Yp&&this.e_(g.kl,g.Dl,f,u,d,l,a,c)&&(g.om=t,g.lm=i),s.u_&&-1!==s.u_[n])if(g.st){const t=g.hm[s.u_[n]];e.A.r_(l,a,c,f,u,d,this.a_(t,s.I_[n]),this.a_(t,s.C_[n]),this.a_(t,s.E_[n]))}else s.flat?e.A.c_(l,a,c,f,u,d,s.I_[n],s.C_[n],s.E_[n],y.A.d_[0],y.A.w_[0],y.A.y_[0],y.A.d_[1],y.A.d_[3],y.A.w_[1],y.A.w_[3],y.A.y_[1],y.A.y_[3],s.u_[n]):e.A.c_(l,a,c,f,u,d,s.I_[n],s.C_[n],s.E_[n],y.A.d_[h],y.A.w_[h],y.A.y_[h],y.A.d_[r],y.A.d_[o],y.A.w_[r],y.A.w_[o],y.A.y_[r],y.A.y_[o],s.u_[n]);else 12345678!==s.I_[n]&&e.A.r_(l,a,c,f,u,d,s.I_[n],s.C_[n],s.E_[n])}};Ug=(t,i,s)=>{const e=this.wm[t][i][s];if(e===-g.Ip)return!1;if(e===g.Ip)return!0;{const e=i<<7,n=s<<7;return this.v_(e+1,this.um[t][i][s],n+1)&&this.v_(e+128-1,this.um[t][i+1][s],n+1)&&this.v_(e+128-1,this.um[t][i+1][s+1],n+128-1)&&this.v_(e+1,this.um[t][i][s+1],n+128-1)?(this.wm[t][i][s]=g.Ip,!0):(this.wm[t][i][s]=-g.Ip,!1)}};zg=(t,i,s,e)=>{if(!this.Ug(t,i,s))return!1;const n=i<<7,h=s<<7,r=this.um[t][i][s]-1,o=r-120,l=r-230,a=r-238;if(e<16){if(1===e){if(n>g.Mp){if(!this.v_(n,r,h))return!1;if(!this.v_(n,r,h+128))return!1}if(t>0){if(!this.v_(n,o,h))return!1;if(!this.v_(n,o,h+128))return!1}return!!this.v_(n,l,h)&&this.v_(n,l,h+128)}if(2===e){if(h0){if(!this.v_(n,o,h+128))return!1;if(!this.v_(n+128,o,h+128))return!1}return!!this.v_(n,l,h+128)&&this.v_(n+128,l,h+128)}if(4===e){if(n0){if(!this.v_(n+128,o,h))return!1;if(!this.v_(n+128,o,h+128))return!1}return!!this.v_(n+128,l,h)&&this.v_(n+128,l,h+128)}if(8===e){if(h>g.Dp){if(!this.v_(n,r,h))return!1;if(!this.v_(n+128,r,h))return!1}if(t>0){if(!this.v_(n,o,h))return!1;if(!this.v_(n+128,o,h))return!1}return!!this.v_(n,l,h)&&this.v_(n+128,l,h)}}return!!this.v_(n+64,a,h+64)&&(16===e?this.v_(n,l,h+128):32===e?this.v_(n+128,l,h+128):64===e?this.v_(n+128,l,h):128===e?this.v_(n,l,h):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,i,s,e)=>{if(this.Ug(t,i,s)){const n=i<<7,h=s<<7;return this.v_(n+1,this.um[t][i][s]-e,h+1)&&this.v_(n+128-1,this.um[t][i+1][s]-e,h+1)&&this.v_(n+128-1,this.um[t][i+1][s+1]-e,h+128-1)&&this.v_(n+1,this.um[t][i][s+1]-e,h+128-1)}return!1};t_=(t,i,s,e,n,h)=>{let r,o;if(i!==s||e!==n){for(r=i;r<=s;r++)for(o=e;o<=n;o++)if(this.wm[t][r][o]===-g.Ip)return!1;o=1+(i<<7);const l=2+(e<<7),a=this.um[t][i][e]-h;if(!this.v_(o,a,l))return!1;const c=(s<<7)-1;if(!this.v_(c,a,l))return!1;const f=(n<<7)-1;return!!this.v_(o,a,f)&&this.v_(c,a,f)}return!!this.Ug(t,i,e)&&(r=i<<7,o=e<<7,this.v_(r+1,this.um[t][i][e]-h,o+1)&&this.v_(r+128-1,this.um[t][i+1][e]-h,o+1)&&this.v_(r+128-1,this.um[t][i+1][e+1]-h,o+128-1)&&this.v_(r+1,this.um[t][i][e+1]-h,o+128-1))};v_=(t,i,s)=>{for(let e=0;e0){const t=n.dg+(n.xg*e>>8),h=n.wg+(n.Mg*e>>8),r=n.cg+(n.kg*e>>8),o=n.Pd+(n.Dg*e>>8);if(s>=t&&s<=h&&i>=r&&i<=o)return!0}}else if(2===n.mode){const e=t-n.fg;if(e>0){const t=n.dg+(n.xg*e>>8),h=n.wg+(n.Mg*e>>8),r=n.cg+(n.kg*e>>8),o=n.Pd+(n.Dg*e>>8);if(s>=t&&s<=h&&i>=r&&i<=o)return!0}}else if(3===n.mode){const e=n.dg-s;if(e>0){const s=n.fg+(n.Fg*e>>8),h=n.ug+(n.Ng*e>>8),r=n.cg+(n.kg*e>>8),o=n.Pd+(n.Dg*e>>8);if(t>=s&&t<=h&&i>=r&&i<=o)return!0}}else if(4===n.mode){const e=s-n.dg;if(e>0){const s=n.fg+(n.Fg*e>>8),h=n.ug+(n.Ng*e>>8),r=n.cg+(n.kg*e>>8),o=n.Pd+(n.Dg*e>>8);if(t>=s&&t<=h&&i>=r&&i<=o)return!0}}else if(5===n.mode){const e=i-n.cg;if(e>0){const i=n.fg+(n.Fg*e>>8),h=n.ug+(n.Ng*e>>8),r=n.dg+(n.xg*e>>8),o=n.wg+(n.Mg*e>>8);if(t>=i&&t<=h&&s>=r&&s<=o)return!0}}}return!1};e_=(t,i,s,e,n,h,r,o)=>{if(is&&i>e&&i>n)return!1;if(th&&t>r&&t>o)return!1;const l=(i-e)*(o-r)-(t-r)*(n-e);return((i-s)*(r-h)-(t-h)*(e-s))*l>0&&l*((i-n)*(h-o)-(t-o)*(s-n))>0};a_=(t,i)=>((i=(127-i)*(127&t)/160|0)<2?i=2:i>126&&(i=126),(65408&t)+i)}},7121:(t,i,s)=>{s.d(i,{A:()=>n});var e=s(1982);class n extends e.A{}},4197:(t,i,s)=>{s.d(i,{A:()=>n});var e=s(1982);class n extends e.A{b_;T_;O_;R_;index;Vw;ul;fl;constructor(t,i,s,e,n,h,r){super(),this.b_=i,this.T_=s,this.O_=e,this.R_=n,this.index=t,this.Vw=h,r&&-1!==h.wl&&this.Vw.delay?(this.ul=Math.random()*this.Vw.dl|0,this.fl=Math.random()*this.Vw.delay[this.ul]|0):(this.ul=-1,this.fl=0)}}},9418:(t,i,s)=>{s.d(i,{A:()=>r});var e=s(7121),n=s(1312),h=s(3867);class r extends e.A{x=0;z=0;Yg=0;S_=!1;size=1;La=-1;L_=-1;x_=-1;M_=-1;k_=-1;D_=-1;F_=-1;N_=null;B_=100;P_=0;U_=0;W_=0;G_=0;H_=-1e3;Y_=0;V_=0;K_=-1;X_=0;j_=0;z_=-1;Z_=0;q_=0;J_=-1;Q_=0;tI=0;iI=0;sI=0;eI=-1;nI=0;hI=0;rI=0;oI=0;lI=0;aI=0;cI=0;fI=0;uI=0;dI=0;wI=0;Ip=0;height=0;yI=0;pathLength=0;AI=new Int32Array(10);pI=new Int32Array(10);mI=new h.ds(10,!1);gI=0;_I=-1;II=-1;CI=-1;EI=-1;move(t,i,s){if(-1!==this.J_&&n.A.So[this.J_].priority<=1&&(this.J_=-1),!t){const t=i-this.AI[0],e=s-this.pI[0];if(t>=-8&&t<=8&&e>=-8&&e<=8){this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.AI[t]=this.AI[t-1],this.pI[t]=this.pI[t-1],this.mI[t]=this.mI[t-1];return this.AI[0]=i,this.pI[0]=s,void(this.mI[0]=!1)}}this.pathLength=0,this.gI=0,this.AI[0]=i,this.pI[0]=s,this.x=128*this.AI[0]+64*this.size,this.z=128*this.pI[0]+64*this.size}step(t,i){let s=this.AI[0],e=this.pI[0];0===i?(s--,e++):1===i?e++:2===i?(s++,e++):3===i?s--:4===i?s++:5===i?(s--,e--):6===i?e--:7===i&&(s++,e--),-1!==this.J_&&n.A.So[this.J_].priority<=1&&(this.J_=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.AI[t]=this.AI[t-1],this.pI[t]=this.pI[t-1],this.mI[t]=this.mI[t-1];this.AI[0]=s,this.pI[0]=e,this.mI[0]=t}}},8268:(t,i,s)=>{s.d(i,{A:()=>d});var e=s(9418),n=s(8665),h=s(2679),r=s(8738),o=s(1312),l=s(8317),a=s(1302),c=s(3819),f=s(3867),u=s(9298);class d extends e.A{static vI=1;static bI=2;static TI=4;static OI=8;static RI=16;static SI=32;static LI=64;static xI=128;static MI=256;static kI=512;static Sa=[u.A.DI,u.A.FI,u.A.NI,u.A.BI,u.A.UI,u.A.WI,u.A.GI,u.A.HI,u.A.YI,u.A.VI,u.A.KI,u.A.XI,u.A.jI,u.A.zI,u.A.ZI,u.A.qI];static Ra=[[u.A.JI,u.A.$I,u.A.QI,u.A.tC,u.A.iC,u.A.sC,u.A.eC,u.A.nC,u.A.hC,u.A.rC,u.A.oC,u.A.lC],[u.A.aC,u.A.cC,u.A.fC,u.A.uC,u.A.dC,u.A.wC,u.A.yC,u.A.AC,u.A.pC,u.A.mC,u.A.gC,u.A._C,u.A.IC,u.A.CC,u.A.EC,u.A.vC],[u.A.vC-1,u.A.aC+1,u.A.cC,u.A.fC,u.A.uC,u.A.dC,u.A.wC,u.A.yC,u.A.AC,u.A.pC,u.A.mC,u.A.gC,u.A._C,u.A.IC,u.A.CC,u.A.EC],[u.A.bC,u.A.TC,u.A.OC,u.A.RC,u.A.SC,u.A.LC],[u.A.xC,u.A.MC,u.A.kC,u.A.DC,u.A.FC,u.A.NC,u.A.BC,u.A.PC]];static Lo=new h.A(200);name=null;visible=!1;UC=0;WC=0;GC=new Uint16Array(12);HC=new Uint16Array(5);Ka=0;YC=0n;y=0;VC=0;KC=0;XC=0;jC=0;zC=0;ZC=null;Sg=0;Lg=0;FA=0;NA=0;st=!1;draw(t){if(!this.visible)return null;let i=this.zd();if(this.height=i.Pd,i.$d=!0,this.st)return i;if(-1!==this.eI&&-1!==this.nI){const t=r.A.So[this.eI],s=n.A.vu(t.la(),!0,!t.ld,!1);s.translate(-this.oI,0,0),s.xa(),t.Vw&&t.Vw.frames&&s.Ma(t.Vw.frames[this.nI]),s.Dd=null,s.Fd=null,128===t.Xd&&128===t.jd||s.scale(t.Xd,t.jd,t.Xd),s.ka(t.fd+64,t.ud+850,-30,-50,-30,!0);const e=[i,s];i=n.A.qC(e,2)}if(this.ZC&&(t>=this.KC&&(this.ZC=null),t>=this.VC&&t=d.Ra[i].length)&&(s=0),this.HC[i]=s}this.La=t.ou,65535===this.La&&(this.La=-1),this.L_=t.ou,65535===this.L_&&(this.L_=-1),this.x_=t.ou,65535===this.x_&&(this.x_=-1),this.M_=t.ou,65535===this.M_&&(this.M_=-1),this.k_=t.ou,65535===this.k_&&(this.k_=-1),this.D_=t.ou,65535===this.D_&&(this.D_=-1),this.F_=t.ou,65535===this.F_&&(this.F_=-1),this.name=c.A.Ca(c.A.Ea(t.JC)),this.Ka=t.au,this.visible=!0,this.YC=0n;for(let t=0;t<12;t++)this.YC<<=0x4n,this.GC[t]>=256&&(this.YC+=BigInt(this.GC[t])-256n);this.GC[0]>=256&&(this.YC+=BigInt(this.GC[0])-256n>>4n),this.GC[1]>=256&&(this.YC+=BigInt(this.GC[1])-256n>>8n);for(let t=0;t<5;t++)this.YC<<=0x3n,this.YC+=BigInt(this.HC[t]);this.YC<<=0x1n,this.YC+=BigInt(this.UC)}Xu(){if(!this.visible)return null;const t=new f.ds(12,null);let i=0;for(let s=0;s<12;s++){const e=this.GC[s];if(e>=256&&e<512&&(t[i++]=l.A.So[e-256].Xu()),e>=512){const s=a.A.get(e-512).Xu(this.UC);s&&(t[i++]=s)}}const s=n.A.Ta(t,i);for(let t=0;t<5;t++)0!==this.HC[t]&&(s.Oa(d.Ra[t][0],d.Ra[t][this.HC[t]]),1===t&&s.Oa(d.Sa[0],d.Sa[this.HC[t]]));return s}zd(){let t=this.YC,i=-1,s=-1,e=-1,h=-1;if(this.J_>=0&&0===this.iI){const n=o.A.So[this.J_];if(n.frames&&(i=n.frames[this.Q_]),this.z_>=0&&this.z_!==this.La){const t=o.A.So[this.z_].frames;t&&(s=t[this.Z_])}n.Gw>=0&&(e=n.Gw,t+=BigInt(e-this.GC[5])<<8n),n.Hw>=0&&(h=n.Hw,t+=BigInt(h-this.GC[3])<<16n)}else if(this.z_>=0){const t=o.A.So[this.z_].frames;t&&(i=t[this.Z_])}let r=d.Lo?.get(t);if(!r){const i=new f.ds(12,null);let s=0;for(let t=0;t<12;t++){let n=this.GC[t];if(h>=0&&3===t&&(n=h),e>=0&&5===t&&(n=e),n>=256&&n<512){const t=l.A.So[n-256].la();t&&(i[s++]=t)}if(n>=512){const t=a.A.get(n-512).Pw(this.UC);t&&(i[s++]=t)}}r=n.A.Ta(i,s);for(let t=0;t<5;t++)0!==this.HC[t]&&(r.Oa(d.Ra[t][0],d.Ra[t][this.HC[t]]),1===t&&r.Oa(d.Sa[0],d.Sa[this.HC[t]]));r.xa(),r.ka(64,850,-30,-50,-30,!0),d.Lo?.put(t,r)}if(this.st)return r;const c=n.A.Zd(r,!0);return-1!==i&&-1!==s?c.qd(i,s,o.A.So[this.J_].Uw):-1!==i&&c.Ma(i),c.Jd(),c.Dd=null,c.Fd=null,c}}},9222:(t,i,s)=>{s.d(i,{A:()=>e});class e{y;x;z;model;Xm;info;constructor(t,i,s,e,n,h){this.y=t,this.x=i,this.z=s,this.model=e,this.Xm=n,this.info=h}}},1161:(t,i,s)=>{s.d(i,{A:()=>e});class e{level;y;x;z;model;Hg;Yg;jm;rg;zm;og;Xm;info;Qg=0;Ip=0;constructor(t,i,s,e,n,h,r,o,l,a,c,f,u){this.level=t,this.y=i,this.x=s,this.z=e,this.model=n,this.Hg=h,this.Yg=r,this.jm=o,this.rg=l,this.zm=a,this.og=c,this.Xm=f,this.info=u}}},5748:(t,i,s)=>{s.d(i,{A:()=>e});class e{y;x;z;$g;Jg;qg;Xm;offset;constructor(t,i,s,e,n,h,r,o){this.y=t,this.x=i,this.z=s,this.$g=e,this.Jg=n,this.qg=h,this.Xm=r,this.offset=o}}},8256:(t,i,s)=>{s.d(i,{A:()=>e});class e{Sg;FA;Lg;NA;type;fg;ug;dg;wg;cg;Pd;mode=0;Fg=0;Ng=0;xg=0;Mg=0;kg=0;Dg=0;constructor(t,i,s,e,n,h,r,o,l,a,c){this.Sg=t,this.FA=i,this.Lg=s,this.NA=e,this.type=n,this.fg=h,this.ug=r,this.dg=o,this.wg=l,this.cg=a,this.Pd=c}}},3795:(t,i,s)=>{s.d(i,{A:()=>h});var e=s(1982),n=s(3867);class h extends e.A{level;x;z;Pg;xm;Og;vm=null;Tm=null;Dm=null;Fm=null;Om=null;Mm=null;Cm=null;Lm=0;Rg=0;Em=0;visible=!1;update=!1;vg=!1;bg=0;Xg=0;jg=0;Vg=0;constructor(t,i,s){super(),this.Pg=this.level=t,this.x=i,this.z=s,this.xm=new n.ds(5,null),this.Og=new Int32Array(5)}}},2771:(t,i,s)=>{s.d(i,{A:()=>e});class e{static A_=new Int32Array(6);static p_=new Int32Array(6);static d_=new Int32Array(6);static w_=new Int32Array(6);static y_=new Int32Array(6);static $C=[Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,2,6),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,13,14)];static QC=[Int8Array.of(0,1,2,3,0,0,1,3),Int8Array.of(1,1,2,3,1,0,1,3),Int8Array.of(0,1,2,3,1,0,1,3),Int8Array.of(0,0,1,2,0,0,2,4,1,0,4,3),Int8Array.of(0,0,1,4,0,0,4,3,1,1,2,4),Int8Array.of(0,0,4,3,1,0,1,2,1,0,2,4),Int8Array.of(0,1,2,4,1,0,1,4,1,0,4,3),Int8Array.of(0,4,1,2,0,4,2,5,1,0,4,5,1,0,5,3),Int8Array.of(0,4,1,2,0,4,2,3,0,4,3,5,1,0,4,5),Int8Array.of(0,0,4,5,1,4,1,2,1,4,2,3,1,4,3,5),Int8Array.of(0,0,1,5,0,1,4,5,0,1,2,4,1,0,5,3,1,5,4,3,1,4,2,3),Int8Array.of(1,0,1,5,1,1,4,5,1,1,2,4,0,0,5,3,0,5,4,3,0,4,2,3),Int8Array.of(1,0,5,4,1,0,1,5,0,0,4,3,0,4,5,3,0,5,2,3,0,1,2,5)];static tE=128;static iE=this.tE/2|0;static sE=this.tE/4|0;static eE=3*this.tE/4|0;Rd;Ld;Sd;I_;C_;E_;m_;g_;__;u_;flat;shape;angle;Ig;Cg;constructor(t,i,s,n,h,r,o,l,a,c,f,u,d,w,y,A,p,m,g){this.flat=!(p!==n||p!==w||p!==l),this.shape=i,this.angle=r,this.Ig=d,this.Cg=a;const _=e.$C[i],I=_.length;this.Rd=new Int32Array(I),this.Ld=new Int32Array(I),this.Sd=new Int32Array(I);const C=new Int32Array(I),E=new Int32Array(I),v=t*e.tE,b=m*e.tE;for(let t=0;t8&&I<=12&&(I=9+(I-r-9&3)),I>12&&I<=16&&(I=13+(I-r-13&3)),1===I?(i=v,a=b,f=p,d=o,m=c):2===I?(i=v+e.iE,a=b,f=p+n>>1,d=o+g>>1,m=c+s>>1):3===I?(i=v+e.tE,a=b,f=n,d=g,m=s):4===I?(i=v+e.tE,a=b+e.iE,f=n+w>>1,d=g+h>>1,m=s+y>>1):5===I?(i=v+e.tE,a=b+e.tE,f=w,d=h,m=y):6===I?(i=v+e.iE,a=b+e.tE,f=w+l>>1,d=h+A>>1,m=y+u>>1):7===I?(i=v,a=b+e.tE,f=l,d=A,m=u):8===I?(i=v,a=b+e.iE,f=l+p>>1,d=A+o>>1,m=u+c>>1):9===I?(i=v+e.iE,a=b+e.sE,f=p+n>>1,d=o+g>>1,m=c+s>>1):10===I?(i=v+e.eE,a=b+e.iE,f=n+w>>1,d=g+h>>1,m=s+y>>1):11===I?(i=v+e.iE,a=b+e.eE,f=w+l>>1,d=h+A>>1,m=y+u>>1):12===I?(i=v+e.sE,a=b+e.iE,f=l+p>>1,d=A+o>>1,m=u+c>>1):13===I?(i=v+e.sE,a=b+e.sE,f=p,d=o,m=c):14===I?(i=v+e.eE,a=b+e.sE,f=n,d=g,m=s):15===I?(i=v+e.eE,a=b+e.eE,f=w,d=h,m=y):(i=v+e.sE,a=b+e.eE,f=l,d=A,m=u),this.Rd[t]=i,this.Ld[t]=f,this.Sd[t]=a,C[t]=d,E[t]=m}const T=e.QC[i],O=T.length/4|0;this.m_=new Int32Array(O),this.g_=new Int32Array(O),this.__=new Int32Array(O),this.I_=new Int32Array(O),this.C_=new Int32Array(O),this.E_=new Int32Array(O),this.u_=-1!==f?new Int32Array(O):null;let R=0;for(let t=0;t{s.d(i,{A:()=>e});class e{static QA=0;static bm=1;static nE=2;static hE=3;static rE=4;static oE=5;static iE=6;static sE=7;static eE=8;static lE=9;static aE=10;static cE=11}},3479:(t,i,s)=>{s.d(i,{A:()=>e});class e{f_;l_;h_;o_;n_;color;flat;constructor(t,i,s,e,n,h,r){this.f_=t,this.l_=i,this.h_=s,this.o_=e,this.n_=n,this.color=h,this.flat=r}}},6855:(t,i,s)=>{s.d(i,{A:()=>e});class e{y;x;z;Kg;Zg;Wm;Hm;Xm;info;constructor(t,i,s,e,n,h,r,o,l){this.y=t,this.x=i,this.z=s,this.Kg=e,this.Zg=n,this.Wm=h,this.Hm=r,this.Xm=o,this.info=l}}},7441:(t,i,s)=>{s.d(i,{A:()=>e});class e{y;x;z;type;angle;model;Xm;info;constructor(t,i,s,e,n,h,r,o){this.y=t,this.x=i,this.z=s,this.type=e,this.angle=n,this.model=h,this.Xm=r,this.info=o}}},7536:(t,i,s)=>{s.d(i,{A:()=>n});var e=s(1982);class n{fE;uE;constructor(t){this.uE=[],this.fE=t;for(let i=0;i{s.d(i,{A:()=>n});var e=s(1982);class n extends e.A{wE;yE;constructor(){super(),this.wE=this,this.yE=this}AE(){this.yE&&this.wE&&(this.yE.wE=this.wE,this.wE.yE=this.yE,this.wE=null,this.yE=null)}}},3819:(t,i,s)=>{s.d(i,{A:()=>e});class e{static pE=['_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9'];static mE=t=>{t=t.trim();let i=0n;for(let s=0;s=65&&e<=90?i+=BigInt(e+1-65):e>=97&&e<=122?i+=BigInt(e+1-97):e>=48&&e<=57&&(i+=BigInt(e+27-48))}return i};static Ea=t=>{if(t<0n||t>=6582952005840035281n)return'invalid_name';if(t%37n===0n)return'invalid_name';let i=0;const s=Array(12);for(;0n!==t;){const e=t;t/=37n,s[11-i++]=this.pE[Number(e-37n*t)]}return s.slice(12-i).join('')};static gE=t=>{const i=[...t.toLowerCase()];let s=!0;for(let t=0;t='a'&&e<='z'&&(i[t]=e.toUpperCase(),s=!1),'.'!==e&&'!'!==e||(s=!0)}return i.join('')};static _E=t=>{let i='';for(let s=0;s(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static Ca=t=>{if(0===t.length)return t;const i=[...t];for(let t=0;t='a'&&i[t+1]<='z'&&(i[t+1]=String.fromCharCode(i[t+1].charCodeAt(0)+'A'.charCodeAt(0)-97)));return i[0]>='a'&&i[0]<='z'&&(i[0]=String.fromCharCode(i[0].charCodeAt(0)+'A'.charCodeAt(0)-97)),i.join('')};static Iu=t=>{const i=t.toUpperCase();let s=0n;for(let t=0;t>56n)&0xffffffffffffffn;return s}}},6666:(t,i,s)=>{s.d(i,{A:()=>n});var e=s(1982);class n{IE;cursor=null;constructor(){const t=new e.A;t.next=t,t.dE=t,this.IE=t}MA(t){t.dE&&t.hw(),t.dE=this.IE.dE,t.next=this.IE,t.dE&&(t.dE.next=t),t.next.dE=t}CE(t){t.dE&&t.hw(),t.dE=this.IE,t.next=this.IE.next,t.dE.next=t,t.next&&(t.next.dE=t)}Bg(){const t=this.IE.next;return t===this.IE?null:(t?.hw(),t)}head(){const t=this.IE.next;return t===this.IE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}EE(){const t=this.IE.dE;return t===this.IE?(this.cursor=null,null):(this.cursor=t?.dE||null,t)}next(){const t=this.cursor;return t===this.IE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}dE(){const t=this.cursor;return t===this.IE?(this.cursor=null,null):(this.cursor=t?.dE||null,t)}clear(){for(;;){const t=this.IE.next;if(t===this.IE)return;t?.hw()}}}},1982:(t,i,s)=>{s.d(i,{A:()=>e});class e{key;next;dE;constructor(){this.key=0n,this.next=this,this.dE=this}hw(){this.dE&&this.next&&(this.dE.next=this.next,this.next.dE=this.dE,this.next=null,this.dE=null)}}},2679:(t,i,s)=>{s.d(i,{A:()=>h});var e=s(2512),n=s(7536);class h{vE;bE;history;available;constructor(t){this.vE=t,this.available=t,this.bE=new n.A(1024),this.history=new e.A}get(t){const i=this.bE.get(t);return i&&this.history.push(i),i}put(t,i){if(0===this.available){const t=this.history.pop();t?.hw(),t?.AE()}else this.available--;this.bE.put(t,i),this.history.push(i)}clear(){const t=this.history.pop();t?(t.hw(),t.AE()):this.available=this.vE}}},2512:(t,i,s)=>{s.d(i,{A:()=>n});var e=s(4474);class n{head;constructor(){this.head=new e.A}push(t){t.yE&&t.AE(),t.yE=this.head.yE,t.wE=this.head,t.yE&&(t.yE.wE=t),t.wE.yE=t}pop(){const t=this.head.wE;return t===this.head?null:(t?.AE(),t)}}},8534:(t,i,s)=>{s.d(i,{A:()=>h});var e=s(1069),n=s(3867);class h{static So=[];static ru=t=>{const i=new e.A(t.read('base_head.dat')),s=new e.A(t.read('base_type.dat')),r=new e.A(t.read('base_label.dat')),o=i.ou;i.af+=2;for(let t=0;t{s.d(i,{A:()=>h});var e=s(8534),n=s(1069);class h{static So=[];static ru=t=>{const i=new n.A(t.read('frame_head.dat')),s=new n.A(t.read('frame_tran1.dat')),r=new n.A(t.read('frame_tran2.dat')),o=new n.A(t.read('frame_del.dat')),l=i.ou;i.af+=2;const a=new Int32Array(500),c=new Int32Array(500),f=new Int32Array(500),u=new Int32Array(500);for(let t=0;t0){if(0!==d.types[t])for(let i=t-1;i>y;i--)if(0===d.types[i]){a[A]=i,c[A]=0,f[A]=0,u[A]=0,A++;break}a[A]=t;let s=0;3===d.types[a[A]]&&(s=128),c[A]=1&i?r.OE:s,f[A]=2&i?r.OE:s,u[A]=4&i?r.OE:s,y=t,A++}}n.length=A,n.RE=new Int32Array(A),n.x=new Int32Array(A),n.y=new Int32Array(A),n.z=new Int32Array(A);for(let t=0;t{s.d(i,{bc:()=>e,zo:()=>n,SE:()=>o,LE:()=>r,xE:()=>h});const e=document.getElementById('canvas'),n=e.getContext('2d',{willReadFrequently:!0}),h=document.createElement('canvas'),r=document.createElement('img'),o=h.getContext('2d',{willReadFrequently:!0})},9298:(t,i,s)=>{s.d(i,{A:()=>e});class e{static RED=16711680;static GREEN=65280;static BLUE=255;static Wl=16776960;static ME=65535;static sp=16711935;static _l=16777215;static Ul=0;static kE=16748608;static DE=8388608;static FE=128;static NE=16756736;static BE=16740352;static PE=16723968;static UE=12648192;static WE=8453888;static GE=4259584;static HE=9179409;static YE=6116423;static il=2301979;static sl=5063219;static nl=7759444;static rl=3353893;static VE=8388736;static KE=13350793;static XE=Int32Array.of(e.Wl,e.RED,e.GREEN,e.ME,e.sp,e._l);static JI=6798;static $I=107;static QI=10283;static tC=16;static iC=4797;static sC=7744;static eC=5799;static nC=4634;static hC=33697;static rC=22433;static oC=2983;static lC=54193;static aC=8741;static cC=12;static fC=64030;static uC=43162;static dC=7735;static wC=8404;static yC=1701;static AC=38430;static pC=24094;static mC=10153;static gC=56621;static _C=4783;static IC=1341;static CC=16578;static EC=35003;static vC=25239;static DI=9104;static FI=10275;static NI=7595;static BI=3610;static UI=7975;static WI=8526;static GI=918;static HI=38802;static YI=24466;static VI=10145;static KI=58654;static XI=5027;static jI=1457;static zI=16565;static ZI=34991;static qI=25486;static bC=4626;static TC=11146;static OC=6439;static RC=12;static SC=4758;static LC=10270;static PC=4574;static xC=4550;static MC=4537;static kC=5681;static DC=5673;static FC=5790;static NC=6806;static BC=8076}},8950:(t,i,s)=>{s.d(i,{A:()=>n});var e=s(4474);class n extends e.A{static aw=new Int32Array;static cw=0;static fw=0;static top=0;static bottom=0;static left=0;static right=0;static s_=0;static jE=0;static zE=0;static bind=(t,i,s)=>{this.aw=t,this.cw=i,this.fw=s,this.Al(0,0,i,s)};static ZE=()=>{this.left=0,this.top=0,this.right=this.cw,this.bottom=this.fw,this.s_=this.right-1,this.jE=this.right/2|0};static Al=(t,i,s,e)=>{t<0&&(t=0),i<0&&(i=0),s>this.cw&&(s=this.cw),e>this.fw&&(e=this.fw),this.top=i,this.bottom=e,this.left=t,this.right=s,this.s_=this.right-1,this.jE=this.right/2|0,this.zE=this.bottom/2|0};static clear=()=>{const t=this.cw*this.fw;for(let i=0;i{this.hl(t,i,n,s),this.hl(t,i+e-1,n,s),this.el(t,i,n,e),this.el(t+s-1,i,n,e)};static hl=(t,i,s,e)=>{if(i=this.bottom)return;tthis.right&&(e=this.right-t);const n=t+i*this.cw;for(let t=0;t{if(t=this.right)return;ithis.bottom&&(e=this.bottom-i);const n=t+i*this.cw;for(let t=0;t{const h=Math.abs(s-t),r=Math.abs(e-i),o=t=this.left&&t=this.top&&i-r&&(a-=r,t+=o),s{tthis.right&&(s=this.right-t),i+e>this.bottom&&(e=this.bottom-i);const h=this.cw-s;let r=t+i*this.cw;for(let t=-e;t<0;t++){for(let t=-s;t<0;t++)this.aw[r++]=n;r+=h}};static JE(t,i,s,e,n,h){tthis.right&&(s=this.right-t),i+e>this.bottom&&(e=this.bottom-i);const r=256-h,o=(n>>16&255)*h,l=(n>>8&255)*h,a=(255&n)*h,c=this.cw-s;let f=t+i*this.cw;for(let t=0;t>16&255)*r>>8<<16)+(l+(this.aw[f]>>8&255)*r>>8<<8)+(a+(255&this.aw[f])*r>>8);this.aw[f++]=t}f+=c}}static $E(t,i,s,e,n){const h=256-n,r=(e>>16&255)*n,o=(e>>8&255)*n,l=(255&e)*n;let a=i-s;a<0&&(a=0);let c=i+s;c>=this.fw&&(c=this.fw-1);for(let e=a;e<=c;e++){const n=e-i,a=0|Math.sqrt(s*s-n*n);let c=t-a;c<0&&(c=0);let f=t+a;f>=this.cw&&(f=this.cw-1);let u=c+e*this.cw;for(let t=c;t<=f;t++){const t=(r+(this.aw[u]>>16&255)*h>>8<<16)+(o+(this.aw[u]>>8&255)*h>>8<<8)+(l+(255&this.aw[u])*h>>8);this.aw[u++]=t}}}static QE=(t,i,s)=>{t=this.right||i=this.bottom||(this.aw[t+i*this.cw]=s)}}},4583:(t,i,s)=>{s.d(i,{A:()=>r});var e=s(8950),n=s(1673),h=s(3867);class r extends e.A{static st=!1;static tv=new Int32Array(512);static iv=new Int32Array(2048);static sin=new Int32Array(2048);static cos=new Int32Array(2048);static palette=new Int32Array(65536);static sv=new h.ds(50,null);static ev=0;static lw=new Int32Array;static ha=0;static ra=0;static uw=!0;static i_=!1;static alpha=0;static nv=null;static hv=new h.ds(50,null);static rv=0;static Ip=0;static ov=new Int32Array(50);static lv=new h.ds(50,null);static av=!1;static cv=new h.ds(50,!1);static fv=new Int32Array(50);static{for(let t=1;t<512;t++)this.tv[t]=32768/t|0;for(let t=1;t<2048;t++)this.iv[t]=65536/t|0;for(let t=0;t<2048;t++)this.sin[t]=65536*Math.sin(.0030679615757712823*t)|0,this.cos[t]=65536*Math.cos(.0030679615757712823*t)|0}static To=()=>{this.tv=null,this.tv=null,this.sin=null,this.cos=null,this.lw=null,this.sv=null,this.cv=null,this.fv=null,this.nv=null,this.hv=null,this.ov=null,this.palette=null,this.lv=null,console.log('Draw3D unloaded!')};static Tc=()=>{this.lw=new Int32Array(this.fw);for(let t=0;t{this.lw=new Int32Array(i);for(let s=0;s{this.nv=null,this.hv.fill(null)};static wv=t=>{this.ev=0;for(let i=0;i<50;i++)try{this.sv[i]=n.A.Cu(t,i.toString()),this.st&&128===this.sv[i]?.Nl?this.sv[i]?.yv():this.sv[i]?.Iw(),this.ev++}catch(t){}};static ip=t=>{if(0!==this.fv[t])return this.fv[t];const i=this.lv[t];if(!i)return 0;let s=0,e=0,n=0;const h=i.length;for(let t=0;t>16&255,e+=i[t]>>8&255,n+=255&i[t];let r=(s/h<<16)+(e/h<<8)+(n/h|0);return r=this.Av(r,1.4),0===r&&(r=1),this.fv[t]=r,r};static pv=t=>{const i=t+.03*Math.random()-.015;let s=0;for(let t=0;t<512;t++){const e=(t/8|0)/64+.0078125,n=(7&t)/8+.0625;for(let t=0;t<128;t++){const h=t/128;let r=h,o=h,l=h;if(0!==n){let t;t=h<.5?h*(n+1):h+n-h*n;const i=2*h-t;let s=e+.3333333333333333;s>1&&s--;let a=e-.3333333333333333;a<0&&a++,r=6*s<1?i+6*(t-i)*s:2*s<1?t:3*s<2?i+(t-i)*(.6666666666666666-s)*6:i,o=6*e<1?i+6*(t-i)*e:2*e<1?t:3*e<2?i+(t-i)*(.6666666666666666-e)*6:i,l=6*a<1?i+6*(t-i)*a:2*a<1?t:3*a<2?i+(t-i)*(.6666666666666666-a)*6:i}const a=((256*r|0)<<16)+((256*o|0)<<8)+(256*l|0);this.palette[s++]=this.Av(a,i)}}for(let t=0;t<50;t++){const s=this.sv[t];if(!s)continue;const e=s.palette;this.lv[t]=new Int32Array(e.length);for(let s=0;s{const s=(t>>16)/256,e=(t>>8&255)/256,n=(255&t)/256;return((256*Math.pow(s,i)|0)<<16)+((256*Math.pow(e,i)|0)<<8)+(256*Math.pow(n,i)|0)};static gv=t=>{this.nv||(this.rv=t,this.st?this.nv=new h.Kh(t,16384):this.nv=new h.Kh(t,65536),this.hv.fill(null))};static r_=(t,i,s,e,n,h,r,o,l)=>{let a=0,c=0;n!==e&&(a=(i-t<<16)/(n-e)|0,c=(o-r<<15)/(n-e)|0);let f=0,u=0;h!==n&&(f=(s-i<<16)/(h-n)|0,u=(l-o<<15)/(h-n)|0);let d=0,w=0;if(h!==e&&(d=(t-s<<16)/(e-h)|0,w=(r-l<<15)/(e-h)|0),e<=n&&e<=h){if(ethis.bottom&&(n=this.bottom),h>this.bottom&&(h=this.bottom),nf)for(h-=n,n-=e,e=this.lw[e];;){if(--n<0)for(;;){if(--h<0)return;this._v(s>>16,i>>16,l>>7,o>>7,this.aw,e,0),s+=d,i+=f,l+=w,o+=u,e+=this.cw}this._v(s>>16,t>>16,l>>7,r>>7,this.aw,e,0),s+=d,t+=a,l+=w,r+=c,e+=this.cw}else for(h-=n,n-=e,e=this.lw[e];;){if(--n<0)for(;;){if(--h<0)return;this._v(i>>16,s>>16,o>>7,l>>7,this.aw,e,0),s+=d,i+=f,l+=w,o+=u,e+=this.cw}this._v(t>>16,s>>16,r>>7,l>>7,this.aw,e,0),s+=d,t+=a,l+=w,r+=c,e+=this.cw}else if(i=t<<=16,o=r<<=15,e<0&&(i-=d*e,t-=a*e,o-=w*e,r-=c*e,e=0),s<<=16,l<<=15,h<0&&(s-=f*h,l-=u*h,h=0),e!==h&&da)for(n-=h,h-=e,e=this.lw[e];;){if(--h<0)for(;;){if(--n<0)return;this._v(s>>16,t>>16,l>>7,r>>7,this.aw,e,0),s+=f,t+=a,l+=u,r+=c,e+=this.cw}this._v(i>>16,t>>16,o>>7,r>>7,this.aw,e,0),i+=d,t+=a,o+=w,r+=c,e+=this.cw}else for(n-=h,h-=e,e=this.lw[e];;){if(--h<0)for(;;){if(--n<0)return;this._v(t>>16,s>>16,r>>7,l>>7,this.aw,e,0),s+=f,t+=a,l+=u,r+=c,e+=this.cw}this._v(t>>16,i>>16,r>>7,o>>7,this.aw,e,0),i+=d,t+=a,o+=w,r+=c,e+=this.cw}}else if(n<=h){if(nthis.bottom&&(h=this.bottom),e>this.bottom&&(e=this.bottom),hd)for(e-=h,h-=n,n=this.lw[n];;){if(--h<0)for(;;){if(--e<0)return;this._v(t>>16,s>>16,r>>7,l>>7,this.aw,n,0),t+=a,s+=d,r+=c,l+=w,n+=this.cw}this._v(t>>16,i>>16,r>>7,o>>7,this.aw,n,0),t+=a,i+=f,r+=c,o+=u,n+=this.cw}else for(e-=h,h-=n,n=this.lw[n];;){if(--h<0)for(;;){if(--e<0)return;this._v(s>>16,t>>16,l>>7,r>>7,this.aw,n,0),t+=a,s+=d,r+=c,l+=w,n+=this.cw}this._v(i>>16,t>>16,o>>7,r>>7,this.aw,n,0),t+=a,i+=f,r+=c,o+=u,n+=this.cw}else if(s=i<<=16,l=o<<=15,n<0&&(s-=a*n,i-=f*n,l-=c*n,o-=u*n,n=0),t<<=16,r<<=15,e<0&&(t-=d*e,r-=w*e,e=0),h-=e,e-=n,n=this.lw[n],a>16,i>>16,r>>7,o>>7,this.aw,n,0),t+=d,i+=f,r+=w,o+=u,n+=this.cw}this._v(s>>16,i>>16,l>>7,o>>7,this.aw,n,0),s+=a,i+=f,l+=c,o+=u,n+=this.cw}else for(;;){if(--e<0)for(;;){if(--h<0)return;this._v(i>>16,t>>16,o>>7,r>>7,this.aw,n,0),t+=d,i+=f,r+=w,o+=u,n+=this.cw}this._v(i>>16,s>>16,o>>7,l>>7,this.aw,n,0),s+=a,i+=f,l+=c,o+=u,n+=this.cw}}else if(hthis.bottom&&(e=this.bottom),n>this.bottom&&(n=this.bottom),e>16,t>>16,o>>7,r>>7,this.aw,h,0),i+=f,t+=a,o+=u,r+=c,h+=this.cw}this._v(i>>16,s>>16,o>>7,l>>7,this.aw,h,0),i+=f,s+=d,o+=u,l+=w,h+=this.cw}else for(;;){if(--e<0)for(;;){if(--n<0)return;this._v(t>>16,i>>16,r>>7,o>>7,this.aw,h,0),i+=f,t+=a,o+=u,r+=c,h+=this.cw}this._v(s>>16,i>>16,l>>7,o>>7,this.aw,h,0),i+=f,s+=d,o+=u,l+=w,h+=this.cw}else if(t=s<<=16,r=l<<=15,h<0&&(t-=f*h,s-=d*h,r-=u*h,l-=w*h,h=0),i<<=16,o<<=15,n<0&&(i-=a*n,o-=c*n,n=0),e-=n,n-=h,h=this.lw[h],f>16,s>>16,o>>7,l>>7,this.aw,h,0),i+=a,s+=d,o+=c,l+=w,h+=this.cw}this._v(t>>16,s>>16,r>>7,l>>7,this.aw,h,0),t+=f,s+=d,r+=u,l+=w,h+=this.cw}else for(;;){if(--n<0)for(;;){if(--e<0)return;this._v(s>>16,i>>16,l>>7,o>>7,this.aw,h,0),i+=a,s+=d,o+=c,l+=w,h+=this.cw}this._v(s>>16,t>>16,l>>7,r>>7,this.aw,h,0),t+=f,s+=d,r+=u,l+=w,h+=this.cw}};static _v=(t,i,s,e,n,h,r)=>{let o;if(this.uw){let l;if(this.i_){if(l=i-t>3?(e-s)/(i-t)|0:0,i>this.s_&&(i=this.s_),t<0&&(s-=t*l,t=0),t>=i)return;h+=t,r=i-t>>2,l<<=2}else{if(!(t>2)>0?(e-s)*this.tv[r]>>15:0}if(0===this.alpha)for(;;){if(--r<0){if((r=i-t&3)>0){o=this.palette[s>>8];do{n[h++]=o,r--}while(r>0);return}break}o=this.palette[s>>8],s+=l,n[h++]=o,n[h++]=o,n[h++]=o,n[h++]=o}else{const e=this.alpha,a=256-this.alpha;for(;;){if(--r<0){if((r=i-t&3)>0){o=this.palette[s>>8],o=((16711935&o)*a>>8&16711935)+((65280&o)*a>>8&65280);do{n[h++]=o+((16711935&n[h])*e>>8&16711935)+((65280&n[h])*e>>8&65280),r--}while(r>0)}break}o=this.palette[s>>8],s+=l,o=((16711935&o)*a>>8&16711935)+((65280&o)*a>>8&65280),n[h++]=o+((16711935&n[h])*e>>8&16711935)+((65280&n[h])*e>>8&65280),n[h++]=o+((16711935&n[h])*e>>8&16711935)+((65280&n[h])*e>>8&65280),n[h++]=o+((16711935&n[h])*e>>8&16711935)+((65280&n[h])*e>>8&65280),n[h++]=o+((16711935&n[h])*e>>8&16711935)+((65280&n[h])*e>>8&65280)}}}else if(tthis.s_&&(i=this.s_),t<0&&(s-=t*l,t=0),t>=i))return;if(h+=t,r=i-t,0===this.alpha)do{n[h++]=this.palette[s>>8],s+=l,r--}while(r>0);else{const t=this.alpha,i=256-this.alpha;do{o=this.palette[s>>8],s+=l,o=((16711935&o)*i>>8&16711935)+((65280&o)*i>>8&65280),n[h++]=o+((16711935&n[h])*t>>8&16711935)+((65280&n[h])*t>>8&65280),r--}while(r>0)}}};static Iv=(t,i,s,e,n,h,r)=>{let o=0;n!==e&&(o=(i-t<<16)/(n-e)|0);let l=0;h!==n&&(l=(s-i<<16)/(h-n)|0);let a=0;if(h!==e&&(a=(t-s<<16)/(e-h)|0),e<=n&&e<=h){if(ethis.bottom&&(n=this.bottom),h>this.bottom&&(h=this.bottom),nl)for(h-=n,n-=e,e=this.lw[e];;){if(--n<0)for(;;){if(--h<0)return;this.Cv(s>>16,i>>16,this.aw,e,r),s+=a,i+=l,e+=this.cw}this.Cv(s>>16,t>>16,this.aw,e,r),s+=a,t+=o,e+=this.cw}else for(h-=n,n-=e,e=this.lw[e];;){if(--n<0)for(;;){if(--h<0)return;this.Cv(i>>16,s>>16,this.aw,e,r),s+=a,i+=l,e+=this.cw}this.Cv(t>>16,s>>16,this.aw,e,r),s+=a,t+=o,e+=this.cw}else if(i=t<<=16,e<0&&(i-=a*e,t-=o*e,e=0),s<<=16,h<0&&(s-=l*h,h=0),e!==h&&ao)for(n-=h,h-=e,e=this.lw[e];;){if(--h<0)for(;;){if(--n<0)return;this.Cv(s>>16,t>>16,this.aw,e,r),s+=l,t+=o,e+=this.cw}this.Cv(i>>16,t>>16,this.aw,e,r),i+=a,t+=o,e+=this.cw}else for(n-=h,h-=e,e=this.lw[e];;){if(--h<0)for(;;){if(--n<0)return;this.Cv(t>>16,s>>16,this.aw,e,r),s+=l,t+=o,e+=this.cw}this.Cv(t>>16,i>>16,this.aw,e,r),i+=a,t+=o,e+=this.cw}}else if(n<=h){if(nthis.bottom&&(h=this.bottom),e>this.bottom&&(e=this.bottom),ha)for(e-=h,h-=n,n=this.lw[n];;){if(--h<0)for(;;){if(--e<0)return;this.Cv(t>>16,s>>16,this.aw,n,r),t+=o,s+=a,n+=this.cw}this.Cv(t>>16,i>>16,this.aw,n,r),t+=o,i+=l,n+=this.cw}else for(e-=h,h-=n,n=this.lw[n];;){if(--h<0)for(;;){if(--e<0)return;this.Cv(s>>16,t>>16,this.aw,n,r),t+=o,s+=a,n+=this.cw}this.Cv(i>>16,t>>16,this.aw,n,r),t+=o,i+=l,n+=this.cw}else if(s=i<<=16,n<0&&(s-=o*n,i-=l*n,n=0),t<<=16,e<0&&(t-=a*e,e=0),o>16,i>>16,this.aw,n,r),t+=a,i+=l,n+=this.cw}this.Cv(s>>16,i>>16,this.aw,n,r),s+=o,i+=l,n+=this.cw}else for(h-=e,e-=n,n=this.lw[n];;){if(--e<0)for(;;){if(--h<0)return;this.Cv(i>>16,t>>16,this.aw,n,r),t+=a,i+=l,n+=this.cw}this.Cv(i>>16,s>>16,this.aw,n,r),s+=o,i+=l,n+=this.cw}}else if(hthis.bottom&&(e=this.bottom),n>this.bottom&&(n=this.bottom),e>16,t>>16,this.aw,h,r),i+=l,t+=o,h+=this.cw}this.Cv(i>>16,s>>16,this.aw,h,r),i+=l,s+=a,h+=this.cw}else for(n-=e,e-=h,h=this.lw[h];;){if(--e<0)for(;;){if(--n<0)return;this.Cv(t>>16,i>>16,this.aw,h,r),i+=l,t+=o,h+=this.cw}this.Cv(s>>16,i>>16,this.aw,h,r),i+=l,s+=a,h+=this.cw}else if(t=s<<=16,h<0&&(t-=l*h,s-=a*h,h=0),i<<=16,n<0&&(i-=o*n,n=0),l>16,s>>16,this.aw,h,r),i+=o,s+=a,h+=this.cw}this.Cv(t>>16,s>>16,this.aw,h,r),t+=l,s+=a,h+=this.cw}else for(e-=n,n-=h,h=this.lw[h];;){if(--n<0)for(;;){if(--e<0)return;this.Cv(s>>16,i>>16,this.aw,h,r),i+=o,s+=a,h+=this.cw}this.Cv(s>>16,t>>16,this.aw,h,r),t+=l,s+=a,h+=this.cw}};static c_=(t,i,s,e,n,h,r,o,l,a,c,f,u,d,w,y,A,p,m)=>{const g=this.Ev(m);this.av=!this.cv[m];const _=a-u,I=c-w,C=f-A,E=d-a,v=y-c,b=p-f;let T=E*c-v*a<<14;const O=v*f-b*c<<8,R=b*a-E*f<<5;let S=_*c-I*a<<14;const L=I*f-C*c<<8,x=C*a-_*f<<5;let M=I*E-_*v<<14;const k=C*v-I*b<<8,D=_*b-C*E<<5;let F=0,N=0;n!==e&&(F=(i-t<<16)/(n-e)|0,N=(o-r<<16)/(n-e)|0);let B=0,P=0;h!==n&&(B=(s-i<<16)/(h-n)|0,P=(l-o<<16)/(h-n)|0);let U=0,W=0;if(h!==e&&(U=(t-s<<16)/(e-h)|0,W=(r-l<<16)/(e-h)|0),e<=n&&e<=h){if(ethis.bottom&&(n=this.bottom),h>this.bottom&&(h=this.bottom),nB)for(h-=n,n-=e,e=this.lw[e];;){if(--n<0)for(;;){if(--h<0)return;this.vv(s>>16,i>>16,this.aw,e,g,0,0,T,S,M,O,L,k,l>>8,o>>8),s+=U,i+=B,l+=W,o+=P,e+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}this.vv(s>>16,t>>16,this.aw,e,g,0,0,T,S,M,O,L,k,l>>8,r>>8),s+=U,t+=F,l+=W,r+=N,e+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}else for(h-=n,n-=e,e=this.lw[e];;){if(--n<0)for(;;){if(--h<0)return;this.vv(i>>16,s>>16,this.aw,e,g,0,0,T,S,M,O,L,k,o>>8,l>>8),s+=U,i+=B,l+=W,o+=P,e+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}this.vv(t>>16,s>>16,this.aw,e,g,0,0,T,S,M,O,L,k,r>>8,l>>8),s+=U,t+=F,l+=W,r+=N,e+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}}else{i=t<<=16,o=r<<=16,e<0&&(i-=U*e,t-=F*e,o-=W*e,r-=N*e,e=0),s<<=16,l<<=16,h<0&&(s-=B*h,l-=P*h,h=0);const a=e-this.ra;if(T+=R*a,S+=x*a,M+=D*a,T|=0,S|=0,M|=0,(e===h||U>=F)&&(e!==h||B<=F))for(n-=h,h-=e,e=this.lw[e];;){if(--h<0)for(;;){if(--n<0)return;this.vv(t>>16,s>>16,this.aw,e,g,0,0,T,S,M,O,L,k,r>>8,l>>8),s+=B,t+=F,l+=P,r+=N,e+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}this.vv(t>>16,i>>16,this.aw,e,g,0,0,T,S,M,O,L,k,r>>8,o>>8),i+=U,t+=F,o+=W,r+=N,e+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}else for(n-=h,h-=e,e=this.lw[e];;){if(--h<0)for(;;){if(--n<0)return;this.vv(s>>16,t>>16,this.aw,e,g,0,0,T,S,M,O,L,k,l>>8,r>>8),s+=B,t+=F,l+=P,r+=N,e+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}this.vv(i>>16,t>>16,this.aw,e,g,0,0,T,S,M,O,L,k,o>>8,r>>8),i+=U,t+=F,o+=W,r+=N,e+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}}}else if(n<=h){if(nthis.bottom&&(h=this.bottom),e>this.bottom&&(e=this.bottom),hU)for(e-=h,h-=n,n=this.lw[n];;){if(--h<0)for(;;){if(--e<0)return;this.vv(t>>16,s>>16,this.aw,n,g,0,0,T,S,M,O,L,k,r>>8,l>>8),t+=F,s+=U,r+=N,l+=W,n+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}this.vv(t>>16,i>>16,this.aw,n,g,0,0,T,S,M,O,L,k,r>>8,o>>8),t+=F,i+=B,r+=N,o+=P,n+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}else for(e-=h,h-=n,n=this.lw[n];;){if(--h<0)for(;;){if(--e<0)return;this.vv(s>>16,t>>16,this.aw,n,g,0,0,T,S,M,O,L,k,l>>8,r>>8),t+=F,s+=U,r+=N,l+=W,n+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}this.vv(i>>16,t>>16,this.aw,n,g,0,0,T,S,M,O,L,k,o>>8,r>>8),t+=F,i+=B,r+=N,o+=P,n+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}}else{s=i<<=16,l=o<<=16,n<0&&(s-=F*n,i-=B*n,l-=N*n,o-=P*n,n=0),t<<=16,r<<=16,e<0&&(t-=U*e,r-=W*e,e=0);const a=n-this.ra;if(T+=R*a,S+=x*a,M+=D*a,T|=0,S|=0,M|=0,h-=e,e-=n,n=this.lw[n],F>16,i>>16,this.aw,n,g,0,0,T,S,M,O,L,k,r>>8,o>>8),t+=U,i+=B,r+=W,o+=P,n+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}this.vv(s>>16,i>>16,this.aw,n,g,0,0,T,S,M,O,L,k,l>>8,o>>8),s+=F,i+=B,l+=N,o+=P,n+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}else for(;;){if(--e<0)for(;;){if(--h<0)return;this.vv(i>>16,t>>16,this.aw,n,g,0,0,T,S,M,O,L,k,o>>8,r>>8),t+=U,i+=B,r+=W,o+=P,n+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}this.vv(i>>16,s>>16,this.aw,n,g,0,0,T,S,M,O,L,k,o>>8,l>>8),s+=F,i+=B,l+=N,o+=P,n+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}}}else if(hthis.bottom&&(e=this.bottom),n>this.bottom&&(n=this.bottom),e>16,t>>16,this.aw,h,g,0,0,T,S,M,O,L,k,o>>8,r>>8),i+=B,t+=F,o+=P,r+=N,h+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}this.vv(i>>16,s>>16,this.aw,h,g,0,0,T,S,M,O,L,k,o>>8,l>>8),i+=B,s+=U,o+=P,l+=W,h+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}else for(;;){if(--e<0)for(;;){if(--n<0)return;this.vv(t>>16,i>>16,this.aw,h,g,0,0,T,S,M,O,L,k,r>>8,o>>8),i+=B,t+=F,o+=P,r+=N,h+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}this.vv(s>>16,i>>16,this.aw,h,g,0,0,T,S,M,O,L,k,l>>8,o>>8),i+=B,s+=U,o+=P,l+=W,h+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}}else{t=s<<=16,r=l<<=16,h<0&&(t-=B*h,s-=U*h,r-=P*h,l-=W*h,h=0),i<<=16,o<<=16,n<0&&(i-=F*n,o-=N*n,n=0);const a=h-this.ra;if(T+=R*a,S+=x*a,M+=D*a,T|=0,S|=0,M|=0,e-=n,n-=h,h=this.lw[h],B>16,s>>16,this.aw,h,g,0,0,T,S,M,O,L,k,o>>8,l>>8),i+=F,s+=U,o+=N,l+=W,h+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}this.vv(t>>16,s>>16,this.aw,h,g,0,0,T,S,M,O,L,k,r>>8,l>>8),t+=B,s+=U,r+=P,l+=W,h+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}else for(;;){if(--n<0)for(;;){if(--e<0)return;this.vv(s>>16,i>>16,this.aw,h,g,0,0,T,S,M,O,L,k,l>>8,o>>8),i+=F,s+=U,o+=N,l+=W,h+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}this.vv(s>>16,t>>16,this.aw,h,g,0,0,T,S,M,O,L,k,l>>8,r>>8),t+=B,s+=U,r+=P,l+=W,h+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}}};static vv=(t,i,s,e,n,h,r,o,l,a,c,f,u,d,w)=>{if(t>=i)return;let y,A,p,m,g,_,I,C,E;if(this.i_){if(y=(w-d)/(i-t)|0,i>this.s_&&(i=this.s_),t<0&&(d-=t*y,t=0),t>=i)return;A=i-t>>3,y<<=12}else i-t>7?(A=i-t>>3,y=(w-d)*this.tv[A]>>6):(A=0,y=0);if(d<<=9,e+=t,this.st&&n)if(p=0,m=0,_=t-this.ha,o+=(c>>3)*_,l+=(f>>3)*_,a+=(u>>3)*_,o|=0,l|=0,g=(a|=0)>>12,0!==g&&(r=l/g|0,(h=o/g|0)<0?h=0:h>4032&&(h=4032)),o+=c,l+=f,a+=u,o|=0,l|=0,g=(a|=0)>>12,0!==g&&(p=o/g|0,m=l/g|0,p<7?p=7:p>4032&&(p=4032)),I=p-h>>3,C=m-r>>3,h+=d>>3&786432,E=d>>23,this.av){for(;A-- >0;)s[e++]=n[(4032&r)+(h>>6)]>>>E,h+=I,r+=C,s[e++]=n[(4032&r)+(h>>6)]>>>E,h+=I,r+=C,s[e++]=n[(4032&r)+(h>>6)]>>>E,h+=I,r+=C,s[e++]=n[(4032&r)+(h>>6)]>>>E,h+=I,r+=C,s[e++]=n[(4032&r)+(h>>6)]>>>E,h+=I,r+=C,s[e++]=n[(4032&r)+(h>>6)]>>>E,h+=I,r+=C,s[e++]=n[(4032&r)+(h>>6)]>>>E,h+=I,r+=C,s[e++]=n[(4032&r)+(h>>6)]>>>E,h=p,r=m,o+=c,l+=f,g=(a+=u)>>12,0!==g&&(p=o/g|0,m=l/g|0,p<7?p=7:p>4032&&(p=4032)),I=p-h>>3,C=m-r>>3,h+=(d+=y)>>3&786432,E=d>>23;for(A=i-t&7;A-- >0;)s[e++]=n[(4032&r)+(h>>6)]>>>E,h+=I,r+=C}else{for(;A-- >0;){let t;0!=(t=n[(4032&r)+(h>>6)]>>>E)&&(s[e]=t),e+=1,0!=(t=n[(4032&(r+=C))+((h+=I)>>6)]>>>E)&&(s[e]=t),e++,0!=(t=n[(4032&(r+=C))+((h+=I)>>6)]>>>E)&&(s[e]=t),e++,0!=(t=n[(4032&(r+=C))+((h+=I)>>6)]>>>E)&&(s[e]=t),e++,0!=(t=n[(4032&(r+=C))+((h+=I)>>6)]>>>E)&&(s[e]=t),e++,0!=(t=n[(4032&(r+=C))+((h+=I)>>6)]>>>E)&&(s[e]=t),e++,0!=(t=n[(4032&(r+=C))+((h+=I)>>6)]>>>E)&&(s[e]=t),e++,0!=(t=n[(4032&(r+=C))+((h+=I)>>6)]>>>E)&&(s[e]=t),e+=1,h=p,r=m,o+=c,l+=f,a+=u,o|=0,l|=0,g=(a|=0)>>12,0!==g&&(p=o/g|0,m=l/g|0,p<7?p=7:p>4032&&(p=4032)),I=p-h>>3,C=m-r>>3,h+=(d+=y)>>3&786432,E=d>>23}for(A=i-t&7;A-- >0;){let t;0!=(t=n[(4032&r)+(h>>6)]>>>E)&&(s[e]=t),e++,h+=I,r+=C}}else if(p=0,m=0,_=t-this.ha,o+=(c>>3)*_,l+=(f>>3)*_,a+=(u>>3)*_,o|=0,l|=0,g=(a|=0)>>14,0!==g&&(r=l/g|0,(h=o/g|0)<0?h=0:h>16256&&(h=16256)),o+=c,l+=f,a+=u,o|=0,l|=0,g=(a|=0)>>14,0!==g&&(p=o/g|0,m=l/g|0,p<7?p=7:p>16256&&(p=16256)),I=p-h>>3,C=m-r>>3,h+=6291456&d,E=d>>23,this.av&&n){for(;A-- >0;)s[e++]=n[(16256&r)+(h>>7)]>>>E,h+=I,r+=C,s[e++]=n[(16256&r)+(h>>7)]>>>E,h+=I,r+=C,s[e++]=n[(16256&r)+(h>>7)]>>>E,h+=I,r+=C,s[e++]=n[(16256&r)+(h>>7)]>>>E,h+=I,r+=C,s[e++]=n[(16256&r)+(h>>7)]>>>E,h+=I,r+=C,s[e++]=n[(16256&r)+(h>>7)]>>>E,h+=I,r+=C,s[e++]=n[(16256&r)+(h>>7)]>>>E,h+=I,r+=C,s[e++]=n[(16256&r)+(h>>7)]>>>E,h=p,r=m,o+=c,l+=f,a+=u,o|=0,l|=0,g=(a|=0)>>14,0!==g&&(p=o/g|0,m=l/g|0,p<7?p=7:p>16256&&(p=16256)),I=p-h>>3,C=m-r>>3,h+=6291456&(d+=y),E=d>>23;for(A=i-t&7;A-- >0;)s[e++]=n[(16256&r)+(h>>7)]>>>E,h+=I,r+=C}else{for(;A-- >0&&n;){let t;0!=(t=n[(16256&r)+(h>>7)]>>>E)&&(s[e]=t),e+=1,0!=(t=n[(16256&(r+=C))+((h+=I)>>7)]>>>E)&&(s[e]=t),e++,0!=(t=n[(16256&(r+=C))+((h+=I)>>7)]>>>E)&&(s[e]=t),e++,0!=(t=n[(16256&(r+=C))+((h+=I)>>7)]>>>E)&&(s[e]=t),e++,0!=(t=n[(16256&(r+=C))+((h+=I)>>7)]>>>E)&&(s[e]=t),e++,0!=(t=n[(16256&(r+=C))+((h+=I)>>7)]>>>E)&&(s[e]=t),e++,0!=(t=n[(16256&(r+=C))+((h+=I)>>7)]>>>E)&&(s[e]=t),e++,0!=(t=n[(16256&(r+=C))+((h+=I)>>7)]>>>E)&&(s[e]=t),e++,h=p,r=m,o+=c,l+=f,a+=u,o|=0,l|=0,g=(a|=0)>>14,0!==g&&(p=o/g|0,m=l/g|0,p<7?p=7:p>16256&&(p=16256)),I=p-h>>3,C=m-r>>3,h+=6291456&(d+=y),E=d>>23}for(A=i-t&7;A-- >0&&n;){let t;0!=(t=n[(16256&r)+(h>>7)]>>>E)&&(s[e]=t),e++,h+=I,r+=C}}};static Cv=(t,i,s,e,n)=>{if(this.i_&&(i>this.s_&&(i=this.s_),t<0&&(t=0)),t>=i)return;e+=t;let h=i-t>>2;if(0===this.alpha)for(;;){if(h--,h<0)for(h=i-t&3;;){if(h--,h<0)return;s[e++]=n}s[e++]=n,s[e++]=n,s[e++]=n,s[e++]=n}const r=this.alpha,o=256-this.alpha;for(n=((16711935&n)*o>>8&16711935)+((65280&n)*o>>8&65280);;){if(h--,h<0)for(h=i-t&3;;){if(h--,h<0)return;s[e++]=n+((16711935&s[e])*r>>8&16711935)+((65280&s[e])*r>>8&65280)}s[e++]=n+((16711935&s[e])*r>>8&16711935)+((65280&s[e])*r>>8&65280),s[e++]=n+((16711935&s[e])*r>>8&16711935)+((65280&s[e])*r>>8&65280),s[e++]=n+((16711935&s[e])*r>>8&16711935)+((65280&s[e])*r>>8&65280),s[e++]=n+((16711935&s[e])*r>>8&16711935)+((65280&s[e])*r>>8&65280)}};static mv=t=>{this.hv[t]&&this.nv&&(this.nv[this.rv++]=this.hv[t],this.hv[t]=null)};static Ev=t=>{if(this.ov[t]=this.Ip++,this.hv[t])return this.hv[t];let i;if(this.rv>0&&this.nv)i=this.nv[--this.rv],this.nv[this.rv]=null;else{let t=0,s=-1;for(let i=0;i>>3)&16316671,i[n+8192]=h-(h>>>2)&16316671,i[n+12288]=h-(h>>>2)-(h>>>3)&16316671}}else{if(64===s.width)for(let t=0;t<128;t++)for(let n=0;n<128;n++)i[n+(t<<7)]=e[s.aw[(n>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)i[t]=e[s.aw[t]];this.cv[t]=!1;for(let s=0;s<16384;s++){i[s]&=16316671;const e=i[s];0===e&&(this.cv[t]=!0),i[s+16384]=e-(e>>>3)&16316671,i[s+32768]=e-(e>>>2)&16316671,i[s+49152]=e-(e>>>2)-(e>>>3)&16316671}}return i}}},880:(t,i,s)=>{s.d(i,{r:()=>n});var e=s(7854);const n=async t=>{255!==t[0]&&(t[0]=255),URL.revokeObjectURL(e.LE.src),e.LE.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>e.LE.onload=()=>t())),e.SE.clearRect(0,0,e.xE.width,e.xE.height);const i=e.LE.naturalWidth,s=e.LE.naturalHeight;return e.xE.width=i,e.xE.height=s,e.SE.drawImage(e.LE,0,0),e.SE.getImageData(0,0,i,s)}},8665:(t,i,s)=>{s.d(i,{A:()=>f});var e=s(1069),n=s(8950),h=s(4583),r=s(6730),o=s(4474),l=s(3867);class a{Od=0;Ag=0;bv=0;Tv=-1;Ov=-1;Rv=-1;Sv=-1;Lv=-1;xv=-1;Mv=-1;kv=-1;Dv=-1;Fv=0;Nv=-1;Bv=-1;Pv=-1;data=null}class c{x=0;y=0;z=0;w=0}class f extends o.A{static metadata=null;static head=null;static Uv=null;static Wv=null;static Gv=null;static Hv=null;static Yv=null;static Vv=null;static Kv=null;static Xv=null;static jv=null;static zv=null;static Zv=null;static qv=null;static axis=null;static Jv=new l.ds(4096,!1);static $v=new l.ds(4096,!1);static Qv=new Int32Array(4096);static tb=new Int32Array(4096);static ib=new Int32Array(4096);static sb=new Int32Array(4096);static eb=new Int32Array(4096);static nb=new Int32Array(4096);static hb=new Int32Array(1500);static rb=new l.Kh(1500,512);static ob=new Int32Array(12);static lb=new l.Kh(12,2e3);static ab=new Int32Array(2e3);static cb=new Int32Array(2e3);static fb=new Int32Array(12);static ub=new Int32Array(10);static wb=new Int32Array(10);static yb=new Int32Array(10);static gh=0;static Ab=0;static _h=0;static pb=!1;static kl=0;static Dl=0;static mb=0;static gb=new Int32Array(1e3);static _b=!1;static ru(t){try{f.head=new e.A(t.read('ob_head.dat')),f.Uv=new e.A(t.read('ob_face1.dat')),f.Wv=new e.A(t.read('ob_face2.dat')),f.Gv=new e.A(t.read('ob_face3.dat')),f.Hv=new e.A(t.read('ob_face4.dat')),f.Yv=new e.A(t.read('ob_face5.dat')),f.Vv=new e.A(t.read('ob_point1.dat')),f.Kv=new e.A(t.read('ob_point2.dat')),f.Xv=new e.A(t.read('ob_point3.dat')),f.jv=new e.A(t.read('ob_point4.dat')),f.zv=new e.A(t.read('ob_point5.dat')),f.Zv=new e.A(t.read('ob_vertex1.dat')),f.qv=new e.A(t.read('ob_vertex2.dat')),f.axis=new e.A(t.read('ob_axis.dat')),f.head.af=0,f.Vv.af=0,f.Kv.af=0,f.Xv.af=0,f.jv.af=0,f.Zv.af=0,f.qv.af=0;const i=f.head.ou;f.metadata=new l.ds(i+100,null);let s=0,n=0,h=0,r=0,o=0,c=0,u=0;for(let t=0;t>7)<2?i=2:i>126&&(i=126),(65408&t)+i):(i<0?i=0:i>127&&(i=127),127-i)}static Td=(t,i,s)=>{const e=t.Od,n=t.Ag,h=t.bv;let r,o,a,u,d;if(i){r=new Int32Array(e);for(let i=0;i{const n=t.Od,h=t.Ag,r=t.bv;let o,l,a,c,u;if(e)o=t.Rd,l=t.Ld,a=t.Sd;else{o=new Int32Array(n),l=new Int32Array(n),a=new Int32Array(n);for(let i=0;i{const s=t.Od,e=t.Ag,n=t.bv,h=new Int32Array(s),r=new Int32Array(s),o=new Int32Array(s);for(let i=0;i{let s=!1,e=!1,n=!1,h=!1,r=0,o=0,l=0,a=-1;for(let c=0;c{let s=!1,e=!1,n=!1,h=!1,r=0,o=0,l=0,a=-1;for(let c=0;c{let o=-1;const l=t.Rd[i],a=t.Ld[i],c=t.Sd[i];for(let t=0;t{if(!f.metadata)throw new Error('cant loading model metadata!!!!!');const i=f.metadata[t];if(!i)throw console.log(`Error model:${t} not found!`),new Error('cant loading model metadata!!!!!');if(!(f.head&&f.Uv&&f.Wv&&f.Gv&&f.Hv&&f.Yv&&f.Vv&&f.Kv&&f.Xv&&f.jv&&f.zv&&f.Zv&&f.qv&&f.axis))throw new Error('cant loading model!!!!!');const s=i.Od,e=i.Ag,n=i.bv,h=new Int32Array(s),r=new Int32Array(s),o=new Int32Array(s),l=new Int32Array(e),a=new Int32Array(e),c=new Int32Array(e),u=new Int32Array(n),d=new Int32Array(n),w=new Int32Array(n);let y=null;i.Lv>=0&&(y=new Int32Array(s));let A=null;i.Dv>=0&&(A=new Int32Array(e));let p=null,m=0;i.Fv>=0?p=new Int32Array(e):m=-i.Fv-1;let g=null;i.Nv>=0&&(g=new Int32Array(e));let _=null;i.Bv>=0&&(_=new Int32Array(e));const I=new Int32Array(e);f.Vv.af=i.Tv,f.Kv.af=i.Ov,f.Xv.af=i.Rv,f.jv.af=i.Sv,f.zv.af=i.Lv;let C,E,v,b=0,T=0,O=0;for(let t=0;t{if(!f.metadata||!f.metadata[i])throw new Error('No model metadata');const s=f.metadata[i];if(s.data=t,!s.data.length)throw new Error('No model data');const n=s.Od,h=s.Ag,r=s.bv,o=new Int32Array(n),l=new Int32Array(n),a=new Int32Array(n),c=new Int32Array(h),u=new Int32Array(h),d=new Int32Array(h),w=new Int32Array(r),y=new Int32Array(r),A=new Int32Array(r);let p=null;s.Lv>=0&&(p=new Int32Array(n));let m=null;s.Dv>=0&&(m=new Int32Array(h));let g=null,_=0;s.Fv>=0?g=new Int32Array(h):_=-s.Fv-1;let I=null;s.Nv>=0&&(I=new Int32Array(h));let C=null;s.Bv>=0&&(C=new Int32Array(h));const E=new Int32Array(h),v=new e.A(s.data);v.af=s.Tv;const b=new e.A(s.data);b.af=s.Ov;const T=new e.A(s.data);T.af=s.Rv;const O=new e.A(s.data);O.af=s.Sv;const R=new e.A(s.data);R.af=s.Lv;let S,L,x,M=0,k=0,D=0;for(let t=0;tthis.Pd&&(this.Pd=-s),s>this.cg&&(this.cg=s);const n=i*i+e*e;n>this.fp&&(this.fp=n)}this.fp=Math.sqrt(this.fp)+.99|0,this.Mb=Math.sqrt(this.fp*this.fp+this.Pd*this.Pd)+.99|0,this.xb=this.Mb+(Math.sqrt(this.fp*this.fp+this.cg*this.cg)+.99|0)}xd(){this.Pd=0,this.cg=0;for(let t=0;tthis.Pd&&(this.Pd=-i),i>this.cg&&(this.cg=i)}this.Mb=Math.sqrt(this.fp*this.fp+this.Pd*this.Pd)+.99|0,this.xb=this.Mb+(Math.sqrt(this.fp*this.fp+this.cg*this.cg)+.99|0)}xa(){if(this.kb){const t=new Int32Array(256);let i=0;for(let s=0;si&&(i=e)}this.Fd=new l.ds(i+1,null);for(let s=0;s<=i;s++)this.Fd[s]=new Int32Array(t[s]),t[s]=0;let s=0;for(;si&&(i=e)}this.Dd=new l.ds(i+1,null);for(let s=0;s<=i;s++)this.Dd[s]=new Int32Array(t[s]),t[s]=0;let s=0;for(;sl;)l=s[o++];h&&h.types&&e.x&&e.y&&e.z&&h.labels&&(i!==l||0===h.types[i])&&this.Pb(e.x[t],e.y[t],e.z[t],h.labels[i],h.types[i])}f.gh=0,f.Ab=0,f._h=0,o=0,l=s[o++];for(let t=0;tl;)l=s[o++];h&&h.types&&n.x&&n.y&&n.z&&h.labels&&(i===l||0===h.types[i])&&this.Pb(n.x[t],n.y[t],n.z[t],h.labels[i],h.types[i])}}else this.Ma(t)}Ma(t){if(!this.Fd||-1===t||!r.A.So[t])return;const i=r.A.So[t],s=i.TE;f.gh=0,f.Ab=0,f._h=0;for(let t=0;t>16;this.Sd[t]=this.Ld[t]*i+this.Sd[t]*s>>16,this.Ld[t]=e}}translate(t,i,s){for(let e=0;e>8;if(this.Eb&&this.vb&&this.bb||(this.Eb=new Int32Array(this.Ag),this.vb=new Int32Array(this.Ag),this.bb=new Int32Array(this.Ag)),!this.sg){this.sg=new l.ds(this.Od,null);for(let t=0;t8192||p>8192||m>8192||A<-8192||p<-8192||m<-8192;)A>>=1,p>>=1,m>>=1;let g=0|Math.sqrt(A*A+p*p+m*m);if(g<=0&&(g=1),A=256*A/g|0,p=256*p/g|0,m=256*m/g|0,this.yg&&1&this.yg[i]){const h=t+((s*A+e*p+n*m)/(r+(r/2|0))|0);this.Eu&&(this.Eb[i]=f.Cb(this.Eu[i],h,this.yg[i]))}else{let t=this.sg[h];t&&(t.x+=A,t.y+=p,t.z+=m,t.w++),t=this.sg[o],t&&(t.x+=A,t.y+=p,t.z+=m,t.w++),t=this.sg[l],t&&(t.x+=A,t.y+=p,t.z+=m,t.w++)}}if(h)this.hg(t,r,s,e,n);else{this.ag=new l.ds(this.Od,null);for(let t=0;t>16;for(let e=0;e>16,_=_*w-g*d>>16,g=m),0!==t&&(m=_*a-I*l>>16,I=_*l+I*a>>16,_=m),0!==i&&(m=I*c+g*u>>16,I=I*u-g*c>>16,g=m),g+=n,_+=r,I+=o,m=_*A-I*y>>16,I=_*y+I*A>>16,_=m,f.Qv&&f.tb&&f.ib&&(f.ib[e]=I-p,f.Qv[e]=h.A.ha+((g<<9)/I|0),f.tb[e]=h.A.ra+((_<<9)/I|0)),this.bv>0&&f.sb&&f.eb&&f.nb&&(f.sb[e]=g,f.eb[e]=_,f.nb[e]=I)}try{this.Gb(!1,!1,0)}catch(t){}}draw(t,i,s,e,r,o,l,a,c){const u=a*r-o*e>>16,d=l*i+u*s>>16,w=this.fp*s>>16,y=d+w;if(y<=50||d>=3500)return;const A=a*e+o*r>>16;let p=A-this.fp<<9;if((p/y|0)>=n.A.jE)return;let m=A+this.fp<<9;if((m/y|0)<=-n.A.jE)return;const g=l*s-u*i>>16,_=this.fp*i>>16;let I=g+_<<9;if((I/y|0)<=-n.A.zE)return;let C=g-(_+(this.Pd*s>>16))<<9;if((C/y|0)>=n.A.zE)return;let E=d-(w+(this.Pd*i>>16))<=50,v=!1;if(c>0&&f.pb){let t=d-w;t<=50&&(t=50),A>0?(p=p/y|0,m=m/t|0):(m=m/y|0,p=p/t|0),g>0?(C=C/y|0,I=I/t|0):(I=I/y|0,C=C/t|0);const i=f.kl-h.A.ha,s=f.Dl-h.A.ra;i>p&&iC&&s>16,w=w*R-c*O>>16,c=h),c+=o,u+=l,w+=a,h=w*e+c*r>>16,w=w*r-c*e>>16,c=h,h=u*s-w*i>>16,w=u*i+w*s>>16,u=h,f.ib&&(f.ib[n]=w-d),w>=50&&f.Qv&&f.tb?(f.Qv[n]=b+((c<<9)/w|0),f.tb[n]=T+((u<<9)/w|0)):f.Qv&&(f.Qv[n]=-5e3,E=!0),(E||this.bv>0)&&f.sb&&f.eb&&f.nb&&(f.sb[n]=c,f.eb[n]=u,f.nb[n]=w)}try{this.Gb(E,v,c)}catch(t){}}Gb(t,i,s,e=!1){f._b&&(this.Nb=-1,this.Bb=-1);for(let t=0;tn.A.s_||a>n.A.s_||c>n.A.s_),f.rb&&f.hb){const t=((y+A+p)/3|0)+this.Mb;f.rb[t][f.hb[t]++]=e,f._b&&this.Hb(f.kl,f.Dl,u,d,w,l,a,c)&&this.Bb=0;t--){const i=f.hb[t];if(!(i<=0)&&f.rb){const s=f.rb[t];for(let t=0;t=0;t--){const i=f.hb[t];if(i>0&&f.rb){const s=f.rb[t];for(let e=0;e0||f.ob[2]>0)&&(h=(f.fb[1]+f.fb[2])/(f.ob[1]+f.ob[2])|0);let r=0;f.ob&&f.fb&&(f.ob[3]>0||f.ob[4]>0)&&(r=(f.fb[3]+f.fb[4])/(f.ob[3]+f.ob[4])|0);let o=0;if(f.ob&&f.fb&&(f.ob[6]>0||f.ob[8]>0)&&(o=(f.fb[6]+f.fb[8])/(f.ob[6]+f.ob[8])|0),f.ob&&f.lb){let t,i=0,s=f.ob[10],n=f.lb[10],l=f.ab;i===s&&(i=0,s=f.ob[11],n=f.lb[11],l=f.cb),t=ih;)this.Yb(n[i++],e),i===s&&n!==f.lb[11]&&(i=0,s=f.ob[11],n=f.lb[11],l=f.cb),t=ir;)this.Yb(n[i++],e),i===s&&n!==f.lb[11]&&(i=0,s=f.ob[11],n=f.lb[11],l=f.cb),t=io;)this.Yb(n[i++],e),i===s&&n!==f.lb[11]&&(i=0,s=f.ob[11],n=f.lb[11],l=f.cb),t=i>2,r=this.Rb[i],o=this.Sb[i],l=this.Lb[i];h.A.c_(f.Qv[s],f.Qv[e],f.Qv[n],f.tb[s],f.tb[e],f.tb[n],this.Eb[t],this.vb[t],this.bb[t],f.sb[r],f.eb[r],f.nb[r],f.sb[o],f.sb[l],f.eb[o],f.eb[l],f.nb[o],f.nb[l],this.Eu[t])}else if(3===r&&this.yg&&this.Eu&&this.Eb&&f.Qv&&f.tb&&f.sb&&f.eb&&f.nb){const i=this.yg[t]>>2,r=this.Rb[i],o=this.Sb[i],l=this.Lb[i];h.A.c_(f.Qv[s],f.Qv[e],f.Qv[n],f.tb[s],f.tb[e],f.tb[n],this.Eb[t],this.Eb[t],this.Eb[t],f.sb[r],f.eb[r],f.nb[r],f.sb[o],f.sb[l],f.eb[o],f.eb[l],f.nb[o],f.nb[l],this.Eu[t])}}Vb(t,i=!1){let s=0;if(f.nb){const i=h.A.ha,e=h.A.ra,n=this.pg[t],r=this.mg[t],o=this.gg[t],l=f.nb[n],a=f.nb[r],c=f.nb[o];if(l>=50&&f.Qv&&f.tb&&this.Eb)f.ub[s]=f.Qv[n],f.wb[s]=f.tb[n],f.yb[s++]=this.Eb[t];else if(f.sb&&f.eb&&this.Eb){const u=f.sb[n],d=f.eb[n],w=this.Eb[t];if(c>=50&&this.bb){const n=(50-l)*h.A.iv[c-l];f.ub[s]=i+((u+((f.sb[o]-u)*n>>16)<<9)/50|0),f.wb[s]=e+((d+((f.eb[o]-d)*n>>16)<<9)/50|0),f.yb[s++]=w+((this.bb[t]-w)*n>>16)}if(a>=50&&this.vb){const n=(50-l)*h.A.iv[a-l];f.ub[s]=i+((u+((f.sb[r]-u)*n>>16)<<9)/50|0),f.wb[s]=e+((d+((f.eb[r]-d)*n>>16)<<9)/50|0),f.yb[s++]=w+((this.vb[t]-w)*n>>16)}}if(a>=50&&f.Qv&&f.tb&&this.vb)f.ub[s]=f.Qv[r],f.wb[s]=f.tb[r],f.yb[s++]=this.vb[t];else if(f.sb&&f.eb&&this.vb){const u=f.sb[r],d=f.eb[r],w=this.vb[t];if(l>=50&&this.Eb){const r=(50-a)*h.A.iv[l-a];f.ub[s]=i+((u+((f.sb[n]-u)*r>>16)<<9)/50|0),f.wb[s]=e+((d+((f.eb[n]-d)*r>>16)<<9)/50|0),f.yb[s++]=w+((this.Eb[t]-w)*r>>16)}if(c>=50&&this.bb){const n=(50-a)*h.A.iv[c-a];f.ub[s]=i+((u+((f.sb[o]-u)*n>>16)<<9)/50|0),f.wb[s]=e+((d+((f.eb[o]-d)*n>>16)<<9)/50|0),f.yb[s++]=w+((this.bb[t]-w)*n>>16)}}if(c>=50&&f.Qv&&f.tb&&this.bb)f.ub[s]=f.Qv[o],f.wb[s]=f.tb[o],f.yb[s++]=this.bb[t];else if(f.sb&&f.eb&&this.bb){const u=f.sb[o],d=f.eb[o],w=this.bb[t];if(a>=50&&this.vb){const n=(50-c)*h.A.iv[a-c];f.ub[s]=i+((u+((f.sb[r]-u)*n>>16)<<9)/50|0),f.wb[s]=e+((d+((f.eb[r]-d)*n>>16)<<9)/50|0),f.yb[s++]=w+((this.vb[t]-w)*n>>16)}if(l>=50&&this.Eb){const r=(50-c)*h.A.iv[l-c];f.ub[s]=i+((u+((f.sb[n]-u)*r>>16)<<9)/50|0),f.wb[s]=e+((d+((f.eb[n]-d)*r>>16)<<9)/50|0),f.yb[s++]=w+((this.Eb[t]-w)*r>>16)}}}const e=f.ub[0],r=f.ub[1],o=f.ub[2],l=f.wb[0],a=f.wb[1],c=f.wb[2];if(!((e-r)*(c-a)-(l-a)*(o-r)<=0))if(h.A.i_=!1,3===s){let s;if((e<0||r<0||o<0||e>n.A.s_||r>n.A.s_||o>n.A.s_)&&(h.A.i_=!0),s=this.yg?3&this.yg[t]:0,i)h.A.qE(e,r,l,a,f.yb[0]),h.A.qE(r,o,a,c,f.yb[1]),h.A.qE(o,e,c,l,f.yb[2]);else if(0===s)h.A.r_(e,r,o,l,a,c,f.yb[0],f.yb[1],f.yb[2]);else if(1===s&&this.Eb)h.A.Iv(e,r,o,l,a,c,h.A.palette[this.Eb[t]]);else if(2===s&&this.yg&&this.Eu&&f.sb&&f.eb&&f.nb){const i=this.yg[t]>>2,s=this.Rb[i],n=this.Sb[i],u=this.Lb[i];h.A.c_(e,r,o,l,a,c,f.yb[0],f.yb[1],f.yb[2],f.sb[s],f.eb[s],f.nb[s],f.sb[n],f.sb[u],f.eb[n],f.eb[u],f.nb[n],f.nb[u],this.Eu[t])}else if(3===s&&this.yg&&this.Eu&&this.Eb&&f.sb&&f.eb&&f.nb){const i=this.yg[t]>>2,s=this.Rb[i],n=this.Sb[i],u=this.Lb[i];h.A.c_(e,r,o,l,a,c,this.Eb[t],this.Eb[t],this.Eb[t],f.sb[s],f.eb[s],f.nb[s],f.sb[n],f.sb[u],f.eb[n],f.eb[u],f.nb[n],f.nb[u],this.Eu[t])}}else if(4===s){let s;if((e<0||r<0||o<0||e>n.A.s_||r>n.A.s_||o>n.A.s_||f.ub[3]<0||f.ub[3]>n.A.s_)&&(h.A.i_=!0),s=this.yg?3&this.yg[t]:0,i)h.A.qE(e,r,l,a,f.yb[0]),h.A.qE(r,o,a,c,f.yb[1]),h.A.qE(o,f.ub[3],c,f.wb[3],f.yb[2]),h.A.qE(f.ub[3],e,f.wb[3],l,f.yb[3]);else if(0===s)h.A.r_(e,r,o,l,a,c,f.yb[0],f.yb[1],f.yb[2]),h.A.r_(e,o,f.ub[3],l,c,f.wb[3],f.yb[0],f.yb[2],f.yb[3]);else if(1===s){if(this.Eb){const i=h.A.palette[this.Eb[t]];h.A.Iv(e,r,o,l,a,c,i),h.A.Iv(e,o,f.ub[3],l,c,f.wb[3],i)}}else if(2===s&&this.yg&&this.Eu&&f.sb&&f.eb&&f.nb){const i=this.yg[t]>>2,s=this.Rb[i],n=this.Sb[i],u=this.Lb[i];h.A.c_(e,r,o,l,a,c,f.yb[0],f.yb[1],f.yb[2],f.sb[s],f.eb[s],f.nb[s],f.sb[n],f.sb[u],f.eb[n],f.eb[u],f.nb[n],f.nb[u],this.Eu[t]),h.A.c_(e,o,f.ub[3],l,c,f.wb[3],f.yb[0],f.yb[2],f.yb[3],f.sb[s],f.eb[s],f.nb[s],f.sb[n],f.sb[u],f.eb[n],f.eb[u],f.nb[n],f.nb[u],this.Eu[t])}else if(3===s&&this.yg&&this.Eu&&this.Eb&&f.sb&&f.eb&&f.nb){const i=this.yg[t]>>2,s=this.Rb[i],n=this.Sb[i],u=this.Lb[i];h.A.c_(e,r,o,l,a,c,this.Eb[t],this.Eb[t],this.Eb[t],f.sb[s],f.eb[s],f.nb[s],f.sb[n],f.sb[u],f.eb[n],f.eb[u],f.nb[n],f.nb[u],this.Eu[t]),h.A.c_(e,o,f.ub[3],l,c,f.wb[3],this.Eb[t],this.Eb[t],this.Eb[t],f.sb[s],f.eb[s],f.nb[s],f.sb[n],f.sb[u],f.eb[n],f.eb[u],f.nb[n],f.nb[u],this.Eu[t])}}}Pb(t,i,s,e,n){if(!e)return;const r=e.length;if(0===n){let n=0;f.gh=0,f.Ab=0,f._h=0;for(let t=0;t0?(f.gh=(f.gh/n|0)+t,f.Ab=(f.Ab/n|0)+i,f._h=(f._h/n|0)+s):(f.gh=t,f.Ab=i,f._h=s)}else if(1===n)for(let n=0;n=this.Fd.length)continue;const r=this.Fd[h];if(r)for(let e=0;e=this.Fd.length)continue;const o=this.Fd[r];if(o)for(let e=0;e>16;this.Ld[n]=this.Ld[n]*u-this.Rd[n]*c>>16,this.Rd[n]=t}if(0!==r){c=h.A.sin[r],u=h.A.cos[r];const t=this.Ld[n]*u-this.Sd[n]*c>>16;this.Sd[n]=this.Ld[n]*c+this.Sd[n]*u>>16,this.Ld[n]=t}if(0!==l){c=h.A.sin[l],u=h.A.cos[l];const t=this.Sd[n]*c+this.Rd[n]*u>>16;this.Sd[n]=this.Sd[n]*u-this.Rd[n]*c>>16,this.Rd[n]=t}this.Rd[n]+=f.gh,this.Ld[n]+=f.Ab,this.Sd[n]+=f._h}}else if(3===n)for(let n=0;n=this.Fd.length)continue;const r=this.Fd[h];if(r)for(let e=0;e=this.Dd.length)continue;const n=this.Dd[s];if(n)for(let i=0;i255&&(this.Ob[s]=255)}}}Wb(){this.Pd=0,this.fp=0,this.cg=0,this.fg=999999,this.ug=-999999,this.wg=-99999,this.dg=99999;for(let t=0;tthis.ug&&(this.ug=i),ethis.wg&&(this.wg=e),-s>this.Pd&&(this.Pd=-s),s>this.cg&&(this.cg=s);const n=i*i+e*e;n>this.fp&&(this.fp=n)}this.fp=0|Math.sqrt(this.fp),this.Mb=0|Math.sqrt(this.fp*this.fp+this.Pd*this.Pd),this.xb=this.Mb+(0|Math.sqrt(this.fp*this.fp+this.cg*this.cg))}Hb(t,i,s,e,n,h,r,o){return!(is&&i>e&&i>n)&&(!(t{s.d(i,{A:()=>o});var e=s(8950),n=s(1069),h=s(4474),r=s(880);class o extends h.A{aw;width;height;Xb;jb;Nl;nw;constructor(t,i){super(),this.aw=new Int32Array(t*i),this.width=this.Nl=t,this.height=this.nw=i,this.Xb=this.jb=0}static zb=async(t,i)=>{const s=t.read(i+'.dat');if(!s)throw new Error(`${i} jpeg not found!`);const e=await(0,r.r)(s),n=new o(e.width,e.height),h=new Uint32Array(e.data.buffer),l=n.aw;for(let t=0;t>24&255)<<24|(255&i)<<16|(i>>8&255)<<8|i>>16&255}return n};static Cu=(t,i,s=0)=>{const e=new n.A(t.read(i+'.dat')),h=new n.A(t.read('index.dat'));h.af=e.ou;const r=h.ou,l=h.ou,a=[],c=h.au-1;for(let t=0;te.length||h.af>h.length)throw new Error;const f=h.au,u=h.au,d=h.ou,w=h.ou,y=new o(d,w);y.Xb=f,y.jb=u,y.Nl=r,y.nw=l;const A=h.au;if(0===A){const t=y.width*y.height;for(let i=0;ie.A.bottom&&(h-=i+h-e.A.bottom),te.A.right){const i=t+r-e.A.right;r-=i,l+=i,o+=i}r>0&&h>0&&this.Zb(r,h,this.aw,n,l,e.A.aw,s,o)}Fl(t,i,s){i|=0,s|=0;let n=(i+=this.Xb)+(s+=this.jb)*e.A.cw,h=0,r=this.height,o=this.width,l=e.A.cw-o,a=0;if(se.A.bottom&&(r-=s+r-e.A.bottom),ie.A.right){const t=i+o-e.A.right;o-=t,a+=t,l+=t}o>0&&r>0&&this.qb(o,r,this.aw,h,a,e.A.aw,n,l,t)}Jb(t,i){t|=0,i|=0;let s=(t+=this.Xb)+(i+=this.jb)*e.A.cw,n=0,h=this.height,r=this.width,o=e.A.cw-r,l=0;if(ie.A.bottom&&(h-=i+h-e.A.bottom),te.A.right){const i=t+r-e.A.right;r-=i,l+=i,o+=i}r>0&&h>0&&this.$b(r,h,this.aw,n,l,e.A.aw,s,o)}Qb(){const t=this.aw,i=this.width,s=this.height;for(let e=0;e>16&255;h+=t,h<1?h=1:h>255&&(h=255);let r=n>>8&255;r+=i,r<1?r=1:r>255&&(r=255);let o=255&n;o+=s,o<1?o=1:o>255&&(o=255),this.aw[e]=(h<<16)+(r<<8)+o}}}Iw(t,i,s,n){t|=0,i|=0,s|=0,n|=0;try{const h=this.width;let r=0,o=0;const l=this.Nl,a=this.nw,c=(l<<16)/s|0,f=(a<<16)/n|0;t+=(this.Xb*s+l-1)/l|0,i+=(this.jb*n+a-1)/a|0,this.Xb*s%l!=0&&(r=(l-this.Xb*s%l<<16)/s|0),this.jb*n%a!=0&&(o=(a-this.jb*n%a<<16)/n|0),s=s*(this.width-(r>>16))/l|0,n=n*(this.height-(o>>16))/a|0;let u=t+i*e.A.cw,d=e.A.cw-s;if(ie.A.bottom&&(n-=i+n-e.A.bottom),te.A.right){const i=t+s-e.A.right;s-=i,d+=i}this.scale(s,n,this.aw,r,o,e.A.aw,d,u,h,c,f)}catch(t){console.error('error in sprite clipping routine')}}iT(t,i,s,n,h,r,o,l,a,c){t|=0,i|=0,s|=0,n|=0;try{const f=-s/2|0,u=-n/2|0,d=65536*Math.sin(a/326.11)|0,w=65536*Math.cos(a/326.11)|0,y=d*c>>8,A=w*c>>8;let p=(o<<16)+u*y+f*A,m=u*A-f*y+(l<<16),g=t+i*e.A.cw;for(let t=0;t>16)+(o>>16)*this.width],n+=A,o-=y;p+=y,m+=A,g+=e.A.cw}}catch(t){}}sT(t,i,s){t|=0,i|=0;let n=(t+=this.Xb)+(i+=this.jb)*e.A.cw,h=0,r=this.height,o=this.width,l=e.A.cw-o,a=0;if(ie.A.bottom&&(r-=i+r-e.A.bottom),te.A.right){const i=t+o-e.A.right;o-=i,a+=i,l+=i}o>0&&r>0&&this.eT(o,r,this.aw,a,h,e.A.aw,n,l,s.aw)}scale(t,i,s,e,n,h,r,o,l,a,c){try{const f=e;for(let u=-i;u<0;u++){const i=(n>>16)*l;for(let n=-t;n<0;n++){const t=s[(e>>16)+i];0===t?o++:h[o++]=t,e+=a}n+=c,e=f,o+=r}}catch(t){console.error('error in plot_scale')}}$b(t,i,s,e,n,h,r,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++)h[r++]=s[e++],h[r++]=s[e++],h[r++]=s[e++],h[r++]=s[e++];for(let i=t;i<0;i++)h[r++]=s[e++];r+=o,e+=n}}qb(t,i,s,e,n,h,r,o,l){const a=256-l;for(let c=-i;c<0;c++){for(let i=-t;i<0;i++){const t=s[e++];if(0===t)r++;else{const i=h[r];h[r++]=((16711935&t)*l+(16711935&i)*a&4278255360)+((65280&t)*l+(65280&i)*a&16711680)>>8}}r+=o,e+=n}}Zb(t,i,s,e,n,h,r,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=s[e++];0===t?r++:h[r++]=t,t=s[e++],0===t?r++:h[r++]=t,t=s[e++],0===t?r++:h[r++]=t,t=s[e++],0===t?r++:h[r++]=t}for(let i=t;i<0;i++){const t=s[e++];0===t?r++:h[r++]=t}r+=o,e+=n}}eT(t,i,s,e,n,h,r,o,l){const a=-(t>>2);t=-(3&t);for(let c=-i;c<0;c++){for(let t=a;t<0;t++){let t=s[n++];0!==t&&0===l[r]?h[r++]=t:r++,t=s[n++],0!==t&&0===l[r]?h[r++]=t:r++,t=s[n++],0!==t&&0===l[r]?h[r++]=t:r++,t=s[n++],0!==t&&0===l[r]?h[r++]=t:r++}for(let i=t;i<0;i++){const t=s[n++];0!==t&&0===l[r]?h[r++]=t:r++}r+=o,n+=e}}}},1673:(t,i,s)=>{s.d(i,{A:()=>r});var e=s(8950),n=s(1069),h=s(4474);class r extends h.A{aw;width;height;Xb;jb;Nl;nw;palette;constructor(t,i,s){super(),this.aw=new Int8Array(t*i),this.width=this.Nl=t,this.height=this.nw=i,this.Xb=this.jb=0,this.palette=s}static Cu=(t,i,s=0)=>{const e=new n.A(t.read(i+'.dat')),h=new n.A(t.read('index.dat'));h.af=e.ou;const o=h.ou,l=h.ou,a=h.au,c=new Int32Array(a);for(let t=1;te.length||h.af>h.length)throw new Error;const f=h.au,u=h.au,d=h.ou,w=h.ou,y=new r(d,w,c);y.Xb=f,y.jb=u,y.Nl=o,y.nw=l;const A=y.aw,p=h.au;if(0===p){const t=y.width*y.height;for(let i=0;ie.A.bottom&&(h-=i+h-e.A.bottom),te.A.right){const i=t+r-e.A.right;r-=i,l+=i,o+=i}r>0&&h>0&&this.nT(r,h,this.aw,n,l,e.A.aw,s,o)}Qb(){const t=this.aw,i=this.width,s=this.height;for(let e=0;e>16&255;n+=t,n<0?n=0:n>255&&(n=255);let h=this.palette[e]>>8&255;h+=i,h<0?h=0:h>255&&(h=255);let r=255&this.palette[e];r+=s,r<0?r=0:r>255&&(r=255),this.palette[e]=(n<<16)+(h<<8)+r}}yv(){this.Nl|=0,this.nw|=0,this.Nl/=2,this.nw/=2,this.Nl|=0,this.nw|=0;const t=new Int8Array(this.Nl*this.nw);let i=0;for(let s=0;s>1)+(s+this.jb>>1)*this.Nl]=this.aw[i++];this.aw=t,this.width=this.Nl,this.height=this.nw,this.Xb=0,this.jb=0}Iw(){if(this.width===this.Nl&&this.height===this.nw)return;const t=new Int8Array(this.Nl*this.nw);let i=0;for(let s=0;s>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=s[e++];0===t?r++:h[r++]=this.palette[255&t],t=s[e++],0===t?r++:h[r++]=this.palette[255&t],t=s[e++],0===t?r++:h[r++]=this.palette[255&t],t=s[e++],0===t?r++:h[r++]=this.palette[255&t]}for(let i=t;i<0;i++){const t=s[e++];0===t?r++:h[r++]=this.palette[255&t]}r+=o,e+=n}}clip(t,i,s,n){try{const h=this.width;this.height;let r=0,o=0;const l=this.Nl,a=this.nw,c=(l<<16)/s|0,f=(a<<16)/n|0;t=t+(this.Xb*s+l-1)/l|0,i=i+(this.jb*n+a-1)/a|0,this.Xb*s%l!=0&&(r=(l-this.Xb*s%l<<16)/s|0),this.jb*n%a!=0&&(o=(a-this.jb*n%a<<16)/n|0),s=s*(this.width-(r>>16))/l|0,n=n*(this.height-(o>>16))/a|0;let u,d=t+i*e.A.cw,w=e.A.cw-s;ie.A.bottom&&(n-=i+n-e.A.bottom),te.A.right&&(u=t+s-e.A.right,s-=u,w+=u),this.hT(e.A.aw,this.aw,this.palette,r,o,d,w,s,n,c,f,h)}catch(t){console.log('error in sprite clipping routine')}}hT(t,i,s,e,n,h,r,o,l,a,c,f){try{const u=e;for(let d=-l;d<0;d++){const l=(n>>16)*f;for(let n=-o;n<0;n++){const n=i[(e>>16)+l];0==n?h++:t[h++]=s[255&n],e+=a}n+=c,e=u,h+=r}}catch(t){console.log('error in plot_scale')}}}},2682:(t,i,s)=>{s.d(i,{A:()=>l});var e=s(8950),n=s(1069),h=s(4474);class r{seed;constructor(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}rT(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}oT(){return this.next(32)}next(t){return this.seed=0x5deece66dn*this.seed+0xbn&(1n<<48n)-1n,Number(this.seed)>>>48-t}}var o=s(9298);class l extends h.A{static lT='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!"£$%^&*()-_=+[{]};:\'@#~,<.>/?\\| ';static aT=[];static{const t=navigator.userAgent.includes('Capacitor');for(let i=0;i<256;i++){let s=l.lT.indexOf(String.fromCharCode(i));t&&s>=63&&s--,-1===s&&(s=74),l.aT[i]=s}}cT=[];fT=new Int32Array(94);uT=new Int32Array(94);dT=new Int32Array(94);wT=new Int32Array(94);yT=new Int32Array(95);AT=new Int32Array(256);random=new r(BigInt(Date.now()));height=0;static Cu=(t,i)=>{const s=new n.A(t.read(i+'.dat')),e=new n.A(t.read('index.dat'));e.af=s.ou+4;const h=e.au;h>0&&(e.af+=3*(h-1));const r=new l;for(let t=0;t<94;t++){r.dT[t]=e.au,r.wT[t]=e.au;const i=r.fT[t]=e.ou,n=r.uT[t]=e.ou,h=e.au,o=i*n;if(r.cT[t]=new Int8Array(o),0===h)for(let e=0;er.height&&(r.height=n),r.dT[t]=1,r.yT[t]=i+2;{let s=0;for(let e=n/7|0;e=e.A.bottom&&(h-=s+h+1-e.A.bottom),i=e.A.right){const t=i+n+1-e.A.right;n-=t,a+=t,l+=t}n>0&&h>0&&this.bT(n,h,t,c,a,e.A.aw,o,l,r)}CT(t,i,s,n,h,r,o){s|=0,n|=0;let l=(t|=0)+(i|=0)*e.A.cw,a=e.A.cw-s,c=0,f=0;if(i=e.A.bottom&&(n-=i+n+1-e.A.bottom),t=e.A.right){const i=t+s+1-e.A.right;s-=i,c+=i,a+=i}s>0&&n>0&&this.TT(s,n,e.A.aw,l,a,o,f,c,h,r)}bT(t,i,s,e,n,h,r,o,l){const a=-((t|=0)>>2);t=-(3&t);for(let c=-(i|=0);c<0;c++){for(let t=a;t<0;t++)0===s[e++]?r++:h[r++]=l,0===s[e++]?r++:h[r++]=l,0===s[e++]?r++:h[r++]=l,0===s[e++]?r++:h[r++]=l;for(let i=t;i<0;i++)0===s[e++]?r++:h[r++]=l;r+=o,e+=n}}TT(t,i,s,e,n,h,r,o,l,a){t|=0;const c=((16711935&l)*a&4278255360)+((65280&l)*a&16711680)>>8,f=256-a;for(let l=-(i|=0);l<0;l++){for(let i=-t;i<0;i++)if(0===h[r++])e++;else{const t=s[e];s[e++]=(((16711935&t)*f&4278255360)+((65280&t)*f&16711680)>>8)+c}e+=n,r+=o}}mT(t){return'red'===t?o.A.RED:'gre'===t?o.A.GREEN:'blu'===t?o.A.BLUE:'yel'===t?o.A.Wl:'cya'===t?o.A.ME:'mag'===t?o.A.sp:'whi'===t?o.A._l:'bla'===t?o.A.Ul:'lre'===t?o.A.kE:'dre'===t?o.A.DE:'dbl'===t?o.A.FE:'or1'===t?o.A.NE:'or2'===t?o.A.BE:'or3'===t?o.A.PE:'gr1'===t?o.A.UE:'gr2'===t?o.A.WE:'gr3'===t?o.A.GE:o.A.Ul}split(t,i){if(0===t.length)return[t];const s=[];for(;t.length>0;){if(this.gT(t)<=i&&-1===t.indexOf('|')){s.push(t);break}let e=t.length;for(let s=0;si)break;e=s}else if('|'===t[s]){e=s;break}s.push(t.substring(0,e)),t=t.substring(e+1)}return s}}},1183:(t,i,s)=>{s.d(i,{A:()=>h});var e=s(8950),n=s(7854);class h{OT;width;height;RT;ST;aw;constructor(t,i,s=n.zo){this.RT=s,this.OT=this.RT.getImageData(0,0,t,i),this.ST=new Uint32Array(this.OT.data.buffer),this.aw=new Int32Array(t*i),this.width=t,this.height=i,this.bind()}clear(){this.aw.fill(0)}bind(){e.A.bind(this.aw,this.width,this.height)}draw(t,i){this.#t(),this.RT.putImageData(this.OT,t,i)}#t(){const t=this.aw.length,i=this.aw,s=this.ST;for(let e=0;e>16&255|(t>>8&255)<<8|(255&t)<<16|4278190080}}}},4544:(t,i,s)=>{s.d(i,{A:()=>e});class e{db;constructor(t){t.onerror=this.onerror,t.onclose=this.onclose,this.db=t}static openDatabase=async()=>await new Promise(((t,i)=>{const s=indexedDB.open('lostcity',1);s.onsuccess=i=>{const s=i.target;console.log('database success!'),t(s.result)},s.onupgradeneeded=t=>{t.target.result.createObjectStore('cache')},s.onerror=t=>{const s=t.target;console.error('database error!: ',s.error),i(s.result)}}));Po=async t=>await new Promise((i=>{const s=this.db.transaction('cache','readonly').objectStore('cache').get(t);s.onsuccess=()=>{i(s.result)},s.onerror=t=>{i(void 0)}}));Yo=async(t,i)=>await new Promise(((s,e)=>{const n=this.db.transaction('cache','readwrite').objectStore('cache').put(i,t);n.onsuccess=()=>{s()},n.onerror=t=>{e()}}));onclose=t=>{console.log('database close!')};onerror=t=>{console.log('database error!')};LT=t=>{const i=t.trim();let s=0;for(let t=0;t='A'&&e<='Z'?s+=e.charCodeAt(0)+1-65:e>='a'&&e<='z'?s+=e.charCodeAt(0)+1-97:e>='0'&&e<='9'&&(s+=e.charCodeAt(0)+27-48)}return s}}},2901:(t,i,s)=>{s.d(i,{A:()=>h});var e=s(1069),n=s(1908);class h{static LT=t=>{let i=0;t=t.toUpperCase();for(let s=0;s=this.MT)return null;if(this.BT[t])return this.BT[t];const i=this.NT[t],s=i+this.FT[t];if(this.xT){const e=Uint8Array.from(this.buffer.subarray(i,i+s));return this.BT[t]=e,e}{const i=Uint8Array.from(n.A.read(this.DT[t],this.buffer,this.FT[t],this.NT[t]));return this.BT[t]=i,i}}}},1069:(t,i,s)=>{s.d(i,{A:()=>r});var e=s(9234),n=s(6666),h=s(4474);class r extends h.A{static UT=3988292384;static WT=new Int32Array(256);static GT=new Uint32Array(33);static HT=new n.A;static YT=new n.A;static VT=new n.A;static KT=0;static XT=0;static jT=0;static{for(let t=0;t<32;t++)r.GT[t]=(1<>>=1:i=i>>>1^r.UT;r.WT[t]=i}}static Uo=t=>{let i=4294967295;for(let s=0;s>>8^r.WT[255&(i^t[s])];return~i};view;data;af=0;zT=0;random=null;constructor(t){if(!t)throw new Error('Input src packet array was null!');super(),t instanceof Int8Array?this.data=new Uint8Array(t):this.data=t,this.view=new DataView(this.data.buffer,this.data.byteOffset,this.data.byteLength)}get length(){return this.view.byteLength}get available(){return this.length-this.af}static Pt=t=>{let i=null;return 0===t&&r.KT>0?(r.KT--,i=r.HT.Bg()):1===t&&r.XT>0?(r.XT--,i=r.YT.Bg()):2===t&&r.jT>0&&(r.jT--,i=r.VT.Bg()),i?(i.af=0,i):new r(0===t?new Uint8Array(100):1===t?new Uint8Array(5e3):new Uint8Array(3e4))};release(){this.af=0,100===this.view.byteLength&&r.KT<1e3?(r.HT.MA(this),r.KT++):5e3===this.view.byteLength&&r.XT<250?(r.YT.MA(this),r.XT++):3e4===this.view.byteLength&&r.jT<50&&(r.VT.MA(this),r.jT++)}get au(){return this.view.getUint8(this.af++)}get bd(){return this.view.getInt8(this.af++)}get ou(){const t=this.view.getUint16(this.af);return this.af+=2,t}get fu(){const t=this.view.getInt16(this.af);return this.af+=2,t}get Gu(){const t=this.view.getUint8(this.af++)<<16|this.view.getUint16(this.af);return this.af+=2,t}get Ko(){const t=this.view.getInt32(this.af);return this.af+=4,t}get JC(){const t=this.view.getBigInt64(this.af);return this.af+=8,t}get OE(){return this.view.getUint8(this.af)<128?this.au-64:this.ou-49152}get cp(){return this.view.getUint8(this.af)<128?this.au:this.ou-32768}get wu(){const t=this.view,i=t.byteLength;let s,e='';for(;10!==(s=t.getUint8(this.af++))&&this.af>16),this.view.setUint16(this.af,t),this.af+=2}p4(t){this.view.setInt32(this.af,t),this.af+=4}$T(t){this.view.setInt32(this.af,t,!0),this.af+=4}QT(t){this.view.setBigInt64(this.af,t),this.af+=8}tO(t){const i=this.view,s=t.length;for(let e=0;e>>3,s=8-(7&this.zT),e=0;for(this.zT+=t;t>s;s=8)e+=(this.view.getUint8(i++)&r.GT[s])<>>s-t&r.GT[t],e}rO(t,i){const s=this.af;this.af=0;const n=new Uint8Array(s);this.ZT(s,0,n);const h=(0,e.oO)(n),r=(0,e.lO)(h,i,t),o=(0,e.aO)(r);this.af=0,this.p1(o.length),this.iO(o,o.length,0)}}},3867:(t,i,s)=>{s.d(i,{qA:()=>a,ZA:()=>o,ds:()=>e,mp:()=>n,Er:()=>h,wp:()=>r,Kh:()=>l});class e extends Array{constructor(t,i){super(t);for(let s=0;s{s.d(i,{aO:()=>o,Go:()=>n,oO:()=>r,Ho:()=>e,Xa:()=>h,lO:()=>l});const e=async t=>new Promise((i=>setTimeout(i,t))),n=async t=>new Int8Array(await(await fetch(t)).arrayBuffer()),h=async t=>(await fetch(t)).text();function r(t){let i=0n;for(let s=0;s0n;)i.unshift(Number(0xffn&t)),t>>=8n;return 128&i[0]&&i.unshift(0),new Uint8Array(i)}function l(t,i,s){let e=1n;for(;i>0n;)i%2n===1n&&(e=e*t%s),t=t*t%s,i>>=1n;return e}},9073:(t,i,s)=>{s.a(t,(async(t,i)=>{try{var e=s(1908),n=s(2901),h=s(9234),r=s(1069),o=s(7604),l=s(7046),a=s(3867),c=s(1673),f=s(2511),u=s(2682),d=s(8950),w=s(4544),y=s(1651);class t extends l.A{static cO=!1;static fO=!0;db=null;uO=3200;dO=3200;sizeX=1280;sizeZ=1344;wO=2240;yO=2752;AO=1e3;pO=0;mO=[];gO=[];_O=[];IO=[];CO=[0];EO=[0];vO=[];bO=[];TO=[];OO=[];RO=[];SO=[];LO=[];xO=[];As=[];ps=[];Es=null;vs=null;bs=null;Ts=null;MO=null;kO=[];DO=!0;FO=0;NO=-1;BO=-1;PO=-1;UO=-1;WO=!1;GO=['General Store','Sword Shop','Magic Shop','Axe Shop','Helmet Shop','Bank','Quest Start','Amulet Shop','Mining Site','Furnace','Anvil','Combat Training','Dungeon','Staff Shop','Platebody Shop','Platelegs Shop','Scimitar Shop','Archery Shop','Shield Shop','Altar','Herbalist','Jewelery','Gem Shop','Crafting Shop','Candle Shop','Fishing Shop','Fishing Spot','Clothes Shop','Apothecary','Silk Trader','Kebab Seller','Pub/Bar','Mace Shop','Tannery','Rare Trees','Spinning Wheel','Food Shop','Cookery Shop','???','Water Source','Cooking Range','Skirt Shop','Potters Wheel','Windmill','Mining Shop','Chainmail Shop','Silver Shop','Fur Trader','Spice Shop'];HO=5;YO=13;VO=140;KO=470;XO=!1;jO=0;zO=0;ZO=-1;qO=0;JO=0;$O=0;QO=new Int32Array(2e3);tR=new Int32Array(2e3);iR=new Int32Array(2e3);Un=new Int32Array(2e3);Wn=new Int32Array(2e3);Gs=new Int32Array(2e3);Pn=0;sR=null;eR=200;nR=this.eR*this.sizeX/this.sizeZ|0;hR=635-this.nR-5;rR=503-this.eR-20;oR=!1;lR=8943445;aR=7824964;cR=6706483;fR=11141120;uR=10027008;dR=8912896;zoom=4;wR=4;offsetX=this.uO-this.wO;Dy=this.yO+this.sizeZ-this.dO;load=async()=>{await e.A.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new w.A(await w.A.openDatabase());const t=await this.yR();await this.Wo(100,'Please wait... Rendering Map');const i=new r.A(t.read('labels.dat'));this.pO=i.ou;for(let t=0;t{if(this.DO){this.DO=!1,this.FO=0,d.A.clear();const t=this.offsetX-(635/this.zoom|0),i=this.Dy-(503/this.zoom|0),s=this.offsetX+(635/this.zoom|0),e=this.Dy+(503/this.zoom|0);if(this.ER(t,i,s,e,0,0,635,503),this.oR&&(this.sR?.Jb(this.hR,this.rR),d.A.JE(this.hR+this.nR*t/this.sizeX|0,this.rR+this.eR*i/this.sizeZ|0,(s-t)*this.nR/this.sizeX|0,(e-i)*this.eR/this.sizeZ|0,16711680,128),d.A.gl(this.hR+this.nR*t/this.sizeX|0,this.rR+this.eR*i/this.sizeZ|0,(s-t)*this.nR/this.sizeX|0,(e-i)*this.eR/this.sizeZ|0,16711680),this.$O>0&&this.$O%10<5))for(let t=0;t0&&this.$O%10<5&&this.JO==i+this.zO&&(s=16776960),this.MO?.Bl(this.HO+20,t+13,this.GO[i+this.zO],s)}t+=17}}this.Bl(this.hR,this.rR+this.eR,this.nR,18,this.lR,this.aR,this.cR,'Overview'),this.Bl(this.HO,this.YO+this.KO,this.VO,18,this.lR,this.aR,this.cR,'Key'),3==this.wR?this.Bl(170,471,50,30,this.fR,this.uR,this.dR,'37%'):this.Bl(170,471,50,30,this.lR,this.aR,this.cR,'37%'),4==this.wR?this.Bl(230,471,50,30,this.fR,this.uR,this.dR,'50%'):this.Bl(230,471,50,30,this.lR,this.aR,this.cR,'50%'),6==this.wR?this.Bl(290,471,50,30,this.fR,this.uR,this.dR,'75%'):this.Bl(290,471,50,30,this.lR,this.aR,this.cR,'75%'),8==this.wR?this.Bl(350,471,50,30,this.fR,this.uR,this.dR,'100%'):this.Bl(350,471,50,30,this.lR,this.aR,this.cR,'100%')}this.FO--,this.FO<=0&&(this.xo?.draw(0,0),this.FO=50)};refresh=async()=>{this.FO=0};update=async()=>{1==this.fc[1]&&(this.offsetX=this.offsetX-16/this.zoom|0,this.DO=!0),1==this.fc[2]&&(this.offsetX=this.offsetX+16/this.zoom|0,this.DO=!0),1==this.fc[3]&&(this.Dy=this.Dy-16/this.zoom|0,this.DO=!0),1==this.fc[4]&&(this.Dy=this.Dy+16/this.zoom|0,this.DO=!0);let t=1;for(;t>0;)t=this.xc(),49==t?(this.wR=3,this.DO=!0):50==t?(this.wR=4,this.DO=!0):51==t?(this.wR=6,this.DO=!0):52==t?(this.wR=8,this.DO=!0):107==t||75==t?(this.XO=!this.XO,this.DO=!0):111!=t&&79!=t||(this.oR=!this.oR,this.DO=!0);if(1==this.lc&&(this.NO=this.ac,this.BO=this.cc,this.PO=this.offsetX,this.UO=this.Dy,this.ac>170&&this.ac<220&&this.cc>471&&this.cc<503?(this.wR=3,this.NO=-1):this.ac>230&&this.ac<280&&this.cc>471&&this.cc<503?(this.wR=4,this.NO=-1):this.ac>290&&this.ac<340&&this.cc>471&&this.cc<503?(this.wR=6,this.NO=-1):this.ac>350&&this.ac<400&&this.cc>471&&this.cc<503?(this.wR=8,this.NO=-1):this.ac>this.HO&&this.cc>this.YO+this.KO&&this.acthis.hR&&this.cc>this.rR+this.eR&&this.acthis.HO&&this.cc>this.YO&&this.acthis.HO&&this.cc>this.YO&&this.acthis.HO&&this.cc>this.YO+this.KO-18&&this.acthis.HO&&this.kl=t&&this.Dlthis.hR&&i>this.rR&&tthis.wR&&(this.zoom=this.wR)),this.zoom>this.wR&&(this.DO=!0,this.zoom-=this.zoom/30,this.zoomthis.jO&&(this.DO=!0,this.zO--),this.$O>0&&(this.DO=!0,this.$O--);const i=this.offsetX-(635/this.zoom|0),s=this.Dy-(503/this.zoom|0),e=this.offsetX+(635/this.zoom|0),n=this.Dy+(503/this.zoom|0);i<48&&(this.offsetX=48+(635/this.zoom|0)),s<48&&(this.Dy=48+(503/this.zoom|0)),e>this.sizeX-48&&(this.offsetX=this.sizeX-48-(635/this.zoom|0)),n>this.sizeZ-48&&(this.Dy=this.sizeZ-48-(503/this.zoom|0))};async yR(){let t=await(this.db?.Po('worldmap.dat'));if(t)return new n.A(t);let i=5;for(;!t;){await this.Wo(0,'Requesting map');try{console.log(`${y.K.nt}/worldmap.jag`),t=await(0,h.Go)(`${y.K.nt}/worldmap.jag`)}catch(s){t=void 0;for(let t=i;t>0;t--)await this.Wo(0,`Error loading - Will retry in ${t} secs.`),await(0,h.Ho)(1e3);i*=2,i>60&&(i=60)}}return await(this.db?.Yo('worldmap.dat',t)),new n.A(t)}Bl(t,i,s,e,n,h,r,o){t=Math.trunc(t),i=Math.trunc(i),s=Math.trunc(s),e=Math.trunc(e),d.A.gl(t,i,s,e,0);const l=t+1,a=i+1,c=s-2,f=e-2;d.A.fillRect(l,a,c,f,h),d.A.hl(l,a,n,c),d.A.el(l,a,n,f),d.A.hl(l,a+f-1,r,c),d.A.el(l+c-1,a,r,f),this.MO?._T(l+c/2+1,a+f/2+1+4,o,0),this.MO?._T(l+c/2,a+f/2+4,o,16777215)}CR(){for(let t=0;t10&&e>20)-(o>>20),n+=(i>>10&1023)-(o>>10&1023),h+=(1023&i)-(1023&o),h>0&&(this.kO[e][r]=this.vR(t/8533,n/8533,h/8533))}}}}AR(t){for(;t.available>0;){const i=64*t.au-this.wO,s=64*t.au-this.yO;if(i>0&&s>0&&i+640;){const i=64*t.au-this.wO,s=64*t.au-this.yO;if(i>0&&s>0&&i+640;){const i=64*t.au-this.wO,s=64*t.au-this.yO;if(i>0&&s>0&&i+640;){const i=64*t.au-this.wO,s=64*t.au-this.yO;if(i>0&&s>0&&i+640;){const i=64*t.au-this.wO,s=64*t.au-this.yO;if(i>0&&s>0&&i+641&&l--;let a=t-.3333333333333333;a<0&&a++,e=6*l<1?o+6*(r-o)*l:2*l<1?r:3*l<2?o+(r-o)*(.6666666666666666-l)*6:o,n=6*t<1?o+6*(r-o)*t:2*t<1?r:3*t<2?o+(r-o)*(.6666666666666666-t)*6:o,h=6*a<1?o+6*(r-o)*a:2*a<1?r:3*a<2?o+(r-o)*(.6666666666666666-a)*6:o}return((256*e|0)<<16)+((256*n|0)<<8)+(256*h|0)}ER(i,s,e,n,h,r,o,l){const a=e-i,c=n-s,f=(o-h<<16)/a|0,u=(l-r<<16)/c|0;for(let t=0;t>16,n=f*(t+1)>>16;const o=n-e;if(!(o<=0)){e+=h,n+=h;for(let h=0;h>16,a=u*(h+1)>>16;const c=a-l;if(c<=0)continue;l+=r,a+=r;const f=this.bO[t+i][h+s];if(0===f)d.A.fillRect(e,l,n-e,a-l,this.kO[t+i][h+s]);else{const n=this.TO[t+i][h+s],r=252&n;0==r||o<=1||c<=1?d.A.fillRect(e,l,o,c,f):this.bR(d.A.aw,l*d.A.cw+e,this.kO[t+i][h+s],f,o,c,r>>2,3&n)}}}}if(e-i>o-h)return;let w=0;for(let t=0;t>16,n=f*(t+1)>>16;const o=n-e;if(!(o<=0)){e+=h,n+=h;for(let h=0;h>16,a=u*(h+1)>>16;const c=a-l;if(c<=0)continue;l+=r,a+=r;let f=255&this.OO[t+i][h+s];if(0!=f){let t,i;t=1==o?e:n-1,i=1==c?l:a-1;let s=13421772;if((f>=5&&f<=8||f>=13&&f<=16||f>=21&&f<=24)&&(s=13369344,f-=4),27!=f&&28!=f||(s=13369344,f-=2),1==f)d.A.el(e,l,s,c);else if(2==f)d.A.hl(e,l,s,o);else if(3==f)d.A.el(t,l,s,c);else if(4==f)d.A.hl(e,i,s,o);else if(9==f)d.A.el(e,l,16777215,c),d.A.hl(e,l,s,o);else if(10==f)d.A.el(t,l,16777215,c),d.A.hl(e,l,s,o);else if(11==f)d.A.el(t,l,16777215,c),d.A.hl(e,i,s,o);else if(12==f)d.A.el(e,l,16777215,c),d.A.hl(e,i,s,o);else if(17==f)d.A.hl(e,l,s,1);else if(18==f)d.A.hl(t,l,s,1);else if(19==f)d.A.hl(t,i,s,1);else if(20==f)d.A.hl(e,i,s,1);else if(25==f)for(let t=0;t>16,n=f*(t+1)>>16;if(!(n-e<=0)){e+=h,n+=h;for(let n=0;n>16,o=u*(n+1)>>16;o-h<=0||(h+=r,o+=r,this.LO[t+i][n+s]&&this.Es?.draw(e,h))}}}for(let t=0;t>16,n=f*(t+1)>>16;if(!(n-e<=0)){e+=h,n+=h;for(let n=0;n>16,o=u*(n+1)>>16;o-h<=0||(h+=r,o+=r,this.xO[t+i][n+s]&&this.vs?.draw(e,h))}}}for(let t=0;t0)for(let t=0;t=71&&a<=73?this.MO?._T((y+u)/2,(A+w)/2,'u_pass',16711680):t>=32&&t<=34&&a>=70&&a<=74&&this.MO?._T((y+u)/2,(A+w)/2,'u_pass',16776960)}}bR(t,i,s,e,n,h,r,o){const l=d.A.cw-n;if(9==r?(r=1,o=o+1&3):10==r?(r=1,o=o+3&3):11==r&&(r=8,o=o+3&3),1==r){if(0==o)for(let r=0;r=0;r--){for(let h=0;h=r?e:s;i+=l}else if(3==o)for(let r=h-1;r>=0;r--){for(let h=0;h=r?e:s;i+=l}}else if(2==r){if(0==o)for(let r=h-1;r>=0;r--){for(let h=0;h>1?e:s;i+=l}else if(1==o)for(let r=0;r=r<<1?e:s;i+=l}else if(2==o)for(let r=0;r=0;h--)t[i++]=h<=r>>1?e:s;i+=l}else if(3==o)for(let r=h-1;r>=0;r--){for(let h=n-1;h>=0;h--)t[i++]=h>=r<<1?e:s;i+=l}}else if(3==r){if(0==o)for(let r=h-1;r>=0;r--){for(let h=n-1;h>=0;h--)t[i++]=h<=r>>1?e:s;i+=l}else if(1==o)for(let r=h-1;r>=0;r--){for(let h=0;h=r<<1?e:s;i+=l}else if(2==o)for(let r=0;r>1?e:s;i+=l}else if(3==o)for(let r=0;r=0;h--)t[i++]=h>=r<<1?e:s;i+=l}}else if(4==r){if(0==o)for(let r=h-1;r>=0;r--){for(let h=0;h=r>>1?e:s;i+=l}else if(1==o)for(let r=0;r=0;h--)t[i++]=h>=r>>1?e:s;i+=l}else if(3==o)for(let r=h-1;r>=0;r--){for(let h=n-1;h>=0;h--)t[i++]=h<=r<<1?e:s;i+=l}}else if(5==r){if(0==o)for(let r=h-1;r>=0;r--){for(let h=n-1;h>=0;h--)t[i++]=h>=r>>1?e:s;i+=l}else if(1==o)for(let r=h-1;r>=0;r--){for(let h=0;h=r>>1?e:s;i+=l}else if(3==o)for(let r=0;r=0;h--)t[i++]=h<=r<<1?e:s;i+=l}}else if(6==r){if(0==o)for(let r=0;r=n/2?e:s;i+=l}else if(3==o)for(let r=0;r=h/2?e:s;i+=l}}else if(7==r){if(0==o)for(let r=0;r=0;r--){for(let o=0;o=0;r--){for(let o=n-1;o>=0;o--)t[i++]=o<=r-h/2?e:s;i+=l}else if(3==o)for(let r=0;r=0;o--)t[i++]=o<=r-h/2?e:s;i+=l}}else if(8==r)if(0==o)for(let r=0;r=r-h/2?e:s;i+=l}else if(1==o)for(let r=h-1;r>=0;r--){for(let o=0;o=r-h/2?e:s;i+=l}else if(2==o)for(let r=h-1;r>=0;r--){for(let o=n-1;o>=0;o--)t[i++]=o>=r-h/2?e:s;i+=l}else if(3==o)for(let r=0;r=0;o--)t[i++]=o>=r-h/2?e:s;i+=l}}Mo(){return 0}ko(){return!1}Do(){return!1}Fo(){return-1}No(){return-1}}await(0,o.w)(),(new t).Oc().then((()=>{})),window.onkeydown=function(t){return!(' '===t.key&&t.target===document.body)},i()}catch(t){i(t)}}),1)},1908:(t,i,s)=>{s.d(i,{A:()=>n});var e=s(9763);class n{static TR=null;static load=async t=>{this.TR=await(0,e.F)(new WebAssembly.Module(t),{env:void 0})};static read=(t,i,s,e)=>{if(!this.TR)throw new Error('bz2 not found!!');return Int8Array.from(this.TR.read(t,i,s,e))}}},123:(t,i,s)=>{function e(t,i){window._tinyMidiPlay&&window._tinyMidiPlay(t,i/256)}function n(){window._tinyMidiStop&&window._tinyMidiStop()}s.d(i,{Xo:()=>e,Oo:()=>n})},9763:(t,i,s)=>{async function e(t,i={}){const s={env:Object.assign(Object.create(globalThis),i.env||{},{abort(t,i,s,e){t=r(t>>>0),i=r(i>>>0),s>>>=0,e>>>=0,(()=>{throw Error(`${t} in ${i}:${s}:${e}`)})()}})},{exports:e}=await WebAssembly.instantiate(t,s),n=e.memory||i.env.memory,h=Object.setPrototypeOf({read:(t,i,s,h)=>(i=function(t,i,s,h,r){if(null==h)return 0;const o=h.length,l=e.__pin(e.__new(o<>>0;if(r)new r(n.buffer,l,o).set(h);else for(let i=0;i>>0),h[i]);return e.__unpin(l),l}(l,6,0,i,Int8Array)||function(){throw TypeError("value must not be null")}(),function(t,i,s){if(!s)return null;const e=function(t){try{return o.getUint32(t,!0)}catch{return o=new DataView(n.buffer),o.getUint32(t,!0)}}(s-4)>>>i,h=new Array(e);for(let n=0;n>>0));return h}(a,0,e.read(t,i,s,h)>>>0))},e);function r(t){if(!t)return null;const i=t+new Uint32Array(n.buffer)[t-4>>>2]>>>1,s=new Uint16Array(n.buffer);let e=t>>>1,h="";for(;i-e>1024;)h+=String.fromCharCode(...s.subarray(e,e+=1024));return h+String.fromCharCode(...s.subarray(e,i))}let o=new DataView(n.buffer);function l(t,i){try{o.setUint8(t,i,!0)}catch{o=new DataView(n.buffer),o.setUint8(t,i,!0)}}function a(t){try{return o.getInt8(t,!0)}catch{return o=new DataView(n.buffer),o.getInt8(t,!0)}}return h}s.d(i,{F:()=>e})},9896:(t,i,s)=>{var e=s(8151);!function(){window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioContext&&(window.audioContext=new window.AudioContext);var t=function(i){if(window.audioContext){var s=window.audioContext.createBuffer(1,1,22050),e=window.audioContext.createBufferSource();e.buffer=s,e.connect(window.audioContext.destination),e.start?e.start(0):e.play?e.play(0):e.noteOn&&e.noteOn(0)}document.removeEventListener('touchstart',t),document.removeEventListener('touchend',t),document.removeEventListener('click',t)};document.addEventListener('touchstart',t),document.addEventListener('touchend',t),document.addEventListener('click',t)}(),(async()=>{let t=new Float32Array,i=window.audioContext.createGain();i.gain.value=.1,i.connect(window.audioContext.destination);let s=window.audioContext.currentTime,n=[];const h=new e.A({OR:30,RR:i=>{let s=new Float32Array(i.buffer),e=new Float32Array(t.length+s.length);e.set(t,0),e.set(s,t.length),t=e},SR:t=>{},bufferSize:102400});await h.init();const r=await fetch('./SCC1_Florestan.sf2'),o=new Uint8Array(await r.arrayBuffer());function l(){if(!window.audioContext||!t.length)return;let e=window.audioContext.createBufferSource();const h=t.length/2,r=window.audioContext.createBuffer(2,h,44100);for(let i=0;i<2;i++){const s=r.getChannelData(i);let e=i;for(let i=0;i{if(a&&clearInterval(a),t=new Float32Array,n.length){let t=i.gain.value;i.gain.value=0,n.forEach((t=>{t.stop(window.audioContext.currentTime)})),n=[],i.gain.value=t}},window._tinyMidiVolume=(t=1)=>{i.gain.value=t},window._tinyMidiPlay=async(t,i=1)=>{t&&(await window._tinyMidiStop(),-1!=i&&window._tinyMidiVolume(i),s=window.audioContext.currentTime,a=setInterval(l,250),h.xR(t))}})()},8151:(t,i,s)=>{s.d(i,{A:()=>n});var e=s(5473);const n=class{constructor(t={}){this.MR=void 0,this.kR=0,this.DR=0,this.FR=0,this.OR=t.OR||100,this.sampleRate=t.sampleRate||44100,this.NR=t.NR||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.BR(1),this.RR=t.RR||(()=>{}),this.SR=t.SR||(()=>{}),this.PR=void 0,this.test=0}async init(){if(!this.MR){if('undefined'!=typeof process){const{UR:t}=await import('path'),{WR:i}=await import('module');globalThis.__dirname=t("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js"),globalThis.require=i("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js")}this.MR=await(0,e.A)(),this.GR=this.MR._malloc(this.bufferSize),this.HR=this.MR._malloc(8)}}BR(t){this.bufferSize=4*this.sampleRate*this.NR*t}YR(){if(!this.MR)throw new Error(`${this.constructor.name} not initalized. call .init()`)}LR(t){this.YR();const{_malloc:i,_free:s,_tsf_load_memory:e,_tsf_set_output:n,_tsf_channel_set_bank_preset:h,_tsf_set_max_voices:r,_tsf_channel_set_presetnumber:o}=this.MR;s(this.kR),this.kR=i(t.length),this.MR.HEAPU8.set(t,this.kR),this.DR=e(this.kR,t.length),n(this.DR,2===this.NR?0:2,this.sampleRate,this.gain)}VR(){this.YR();const t=new Uint8Array(this.bufferSize);return t.set(this.MR.HEAPU8.subarray(this.GR,this.GR+this.bufferSize)),t}KR(t){const{_malloc:i,_free:s,_tml_load_memory:e}=this.MR;return s(this.FR),this.FR=i(t.length),this.MR.HEAPU8.set(t,this.FR),e(this.FR,t.length)}XR(t){const{_midi_render:i}=this.MR;return i(this.DR,t,this.NR,this.sampleRate,this.GR,this.bufferSize,this.HR)}xR(t){if(this.YR(),!this.DR)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.PR);const{setValue:i,getValue:s}=this.MR;i(this.HR,0,'double'),this.MR._tsf_reset(this.DR),this.MR._tsf_channel_set_bank_preset(this.DR,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let e=this.KR(t);const n=()=>{e=this.XR(e);const t=this.VR();this.RR(t),e?this.PR=setTimeout(n,this.OR):this.SR(s(this.HR,'double'))};this.PR=setTimeout(n,16)}}},8227:(t,i,s)=>{t.exports=s.p+"9f86b5397894e28b5ae2.wasm"},5473:(t,i,s)=>{var e;s.d(i,{A:()=>n});const n=(e="file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/tinymidipcm.mjs",function(t){var i,n,h=void 0!==(t=t||{})?t:{};h.ready=new Promise((function(t,s){i=t,n=s})),["_tsf_load_memory","_tsf_set_output","_tsf_channel_set_bank_preset","_tsf_set_max_voices","_tsf_channel_set_presetnumber","_tsf_reset","_tsf_close","_tml_load_memory","_midi_render","_malloc","_realloc","_free","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(h.ready,t)||Object.defineProperty(h.ready,t,{get:()=>j('You are getting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),set:()=>j('You are setting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js')})}));var r=Object.assign({},h),o=[],l='object'==typeof window,a='function'==typeof importScripts,c='object'==typeof process&&'object'==typeof process.versions&&'string'==typeof process.versions.node,f=!l&&!c&&!a;if(h.ENVIRONMENT)throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');var u,d,w,y='';if(c){if('undefined'==typeof process||!process.release||'node'!==process.release.name)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');var A,p;y=a?require('path').UR(y)+'/':__dirname+'/';var m=()=>{p||(A=require('fs'),p=require('path'))};u=(t,i)=>(m(),t=p.normalize(t),A.jR(t,i?void 0:'utf8')),w=t=>{var i=u(t,!0);return i.buffer||(i=new Uint8Array(i)),D(i.buffer),i},d=(t,i,s)=>{m(),t=p.normalize(t),A.zR(t,(function(t,e){t?s(t):i(e.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,'/'),o=process.argv.slice(2),process.on('uncaughtException',(function(t){if(!(t instanceof nt))throw t})),process.on('unhandledRejection',(function(t){throw t})),h.inspect=function(){return'[Emscripten Module object]'}}else if(f){if('object'==typeof process&&'function'==typeof require||'object'==typeof window||'function'==typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');'undefined'!=typeof read&&(u=function(t){return read(t)}),w=function(t){let i;return'function'==typeof readbuffer?new Uint8Array(readbuffer(t)):(i=read(t,'binary'),D('object'==typeof i),i)},d=function(t,i,s){setTimeout((()=>i(w(t))),0)},'undefined'!=typeof scriptArgs?o=scriptArgs:void 0!==arguments&&(o=arguments),'undefined'!=typeof print&&('undefined'==typeof console&&(console={}),console.log=print,console.warn=console.error='undefined'!=typeof printErr?printErr:print)}else{if(!l&&!a)throw new Error('environment detection error');if(a?y=self.location.href:'undefined'!=typeof document&&document.currentScript&&(y=document.currentScript.src),e&&(y=e),y=0!==y.indexOf('blob:')?y.substr(0,y.replace(/[?#].*/,"").lastIndexOf('/')+1):'','object'!=typeof window&&'function'!=typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');u=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.send(null),i.responseText},a&&(w=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.responseType='arraybuffer',i.send(null),new Uint8Array(i.response)}),d=(t,i,s)=>{var e=new XMLHttpRequest;e.open('GET',t,!0),e.responseType='arraybuffer',e.onload=()=>{200==e.status||0==e.status&&e.response?i(e.response):s()},e.onerror=s,e.send(null)}}h.print||console.log.bind(console);var g,_,I=h.printErr||console.warn.bind(console);function C(t,i){Object.getOwnPropertyDescriptor(h,t)||Object.defineProperty(h,t,{configurable:!0,get:function(){j('Module.'+t+' has been replaced with plain '+i+' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')}})}function E(t){return'FS_createPath'===t||'FS_createDataFile'===t||'FS_createPreloadedFile'===t||'FS_unlink'===t||'addRunDependency'===t||'FS_createLazyFile'===t||'FS_createDevice'===t||'removeRunDependency'===t}Object.assign(h,r),r=null,g='fetchSettings',Object.getOwnPropertyDescriptor(h,g)&&j('`Module.'+g+'` was supplied but `'+g+'` not included in INCOMING_MODULE_JS_API'),h.arguments&&(o=h.arguments),C('arguments','arguments_'),h.thisProgram&&h.thisProgram,C('thisProgram','thisProgram'),h.quit&&h.quit,C('quit','quit_'),D(void 0===h.memoryInitializerPrefixURL,'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===h.pthreadMainPrefixURL,'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'),D(void 0===h.cdInitializerPrefixURL,'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===h.filePackagePrefixURL,'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'),D(void 0===h.read,'Module.read option was removed (modify read_ in JS)'),D(void 0===h.readAsync,'Module.readAsync option was removed (modify readAsync in JS)'),D(void 0===h.readBinary,'Module.readBinary option was removed (modify readBinary in JS)'),D(void 0===h.setWindowTitle,'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'),D(void 0===h.TOTAL_MEMORY,'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'),C('read','read_'),C('readAsync','readAsync'),C('readBinary','readBinary'),C('setWindowTitle','setWindowTitle'),D(!f,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),h.wasmBinary&&(_=h.wasmBinary),C('wasmBinary','wasmBinary');var v;h.noExitRuntime;C('noExitRuntime','noExitRuntime'),'object'!=typeof WebAssembly&&j('no native wasm support detected');var b,T,O,R,S,L,x,M,k=!1;function D(t,i){t||j('Assertion failed'+(i?': '+i:''))}function F(t){b=t,h.HEAP8=T=new Int8Array(t),h.HEAP16=R=new Int16Array(t),h.HEAP32=S=new Int32Array(t),h.HEAPU8=O=new Uint8Array(t),h.HEAPU16=new Uint16Array(t),h.HEAPU32=L=new Uint32Array(t),h.HEAPF32=x=new Float32Array(t),h.HEAPF64=M=new Float64Array(t)}'undefined'!=typeof TextDecoder&&new TextDecoder('utf8');var N=5242880;h.TOTAL_STACK&&D(N===h.TOTAL_STACK,'the stack size can no longer be determined at runtime');var B=h.INITIAL_MEMORY||16777216;function P(){if(!k){var t=ft(),i=L[t>>2],s=L[t+4>>2];34821223==i&&2310721022==s||j('Stack overflow! Stack cookie has been overwritten at 0x'+t.toString(16)+', expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+s.toString(16)+' 0x'+i.toString(16)),1668509029!==L[0]&&j('Runtime error: The application has corrupted its heap memory area (address zero)!')}}C('INITIAL_MEMORY','INITIAL_MEMORY'),D(B>=N,'INITIAL_MEMORY should be larger than TOTAL_STACK, was '+B+'! (TOTAL_STACK='+N+')'),D('undefined'!=typeof Int32Array&&'undefined'!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,'JS engine does not provide full typed array support'),D(!h.wasmMemory,'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'),D(16777216==B,'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'),function(){var t=new Int16Array(1),i=new Int8Array(t.buffer);if(t[0]=25459,115!==i[0]||99!==i[1])throw'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'}();var U=[],W=[],G=[],H=!1;D(Math.imul,'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.fround,'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.clz32,'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.trunc,'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');var Y=0,V=null,K=null,X={};function j(t){h.onAbort&&h.onAbort(t),I(t='Aborted('+t+')'),k=!0;var i=new WebAssembly.RuntimeError(t);throw n(i),i}var z={error:function(){j('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM')},init:function(){z.error()},ZR:function(){z.error()},qR:function(){z.error()},JR:function(){z.error()},open:function(){z.error()},$R:function(){z.error()},QR:function(){z.error()},tS:function(){z.error()},iS:function(){z.error()},sS:function(){z.error()}};h.FS_createDataFile=z.ZR,h.FS_createPreloadedFile=z.qR;var Z,q,J,$,Q='data:application/octet-stream;base64,';function tt(t){return t.startsWith(Q)}function it(t){return t.startsWith('file://')}function st(t,i){return function(){var s=t,e=i;return i||(e=h.asm),D(H,'native function `'+s+'` called before runtime initialization'),e[t]||D(e[t],'exported native function `'+s+'` not found'),e[t].apply(null,arguments)}}function et(t){try{if(t==Z&&_)return new Uint8Array(_);if(w)return w(t);throw"both async and sync fetching of the wasm failed"}catch(t){j(t)}}function nt(t){this.name='ExitStatus',this.message='Program terminated with exit('+t+')',this.status=t}function ht(t){for(;t.length>0;)t.shift()(h)}function rt(t){rt.eS||(rt.eS={}),rt.eS[t]||(rt.eS[t]=1,c&&(t='warning: '+t),I(t))}function ot(t){try{return v.nS(t-b.byteLength+65535>>>16),F(v.buffer),1}catch(i){I('emscripten_realloc_buffer: Attempted to grow heap from '+b.byteLength+' bytes to '+t+' bytes, but got error: '+i)}}h.locateFile?tt(Z='tinymidipcm.wasm')||(q=Z,Z=h.locateFile?h.locateFile(q,y):y+q):Z=new URL(s(8227),s.b).toString();var lt,at={"emscripten_memcpy_big":function(t,i,s){O.copyWithin(t,i,i+s)},"emscripten_resize_heap":function(t){var i=O.length;D((t>>>=0)>i);var s,e,n=2147483648;if(t>n)return I('Cannot enlarge memory, asked to go up to '+t+' bytes, but the limit is '+n+' bytes!'),!1;for(var h=1;h<=4;h*=2){var r=i*(1+.2/h);r=Math.min(r,t+100663296);var o=Math.min(n,(s=Math.max(t,r))+((e=65536)-s%e)%e);if(ot(o))return!0}return I('Failed to grow the heap from '+i+' bytes to '+o+' bytes, not enough memory!'),!1}},ct=(function(){var t,i={'env':at,'wasi_snapshot_preview1':at};function s(t,i){var s,e=t.exports;h.asm=e,D(v=h.asm.memory,"memory not found in wasm exports"),F(v.buffer),D(h.asm.__indirect_function_table,"table not found in wasm exports"),s=h.asm.__wasm_call_ctors,W.unshift(s),function(t){if(Y--,h.monitorRunDependencies&&h.monitorRunDependencies(Y),t?(D(X[t]),delete X[t]):I('warning: run dependency removed without ID'),0==Y&&(null!==V&&(clearInterval(V),V=null),K)){var i=K;K=null,i()}}('wasm-instantiate')}t='wasm-instantiate',Y++,h.monitorRunDependencies&&h.monitorRunDependencies(Y),t?(D(!X[t]),X[t]=1,null===V&&'undefined'!=typeof setInterval&&(V=setInterval((function(){if(k)return clearInterval(V),void(V=null);var t=!1;for(var i in X)t||(t=!0,I('still waiting on run dependencies:')),I('dependency: '+i);t&&I('(end of list)')}),1e4))):I('warning: run dependency added without ID');var e=h;function r(t){D(h===e,'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'),e=null,s(t.instance)}function o(t){return function(){if(!_&&(l||a)){if('function'==typeof fetch&&!it(Z))return fetch(Z,{credentials:'same-origin'}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+Z+"'";return t.arrayBuffer()})).catch((function(){return et(Z)}));if(d)return new Promise((function(t,i){d(Z,(function(i){t(new Uint8Array(i))}),i)}))}return Promise.resolve().then((function(){return et(Z)}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){I('failed to asynchronously prepare wasm: '+t),it(Z)&&I('warning: Loading from a file URI ('+Z+') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing'),j(t)}))}if(h.instantiateWasm)try{return h.instantiateWasm(i,s)}catch(t){I('Module.instantiateWasm callback failed with error: '+t),n(t)}(_||'function'!=typeof WebAssembly.instantiateStreaming||tt(Z)||it(Z)||c||'function'!=typeof fetch?o(r):fetch(Z,{credentials:'same-origin'}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(r,(function(t){return I('wasm streaming compile failed: '+t),I('falling back to ArrayBuffer instantiation'),o(r)}))}))).catch(n)}(),h.___wasm_call_ctors=st("__wasm_call_ctors"),h._malloc=st("malloc"),h._free=st("free"),h._tsf_load_memory=st("tsf_load_memory"),h._tsf_close=st("tsf_close"),h._tsf_reset=st("tsf_reset"),h._tsf_set_output=st("tsf_set_output"),h._tsf_set_max_voices=st("tsf_set_max_voices"),h._realloc=st("realloc"),h._tsf_channel_set_presetnumber=st("tsf_channel_set_presetnumber"),h._tsf_channel_set_bank_preset=st("tsf_channel_set_bank_preset"),h._tml_load_memory=st("tml_load_memory"),h._midi_render=st("midi_render"),h.___errno_location=st("__errno_location"),h._fflush=st("fflush"),h._emscripten_stack_init=function(){return(ct=h._emscripten_stack_init=h.asm.emscripten_stack_init).apply(null,arguments)}),ft=(h._emscripten_stack_get_free=function(){return(h._emscripten_stack_get_free=h.asm.emscripten_stack_get_free).apply(null,arguments)},h._emscripten_stack_get_base=function(){return(h._emscripten_stack_get_base=h.asm.emscripten_stack_get_base).apply(null,arguments)},h._emscripten_stack_get_end=function(){return(ft=h._emscripten_stack_get_end=h.asm.emscripten_stack_get_end).apply(null,arguments)});function ut(){var t;ct(),D(!(3&(t=ft()))),L[t>>2]=34821223,L[t+4>>2]=2310721022,L[0]=1668509029}function dt(t){function s(){lt||(lt=!0,h.calledRun=!0,k||(D(!H),H=!0,P(),ht(W),i(h),h.onRuntimeInitialized&&h.onRuntimeInitialized(),D(!h._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(P(),h.postRun)for('function'==typeof h.postRun&&(h.postRun=[h.postRun]);h.postRun.length;)t=h.postRun.shift(),G.unshift(t);var t;ht(G)}()))}t=t||o,Y>0||(ut(),function(){if(h.preRun)for('function'==typeof h.preRun&&(h.preRun=[h.preRun]);h.preRun.length;)t=h.preRun.shift(),U.unshift(t);var t;ht(U)}(),Y>0||(h.setStatus?(h.setStatus('Running...'),setTimeout((function(){setTimeout((function(){h.setStatus('')}),1),s()}),1)):s(),P()))}if(h.stackSave=st("stackSave"),h.stackRestore=st("stackRestore"),h.stackAlloc=st("stackAlloc"),h.setValue=function(t,i,s="i8"){switch(s.endsWith('*')&&(s='*'),s){case'i1':case'i8':T[0|t]=i;break;case'i16':R[t>>1]=i;break;case'i32':S[t>>2]=i;break;case'i64':$=[i>>>0,(J=i,+Math.abs(J)>=1?J>0?(0|Math.min(+Math.floor(J/4294967296),4294967295))>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],S[t>>2]=$[0],S[t+4>>2]=$[1];break;case'float':x[t>>2]=i;break;case'double':M[t>>3]=i;break;case'*':L[t>>2]=i;break;default:j('invalid type for setValue: '+s)}},h.getValue=function(t,i="i8"){switch(i.endsWith('*')&&(i='*'),i){case'i1':case'i8':return T[0|t];case'i16':return R[t>>1];case'i32':case'i64':return S[t>>2];case'float':return x[t>>2];case'double':return M[t>>3];case'*':return L[t>>2];default:j('invalid type for getValue: '+i)}return null},['run','UTF8ArrayToString','UTF8ToString','stringToUTF8Array','stringToUTF8','lengthBytesUTF8','addOnPreRun','addOnInit','addOnPreMain','addOnExit','addOnPostRun','addRunDependency','removeRunDependency','FS_createFolder','FS_createPath','FS_createDataFile','FS_createPreloadedFile','FS_createLazyFile','FS_createLink','FS_createDevice','FS_unlink','getLEB','getFunctionTables','alignFunctionTables','registerFunctions','prettyPrint','getCompilerSetting','print','printErr','callMain','abort','keepRuntimeAlive','wasmMemory','stackAlloc','stackSave','stackRestore','getTempRet0','setTempRet0','writeStackCookie','checkStackCookie','ptrToString','zeroMemory','stringToNewUTF8','exitJS','getHeapMax','emscripten_realloc_buffer','ENV','ERRNO_CODES','ERRNO_MESSAGES','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','DNS','getHostByName','Protocols','Sockets','getRandomDevice','warnOnce','traverseStack','UNWIND_CACHE','convertPCtoSourceLocation','readAsmConstArgsArray','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','handleException','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','freeTableIndexes','functionsInTableMap','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','PATH','PATH_FS','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16Decoder','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeArrayToMemory','writeAsciiToMemory','SYSCALLS','getSocketFromFD','getSocketAddress','JSEvents','registerKeyEventCallback','specialHTMLTargets','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','currentFullscreenStrategy','restoreOldWindowedStyle','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','demangle','demangleAll','jsStackTrace','stackTrace','ExitStatus','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','dlopenMissingError','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','uncaughtExceptionCount','exceptionLast','exceptionCaught','ExceptionInfo','exception_addRef','exception_decRef','Browser','setMainLoop','wget','FS','MEMFS','TTY','PIPEFS','SOCKFS','_setNetworkCallback','tempFixedLengthArray','miniTempWebGLFloatBuffers','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','GL','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','AL','SDL_unicode','SDL_ttfContext','SDL_audio','SDL','SDL_gfx','GLUT','EGL','GLFW_Window','GLFW','GLEW','IDBStore','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){Object.getOwnPropertyDescriptor(h,t)||Object.defineProperty(h,t,{configurable:!0,get:function(){var i="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),j(i)}})})),['ptrToString','zeroMemory','stringToNewUTF8','exitJS','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','getHostByName','getRandomDevice','traverseStack','convertPCtoSourceLocation','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeAsciiToMemory','getSocketFromFD','getSocketAddress','registerKeyEventCallback','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','ExceptionInfo','exception_addRef','exception_decRef','setMainLoop','_setNetworkCallback','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','SDL_unicode','SDL_ttfContext','SDL_audio','GLFW_Window','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){'undefined'==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var i='`'+t+'` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line';E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),rt(i)}})})),K=function t(){lt||dt(),lt||(K=t)},h.preInit)for('function'==typeof h.preInit&&(h.preInit=[h.preInit]);h.preInit.length>0;)h.preInit.pop()();return dt(),t.ready})}},h={};function r(t){var i=h[t];if(void 0!==i)return i.exports;var s=h[t]={exports:{}};return n[t](s,s.exports,r),s.exports}r.m=n,t="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",i="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",s="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",e=t=>{t&&t.d<1&&(t.d=1,t.forEach((t=>t.r--)),t.forEach((t=>t.r--?t.r++:t())))},r.a=(n,h,r)=>{var o;r&&((o=[]).d=-1);var l,a,c,f=new Set,u=n.exports,d=new Promise(((t,i)=>{c=i,a=t}));d[i]=u,d[t]=t=>(o&&t(o),f.forEach(t),d.catch((t=>{}))),n.exports=d,h((n=>{var h;l=(n=>n.map((n=>{if(null!==n&&"object"==typeof n){if(n[t])return n;if(n.then){var h=[];h.d=0,n.then((t=>{r[i]=t,e(h)}),(t=>{r[s]=t,e(h)}));var r={};return r[t]=t=>t(h),r}}var o={};return o[t]=t=>{},o[i]=n,o})))(n);var r=()=>l.map((t=>{if(t[s])throw t[s];return t[i]})),a=new Promise((i=>{(h=()=>i(r)).r=0;var s=t=>t!==o&&!f.has(t)&&(f.add(t),t&&!t.d&&(h.r++,t.push(h)));l.map((i=>i[t](s)))}));return h.r?a:r()}),(t=>(t?c(d[s]=t):a(u),e(o)))),o&&o.d<0&&(o.d=0)},r.d=(t,i)=>{for(var s in i)r.o(i,s)&&!r.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:i[s]})},r.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),r.p="/Client2/",r.b=document.baseURI||self.location.href;r(9073)})(); \ No newline at end of file +(()=>{"use strict";var t,i,s,e,n={1651:(t,i,s)=>{s.d(i,{K:()=>M});var e=s(1120),n=s(4583),h=s(2901),r=s(1069),o=s(7046),l=(s(9896),s(6666)),a=s(3045),c=s(818),f=s(670),u=s(8268),d=s(3867),w=s(7854),y=s(8950),A=s(1302),p=s(9298),m=s(8665),g=s(1312),_=s(3819),I=s(8317),C=s(9234),E=s(1908),v=s(123),b=s(5637),T=s(6948),O=s(2164),R=s(8738),S=s(3764),L=s(8534),x=s(6730);class M extends o.A{static tt=225;static it=10;static portOffset=0;static members=!0;static st=!1;static et='';static nt='';static ht=!1;static rt=2;static ot=!1;static lt='https://raw.githubusercontent.com/2004scape/Server/main';static exponent=58778699976184461502525193738213253649000149147835990136706041084440742975821n;static ct=7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789n;static ft=0;static ut=0;static dt=0;static wt=0;static yt=0;static At=0;static gt=0;static _t=0;static It=0;static Ct=0;static Et=0;static vt=0;static bt=0;static Tt=0;static Ot=0;static Rt=()=>{a.A.st=!1,n.A.st=!1,M.st=!1,c.A.st=!1};static St=()=>{a.A.st=!0,n.A.st=!0,M.st=!0,c.A.st=!0};Lt=2048;xt=2047;Mt=!1;kt=!1;Dt=!1;Ft=!1;db=null;Nt=0;Bt=[];stream=null;in=r.A.Pt(1);Ut=r.A.Pt(1);Wt=r.A.Pt(1);Gt=0n;Ht=0;Yt=0;Vt=0;Kt=null;Xt=0;packetSize=0;jt=0;zt=0;Zt=0;qt=null;Jt=!0;$t=0;Qt=0;ti=null;ii=null;si=null;ei=null;ni=null;hi=null;ri=null;oi=null;li=null;ai=null;ci=null;fi='';ui='';username='';password='';di=null;wi=null;yi=null;Ai=null;pi=[];mi=!1;gi=null;_i=null;Ii=null;Ci=null;Ei=null;vi=null;bi=null;Ti=null;Oi=null;Ri=null;Si=new Int32Array(256);Li=0;xi=0;Mi=0;ki=null;Di=null;Fi=null;Ni=null;Bi=null;Pi=null;Ui=null;Wi=null;Gi=null;Hi=null;Yi=null;Vi=null;Ki=null;Xi=null;ji=null;zi=null;Zi=null;qi=null;Ji=null;$i=null;Qi=null;ts=new Int32Array(33);ss=new Int32Array(33);es=new Int32Array(151);ns=new Int32Array(151);hs=null;rs=null;os=null;ls=null;cs=null;fs=null;us=new d.ds(13,null);ws=null;ys=null;As=new d.ds(50,null);ps=new d.ds(50,null);gs=new d.ds(20,null);_s=new d.ds(20,null);Is=null;Cs=new d.ds(8,null);Es=null;vs=null;bs=null;Ts=null;Os=null;Rs=null;Ss=null;Ls=null;xs=null;Ms=null;ks=null;Ds=null;Fs=null;Ns=null;Bs=null;Ps=null;Us=null;Ws=null;Gs=new d.ds(1e3,null);Hs=!1;Ys=!1;Vs=!1;Ks=!1;Xs=-1;js=0;zs=0;Zs=0;qs=0;Js=0;$s=0;Qs=!1;te=0;ie=0;se=0;ee=0;ne=0;he=0;re=[];oe=-1;le=-1;ae=new e.A;ce=78;fe=0;ue=0;de=[];we=0;ye=0;Ae=0;pe=0;me=0;ge=0;_e=0;Ie=0;Ce=[];Ee=[];ve=[];be=[];Te=null;Oe=-1;Re=3;Se=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];Le=0;xe=0;Me=0;ke=!1;De=0;Fe=!1;Ne='';Be='';Pe=0;Ue='';We=!1;Ge=-1;He=new d.ds(100,null);Ye=new d.ds(100,null);messageType=new Int32Array(100);Ve=new Int32Array(100);Ke=0;Xe=0;je=0;ze='';Ze=0;qe=0;Je=0;$e=0;Qe=0;tn=0;sn=0;en=0;nn=0;hn=!1;rn=0;ln=0;an=0;cn=0;fn=null;un=0;dn=0;wn=0;yn=0;An=!1;pn=[];mn=[];gn=0;_n=0;In=0;Cn=null;En=0;vn=new Int32Array(500);bn=new Int32Array(500);Tn=new Int32Array(500);On=new Int32Array(500);Rn=0;Sn=0;Ln=0;xn='';Mn=!1;kn=-1;Dn=0;Fn=0;Nn=0;Bn=0;Pn=0;Un=new Int32Array(1e3);Wn=new Int32Array(1e3);Gn=null;Hn=0;Yn=0;Vn=0;Kn=0;Xn=0;jn=!1;zn=0;Zn=0;qn=0;Jn=0;$n=2;Qn=2;th=1;ih=new Int32Array(5);sh=new d.ds(5,!1);eh=new Int32Array(5);nh=new Int32Array(5);hh=new Int32Array(5);rh=0;oh=0;lh=0;ah=0;fh=0;uh=0;dh=0;wh=0;yh=0;Ah=1;ph=2;mh=-1;gh=0;_h=0;Ih=0;Ch=0;Eh=0;bh=0;Th=null;Oh=null;Rh=null;Sh=0;Lh=0;xh=new Int8Array(16384);Mh=new d.ds(f.A.kh,null);Dh=0;Fh=0;Nh=128;Bh=0;Ph=0;Uh=0;Wh=0;Gh=0;Hh=null;Yh=null;Vh=new d.Kh(f.A.Xh,f.A.Xh);jh=0;zh=0;Zh=0;qh=0;Jh=0;$h=0;Qh=0;tr=0;ir=0;sr=0;er=0;nr=0;hr=new d.ds(this.Lt,null);rr=0;lr=new Int32Array(this.Lt);ar=0;cr=0;ur=new Int32Array(this.Lt);dr=new Int32Array(1e3);wr=new d.ds(this.Lt,null);yr=new d.ds(8192,null);Ar=0;pr=new Int32Array(8192);mr=new l.A;gr=new l.A;_r=new l.A;Ir=new l.A;Cr=new d.Er(f.A.kh,f.A.Xh,f.A.Xh,null);vr=new l.A;br=new Int32Array(4e3);Tr=new Int32Array(4e3);Or=new Int32Array(f.A.Xh*f.A.Xh);Rr=new Int32Array(f.A.Xh*f.A.Xh);Sr=0;Lr=null;Mr=0;kr=0;Dr=-1;Fr=0;Nr=0;Br=0;Pr=0;Ur=!1;Wr=!0;Gr=!1;Hr=new Int32Array(7);Yr=new Int32Array(5);Vr=0;Kr=0;static Xr=50;jr=new Int32Array(M.Xr);zr=new Int32Array(M.Xr);Zr=new Int32Array(M.Xr);qr=new Int32Array(M.Xr);Jr=new Int32Array(M.Xr);$r=new Int32Array(M.Xr);Qr=new Int32Array(M.Xr);io=new d.ds(M.Xr,null);so=new d.ds(100,null);eo=new BigInt64Array(100);no=new Int32Array(100);ho=null;ro=0;oo=!0;lo=new Int32Array(50);ao=new Int32Array(50);co=new Int32Array(50);fo=192;uo=-1;do=-1;wo=0;yo=0;Ao=0;po=!0;mo=null;_o=0;Io=0;Co=192;Eo=new d.ds(16,null);vo=0;bo=!1;To=()=>{try{this.stream&&this.stream.close()}catch(t){}this.stream=null,(0,v.Oo)(),this.Ut=null,this.Wt=null,this.in=null,this.Rh=null,this.Th=null,this.Oh=null,this.Hh=null,this.Yh=null,this.Gn=null,this.Mh=null,this.Or=null,this.Rr=null,this.br=null,this.Tr=null,this.xh=null,this.Di=null,this.Fi=null,this.Ni=null,this.Bi=null,this.Pi=null,this.Ui=null,this.Wi=null,this.Gi=null,this.Hi=null,this.Yi=null,this.Vi=null,this.Ki=null,this.Xi=null,this.ji=null,this.zi=null,this.Zi=null,this.qi=null,this.hs=null,this.os=null,this.rs=null,this.ls=null,this.cs=null,this.fs=null,this.us=null,this.Ss=null,this.Ls=null,this.xs=null,this.Ms=null,this.ks=null,this.Ds=null,this.Fs=null,this.Ns=null,this.Bs=null,this.Ps=null,this.ys=null,this.gs=null,this._s=null,this.Cs=null,this.Es=null,this.vs=null,this.bs=null,this.Ts=null,this.As=null,this.ps=null,this.Vh=null,this.hr=null,this.lr=null,this.ur=null,this.wr=null,this.dr=null,this.yr=null,this.pr=null,this.Cr=null,this.vr=null,this.Ir=null,this.mr=null,this.gr=null,this._r=null,this.Tn=null,this.On=null,this.vn=null,this.bn=null,this.re=null,this.pn=null,this.Un=null,this.Wn=null,this.Gs=null,this.ws=null,this.so=null,this.eo=null,this.no=null,this.ei=null,this.ni=null,this.ti=null,this.ii=null,this.si=null,this.hi=null,this.ri=null,this.oi=null,this.li=null,this.Ro(),b.A.To(),T.A.To(),A.A.To(),O.A.So=null,I.A.So=null,e.A.So=null,g.A.So=null,R.A.So=null,R.A.Lo=null,S.A.So=null,this.xo=null,u.A.Lo=null,n.A.To(),a.A.To(),m.A.To(),L.A.So=[],x.A.So=[]};Mo(){return this.$t}ko(){return this.We}Do(){return this.Fe}Fo(){return this.le}No(){return this.Xs}Ro=()=>{this.mi=!1,this.ki&&(clearInterval(this.ki),this.ki=null),this.ai=null,this.ci=null,this.pi=[],this.bi=null,this.Ti=null,this.Oi=null,this.Ri=null,this.Ci=null,this.Ii=null,this.Ei=null,this.vi=null,this.gi=null,this._i=null};Bo=async(t,i,s,e)=>{let n=5,o=await(this.db?.Po(t));if(o&&r.A.Uo(o)!==s&&(o=void 0),o)return new h.A(o);for(;!o;){await this.Wo(e,`Requesting ${i}`);try{o=await(0,C.Go)(`${M.nt}/${t}${s}`)}catch(t){o=void 0;for(let t=n;t>0;t--)await this.Wo(e,`Error loading - Will retry in ${t} secs.`),await(0,C.Ho)(1e3);n*=2,n>60&&(n=60)}}return await(this.db?.Yo(t,o)),new h.A(o)};Vo=async(t,i,s)=>{let e=await(this.db?.Po(t+'.mid'));if(e&&12345678!==i&&r.A.Uo(e)!==i&&(e=void 0),!e)try{e=await(0,C.Go)(`${M.nt}/${t}_${i}.mid`),s!==e.length&&(e=e.slice(0,s))}catch(t){}if(!e)return;await(this.db?.Yo(t+'.mid',e));const n=new r.A(Uint8Array.from(e)).Ko,h=E.A.read(n,e,s,4);(0,v.Xo)(h,this.Co)};jo=()=>{if(w.zo.fillStyle='black',w.zo.fillRect(0,0,this.width,this.height),this.Zo(1),this.Dt){this.mi=!1,w.zo.font='bold 16px helvetica, sans-serif',w.zo.textAlign='left',w.zo.fillStyle='yellow';let t=35;w.zo.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,w.zo.fillStyle='white',w.zo.fillText('To fix this try the following (in order):',30,t),t+=50,w.zo.font='bold 12px helvetica, sans-serif',w.zo.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.zo.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,w.zo.fillText('3: Try using a different game-world',30,t),t+=30,w.zo.fillText('4: Try rebooting your computer',30,t),t+=30,w.zo.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.Ft&&(this.mi=!1,w.zo.font='bold 20px helvetica, sans-serif',w.zo.textAlign='left',w.zo.fillStyle='white',w.zo.fillText('Error - unable to load game!',50,50),w.zo.fillText('To play RuneScape make sure you play from',50,100),w.zo.fillText('https://2004scape.org',50,150)),this.kt){this.mi=!1,w.zo.font='bold 13px helvetica, sans-serif',w.zo.textAlign='left',w.zo.fillStyle='yellow';let t=35;w.zo.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,w.zo.fillStyle='white',w.zo.fillText('To fix this try the following (in order):',30,t),t+=50,w.zo.font='bold 12px helvetica, sans-serif',w.zo.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.zo.fillText('2: Try rebooting your computer, and reloading',30,t)}};qo=t=>{if(!t.Jo)return!1;for(let i=0;i=e)return!1}else if(3===t.Jo[i]){if(s<=e)return!1}else if(4===t.Jo[i]){if(s===e)return!1}else if(s!==e)return!1}return!0};tl=(t,i,s,e,n)=>{this.Os?.draw(t,i),this.Rs?.draw(t,i+n-16),y.A.fillRect(t,i+16,16,n-32,p.A.il);let h=(n-32)*n/e|0;h<8&&(h=8);const r=(n-h-32)*s/(e-n)|0;y.A.fillRect(t,i+r+16,16,h,p.A.sl),y.A.el(t,i+r+16,p.A.nl,h),y.A.el(t+1,i+r+16,p.A.nl,h),y.A.hl(t,i+r+16,p.A.nl,16),y.A.hl(t,i+r+17,p.A.nl,16),y.A.el(t+15,i+r+16,p.A.rl,h),y.A.el(t+14,i+r+17,p.A.rl,h-1),y.A.hl(t,i+r+h+15,p.A.rl,16),y.A.hl(t+1,i+r+h+14,p.A.rl,15)};ol=(t,i)=>{let s=!1;const n=e.A.So[t];if(!n.ll)return!1;for(let t=0;te.delay[h.ul];)h.fl-=e.delay[h.ul]+1,h.ul++,h.ul>=e.dl&&(h.ul-=e.wl,(h.ul<0||h.ul>=e.dl)&&(h.ul=0)),s=!0}}}return s};yl=(t,i,s,h,r=!1)=>{if(0!==t.type||!t.ll||t.hide&&this.Ze!==t.id&&this.qe!==t.id&&this.Je!==t.id)return;const o=y.A.left,l=y.A.top,a=y.A.right,c=y.A.bottom;y.A.Al(i,s,i+t.width,s+t.height);const f=t.ll.length;for(let o=0;o0&&this.Cl(c),c.type===e.A.El)c.vl>c.scroll-c.height&&(c.vl=c.scroll-c.height),c.vl<0&&(c.vl=0),this.yl(c,l,a,c.vl,r),c.scroll>c.height&&this.tl(l+c.width,a,c.vl,c.scroll,c.height);else if(c.type===e.A.bl){let t=0;for(let i=0;i0){let i=0,s=0;const h=c.Rl[t]-1;if(e>=-32&&e<=512&&n>=-32&&n<=334||0!==this.tn&&this.Qe===t){const r=A.A.Ml(h,c.Sl[t]);if(0!==this.tn&&this.Qe===t&&this.$e===c.id?(i=this.kl-this.sn,s=this.Dl-this.en,i<5&&i>-5&&(i=0),s<5&&s>-5&&(s=0),this.nn<5&&(i=0,s=0),r.Fl(128,e+i,n+s)):0!==this.un&&this.dn===t&&this.wn===c.id?r.Fl(128,e,n):r.draw(e,n),33===r.Nl||1!==c.Sl[t]){const h=c.Sl[t];this.di?.Bl(e+i+1,n+10+s,this.Pl(h),p.A.Ul),this.di?.Bl(e+i,n+9+s,this.Pl(h),p.A.Wl)}}}else if(c.Gl&&t<20){const i=c.Gl[t];i?.draw(e,n)}t++}}else if(c.type===e.A.Hl)c.fill?y.A.fillRect(l,a,c.width,c.height,c.Yl):y.A.gl(l,a,c.width,c.height,c.Yl);else if(c.type===e.A.Vl){const t=c.font;let i=c.Yl,s=c.text;if(this.Je!==c.id&&this.qe!==c.id&&this.Ze!==c.id||0===c.Kl||(i=c.Kl),this.qo(c)&&(i=c.Xl,c.jl&&c.jl.length>0&&(s=c.jl)),c.zl===e.A.Zl&&this.An&&(s='Please wait...',i=c.Yl),!t||!s)continue;for(let e=a+t.height;s.length>0;e+=t.height){if(-1!==s.indexOf('%')){for(;;){const t=s.indexOf('%1');if(-1===t)break;s=s.substring(0,t)+this.ql(this.$o(c,0))+s.substring(t+2)}for(;;){const t=s.indexOf('%2');if(-1===t)break;s=s.substring(0,t)+this.ql(this.$o(c,1))+s.substring(t+2)}for(;;){const t=s.indexOf('%3');if(-1===t)break;s=s.substring(0,t)+this.ql(this.$o(c,2))+s.substring(t+2)}for(;;){const t=s.indexOf('%4');if(-1===t)break;s=s.substring(0,t)+this.ql(this.$o(c,3))+s.substring(t+2)}for(;;){const t=s.indexOf('%5');if(-1===t)break;s=s.substring(0,t)+this.ql(this.$o(c,4))+s.substring(t+2)}}const n=s.indexOf('\\n');let h;-1!==n?(h=s.substring(0,n),s=s.substring(n+2)):(h=s,s=''),c.Jl?t.$l(l+(c.width/2|0),e,h,i,c.Ql):t.ta(l,e,h,i,c.Ql)}}else if(c.type===e.A.ia){let t;t=this.qo(c)?c.sa:c.ea,t?.draw(l,a)}else if(c.type===e.A.na){const t=n.A.ha,i=n.A.ra;n.A.ha=l+(c.width/2|0),n.A.ra=a+(c.height/2|0);const s=n.A.sin[c.oa]*c.zoom>>16,e=n.A.cos[c.oa]*c.zoom>>16,h=this.qo(c);let r;r=h?c.cl:c.al;let o=null;if(-1===r)o=c.la(-1,-1,h);else{const t=g.A.So[r];t.frames&&t.aa&&(o=c.la(t.frames[c.ul],t.aa[c.ul],h))}o&&o.ca(0,c.fa,0,c.oa,0,s,e),n.A.ha=t,n.A.ra=i}else if(c.type===e.A.ua){const t=c.font;if(!t||!c.Rl||!c.Sl)continue;let i=0;for(let s=0;s0){const n=A.A.get(c.Rl[i]-1);let h=n.name;if((n.da||1!==c.Sl[i])&&(h=h+' x'+this.wa(c.Sl[i])),!h)continue;const r=l+e*(c.Ll+115),o=a+s*(c.xl+12);c.Jl?t.$l(r+(c.width/2|0),o,h,c.Yl,c.Ql):t.ta(r,o,h,c.Yl,c.Ql)}i++}}}y.A.Al(o,l,a,c)};Cl=t=>{let i=t.Il;if(i>=e.A.ya&&i<=e.A.Aa)i--,i>=this.Vr?(t.text='',t.zl=0):(t.text=this.so[i],t.zl=1);else if(i>=e.A.pa&&i<=e.A.ma)i-=e.A.pa,i>=this.Vr?(t.text='',t.zl=0):(0===this.no[i]?t.text='@red@Offline':this.no[i]===M.it?t.text='@gre@World-'+(this.no[i]-9):t.text='@yel@World-'+(this.no[i]-9),t.zl=1);else if(i===e.A.ga)t.scroll=15*this.Vr+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i>=e.A._a&&i<=e.A.Ia)i-=e.A._a,i>=this.ue?(t.text='',t.zl=0):(t.text=_.A.Ca(_.A.Ea(this.de[i])),t.zl=1);else if(i===e.A.va)t.scroll=15*this.ue+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i===e.A.ba){if(t.oa=150,t.fa=256*Math.sin(this.Nt/40)&2047,this.Gr){this.Gr=!1;const i=new d.ds(7,null);let s=0;for(let t=0;t<7;t++){const e=this.Hr[t];e>=0&&(i[s++]=I.A.So[e].la())}const e=m.A.Ta(i,s);for(let t=0;t<5;t++)0!==this.Yr[t]&&(e.Oa(u.A.Ra[t][0],u.A.Ra[t][this.Yr[t]]),1===t&&e.Oa(u.A.Sa[0],u.A.Sa[this.Yr[t]]));if(this.Lr){const i=g.A.So[this.Lr.La].frames;i&&(e.xa(),e.Ma(i[0]),e.ka(64,850,-30,-50,-30,!0),t.model=e)}}}else if(i===e.A.Da)this.Us||(this.Us=t.ea,this.Ws=t.sa),this.Wr?t.ea=this.Ws:t.ea=this.Us;else if(i===e.A.Fa)this.Us||(this.Us=t.ea,this.Ws=t.sa),this.Wr?t.ea=this.Us:t.ea=this.Ws;else if(i===e.A.Na)t.text=this.xn,this.Nt%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(i===e.A.Ba)this.Ur?this.Mn?(t.Yl=p.A.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.Yl=p.A._l,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(i===e.A.Pa||i===e.A.Ua)if(0===this.Dn)t.text='';else{let i;i=0===this.Fn?'earlier today':1===this.Fn?'yesterday':this.Fn+' days ago',t.text='You last logged in '+i+' from: '+_.A.Wa(this.Dn)}else if(i===e.A.Ga)0===this.Bn&&(t.text='0 unread messages',t.Yl=p.A.Wl),1===this.Bn&&(t.text='1 unread message',t.Yl=p.A.GREEN),this.Bn>1&&(t.text=this.Bn+' unread messages',t.Yl=p.A.GREEN);else if(i===e.A.Ha)if(201===this.Nn)t.text='';else if(200===this.Nn)t.text='You have not yet set any password recovery questions.';else{let i;i=0===this.Nn?'Earlier today':1===this.Nn?'Yesterday':this.Nn+' days ago',t.text=i+' you changed your recovery questions'}else i===e.A.Ya?201===this.Nn?t.text='':200===this.Nn?t.text='We strongly recommend you do so now to secure your account.':t.text='If you do not remember making this change then cancel it immediately':i===e.A.Va&&(201===this.Nn?t.text='':(this.Nn,t.text="Do this from the 'account management' area on our front webpage"))};$o=(t,i)=>{if(!t.scripts||i>=t.scripts.length)return-2;try{const s=t.scripts[i];if(!s)return-1;let n=0,h=0;for(;;){const t=s[h++];if(0===t)return n;if(1===t)n+=this.Ee[s[h++]];else if(2===t)n+=this.ve[s[h++]];else if(3===t)n+=this.Ce[s[h++]];else if(4===t){const t=e.A.So[s[h++]],i=s[h++]+1;if(t.Rl&&t.Sl)for(let s=0;st<999999999?String(t):'*';wa=t=>{let i=String(t);for(let t=i.length-3;t>0;t-=3)i=i.substring(0,t)+','+i.substring(t);return i.length>8?i='@gre@'+i.substring(0,i.length-8)+' million @whi@('+i+')':i.length>4&&(i='@cya@'+i.substring(0,i.length-4)+'K @whi@('+i+')'),' '+i};Pl=t=>t<1e5?String(t):t<1e7?(t/1e3|0)+'K':(t/1e6|0)+'M'}},7604:(t,i,s)=>{s.d(i,{w:()=>r});var e=s(7046),n=s(1651),h=s(9234);async function r(){await async function(){0===e.A.getParameter('world').length&&e.A.setParameter('world','1');'localhost'===window.location.hostname&&'0'===e.A.getParameter('world')?(n.K.et='http://localhost',n.K.nt='http://localhost',n.K.portOffset=0):await async function(t){const i=await o(t,parseInt(e.A.getParameter('world'),10)),s=new URL(i.address);n.K.it=10+i.id-1,n.K.et=`${s.protocol}//${s.hostname}`,n.K.nt=`${s.protocol}//${s.hostname}:${s.port}`,t||(n.K.et=n.K.et.replace('https:','http:'));n.K.portOffset=i.portOffset,n.K.members=!0===i?.members,e.A.setParameter('world',i.id.toString(10))}(window.location.protocol.startsWith('https'))}(),function(){0===e.A.getParameter('detail').length&&e.A.setParameter('detail','high');'low'===e.A.getParameter('detail')?n.K.St():n.K.Rt()}(),0===e.A.getParameter('method').length&&e.A.setParameter('method','0')}async function o(t,i,s=0){if(s>=10)throw new Error('could not find world to connect!');const e=t?'https:':'http:';let n;try{n=JSON.parse(await(0,h.Xa)(`${e}//2004scape.org/api/v1/worldlist`))}catch(e){return await(0,h.Ho)(1e3),o(t,i,++s)}n.push({id:0,region:'Local Development',address:'http://localhost',portOffset:0,members:!0,hr:0});const r=n.find((t=>t.id===i));return r||o(t,i,10)}},7046:(t,i,s)=>{s.d(i,{A:()=>a});var e=s(1183),n=s(4583),h=s(9234),r=s(9091),o=s(2595),l=s(7854);class a{static getParameter(t){return new URLSearchParams(window.location.search).get(t)??''}static setParameter(t,i){const s=new URL(window.location.toString());s.searchParams.set(t,i),window.history.pushState(null,'',s.toString())}ja=0;za=[];Za=0;xo=null;state=0;qa=20;Ja=1;$a=[];Qa=0;tc=0;ic=[];sc=!0;ec=!1;nc=50;hasFocus=!0;hc=!1;rc=0;oc=0;kl=0;Dl=0;lc=0;ac=0;cc=0;fc=[];uc=[];dc=0;wc=0;input=null;yc=!1;Ac=!1;mc=!1;time=-1;gc=0;_c=0;Ic=0;Cc=0;Ec=0;vc=0;constructor(t=!1){l.bc.tabIndex=-1,l.zo.fillStyle='black',l.zo.fillRect(0,0,l.bc.width,l.bc.height),this.ec=t,this.ec?this.resize(window.innerWidth,window.innerHeight):this.resize(l.bc.width,l.bc.height)}get width(){return l.bc.width}get height(){return l.bc.height}resize=(t,i)=>{l.bc.width=t,l.bc.height=i,this.xo=new e.A(t,i),n.A.Tc()};Oc=async()=>{l.bc.addEventListener('resize',(()=>{this.ec&&this.resize(window.innerWidth,window.innerHeight)}),!1),l.bc.onmousedown=this.onmousedown,l.bc.onmouseup=this.onmouseup,l.bc.onmouseenter=this.onmouseenter,l.bc.onmouseleave=this.onmouseleave,l.bc.onmousemove=this.onmousemove,window.onbeforeunload=this.To,l.bc.onfocus=this.onfocus,l.bc.onblur=this.onblur,this.Rc?(l.bc.ontouchstart=this.ontouchstart,l.bc.ontouchend=this.ontouchend,l.bc.ontouchmove=this.ontouchmove):(l.bc.onkeydown=this.onkeydown,l.bc.onkeyup=this.onkeyup),l.bc.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.Rc&&'low'===a.getParameter('detail')&&(this.nc=30),await this.Wo(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.$a[t]=performance.now();let t,i=0,s=256,e=1,n=0;for(;this.state>=0;){if(this.state>0&&(this.state--,0===this.state))return void this.Sc();const r=s,o=e;s=300,e=1,t=performance.now();const l=this.$a[i];if(0===l?(s=r,e=o):t>l&&(s=2560*this.qa/(t-l)|0),s<25?s=25:s>256&&(s=256,e=this.qa-(t-l)/10|0),this.$a[i]=t,i=(i+1)%10,e>1)for(let t=0;t<10;t++)0!==this.$a[t]&&(this.$a[t]+=e);for(e0&&(this.Qa=1e3*s/(256*this.qa)|0);const a=performance.now();if(this.sc&&this.refresh(),await this.draw(),this.ic[this.tc]=(performance.now()-a)/1e3,this.tc=(this.tc+1)%this.ic.length,this.nc<50){const i=1e3/this.nc-(performance.now()-t);i>0&&await(0,h.Ho)(i)}}-1===this.state&&this.Sc()};Sc=()=>{this.state=-2,this.To()};Zo=t=>{this.qa=1e3/t|0};Lc=t=>{this.nc=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.qa|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};To=()=>{};draw=async()=>{};refresh=()=>{};async Wo(t,i){const s=this.width,e=this.height;this.sc&&(l.zo.fillStyle='black',l.zo.fillRect(0,0,s,e),this.sc=!1);const n=e/2-18;l.zo.fillStyle='rgb(140, 17, 17)',l.zo.rect((s/2|0)-152,n,304,34),l.zo.fillRect((s/2|0)-150,n+2,3*t,30),l.zo.fillStyle='black',l.zo.fillRect((s/2|0)-150+3*t,n+2,300-3*t,30),l.zo.font='bold 13px helvetica, sans-serif',l.zo.textAlign='center',l.zo.fillStyle='white',l.zo.fillText(i,s/2|0,n+22),await(0,h.Ho)(5)}xc=()=>{let t=-1;return this.wc!==this.dc&&(t=this.uc[this.dc],this.dc=this.dc+1&127),t};get ms(){const t=this.ic.length;let i=0;for(let s=0;sthis.ja&&(this.ja=s),this.za[this.Za]=s,this.Za=(this.Za+1)%250,s}get Mc(){return this.za.reduce(((t,i)=>t+i),0)/250}onkeydown=t=>{const i=t.key;this.rc=0;const s=r.c[i];if(!s||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const e=s.code;let n=s.ch;t.ctrlKey&&(n>='A'.charCodeAt(0)&&n<=']'.charCodeAt(0)||n=='_'.charCodeAt(0)?n-='A'.charCodeAt(0)-1:n>='a'.charCodeAt(0)&&n<='z'.charCodeAt(0)&&(n-='a'.charCodeAt(0)-1)),n<30&&(n=0),e===r.c.ArrowLeft.code?n=1:e===r.c.ArrowRight.code?n=2:e===r.c.ArrowUp.code?n=3:e===r.c.ArrowDown.code?n=4:e===r.c.Control.code?n=5:e===r.c.Shift.code?n=6:e===r.c.Alt.code?n=7:e===r.c.Backspace.code||e===r.c.Delete.code?n=8:e===r.c.Tab.code?n=9:e===r.c.Enter.code?n=10:e>=r.c.F1.code&&e<=r.c.F12.code?n=e+1008-r.c.F1.code:e===r.c.Home.code?n=1e3:e===r.c.End.code?n=1001:e===r.c.PageUp.code?n=1002:e===r.c.PageDown.code&&(n=1003),n>0&&n<128&&(this.fc[n]=1),n>4&&(this.uc[this.wc]=n,this.wc=this.wc+1&127),o.A.enabled&&o.A.kc(n),r.g.includes(i)||t.preventDefault()};onkeyup=t=>{const i=t.key;this.rc=0;const s=r.c[i];if(!s||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const e=s.code;let n=s.ch;n<30&&(n=0),e===r.c.ArrowLeft.code?n=1:e===r.c.ArrowRight.code?n=2:e===r.c.ArrowUp.code?n=3:e===r.c.ArrowDown.code?n=4:e===r.c.Control.code?n=5:e===r.c.Shift.code?n=6:e===r.c.Alt.code?n=7:e===r.c.Backspace.code||e===r.c.Delete.code?n=8:e===r.c.Tab.code?n=9:e===r.c.Enter.code?n=10:e>=r.c.F1.code&&e<=r.c.F12.code?n=e+1008-r.c.F1.code:e===r.c.Home.code?n=1e3:e===r.c.End.code?n=1001:e===r.c.PageUp.code?n=1002:e===r.c.PageDown.code&&(n=1003),n>0&&n<128&&(this.fc[n]=0),o.A.enabled&&o.A.Dc(n),r.g.includes(i)||t.preventDefault()};onmousedown=t=>{if(this.yc=!1,(t.clientX>0||t.clientY>0)&&this.Fc(t),this.rc=0,this.ac=this.kl,this.cc=this.Dl,this.Rc&&!this.Nc){if(this.Bc()||this.Pc()||this.Uc())return this.lc=1,void(this.oc=1);t.timeStamp>=this.time+500?(this.lc=2,this.oc=2):(this.lc=1,this.oc=1)}else 2===t.button?(this.lc=2,this.oc=2):(this.lc=1,this.oc=1);o.A.enabled&&o.A.Wc(this.ac,this.cc,t.buttons)};onmouseup=t=>{this.Fc(t),this.rc=0,this.oc=0,o.A.enabled&&o.A.Gc(t.buttons)};onmouseenter=t=>{this.Fc(t),o.A.enabled&&o.A.Hc()};onmouseleave=t=>{this.Fc(t),this.rc=0,this.kl=-1,this.Dl=-1,this.oc=0,this.ac=-1,this.cc=-1,o.A.enabled&&o.A.Yc()};onmousemove=t=>{this.Fc(t),this.rc=0,o.A.enabled&&o.A.Vc(this.kl,this.Dl)};onfocus=t=>{this.hasFocus=!0,this.sc=!0,this.refresh(),o.A.enabled&&o.A.Kc()};onblur=t=>{this.hasFocus=!1,o.A.enabled&&o.A.Xc()};ontouchstart=t=>{if(!this.Rc)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.yc=!0;const i=t.changedTouches[0],s=0|i.clientX,e=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:s,clientY:e})),this.gc=this.Ec=this.Ic=0|i.screenX,this._c=this.vc=this.Cc=0|i.screenY,this.time=t.timeStamp,this.Ac=this.jc(),this.mc=this.zc()};ontouchend=t=>{if(!this.Rc||!this.yc)return;const i=t.changedTouches[0],s=0|i.clientX,e=0|i.clientY;if(this.onmousemove(new MouseEvent('mousemove',{clientX:s,clientY:e})),this.Ec=0|i.screenX,this.vc=0|i.screenY,this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.Ac&&!this.jc())return void(this.yc=!1);if(this.mc&&!this.zc())return void(this.yc=!1);if(this.Bc()||this.Zc()||this.Pc()||this.Uc()){null!==this.input&&(this.input.parentNode?.contains(this.input)&&this.input.parentNode?.removeChild(this.input),this.input=null);const t=document.createElement('input');return this.Pc()?(t.setAttribute('id','username'),t.setAttribute('placeholder','Username')):this.Uc()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.Bc()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.Zc()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this.qc?t.setAttribute('type','password'):t.setAttribute('type',this.Uc()?'password':'text'),t.setAttribute('autofocus','autofocus'),t.setAttribute('spellcheck','false'),t.setAttribute('autocomplete','off'),t.setAttribute('style',`position: fixed; left: ${s}px; top: ${e}px; width: 1px; height: 1px; opacity: 0;`),document.body.appendChild(t),t.focus(),t.click(),this.qc&&(t.oninput=t=>{if(!(t instanceof InputEvent))return;const i=t,s=i.data;null!==s&&'insertText'===i.inputType&&this.onkeydown(new KeyboardEvent('keydown',{key:s,code:s}))}),t.onkeydown=t=>{this.qc&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this.qc&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeyup(new KeyboardEvent('keyup',{key:t.key,code:t.key}))},t.onfocus=t=>{this.input?.parentNode?.removeChild(this.input),this.input=null,this.onfocus(t)},this.input=t,void(this.yc=!1)}const n=t.timeStamp>=this.time+500,h=Math.abs(this.gc-this.Ec)>16||Math.abs(this._c-this.vc)>16;n&&!h?(this.yc=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.oc=0,this.yc=!1)};ontouchmove=t=>{if(!this.Rc||!this.yc)return;const i=t.changedTouches[0],s=0|i.clientX,e=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:s,clientY:e})),this.Ec=0|i.screenX,this.vc=0|i.screenY,this.Ac&&-1===this.No()?(this.Ic-this.Ec>0?this.rotate(2):this.Ic-this.Ec<0&&this.rotate(0),this.Cc-this.vc>0?this.rotate(3):this.Cc-this.vc<0&&this.rotate(1)):(this.mc||-1!==this.No())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this.Ic=this.Ec,this.Cc=this.vc};get Rc(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get qc(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get Nc(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}jc=()=>this.hc&&this.kl>=8&&this.kl<=520&&this.Dl>=11&&this.Dl<=345;Bc=()=>this.hc&&-1===this.Fo()&&!this.ko()&&!this.Do()&&this.kl>=11&&this.kl<=506&&this.Dl>=449&&this.Dl<=482;Zc=()=>this.hc&&(this.ko()||this.Do())&&this.kl>=11&&this.kl<=506&&this.Dl>=383&&this.Dl<=482;zc=()=>this.hc&&this.kl>=562&&this.kl<=752&&this.Dl>=231&&this.Dl<=492;Pc=()=>!this.hc&&2===this.Mo()&&this.kl>=301&&this.kl<=562&&this.Dl>=262&&this.Dl<=279;Uc=()=>!this.hc&&2===this.Mo()&&this.kl>=301&&this.kl<=562&&this.Dl>=279&&this.Dl<=296;rotate=t=>{0===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowLeft',code:'ArrowLeft'}))):1===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowUp',code:'ArrowUp'}))):2===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowRight',code:'ArrowRight'}))):3===t&&(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowDown',code:'ArrowDown'})))};Jc=()=>null!==document.fullscreenElement;Fc=t=>{if(this.Jc()){const i=t.target.getBoundingClientRect(),s=window.innerHeight/l.bc.height,e=(window.innerWidth-l.bc.width*s)/2;this.kl=0|this.$c(t.clientX-i.left-e,0,l.bc.width*s,0,789),this.Dl=0|this.$c(t.clientY-i.top,0,l.bc.height*s,0,532)}else{const i=l.bc.getBoundingClientRect(),s=l.bc.width/i.width,e=l.bc.height/i.height;this.kl=(t.clientX-i.left)*s|0,this.Dl=(t.clientY-i.top)*e|0}this.kl<0&&(this.kl=0),this.Dl<0&&(this.Dl=0),this.kl>789&&(this.kl=789),this.Dl>532&&(this.Dl=532)};$c=(t,i,s,e,n)=>(t-i)*(n-e)/(s-i)+e}},2595:(t,i,s)=>{s.d(i,{A:()=>n});var e=s(1069);class n{static enabled=!1;static Qc=null;static tf=null;static if=0;static sf=0;static ef=0;static nf=0;static hf=0;static rf=()=>{this.Qc=e.A.Pt(1),this.tf=null,this.if=performance.now(),this.enabled=!0};static lf=()=>{this.enabled=!1,this.Qc=null};static flush=()=>{let t=null;return this.tf&&this.enabled&&(t=this.tf),this.tf=null,t};static stop=()=>{let t=null;return this.Qc&&this.Qc.af>0&&this.enabled&&(t=this.Qc),this.lf(),t};static Wc=(t,i,s)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;this.sf++;const e=performance.now();let n=(e-this.if)/10|0;n>250&&(n=250),this.if=e,this.cf(5),1===s?this.Qc?.p1(1):this.Qc?.p1(2),this.Qc?.p1(n),this.Qc?.p3(t+(i<<10))};static Gc=t=>{if(!this.enabled)return;this.sf++;const i=performance.now();let s=(i-this.if)/10|0;s>250&&(s=250),this.if=i,this.cf(2),1===t?this.Qc?.p1(3):this.Qc?.p1(4),this.Qc?.p1(s)};static Vc=(t,i)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;const s=performance.now();if(s-this.ef>=50){this.ef=s,this.sf++;let e=(s-this.if)/10|0;e>250&&(e=250),this.if=s,t-this.nf<8&&t-this.nf>=-8&&i-this.hf<8&&i-this.hf>=-8?(this.cf(3),this.Qc?.p1(5),this.Qc?.p1(e),this.Qc?.p1(t+(i-this.hf+8<<4)+8-this.nf)):t-this.nf<128&&t-this.nf>=-128&&i-this.hf<128&&i-this.hf>=-128?(this.cf(4),this.Qc?.p1(6),this.Qc?.p1(e),this.Qc?.p1(t+128-this.nf),this.Qc?.p1(i+128-this.hf)):(this.cf(5),this.Qc?.p1(7),this.Qc?.p1(e),this.Qc?.p3(t+(i<<10))),this.nf=t,this.hf=i}};static kc=t=>{if(!this.enabled)return;this.sf++;const i=performance.now();let s=(i-this.if)/10|0;s>250&&(s=250),this.if=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.cf(3),this.Qc?.p1(8),this.Qc?.p1(s),this.Qc?.p1(t)};static Dc=t=>{if(!this.enabled)return;this.sf++;const i=performance.now();let s=(i-this.if)/10|0;s>250&&(s=250),this.if=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.cf(3),this.Qc?.p1(9),this.Qc?.p1(s),this.Qc?.p1(t)};static Kc=()=>{if(!this.enabled)return;this.sf++;const t=performance.now();let i=(t-this.if)/10|0;i>250&&(i=250),this.if=t,this.cf(2),this.Qc?.p1(10),this.Qc?.p1(i)};static Xc=()=>{if(!this.enabled)return;this.sf++;const t=performance.now();let i=(t-this.if)/10|0;i>250&&(i=250),this.if=t,this.cf(2),this.Qc?.p1(11),this.Qc?.p1(i)};static Hc=()=>{if(!this.enabled)return;this.sf++;const t=performance.now();let i=(t-this.if)/10|0;i>250&&(i=250),this.if=t,this.cf(2),this.Qc?.p1(12),this.Qc?.p1(i)};static Yc=()=>{if(!this.enabled)return;this.sf++;const t=performance.now();let i=(t-this.if)/10|0;i>250&&(i=250),this.if=t,this.cf(2),this.Qc?.p1(13),this.Qc?.p1(i)};static cf=t=>{if(this.Qc&&this.Qc.af+t>=500){const t=this.Qc;this.Qc=e.A.Pt(1),this.tf=t}}}},9091:(t,i,s)=>{s.d(i,{c:()=>n,g:()=>e});const e=['F11','F12'],n={'Backspace':{code:8,ch:8},'Enter':{code:10,ch:10},'Shift':{code:16,ch:65535},'Escape':{code:27,ch:27},'Tab':{code:9,ch:9},'CapsLock':{code:20,ch:65535},' ':{code:32,ch:32},'Control':{code:17,ch:65535},'Alt':{code:18,ch:65535},'Meta':{code:524,ch:65535},'ArrowLeft':{code:37,ch:65535},'ArrowRight':{code:39,ch:65535},'ArrowUp':{code:38,ch:65535},'ArrowDown':{code:40,ch:65535},'Insert':{code:155,ch:65535},'Home':{code:36,ch:65535},'PageUp':{code:33,ch:65535},'Delete':{code:127,ch:127},'End':{code:35,ch:65535},'PageDown':{code:34,ch:65535},'`':{code:192,ch:96},'~':{code:192,ch:126},'!':{code:49,ch:33},'@':{code:50,ch:64},'#':{code:51,ch:35},'$':{code:52,ch:36},'%':{code:53,ch:37},'^':{code:54,ch:94},'&':{code:55,ch:38},'*':{code:56,ch:42},'(':{code:57,ch:40},')':{code:48,ch:41},'-':{code:45,ch:45},'_':{code:45,ch:95},'=':{code:61,ch:61},'+':{code:61,ch:43},'[':{code:91,ch:91},'{':{code:91,ch:123},']':{code:93,ch:93},'}':{code:93,ch:125},'\\':{code:92,ch:92},'|':{code:92,ch:124},';':{code:59,ch:59},':':{code:59,ch:58},"'":{code:222,ch:39},'"':{code:222,ch:34},',':{code:44,ch:44},'<':{code:44,ch:60},'.':{code:46,ch:46},'>':{code:46,ch:62},'/':{code:47,ch:47},'?':{code:47,ch:63},'F1':{code:112,ch:65535},'F2':{code:113,ch:65535},'F3':{code:114,ch:65535},'F4':{code:115,ch:65535},'F5':{code:116,ch:65535},'F6':{code:117,ch:65535},'F7':{code:118,ch:65535},'F8':{code:119,ch:65535},'F9':{code:120,ch:65535},'F10':{code:121,ch:65535},'F11':{code:122,ch:65535},'F12':{code:123,ch:65535},0:{code:48,ch:48},1:{code:49,ch:49},2:{code:50,ch:50},3:{code:51,ch:51},4:{code:52,ch:52},5:{code:53,ch:53},6:{code:54,ch:54},7:{code:55,ch:55},8:{code:56,ch:56},9:{code:57,ch:57},'a':{code:65,ch:97},'b':{code:66,ch:98},'c':{code:67,ch:99},'d':{code:68,ch:100},'e':{code:69,ch:101},'f':{code:70,ch:102},'g':{code:71,ch:103},'h':{code:72,ch:104},'i':{code:73,ch:105},'j':{code:74,ch:106},'k':{code:75,ch:107},'l':{code:76,ch:108},'m':{code:77,ch:109},'n':{code:78,ch:110},'o':{code:79,ch:111},'p':{code:80,ch:112},'q':{code:81,ch:113},'r':{code:82,ch:114},'s':{code:83,ch:115},'t':{code:84,ch:116},'u':{code:85,ch:117},'v':{code:86,ch:118},'w':{code:87,ch:119},'x':{code:88,ch:120},'y':{code:89,ch:121},'z':{code:90,ch:122},'A':{code:65,ch:65},'B':{code:66,ch:66},'C':{code:67,ch:67},'D':{code:68,ch:68},'E':{code:69,ch:69},'F':{code:70,ch:70},'G':{code:71,ch:71},'H':{code:72,ch:72},'I':{code:73,ch:73},'J':{code:74,ch:74},'K':{code:75,ch:75},'L':{code:76,ch:76},'M':{code:77,ch:77},'N':{code:78,ch:78},'O':{code:79,ch:79},'P':{code:80,ch:80},'Q':{code:81,ch:81},'R':{code:82,ch:82},'S':{code:83,ch:83},'T':{code:84,ch:84},'U':{code:85,ch:85},'V':{code:86,ch:86},'W':{code:87,ch:87},'X':{code:88,ch:88},'Y':{code:89,ch:89},'Z':{code:90,ch:90}}},1120:(t,i,s)=>{s.d(i,{A:()=>c});var e=s(1069),n=s(8665),h=s(2679),r=s(2511),o=s(3819),l=s(3867),a=s(8950);class c{static So=[];static ff=null;static Lo=null;static El=0;static uf=1;static bl=2;static Hl=3;static Vl=4;static ia=5;static na=6;static ua=7;static df=1;static wf=2;static yf=3;static Af=4;static pf=5;static Zl=6;static ya=1;static Aa=100;static pa=101;static ma=200;static mf=201;static gf=202;static ga=203;static _f=205;static If=300;static Cf=301;static Ef=302;static vf=303;static bf=304;static Tf=305;static Of=306;static Rf=307;static Sf=308;static Lf=309;static xf=310;static Mf=311;static kf=312;static Df=313;static Ff=314;static Nf=315;static Bf=316;static Pf=317;static Uf=318;static Wf=319;static Gf=320;static Hf=321;static Yf=322;static Vf=323;static Da=324;static Fa=325;static Kf=326;static ba=327;static _a=401;static Ia=500;static Xf=501;static jf=502;static va=503;static Na=600;static zf=601;static Zf=602;static qf=603;static Jf=604;static $f=605;static Qf=606;static tu=607;static iu=608;static su=609;static eu=610;static nu=611;static hu=612;static Ba=613;static Pa=650;static Ga=651;static Ha=652;static Ya=653;static Va=654;static Ua=655;static ru=(t,i,s)=>{this.ff=new h.A(5e4),this.Lo=new h.A(5e4);const n=new e.A(t.read('data'));let r=-1;for(n.af+=2;n.af0){e.Jo=new Uint8Array(h),e.Qo=new Uint16Array(h);for(let t=0;t0){e.scripts=new l.ds(o,null);for(let t=0;t0){const n=s.lastIndexOf(',');e.Gl[t]=this.yu(i,s.substring(0,n),parseInt(s.substring(n+1),10))}}e.Au=new l.ds(5,null);for(let t=0;t<5;t++){const i=n.wu;e.Au[t]=i,0===i.length&&(e.Au[t]=null)}}if(e.type===c.Hl&&(e.fill=1===n.au),e.type===c.Vl||e.type===c.uf){e.Jl=1===n.au;const t=n.au;s&&(e.font=s[t]),e.Ql=1===n.au}if(e.type===c.Vl&&(e.text=n.wu,e.jl=n.wu),e.type!==c.uf&&e.type!==c.Hl&&e.type!==c.Vl||(e.Yl=n.Ko),e.type!==c.Hl&&e.type!==c.Vl||(e.Xl=n.Ko,e.Kl=n.Ko),e.type===c.ia){const t=n.wu;if(t.length>0){const s=t.lastIndexOf(',');e.ea=this.yu(i,t.substring(0,s),parseInt(t.substring(s+1),10))}const s=n.wu;if(s.length>0){const t=s.lastIndexOf(',');e.sa=this.yu(i,s.substring(0,t),parseInt(s.substring(t+1),10))}}if(e.type===c.na){const t=n.au;0!==t&&(e.model=this.la((t-1<<8)+n.au));const i=n.au;0!==i&&(e.pu=this.la((i-1<<8)+n.au)),e.al=n.au,0===e.al?e.al=-1:e.al=(e.al-1<<8)+n.au,e.cl=n.au,0===e.cl?e.cl=-1:e.cl=(e.cl-1<<8)+n.au,e.zoom=n.ou,e.oa=n.ou,e.fa=n.ou}if(e.type===c.ua){e.Rl=new Int32Array(e.width*e.height),e.Sl=new Int32Array(e.width*e.height),e.Jl=1===n.au;const t=n.au;s&&(e.font=s[t]),e.Ql=1===n.au,e.Yl=n.Ko,e.Ll=n.fu,e.xl=n.fu,e.uu=1===n.au,e.Au=new l.ds(5,null);for(let t=0;t<5;t++){const i=n.wu;e.Au[t]=i,0===i.length&&(e.Au[t]=null)}}e.zl!==c.wf&&e.type!==c.bl||(e.mu=n.wu,e.action=n.wu,e.gu=n.ou),e.zl!==c.df&&e.zl!==c.Af&&e.zl!==c.pf&&e.zl!==c.Zl||(e._u=n.wu,0===e._u.length&&(e.zl===c.df?e._u='Ok':e.zl===c.Af||e.zl===c.pf?e._u='Select':e.zl===c.Zl&&(e._u='Continue')))}this.ff=null,this.Lo=null};static yu=(t,i,s)=>{const e=o.A.Iu(i)<<8n|BigInt(s);if(this.ff){const t=this.ff.get(e);if(t)return t}let n;try{n=r.A.Cu(t,i,s),this.ff?.put(e,n)}catch(t){return null}return n};static la=t=>{if(this.Lo){const i=this.Lo.get(BigInt(t));if(i)return i}const i=n.A.model(t);return this.Lo?.put(BigInt(t),i),i};id=-1;lu=-1;type=-1;zl=-1;Il=0;width=0;height=0;cu=-1;Jo=null;Qo=null;scripts=null;scroll=0;hide=!1;draggable=!1;uu=!1;du=!1;Ll=0;xl=0;Tl=null;Ol=null;Gl=null;Au=null;fill=!1;Jl=!1;font=null;Ql=!1;text=null;jl=null;Yl=0;Xl=0;Kl=0;ea=null;sa=null;model=null;pu=null;al=-1;cl=-1;zoom=0;oa=0;fa=0;mu=null;action=null;gu=-1;_u=null;ll=null;pl=null;ml=null;x=0;y=0;vl=0;Rl=null;Sl=null;ul=0;fl=0;la(t,i,s){let e=this.model;if(s&&(e=this.pu),!e)return null;if(-1===t&&-1===i&&!e.Eu)return e;const h=n.A.vu(e,!0,!0,!1);return-1===t&&-1===i||h.xa(),-1!==t&&h.Ma(t),-1!==i&&h.Ma(i),h.ka(64,768,-50,-10,-50,!0),h}bu(){if(this.lu===this.id)return this.x;let t=c.So[this.lu];if(!t.ll||!t.pl||!t.ml)return this.x;let i=t.ll.indexOf(this.id);if(-1===i)return this.x;let s=t.pl[i];for(;t.lu!==t.id;){const e=c.So[t.lu];e.ll&&e.pl&&e.ml&&(i=e.ll.indexOf(t.id),-1!==i&&(s+=e.pl[i])),t=e}return s}Tu(){if(this.lu===this.id)return this.y;let t=c.So[this.lu];if(!t.ll||!t.pl||!t.ml)return this.y;let i=t.ll.indexOf(this.id);if(-1===i)return this.y;let s=t.ml[i];for(;t.lu!==t.id;){const e=c.So[t.lu];e.ll&&e.pl&&e.ml&&(i=e.ll.indexOf(t.id),-1!==i&&(s+=e.ml[i])),t=e}return s}outline(t){const i=this.bu(),s=this.Tu();a.A.gl(i,s,this.width,this.height,t)}move(t,i){if(this.lu===this.id)return;this.x=0,this.y=0;const s=c.So[this.lu];if(s.ll&&s.pl&&s.ml){const e=s.ll.indexOf(this.id);-1!==e&&(s.pl[e]=t,s.ml[e]=i)}}delete(){if(this.lu===this.id)return;const t=c.So[this.lu];if(t.ll&&t.pl&&t.ml){const i=t.ll.indexOf(this.id);-1!==i&&(t.ll.splice(i,1),t.pl.splice(i,1),t.ml.splice(i,1))}}}},6333:(t,i,s)=>{s.d(i,{$:()=>e});class e{id;Ou=null;constructor(t){this.id=t}Ru(t){for(;;){const i=t.au;if(0===i)break;this.decode(i,t)}return this}}},2164:(t,i,s)=>{s.d(i,{A:()=>h});var e=s(1069),n=s(6333);class h extends n.${static count=0;static So=[];static ru=t=>{const i=new e.A(t.read('flo.dat'));this.count=i.ou;for(let t=0;t(s>179&&(i=i/2|0),s>192&&(i=i/2|0),s>217&&(i=i/2|0),s>243&&(i=i/2|0),(t/4<<10)+(i/32<<7)+(s/2|0));static Lu=(t,i)=>-1===t?12345678:((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);static xu=(t,i)=>-2===t?12345678:-1===t?(i<0?i=0:i>127&&(i=127),127-i):((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);Mu=0;texture=-1;ku=!1;Du=!0;Fu=0;Nu=0;Bu=0;Pu=0;Uu=0;Wu=0;decode(t,i){1===t?(this.Mu=i.Gu,this.setColor(this.Mu)):2===t?this.texture=i.au:3===t?this.ku=!0:5===t?this.Du=!1:6===t?this.Ou=i.wu:console.log('Error unrecognised config code: ',t)}setColor(t){const i=(t>>16&255)/256,s=(t>>8&255)/256,e=(255&t)/256;let n=i;si&&(r=s),e>r&&(r=e);let o=0,l=0;const a=(n+r)/2;n!==r&&(a<.5&&(l=(r-n)/(r+n)),a>=.5&&(l=(r-n)/(2-r-n)),i===r?o=(s-e)/(r-n):s===r?o=(e-i)/(r-n)+2:e===r&&(o=(i-s)/(r-n)+4)),o/=6,this.Fu=256*o|0,this.Nu=256*l|0,this.Bu=256*a|0,this.Nu<0?this.Nu=0:this.Nu>255&&(this.Nu=255),this.Bu<0?this.Bu=0:this.Bu>255&&(this.Bu=255),this.Pu=a>.5?(1-a)*l*512|0:a*l*512|0,this.Pu<1&&(this.Pu=1),this.Uu=o*this.Pu|0;let c=this.Fu+(16*Math.random()|0)-8;c<0?c=0:c>255&&(c=255);let f=this.Nu+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255);let u=this.Bu+(48*Math.random()|0)-24;u<0?u=0:u>255&&(u=255),this.Wu=h.Su(c,f,u)}}},8317:(t,i,s)=>{s.d(i,{A:()=>o});var e=s(1069),n=s(6333),h=s(8665),r=s(3867);class o extends n.${static count=0;static So=[];static ru=t=>{const i=new e.A(t.read('idk.dat'));this.count=i.ou;for(let t=0;t=40&&t<50)this.Vu[t-40]=i.ou;else if(t>=50&&t<60)this.Ku[t-50]=i.ou;else{if(!(t>=60&&t<70))throw new Error(`Unrecognized idk config code: ${t}`);this.Yu[t-60]=i.ou}}la(){if(!this.Hu)return null;const t=new r.ds(this.Hu.length,null);for(let i=0;i{s.d(i,{A:()=>c});var e=s(6333),n=s(1069),h=s(2679),r=s(8665),o=s(1023),l=s(6169),a=s(3867);class c extends e.${static count=0;static cache=null;static ju=null;static zu=null;static Zu=0;static qu=new h.A(500);static Ju=new h.A(30);static ru=t=>{this.ju=new n.A(t.read('loc.dat'));const i=new n.A(t.read('loc.idx'));this.count=i.ou,this.zu=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.zu||!this.ju)throw new Error('LocType not loaded!!!');for(let i=0;i<10;i++){const s=this.cache[i];if(s&&s.id===t)return s}this.Zu=(this.Zu+1)%10;const i=this.cache[this.Zu];return this.ju.af=this.zu[t],i.id=t,i.reset(),i.Ru(this.ju),i.$u||(i.$u=new Int32Array(1)),-1===i.Qu&&i.$u&&(i.active=i.$u.length>0&&i.$u[0]===o.A.td.id,i.sd&&(i.active=!0)),i};static To=()=>{this.qu=null,this.Ju=null,this.zu=null,this.cache=null,this.ju=null};Hu=null;$u=null;name=null;ed=null;Vu=null;Ku=null;width=1;length=1;nd=!0;hd=!0;active=!1;Qu=-1;rd=!1;od=!1;Du=!1;al=-1;ld=!1;ad=16;fd=0;ud=0;sd=null;dd=-1;wd=-1;yd=!1;Ad=!0;pd=128;md=128;gd=128;_d=0;Id=0;Cd=0;Ed=0;vd=!1;decode(t,i){if(1===t){const t=i.au;this.Hu=new Int32Array(t),this.$u=new Int32Array(t);for(let s=0;s=30&&t<39)this.sd||(this.sd=new a.ds(5,null)),this.sd[t-30]=i.wu,'hidden'===this.sd[t-30]?.toLowerCase()&&(this.sd[t-30]=null);else if(40===t){const t=i.au;this.Vu=new Uint16Array(t),this.Ku=new Uint16Array(t);for(let s=0;s=this.Hu.length)return null;let d=this.Hu[a];if(-1===d)return null;const w=this.yd!==i>3;w&&(d+=65536);let y=c.qu?.get(BigInt(d));y||(y=r.A.model(65535&d),w&&y.Md(),c.qu?.put(BigInt(d),y));const A=128!==this.pd||128!==this.md||128!==this.gd,p=0!==this.Id||0!==this.Cd||0!==this.Ed;let m=r.A.vu(y,!this.Vu,!this.ld,i===l.A.kd&&-1===o&&!A&&!p);for(-1!==o&&(m.xa(),m.Ma(o),m.Dd=null,m.Fd=null);i-- >0;)m.Nd();if(this.Vu&&this.Ku)for(let t=0;t{s.d(i,{A:()=>l});var e=s(6333),n=s(1069),h=s(2679),r=s(8665),o=s(3867);class l extends e.${static count=0;static cache=null;static ju=null;static zu=null;static Zu=0;static Lo=new h.A(30);static ru=t=>{this.ju=new n.A(t.read('npc.dat'));const i=new n.A(t.read('npc.idx'));this.count=i.ou,this.zu=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.zu||!this.ju)throw new Error('NpcType not loaded!!!');for(let i=0;i<20;i++){const s=this.cache[i];if(s&&s.id===t)return s}this.Zu=(this.Zu+1)%20;const i=this.cache[this.Zu]=new l(t);return this.ju.af=this.zu[t],i.Ru(this.ju),i};static To=()=>{this.Lo=null,this.zu=null,this.cache=null,this.ju=null};name=null;ed=null;size=1;Hu=null;Yu=null;ld=!1;Ud=-1;Wd=-1;Gd=-1;Hd=-1;Yd=-1;Vu=null;Ku=null;sd=null;pd=-1;md=-1;gd=-1;Vd=!0;Kd=-1;Xd=128;jd=128;decode(t,i){if(1===t){const t=i.au;this.Hu=new Uint16Array(t);for(let s=0;s=30&&t<40)this.sd||(this.sd=new o.ds(5,null)),this.sd[t-30]=i.wu,'hidden'===this.sd[t-30]?.toLowerCase()&&(this.sd[t-30]=null);else if(40===t){const t=i.au;this.Vu=new Uint16Array(t),this.Ku=new Uint16Array(t);for(let s=0;s{s.d(i,{A:()=>u});var e=s(6333),n=s(1069),h=s(2511),r=s(2679),o=s(8665),l=s(4583),a=s(8950),c=s(9298),f=s(3867);class u extends e.${static count=0;static cache=null;static ju=null;static zu=null;static Zu=0;static Qd=!0;static Lo=new r.A(50);static tw=new r.A(200);static ru=(t,i)=>{this.Qd=i,this.ju=new n.A(t.read('obj.dat'));const s=new n.A(t.read('obj.idx'));this.count=s.ou,this.zu=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.zu||!this.ju)throw new Error('ObjType not loaded!!!');for(let i=0;i<10;i++){const s=this.cache[i];if(s&&s.id===t)return s}this.Zu=(this.Zu+1)%10;const i=this.cache[this.Zu];return this.ju.af=this.zu[t],i.id=t,i.reset(),i.Ru(this.ju),-1!==i.iw&&i.sw(),!this.Qd&&i.members&&(i.name='Members Object',i.ed="Login to a members' server to use this object.",i.sd=null,i.ew=null),i};static To=()=>{this.Lo=null,this.tw=null,this.zu=null,this.cache=null,this.ju=null};static Ml=(t,i)=>{if(u.tw){let s=u.tw.get(BigInt(t));if(s&&s.nw!==i&&-1!==s.nw&&(s.hw(),s=null),s)return s}let s=u.get(t);if(s.rw||(i=-1),s.rw&&s.ow&&i>1){let t=-1;for(let e=0;e<10;e++)i>=s.ow[e]&&0!==s.ow[e]&&(t=s.rw[e]);-1!==t&&(s=u.get(t))}const e=new h.A(32,32),n=l.A.ha,r=l.A.ra,o=l.A.lw,f=a.A.aw,d=a.A.cw,w=a.A.fw,y=a.A.left,A=a.A.right,p=a.A.top,m=a.A.bottom;l.A.uw=!1,a.A.bind(e.aw,32,32),a.A.fillRect(0,0,32,32,c.A.Ul),l.A.Tc();const g=s.dw(1),_=l.A.sin[s.ww]*s.yw>>16,I=l.A.cos[s.ww]*s.yw>>16;g.ca(0,s.Aw,s.pw,s.ww,s.mw,_+(g.Pd/2|0)+s.gw,I+s.gw);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===e.aw[t+32*i]&&(t>0&&e.aw[t+32*i-1]>1||i>0&&e.aw[t+32*(i-1)]>1||t<31&&e.aw[t+32*i+1]>1||i<31&&e.aw[t+32*(i+1)]>1)&&(e.aw[t+32*i]=1);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===e.aw[t+32*i]&&t>0&&i>0&&e.aw[t+32*(i-1)-1]>0&&(e.aw[t+32*i]=3153952);if(-1!==s.iw){const t=this.Ml(s._w,10),i=t.Nl,e=t.nw;t.Nl=32,t.nw=32,t.Iw(5,5,22,22),t.Nl=i,t.nw=e}return u.tw?.put(BigInt(t),e),a.A.bind(f,d,w),a.A.Al(y,p,A,m),l.A.ha=n,l.A.ra=r,l.A.lw=o,l.A.uw=!0,s.da?e.Nl=33:e.Nl=32,e.nw=i,e};model=0;name=null;ed=null;Vu=null;Ku=null;yw=2e3;ww=0;Aw=0;pw=0;mw=0;gw=0;Cw=!1;Ew=-1;da=!1;bw=1;members=!1;sd=null;ew=null;Tw=-1;Ow=-1;Rw=0;Sw=-1;Lw=-1;xw=0;Mw=-1;kw=-1;Dw=-1;Fw=-1;Nw=-1;Bw=-1;rw=null;ow=null;_w=-1;iw=-1;decode(t,i){if(1===t)this.model=i.ou;else if(2===t)this.name=i.wu;else if(3===t)this.ed=i.wu;else if(4===t)this.yw=i.ou;else if(5===t)this.ww=i.ou;else if(6===t)this.Aw=i.ou;else if(7===t)this.mw=i.fu,this.mw>32767&&(this.mw-=65536);else if(8===t)this.gw=i.fu,this.gw>32767&&(this.gw-=65536);else if(9===t)this.Cw=!0;else if(10===t)this.Ew=i.ou;else if(11===t)this.da=!0;else if(12===t)this.bw=i.Ko;else if(16===t)this.members=!0;else if(23===t)this.Tw=i.ou,this.Rw=i.bd;else if(24===t)this.Ow=i.ou;else if(25===t)this.Sw=i.ou,this.xw=i.bd;else if(26===t)this.Lw=i.ou;else if(t>=30&&t<35)this.sd||(this.sd=new f.ds(5,null)),this.sd[t-30]=i.wu,'hidden'===this.sd[t-30]?.toLowerCase()&&(this.sd[t-30]=null);else if(t>=35&&t<40)this.ew||(this.ew=new f.ds(5,null)),this.ew[t-35]=i.wu;else if(40===t){const t=i.au;this.Vu=new Uint16Array(t),this.Ku=new Uint16Array(t);for(let s=0;s=100&&t<110&&(this.rw&&this.ow||(this.rw=new Uint16Array(10),this.ow=new Uint16Array(10)),this.rw[t-100]=i.ou,this.ow[t-100]=i.ou)}Pw(t){let i=this.Tw;if(1===t&&(i=this.Sw),-1===i)return null;let s=this.Ow,e=this.Mw;1===t&&(s=this.Lw,e=this.kw);let n=o.A.model(i);if(-1!==s){const t=o.A.model(s);if(-1===e){const i=[n,t];n=o.A.Ta(i,2)}else{const i=[n,t,o.A.model(e)];n=o.A.Ta(i,3)}}if(0===t&&0!==this.Rw&&n.translate(this.Rw,0,0),1===t&&0!==this.xw&&n.translate(this.xw,0,0),this.Vu&&this.Ku)for(let t=0;t1){let i=-1;for(let s=0;s<10;s++)t>=this.ow[s]&&0!==this.ow[s]&&(i=this.rw[s]);if(-1!==i)return u.get(i).dw(1)}if(u.Lo){const t=u.Lo.get(BigInt(this.id));if(t)return t}const i=o.A.model(this.model);if(this.Vu&&this.Ku)for(let t=0;t{s.d(i,{A:()=>r});var e=s(6333),n=s(1069),h=s(6730);class r extends e.${static count=0;static So=[];static ru=t=>{const i=new n.A(t.read('seq.dat'));this.count=i.ou;for(let t=0;t{s.d(i,{A:()=>l});var e=s(6333),n=s(1069),h=s(1312),r=s(8665),o=s(2679);class l extends e.${static count=0;static So=[];static Lo=new o.A(30);static ru=t=>{const i=new n.A(t.read('spotanim.dat'));this.count=i.ou;for(let t=0;t=40&&t<50)this.Vu[t-40]=i.ou;else{if(!(t>=50&&t<60))throw new Error(`Unrecognized spotanim config code: ${t}`);this.Ku[t-50]=i.ou}}la(){let t=l.Lo?.get(BigInt(this.id));if(t)return t;t=r.A.model(this.model);for(let i=0;i<6;i++)0!==this.Vu[0]&&t.Oa(this.Vu[i],this.Ku[i]);return l.Lo?.put(BigInt(this.id),t),t}}},3764:(t,i,s)=>{s.d(i,{A:()=>h});var e=s(6333),n=s(1069);class h extends e.${static count=0;static So=[];static Kw=[];static Xw=0;static ru=t=>{const i=new n.A(t.read('varp.dat'));this.count=i.ou;for(let t=0;t{s.d(i,{A:()=>e});class e{static OPEN=0;static $w=1;static Qw=2;static ty=4;static iy=8;static sy=e.$w<<4;static ey=e.Qw<<4;static ny=e.ty<<4;static hy=e.iy<<4;static oy=256;static ly=512;static uy=1024;static wy=2048;static yy=4096;static Ay=e.ly<<4;static py=e.uy<<4;static my=e.wy<<4;static gy=e.yy<<4;static _y=e.oy<<9;static Iy=524288;static Cy=2097152;static Ey=e.Cy|e.Iy;static vy=e.oy|e.Ey;static by=e.Qw|e.vy;static Ty=e.iy|e.vy;static Oy=e.Qw|e.ty|e.Ty;static Ry=e.ey|e.vy;static Sy=e.iy|e.sy|e.Ry;static Ly=e.hy|e.vy;static xy=e.$w|e.Qw|e.Ly;static My=e.ey|e.ny|e.Ly;static ky=16777215}},670:(t,i,s)=>{s.d(i,{A:()=>o});var e=s(9456),n=s(6169),h=s(1023),r=s(4909);class o{static kh=4;static Xh=104;static index=(t,i)=>t*o.Xh+i;offsetX;Dy;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.Dy=0,this.sizeX=o.Xh,this.sizeZ=o.Xh,this.flags=new Int32Array(this.sizeX*this.sizeZ),this.reset()}reset=()=>{for(let t=0;t{this.flags[o.index(t-this.offsetX,i-this.Dy)]|=e.A.Cy};Ny=(t,i)=>{this.flags[o.index(t-this.offsetX,i-this.Dy)]&=~e.A.Cy};By=(t,i,s,h,r,o)=>{let l=e.A.oy;o&&(l|=e.A._y);const a=t-this.offsetX,c=i-this.Dy;if(r===n.A.Py||r===n.A.Uy){const t=s;s=h,h=t}for(let t=a;t=0&&t=0&&i{let l=e.A.oy;o&&(l|=e.A._y);const a=t-this.offsetX,c=i-this.Dy;if(r===n.A.Py||r===n.A.Uy){const t=s;s=h,h=t}for(let t=a;t=0&&t=0&&i{const l=t-this.offsetX,a=i-this.Dy,c=o?e.A.gy:e.A.hy,f=o?e.A.yy:e.A.iy,u=o?e.A.uy:e.A.Qw,d=o?e.A.py:e.A.ey,w=o?e.A.ly:e.A.$w,y=o?e.A.Ay:e.A.sy,A=o?e.A.wy:e.A.ty,p=o?e.A.my:e.A.ny;s===h.A.Hy.id?r===n.A.kd?(this.add(l,a,c),this.add(l-1,a,f)):r===n.A.Py?(this.add(l,a,u),this.add(l,a+1,d)):r===n.A.Yy?(this.add(l,a,f),this.add(l+1,a,c)):r===n.A.Uy&&(this.add(l,a,d),this.add(l,a-1,u)):s===h.A.Vy.id||s===h.A.Ky.id?r===n.A.kd?(this.add(l,a,w),this.add(l-1,a+1,y)):r===n.A.Py?(this.add(l,a,A),this.add(l+1,a+1,p)):r===n.A.Yy?(this.add(l,a,y),this.add(l+1,a-1,w)):r===n.A.Uy&&(this.add(l,a,p),this.add(l-1,a-1,A)):s===h.A.Xy.id&&(r===n.A.kd?(this.add(l,a,u|c),this.add(l-1,a,f),this.add(l,a+1,d)):r===n.A.Py?(this.add(l,a,u|f),this.add(l,a+1,d),this.add(l+1,a,c)):r===n.A.Yy?(this.add(l,a,d|f),this.add(l+1,a,c),this.add(l,a-1,u)):r===n.A.Uy&&(this.add(l,a,d|c),this.add(l,a-1,u),this.add(l-1,a,f))),o&&this.Gy(t,i,s,r,!1)};jy=(t,i,s,r,o)=>{const l=t-this.offsetX,a=i-this.Dy,c=o?e.A.gy:e.A.hy,f=o?e.A.yy:e.A.iy,u=o?e.A.uy:e.A.Qw,d=o?e.A.py:e.A.ey,w=o?e.A.ly:e.A.$w,y=o?e.A.Ay:e.A.sy,A=o?e.A.wy:e.A.ty,p=o?e.A.my:e.A.ny;s===h.A.Hy.id?r===n.A.kd?(this.remove(l,a,c),this.remove(l-1,a,f)):r===n.A.Py?(this.remove(l,a,u),this.remove(l,a+1,d)):r===n.A.Yy?(this.remove(l,a,f),this.remove(l+1,a,c)):r===n.A.Uy&&(this.remove(l,a,d),this.remove(l,a-1,u)):s===h.A.Vy.id||s===h.A.Ky.id?r===n.A.kd?(this.remove(l,a,w),this.remove(l-1,a+1,y)):r===n.A.Py?(this.remove(l,a,A),this.remove(l+1,a+1,p)):r===n.A.Yy?(this.remove(l,a,y),this.remove(l+1,a-1,w)):r===n.A.Uy&&(this.remove(l,a,p),this.remove(l-1,a-1,A)):s===h.A.Xy.id&&(r===n.A.kd?(this.remove(l,a,u|c),this.remove(l-1,a,f),this.remove(l,a+1,d)):r===n.A.Py?(this.remove(l,a,u|f),this.remove(l,a+1,d),this.remove(l+1,a,c)):r===n.A.Yy?(this.remove(l,a,d|f),this.remove(l+1,a,c),this.remove(l,a-1,u)):r===n.A.Uy&&(this.remove(l,a,d|c),this.remove(l,a-1,u),this.remove(l-1,a,f))),o&&this.jy(t,i,s,r,!1)};zy=(t,i,s,r,l,a)=>{if(t===s&&i===r)return!0;const c=t-this.offsetX,f=i-this.Dy,u=s-this.offsetX,d=r-this.Dy,w=o.index(c,f);if(l===h.A.Hy.id){if(a===n.A.kd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&e.A.Ry)===e.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&e.A.by)===e.A.OPEN)return!0}else if(a===n.A.Py){if(c===u&&f===d+1)return!0;if(c===u-1&&f===d&&(this.flags[w]&e.A.Ty)===e.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&e.A.Ly)===e.A.OPEN)return!0}else if(a===n.A.Yy){if(c===u+1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&e.A.Ry)===e.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&e.A.by)===e.A.OPEN)return!0}else if(a===n.A.Uy){if(c===u&&f===d-1)return!0;if(c===u-1&&f===d&&(this.flags[w]&e.A.Ty)===e.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&e.A.Ly)===e.A.OPEN)return!0}}else if(l===h.A.Xy.id){if(a===n.A.kd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d&&(this.flags[w]&e.A.Ly)===e.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&e.A.by)===e.A.OPEN)return!0}else if(a===n.A.Py){if(c===u-1&&f===d&&(this.flags[w]&e.A.Ty)===e.A.OPEN)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1&&(this.flags[w]&e.A.by)===e.A.OPEN)return!0}else if(a===n.A.Yy){if(c===u-1&&f===d&&(this.flags[w]&e.A.Ty)===e.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&e.A.Ry)===e.A.OPEN)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1)return!0}else if(a===n.A.Uy){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&e.A.Ry)===e.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&e.A.Ly)===e.A.OPEN)return!0;if(c===u&&f===d-1)return!0}}else if(l===h.A.Zy.id){if(c===u&&f===d+1&&(this.flags[w]&e.A.ey)===e.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&e.A.Qw)===e.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&e.A.iy)===e.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&e.A.hy)===e.A.OPEN)return!0}return!1};qy=(t,i,s,r,l,a)=>{if(t===s&&i===r)return!0;const c=t-this.offsetX,f=i-this.Dy,u=s-this.offsetX,d=r-this.Dy,w=o.index(c,f);if(l===h.A.Jy.id||l===h.A.$y.id){if(l===h.A.$y.id&&(a=a+2&3),a===n.A.kd){if(c===u+1&&f===d&&(this.flags[w]&e.A.hy)===e.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&e.A.Qw)===e.A.OPEN)return!0}else if(a===n.A.Py){if(c===u-1&&f===d&&(this.flags[w]&e.A.iy)===e.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&e.A.Qw)===e.A.OPEN)return!0}else if(a===n.A.Yy){if(c===u-1&&f===d&&(this.flags[w]&e.A.iy)===e.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&e.A.ey)===e.A.OPEN)return!0}else if(a===n.A.Uy){if(c===u+1&&f===d&&(this.flags[w]&e.A.hy)===e.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&e.A.ey)===e.A.OPEN)return!0}}else if(l===h.A.Qy.id){if(c===u&&f===d+1&&(this.flags[w]&e.A.ey)===e.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&e.A.Qw)===e.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&e.A.iy)===e.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&e.A.hy)===e.A.OPEN)return!0}return!1};tA=(t,i,s,n,h,l,a)=>{const c=s+h-1,f=n+l-1,u=o.index(t-this.offsetX,i-this.Dy);return t>=s&&t<=c&&i>=n&&i<=f||(t===s-1&&i>=n&&i<=f&&(this.flags[u]&e.A.iy)===e.A.OPEN&&(a&r.A.kd)===e.A.OPEN||(t===c+1&&i>=n&&i<=f&&(this.flags[u]&e.A.hy)===e.A.OPEN&&(a&r.A.Yy)===e.A.OPEN||(i===n-1&&t>=s&&t<=c&&(this.flags[u]&e.A.Qw)===e.A.OPEN&&(a&r.A.Uy)===e.A.OPEN||i===f+1&&t>=s&&t<=c&&(this.flags[u]&e.A.ey)===e.A.OPEN&&(a&r.A.Py)===e.A.OPEN)))};add=(t,i,s)=>{this.flags[o.index(t,i)]|=s};remove=(t,i,s)=>{this.flags[o.index(t,i)]&=e.A.ky-s}}},4909:(t,i,s)=>{s.d(i,{A:()=>e});class e{static Py=1;static Yy=2;static Uy=4;static kd=8}},6169:(t,i,s)=>{s.d(i,{A:()=>e});class e{static kd=0;static Py=1;static Yy=2;static Uy=3}},5599:(t,i,s)=>{s.d(i,{A:()=>e});class e{static iA=0;static sA=1;static eA=2;static nA=3}},1023:(t,i,s)=>{s.d(i,{A:()=>n});var e=s(5599);class n{static Hy=new n(0,e.A.iA);static Vy=new n(1,e.A.iA);static Xy=new n(2,e.A.iA);static Ky=new n(3,e.A.iA);static hA=new n(4,e.A.sA);static rA=new n(5,e.A.sA);static Jy=new n(6,e.A.sA);static $y=new n(7,e.A.sA);static Qy=new n(8,e.A.sA);static Zy=new n(9,e.A.eA);static td=new n(10,e.A.eA);static oA=new n(11,e.A.eA);static lA=new n(12,e.A.eA);static aA=new n(13,e.A.eA);static cA=new n(14,e.A.eA);static fA=new n(15,e.A.eA);static uA=new n(16,e.A.eA);static dA=new n(17,e.A.eA);static wA=new n(18,e.A.eA);static yA=new n(19,e.A.eA);static AA=new n(20,e.A.eA);static pA=new n(21,e.A.eA);static nA=new n(22,e.A.nA);static values(){return[this.Hy,this.Vy,this.dA,this.fA,this.Xy,this.cA,this.Zy,this.Ky,this.nA,this.lA,this.oA,this.Jy,this.AA,this.td,this.rA,this.aA,this.$y,this.hA,this.uA,this.Qy,this.yA,this.pA,this.wA]}static of(t){const i=this.values();for(let s=0;s{s.d(i,{A:()=>A});var e=s(670),n=s(2164),h=s(1069),r=s(4583),o=s(3045),l=s(5637),a=s(4197),c=s(1312),f=s(1023),u=s(6169),d=s(9298),w=s(5518),y=s(3867);class A{static mA=Int8Array.of(1,2,4,8);static gA=Uint8Array.of(16,32,64,128);static _A=Int8Array.of(1,0,-1,0);static IA=Int8Array.of(0,-1,0,1);static CA=(17*Math.random()|0)-8;static EA=(33*Math.random()|0)-16;static st=!0;static vA=0;static bA=!1;static TA=(t,i)=>{let s=this.OA(t+45365,i+91923,4)+(this.OA(t+10294,i+37821,2)-128>>1)+(this.OA(t,i,1)-128>>2)-128;return s=35+(.3*s|0),s<10?s=10:s>60&&(s=60),s};static OA=(t,i,s)=>{const e=t/s|0,n=t&s-1,h=i/s|0,r=i&s-1,o=this.RA(e,h),l=this.RA(e+1,h),a=this.RA(e,h+1),c=this.RA(e+1,h+1),f=this.SA(o,l,n,s),u=this.SA(a,c,n,s);return this.SA(f,u,r,s)};static SA=(t,i,s,e)=>{const n=65536-r.A.cos[1024*s/e|0]>>1;return(t*(65536-n)>>16)+(i*n>>16)};static RA=(t,i)=>((this.LA(t-1,i-1)+this.LA(t+1,i-1)+this.LA(t-1,i+1)+this.LA(t+1,i+1))/16|0)+((this.LA(t-1,i)+this.LA(t+1,i)+this.LA(t,i-1)+this.LA(t,i+1))/8|0)+(this.LA(t,i)/4|0);static LA=(t,i)=>{const s=t+57*i,e=BigInt(s<<13^s);return 255&Number((e*(e*e*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static By=(t,i,s,e,n,h,r,o,d,w,y)=>{const p=n[y][i][s],m=n[y][i+1][s],g=n[y][i+1][s+1],_=n[y][i][s+1],I=p+m+g+_>>2,C=l.A.get(o);let E=i+(s<<7)+(o<<14)+1073741824|0;C.active||(E+=-2147483648),E|=0;const v=(w<<6)+d<<24>>24;if(d===f.A.nA.id)e?.xA(C.la(f.A.nA.id,w,p,m,g,_,-1),t,i,s,I,E,v),C.nd&&C.active&&r?.Fy(i,s),-1!==C.al&&h.MA(new a.A(o,t,3,i,s,c.A.So[C.al],!0));else if(d===f.A.td.id||d===f.A.oA.id){const n=C.la(f.A.td.id,w,p,m,g,_,-1);if(n){let h,r,o=0;d===f.A.oA.id&&(o+=256),w===u.A.Py||w===u.A.Uy?(h=C.length,r=C.width):(h=C.width,r=C.length),e?.By(t,i,s,I,n,null,E,v,h,r,o)}C.nd&&r?.By(i,s,C.width,C.length,w,C.hd),-1!==C.al&&h.MA(new a.A(o,t,2,i,s,c.A.So[C.al],!0))}else if(d>=f.A.lA.id)e?.By(t,i,s,I,C.la(d,w,p,m,g,_,-1),null,E,v,1,1,0),C.nd&&r?.By(i,s,C.width,C.length,w,C.hd),-1!==C.al&&h.MA(new a.A(o,t,2,i,s,c.A.So[C.al],!0));else if(d===f.A.Hy.id)e?.Gy(t,i,s,I,A.mA[w],0,C.la(f.A.Hy.id,w,p,m,g,_,-1),null,E,v),C.nd&&r?.Gy(i,s,d,w,C.hd),-1!==C.al&&h.MA(new a.A(o,t,0,i,s,c.A.So[C.al],!0));else if(d===f.A.Vy.id)e?.Gy(t,i,s,I,A.gA[w],0,C.la(f.A.Vy.id,w,p,m,g,_,-1),null,E,v),C.nd&&r?.Gy(i,s,d,w,C.hd),-1!==C.al&&h.MA(new a.A(o,t,0,i,s,c.A.So[C.al],!0));else if(d===f.A.Xy.id){const n=w+1&3;e?.Gy(t,i,s,I,A.mA[w],A.mA[n],C.la(f.A.Xy.id,w+4,p,m,g,_,-1),C.la(f.A.Xy.id,n,p,m,g,_,-1),E,v),C.nd&&r?.Gy(i,s,d,w,C.hd),-1!==C.al&&h.MA(new a.A(o,t,0,i,s,c.A.So[C.al],!0))}else if(d===f.A.Ky.id)e?.Gy(t,i,s,I,A.gA[w],0,C.la(f.A.Ky.id,w,p,m,g,_,-1),null,E,v),C.nd&&r?.Gy(i,s,d,w,C.hd),-1!==C.al&&h.MA(new a.A(o,t,0,i,s,c.A.So[C.al],!0));else if(d===f.A.Zy.id)e?.By(t,i,s,I,C.la(d,w,p,m,g,_,-1),null,E,v,1,1,0),C.nd&&r?.By(i,s,C.width,C.length,w,C.hd),-1!==C.al&&h.MA(new a.A(o,t,2,i,s,c.A.So[C.al],!0));else if(d===f.A.hA.id)e?.kA(t,i,s,I,0,0,E,C.la(f.A.hA.id,u.A.kd,p,m,g,_,-1),v,512*w,A.mA[w]),-1!==C.al&&h.MA(new a.A(o,t,1,i,s,c.A.So[C.al],!0));else if(d===f.A.rA.id){let n=16;if(e){const h=e.DA(t,i,s);h>0&&(n=l.A.get(h>>14&32767).ad)}e?.kA(t,i,s,I,A._A[w]*n,A.IA[w]*n,E,C.la(f.A.hA.id,u.A.kd,p,m,g,_,-1),v,512*w,A.mA[w]),-1!==C.al&&h.MA(new a.A(o,t,1,i,s,c.A.So[C.al],!0))}else d===f.A.Jy.id?(e?.kA(t,i,s,I,0,0,E,C.la(f.A.hA.id,u.A.kd,p,m,g,_,-1),v,w,256),-1!==C.al&&h.MA(new a.A(o,t,1,i,s,c.A.So[C.al],!0))):d===f.A.$y.id?(e?.kA(t,i,s,I,0,0,E,C.la(f.A.hA.id,u.A.kd,p,m,g,_,-1),v,w,512),-1!==C.al&&h.MA(new a.A(o,t,1,i,s,c.A.So[C.al],!0))):d===f.A.Qy.id&&(e?.kA(t,i,s,I,0,0,E,C.la(f.A.hA.id,u.A.kd,p,m,g,_,-1),v,w,768),-1!==C.al&&h.MA(new a.A(o,t,1,i,s,c.A.So[C.al],!0)))};FA;NA;Hh;Yh;BA;PA;UA;WA;GA;HA;YA;VA;KA;XA;jA;zA;constructor(t,i,s,n){this.FA=t,this.NA=i,this.Hh=s,this.Yh=n,this.BA=new y.ZA(e.A.kh,t,i),this.PA=new y.ZA(e.A.kh,t,i),this.UA=new y.ZA(e.A.kh,t,i),this.WA=new y.ZA(e.A.kh,t,i),this.zA=new y.qA(e.A.kh,t+1,i+1),this.GA=new y.ZA(e.A.kh,t+1,i+1),this.HA=new y.Kh(t+1,i+1),this.YA=new Int32Array(i),this.VA=new Int32Array(i),this.KA=new Int32Array(i),this.XA=new Int32Array(i),this.jA=new Int32Array(i)}JA=(t,i)=>{for(let t=0;t=0&&i[e]?.Fy(s,n)}A.CA+=(5*Math.random()|0)-2,A.CA<-8?A.CA=-8:A.CA>8&&(A.CA=8),A.EA+=(5*Math.random()|0)-2,A.EA<-16?A.EA=-16:A.EA>16&&(A.EA=16);for(let i=0;i>8;for(let t=1;t>2)+(s[n+1][t]>>3)+(s[n][t-1]>>2)+(s[n][t+1]>>3)+(s[n][t]>>1);this.HA[n][t]=u-d}for(let t=0;t=0&&e0){const i=n.A.So[s-1];this.YA[t]+=i.Uu,this.VA[t]+=i.Nu,this.KA[t]+=i.Bu,this.XA[t]+=i.Pu,h=this.jA[t]++}}const r=s-5;if(r>=0&&r0){const i=n.A.So[s-1];this.YA[t]-=i.Uu,this.VA[t]-=i.Nu,this.KA[t]-=i.Bu,this.XA[t]-=i.Pu,h=this.jA[t]--}}}if(s>=1&&s=0&&f=0&&y=1&&c0||y>0){const p=this.Hh[i][s][c],m=this.Hh[i][s+1][c],g=this.Hh[i][s+1][c+1],_=this.Hh[i][s][c+1],I=this.HA[s][c],C=this.HA[s+1][c],E=this.HA[s+1][c+1],v=this.HA[s][c+1];let b=-1,T=-1;if(f>0){const t=256*e/l|0,i=h/a|0;let s=o/a|0;b=n.A.Su(t,i,s);const r=t+A.CA&255;s+=A.EA,s<0?s=0:s>255&&(s=255),T=n.A.Su(r,i,s)}if(i>0){let t=0!==f||this.UA[i][s][c]===w.A.QA;y>0&&!n.A.So[y-1].Du&&(t=!1),t&&p===m&&p===g&&p===_&&(this.zA[i][s][c]|=2340)}let O=0;if(-1!==b&&(O=r.A.palette[n.A.Lu(T,96)]),0===y)t?.tp(i,s,c,w.A.QA,u.A.kd,-1,p,m,g,_,n.A.Lu(b,I),n.A.Lu(b,C),n.A.Lu(b,E),n.A.Lu(b,v),d.A.Ul,d.A.Ul,d.A.Ul,d.A.Ul,O,d.A.Ul);else{const e=this.UA[i][s][c]+1,h=this.WA[i][s][c],o=n.A.So[y-1];let l,a,f=o.texture;f>=0?(a=r.A.ip(f),l=-1):o.Mu===d.A.sp?(a=0,l=-2,f=-1):(l=n.A.Su(o.Fu,o.Nu,o.Bu),a=r.A.palette[n.A.xu(o.Wu,96)]),t?.tp(i,s,c,e,h,f,p,m,g,_,n.A.Lu(b,I),n.A.Lu(b,C),n.A.Lu(b,E),n.A.Lu(b,v),n.A.xu(l,I),n.A.xu(l,C),n.A.xu(l,E),n.A.xu(l,v),O,a)}}}}}}for(let s=1;s0&&(t<<=3,i<<=3,s<<=3);for(let e=0;e<=n;e++)for(let h=0;h<=this.NA;h++)for(let r=0;r<=this.FA;r++){if(this.zA[e][r][h]&t){let i=h,s=h,l=e,a=e;for(;i>0&&this.zA[e][r][i-1]&t;)i--;for(;s0;){for(let e=i;e<=s;e++)if(!(this.zA[l-1][r][e]&t))break t;l--}t:for(;a=8){const e=this.Hh[a][r][i]-240,h=this.Hh[l][r][i];o.A.rp(n,1,128*r,e,128*i,128*r,h,128*s+128);for(let e=l;e<=a;e++)for(let n=i;n<=s;n++)this.zA[e][r][n]&=~t}}if(this.zA[e][r][h]&i){let t=r,s=r,l=e,a=e;for(;t>0&&this.zA[e][t-1][h]&i;)t--;for(;s0;){for(let e=t;e<=s;e++)if(!(this.zA[l-1][e][h]&i))break t;l--}t:for(;a=8){const e=this.Hh[a][t][h]-240,r=this.Hh[l][t][h];o.A.rp(n,2,128*t,e,128*h,128*s+128,r,128*h);for(let e=l;e<=a;e++)for(let n=t;n<=s;n++)this.zA[e][n][h]&=~i}}if(this.zA[e][r][h]&s){let t=r,i=r,l=h,a=h;for(;l>0&&this.zA[e][r][l-1]&s;)l--;for(;a0;){for(let i=l;i<=a;i++)if(!(this.zA[e][t-1][i]&s))break t;t--}t:for(;i=4){const h=this.Hh[e][t][l];o.A.rp(n,4,128*t,h,128*l,128*i+128,h,128*a+128);for(let n=t;n<=i;n++)for(let t=l;t<=a;t++)this.zA[e][n][t]&=~s}}}}}};op=(t,i,s,h)=>{let r=0;for(let t=0;t>24;break}for(let n=t;n=0&&t=0&&n{const o=new h.A(new Uint8Array(r));for(let h=0;h=0&&a=0&&c>24,this.WA[h][a][c]=(f-2&3)<<24>>24):f<=81?this.Yh[h][a][c]=f-49<<24>>24:this.BA[h][a][c]=f-81<<24>>24}else for(;f=o.au,0!==f;){if(1===f){o.au;break}f<=49&&o.au}}};ap=(t,i,s,n,r,o)=>{const l=new h.A(new Uint8Array(n));let a=-1;for(;;){const n=l.cp;if(0===n)return;a+=n;let h=0;for(;;){const n=l.cp;if(0===n)break;h+=n-1;const c=63&h,f=h>>6&63,u=h>>12,d=l.au,w=d>>2,y=3&d,A=f+r,p=c+o;if(A>0&&p>0&&A=0&&(n=s[e]),this.By(u,A,p,t,i,n,a,w,y)}}}};By=(t,i,s,e,n,h,r,o,d)=>{if(A.st){if(16&this.Yh[t][i][s])return;if(this.$A(t,i,s)!==A.vA)return}const w=this.Hh[t][i][s],y=this.Hh[t][i+1][s],p=this.Hh[t][i+1][s+1],m=this.Hh[t][i][s+1],g=w+y+p+m>>2,_=l.A.get(r);let I=i+(s<<7)+(r<<14)+1073741824|0;_.active||(I+=-2147483648),I|=0;const C=(d<<6)+o<<24>>24;if(o===f.A.nA.id)(!A.st||_.active||_.vd)&&(e?.xA(_.la(f.A.nA.id,d,w,y,p,m,-1),t,i,s,g,I,C),_.nd&&_.active&&h?.Fy(i,s),-1!==_.al&&n.MA(new a.A(r,t,3,i,s,c.A.So[_.al],!0)));else if(o===f.A.td.id||o===f.A.oA.id){const l=_.la(f.A.td.id,d,w,y,p,m,-1);if(l){let n,h,r=0;if(o===f.A.oA.id&&(r+=256),d===u.A.Py||d===u.A.Uy?(n=_.length,h=_.width):(n=_.width,h=_.length),e?.By(t,i,s,g,l,null,I,C,n,h,r)&&_.Ad)for(let e=0;e<=n;e++)for(let n=0;n<=h;n++){let h=l.fp/4|0;h>30&&(h=30),h>this.GA[t][i+e][s+n]&&(this.GA[t][i+e][s+n]=h<<24>>24)}}_.nd&&h?.By(i,s,_.width,_.length,d,_.hd),-1!==_.al&&n.MA(new a.A(r,t,2,i,s,c.A.So[_.al],!0))}else if(o>=f.A.lA.id)e?.By(t,i,s,g,_.la(o,d,w,y,p,m,-1),null,I,C,1,1,0),o>=f.A.lA.id&&o<=f.A.dA.id&&o!==f.A.aA.id&&t>0&&(this.zA[t][i][s]|=2340),_.nd&&h?.By(i,s,_.width,_.length,d,_.hd),-1!==_.al&&n.MA(new a.A(r,t,2,i,s,c.A.So[_.al],!0));else if(o===f.A.Hy.id)e?.Gy(t,i,s,g,A.mA[d],0,_.la(f.A.Hy.id,d,w,y,p,m,-1),null,I,C),d===u.A.kd?(_.Ad&&(this.GA[t][i][s]=50,this.GA[t][i][s+1]=50),_.Du&&(this.zA[t][i][s]|=585)):d===u.A.Py?(_.Ad&&(this.GA[t][i][s+1]=50,this.GA[t][i+1][s+1]=50),_.Du&&(this.zA[t][i][s+1]|=1170)):d===u.A.Yy?(_.Ad&&(this.GA[t][i+1][s]=50,this.GA[t][i+1][s+1]=50),_.Du&&(this.zA[t][i+1][s]|=585)):d===u.A.Uy&&(_.Ad&&(this.GA[t][i][s]=50,this.GA[t][i+1][s]=50),_.Du&&(this.zA[t][i][s]|=1170)),_.nd&&h?.Gy(i,s,o,d,_.hd),-1!==_.al&&n.MA(new a.A(r,t,0,i,s,c.A.So[_.al],!0)),16!==_.ad&&e?.up(t,i,s,_.ad);else if(o===f.A.Vy.id)e?.Gy(t,i,s,g,A.gA[d],0,_.la(f.A.Vy.id,d,w,y,p,m,-1),null,I,C),_.Ad&&(d===u.A.kd?this.GA[t][i][s+1]=50:d===u.A.Py?this.GA[t][i+1][s+1]=50:d===u.A.Yy?this.GA[t][i+1][s]=50:d===u.A.Uy&&(this.GA[t][i][s]=50)),_.nd&&h?.Gy(i,s,o,d,_.hd),-1!==_.al&&n.MA(new a.A(r,t,0,i,s,c.A.So[_.al],!0));else if(o===f.A.Xy.id){const l=d+1&3;e?.Gy(t,i,s,g,A.mA[d],A.mA[l],_.la(f.A.Xy.id,d+4,w,y,p,m,-1),_.la(f.A.Xy.id,l,w,y,p,m,-1),I,C),_.Du&&(d===u.A.kd?(this.zA[t][i][s]|=265,this.zA[t][i][s+1]|=1170):d===u.A.Py?(this.zA[t][i][s+1]|=1170,this.zA[t][i+1][s]|=585):d===u.A.Yy?(this.zA[t][i+1][s]|=585,this.zA[t][i][s]|=1170):d===u.A.Uy&&(this.zA[t][i][s]|=1170,this.zA[t][i][s]|=585)),_.nd&&h?.Gy(i,s,o,d,_.hd),-1!==_.al&&n.MA(new a.A(r,t,0,i,s,c.A.So[_.al],!0)),16!==_.ad&&e?.up(t,i,s,_.ad)}else if(o===f.A.Ky.id)e?.Gy(t,i,s,g,A.gA[d],0,_.la(f.A.Ky.id,d,w,y,p,m,-1),null,I,C),_.Ad&&(d===u.A.kd?this.GA[t][i][s+1]=50:d===u.A.Py?this.GA[t][i+1][s+1]=50:d===u.A.Yy?this.GA[t][i+1][s]=50:d===u.A.Uy&&(this.GA[t][i][s]=50)),_.nd&&h?.Gy(i,s,o,d,_.hd),-1!==_.al&&n.MA(new a.A(r,t,0,i,s,c.A.So[_.al],!0));else if(o===f.A.Zy.id)e?.By(t,i,s,g,_.la(o,d,w,y,p,m,-1),null,I,C,1,1,0),_.nd&&h?.By(i,s,_.width,_.length,d,_.hd),-1!==_.al&&n.MA(new a.A(r,t,2,i,s,c.A.So[_.al],!0));else if(o===f.A.hA.id)e?.kA(t,i,s,g,0,0,I,_.la(f.A.hA.id,u.A.kd,w,y,p,m,-1),C,512*d,A.mA[d]),-1!==_.al&&n.MA(new a.A(r,t,1,i,s,c.A.So[_.al],!0));else if(o===f.A.rA.id){let h=16;if(e){const n=e.DA(t,i,s);n>0&&(h=l.A.get(n>>14&32767).ad)}e?.kA(t,i,s,g,A._A[d]*h,A.IA[d]*h,I,_.la(f.A.hA.id,u.A.kd,w,y,p,m,-1),C,512*d,A.mA[d]),-1!==_.al&&n.MA(new a.A(r,t,1,i,s,c.A.So[_.al],!0))}else o===f.A.Jy.id?(e?.kA(t,i,s,g,0,0,I,_.la(f.A.hA.id,u.A.kd,w,y,p,m,-1),C,d,256),-1!==_.al&&n.MA(new a.A(r,t,1,i,s,c.A.So[_.al],!0))):o===f.A.$y.id?(e?.kA(t,i,s,g,0,0,I,_.la(f.A.hA.id,u.A.kd,w,y,p,m,-1),C,d,512),-1!==_.al&&n.MA(new a.A(r,t,1,i,s,c.A.So[_.al],!0))):o===f.A.Qy.id&&(e?.kA(t,i,s,g,0,0,I,_.la(f.A.hA.id,u.A.kd,w,y,p,m,-1),C,d,768),-1!==_.al&&n.MA(new a.A(r,t,1,i,s,c.A.So[_.al],!0)))};$A=(t,i,s)=>8&this.Yh[t][i][s]?0:t<=0||!(2&this.Yh[1][i][s])?t:t-1}},3045:(t,i,s)=>{s.d(i,{A:()=>g});var e=s(4583),n=s(1161),h=s(3795),r=s(8256),o=s(670),l=s(9222),a=s(6855),c=s(7441),f=s(6666),u=s(5748),d=s(3479),w=s(8950),y=s(2771),A=s(5518),p=s(6169),m=s(3867);class g{static dp=new m.wp(8,32,51,51,!1);static yp=new m.ds(100,null);static Ap=new Int32Array(o.A.kh);static pp=new m.mp(o.A.kh,500,null);static gp=new m.ds(500,null);static _p=new f.A;static Ip=0;static Cp=0;static Ep=0;static vp=0;static bp=0;static Tp=0;static Op=0;static Rp=0;static Sp=0;static Lp=0;static xp=0;static Mp=0;static kp=0;static Dp=0;static Fp=0;static Np=0;static Bp=0;static Pp=0;static Up=0;static Wp=0;static Gp=0;static Hp=0;static Yp=!1;static Vp=null;static Kp=Uint8Array.of(19,55,38,155,255,110,137,205,76);static Xp=Uint8Array.of(160,192,80,96,0,144,80,48,160);static jp=Uint8Array.of(76,8,137,4,0,1,38,2,19);static zp=Int8Array.of(0,0,2,0,0,2,1,1,0);static Zp=Int8Array.of(2,0,0,2,0,0,0,4,4);static qp=Int8Array.of(0,4,4,8,0,0,8,0,0);static Jp=Int8Array.of(1,1,0,0,0,8,0,0,8);static $p=Int8Array.of(53,-53,-53,53);static Qp=Int8Array.of(-53,-53,53,53);static tm=Int8Array.of(-45,45,45,-45);static im=Int8Array.of(45,45,-45,-45);static sm=[new Int8Array(16),Int8Array.of(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,0,0,0,1,1,0,0,1,1,1,0,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1),Int8Array.of(0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0),Int8Array.of(0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0),Int8Array.of(1,1,1,1,1,1,1,1,0,1,1,1,0,0,1,1),Int8Array.of(1,1,1,1,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,0,0,0,0,1,1,0,1,1,1,0,1,1,1),Int8Array.of(0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1)];static nm=[Int8Array.of(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),Int8Array.of(12,8,4,0,13,9,5,1,14,10,6,2,15,11,7,3),Int8Array.of(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0),Int8Array.of(3,7,11,15,2,6,10,14,1,5,9,13,0,4,8,12)];static hm=Int32Array.of(41,39248,41,4643,41,41,41,41,41,41,41,41,41,41,41,43086,41,41,41,41,41,41,41,8602,41,28992,41,41,41,41,41,5056,41,41,41,41,41,41,41,41,41,41,41,41,41,41,3131,41,41,41);static rm=0;static kl=0;static Dl=0;static om=-1;static lm=-1;static st=!0;static init=(t,i,s,n,h)=>{this.Cp=0,this.Ep=0,this.vp=t,this.bp=i,this.Tp=t/2|0,this.Op=i/2|0;const r=new m.wp(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let i=0;i<2048;i+=64){this.Rp=e.A.sin[t],this.Sp=e.A.cos[t],this.Lp=e.A.sin[i],this.xp=e.A.cos[i];const o=(t-128)/32|0,l=i/64|0;for(let t=-26;t<=26;t++)for(let i=-26;i<=26;i++){const e=128*t,a=128*i;let c=!1;for(let t=-s;t<=n;t+=128)if(this.am(e,a,h[o]+t)){c=!0;break}r[o][l][t+25+1][i+25+1]=c}}for(let t=0;t<8;t++)for(let i=0;i<32;i++)for(let s=-25;s<25;s++)for(let e=-25;e<25;e++){let n=!1;t:for(let h=-1;h<=1;h++)for(let o=-1;o<=1;o++){if(r[t][i][s+h+25+1][e+o+25+1]){n=!0;break t}if(r[t][(i+1)%31][s+h+25+1][e+o+25+1]){n=!0;break t}if(r[t+1][i][s+h+25+1][e+o+25+1]){n=!0;break t}if(r[t+1][(i+1)%31][s+h+25+1][e+o+25+1]){n=!0;break t}}this.dp[t][i][s+25][e+25]=n}};static To=()=>{this.yp=null,this.Ap=null,this.pp=null,this._p=null,this.dp=null,this.gp=null,this.Vp=null,console.log('World3D unloaded!')};static rp=(t,i,s,e,n,h,o,l)=>{g.pp[t][g.Ap[t]++]=new r.A(s/128|0,h/128|0,n/128|0,l/128|0,i,s,h,n,l,e,o)};static am=(t,i,s)=>{const e=i*this.Lp+t*this.xp>>16,n=i*this.xp-t*this.Lp>>16,h=s*this.Rp+n*this.Sp>>16,r=s*this.Sp-n*this.Rp>>16;if(h<50||h>3500)return!1;const o=this.Tp+((e<<9)/h|0),l=this.Op+((r<<9)/h|0);return o>=this.Cp&&o<=this.vp&&l>=this.Ep&&l<=this.bp};fm;FA;NA;um;dm;Ir;wm;ym;Am;pm=0;gm=0;_m=0;constructor(t,i,s,e){this.fm=s,this.FA=e,this.NA=i,this.dm=new m.Er(s,e,i,null),this.wm=new m.qA(s,e+1,i+1),this.um=t,this.Ir=new m.ds(5e3,null),this.ym=new Int32Array(1e4),this.Am=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this.gm=t;for(let i=0;i{const s=this.dm[0][t][i];for(let s=0;s<3;s++){this.dm[s][t][i]=this.dm[s+1][t][i];const e=this.dm[s][t][i];e&&e.level--}this.dm[0][t][i]||(this.dm[0][t][i]=new h.A(0,t,i));const e=this.dm[0][t][i];e&&(e.Cm=s),this.dm[3][t][i]=null};ep=(t,i,s,e)=>{const n=this.dm[t][i][s];n&&(n.Em=e)};tp=(t,i,s,e,n,r,o,l,a,c,f,u,w,p,m,g,_,I,C,E)=>{if(e===A.A.QA){for(let e=t;e>=0;e--)this.dm[e][i][s]||(this.dm[e][i][s]=new h.A(e,i,s));const e=this.dm[t][i][s];e&&(e.vm=new d.A(f,u,w,p,-1,C,!1))}else if(e===A.A.bm){for(let e=t;e>=0;e--)this.dm[e][i][s]||(this.dm[e][i][s]=new h.A(e,i,s));const e=this.dm[t][i][s];e&&(e.vm=new d.A(m,g,_,I,r,E,o===l&&o===a&&o===c))}else{for(let e=t;e>=0;e--)this.dm[e][i][s]||(this.dm[e][i][s]=new h.A(e,i,s));const d=this.dm[t][i][s];d&&(d.Tm=new y.A(i,e,g,l,w,n,f,c,E,m,r,I,C,a,_,p,o,s,u))}};xA=(t,i,s,e,n,r,o)=>{this.dm[i][s][e]||(this.dm[i][s][e]=new h.A(i,s,e));const a=this.dm[i][s][e];a&&(a.Om=new l.A(n,128*s+64,128*e+64,t,r,o))};Rm=(t,i,s)=>{const e=this.dm[t][i][s];e&&(e.Om=null)};Sm=(t,i,s,e,n,r,o,l)=>{let a=0;const c=this.dm[e][t][i];if(c)for(let t=0;ta&&(a=s)}else this.dm[e][t][i]=new h.A(e,t,i);const f=this.dm[e][t][i];f&&(f.Mm=new u.A(s,128*t+64,128*i+64,r,o,l,n,a))};km=(t,i,s)=>{const e=this.dm[t][i][s];e&&(e.Mm=null)};Gy=(t,i,s,e,n,r,o,l,c,f)=>{if(!o&&!l)return;for(let e=t;e>=0;e--)this.dm[e][i][s]||(this.dm[e][i][s]=new h.A(e,i,s));const u=this.dm[t][i][s];u&&(u.Dm=new a.A(e,128*i+64,128*s+64,n,r,o,l,c,f))};jy=(t,i,s,e)=>{const n=this.dm[t][i][s];1===e&&n&&(n.Dm=null)};kA=(t,i,s,e,n,r,o,l,a,f,u)=>{if(!l)return;for(let e=t;e>=0;e--)this.dm[e][i][s]||(this.dm[e][i][s]=new h.A(e,i,s));const d=this.dm[t][i][s];d&&(d.Fm=new c.A(e,128*i+n+64,128*s+r+64,u,f,l,o,a))};Nm=(t,i,s)=>{const e=this.dm[t][i][s];e&&(e.Fm=null)};up=(t,i,s,e)=>{const n=this.dm[t][i][s];if(!n)return;const h=n.Fm;if(!h)return;const r=128*i+64,o=128*s+64;h.x=r+((h.x-r)*e/16|0),h.z=o+((h.z-o)*e/16|0)};Bm=(t,i,s,e)=>{if(!e)return;const n=this.dm[t][i][s];if(!n)return;const h=n.Fm;h&&(h.model=e)};Pm=(t,i,s,e)=>{if(!e)return;const n=this.dm[t][i][s];if(!n)return;const h=n.Om;h&&(h.model=e)};Um=(t,i,s,e)=>{if(!e)return;const n=this.dm[t][i][s];if(!n)return;const h=n.Dm;h&&(h.Wm=e)};Gm=(t,i,s,e,n)=>{if(!e)return;const h=this.dm[s][t][i];if(!h)return;const r=h.Dm;r&&(r.Wm=e,r.Hm=n)};By=(t,i,s,e,n,h,r,o,l,a,c)=>{if(!n&&!h)return!0;const f=128*i+64*l,u=128*s+64*a;return this.Ym(f,u,e,t,i,s,l,a,n,h,r,o,c,!1)};Vm=(t,i,s,e,n,h,r,o,l,a)=>{if(!n&&!h)return!0;let c=i-l,f=e-l,u=i+l,d=e+l;return a&&(o>640&&o<1408&&(d+=128),o>1152&&o<1920&&(u+=128),(o>1664||o<384)&&(f-=128),o>128&&o<896&&(c-=128)),c=c/128|0,f=f/128|0,u=u/128|0,d=d/128|0,this.Ym(i,e,s,t,c,f,u+1-c,d-f+1,n,h,r,0,o,!0)};Km=(t,i,s,e,n,h,r,o,l,a,c,f)=>!l&&!a||this.Ym(i,e,s,t,n,h,r+1-n,o-h+1,l,a,c,0,f,!0);Wy=(t,i,s)=>{const e=this.dm[t][i][s];if(e)for(let t=0;t>29&3)&&n.jm===i&&n.zm===s)return void this.Zm(n)}};qm=(t,i,s,e)=>{if(!e)return;const n=this.dm[t][i][s];if(n)for(let t=0;t>29&3))return void(i.model=e)}};Jm=()=>{for(let t=0;t{const e=this.dm[t][i][s];return e&&e.Dm?e.Dm.Xm:0};$m=(t,i,s)=>{const e=this.dm[t][s][i];return e&&e.Fm?e.Fm.Xm:0};Qm=(t,i,s)=>{const e=this.dm[t][i][s];if(!e)return 0;for(let t=0;t>29&3)&&n.jm===i&&n.zm===s)return n.Xm}return 0};tg=(t,i,s)=>{const e=this.dm[t][i][s];return e&&e.Om?e.Om.Xm:0};ig=(t,i,s,e)=>{const n=this.dm[t][i][s];if(n){if(n.Dm&&n.Dm.Xm===e)return 255&n.Dm.info;if(n.Fm&&n.Fm.Xm===e)return 255&n.Fm.info;if(n.Om&&n.Om.Xm===e)return 255&n.Om.info;for(let t=0;t{const h=i*(0|Math.sqrt(s*s+e*e+n*n))>>8;for(let i=0;i{if(i0){const n=this.dm[t][i+1][s-1];n&&n.Om&&n.Om.model&&n.Om.model.sg&&this.ng(e,n.Om.model,128,0,-128,!0)}};eg=(t,i,s,e,n,h)=>{let r=!0,o=i;const l=i+e,a=s-1,c=s+n;for(let f=t;f<=t+1;f++)if(f!==this.fm){for(let u=o;u<=l;u++)if(!(u<0||u>=this.FA))for(let o=a;o<=c;o++){if(o<0||o>=this.NA||r&&u=s||u===i))continue;const a=this.dm[f][u][o];if(!a)continue;const d=128*(u-i)+64*(1-e),w=128*(o-s)+64*(1-n),y=((this.um[f][u][o]+this.um[f][u+1][o]+this.um[f][u][o+1]+this.um[f][u+1][o+1])/4|0)-((this.um[t][i][s]+this.um[t][i+1][s]+this.um[t][i][s+1]+this.um[t][i+1][s+1])/4|0),A=a.Dm;A&&A.Wm&&A.Wm.sg&&this.ng(h,A.Wm,d,y,w,r),A&&A.Hm&&A.Hm.sg&&this.ng(h,A.Hm,d,y,w,r);for(let t=0;t{this._m++;let r=0;const o=i.Rd,l=i.Od;if(t.sg&&t.ag)for(let h=0;hi.cg)continue;const u=t.Rd[h]-s;if(ui.ug)continue;const d=t.Sd[h]-n;if(di.wg)continue;if(i.sg&&i.ag)for(let t=0;t{const r=this.dm[t][i][s];if(!r)return;const o=r.vm;if(o){const t=o.color;if(0!==t)for(let i=0;i<4;i++)e[n]=t,e[n+1]=t,e[n+2]=t,e[n+3]=t,n+=h;return}const l=r.Tm;if(!l)return;const a=l.shape,c=l.angle,f=l.Ig,u=l.Cg,d=g.sm[a],w=g.nm[c];let y=0;if(0===f)for(let t=0;t<4;t++)0!==d[w[y++]]&&(e[n]=u),0!==d[w[y++]]&&(e[n+1]=u),0!==d[w[y++]]&&(e[n+2]=u),0!==d[w[y++]]&&(e[n+3]=u),n+=h;else for(let t=0;t<4;t++)e[n]=0===d[w[y++]]?f:u,e[n+1]=0===d[w[y++]]?f:u,e[n+2]=0===d[w[y++]]?f:u,e[n+3]=0===d[w[y++]]?f:u,n+=h};click=(t,i)=>{g.Yp=!0,g.kl=t,g.Dl=i,g.om=-1,g.lm=-1};draw=(t,i,s,n,h,r,o)=>{t<0?t=0:t>=128*this.FA&&(t=128*this.FA-1),s<0?s=0:s>=128*this.NA&&(s=128*this.NA-1),g.Ip++,g.Rp=e.A.sin[r],g.Sp=e.A.cos[r],g.Lp=e.A.sin[h],g.xp=e.A.cos[h],g.Vp=g.dp[(r-128)/32|0][h/64|0],g.Mp=t,g.kp=i,g.Dp=s,g.Fp=t/128|0,g.Np=s/128|0,g.Gp=n,g.Bp=g.Fp-25,g.Bp<0&&(g.Bp=0),g.Up=g.Np-25,g.Up<0&&(g.Up=0),g.Pp=g.Fp+25,g.Pp>this.FA&&(g.Pp=this.FA),g.Wp=g.Np+25,g.Wp>this.NA&&(g.Wp=this.NA),this.Eg(),g.Hp=0;for(let t=this.gm;t=2e3)?(r.visible=!0,r.update=!0,r.vg=r.Lm>0,g.Hp++):(r.visible=!1,r.update=!1,r.bg=0))}}for(let t=this.gm;t=g.Pp))for(let t=-25;t<=0;t++){const n=g.Np+t,h=g.Np-t;let r;if(s>=g.Bp&&(n>=g.Up&&(r=i[s][n],r&&r.visible&&this.Tg(r,!0,o)),h=g.Up&&(r=i[e][n],r&&r.visible&&this.Tg(r,!0,o)),h=g.Pp))for(let t=-25;t<=0;t++){const n=g.Np+t,h=g.Np-t;let r;if(s>=g.Bp&&(n>=g.Up&&(r=i[s][n],r&&r.visible&&this.Tg(r,!1,o)),h=g.Up&&(r=i[e][n],r&&r.visible&&this.Tg(r,!1,o)),h{if(!c&&!f)return!1;for(let t=r;t=this.FA||i>=this.NA)return!1;const s=this.dm[e][t][i];if(s&&s.Lm>=5)return!1}const A=new n.A(e,s,t,i,c,f,w,r,r+l-1,o,o+a-1,u,d);for(let t=r;tr&&(s|=1),to&&(s+=8),i=0;s--)this.dm[s][t][i]||(this.dm[s][t][i]=new h.A(s,t,i));const n=this.dm[e][t][i];n&&(n.xm[n.Lm]=A,n.Og[n.Lm]=s,n.Rg|=s,n.Lm++)}return y&&(this.Ir[this.pm++]=A),!0};Zm=t=>{for(let i=t.jm;i<=t.rg;i++)for(let s=t.zm;s<=t.og;s++){const e=this.dm[t.level][i][s];if(e){for(let i=0;i{const t=g.Ap[g.Gp],i=g.pp[g.Gp];g.rm=0;for(let s=0;s=0&&e<=50){n=t.Lg+25-g.Np,n<0&&(n=0),h=t.NA+25-g.Np,h>50&&(h=50);let i=!1;for(;n<=h;)if(g.Vp&&g.Vp[e][n++]){i=!0;break}if(i){if(r=g.Mp-t.fg,r>32)t.mode=1;else{if(r>=-32)continue;t.mode=2,r=-r}t.xg=(t.dg-g.Dp<<8)/r|0,t.Mg=(t.wg-g.Dp<<8)/r|0,t.kg=(t.cg-g.kp<<8)/r|0,t.Dg=(t.Pd-g.kp<<8)/r|0,g.gp[g.rm++]=t}}}else if(2===t.type){if(e=t.Lg+25-g.Np,e>=0&&e<=50){n=t.Sg+25-g.Fp,n<0&&(n=0),h=t.FA+25-g.Fp,h>50&&(h=50);let i=!1;for(;n<=h;)if(g.Vp&&g.Vp[n++][e]){i=!0;break}if(i){if(r=g.Dp-t.dg,r>32)t.mode=3;else{if(r>=-32)continue;t.mode=4,r=-r}t.Fg=(t.fg-g.Mp<<8)/r|0,t.Ng=(t.ug-g.Mp<<8)/r|0,t.kg=(t.cg-g.kp<<8)/r|0,t.Dg=(t.Pd-g.kp<<8)/r|0,g.gp[g.rm++]=t}}}else if(4===t.type&&(e=t.cg-g.kp,e>128&&(n=t.Lg+25-g.Np,n<0&&(n=0),h=t.NA+25-g.Np,h>50&&(h=50),n<=h))){let i=t.Sg+25-g.Fp;i<0&&(i=0),r=t.FA+25-g.Fp,r>50&&(r=50);let s=!1;t:for(let t=i;t<=r;t++)for(let i=n;i<=h;i++)if(g.Vp&&g.Vp[t][i]){s=!0;break t}s&&(t.mode=5,t.Fg=(t.fg-g.Mp<<8)/e|0,t.Ng=(t.ug-g.Mp<<8)/e|0,t.xg=(t.dg-g.Dp<<8)/e|0,t.Mg=(t.wg-g.Dp<<8)/e|0,g.gp[g.rm++]=t)}}};Tg=(t,i,s)=>{for(g._p.MA(t);;){let t;do{if(t=g._p.Bg(),!t)return}while(!t.update);const e=t.x,n=t.z,h=t.level,r=t.Pg,o=this.dm[h];if(t.visible){if(i){if(h>0){const t=this.dm[h-1][e][n];if(t&&t.update)continue}if(e<=g.Fp&&e>g.Bp){const i=o[e-1][n];if(i&&i.update&&(i.visible||!(1&t.Rg)))continue}if(e>=g.Fp&&eg.Up){const i=o[e][n-1];if(i&&i.update&&(i.visible||!(8&t.Rg)))continue}if(n>=g.Np&&nn&&(a+=6),c=g.Kp[a],t.Vg=g.jp[a]),f&&(f.Kg&g.Xp[a]?16===f.Kg?(t.bg=3,t.Xg=g.zp[a],t.jg=3-t.Xg):32===f.Kg?(t.bg=6,t.Xg=g.Zp[a],t.jg=6-t.Xg):64===f.Kg?(t.bg=12,t.Xg=g.qp[a],t.jg=12-t.Xg):(t.bg=9,t.Xg=g.Jp[a],t.jg=9-t.Xg):t.bg=0,f.Kg&c&&!this.zg(r,e,n,f.Kg)&&f.Wm?.draw(0,g.Rp,g.Sp,g.Lp,g.xp,f.x-g.Mp,f.y-g.kp,f.z-g.Dp,f.Xm),f.Zg&c&&!this.zg(r,e,n,f.Zg)&&f.Hm?.draw(0,g.Rp,g.Sp,g.Lp,g.xp,f.x-g.Mp,f.y-g.kp,f.z-g.Dp,f.Xm)),u&&!this.visible(r,e,n,u.model.Pd))if(u.type&c)u.model.draw(u.angle,g.Rp,g.Sp,g.Lp,g.xp,u.x-g.Mp,u.y-g.kp,u.z-g.Dp,u.Xm);else if(768&u.type){const t=u.x-g.Mp,i=u.y-g.kp,s=u.z-g.Dp,e=u.angle;let n,h;if(n=e===p.A.Py||e===p.A.Yy?-t:t,h=e===p.A.Yy||e===p.A.Uy?-s:s,256&u.type&&hn){const n=t+g.tm[e],h=s+g.im[e];u.model.draw(512*e+1280&2047,g.Rp,g.Sp,g.Lp,g.xp,n,i,h,u.Xm)}}if(l){const i=t.Om;i&&i.model?.draw(0,g.Rp,g.Sp,g.Lp,g.xp,i.x-g.Mp,i.y-g.kp,i.z-g.Dp,i.Xm);const s=t.Mm;s&&0===s.offset&&(s.qg&&s.qg.draw(0,g.Rp,g.Sp,g.Lp,g.xp,s.x-g.Mp,s.y-g.kp,s.z-g.Dp,s.Xm),s.Jg&&s.Jg.draw(0,g.Rp,g.Sp,g.Lp,g.xp,s.x-g.Mp,s.y-g.kp,s.z-g.Dp,s.Xm),s.$g&&s.$g.draw(0,g.Rp,g.Sp,g.Lp,g.xp,s.x-g.Mp,s.y-g.kp,s.z-g.Dp,s.Xm))}const d=t.Rg;if(0!==d){if(eg.Fp&&1&d){const t=o[e-1][n];t&&t.update&&g._p.MA(t)}if(n>g.Np&&8&d){const t=o[e][n-1];t&&t.update&&g._p.MA(t)}}}if(0!==t.bg){let i=!0;for(let s=0;si.jm&&(h+=1),si.zm&&(h+=8),ee&&(e=n);const r=g.Np-i.zm,l=i.og-g.Np;i.Qg=l>r?e+l:e+r}for(;;){let t=-50,i=-1;for(let s=0;st&&(t=e.Qg,i=s))}if(-1===i)break;const l=g.yp[i];if(l){l.Ip=g.Ip;let t=l.model;t||(t=l.Hg?.draw(s)??null),t&&!this.t_(r,l.jm,l.rg,l.zm,l.og,t.Pd)&&t.draw(l.Yg,g.Rp,g.Sp,g.Lp,g.xp,l.x-g.Mp,l.y-g.kp,l.z-g.Dp,l.Xm);for(let t=l.jm;t<=l.rg;t++)for(let i=l.zm;i<=l.og;i++){const s=o[t][i];s&&(0!==s.bg?g._p.MA(s):t===e&&i===n||!s.update||g._p.MA(s))}}}if(t.vg)continue}if(!t.update||0!==t.bg)continue;if(e<=g.Fp&&e>g.Bp){const t=o[e-1][n];if(t&&t.update)continue}if(e>=g.Fp&&eg.Up){const t=o[e][n-1];if(t&&t.update)continue}if(n>=g.Np&&n=h){const h=t+g.$p[n],r=e+g.Qp[n];i.model.draw(512*n+256,g.Rp,g.Sp,g.Lp,g.xp,h,s,r,i.Xm)}if(512&i.type&&r<=h){const h=t+g.tm[n],r=e+g.im[n];i.model.draw(512*n+1280&2047,g.Rp,g.Sp,g.Lp,g.xp,h,s,r,i.Xm)}}const s=t.Dm;s&&(s.Zg&t.Vg&&!this.zg(r,e,n,s.Zg)&&s.Hm?.draw(0,g.Rp,g.Sp,g.Lp,g.xp,s.x-g.Mp,s.y-g.kp,s.z-g.Dp,s.Xm),s.Kg&t.Vg&&!this.zg(r,e,n,s.Kg)&&s.Wm?.draw(0,g.Rp,g.Sp,g.Lp,g.xp,s.x-g.Mp,s.y-g.kp,s.z-g.Dp,s.Xm))}if(hg.Fp){const t=o[e-1][n];t&&t.update&&g._p.MA(t)}if(n>g.Np){const t=o[e][n-1];t&&t.update&&g._p.MA(t)}}};Wg=(t,i,s,n,h,r,o,l)=>{let a,c,f,u,d=a=(s<<7)-g.Mp,y=c=(n<<7)-g.Dp,A=f=d+128,p=u=y+128,m=this.um[i][s][n]-g.kp,_=this.um[i][s+1][n]-g.kp,I=this.um[i][s+1][n+1]-g.kp,C=this.um[i][s][n+1]-g.kp,E=y*o+d*l>>16;if(y=y*l-d*o>>16,d=E,E=m*r-y*h>>16,y=m*h+y*r>>16,m=E,y<50)return;if(E=c*o+A*l>>16,c=c*l-A*o>>16,A=E,E=_*r-c*h>>16,c=_*h+c*r>>16,_=E,c<50)return;if(E=p*o+f*l>>16,p=p*l-f*o>>16,f=E,E=I*r-p*h>>16,p=I*h+p*r>>16,I=E,p<50)return;if(E=u*o+a*l>>16,u=u*l-a*o>>16,a=E,E=C*r-u*h>>16,u=C*h+u*r>>16,C=E,u<50)return;const v=e.A.ha+((d<<9)/y|0),b=e.A.ra+((m<<9)/y|0),T=e.A.ha+((A<<9)/c|0),O=e.A.ra+((_<<9)/c|0),R=e.A.ha+((f<<9)/p|0),S=e.A.ra+((I<<9)/p|0),L=e.A.ha+((a<<9)/u|0),x=e.A.ra+((C<<9)/u|0);if(e.A.alpha=0,(R-L)*(O-x)-(S-x)*(T-L)>0)if(e.A.i_=R<0||L<0||T<0||R>w.A.s_||L>w.A.s_||T>w.A.s_,g.Yp&&this.e_(g.kl,g.Dl,S,x,O,R,L,T)&&(g.om=s,g.lm=n),-1===t.n_)12345678!==t.h_&&e.A.r_(R,L,T,S,x,O,t.h_,t.o_,t.l_);else if(g.st){const i=g.hm[t.n_];e.A.r_(R,L,T,S,x,O,this.a_(i,t.h_),this.a_(i,t.o_),this.a_(i,t.l_))}else t.flat?e.A.c_(R,L,T,S,x,O,t.h_,t.o_,t.l_,d,m,y,A,a,_,C,c,u,t.n_):e.A.c_(R,L,T,S,x,O,t.h_,t.o_,t.l_,f,I,p,a,A,C,_,u,c,t.n_);if(!((v-T)*(x-O)-(b-O)*(L-T)<=0))if(e.A.i_=v<0||T<0||L<0||v>w.A.s_||T>w.A.s_||L>w.A.s_,g.Yp&&this.e_(g.kl,g.Dl,b,O,x,v,T,L)&&(g.om=s,g.lm=n),-1!==t.n_){if(!g.st)return void e.A.c_(v,T,L,b,O,x,t.f_,t.l_,t.o_,d,m,y,A,a,_,C,c,u,t.n_);const i=g.hm[t.n_];e.A.r_(v,T,L,b,O,x,this.a_(i,t.f_),this.a_(i,t.l_),this.a_(i,t.o_))}else 12345678!==t.f_&&e.A.r_(v,T,L,b,O,x,t.f_,t.l_,t.o_)};Gg=(t,i,s,n,h,r,o)=>{let l=s.Rd.length;for(let t=0;t>16;if(a=a*o-i*r>>16,i=c,c=l*h-a*n>>16,a=l*n+a*h>>16,l=c,a<50)return;s.u_&&(y.A.d_[t]=i,y.A.w_[t]=l,y.A.y_[t]=a),y.A.A_[t]=e.A.ha+((i<<9)/a|0),y.A.p_[t]=e.A.ra+((l<<9)/a|0)}e.A.alpha=0,l=s.m_.length;for(let n=0;n0)if(e.A.i_=l<0||a<0||c<0||l>w.A.s_||a>w.A.s_||c>w.A.s_,g.Yp&&this.e_(g.kl,g.Dl,f,u,d,l,a,c)&&(g.om=t,g.lm=i),s.u_&&-1!==s.u_[n])if(g.st){const t=g.hm[s.u_[n]];e.A.r_(l,a,c,f,u,d,this.a_(t,s.I_[n]),this.a_(t,s.C_[n]),this.a_(t,s.E_[n]))}else s.flat?e.A.c_(l,a,c,f,u,d,s.I_[n],s.C_[n],s.E_[n],y.A.d_[0],y.A.w_[0],y.A.y_[0],y.A.d_[1],y.A.d_[3],y.A.w_[1],y.A.w_[3],y.A.y_[1],y.A.y_[3],s.u_[n]):e.A.c_(l,a,c,f,u,d,s.I_[n],s.C_[n],s.E_[n],y.A.d_[h],y.A.w_[h],y.A.y_[h],y.A.d_[r],y.A.d_[o],y.A.w_[r],y.A.w_[o],y.A.y_[r],y.A.y_[o],s.u_[n]);else 12345678!==s.I_[n]&&e.A.r_(l,a,c,f,u,d,s.I_[n],s.C_[n],s.E_[n])}};Ug=(t,i,s)=>{const e=this.wm[t][i][s];if(e===-g.Ip)return!1;if(e===g.Ip)return!0;{const e=i<<7,n=s<<7;return this.v_(e+1,this.um[t][i][s],n+1)&&this.v_(e+128-1,this.um[t][i+1][s],n+1)&&this.v_(e+128-1,this.um[t][i+1][s+1],n+128-1)&&this.v_(e+1,this.um[t][i][s+1],n+128-1)?(this.wm[t][i][s]=g.Ip,!0):(this.wm[t][i][s]=-g.Ip,!1)}};zg=(t,i,s,e)=>{if(!this.Ug(t,i,s))return!1;const n=i<<7,h=s<<7,r=this.um[t][i][s]-1,o=r-120,l=r-230,a=r-238;if(e<16){if(1===e){if(n>g.Mp){if(!this.v_(n,r,h))return!1;if(!this.v_(n,r,h+128))return!1}if(t>0){if(!this.v_(n,o,h))return!1;if(!this.v_(n,o,h+128))return!1}return!!this.v_(n,l,h)&&this.v_(n,l,h+128)}if(2===e){if(h0){if(!this.v_(n,o,h+128))return!1;if(!this.v_(n+128,o,h+128))return!1}return!!this.v_(n,l,h+128)&&this.v_(n+128,l,h+128)}if(4===e){if(n0){if(!this.v_(n+128,o,h))return!1;if(!this.v_(n+128,o,h+128))return!1}return!!this.v_(n+128,l,h)&&this.v_(n+128,l,h+128)}if(8===e){if(h>g.Dp){if(!this.v_(n,r,h))return!1;if(!this.v_(n+128,r,h))return!1}if(t>0){if(!this.v_(n,o,h))return!1;if(!this.v_(n+128,o,h))return!1}return!!this.v_(n,l,h)&&this.v_(n+128,l,h)}}return!!this.v_(n+64,a,h+64)&&(16===e?this.v_(n,l,h+128):32===e?this.v_(n+128,l,h+128):64===e?this.v_(n+128,l,h):128===e?this.v_(n,l,h):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,i,s,e)=>{if(this.Ug(t,i,s)){const n=i<<7,h=s<<7;return this.v_(n+1,this.um[t][i][s]-e,h+1)&&this.v_(n+128-1,this.um[t][i+1][s]-e,h+1)&&this.v_(n+128-1,this.um[t][i+1][s+1]-e,h+128-1)&&this.v_(n+1,this.um[t][i][s+1]-e,h+128-1)}return!1};t_=(t,i,s,e,n,h)=>{let r,o;if(i!==s||e!==n){for(r=i;r<=s;r++)for(o=e;o<=n;o++)if(this.wm[t][r][o]===-g.Ip)return!1;o=1+(i<<7);const l=2+(e<<7),a=this.um[t][i][e]-h;if(!this.v_(o,a,l))return!1;const c=(s<<7)-1;if(!this.v_(c,a,l))return!1;const f=(n<<7)-1;return!!this.v_(o,a,f)&&this.v_(c,a,f)}return!!this.Ug(t,i,e)&&(r=i<<7,o=e<<7,this.v_(r+1,this.um[t][i][e]-h,o+1)&&this.v_(r+128-1,this.um[t][i+1][e]-h,o+1)&&this.v_(r+128-1,this.um[t][i+1][e+1]-h,o+128-1)&&this.v_(r+1,this.um[t][i][e+1]-h,o+128-1))};v_=(t,i,s)=>{for(let e=0;e0){const t=n.dg+(n.xg*e>>8),h=n.wg+(n.Mg*e>>8),r=n.cg+(n.kg*e>>8),o=n.Pd+(n.Dg*e>>8);if(s>=t&&s<=h&&i>=r&&i<=o)return!0}}else if(2===n.mode){const e=t-n.fg;if(e>0){const t=n.dg+(n.xg*e>>8),h=n.wg+(n.Mg*e>>8),r=n.cg+(n.kg*e>>8),o=n.Pd+(n.Dg*e>>8);if(s>=t&&s<=h&&i>=r&&i<=o)return!0}}else if(3===n.mode){const e=n.dg-s;if(e>0){const s=n.fg+(n.Fg*e>>8),h=n.ug+(n.Ng*e>>8),r=n.cg+(n.kg*e>>8),o=n.Pd+(n.Dg*e>>8);if(t>=s&&t<=h&&i>=r&&i<=o)return!0}}else if(4===n.mode){const e=s-n.dg;if(e>0){const s=n.fg+(n.Fg*e>>8),h=n.ug+(n.Ng*e>>8),r=n.cg+(n.kg*e>>8),o=n.Pd+(n.Dg*e>>8);if(t>=s&&t<=h&&i>=r&&i<=o)return!0}}else if(5===n.mode){const e=i-n.cg;if(e>0){const i=n.fg+(n.Fg*e>>8),h=n.ug+(n.Ng*e>>8),r=n.dg+(n.xg*e>>8),o=n.wg+(n.Mg*e>>8);if(t>=i&&t<=h&&s>=r&&s<=o)return!0}}}return!1};e_=(t,i,s,e,n,h,r,o)=>{if(is&&i>e&&i>n)return!1;if(th&&t>r&&t>o)return!1;const l=(i-e)*(o-r)-(t-r)*(n-e);return((i-s)*(r-h)-(t-h)*(e-s))*l>0&&l*((i-n)*(h-o)-(t-o)*(s-n))>0};a_=(t,i)=>((i=(127-i)*(127&t)/160|0)<2?i=2:i>126&&(i=126),(65408&t)+i)}},7121:(t,i,s)=>{s.d(i,{A:()=>n});var e=s(1982);class n extends e.A{}},4197:(t,i,s)=>{s.d(i,{A:()=>n});var e=s(1982);class n extends e.A{b_;T_;O_;R_;index;Vw;ul;fl;constructor(t,i,s,e,n,h,r){super(),this.b_=i,this.T_=s,this.O_=e,this.R_=n,this.index=t,this.Vw=h,r&&-1!==h.wl&&this.Vw.delay?(this.ul=Math.random()*this.Vw.dl|0,this.fl=Math.random()*this.Vw.delay[this.ul]|0):(this.ul=-1,this.fl=0)}}},9418:(t,i,s)=>{s.d(i,{A:()=>r});var e=s(7121),n=s(1312),h=s(3867);class r extends e.A{x=0;z=0;Yg=0;S_=!1;size=1;La=-1;L_=-1;x_=-1;M_=-1;k_=-1;D_=-1;F_=-1;N_=null;B_=100;P_=0;U_=0;W_=0;G_=0;H_=-1e3;Y_=0;V_=0;K_=-1;X_=0;j_=0;z_=-1;Z_=0;q_=0;J_=-1;Q_=0;tI=0;iI=0;sI=0;eI=-1;nI=0;hI=0;rI=0;oI=0;lI=0;aI=0;cI=0;fI=0;uI=0;dI=0;wI=0;Ip=0;height=0;yI=0;pathLength=0;AI=new Int32Array(10);pI=new Int32Array(10);mI=new h.ds(10,!1);gI=0;_I=-1;II=-1;CI=-1;EI=-1;move(t,i,s){if(-1!==this.J_&&n.A.So[this.J_].priority<=1&&(this.J_=-1),!t){const t=i-this.AI[0],e=s-this.pI[0];if(t>=-8&&t<=8&&e>=-8&&e<=8){this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.AI[t]=this.AI[t-1],this.pI[t]=this.pI[t-1],this.mI[t]=this.mI[t-1];return this.AI[0]=i,this.pI[0]=s,void(this.mI[0]=!1)}}this.pathLength=0,this.gI=0,this.AI[0]=i,this.pI[0]=s,this.x=128*this.AI[0]+64*this.size,this.z=128*this.pI[0]+64*this.size}step(t,i){let s=this.AI[0],e=this.pI[0];0===i?(s--,e++):1===i?e++:2===i?(s++,e++):3===i?s--:4===i?s++:5===i?(s--,e--):6===i?e--:7===i&&(s++,e--),-1!==this.J_&&n.A.So[this.J_].priority<=1&&(this.J_=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.AI[t]=this.AI[t-1],this.pI[t]=this.pI[t-1],this.mI[t]=this.mI[t-1];this.AI[0]=s,this.pI[0]=e,this.mI[0]=t}}},8268:(t,i,s)=>{s.d(i,{A:()=>d});var e=s(9418),n=s(8665),h=s(2679),r=s(8738),o=s(1312),l=s(8317),a=s(1302),c=s(3819),f=s(3867),u=s(9298);class d extends e.A{static vI=1;static bI=2;static TI=4;static OI=8;static RI=16;static SI=32;static LI=64;static xI=128;static MI=256;static kI=512;static Sa=[u.A.DI,u.A.FI,u.A.NI,u.A.BI,u.A.UI,u.A.WI,u.A.GI,u.A.HI,u.A.YI,u.A.VI,u.A.KI,u.A.XI,u.A.jI,u.A.zI,u.A.ZI,u.A.qI];static Ra=[[u.A.JI,u.A.$I,u.A.QI,u.A.tC,u.A.iC,u.A.sC,u.A.eC,u.A.nC,u.A.hC,u.A.rC,u.A.oC,u.A.lC],[u.A.aC,u.A.cC,u.A.fC,u.A.uC,u.A.dC,u.A.wC,u.A.yC,u.A.AC,u.A.pC,u.A.mC,u.A.gC,u.A._C,u.A.IC,u.A.CC,u.A.EC,u.A.vC],[u.A.vC-1,u.A.aC+1,u.A.cC,u.A.fC,u.A.uC,u.A.dC,u.A.wC,u.A.yC,u.A.AC,u.A.pC,u.A.mC,u.A.gC,u.A._C,u.A.IC,u.A.CC,u.A.EC],[u.A.bC,u.A.TC,u.A.OC,u.A.RC,u.A.SC,u.A.LC],[u.A.xC,u.A.MC,u.A.kC,u.A.DC,u.A.FC,u.A.NC,u.A.BC,u.A.PC]];static Lo=new h.A(200);name=null;visible=!1;UC=0;WC=0;GC=new Uint16Array(12);HC=new Uint16Array(5);Ka=0;YC=0n;y=0;VC=0;KC=0;XC=0;jC=0;zC=0;ZC=null;Sg=0;Lg=0;FA=0;NA=0;st=!1;draw(t){if(!this.visible)return null;let i=this.zd();if(this.height=i.Pd,i.$d=!0,this.st)return i;if(-1!==this.eI&&-1!==this.nI){const t=r.A.So[this.eI],s=n.A.vu(t.la(),!0,!t.ld,!1);s.translate(-this.oI,0,0),s.xa(),t.Vw&&t.Vw.frames&&s.Ma(t.Vw.frames[this.nI]),s.Dd=null,s.Fd=null,128===t.Xd&&128===t.jd||s.scale(t.Xd,t.jd,t.Xd),s.ka(t.fd+64,t.ud+850,-30,-50,-30,!0);const e=[i,s];i=n.A.qC(e,2)}if(this.ZC&&(t>=this.KC&&(this.ZC=null),t>=this.VC&&t=d.Ra[i].length)&&(s=0),this.HC[i]=s}this.La=t.ou,65535===this.La&&(this.La=-1),this.L_=t.ou,65535===this.L_&&(this.L_=-1),this.x_=t.ou,65535===this.x_&&(this.x_=-1),this.M_=t.ou,65535===this.M_&&(this.M_=-1),this.k_=t.ou,65535===this.k_&&(this.k_=-1),this.D_=t.ou,65535===this.D_&&(this.D_=-1),this.F_=t.ou,65535===this.F_&&(this.F_=-1),this.name=c.A.Ca(c.A.Ea(t.JC)),this.Ka=t.au,this.visible=!0,this.YC=0n;for(let t=0;t<12;t++)this.YC<<=0x4n,this.GC[t]>=256&&(this.YC+=BigInt(this.GC[t])-256n);this.GC[0]>=256&&(this.YC+=BigInt(this.GC[0])-256n>>4n),this.GC[1]>=256&&(this.YC+=BigInt(this.GC[1])-256n>>8n);for(let t=0;t<5;t++)this.YC<<=0x3n,this.YC+=BigInt(this.HC[t]);this.YC<<=0x1n,this.YC+=BigInt(this.UC)}Xu(){if(!this.visible)return null;const t=new f.ds(12,null);let i=0;for(let s=0;s<12;s++){const e=this.GC[s];if(e>=256&&e<512&&(t[i++]=l.A.So[e-256].Xu()),e>=512){const s=a.A.get(e-512).Xu(this.UC);s&&(t[i++]=s)}}const s=n.A.Ta(t,i);for(let t=0;t<5;t++)0!==this.HC[t]&&(s.Oa(d.Ra[t][0],d.Ra[t][this.HC[t]]),1===t&&s.Oa(d.Sa[0],d.Sa[this.HC[t]]));return s}zd(){let t=this.YC,i=-1,s=-1,e=-1,h=-1;if(this.J_>=0&&0===this.iI){const n=o.A.So[this.J_];if(n.frames&&(i=n.frames[this.Q_]),this.z_>=0&&this.z_!==this.La){const t=o.A.So[this.z_].frames;t&&(s=t[this.Z_])}n.Gw>=0&&(e=n.Gw,t+=BigInt(e-this.GC[5])<<8n),n.Hw>=0&&(h=n.Hw,t+=BigInt(h-this.GC[3])<<16n)}else if(this.z_>=0){const t=o.A.So[this.z_].frames;t&&(i=t[this.Z_])}let r=d.Lo?.get(t);if(!r){const i=new f.ds(12,null);let s=0;for(let t=0;t<12;t++){let n=this.GC[t];if(h>=0&&3===t&&(n=h),e>=0&&5===t&&(n=e),n>=256&&n<512){const t=l.A.So[n-256].la();t&&(i[s++]=t)}if(n>=512){const t=a.A.get(n-512).Pw(this.UC);t&&(i[s++]=t)}}r=n.A.Ta(i,s);for(let t=0;t<5;t++)0!==this.HC[t]&&(r.Oa(d.Ra[t][0],d.Ra[t][this.HC[t]]),1===t&&r.Oa(d.Sa[0],d.Sa[this.HC[t]]));r.xa(),r.ka(64,850,-30,-50,-30,!0),d.Lo?.put(t,r)}if(this.st)return r;const c=n.A.Zd(r,!0);return-1!==i&&-1!==s?c.qd(i,s,o.A.So[this.J_].Uw):-1!==i&&c.Ma(i),c.Jd(),c.Dd=null,c.Fd=null,c}}},9222:(t,i,s)=>{s.d(i,{A:()=>e});class e{y;x;z;model;Xm;info;constructor(t,i,s,e,n,h){this.y=t,this.x=i,this.z=s,this.model=e,this.Xm=n,this.info=h}}},1161:(t,i,s)=>{s.d(i,{A:()=>e});class e{level;y;x;z;model;Hg;Yg;jm;rg;zm;og;Xm;info;Qg=0;Ip=0;constructor(t,i,s,e,n,h,r,o,l,a,c,f,u){this.level=t,this.y=i,this.x=s,this.z=e,this.model=n,this.Hg=h,this.Yg=r,this.jm=o,this.rg=l,this.zm=a,this.og=c,this.Xm=f,this.info=u}}},5748:(t,i,s)=>{s.d(i,{A:()=>e});class e{y;x;z;$g;Jg;qg;Xm;offset;constructor(t,i,s,e,n,h,r,o){this.y=t,this.x=i,this.z=s,this.$g=e,this.Jg=n,this.qg=h,this.Xm=r,this.offset=o}}},8256:(t,i,s)=>{s.d(i,{A:()=>e});class e{Sg;FA;Lg;NA;type;fg;ug;dg;wg;cg;Pd;mode=0;Fg=0;Ng=0;xg=0;Mg=0;kg=0;Dg=0;constructor(t,i,s,e,n,h,r,o,l,a,c){this.Sg=t,this.FA=i,this.Lg=s,this.NA=e,this.type=n,this.fg=h,this.ug=r,this.dg=o,this.wg=l,this.cg=a,this.Pd=c}}},3795:(t,i,s)=>{s.d(i,{A:()=>h});var e=s(1982),n=s(3867);class h extends e.A{level;x;z;Pg;xm;Og;vm=null;Tm=null;Dm=null;Fm=null;Om=null;Mm=null;Cm=null;Lm=0;Rg=0;Em=0;visible=!1;update=!1;vg=!1;bg=0;Xg=0;jg=0;Vg=0;constructor(t,i,s){super(),this.Pg=this.level=t,this.x=i,this.z=s,this.xm=new n.ds(5,null),this.Og=new Int32Array(5)}}},2771:(t,i,s)=>{s.d(i,{A:()=>e});class e{static A_=new Int32Array(6);static p_=new Int32Array(6);static d_=new Int32Array(6);static w_=new Int32Array(6);static y_=new Int32Array(6);static $C=[Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,2,6),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,13,14)];static QC=[Int8Array.of(0,1,2,3,0,0,1,3),Int8Array.of(1,1,2,3,1,0,1,3),Int8Array.of(0,1,2,3,1,0,1,3),Int8Array.of(0,0,1,2,0,0,2,4,1,0,4,3),Int8Array.of(0,0,1,4,0,0,4,3,1,1,2,4),Int8Array.of(0,0,4,3,1,0,1,2,1,0,2,4),Int8Array.of(0,1,2,4,1,0,1,4,1,0,4,3),Int8Array.of(0,4,1,2,0,4,2,5,1,0,4,5,1,0,5,3),Int8Array.of(0,4,1,2,0,4,2,3,0,4,3,5,1,0,4,5),Int8Array.of(0,0,4,5,1,4,1,2,1,4,2,3,1,4,3,5),Int8Array.of(0,0,1,5,0,1,4,5,0,1,2,4,1,0,5,3,1,5,4,3,1,4,2,3),Int8Array.of(1,0,1,5,1,1,4,5,1,1,2,4,0,0,5,3,0,5,4,3,0,4,2,3),Int8Array.of(1,0,5,4,1,0,1,5,0,0,4,3,0,4,5,3,0,5,2,3,0,1,2,5)];static tE=128;static iE=this.tE/2|0;static sE=this.tE/4|0;static eE=3*this.tE/4|0;Rd;Ld;Sd;I_;C_;E_;m_;g_;__;u_;flat;shape;angle;Ig;Cg;constructor(t,i,s,n,h,r,o,l,a,c,f,u,d,w,y,A,p,m,g){this.flat=!(p!==n||p!==w||p!==l),this.shape=i,this.angle=r,this.Ig=d,this.Cg=a;const _=e.$C[i],I=_.length;this.Rd=new Int32Array(I),this.Ld=new Int32Array(I),this.Sd=new Int32Array(I);const C=new Int32Array(I),E=new Int32Array(I),v=t*e.tE,b=m*e.tE;for(let t=0;t8&&I<=12&&(I=9+(I-r-9&3)),I>12&&I<=16&&(I=13+(I-r-13&3)),1===I?(i=v,a=b,f=p,d=o,m=c):2===I?(i=v+e.iE,a=b,f=p+n>>1,d=o+g>>1,m=c+s>>1):3===I?(i=v+e.tE,a=b,f=n,d=g,m=s):4===I?(i=v+e.tE,a=b+e.iE,f=n+w>>1,d=g+h>>1,m=s+y>>1):5===I?(i=v+e.tE,a=b+e.tE,f=w,d=h,m=y):6===I?(i=v+e.iE,a=b+e.tE,f=w+l>>1,d=h+A>>1,m=y+u>>1):7===I?(i=v,a=b+e.tE,f=l,d=A,m=u):8===I?(i=v,a=b+e.iE,f=l+p>>1,d=A+o>>1,m=u+c>>1):9===I?(i=v+e.iE,a=b+e.sE,f=p+n>>1,d=o+g>>1,m=c+s>>1):10===I?(i=v+e.eE,a=b+e.iE,f=n+w>>1,d=g+h>>1,m=s+y>>1):11===I?(i=v+e.iE,a=b+e.eE,f=w+l>>1,d=h+A>>1,m=y+u>>1):12===I?(i=v+e.sE,a=b+e.iE,f=l+p>>1,d=A+o>>1,m=u+c>>1):13===I?(i=v+e.sE,a=b+e.sE,f=p,d=o,m=c):14===I?(i=v+e.eE,a=b+e.sE,f=n,d=g,m=s):15===I?(i=v+e.eE,a=b+e.eE,f=w,d=h,m=y):(i=v+e.sE,a=b+e.eE,f=l,d=A,m=u),this.Rd[t]=i,this.Ld[t]=f,this.Sd[t]=a,C[t]=d,E[t]=m}const T=e.QC[i],O=T.length/4|0;this.m_=new Int32Array(O),this.g_=new Int32Array(O),this.__=new Int32Array(O),this.I_=new Int32Array(O),this.C_=new Int32Array(O),this.E_=new Int32Array(O),this.u_=-1!==f?new Int32Array(O):null;let R=0;for(let t=0;t{s.d(i,{A:()=>e});class e{static QA=0;static bm=1;static nE=2;static hE=3;static rE=4;static oE=5;static iE=6;static sE=7;static eE=8;static lE=9;static aE=10;static cE=11}},3479:(t,i,s)=>{s.d(i,{A:()=>e});class e{f_;l_;h_;o_;n_;color;flat;constructor(t,i,s,e,n,h,r){this.f_=t,this.l_=i,this.h_=s,this.o_=e,this.n_=n,this.color=h,this.flat=r}}},6855:(t,i,s)=>{s.d(i,{A:()=>e});class e{y;x;z;Kg;Zg;Wm;Hm;Xm;info;constructor(t,i,s,e,n,h,r,o,l){this.y=t,this.x=i,this.z=s,this.Kg=e,this.Zg=n,this.Wm=h,this.Hm=r,this.Xm=o,this.info=l}}},7441:(t,i,s)=>{s.d(i,{A:()=>e});class e{y;x;z;type;angle;model;Xm;info;constructor(t,i,s,e,n,h,r,o){this.y=t,this.x=i,this.z=s,this.type=e,this.angle=n,this.model=h,this.Xm=r,this.info=o}}},7536:(t,i,s)=>{s.d(i,{A:()=>n});var e=s(1982);class n{fE;uE;constructor(t){this.uE=[],this.fE=t;for(let i=0;i{s.d(i,{A:()=>n});var e=s(1982);class n extends e.A{wE;yE;constructor(){super(),this.wE=this,this.yE=this}AE(){this.yE&&this.wE&&(this.yE.wE=this.wE,this.wE.yE=this.yE,this.wE=null,this.yE=null)}}},3819:(t,i,s)=>{s.d(i,{A:()=>e});class e{static pE=['_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9'];static mE=t=>{t=t.trim();let i=0n;for(let s=0;s=65&&e<=90?i+=BigInt(e+1-65):e>=97&&e<=122?i+=BigInt(e+1-97):e>=48&&e<=57&&(i+=BigInt(e+27-48))}return i};static Ea=t=>{if(t<0n||t>=6582952005840035281n)return'invalid_name';if(t%37n===0n)return'invalid_name';let i=0;const s=Array(12);for(;0n!==t;){const e=t;t/=37n,s[11-i++]=this.pE[Number(e-37n*t)]}return s.slice(12-i).join('')};static gE=t=>{const i=[...t.toLowerCase()];let s=!0;for(let t=0;t='a'&&e<='z'&&(i[t]=e.toUpperCase(),s=!1),'.'!==e&&'!'!==e||(s=!0)}return i.join('')};static _E=t=>{let i='';for(let s=0;s(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static Ca=t=>{if(0===t.length)return t;const i=[...t];for(let t=0;t='a'&&i[t+1]<='z'&&(i[t+1]=String.fromCharCode(i[t+1].charCodeAt(0)+'A'.charCodeAt(0)-97)));return i[0]>='a'&&i[0]<='z'&&(i[0]=String.fromCharCode(i[0].charCodeAt(0)+'A'.charCodeAt(0)-97)),i.join('')};static Iu=t=>{const i=t.toUpperCase();let s=0n;for(let t=0;t>56n)&0xffffffffffffffn;return s}}},6666:(t,i,s)=>{s.d(i,{A:()=>n});var e=s(1982);class n{IE;cursor=null;constructor(){const t=new e.A;t.next=t,t.dE=t,this.IE=t}MA(t){t.dE&&t.hw(),t.dE=this.IE.dE,t.next=this.IE,t.dE&&(t.dE.next=t),t.next.dE=t}CE(t){t.dE&&t.hw(),t.dE=this.IE,t.next=this.IE.next,t.dE.next=t,t.next&&(t.next.dE=t)}Bg(){const t=this.IE.next;return t===this.IE?null:(t?.hw(),t)}head(){const t=this.IE.next;return t===this.IE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}EE(){const t=this.IE.dE;return t===this.IE?(this.cursor=null,null):(this.cursor=t?.dE||null,t)}next(){const t=this.cursor;return t===this.IE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}dE(){const t=this.cursor;return t===this.IE?(this.cursor=null,null):(this.cursor=t?.dE||null,t)}clear(){for(;;){const t=this.IE.next;if(t===this.IE)return;t?.hw()}}}},1982:(t,i,s)=>{s.d(i,{A:()=>e});class e{key;next;dE;constructor(){this.key=0n,this.next=this,this.dE=this}hw(){this.dE&&this.next&&(this.dE.next=this.next,this.next.dE=this.dE,this.next=null,this.dE=null)}}},2679:(t,i,s)=>{s.d(i,{A:()=>h});var e=s(2512),n=s(7536);class h{vE;bE;history;available;constructor(t){this.vE=t,this.available=t,this.bE=new n.A(1024),this.history=new e.A}get(t){const i=this.bE.get(t);return i&&this.history.push(i),i}put(t,i){if(0===this.available){const t=this.history.pop();t?.hw(),t?.AE()}else this.available--;this.bE.put(t,i),this.history.push(i)}clear(){const t=this.history.pop();t?(t.hw(),t.AE()):this.available=this.vE}}},2512:(t,i,s)=>{s.d(i,{A:()=>n});var e=s(4474);class n{head;constructor(){this.head=new e.A}push(t){t.yE&&t.AE(),t.yE=this.head.yE,t.wE=this.head,t.yE&&(t.yE.wE=t),t.wE.yE=t}pop(){const t=this.head.wE;return t===this.head?null:(t?.AE(),t)}}},8534:(t,i,s)=>{s.d(i,{A:()=>h});var e=s(1069),n=s(3867);class h{static So=[];static ru=t=>{const i=new e.A(t.read('base_head.dat')),s=new e.A(t.read('base_type.dat')),r=new e.A(t.read('base_label.dat')),o=i.ou;i.af+=2;for(let t=0;t{s.d(i,{A:()=>h});var e=s(8534),n=s(1069);class h{static So=[];static ru=t=>{const i=new n.A(t.read('frame_head.dat')),s=new n.A(t.read('frame_tran1.dat')),r=new n.A(t.read('frame_tran2.dat')),o=new n.A(t.read('frame_del.dat')),l=i.ou;i.af+=2;const a=new Int32Array(500),c=new Int32Array(500),f=new Int32Array(500),u=new Int32Array(500);for(let t=0;t0){if(0!==d.types[t])for(let i=t-1;i>y;i--)if(0===d.types[i]){a[A]=i,c[A]=0,f[A]=0,u[A]=0,A++;break}a[A]=t;let s=0;3===d.types[a[A]]&&(s=128),c[A]=1&i?r.OE:s,f[A]=2&i?r.OE:s,u[A]=4&i?r.OE:s,y=t,A++}}n.length=A,n.RE=new Int32Array(A),n.x=new Int32Array(A),n.y=new Int32Array(A),n.z=new Int32Array(A);for(let t=0;t{s.d(i,{bc:()=>e,zo:()=>n,SE:()=>o,LE:()=>r,xE:()=>h});const e=document.getElementById('canvas'),n=e.getContext('2d',{willReadFrequently:!0}),h=document.createElement('canvas'),r=document.createElement('img'),o=h.getContext('2d',{willReadFrequently:!0})},9298:(t,i,s)=>{s.d(i,{A:()=>e});class e{static RED=16711680;static GREEN=65280;static BLUE=255;static Wl=16776960;static ME=65535;static sp=16711935;static _l=16777215;static Ul=0;static kE=16748608;static DE=8388608;static FE=128;static NE=16756736;static BE=16740352;static PE=16723968;static UE=12648192;static WE=8453888;static GE=4259584;static HE=9179409;static YE=6116423;static il=2301979;static sl=5063219;static nl=7759444;static rl=3353893;static VE=8388736;static KE=13350793;static XE=Int32Array.of(e.Wl,e.RED,e.GREEN,e.ME,e.sp,e._l);static JI=6798;static $I=107;static QI=10283;static tC=16;static iC=4797;static sC=7744;static eC=5799;static nC=4634;static hC=33697;static rC=22433;static oC=2983;static lC=54193;static aC=8741;static cC=12;static fC=64030;static uC=43162;static dC=7735;static wC=8404;static yC=1701;static AC=38430;static pC=24094;static mC=10153;static gC=56621;static _C=4783;static IC=1341;static CC=16578;static EC=35003;static vC=25239;static DI=9104;static FI=10275;static NI=7595;static BI=3610;static UI=7975;static WI=8526;static GI=918;static HI=38802;static YI=24466;static VI=10145;static KI=58654;static XI=5027;static jI=1457;static zI=16565;static ZI=34991;static qI=25486;static bC=4626;static TC=11146;static OC=6439;static RC=12;static SC=4758;static LC=10270;static PC=4574;static xC=4550;static MC=4537;static kC=5681;static DC=5673;static FC=5790;static NC=6806;static BC=8076}},8950:(t,i,s)=>{s.d(i,{A:()=>n});var e=s(4474);class n extends e.A{static aw=new Int32Array;static cw=0;static fw=0;static top=0;static bottom=0;static left=0;static right=0;static s_=0;static jE=0;static zE=0;static bind=(t,i,s)=>{this.aw=t,this.cw=i,this.fw=s,this.Al(0,0,i,s)};static ZE=()=>{this.left=0,this.top=0,this.right=this.cw,this.bottom=this.fw,this.s_=this.right-1,this.jE=this.right/2|0};static Al=(t,i,s,e)=>{t<0&&(t=0),i<0&&(i=0),s>this.cw&&(s=this.cw),e>this.fw&&(e=this.fw),this.top=i,this.bottom=e,this.left=t,this.right=s,this.s_=this.right-1,this.jE=this.right/2|0,this.zE=this.bottom/2|0};static clear=()=>{const t=this.cw*this.fw;for(let i=0;i{this.hl(t,i,n,s),this.hl(t,i+e-1,n,s),this.el(t,i,n,e),this.el(t+s-1,i,n,e)};static hl=(t,i,s,e)=>{if(i=this.bottom)return;tthis.right&&(e=this.right-t);const n=t+i*this.cw;for(let t=0;t{if(t=this.right)return;ithis.bottom&&(e=this.bottom-i);const n=t+i*this.cw;for(let t=0;t{const h=Math.abs(s-t),r=Math.abs(e-i),o=t=this.left&&t=this.top&&i-r&&(a-=r,t+=o),s{tthis.right&&(s=this.right-t),i+e>this.bottom&&(e=this.bottom-i);const h=this.cw-s;let r=t+i*this.cw;for(let t=-e;t<0;t++){for(let t=-s;t<0;t++)this.aw[r++]=n;r+=h}};static JE(t,i,s,e,n,h){tthis.right&&(s=this.right-t),i+e>this.bottom&&(e=this.bottom-i);const r=256-h,o=(n>>16&255)*h,l=(n>>8&255)*h,a=(255&n)*h,c=this.cw-s;let f=t+i*this.cw;for(let t=0;t>16&255)*r>>8<<16)+(l+(this.aw[f]>>8&255)*r>>8<<8)+(a+(255&this.aw[f])*r>>8);this.aw[f++]=t}f+=c}}static $E(t,i,s,e,n){const h=256-n,r=(e>>16&255)*n,o=(e>>8&255)*n,l=(255&e)*n;let a=i-s;a<0&&(a=0);let c=i+s;c>=this.fw&&(c=this.fw-1);for(let e=a;e<=c;e++){const n=e-i,a=0|Math.sqrt(s*s-n*n);let c=t-a;c<0&&(c=0);let f=t+a;f>=this.cw&&(f=this.cw-1);let u=c+e*this.cw;for(let t=c;t<=f;t++){const t=(r+(this.aw[u]>>16&255)*h>>8<<16)+(o+(this.aw[u]>>8&255)*h>>8<<8)+(l+(255&this.aw[u])*h>>8);this.aw[u++]=t}}}static QE=(t,i,s)=>{t=this.right||i=this.bottom||(this.aw[t+i*this.cw]=s)}}},4583:(t,i,s)=>{s.d(i,{A:()=>r});var e=s(8950),n=s(1673),h=s(3867);class r extends e.A{static st=!1;static tv=new Int32Array(512);static iv=new Int32Array(2048);static sin=new Int32Array(2048);static cos=new Int32Array(2048);static palette=new Int32Array(65536);static sv=new h.ds(50,null);static ev=0;static lw=new Int32Array;static ha=0;static ra=0;static uw=!0;static i_=!1;static alpha=0;static nv=null;static hv=new h.ds(50,null);static rv=0;static Ip=0;static ov=new Int32Array(50);static lv=new h.ds(50,null);static av=!1;static cv=new h.ds(50,!1);static fv=new Int32Array(50);static{for(let t=1;t<512;t++)this.tv[t]=32768/t|0;for(let t=1;t<2048;t++)this.iv[t]=65536/t|0;for(let t=0;t<2048;t++)this.sin[t]=65536*Math.sin(.0030679615757712823*t)|0,this.cos[t]=65536*Math.cos(.0030679615757712823*t)|0}static To=()=>{this.tv=null,this.tv=null,this.sin=null,this.cos=null,this.lw=null,this.sv=null,this.cv=null,this.fv=null,this.nv=null,this.hv=null,this.ov=null,this.palette=null,this.lv=null,console.log('Draw3D unloaded!')};static Tc=()=>{this.lw=new Int32Array(this.fw);for(let t=0;t{this.lw=new Int32Array(i);for(let s=0;s{this.nv=null,this.hv.fill(null)};static wv=t=>{this.ev=0;for(let i=0;i<50;i++)try{this.sv[i]=n.A.Cu(t,i.toString()),this.st&&128===this.sv[i]?.Nl?this.sv[i]?.yv():this.sv[i]?.Iw(),this.ev++}catch(t){}};static ip=t=>{if(0!==this.fv[t])return this.fv[t];const i=this.lv[t];if(!i)return 0;let s=0,e=0,n=0;const h=i.length;for(let t=0;t>16&255,e+=i[t]>>8&255,n+=255&i[t];let r=(s/h<<16)+(e/h<<8)+(n/h|0);return r=this.Av(r,1.4),0===r&&(r=1),this.fv[t]=r,r};static pv=t=>{const i=t+.03*Math.random()-.015;let s=0;for(let t=0;t<512;t++){const e=(t/8|0)/64+.0078125,n=(7&t)/8+.0625;for(let t=0;t<128;t++){const h=t/128;let r=h,o=h,l=h;if(0!==n){let t;t=h<.5?h*(n+1):h+n-h*n;const i=2*h-t;let s=e+.3333333333333333;s>1&&s--;let a=e-.3333333333333333;a<0&&a++,r=6*s<1?i+6*(t-i)*s:2*s<1?t:3*s<2?i+(t-i)*(.6666666666666666-s)*6:i,o=6*e<1?i+6*(t-i)*e:2*e<1?t:3*e<2?i+(t-i)*(.6666666666666666-e)*6:i,l=6*a<1?i+6*(t-i)*a:2*a<1?t:3*a<2?i+(t-i)*(.6666666666666666-a)*6:i}const a=((256*r|0)<<16)+((256*o|0)<<8)+(256*l|0);this.palette[s++]=this.Av(a,i)}}for(let t=0;t<50;t++){const s=this.sv[t];if(!s)continue;const e=s.palette;this.lv[t]=new Int32Array(e.length);for(let s=0;s{const s=(t>>16)/256,e=(t>>8&255)/256,n=(255&t)/256;return((256*Math.pow(s,i)|0)<<16)+((256*Math.pow(e,i)|0)<<8)+(256*Math.pow(n,i)|0)};static gv=t=>{this.nv||(this.rv=t,this.st?this.nv=new h.Kh(t,16384):this.nv=new h.Kh(t,65536),this.hv.fill(null))};static r_=(t,i,s,e,n,h,r,o,l)=>{let a=0,c=0;n!==e&&(a=(i-t<<16)/(n-e)|0,c=(o-r<<15)/(n-e)|0);let f=0,u=0;h!==n&&(f=(s-i<<16)/(h-n)|0,u=(l-o<<15)/(h-n)|0);let d=0,w=0;if(h!==e&&(d=(t-s<<16)/(e-h)|0,w=(r-l<<15)/(e-h)|0),e<=n&&e<=h){if(ethis.bottom&&(n=this.bottom),h>this.bottom&&(h=this.bottom),nf)for(h-=n,n-=e,e=this.lw[e];;){if(--n<0)for(;;){if(--h<0)return;this._v(s>>16,i>>16,l>>7,o>>7,this.aw,e,0),s+=d,i+=f,l+=w,o+=u,e+=this.cw}this._v(s>>16,t>>16,l>>7,r>>7,this.aw,e,0),s+=d,t+=a,l+=w,r+=c,e+=this.cw}else for(h-=n,n-=e,e=this.lw[e];;){if(--n<0)for(;;){if(--h<0)return;this._v(i>>16,s>>16,o>>7,l>>7,this.aw,e,0),s+=d,i+=f,l+=w,o+=u,e+=this.cw}this._v(t>>16,s>>16,r>>7,l>>7,this.aw,e,0),s+=d,t+=a,l+=w,r+=c,e+=this.cw}else if(i=t<<=16,o=r<<=15,e<0&&(i-=d*e,t-=a*e,o-=w*e,r-=c*e,e=0),s<<=16,l<<=15,h<0&&(s-=f*h,l-=u*h,h=0),e!==h&&da)for(n-=h,h-=e,e=this.lw[e];;){if(--h<0)for(;;){if(--n<0)return;this._v(s>>16,t>>16,l>>7,r>>7,this.aw,e,0),s+=f,t+=a,l+=u,r+=c,e+=this.cw}this._v(i>>16,t>>16,o>>7,r>>7,this.aw,e,0),i+=d,t+=a,o+=w,r+=c,e+=this.cw}else for(n-=h,h-=e,e=this.lw[e];;){if(--h<0)for(;;){if(--n<0)return;this._v(t>>16,s>>16,r>>7,l>>7,this.aw,e,0),s+=f,t+=a,l+=u,r+=c,e+=this.cw}this._v(t>>16,i>>16,r>>7,o>>7,this.aw,e,0),i+=d,t+=a,o+=w,r+=c,e+=this.cw}}else if(n<=h){if(nthis.bottom&&(h=this.bottom),e>this.bottom&&(e=this.bottom),hd)for(e-=h,h-=n,n=this.lw[n];;){if(--h<0)for(;;){if(--e<0)return;this._v(t>>16,s>>16,r>>7,l>>7,this.aw,n,0),t+=a,s+=d,r+=c,l+=w,n+=this.cw}this._v(t>>16,i>>16,r>>7,o>>7,this.aw,n,0),t+=a,i+=f,r+=c,o+=u,n+=this.cw}else for(e-=h,h-=n,n=this.lw[n];;){if(--h<0)for(;;){if(--e<0)return;this._v(s>>16,t>>16,l>>7,r>>7,this.aw,n,0),t+=a,s+=d,r+=c,l+=w,n+=this.cw}this._v(i>>16,t>>16,o>>7,r>>7,this.aw,n,0),t+=a,i+=f,r+=c,o+=u,n+=this.cw}else if(s=i<<=16,l=o<<=15,n<0&&(s-=a*n,i-=f*n,l-=c*n,o-=u*n,n=0),t<<=16,r<<=15,e<0&&(t-=d*e,r-=w*e,e=0),h-=e,e-=n,n=this.lw[n],a>16,i>>16,r>>7,o>>7,this.aw,n,0),t+=d,i+=f,r+=w,o+=u,n+=this.cw}this._v(s>>16,i>>16,l>>7,o>>7,this.aw,n,0),s+=a,i+=f,l+=c,o+=u,n+=this.cw}else for(;;){if(--e<0)for(;;){if(--h<0)return;this._v(i>>16,t>>16,o>>7,r>>7,this.aw,n,0),t+=d,i+=f,r+=w,o+=u,n+=this.cw}this._v(i>>16,s>>16,o>>7,l>>7,this.aw,n,0),s+=a,i+=f,l+=c,o+=u,n+=this.cw}}else if(hthis.bottom&&(e=this.bottom),n>this.bottom&&(n=this.bottom),e>16,t>>16,o>>7,r>>7,this.aw,h,0),i+=f,t+=a,o+=u,r+=c,h+=this.cw}this._v(i>>16,s>>16,o>>7,l>>7,this.aw,h,0),i+=f,s+=d,o+=u,l+=w,h+=this.cw}else for(;;){if(--e<0)for(;;){if(--n<0)return;this._v(t>>16,i>>16,r>>7,o>>7,this.aw,h,0),i+=f,t+=a,o+=u,r+=c,h+=this.cw}this._v(s>>16,i>>16,l>>7,o>>7,this.aw,h,0),i+=f,s+=d,o+=u,l+=w,h+=this.cw}else if(t=s<<=16,r=l<<=15,h<0&&(t-=f*h,s-=d*h,r-=u*h,l-=w*h,h=0),i<<=16,o<<=15,n<0&&(i-=a*n,o-=c*n,n=0),e-=n,n-=h,h=this.lw[h],f>16,s>>16,o>>7,l>>7,this.aw,h,0),i+=a,s+=d,o+=c,l+=w,h+=this.cw}this._v(t>>16,s>>16,r>>7,l>>7,this.aw,h,0),t+=f,s+=d,r+=u,l+=w,h+=this.cw}else for(;;){if(--n<0)for(;;){if(--e<0)return;this._v(s>>16,i>>16,l>>7,o>>7,this.aw,h,0),i+=a,s+=d,o+=c,l+=w,h+=this.cw}this._v(s>>16,t>>16,l>>7,r>>7,this.aw,h,0),t+=f,s+=d,r+=u,l+=w,h+=this.cw}};static _v=(t,i,s,e,n,h,r)=>{let o;if(this.uw){let l;if(this.i_){if(l=i-t>3?(e-s)/(i-t)|0:0,i>this.s_&&(i=this.s_),t<0&&(s-=t*l,t=0),t>=i)return;h+=t,r=i-t>>2,l<<=2}else{if(!(t>2)>0?(e-s)*this.tv[r]>>15:0}if(0===this.alpha)for(;;){if(--r<0){if((r=i-t&3)>0){o=this.palette[s>>8];do{n[h++]=o,r--}while(r>0);return}break}o=this.palette[s>>8],s+=l,n[h++]=o,n[h++]=o,n[h++]=o,n[h++]=o}else{const e=this.alpha,a=256-this.alpha;for(;;){if(--r<0){if((r=i-t&3)>0){o=this.palette[s>>8],o=((16711935&o)*a>>8&16711935)+((65280&o)*a>>8&65280);do{n[h++]=o+((16711935&n[h])*e>>8&16711935)+((65280&n[h])*e>>8&65280),r--}while(r>0)}break}o=this.palette[s>>8],s+=l,o=((16711935&o)*a>>8&16711935)+((65280&o)*a>>8&65280),n[h++]=o+((16711935&n[h])*e>>8&16711935)+((65280&n[h])*e>>8&65280),n[h++]=o+((16711935&n[h])*e>>8&16711935)+((65280&n[h])*e>>8&65280),n[h++]=o+((16711935&n[h])*e>>8&16711935)+((65280&n[h])*e>>8&65280),n[h++]=o+((16711935&n[h])*e>>8&16711935)+((65280&n[h])*e>>8&65280)}}}else if(tthis.s_&&(i=this.s_),t<0&&(s-=t*l,t=0),t>=i))return;if(h+=t,r=i-t,0===this.alpha)do{n[h++]=this.palette[s>>8],s+=l,r--}while(r>0);else{const t=this.alpha,i=256-this.alpha;do{o=this.palette[s>>8],s+=l,o=((16711935&o)*i>>8&16711935)+((65280&o)*i>>8&65280),n[h++]=o+((16711935&n[h])*t>>8&16711935)+((65280&n[h])*t>>8&65280),r--}while(r>0)}}};static Iv=(t,i,s,e,n,h,r)=>{let o=0;n!==e&&(o=(i-t<<16)/(n-e)|0);let l=0;h!==n&&(l=(s-i<<16)/(h-n)|0);let a=0;if(h!==e&&(a=(t-s<<16)/(e-h)|0),e<=n&&e<=h){if(ethis.bottom&&(n=this.bottom),h>this.bottom&&(h=this.bottom),nl)for(h-=n,n-=e,e=this.lw[e];;){if(--n<0)for(;;){if(--h<0)return;this.Cv(s>>16,i>>16,this.aw,e,r),s+=a,i+=l,e+=this.cw}this.Cv(s>>16,t>>16,this.aw,e,r),s+=a,t+=o,e+=this.cw}else for(h-=n,n-=e,e=this.lw[e];;){if(--n<0)for(;;){if(--h<0)return;this.Cv(i>>16,s>>16,this.aw,e,r),s+=a,i+=l,e+=this.cw}this.Cv(t>>16,s>>16,this.aw,e,r),s+=a,t+=o,e+=this.cw}else if(i=t<<=16,e<0&&(i-=a*e,t-=o*e,e=0),s<<=16,h<0&&(s-=l*h,h=0),e!==h&&ao)for(n-=h,h-=e,e=this.lw[e];;){if(--h<0)for(;;){if(--n<0)return;this.Cv(s>>16,t>>16,this.aw,e,r),s+=l,t+=o,e+=this.cw}this.Cv(i>>16,t>>16,this.aw,e,r),i+=a,t+=o,e+=this.cw}else for(n-=h,h-=e,e=this.lw[e];;){if(--h<0)for(;;){if(--n<0)return;this.Cv(t>>16,s>>16,this.aw,e,r),s+=l,t+=o,e+=this.cw}this.Cv(t>>16,i>>16,this.aw,e,r),i+=a,t+=o,e+=this.cw}}else if(n<=h){if(nthis.bottom&&(h=this.bottom),e>this.bottom&&(e=this.bottom),ha)for(e-=h,h-=n,n=this.lw[n];;){if(--h<0)for(;;){if(--e<0)return;this.Cv(t>>16,s>>16,this.aw,n,r),t+=o,s+=a,n+=this.cw}this.Cv(t>>16,i>>16,this.aw,n,r),t+=o,i+=l,n+=this.cw}else for(e-=h,h-=n,n=this.lw[n];;){if(--h<0)for(;;){if(--e<0)return;this.Cv(s>>16,t>>16,this.aw,n,r),t+=o,s+=a,n+=this.cw}this.Cv(i>>16,t>>16,this.aw,n,r),t+=o,i+=l,n+=this.cw}else if(s=i<<=16,n<0&&(s-=o*n,i-=l*n,n=0),t<<=16,e<0&&(t-=a*e,e=0),o>16,i>>16,this.aw,n,r),t+=a,i+=l,n+=this.cw}this.Cv(s>>16,i>>16,this.aw,n,r),s+=o,i+=l,n+=this.cw}else for(h-=e,e-=n,n=this.lw[n];;){if(--e<0)for(;;){if(--h<0)return;this.Cv(i>>16,t>>16,this.aw,n,r),t+=a,i+=l,n+=this.cw}this.Cv(i>>16,s>>16,this.aw,n,r),s+=o,i+=l,n+=this.cw}}else if(hthis.bottom&&(e=this.bottom),n>this.bottom&&(n=this.bottom),e>16,t>>16,this.aw,h,r),i+=l,t+=o,h+=this.cw}this.Cv(i>>16,s>>16,this.aw,h,r),i+=l,s+=a,h+=this.cw}else for(n-=e,e-=h,h=this.lw[h];;){if(--e<0)for(;;){if(--n<0)return;this.Cv(t>>16,i>>16,this.aw,h,r),i+=l,t+=o,h+=this.cw}this.Cv(s>>16,i>>16,this.aw,h,r),i+=l,s+=a,h+=this.cw}else if(t=s<<=16,h<0&&(t-=l*h,s-=a*h,h=0),i<<=16,n<0&&(i-=o*n,n=0),l>16,s>>16,this.aw,h,r),i+=o,s+=a,h+=this.cw}this.Cv(t>>16,s>>16,this.aw,h,r),t+=l,s+=a,h+=this.cw}else for(e-=n,n-=h,h=this.lw[h];;){if(--n<0)for(;;){if(--e<0)return;this.Cv(s>>16,i>>16,this.aw,h,r),i+=o,s+=a,h+=this.cw}this.Cv(s>>16,t>>16,this.aw,h,r),t+=l,s+=a,h+=this.cw}};static c_=(t,i,s,e,n,h,r,o,l,a,c,f,u,d,w,y,A,p,m)=>{const g=this.Ev(m);this.av=!this.cv[m];const _=a-u,I=c-w,C=f-A,E=d-a,v=y-c,b=p-f;let T=E*c-v*a<<14;const O=v*f-b*c<<8,R=b*a-E*f<<5;let S=_*c-I*a<<14;const L=I*f-C*c<<8,x=C*a-_*f<<5;let M=I*E-_*v<<14;const k=C*v-I*b<<8,D=_*b-C*E<<5;let F=0,N=0;n!==e&&(F=(i-t<<16)/(n-e)|0,N=(o-r<<16)/(n-e)|0);let B=0,P=0;h!==n&&(B=(s-i<<16)/(h-n)|0,P=(l-o<<16)/(h-n)|0);let U=0,W=0;if(h!==e&&(U=(t-s<<16)/(e-h)|0,W=(r-l<<16)/(e-h)|0),e<=n&&e<=h){if(ethis.bottom&&(n=this.bottom),h>this.bottom&&(h=this.bottom),nB)for(h-=n,n-=e,e=this.lw[e];;){if(--n<0)for(;;){if(--h<0)return;this.vv(s>>16,i>>16,this.aw,e,g,0,0,T,S,M,O,L,k,l>>8,o>>8),s+=U,i+=B,l+=W,o+=P,e+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}this.vv(s>>16,t>>16,this.aw,e,g,0,0,T,S,M,O,L,k,l>>8,r>>8),s+=U,t+=F,l+=W,r+=N,e+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}else for(h-=n,n-=e,e=this.lw[e];;){if(--n<0)for(;;){if(--h<0)return;this.vv(i>>16,s>>16,this.aw,e,g,0,0,T,S,M,O,L,k,o>>8,l>>8),s+=U,i+=B,l+=W,o+=P,e+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}this.vv(t>>16,s>>16,this.aw,e,g,0,0,T,S,M,O,L,k,r>>8,l>>8),s+=U,t+=F,l+=W,r+=N,e+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}}else{i=t<<=16,o=r<<=16,e<0&&(i-=U*e,t-=F*e,o-=W*e,r-=N*e,e=0),s<<=16,l<<=16,h<0&&(s-=B*h,l-=P*h,h=0);const a=e-this.ra;if(T+=R*a,S+=x*a,M+=D*a,T|=0,S|=0,M|=0,(e===h||U>=F)&&(e!==h||B<=F))for(n-=h,h-=e,e=this.lw[e];;){if(--h<0)for(;;){if(--n<0)return;this.vv(t>>16,s>>16,this.aw,e,g,0,0,T,S,M,O,L,k,r>>8,l>>8),s+=B,t+=F,l+=P,r+=N,e+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}this.vv(t>>16,i>>16,this.aw,e,g,0,0,T,S,M,O,L,k,r>>8,o>>8),i+=U,t+=F,o+=W,r+=N,e+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}else for(n-=h,h-=e,e=this.lw[e];;){if(--h<0)for(;;){if(--n<0)return;this.vv(s>>16,t>>16,this.aw,e,g,0,0,T,S,M,O,L,k,l>>8,r>>8),s+=B,t+=F,l+=P,r+=N,e+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}this.vv(i>>16,t>>16,this.aw,e,g,0,0,T,S,M,O,L,k,o>>8,r>>8),i+=U,t+=F,o+=W,r+=N,e+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}}}else if(n<=h){if(nthis.bottom&&(h=this.bottom),e>this.bottom&&(e=this.bottom),hU)for(e-=h,h-=n,n=this.lw[n];;){if(--h<0)for(;;){if(--e<0)return;this.vv(t>>16,s>>16,this.aw,n,g,0,0,T,S,M,O,L,k,r>>8,l>>8),t+=F,s+=U,r+=N,l+=W,n+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}this.vv(t>>16,i>>16,this.aw,n,g,0,0,T,S,M,O,L,k,r>>8,o>>8),t+=F,i+=B,r+=N,o+=P,n+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}else for(e-=h,h-=n,n=this.lw[n];;){if(--h<0)for(;;){if(--e<0)return;this.vv(s>>16,t>>16,this.aw,n,g,0,0,T,S,M,O,L,k,l>>8,r>>8),t+=F,s+=U,r+=N,l+=W,n+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}this.vv(i>>16,t>>16,this.aw,n,g,0,0,T,S,M,O,L,k,o>>8,r>>8),t+=F,i+=B,r+=N,o+=P,n+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}}else{s=i<<=16,l=o<<=16,n<0&&(s-=F*n,i-=B*n,l-=N*n,o-=P*n,n=0),t<<=16,r<<=16,e<0&&(t-=U*e,r-=W*e,e=0);const a=n-this.ra;if(T+=R*a,S+=x*a,M+=D*a,T|=0,S|=0,M|=0,h-=e,e-=n,n=this.lw[n],F>16,i>>16,this.aw,n,g,0,0,T,S,M,O,L,k,r>>8,o>>8),t+=U,i+=B,r+=W,o+=P,n+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}this.vv(s>>16,i>>16,this.aw,n,g,0,0,T,S,M,O,L,k,l>>8,o>>8),s+=F,i+=B,l+=N,o+=P,n+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}else for(;;){if(--e<0)for(;;){if(--h<0)return;this.vv(i>>16,t>>16,this.aw,n,g,0,0,T,S,M,O,L,k,o>>8,r>>8),t+=U,i+=B,r+=W,o+=P,n+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}this.vv(i>>16,s>>16,this.aw,n,g,0,0,T,S,M,O,L,k,o>>8,l>>8),s+=F,i+=B,l+=N,o+=P,n+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}}}else if(hthis.bottom&&(e=this.bottom),n>this.bottom&&(n=this.bottom),e>16,t>>16,this.aw,h,g,0,0,T,S,M,O,L,k,o>>8,r>>8),i+=B,t+=F,o+=P,r+=N,h+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}this.vv(i>>16,s>>16,this.aw,h,g,0,0,T,S,M,O,L,k,o>>8,l>>8),i+=B,s+=U,o+=P,l+=W,h+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}else for(;;){if(--e<0)for(;;){if(--n<0)return;this.vv(t>>16,i>>16,this.aw,h,g,0,0,T,S,M,O,L,k,r>>8,o>>8),i+=B,t+=F,o+=P,r+=N,h+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}this.vv(s>>16,i>>16,this.aw,h,g,0,0,T,S,M,O,L,k,l>>8,o>>8),i+=B,s+=U,o+=P,l+=W,h+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}}else{t=s<<=16,r=l<<=16,h<0&&(t-=B*h,s-=U*h,r-=P*h,l-=W*h,h=0),i<<=16,o<<=16,n<0&&(i-=F*n,o-=N*n,n=0);const a=h-this.ra;if(T+=R*a,S+=x*a,M+=D*a,T|=0,S|=0,M|=0,e-=n,n-=h,h=this.lw[h],B>16,s>>16,this.aw,h,g,0,0,T,S,M,O,L,k,o>>8,l>>8),i+=F,s+=U,o+=N,l+=W,h+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}this.vv(t>>16,s>>16,this.aw,h,g,0,0,T,S,M,O,L,k,r>>8,l>>8),t+=B,s+=U,r+=P,l+=W,h+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}else for(;;){if(--n<0)for(;;){if(--e<0)return;this.vv(s>>16,i>>16,this.aw,h,g,0,0,T,S,M,O,L,k,l>>8,o>>8),i+=F,s+=U,o+=N,l+=W,h+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}this.vv(s>>16,t>>16,this.aw,h,g,0,0,T,S,M,O,L,k,l>>8,r>>8),t+=B,s+=U,r+=P,l+=W,h+=this.cw,T+=R,S+=x,M+=D,T|=0,S|=0,M|=0}}};static vv=(t,i,s,e,n,h,r,o,l,a,c,f,u,d,w)=>{if(t>=i)return;let y,A,p,m,g,_,I,C,E;if(this.i_){if(y=(w-d)/(i-t)|0,i>this.s_&&(i=this.s_),t<0&&(d-=t*y,t=0),t>=i)return;A=i-t>>3,y<<=12}else i-t>7?(A=i-t>>3,y=(w-d)*this.tv[A]>>6):(A=0,y=0);if(d<<=9,e+=t,this.st&&n)if(p=0,m=0,_=t-this.ha,o+=(c>>3)*_,l+=(f>>3)*_,a+=(u>>3)*_,o|=0,l|=0,g=(a|=0)>>12,0!==g&&(r=l/g|0,(h=o/g|0)<0?h=0:h>4032&&(h=4032)),o+=c,l+=f,a+=u,o|=0,l|=0,g=(a|=0)>>12,0!==g&&(p=o/g|0,m=l/g|0,p<7?p=7:p>4032&&(p=4032)),I=p-h>>3,C=m-r>>3,h+=d>>3&786432,E=d>>23,this.av){for(;A-- >0;)s[e++]=n[(4032&r)+(h>>6)]>>>E,h+=I,r+=C,s[e++]=n[(4032&r)+(h>>6)]>>>E,h+=I,r+=C,s[e++]=n[(4032&r)+(h>>6)]>>>E,h+=I,r+=C,s[e++]=n[(4032&r)+(h>>6)]>>>E,h+=I,r+=C,s[e++]=n[(4032&r)+(h>>6)]>>>E,h+=I,r+=C,s[e++]=n[(4032&r)+(h>>6)]>>>E,h+=I,r+=C,s[e++]=n[(4032&r)+(h>>6)]>>>E,h+=I,r+=C,s[e++]=n[(4032&r)+(h>>6)]>>>E,h=p,r=m,o+=c,l+=f,g=(a+=u)>>12,0!==g&&(p=o/g|0,m=l/g|0,p<7?p=7:p>4032&&(p=4032)),I=p-h>>3,C=m-r>>3,h+=(d+=y)>>3&786432,E=d>>23;for(A=i-t&7;A-- >0;)s[e++]=n[(4032&r)+(h>>6)]>>>E,h+=I,r+=C}else{for(;A-- >0;){let t;0!=(t=n[(4032&r)+(h>>6)]>>>E)&&(s[e]=t),e+=1,0!=(t=n[(4032&(r+=C))+((h+=I)>>6)]>>>E)&&(s[e]=t),e++,0!=(t=n[(4032&(r+=C))+((h+=I)>>6)]>>>E)&&(s[e]=t),e++,0!=(t=n[(4032&(r+=C))+((h+=I)>>6)]>>>E)&&(s[e]=t),e++,0!=(t=n[(4032&(r+=C))+((h+=I)>>6)]>>>E)&&(s[e]=t),e++,0!=(t=n[(4032&(r+=C))+((h+=I)>>6)]>>>E)&&(s[e]=t),e++,0!=(t=n[(4032&(r+=C))+((h+=I)>>6)]>>>E)&&(s[e]=t),e++,0!=(t=n[(4032&(r+=C))+((h+=I)>>6)]>>>E)&&(s[e]=t),e+=1,h=p,r=m,o+=c,l+=f,a+=u,o|=0,l|=0,g=(a|=0)>>12,0!==g&&(p=o/g|0,m=l/g|0,p<7?p=7:p>4032&&(p=4032)),I=p-h>>3,C=m-r>>3,h+=(d+=y)>>3&786432,E=d>>23}for(A=i-t&7;A-- >0;){let t;0!=(t=n[(4032&r)+(h>>6)]>>>E)&&(s[e]=t),e++,h+=I,r+=C}}else if(p=0,m=0,_=t-this.ha,o+=(c>>3)*_,l+=(f>>3)*_,a+=(u>>3)*_,o|=0,l|=0,g=(a|=0)>>14,0!==g&&(r=l/g|0,(h=o/g|0)<0?h=0:h>16256&&(h=16256)),o+=c,l+=f,a+=u,o|=0,l|=0,g=(a|=0)>>14,0!==g&&(p=o/g|0,m=l/g|0,p<7?p=7:p>16256&&(p=16256)),I=p-h>>3,C=m-r>>3,h+=6291456&d,E=d>>23,this.av&&n){for(;A-- >0;)s[e++]=n[(16256&r)+(h>>7)]>>>E,h+=I,r+=C,s[e++]=n[(16256&r)+(h>>7)]>>>E,h+=I,r+=C,s[e++]=n[(16256&r)+(h>>7)]>>>E,h+=I,r+=C,s[e++]=n[(16256&r)+(h>>7)]>>>E,h+=I,r+=C,s[e++]=n[(16256&r)+(h>>7)]>>>E,h+=I,r+=C,s[e++]=n[(16256&r)+(h>>7)]>>>E,h+=I,r+=C,s[e++]=n[(16256&r)+(h>>7)]>>>E,h+=I,r+=C,s[e++]=n[(16256&r)+(h>>7)]>>>E,h=p,r=m,o+=c,l+=f,a+=u,o|=0,l|=0,g=(a|=0)>>14,0!==g&&(p=o/g|0,m=l/g|0,p<7?p=7:p>16256&&(p=16256)),I=p-h>>3,C=m-r>>3,h+=6291456&(d+=y),E=d>>23;for(A=i-t&7;A-- >0;)s[e++]=n[(16256&r)+(h>>7)]>>>E,h+=I,r+=C}else{for(;A-- >0&&n;){let t;0!=(t=n[(16256&r)+(h>>7)]>>>E)&&(s[e]=t),e+=1,0!=(t=n[(16256&(r+=C))+((h+=I)>>7)]>>>E)&&(s[e]=t),e++,0!=(t=n[(16256&(r+=C))+((h+=I)>>7)]>>>E)&&(s[e]=t),e++,0!=(t=n[(16256&(r+=C))+((h+=I)>>7)]>>>E)&&(s[e]=t),e++,0!=(t=n[(16256&(r+=C))+((h+=I)>>7)]>>>E)&&(s[e]=t),e++,0!=(t=n[(16256&(r+=C))+((h+=I)>>7)]>>>E)&&(s[e]=t),e++,0!=(t=n[(16256&(r+=C))+((h+=I)>>7)]>>>E)&&(s[e]=t),e++,0!=(t=n[(16256&(r+=C))+((h+=I)>>7)]>>>E)&&(s[e]=t),e++,h=p,r=m,o+=c,l+=f,a+=u,o|=0,l|=0,g=(a|=0)>>14,0!==g&&(p=o/g|0,m=l/g|0,p<7?p=7:p>16256&&(p=16256)),I=p-h>>3,C=m-r>>3,h+=6291456&(d+=y),E=d>>23}for(A=i-t&7;A-- >0&&n;){let t;0!=(t=n[(16256&r)+(h>>7)]>>>E)&&(s[e]=t),e++,h+=I,r+=C}}};static Cv=(t,i,s,e,n)=>{if(this.i_&&(i>this.s_&&(i=this.s_),t<0&&(t=0)),t>=i)return;e+=t;let h=i-t>>2;if(0===this.alpha)for(;;){if(h--,h<0)for(h=i-t&3;;){if(h--,h<0)return;s[e++]=n}s[e++]=n,s[e++]=n,s[e++]=n,s[e++]=n}const r=this.alpha,o=256-this.alpha;for(n=((16711935&n)*o>>8&16711935)+((65280&n)*o>>8&65280);;){if(h--,h<0)for(h=i-t&3;;){if(h--,h<0)return;s[e++]=n+((16711935&s[e])*r>>8&16711935)+((65280&s[e])*r>>8&65280)}s[e++]=n+((16711935&s[e])*r>>8&16711935)+((65280&s[e])*r>>8&65280),s[e++]=n+((16711935&s[e])*r>>8&16711935)+((65280&s[e])*r>>8&65280),s[e++]=n+((16711935&s[e])*r>>8&16711935)+((65280&s[e])*r>>8&65280),s[e++]=n+((16711935&s[e])*r>>8&16711935)+((65280&s[e])*r>>8&65280)}};static mv=t=>{this.hv[t]&&this.nv&&(this.nv[this.rv++]=this.hv[t],this.hv[t]=null)};static Ev=t=>{if(this.ov[t]=this.Ip++,this.hv[t])return this.hv[t];let i;if(this.rv>0&&this.nv)i=this.nv[--this.rv],this.nv[this.rv]=null;else{let t=0,s=-1;for(let i=0;i>>3)&16316671,i[n+8192]=h-(h>>>2)&16316671,i[n+12288]=h-(h>>>2)-(h>>>3)&16316671}}else{if(64===s.width)for(let t=0;t<128;t++)for(let n=0;n<128;n++)i[n+(t<<7)]=e[s.aw[(n>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)i[t]=e[s.aw[t]];this.cv[t]=!1;for(let s=0;s<16384;s++){i[s]&=16316671;const e=i[s];0===e&&(this.cv[t]=!0),i[s+16384]=e-(e>>>3)&16316671,i[s+32768]=e-(e>>>2)&16316671,i[s+49152]=e-(e>>>2)-(e>>>3)&16316671}}return i}}},880:(t,i,s)=>{s.d(i,{r:()=>n});var e=s(7854);const n=async t=>{255!==t[0]&&(t[0]=255),URL.revokeObjectURL(e.LE.src),e.LE.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>e.LE.onload=()=>t())),e.SE.clearRect(0,0,e.xE.width,e.xE.height);const i=e.LE.naturalWidth,s=e.LE.naturalHeight;return e.xE.width=i,e.xE.height=s,e.SE.drawImage(e.LE,0,0),e.SE.getImageData(0,0,i,s)}},8665:(t,i,s)=>{s.d(i,{A:()=>f});var e=s(1069),n=s(8950),h=s(4583),r=s(6730),o=s(4474),l=s(3867);class a{Od=0;Ag=0;bv=0;Tv=-1;Ov=-1;Rv=-1;Sv=-1;Lv=-1;xv=-1;Mv=-1;kv=-1;Dv=-1;Fv=0;Nv=-1;Bv=-1;Pv=-1;data=null}class c{x=0;y=0;z=0;w=0}class f extends o.A{static metadata=null;static head=null;static Uv=null;static Wv=null;static Gv=null;static Hv=null;static Yv=null;static Vv=null;static Kv=null;static Xv=null;static jv=null;static zv=null;static Zv=null;static qv=null;static axis=null;static Jv=new l.ds(4096,!1);static $v=new l.ds(4096,!1);static Qv=new Int32Array(4096);static tb=new Int32Array(4096);static ib=new Int32Array(4096);static sb=new Int32Array(4096);static eb=new Int32Array(4096);static nb=new Int32Array(4096);static hb=new Int32Array(1500);static rb=new l.Kh(1500,512);static ob=new Int32Array(12);static lb=new l.Kh(12,2e3);static ab=new Int32Array(2e3);static cb=new Int32Array(2e3);static fb=new Int32Array(12);static ub=new Int32Array(10);static wb=new Int32Array(10);static yb=new Int32Array(10);static gh=0;static Ab=0;static _h=0;static pb=!1;static kl=0;static Dl=0;static mb=0;static gb=new Int32Array(1e3);static _b=!1;static ru(t){try{f.head=new e.A(t.read('ob_head.dat')),f.Uv=new e.A(t.read('ob_face1.dat')),f.Wv=new e.A(t.read('ob_face2.dat')),f.Gv=new e.A(t.read('ob_face3.dat')),f.Hv=new e.A(t.read('ob_face4.dat')),f.Yv=new e.A(t.read('ob_face5.dat')),f.Vv=new e.A(t.read('ob_point1.dat')),f.Kv=new e.A(t.read('ob_point2.dat')),f.Xv=new e.A(t.read('ob_point3.dat')),f.jv=new e.A(t.read('ob_point4.dat')),f.zv=new e.A(t.read('ob_point5.dat')),f.Zv=new e.A(t.read('ob_vertex1.dat')),f.qv=new e.A(t.read('ob_vertex2.dat')),f.axis=new e.A(t.read('ob_axis.dat')),f.head.af=0,f.Vv.af=0,f.Kv.af=0,f.Xv.af=0,f.jv.af=0,f.Zv.af=0,f.qv.af=0;const i=f.head.ou;f.metadata=new l.ds(i+100,null);let s=0,n=0,h=0,r=0,o=0,c=0,u=0;for(let t=0;t>7)<2?i=2:i>126&&(i=126),(65408&t)+i):(i<0?i=0:i>127&&(i=127),127-i)}static Td=(t,i,s)=>{const e=t.Od,n=t.Ag,h=t.bv;let r,o,a,u,d;if(i){r=new Int32Array(e);for(let i=0;i{const n=t.Od,h=t.Ag,r=t.bv;let o,l,a,c,u;if(e)o=t.Rd,l=t.Ld,a=t.Sd;else{o=new Int32Array(n),l=new Int32Array(n),a=new Int32Array(n);for(let i=0;i{const s=t.Od,e=t.Ag,n=t.bv,h=new Int32Array(s),r=new Int32Array(s),o=new Int32Array(s);for(let i=0;i{let s=!1,e=!1,n=!1,h=!1,r=0,o=0,l=0,a=-1;for(let c=0;c{let s=!1,e=!1,n=!1,h=!1,r=0,o=0,l=0,a=-1;for(let c=0;c{let o=-1;const l=t.Rd[i],a=t.Ld[i],c=t.Sd[i];for(let t=0;t{if(!f.metadata)throw new Error('cant loading model metadata!!!!!');const i=f.metadata[t];if(!i)throw console.log(`Error model:${t} not found!`),new Error('cant loading model metadata!!!!!');if(!(f.head&&f.Uv&&f.Wv&&f.Gv&&f.Hv&&f.Yv&&f.Vv&&f.Kv&&f.Xv&&f.jv&&f.zv&&f.Zv&&f.qv&&f.axis))throw new Error('cant loading model!!!!!');const s=i.Od,e=i.Ag,n=i.bv,h=new Int32Array(s),r=new Int32Array(s),o=new Int32Array(s),l=new Int32Array(e),a=new Int32Array(e),c=new Int32Array(e),u=new Int32Array(n),d=new Int32Array(n),w=new Int32Array(n);let y=null;i.Lv>=0&&(y=new Int32Array(s));let A=null;i.Dv>=0&&(A=new Int32Array(e));let p=null,m=0;i.Fv>=0?p=new Int32Array(e):m=-i.Fv-1;let g=null;i.Nv>=0&&(g=new Int32Array(e));let _=null;i.Bv>=0&&(_=new Int32Array(e));const I=new Int32Array(e);f.Vv.af=i.Tv,f.Kv.af=i.Ov,f.Xv.af=i.Rv,f.jv.af=i.Sv,f.zv.af=i.Lv;let C,E,v,b=0,T=0,O=0;for(let t=0;t{if(!f.metadata||!f.metadata[i])throw new Error('No model metadata');const s=f.metadata[i];if(s.data=t,!s.data.length)throw new Error('No model data');const n=s.Od,h=s.Ag,r=s.bv,o=new Int32Array(n),l=new Int32Array(n),a=new Int32Array(n),c=new Int32Array(h),u=new Int32Array(h),d=new Int32Array(h),w=new Int32Array(r),y=new Int32Array(r),A=new Int32Array(r);let p=null;s.Lv>=0&&(p=new Int32Array(n));let m=null;s.Dv>=0&&(m=new Int32Array(h));let g=null,_=0;s.Fv>=0?g=new Int32Array(h):_=-s.Fv-1;let I=null;s.Nv>=0&&(I=new Int32Array(h));let C=null;s.Bv>=0&&(C=new Int32Array(h));const E=new Int32Array(h),v=new e.A(s.data);v.af=s.Tv;const b=new e.A(s.data);b.af=s.Ov;const T=new e.A(s.data);T.af=s.Rv;const O=new e.A(s.data);O.af=s.Sv;const R=new e.A(s.data);R.af=s.Lv;let S,L,x,M=0,k=0,D=0;for(let t=0;tthis.Pd&&(this.Pd=-s),s>this.cg&&(this.cg=s);const n=i*i+e*e;n>this.fp&&(this.fp=n)}this.fp=Math.sqrt(this.fp)+.99|0,this.Mb=Math.sqrt(this.fp*this.fp+this.Pd*this.Pd)+.99|0,this.xb=this.Mb+(Math.sqrt(this.fp*this.fp+this.cg*this.cg)+.99|0)}xd(){this.Pd=0,this.cg=0;for(let t=0;tthis.Pd&&(this.Pd=-i),i>this.cg&&(this.cg=i)}this.Mb=Math.sqrt(this.fp*this.fp+this.Pd*this.Pd)+.99|0,this.xb=this.Mb+(Math.sqrt(this.fp*this.fp+this.cg*this.cg)+.99|0)}xa(){if(this.kb){const t=new Int32Array(256);let i=0;for(let s=0;si&&(i=e)}this.Fd=new l.ds(i+1,null);for(let s=0;s<=i;s++)this.Fd[s]=new Int32Array(t[s]),t[s]=0;let s=0;for(;si&&(i=e)}this.Dd=new l.ds(i+1,null);for(let s=0;s<=i;s++)this.Dd[s]=new Int32Array(t[s]),t[s]=0;let s=0;for(;sl;)l=s[o++];h&&h.types&&e.x&&e.y&&e.z&&h.labels&&(i!==l||0===h.types[i])&&this.Pb(e.x[t],e.y[t],e.z[t],h.labels[i],h.types[i])}f.gh=0,f.Ab=0,f._h=0,o=0,l=s[o++];for(let t=0;tl;)l=s[o++];h&&h.types&&n.x&&n.y&&n.z&&h.labels&&(i===l||0===h.types[i])&&this.Pb(n.x[t],n.y[t],n.z[t],h.labels[i],h.types[i])}}else this.Ma(t)}Ma(t){if(!this.Fd||-1===t||!r.A.So[t])return;const i=r.A.So[t],s=i.TE;f.gh=0,f.Ab=0,f._h=0;for(let t=0;t>16;this.Sd[t]=this.Ld[t]*i+this.Sd[t]*s>>16,this.Ld[t]=e}}translate(t,i,s){for(let e=0;e>8;if(this.Eb&&this.vb&&this.bb||(this.Eb=new Int32Array(this.Ag),this.vb=new Int32Array(this.Ag),this.bb=new Int32Array(this.Ag)),!this.sg){this.sg=new l.ds(this.Od,null);for(let t=0;t8192||p>8192||m>8192||A<-8192||p<-8192||m<-8192;)A>>=1,p>>=1,m>>=1;let g=0|Math.sqrt(A*A+p*p+m*m);if(g<=0&&(g=1),A=256*A/g|0,p=256*p/g|0,m=256*m/g|0,this.yg&&1&this.yg[i]){const h=t+((s*A+e*p+n*m)/(r+(r/2|0))|0);this.Eu&&(this.Eb[i]=f.Cb(this.Eu[i],h,this.yg[i]))}else{let t=this.sg[h];t&&(t.x+=A,t.y+=p,t.z+=m,t.w++),t=this.sg[o],t&&(t.x+=A,t.y+=p,t.z+=m,t.w++),t=this.sg[l],t&&(t.x+=A,t.y+=p,t.z+=m,t.w++)}}if(h)this.hg(t,r,s,e,n);else{this.ag=new l.ds(this.Od,null);for(let t=0;t>16;for(let e=0;e>16,_=_*w-g*d>>16,g=m),0!==t&&(m=_*a-I*l>>16,I=_*l+I*a>>16,_=m),0!==i&&(m=I*c+g*u>>16,I=I*u-g*c>>16,g=m),g+=n,_+=r,I+=o,m=_*A-I*y>>16,I=_*y+I*A>>16,_=m,f.Qv&&f.tb&&f.ib&&(f.ib[e]=I-p,f.Qv[e]=h.A.ha+((g<<9)/I|0),f.tb[e]=h.A.ra+((_<<9)/I|0)),this.bv>0&&f.sb&&f.eb&&f.nb&&(f.sb[e]=g,f.eb[e]=_,f.nb[e]=I)}try{this.Gb(!1,!1,0)}catch(t){}}draw(t,i,s,e,r,o,l,a,c){const u=a*r-o*e>>16,d=l*i+u*s>>16,w=this.fp*s>>16,y=d+w;if(y<=50||d>=3500)return;const A=a*e+o*r>>16;let p=A-this.fp<<9;if((p/y|0)>=n.A.jE)return;let m=A+this.fp<<9;if((m/y|0)<=-n.A.jE)return;const g=l*s-u*i>>16,_=this.fp*i>>16;let I=g+_<<9;if((I/y|0)<=-n.A.zE)return;let C=g-(_+(this.Pd*s>>16))<<9;if((C/y|0)>=n.A.zE)return;let E=d-(w+(this.Pd*i>>16))<=50,v=!1;if(c>0&&f.pb){let t=d-w;t<=50&&(t=50),A>0?(p=p/y|0,m=m/t|0):(m=m/y|0,p=p/t|0),g>0?(C=C/y|0,I=I/t|0):(I=I/y|0,C=C/t|0);const i=f.kl-h.A.ha,s=f.Dl-h.A.ra;i>p&&iC&&s>16,w=w*R-c*O>>16,c=h),c+=o,u+=l,w+=a,h=w*e+c*r>>16,w=w*r-c*e>>16,c=h,h=u*s-w*i>>16,w=u*i+w*s>>16,u=h,f.ib&&(f.ib[n]=w-d),w>=50&&f.Qv&&f.tb?(f.Qv[n]=b+((c<<9)/w|0),f.tb[n]=T+((u<<9)/w|0)):f.Qv&&(f.Qv[n]=-5e3,E=!0),(E||this.bv>0)&&f.sb&&f.eb&&f.nb&&(f.sb[n]=c,f.eb[n]=u,f.nb[n]=w)}try{this.Gb(E,v,c)}catch(t){}}Gb(t,i,s,e=!1){f._b&&(this.Nb=-1,this.Bb=-1);for(let t=0;tn.A.s_||a>n.A.s_||c>n.A.s_),f.rb&&f.hb){const t=((y+A+p)/3|0)+this.Mb;f.rb[t][f.hb[t]++]=e,f._b&&this.Hb(f.kl,f.Dl,u,d,w,l,a,c)&&this.Bb=0;t--){const i=f.hb[t];if(!(i<=0)&&f.rb){const s=f.rb[t];for(let t=0;t=0;t--){const i=f.hb[t];if(i>0&&f.rb){const s=f.rb[t];for(let e=0;e0||f.ob[2]>0)&&(h=(f.fb[1]+f.fb[2])/(f.ob[1]+f.ob[2])|0);let r=0;f.ob&&f.fb&&(f.ob[3]>0||f.ob[4]>0)&&(r=(f.fb[3]+f.fb[4])/(f.ob[3]+f.ob[4])|0);let o=0;if(f.ob&&f.fb&&(f.ob[6]>0||f.ob[8]>0)&&(o=(f.fb[6]+f.fb[8])/(f.ob[6]+f.ob[8])|0),f.ob&&f.lb){let t,i=0,s=f.ob[10],n=f.lb[10],l=f.ab;i===s&&(i=0,s=f.ob[11],n=f.lb[11],l=f.cb),t=ih;)this.Yb(n[i++],e),i===s&&n!==f.lb[11]&&(i=0,s=f.ob[11],n=f.lb[11],l=f.cb),t=ir;)this.Yb(n[i++],e),i===s&&n!==f.lb[11]&&(i=0,s=f.ob[11],n=f.lb[11],l=f.cb),t=io;)this.Yb(n[i++],e),i===s&&n!==f.lb[11]&&(i=0,s=f.ob[11],n=f.lb[11],l=f.cb),t=i>2,r=this.Rb[i],o=this.Sb[i],l=this.Lb[i];h.A.c_(f.Qv[s],f.Qv[e],f.Qv[n],f.tb[s],f.tb[e],f.tb[n],this.Eb[t],this.vb[t],this.bb[t],f.sb[r],f.eb[r],f.nb[r],f.sb[o],f.sb[l],f.eb[o],f.eb[l],f.nb[o],f.nb[l],this.Eu[t])}else if(3===r&&this.yg&&this.Eu&&this.Eb&&f.Qv&&f.tb&&f.sb&&f.eb&&f.nb){const i=this.yg[t]>>2,r=this.Rb[i],o=this.Sb[i],l=this.Lb[i];h.A.c_(f.Qv[s],f.Qv[e],f.Qv[n],f.tb[s],f.tb[e],f.tb[n],this.Eb[t],this.Eb[t],this.Eb[t],f.sb[r],f.eb[r],f.nb[r],f.sb[o],f.sb[l],f.eb[o],f.eb[l],f.nb[o],f.nb[l],this.Eu[t])}}Vb(t,i=!1){let s=0;if(f.nb){const i=h.A.ha,e=h.A.ra,n=this.pg[t],r=this.mg[t],o=this.gg[t],l=f.nb[n],a=f.nb[r],c=f.nb[o];if(l>=50&&f.Qv&&f.tb&&this.Eb)f.ub[s]=f.Qv[n],f.wb[s]=f.tb[n],f.yb[s++]=this.Eb[t];else if(f.sb&&f.eb&&this.Eb){const u=f.sb[n],d=f.eb[n],w=this.Eb[t];if(c>=50&&this.bb){const n=(50-l)*h.A.iv[c-l];f.ub[s]=i+((u+((f.sb[o]-u)*n>>16)<<9)/50|0),f.wb[s]=e+((d+((f.eb[o]-d)*n>>16)<<9)/50|0),f.yb[s++]=w+((this.bb[t]-w)*n>>16)}if(a>=50&&this.vb){const n=(50-l)*h.A.iv[a-l];f.ub[s]=i+((u+((f.sb[r]-u)*n>>16)<<9)/50|0),f.wb[s]=e+((d+((f.eb[r]-d)*n>>16)<<9)/50|0),f.yb[s++]=w+((this.vb[t]-w)*n>>16)}}if(a>=50&&f.Qv&&f.tb&&this.vb)f.ub[s]=f.Qv[r],f.wb[s]=f.tb[r],f.yb[s++]=this.vb[t];else if(f.sb&&f.eb&&this.vb){const u=f.sb[r],d=f.eb[r],w=this.vb[t];if(l>=50&&this.Eb){const r=(50-a)*h.A.iv[l-a];f.ub[s]=i+((u+((f.sb[n]-u)*r>>16)<<9)/50|0),f.wb[s]=e+((d+((f.eb[n]-d)*r>>16)<<9)/50|0),f.yb[s++]=w+((this.Eb[t]-w)*r>>16)}if(c>=50&&this.bb){const n=(50-a)*h.A.iv[c-a];f.ub[s]=i+((u+((f.sb[o]-u)*n>>16)<<9)/50|0),f.wb[s]=e+((d+((f.eb[o]-d)*n>>16)<<9)/50|0),f.yb[s++]=w+((this.bb[t]-w)*n>>16)}}if(c>=50&&f.Qv&&f.tb&&this.bb)f.ub[s]=f.Qv[o],f.wb[s]=f.tb[o],f.yb[s++]=this.bb[t];else if(f.sb&&f.eb&&this.bb){const u=f.sb[o],d=f.eb[o],w=this.bb[t];if(a>=50&&this.vb){const n=(50-c)*h.A.iv[a-c];f.ub[s]=i+((u+((f.sb[r]-u)*n>>16)<<9)/50|0),f.wb[s]=e+((d+((f.eb[r]-d)*n>>16)<<9)/50|0),f.yb[s++]=w+((this.vb[t]-w)*n>>16)}if(l>=50&&this.Eb){const r=(50-c)*h.A.iv[l-c];f.ub[s]=i+((u+((f.sb[n]-u)*r>>16)<<9)/50|0),f.wb[s]=e+((d+((f.eb[n]-d)*r>>16)<<9)/50|0),f.yb[s++]=w+((this.Eb[t]-w)*r>>16)}}}const e=f.ub[0],r=f.ub[1],o=f.ub[2],l=f.wb[0],a=f.wb[1],c=f.wb[2];if(!((e-r)*(c-a)-(l-a)*(o-r)<=0))if(h.A.i_=!1,3===s){let s;if((e<0||r<0||o<0||e>n.A.s_||r>n.A.s_||o>n.A.s_)&&(h.A.i_=!0),s=this.yg?3&this.yg[t]:0,i)h.A.qE(e,r,l,a,f.yb[0]),h.A.qE(r,o,a,c,f.yb[1]),h.A.qE(o,e,c,l,f.yb[2]);else if(0===s)h.A.r_(e,r,o,l,a,c,f.yb[0],f.yb[1],f.yb[2]);else if(1===s&&this.Eb)h.A.Iv(e,r,o,l,a,c,h.A.palette[this.Eb[t]]);else if(2===s&&this.yg&&this.Eu&&f.sb&&f.eb&&f.nb){const i=this.yg[t]>>2,s=this.Rb[i],n=this.Sb[i],u=this.Lb[i];h.A.c_(e,r,o,l,a,c,f.yb[0],f.yb[1],f.yb[2],f.sb[s],f.eb[s],f.nb[s],f.sb[n],f.sb[u],f.eb[n],f.eb[u],f.nb[n],f.nb[u],this.Eu[t])}else if(3===s&&this.yg&&this.Eu&&this.Eb&&f.sb&&f.eb&&f.nb){const i=this.yg[t]>>2,s=this.Rb[i],n=this.Sb[i],u=this.Lb[i];h.A.c_(e,r,o,l,a,c,this.Eb[t],this.Eb[t],this.Eb[t],f.sb[s],f.eb[s],f.nb[s],f.sb[n],f.sb[u],f.eb[n],f.eb[u],f.nb[n],f.nb[u],this.Eu[t])}}else if(4===s){let s;if((e<0||r<0||o<0||e>n.A.s_||r>n.A.s_||o>n.A.s_||f.ub[3]<0||f.ub[3]>n.A.s_)&&(h.A.i_=!0),s=this.yg?3&this.yg[t]:0,i)h.A.qE(e,r,l,a,f.yb[0]),h.A.qE(r,o,a,c,f.yb[1]),h.A.qE(o,f.ub[3],c,f.wb[3],f.yb[2]),h.A.qE(f.ub[3],e,f.wb[3],l,f.yb[3]);else if(0===s)h.A.r_(e,r,o,l,a,c,f.yb[0],f.yb[1],f.yb[2]),h.A.r_(e,o,f.ub[3],l,c,f.wb[3],f.yb[0],f.yb[2],f.yb[3]);else if(1===s){if(this.Eb){const i=h.A.palette[this.Eb[t]];h.A.Iv(e,r,o,l,a,c,i),h.A.Iv(e,o,f.ub[3],l,c,f.wb[3],i)}}else if(2===s&&this.yg&&this.Eu&&f.sb&&f.eb&&f.nb){const i=this.yg[t]>>2,s=this.Rb[i],n=this.Sb[i],u=this.Lb[i];h.A.c_(e,r,o,l,a,c,f.yb[0],f.yb[1],f.yb[2],f.sb[s],f.eb[s],f.nb[s],f.sb[n],f.sb[u],f.eb[n],f.eb[u],f.nb[n],f.nb[u],this.Eu[t]),h.A.c_(e,o,f.ub[3],l,c,f.wb[3],f.yb[0],f.yb[2],f.yb[3],f.sb[s],f.eb[s],f.nb[s],f.sb[n],f.sb[u],f.eb[n],f.eb[u],f.nb[n],f.nb[u],this.Eu[t])}else if(3===s&&this.yg&&this.Eu&&this.Eb&&f.sb&&f.eb&&f.nb){const i=this.yg[t]>>2,s=this.Rb[i],n=this.Sb[i],u=this.Lb[i];h.A.c_(e,r,o,l,a,c,this.Eb[t],this.Eb[t],this.Eb[t],f.sb[s],f.eb[s],f.nb[s],f.sb[n],f.sb[u],f.eb[n],f.eb[u],f.nb[n],f.nb[u],this.Eu[t]),h.A.c_(e,o,f.ub[3],l,c,f.wb[3],this.Eb[t],this.Eb[t],this.Eb[t],f.sb[s],f.eb[s],f.nb[s],f.sb[n],f.sb[u],f.eb[n],f.eb[u],f.nb[n],f.nb[u],this.Eu[t])}}}Pb(t,i,s,e,n){if(!e)return;const r=e.length;if(0===n){let n=0;f.gh=0,f.Ab=0,f._h=0;for(let t=0;t0?(f.gh=(f.gh/n|0)+t,f.Ab=(f.Ab/n|0)+i,f._h=(f._h/n|0)+s):(f.gh=t,f.Ab=i,f._h=s)}else if(1===n)for(let n=0;n=this.Fd.length)continue;const r=this.Fd[h];if(r)for(let e=0;e=this.Fd.length)continue;const o=this.Fd[r];if(o)for(let e=0;e>16;this.Ld[n]=this.Ld[n]*u-this.Rd[n]*c>>16,this.Rd[n]=t}if(0!==r){c=h.A.sin[r],u=h.A.cos[r];const t=this.Ld[n]*u-this.Sd[n]*c>>16;this.Sd[n]=this.Ld[n]*c+this.Sd[n]*u>>16,this.Ld[n]=t}if(0!==l){c=h.A.sin[l],u=h.A.cos[l];const t=this.Sd[n]*c+this.Rd[n]*u>>16;this.Sd[n]=this.Sd[n]*u-this.Rd[n]*c>>16,this.Rd[n]=t}this.Rd[n]+=f.gh,this.Ld[n]+=f.Ab,this.Sd[n]+=f._h}}else if(3===n)for(let n=0;n=this.Fd.length)continue;const r=this.Fd[h];if(r)for(let e=0;e=this.Dd.length)continue;const n=this.Dd[s];if(n)for(let i=0;i255&&(this.Ob[s]=255)}}}Wb(){this.Pd=0,this.fp=0,this.cg=0,this.fg=999999,this.ug=-999999,this.wg=-99999,this.dg=99999;for(let t=0;tthis.ug&&(this.ug=i),ethis.wg&&(this.wg=e),-s>this.Pd&&(this.Pd=-s),s>this.cg&&(this.cg=s);const n=i*i+e*e;n>this.fp&&(this.fp=n)}this.fp=0|Math.sqrt(this.fp),this.Mb=0|Math.sqrt(this.fp*this.fp+this.Pd*this.Pd),this.xb=this.Mb+(0|Math.sqrt(this.fp*this.fp+this.cg*this.cg))}Hb(t,i,s,e,n,h,r,o){return!(is&&i>e&&i>n)&&(!(t{s.d(i,{A:()=>o});var e=s(8950),n=s(1069),h=s(4474),r=s(880);class o extends h.A{aw;width;height;Xb;jb;Nl;nw;constructor(t,i){super(),this.aw=new Int32Array(t*i),this.width=this.Nl=t,this.height=this.nw=i,this.Xb=this.jb=0}static zb=async(t,i)=>{const s=t.read(i+'.dat');if(!s)throw new Error(`${i} jpeg not found!`);const e=await(0,r.r)(s),n=new o(e.width,e.height),h=new Uint32Array(e.data.buffer),l=n.aw;for(let t=0;t>24&255)<<24|(255&i)<<16|(i>>8&255)<<8|i>>16&255}return n};static Cu=(t,i,s=0)=>{const e=new n.A(t.read(i+'.dat')),h=new n.A(t.read('index.dat'));h.af=e.ou;const r=h.ou,l=h.ou,a=[],c=h.au-1;for(let t=0;te.length||h.af>h.length)throw new Error;const f=h.au,u=h.au,d=h.ou,w=h.ou,y=new o(d,w);y.Xb=f,y.jb=u,y.Nl=r,y.nw=l;const A=h.au;if(0===A){const t=y.width*y.height;for(let i=0;ie.A.bottom&&(h-=i+h-e.A.bottom),te.A.right){const i=t+r-e.A.right;r-=i,l+=i,o+=i}r>0&&h>0&&this.Zb(r,h,this.aw,n,l,e.A.aw,s,o)}Fl(t,i,s){i|=0,s|=0;let n=(i+=this.Xb)+(s+=this.jb)*e.A.cw,h=0,r=this.height,o=this.width,l=e.A.cw-o,a=0;if(se.A.bottom&&(r-=s+r-e.A.bottom),ie.A.right){const t=i+o-e.A.right;o-=t,a+=t,l+=t}o>0&&r>0&&this.qb(o,r,this.aw,h,a,e.A.aw,n,l,t)}Jb(t,i){t|=0,i|=0;let s=(t+=this.Xb)+(i+=this.jb)*e.A.cw,n=0,h=this.height,r=this.width,o=e.A.cw-r,l=0;if(ie.A.bottom&&(h-=i+h-e.A.bottom),te.A.right){const i=t+r-e.A.right;r-=i,l+=i,o+=i}r>0&&h>0&&this.$b(r,h,this.aw,n,l,e.A.aw,s,o)}Qb(){const t=this.aw,i=this.width,s=this.height;for(let e=0;e>16&255;h+=t,h<1?h=1:h>255&&(h=255);let r=n>>8&255;r+=i,r<1?r=1:r>255&&(r=255);let o=255&n;o+=s,o<1?o=1:o>255&&(o=255),this.aw[e]=(h<<16)+(r<<8)+o}}}Iw(t,i,s,n){t|=0,i|=0,s|=0,n|=0;try{const h=this.width;let r=0,o=0;const l=this.Nl,a=this.nw,c=(l<<16)/s|0,f=(a<<16)/n|0;t+=(this.Xb*s+l-1)/l|0,i+=(this.jb*n+a-1)/a|0,this.Xb*s%l!=0&&(r=(l-this.Xb*s%l<<16)/s|0),this.jb*n%a!=0&&(o=(a-this.jb*n%a<<16)/n|0),s=s*(this.width-(r>>16))/l|0,n=n*(this.height-(o>>16))/a|0;let u=t+i*e.A.cw,d=e.A.cw-s;if(ie.A.bottom&&(n-=i+n-e.A.bottom),te.A.right){const i=t+s-e.A.right;s-=i,d+=i}this.scale(s,n,this.aw,r,o,e.A.aw,d,u,h,c,f)}catch(t){console.error('error in sprite clipping routine')}}iT(t,i,s,n,h,r,o,l,a,c){t|=0,i|=0,s|=0,n|=0;try{const f=-s/2|0,u=-n/2|0,d=65536*Math.sin(a/326.11)|0,w=65536*Math.cos(a/326.11)|0,y=d*c>>8,A=w*c>>8;let p=(o<<16)+u*y+f*A,m=u*A-f*y+(l<<16),g=t+i*e.A.cw;for(let t=0;t>16)+(o>>16)*this.width],n+=A,o-=y;p+=y,m+=A,g+=e.A.cw}}catch(t){}}sT(t,i,s){t|=0,i|=0;let n=(t+=this.Xb)+(i+=this.jb)*e.A.cw,h=0,r=this.height,o=this.width,l=e.A.cw-o,a=0;if(ie.A.bottom&&(r-=i+r-e.A.bottom),te.A.right){const i=t+o-e.A.right;o-=i,a+=i,l+=i}o>0&&r>0&&this.eT(o,r,this.aw,a,h,e.A.aw,n,l,s.aw)}scale(t,i,s,e,n,h,r,o,l,a,c){try{const f=e;for(let u=-i;u<0;u++){const i=(n>>16)*l;for(let n=-t;n<0;n++){const t=s[(e>>16)+i];0===t?o++:h[o++]=t,e+=a}n+=c,e=f,o+=r}}catch(t){console.error('error in plot_scale')}}$b(t,i,s,e,n,h,r,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++)h[r++]=s[e++],h[r++]=s[e++],h[r++]=s[e++],h[r++]=s[e++];for(let i=t;i<0;i++)h[r++]=s[e++];r+=o,e+=n}}qb(t,i,s,e,n,h,r,o,l){const a=256-l;for(let c=-i;c<0;c++){for(let i=-t;i<0;i++){const t=s[e++];if(0===t)r++;else{const i=h[r];h[r++]=((16711935&t)*l+(16711935&i)*a&4278255360)+((65280&t)*l+(65280&i)*a&16711680)>>8}}r+=o,e+=n}}Zb(t,i,s,e,n,h,r,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=s[e++];0===t?r++:h[r++]=t,t=s[e++],0===t?r++:h[r++]=t,t=s[e++],0===t?r++:h[r++]=t,t=s[e++],0===t?r++:h[r++]=t}for(let i=t;i<0;i++){const t=s[e++];0===t?r++:h[r++]=t}r+=o,e+=n}}eT(t,i,s,e,n,h,r,o,l){const a=-(t>>2);t=-(3&t);for(let c=-i;c<0;c++){for(let t=a;t<0;t++){let t=s[n++];0!==t&&0===l[r]?h[r++]=t:r++,t=s[n++],0!==t&&0===l[r]?h[r++]=t:r++,t=s[n++],0!==t&&0===l[r]?h[r++]=t:r++,t=s[n++],0!==t&&0===l[r]?h[r++]=t:r++}for(let i=t;i<0;i++){const t=s[n++];0!==t&&0===l[r]?h[r++]=t:r++}r+=o,n+=e}}}},1673:(t,i,s)=>{s.d(i,{A:()=>r});var e=s(8950),n=s(1069),h=s(4474);class r extends h.A{aw;width;height;Xb;jb;Nl;nw;palette;constructor(t,i,s){super(),this.aw=new Int8Array(t*i),this.width=this.Nl=t,this.height=this.nw=i,this.Xb=this.jb=0,this.palette=s}static Cu=(t,i,s=0)=>{const e=new n.A(t.read(i+'.dat')),h=new n.A(t.read('index.dat'));h.af=e.ou;const o=h.ou,l=h.ou,a=h.au,c=new Int32Array(a);for(let t=1;te.length||h.af>h.length)throw new Error;const f=h.au,u=h.au,d=h.ou,w=h.ou,y=new r(d,w,c);y.Xb=f,y.jb=u,y.Nl=o,y.nw=l;const A=y.aw,p=h.au;if(0===p){const t=y.width*y.height;for(let i=0;ie.A.bottom&&(h-=i+h-e.A.bottom),te.A.right){const i=t+r-e.A.right;r-=i,l+=i,o+=i}r>0&&h>0&&this.nT(r,h,this.aw,n,l,e.A.aw,s,o)}Qb(){const t=this.aw,i=this.width,s=this.height;for(let e=0;e>16&255;n+=t,n<0?n=0:n>255&&(n=255);let h=this.palette[e]>>8&255;h+=i,h<0?h=0:h>255&&(h=255);let r=255&this.palette[e];r+=s,r<0?r=0:r>255&&(r=255),this.palette[e]=(n<<16)+(h<<8)+r}}yv(){this.Nl|=0,this.nw|=0,this.Nl/=2,this.nw/=2,this.Nl|=0,this.nw|=0;const t=new Int8Array(this.Nl*this.nw);let i=0;for(let s=0;s>1)+(s+this.jb>>1)*this.Nl]=this.aw[i++];this.aw=t,this.width=this.Nl,this.height=this.nw,this.Xb=0,this.jb=0}Iw(){if(this.width===this.Nl&&this.height===this.nw)return;const t=new Int8Array(this.Nl*this.nw);let i=0;for(let s=0;s>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=s[e++];0===t?r++:h[r++]=this.palette[255&t],t=s[e++],0===t?r++:h[r++]=this.palette[255&t],t=s[e++],0===t?r++:h[r++]=this.palette[255&t],t=s[e++],0===t?r++:h[r++]=this.palette[255&t]}for(let i=t;i<0;i++){const t=s[e++];0===t?r++:h[r++]=this.palette[255&t]}r+=o,e+=n}}clip(t,i,s,n){try{const h=this.width;this.height;let r=0,o=0;const l=this.Nl,a=this.nw,c=(l<<16)/s|0,f=(a<<16)/n|0;t=t+(this.Xb*s+l-1)/l|0,i=i+(this.jb*n+a-1)/a|0,this.Xb*s%l!=0&&(r=(l-this.Xb*s%l<<16)/s|0),this.jb*n%a!=0&&(o=(a-this.jb*n%a<<16)/n|0),s=s*(this.width-(r>>16))/l|0,n=n*(this.height-(o>>16))/a|0;let u,d=t+i*e.A.cw,w=e.A.cw-s;ie.A.bottom&&(n-=i+n-e.A.bottom),te.A.right&&(u=t+s-e.A.right,s-=u,w+=u),this.hT(e.A.aw,this.aw,this.palette,r,o,d,w,s,n,c,f,h)}catch(t){console.log('error in sprite clipping routine')}}hT(t,i,s,e,n,h,r,o,l,a,c,f){try{const u=e;for(let d=-l;d<0;d++){const l=(n>>16)*f;for(let n=-o;n<0;n++){const n=i[(e>>16)+l];0==n?h++:t[h++]=s[255&n],e+=a}n+=c,e=u,h+=r}}catch(t){console.log('error in plot_scale')}}}},2682:(t,i,s)=>{s.d(i,{A:()=>l});var e=s(8950),n=s(1069),h=s(4474);class r{seed;constructor(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}rT(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}oT(){return this.next(32)}next(t){return this.seed=0x5deece66dn*this.seed+0xbn&(1n<<48n)-1n,Number(this.seed)>>>48-t}}var o=s(9298);class l extends h.A{static lT='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!"£$%^&*()-_=+[{]};:\'@#~,<.>/?\\| ';static aT=[];static{const t=navigator.userAgent.includes('Capacitor');for(let i=0;i<256;i++){let s=l.lT.indexOf(String.fromCharCode(i));t&&s>=63&&s--,-1===s&&(s=74),l.aT[i]=s}}cT=[];fT=new Int32Array(94);uT=new Int32Array(94);dT=new Int32Array(94);wT=new Int32Array(94);yT=new Int32Array(95);AT=new Int32Array(256);random=new r(BigInt(Date.now()));height=0;static Cu=(t,i)=>{const s=new n.A(t.read(i+'.dat')),e=new n.A(t.read('index.dat'));e.af=s.ou+4;const h=e.au;h>0&&(e.af+=3*(h-1));const r=new l;for(let t=0;t<94;t++){r.dT[t]=e.au,r.wT[t]=e.au;const i=r.fT[t]=e.ou,n=r.uT[t]=e.ou,h=e.au,o=i*n;if(r.cT[t]=new Int8Array(o),0===h)for(let e=0;er.height&&(r.height=n),r.dT[t]=1,r.yT[t]=i+2;{let s=0;for(let e=n/7|0;e=e.A.bottom&&(h-=s+h+1-e.A.bottom),i=e.A.right){const t=i+n+1-e.A.right;n-=t,a+=t,l+=t}n>0&&h>0&&this.bT(n,h,t,c,a,e.A.aw,o,l,r)}CT(t,i,s,n,h,r,o){s|=0,n|=0;let l=(t|=0)+(i|=0)*e.A.cw,a=e.A.cw-s,c=0,f=0;if(i=e.A.bottom&&(n-=i+n+1-e.A.bottom),t=e.A.right){const i=t+s+1-e.A.right;s-=i,c+=i,a+=i}s>0&&n>0&&this.TT(s,n,e.A.aw,l,a,o,f,c,h,r)}bT(t,i,s,e,n,h,r,o,l){const a=-((t|=0)>>2);t=-(3&t);for(let c=-(i|=0);c<0;c++){for(let t=a;t<0;t++)0===s[e++]?r++:h[r++]=l,0===s[e++]?r++:h[r++]=l,0===s[e++]?r++:h[r++]=l,0===s[e++]?r++:h[r++]=l;for(let i=t;i<0;i++)0===s[e++]?r++:h[r++]=l;r+=o,e+=n}}TT(t,i,s,e,n,h,r,o,l,a){t|=0;const c=((16711935&l)*a&4278255360)+((65280&l)*a&16711680)>>8,f=256-a;for(let l=-(i|=0);l<0;l++){for(let i=-t;i<0;i++)if(0===h[r++])e++;else{const t=s[e];s[e++]=(((16711935&t)*f&4278255360)+((65280&t)*f&16711680)>>8)+c}e+=n,r+=o}}mT(t){return'red'===t?o.A.RED:'gre'===t?o.A.GREEN:'blu'===t?o.A.BLUE:'yel'===t?o.A.Wl:'cya'===t?o.A.ME:'mag'===t?o.A.sp:'whi'===t?o.A._l:'bla'===t?o.A.Ul:'lre'===t?o.A.kE:'dre'===t?o.A.DE:'dbl'===t?o.A.FE:'or1'===t?o.A.NE:'or2'===t?o.A.BE:'or3'===t?o.A.PE:'gr1'===t?o.A.UE:'gr2'===t?o.A.WE:'gr3'===t?o.A.GE:o.A.Ul}split(t,i){if(0===t.length)return[t];const s=[];for(;t.length>0;){if(this.gT(t)<=i&&-1===t.indexOf('|')){s.push(t);break}let e=t.length;for(let s=0;si)break;e=s}else if('|'===t[s]){e=s;break}s.push(t.substring(0,e)),t=t.substring(e+1)}return s}}},1183:(t,i,s)=>{s.d(i,{A:()=>h});var e=s(8950),n=s(7854);class h{OT;width;height;RT;ST;aw;constructor(t,i,s=n.zo){this.RT=s,this.OT=this.RT.getImageData(0,0,t,i),this.ST=new Uint32Array(this.OT.data.buffer),this.aw=new Int32Array(t*i),this.width=t,this.height=i,this.bind()}clear(){this.aw.fill(0)}bind(){e.A.bind(this.aw,this.width,this.height)}draw(t,i){this.#t(),this.RT.putImageData(this.OT,t,i)}#t(){const t=this.aw.length,i=this.aw,s=this.ST;for(let e=0;e>16&255|(t>>8&255)<<8|(255&t)<<16|4278190080}}}},4544:(t,i,s)=>{s.d(i,{A:()=>e});class e{db;constructor(t){t.onerror=this.onerror,t.onclose=this.onclose,this.db=t}static openDatabase=async()=>await new Promise(((t,i)=>{const s=indexedDB.open('lostcity',1);s.onsuccess=i=>{const s=i.target;console.log('database success!'),t(s.result)},s.onupgradeneeded=t=>{t.target.result.createObjectStore('cache')},s.onerror=t=>{const s=t.target;console.error('database error!: ',s.error),i(s.result)}}));Po=async t=>await new Promise((i=>{const s=this.db.transaction('cache','readonly').objectStore('cache').get(t);s.onsuccess=()=>{i(s.result)},s.onerror=t=>{i(void 0)}}));Yo=async(t,i)=>await new Promise(((s,e)=>{const n=this.db.transaction('cache','readwrite').objectStore('cache').put(i,t);n.onsuccess=()=>{s()},n.onerror=t=>{e()}}));onclose=t=>{console.log('database close!')};onerror=t=>{console.log('database error!')};LT=t=>{const i=t.trim();let s=0;for(let t=0;t='A'&&e<='Z'?s+=e.charCodeAt(0)+1-65:e>='a'&&e<='z'?s+=e.charCodeAt(0)+1-97:e>='0'&&e<='9'&&(s+=e.charCodeAt(0)+27-48)}return s}}},2901:(t,i,s)=>{s.d(i,{A:()=>h});var e=s(1069),n=s(1908);class h{static LT=t=>{let i=0;t=t.toUpperCase();for(let s=0;s=this.MT)return null;if(this.BT[t])return this.BT[t];const i=this.NT[t],s=i+this.FT[t];if(this.xT){const e=Uint8Array.from(this.buffer.subarray(i,i+s));return this.BT[t]=e,e}{const i=Uint8Array.from(n.A.read(this.DT[t],this.buffer,this.FT[t],this.NT[t]));return this.BT[t]=i,i}}}},1069:(t,i,s)=>{s.d(i,{A:()=>r});var e=s(9234),n=s(6666),h=s(4474);class r extends h.A{static UT=3988292384;static WT=new Int32Array(256);static GT=new Uint32Array(33);static HT=new n.A;static YT=new n.A;static VT=new n.A;static KT=0;static XT=0;static jT=0;static{for(let t=0;t<32;t++)r.GT[t]=(1<>>=1:i=i>>>1^r.UT;r.WT[t]=i}}static Uo=t=>{let i=4294967295;for(let s=0;s>>8^r.WT[255&(i^t[s])];return~i};view;data;af=0;zT=0;random=null;constructor(t){if(!t)throw new Error('Input src packet array was null!');super(),t instanceof Int8Array?this.data=new Uint8Array(t):this.data=t,this.view=new DataView(this.data.buffer,this.data.byteOffset,this.data.byteLength)}get length(){return this.view.byteLength}get available(){return this.length-this.af}static Pt=t=>{let i=null;return 0===t&&r.KT>0?(r.KT--,i=r.HT.Bg()):1===t&&r.XT>0?(r.XT--,i=r.YT.Bg()):2===t&&r.jT>0&&(r.jT--,i=r.VT.Bg()),i?(i.af=0,i):new r(0===t?new Uint8Array(100):1===t?new Uint8Array(5e3):new Uint8Array(3e4))};release(){this.af=0,100===this.view.byteLength&&r.KT<1e3?(r.HT.MA(this),r.KT++):5e3===this.view.byteLength&&r.XT<250?(r.YT.MA(this),r.XT++):3e4===this.view.byteLength&&r.jT<50&&(r.VT.MA(this),r.jT++)}get au(){return this.view.getUint8(this.af++)}get bd(){return this.view.getInt8(this.af++)}get ou(){const t=this.view.getUint16(this.af);return this.af+=2,t}get fu(){const t=this.view.getInt16(this.af);return this.af+=2,t}get Gu(){const t=this.view.getUint8(this.af++)<<16|this.view.getUint16(this.af);return this.af+=2,t}get Ko(){const t=this.view.getInt32(this.af);return this.af+=4,t}get JC(){const t=this.view.getBigInt64(this.af);return this.af+=8,t}get OE(){return this.view.getUint8(this.af)<128?this.au-64:this.ou-49152}get cp(){return this.view.getUint8(this.af)<128?this.au:this.ou-32768}get wu(){const t=this.view,i=t.byteLength;let s,e='';for(;10!==(s=t.getUint8(this.af++))&&this.af>16),this.view.setUint16(this.af,t),this.af+=2}p4(t){this.view.setInt32(this.af,t),this.af+=4}$T(t){this.view.setInt32(this.af,t,!0),this.af+=4}QT(t){this.view.setBigInt64(this.af,t),this.af+=8}tO(t){const i=this.view,s=t.length;for(let e=0;e>>3,s=8-(7&this.zT),e=0;for(this.zT+=t;t>s;s=8)e+=(this.view.getUint8(i++)&r.GT[s])<>>s-t&r.GT[t],e}rO(t,i){const s=this.af;this.af=0;const n=new Uint8Array(s);this.ZT(s,0,n);const h=(0,e.oO)(n),r=(0,e.lO)(h,i,t),o=(0,e.aO)(r);this.af=0,this.p1(o.length),this.iO(o,o.length,0)}}},3867:(t,i,s)=>{s.d(i,{qA:()=>a,ZA:()=>o,ds:()=>e,mp:()=>n,Er:()=>h,wp:()=>r,Kh:()=>l});class e extends Array{constructor(t,i){super(t);for(let s=0;s{s.d(i,{aO:()=>o,Go:()=>n,oO:()=>r,Ho:()=>e,Xa:()=>h,lO:()=>l});const e=async t=>new Promise((i=>setTimeout(i,t))),n=async t=>new Int8Array(await(await fetch(t)).arrayBuffer()),h=async t=>(await fetch(t)).text();function r(t){let i=0n;for(let s=0;s0n;)i.unshift(Number(0xffn&t)),t>>=8n;return 128&i[0]&&i.unshift(0),new Uint8Array(i)}function l(t,i,s){let e=1n;for(;i>0n;)i%2n===1n&&(e=e*t%s),t=t*t%s,i>>=1n;return e}},9073:(t,i,s)=>{s.a(t,(async(t,i)=>{try{var e=s(1908),n=s(2901),h=s(9234),r=s(1069),o=s(7604),l=s(7046),a=s(3867),c=s(1673),f=s(2511),u=s(2682),d=s(8950),w=s(4544),y=s(1651);class t extends l.A{static cO=!1;static fO=!0;db=null;uO=3200;dO=3200;sizeX=1280;sizeZ=1344;wO=2240;yO=2752;AO=1e3;pO=0;mO=[];gO=[];_O=[];IO=[];CO=[0];EO=[0];vO=[];bO=[];TO=[];OO=[];RO=[];SO=[];LO=[];xO=[];As=[];ps=[];Es=null;vs=null;bs=null;Ts=null;MO=null;kO=[];DO=!0;FO=0;NO=-1;BO=-1;PO=-1;UO=-1;WO=!1;GO=['General Store','Sword Shop','Magic Shop','Axe Shop','Helmet Shop','Bank','Quest Start','Amulet Shop','Mining Site','Furnace','Anvil','Combat Training','Dungeon','Staff Shop','Platebody Shop','Platelegs Shop','Scimitar Shop','Archery Shop','Shield Shop','Altar','Herbalist','Jewelery','Gem Shop','Crafting Shop','Candle Shop','Fishing Shop','Fishing Spot','Clothes Shop','Apothecary','Silk Trader','Kebab Seller','Pub/Bar','Mace Shop','Tannery','Rare Trees','Spinning Wheel','Food Shop','Cookery Shop','???','Water Source','Cooking Range','Skirt Shop','Potters Wheel','Windmill','Mining Shop','Chainmail Shop','Silver Shop','Fur Trader','Spice Shop'];HO=5;YO=13;VO=140;KO=470;XO=!1;jO=0;zO=0;ZO=-1;qO=0;JO=0;$O=0;QO=new Int32Array(2e3);tR=new Int32Array(2e3);iR=new Int32Array(2e3);Un=new Int32Array(2e3);Wn=new Int32Array(2e3);Gs=new Int32Array(2e3);Pn=0;sR=null;eR=200;nR=this.eR*this.sizeX/this.sizeZ|0;hR=635-this.nR-5;rR=503-this.eR-20;oR=!1;lR=8943445;aR=7824964;cR=6706483;fR=11141120;uR=10027008;dR=8912896;zoom=4;wR=4;offsetX=this.uO-this.wO;Dy=this.yO+this.sizeZ-this.dO;load=async()=>{await e.A.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new w.A(await w.A.openDatabase());const t=await this.yR();await this.Wo(100,'Please wait... Rendering Map');const i=new r.A(t.read('labels.dat'));this.pO=i.ou;for(let t=0;t{if(this.DO){this.DO=!1,this.FO=0,d.A.clear();const t=this.offsetX-(635/this.zoom|0),i=this.Dy-(503/this.zoom|0),s=this.offsetX+(635/this.zoom|0),e=this.Dy+(503/this.zoom|0);if(this.ER(t,i,s,e,0,0,635,503),this.oR&&(this.sR?.Jb(this.hR,this.rR),d.A.JE(this.hR+this.nR*t/this.sizeX|0,this.rR+this.eR*i/this.sizeZ|0,(s-t)*this.nR/this.sizeX|0,(e-i)*this.eR/this.sizeZ|0,16711680,128),d.A.gl(this.hR+this.nR*t/this.sizeX|0,this.rR+this.eR*i/this.sizeZ|0,(s-t)*this.nR/this.sizeX|0,(e-i)*this.eR/this.sizeZ|0,16711680),this.$O>0&&this.$O%10<5))for(let t=0;t0&&this.$O%10<5&&this.JO==i+this.zO&&(s=16776960),this.MO?.Bl(this.HO+20,t+13,this.GO[i+this.zO],s)}t+=17}}this.Bl(this.hR,this.rR+this.eR,this.nR,18,this.lR,this.aR,this.cR,'Overview'),this.Bl(this.HO,this.YO+this.KO,this.VO,18,this.lR,this.aR,this.cR,'Key'),3==this.wR?this.Bl(170,471,50,30,this.fR,this.uR,this.dR,'37%'):this.Bl(170,471,50,30,this.lR,this.aR,this.cR,'37%'),4==this.wR?this.Bl(230,471,50,30,this.fR,this.uR,this.dR,'50%'):this.Bl(230,471,50,30,this.lR,this.aR,this.cR,'50%'),6==this.wR?this.Bl(290,471,50,30,this.fR,this.uR,this.dR,'75%'):this.Bl(290,471,50,30,this.lR,this.aR,this.cR,'75%'),8==this.wR?this.Bl(350,471,50,30,this.fR,this.uR,this.dR,'100%'):this.Bl(350,471,50,30,this.lR,this.aR,this.cR,'100%')}this.FO--,this.FO<=0&&(this.xo?.draw(0,0),this.FO=50)};refresh=async()=>{this.FO=0};update=async()=>{1==this.fc[1]&&(this.offsetX=this.offsetX-16/this.zoom|0,this.DO=!0),1==this.fc[2]&&(this.offsetX=this.offsetX+16/this.zoom|0,this.DO=!0),1==this.fc[3]&&(this.Dy=this.Dy-16/this.zoom|0,this.DO=!0),1==this.fc[4]&&(this.Dy=this.Dy+16/this.zoom|0,this.DO=!0);let t=1;for(;t>0;)t=this.xc(),49==t?(this.wR=3,this.DO=!0):50==t?(this.wR=4,this.DO=!0):51==t?(this.wR=6,this.DO=!0):52==t?(this.wR=8,this.DO=!0):107==t||75==t?(this.XO=!this.XO,this.DO=!0):111!=t&&79!=t||(this.oR=!this.oR,this.DO=!0);if(1==this.lc&&(this.NO=this.ac,this.BO=this.cc,this.PO=this.offsetX,this.UO=this.Dy,this.ac>170&&this.ac<220&&this.cc>471&&this.cc<503?(this.wR=3,this.NO=-1):this.ac>230&&this.ac<280&&this.cc>471&&this.cc<503?(this.wR=4,this.NO=-1):this.ac>290&&this.ac<340&&this.cc>471&&this.cc<503?(this.wR=6,this.NO=-1):this.ac>350&&this.ac<400&&this.cc>471&&this.cc<503?(this.wR=8,this.NO=-1):this.ac>this.HO&&this.cc>this.YO+this.KO&&this.acthis.hR&&this.cc>this.rR+this.eR&&this.acthis.HO&&this.cc>this.YO&&this.acthis.HO&&this.cc>this.YO&&this.acthis.HO&&this.cc>this.YO+this.KO-18&&this.acthis.HO&&this.kl=t&&this.Dlthis.hR&&i>this.rR&&tthis.wR&&(this.zoom=this.wR)),this.zoom>this.wR&&(this.DO=!0,this.zoom-=this.zoom/30,this.zoomthis.jO&&(this.DO=!0,this.zO--),this.$O>0&&(this.DO=!0,this.$O--);const i=this.offsetX-(635/this.zoom|0),s=this.Dy-(503/this.zoom|0),e=this.offsetX+(635/this.zoom|0),n=this.Dy+(503/this.zoom|0);i<48&&(this.offsetX=48+(635/this.zoom|0)),s<48&&(this.Dy=48+(503/this.zoom|0)),e>this.sizeX-48&&(this.offsetX=this.sizeX-48-(635/this.zoom|0)),n>this.sizeZ-48&&(this.Dy=this.sizeZ-48-(503/this.zoom|0))};async yR(){let t=await(this.db?.Po('worldmap.dat'));if(t)return new n.A(t);let i=5;for(;!t;){await this.Wo(0,'Requesting map');try{console.log(`${y.K.nt}/worldmap.jag`),t=await(0,h.Go)(`${y.K.nt}/worldmap.jag`)}catch(s){t=void 0;for(let t=i;t>0;t--)await this.Wo(0,`Error loading - Will retry in ${t} secs.`),await(0,h.Ho)(1e3);i*=2,i>60&&(i=60)}}return await(this.db?.Yo('worldmap.dat',t)),new n.A(t)}Bl(t,i,s,e,n,h,r,o){t=Math.trunc(t),i=Math.trunc(i),s=Math.trunc(s),e=Math.trunc(e),d.A.gl(t,i,s,e,0);const l=t+1,a=i+1,c=s-2,f=e-2;d.A.fillRect(l,a,c,f,h),d.A.hl(l,a,n,c),d.A.el(l,a,n,f),d.A.hl(l,a+f-1,r,c),d.A.el(l+c-1,a,r,f),this.MO?._T(l+c/2+1,a+f/2+1+4,o,0),this.MO?._T(l+c/2,a+f/2+4,o,16777215)}CR(){for(let t=0;t10&&e>20)-(o>>20),n+=(i>>10&1023)-(o>>10&1023),h+=(1023&i)-(1023&o),h>0&&(this.kO[e][r]=this.vR(t/8533,n/8533,h/8533))}}}}AR(t){for(;t.available>0;){const i=64*t.au-this.wO,s=64*t.au-this.yO;if(i>0&&s>0&&i+640;){const i=64*t.au-this.wO,s=64*t.au-this.yO;if(i>0&&s>0&&i+640;){const i=64*t.au-this.wO,s=64*t.au-this.yO;if(i>0&&s>0&&i+640;){const i=64*t.au-this.wO,s=64*t.au-this.yO;if(i>0&&s>0&&i+640;){const i=64*t.au-this.wO,s=64*t.au-this.yO;if(i>0&&s>0&&i+641&&l--;let a=t-.3333333333333333;a<0&&a++,e=6*l<1?o+6*(r-o)*l:2*l<1?r:3*l<2?o+(r-o)*(.6666666666666666-l)*6:o,n=6*t<1?o+6*(r-o)*t:2*t<1?r:3*t<2?o+(r-o)*(.6666666666666666-t)*6:o,h=6*a<1?o+6*(r-o)*a:2*a<1?r:3*a<2?o+(r-o)*(.6666666666666666-a)*6:o}return((256*e|0)<<16)+((256*n|0)<<8)+(256*h|0)}ER(i,s,e,n,h,r,o,l){const a=e-i,c=n-s,f=(o-h<<16)/a|0,u=(l-r<<16)/c|0;for(let t=0;t>16,n=f*(t+1)>>16;const o=n-e;if(!(o<=0)){e+=h,n+=h;for(let h=0;h>16,a=u*(h+1)>>16;const c=a-l;if(c<=0)continue;l+=r,a+=r;const f=this.bO[t+i][h+s];if(0===f)d.A.fillRect(e,l,n-e,a-l,this.kO[t+i][h+s]);else{const n=this.TO[t+i][h+s],r=252&n;0==r||o<=1||c<=1?d.A.fillRect(e,l,o,c,f):this.bR(d.A.aw,l*d.A.cw+e,this.kO[t+i][h+s],f,o,c,r>>2,3&n)}}}}if(e-i>o-h)return;let w=0;for(let t=0;t>16,n=f*(t+1)>>16;const o=n-e;if(!(o<=0)){e+=h,n+=h;for(let h=0;h>16,a=u*(h+1)>>16;const c=a-l;if(c<=0)continue;l+=r,a+=r;let f=255&this.OO[t+i][h+s];if(0!=f){let t,i;t=1==o?e:n-1,i=1==c?l:a-1;let s=13421772;if((f>=5&&f<=8||f>=13&&f<=16||f>=21&&f<=24)&&(s=13369344,f-=4),27!=f&&28!=f||(s=13369344,f-=2),1==f)d.A.el(e,l,s,c);else if(2==f)d.A.hl(e,l,s,o);else if(3==f)d.A.el(t,l,s,c);else if(4==f)d.A.hl(e,i,s,o);else if(9==f)d.A.el(e,l,16777215,c),d.A.hl(e,l,s,o);else if(10==f)d.A.el(t,l,16777215,c),d.A.hl(e,l,s,o);else if(11==f)d.A.el(t,l,16777215,c),d.A.hl(e,i,s,o);else if(12==f)d.A.el(e,l,16777215,c),d.A.hl(e,i,s,o);else if(17==f)d.A.hl(e,l,s,1);else if(18==f)d.A.hl(t,l,s,1);else if(19==f)d.A.hl(t,i,s,1);else if(20==f)d.A.hl(e,i,s,1);else if(25==f)for(let t=0;t>16,n=f*(t+1)>>16;if(!(n-e<=0)){e+=h,n+=h;for(let n=0;n>16,o=u*(n+1)>>16;o-h<=0||(h+=r,o+=r,this.LO[t+i][n+s]&&this.Es?.draw(e,h))}}}for(let t=0;t>16,n=f*(t+1)>>16;if(!(n-e<=0)){e+=h,n+=h;for(let n=0;n>16,o=u*(n+1)>>16;o-h<=0||(h+=r,o+=r,this.xO[t+i][n+s]&&this.vs?.draw(e,h))}}}for(let t=0;t0)for(let t=0;t=71&&a<=73?this.MO?._T((y+u)/2,(A+w)/2,'u_pass',16711680):t>=32&&t<=34&&a>=70&&a<=74&&this.MO?._T((y+u)/2,(A+w)/2,'u_pass',16776960)}}bR(t,i,s,e,n,h,r,o){const l=d.A.cw-n;if(9==r?(r=1,o=o+1&3):10==r?(r=1,o=o+3&3):11==r&&(r=8,o=o+3&3),1==r){if(0==o)for(let r=0;r=0;r--){for(let h=0;h=r?e:s;i+=l}else if(3==o)for(let r=h-1;r>=0;r--){for(let h=0;h=r?e:s;i+=l}}else if(2==r){if(0==o)for(let r=h-1;r>=0;r--){for(let h=0;h>1?e:s;i+=l}else if(1==o)for(let r=0;r=r<<1?e:s;i+=l}else if(2==o)for(let r=0;r=0;h--)t[i++]=h<=r>>1?e:s;i+=l}else if(3==o)for(let r=h-1;r>=0;r--){for(let h=n-1;h>=0;h--)t[i++]=h>=r<<1?e:s;i+=l}}else if(3==r){if(0==o)for(let r=h-1;r>=0;r--){for(let h=n-1;h>=0;h--)t[i++]=h<=r>>1?e:s;i+=l}else if(1==o)for(let r=h-1;r>=0;r--){for(let h=0;h=r<<1?e:s;i+=l}else if(2==o)for(let r=0;r>1?e:s;i+=l}else if(3==o)for(let r=0;r=0;h--)t[i++]=h>=r<<1?e:s;i+=l}}else if(4==r){if(0==o)for(let r=h-1;r>=0;r--){for(let h=0;h=r>>1?e:s;i+=l}else if(1==o)for(let r=0;r=0;h--)t[i++]=h>=r>>1?e:s;i+=l}else if(3==o)for(let r=h-1;r>=0;r--){for(let h=n-1;h>=0;h--)t[i++]=h<=r<<1?e:s;i+=l}}else if(5==r){if(0==o)for(let r=h-1;r>=0;r--){for(let h=n-1;h>=0;h--)t[i++]=h>=r>>1?e:s;i+=l}else if(1==o)for(let r=h-1;r>=0;r--){for(let h=0;h=r>>1?e:s;i+=l}else if(3==o)for(let r=0;r=0;h--)t[i++]=h<=r<<1?e:s;i+=l}}else if(6==r){if(0==o)for(let r=0;r=n/2?e:s;i+=l}else if(3==o)for(let r=0;r=h/2?e:s;i+=l}}else if(7==r){if(0==o)for(let r=0;r=0;r--){for(let o=0;o=0;r--){for(let o=n-1;o>=0;o--)t[i++]=o<=r-h/2?e:s;i+=l}else if(3==o)for(let r=0;r=0;o--)t[i++]=o<=r-h/2?e:s;i+=l}}else if(8==r)if(0==o)for(let r=0;r=r-h/2?e:s;i+=l}else if(1==o)for(let r=h-1;r>=0;r--){for(let o=0;o=r-h/2?e:s;i+=l}else if(2==o)for(let r=h-1;r>=0;r--){for(let o=n-1;o>=0;o--)t[i++]=o>=r-h/2?e:s;i+=l}else if(3==o)for(let r=0;r=0;o--)t[i++]=o>=r-h/2?e:s;i+=l}}Mo(){return 0}ko(){return!1}Do(){return!1}Fo(){return-1}No(){return-1}}await(0,o.w)(),(new t).Oc().then((()=>{})),window.onkeydown=function(t){return!(' '===t.key&&t.target===document.body)},i()}catch(t){i(t)}}),1)},1908:(t,i,s)=>{s.d(i,{A:()=>n});var e=s(9763);class n{static TR=null;static load=async t=>{this.TR=await(0,e.F)(new WebAssembly.Module(t),{env:void 0})};static read=(t,i,s,e)=>{if(!this.TR)throw new Error('bz2 not found!!');return Int8Array.from(this.TR.read(t,i,s,e))}}},123:(t,i,s)=>{function e(t,i){window._tinyMidiPlay&&window._tinyMidiPlay(t,i/256)}function n(){window._tinyMidiStop&&window._tinyMidiStop()}s.d(i,{Xo:()=>e,Oo:()=>n})},9763:(t,i,s)=>{async function e(t,i={}){const s={env:Object.assign(Object.create(globalThis),i.env||{},{abort(t,i,s,e){t=r(t>>>0),i=r(i>>>0),s>>>=0,e>>>=0,(()=>{throw Error(`${t} in ${i}:${s}:${e}`)})()}})},{exports:e}=await WebAssembly.instantiate(t,s),n=e.memory||i.env.memory,h=Object.setPrototypeOf({read:(t,i,s,h)=>(i=function(t,i,s,h,r){if(null==h)return 0;const o=h.length,l=e.__pin(e.__new(o<>>0;if(r)new r(n.buffer,l,o).set(h);else for(let i=0;i>>0),h[i]);return e.__unpin(l),l}(l,6,0,i,Int8Array)||function(){throw TypeError("value must not be null")}(),function(t,i,s){if(!s)return null;const e=function(t){try{return o.getUint32(t,!0)}catch{return o=new DataView(n.buffer),o.getUint32(t,!0)}}(s-4)>>>i,h=new Array(e);for(let n=0;n>>0));return h}(a,0,e.read(t,i,s,h)>>>0))},e);function r(t){if(!t)return null;const i=t+new Uint32Array(n.buffer)[t-4>>>2]>>>1,s=new Uint16Array(n.buffer);let e=t>>>1,h="";for(;i-e>1024;)h+=String.fromCharCode(...s.subarray(e,e+=1024));return h+String.fromCharCode(...s.subarray(e,i))}let o=new DataView(n.buffer);function l(t,i){try{o.setUint8(t,i,!0)}catch{o=new DataView(n.buffer),o.setUint8(t,i,!0)}}function a(t){try{return o.getInt8(t,!0)}catch{return o=new DataView(n.buffer),o.getInt8(t,!0)}}return h}s.d(i,{F:()=>e})},9896:(t,i,s)=>{var e=s(8151);!function(){window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioContext&&(window.audioContext=new window.AudioContext);var t=function(i){if(window.audioContext){var s=window.audioContext.createBuffer(1,1,22050),e=window.audioContext.createBufferSource();e.buffer=s,e.connect(window.audioContext.destination),e.start?e.start(0):e.play?e.play(0):e.noteOn&&e.noteOn(0)}document.removeEventListener('touchstart',t),document.removeEventListener('touchend',t),document.removeEventListener('click',t)};document.addEventListener('touchstart',t),document.addEventListener('touchend',t),document.addEventListener('click',t)}(),(async()=>{let t=new Float32Array,i=window.audioContext.createGain();i.gain.value=.1,i.connect(window.audioContext.destination);let s=window.audioContext.currentTime,n=[];const h=new e.A({OR:30,RR:i=>{let s=new Float32Array(i.buffer),e=new Float32Array(t.length+s.length);e.set(t,0),e.set(s,t.length),t=e},SR:t=>{},bufferSize:102400});await h.init();const r=await fetch('./SCC1_Florestan.sf2'),o=new Uint8Array(await r.arrayBuffer());function l(){if(!window.audioContext||!t.length)return;let e=window.audioContext.createBufferSource();const h=t.length/2,r=window.audioContext.createBuffer(2,h,44100);for(let i=0;i<2;i++){const s=r.getChannelData(i);let e=i;for(let i=0;i{if(a&&clearInterval(a),t=new Float32Array,n.length){let t=i.gain.value;i.gain.value=0,n.forEach((t=>{t.stop(window.audioContext.currentTime)})),n=[],i.gain.value=t}},window._tinyMidiVolume=(t=1)=>{i.gain.value=t},window._tinyMidiPlay=async(t,i=1)=>{t&&(await window._tinyMidiStop(),-1!=i&&window._tinyMidiVolume(i),s=window.audioContext.currentTime,a=setInterval(l,250),h.xR(t))}})()},8151:(t,i,s)=>{s.d(i,{A:()=>n});var e=s(5473);const n=class{constructor(t={}){this.MR=void 0,this.kR=0,this.DR=0,this.FR=0,this.OR=t.OR||100,this.sampleRate=t.sampleRate||44100,this.NR=t.NR||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.BR(1),this.RR=t.RR||(()=>{}),this.SR=t.SR||(()=>{}),this.PR=void 0,this.test=0}async init(){if(!this.MR){if('undefined'!=typeof process){const{UR:t}=await import('path'),{WR:i}=await import('module');globalThis.__dirname=t("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js"),globalThis.require=i("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js")}this.MR=await(0,e.A)(),this.GR=this.MR._malloc(this.bufferSize),this.HR=this.MR._malloc(8)}}BR(t){this.bufferSize=4*this.sampleRate*this.NR*t}YR(){if(!this.MR)throw new Error(`${this.constructor.name} not initalized. call .init()`)}LR(t){this.YR();const{_malloc:i,_free:s,_tsf_load_memory:e,_tsf_set_output:n,_tsf_channel_set_bank_preset:h,_tsf_set_max_voices:r,_tsf_channel_set_presetnumber:o}=this.MR;s(this.kR),this.kR=i(t.length),this.MR.HEAPU8.set(t,this.kR),this.DR=e(this.kR,t.length),n(this.DR,2===this.NR?0:2,this.sampleRate,this.gain)}VR(){this.YR();const t=new Uint8Array(this.bufferSize);return t.set(this.MR.HEAPU8.subarray(this.GR,this.GR+this.bufferSize)),t}KR(t){const{_malloc:i,_free:s,_tml_load_memory:e}=this.MR;return s(this.FR),this.FR=i(t.length),this.MR.HEAPU8.set(t,this.FR),e(this.FR,t.length)}XR(t){const{_midi_render:i}=this.MR;return i(this.DR,t,this.NR,this.sampleRate,this.GR,this.bufferSize,this.HR)}xR(t){if(this.YR(),!this.DR)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.PR);const{setValue:i,getValue:s}=this.MR;i(this.HR,0,'double'),this.MR._tsf_reset(this.DR),this.MR._tsf_channel_set_bank_preset(this.DR,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let e=this.KR(t);const n=()=>{e=this.XR(e);const t=this.VR();this.RR(t),e?this.PR=setTimeout(n,this.OR):this.SR(s(this.HR,'double'))};this.PR=setTimeout(n,16)}}},8227:(t,i,s)=>{t.exports=s.p+"9f86b5397894e28b5ae2.wasm"},5473:(t,i,s)=>{var e;s.d(i,{A:()=>n});const n=(e="file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/tinymidipcm.mjs",function(t){var i,n,h=void 0!==(t=t||{})?t:{};h.ready=new Promise((function(t,s){i=t,n=s})),["_tsf_load_memory","_tsf_set_output","_tsf_channel_set_bank_preset","_tsf_set_max_voices","_tsf_channel_set_presetnumber","_tsf_reset","_tsf_close","_tml_load_memory","_midi_render","_malloc","_realloc","_free","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(h.ready,t)||Object.defineProperty(h.ready,t,{get:()=>j('You are getting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),set:()=>j('You are setting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js')})}));var r=Object.assign({},h),o=[],l='object'==typeof window,a='function'==typeof importScripts,c='object'==typeof process&&'object'==typeof process.versions&&'string'==typeof process.versions.node,f=!l&&!c&&!a;if(h.ENVIRONMENT)throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');var u,d,w,y='';if(c){if('undefined'==typeof process||!process.release||'node'!==process.release.name)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');var A,p;y=a?require('path').UR(y)+'/':__dirname+'/';var m=()=>{p||(A=require('fs'),p=require('path'))};u=(t,i)=>(m(),t=p.normalize(t),A.jR(t,i?void 0:'utf8')),w=t=>{var i=u(t,!0);return i.buffer||(i=new Uint8Array(i)),D(i.buffer),i},d=(t,i,s)=>{m(),t=p.normalize(t),A.zR(t,(function(t,e){t?s(t):i(e.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,'/'),o=process.argv.slice(2),process.on('uncaughtException',(function(t){if(!(t instanceof nt))throw t})),process.on('unhandledRejection',(function(t){throw t})),h.inspect=function(){return'[Emscripten Module object]'}}else if(f){if('object'==typeof process&&'function'==typeof require||'object'==typeof window||'function'==typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');'undefined'!=typeof read&&(u=function(t){return read(t)}),w=function(t){let i;return'function'==typeof readbuffer?new Uint8Array(readbuffer(t)):(i=read(t,'binary'),D('object'==typeof i),i)},d=function(t,i,s){setTimeout((()=>i(w(t))),0)},'undefined'!=typeof scriptArgs?o=scriptArgs:void 0!==arguments&&(o=arguments),'undefined'!=typeof print&&('undefined'==typeof console&&(console={}),console.log=print,console.warn=console.error='undefined'!=typeof printErr?printErr:print)}else{if(!l&&!a)throw new Error('environment detection error');if(a?y=self.location.href:'undefined'!=typeof document&&document.currentScript&&(y=document.currentScript.src),e&&(y=e),y=0!==y.indexOf('blob:')?y.substr(0,y.replace(/[?#].*/,"").lastIndexOf('/')+1):'','object'!=typeof window&&'function'!=typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');u=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.send(null),i.responseText},a&&(w=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.responseType='arraybuffer',i.send(null),new Uint8Array(i.response)}),d=(t,i,s)=>{var e=new XMLHttpRequest;e.open('GET',t,!0),e.responseType='arraybuffer',e.onload=()=>{200==e.status||0==e.status&&e.response?i(e.response):s()},e.onerror=s,e.send(null)}}h.print||console.log.bind(console);var g,_,I=h.printErr||console.warn.bind(console);function C(t,i){Object.getOwnPropertyDescriptor(h,t)||Object.defineProperty(h,t,{configurable:!0,get:function(){j('Module.'+t+' has been replaced with plain '+i+' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')}})}function E(t){return'FS_createPath'===t||'FS_createDataFile'===t||'FS_createPreloadedFile'===t||'FS_unlink'===t||'addRunDependency'===t||'FS_createLazyFile'===t||'FS_createDevice'===t||'removeRunDependency'===t}Object.assign(h,r),r=null,g='fetchSettings',Object.getOwnPropertyDescriptor(h,g)&&j('`Module.'+g+'` was supplied but `'+g+'` not included in INCOMING_MODULE_JS_API'),h.arguments&&(o=h.arguments),C('arguments','arguments_'),h.thisProgram&&h.thisProgram,C('thisProgram','thisProgram'),h.quit&&h.quit,C('quit','quit_'),D(void 0===h.memoryInitializerPrefixURL,'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===h.pthreadMainPrefixURL,'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'),D(void 0===h.cdInitializerPrefixURL,'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===h.filePackagePrefixURL,'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'),D(void 0===h.read,'Module.read option was removed (modify read_ in JS)'),D(void 0===h.readAsync,'Module.readAsync option was removed (modify readAsync in JS)'),D(void 0===h.readBinary,'Module.readBinary option was removed (modify readBinary in JS)'),D(void 0===h.setWindowTitle,'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'),D(void 0===h.TOTAL_MEMORY,'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'),C('read','read_'),C('readAsync','readAsync'),C('readBinary','readBinary'),C('setWindowTitle','setWindowTitle'),D(!f,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),h.wasmBinary&&(_=h.wasmBinary),C('wasmBinary','wasmBinary');var v;h.noExitRuntime;C('noExitRuntime','noExitRuntime'),'object'!=typeof WebAssembly&&j('no native wasm support detected');var b,T,O,R,S,L,x,M,k=!1;function D(t,i){t||j('Assertion failed'+(i?': '+i:''))}function F(t){b=t,h.HEAP8=T=new Int8Array(t),h.HEAP16=R=new Int16Array(t),h.HEAP32=S=new Int32Array(t),h.HEAPU8=O=new Uint8Array(t),h.HEAPU16=new Uint16Array(t),h.HEAPU32=L=new Uint32Array(t),h.HEAPF32=x=new Float32Array(t),h.HEAPF64=M=new Float64Array(t)}'undefined'!=typeof TextDecoder&&new TextDecoder('utf8');var N=5242880;h.TOTAL_STACK&&D(N===h.TOTAL_STACK,'the stack size can no longer be determined at runtime');var B=h.INITIAL_MEMORY||16777216;function P(){if(!k){var t=ft(),i=L[t>>2],s=L[t+4>>2];34821223==i&&2310721022==s||j('Stack overflow! Stack cookie has been overwritten at 0x'+t.toString(16)+', expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+s.toString(16)+' 0x'+i.toString(16)),1668509029!==L[0]&&j('Runtime error: The application has corrupted its heap memory area (address zero)!')}}C('INITIAL_MEMORY','INITIAL_MEMORY'),D(B>=N,'INITIAL_MEMORY should be larger than TOTAL_STACK, was '+B+'! (TOTAL_STACK='+N+')'),D('undefined'!=typeof Int32Array&&'undefined'!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,'JS engine does not provide full typed array support'),D(!h.wasmMemory,'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'),D(16777216==B,'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'),function(){var t=new Int16Array(1),i=new Int8Array(t.buffer);if(t[0]=25459,115!==i[0]||99!==i[1])throw'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'}();var U=[],W=[],G=[],H=!1;D(Math.imul,'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.fround,'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.clz32,'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.trunc,'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');var Y=0,V=null,K=null,X={};function j(t){h.onAbort&&h.onAbort(t),I(t='Aborted('+t+')'),k=!0;var i=new WebAssembly.RuntimeError(t);throw n(i),i}var z={error:function(){j('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM')},init:function(){z.error()},ZR:function(){z.error()},qR:function(){z.error()},JR:function(){z.error()},open:function(){z.error()},$R:function(){z.error()},QR:function(){z.error()},tS:function(){z.error()},iS:function(){z.error()},sS:function(){z.error()}};h.FS_createDataFile=z.ZR,h.FS_createPreloadedFile=z.qR;var Z,q,J,$,Q='data:application/octet-stream;base64,';function tt(t){return t.startsWith(Q)}function it(t){return t.startsWith('file://')}function st(t,i){return function(){var s=t,e=i;return i||(e=h.asm),D(H,'native function `'+s+'` called before runtime initialization'),e[t]||D(e[t],'exported native function `'+s+'` not found'),e[t].apply(null,arguments)}}function et(t){try{if(t==Z&&_)return new Uint8Array(_);if(w)return w(t);throw"both async and sync fetching of the wasm failed"}catch(t){j(t)}}function nt(t){this.name='ExitStatus',this.message='Program terminated with exit('+t+')',this.status=t}function ht(t){for(;t.length>0;)t.shift()(h)}function rt(t){rt.eS||(rt.eS={}),rt.eS[t]||(rt.eS[t]=1,c&&(t='warning: '+t),I(t))}function ot(t){try{return v.nS(t-b.byteLength+65535>>>16),F(v.buffer),1}catch(i){I('emscripten_realloc_buffer: Attempted to grow heap from '+b.byteLength+' bytes to '+t+' bytes, but got error: '+i)}}h.locateFile?tt(Z='tinymidipcm.wasm')||(q=Z,Z=h.locateFile?h.locateFile(q,y):y+q):Z=new URL(s(8227),s.b).toString();var lt,at={"emscripten_memcpy_big":function(t,i,s){O.copyWithin(t,i,i+s)},"emscripten_resize_heap":function(t){var i=O.length;D((t>>>=0)>i);var s,e,n=2147483648;if(t>n)return I('Cannot enlarge memory, asked to go up to '+t+' bytes, but the limit is '+n+' bytes!'),!1;for(var h=1;h<=4;h*=2){var r=i*(1+.2/h);r=Math.min(r,t+100663296);var o=Math.min(n,(s=Math.max(t,r))+((e=65536)-s%e)%e);if(ot(o))return!0}return I('Failed to grow the heap from '+i+' bytes to '+o+' bytes, not enough memory!'),!1}},ct=(function(){var t,i={'env':at,'wasi_snapshot_preview1':at};function s(t,i){var s,e=t.exports;h.asm=e,D(v=h.asm.memory,"memory not found in wasm exports"),F(v.buffer),D(h.asm.__indirect_function_table,"table not found in wasm exports"),s=h.asm.__wasm_call_ctors,W.unshift(s),function(t){if(Y--,h.monitorRunDependencies&&h.monitorRunDependencies(Y),t?(D(X[t]),delete X[t]):I('warning: run dependency removed without ID'),0==Y&&(null!==V&&(clearInterval(V),V=null),K)){var i=K;K=null,i()}}('wasm-instantiate')}t='wasm-instantiate',Y++,h.monitorRunDependencies&&h.monitorRunDependencies(Y),t?(D(!X[t]),X[t]=1,null===V&&'undefined'!=typeof setInterval&&(V=setInterval((function(){if(k)return clearInterval(V),void(V=null);var t=!1;for(var i in X)t||(t=!0,I('still waiting on run dependencies:')),I('dependency: '+i);t&&I('(end of list)')}),1e4))):I('warning: run dependency added without ID');var e=h;function r(t){D(h===e,'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'),e=null,s(t.instance)}function o(t){return function(){if(!_&&(l||a)){if('function'==typeof fetch&&!it(Z))return fetch(Z,{credentials:'same-origin'}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+Z+"'";return t.arrayBuffer()})).catch((function(){return et(Z)}));if(d)return new Promise((function(t,i){d(Z,(function(i){t(new Uint8Array(i))}),i)}))}return Promise.resolve().then((function(){return et(Z)}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){I('failed to asynchronously prepare wasm: '+t),it(Z)&&I('warning: Loading from a file URI ('+Z+') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing'),j(t)}))}if(h.instantiateWasm)try{return h.instantiateWasm(i,s)}catch(t){I('Module.instantiateWasm callback failed with error: '+t),n(t)}(_||'function'!=typeof WebAssembly.instantiateStreaming||tt(Z)||it(Z)||c||'function'!=typeof fetch?o(r):fetch(Z,{credentials:'same-origin'}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(r,(function(t){return I('wasm streaming compile failed: '+t),I('falling back to ArrayBuffer instantiation'),o(r)}))}))).catch(n)}(),h.___wasm_call_ctors=st("__wasm_call_ctors"),h._malloc=st("malloc"),h._free=st("free"),h._tsf_load_memory=st("tsf_load_memory"),h._tsf_close=st("tsf_close"),h._tsf_reset=st("tsf_reset"),h._tsf_set_output=st("tsf_set_output"),h._tsf_set_max_voices=st("tsf_set_max_voices"),h._realloc=st("realloc"),h._tsf_channel_set_presetnumber=st("tsf_channel_set_presetnumber"),h._tsf_channel_set_bank_preset=st("tsf_channel_set_bank_preset"),h._tml_load_memory=st("tml_load_memory"),h._midi_render=st("midi_render"),h.___errno_location=st("__errno_location"),h._fflush=st("fflush"),h._emscripten_stack_init=function(){return(ct=h._emscripten_stack_init=h.asm.emscripten_stack_init).apply(null,arguments)}),ft=(h._emscripten_stack_get_free=function(){return(h._emscripten_stack_get_free=h.asm.emscripten_stack_get_free).apply(null,arguments)},h._emscripten_stack_get_base=function(){return(h._emscripten_stack_get_base=h.asm.emscripten_stack_get_base).apply(null,arguments)},h._emscripten_stack_get_end=function(){return(ft=h._emscripten_stack_get_end=h.asm.emscripten_stack_get_end).apply(null,arguments)});function ut(){var t;ct(),D(!(3&(t=ft()))),L[t>>2]=34821223,L[t+4>>2]=2310721022,L[0]=1668509029}function dt(t){function s(){lt||(lt=!0,h.calledRun=!0,k||(D(!H),H=!0,P(),ht(W),i(h),h.onRuntimeInitialized&&h.onRuntimeInitialized(),D(!h._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(P(),h.postRun)for('function'==typeof h.postRun&&(h.postRun=[h.postRun]);h.postRun.length;)t=h.postRun.shift(),G.unshift(t);var t;ht(G)}()))}t=t||o,Y>0||(ut(),function(){if(h.preRun)for('function'==typeof h.preRun&&(h.preRun=[h.preRun]);h.preRun.length;)t=h.preRun.shift(),U.unshift(t);var t;ht(U)}(),Y>0||(h.setStatus?(h.setStatus('Running...'),setTimeout((function(){setTimeout((function(){h.setStatus('')}),1),s()}),1)):s(),P()))}if(h.stackSave=st("stackSave"),h.stackRestore=st("stackRestore"),h.stackAlloc=st("stackAlloc"),h.setValue=function(t,i,s="i8"){switch(s.endsWith('*')&&(s='*'),s){case'i1':case'i8':T[0|t]=i;break;case'i16':R[t>>1]=i;break;case'i32':S[t>>2]=i;break;case'i64':$=[i>>>0,(J=i,+Math.abs(J)>=1?J>0?(0|Math.min(+Math.floor(J/4294967296),4294967295))>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],S[t>>2]=$[0],S[t+4>>2]=$[1];break;case'float':x[t>>2]=i;break;case'double':M[t>>3]=i;break;case'*':L[t>>2]=i;break;default:j('invalid type for setValue: '+s)}},h.getValue=function(t,i="i8"){switch(i.endsWith('*')&&(i='*'),i){case'i1':case'i8':return T[0|t];case'i16':return R[t>>1];case'i32':case'i64':return S[t>>2];case'float':return x[t>>2];case'double':return M[t>>3];case'*':return L[t>>2];default:j('invalid type for getValue: '+i)}return null},['run','UTF8ArrayToString','UTF8ToString','stringToUTF8Array','stringToUTF8','lengthBytesUTF8','addOnPreRun','addOnInit','addOnPreMain','addOnExit','addOnPostRun','addRunDependency','removeRunDependency','FS_createFolder','FS_createPath','FS_createDataFile','FS_createPreloadedFile','FS_createLazyFile','FS_createLink','FS_createDevice','FS_unlink','getLEB','getFunctionTables','alignFunctionTables','registerFunctions','prettyPrint','getCompilerSetting','print','printErr','callMain','abort','keepRuntimeAlive','wasmMemory','stackAlloc','stackSave','stackRestore','getTempRet0','setTempRet0','writeStackCookie','checkStackCookie','ptrToString','zeroMemory','stringToNewUTF8','exitJS','getHeapMax','emscripten_realloc_buffer','ENV','ERRNO_CODES','ERRNO_MESSAGES','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','DNS','getHostByName','Protocols','Sockets','getRandomDevice','warnOnce','traverseStack','UNWIND_CACHE','convertPCtoSourceLocation','readAsmConstArgsArray','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','handleException','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','freeTableIndexes','functionsInTableMap','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','PATH','PATH_FS','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16Decoder','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeArrayToMemory','writeAsciiToMemory','SYSCALLS','getSocketFromFD','getSocketAddress','JSEvents','registerKeyEventCallback','specialHTMLTargets','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','currentFullscreenStrategy','restoreOldWindowedStyle','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','demangle','demangleAll','jsStackTrace','stackTrace','ExitStatus','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','dlopenMissingError','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','uncaughtExceptionCount','exceptionLast','exceptionCaught','ExceptionInfo','exception_addRef','exception_decRef','Browser','setMainLoop','wget','FS','MEMFS','TTY','PIPEFS','SOCKFS','_setNetworkCallback','tempFixedLengthArray','miniTempWebGLFloatBuffers','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','GL','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','AL','SDL_unicode','SDL_ttfContext','SDL_audio','SDL','SDL_gfx','GLUT','EGL','GLFW_Window','GLFW','GLEW','IDBStore','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){Object.getOwnPropertyDescriptor(h,t)||Object.defineProperty(h,t,{configurable:!0,get:function(){var i="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),j(i)}})})),['ptrToString','zeroMemory','stringToNewUTF8','exitJS','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','getHostByName','getRandomDevice','traverseStack','convertPCtoSourceLocation','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeAsciiToMemory','getSocketFromFD','getSocketAddress','registerKeyEventCallback','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','ExceptionInfo','exception_addRef','exception_decRef','setMainLoop','_setNetworkCallback','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','SDL_unicode','SDL_ttfContext','SDL_audio','GLFW_Window','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){'undefined'==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var i='`'+t+'` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line';E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),rt(i)}})})),K=function t(){lt||dt(),lt||(K=t)},h.preInit)for('function'==typeof h.preInit&&(h.preInit=[h.preInit]);h.preInit.length>0;)h.preInit.pop()();return dt(),t.ready})}},h={};function r(t){var i=h[t];if(void 0!==i)return i.exports;var s=h[t]={exports:{}};return n[t](s,s.exports,r),s.exports}r.m=n,t="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",i="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",s="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",e=t=>{t&&t.d<1&&(t.d=1,t.forEach((t=>t.r--)),t.forEach((t=>t.r--?t.r++:t())))},r.a=(n,h,r)=>{var o;r&&((o=[]).d=-1);var l,a,c,f=new Set,u=n.exports,d=new Promise(((t,i)=>{c=i,a=t}));d[i]=u,d[t]=t=>(o&&t(o),f.forEach(t),d.catch((t=>{}))),n.exports=d,h((n=>{var h;l=(n=>n.map((n=>{if(null!==n&&"object"==typeof n){if(n[t])return n;if(n.then){var h=[];h.d=0,n.then((t=>{r[i]=t,e(h)}),(t=>{r[s]=t,e(h)}));var r={};return r[t]=t=>t(h),r}}var o={};return o[t]=t=>{},o[i]=n,o})))(n);var r=()=>l.map((t=>{if(t[s])throw t[s];return t[i]})),a=new Promise((i=>{(h=()=>i(r)).r=0;var s=t=>t!==o&&!f.has(t)&&(f.add(t),t&&!t.d&&(h.r++,t.push(h)));l.map((i=>i[t](s)))}));return h.r?a:r()}),(t=>(t?c(d[s]=t):a(u),e(o)))),o&&o.d<0&&(o.d=0)},r.d=(t,i)=>{for(var s in i)r.o(i,s)&&!r.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:i[s]})},r.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),r.p="/Client2/",r.b=document.baseURI||self.location.href;r(9073)})(); \ No newline at end of file diff --git a/mesanim.js b/mesanim.js index 13f1f2bc..ce348dab 100644 --- a/mesanim.js +++ b/mesanim.js @@ -1 +1 @@ -(()=>{"use strict";var t,i,e,s,n={1651:(t,i,e)=>{e.d(i,{K:()=>k});var s=e(1120),n=e(4583),r=e(2901),h=e(1069),o=e(7046),a=(e(9896),e(6666)),l=e(3045),c=e(818),f=e(670),u=e(8268),d=e(3867),w=e(7854),y=e(8950),m=e(1302),A=e(9298),p=e(8665),g=e(1312),I=e(3819),_=e(8317),C=e(9234),E=e(1908),v=e(123),b=e(5637),T=e(6948),R=e(2164),O=e(8738),L=e(3764),S=e(8534),x=e(6730);class k extends o.A{static tt=225;static it=10;static portOffset=0;static members=!0;static et=!1;static st='';static nt='';static rt=!1;static ht=2;static ot=!1;static lt='https://raw.githubusercontent.com/2004scape/Server/main';static exponent=58778699976184461502525193738213253649000149147835990136706041084440742975821n;static ct=7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789n;static ft=0;static ut=0;static dt=0;static wt=0;static yt=0;static At=0;static gt=0;static It=0;static _t=0;static Ct=0;static Et=0;static vt=0;static bt=0;static Tt=0;static Rt=0;static Ot=()=>{l.A.et=!1,n.A.et=!1,k.et=!1,c.A.et=!1};static Lt=()=>{l.A.et=!0,n.A.et=!0,k.et=!0,c.A.et=!0};St=2048;xt=2047;kt=!1;Mt=!1;Dt=!1;Nt=!1;db=null;Ft=0;Bt=[];stream=null;in=h.A.Ut(1);Pt=h.A.Ut(1);Gt=h.A.Ut(1);Wt=0n;Ht=0;Yt=0;Vt=0;Kt=null;Xt=0;packetSize=0;jt=0;zt=0;Zt=0;qt=null;$t=!0;Jt=0;Qt=0;ti=null;ii=null;ei=null;si=null;ni=null;ri=null;hi=null;oi=null;ai=null;li=null;ci=null;fi='';ui='';username='';password='';di=null;wi=null;yi=null;mi=null;Ai=[];pi=!1;gi=null;Ii=null;_i=null;Ci=null;Ei=null;vi=null;bi=null;Ti=null;Ri=null;Oi=null;Li=new Int32Array(256);Si=0;xi=0;ki=0;Mi=null;Di=null;Ni=null;Fi=null;Bi=null;Ui=null;Pi=null;Gi=null;Wi=null;Hi=null;Yi=null;Vi=null;Ki=null;Xi=null;ji=null;zi=null;Zi=null;qi=null;$i=null;Ji=null;Qi=null;te=new Int32Array(33);ie=new Int32Array(33);ee=new Int32Array(151);se=new Int32Array(151);ne=null;re=null;he=null;oe=null;ae=null;le=null;ce=new d.fe(13,null);ue=null;de=null;we=new d.fe(50,null);ye=new d.fe(50,null);me=new d.fe(20,null);Ae=new d.fe(20,null);pe=null;ge=new d.fe(8,null);Ie=null;_e=null;Ce=null;Ee=null;ve=null;be=null;Te=null;Re=null;Oe=null;Le=null;Se=null;xe=null;ke=null;Me=null;De=null;Ne=null;Fe=null;Be=null;Ue=new d.fe(1e3,null);Pe=!1;Ge=!1;We=!1;He=!1;Ye=-1;Ve=0;Ke=0;Xe=0;je=0;ze=0;Ze=0;qe=!1;$e=0;Je=0;Qe=0;ts=0;es=0;ss=0;ns=[];rs=-1;hs=-1;os=new s.A;ls=78;cs=0;fs=0;us=[];ds=0;ws=0;ys=0;As=0;ps=0;gs=0;Is=0;_s=0;Cs=[];Es=[];vs=[];bs=[];Ts=null;Rs=-1;Os=3;Ls=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];Ss=0;xs=0;ks=0;Ms=!1;Ds=0;Ns=!1;Fs='';Bs='';Us=0;Ps='';Gs=!1;Ws=-1;Hs=new d.fe(100,null);Ys=new d.fe(100,null);messageType=new Int32Array(100);Vs=new Int32Array(100);Ks=0;Xs=0;js=0;zs='';Zs=0;qs=0;$s=0;Js=0;Qs=0;tn=0;en=0;sn=0;nn=0;rn=!1;hn=0;an=0;ln=0;cn=0;fn=null;un=0;dn=0;wn=0;yn=0;mn=!1;An=[];pn=[];gn=0;In=0;_n=0;Cn=null;En=0;vn=new Int32Array(500);bn=new Int32Array(500);Tn=new Int32Array(500);Rn=new Int32Array(500);On=0;Ln=0;Sn=0;xn='';kn=!1;Mn=-1;Dn=0;Nn=0;Fn=0;Bn=0;Un=0;Pn=new Int32Array(1e3);Gn=new Int32Array(1e3);Wn=null;Hn=0;Yn=0;Vn=0;Kn=0;Xn=0;jn=!1;zn=0;Zn=0;qn=0;$n=0;Jn=2;Qn=2;tr=1;ir=new Int32Array(5);er=new d.fe(5,!1);sr=new Int32Array(5);nr=new Int32Array(5);rr=new Int32Array(5);hr=0;ar=0;lr=0;cr=0;ur=0;dr=0;wr=0;yr=0;mr=0;Ar=1;pr=2;gr=-1;Ir=0;_r=0;Cr=0;Er=0;vr=0;br=0;Tr=null;Rr=null;Or=null;Lr=0;Sr=0;kr=new Int8Array(16384);Mr=new d.fe(f.A.Dr,null);Nr=0;Fr=0;Br=128;Ur=0;Pr=0;Gr=0;Wr=0;Hr=0;Yr=null;Vr=null;Kr=new d.Xr(f.A.jr,f.A.jr);zr=0;Zr=0;qr=0;$r=0;Jr=0;Qr=0;th=0;ih=0;eh=0;sh=0;nh=0;rh=0;hh=new d.fe(this.St,null);oh=0;ah=new Int32Array(this.St);lh=0;fh=0;uh=new Int32Array(this.St);dh=new Int32Array(1e3);wh=new d.fe(this.St,null);yh=new d.fe(8192,null);mh=0;Ah=new Int32Array(8192);ph=new a.A;gh=new a.A;Ih=new a.A;_h=new a.A;Ch=new d.Eh(f.A.Dr,f.A.jr,f.A.jr,null);bh=new a.A;Th=new Int32Array(4e3);Rh=new Int32Array(4e3);Oh=new Int32Array(f.A.jr*f.A.jr);Lh=new Int32Array(f.A.jr*f.A.jr);Sh=0;xh=null;kh=0;Mh=0;Dh=-1;Nh=0;Fh=0;Bh=0;Uh=0;Ph=!1;Gh=!0;Wh=!1;Hh=new Int32Array(7);Yh=new Int32Array(5);Vh=0;Kh=0;static Xh=50;jh=new Int32Array(k.Xh);zh=new Int32Array(k.Xh);Zh=new Int32Array(k.Xh);qh=new Int32Array(k.Xh);$h=new Int32Array(k.Xh);Jh=new Int32Array(k.Xh);Qh=new Int32Array(k.Xh);io=new d.fe(k.Xh,null);eo=new d.fe(100,null);so=new BigInt64Array(100);no=new Int32Array(100);ro=null;ho=0;oo=!0;ao=new Int32Array(50);lo=new Int32Array(50);co=new Int32Array(50);fo=192;uo=-1;do=-1;wo=0;yo=0;mo=0;Ao=!0;po=null;Io=0;_o=0;Co=192;Eo=new d.fe(16,null);vo=0;bo=!1;To=()=>{try{this.stream&&this.stream.close()}catch(t){}this.stream=null,(0,v.Ro)(),this.Pt=null,this.Gt=null,this.in=null,this.Or=null,this.Tr=null,this.Rr=null,this.Yr=null,this.Vr=null,this.Wn=null,this.Mr=null,this.Oh=null,this.Lh=null,this.Th=null,this.Rh=null,this.kr=null,this.Di=null,this.Ni=null,this.Fi=null,this.Bi=null,this.Ui=null,this.Pi=null,this.Gi=null,this.Wi=null,this.Hi=null,this.Yi=null,this.Vi=null,this.Ki=null,this.Xi=null,this.ji=null,this.zi=null,this.Zi=null,this.qi=null,this.ne=null,this.he=null,this.re=null,this.oe=null,this.ae=null,this.le=null,this.ce=null,this.Te=null,this.Re=null,this.Oe=null,this.Le=null,this.Se=null,this.xe=null,this.ke=null,this.Me=null,this.De=null,this.Ne=null,this.de=null,this.me=null,this.Ae=null,this.ge=null,this.Ie=null,this._e=null,this.Ce=null,this.Ee=null,this.we=null,this.ye=null,this.Kr=null,this.hh=null,this.ah=null,this.uh=null,this.wh=null,this.dh=null,this.yh=null,this.Ah=null,this.Ch=null,this.bh=null,this._h=null,this.ph=null,this.gh=null,this.Ih=null,this.Tn=null,this.Rn=null,this.vn=null,this.bn=null,this.ns=null,this.An=null,this.Pn=null,this.Gn=null,this.Ue=null,this.ue=null,this.eo=null,this.so=null,this.no=null,this.si=null,this.ni=null,this.ti=null,this.ii=null,this.ei=null,this.ri=null,this.hi=null,this.oi=null,this.ai=null,this.Oo(),b.A.To(),T.A.To(),m.A.To(),R.A.Lo=null,_.A.Lo=null,s.A.Lo=null,g.A.Lo=null,O.A.Lo=null,O.A.So=null,L.A.Lo=null,this.xo=null,u.A.So=null,n.A.To(),l.A.To(),p.A.To(),S.A.Lo=[],x.A.Lo=[]};ko(){return this.Jt}Mo(){return this.Gs}Do(){return this.Ns}No(){return this.hs}Fo(){return this.Ye}Oo=()=>{this.pi=!1,this.Mi&&(clearInterval(this.Mi),this.Mi=null),this.li=null,this.ci=null,this.Ai=[],this.bi=null,this.Ti=null,this.Ri=null,this.Oi=null,this.Ci=null,this._i=null,this.Ei=null,this.vi=null,this.gi=null,this.Ii=null};Bo=async(t,i,e,s)=>{let n=5,o=await(this.db?.Uo(t));if(o&&h.A.Po(o)!==e&&(o=void 0),o)return new r.A(o);for(;!o;){await this.Go(s,`Requesting ${i}`);try{o=await(0,C.Wo)(`${k.nt}/${t}${e}`)}catch(t){o=void 0;for(let t=n;t>0;t--)await this.Go(s,`Error loading - Will retry in ${t} secs.`),await(0,C.Ho)(1e3);n*=2,n>60&&(n=60)}}return await(this.db?.Yo(t,o)),new r.A(o)};Vo=async(t,i,e)=>{let s=await(this.db?.Uo(t+'.mid'));if(s&&12345678!==i&&h.A.Po(s)!==i&&(s=void 0),!s)try{s=await(0,C.Wo)(`${k.nt}/${t}_${i}.mid`),e!==s.length&&(s=s.slice(0,e))}catch(t){}if(!s)return;await(this.db?.Yo(t+'.mid',s));const n=new h.A(Uint8Array.from(s)).Ko,r=E.A.read(n,s,e,4);(0,v.Xo)(r,this.Co)};jo=()=>{if(w.zo.fillStyle='black',w.zo.fillRect(0,0,this.width,this.height),this.Zo(1),this.Dt){this.pi=!1,w.zo.font='bold 16px helvetica, sans-serif',w.zo.textAlign='left',w.zo.fillStyle='yellow';let t=35;w.zo.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,w.zo.fillStyle='white',w.zo.fillText('To fix this try the following (in order):',30,t),t+=50,w.zo.font='bold 12px helvetica, sans-serif',w.zo.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.zo.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,w.zo.fillText('3: Try using a different game-world',30,t),t+=30,w.zo.fillText('4: Try rebooting your computer',30,t),t+=30,w.zo.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.Nt&&(this.pi=!1,w.zo.font='bold 20px helvetica, sans-serif',w.zo.textAlign='left',w.zo.fillStyle='white',w.zo.fillText('Error - unable to load game!',50,50),w.zo.fillText('To play RuneScape make sure you play from',50,100),w.zo.fillText('https://2004scape.org',50,150)),this.Mt){this.pi=!1,w.zo.font='bold 13px helvetica, sans-serif',w.zo.textAlign='left',w.zo.fillStyle='yellow';let t=35;w.zo.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,w.zo.fillStyle='white',w.zo.fillText('To fix this try the following (in order):',30,t),t+=50,w.zo.font='bold 12px helvetica, sans-serif',w.zo.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.zo.fillText('2: Try rebooting your computer, and reloading',30,t)}};qo=t=>{if(!t.$o)return!1;for(let i=0;i=s)return!1}else if(3===t.$o[i]){if(e<=s)return!1}else if(4===t.$o[i]){if(e===s)return!1}else if(e!==s)return!1}return!0};ta=(t,i,e,s,n)=>{this.ve?.draw(t,i),this.be?.draw(t,i+n-16),y.A.fillRect(t,i+16,16,n-32,A.A.ia);let r=(n-32)*n/s|0;r<8&&(r=8);const h=(n-r-32)*e/(s-n)|0;y.A.fillRect(t,i+h+16,16,r,A.A.ea),y.A.sa(t,i+h+16,A.A.na,r),y.A.sa(t+1,i+h+16,A.A.na,r),y.A.ra(t,i+h+16,A.A.na,16),y.A.ra(t,i+h+17,A.A.na,16),y.A.sa(t+15,i+h+16,A.A.ha,r),y.A.sa(t+14,i+h+17,A.A.ha,r-1),y.A.ra(t,i+h+r+15,A.A.ha,16),y.A.ra(t+1,i+h+r+14,A.A.ha,15)};oa=(t,i)=>{let e=!1;const n=s.A.Lo[t];if(!n.aa)return!1;for(let t=0;ts.delay[r.ua];)r.fa-=s.delay[r.ua]+1,r.ua++,r.ua>=s.da&&(r.ua-=s.wa,(r.ua<0||r.ua>=s.da)&&(r.ua=0)),e=!0}}}return e};ya=(t,i,e,r,h=!1)=>{if(0!==t.type||!t.aa||t.hide&&this.Zs!==t.id&&this.qs!==t.id&&this.$s!==t.id)return;const o=y.A.left,a=y.A.top,l=y.A.right,c=y.A.bottom;y.A.ma(i,e,i+t.width,e+t.height);const f=t.aa.length;for(let o=0;o0&&this.Ca(c),c.type===s.A.Ea)c.va>c.scroll-c.height&&(c.va=c.scroll-c.height),c.va<0&&(c.va=0),this.ya(c,a,l,c.va,h),c.scroll>c.height&&this.ta(a+c.width,l,c.va,c.scroll,c.height);else if(c.type===s.A.ba){let t=0;for(let i=0;i0){let i=0,e=0;const r=c.Oa[t]-1;if(s>=-32&&s<=512&&n>=-32&&n<=334||0!==this.tn&&this.Qs===t){const h=m.A.ka(r,c.La[t]);if(0!==this.tn&&this.Qs===t&&this.Js===c.id?(i=this.Ma-this.en,e=this.Da-this.sn,i<5&&i>-5&&(i=0),e<5&&e>-5&&(e=0),this.nn<5&&(i=0,e=0),h.Na(128,s+i,n+e)):0!==this.un&&this.dn===t&&this.wn===c.id?h.Na(128,s,n):h.draw(s,n),33===h.Fa||1!==c.La[t]){const r=c.La[t];this.di?.Ba(s+i+1,n+10+e,this.Ua(r),A.A.Pa),this.di?.Ba(s+i,n+9+e,this.Ua(r),A.A.Ga)}}}else if(c.Wa&&t<20){const i=c.Wa[t];i?.draw(s,n)}t++}}else if(c.type===s.A.Ha)c.fill?y.A.fillRect(a,l,c.width,c.height,c.Ya):y.A.ga(a,l,c.width,c.height,c.Ya);else if(c.type===s.A.Va){const t=c.font;let i=c.Ya,e=c.text;if(this.$s!==c.id&&this.qs!==c.id&&this.Zs!==c.id||0===c.Ka||(i=c.Ka),this.qo(c)&&(i=c.Xa,c.ja&&c.ja.length>0&&(e=c.ja)),c.za===s.A.Za&&this.mn&&(e='Please wait...',i=c.Ya),!t||!e)continue;for(let s=l+t.height;e.length>0;s+=t.height){if(-1!==e.indexOf('%')){for(;;){const t=e.indexOf('%1');if(-1===t)break;e=e.substring(0,t)+this.qa(this.Jo(c,0))+e.substring(t+2)}for(;;){const t=e.indexOf('%2');if(-1===t)break;e=e.substring(0,t)+this.qa(this.Jo(c,1))+e.substring(t+2)}for(;;){const t=e.indexOf('%3');if(-1===t)break;e=e.substring(0,t)+this.qa(this.Jo(c,2))+e.substring(t+2)}for(;;){const t=e.indexOf('%4');if(-1===t)break;e=e.substring(0,t)+this.qa(this.Jo(c,3))+e.substring(t+2)}for(;;){const t=e.indexOf('%5');if(-1===t)break;e=e.substring(0,t)+this.qa(this.Jo(c,4))+e.substring(t+2)}}const n=e.indexOf('\\n');let r;-1!==n?(r=e.substring(0,n),e=e.substring(n+2)):(r=e,e=''),c.$a?t.Ja(a+(c.width/2|0),s,r,i,c.Qa):t.tl(a,s,r,i,c.Qa)}}else if(c.type===s.A.il){let t;t=this.qo(c)?c.el:c.sl,t?.draw(a,l)}else if(c.type===s.A.nl){const t=n.A.rl,i=n.A.hl;n.A.rl=a+(c.width/2|0),n.A.hl=l+(c.height/2|0);const e=n.A.sin[c.ol]*c.zoom>>16,s=n.A.cos[c.ol]*c.zoom>>16,r=this.qo(c);let h;h=r?c.ca:c.la;let o=null;if(-1===h)o=c.al(-1,-1,r);else{const t=g.A.Lo[h];t.frames&&t.ll&&(o=c.al(t.frames[c.ua],t.ll[c.ua],r))}o&&o.cl(0,c.fl,0,c.ol,0,e,s),n.A.rl=t,n.A.hl=i}else if(c.type===s.A.ul){const t=c.font;if(!t||!c.Oa||!c.La)continue;let i=0;for(let e=0;e0){const n=m.A.get(c.Oa[i]-1);let r=n.name;if((n.dl||1!==c.La[i])&&(r=r+' x'+this.wl(c.La[i])),!r)continue;const h=a+s*(c.Sa+115),o=l+e*(c.xa+12);c.$a?t.Ja(h+(c.width/2|0),o,r,c.Ya,c.Qa):t.tl(h,o,r,c.Ya,c.Qa)}i++}}}y.A.ma(o,a,l,c)};Ca=t=>{let i=t._a;if(i>=s.A.yl&&i<=s.A.ml)i--,i>=this.Vh?(t.text='',t.za=0):(t.text=this.eo[i],t.za=1);else if(i>=s.A.Al&&i<=s.A.pl)i-=s.A.Al,i>=this.Vh?(t.text='',t.za=0):(0===this.no[i]?t.text='@red@Offline':this.no[i]===k.it?t.text='@gre@World-'+(this.no[i]-9):t.text='@yel@World-'+(this.no[i]-9),t.za=1);else if(i===s.A.gl)t.scroll=15*this.Vh+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i>=s.A.Il&&i<=s.A._l)i-=s.A.Il,i>=this.fs?(t.text='',t.za=0):(t.text=I.A.Cl(I.A.El(this.us[i])),t.za=1);else if(i===s.A.vl)t.scroll=15*this.fs+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i===s.A.bl){if(t.ol=150,t.fl=256*Math.sin(this.Ft/40)&2047,this.Wh){this.Wh=!1;const i=new d.fe(7,null);let e=0;for(let t=0;t<7;t++){const s=this.Hh[t];s>=0&&(i[e++]=_.A.Lo[s].al())}const s=p.A.Tl(i,e);for(let t=0;t<5;t++)0!==this.Yh[t]&&(s.Rl(u.A.Ol[t][0],u.A.Ol[t][this.Yh[t]]),1===t&&s.Rl(u.A.Ll[0],u.A.Ll[this.Yh[t]]));if(this.xh){const i=g.A.Lo[this.xh.Sl].frames;i&&(s.xl(),s.kl(i[0]),s.Ml(64,850,-30,-50,-30,!0),t.model=s)}}}else if(i===s.A.Dl)this.Fe||(this.Fe=t.sl,this.Be=t.el),this.Gh?t.sl=this.Be:t.sl=this.Fe;else if(i===s.A.Nl)this.Fe||(this.Fe=t.sl,this.Be=t.el),this.Gh?t.sl=this.Fe:t.sl=this.Be;else if(i===s.A.Fl)t.text=this.xn,this.Ft%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(i===s.A.Bl)this.Ph?this.kn?(t.Ya=A.A.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.Ya=A.A.Ia,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(i===s.A.Ul||i===s.A.Pl)if(0===this.Dn)t.text='';else{let i;i=0===this.Nn?'earlier today':1===this.Nn?'yesterday':this.Nn+' days ago',t.text='You last logged in '+i+' from: '+I.A.Gl(this.Dn)}else if(i===s.A.Wl)0===this.Bn&&(t.text='0 unread messages',t.Ya=A.A.Ga),1===this.Bn&&(t.text='1 unread message',t.Ya=A.A.GREEN),this.Bn>1&&(t.text=this.Bn+' unread messages',t.Ya=A.A.GREEN);else if(i===s.A.Hl)if(201===this.Fn)t.text='';else if(200===this.Fn)t.text='You have not yet set any password recovery questions.';else{let i;i=0===this.Fn?'Earlier today':1===this.Fn?'Yesterday':this.Fn+' days ago',t.text=i+' you changed your recovery questions'}else i===s.A.Yl?201===this.Fn?t.text='':200===this.Fn?t.text='We strongly recommend you do so now to secure your account.':t.text='If you do not remember making this change then cancel it immediately':i===s.A.Vl&&(201===this.Fn?t.text='':(this.Fn,t.text="Do this from the 'account management' area on our front webpage"))};Jo=(t,i)=>{if(!t.scripts||i>=t.scripts.length)return-2;try{const e=t.scripts[i];if(!e)return-1;let n=0,r=0;for(;;){const t=e[r++];if(0===t)return n;if(1===t)n+=this.Es[e[r++]];else if(2===t)n+=this.vs[e[r++]];else if(3===t)n+=this.Cs[e[r++]];else if(4===t){const t=s.A.Lo[e[r++]],i=e[r++]+1;if(t.Oa&&t.La)for(let e=0;et<999999999?String(t):'*';wl=t=>{let i=String(t);for(let t=i.length-3;t>0;t-=3)i=i.substring(0,t)+','+i.substring(t);return i.length>8?i='@gre@'+i.substring(0,i.length-8)+' million @whi@('+i+')':i.length>4&&(i='@cya@'+i.substring(0,i.length-4)+'K @whi@('+i+')'),' '+i};Ua=t=>t<1e5?String(t):t<1e7?(t/1e3|0)+'K':(t/1e6|0)+'M'}},7604:(t,i,e)=>{e.d(i,{w:()=>h});var s=e(7046),n=e(1651),r=e(9234);async function h(){await async function(){0===s.A.getParameter('world').length&&s.A.setParameter('world','1');'localhost'===window.location.hostname&&'0'===s.A.getParameter('world')?(n.K.st='http://localhost',n.K.nt='http://localhost',n.K.portOffset=0):await async function(t){const i=await o(t,parseInt(s.A.getParameter('world'),10)),e=new URL(i.address);n.K.it=10+i.id-1,n.K.st=`${e.protocol}//${e.hostname}`,n.K.nt=`${e.protocol}//${e.hostname}:${e.port}`,t||(n.K.st=n.K.st.replace('https:','http:'));n.K.portOffset=i.portOffset,n.K.members=!0===i?.members,s.A.setParameter('world',i.id.toString(10))}(window.location.protocol.startsWith('https'))}(),function(){0===s.A.getParameter('detail').length&&s.A.setParameter('detail','high');'low'===s.A.getParameter('detail')?n.K.Lt():n.K.Ot()}(),0===s.A.getParameter('method').length&&s.A.setParameter('method','0')}async function o(t,i,e=0){if(e>=10)throw new Error('could not find world to connect!');const s=t?'https:':'http:';let n;try{n=JSON.parse(await(0,r.Xl)(`${s}//2004scape.org/api/v1/worldlist`))}catch(s){return await(0,r.Ho)(1e3),o(t,i,++e)}n.push({id:0,region:'Local Development',address:'http://localhost',portOffset:0,members:!0,hh:0});const h=n.find((t=>t.id===i));return h||o(t,i,10)}},7046:(t,i,e)=>{e.d(i,{A:()=>l});var s=e(1183),n=e(4583),r=e(9234),h=e(9091),o=e(2595),a=e(7854);class l{static getParameter(t){return new URLSearchParams(window.location.search).get(t)??''}static setParameter(t,i){const e=new URL(window.location.toString());e.searchParams.set(t,i),window.history.pushState(null,'',e.toString())}jl=0;zl=[];Zl=0;xo=null;state=0;ql=20;$l=1;Jl=[];Ql=0;tc=0;ic=[];ec=!0;sc=!1;nc=50;hasFocus=!0;rc=!1;hc=0;oc=0;Ma=0;Da=0;ac=0;lc=0;cc=0;fc=[];uc=[];dc=0;wc=0;input=null;yc=!1;mc=!1;Ac=!1;time=-1;gc=0;Ic=0;_c=0;Cc=0;Ec=0;vc=0;constructor(t=!1){a.bc.tabIndex=-1,a.zo.fillStyle='black',a.zo.fillRect(0,0,a.bc.width,a.bc.height),this.sc=t,this.sc?this.resize(window.innerWidth,window.innerHeight):this.resize(a.bc.width,a.bc.height)}get width(){return a.bc.width}get height(){return a.bc.height}resize=(t,i)=>{a.bc.width=t,a.bc.height=i,this.xo=new s.A(t,i),n.A.Tc()};Rc=async()=>{a.bc.addEventListener('resize',(()=>{this.sc&&this.resize(window.innerWidth,window.innerHeight)}),!1),a.bc.onmousedown=this.onmousedown,a.bc.onmouseup=this.onmouseup,a.bc.onmouseenter=this.onmouseenter,a.bc.onmouseleave=this.onmouseleave,a.bc.onmousemove=this.onmousemove,window.onbeforeunload=this.To,a.bc.onfocus=this.onfocus,a.bc.onblur=this.onblur,this.Oc?(a.bc.ontouchstart=this.ontouchstart,a.bc.ontouchend=this.ontouchend,a.bc.ontouchmove=this.ontouchmove):(a.bc.onkeydown=this.onkeydown,a.bc.onkeyup=this.onkeyup),a.bc.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.Oc&&'low'===l.getParameter('detail')&&(this.nc=30),await this.Go(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.Jl[t]=performance.now();let t,i=0,e=256,s=1,n=0;for(;this.state>=0;){if(this.state>0&&(this.state--,0===this.state))return void this.Lc();const h=e,o=s;e=300,s=1,t=performance.now();const a=this.Jl[i];if(0===a?(e=h,s=o):t>a&&(e=2560*this.ql/(t-a)|0),e<25?e=25:e>256&&(e=256,s=this.ql-(t-a)/10|0),this.Jl[i]=t,i=(i+1)%10,s>1)for(let t=0;t<10;t++)0!==this.Jl[t]&&(this.Jl[t]+=s);for(s0&&(this.Ql=1e3*e/(256*this.ql)|0);const l=performance.now();if(this.ec&&this.refresh(),await this.draw(),this.ic[this.tc]=(performance.now()-l)/1e3,this.tc=(this.tc+1)%this.ic.length,this.nc<50){const i=1e3/this.nc-(performance.now()-t);i>0&&await(0,r.Ho)(i)}}-1===this.state&&this.Lc()};Lc=()=>{this.state=-2,this.To()};Zo=t=>{this.ql=1e3/t|0};Sc=t=>{this.nc=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.ql|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};To=()=>{};draw=async()=>{};refresh=()=>{};async Go(t,i){const e=this.width,s=this.height;this.ec&&(a.zo.fillStyle='black',a.zo.fillRect(0,0,e,s),this.ec=!1);const n=s/2-18;a.zo.fillStyle='rgb(140, 17, 17)',a.zo.rect((e/2|0)-152,n,304,34),a.zo.fillRect((e/2|0)-150,n+2,3*t,30),a.zo.fillStyle='black',a.zo.fillRect((e/2|0)-150+3*t,n+2,300-3*t,30),a.zo.font='bold 13px helvetica, sans-serif',a.zo.textAlign='center',a.zo.fillStyle='white',a.zo.fillText(i,e/2|0,n+22),await(0,r.Ho)(5)}xc=()=>{let t=-1;return this.wc!==this.dc&&(t=this.uc[this.dc],this.dc=this.dc+1&127),t};get ms(){const t=this.ic.length;let i=0;for(let e=0;ethis.jl&&(this.jl=e),this.zl[this.Zl]=e,this.Zl=(this.Zl+1)%250,e}get kc(){return this.zl.reduce(((t,i)=>t+i),0)/250}onkeydown=t=>{const i=t.key;h.p.includes(i)&&t.preventDefault(),this.hc=0;const e=h.L[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;t.ctrlKey&&(n>='A'.charCodeAt(0)&&n<=']'.charCodeAt(0)||n=='_'.charCodeAt(0)?n-='A'.charCodeAt(0)-1:n>='a'.charCodeAt(0)&&n<='z'.charCodeAt(0)&&(n-='a'.charCodeAt(0)-1)),n<30&&(n=0),s===h.L.ArrowLeft.code?n=1:s===h.L.ArrowRight.code?n=2:s===h.L.ArrowUp.code?n=3:s===h.L.ArrowDown.code?n=4:s===h.L.Control.code?n=5:s===h.L.Shift.code?n=6:s===h.L.Alt.code?n=7:s===h.L.Backspace.code||s===h.L.Delete.code?n=8:s===h.L.Tab.code?n=9:s===h.L.Enter.code?n=10:s>=h.L.F1.code&&s<=h.L.F12.code?n=s+1008-h.L.F1.code:s===h.L.Home.code?n=1e3:s===h.L.End.code?n=1001:s===h.L.PageUp.code?n=1002:s===h.L.PageDown.code&&(n=1003),n>0&&n<128&&(this.fc[n]=1),n>4&&(this.uc[this.wc]=n,this.wc=this.wc+1&127),o.A.enabled&&o.A.Mc(n)};onkeyup=t=>{const i=t.key;h.p.includes(i)&&t.preventDefault(),this.hc=0;const e=h.L[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;n<30&&(n=0),s===h.L.ArrowLeft.code?n=1:s===h.L.ArrowRight.code?n=2:s===h.L.ArrowUp.code?n=3:s===h.L.ArrowDown.code?n=4:s===h.L.Control.code?n=5:s===h.L.Shift.code?n=6:s===h.L.Alt.code?n=7:s===h.L.Backspace.code||s===h.L.Delete.code?n=8:s===h.L.Tab.code?n=9:s===h.L.Enter.code?n=10:s>=h.L.F1.code&&s<=h.L.F12.code?n=s+1008-h.L.F1.code:s===h.L.Home.code?n=1e3:s===h.L.End.code?n=1001:s===h.L.PageUp.code?n=1002:s===h.L.PageDown.code&&(n=1003),n>0&&n<128&&(this.fc[n]=0),o.A.enabled&&o.A.Dc(n)};onmousedown=t=>{if(this.yc=!1,(t.clientX>0||t.clientY>0)&&this.Nc(t),this.hc=0,this.lc=this.Ma,this.cc=this.Da,this.Oc&&!this.Fc){if(this.Bc()||this.Uc()||this.Pc())return this.ac=1,void(this.oc=1);t.timeStamp>=this.time+500?(this.ac=2,this.oc=2):(this.ac=1,this.oc=1)}else 2===t.button?(this.ac=2,this.oc=2):(this.ac=1,this.oc=1);o.A.enabled&&o.A.Gc(this.lc,this.cc,t.buttons)};onmouseup=t=>{this.Nc(t),this.hc=0,this.oc=0,o.A.enabled&&o.A.Wc(t.buttons)};onmouseenter=t=>{this.Nc(t),o.A.enabled&&o.A.Hc()};onmouseleave=t=>{this.Nc(t),this.hc=0,this.Ma=-1,this.Da=-1,this.oc=0,this.lc=-1,this.cc=-1,o.A.enabled&&o.A.Yc()};onmousemove=t=>{this.Nc(t),this.hc=0,o.A.enabled&&o.A.Vc(this.Ma,this.Da)};onfocus=t=>{this.hasFocus=!0,this.ec=!0,this.refresh(),o.A.enabled&&o.A.Kc()};onblur=t=>{this.hasFocus=!1,o.A.enabled&&o.A.Xc()};ontouchstart=t=>{if(!this.Oc)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.yc=!0;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.gc=this.Ec=this._c=0|i.screenX,this.Ic=this.vc=this.Cc=0|i.screenY,this.time=t.timeStamp,this.mc=this.jc(),this.Ac=this.zc()};ontouchend=t=>{if(!this.Oc||!this.yc)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;if(this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.Ec=0|i.screenX,this.vc=0|i.screenY,this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.mc&&!this.jc())return void(this.yc=!1);if(this.Ac&&!this.zc())return void(this.yc=!1);if(this.Bc()||this.Zc()||this.Uc()||this.Pc()){null!==this.input&&(this.input.parentNode?.contains(this.input)&&this.input.parentNode?.removeChild(this.input),this.input=null);const t=document.createElement('input');return this.Uc()?(t.setAttribute('id','username'),t.setAttribute('placeholder','Username')):this.Pc()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.Bc()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.Zc()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this.qc?t.setAttribute('type','password'):t.setAttribute('type',this.Pc()?'password':'text'),t.setAttribute('autofocus','autofocus'),t.setAttribute('spellcheck','false'),t.setAttribute('autocomplete','off'),t.setAttribute('style',`position: fixed; left: ${e}px; top: ${s}px; width: 1px; height: 1px; opacity: 0;`),document.body.appendChild(t),t.focus(),t.click(),this.qc&&(t.oninput=t=>{if(!(t instanceof InputEvent))return;const i=t,e=i.data;null!==e&&'insertText'===i.inputType&&this.onkeydown(new KeyboardEvent('keydown',{key:e,code:e}))}),t.onkeydown=t=>{this.qc&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this.qc&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeyup(new KeyboardEvent('keyup',{key:t.key,code:t.key}))},t.onfocus=t=>{this.input?.parentNode?.removeChild(this.input),this.input=null,this.onfocus(t)},this.input=t,void(this.yc=!1)}const n=t.timeStamp>=this.time+500,r=Math.abs(this.gc-this.Ec)>16||Math.abs(this.Ic-this.vc)>16;n&&!r?(this.yc=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.oc=0,this.yc=!1)};ontouchmove=t=>{if(!this.Oc||!this.yc)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.Ec=0|i.screenX,this.vc=0|i.screenY,this.mc&&-1===this.Fo()?(this._c-this.Ec>0?this.rotate(2):this._c-this.Ec<0&&this.rotate(0),this.Cc-this.vc>0?this.rotate(3):this.Cc-this.vc<0&&this.rotate(1)):(this.Ac||-1!==this.Fo())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this._c=this.Ec,this.Cc=this.vc};get Oc(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get qc(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get Fc(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}jc=()=>this.rc&&this.Ma>=8&&this.Ma<=520&&this.Da>=11&&this.Da<=345;Bc=()=>this.rc&&-1===this.No()&&!this.Mo()&&!this.Do()&&this.Ma>=11&&this.Ma<=506&&this.Da>=449&&this.Da<=482;Zc=()=>this.rc&&(this.Mo()||this.Do())&&this.Ma>=11&&this.Ma<=506&&this.Da>=383&&this.Da<=482;zc=()=>this.rc&&this.Ma>=562&&this.Ma<=752&&this.Da>=231&&this.Da<=492;Uc=()=>!this.rc&&2===this.ko()&&this.Ma>=301&&this.Ma<=562&&this.Da>=262&&this.Da<=279;Pc=()=>!this.rc&&2===this.ko()&&this.Ma>=301&&this.Ma<=562&&this.Da>=279&&this.Da<=296;rotate=t=>{0===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowLeft',code:'ArrowLeft'}))):1===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowUp',code:'ArrowUp'}))):2===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowRight',code:'ArrowRight'}))):3===t&&(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowDown',code:'ArrowDown'})))};$c=()=>null!==document.fullscreenElement;Nc=t=>{if(this.$c()){const i=t.target.getBoundingClientRect(),e=window.innerHeight/a.bc.height,s=(window.innerWidth-a.bc.width*e)/2;this.Ma=0|this.Jc(t.clientX-i.left-s,0,a.bc.width*e,0,789),this.Da=0|this.Jc(t.clientY-i.top,0,a.bc.height*e,0,532)}else{const i=a.bc.getBoundingClientRect(),e=a.bc.width/i.width,s=a.bc.height/i.height;this.Ma=(t.clientX-i.left)*e|0,this.Da=(t.clientY-i.top)*s|0}this.Ma<0&&(this.Ma=0),this.Da<0&&(this.Da=0),this.Ma>789&&(this.Ma=789),this.Da>532&&(this.Da=532)};Jc=(t,i,e,s,n)=>(t-i)*(n-s)/(e-i)+s}},2595:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1069);class n{static enabled=!1;static Qc=null;static tf=null;static if=0;static ef=0;static sf=0;static nf=0;static rf=0;static hf=()=>{this.Qc=s.A.Ut(1),this.tf=null,this.if=performance.now(),this.enabled=!0};static af=()=>{this.enabled=!1,this.Qc=null};static flush=()=>{let t=null;return this.tf&&this.enabled&&(t=this.tf),this.tf=null,t};static stop=()=>{let t=null;return this.Qc&&this.Qc.lf>0&&this.enabled&&(t=this.Qc),this.af(),t};static Gc=(t,i,e)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;this.ef++;const s=performance.now();let n=(s-this.if)/10|0;n>250&&(n=250),this.if=s,this.cf(5),1===e?this.Qc?.p1(1):this.Qc?.p1(2),this.Qc?.p1(n),this.Qc?.p3(t+(i<<10))};static Wc=t=>{if(!this.enabled)return;this.ef++;const i=performance.now();let e=(i-this.if)/10|0;e>250&&(e=250),this.if=i,this.cf(2),1===t?this.Qc?.p1(3):this.Qc?.p1(4),this.Qc?.p1(e)};static Vc=(t,i)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;const e=performance.now();if(e-this.sf>=50){this.sf=e,this.ef++;let s=(e-this.if)/10|0;s>250&&(s=250),this.if=e,t-this.nf<8&&t-this.nf>=-8&&i-this.rf<8&&i-this.rf>=-8?(this.cf(3),this.Qc?.p1(5),this.Qc?.p1(s),this.Qc?.p1(t+(i-this.rf+8<<4)+8-this.nf)):t-this.nf<128&&t-this.nf>=-128&&i-this.rf<128&&i-this.rf>=-128?(this.cf(4),this.Qc?.p1(6),this.Qc?.p1(s),this.Qc?.p1(t+128-this.nf),this.Qc?.p1(i+128-this.rf)):(this.cf(5),this.Qc?.p1(7),this.Qc?.p1(s),this.Qc?.p3(t+(i<<10))),this.nf=t,this.rf=i}};static Mc=t=>{if(!this.enabled)return;this.ef++;const i=performance.now();let e=(i-this.if)/10|0;e>250&&(e=250),this.if=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.cf(3),this.Qc?.p1(8),this.Qc?.p1(e),this.Qc?.p1(t)};static Dc=t=>{if(!this.enabled)return;this.ef++;const i=performance.now();let e=(i-this.if)/10|0;e>250&&(e=250),this.if=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.cf(3),this.Qc?.p1(9),this.Qc?.p1(e),this.Qc?.p1(t)};static Kc=()=>{if(!this.enabled)return;this.ef++;const t=performance.now();let i=(t-this.if)/10|0;i>250&&(i=250),this.if=t,this.cf(2),this.Qc?.p1(10),this.Qc?.p1(i)};static Xc=()=>{if(!this.enabled)return;this.ef++;const t=performance.now();let i=(t-this.if)/10|0;i>250&&(i=250),this.if=t,this.cf(2),this.Qc?.p1(11),this.Qc?.p1(i)};static Hc=()=>{if(!this.enabled)return;this.ef++;const t=performance.now();let i=(t-this.if)/10|0;i>250&&(i=250),this.if=t,this.cf(2),this.Qc?.p1(12),this.Qc?.p1(i)};static Yc=()=>{if(!this.enabled)return;this.ef++;const t=performance.now();let i=(t-this.if)/10|0;i>250&&(i=250),this.if=t,this.cf(2),this.Qc?.p1(13),this.Qc?.p1(i)};static cf=t=>{if(this.Qc&&this.Qc.lf+t>=500){const t=this.Qc;this.Qc=s.A.Ut(1),this.tf=t}}}},9091:(t,i,e)=>{e.d(i,{L:()=>s,p:()=>n});const s={'Backspace':{code:8,ch:8},'Enter':{code:10,ch:10},'Shift':{code:16,ch:65535},'Escape':{code:27,ch:27},'Tab':{code:9,ch:9},'CapsLock':{code:20,ch:65535},' ':{code:32,ch:32},'Control':{code:17,ch:65535},'Alt':{code:18,ch:65535},'Meta':{code:524,ch:65535},'ArrowLeft':{code:37,ch:65535},'ArrowRight':{code:39,ch:65535},'ArrowUp':{code:38,ch:65535},'ArrowDown':{code:40,ch:65535},'Insert':{code:155,ch:65535},'Home':{code:36,ch:65535},'PageUp':{code:33,ch:65535},'Delete':{code:127,ch:127},'End':{code:35,ch:65535},'PageDown':{code:34,ch:65535},'`':{code:192,ch:96},'~':{code:192,ch:126},'!':{code:49,ch:33},'@':{code:50,ch:64},'#':{code:51,ch:35},'$':{code:52,ch:36},'%':{code:53,ch:37},'^':{code:54,ch:94},'&':{code:55,ch:38},'*':{code:56,ch:42},'(':{code:57,ch:40},')':{code:48,ch:41},'-':{code:45,ch:45},'_':{code:45,ch:95},'=':{code:61,ch:61},'+':{code:61,ch:43},'[':{code:91,ch:91},'{':{code:91,ch:123},']':{code:93,ch:93},'}':{code:93,ch:125},'\\':{code:92,ch:92},'|':{code:92,ch:124},';':{code:59,ch:59},':':{code:59,ch:58},"'":{code:222,ch:39},'"':{code:222,ch:34},',':{code:44,ch:44},'<':{code:44,ch:60},'.':{code:46,ch:46},'>':{code:46,ch:62},'/':{code:47,ch:47},'?':{code:47,ch:63},'F1':{code:112,ch:65535},'F2':{code:113,ch:65535},'F3':{code:114,ch:65535},'F4':{code:115,ch:65535},'F5':{code:116,ch:65535},'F6':{code:117,ch:65535},'F7':{code:118,ch:65535},'F8':{code:119,ch:65535},'F9':{code:120,ch:65535},'F10':{code:121,ch:65535},'F11':{code:122,ch:65535},'F12':{code:123,ch:65535},0:{code:48,ch:48},1:{code:49,ch:49},2:{code:50,ch:50},3:{code:51,ch:51},4:{code:52,ch:52},5:{code:53,ch:53},6:{code:54,ch:54},7:{code:55,ch:55},8:{code:56,ch:56},9:{code:57,ch:57},'a':{code:65,ch:97},'b':{code:66,ch:98},'c':{code:67,ch:99},'d':{code:68,ch:100},'e':{code:69,ch:101},'f':{code:70,ch:102},'g':{code:71,ch:103},'h':{code:72,ch:104},'i':{code:73,ch:105},'j':{code:74,ch:106},'k':{code:75,ch:107},'l':{code:76,ch:108},'m':{code:77,ch:109},'n':{code:78,ch:110},'o':{code:79,ch:111},'p':{code:80,ch:112},'q':{code:81,ch:113},'r':{code:82,ch:114},'s':{code:83,ch:115},'t':{code:84,ch:116},'u':{code:85,ch:117},'v':{code:86,ch:118},'w':{code:87,ch:119},'x':{code:88,ch:120},'y':{code:89,ch:121},'z':{code:90,ch:122},'A':{code:65,ch:65},'B':{code:66,ch:66},'C':{code:67,ch:67},'D':{code:68,ch:68},'E':{code:69,ch:69},'F':{code:70,ch:70},'G':{code:71,ch:71},'H':{code:72,ch:72},'I':{code:73,ch:73},'J':{code:74,ch:74},'K':{code:75,ch:75},'L':{code:76,ch:76},'M':{code:77,ch:77},'N':{code:78,ch:78},'O':{code:79,ch:79},'P':{code:80,ch:80},'Q':{code:81,ch:81},'R':{code:82,ch:82},'S':{code:83,ch:83},'T':{code:84,ch:84},'U':{code:85,ch:85},'V':{code:86,ch:86},'W':{code:87,ch:87},'X':{code:88,ch:88},'Y':{code:89,ch:89},'Z':{code:90,ch:90}},n=['Tab','F1','F2','F3','F4','F5','F6','F7','F8','F9','F10','ArrowLeft','ArrowRight','ArrowUp','ArrowDown']},1120:(t,i,e)=>{e.d(i,{A:()=>c});var s=e(1069),n=e(8665),r=e(2679),h=e(2511),o=e(3819),a=e(3867),l=e(8950);class c{static Lo=[];static ff=null;static So=null;static Ea=0;static uf=1;static ba=2;static Ha=3;static Va=4;static il=5;static nl=6;static ul=7;static df=1;static wf=2;static yf=3;static mf=4;static Af=5;static Za=6;static yl=1;static ml=100;static Al=101;static pl=200;static pf=201;static gf=202;static gl=203;static If=205;static _f=300;static Cf=301;static Ef=302;static vf=303;static bf=304;static Tf=305;static Rf=306;static Of=307;static Lf=308;static Sf=309;static xf=310;static kf=311;static Mf=312;static Df=313;static Nf=314;static Ff=315;static Bf=316;static Uf=317;static Pf=318;static Gf=319;static Wf=320;static Hf=321;static Yf=322;static Vf=323;static Dl=324;static Nl=325;static Kf=326;static bl=327;static Il=401;static _l=500;static Xf=501;static jf=502;static vl=503;static Fl=600;static zf=601;static Zf=602;static qf=603;static $f=604;static Jf=605;static Qf=606;static tu=607;static iu=608;static eu=609;static su=610;static nu=611;static ru=612;static Bl=613;static Ul=650;static Wl=651;static Hl=652;static Yl=653;static Vl=654;static Pl=655;static hu=(t,i,e)=>{this.ff=new r.A(5e4),this.So=new r.A(5e4);const n=new s.A(t.read('data'));let h=-1;for(n.lf+=2;n.lf0){s.$o=new Uint8Array(r),s.Qo=new Uint16Array(r);for(let t=0;t0){s.scripts=new a.fe(o,null);for(let t=0;t0){const n=e.lastIndexOf(',');s.Wa[t]=this.yu(i,e.substring(0,n),parseInt(e.substring(n+1),10))}}s.mu=new a.fe(5,null);for(let t=0;t<5;t++){const i=n.wu;s.mu[t]=i,0===i.length&&(s.mu[t]=null)}}if(s.type===c.Ha&&(s.fill=1===n.lu),s.type===c.Va||s.type===c.uf){s.$a=1===n.lu;const t=n.lu;e&&(s.font=e[t]),s.Qa=1===n.lu}if(s.type===c.Va&&(s.text=n.wu,s.ja=n.wu),s.type!==c.uf&&s.type!==c.Ha&&s.type!==c.Va||(s.Ya=n.Ko),s.type!==c.Ha&&s.type!==c.Va||(s.Xa=n.Ko,s.Ka=n.Ko),s.type===c.il){const t=n.wu;if(t.length>0){const e=t.lastIndexOf(',');s.sl=this.yu(i,t.substring(0,e),parseInt(t.substring(e+1),10))}const e=n.wu;if(e.length>0){const t=e.lastIndexOf(',');s.el=this.yu(i,e.substring(0,t),parseInt(e.substring(t+1),10))}}if(s.type===c.nl){const t=n.lu;0!==t&&(s.model=this.al((t-1<<8)+n.lu));const i=n.lu;0!==i&&(s.Au=this.al((i-1<<8)+n.lu)),s.la=n.lu,0===s.la?s.la=-1:s.la=(s.la-1<<8)+n.lu,s.ca=n.lu,0===s.ca?s.ca=-1:s.ca=(s.ca-1<<8)+n.lu,s.zoom=n.ou,s.ol=n.ou,s.fl=n.ou}if(s.type===c.ul){s.Oa=new Int32Array(s.width*s.height),s.La=new Int32Array(s.width*s.height),s.$a=1===n.lu;const t=n.lu;e&&(s.font=e[t]),s.Qa=1===n.lu,s.Ya=n.Ko,s.Sa=n.fu,s.xa=n.fu,s.uu=1===n.lu,s.mu=new a.fe(5,null);for(let t=0;t<5;t++){const i=n.wu;s.mu[t]=i,0===i.length&&(s.mu[t]=null)}}s.za!==c.wf&&s.type!==c.ba||(s.pu=n.wu,s.action=n.wu,s.gu=n.ou),s.za!==c.df&&s.za!==c.mf&&s.za!==c.Af&&s.za!==c.Za||(s.Iu=n.wu,0===s.Iu.length&&(s.za===c.df?s.Iu='Ok':s.za===c.mf||s.za===c.Af?s.Iu='Select':s.za===c.Za&&(s.Iu='Continue')))}this.ff=null,this.So=null};static yu=(t,i,e)=>{const s=o.A._u(i)<<8n|BigInt(e);if(this.ff){const t=this.ff.get(s);if(t)return t}let n;try{n=h.A.Cu(t,i,e),this.ff?.put(s,n)}catch(t){return null}return n};static al=t=>{if(this.So){const i=this.So.get(BigInt(t));if(i)return i}const i=n.A.model(t);return this.So?.put(BigInt(t),i),i};id=-1;au=-1;type=-1;za=-1;_a=0;width=0;height=0;cu=-1;$o=null;Qo=null;scripts=null;scroll=0;hide=!1;draggable=!1;uu=!1;du=!1;Sa=0;xa=0;Ta=null;Ra=null;Wa=null;mu=null;fill=!1;$a=!1;font=null;Qa=!1;text=null;ja=null;Ya=0;Xa=0;Ka=0;sl=null;el=null;model=null;Au=null;la=-1;ca=-1;zoom=0;ol=0;fl=0;pu=null;action=null;gu=-1;Iu=null;aa=null;Aa=null;pa=null;x=0;y=0;va=0;Oa=null;La=null;ua=0;fa=0;al(t,i,e){let s=this.model;if(e&&(s=this.Au),!s)return null;if(-1===t&&-1===i&&!s.Eu)return s;const r=n.A.vu(s,!0,!0,!1);return-1===t&&-1===i||r.xl(),-1!==t&&r.kl(t),-1!==i&&r.kl(i),r.Ml(64,768,-50,-10,-50,!0),r}bu(){if(this.au===this.id)return this.x;let t=c.Lo[this.au];if(!t.aa||!t.Aa||!t.pa)return this.x;let i=t.aa.indexOf(this.id);if(-1===i)return this.x;let e=t.Aa[i];for(;t.au!==t.id;){const s=c.Lo[t.au];s.aa&&s.Aa&&s.pa&&(i=s.aa.indexOf(t.id),-1!==i&&(e+=s.Aa[i])),t=s}return e}Tu(){if(this.au===this.id)return this.y;let t=c.Lo[this.au];if(!t.aa||!t.Aa||!t.pa)return this.y;let i=t.aa.indexOf(this.id);if(-1===i)return this.y;let e=t.pa[i];for(;t.au!==t.id;){const s=c.Lo[t.au];s.aa&&s.Aa&&s.pa&&(i=s.aa.indexOf(t.id),-1!==i&&(e+=s.pa[i])),t=s}return e}outline(t){const i=this.bu(),e=this.Tu();l.A.ga(i,e,this.width,this.height,t)}move(t,i){if(this.au===this.id)return;this.x=0,this.y=0;const e=c.Lo[this.au];if(e.aa&&e.Aa&&e.pa){const s=e.aa.indexOf(this.id);-1!==s&&(e.Aa[s]=t,e.pa[s]=i)}}delete(){if(this.au===this.id)return;const t=c.Lo[this.au];if(t.aa&&t.Aa&&t.pa){const i=t.aa.indexOf(this.id);-1!==i&&(t.aa.splice(i,1),t.Aa.splice(i,1),t.pa.splice(i,1))}}}},6333:(t,i,e)=>{e.d(i,{$:()=>s});class s{id;Ru=null;constructor(t){this.id=t}Ou(t){for(;;){const i=t.lu;if(0===i)break;this.decode(i,t)}return this}}},2164:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(6333);class r extends n.${static count=0;static Lo=[];static hu=t=>{const i=new s.A(t.read('flo.dat'));this.count=i.ou;for(let t=0;t(e>179&&(i=i/2|0),e>192&&(i=i/2|0),e>217&&(i=i/2|0),e>243&&(i=i/2|0),(t/4<<10)+(i/32<<7)+(e/2|0));static Su=(t,i)=>-1===t?12345678:((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);static xu=(t,i)=>-2===t?12345678:-1===t?(i<0?i=0:i>127&&(i=127),127-i):((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);ku=0;texture=-1;Mu=!1;Du=!0;Nu=0;Fu=0;Bu=0;Uu=0;Pu=0;Gu=0;decode(t,i){1===t?(this.ku=i.Wu,this.setColor(this.ku)):2===t?this.texture=i.lu:3===t?this.Mu=!0:5===t?this.Du=!1:6===t?this.Ru=i.wu:console.log('Error unrecognised config code: ',t)}setColor(t){const i=(t>>16&255)/256,e=(t>>8&255)/256,s=(255&t)/256;let n=i;ei&&(h=e),s>h&&(h=s);let o=0,a=0;const l=(n+h)/2;n!==h&&(l<.5&&(a=(h-n)/(h+n)),l>=.5&&(a=(h-n)/(2-h-n)),i===h?o=(e-s)/(h-n):e===h?o=(s-i)/(h-n)+2:s===h&&(o=(i-e)/(h-n)+4)),o/=6,this.Nu=256*o|0,this.Fu=256*a|0,this.Bu=256*l|0,this.Fu<0?this.Fu=0:this.Fu>255&&(this.Fu=255),this.Bu<0?this.Bu=0:this.Bu>255&&(this.Bu=255),this.Uu=l>.5?(1-l)*a*512|0:l*a*512|0,this.Uu<1&&(this.Uu=1),this.Pu=o*this.Uu|0;let c=this.Nu+(16*Math.random()|0)-8;c<0?c=0:c>255&&(c=255);let f=this.Fu+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255);let u=this.Bu+(48*Math.random()|0)-24;u<0?u=0:u>255&&(u=255),this.Gu=r.Lu(c,f,u)}}},8317:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(1069),n=e(6333),r=e(8665),h=e(3867);class o extends n.${static count=0;static Lo=[];static hu=t=>{const i=new s.A(t.read('idk.dat'));this.count=i.ou;for(let t=0;t=40&&t<50)this.Vu[t-40]=i.ou;else if(t>=50&&t<60)this.Ku[t-50]=i.ou;else{if(!(t>=60&&t<70))throw new Error(`Unrecognized idk config code: ${t}`);this.Yu[t-60]=i.ou}}al(){if(!this.Hu)return null;const t=new h.fe(this.Hu.length,null);for(let i=0;i{e.d(i,{A:()=>c});var s=e(6333),n=e(1069),r=e(2679),h=e(8665),o=e(1023),a=e(6169),l=e(3867);class c extends s.${static count=0;static cache=null;static ju=null;static zu=null;static Zu=0;static qu=new r.A(500);static $u=new r.A(30);static hu=t=>{this.ju=new n.A(t.read('loc.dat'));const i=new n.A(t.read('loc.idx'));this.count=i.ou,this.zu=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.zu||!this.ju)throw new Error('LocType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Zu=(this.Zu+1)%10;const i=this.cache[this.Zu];return this.ju.lf=this.zu[t],i.id=t,i.reset(),i.Ou(this.ju),i.Ju||(i.Ju=new Int32Array(1)),-1===i.Qu&&i.Ju&&(i.active=i.Ju.length>0&&i.Ju[0]===o.A.td.id,i.ed&&(i.active=!0)),i};static To=()=>{this.qu=null,this.$u=null,this.zu=null,this.cache=null,this.ju=null};Hu=null;Ju=null;name=null;sd=null;Vu=null;Ku=null;width=1;length=1;nd=!0;rd=!0;active=!1;Qu=-1;hd=!1;od=!1;Du=!1;la=-1;ad=!1;ld=16;fd=0;ud=0;ed=null;dd=-1;wd=-1;yd=!1;md=!0;Ad=128;pd=128;gd=128;Id=0;_d=0;Cd=0;Ed=0;vd=!1;decode(t,i){if(1===t){const t=i.lu;this.Hu=new Int32Array(t),this.Ju=new Int32Array(t);for(let e=0;e=30&&t<39)this.ed||(this.ed=new l.fe(5,null)),this.ed[t-30]=i.wu,'hidden'===this.ed[t-30]?.toLowerCase()&&(this.ed[t-30]=null);else if(40===t){const t=i.lu;this.Vu=new Uint16Array(t),this.Ku=new Uint16Array(t);for(let e=0;e=this.Hu.length)return null;let d=this.Hu[l];if(-1===d)return null;const w=this.yd!==i>3;w&&(d+=65536);let y=c.qu?.get(BigInt(d));y||(y=h.A.model(65535&d),w&&y.kd(),c.qu?.put(BigInt(d),y));const m=128!==this.Ad||128!==this.pd||128!==this.gd,A=0!==this._d||0!==this.Cd||0!==this.Ed;let p=h.A.vu(y,!this.Vu,!this.ad,i===a.A.Md&&-1===o&&!m&&!A);for(-1!==o&&(p.xl(),p.kl(o),p.Dd=null,p.Nd=null);i-- >0;)p.Fd();if(this.Vu&&this.Ku)for(let t=0;t{e.d(i,{A:()=>n});var s=e(6333);class n extends s.${static count=0;static Lo=[];static hu=t=>{this.count=t.ou;for(let i=0;i=1&&t<5)this.Pd[t-1]=i.ou;else{if(250!==t)throw new Error(`Unrecognized mesanim config code: ${t}`);this.Ru=i.wu}}}},6948:(t,i,e)=>{e.d(i,{A:()=>a});var s=e(6333),n=e(1069),r=e(2679),h=e(8665),o=e(3867);class a extends s.${static count=0;static cache=null;static ju=null;static zu=null;static Zu=0;static So=new r.A(30);static hu=t=>{this.ju=new n.A(t.read('npc.dat'));const i=new n.A(t.read('npc.idx'));this.count=i.ou,this.zu=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.zu||!this.ju)throw new Error('NpcType not loaded!!!');for(let i=0;i<20;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Zu=(this.Zu+1)%20;const i=this.cache[this.Zu]=new a(t);return this.ju.lf=this.zu[t],i.Ou(this.ju),i};static To=()=>{this.So=null,this.zu=null,this.cache=null,this.ju=null};name=null;sd=null;size=1;Hu=null;Yu=null;ad=!1;Gd=-1;Wd=-1;Hd=-1;Yd=-1;Vd=-1;Vu=null;Ku=null;ed=null;Ad=-1;pd=-1;gd=-1;Kd=!0;Xd=-1;jd=128;zd=128;decode(t,i){if(1===t){const t=i.lu;this.Hu=new Uint16Array(t);for(let e=0;e=30&&t<40)this.ed||(this.ed=new o.fe(5,null)),this.ed[t-30]=i.wu,'hidden'===this.ed[t-30]?.toLowerCase()&&(this.ed[t-30]=null);else if(40===t){const t=i.lu;this.Vu=new Uint16Array(t),this.Ku=new Uint16Array(t);for(let e=0;e{e.d(i,{A:()=>u});var s=e(6333),n=e(1069),r=e(2511),h=e(2679),o=e(8665),a=e(4583),l=e(8950),c=e(9298),f=e(3867);class u extends s.${static count=0;static cache=null;static ju=null;static zu=null;static Zu=0;static tw=!0;static So=new h.A(50);static iw=new h.A(200);static hu=(t,i)=>{this.tw=i,this.ju=new n.A(t.read('obj.dat'));const e=new n.A(t.read('obj.idx'));this.count=e.ou,this.zu=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.zu||!this.ju)throw new Error('ObjType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Zu=(this.Zu+1)%10;const i=this.cache[this.Zu];return this.ju.lf=this.zu[t],i.id=t,i.reset(),i.Ou(this.ju),-1!==i.ew&&i.sw(),!this.tw&&i.members&&(i.name='Members Object',i.sd="Login to a members' server to use this object.",i.ed=null,i.nw=null),i};static To=()=>{this.So=null,this.iw=null,this.zu=null,this.cache=null,this.ju=null};static ka=(t,i)=>{if(u.iw){let e=u.iw.get(BigInt(t));if(e&&e.rw!==i&&-1!==e.rw&&(e.hw(),e=null),e)return e}let e=u.get(t);if(e.ow||(i=-1),e.ow&&e.aw&&i>1){let t=-1;for(let s=0;s<10;s++)i>=e.aw[s]&&0!==e.aw[s]&&(t=e.ow[s]);-1!==t&&(e=u.get(t))}const s=new r.A(32,32),n=a.A.rl,h=a.A.hl,o=a.A.lw,f=l.A.cw,d=l.A.fw,w=l.A.uw,y=l.A.left,m=l.A.right,A=l.A.top,p=l.A.bottom;a.A.dw=!1,l.A.bind(s.cw,32,32),l.A.fillRect(0,0,32,32,c.A.Pa),a.A.Tc();const g=e.ww(1),I=a.A.sin[e.yw]*e.mw>>16,_=a.A.cos[e.yw]*e.mw>>16;g.cl(0,e.Aw,e.pw,e.yw,e.gw,I+(g.Ud/2|0)+e.Iw,_+e.Iw);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.cw[t+32*i]&&(t>0&&s.cw[t+32*i-1]>1||i>0&&s.cw[t+32*(i-1)]>1||t<31&&s.cw[t+32*i+1]>1||i<31&&s.cw[t+32*(i+1)]>1)&&(s.cw[t+32*i]=1);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.cw[t+32*i]&&t>0&&i>0&&s.cw[t+32*(i-1)-1]>0&&(s.cw[t+32*i]=3153952);if(-1!==e.ew){const t=this.ka(e._w,10),i=t.Fa,s=t.rw;t.Fa=32,t.rw=32,t.Cw(5,5,22,22),t.Fa=i,t.rw=s}return u.iw?.put(BigInt(t),s),l.A.bind(f,d,w),l.A.ma(y,A,m,p),a.A.rl=n,a.A.hl=h,a.A.lw=o,a.A.dw=!0,e.dl?s.Fa=33:s.Fa=32,s.rw=i,s};model=0;name=null;sd=null;Vu=null;Ku=null;mw=2e3;yw=0;Aw=0;pw=0;gw=0;Iw=0;Ew=!1;bw=-1;dl=!1;Tw=1;members=!1;ed=null;nw=null;Rw=-1;Ow=-1;Lw=0;Sw=-1;xw=-1;kw=0;Mw=-1;Dw=-1;Nw=-1;Fw=-1;Bw=-1;Uw=-1;ow=null;aw=null;_w=-1;ew=-1;decode(t,i){if(1===t)this.model=i.ou;else if(2===t)this.name=i.wu;else if(3===t)this.sd=i.wu;else if(4===t)this.mw=i.ou;else if(5===t)this.yw=i.ou;else if(6===t)this.Aw=i.ou;else if(7===t)this.gw=i.fu,this.gw>32767&&(this.gw-=65536);else if(8===t)this.Iw=i.fu,this.Iw>32767&&(this.Iw-=65536);else if(9===t)this.Ew=!0;else if(10===t)this.bw=i.ou;else if(11===t)this.dl=!0;else if(12===t)this.Tw=i.Ko;else if(16===t)this.members=!0;else if(23===t)this.Rw=i.ou,this.Lw=i.bd;else if(24===t)this.Ow=i.ou;else if(25===t)this.Sw=i.ou,this.kw=i.bd;else if(26===t)this.xw=i.ou;else if(t>=30&&t<35)this.ed||(this.ed=new f.fe(5,null)),this.ed[t-30]=i.wu,'hidden'===this.ed[t-30]?.toLowerCase()&&(this.ed[t-30]=null);else if(t>=35&&t<40)this.nw||(this.nw=new f.fe(5,null)),this.nw[t-35]=i.wu;else if(40===t){const t=i.lu;this.Vu=new Uint16Array(t),this.Ku=new Uint16Array(t);for(let e=0;e=100&&t<110&&(this.ow&&this.aw||(this.ow=new Uint16Array(10),this.aw=new Uint16Array(10)),this.ow[t-100]=i.ou,this.aw[t-100]=i.ou)}Pw(t){let i=this.Rw;if(1===t&&(i=this.Sw),-1===i)return null;let e=this.Ow,s=this.Mw;1===t&&(e=this.xw,s=this.Dw);let n=o.A.model(i);if(-1!==e){const t=o.A.model(e);if(-1===s){const i=[n,t];n=o.A.Tl(i,2)}else{const i=[n,t,o.A.model(s)];n=o.A.Tl(i,3)}}if(0===t&&0!==this.Lw&&n.translate(this.Lw,0,0),1===t&&0!==this.kw&&n.translate(this.kw,0,0),this.Vu&&this.Ku)for(let t=0;t1){let i=-1;for(let e=0;e<10;e++)t>=this.aw[e]&&0!==this.aw[e]&&(i=this.ow[e]);if(-1!==i)return u.get(i).ww(1)}if(u.So){const t=u.So.get(BigInt(this.id));if(t)return t}const i=o.A.model(this.model);if(this.Vu&&this.Ku)for(let t=0;t{e.d(i,{A:()=>h});var s=e(6333),n=e(1069),r=e(6730);class h extends s.${static count=0;static Lo=[];static hu=t=>{const i=new n.A(t.read('seq.dat'));this.count=i.ou;for(let t=0;t{e.d(i,{A:()=>a});var s=e(6333),n=e(1069),r=e(1312),h=e(8665),o=e(2679);class a extends s.${static count=0;static Lo=[];static So=new o.A(30);static hu=t=>{const i=new n.A(t.read('spotanim.dat'));this.count=i.ou;for(let t=0;t=40&&t<50)this.Vu[t-40]=i.ou;else{if(!(t>=50&&t<60))throw new Error(`Unrecognized spotanim config code: ${t}`);this.Ku[t-50]=i.ou}}al(){let t=a.So?.get(BigInt(this.id));if(t)return t;t=h.A.model(this.model);for(let i=0;i<6;i++)0!==this.Vu[0]&&t.Rl(this.Vu[i],this.Ku[i]);return a.So?.put(BigInt(this.id),t),t}}},3764:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(6333),n=e(1069);class r extends s.${static count=0;static Lo=[];static Xw=[];static jw=0;static hu=t=>{const i=new n.A(t.read('varp.dat'));this.count=i.ou;for(let t=0;t{e.d(i,{A:()=>s});class s{static OPEN=0;static Qw=1;static ty=2;static iy=4;static ey=8;static sy=s.Qw<<4;static ny=s.ty<<4;static hy=s.iy<<4;static oy=s.ey<<4;static ly=256;static uy=512;static wy=1024;static yy=2048;static my=4096;static Ay=s.uy<<4;static py=s.wy<<4;static gy=s.yy<<4;static Iy=s.my<<4;static _y=s.ly<<9;static Cy=524288;static Ey=2097152;static vy=s.Ey|s.Cy;static by=s.ly|s.vy;static Ty=s.ty|s.by;static Ry=s.ey|s.by;static Oy=s.ty|s.iy|s.Ry;static Ly=s.ny|s.by;static Sy=s.ey|s.sy|s.Ly;static xy=s.oy|s.by;static ky=s.Qw|s.ty|s.xy;static My=s.ny|s.hy|s.xy;static Dy=16777215}},670:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(9456),n=e(6169),r=e(1023),h=e(4909);class o{static Dr=4;static jr=104;static index=(t,i)=>t*o.jr+i;offsetX;Ny;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.Ny=0,this.sizeX=o.jr,this.sizeZ=o.jr,this.flags=new Int32Array(this.sizeX*this.sizeZ),this.reset()}reset=()=>{for(let t=0;t{this.flags[o.index(t-this.offsetX,i-this.Ny)]|=s.A.Ey};By=(t,i)=>{this.flags[o.index(t-this.offsetX,i-this.Ny)]&=~s.A.Ey};Uy=(t,i,e,r,h,o)=>{let a=s.A.ly;o&&(a|=s.A._y);const l=t-this.offsetX,c=i-this.Ny;if(h===n.A.Py||h===n.A.Gy){const t=e;e=r,r=t}for(let t=l;t=0&&t=0&&i{let a=s.A.ly;o&&(a|=s.A._y);const l=t-this.offsetX,c=i-this.Ny;if(h===n.A.Py||h===n.A.Gy){const t=e;e=r,r=t}for(let t=l;t=0&&t=0&&i{const a=t-this.offsetX,l=i-this.Ny,c=o?s.A.Iy:s.A.oy,f=o?s.A.my:s.A.ey,u=o?s.A.wy:s.A.ty,d=o?s.A.py:s.A.ny,w=o?s.A.uy:s.A.Qw,y=o?s.A.Ay:s.A.sy,m=o?s.A.yy:s.A.iy,A=o?s.A.gy:s.A.hy;e===r.A.Yy.id?h===n.A.Md?(this.add(a,l,c),this.add(a-1,l,f)):h===n.A.Py?(this.add(a,l,u),this.add(a,l+1,d)):h===n.A.Vy?(this.add(a,l,f),this.add(a+1,l,c)):h===n.A.Gy&&(this.add(a,l,d),this.add(a,l-1,u)):e===r.A.Ky.id||e===r.A.Xy.id?h===n.A.Md?(this.add(a,l,w),this.add(a-1,l+1,y)):h===n.A.Py?(this.add(a,l,m),this.add(a+1,l+1,A)):h===n.A.Vy?(this.add(a,l,y),this.add(a+1,l-1,w)):h===n.A.Gy&&(this.add(a,l,A),this.add(a-1,l-1,m)):e===r.A.jy.id&&(h===n.A.Md?(this.add(a,l,u|c),this.add(a-1,l,f),this.add(a,l+1,d)):h===n.A.Py?(this.add(a,l,u|f),this.add(a,l+1,d),this.add(a+1,l,c)):h===n.A.Vy?(this.add(a,l,d|f),this.add(a+1,l,c),this.add(a,l-1,u)):h===n.A.Gy&&(this.add(a,l,d|c),this.add(a,l-1,u),this.add(a-1,l,f))),o&&this.Hy(t,i,e,h,!1)};zy=(t,i,e,h,o)=>{const a=t-this.offsetX,l=i-this.Ny,c=o?s.A.Iy:s.A.oy,f=o?s.A.my:s.A.ey,u=o?s.A.wy:s.A.ty,d=o?s.A.py:s.A.ny,w=o?s.A.uy:s.A.Qw,y=o?s.A.Ay:s.A.sy,m=o?s.A.yy:s.A.iy,A=o?s.A.gy:s.A.hy;e===r.A.Yy.id?h===n.A.Md?(this.remove(a,l,c),this.remove(a-1,l,f)):h===n.A.Py?(this.remove(a,l,u),this.remove(a,l+1,d)):h===n.A.Vy?(this.remove(a,l,f),this.remove(a+1,l,c)):h===n.A.Gy&&(this.remove(a,l,d),this.remove(a,l-1,u)):e===r.A.Ky.id||e===r.A.Xy.id?h===n.A.Md?(this.remove(a,l,w),this.remove(a-1,l+1,y)):h===n.A.Py?(this.remove(a,l,m),this.remove(a+1,l+1,A)):h===n.A.Vy?(this.remove(a,l,y),this.remove(a+1,l-1,w)):h===n.A.Gy&&(this.remove(a,l,A),this.remove(a-1,l-1,m)):e===r.A.jy.id&&(h===n.A.Md?(this.remove(a,l,u|c),this.remove(a-1,l,f),this.remove(a,l+1,d)):h===n.A.Py?(this.remove(a,l,u|f),this.remove(a,l+1,d),this.remove(a+1,l,c)):h===n.A.Vy?(this.remove(a,l,d|f),this.remove(a+1,l,c),this.remove(a,l-1,u)):h===n.A.Gy&&(this.remove(a,l,d|c),this.remove(a,l-1,u),this.remove(a-1,l,f))),o&&this.zy(t,i,e,h,!1)};Zy=(t,i,e,h,a,l)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.Ny,u=e-this.offsetX,d=h-this.Ny,w=o.index(c,f);if(a===r.A.Yy.id){if(l===n.A.Md){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Ly)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Ty)===s.A.OPEN)return!0}else if(l===n.A.Py){if(c===u&&f===d+1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Ry)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.xy)===s.A.OPEN)return!0}else if(l===n.A.Vy){if(c===u+1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Ly)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Ty)===s.A.OPEN)return!0}else if(l===n.A.Gy){if(c===u&&f===d-1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Ry)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.xy)===s.A.OPEN)return!0}}else if(a===r.A.jy.id){if(l===n.A.Md){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.xy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Ty)===s.A.OPEN)return!0}else if(l===n.A.Py){if(c===u-1&&f===d&&(this.flags[w]&s.A.Ry)===s.A.OPEN)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Ty)===s.A.OPEN)return!0}else if(l===n.A.Vy){if(c===u-1&&f===d&&(this.flags[w]&s.A.Ry)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Ly)===s.A.OPEN)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1)return!0}else if(l===n.A.Gy){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Ly)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.xy)===s.A.OPEN)return!0;if(c===u&&f===d-1)return!0}}else if(a===r.A.qy.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.ny)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.ty)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.ey)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.oy)===s.A.OPEN)return!0}return!1};$y=(t,i,e,h,a,l)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.Ny,u=e-this.offsetX,d=h-this.Ny,w=o.index(c,f);if(a===r.A.Jy.id||a===r.A.Qy.id){if(a===r.A.Qy.id&&(l=l+2&3),l===n.A.Md){if(c===u+1&&f===d&&(this.flags[w]&s.A.oy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.ty)===s.A.OPEN)return!0}else if(l===n.A.Py){if(c===u-1&&f===d&&(this.flags[w]&s.A.ey)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.ty)===s.A.OPEN)return!0}else if(l===n.A.Vy){if(c===u-1&&f===d&&(this.flags[w]&s.A.ey)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.ny)===s.A.OPEN)return!0}else if(l===n.A.Gy){if(c===u+1&&f===d&&(this.flags[w]&s.A.oy)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.ny)===s.A.OPEN)return!0}}else if(a===r.A.tm.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.ny)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.ty)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.ey)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.oy)===s.A.OPEN)return!0}return!1};im=(t,i,e,n,r,a,l)=>{const c=e+r-1,f=n+a-1,u=o.index(t-this.offsetX,i-this.Ny);return t>=e&&t<=c&&i>=n&&i<=f||(t===e-1&&i>=n&&i<=f&&(this.flags[u]&s.A.ey)===s.A.OPEN&&(l&h.A.Md)===s.A.OPEN||(t===c+1&&i>=n&&i<=f&&(this.flags[u]&s.A.oy)===s.A.OPEN&&(l&h.A.Vy)===s.A.OPEN||(i===n-1&&t>=e&&t<=c&&(this.flags[u]&s.A.ty)===s.A.OPEN&&(l&h.A.Gy)===s.A.OPEN||i===f+1&&t>=e&&t<=c&&(this.flags[u]&s.A.ny)===s.A.OPEN&&(l&h.A.Py)===s.A.OPEN)))};add=(t,i,e)=>{this.flags[o.index(t,i)]|=e};remove=(t,i,e)=>{this.flags[o.index(t,i)]&=s.A.Dy-e}}},4909:(t,i,e)=>{e.d(i,{A:()=>s});class s{static Py=1;static Vy=2;static Gy=4;static Md=8}},6169:(t,i,e)=>{e.d(i,{A:()=>s});class s{static Md=0;static Py=1;static Vy=2;static Gy=3}},5599:(t,i,e)=>{e.d(i,{A:()=>s});class s{static sm=0;static nm=1;static rm=2;static hm=3}},1023:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5599);class n{static Yy=new n(0,s.A.sm);static Ky=new n(1,s.A.sm);static jy=new n(2,s.A.sm);static Xy=new n(3,s.A.sm);static om=new n(4,s.A.nm);static am=new n(5,s.A.nm);static Jy=new n(6,s.A.nm);static Qy=new n(7,s.A.nm);static tm=new n(8,s.A.nm);static qy=new n(9,s.A.rm);static td=new n(10,s.A.rm);static lm=new n(11,s.A.rm);static fm=new n(12,s.A.rm);static um=new n(13,s.A.rm);static dm=new n(14,s.A.rm);static wm=new n(15,s.A.rm);static ym=new n(16,s.A.rm);static Am=new n(17,s.A.rm);static pm=new n(18,s.A.rm);static gm=new n(19,s.A.rm);static Im=new n(20,s.A.rm);static _m=new n(21,s.A.rm);static hm=new n(22,s.A.hm);static values(){return[this.Yy,this.Ky,this.Am,this.wm,this.jy,this.dm,this.qy,this.Xy,this.hm,this.fm,this.lm,this.Jy,this.Im,this.td,this.am,this.um,this.Qy,this.om,this.ym,this.tm,this.gm,this._m,this.pm]}static of(t){const i=this.values();for(let e=0;e{e.d(i,{A:()=>m});var s=e(670),n=e(2164),r=e(1069),h=e(4583),o=e(3045),a=e(5637),l=e(4197),c=e(1312),f=e(1023),u=e(6169),d=e(9298),w=e(5518),y=e(3867);class m{static Cm=Int8Array.of(1,2,4,8);static Em=Uint8Array.of(16,32,64,128);static vm=Int8Array.of(1,0,-1,0);static bm=Int8Array.of(0,-1,0,1);static Tm=(17*Math.random()|0)-8;static Rm=(33*Math.random()|0)-16;static et=!0;static Om=0;static Lm=!1;static Sm=(t,i)=>{let e=this.xm(t+45365,i+91923,4)+(this.xm(t+10294,i+37821,2)-128>>1)+(this.xm(t,i,1)-128>>2)-128;return e=35+(.3*e|0),e<10?e=10:e>60&&(e=60),e};static xm=(t,i,e)=>{const s=t/e|0,n=t&e-1,r=i/e|0,h=i&e-1,o=this.km(s,r),a=this.km(s+1,r),l=this.km(s,r+1),c=this.km(s+1,r+1),f=this.Mm(o,a,n,e),u=this.Mm(l,c,n,e);return this.Mm(f,u,h,e)};static Mm=(t,i,e,s)=>{const n=65536-h.A.cos[1024*e/s|0]>>1;return(t*(65536-n)>>16)+(i*n>>16)};static km=(t,i)=>((this.Dm(t-1,i-1)+this.Dm(t+1,i-1)+this.Dm(t-1,i+1)+this.Dm(t+1,i+1))/16|0)+((this.Dm(t-1,i)+this.Dm(t+1,i)+this.Dm(t,i-1)+this.Dm(t,i+1))/8|0)+(this.Dm(t,i)/4|0);static Dm=(t,i)=>{const e=t+57*i,s=BigInt(e<<13^e);return 255&Number((s*(s*s*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static Uy=(t,i,e,s,n,r,h,o,d,w,y)=>{const A=n[y][i][e],p=n[y][i+1][e],g=n[y][i+1][e+1],I=n[y][i][e+1],_=A+p+g+I>>2,C=a.A.get(o);let E=i+(e<<7)+(o<<14)+1073741824|0;C.active||(E+=-2147483648),E|=0;const v=(w<<6)+d<<24>>24;if(d===f.A.hm.id)s?.Nm(C.al(f.A.hm.id,w,A,p,g,I,-1),t,i,e,_,E,v),C.nd&&C.active&&h?.Fy(i,e),-1!==C.la&&r.Fm(new l.A(o,t,3,i,e,c.A.Lo[C.la],!0));else if(d===f.A.td.id||d===f.A.lm.id){const n=C.al(f.A.td.id,w,A,p,g,I,-1);if(n){let r,h,o=0;d===f.A.lm.id&&(o+=256),w===u.A.Py||w===u.A.Gy?(r=C.length,h=C.width):(r=C.width,h=C.length),s?.Uy(t,i,e,_,n,null,E,v,r,h,o)}C.nd&&h?.Uy(i,e,C.width,C.length,w,C.rd),-1!==C.la&&r.Fm(new l.A(o,t,2,i,e,c.A.Lo[C.la],!0))}else if(d>=f.A.fm.id)s?.Uy(t,i,e,_,C.al(d,w,A,p,g,I,-1),null,E,v,1,1,0),C.nd&&h?.Uy(i,e,C.width,C.length,w,C.rd),-1!==C.la&&r.Fm(new l.A(o,t,2,i,e,c.A.Lo[C.la],!0));else if(d===f.A.Yy.id)s?.Hy(t,i,e,_,m.Cm[w],0,C.al(f.A.Yy.id,w,A,p,g,I,-1),null,E,v),C.nd&&h?.Hy(i,e,d,w,C.rd),-1!==C.la&&r.Fm(new l.A(o,t,0,i,e,c.A.Lo[C.la],!0));else if(d===f.A.Ky.id)s?.Hy(t,i,e,_,m.Em[w],0,C.al(f.A.Ky.id,w,A,p,g,I,-1),null,E,v),C.nd&&h?.Hy(i,e,d,w,C.rd),-1!==C.la&&r.Fm(new l.A(o,t,0,i,e,c.A.Lo[C.la],!0));else if(d===f.A.jy.id){const n=w+1&3;s?.Hy(t,i,e,_,m.Cm[w],m.Cm[n],C.al(f.A.jy.id,w+4,A,p,g,I,-1),C.al(f.A.jy.id,n,A,p,g,I,-1),E,v),C.nd&&h?.Hy(i,e,d,w,C.rd),-1!==C.la&&r.Fm(new l.A(o,t,0,i,e,c.A.Lo[C.la],!0))}else if(d===f.A.Xy.id)s?.Hy(t,i,e,_,m.Em[w],0,C.al(f.A.Xy.id,w,A,p,g,I,-1),null,E,v),C.nd&&h?.Hy(i,e,d,w,C.rd),-1!==C.la&&r.Fm(new l.A(o,t,0,i,e,c.A.Lo[C.la],!0));else if(d===f.A.qy.id)s?.Uy(t,i,e,_,C.al(d,w,A,p,g,I,-1),null,E,v,1,1,0),C.nd&&h?.Uy(i,e,C.width,C.length,w,C.rd),-1!==C.la&&r.Fm(new l.A(o,t,2,i,e,c.A.Lo[C.la],!0));else if(d===f.A.om.id)s?.Bm(t,i,e,_,0,0,E,C.al(f.A.om.id,u.A.Md,A,p,g,I,-1),v,512*w,m.Cm[w]),-1!==C.la&&r.Fm(new l.A(o,t,1,i,e,c.A.Lo[C.la],!0));else if(d===f.A.am.id){let n=16;if(s){const r=s.Um(t,i,e);r>0&&(n=a.A.get(r>>14&32767).ld)}s?.Bm(t,i,e,_,m.vm[w]*n,m.bm[w]*n,E,C.al(f.A.om.id,u.A.Md,A,p,g,I,-1),v,512*w,m.Cm[w]),-1!==C.la&&r.Fm(new l.A(o,t,1,i,e,c.A.Lo[C.la],!0))}else d===f.A.Jy.id?(s?.Bm(t,i,e,_,0,0,E,C.al(f.A.om.id,u.A.Md,A,p,g,I,-1),v,w,256),-1!==C.la&&r.Fm(new l.A(o,t,1,i,e,c.A.Lo[C.la],!0))):d===f.A.Qy.id?(s?.Bm(t,i,e,_,0,0,E,C.al(f.A.om.id,u.A.Md,A,p,g,I,-1),v,w,512),-1!==C.la&&r.Fm(new l.A(o,t,1,i,e,c.A.Lo[C.la],!0))):d===f.A.tm.id&&(s?.Bm(t,i,e,_,0,0,E,C.al(f.A.om.id,u.A.Md,A,p,g,I,-1),v,w,768),-1!==C.la&&r.Fm(new l.A(o,t,1,i,e,c.A.Lo[C.la],!0)))};Pm;Gm;Yr;Vr;Wm;Hm;Ym;Vm;Km;Xm;jm;zm;Zm;qm;$m;Jm;constructor(t,i,e,n){this.Pm=t,this.Gm=i,this.Yr=e,this.Vr=n,this.Wm=new y.Qm(s.A.Dr,t,i),this.Hm=new y.Qm(s.A.Dr,t,i),this.Ym=new y.Qm(s.A.Dr,t,i),this.Vm=new y.Qm(s.A.Dr,t,i),this.Jm=new y.tA(s.A.Dr,t+1,i+1),this.Km=new y.Qm(s.A.Dr,t+1,i+1),this.Xm=new y.Xr(t+1,i+1),this.jm=new Int32Array(i),this.zm=new Int32Array(i),this.Zm=new Int32Array(i),this.qm=new Int32Array(i),this.$m=new Int32Array(i)}iA=(t,i)=>{for(let t=0;t=0&&i[s]?.Fy(e,n)}m.Tm+=(5*Math.random()|0)-2,m.Tm<-8?m.Tm=-8:m.Tm>8&&(m.Tm=8),m.Rm+=(5*Math.random()|0)-2,m.Rm<-16?m.Rm=-16:m.Rm>16&&(m.Rm=16);for(let i=0;i>8;for(let t=1;t>2)+(e[n+1][t]>>3)+(e[n][t-1]>>2)+(e[n][t+1]>>3)+(e[n][t]>>1);this.Xm[n][t]=u-d}for(let t=0;t=0&&s0){const i=n.A.Lo[e-1];this.jm[t]+=i.Pu,this.zm[t]+=i.Fu,this.Zm[t]+=i.Bu,this.qm[t]+=i.Uu,r=this.$m[t]++}}const h=e-5;if(h>=0&&h0){const i=n.A.Lo[e-1];this.jm[t]-=i.Pu,this.zm[t]-=i.Fu,this.Zm[t]-=i.Bu,this.qm[t]-=i.Uu,r=this.$m[t]--}}}if(e>=1&&e=0&&f=0&&y=1&&c0||y>0){const A=this.Yr[i][e][c],p=this.Yr[i][e+1][c],g=this.Yr[i][e+1][c+1],I=this.Yr[i][e][c+1],_=this.Xm[e][c],C=this.Xm[e+1][c],E=this.Xm[e+1][c+1],v=this.Xm[e][c+1];let b=-1,T=-1;if(f>0){const t=256*s/a|0,i=r/l|0;let e=o/l|0;b=n.A.Lu(t,i,e);const h=t+m.Tm&255;e+=m.Rm,e<0?e=0:e>255&&(e=255),T=n.A.Lu(h,i,e)}if(i>0){let t=0!==f||this.Ym[i][e][c]===w.A.sA;y>0&&!n.A.Lo[y-1].Du&&(t=!1),t&&A===p&&A===g&&A===I&&(this.Jm[i][e][c]|=2340)}let R=0;if(-1!==b&&(R=h.A.palette[n.A.Su(T,96)]),0===y)t?.nA(i,e,c,w.A.sA,u.A.Md,-1,A,p,g,I,n.A.Su(b,_),n.A.Su(b,C),n.A.Su(b,E),n.A.Su(b,v),d.A.Pa,d.A.Pa,d.A.Pa,d.A.Pa,R,d.A.Pa);else{const s=this.Ym[i][e][c]+1,r=this.Vm[i][e][c],o=n.A.Lo[y-1];let a,l,f=o.texture;f>=0?(l=h.A.rA(f),a=-1):o.ku===d.A.hA?(l=0,a=-2,f=-1):(a=n.A.Lu(o.Nu,o.Fu,o.Bu),l=h.A.palette[n.A.xu(o.Gu,96)]),t?.nA(i,e,c,s,r,f,A,p,g,I,n.A.Su(b,_),n.A.Su(b,C),n.A.Su(b,E),n.A.Su(b,v),n.A.xu(a,_),n.A.xu(a,C),n.A.xu(a,E),n.A.xu(a,v),R,l)}}}}}}for(let e=1;e0&&(t<<=3,i<<=3,e<<=3);for(let s=0;s<=n;s++)for(let r=0;r<=this.Gm;r++)for(let h=0;h<=this.Pm;h++){if(this.Jm[s][h][r]&t){let i=r,e=r,a=s,l=s;for(;i>0&&this.Jm[s][h][i-1]&t;)i--;for(;e0;){for(let s=i;s<=e;s++)if(!(this.Jm[a-1][h][s]&t))break t;a--}t:for(;l=8){const s=this.Yr[l][h][i]-240,r=this.Yr[a][h][i];o.A.cA(n,1,128*h,s,128*i,128*h,r,128*e+128);for(let s=a;s<=l;s++)for(let n=i;n<=e;n++)this.Jm[s][h][n]&=~t}}if(this.Jm[s][h][r]&i){let t=h,e=h,a=s,l=s;for(;t>0&&this.Jm[s][t-1][r]&i;)t--;for(;e0;){for(let s=t;s<=e;s++)if(!(this.Jm[a-1][s][r]&i))break t;a--}t:for(;l=8){const s=this.Yr[l][t][r]-240,h=this.Yr[a][t][r];o.A.cA(n,2,128*t,s,128*r,128*e+128,h,128*r);for(let s=a;s<=l;s++)for(let n=t;n<=e;n++)this.Jm[s][n][r]&=~i}}if(this.Jm[s][h][r]&e){let t=h,i=h,a=r,l=r;for(;a>0&&this.Jm[s][h][a-1]&e;)a--;for(;l0;){for(let i=a;i<=l;i++)if(!(this.Jm[s][t-1][i]&e))break t;t--}t:for(;i=4){const r=this.Yr[s][t][a];o.A.cA(n,4,128*t,r,128*a,128*i+128,r,128*l+128);for(let n=t;n<=i;n++)for(let t=a;t<=l;t++)this.Jm[s][n][t]&=~e}}}}}};fA=(t,i,e,r)=>{let h=0;for(let t=0;t>24;break}for(let n=t;n=0&&t=0&&n{const o=new r.A(new Uint8Array(h));for(let r=0;r=0&&l=0&&c>24,this.Vm[r][l][c]=(f-2&3)<<24>>24):f<=81?this.Vr[r][l][c]=f-49<<24>>24:this.Wm[r][l][c]=f-81<<24>>24}else for(;f=o.lu,0!==f;){if(1===f){o.lu;break}f<=49&&o.lu}}};dA=(t,i,e,n,h,o)=>{const a=new r.A(new Uint8Array(n));let l=-1;for(;;){const n=a.wA;if(0===n)return;l+=n;let r=0;for(;;){const n=a.wA;if(0===n)break;r+=n-1;const c=63&r,f=r>>6&63,u=r>>12,d=a.lu,w=d>>2,y=3&d,m=f+h,A=c+o;if(m>0&&A>0&&m=0&&(n=e[s]),this.Uy(u,m,A,t,i,n,l,w,y)}}}};Uy=(t,i,e,s,n,r,h,o,d)=>{if(m.et){if(16&this.Vr[t][i][e])return;if(this.eA(t,i,e)!==m.Om)return}const w=this.Yr[t][i][e],y=this.Yr[t][i+1][e],A=this.Yr[t][i+1][e+1],p=this.Yr[t][i][e+1],g=w+y+A+p>>2,I=a.A.get(h);let _=i+(e<<7)+(h<<14)+1073741824|0;I.active||(_+=-2147483648),_|=0;const C=(d<<6)+o<<24>>24;if(o===f.A.hm.id)(!m.et||I.active||I.vd)&&(s?.Nm(I.al(f.A.hm.id,d,w,y,A,p,-1),t,i,e,g,_,C),I.nd&&I.active&&r?.Fy(i,e),-1!==I.la&&n.Fm(new l.A(h,t,3,i,e,c.A.Lo[I.la],!0)));else if(o===f.A.td.id||o===f.A.lm.id){const a=I.al(f.A.td.id,d,w,y,A,p,-1);if(a){let n,r,h=0;if(o===f.A.lm.id&&(h+=256),d===u.A.Py||d===u.A.Gy?(n=I.length,r=I.width):(n=I.width,r=I.length),s?.Uy(t,i,e,g,a,null,_,C,n,r,h)&&I.md)for(let s=0;s<=n;s++)for(let n=0;n<=r;n++){let r=a.yA/4|0;r>30&&(r=30),r>this.Km[t][i+s][e+n]&&(this.Km[t][i+s][e+n]=r<<24>>24)}}I.nd&&r?.Uy(i,e,I.width,I.length,d,I.rd),-1!==I.la&&n.Fm(new l.A(h,t,2,i,e,c.A.Lo[I.la],!0))}else if(o>=f.A.fm.id)s?.Uy(t,i,e,g,I.al(o,d,w,y,A,p,-1),null,_,C,1,1,0),o>=f.A.fm.id&&o<=f.A.Am.id&&o!==f.A.um.id&&t>0&&(this.Jm[t][i][e]|=2340),I.nd&&r?.Uy(i,e,I.width,I.length,d,I.rd),-1!==I.la&&n.Fm(new l.A(h,t,2,i,e,c.A.Lo[I.la],!0));else if(o===f.A.Yy.id)s?.Hy(t,i,e,g,m.Cm[d],0,I.al(f.A.Yy.id,d,w,y,A,p,-1),null,_,C),d===u.A.Md?(I.md&&(this.Km[t][i][e]=50,this.Km[t][i][e+1]=50),I.Du&&(this.Jm[t][i][e]|=585)):d===u.A.Py?(I.md&&(this.Km[t][i][e+1]=50,this.Km[t][i+1][e+1]=50),I.Du&&(this.Jm[t][i][e+1]|=1170)):d===u.A.Vy?(I.md&&(this.Km[t][i+1][e]=50,this.Km[t][i+1][e+1]=50),I.Du&&(this.Jm[t][i+1][e]|=585)):d===u.A.Gy&&(I.md&&(this.Km[t][i][e]=50,this.Km[t][i+1][e]=50),I.Du&&(this.Jm[t][i][e]|=1170)),I.nd&&r?.Hy(i,e,o,d,I.rd),-1!==I.la&&n.Fm(new l.A(h,t,0,i,e,c.A.Lo[I.la],!0)),16!==I.ld&&s?.mA(t,i,e,I.ld);else if(o===f.A.Ky.id)s?.Hy(t,i,e,g,m.Em[d],0,I.al(f.A.Ky.id,d,w,y,A,p,-1),null,_,C),I.md&&(d===u.A.Md?this.Km[t][i][e+1]=50:d===u.A.Py?this.Km[t][i+1][e+1]=50:d===u.A.Vy?this.Km[t][i+1][e]=50:d===u.A.Gy&&(this.Km[t][i][e]=50)),I.nd&&r?.Hy(i,e,o,d,I.rd),-1!==I.la&&n.Fm(new l.A(h,t,0,i,e,c.A.Lo[I.la],!0));else if(o===f.A.jy.id){const a=d+1&3;s?.Hy(t,i,e,g,m.Cm[d],m.Cm[a],I.al(f.A.jy.id,d+4,w,y,A,p,-1),I.al(f.A.jy.id,a,w,y,A,p,-1),_,C),I.Du&&(d===u.A.Md?(this.Jm[t][i][e]|=265,this.Jm[t][i][e+1]|=1170):d===u.A.Py?(this.Jm[t][i][e+1]|=1170,this.Jm[t][i+1][e]|=585):d===u.A.Vy?(this.Jm[t][i+1][e]|=585,this.Jm[t][i][e]|=1170):d===u.A.Gy&&(this.Jm[t][i][e]|=1170,this.Jm[t][i][e]|=585)),I.nd&&r?.Hy(i,e,o,d,I.rd),-1!==I.la&&n.Fm(new l.A(h,t,0,i,e,c.A.Lo[I.la],!0)),16!==I.ld&&s?.mA(t,i,e,I.ld)}else if(o===f.A.Xy.id)s?.Hy(t,i,e,g,m.Em[d],0,I.al(f.A.Xy.id,d,w,y,A,p,-1),null,_,C),I.md&&(d===u.A.Md?this.Km[t][i][e+1]=50:d===u.A.Py?this.Km[t][i+1][e+1]=50:d===u.A.Vy?this.Km[t][i+1][e]=50:d===u.A.Gy&&(this.Km[t][i][e]=50)),I.nd&&r?.Hy(i,e,o,d,I.rd),-1!==I.la&&n.Fm(new l.A(h,t,0,i,e,c.A.Lo[I.la],!0));else if(o===f.A.qy.id)s?.Uy(t,i,e,g,I.al(o,d,w,y,A,p,-1),null,_,C,1,1,0),I.nd&&r?.Uy(i,e,I.width,I.length,d,I.rd),-1!==I.la&&n.Fm(new l.A(h,t,2,i,e,c.A.Lo[I.la],!0));else if(o===f.A.om.id)s?.Bm(t,i,e,g,0,0,_,I.al(f.A.om.id,u.A.Md,w,y,A,p,-1),C,512*d,m.Cm[d]),-1!==I.la&&n.Fm(new l.A(h,t,1,i,e,c.A.Lo[I.la],!0));else if(o===f.A.am.id){let r=16;if(s){const n=s.Um(t,i,e);n>0&&(r=a.A.get(n>>14&32767).ld)}s?.Bm(t,i,e,g,m.vm[d]*r,m.bm[d]*r,_,I.al(f.A.om.id,u.A.Md,w,y,A,p,-1),C,512*d,m.Cm[d]),-1!==I.la&&n.Fm(new l.A(h,t,1,i,e,c.A.Lo[I.la],!0))}else o===f.A.Jy.id?(s?.Bm(t,i,e,g,0,0,_,I.al(f.A.om.id,u.A.Md,w,y,A,p,-1),C,d,256),-1!==I.la&&n.Fm(new l.A(h,t,1,i,e,c.A.Lo[I.la],!0))):o===f.A.Qy.id?(s?.Bm(t,i,e,g,0,0,_,I.al(f.A.om.id,u.A.Md,w,y,A,p,-1),C,d,512),-1!==I.la&&n.Fm(new l.A(h,t,1,i,e,c.A.Lo[I.la],!0))):o===f.A.tm.id&&(s?.Bm(t,i,e,g,0,0,_,I.al(f.A.om.id,u.A.Md,w,y,A,p,-1),C,d,768),-1!==I.la&&n.Fm(new l.A(h,t,1,i,e,c.A.Lo[I.la],!0)))};eA=(t,i,e)=>8&this.Vr[t][i][e]?0:t<=0||!(2&this.Vr[1][i][e])?t:t-1}},3045:(t,i,e)=>{e.d(i,{A:()=>g});var s=e(4583),n=e(1161),r=e(3795),h=e(8256),o=e(670),a=e(9222),l=e(6855),c=e(7441),f=e(6666),u=e(5748),d=e(3479),w=e(8950),y=e(2771),m=e(5518),A=e(6169),p=e(3867);class g{static AA=new p.pA(8,32,51,51,!1);static gA=new p.fe(100,null);static IA=new Int32Array(o.A.Dr);static _A=new p.CA(o.A.Dr,500,null);static EA=new p.fe(500,null);static vA=new f.A;static bA=0;static TA=0;static RA=0;static OA=0;static LA=0;static SA=0;static xA=0;static kA=0;static MA=0;static DA=0;static NA=0;static FA=0;static BA=0;static UA=0;static PA=0;static GA=0;static WA=0;static HA=0;static YA=0;static VA=0;static KA=0;static XA=0;static jA=!1;static zA=null;static ZA=Uint8Array.of(19,55,38,155,255,110,137,205,76);static qA=Uint8Array.of(160,192,80,96,0,144,80,48,160);static $A=Uint8Array.of(76,8,137,4,0,1,38,2,19);static JA=Int8Array.of(0,0,2,0,0,2,1,1,0);static QA=Int8Array.of(2,0,0,2,0,0,0,4,4);static tp=Int8Array.of(0,4,4,8,0,0,8,0,0);static ip=Int8Array.of(1,1,0,0,0,8,0,0,8);static ep=Int8Array.of(53,-53,-53,53);static sp=Int8Array.of(-53,-53,53,53);static np=Int8Array.of(-45,45,45,-45);static rp=Int8Array.of(45,45,-45,-45);static hp=[new Int8Array(16),Int8Array.of(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,0,0,0,1,1,0,0,1,1,1,0,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1),Int8Array.of(0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0),Int8Array.of(0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0),Int8Array.of(1,1,1,1,1,1,1,1,0,1,1,1,0,0,1,1),Int8Array.of(1,1,1,1,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,0,0,0,0,1,1,0,1,1,1,0,1,1,1),Int8Array.of(0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1)];static op=[Int8Array.of(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),Int8Array.of(12,8,4,0,13,9,5,1,14,10,6,2,15,11,7,3),Int8Array.of(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0),Int8Array.of(3,7,11,15,2,6,10,14,1,5,9,13,0,4,8,12)];static ap=Int32Array.of(41,39248,41,4643,41,41,41,41,41,41,41,41,41,41,41,43086,41,41,41,41,41,41,41,8602,41,28992,41,41,41,41,41,5056,41,41,41,41,41,41,41,41,41,41,41,41,41,41,3131,41,41,41);static lp=0;static Ma=0;static Da=0;static cp=-1;static fp=-1;static et=!0;static init=(t,i,e,n,r)=>{this.TA=0,this.RA=0,this.OA=t,this.LA=i,this.SA=t/2|0,this.xA=i/2|0;const h=new p.pA(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let i=0;i<2048;i+=64){this.kA=s.A.sin[t],this.MA=s.A.cos[t],this.DA=s.A.sin[i],this.NA=s.A.cos[i];const o=(t-128)/32|0,a=i/64|0;for(let t=-26;t<=26;t++)for(let i=-26;i<=26;i++){const s=128*t,l=128*i;let c=!1;for(let t=-e;t<=n;t+=128)if(this.up(s,l,r[o]+t)){c=!0;break}h[o][a][t+25+1][i+25+1]=c}}for(let t=0;t<8;t++)for(let i=0;i<32;i++)for(let e=-25;e<25;e++)for(let s=-25;s<25;s++){let n=!1;t:for(let r=-1;r<=1;r++)for(let o=-1;o<=1;o++){if(h[t][i][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t][(i+1)%31][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][i][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][(i+1)%31][e+r+25+1][s+o+25+1]){n=!0;break t}}this.AA[t][i][e+25][s+25]=n}};static To=()=>{this.gA=null,this.IA=null,this._A=null,this.vA=null,this.AA=null,this.EA=null,this.zA=null,console.log('World3D unloaded!')};static cA=(t,i,e,s,n,r,o,a)=>{g._A[t][g.IA[t]++]=new h.A(e/128|0,r/128|0,n/128|0,a/128|0,i,e,r,n,a,s,o)};static up=(t,i,e)=>{const s=i*this.DA+t*this.NA>>16,n=i*this.NA-t*this.DA>>16,r=e*this.kA+n*this.MA>>16,h=e*this.MA-n*this.kA>>16;if(r<50||r>3500)return!1;const o=this.SA+((s<<9)/r|0),a=this.xA+((h<<9)/r|0);return o>=this.TA&&o<=this.OA&&a>=this.RA&&a<=this.LA};dp;Pm;Gm;wp;yp;_h;mp;Ap;pp;gp=0;Ip=0;_p=0;constructor(t,i,e,s){this.dp=e,this.Pm=s,this.Gm=i,this.yp=new p.Eh(e,s,i,null),this.mp=new p.tA(e,s+1,i+1),this.wp=t,this._h=new p.fe(5e3,null),this.Ap=new Int32Array(1e4),this.pp=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this.Ip=t;for(let i=0;i{const e=this.yp[0][t][i];for(let e=0;e<3;e++){this.yp[e][t][i]=this.yp[e+1][t][i];const s=this.yp[e][t][i];s&&s.level--}this.yp[0][t][i]||(this.yp[0][t][i]=new r.A(0,t,i));const s=this.yp[0][t][i];s&&(s.Ep=e),this.yp[3][t][i]=null};oA=(t,i,e,s)=>{const n=this.yp[t][i][e];n&&(n.vp=s)};nA=(t,i,e,s,n,h,o,a,l,c,f,u,w,A,p,g,I,_,C,E)=>{if(s===m.A.sA){for(let s=t;s>=0;s--)this.yp[s][i][e]||(this.yp[s][i][e]=new r.A(s,i,e));const s=this.yp[t][i][e];s&&(s.bp=new d.A(f,u,w,A,-1,C,!1))}else if(s===m.A.Tp){for(let s=t;s>=0;s--)this.yp[s][i][e]||(this.yp[s][i][e]=new r.A(s,i,e));const s=this.yp[t][i][e];s&&(s.bp=new d.A(p,g,I,_,h,E,o===a&&o===l&&o===c))}else{for(let s=t;s>=0;s--)this.yp[s][i][e]||(this.yp[s][i][e]=new r.A(s,i,e));const d=this.yp[t][i][e];d&&(d.Rp=new y.A(i,s,g,a,w,n,f,c,E,p,h,_,C,l,I,A,o,e,u))}};Nm=(t,i,e,s,n,h,o)=>{this.yp[i][e][s]||(this.yp[i][e][s]=new r.A(i,e,s));const l=this.yp[i][e][s];l&&(l.Op=new a.A(n,128*e+64,128*s+64,t,h,o))};Lp=(t,i,e)=>{const s=this.yp[t][i][e];s&&(s.Op=null)};Sp=(t,i,e,s,n,h,o,a)=>{let l=0;const c=this.yp[s][t][i];if(c)for(let t=0;tl&&(l=e)}else this.yp[s][t][i]=new r.A(s,t,i);const f=this.yp[s][t][i];f&&(f.Mp=new u.A(e,128*t+64,128*i+64,h,o,a,n,l))};Dp=(t,i,e)=>{const s=this.yp[t][i][e];s&&(s.Mp=null)};Hy=(t,i,e,s,n,h,o,a,c,f)=>{if(!o&&!a)return;for(let s=t;s>=0;s--)this.yp[s][i][e]||(this.yp[s][i][e]=new r.A(s,i,e));const u=this.yp[t][i][e];u&&(u.Np=new l.A(s,128*i+64,128*e+64,n,h,o,a,c,f))};zy=(t,i,e,s)=>{const n=this.yp[t][i][e];1===s&&n&&(n.Np=null)};Bm=(t,i,e,s,n,h,o,a,l,f,u)=>{if(!a)return;for(let s=t;s>=0;s--)this.yp[s][i][e]||(this.yp[s][i][e]=new r.A(s,i,e));const d=this.yp[t][i][e];d&&(d.Fp=new c.A(s,128*i+n+64,128*e+h+64,u,f,a,o,l))};Bp=(t,i,e)=>{const s=this.yp[t][i][e];s&&(s.Fp=null)};mA=(t,i,e,s)=>{const n=this.yp[t][i][e];if(!n)return;const r=n.Fp;if(!r)return;const h=128*i+64,o=128*e+64;r.x=h+((r.x-h)*s/16|0),r.z=o+((r.z-o)*s/16|0)};Up=(t,i,e,s)=>{if(!s)return;const n=this.yp[t][i][e];if(!n)return;const r=n.Fp;r&&(r.model=s)};Pp=(t,i,e,s)=>{if(!s)return;const n=this.yp[t][i][e];if(!n)return;const r=n.Op;r&&(r.model=s)};Gp=(t,i,e,s)=>{if(!s)return;const n=this.yp[t][i][e];if(!n)return;const r=n.Np;r&&(r.Wp=s)};Hp=(t,i,e,s,n)=>{if(!s)return;const r=this.yp[e][t][i];if(!r)return;const h=r.Np;h&&(h.Wp=s,h.Yp=n)};Uy=(t,i,e,s,n,r,h,o,a,l,c)=>{if(!n&&!r)return!0;const f=128*i+64*a,u=128*e+64*l;return this.Vp(f,u,s,t,i,e,a,l,n,r,h,o,c,!1)};Kp=(t,i,e,s,n,r,h,o,a,l)=>{if(!n&&!r)return!0;let c=i-a,f=s-a,u=i+a,d=s+a;return l&&(o>640&&o<1408&&(d+=128),o>1152&&o<1920&&(u+=128),(o>1664||o<384)&&(f-=128),o>128&&o<896&&(c-=128)),c=c/128|0,f=f/128|0,u=u/128|0,d=d/128|0,this.Vp(i,s,e,t,c,f,u+1-c,d-f+1,n,r,h,0,o,!0)};Xp=(t,i,e,s,n,r,h,o,a,l,c,f)=>!a&&!l||this.Vp(i,s,e,t,n,r,h+1-n,o-r+1,a,l,c,0,f,!0);Wy=(t,i,e)=>{const s=this.yp[t][i][e];if(s)for(let t=0;t>29&3)&&n.zp===i&&n.Zp===e)return void this.qp(n)}};$p=(t,i,e,s)=>{if(!s)return;const n=this.yp[t][i][e];if(n)for(let t=0;t>29&3))return void(i.model=s)}};Jp=()=>{for(let t=0;t{const s=this.yp[t][i][e];return s&&s.Np?s.Np.jp:0};Qp=(t,i,e)=>{const s=this.yp[t][e][i];return s&&s.Fp?s.Fp.jp:0};tg=(t,i,e)=>{const s=this.yp[t][i][e];if(!s)return 0;for(let t=0;t>29&3)&&n.zp===i&&n.Zp===e)return n.jp}return 0};ig=(t,i,e)=>{const s=this.yp[t][i][e];return s&&s.Op?s.Op.jp:0};eg=(t,i,e,s)=>{const n=this.yp[t][i][e];if(n){if(n.Np&&n.Np.jp===s)return 255&n.Np.info;if(n.Fp&&n.Fp.jp===s)return 255&n.Fp.info;if(n.Op&&n.Op.jp===s)return 255&n.Op.info;for(let t=0;t{const r=i*(0|Math.sqrt(e*e+s*s+n*n))>>8;for(let i=0;i{if(i0){const n=this.yp[t][i+1][e-1];n&&n.Op&&n.Op.model&&n.Op.model.sg&&this.rg(s,n.Op.model,128,0,-128,!0)}};ng=(t,i,e,s,n,r)=>{let h=!0,o=i;const a=i+s,l=e-1,c=e+n;for(let f=t;f<=t+1;f++)if(f!==this.dp){for(let u=o;u<=a;u++)if(!(u<0||u>=this.Pm))for(let o=l;o<=c;o++){if(o<0||o>=this.Gm||h&&u=e||u===i))continue;const l=this.yp[f][u][o];if(!l)continue;const d=128*(u-i)+64*(1-s),w=128*(o-e)+64*(1-n),y=((this.wp[f][u][o]+this.wp[f][u+1][o]+this.wp[f][u][o+1]+this.wp[f][u+1][o+1])/4|0)-((this.wp[t][i][e]+this.wp[t][i+1][e]+this.wp[t][i][e+1]+this.wp[t][i+1][e+1])/4|0),m=l.Np;m&&m.Wp&&m.Wp.sg&&this.rg(r,m.Wp,d,y,w,h),m&&m.Yp&&m.Yp.sg&&this.rg(r,m.Yp,d,y,w,h);for(let t=0;t{this._p++;let h=0;const o=i.Od,a=i.Rd;if(t.sg&&t.cg)for(let r=0;ri.fg)continue;const u=t.Od[r]-e;if(ui.dg)continue;const d=t.Ld[r]-n;if(di.yg)continue;if(i.sg&&i.cg)for(let t=0;t{const h=this.yp[t][i][e];if(!h)return;const o=h.bp;if(o){const t=o.color;if(0!==t)for(let i=0;i<4;i++)s[n]=t,s[n+1]=t,s[n+2]=t,s[n+3]=t,n+=r;return}const a=h.Rp;if(!a)return;const l=a.shape,c=a.angle,f=a.Cg,u=a.Eg,d=g.hp[l],w=g.op[c];let y=0;if(0===f)for(let t=0;t<4;t++)0!==d[w[y++]]&&(s[n]=u),0!==d[w[y++]]&&(s[n+1]=u),0!==d[w[y++]]&&(s[n+2]=u),0!==d[w[y++]]&&(s[n+3]=u),n+=r;else for(let t=0;t<4;t++)s[n]=0===d[w[y++]]?f:u,s[n+1]=0===d[w[y++]]?f:u,s[n+2]=0===d[w[y++]]?f:u,s[n+3]=0===d[w[y++]]?f:u,n+=r};click=(t,i)=>{g.jA=!0,g.Ma=t,g.Da=i,g.cp=-1,g.fp=-1};draw=(t,i,e,n,r,h,o)=>{t<0?t=0:t>=128*this.Pm&&(t=128*this.Pm-1),e<0?e=0:e>=128*this.Gm&&(e=128*this.Gm-1),g.bA++,g.kA=s.A.sin[h],g.MA=s.A.cos[h],g.DA=s.A.sin[r],g.NA=s.A.cos[r],g.zA=g.AA[(h-128)/32|0][r/64|0],g.FA=t,g.BA=i,g.UA=e,g.PA=t/128|0,g.GA=e/128|0,g.KA=n,g.WA=g.PA-25,g.WA<0&&(g.WA=0),g.YA=g.GA-25,g.YA<0&&(g.YA=0),g.HA=g.PA+25,g.HA>this.Pm&&(g.HA=this.Pm),g.VA=g.GA+25,g.VA>this.Gm&&(g.VA=this.Gm),this.vg(),g.XA=0;for(let t=this.Ip;t=2e3)?(h.visible=!0,h.update=!0,h.bg=h.xp>0,g.XA++):(h.visible=!1,h.update=!1,h.Tg=0))}}for(let t=this.Ip;t=g.HA))for(let t=-25;t<=0;t++){const n=g.GA+t,r=g.GA-t;let h;if(e>=g.WA&&(n>=g.YA&&(h=i[e][n],h&&h.visible&&this.Rg(h,!0,o)),r=g.YA&&(h=i[s][n],h&&h.visible&&this.Rg(h,!0,o)),r=g.HA))for(let t=-25;t<=0;t++){const n=g.GA+t,r=g.GA-t;let h;if(e>=g.WA&&(n>=g.YA&&(h=i[e][n],h&&h.visible&&this.Rg(h,!1,o)),r=g.YA&&(h=i[s][n],h&&h.visible&&this.Rg(h,!1,o)),r{if(!c&&!f)return!1;for(let t=h;t=this.Pm||i>=this.Gm)return!1;const e=this.yp[s][t][i];if(e&&e.xp>=5)return!1}const m=new n.A(s,e,t,i,c,f,w,h,h+a-1,o,o+l-1,u,d);for(let t=h;th&&(e|=1),to&&(e+=8),i=0;e--)this.yp[e][t][i]||(this.yp[e][t][i]=new r.A(e,t,i));const n=this.yp[s][t][i];n&&(n.kp[n.xp]=m,n.Og[n.xp]=e,n.Lg|=e,n.xp++)}return y&&(this._h[this.gp++]=m),!0};qp=t=>{for(let i=t.zp;i<=t.og;i++)for(let e=t.Zp;e<=t.ag;e++){const s=this.yp[t.level][i][e];if(s){for(let i=0;i{const t=g.IA[g.KA],i=g._A[g.KA];g.lp=0;for(let e=0;e=0&&s<=50){n=t.xg+25-g.GA,n<0&&(n=0),r=t.Gm+25-g.GA,r>50&&(r=50);let i=!1;for(;n<=r;)if(g.zA&&g.zA[s][n++]){i=!0;break}if(i){if(h=g.FA-t.ug,h>32)t.mode=1;else{if(h>=-32)continue;t.mode=2,h=-h}t.kg=(t.wg-g.UA<<8)/h|0,t.Mg=(t.yg-g.UA<<8)/h|0,t.Dg=(t.fg-g.BA<<8)/h|0,t.Ng=(t.Ud-g.BA<<8)/h|0,g.EA[g.lp++]=t}}}else if(2===t.type){if(s=t.xg+25-g.GA,s>=0&&s<=50){n=t.Sg+25-g.PA,n<0&&(n=0),r=t.Pm+25-g.PA,r>50&&(r=50);let i=!1;for(;n<=r;)if(g.zA&&g.zA[n++][s]){i=!0;break}if(i){if(h=g.UA-t.wg,h>32)t.mode=3;else{if(h>=-32)continue;t.mode=4,h=-h}t.Fg=(t.ug-g.FA<<8)/h|0,t.Bg=(t.dg-g.FA<<8)/h|0,t.Dg=(t.fg-g.BA<<8)/h|0,t.Ng=(t.Ud-g.BA<<8)/h|0,g.EA[g.lp++]=t}}}else if(4===t.type&&(s=t.fg-g.BA,s>128&&(n=t.xg+25-g.GA,n<0&&(n=0),r=t.Gm+25-g.GA,r>50&&(r=50),n<=r))){let i=t.Sg+25-g.PA;i<0&&(i=0),h=t.Pm+25-g.PA,h>50&&(h=50);let e=!1;t:for(let t=i;t<=h;t++)for(let i=n;i<=r;i++)if(g.zA&&g.zA[t][i]){e=!0;break t}e&&(t.mode=5,t.Fg=(t.ug-g.FA<<8)/s|0,t.Bg=(t.dg-g.FA<<8)/s|0,t.kg=(t.wg-g.UA<<8)/s|0,t.Mg=(t.yg-g.UA<<8)/s|0,g.EA[g.lp++]=t)}}};Rg=(t,i,e)=>{for(g.vA.Fm(t);;){let t;do{if(t=g.vA.Ug(),!t)return}while(!t.update);const s=t.x,n=t.z,r=t.level,h=t.Pg,o=this.yp[r];if(t.visible){if(i){if(r>0){const t=this.yp[r-1][s][n];if(t&&t.update)continue}if(s<=g.PA&&s>g.WA){const i=o[s-1][n];if(i&&i.update&&(i.visible||!(1&t.Lg)))continue}if(s>=g.PA&&sg.YA){const i=o[s][n-1];if(i&&i.update&&(i.visible||!(8&t.Lg)))continue}if(n>=g.GA&&nn&&(l+=6),c=g.ZA[l],t.Kg=g.$A[l]),f&&(f.Xg&g.qA[l]?16===f.Xg?(t.Tg=3,t.jg=g.JA[l],t.zg=3-t.jg):32===f.Xg?(t.Tg=6,t.jg=g.QA[l],t.zg=6-t.jg):64===f.Xg?(t.Tg=12,t.jg=g.tp[l],t.zg=12-t.jg):(t.Tg=9,t.jg=g.ip[l],t.zg=9-t.jg):t.Tg=0,f.Xg&c&&!this.Zg(h,s,n,f.Xg)&&f.Wp?.draw(0,g.kA,g.MA,g.DA,g.NA,f.x-g.FA,f.y-g.BA,f.z-g.UA,f.jp),f.qg&c&&!this.Zg(h,s,n,f.qg)&&f.Yp?.draw(0,g.kA,g.MA,g.DA,g.NA,f.x-g.FA,f.y-g.BA,f.z-g.UA,f.jp)),u&&!this.visible(h,s,n,u.model.Ud))if(u.type&c)u.model.draw(u.angle,g.kA,g.MA,g.DA,g.NA,u.x-g.FA,u.y-g.BA,u.z-g.UA,u.jp);else if(768&u.type){const t=u.x-g.FA,i=u.y-g.BA,e=u.z-g.UA,s=u.angle;let n,r;if(n=s===A.A.Py||s===A.A.Vy?-t:t,r=s===A.A.Vy||s===A.A.Gy?-e:e,256&u.type&&rn){const n=t+g.np[s],r=e+g.rp[s];u.model.draw(512*s+1280&2047,g.kA,g.MA,g.DA,g.NA,n,i,r,u.jp)}}if(a){const i=t.Op;i&&i.model?.draw(0,g.kA,g.MA,g.DA,g.NA,i.x-g.FA,i.y-g.BA,i.z-g.UA,i.jp);const e=t.Mp;e&&0===e.offset&&(e.$g&&e.$g.draw(0,g.kA,g.MA,g.DA,g.NA,e.x-g.FA,e.y-g.BA,e.z-g.UA,e.jp),e.Jg&&e.Jg.draw(0,g.kA,g.MA,g.DA,g.NA,e.x-g.FA,e.y-g.BA,e.z-g.UA,e.jp),e.Qg&&e.Qg.draw(0,g.kA,g.MA,g.DA,g.NA,e.x-g.FA,e.y-g.BA,e.z-g.UA,e.jp))}const d=t.Lg;if(0!==d){if(sg.PA&&1&d){const t=o[s-1][n];t&&t.update&&g.vA.Fm(t)}if(n>g.GA&&8&d){const t=o[s][n-1];t&&t.update&&g.vA.Fm(t)}}}if(0!==t.Tg){let i=!0;for(let e=0;ei.zp&&(r+=1),ei.Zp&&(r+=8),ss&&(s=n);const h=g.GA-i.Zp,a=i.ag-g.GA;i.tI=a>h?s+a:s+h}for(;;){let t=-50,i=-1;for(let e=0;et&&(t=s.tI,i=e))}if(-1===i)break;const a=g.gA[i];if(a){a.bA=g.bA;let t=a.model;t||(t=a.Yg?.draw(e)??null),t&&!this.iI(h,a.zp,a.og,a.Zp,a.ag,t.Ud)&&t.draw(a.Vg,g.kA,g.MA,g.DA,g.NA,a.x-g.FA,a.y-g.BA,a.z-g.UA,a.jp);for(let t=a.zp;t<=a.og;t++)for(let i=a.Zp;i<=a.ag;i++){const e=o[t][i];e&&(0!==e.Tg?g.vA.Fm(e):t===s&&i===n||!e.update||g.vA.Fm(e))}}}if(t.bg)continue}if(!t.update||0!==t.Tg)continue;if(s<=g.PA&&s>g.WA){const t=o[s-1][n];if(t&&t.update)continue}if(s>=g.PA&&sg.YA){const t=o[s][n-1];if(t&&t.update)continue}if(n>=g.GA&&n=r){const r=t+g.ep[n],h=s+g.sp[n];i.model.draw(512*n+256,g.kA,g.MA,g.DA,g.NA,r,e,h,i.jp)}if(512&i.type&&h<=r){const r=t+g.np[n],h=s+g.rp[n];i.model.draw(512*n+1280&2047,g.kA,g.MA,g.DA,g.NA,r,e,h,i.jp)}}const e=t.Np;e&&(e.qg&t.Kg&&!this.Zg(h,s,n,e.qg)&&e.Yp?.draw(0,g.kA,g.MA,g.DA,g.NA,e.x-g.FA,e.y-g.BA,e.z-g.UA,e.jp),e.Xg&t.Kg&&!this.Zg(h,s,n,e.Xg)&&e.Wp?.draw(0,g.kA,g.MA,g.DA,g.NA,e.x-g.FA,e.y-g.BA,e.z-g.UA,e.jp))}if(rg.PA){const t=o[s-1][n];t&&t.update&&g.vA.Fm(t)}if(n>g.GA){const t=o[s][n-1];t&&t.update&&g.vA.Fm(t)}}};Wg=(t,i,e,n,r,h,o,a)=>{let l,c,f,u,d=l=(e<<7)-g.FA,y=c=(n<<7)-g.UA,m=f=d+128,A=u=y+128,p=this.wp[i][e][n]-g.BA,I=this.wp[i][e+1][n]-g.BA,_=this.wp[i][e+1][n+1]-g.BA,C=this.wp[i][e][n+1]-g.BA,E=y*o+d*a>>16;if(y=y*a-d*o>>16,d=E,E=p*h-y*r>>16,y=p*r+y*h>>16,p=E,y<50)return;if(E=c*o+m*a>>16,c=c*a-m*o>>16,m=E,E=I*h-c*r>>16,c=I*r+c*h>>16,I=E,c<50)return;if(E=A*o+f*a>>16,A=A*a-f*o>>16,f=E,E=_*h-A*r>>16,A=_*r+A*h>>16,_=E,A<50)return;if(E=u*o+l*a>>16,u=u*a-l*o>>16,l=E,E=C*h-u*r>>16,u=C*r+u*h>>16,C=E,u<50)return;const v=s.A.rl+((d<<9)/y|0),b=s.A.hl+((p<<9)/y|0),T=s.A.rl+((m<<9)/c|0),R=s.A.hl+((I<<9)/c|0),O=s.A.rl+((f<<9)/A|0),L=s.A.hl+((_<<9)/A|0),S=s.A.rl+((l<<9)/u|0),x=s.A.hl+((C<<9)/u|0);if(s.A.alpha=0,(O-S)*(R-x)-(L-x)*(T-S)>0)if(s.A.eI=O<0||S<0||T<0||O>w.A.sI||S>w.A.sI||T>w.A.sI,g.jA&&this.nI(g.Ma,g.Da,L,x,R,O,S,T)&&(g.cp=e,g.fp=n),-1===t.rI)12345678!==t.hI&&s.A.oI(O,S,T,L,x,R,t.hI,t.aI,t.lI);else if(g.et){const i=g.ap[t.rI];s.A.oI(O,S,T,L,x,R,this.cI(i,t.hI),this.cI(i,t.aI),this.cI(i,t.lI))}else t.flat?s.A.fI(O,S,T,L,x,R,t.hI,t.aI,t.lI,d,p,y,m,l,I,C,c,u,t.rI):s.A.fI(O,S,T,L,x,R,t.hI,t.aI,t.lI,f,_,A,l,m,C,I,u,c,t.rI);if(!((v-T)*(x-R)-(b-R)*(S-T)<=0))if(s.A.eI=v<0||T<0||S<0||v>w.A.sI||T>w.A.sI||S>w.A.sI,g.jA&&this.nI(g.Ma,g.Da,b,R,x,v,T,S)&&(g.cp=e,g.fp=n),-1!==t.rI){if(!g.et)return void s.A.fI(v,T,S,b,R,x,t.uI,t.lI,t.aI,d,p,y,m,l,I,C,c,u,t.rI);const i=g.ap[t.rI];s.A.oI(v,T,S,b,R,x,this.cI(i,t.uI),this.cI(i,t.lI),this.cI(i,t.aI))}else 12345678!==t.uI&&s.A.oI(v,T,S,b,R,x,t.uI,t.lI,t.aI)};Hg=(t,i,e,n,r,h,o)=>{let a=e.Od.length;for(let t=0;t>16;if(l=l*o-i*h>>16,i=c,c=a*r-l*n>>16,l=a*n+l*r>>16,a=c,l<50)return;e.dI&&(y.A.wI[t]=i,y.A.yI[t]=a,y.A.mI[t]=l),y.A.AI[t]=s.A.rl+((i<<9)/l|0),y.A.pI[t]=s.A.hl+((a<<9)/l|0)}s.A.alpha=0,a=e.gI.length;for(let n=0;n0)if(s.A.eI=a<0||l<0||c<0||a>w.A.sI||l>w.A.sI||c>w.A.sI,g.jA&&this.nI(g.Ma,g.Da,f,u,d,a,l,c)&&(g.cp=t,g.fp=i),e.dI&&-1!==e.dI[n])if(g.et){const t=g.ap[e.dI[n]];s.A.oI(a,l,c,f,u,d,this.cI(t,e.CI[n]),this.cI(t,e.EI[n]),this.cI(t,e.vI[n]))}else e.flat?s.A.fI(a,l,c,f,u,d,e.CI[n],e.EI[n],e.vI[n],y.A.wI[0],y.A.yI[0],y.A.mI[0],y.A.wI[1],y.A.wI[3],y.A.yI[1],y.A.yI[3],y.A.mI[1],y.A.mI[3],e.dI[n]):s.A.fI(a,l,c,f,u,d,e.CI[n],e.EI[n],e.vI[n],y.A.wI[r],y.A.yI[r],y.A.mI[r],y.A.wI[h],y.A.wI[o],y.A.yI[h],y.A.yI[o],y.A.mI[h],y.A.mI[o],e.dI[n]);else 12345678!==e.CI[n]&&s.A.oI(a,l,c,f,u,d,e.CI[n],e.EI[n],e.vI[n])}};Gg=(t,i,e)=>{const s=this.mp[t][i][e];if(s===-g.bA)return!1;if(s===g.bA)return!0;{const s=i<<7,n=e<<7;return this.bI(s+1,this.wp[t][i][e],n+1)&&this.bI(s+128-1,this.wp[t][i+1][e],n+1)&&this.bI(s+128-1,this.wp[t][i+1][e+1],n+128-1)&&this.bI(s+1,this.wp[t][i][e+1],n+128-1)?(this.mp[t][i][e]=g.bA,!0):(this.mp[t][i][e]=-g.bA,!1)}};Zg=(t,i,e,s)=>{if(!this.Gg(t,i,e))return!1;const n=i<<7,r=e<<7,h=this.wp[t][i][e]-1,o=h-120,a=h-230,l=h-238;if(s<16){if(1===s){if(n>g.FA){if(!this.bI(n,h,r))return!1;if(!this.bI(n,h,r+128))return!1}if(t>0){if(!this.bI(n,o,r))return!1;if(!this.bI(n,o,r+128))return!1}return!!this.bI(n,a,r)&&this.bI(n,a,r+128)}if(2===s){if(r0){if(!this.bI(n,o,r+128))return!1;if(!this.bI(n+128,o,r+128))return!1}return!!this.bI(n,a,r+128)&&this.bI(n+128,a,r+128)}if(4===s){if(n0){if(!this.bI(n+128,o,r))return!1;if(!this.bI(n+128,o,r+128))return!1}return!!this.bI(n+128,a,r)&&this.bI(n+128,a,r+128)}if(8===s){if(r>g.UA){if(!this.bI(n,h,r))return!1;if(!this.bI(n+128,h,r))return!1}if(t>0){if(!this.bI(n,o,r))return!1;if(!this.bI(n+128,o,r))return!1}return!!this.bI(n,a,r)&&this.bI(n+128,a,r)}}return!!this.bI(n+64,l,r+64)&&(16===s?this.bI(n,a,r+128):32===s?this.bI(n+128,a,r+128):64===s?this.bI(n+128,a,r):128===s?this.bI(n,a,r):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,i,e,s)=>{if(this.Gg(t,i,e)){const n=i<<7,r=e<<7;return this.bI(n+1,this.wp[t][i][e]-s,r+1)&&this.bI(n+128-1,this.wp[t][i+1][e]-s,r+1)&&this.bI(n+128-1,this.wp[t][i+1][e+1]-s,r+128-1)&&this.bI(n+1,this.wp[t][i][e+1]-s,r+128-1)}return!1};iI=(t,i,e,s,n,r)=>{let h,o;if(i!==e||s!==n){for(h=i;h<=e;h++)for(o=s;o<=n;o++)if(this.mp[t][h][o]===-g.bA)return!1;o=1+(i<<7);const a=2+(s<<7),l=this.wp[t][i][s]-r;if(!this.bI(o,l,a))return!1;const c=(e<<7)-1;if(!this.bI(c,l,a))return!1;const f=(n<<7)-1;return!!this.bI(o,l,f)&&this.bI(c,l,f)}return!!this.Gg(t,i,s)&&(h=i<<7,o=s<<7,this.bI(h+1,this.wp[t][i][s]-r,o+1)&&this.bI(h+128-1,this.wp[t][i+1][s]-r,o+1)&&this.bI(h+128-1,this.wp[t][i+1][s+1]-r,o+128-1)&&this.bI(h+1,this.wp[t][i][s+1]-r,o+128-1))};bI=(t,i,e)=>{for(let s=0;s0){const t=n.wg+(n.kg*s>>8),r=n.yg+(n.Mg*s>>8),h=n.fg+(n.Dg*s>>8),o=n.Ud+(n.Ng*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(2===n.mode){const s=t-n.ug;if(s>0){const t=n.wg+(n.kg*s>>8),r=n.yg+(n.Mg*s>>8),h=n.fg+(n.Dg*s>>8),o=n.Ud+(n.Ng*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(3===n.mode){const s=n.wg-e;if(s>0){const e=n.ug+(n.Fg*s>>8),r=n.dg+(n.Bg*s>>8),h=n.fg+(n.Dg*s>>8),o=n.Ud+(n.Ng*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(4===n.mode){const s=e-n.wg;if(s>0){const e=n.ug+(n.Fg*s>>8),r=n.dg+(n.Bg*s>>8),h=n.fg+(n.Dg*s>>8),o=n.Ud+(n.Ng*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(5===n.mode){const s=i-n.fg;if(s>0){const i=n.ug+(n.Fg*s>>8),r=n.dg+(n.Bg*s>>8),h=n.wg+(n.kg*s>>8),o=n.yg+(n.Mg*s>>8);if(t>=i&&t<=r&&e>=h&&e<=o)return!0}}}return!1};nI=(t,i,e,s,n,r,h,o)=>{if(ie&&i>s&&i>n)return!1;if(tr&&t>h&&t>o)return!1;const a=(i-s)*(o-h)-(t-h)*(n-s);return((i-e)*(h-r)-(t-r)*(s-e))*a>0&&a*((i-n)*(r-o)-(t-o)*(e-n))>0};cI=(t,i)=>((i=(127-i)*(127&t)/160|0)<2?i=2:i>126&&(i=126),(65408&t)+i)}},7121:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{}},4197:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{TI;RI;OI;LI;index;Kw;ua;fa;constructor(t,i,e,s,n,r,h){super(),this.TI=i,this.RI=e,this.OI=s,this.LI=n,this.index=t,this.Kw=r,h&&-1!==r.wa&&this.Kw.delay?(this.ua=Math.random()*this.Kw.da|0,this.fa=Math.random()*this.Kw.delay[this.ua]|0):(this.ua=-1,this.fa=0)}}},9418:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(7121),n=e(1312),r=e(3867);class h extends s.A{x=0;z=0;Vg=0;SI=!1;size=1;Sl=-1;xI=-1;kI=-1;MI=-1;DI=-1;NI=-1;FI=-1;BI=null;UI=100;GI=0;WI=0;HI=0;YI=0;VI=-1e3;KI=0;XI=0;jI=-1;zI=0;ZI=0;qI=-1;$I=0;JI=0;QI=-1;t_=0;i_=0;e_=0;s_=0;n_=-1;r_=0;h_=0;o_=0;a_=0;l_=0;c_=0;f_=0;u_=0;d_=0;w_=0;y_=0;bA=0;height=0;m_=0;pathLength=0;A_=new Int32Array(10);p_=new Int32Array(10);g_=new r.fe(10,!1);I_=0;__=-1;C_=-1;E_=-1;v_=-1;move(t,i,e){if(-1!==this.QI&&n.A.Lo[this.QI].priority<=1&&(this.QI=-1),!t){const t=i-this.A_[0],s=e-this.p_[0];if(t>=-8&&t<=8&&s>=-8&&s<=8){this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.A_[t]=this.A_[t-1],this.p_[t]=this.p_[t-1],this.g_[t]=this.g_[t-1];return this.A_[0]=i,this.p_[0]=e,void(this.g_[0]=!1)}}this.pathLength=0,this.I_=0,this.A_[0]=i,this.p_[0]=e,this.x=128*this.A_[0]+64*this.size,this.z=128*this.p_[0]+64*this.size}step(t,i){let e=this.A_[0],s=this.p_[0];0===i?(e--,s++):1===i?s++:2===i?(e++,s++):3===i?e--:4===i?e++:5===i?(e--,s--):6===i?s--:7===i&&(e++,s--),-1!==this.QI&&n.A.Lo[this.QI].priority<=1&&(this.QI=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.A_[t]=this.A_[t-1],this.p_[t]=this.p_[t-1],this.g_[t]=this.g_[t-1];this.A_[0]=e,this.p_[0]=s,this.g_[0]=t}}},8268:(t,i,e)=>{e.d(i,{A:()=>d});var s=e(9418),n=e(8665),r=e(2679),h=e(8738),o=e(1312),a=e(8317),l=e(1302),c=e(3819),f=e(3867),u=e(9298);class d extends s.A{static b_=1;static T_=2;static R_=4;static O_=8;static L_=16;static S_=32;static x_=64;static k_=128;static M_=256;static D_=512;static Ll=[u.A.N_,u.A.F_,u.A.B_,u.A.U_,u.A.P_,u.A.G_,u.A.W_,u.A.H_,u.A.Y_,u.A.V_,u.A.K_,u.A.X_,u.A.j_,u.A.z_,u.A.Z_,u.A.q_];static Ol=[[u.A.J_,u.A.Q_,u.A.tC,u.A.iC,u.A.eC,u.A.sC,u.A.nC,u.A.rC,u.A.hC,u.A.oC,u.A.aC,u.A.lC],[u.A.cC,u.A.fC,u.A.uC,u.A.dC,u.A.wC,u.A.yC,u.A.mC,u.A.AC,u.A.pC,u.A.gC,u.A.IC,u.A._C,u.A.CC,u.A.EC,u.A.vC,u.A.bC],[u.A.bC-1,u.A.cC+1,u.A.fC,u.A.uC,u.A.dC,u.A.wC,u.A.yC,u.A.mC,u.A.AC,u.A.pC,u.A.gC,u.A.IC,u.A._C,u.A.CC,u.A.EC,u.A.vC],[u.A.TC,u.A.RC,u.A.OC,u.A.LC,u.A.SC,u.A.xC],[u.A.kC,u.A.MC,u.A.DC,u.A.NC,u.A.FC,u.A.BC,u.A.UC,u.A.PC]];static So=new r.A(200);name=null;visible=!1;GC=0;WC=0;HC=new Uint16Array(12);YC=new Uint16Array(5);Kl=0;VC=0n;y=0;KC=0;XC=0;jC=0;zC=0;ZC=0;qC=null;Sg=0;xg=0;Pm=0;Gm=0;et=!1;draw(t){if(!this.visible)return null;let i=this.Zd();if(this.height=i.Ud,i.Qd=!0,this.et)return i;if(-1!==this.n_&&-1!==this.r_){const t=h.A.Lo[this.n_],e=n.A.vu(t.al(),!0,!t.ad,!1);e.translate(-this.a_,0,0),e.xl(),t.Kw&&t.Kw.frames&&e.kl(t.Kw.frames[this.r_]),e.Dd=null,e.Nd=null,128===t.jd&&128===t.zd||e.scale(t.jd,t.zd,t.jd),e.Ml(t.fd+64,t.ud+850,-30,-50,-30,!0);const s=[i,e];i=n.A.$C(s,2)}if(this.qC&&(t>=this.XC&&(this.qC=null),t>=this.KC&&t=d.Ol[i].length)&&(e=0),this.YC[i]=e}this.Sl=t.ou,65535===this.Sl&&(this.Sl=-1),this.xI=t.ou,65535===this.xI&&(this.xI=-1),this.kI=t.ou,65535===this.kI&&(this.kI=-1),this.MI=t.ou,65535===this.MI&&(this.MI=-1),this.DI=t.ou,65535===this.DI&&(this.DI=-1),this.NI=t.ou,65535===this.NI&&(this.NI=-1),this.FI=t.ou,65535===this.FI&&(this.FI=-1),this.name=c.A.Cl(c.A.El(t.JC)),this.Kl=t.lu,this.visible=!0,this.VC=0n;for(let t=0;t<12;t++)this.VC<<=0x4n,this.HC[t]>=256&&(this.VC+=BigInt(this.HC[t])-256n);this.HC[0]>=256&&(this.VC+=BigInt(this.HC[0])-256n>>4n),this.HC[1]>=256&&(this.VC+=BigInt(this.HC[1])-256n>>8n);for(let t=0;t<5;t++)this.VC<<=0x3n,this.VC+=BigInt(this.YC[t]);this.VC<<=0x1n,this.VC+=BigInt(this.GC)}Xu(){if(!this.visible)return null;const t=new f.fe(12,null);let i=0;for(let e=0;e<12;e++){const s=this.HC[e];if(s>=256&&s<512&&(t[i++]=a.A.Lo[s-256].Xu()),s>=512){const e=l.A.get(s-512).Xu(this.GC);e&&(t[i++]=e)}}const e=n.A.Tl(t,i);for(let t=0;t<5;t++)0!==this.YC[t]&&(e.Rl(d.Ol[t][0],d.Ol[t][this.YC[t]]),1===t&&e.Rl(d.Ll[0],d.Ll[this.YC[t]]));return e}Zd(){let t=this.VC,i=-1,e=-1,s=-1,r=-1;if(this.QI>=0&&0===this.e_){const n=o.A.Lo[this.QI];if(n.frames&&(i=n.frames[this.t_]),this.qI>=0&&this.qI!==this.Sl){const t=o.A.Lo[this.qI].frames;t&&(e=t[this.$I])}n.Hw>=0&&(s=n.Hw,t+=BigInt(s-this.HC[5])<<8n),n.Yw>=0&&(r=n.Yw,t+=BigInt(r-this.HC[3])<<16n)}else if(this.qI>=0){const t=o.A.Lo[this.qI].frames;t&&(i=t[this.$I])}let h=d.So?.get(t);if(!h){const i=new f.fe(12,null);let e=0;for(let t=0;t<12;t++){let n=this.HC[t];if(r>=0&&3===t&&(n=r),s>=0&&5===t&&(n=s),n>=256&&n<512){const t=a.A.Lo[n-256].al();t&&(i[e++]=t)}if(n>=512){const t=l.A.get(n-512).Pw(this.GC);t&&(i[e++]=t)}}h=n.A.Tl(i,e);for(let t=0;t<5;t++)0!==this.YC[t]&&(h.Rl(d.Ol[t][0],d.Ol[t][this.YC[t]]),1===t&&h.Rl(d.Ll[0],d.Ll[this.YC[t]]));h.xl(),h.Ml(64,850,-30,-50,-30,!0),d.So?.put(t,h)}if(this.et)return h;const c=n.A.qd(h,!0);return-1!==i&&-1!==e?c.$d(i,e,o.A.Lo[this.QI].Gw):-1!==i&&c.kl(i),c.Jd(),c.Dd=null,c.Nd=null,c}}},9222:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;model;jp;info;constructor(t,i,e,s,n,r){this.y=t,this.x=i,this.z=e,this.model=s,this.jp=n,this.info=r}}},1161:(t,i,e)=>{e.d(i,{A:()=>s});class s{level;y;x;z;model;Yg;Vg;zp;og;Zp;ag;jp;info;tI=0;bA=0;constructor(t,i,e,s,n,r,h,o,a,l,c,f,u){this.level=t,this.y=i,this.x=e,this.z=s,this.model=n,this.Yg=r,this.Vg=h,this.zp=o,this.og=a,this.Zp=l,this.ag=c,this.jp=f,this.info=u}}},5748:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;Qg;Jg;$g;jp;offset;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.Qg=s,this.Jg=n,this.$g=r,this.jp=h,this.offset=o}}},8256:(t,i,e)=>{e.d(i,{A:()=>s});class s{Sg;Pm;xg;Gm;type;ug;dg;wg;yg;fg;Ud;mode=0;Fg=0;Bg=0;kg=0;Mg=0;Dg=0;Ng=0;constructor(t,i,e,s,n,r,h,o,a,l,c){this.Sg=t,this.Pm=i,this.xg=e,this.Gm=s,this.type=n,this.ug=r,this.dg=h,this.wg=o,this.yg=a,this.fg=l,this.Ud=c}}},3795:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1982),n=e(3867);class r extends s.A{level;x;z;Pg;kp;Og;bp=null;Rp=null;Np=null;Fp=null;Op=null;Mp=null;Ep=null;xp=0;Lg=0;vp=0;visible=!1;update=!1;bg=!1;Tg=0;jg=0;zg=0;Kg=0;constructor(t,i,e){super(),this.Pg=this.level=t,this.x=i,this.z=e,this.kp=new n.fe(5,null),this.Og=new Int32Array(5)}}},2771:(t,i,e)=>{e.d(i,{A:()=>s});class s{static AI=new Int32Array(6);static pI=new Int32Array(6);static wI=new Int32Array(6);static yI=new Int32Array(6);static mI=new Int32Array(6);static QC=[Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,2,6),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,13,14)];static tE=[Int8Array.of(0,1,2,3,0,0,1,3),Int8Array.of(1,1,2,3,1,0,1,3),Int8Array.of(0,1,2,3,1,0,1,3),Int8Array.of(0,0,1,2,0,0,2,4,1,0,4,3),Int8Array.of(0,0,1,4,0,0,4,3,1,1,2,4),Int8Array.of(0,0,4,3,1,0,1,2,1,0,2,4),Int8Array.of(0,1,2,4,1,0,1,4,1,0,4,3),Int8Array.of(0,4,1,2,0,4,2,5,1,0,4,5,1,0,5,3),Int8Array.of(0,4,1,2,0,4,2,3,0,4,3,5,1,0,4,5),Int8Array.of(0,0,4,5,1,4,1,2,1,4,2,3,1,4,3,5),Int8Array.of(0,0,1,5,0,1,4,5,0,1,2,4,1,0,5,3,1,5,4,3,1,4,2,3),Int8Array.of(1,0,1,5,1,1,4,5,1,1,2,4,0,0,5,3,0,5,4,3,0,4,2,3),Int8Array.of(1,0,5,4,1,0,1,5,0,0,4,3,0,4,5,3,0,5,2,3,0,1,2,5)];static iE=128;static eE=this.iE/2|0;static sE=this.iE/4|0;static nE=3*this.iE/4|0;Od;Sd;Ld;CI;EI;vI;gI;II;_I;dI;flat;shape;angle;Cg;Eg;constructor(t,i,e,n,r,h,o,a,l,c,f,u,d,w,y,m,A,p,g){this.flat=!(A!==n||A!==w||A!==a),this.shape=i,this.angle=h,this.Cg=d,this.Eg=l;const I=s.QC[i],_=I.length;this.Od=new Int32Array(_),this.Sd=new Int32Array(_),this.Ld=new Int32Array(_);const C=new Int32Array(_),E=new Int32Array(_),v=t*s.iE,b=p*s.iE;for(let t=0;t<_;t++){let i,l,f,d,p,_=I[t];!(1&_)&&_<=8&&(_=1+(_-h-h-1&7)),_>8&&_<=12&&(_=9+(_-h-9&3)),_>12&&_<=16&&(_=13+(_-h-13&3)),1===_?(i=v,l=b,f=A,d=o,p=c):2===_?(i=v+s.eE,l=b,f=A+n>>1,d=o+g>>1,p=c+e>>1):3===_?(i=v+s.iE,l=b,f=n,d=g,p=e):4===_?(i=v+s.iE,l=b+s.eE,f=n+w>>1,d=g+r>>1,p=e+y>>1):5===_?(i=v+s.iE,l=b+s.iE,f=w,d=r,p=y):6===_?(i=v+s.eE,l=b+s.iE,f=w+a>>1,d=r+m>>1,p=y+u>>1):7===_?(i=v,l=b+s.iE,f=a,d=m,p=u):8===_?(i=v,l=b+s.eE,f=a+A>>1,d=m+o>>1,p=u+c>>1):9===_?(i=v+s.eE,l=b+s.sE,f=A+n>>1,d=o+g>>1,p=c+e>>1):10===_?(i=v+s.nE,l=b+s.eE,f=n+w>>1,d=g+r>>1,p=e+y>>1):11===_?(i=v+s.eE,l=b+s.nE,f=w+a>>1,d=r+m>>1,p=y+u>>1):12===_?(i=v+s.sE,l=b+s.eE,f=a+A>>1,d=m+o>>1,p=u+c>>1):13===_?(i=v+s.sE,l=b+s.sE,f=A,d=o,p=c):14===_?(i=v+s.nE,l=b+s.sE,f=n,d=g,p=e):15===_?(i=v+s.nE,l=b+s.nE,f=w,d=r,p=y):(i=v+s.sE,l=b+s.nE,f=a,d=m,p=u),this.Od[t]=i,this.Sd[t]=f,this.Ld[t]=l,C[t]=d,E[t]=p}const T=s.tE[i],R=T.length/4|0;this.gI=new Int32Array(R),this.II=new Int32Array(R),this._I=new Int32Array(R),this.CI=new Int32Array(R),this.EI=new Int32Array(R),this.vI=new Int32Array(R),this.dI=-1!==f?new Int32Array(R):null;let O=0;for(let t=0;t{e.d(i,{A:()=>s});class s{static sA=0;static Tp=1;static rE=2;static hE=3;static oE=4;static aE=5;static eE=6;static sE=7;static nE=8;static lE=9;static cE=10;static fE=11}},3479:(t,i,e)=>{e.d(i,{A:()=>s});class s{uI;lI;hI;aI;rI;color;flat;constructor(t,i,e,s,n,r,h){this.uI=t,this.lI=i,this.hI=e,this.aI=s,this.rI=n,this.color=r,this.flat=h}}},6855:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;Xg;qg;Wp;Yp;jp;info;constructor(t,i,e,s,n,r,h,o,a){this.y=t,this.x=i,this.z=e,this.Xg=s,this.qg=n,this.Wp=r,this.Yp=h,this.jp=o,this.info=a}}},7441:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;type;angle;model;jp;info;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.type=s,this.angle=n,this.model=r,this.jp=h,this.info=o}}},7536:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n{uE;dE;constructor(t){this.dE=[],this.uE=t;for(let i=0;i{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{yE;mE;constructor(){super(),this.yE=this,this.mE=this}AE(){this.mE&&this.yE&&(this.mE.yE=this.yE,this.yE.mE=this.mE,this.yE=null,this.mE=null)}}},3819:(t,i,e)=>{e.d(i,{A:()=>s});class s{static pE=['_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9'];static gE=t=>{t=t.trim();let i=0n;for(let e=0;e=65&&s<=90?i+=BigInt(s+1-65):s>=97&&s<=122?i+=BigInt(s+1-97):s>=48&&s<=57&&(i+=BigInt(s+27-48))}return i};static El=t=>{if(t<0n||t>=6582952005840035281n)return'invalid_name';if(t%37n===0n)return'invalid_name';let i=0;const e=Array(12);for(;0n!==t;){const s=t;t/=37n,e[11-i++]=this.pE[Number(s-37n*t)]}return e.slice(12-i).join('')};static IE=t=>{const i=[...t.toLowerCase()];let e=!0;for(let t=0;t='a'&&s<='z'&&(i[t]=s.toUpperCase(),e=!1),'.'!==s&&'!'!==s||(e=!0)}return i.join('')};static _E=t=>{let i='';for(let e=0;e(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static Cl=t=>{if(0===t.length)return t;const i=[...t];for(let t=0;t='a'&&i[t+1]<='z'&&(i[t+1]=String.fromCharCode(i[t+1].charCodeAt(0)+'A'.charCodeAt(0)-97)));return i[0]>='a'&&i[0]<='z'&&(i[0]=String.fromCharCode(i[0].charCodeAt(0)+'A'.charCodeAt(0)-97)),i.join('')};static _u=t=>{const i=t.toUpperCase();let e=0n;for(let t=0;t>56n)&0xffffffffffffffn;return e}}},6666:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n{CE;cursor=null;constructor(){const t=new s.A;t.next=t,t.wE=t,this.CE=t}Fm(t){t.wE&&t.hw(),t.wE=this.CE.wE,t.next=this.CE,t.wE&&(t.wE.next=t),t.next.wE=t}EE(t){t.wE&&t.hw(),t.wE=this.CE,t.next=this.CE.next,t.wE.next=t,t.next&&(t.next.wE=t)}Ug(){const t=this.CE.next;return t===this.CE?null:(t?.hw(),t)}head(){const t=this.CE.next;return t===this.CE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}vE(){const t=this.CE.wE;return t===this.CE?(this.cursor=null,null):(this.cursor=t?.wE||null,t)}next(){const t=this.cursor;return t===this.CE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}wE(){const t=this.cursor;return t===this.CE?(this.cursor=null,null):(this.cursor=t?.wE||null,t)}clear(){for(;;){const t=this.CE.next;if(t===this.CE)return;t?.hw()}}}},1982:(t,i,e)=>{e.d(i,{A:()=>s});class s{key;next;wE;constructor(){this.key=0n,this.next=this,this.wE=this}hw(){this.wE&&this.next&&(this.wE.next=this.next,this.next.wE=this.wE,this.next=null,this.wE=null)}}},2679:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(2512),n=e(7536);class r{bE;TE;history;available;constructor(t){this.bE=t,this.available=t,this.TE=new n.A(1024),this.history=new s.A}get(t){const i=this.TE.get(t);return i&&this.history.push(i),i}put(t,i){if(0===this.available){const t=this.history.pop();t?.hw(),t?.AE()}else this.available--;this.TE.put(t,i),this.history.push(i)}clear(){const t=this.history.pop();t?(t.hw(),t.AE()):this.available=this.bE}}},2512:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n{head;constructor(){this.head=new s.A}push(t){t.mE&&t.AE(),t.mE=this.head.mE,t.yE=this.head,t.mE&&(t.mE.yE=t),t.yE.mE=t}pop(){const t=this.head.yE;return t===this.head?null:(t?.AE(),t)}}},8534:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(3867);class r{static Lo=[];static hu=t=>{const i=new s.A(t.read('base_head.dat')),e=new s.A(t.read('base_type.dat')),h=new s.A(t.read('base_label.dat')),o=i.ou;i.lf+=2;for(let t=0;t{e.d(i,{A:()=>r});var s=e(8534),n=e(1069);class r{static Lo=[];static hu=t=>{const i=new n.A(t.read('frame_head.dat')),e=new n.A(t.read('frame_tran1.dat')),h=new n.A(t.read('frame_tran2.dat')),o=new n.A(t.read('frame_del.dat')),a=i.ou;i.lf+=2;const l=new Int32Array(500),c=new Int32Array(500),f=new Int32Array(500),u=new Int32Array(500);for(let t=0;t0){if(0!==d.types[t])for(let i=t-1;i>y;i--)if(0===d.types[i]){l[m]=i,c[m]=0,f[m]=0,u[m]=0,m++;break}l[m]=t;let e=0;3===d.types[l[m]]&&(e=128),c[m]=1&i?h.OE:e,f[m]=2&i?h.OE:e,u[m]=4&i?h.OE:e,y=t,m++}}n.length=m,n.LE=new Int32Array(m),n.x=new Int32Array(m),n.y=new Int32Array(m),n.z=new Int32Array(m);for(let t=0;t{e.d(i,{bc:()=>s,zo:()=>n,SE:()=>o,xE:()=>h,kE:()=>r});const s=document.getElementById('canvas'),n=s.getContext('2d',{willReadFrequently:!0}),r=document.createElement('canvas'),h=document.createElement('img'),o=r.getContext('2d',{willReadFrequently:!0})},9298:(t,i,e)=>{e.d(i,{A:()=>s});class s{static RED=16711680;static GREEN=65280;static BLUE=255;static Ga=16776960;static ME=65535;static hA=16711935;static Ia=16777215;static Pa=0;static DE=16748608;static NE=8388608;static FE=128;static BE=16756736;static UE=16740352;static PE=16723968;static GE=12648192;static WE=8453888;static HE=4259584;static YE=9179409;static VE=6116423;static ia=2301979;static ea=5063219;static na=7759444;static ha=3353893;static KE=8388736;static XE=13350793;static jE=Int32Array.of(s.Ga,s.RED,s.GREEN,s.ME,s.hA,s.Ia);static J_=6798;static Q_=107;static tC=10283;static iC=16;static eC=4797;static sC=7744;static nC=5799;static rC=4634;static hC=33697;static oC=22433;static aC=2983;static lC=54193;static cC=8741;static fC=12;static uC=64030;static dC=43162;static wC=7735;static yC=8404;static mC=1701;static AC=38430;static pC=24094;static gC=10153;static IC=56621;static _C=4783;static CC=1341;static EC=16578;static vC=35003;static bC=25239;static N_=9104;static F_=10275;static B_=7595;static U_=3610;static P_=7975;static G_=8526;static W_=918;static H_=38802;static Y_=24466;static V_=10145;static K_=58654;static X_=5027;static j_=1457;static z_=16565;static Z_=34991;static q_=25486;static TC=4626;static RC=11146;static OC=6439;static LC=12;static SC=4758;static xC=10270;static PC=4574;static kC=4550;static MC=4537;static DC=5681;static NC=5673;static FC=5790;static BC=6806;static UC=8076}},8950:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n extends s.A{static cw=new Int32Array;static fw=0;static uw=0;static top=0;static bottom=0;static left=0;static right=0;static sI=0;static zE=0;static ZE=0;static bind=(t,i,e)=>{this.cw=t,this.fw=i,this.uw=e,this.ma(0,0,i,e)};static qE=()=>{this.left=0,this.top=0,this.right=this.fw,this.bottom=this.uw,this.sI=this.right-1,this.zE=this.right/2|0};static ma=(t,i,e,s)=>{t<0&&(t=0),i<0&&(i=0),e>this.fw&&(e=this.fw),s>this.uw&&(s=this.uw),this.top=i,this.bottom=s,this.left=t,this.right=e,this.sI=this.right-1,this.zE=this.right/2|0,this.ZE=this.bottom/2|0};static clear=()=>{const t=this.fw*this.uw;for(let i=0;i{this.ra(t,i,n,e),this.ra(t,i+s-1,n,e),this.sa(t,i,n,s),this.sa(t+e-1,i,n,s)};static ra=(t,i,e,s)=>{if(i=this.bottom)return;tthis.right&&(s=this.right-t);const n=t+i*this.fw;for(let t=0;t{if(t=this.right)return;ithis.bottom&&(s=this.bottom-i);const n=t+i*this.fw;for(let t=0;t{const r=Math.abs(e-t),h=Math.abs(s-i),o=t=this.left&&t=this.top&&i-h&&(l-=h,t+=o),e{tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const r=this.fw-e;let h=t+i*this.fw;for(let t=-s;t<0;t++){for(let t=-e;t<0;t++)this.cw[h++]=n;h+=r}};static JE(t,i,e,s,n,r){tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const h=256-r,o=(n>>16&255)*r,a=(n>>8&255)*r,l=(255&n)*r,c=this.fw-e;let f=t+i*this.fw;for(let t=0;t>16&255)*h>>8<<16)+(a+(this.cw[f]>>8&255)*h>>8<<8)+(l+(255&this.cw[f])*h>>8);this.cw[f++]=t}f+=c}}static QE(t,i,e,s,n){const r=256-n,h=(s>>16&255)*n,o=(s>>8&255)*n,a=(255&s)*n;let l=i-e;l<0&&(l=0);let c=i+e;c>=this.uw&&(c=this.uw-1);for(let s=l;s<=c;s++){const n=s-i,l=0|Math.sqrt(e*e-n*n);let c=t-l;c<0&&(c=0);let f=t+l;f>=this.fw&&(f=this.fw-1);let u=c+s*this.fw;for(let t=c;t<=f;t++){const t=(h+(this.cw[u]>>16&255)*r>>8<<16)+(o+(this.cw[u]>>8&255)*r>>8<<8)+(a+(255&this.cw[u])*r>>8);this.cw[u++]=t}}}static tv=(t,i,e)=>{t=this.right||i=this.bottom||(this.cw[t+i*this.fw]=e)}}},4583:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(8950),n=e(1673),r=e(3867);class h extends s.A{static et=!1;static iv=new Int32Array(512);static ev=new Int32Array(2048);static sin=new Int32Array(2048);static cos=new Int32Array(2048);static palette=new Int32Array(65536);static sv=new r.fe(50,null);static nv=0;static lw=new Int32Array;static rl=0;static hl=0;static dw=!0;static eI=!1;static alpha=0;static rv=null;static hv=new r.fe(50,null);static ov=0;static bA=0;static av=new Int32Array(50);static lv=new r.fe(50,null);static cv=!1;static fv=new r.fe(50,!1);static uv=new Int32Array(50);static{for(let t=1;t<512;t++)this.iv[t]=32768/t|0;for(let t=1;t<2048;t++)this.ev[t]=65536/t|0;for(let t=0;t<2048;t++)this.sin[t]=65536*Math.sin(.0030679615757712823*t)|0,this.cos[t]=65536*Math.cos(.0030679615757712823*t)|0}static To=()=>{this.iv=null,this.iv=null,this.sin=null,this.cos=null,this.lw=null,this.sv=null,this.fv=null,this.uv=null,this.rv=null,this.hv=null,this.av=null,this.palette=null,this.lv=null,console.log('Draw3D unloaded!')};static Tc=()=>{this.lw=new Int32Array(this.uw);for(let t=0;t{this.lw=new Int32Array(i);for(let e=0;e{this.rv=null,this.hv.fill(null)};static yv=t=>{this.nv=0;for(let i=0;i<50;i++)try{this.sv[i]=n.A.Cu(t,i.toString()),this.et&&128===this.sv[i]?.Fa?this.sv[i]?.mv():this.sv[i]?.Cw(),this.nv++}catch(t){}};static rA=t=>{if(0!==this.uv[t])return this.uv[t];const i=this.lv[t];if(!i)return 0;let e=0,s=0,n=0;const r=i.length;for(let t=0;t>16&255,s+=i[t]>>8&255,n+=255&i[t];let h=(e/r<<16)+(s/r<<8)+(n/r|0);return h=this.Av(h,1.4),0===h&&(h=1),this.uv[t]=h,h};static pv=t=>{const i=t+.03*Math.random()-.015;let e=0;for(let t=0;t<512;t++){const s=(t/8|0)/64+.0078125,n=(7&t)/8+.0625;for(let t=0;t<128;t++){const r=t/128;let h=r,o=r,a=r;if(0!==n){let t;t=r<.5?r*(n+1):r+n-r*n;const i=2*r-t;let e=s+.3333333333333333;e>1&&e--;let l=s-.3333333333333333;l<0&&l++,h=6*e<1?i+6*(t-i)*e:2*e<1?t:3*e<2?i+(t-i)*(.6666666666666666-e)*6:i,o=6*s<1?i+6*(t-i)*s:2*s<1?t:3*s<2?i+(t-i)*(.6666666666666666-s)*6:i,a=6*l<1?i+6*(t-i)*l:2*l<1?t:3*l<2?i+(t-i)*(.6666666666666666-l)*6:i}const l=((256*h|0)<<16)+((256*o|0)<<8)+(256*a|0);this.palette[e++]=this.Av(l,i)}}for(let t=0;t<50;t++){const e=this.sv[t];if(!e)continue;const s=e.palette;this.lv[t]=new Int32Array(s.length);for(let e=0;e{const e=(t>>16)/256,s=(t>>8&255)/256,n=(255&t)/256;return((256*Math.pow(e,i)|0)<<16)+((256*Math.pow(s,i)|0)<<8)+(256*Math.pow(n,i)|0)};static Iv=t=>{this.rv||(this.ov=t,this.et?this.rv=new r.Xr(t,16384):this.rv=new r.Xr(t,65536),this.hv.fill(null))};static oI=(t,i,e,s,n,r,h,o,a)=>{let l=0,c=0;n!==s&&(l=(i-t<<16)/(n-s)|0,c=(o-h<<15)/(n-s)|0);let f=0,u=0;r!==n&&(f=(e-i<<16)/(r-n)|0,u=(a-o<<15)/(r-n)|0);let d=0,w=0;if(r!==s&&(d=(t-e<<16)/(s-r)|0,w=(h-a<<15)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),nf)for(r-=n,n-=s,s=this.lw[s];;){if(--n<0)for(;;){if(--r<0)return;this._v(e>>16,i>>16,a>>7,o>>7,this.cw,s,0),e+=d,i+=f,a+=w,o+=u,s+=this.fw}this._v(e>>16,t>>16,a>>7,h>>7,this.cw,s,0),e+=d,t+=l,a+=w,h+=c,s+=this.fw}else for(r-=n,n-=s,s=this.lw[s];;){if(--n<0)for(;;){if(--r<0)return;this._v(i>>16,e>>16,o>>7,a>>7,this.cw,s,0),e+=d,i+=f,a+=w,o+=u,s+=this.fw}this._v(t>>16,e>>16,h>>7,a>>7,this.cw,s,0),e+=d,t+=l,a+=w,h+=c,s+=this.fw}else if(i=t<<=16,o=h<<=15,s<0&&(i-=d*s,t-=l*s,o-=w*s,h-=c*s,s=0),e<<=16,a<<=15,r<0&&(e-=f*r,a-=u*r,r=0),s!==r&&dl)for(n-=r,r-=s,s=this.lw[s];;){if(--r<0)for(;;){if(--n<0)return;this._v(e>>16,t>>16,a>>7,h>>7,this.cw,s,0),e+=f,t+=l,a+=u,h+=c,s+=this.fw}this._v(i>>16,t>>16,o>>7,h>>7,this.cw,s,0),i+=d,t+=l,o+=w,h+=c,s+=this.fw}else for(n-=r,r-=s,s=this.lw[s];;){if(--r<0)for(;;){if(--n<0)return;this._v(t>>16,e>>16,h>>7,a>>7,this.cw,s,0),e+=f,t+=l,a+=u,h+=c,s+=this.fw}this._v(t>>16,i>>16,h>>7,o>>7,this.cw,s,0),i+=d,t+=l,o+=w,h+=c,s+=this.fw}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),rd)for(s-=r,r-=n,n=this.lw[n];;){if(--r<0)for(;;){if(--s<0)return;this._v(t>>16,e>>16,h>>7,a>>7,this.cw,n,0),t+=l,e+=d,h+=c,a+=w,n+=this.fw}this._v(t>>16,i>>16,h>>7,o>>7,this.cw,n,0),t+=l,i+=f,h+=c,o+=u,n+=this.fw}else for(s-=r,r-=n,n=this.lw[n];;){if(--r<0)for(;;){if(--s<0)return;this._v(e>>16,t>>16,a>>7,h>>7,this.cw,n,0),t+=l,e+=d,h+=c,a+=w,n+=this.fw}this._v(i>>16,t>>16,o>>7,h>>7,this.cw,n,0),t+=l,i+=f,h+=c,o+=u,n+=this.fw}else if(e=i<<=16,a=o<<=15,n<0&&(e-=l*n,i-=f*n,a-=c*n,o-=u*n,n=0),t<<=16,h<<=15,s<0&&(t-=d*s,h-=w*s,s=0),r-=s,s-=n,n=this.lw[n],l>16,i>>16,h>>7,o>>7,this.cw,n,0),t+=d,i+=f,h+=w,o+=u,n+=this.fw}this._v(e>>16,i>>16,a>>7,o>>7,this.cw,n,0),e+=l,i+=f,a+=c,o+=u,n+=this.fw}else for(;;){if(--s<0)for(;;){if(--r<0)return;this._v(i>>16,t>>16,o>>7,h>>7,this.cw,n,0),t+=d,i+=f,h+=w,o+=u,n+=this.fw}this._v(i>>16,e>>16,o>>7,a>>7,this.cw,n,0),e+=l,i+=f,a+=c,o+=u,n+=this.fw}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,o>>7,h>>7,this.cw,r,0),i+=f,t+=l,o+=u,h+=c,r+=this.fw}this._v(i>>16,e>>16,o>>7,a>>7,this.cw,r,0),i+=f,e+=d,o+=u,a+=w,r+=this.fw}else for(;;){if(--s<0)for(;;){if(--n<0)return;this._v(t>>16,i>>16,h>>7,o>>7,this.cw,r,0),i+=f,t+=l,o+=u,h+=c,r+=this.fw}this._v(e>>16,i>>16,a>>7,o>>7,this.cw,r,0),i+=f,e+=d,o+=u,a+=w,r+=this.fw}else if(t=e<<=16,h=a<<=15,r<0&&(t-=f*r,e-=d*r,h-=u*r,a-=w*r,r=0),i<<=16,o<<=15,n<0&&(i-=l*n,o-=c*n,n=0),s-=n,n-=r,r=this.lw[r],f>16,e>>16,o>>7,a>>7,this.cw,r,0),i+=l,e+=d,o+=c,a+=w,r+=this.fw}this._v(t>>16,e>>16,h>>7,a>>7,this.cw,r,0),t+=f,e+=d,h+=u,a+=w,r+=this.fw}else for(;;){if(--n<0)for(;;){if(--s<0)return;this._v(e>>16,i>>16,a>>7,o>>7,this.cw,r,0),i+=l,e+=d,o+=c,a+=w,r+=this.fw}this._v(e>>16,t>>16,a>>7,h>>7,this.cw,r,0),t+=f,e+=d,h+=u,a+=w,r+=this.fw}};static _v=(t,i,e,s,n,r,h)=>{let o;if(this.dw){let a;if(this.eI){if(a=i-t>3?(s-e)/(i-t)|0:0,i>this.sI&&(i=this.sI),t<0&&(e-=t*a,t=0),t>=i)return;r+=t,h=i-t>>2,a<<=2}else{if(!(t>2)>0?(s-e)*this.iv[h]>>15:0}if(0===this.alpha)for(;;){if(--h<0){if((h=i-t&3)>0){o=this.palette[e>>8];do{n[r++]=o,h--}while(h>0);return}break}o=this.palette[e>>8],e+=a,n[r++]=o,n[r++]=o,n[r++]=o,n[r++]=o}else{const s=this.alpha,l=256-this.alpha;for(;;){if(--h<0){if((h=i-t&3)>0){o=this.palette[e>>8],o=((16711935&o)*l>>8&16711935)+((65280&o)*l>>8&65280);do{n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),h--}while(h>0)}break}o=this.palette[e>>8],e+=a,o=((16711935&o)*l>>8&16711935)+((65280&o)*l>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280)}}}else if(tthis.sI&&(i=this.sI),t<0&&(e-=t*a,t=0),t>=i))return;if(r+=t,h=i-t,0===this.alpha)do{n[r++]=this.palette[e>>8],e+=a,h--}while(h>0);else{const t=this.alpha,i=256-this.alpha;do{o=this.palette[e>>8],e+=a,o=((16711935&o)*i>>8&16711935)+((65280&o)*i>>8&65280),n[r++]=o+((16711935&n[r])*t>>8&16711935)+((65280&n[r])*t>>8&65280),h--}while(h>0)}}};static Cv=(t,i,e,s,n,r,h)=>{let o=0;n!==s&&(o=(i-t<<16)/(n-s)|0);let a=0;r!==n&&(a=(e-i<<16)/(r-n)|0);let l=0;if(r!==s&&(l=(t-e<<16)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),na)for(r-=n,n-=s,s=this.lw[s];;){if(--n<0)for(;;){if(--r<0)return;this.Ev(e>>16,i>>16,this.cw,s,h),e+=l,i+=a,s+=this.fw}this.Ev(e>>16,t>>16,this.cw,s,h),e+=l,t+=o,s+=this.fw}else for(r-=n,n-=s,s=this.lw[s];;){if(--n<0)for(;;){if(--r<0)return;this.Ev(i>>16,e>>16,this.cw,s,h),e+=l,i+=a,s+=this.fw}this.Ev(t>>16,e>>16,this.cw,s,h),e+=l,t+=o,s+=this.fw}else if(i=t<<=16,s<0&&(i-=l*s,t-=o*s,s=0),e<<=16,r<0&&(e-=a*r,r=0),s!==r&&lo)for(n-=r,r-=s,s=this.lw[s];;){if(--r<0)for(;;){if(--n<0)return;this.Ev(e>>16,t>>16,this.cw,s,h),e+=a,t+=o,s+=this.fw}this.Ev(i>>16,t>>16,this.cw,s,h),i+=l,t+=o,s+=this.fw}else for(n-=r,r-=s,s=this.lw[s];;){if(--r<0)for(;;){if(--n<0)return;this.Ev(t>>16,e>>16,this.cw,s,h),e+=a,t+=o,s+=this.fw}this.Ev(t>>16,i>>16,this.cw,s,h),i+=l,t+=o,s+=this.fw}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),rl)for(s-=r,r-=n,n=this.lw[n];;){if(--r<0)for(;;){if(--s<0)return;this.Ev(t>>16,e>>16,this.cw,n,h),t+=o,e+=l,n+=this.fw}this.Ev(t>>16,i>>16,this.cw,n,h),t+=o,i+=a,n+=this.fw}else for(s-=r,r-=n,n=this.lw[n];;){if(--r<0)for(;;){if(--s<0)return;this.Ev(e>>16,t>>16,this.cw,n,h),t+=o,e+=l,n+=this.fw}this.Ev(i>>16,t>>16,this.cw,n,h),t+=o,i+=a,n+=this.fw}else if(e=i<<=16,n<0&&(e-=o*n,i-=a*n,n=0),t<<=16,s<0&&(t-=l*s,s=0),o>16,i>>16,this.cw,n,h),t+=l,i+=a,n+=this.fw}this.Ev(e>>16,i>>16,this.cw,n,h),e+=o,i+=a,n+=this.fw}else for(r-=s,s-=n,n=this.lw[n];;){if(--s<0)for(;;){if(--r<0)return;this.Ev(i>>16,t>>16,this.cw,n,h),t+=l,i+=a,n+=this.fw}this.Ev(i>>16,e>>16,this.cw,n,h),e+=o,i+=a,n+=this.fw}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,this.cw,r,h),i+=a,t+=o,r+=this.fw}this.Ev(i>>16,e>>16,this.cw,r,h),i+=a,e+=l,r+=this.fw}else for(n-=s,s-=r,r=this.lw[r];;){if(--s<0)for(;;){if(--n<0)return;this.Ev(t>>16,i>>16,this.cw,r,h),i+=a,t+=o,r+=this.fw}this.Ev(e>>16,i>>16,this.cw,r,h),i+=a,e+=l,r+=this.fw}else if(t=e<<=16,r<0&&(t-=a*r,e-=l*r,r=0),i<<=16,n<0&&(i-=o*n,n=0),a>16,e>>16,this.cw,r,h),i+=o,e+=l,r+=this.fw}this.Ev(t>>16,e>>16,this.cw,r,h),t+=a,e+=l,r+=this.fw}else for(s-=n,n-=r,r=this.lw[r];;){if(--n<0)for(;;){if(--s<0)return;this.Ev(e>>16,i>>16,this.cw,r,h),i+=o,e+=l,r+=this.fw}this.Ev(e>>16,t>>16,this.cw,r,h),t+=a,e+=l,r+=this.fw}};static fI=(t,i,e,s,n,r,h,o,a,l,c,f,u,d,w,y,m,A,p)=>{const g=this.vv(p);this.cv=!this.fv[p];const I=l-u,_=c-w,C=f-m,E=d-l,v=y-c,b=A-f;let T=E*c-v*l<<14;const R=v*f-b*c<<8,O=b*l-E*f<<5;let L=I*c-_*l<<14;const S=_*f-C*c<<8,x=C*l-I*f<<5;let k=_*E-I*v<<14;const M=C*v-_*b<<8,D=I*b-C*E<<5;let N=0,F=0;n!==s&&(N=(i-t<<16)/(n-s)|0,F=(o-h<<16)/(n-s)|0);let B=0,U=0;r!==n&&(B=(e-i<<16)/(r-n)|0,U=(a-o<<16)/(r-n)|0);let P=0,G=0;if(r!==s&&(P=(t-e<<16)/(s-r)|0,G=(h-a<<16)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),nB)for(r-=n,n-=s,s=this.lw[s];;){if(--n<0)for(;;){if(--r<0)return;this.bv(e>>16,i>>16,this.cw,s,g,0,0,T,L,k,R,S,M,a>>8,o>>8),e+=P,i+=B,a+=G,o+=U,s+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.bv(e>>16,t>>16,this.cw,s,g,0,0,T,L,k,R,S,M,a>>8,h>>8),e+=P,t+=N,a+=G,h+=F,s+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}else for(r-=n,n-=s,s=this.lw[s];;){if(--n<0)for(;;){if(--r<0)return;this.bv(i>>16,e>>16,this.cw,s,g,0,0,T,L,k,R,S,M,o>>8,a>>8),e+=P,i+=B,a+=G,o+=U,s+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.bv(t>>16,e>>16,this.cw,s,g,0,0,T,L,k,R,S,M,h>>8,a>>8),e+=P,t+=N,a+=G,h+=F,s+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}}else{i=t<<=16,o=h<<=16,s<0&&(i-=P*s,t-=N*s,o-=G*s,h-=F*s,s=0),e<<=16,a<<=16,r<0&&(e-=B*r,a-=U*r,r=0);const l=s-this.hl;if(T+=O*l,L+=x*l,k+=D*l,T|=0,L|=0,k|=0,(s===r||P>=N)&&(s!==r||B<=N))for(n-=r,r-=s,s=this.lw[s];;){if(--r<0)for(;;){if(--n<0)return;this.bv(t>>16,e>>16,this.cw,s,g,0,0,T,L,k,R,S,M,h>>8,a>>8),e+=B,t+=N,a+=U,h+=F,s+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.bv(t>>16,i>>16,this.cw,s,g,0,0,T,L,k,R,S,M,h>>8,o>>8),i+=P,t+=N,o+=G,h+=F,s+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}else for(n-=r,r-=s,s=this.lw[s];;){if(--r<0)for(;;){if(--n<0)return;this.bv(e>>16,t>>16,this.cw,s,g,0,0,T,L,k,R,S,M,a>>8,h>>8),e+=B,t+=N,a+=U,h+=F,s+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.bv(i>>16,t>>16,this.cw,s,g,0,0,T,L,k,R,S,M,o>>8,h>>8),i+=P,t+=N,o+=G,h+=F,s+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),rP)for(s-=r,r-=n,n=this.lw[n];;){if(--r<0)for(;;){if(--s<0)return;this.bv(t>>16,e>>16,this.cw,n,g,0,0,T,L,k,R,S,M,h>>8,a>>8),t+=N,e+=P,h+=F,a+=G,n+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.bv(t>>16,i>>16,this.cw,n,g,0,0,T,L,k,R,S,M,h>>8,o>>8),t+=N,i+=B,h+=F,o+=U,n+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}else for(s-=r,r-=n,n=this.lw[n];;){if(--r<0)for(;;){if(--s<0)return;this.bv(e>>16,t>>16,this.cw,n,g,0,0,T,L,k,R,S,M,a>>8,h>>8),t+=N,e+=P,h+=F,a+=G,n+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.bv(i>>16,t>>16,this.cw,n,g,0,0,T,L,k,R,S,M,o>>8,h>>8),t+=N,i+=B,h+=F,o+=U,n+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}}else{e=i<<=16,a=o<<=16,n<0&&(e-=N*n,i-=B*n,a-=F*n,o-=U*n,n=0),t<<=16,h<<=16,s<0&&(t-=P*s,h-=G*s,s=0);const l=n-this.hl;if(T+=O*l,L+=x*l,k+=D*l,T|=0,L|=0,k|=0,r-=s,s-=n,n=this.lw[n],N>16,i>>16,this.cw,n,g,0,0,T,L,k,R,S,M,h>>8,o>>8),t+=P,i+=B,h+=G,o+=U,n+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.bv(e>>16,i>>16,this.cw,n,g,0,0,T,L,k,R,S,M,a>>8,o>>8),e+=N,i+=B,a+=F,o+=U,n+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}else for(;;){if(--s<0)for(;;){if(--r<0)return;this.bv(i>>16,t>>16,this.cw,n,g,0,0,T,L,k,R,S,M,o>>8,h>>8),t+=P,i+=B,h+=G,o+=U,n+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.bv(i>>16,e>>16,this.cw,n,g,0,0,T,L,k,R,S,M,o>>8,a>>8),e+=N,i+=B,a+=F,o+=U,n+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,this.cw,r,g,0,0,T,L,k,R,S,M,o>>8,h>>8),i+=B,t+=N,o+=U,h+=F,r+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.bv(i>>16,e>>16,this.cw,r,g,0,0,T,L,k,R,S,M,o>>8,a>>8),i+=B,e+=P,o+=U,a+=G,r+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}else for(;;){if(--s<0)for(;;){if(--n<0)return;this.bv(t>>16,i>>16,this.cw,r,g,0,0,T,L,k,R,S,M,h>>8,o>>8),i+=B,t+=N,o+=U,h+=F,r+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.bv(e>>16,i>>16,this.cw,r,g,0,0,T,L,k,R,S,M,a>>8,o>>8),i+=B,e+=P,o+=U,a+=G,r+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}}else{t=e<<=16,h=a<<=16,r<0&&(t-=B*r,e-=P*r,h-=U*r,a-=G*r,r=0),i<<=16,o<<=16,n<0&&(i-=N*n,o-=F*n,n=0);const l=r-this.hl;if(T+=O*l,L+=x*l,k+=D*l,T|=0,L|=0,k|=0,s-=n,n-=r,r=this.lw[r],B>16,e>>16,this.cw,r,g,0,0,T,L,k,R,S,M,o>>8,a>>8),i+=N,e+=P,o+=F,a+=G,r+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.bv(t>>16,e>>16,this.cw,r,g,0,0,T,L,k,R,S,M,h>>8,a>>8),t+=B,e+=P,h+=U,a+=G,r+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}else for(;;){if(--n<0)for(;;){if(--s<0)return;this.bv(e>>16,i>>16,this.cw,r,g,0,0,T,L,k,R,S,M,a>>8,o>>8),i+=N,e+=P,o+=F,a+=G,r+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.bv(e>>16,t>>16,this.cw,r,g,0,0,T,L,k,R,S,M,a>>8,h>>8),t+=B,e+=P,h+=U,a+=G,r+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}}};static bv=(t,i,e,s,n,r,h,o,a,l,c,f,u,d,w)=>{if(t>=i)return;let y,m,A,p,g,I,_,C,E;if(this.eI){if(y=(w-d)/(i-t)|0,i>this.sI&&(i=this.sI),t<0&&(d-=t*y,t=0),t>=i)return;m=i-t>>3,y<<=12}else i-t>7?(m=i-t>>3,y=(w-d)*this.iv[m]>>6):(m=0,y=0);if(d<<=9,s+=t,this.et&&n)if(A=0,p=0,I=t-this.rl,o+=(c>>3)*I,a+=(f>>3)*I,l+=(u>>3)*I,o|=0,a|=0,g=(l|=0)>>12,0!==g&&(h=a/g|0,(r=o/g|0)<0?r=0:r>4032&&(r=4032)),o+=c,a+=f,l+=u,o|=0,a|=0,g=(l|=0)>>12,0!==g&&(A=o/g|0,p=a/g|0,A<7?A=7:A>4032&&(A=4032)),_=A-r>>3,C=p-h>>3,r+=d>>3&786432,E=d>>23,this.cv){for(;m-- >0;)e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r=A,h=p,o+=c,a+=f,g=(l+=u)>>12,0!==g&&(A=o/g|0,p=a/g|0,A<7?A=7:A>4032&&(A=4032)),_=A-r>>3,C=p-h>>3,r+=(d+=y)>>3&786432,E=d>>23;for(m=i-t&7;m-- >0;)e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C}else{for(;m-- >0;){let t;0!=(t=n[(4032&h)+(r>>6)]>>>E)&&(e[s]=t),s+=1,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s+=1,r=A,h=p,o+=c,a+=f,l+=u,o|=0,a|=0,g=(l|=0)>>12,0!==g&&(A=o/g|0,p=a/g|0,A<7?A=7:A>4032&&(A=4032)),_=A-r>>3,C=p-h>>3,r+=(d+=y)>>3&786432,E=d>>23}for(m=i-t&7;m-- >0;){let t;0!=(t=n[(4032&h)+(r>>6)]>>>E)&&(e[s]=t),s++,r+=_,h+=C}}else if(A=0,p=0,I=t-this.rl,o+=(c>>3)*I,a+=(f>>3)*I,l+=(u>>3)*I,o|=0,a|=0,g=(l|=0)>>14,0!==g&&(h=a/g|0,(r=o/g|0)<0?r=0:r>16256&&(r=16256)),o+=c,a+=f,l+=u,o|=0,a|=0,g=(l|=0)>>14,0!==g&&(A=o/g|0,p=a/g|0,A<7?A=7:A>16256&&(A=16256)),_=A-r>>3,C=p-h>>3,r+=6291456&d,E=d>>23,this.cv&&n){for(;m-- >0;)e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r=A,h=p,o+=c,a+=f,l+=u,o|=0,a|=0,g=(l|=0)>>14,0!==g&&(A=o/g|0,p=a/g|0,A<7?A=7:A>16256&&(A=16256)),_=A-r>>3,C=p-h>>3,r+=6291456&(d+=y),E=d>>23;for(m=i-t&7;m-- >0;)e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C}else{for(;m-- >0&&n;){let t;0!=(t=n[(16256&h)+(r>>7)]>>>E)&&(e[s]=t),s+=1,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,r=A,h=p,o+=c,a+=f,l+=u,o|=0,a|=0,g=(l|=0)>>14,0!==g&&(A=o/g|0,p=a/g|0,A<7?A=7:A>16256&&(A=16256)),_=A-r>>3,C=p-h>>3,r+=6291456&(d+=y),E=d>>23}for(m=i-t&7;m-- >0&&n;){let t;0!=(t=n[(16256&h)+(r>>7)]>>>E)&&(e[s]=t),s++,r+=_,h+=C}}};static Ev=(t,i,e,s,n)=>{if(this.eI&&(i>this.sI&&(i=this.sI),t<0&&(t=0)),t>=i)return;s+=t;let r=i-t>>2;if(0===this.alpha)for(;;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;e[s++]=n}e[s++]=n,e[s++]=n,e[s++]=n,e[s++]=n}const h=this.alpha,o=256-this.alpha;for(n=((16711935&n)*o>>8&16711935)+((65280&n)*o>>8&65280);;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280)}e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280)}};static gv=t=>{this.hv[t]&&this.rv&&(this.rv[this.ov++]=this.hv[t],this.hv[t]=null)};static vv=t=>{if(this.av[t]=this.bA++,this.hv[t])return this.hv[t];let i;if(this.ov>0&&this.rv)i=this.rv[--this.ov],this.rv[this.ov]=null;else{let t=0,e=-1;for(let i=0;i>>3)&16316671,i[n+8192]=r-(r>>>2)&16316671,i[n+12288]=r-(r>>>2)-(r>>>3)&16316671}}else{if(64===e.width)for(let t=0;t<128;t++)for(let n=0;n<128;n++)i[n+(t<<7)]=s[e.cw[(n>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)i[t]=s[e.cw[t]];this.fv[t]=!1;for(let e=0;e<16384;e++){i[e]&=16316671;const s=i[e];0===s&&(this.fv[t]=!0),i[e+16384]=s-(s>>>3)&16316671,i[e+32768]=s-(s>>>2)&16316671,i[e+49152]=s-(s>>>2)-(s>>>3)&16316671}}return i}}},880:(t,i,e)=>{e.d(i,{r:()=>n});var s=e(7854);const n=async t=>{255!==t[0]&&(t[0]=255),URL.revokeObjectURL(s.xE.src),s.xE.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>s.xE.onload=()=>t())),s.SE.clearRect(0,0,s.kE.width,s.kE.height);const i=s.xE.naturalWidth,e=s.xE.naturalHeight;return s.kE.width=i,s.kE.height=e,s.SE.drawImage(s.xE,0,0),s.SE.getImageData(0,0,i,e)}},8665:(t,i,e)=>{e.d(i,{A:()=>f});var s=e(1069),n=e(8950),r=e(4583),h=e(6730),o=e(4474),a=e(3867);class l{Rd=0;Ag=0;Tv=0;Rv=-1;Ov=-1;Lv=-1;Sv=-1;xv=-1;kv=-1;Mv=-1;Dv=-1;Nv=-1;Fv=0;Bv=-1;Uv=-1;Pv=-1;data=null}class c{x=0;y=0;z=0;w=0}class f extends o.A{static metadata=null;static head=null;static Gv=null;static Wv=null;static Hv=null;static Yv=null;static Vv=null;static Kv=null;static Xv=null;static jv=null;static zv=null;static Zv=null;static qv=null;static $v=null;static axis=null;static Jv=new a.fe(4096,!1);static Qv=new a.fe(4096,!1);static tb=new Int32Array(4096);static ib=new Int32Array(4096);static eb=new Int32Array(4096);static sb=new Int32Array(4096);static nb=new Int32Array(4096);static rb=new Int32Array(4096);static hb=new Int32Array(1500);static ob=new a.Xr(1500,512);static ab=new Int32Array(12);static lb=new a.Xr(12,2e3);static cb=new Int32Array(2e3);static fb=new Int32Array(2e3);static ub=new Int32Array(12);static wb=new Int32Array(10);static yb=new Int32Array(10);static mb=new Int32Array(10);static Ir=0;static Ab=0;static _r=0;static pb=!1;static Ma=0;static Da=0;static gb=0;static Ib=new Int32Array(1e3);static _b=!1;static hu(t){try{f.head=new s.A(t.read('ob_head.dat')),f.Gv=new s.A(t.read('ob_face1.dat')),f.Wv=new s.A(t.read('ob_face2.dat')),f.Hv=new s.A(t.read('ob_face3.dat')),f.Yv=new s.A(t.read('ob_face4.dat')),f.Vv=new s.A(t.read('ob_face5.dat')),f.Kv=new s.A(t.read('ob_point1.dat')),f.Xv=new s.A(t.read('ob_point2.dat')),f.jv=new s.A(t.read('ob_point3.dat')),f.zv=new s.A(t.read('ob_point4.dat')),f.Zv=new s.A(t.read('ob_point5.dat')),f.qv=new s.A(t.read('ob_vertex1.dat')),f.$v=new s.A(t.read('ob_vertex2.dat')),f.axis=new s.A(t.read('ob_axis.dat')),f.head.lf=0,f.Kv.lf=0,f.Xv.lf=0,f.jv.lf=0,f.zv.lf=0,f.qv.lf=0,f.$v.lf=0;const i=f.head.ou;f.metadata=new a.fe(i+100,null);let e=0,n=0,r=0,h=0,o=0,c=0,u=0;for(let t=0;t>7)<2?i=2:i>126&&(i=126),(65408&t)+i):(i<0?i=0:i>127&&(i=127),127-i)}static Td=(t,i,e)=>{const s=t.Rd,n=t.Ag,r=t.Tv;let h,o,l,u,d;if(i){h=new Int32Array(s);for(let i=0;i{const n=t.Rd,r=t.Ag,h=t.Tv;let o,a,l,c,u;if(s)o=t.Od,a=t.Sd,l=t.Ld;else{o=new Int32Array(n),a=new Int32Array(n),l=new Int32Array(n);for(let i=0;i{const e=t.Rd,s=t.Ag,n=t.Tv,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e);for(let i=0;i{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,a=0,l=-1;for(let c=0;c{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,a=0,l=-1;for(let c=0;c{let o=-1;const a=t.Od[i],l=t.Sd[i],c=t.Ld[i];for(let t=0;t{if(!f.metadata)throw new Error('cant loading model metadata!!!!!');const i=f.metadata[t];if(!i)throw console.log(`Error model:${t} not found!`),new Error('cant loading model metadata!!!!!');if(!(f.head&&f.Gv&&f.Wv&&f.Hv&&f.Yv&&f.Vv&&f.Kv&&f.Xv&&f.jv&&f.zv&&f.Zv&&f.qv&&f.$v&&f.axis))throw new Error('cant loading model!!!!!');const e=i.Rd,s=i.Ag,n=i.Tv,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e),a=new Int32Array(s),l=new Int32Array(s),c=new Int32Array(s),u=new Int32Array(n),d=new Int32Array(n),w=new Int32Array(n);let y=null;i.xv>=0&&(y=new Int32Array(e));let m=null;i.Nv>=0&&(m=new Int32Array(s));let A=null,p=0;i.Fv>=0?A=new Int32Array(s):p=-i.Fv-1;let g=null;i.Bv>=0&&(g=new Int32Array(s));let I=null;i.Uv>=0&&(I=new Int32Array(s));const _=new Int32Array(s);f.Kv.lf=i.Rv,f.Xv.lf=i.Ov,f.jv.lf=i.Lv,f.zv.lf=i.Sv,f.Zv.lf=i.xv;let C,E,v,b=0,T=0,R=0;for(let t=0;t{if(!f.metadata||!f.metadata[i])throw new Error('No model metadata');const e=f.metadata[i];if(e.data=t,!e.data.length)throw new Error('No model data');const n=e.Rd,r=e.Ag,h=e.Tv,o=new Int32Array(n),a=new Int32Array(n),l=new Int32Array(n),c=new Int32Array(r),u=new Int32Array(r),d=new Int32Array(r),w=new Int32Array(h),y=new Int32Array(h),m=new Int32Array(h);let A=null;e.xv>=0&&(A=new Int32Array(n));let p=null;e.Nv>=0&&(p=new Int32Array(r));let g=null,I=0;e.Fv>=0?g=new Int32Array(r):I=-e.Fv-1;let _=null;e.Bv>=0&&(_=new Int32Array(r));let C=null;e.Uv>=0&&(C=new Int32Array(r));const E=new Int32Array(r),v=new s.A(e.data);v.lf=e.Rv;const b=new s.A(e.data);b.lf=e.Ov;const T=new s.A(e.data);T.lf=e.Lv;const R=new s.A(e.data);R.lf=e.Sv;const O=new s.A(e.data);O.lf=e.xv;let L,S,x,k=0,M=0,D=0;for(let t=0;tthis.Ud&&(this.Ud=-e),e>this.fg&&(this.fg=e);const n=i*i+s*s;n>this.yA&&(this.yA=n)}this.yA=Math.sqrt(this.yA)+.99|0,this.Mb=Math.sqrt(this.yA*this.yA+this.Ud*this.Ud)+.99|0,this.kb=this.Mb+(Math.sqrt(this.yA*this.yA+this.fg*this.fg)+.99|0)}xd(){this.Ud=0,this.fg=0;for(let t=0;tthis.Ud&&(this.Ud=-i),i>this.fg&&(this.fg=i)}this.Mb=Math.sqrt(this.yA*this.yA+this.Ud*this.Ud)+.99|0,this.kb=this.Mb+(Math.sqrt(this.yA*this.yA+this.fg*this.fg)+.99|0)}xl(){if(this.Db){const t=new Int32Array(256);let i=0;for(let e=0;ei&&(i=s)}this.Nd=new a.fe(i+1,null);for(let e=0;e<=i;e++)this.Nd[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;ei&&(i=s)}this.Dd=new a.fe(i+1,null);for(let e=0;e<=i;e++)this.Dd[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;ea;)a=e[o++];r&&r.types&&s.x&&s.y&&s.z&&r.labels&&(i!==a||0===r.types[i])&&this.Pb(s.x[t],s.y[t],s.z[t],r.labels[i],r.types[i])}f.Ir=0,f.Ab=0,f._r=0,o=0,a=e[o++];for(let t=0;ta;)a=e[o++];r&&r.types&&n.x&&n.y&&n.z&&r.labels&&(i===a||0===r.types[i])&&this.Pb(n.x[t],n.y[t],n.z[t],r.labels[i],r.types[i])}}else this.kl(t)}kl(t){if(!this.Nd||-1===t||!h.A.Lo[t])return;const i=h.A.Lo[t],e=i.RE;f.Ir=0,f.Ab=0,f._r=0;for(let t=0;t>16;this.Ld[t]=this.Sd[t]*i+this.Ld[t]*e>>16,this.Sd[t]=s}}translate(t,i,e){for(let s=0;s>8;if(this.vb&&this.bb&&this.Tb||(this.vb=new Int32Array(this.Ag),this.bb=new Int32Array(this.Ag),this.Tb=new Int32Array(this.Ag)),!this.sg){this.sg=new a.fe(this.Rd,null);for(let t=0;t8192||A>8192||p>8192||m<-8192||A<-8192||p<-8192;)m>>=1,A>>=1,p>>=1;let g=0|Math.sqrt(m*m+A*A+p*p);if(g<=0&&(g=1),m=256*m/g|0,A=256*A/g|0,p=256*p/g|0,this.mg&&1&this.mg[i]){const r=t+((e*m+s*A+n*p)/(h+(h/2|0))|0);this.Eu&&(this.vb[i]=f.Eb(this.Eu[i],r,this.mg[i]))}else{let t=this.sg[r];t&&(t.x+=m,t.y+=A,t.z+=p,t.w++),t=this.sg[o],t&&(t.x+=m,t.y+=A,t.z+=p,t.w++),t=this.sg[a],t&&(t.x+=m,t.y+=A,t.z+=p,t.w++)}}if(r)this.hg(t,h,e,s,n);else{this.cg=new a.fe(this.Rd,null);for(let t=0;t>16;for(let s=0;s>16,I=I*w-g*d>>16,g=p),0!==t&&(p=I*l-_*a>>16,_=I*a+_*l>>16,I=p),0!==i&&(p=_*c+g*u>>16,_=_*u-g*c>>16,g=p),g+=n,I+=h,_+=o,p=I*m-_*y>>16,_=I*y+_*m>>16,I=p,f.tb&&f.ib&&f.eb&&(f.eb[s]=_-A,f.tb[s]=r.A.rl+((g<<9)/_|0),f.ib[s]=r.A.hl+((I<<9)/_|0)),this.Tv>0&&f.sb&&f.nb&&f.rb&&(f.sb[s]=g,f.nb[s]=I,f.rb[s]=_)}try{this.Hb(!1,!1,0)}catch(t){}}draw(t,i,e,s,h,o,a,l,c){const u=l*h-o*s>>16,d=a*i+u*e>>16,w=this.yA*e>>16,y=d+w;if(y<=50||d>=3500)return;const m=l*s+o*h>>16;let A=m-this.yA<<9;if((A/y|0)>=n.A.zE)return;let p=m+this.yA<<9;if((p/y|0)<=-n.A.zE)return;const g=a*e-u*i>>16,I=this.yA*i>>16;let _=g+I<<9;if((_/y|0)<=-n.A.ZE)return;let C=g-(I+(this.Ud*e>>16))<<9;if((C/y|0)>=n.A.ZE)return;let E=d-(w+(this.Ud*i>>16))<=50,v=!1;if(c>0&&f.pb){let t=d-w;t<=50&&(t=50),m>0?(A=A/y|0,p=p/t|0):(p=p/y|0,A=A/t|0),g>0?(C=C/y|0,_=_/t|0):(_=_/y|0,C=C/t|0);const i=f.Ma-r.A.rl,e=f.Da-r.A.hl;i>A&&iC&&e<_&&(this.Qd?f.Ib[f.gb++]=c:v=!0)}const b=r.A.rl,T=r.A.hl;let R=0,O=0;0!==t&&(R=r.A.sin[t],O=r.A.cos[t]);for(let n=0;n>16,w=w*O-c*R>>16,c=r),c+=o,u+=a,w+=l,r=w*s+c*h>>16,w=w*h-c*s>>16,c=r,r=u*e-w*i>>16,w=u*i+w*e>>16,u=r,f.eb&&(f.eb[n]=w-d),w>=50&&f.tb&&f.ib?(f.tb[n]=b+((c<<9)/w|0),f.ib[n]=T+((u<<9)/w|0)):f.tb&&(f.tb[n]=-5e3,E=!0),(E||this.Tv>0)&&f.sb&&f.nb&&f.rb&&(f.sb[n]=c,f.nb[n]=u,f.rb[n]=w)}try{this.Hb(E,v,c)}catch(t){}}Hb(t,i,e,s=!1){f._b&&(this.Bb=-1,this.Ub=-1);for(let t=0;tn.A.sI||l>n.A.sI||c>n.A.sI),f.ob&&f.hb){const t=((y+m+A)/3|0)+this.Mb;f.ob[t][f.hb[t]++]=s,f._b&&this.Yb(f.Ma,f.Da,u,d,w,a,l,c)&&this.Ub=0;t--){const i=f.hb[t];if(!(i<=0)&&f.ob){const e=f.ob[t];for(let t=0;t=0;t--){const i=f.hb[t];if(i>0&&f.ob){const e=f.ob[t];for(let s=0;s0||f.ab[2]>0)&&(r=(f.ub[1]+f.ub[2])/(f.ab[1]+f.ab[2])|0);let h=0;f.ab&&f.ub&&(f.ab[3]>0||f.ab[4]>0)&&(h=(f.ub[3]+f.ub[4])/(f.ab[3]+f.ab[4])|0);let o=0;if(f.ab&&f.ub&&(f.ab[6]>0||f.ab[8]>0)&&(o=(f.ub[6]+f.ub[8])/(f.ab[6]+f.ab[8])|0),f.ab&&f.lb){let t,i=0,e=f.ab[10],n=f.lb[10],a=f.cb;i===e&&(i=0,e=f.ab[11],n=f.lb[11],a=f.fb),t=ir;)this.Vb(n[i++],s),i===e&&n!==f.lb[11]&&(i=0,e=f.ab[11],n=f.lb[11],a=f.fb),t=ih;)this.Vb(n[i++],s),i===e&&n!==f.lb[11]&&(i=0,e=f.ab[11],n=f.lb[11],a=f.fb),t=io;)this.Vb(n[i++],s),i===e&&n!==f.lb[11]&&(i=0,e=f.ab[11],n=f.lb[11],a=f.fb),t=i>2,h=this.Lb[i],o=this.Sb[i],a=this.xb[i];r.A.fI(f.tb[e],f.tb[s],f.tb[n],f.ib[e],f.ib[s],f.ib[n],this.vb[t],this.bb[t],this.Tb[t],f.sb[h],f.nb[h],f.rb[h],f.sb[o],f.sb[a],f.nb[o],f.nb[a],f.rb[o],f.rb[a],this.Eu[t])}else if(3===h&&this.mg&&this.Eu&&this.vb&&f.tb&&f.ib&&f.sb&&f.nb&&f.rb){const i=this.mg[t]>>2,h=this.Lb[i],o=this.Sb[i],a=this.xb[i];r.A.fI(f.tb[e],f.tb[s],f.tb[n],f.ib[e],f.ib[s],f.ib[n],this.vb[t],this.vb[t],this.vb[t],f.sb[h],f.nb[h],f.rb[h],f.sb[o],f.sb[a],f.nb[o],f.nb[a],f.rb[o],f.rb[a],this.Eu[t])}}Kb(t,i=!1){let e=0;if(f.rb){const i=r.A.rl,s=r.A.hl,n=this.pg[t],h=this.gg[t],o=this.Ig[t],a=f.rb[n],l=f.rb[h],c=f.rb[o];if(a>=50&&f.tb&&f.ib&&this.vb)f.wb[e]=f.tb[n],f.yb[e]=f.ib[n],f.mb[e++]=this.vb[t];else if(f.sb&&f.nb&&this.vb){const u=f.sb[n],d=f.nb[n],w=this.vb[t];if(c>=50&&this.Tb){const n=(50-a)*r.A.ev[c-a];f.wb[e]=i+((u+((f.sb[o]-u)*n>>16)<<9)/50|0),f.yb[e]=s+((d+((f.nb[o]-d)*n>>16)<<9)/50|0),f.mb[e++]=w+((this.Tb[t]-w)*n>>16)}if(l>=50&&this.bb){const n=(50-a)*r.A.ev[l-a];f.wb[e]=i+((u+((f.sb[h]-u)*n>>16)<<9)/50|0),f.yb[e]=s+((d+((f.nb[h]-d)*n>>16)<<9)/50|0),f.mb[e++]=w+((this.bb[t]-w)*n>>16)}}if(l>=50&&f.tb&&f.ib&&this.bb)f.wb[e]=f.tb[h],f.yb[e]=f.ib[h],f.mb[e++]=this.bb[t];else if(f.sb&&f.nb&&this.bb){const u=f.sb[h],d=f.nb[h],w=this.bb[t];if(a>=50&&this.vb){const h=(50-l)*r.A.ev[a-l];f.wb[e]=i+((u+((f.sb[n]-u)*h>>16)<<9)/50|0),f.yb[e]=s+((d+((f.nb[n]-d)*h>>16)<<9)/50|0),f.mb[e++]=w+((this.vb[t]-w)*h>>16)}if(c>=50&&this.Tb){const n=(50-l)*r.A.ev[c-l];f.wb[e]=i+((u+((f.sb[o]-u)*n>>16)<<9)/50|0),f.yb[e]=s+((d+((f.nb[o]-d)*n>>16)<<9)/50|0),f.mb[e++]=w+((this.Tb[t]-w)*n>>16)}}if(c>=50&&f.tb&&f.ib&&this.Tb)f.wb[e]=f.tb[o],f.yb[e]=f.ib[o],f.mb[e++]=this.Tb[t];else if(f.sb&&f.nb&&this.Tb){const u=f.sb[o],d=f.nb[o],w=this.Tb[t];if(l>=50&&this.bb){const n=(50-c)*r.A.ev[l-c];f.wb[e]=i+((u+((f.sb[h]-u)*n>>16)<<9)/50|0),f.yb[e]=s+((d+((f.nb[h]-d)*n>>16)<<9)/50|0),f.mb[e++]=w+((this.bb[t]-w)*n>>16)}if(a>=50&&this.vb){const h=(50-c)*r.A.ev[a-c];f.wb[e]=i+((u+((f.sb[n]-u)*h>>16)<<9)/50|0),f.yb[e]=s+((d+((f.nb[n]-d)*h>>16)<<9)/50|0),f.mb[e++]=w+((this.vb[t]-w)*h>>16)}}}const s=f.wb[0],h=f.wb[1],o=f.wb[2],a=f.yb[0],l=f.yb[1],c=f.yb[2];if(!((s-h)*(c-l)-(a-l)*(o-h)<=0))if(r.A.eI=!1,3===e){let e;if((s<0||h<0||o<0||s>n.A.sI||h>n.A.sI||o>n.A.sI)&&(r.A.eI=!0),e=this.mg?3&this.mg[t]:0,i)r.A.$E(s,h,a,l,f.mb[0]),r.A.$E(h,o,l,c,f.mb[1]),r.A.$E(o,s,c,a,f.mb[2]);else if(0===e)r.A.oI(s,h,o,a,l,c,f.mb[0],f.mb[1],f.mb[2]);else if(1===e&&this.vb)r.A.Cv(s,h,o,a,l,c,r.A.palette[this.vb[t]]);else if(2===e&&this.mg&&this.Eu&&f.sb&&f.nb&&f.rb){const i=this.mg[t]>>2,e=this.Lb[i],n=this.Sb[i],u=this.xb[i];r.A.fI(s,h,o,a,l,c,f.mb[0],f.mb[1],f.mb[2],f.sb[e],f.nb[e],f.rb[e],f.sb[n],f.sb[u],f.nb[n],f.nb[u],f.rb[n],f.rb[u],this.Eu[t])}else if(3===e&&this.mg&&this.Eu&&this.vb&&f.sb&&f.nb&&f.rb){const i=this.mg[t]>>2,e=this.Lb[i],n=this.Sb[i],u=this.xb[i];r.A.fI(s,h,o,a,l,c,this.vb[t],this.vb[t],this.vb[t],f.sb[e],f.nb[e],f.rb[e],f.sb[n],f.sb[u],f.nb[n],f.nb[u],f.rb[n],f.rb[u],this.Eu[t])}}else if(4===e){let e;if((s<0||h<0||o<0||s>n.A.sI||h>n.A.sI||o>n.A.sI||f.wb[3]<0||f.wb[3]>n.A.sI)&&(r.A.eI=!0),e=this.mg?3&this.mg[t]:0,i)r.A.$E(s,h,a,l,f.mb[0]),r.A.$E(h,o,l,c,f.mb[1]),r.A.$E(o,f.wb[3],c,f.yb[3],f.mb[2]),r.A.$E(f.wb[3],s,f.yb[3],a,f.mb[3]);else if(0===e)r.A.oI(s,h,o,a,l,c,f.mb[0],f.mb[1],f.mb[2]),r.A.oI(s,o,f.wb[3],a,c,f.yb[3],f.mb[0],f.mb[2],f.mb[3]);else if(1===e){if(this.vb){const i=r.A.palette[this.vb[t]];r.A.Cv(s,h,o,a,l,c,i),r.A.Cv(s,o,f.wb[3],a,c,f.yb[3],i)}}else if(2===e&&this.mg&&this.Eu&&f.sb&&f.nb&&f.rb){const i=this.mg[t]>>2,e=this.Lb[i],n=this.Sb[i],u=this.xb[i];r.A.fI(s,h,o,a,l,c,f.mb[0],f.mb[1],f.mb[2],f.sb[e],f.nb[e],f.rb[e],f.sb[n],f.sb[u],f.nb[n],f.nb[u],f.rb[n],f.rb[u],this.Eu[t]),r.A.fI(s,o,f.wb[3],a,c,f.yb[3],f.mb[0],f.mb[2],f.mb[3],f.sb[e],f.nb[e],f.rb[e],f.sb[n],f.sb[u],f.nb[n],f.nb[u],f.rb[n],f.rb[u],this.Eu[t])}else if(3===e&&this.mg&&this.Eu&&this.vb&&f.sb&&f.nb&&f.rb){const i=this.mg[t]>>2,e=this.Lb[i],n=this.Sb[i],u=this.xb[i];r.A.fI(s,h,o,a,l,c,this.vb[t],this.vb[t],this.vb[t],f.sb[e],f.nb[e],f.rb[e],f.sb[n],f.sb[u],f.nb[n],f.nb[u],f.rb[n],f.rb[u],this.Eu[t]),r.A.fI(s,o,f.wb[3],a,c,f.yb[3],this.vb[t],this.vb[t],this.vb[t],f.sb[e],f.nb[e],f.rb[e],f.sb[n],f.sb[u],f.nb[n],f.nb[u],f.rb[n],f.rb[u],this.Eu[t])}}}Pb(t,i,e,s,n){if(!s)return;const h=s.length;if(0===n){let n=0;f.Ir=0,f.Ab=0,f._r=0;for(let t=0;t0?(f.Ir=(f.Ir/n|0)+t,f.Ab=(f.Ab/n|0)+i,f._r=(f._r/n|0)+e):(f.Ir=t,f.Ab=i,f._r=e)}else if(1===n)for(let n=0;n=this.Nd.length)continue;const h=this.Nd[r];if(h)for(let s=0;s=this.Nd.length)continue;const o=this.Nd[h];if(o)for(let s=0;s>16;this.Sd[n]=this.Sd[n]*u-this.Od[n]*c>>16,this.Od[n]=t}if(0!==h){c=r.A.sin[h],u=r.A.cos[h];const t=this.Sd[n]*u-this.Ld[n]*c>>16;this.Ld[n]=this.Sd[n]*c+this.Ld[n]*u>>16,this.Sd[n]=t}if(0!==a){c=r.A.sin[a],u=r.A.cos[a];const t=this.Ld[n]*c+this.Od[n]*u>>16;this.Ld[n]=this.Ld[n]*u-this.Od[n]*c>>16,this.Od[n]=t}this.Od[n]+=f.Ir,this.Sd[n]+=f.Ab,this.Ld[n]+=f._r}}else if(3===n)for(let n=0;n=this.Nd.length)continue;const h=this.Nd[r];if(h)for(let s=0;s=this.Dd.length)continue;const n=this.Dd[e];if(n)for(let i=0;i255&&(this.Ob[e]=255)}}}Wb(){this.Ud=0,this.yA=0,this.fg=0,this.ug=999999,this.dg=-999999,this.yg=-99999,this.wg=99999;for(let t=0;tthis.dg&&(this.dg=i),sthis.yg&&(this.yg=s),-e>this.Ud&&(this.Ud=-e),e>this.fg&&(this.fg=e);const n=i*i+s*s;n>this.yA&&(this.yA=n)}this.yA=0|Math.sqrt(this.yA),this.Mb=0|Math.sqrt(this.yA*this.yA+this.Ud*this.Ud),this.kb=this.Mb+(0|Math.sqrt(this.yA*this.yA+this.fg*this.fg))}Yb(t,i,e,s,n,r,h,o){return!(ie&&i>s&&i>n)&&(!(t{e.d(i,{A:()=>o});var s=e(8950),n=e(1069),r=e(4474),h=e(880);class o extends r.A{cw;width;height;jb;zb;Fa;rw;constructor(t,i){super(),this.cw=new Int32Array(t*i),this.width=this.Fa=t,this.height=this.rw=i,this.jb=this.zb=0}static Zb=async(t,i)=>{const e=t.read(i+'.dat');if(!e)throw new Error(`${i} jpeg not found!`);const s=await(0,h.r)(e),n=new o(s.width,s.height),r=new Uint32Array(s.data.buffer),a=n.cw;for(let t=0;t>24&255)<<24|(255&i)<<16|(i>>8&255)<<8|i>>16&255}return n};static Cu=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.lf=s.ou;const h=r.ou,a=r.ou,l=[],c=r.lu-1;for(let t=0;ts.length||r.lf>r.length)throw new Error;const f=r.lu,u=r.lu,d=r.ou,w=r.ou,y=new o(d,w);y.jb=f,y.zb=u,y.Fa=h,y.rw=a;const m=r.lu;if(0===m){const t=y.width*y.height;for(let i=0;is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,a+=i,o+=i}h>0&&r>0&&this.qb(h,r,this.cw,n,a,s.A.cw,e,o)}Na(t,i,e){i|=0,e|=0;let n=(i+=this.jb)+(e+=this.zb)*s.A.fw,r=0,h=this.height,o=this.width,a=s.A.fw-o,l=0;if(es.A.bottom&&(h-=e+h-s.A.bottom),is.A.right){const t=i+o-s.A.right;o-=t,l+=t,a+=t}o>0&&h>0&&this.$b(o,h,this.cw,r,l,s.A.cw,n,a,t)}Jb(t,i){t|=0,i|=0;let e=(t+=this.jb)+(i+=this.zb)*s.A.fw,n=0,r=this.height,h=this.width,o=s.A.fw-h,a=0;if(is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,a+=i,o+=i}h>0&&r>0&&this.Qb(h,r,this.cw,n,a,s.A.cw,e,o)}tT(){const t=this.cw,i=this.width,e=this.height;for(let s=0;s>16&255;r+=t,r<1?r=1:r>255&&(r=255);let h=n>>8&255;h+=i,h<1?h=1:h>255&&(h=255);let o=255&n;o+=e,o<1?o=1:o>255&&(o=255),this.cw[s]=(r<<16)+(h<<8)+o}}}Cw(t,i,e,n){t|=0,i|=0,e|=0,n|=0;try{const r=this.width;let h=0,o=0;const a=this.Fa,l=this.rw,c=(a<<16)/e|0,f=(l<<16)/n|0;t+=(this.jb*e+a-1)/a|0,i+=(this.zb*n+l-1)/l|0,this.jb*e%a!=0&&(h=(a-this.jb*e%a<<16)/e|0),this.zb*n%l!=0&&(o=(l-this.zb*n%l<<16)/n|0),e=e*(this.width-(h>>16))/a|0,n=n*(this.height-(o>>16))/l|0;let u=t+i*s.A.fw,d=s.A.fw-e;if(is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right){const i=t+e-s.A.right;e-=i,d+=i}this.scale(e,n,this.cw,h,o,s.A.cw,d,u,r,c,f)}catch(t){console.error('error in sprite clipping routine')}}eT(t,i,e,n,r,h,o,a,l,c){t|=0,i|=0,e|=0,n|=0;try{const f=-e/2|0,u=-n/2|0,d=65536*Math.sin(l/326.11)|0,w=65536*Math.cos(l/326.11)|0,y=d*c>>8,m=w*c>>8;let A=(o<<16)+u*y+f*m,p=u*m-f*y+(a<<16),g=t+i*s.A.fw;for(let t=0;t>16)+(o>>16)*this.width],n+=m,o-=y;A+=y,p+=m,g+=s.A.fw}}catch(t){}}sT(t,i,e){t|=0,i|=0;let n=(t+=this.jb)+(i+=this.zb)*s.A.fw,r=0,h=this.height,o=this.width,a=s.A.fw-o,l=0;if(is.A.bottom&&(h-=i+h-s.A.bottom),ts.A.right){const i=t+o-s.A.right;o-=i,l+=i,a+=i}o>0&&h>0&&this.nT(o,h,this.cw,l,r,s.A.cw,n,a,e.cw)}scale(t,i,e,s,n,r,h,o,a,l,c){try{const f=s;for(let u=-i;u<0;u++){const i=(n>>16)*a;for(let n=-t;n<0;n++){const t=e[(s>>16)+i];0===t?o++:r[o++]=t,s+=l}n+=c,s=f,o+=h}}catch(t){console.error('error in plot_scale')}}Qb(t,i,e,s,n,r,h,o){const a=-(t>>2);t=-(3&t);for(let l=-i;l<0;l++){for(let t=a;t<0;t++)r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++];for(let i=t;i<0;i++)r[h++]=e[s++];h+=o,s+=n}}$b(t,i,e,s,n,r,h,o,a){const l=256-a;for(let c=-i;c<0;c++){for(let i=-t;i<0;i++){const t=e[s++];if(0===t)h++;else{const i=r[h];r[h++]=((16711935&t)*a+(16711935&i)*l&4278255360)+((65280&t)*a+(65280&i)*l&16711680)>>8}}h+=o,s+=n}}qb(t,i,e,s,n,r,h,o){const a=-(t>>2);t=-(3&t);for(let l=-i;l<0;l++){for(let t=a;t<0;t++){let t=e[s++];0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=t}h+=o,s+=n}}nT(t,i,e,s,n,r,h,o,a){const l=-(t>>2);t=-(3&t);for(let c=-i;c<0;c++){for(let t=l;t<0;t++){let t=e[n++];0!==t&&0===a[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===a[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===a[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===a[h]?r[h++]=t:h++}for(let i=t;i<0;i++){const t=e[n++];0!==t&&0===a[h]?r[h++]=t:h++}h+=o,n+=s}}}},1673:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(8950),n=e(1069),r=e(4474);class h extends r.A{cw;width;height;jb;zb;Fa;rw;palette;constructor(t,i,e){super(),this.cw=new Int8Array(t*i),this.width=this.Fa=t,this.height=this.rw=i,this.jb=this.zb=0,this.palette=e}static Cu=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.lf=s.ou;const o=r.ou,a=r.ou,l=r.lu,c=new Int32Array(l);for(let t=1;ts.length||r.lf>r.length)throw new Error;const f=r.lu,u=r.lu,d=r.ou,w=r.ou,y=new h(d,w,c);y.jb=f,y.zb=u,y.Fa=o,y.rw=a;const m=y.cw,A=r.lu;if(0===A){const t=y.width*y.height;for(let i=0;is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,a+=i,o+=i}h>0&&r>0&&this.rT(h,r,this.cw,n,a,s.A.cw,e,o)}tT(){const t=this.cw,i=this.width,e=this.height;for(let s=0;s>16&255;n+=t,n<0?n=0:n>255&&(n=255);let r=this.palette[s]>>8&255;r+=i,r<0?r=0:r>255&&(r=255);let h=255&this.palette[s];h+=e,h<0?h=0:h>255&&(h=255),this.palette[s]=(n<<16)+(r<<8)+h}}mv(){this.Fa|=0,this.rw|=0,this.Fa/=2,this.rw/=2,this.Fa|=0,this.rw|=0;const t=new Int8Array(this.Fa*this.rw);let i=0;for(let e=0;e>1)+(e+this.zb>>1)*this.Fa]=this.cw[i++];this.cw=t,this.width=this.Fa,this.height=this.rw,this.jb=0,this.zb=0}Cw(){if(this.width===this.Fa&&this.height===this.rw)return;const t=new Int8Array(this.Fa*this.rw);let i=0;for(let e=0;e>2);t=-(3&t);for(let l=-i;l<0;l++){for(let t=a;t<0;t++){let t=e[s++];0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t]}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=this.palette[255&t]}h+=o,s+=n}}clip(t,i,e,n){try{const r=this.width;this.height;let h=0,o=0;const a=this.Fa,l=this.rw,c=(a<<16)/e|0,f=(l<<16)/n|0;t=t+(this.jb*e+a-1)/a|0,i=i+(this.zb*n+l-1)/l|0,this.jb*e%a!=0&&(h=(a-this.jb*e%a<<16)/e|0),this.zb*n%l!=0&&(o=(l-this.zb*n%l<<16)/n|0),e=e*(this.width-(h>>16))/a|0,n=n*(this.height-(o>>16))/l|0;let u,d=t+i*s.A.fw,w=s.A.fw-e;is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right&&(u=t+e-s.A.right,e-=u,w+=u),this.hT(s.A.cw,this.cw,this.palette,h,o,d,w,e,n,c,f,r)}catch(t){console.log('error in sprite clipping routine')}}hT(t,i,e,s,n,r,h,o,a,l,c,f){try{const u=s;for(let d=-a;d<0;d++){const a=(n>>16)*f;for(let n=-o;n<0;n++){const n=i[(s>>16)+a];0==n?r++:t[r++]=e[255&n],s+=l}n+=c,s=u,r+=h}}catch(t){console.log('error in plot_scale')}}}},2682:(t,i,e)=>{e.d(i,{A:()=>a});var s=e(8950),n=e(1069),r=e(4474);class h{seed;constructor(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}oT(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}aT(){return this.next(32)}next(t){return this.seed=0x5deece66dn*this.seed+0xbn&(1n<<48n)-1n,Number(this.seed)>>>48-t}}var o=e(9298);class a extends r.A{static lT='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!"£$%^&*()-_=+[{]};:\'@#~,<.>/?\\| ';static cT=[];static{const t=navigator.userAgent.includes('Capacitor');for(let i=0;i<256;i++){let e=a.lT.indexOf(String.fromCharCode(i));t&&e>=63&&e--,-1===e&&(e=74),a.cT[i]=e}}fT=[];uT=new Int32Array(94);dT=new Int32Array(94);wT=new Int32Array(94);yT=new Int32Array(94);mT=new Int32Array(95);AT=new Int32Array(256);random=new h(BigInt(Date.now()));height=0;static Cu=(t,i)=>{const e=new n.A(t.read(i+'.dat')),s=new n.A(t.read('index.dat'));s.lf=e.ou+4;const r=s.lu;r>0&&(s.lf+=3*(r-1));const h=new a;for(let t=0;t<94;t++){h.wT[t]=s.lu,h.yT[t]=s.lu;const i=h.uT[t]=s.ou,n=h.dT[t]=s.ou,r=s.lu,o=i*n;if(h.fT[t]=new Int8Array(o),0===r)for(let s=0;sh.height&&(h.height=n),h.wT[t]=1,h.mT[t]=i+2;{let e=0;for(let s=n/7|0;s=s.A.bottom&&(r-=e+r+1-s.A.bottom),i=s.A.right){const t=i+n+1-s.A.right;n-=t,l+=t,a+=t}n>0&&r>0&&this.TT(n,r,t,c,l,s.A.cw,o,a,h)}ET(t,i,e,n,r,h,o){e|=0,n|=0;let a=(t|=0)+(i|=0)*s.A.fw,l=s.A.fw-e,c=0,f=0;if(i=s.A.bottom&&(n-=i+n+1-s.A.bottom),t=s.A.right){const i=t+e+1-s.A.right;e-=i,c+=i,l+=i}e>0&&n>0&&this.RT(e,n,s.A.cw,a,l,o,f,c,r,h)}TT(t,i,e,s,n,r,h,o,a){const l=-((t|=0)>>2);t=-(3&t);for(let c=-(i|=0);c<0;c++){for(let t=l;t<0;t++)0===e[s++]?h++:r[h++]=a,0===e[s++]?h++:r[h++]=a,0===e[s++]?h++:r[h++]=a,0===e[s++]?h++:r[h++]=a;for(let i=t;i<0;i++)0===e[s++]?h++:r[h++]=a;h+=o,s+=n}}RT(t,i,e,s,n,r,h,o,a,l){t|=0;const c=((16711935&a)*l&4278255360)+((65280&a)*l&16711680)>>8,f=256-l;for(let a=-(i|=0);a<0;a++){for(let i=-t;i<0;i++)if(0===r[h++])s++;else{const t=e[s];e[s++]=(((16711935&t)*f&4278255360)+((65280&t)*f&16711680)>>8)+c}s+=n,h+=o}}gT(t){return'red'===t?o.A.RED:'gre'===t?o.A.GREEN:'blu'===t?o.A.BLUE:'yel'===t?o.A.Ga:'cya'===t?o.A.ME:'mag'===t?o.A.hA:'whi'===t?o.A.Ia:'bla'===t?o.A.Pa:'lre'===t?o.A.DE:'dre'===t?o.A.NE:'dbl'===t?o.A.FE:'or1'===t?o.A.BE:'or2'===t?o.A.UE:'or3'===t?o.A.PE:'gr1'===t?o.A.GE:'gr2'===t?o.A.WE:'gr3'===t?o.A.HE:o.A.Pa}split(t,i){if(0===t.length)return[t];const e=[];for(;t.length>0;){if(this.IT(t)<=i&&-1===t.indexOf('|')){e.push(t);break}let s=t.length;for(let e=0;ei)break;s=e}else if('|'===t[e]){s=e;break}e.push(t.substring(0,s)),t=t.substring(s+1)}return e}}},1183:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(8950),n=e(7854);class r{OT;width;height;LT;ST;cw;constructor(t,i,e=n.zo){this.LT=e,this.OT=this.LT.getImageData(0,0,t,i),this.ST=new Uint32Array(this.OT.data.buffer),this.cw=new Int32Array(t*i),this.width=t,this.height=i,this.bind()}clear(){this.cw.fill(0)}bind(){s.A.bind(this.cw,this.width,this.height)}draw(t,i){this.#t(),this.LT.putImageData(this.OT,t,i)}#t(){const t=this.cw.length,i=this.cw,e=this.ST;for(let s=0;s>16&255|(t>>8&255)<<8|(255&t)<<16|4278190080}}}},4544:(t,i,e)=>{e.d(i,{A:()=>s});class s{db;constructor(t){t.onerror=this.onerror,t.onclose=this.onclose,this.db=t}static openDatabase=async()=>await new Promise(((t,i)=>{const e=indexedDB.open('lostcity',1);e.onsuccess=i=>{const e=i.target;console.log('database success!'),t(e.result)},e.onupgradeneeded=t=>{t.target.result.createObjectStore('cache')},e.onerror=t=>{const e=t.target;console.error('database error!: ',e.error),i(e.result)}}));Uo=async t=>await new Promise((i=>{const e=this.db.transaction('cache','readonly').objectStore('cache').get(t);e.onsuccess=()=>{i(e.result)},e.onerror=t=>{i(void 0)}}));Yo=async(t,i)=>await new Promise(((e,s)=>{const n=this.db.transaction('cache','readwrite').objectStore('cache').put(i,t);n.onsuccess=()=>{e()},n.onerror=t=>{s()}}));onclose=t=>{console.log('database close!')};onerror=t=>{console.log('database error!')};xT=t=>{const i=t.trim();let e=0;for(let t=0;t='A'&&s<='Z'?e+=s.charCodeAt(0)+1-65:s>='a'&&s<='z'?e+=s.charCodeAt(0)+1-97:s>='0'&&s<='9'&&(e+=s.charCodeAt(0)+27-48)}return e}}},2901:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(1908);class r{static xT=t=>{let i=0;t=t.toUpperCase();for(let e=0;e=this.MT)return null;if(this.UT[t])return this.UT[t];const i=this.BT[t],e=i+this.FT[t];if(this.kT){const s=Uint8Array.from(this.buffer.subarray(i,i+e));return this.UT[t]=s,s}{const i=Uint8Array.from(n.A.read(this.NT[t],this.buffer,this.FT[t],this.BT[t]));return this.UT[t]=i,i}}}},1069:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(9234),n=e(6666),r=e(4474);class h extends r.A{static GT=3988292384;static WT=new Int32Array(256);static HT=new Uint32Array(33);static YT=new n.A;static VT=new n.A;static KT=new n.A;static XT=0;static jT=0;static zT=0;static{for(let t=0;t<32;t++)h.HT[t]=(1<>>=1:i=i>>>1^h.GT;h.WT[t]=i}}static Po=t=>{let i=4294967295;for(let e=0;e>>8^h.WT[255&(i^t[e])];return~i};view;data;lf=0;ZT=0;random=null;constructor(t){if(!t)throw new Error('Input src packet array was null!');super(),t instanceof Int8Array?this.data=new Uint8Array(t):this.data=t,this.view=new DataView(this.data.buffer,this.data.byteOffset,this.data.byteLength)}get length(){return this.view.byteLength}get available(){return this.length-this.lf}static Ut=t=>{let i=null;return 0===t&&h.XT>0?(h.XT--,i=h.YT.Ug()):1===t&&h.jT>0?(h.jT--,i=h.VT.Ug()):2===t&&h.zT>0&&(h.zT--,i=h.KT.Ug()),i?(i.lf=0,i):new h(0===t?new Uint8Array(100):1===t?new Uint8Array(5e3):new Uint8Array(3e4))};release(){this.lf=0,100===this.view.byteLength&&h.XT<1e3?(h.YT.Fm(this),h.XT++):5e3===this.view.byteLength&&h.jT<250?(h.VT.Fm(this),h.jT++):3e4===this.view.byteLength&&h.zT<50&&(h.KT.Fm(this),h.zT++)}get lu(){return this.view.getUint8(this.lf++)}get bd(){return this.view.getInt8(this.lf++)}get ou(){const t=this.view.getUint16(this.lf);return this.lf+=2,t}get fu(){const t=this.view.getInt16(this.lf);return this.lf+=2,t}get Wu(){const t=this.view.getUint8(this.lf++)<<16|this.view.getUint16(this.lf);return this.lf+=2,t}get Ko(){const t=this.view.getInt32(this.lf);return this.lf+=4,t}get JC(){const t=this.view.getBigInt64(this.lf);return this.lf+=8,t}get OE(){return this.view.getUint8(this.lf)<128?this.lu-64:this.ou-49152}get wA(){return this.view.getUint8(this.lf)<128?this.lu:this.ou-32768}get wu(){const t=this.view,i=t.byteLength;let e,s='';for(;10!==(e=t.getUint8(this.lf++))&&this.lf>16),this.view.setUint16(this.lf,t),this.lf+=2}p4(t){this.view.setInt32(this.lf,t),this.lf+=4}QT(t){this.view.setInt32(this.lf,t,!0),this.lf+=4}tR(t){this.view.setBigInt64(this.lf,t),this.lf+=8}iR(t){const i=this.view,e=t.length;for(let s=0;s>>3,e=8-(7&this.ZT),s=0;for(this.ZT+=t;t>e;e=8)s+=(this.view.getUint8(i++)&h.HT[e])<>>e-t&h.HT[t],s}oR(t,i){const e=this.lf;this.lf=0;const n=new Uint8Array(e);this.qT(e,0,n);const r=(0,s.aR)(n),h=(0,s.lR)(r,i,t),o=(0,s.cR)(h);this.lf=0,this.p1(o.length),this.eR(o,o.length,0)}}},3937:(t,i,e)=>{e.d(i,{A:()=>o});class s{start=0;end=0;form=0;length=0;fR=null;uR=null;threshold=0;position=0;delta=0;amplitude=0;dR=0;read(t){this.form=t.lu,this.start=t.Ko,this.end=t.Ko,this.length=t.lu,this.fR=new Int32Array(this.length),this.uR=new Int32Array(this.length);for(let i=0;i=this.threshold&&this.uR&&this.fR&&(this.amplitude=this.uR[this.position++]<<15,this.position>=this.length&&(this.position=this.length-1),this.threshold=this.fR[this.position]/65536*t|0,this.threshold>this.dR&&(this.delta=((this.uR[this.position]<<15)-this.amplitude)/(this.threshold-this.dR)|0)),this.amplitude+=this.delta,this.dR++,this.amplitude-this.delta>>15}}class n{static buffer=null;static Dm=null;static sin=null;static wR=new Int32Array(5);static yR=new Int32Array(5);static mR=new Int32Array(5);static AR=new Int32Array(5);static pR=new Int32Array(5);gR=null;IR=null;_R=null;CR=null;ER=null;vR=null;release=null;attack=null;bR=new Int32Array(5);TR=new Int32Array(5);RR=new Int32Array(5);start=0;length=500;OR=100;LR=0;static init=()=>{this.Dm=new Int32Array(32768);for(let t=0;t<32768;t++)Math.random()>.5?this.Dm[t]=1:this.Dm[t]=-1;this.sin=new Int32Array(32768);for(let t=0;t<32768;t++)this.sin[t]=16384*Math.sin(t/5215.1903)|0;this.buffer=new Int32Array(220500)};SR(t,i){for(let i=0;i>1,h+=(i*s>>16)+r}if(this.ER&&this.vR){const i=this.ER.evaluate(t),e=this.vR.evaluate(t);c=c*(32768+(this.xR(e,l,this.ER.form)>>1))>>15,l+=(i*o>>16)+a}for(let s=0;s<5;s++)if(0!==this.bR[s]){const r=i+n.yR[s];r>15,n.wR[s],this.gR.form),n.wR[s]+=(e*n.AR[s]>>16)+n.pR[s])}}if(this.release&&this.attack){this.release.reset(),this.attack.reset();let i=0,e=!0;for(let s=0;s>8):this.release.start+((this.release.end-this.release.start)*h>>8),i+=256,i>=o&&(i=0,e=!e),e&&(n.buffer[s]=0)}}if(this.LR>0&&this.OR>0){const i=this.LR*e;for(let e=i;e32767&&(n.buffer[i]=32767);return n.buffer}xR(t,i,e){return 1===e?(32767&i)<16384?t:-t:2===e?n.sin[32767&i]*t>>14:3===e?((32767&i)*t>>14)-t:4===e?n.Dm[i/2607&32767]*t:0}read(t){this.gR=new s,this.gR.read(t),this.IR=new s,this.IR.read(t),0!==t.lu&&(t.lf--,this._R=new s,this._R.read(t),this.CR=new s,this.CR.read(t)),0!==t.lu&&(t.lf--,this.ER=new s,this.ER.read(t),this.vR=new s,this.vR.read(t)),0!==t.lu&&(t.lf--,this.release=new s,this.release.read(t),this.attack=new s,this.attack.read(t));for(let i=0;i<10;i++){const e=t.wA;if(0===e)break;this.bR[i]=e,this.TR[i]=t.OE,this.RR[i]=t.wA}this.LR=t.wA,this.OR=t.wA,this.length=t.ou,this.start=t.ou}}var r=e(1069),h=e(3867);class o{static kR=new Int32Array(1e3);static MR=null;static DR=null;static NR=new h.fe(1e3,null);FR=new h.fe(10,null);BR=0;loopEnd=0;static hu=t=>{const i=new r.A(t.read('sounds.dat'));for(this.MR=new Uint8Array(441e3),this.DR=new r.A(this.MR),n.init();;){const t=i.ou;if(65535===t)break;const e=new o;e.read(i),this.NR[t]=e,this.kR[t]=e.trim()}};static SR=(t,i)=>{if(!this.NR[t])return null;const e=this.NR[t];return e?.UR(i)??null};read(t){for(let i=0;i<10;i++)0!==t.lu&&(t.lf--,this.FR[i]=new n,this.FR[i]?.read(t));this.BR=t.ou,this.loopEnd=t.ou}trim(){let t=9999999;for(let i=0;i<10;i++)this.FR[i]&&(this.FR[i].start/20|0)i&&(i=this.FR[t].length+this.FR[t].start);if(0===i)return 0;let e=22050*i/1e3|0,s=22050*this.BR/1e3|0,n=22050*this.loopEnd/1e3|0;(s<0||n<0||n>e||s>=n)&&(t=0);let r=e+(n-s)*(t-1);for(let t=44;t>8<<24>>24)}if(t>1){s+=44,n+=44,e+=44,r+=44;const i=r-e;for(let t=e-1;t>=n;t--)o.MR&&(o.MR[t+i]=o.MR[t]);for(let i=1;i{e.d(i,{tA:()=>l,Qm:()=>o,fe:()=>s,CA:()=>n,Eh:()=>r,pA:()=>h,Xr:()=>a});class s extends Array{constructor(t,i){super(t);for(let e=0;e{e.d(i,{cR:()=>o,Wo:()=>n,aR:()=>h,Ho:()=>s,Xl:()=>r,lR:()=>a});const s=async t=>new Promise((i=>setTimeout(i,t))),n=async t=>new Int8Array(await(await fetch(t)).arrayBuffer()),r=async t=>(await fetch(t)).text();function h(t){let i=0n;for(let e=0;e0n;)i.unshift(Number(0xffn&t)),t>>=8n;return 128&i[0]&&i.unshift(0),new Uint8Array(i)}function a(t,i,e){let s=1n;for(;i>0n;)i%2n===1n&&(s=s*t%e),t=t*t%e,i>>=1n;return s}},7953:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1069);class n{static PR=new Uint16Array(['d','o','t'].join('').split('').map((t=>t.charCodeAt(0))));static GR=new Uint16Array(['(','a',')'].join('').split('').map((t=>t.charCodeAt(0))));static WR=new Uint16Array(['s','l','a','s','h'].join('').split('').map((t=>t.charCodeAt(0))));static HR=['cook',"cook's",'cooks','seeks','sheet'];static YR=[];static VR=[];static KR=[];static XR=[];static jR=[];static zR=[];static hu=t=>{const i=new s.A(t.read('fragmentsenc.txt')),e=new s.A(t.read('badenc.txt')),n=new s.A(t.read('domainenc.txt')),r=new s.A(t.read('tldlist.txt'));this.read(e,n,i,r)};static filter=t=>{const i=[...t];this.format(i);const e=i.join('').trim(),s=e.toLowerCase(),n=[...s];this.ZR(n),this.qR(n),this.$R(n),this.JR(n);for(let t=0;t{this.iO(t),this.eO(i),this.sO(e),this.nO(s)};static nO=t=>{const i=t.Ko;for(let e=0;et.lu))};static iO=t=>{const i=t.Ko;for(let e=0;et.lu));const i=new Array(t.lu).fill([]).map((()=>[t.bd,t.bd]));i.length>0&&(this.XR[e]=i)}};static eO=t=>{const i=t.Ko;for(let e=0;et.lu))};static sO=t=>{const i=t.Ko;for(let e=0;e{const i=[...t],e=[...t];this.rO(null,i,this.PR),this.rO(null,e,this.WR);for(let s=0;s{for(let i=0;i<2;i++)for(let i=this.KR.length-1;i>=0;i--)this.rO(this.XR[i],t,this.KR[i])};static $R=t=>{const i=[...t],e=[...t];this.rO(null,i,this.GR),this.rO(null,e,this.PR);for(let s=this.jR.length-1;s>=0;s--)this.oO(e,i,this.jR[s],t)};static JR=t=>{for(let i=0;i=0&&n{if(this.wO(t))return!0;const i=this.yO(t),e=this.zR,s=e.length;if(i===e[0]||i===e[s-1])return!0;let n=0,r=s-1;for(;n<=r;){const t=(n+r)/2|0;if(i===e[t])return!0;i{if(t.length>6)return 0;let i=0;for(let e=0;e{for(let e=i;e=0;e++)if(this.AO(t[e]))return e;return-1};static uO=(t,i)=>{for(let e=t;e=0;e++)if(!this.AO(i[e]))return e;return i.length};static pO=(t,i,e)=>i===e||'o'===i&&'0'===e?1:'o'===i&&'('===e&&')'===t?2:'c'!==i||'('!==e&&'<'!==e&&'['!==e?'e'===i&&'€'===e||'s'===i&&'$'===e||'l'===i&&'i'===e?1:0:1;static oO=(t,i,e,s)=>{const n=e.length,r=s.length;for(let h=0;h<=r-n;h++){const{gO:n,IO:r}=this._O(h,e,s);if(!n)continue;const o=this.CO(h,s,3,i,['@']),a=this.EO(r-1,s,3,t,['.',',']);(o>2||a>2)&&this.fO(h,r,s)}};static _O=(t,i,e)=>{const s=i.length;let n=t,r=0;for(;n0)n+=a,r++;else{if(0===r)break;const e=this.pO(o,String.fromCharCode(i[r-1]),h);if(e>0)n+=e,1===r&&t++;else{if(r>=s||!this.lO(h))break;n++}}}return{gO:r>=s,IO:n}};static rO=(t,i,e)=>{if(!(e.length>i.length))for(let s=0;s<=i.length-e.length;s++){let n=s;const{IO:r,vO:h,bO:o,TO:a,RO:l}=this.OO(i,e,n);n=r;let c=i[n],f=n+1=e.length)||a&&l)continue;let u,d=!0;if(o){let t=!1,e=!1;if((s-1<0||this.lO(i[s-1])&&"'"!==i[s-1])&&(t=!0),(n>=i.length||this.lO(i[n])&&"'"!==i[n])&&(e=!0),!t||!e){let e=!1;for(u=s-2,t&&(u=s);!e&&u=0&&(!this.lO(i[u])||"'"===i[u])){const t=[];let s;for(s=0;s<3&&u+s=0&&(!this.lO(i[u-1])||"'"===i[u-1])&&(n=!1),n&&!this.dO(t)&&(e=!0)}u++}e||(d=!1)}}else{c=' ',s-1>=0&&(c=i[s-1]),f=' ',n{let s=e,n=0,r=0,h=!1,o=!1,a=!1;for(;s=t.length||o&&a);){const l=t[s],c=s+10)1===f&&this.AO(l)&&(o=!0),2===f&&(this.AO(l)||this.AO(c))&&(o=!0),s+=f,n++;else{if(0===n)break;let t;if((t=this.kO(c,String.fromCharCode(i[n-1]),l))>0)s+=t;else{if(n>=i.length||!this.cO(l))break;if(this.lO(l)&&"'"!==l&&(h=!0),this.AO(l)&&(a=!0),s++,r++,(100*r/(s-e)|0)>90)break}}}return{IO:s,vO:n,bO:h,TO:o,RO:a}};static kO=(t,i,e)=>{if(i===e)return 1;if(i>='a'&&i<='m'){if('a'===i)return'4'!==e&&'@'!==e&&'^'!==e?'/'===e&&'\\'===t?2:0:1;if('b'===i)return'6'!==e&&'8'!==e?'1'===e&&'3'===t?2:0:1;if('c'===i)return'('!==e&&'<'!==e&&'{'!==e&&'['!==e?0:1;if('d'===i)return'['===e&&')'===t?2:0;if('e'===i)return'3'!==e&&'€'!==e?0:1;if('f'===i)return'p'===e&&'h'===t?2:'£'===e?1:0;if('g'===i)return'9'!==e&&'6'!==e?0:1;if('h'===i)return'#'===e?1:0;if('i'===i)return'y'!==e&&'l'!==e&&'j'!==e&&'1'!==e&&'!'!==e&&':'!==e&&';'!==e&&'|'!==e?0:1;if('j'===i)return 0;if('k'===i)return 0;if('l'===i)return'1'!==e&&'|'!==e&&'i'!==e?0:1;if('m'===i)return 0}if(i>='n'&&i<='z'){if('n'===i)return 0;if('o'===i)return'0'!==e&&'*'!==e?'('===e&&')'===t||'['===e&&']'===t||'{'===e&&'}'===t||'<'===e&&'>'===t?2:0:1;if('p'===i)return 0;if('q'===i)return 0;if('r'===i)return 0;if('s'===i)return'5'!==e&&'z'!==e&&'$'!==e&&'2'!==e?0:1;if('t'===i)return'7'!==e&&'+'!==e?0:1;if('u'===i)return'v'===e?1:'\\'===e&&'/'===t||'\\'===e&&'|'===t||'|'===e&&'/'===t?2:0;if('v'===i)return'\\'===e&&'/'===t||'\\'===e&&'|'===t||'|'===e&&'/'===t?2:0;if('w'===i)return'v'===e&&'v'===t?2:0;if('x'===i)return')'===e&&'('===t||'}'===e&&'{'===t||']'===e&&'['===t||'>'===e&&'<'===t?2:0;if('y'===i)return 0;if('z'===i)return 0}return i>='0'&&i<='9'?'0'===i?'o'===e||'O'===e?1:'('===e&&')'===t||'{'===e&&'}'===t||'['===e&&']'===t?2:0:'1'===i&&'l'===e?1:0:','===i?'.'===e?1:0:'.'===i?','===e?1:0:'!'===i&&'i'===e?1:0};static SO=(t,i,e)=>{let s=0,n=i.length-1;for(;s<=n;){const r=(s+n)/2|0;if(i[r][0]===t&&i[r][1]===e)return!0;tthis.mO(t)?t.charCodeAt(0)+1-'a'.charCodeAt(0):"'"===t?28:this.AO(t)?t.charCodeAt(0)+29-'0'.charCodeAt(0):27;static hO=(t,i,e,s,n)=>{if(!(s.length>e.length))for(let r=0;r<=e.length-s.length;r++){const{IO:h,MO:o}=this.DO(e,s,r);if(o0&&c>0&&(a=!0),2===i&&(l>2&&c>0||l>0&&c>2)&&(a=!0),3===i&&l>0&&c>2&&(a=!0),!a)continue;let f,u=r,d=h-1,w=!1;if(l>2){if(4===l)for(w=!1,f=r-1;f>=0;f--)if(w){if('*'!==n[f])break;u=f}else'*'===n[f]&&(u=f,w=!0);for(w=!1,f=u-1;f>=0;f--)if(w){if(this.lO(e[f]))break;u=f}else this.lO(e[f])||(w=!0,u=f)}if(c>2){if(4===c)for(w=!1,f=d+1;f{let s=0;for(;e0)e+=h,s++;else{if(0===s)break;let t;if((t=this.pO(r,String.fromCharCode(i[s-1]),n))>0)e+=t;else{if(!this.lO(n))break;e++}}}return{IO:e,MO:s}};static lO=t=>!this.xO(t)&&!this.AO(t);static cO=t=>!this.mO(t)||('v'===t||'x'===t||'j'===t||'q'===t||'z'===t);static xO=t=>this.mO(t)||this.NO(t);static AO=t=>t>='0'&&t<='9';static mO=t=>t>='a'&&t<='z';static NO=t=>t>='A'&&t<='Z';static wO=t=>{for(let i=0;i{for(let s=t;s{let e=0;for(let s=i-1;s>=0&&this.lO(t[s]);s--)'*'===t[s]&&e++;return e};static BO=(t,i)=>{let e=0;for(let s=i+1;s(n?this.FO(i,e):this.BO(i,e))>=s?4:this.lO(n?t[e-1]:t[e+1])?1:0;static CO=(t,i,e,s,n)=>{if(0===t)return 2;for(let e=t-1;e>=0&&this.lO(i[e]);e--)if(n.includes(i[e]))return 3;return this.UO(i,s,t,e,!0)};static EO=(t,i,e,s,n)=>{if(t+1===i.length)return 2;for(let e=t+1;e{let i=0;for(let e=0;et>=' '&&t<=''||' '===t||'\n'===t||'\t'===t||'£'===t||'€'===t;static QR=(t,i)=>{for(let e=0;e{let i=!0;for(let e=0;e{e.a(t,(async(t,i)=>{try{var s=e(1312),n=e(5637),r=e(2164),h=e(1302),o=e(6948),a=e(8317),l=e(8738),c=e(3764),f=e(1120),u=e(3709),d=e(8950),w=e(4583),y=e(2682),m=e(8665),A=e(8534),p=e(6730),g=e(7953),I=e(9234),_=e(1069),C=e(3937),E=e(4544),v=e(7854),b=e(1673),T=e(1908),R=e(1651),O=e(7604);class t extends R.K{GO=[];WO=[];HO=-1;YO=new o.A(-1);VO=-1;KO='';async XO(t){const i=new Map,e=(await(0,I.Xl)(t)).split('\n');for(let t=0;t{if(this.kt)this.Mt=!0;else{this.kt=!0;try{await this.Go(10,'Connecting to fileserver'),await T.A.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new E.A(await E.A.openDatabase());const t=new _.A(new Uint8Array(await(0,I.Wo)(`${R.K.nt}/crc`)));for(let i=0;i<9;i++)this.Bt[i]=t.Ko;const i=await this.Bo('title','title screen',this.Bt[1],10);this.di=y.A.Cu(i,'p11'),this.wi=y.A.Cu(i,'p12'),this.yi=y.A.Cu(i,'b12'),this.mi=y.A.Cu(i,'q8');const e=await this.Bo('config','config',this.Bt[2],15),d=await this.Bo('interface','interface',this.Bt[3],20),v=await this.Bo('media','2d graphics',this.Bt[4],30),O=await this.Bo('models','3d graphics',this.Bt[5],40),L=await this.Bo('textures','textures',this.Bt[6],60),S=await this.Bo('wordenc','chat system',this.Bt[7],65),x=await this.Bo('sounds','sound effects',this.Bt[8],70),k=new _.A(new Uint8Array(await(0,I.Wo)(`${R.K.nt}/server/mesanim.dat`)));await this.Go(75,'Unpacking media'),this.re=b.A.Cu(v,'chatback',0),await this.Go(80,'Unpacking textures'),w.A.yv(L),w.A.pv(.8),w.A.Iv(20),await this.Go(83,'Unpacking models'),m.A.hu(O),A.A.hu(O),p.A.hu(O),await this.Go(86,'Unpacking config'),s.A.hu(e),n.A.hu(e),r.A.hu(e),h.A.hu(e,!0),o.A.hu(e),a.A.hu(e),l.A.hu(e),c.A.hu(e),u.A.hu(k),await this.jO(),await this.zO(),await this.Go(90,'Unpacking sounds'),C.A.hu(x),await this.Go(92,'Unpacking interfaces'),f.A.hu(d,v,[this.di,this.wi,this.yi,this.mi]),await this.Go(97,'Preparing game engine'),g.A.hu(S),await this.Go(100,'Getting ready to start...'),this.xo?.bind(),w.A.Tc();const M=document.querySelector('#authentic');null!==M&&(M.onchange=()=>{this.ZO()});const D=document.querySelector('#newline');null!==D&&(D.onclick=()=>{this.KO+='|',this.ZO()});const N=document.querySelector('#clear');null!==N&&(N.onclick=()=>{this.KO='',this.ZO()}),this.qO('bla'),this.qO('red'),this.qO('gre'),this.qO('blu'),this.qO('yel'),this.qO('cya'),this.qO('mag'),this.qO('whi'),this.qO('lre'),this.qO('dre'),this.qO('dbl'),this.qO('or1'),this.qO('or2'),this.qO('or3'),this.qO('gr1'),this.qO('gr2'),this.qO('gr3'),this.YO=o.A.get(0),this.VO=0,this.ZO()}catch(t){this.Dt=!0,console.error(t)}}};update=async()=>{this.Mt||this.Dt||this.Nt||(this.Ft++,this.$O())};draw=async()=>{this.Mt||this.Dt||this.Nt?this.jo():(d.A.clear(),this.JO(),this.xo?.draw(0,0))};async jO(){this.GO[1]=await this.XO(`${R.K.lt}/data/src/pack/npc.pack`);const t=document.querySelector('#npcs');if(!t)return;t.innerHTML='';const i=document.createElement('input');i.type='search',i.placeholder='Search',i.tabIndex=1,i.oninput=()=>{const t=i.value.toLowerCase().replaceAll(' ','_'),e=document.querySelector('#npcList');if(e)for(let i=0;i-1?s.style.display='':s.style.display='none'}},t.appendChild(i);const e=document.createElement('ul');e.id='npcList',e.className='list-group',t.appendChild(e);for(const[t,i]of this.GO[1]){const s=o.A.get(t);if(null===s.Yu||0===s.Yu.length)continue;const n=document.createElement('li');n.id=i,n.className='list-group-item',0===t&&(n.className+=' active'),n.innerText=i+' ('+t+')',n.onclick=()=>{const i=e.querySelector('.active');i&&(i.className='list-group-item'),n.className='list-group-item active',this.YO=o.A.get(t),this.QO(this.YO,this.VO,this.KO)},e.appendChild(n)}}async zO(){const t=document.querySelector('#mesanims');if(!t)return;t.innerHTML='';const i=document.createElement('input');i.type='search',i.placeholder='Search',i.tabIndex=2,i.oninput=()=>{const t=i.value.toLowerCase().replaceAll(' ','_'),e=document.querySelector('#mesanimList');if(e)for(let i=0;i-1?s.style.display='':s.style.display='none'}},t.appendChild(i);const e=document.createElement('ul');e.id='mesanimList',e.className='list-group',t.appendChild(e);for(const t of u.A.Lo){const i=t.id,s=t.Ru??`mesanim_${t.id}`,n=document.createElement('li');n.id=s,n.className='list-group-item',0===i&&(n.className+=' active'),n.innerText=s+' ('+i+')',n.onclick=()=>{const t=e.querySelector('.active');t&&(t.className='list-group-item'),n.className='list-group-item active',this.VO=i,this.ZO()},e.appendChild(n)}}qO(t){const i=document.querySelector(`#${t}`);null!==i&&(i.onclick=()=>{this.KO+=`@${t}@`,this.ZO()})}$O(){let t=!1;for(;;){const i=this.xc();if(-1===i)break;if(document.activeElement!==v.bc)continue;-1!==y.A.lT.indexOf(String.fromCharCode(i))?(this.KO+=String.fromCharCode(i),t=!0):8===i&&this.KO.length>0?(this.KO=this.KO.substring(0,this.KO.length-1),t=!0):10!==i&&13!==i||(this.KO+='|',t=!0)}t&&-1!==this.KO.indexOf('\\n')&&(this.KO=this.KO.replaceAll('\\n','|')),t&&this.ZO()}JO(){this.re?.draw(0,0),this.oa(this.hs,1);try{this.ya(f.A.Lo[this.hs],0,0,0)}catch(t){console.error(t)}}ZO(){if(-1===this.VO||!this.mi)return;this.tL(this.KO,380,4,this.mi,this.VO),this.iL()>1&&(this.KO=''),this.QO(this.YO,this.VO,this.KO);const t=document.querySelector('#export');if(t){const i=u.A.Lo[this.VO],e=document.querySelector('#authentic');if(null===e||!1===e.checked){const e='default'===i.Ru?'"default"':i.Ru??`mesanim_${i.id}`;t.value=`~chatnpc(${e}, "${this.KO}");`}else t.value=`~chatnpc("${this.KO}");`}}tL(t,i,e,s,n){const r=s.split(t,i);for(this.WO=[],this.HO=n;r.length>0;)this.WO.push(r.splice(0,e))}eL(t,i){return this.WO[t][i]}iL(){return this.WO.length}sL(t){return this.WO[t].length}nL(t){if(-1===this.HO)return-1;const i=u.A.Lo[this.HO],e=this.sL(t);return i.Pd[e-1]}QO(t,i,e){if(!this.mi||-1===i)return;this.tL(e,380,4,this.mi,i);const s=this.iL();for(let i=0;i{})),window.onkeydown=function(t){return!(' '===t.key&&(t.target===document.body||t.target===v.bc))},i()}catch(t){i(t)}}),1)},1908:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(9763);class n{static hL=null;static load=async t=>{this.hL=await(0,s.F)(new WebAssembly.Module(t),{env:void 0})};static read=(t,i,e,s)=>{if(!this.hL)throw new Error('bz2 not found!!');return Int8Array.from(this.hL.read(t,i,e,s))}}},123:(t,i,e)=>{function s(t,i){window._tinyMidiPlay&&window._tinyMidiPlay(t,i/256)}function n(){window._tinyMidiStop&&window._tinyMidiStop()}e.d(i,{Xo:()=>s,Ro:()=>n})},9763:(t,i,e)=>{async function s(t,i={}){const e={env:Object.assign(Object.create(globalThis),i.env||{},{abort(t,i,e,s){t=h(t>>>0),i=h(i>>>0),e>>>=0,s>>>=0,(()=>{throw Error(`${t} in ${i}:${e}:${s}`)})()}})},{exports:s}=await WebAssembly.instantiate(t,e),n=s.memory||i.env.memory,r=Object.setPrototypeOf({read:(t,i,e,r)=>(i=function(t,i,e,r,h){if(null==r)return 0;const o=r.length,a=s.__pin(s.__new(o<>>0;if(h)new h(n.buffer,a,o).set(r);else for(let i=0;i>>0),r[i]);return s.__unpin(a),a}(a,6,0,i,Int8Array)||function(){throw TypeError("value must not be null")}(),function(t,i,e){if(!e)return null;const s=function(t){try{return o.getUint32(t,!0)}catch{return o=new DataView(n.buffer),o.getUint32(t,!0)}}(e-4)>>>i,r=new Array(s);for(let n=0;n>>0));return r}(l,0,s.read(t,i,e,r)>>>0))},s);function h(t){if(!t)return null;const i=t+new Uint32Array(n.buffer)[t-4>>>2]>>>1,e=new Uint16Array(n.buffer);let s=t>>>1,r="";for(;i-s>1024;)r+=String.fromCharCode(...e.subarray(s,s+=1024));return r+String.fromCharCode(...e.subarray(s,i))}let o=new DataView(n.buffer);function a(t,i){try{o.setUint8(t,i,!0)}catch{o=new DataView(n.buffer),o.setUint8(t,i,!0)}}function l(t){try{return o.getInt8(t,!0)}catch{return o=new DataView(n.buffer),o.getInt8(t,!0)}}return r}e.d(i,{F:()=>s})},9896:(t,i,e)=>{var s=e(8151);!function(){window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioContext&&(window.audioContext=new window.AudioContext);var t=function(i){if(window.audioContext){var e=window.audioContext.createBuffer(1,1,22050),s=window.audioContext.createBufferSource();s.buffer=e,s.connect(window.audioContext.destination),s.start?s.start(0):s.play?s.play(0):s.noteOn&&s.noteOn(0)}document.removeEventListener('touchstart',t),document.removeEventListener('touchend',t),document.removeEventListener('click',t)};document.addEventListener('touchstart',t),document.addEventListener('touchend',t),document.addEventListener('click',t)}(),(async()=>{let t=new Float32Array,i=window.audioContext.createGain();i.gain.value=.1,i.connect(window.audioContext.destination);let e=window.audioContext.currentTime,n=[];const r=new s.A({oL:30,aL:i=>{let e=new Float32Array(i.buffer),s=new Float32Array(t.length+e.length);s.set(t,0),s.set(e,t.length),t=s},lL:t=>{},bufferSize:102400});await r.init();const h=await fetch('./SCC1_Florestan.sf2'),o=new Uint8Array(await h.arrayBuffer());function a(){if(!window.audioContext||!t.length)return;let s=window.audioContext.createBufferSource();const r=t.length/2,h=window.audioContext.createBuffer(2,r,44100);for(let i=0;i<2;i++){const e=h.getChannelData(i);let s=i;for(let i=0;i{if(l&&clearInterval(l),t=new Float32Array,n.length){let t=i.gain.value;i.gain.value=0,n.forEach((t=>{t.stop(window.audioContext.currentTime)})),n=[],i.gain.value=t}},window._tinyMidiVolume=(t=1)=>{i.gain.value=t},window._tinyMidiPlay=async(t,i=1)=>{t&&(await window._tinyMidiStop(),-1!=i&&window._tinyMidiVolume(i),e=window.audioContext.currentTime,l=setInterval(a,250),r.fL(t))}})()},8151:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5473);const n=class{constructor(t={}){this.uL=void 0,this.dL=0,this.wL=0,this.yL=0,this.oL=t.oL||100,this.sampleRate=t.sampleRate||44100,this.mL=t.mL||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.AL(1),this.aL=t.aL||(()=>{}),this.lL=t.lL||(()=>{}),this.pL=void 0,this.test=0}async init(){if(!this.uL){if('undefined'!=typeof process){const{gL:t}=await import('path'),{IL:i}=await import('module');globalThis.__dirname=t("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js"),globalThis.require=i("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js")}this.uL=await(0,s.A)(),this._L=this.uL._malloc(this.bufferSize),this.CL=this.uL._malloc(8)}}AL(t){this.bufferSize=4*this.sampleRate*this.mL*t}EL(){if(!this.uL)throw new Error(`${this.constructor.name} not initalized. call .init()`)}cL(t){this.EL();const{_malloc:i,_free:e,_tsf_load_memory:s,_tsf_set_output:n,_tsf_channel_set_bank_preset:r,_tsf_set_max_voices:h,_tsf_channel_set_presetnumber:o}=this.uL;e(this.dL),this.dL=i(t.length),this.uL.HEAPU8.set(t,this.dL),this.wL=s(this.dL,t.length),n(this.wL,2===this.mL?0:2,this.sampleRate,this.gain)}vL(){this.EL();const t=new Uint8Array(this.bufferSize);return t.set(this.uL.HEAPU8.subarray(this._L,this._L+this.bufferSize)),t}bL(t){const{_malloc:i,_free:e,_tml_load_memory:s}=this.uL;return e(this.yL),this.yL=i(t.length),this.uL.HEAPU8.set(t,this.yL),s(this.yL,t.length)}TL(t){const{_midi_render:i}=this.uL;return i(this.wL,t,this.mL,this.sampleRate,this._L,this.bufferSize,this.CL)}fL(t){if(this.EL(),!this.wL)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.pL);const{setValue:i,getValue:e}=this.uL;i(this.CL,0,'double'),this.uL._tsf_reset(this.wL),this.uL._tsf_channel_set_bank_preset(this.wL,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let s=this.bL(t);const n=()=>{s=this.TL(s);const t=this.vL();this.aL(t),s?this.pL=setTimeout(n,this.oL):this.lL(e(this.CL,'double'))};this.pL=setTimeout(n,16)}}},8227:(t,i,e)=>{t.exports=e.p+"9f86b5397894e28b5ae2.wasm"},5473:(t,i,e)=>{var s;e.d(i,{A:()=>n});const n=(s="file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/tinymidipcm.mjs",function(t){var i,n,r=void 0!==(t=t||{})?t:{};r.ready=new Promise((function(t,e){i=t,n=e})),["_tsf_load_memory","_tsf_set_output","_tsf_channel_set_bank_preset","_tsf_set_max_voices","_tsf_channel_set_presetnumber","_tsf_reset","_tsf_close","_tml_load_memory","_midi_render","_malloc","_realloc","_free","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(r.ready,t)||Object.defineProperty(r.ready,t,{get:()=>j('You are getting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),set:()=>j('You are setting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js')})}));var h=Object.assign({},r),o=[],a='object'==typeof window,l='function'==typeof importScripts,c='object'==typeof process&&'object'==typeof process.versions&&'string'==typeof process.versions.node,f=!a&&!c&&!l;if(r.ENVIRONMENT)throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');var u,d,w,y='';if(c){if('undefined'==typeof process||!process.release||'node'!==process.release.name)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');var m,A;y=l?require('path').gL(y)+'/':__dirname+'/';var p=()=>{A||(m=require('fs'),A=require('path'))};u=(t,i)=>(p(),t=A.normalize(t),m.RL(t,i?void 0:'utf8')),w=t=>{var i=u(t,!0);return i.buffer||(i=new Uint8Array(i)),D(i.buffer),i},d=(t,i,e)=>{p(),t=A.normalize(t),m.OL(t,(function(t,s){t?e(t):i(s.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,'/'),o=process.argv.slice(2),process.on('uncaughtException',(function(t){if(!(t instanceof nt))throw t})),process.on('unhandledRejection',(function(t){throw t})),r.inspect=function(){return'[Emscripten Module object]'}}else if(f){if('object'==typeof process&&'function'==typeof require||'object'==typeof window||'function'==typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');'undefined'!=typeof read&&(u=function(t){return read(t)}),w=function(t){let i;return'function'==typeof readbuffer?new Uint8Array(readbuffer(t)):(i=read(t,'binary'),D('object'==typeof i),i)},d=function(t,i,e){setTimeout((()=>i(w(t))),0)},'undefined'!=typeof scriptArgs?o=scriptArgs:void 0!==arguments&&(o=arguments),'undefined'!=typeof print&&('undefined'==typeof console&&(console={}),console.log=print,console.warn=console.error='undefined'!=typeof printErr?printErr:print)}else{if(!a&&!l)throw new Error('environment detection error');if(l?y=self.location.href:'undefined'!=typeof document&&document.currentScript&&(y=document.currentScript.src),s&&(y=s),y=0!==y.indexOf('blob:')?y.substr(0,y.replace(/[?#].*/,"").lastIndexOf('/')+1):'','object'!=typeof window&&'function'!=typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');u=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.send(null),i.responseText},l&&(w=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.responseType='arraybuffer',i.send(null),new Uint8Array(i.response)}),d=(t,i,e)=>{var s=new XMLHttpRequest;s.open('GET',t,!0),s.responseType='arraybuffer',s.onload=()=>{200==s.status||0==s.status&&s.response?i(s.response):e()},s.onerror=e,s.send(null)}}r.print||console.log.bind(console);var g,I,_=r.printErr||console.warn.bind(console);function C(t,i){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){j('Module.'+t+' has been replaced with plain '+i+' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')}})}function E(t){return'FS_createPath'===t||'FS_createDataFile'===t||'FS_createPreloadedFile'===t||'FS_unlink'===t||'addRunDependency'===t||'FS_createLazyFile'===t||'FS_createDevice'===t||'removeRunDependency'===t}Object.assign(r,h),h=null,g='fetchSettings',Object.getOwnPropertyDescriptor(r,g)&&j('`Module.'+g+'` was supplied but `'+g+'` not included in INCOMING_MODULE_JS_API'),r.arguments&&(o=r.arguments),C('arguments','arguments_'),r.thisProgram&&r.thisProgram,C('thisProgram','thisProgram'),r.quit&&r.quit,C('quit','quit_'),D(void 0===r.memoryInitializerPrefixURL,'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.pthreadMainPrefixURL,'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.cdInitializerPrefixURL,'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.filePackagePrefixURL,'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.read,'Module.read option was removed (modify read_ in JS)'),D(void 0===r.readAsync,'Module.readAsync option was removed (modify readAsync in JS)'),D(void 0===r.readBinary,'Module.readBinary option was removed (modify readBinary in JS)'),D(void 0===r.setWindowTitle,'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'),D(void 0===r.TOTAL_MEMORY,'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'),C('read','read_'),C('readAsync','readAsync'),C('readBinary','readBinary'),C('setWindowTitle','setWindowTitle'),D(!f,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),r.wasmBinary&&(I=r.wasmBinary),C('wasmBinary','wasmBinary');var v;r.noExitRuntime;C('noExitRuntime','noExitRuntime'),'object'!=typeof WebAssembly&&j('no native wasm support detected');var b,T,R,O,L,S,x,k,M=!1;function D(t,i){t||j('Assertion failed'+(i?': '+i:''))}function N(t){b=t,r.HEAP8=T=new Int8Array(t),r.HEAP16=O=new Int16Array(t),r.HEAP32=L=new Int32Array(t),r.HEAPU8=R=new Uint8Array(t),r.HEAPU16=new Uint16Array(t),r.HEAPU32=S=new Uint32Array(t),r.HEAPF32=x=new Float32Array(t),r.HEAPF64=k=new Float64Array(t)}'undefined'!=typeof TextDecoder&&new TextDecoder('utf8');var F=5242880;r.TOTAL_STACK&&D(F===r.TOTAL_STACK,'the stack size can no longer be determined at runtime');var B=r.INITIAL_MEMORY||16777216;function U(){if(!M){var t=ft(),i=S[t>>2],e=S[t+4>>2];34821223==i&&2310721022==e||j('Stack overflow! Stack cookie has been overwritten at 0x'+t.toString(16)+', expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+e.toString(16)+' 0x'+i.toString(16)),1668509029!==S[0]&&j('Runtime error: The application has corrupted its heap memory area (address zero)!')}}C('INITIAL_MEMORY','INITIAL_MEMORY'),D(B>=F,'INITIAL_MEMORY should be larger than TOTAL_STACK, was '+B+'! (TOTAL_STACK='+F+')'),D('undefined'!=typeof Int32Array&&'undefined'!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,'JS engine does not provide full typed array support'),D(!r.wasmMemory,'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'),D(16777216==B,'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'),function(){var t=new Int16Array(1),i=new Int8Array(t.buffer);if(t[0]=25459,115!==i[0]||99!==i[1])throw'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'}();var P=[],G=[],W=[],H=!1;D(Math.imul,'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.fround,'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.clz32,'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.trunc,'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');var Y=0,V=null,K=null,X={};function j(t){r.onAbort&&r.onAbort(t),_(t='Aborted('+t+')'),M=!0;var i=new WebAssembly.RuntimeError(t);throw n(i),i}var z={error:function(){j('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM')},init:function(){z.error()},LL:function(){z.error()},SL:function(){z.error()},xL:function(){z.error()},open:function(){z.error()},kL:function(){z.error()},ML:function(){z.error()},DL:function(){z.error()},NL:function(){z.error()},FL:function(){z.error()}};r.FS_createDataFile=z.LL,r.FS_createPreloadedFile=z.SL;var Z,q,$,J,Q='data:application/octet-stream;base64,';function tt(t){return t.startsWith(Q)}function it(t){return t.startsWith('file://')}function et(t,i){return function(){var e=t,s=i;return i||(s=r.asm),D(H,'native function `'+e+'` called before runtime initialization'),s[t]||D(s[t],'exported native function `'+e+'` not found'),s[t].apply(null,arguments)}}function st(t){try{if(t==Z&&I)return new Uint8Array(I);if(w)return w(t);throw"both async and sync fetching of the wasm failed"}catch(t){j(t)}}function nt(t){this.name='ExitStatus',this.message='Program terminated with exit('+t+')',this.status=t}function rt(t){for(;t.length>0;)t.shift()(r)}function ht(t){ht.BL||(ht.BL={}),ht.BL[t]||(ht.BL[t]=1,c&&(t='warning: '+t),_(t))}function ot(t){try{return v.UL(t-b.byteLength+65535>>>16),N(v.buffer),1}catch(i){_('emscripten_realloc_buffer: Attempted to grow heap from '+b.byteLength+' bytes to '+t+' bytes, but got error: '+i)}}r.locateFile?tt(Z='tinymidipcm.wasm')||(q=Z,Z=r.locateFile?r.locateFile(q,y):y+q):Z=new URL(e(8227),e.b).toString();var at,lt={"emscripten_memcpy_big":function(t,i,e){R.copyWithin(t,i,i+e)},"emscripten_resize_heap":function(t){var i=R.length;D((t>>>=0)>i);var e,s,n=2147483648;if(t>n)return _('Cannot enlarge memory, asked to go up to '+t+' bytes, but the limit is '+n+' bytes!'),!1;for(var r=1;r<=4;r*=2){var h=i*(1+.2/r);h=Math.min(h,t+100663296);var o=Math.min(n,(e=Math.max(t,h))+((s=65536)-e%s)%s);if(ot(o))return!0}return _('Failed to grow the heap from '+i+' bytes to '+o+' bytes, not enough memory!'),!1}},ct=(function(){var t,i={'env':lt,'wasi_snapshot_preview1':lt};function e(t,i){var e,s=t.exports;r.asm=s,D(v=r.asm.memory,"memory not found in wasm exports"),N(v.buffer),D(r.asm.__indirect_function_table,"table not found in wasm exports"),e=r.asm.__wasm_call_ctors,G.unshift(e),function(t){if(Y--,r.monitorRunDependencies&&r.monitorRunDependencies(Y),t?(D(X[t]),delete X[t]):_('warning: run dependency removed without ID'),0==Y&&(null!==V&&(clearInterval(V),V=null),K)){var i=K;K=null,i()}}('wasm-instantiate')}t='wasm-instantiate',Y++,r.monitorRunDependencies&&r.monitorRunDependencies(Y),t?(D(!X[t]),X[t]=1,null===V&&'undefined'!=typeof setInterval&&(V=setInterval((function(){if(M)return clearInterval(V),void(V=null);var t=!1;for(var i in X)t||(t=!0,_('still waiting on run dependencies:')),_('dependency: '+i);t&&_('(end of list)')}),1e4))):_('warning: run dependency added without ID');var s=r;function h(t){D(r===s,'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'),s=null,e(t.instance)}function o(t){return function(){if(!I&&(a||l)){if('function'==typeof fetch&&!it(Z))return fetch(Z,{credentials:'same-origin'}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+Z+"'";return t.arrayBuffer()})).catch((function(){return st(Z)}));if(d)return new Promise((function(t,i){d(Z,(function(i){t(new Uint8Array(i))}),i)}))}return Promise.resolve().then((function(){return st(Z)}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){_('failed to asynchronously prepare wasm: '+t),it(Z)&&_('warning: Loading from a file URI ('+Z+') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing'),j(t)}))}if(r.instantiateWasm)try{return r.instantiateWasm(i,e)}catch(t){_('Module.instantiateWasm callback failed with error: '+t),n(t)}(I||'function'!=typeof WebAssembly.instantiateStreaming||tt(Z)||it(Z)||c||'function'!=typeof fetch?o(h):fetch(Z,{credentials:'same-origin'}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(h,(function(t){return _('wasm streaming compile failed: '+t),_('falling back to ArrayBuffer instantiation'),o(h)}))}))).catch(n)}(),r.___wasm_call_ctors=et("__wasm_call_ctors"),r._malloc=et("malloc"),r._free=et("free"),r._tsf_load_memory=et("tsf_load_memory"),r._tsf_close=et("tsf_close"),r._tsf_reset=et("tsf_reset"),r._tsf_set_output=et("tsf_set_output"),r._tsf_set_max_voices=et("tsf_set_max_voices"),r._realloc=et("realloc"),r._tsf_channel_set_presetnumber=et("tsf_channel_set_presetnumber"),r._tsf_channel_set_bank_preset=et("tsf_channel_set_bank_preset"),r._tml_load_memory=et("tml_load_memory"),r._midi_render=et("midi_render"),r.___errno_location=et("__errno_location"),r._fflush=et("fflush"),r._emscripten_stack_init=function(){return(ct=r._emscripten_stack_init=r.asm.emscripten_stack_init).apply(null,arguments)}),ft=(r._emscripten_stack_get_free=function(){return(r._emscripten_stack_get_free=r.asm.emscripten_stack_get_free).apply(null,arguments)},r._emscripten_stack_get_base=function(){return(r._emscripten_stack_get_base=r.asm.emscripten_stack_get_base).apply(null,arguments)},r._emscripten_stack_get_end=function(){return(ft=r._emscripten_stack_get_end=r.asm.emscripten_stack_get_end).apply(null,arguments)});function ut(){var t;ct(),D(!(3&(t=ft()))),S[t>>2]=34821223,S[t+4>>2]=2310721022,S[0]=1668509029}function dt(t){function e(){at||(at=!0,r.calledRun=!0,M||(D(!H),H=!0,U(),rt(G),i(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),D(!r._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(U(),r.postRun)for('function'==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)t=r.postRun.shift(),W.unshift(t);var t;rt(W)}()))}t=t||o,Y>0||(ut(),function(){if(r.preRun)for('function'==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)t=r.preRun.shift(),P.unshift(t);var t;rt(P)}(),Y>0||(r.setStatus?(r.setStatus('Running...'),setTimeout((function(){setTimeout((function(){r.setStatus('')}),1),e()}),1)):e(),U()))}if(r.stackSave=et("stackSave"),r.stackRestore=et("stackRestore"),r.stackAlloc=et("stackAlloc"),r.setValue=function(t,i,e="i8"){switch(e.endsWith('*')&&(e='*'),e){case'i1':case'i8':T[0|t]=i;break;case'i16':O[t>>1]=i;break;case'i32':L[t>>2]=i;break;case'i64':J=[i>>>0,($=i,+Math.abs($)>=1?$>0?(0|Math.min(+Math.floor($/4294967296),4294967295))>>>0:~~+Math.ceil(($-+(~~$>>>0))/4294967296)>>>0:0)],L[t>>2]=J[0],L[t+4>>2]=J[1];break;case'float':x[t>>2]=i;break;case'double':k[t>>3]=i;break;case'*':S[t>>2]=i;break;default:j('invalid type for setValue: '+e)}},r.getValue=function(t,i="i8"){switch(i.endsWith('*')&&(i='*'),i){case'i1':case'i8':return T[0|t];case'i16':return O[t>>1];case'i32':case'i64':return L[t>>2];case'float':return x[t>>2];case'double':return k[t>>3];case'*':return S[t>>2];default:j('invalid type for getValue: '+i)}return null},['run','UTF8ArrayToString','UTF8ToString','stringToUTF8Array','stringToUTF8','lengthBytesUTF8','addOnPreRun','addOnInit','addOnPreMain','addOnExit','addOnPostRun','addRunDependency','removeRunDependency','FS_createFolder','FS_createPath','FS_createDataFile','FS_createPreloadedFile','FS_createLazyFile','FS_createLink','FS_createDevice','FS_unlink','getLEB','getFunctionTables','alignFunctionTables','registerFunctions','prettyPrint','getCompilerSetting','print','printErr','callMain','abort','keepRuntimeAlive','wasmMemory','stackAlloc','stackSave','stackRestore','getTempRet0','setTempRet0','writeStackCookie','checkStackCookie','ptrToString','zeroMemory','stringToNewUTF8','exitJS','getHeapMax','emscripten_realloc_buffer','ENV','ERRNO_CODES','ERRNO_MESSAGES','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','DNS','getHostByName','Protocols','Sockets','getRandomDevice','warnOnce','traverseStack','UNWIND_CACHE','convertPCtoSourceLocation','readAsmConstArgsArray','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','handleException','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','freeTableIndexes','functionsInTableMap','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','PATH','PATH_FS','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16Decoder','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeArrayToMemory','writeAsciiToMemory','SYSCALLS','getSocketFromFD','getSocketAddress','JSEvents','registerKeyEventCallback','specialHTMLTargets','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','currentFullscreenStrategy','restoreOldWindowedStyle','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','demangle','demangleAll','jsStackTrace','stackTrace','ExitStatus','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','dlopenMissingError','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','uncaughtExceptionCount','exceptionLast','exceptionCaught','ExceptionInfo','exception_addRef','exception_decRef','Browser','setMainLoop','wget','FS','MEMFS','TTY','PIPEFS','SOCKFS','_setNetworkCallback','tempFixedLengthArray','miniTempWebGLFloatBuffers','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','GL','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','AL','SDL_unicode','SDL_ttfContext','SDL_audio','SDL','SDL_gfx','GLUT','EGL','GLFW_Window','GLFW','GLEW','IDBStore','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){var i="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),j(i)}})})),['ptrToString','zeroMemory','stringToNewUTF8','exitJS','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','getHostByName','getRandomDevice','traverseStack','convertPCtoSourceLocation','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeAsciiToMemory','getSocketFromFD','getSocketAddress','registerKeyEventCallback','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','ExceptionInfo','exception_addRef','exception_decRef','setMainLoop','_setNetworkCallback','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','SDL_unicode','SDL_ttfContext','SDL_audio','GLFW_Window','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){'undefined'==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var i='`'+t+'` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line';E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),ht(i)}})})),K=function t(){at||dt(),at||(K=t)},r.preInit)for('function'==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return dt(),t.ready})}},r={};function h(t){var i=r[t];if(void 0!==i)return i.exports;var e=r[t]={exports:{}};return n[t](e,e.exports,h),e.exports}h.m=n,t="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",i="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",e="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",s=t=>{t&&t.d<1&&(t.d=1,t.forEach((t=>t.r--)),t.forEach((t=>t.r--?t.r++:t())))},h.a=(n,r,h)=>{var o;h&&((o=[]).d=-1);var a,l,c,f=new Set,u=n.exports,d=new Promise(((t,i)=>{c=i,l=t}));d[i]=u,d[t]=t=>(o&&t(o),f.forEach(t),d.catch((t=>{}))),n.exports=d,r((n=>{var r;a=(n=>n.map((n=>{if(null!==n&&"object"==typeof n){if(n[t])return n;if(n.then){var r=[];r.d=0,n.then((t=>{h[i]=t,s(r)}),(t=>{h[e]=t,s(r)}));var h={};return h[t]=t=>t(r),h}}var o={};return o[t]=t=>{},o[i]=n,o})))(n);var h=()=>a.map((t=>{if(t[e])throw t[e];return t[i]})),l=new Promise((i=>{(r=()=>i(h)).r=0;var e=t=>t!==o&&!f.has(t)&&(f.add(t),t&&!t.d&&(r.r++,t.push(r)));a.map((i=>i[t](e)))}));return r.r?l:h()}),(t=>(t?c(d[e]=t):l(u),s(o)))),o&&o.d<0&&(o.d=0)},h.d=(t,i)=>{for(var e in i)h.o(i,e)&&!h.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:i[e]})},h.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),h.p="/Client2/",h.b=document.baseURI||self.location.href;h(5532)})(); \ No newline at end of file +(()=>{"use strict";var t,i,e,s,n={1651:(t,i,e)=>{e.d(i,{K:()=>k});var s=e(1120),n=e(4583),r=e(2901),h=e(1069),o=e(7046),a=(e(9896),e(6666)),l=e(3045),c=e(818),f=e(670),u=e(8268),d=e(3867),w=e(7854),y=e(8950),m=e(1302),A=e(9298),p=e(8665),g=e(1312),I=e(3819),_=e(8317),C=e(9234),E=e(1908),v=e(123),b=e(5637),T=e(6948),R=e(2164),O=e(8738),L=e(3764),S=e(8534),x=e(6730);class k extends o.A{static tt=225;static it=10;static portOffset=0;static members=!0;static et=!1;static st='';static nt='';static rt=!1;static ht=2;static ot=!1;static lt='https://raw.githubusercontent.com/2004scape/Server/main';static exponent=58778699976184461502525193738213253649000149147835990136706041084440742975821n;static ct=7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789n;static ft=0;static ut=0;static dt=0;static wt=0;static yt=0;static At=0;static gt=0;static It=0;static _t=0;static Ct=0;static Et=0;static vt=0;static bt=0;static Tt=0;static Rt=0;static Ot=()=>{l.A.et=!1,n.A.et=!1,k.et=!1,c.A.et=!1};static Lt=()=>{l.A.et=!0,n.A.et=!0,k.et=!0,c.A.et=!0};St=2048;xt=2047;kt=!1;Mt=!1;Dt=!1;Nt=!1;db=null;Ft=0;Bt=[];stream=null;in=h.A.Ut(1);Pt=h.A.Ut(1);Gt=h.A.Ut(1);Wt=0n;Ht=0;Yt=0;Vt=0;Kt=null;Xt=0;packetSize=0;jt=0;zt=0;Zt=0;qt=null;$t=!0;Jt=0;Qt=0;ti=null;ii=null;ei=null;si=null;ni=null;ri=null;hi=null;oi=null;ai=null;li=null;ci=null;fi='';ui='';username='';password='';di=null;wi=null;yi=null;mi=null;Ai=[];pi=!1;gi=null;Ii=null;_i=null;Ci=null;Ei=null;vi=null;bi=null;Ti=null;Ri=null;Oi=null;Li=new Int32Array(256);Si=0;xi=0;ki=0;Mi=null;Di=null;Ni=null;Fi=null;Bi=null;Ui=null;Pi=null;Gi=null;Wi=null;Hi=null;Yi=null;Vi=null;Ki=null;Xi=null;ji=null;zi=null;Zi=null;qi=null;$i=null;Ji=null;Qi=null;te=new Int32Array(33);ie=new Int32Array(33);ee=new Int32Array(151);se=new Int32Array(151);ne=null;re=null;he=null;oe=null;ae=null;le=null;ce=new d.fe(13,null);ue=null;de=null;we=new d.fe(50,null);ye=new d.fe(50,null);me=new d.fe(20,null);Ae=new d.fe(20,null);pe=null;ge=new d.fe(8,null);Ie=null;_e=null;Ce=null;Ee=null;ve=null;be=null;Te=null;Re=null;Oe=null;Le=null;Se=null;xe=null;ke=null;Me=null;De=null;Ne=null;Fe=null;Be=null;Ue=new d.fe(1e3,null);Pe=!1;Ge=!1;We=!1;He=!1;Ye=-1;Ve=0;Ke=0;Xe=0;je=0;ze=0;Ze=0;qe=!1;$e=0;Je=0;Qe=0;ts=0;es=0;ss=0;ns=[];rs=-1;hs=-1;os=new s.A;ls=78;cs=0;fs=0;us=[];ds=0;ws=0;ys=0;As=0;ps=0;gs=0;Is=0;_s=0;Cs=[];Es=[];vs=[];bs=[];Ts=null;Rs=-1;Os=3;Ls=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];Ss=0;xs=0;ks=0;Ms=!1;Ds=0;Ns=!1;Fs='';Bs='';Us=0;Ps='';Gs=!1;Ws=-1;Hs=new d.fe(100,null);Ys=new d.fe(100,null);messageType=new Int32Array(100);Vs=new Int32Array(100);Ks=0;Xs=0;js=0;zs='';Zs=0;qs=0;$s=0;Js=0;Qs=0;tn=0;en=0;sn=0;nn=0;rn=!1;hn=0;an=0;ln=0;cn=0;fn=null;un=0;dn=0;wn=0;yn=0;mn=!1;An=[];pn=[];gn=0;In=0;_n=0;Cn=null;En=0;vn=new Int32Array(500);bn=new Int32Array(500);Tn=new Int32Array(500);Rn=new Int32Array(500);On=0;Ln=0;Sn=0;xn='';kn=!1;Mn=-1;Dn=0;Nn=0;Fn=0;Bn=0;Un=0;Pn=new Int32Array(1e3);Gn=new Int32Array(1e3);Wn=null;Hn=0;Yn=0;Vn=0;Kn=0;Xn=0;jn=!1;zn=0;Zn=0;qn=0;$n=0;Jn=2;Qn=2;tr=1;ir=new Int32Array(5);er=new d.fe(5,!1);sr=new Int32Array(5);nr=new Int32Array(5);rr=new Int32Array(5);hr=0;ar=0;lr=0;cr=0;ur=0;dr=0;wr=0;yr=0;mr=0;Ar=1;pr=2;gr=-1;Ir=0;_r=0;Cr=0;Er=0;vr=0;br=0;Tr=null;Rr=null;Or=null;Lr=0;Sr=0;kr=new Int8Array(16384);Mr=new d.fe(f.A.Dr,null);Nr=0;Fr=0;Br=128;Ur=0;Pr=0;Gr=0;Wr=0;Hr=0;Yr=null;Vr=null;Kr=new d.Xr(f.A.jr,f.A.jr);zr=0;Zr=0;qr=0;$r=0;Jr=0;Qr=0;th=0;ih=0;eh=0;sh=0;nh=0;rh=0;hh=new d.fe(this.St,null);oh=0;ah=new Int32Array(this.St);lh=0;fh=0;uh=new Int32Array(this.St);dh=new Int32Array(1e3);wh=new d.fe(this.St,null);yh=new d.fe(8192,null);mh=0;Ah=new Int32Array(8192);ph=new a.A;gh=new a.A;Ih=new a.A;_h=new a.A;Ch=new d.Eh(f.A.Dr,f.A.jr,f.A.jr,null);bh=new a.A;Th=new Int32Array(4e3);Rh=new Int32Array(4e3);Oh=new Int32Array(f.A.jr*f.A.jr);Lh=new Int32Array(f.A.jr*f.A.jr);Sh=0;xh=null;kh=0;Mh=0;Dh=-1;Nh=0;Fh=0;Bh=0;Uh=0;Ph=!1;Gh=!0;Wh=!1;Hh=new Int32Array(7);Yh=new Int32Array(5);Vh=0;Kh=0;static Xh=50;jh=new Int32Array(k.Xh);zh=new Int32Array(k.Xh);Zh=new Int32Array(k.Xh);qh=new Int32Array(k.Xh);$h=new Int32Array(k.Xh);Jh=new Int32Array(k.Xh);Qh=new Int32Array(k.Xh);io=new d.fe(k.Xh,null);eo=new d.fe(100,null);so=new BigInt64Array(100);no=new Int32Array(100);ro=null;ho=0;oo=!0;ao=new Int32Array(50);lo=new Int32Array(50);co=new Int32Array(50);fo=192;uo=-1;do=-1;wo=0;yo=0;mo=0;Ao=!0;po=null;Io=0;_o=0;Co=192;Eo=new d.fe(16,null);vo=0;bo=!1;To=()=>{try{this.stream&&this.stream.close()}catch(t){}this.stream=null,(0,v.Ro)(),this.Pt=null,this.Gt=null,this.in=null,this.Or=null,this.Tr=null,this.Rr=null,this.Yr=null,this.Vr=null,this.Wn=null,this.Mr=null,this.Oh=null,this.Lh=null,this.Th=null,this.Rh=null,this.kr=null,this.Di=null,this.Ni=null,this.Fi=null,this.Bi=null,this.Ui=null,this.Pi=null,this.Gi=null,this.Wi=null,this.Hi=null,this.Yi=null,this.Vi=null,this.Ki=null,this.Xi=null,this.ji=null,this.zi=null,this.Zi=null,this.qi=null,this.ne=null,this.he=null,this.re=null,this.oe=null,this.ae=null,this.le=null,this.ce=null,this.Te=null,this.Re=null,this.Oe=null,this.Le=null,this.Se=null,this.xe=null,this.ke=null,this.Me=null,this.De=null,this.Ne=null,this.de=null,this.me=null,this.Ae=null,this.ge=null,this.Ie=null,this._e=null,this.Ce=null,this.Ee=null,this.we=null,this.ye=null,this.Kr=null,this.hh=null,this.ah=null,this.uh=null,this.wh=null,this.dh=null,this.yh=null,this.Ah=null,this.Ch=null,this.bh=null,this._h=null,this.ph=null,this.gh=null,this.Ih=null,this.Tn=null,this.Rn=null,this.vn=null,this.bn=null,this.ns=null,this.An=null,this.Pn=null,this.Gn=null,this.Ue=null,this.ue=null,this.eo=null,this.so=null,this.no=null,this.si=null,this.ni=null,this.ti=null,this.ii=null,this.ei=null,this.ri=null,this.hi=null,this.oi=null,this.ai=null,this.Oo(),b.A.To(),T.A.To(),m.A.To(),R.A.Lo=null,_.A.Lo=null,s.A.Lo=null,g.A.Lo=null,O.A.Lo=null,O.A.So=null,L.A.Lo=null,this.xo=null,u.A.So=null,n.A.To(),l.A.To(),p.A.To(),S.A.Lo=[],x.A.Lo=[]};ko(){return this.Jt}Mo(){return this.Gs}Do(){return this.Ns}No(){return this.hs}Fo(){return this.Ye}Oo=()=>{this.pi=!1,this.Mi&&(clearInterval(this.Mi),this.Mi=null),this.li=null,this.ci=null,this.Ai=[],this.bi=null,this.Ti=null,this.Ri=null,this.Oi=null,this.Ci=null,this._i=null,this.Ei=null,this.vi=null,this.gi=null,this.Ii=null};Bo=async(t,i,e,s)=>{let n=5,o=await(this.db?.Uo(t));if(o&&h.A.Po(o)!==e&&(o=void 0),o)return new r.A(o);for(;!o;){await this.Go(s,`Requesting ${i}`);try{o=await(0,C.Wo)(`${k.nt}/${t}${e}`)}catch(t){o=void 0;for(let t=n;t>0;t--)await this.Go(s,`Error loading - Will retry in ${t} secs.`),await(0,C.Ho)(1e3);n*=2,n>60&&(n=60)}}return await(this.db?.Yo(t,o)),new r.A(o)};Vo=async(t,i,e)=>{let s=await(this.db?.Uo(t+'.mid'));if(s&&12345678!==i&&h.A.Po(s)!==i&&(s=void 0),!s)try{s=await(0,C.Wo)(`${k.nt}/${t}_${i}.mid`),e!==s.length&&(s=s.slice(0,e))}catch(t){}if(!s)return;await(this.db?.Yo(t+'.mid',s));const n=new h.A(Uint8Array.from(s)).Ko,r=E.A.read(n,s,e,4);(0,v.Xo)(r,this.Co)};jo=()=>{if(w.zo.fillStyle='black',w.zo.fillRect(0,0,this.width,this.height),this.Zo(1),this.Dt){this.pi=!1,w.zo.font='bold 16px helvetica, sans-serif',w.zo.textAlign='left',w.zo.fillStyle='yellow';let t=35;w.zo.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,w.zo.fillStyle='white',w.zo.fillText('To fix this try the following (in order):',30,t),t+=50,w.zo.font='bold 12px helvetica, sans-serif',w.zo.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.zo.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,w.zo.fillText('3: Try using a different game-world',30,t),t+=30,w.zo.fillText('4: Try rebooting your computer',30,t),t+=30,w.zo.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.Nt&&(this.pi=!1,w.zo.font='bold 20px helvetica, sans-serif',w.zo.textAlign='left',w.zo.fillStyle='white',w.zo.fillText('Error - unable to load game!',50,50),w.zo.fillText('To play RuneScape make sure you play from',50,100),w.zo.fillText('https://2004scape.org',50,150)),this.Mt){this.pi=!1,w.zo.font='bold 13px helvetica, sans-serif',w.zo.textAlign='left',w.zo.fillStyle='yellow';let t=35;w.zo.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,w.zo.fillStyle='white',w.zo.fillText('To fix this try the following (in order):',30,t),t+=50,w.zo.font='bold 12px helvetica, sans-serif',w.zo.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.zo.fillText('2: Try rebooting your computer, and reloading',30,t)}};qo=t=>{if(!t.$o)return!1;for(let i=0;i=s)return!1}else if(3===t.$o[i]){if(e<=s)return!1}else if(4===t.$o[i]){if(e===s)return!1}else if(e!==s)return!1}return!0};ta=(t,i,e,s,n)=>{this.ve?.draw(t,i),this.be?.draw(t,i+n-16),y.A.fillRect(t,i+16,16,n-32,A.A.ia);let r=(n-32)*n/s|0;r<8&&(r=8);const h=(n-r-32)*e/(s-n)|0;y.A.fillRect(t,i+h+16,16,r,A.A.ea),y.A.sa(t,i+h+16,A.A.na,r),y.A.sa(t+1,i+h+16,A.A.na,r),y.A.ra(t,i+h+16,A.A.na,16),y.A.ra(t,i+h+17,A.A.na,16),y.A.sa(t+15,i+h+16,A.A.ha,r),y.A.sa(t+14,i+h+17,A.A.ha,r-1),y.A.ra(t,i+h+r+15,A.A.ha,16),y.A.ra(t+1,i+h+r+14,A.A.ha,15)};oa=(t,i)=>{let e=!1;const n=s.A.Lo[t];if(!n.aa)return!1;for(let t=0;ts.delay[r.ua];)r.fa-=s.delay[r.ua]+1,r.ua++,r.ua>=s.da&&(r.ua-=s.wa,(r.ua<0||r.ua>=s.da)&&(r.ua=0)),e=!0}}}return e};ya=(t,i,e,r,h=!1)=>{if(0!==t.type||!t.aa||t.hide&&this.Zs!==t.id&&this.qs!==t.id&&this.$s!==t.id)return;const o=y.A.left,a=y.A.top,l=y.A.right,c=y.A.bottom;y.A.ma(i,e,i+t.width,e+t.height);const f=t.aa.length;for(let o=0;o0&&this.Ca(c),c.type===s.A.Ea)c.va>c.scroll-c.height&&(c.va=c.scroll-c.height),c.va<0&&(c.va=0),this.ya(c,a,l,c.va,h),c.scroll>c.height&&this.ta(a+c.width,l,c.va,c.scroll,c.height);else if(c.type===s.A.ba){let t=0;for(let i=0;i0){let i=0,e=0;const r=c.Oa[t]-1;if(s>=-32&&s<=512&&n>=-32&&n<=334||0!==this.tn&&this.Qs===t){const h=m.A.ka(r,c.La[t]);if(0!==this.tn&&this.Qs===t&&this.Js===c.id?(i=this.Ma-this.en,e=this.Da-this.sn,i<5&&i>-5&&(i=0),e<5&&e>-5&&(e=0),this.nn<5&&(i=0,e=0),h.Na(128,s+i,n+e)):0!==this.un&&this.dn===t&&this.wn===c.id?h.Na(128,s,n):h.draw(s,n),33===h.Fa||1!==c.La[t]){const r=c.La[t];this.di?.Ba(s+i+1,n+10+e,this.Ua(r),A.A.Pa),this.di?.Ba(s+i,n+9+e,this.Ua(r),A.A.Ga)}}}else if(c.Wa&&t<20){const i=c.Wa[t];i?.draw(s,n)}t++}}else if(c.type===s.A.Ha)c.fill?y.A.fillRect(a,l,c.width,c.height,c.Ya):y.A.ga(a,l,c.width,c.height,c.Ya);else if(c.type===s.A.Va){const t=c.font;let i=c.Ya,e=c.text;if(this.$s!==c.id&&this.qs!==c.id&&this.Zs!==c.id||0===c.Ka||(i=c.Ka),this.qo(c)&&(i=c.Xa,c.ja&&c.ja.length>0&&(e=c.ja)),c.za===s.A.Za&&this.mn&&(e='Please wait...',i=c.Ya),!t||!e)continue;for(let s=l+t.height;e.length>0;s+=t.height){if(-1!==e.indexOf('%')){for(;;){const t=e.indexOf('%1');if(-1===t)break;e=e.substring(0,t)+this.qa(this.Jo(c,0))+e.substring(t+2)}for(;;){const t=e.indexOf('%2');if(-1===t)break;e=e.substring(0,t)+this.qa(this.Jo(c,1))+e.substring(t+2)}for(;;){const t=e.indexOf('%3');if(-1===t)break;e=e.substring(0,t)+this.qa(this.Jo(c,2))+e.substring(t+2)}for(;;){const t=e.indexOf('%4');if(-1===t)break;e=e.substring(0,t)+this.qa(this.Jo(c,3))+e.substring(t+2)}for(;;){const t=e.indexOf('%5');if(-1===t)break;e=e.substring(0,t)+this.qa(this.Jo(c,4))+e.substring(t+2)}}const n=e.indexOf('\\n');let r;-1!==n?(r=e.substring(0,n),e=e.substring(n+2)):(r=e,e=''),c.$a?t.Ja(a+(c.width/2|0),s,r,i,c.Qa):t.tl(a,s,r,i,c.Qa)}}else if(c.type===s.A.il){let t;t=this.qo(c)?c.el:c.sl,t?.draw(a,l)}else if(c.type===s.A.nl){const t=n.A.rl,i=n.A.hl;n.A.rl=a+(c.width/2|0),n.A.hl=l+(c.height/2|0);const e=n.A.sin[c.ol]*c.zoom>>16,s=n.A.cos[c.ol]*c.zoom>>16,r=this.qo(c);let h;h=r?c.ca:c.la;let o=null;if(-1===h)o=c.al(-1,-1,r);else{const t=g.A.Lo[h];t.frames&&t.ll&&(o=c.al(t.frames[c.ua],t.ll[c.ua],r))}o&&o.cl(0,c.fl,0,c.ol,0,e,s),n.A.rl=t,n.A.hl=i}else if(c.type===s.A.ul){const t=c.font;if(!t||!c.Oa||!c.La)continue;let i=0;for(let e=0;e0){const n=m.A.get(c.Oa[i]-1);let r=n.name;if((n.dl||1!==c.La[i])&&(r=r+' x'+this.wl(c.La[i])),!r)continue;const h=a+s*(c.Sa+115),o=l+e*(c.xa+12);c.$a?t.Ja(h+(c.width/2|0),o,r,c.Ya,c.Qa):t.tl(h,o,r,c.Ya,c.Qa)}i++}}}y.A.ma(o,a,l,c)};Ca=t=>{let i=t._a;if(i>=s.A.yl&&i<=s.A.ml)i--,i>=this.Vh?(t.text='',t.za=0):(t.text=this.eo[i],t.za=1);else if(i>=s.A.Al&&i<=s.A.pl)i-=s.A.Al,i>=this.Vh?(t.text='',t.za=0):(0===this.no[i]?t.text='@red@Offline':this.no[i]===k.it?t.text='@gre@World-'+(this.no[i]-9):t.text='@yel@World-'+(this.no[i]-9),t.za=1);else if(i===s.A.gl)t.scroll=15*this.Vh+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i>=s.A.Il&&i<=s.A._l)i-=s.A.Il,i>=this.fs?(t.text='',t.za=0):(t.text=I.A.Cl(I.A.El(this.us[i])),t.za=1);else if(i===s.A.vl)t.scroll=15*this.fs+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i===s.A.bl){if(t.ol=150,t.fl=256*Math.sin(this.Ft/40)&2047,this.Wh){this.Wh=!1;const i=new d.fe(7,null);let e=0;for(let t=0;t<7;t++){const s=this.Hh[t];s>=0&&(i[e++]=_.A.Lo[s].al())}const s=p.A.Tl(i,e);for(let t=0;t<5;t++)0!==this.Yh[t]&&(s.Rl(u.A.Ol[t][0],u.A.Ol[t][this.Yh[t]]),1===t&&s.Rl(u.A.Ll[0],u.A.Ll[this.Yh[t]]));if(this.xh){const i=g.A.Lo[this.xh.Sl].frames;i&&(s.xl(),s.kl(i[0]),s.Ml(64,850,-30,-50,-30,!0),t.model=s)}}}else if(i===s.A.Dl)this.Fe||(this.Fe=t.sl,this.Be=t.el),this.Gh?t.sl=this.Be:t.sl=this.Fe;else if(i===s.A.Nl)this.Fe||(this.Fe=t.sl,this.Be=t.el),this.Gh?t.sl=this.Fe:t.sl=this.Be;else if(i===s.A.Fl)t.text=this.xn,this.Ft%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(i===s.A.Bl)this.Ph?this.kn?(t.Ya=A.A.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.Ya=A.A.Ia,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(i===s.A.Ul||i===s.A.Pl)if(0===this.Dn)t.text='';else{let i;i=0===this.Nn?'earlier today':1===this.Nn?'yesterday':this.Nn+' days ago',t.text='You last logged in '+i+' from: '+I.A.Gl(this.Dn)}else if(i===s.A.Wl)0===this.Bn&&(t.text='0 unread messages',t.Ya=A.A.Ga),1===this.Bn&&(t.text='1 unread message',t.Ya=A.A.GREEN),this.Bn>1&&(t.text=this.Bn+' unread messages',t.Ya=A.A.GREEN);else if(i===s.A.Hl)if(201===this.Fn)t.text='';else if(200===this.Fn)t.text='You have not yet set any password recovery questions.';else{let i;i=0===this.Fn?'Earlier today':1===this.Fn?'Yesterday':this.Fn+' days ago',t.text=i+' you changed your recovery questions'}else i===s.A.Yl?201===this.Fn?t.text='':200===this.Fn?t.text='We strongly recommend you do so now to secure your account.':t.text='If you do not remember making this change then cancel it immediately':i===s.A.Vl&&(201===this.Fn?t.text='':(this.Fn,t.text="Do this from the 'account management' area on our front webpage"))};Jo=(t,i)=>{if(!t.scripts||i>=t.scripts.length)return-2;try{const e=t.scripts[i];if(!e)return-1;let n=0,r=0;for(;;){const t=e[r++];if(0===t)return n;if(1===t)n+=this.Es[e[r++]];else if(2===t)n+=this.vs[e[r++]];else if(3===t)n+=this.Cs[e[r++]];else if(4===t){const t=s.A.Lo[e[r++]],i=e[r++]+1;if(t.Oa&&t.La)for(let e=0;et<999999999?String(t):'*';wl=t=>{let i=String(t);for(let t=i.length-3;t>0;t-=3)i=i.substring(0,t)+','+i.substring(t);return i.length>8?i='@gre@'+i.substring(0,i.length-8)+' million @whi@('+i+')':i.length>4&&(i='@cya@'+i.substring(0,i.length-4)+'K @whi@('+i+')'),' '+i};Ua=t=>t<1e5?String(t):t<1e7?(t/1e3|0)+'K':(t/1e6|0)+'M'}},7604:(t,i,e)=>{e.d(i,{w:()=>h});var s=e(7046),n=e(1651),r=e(9234);async function h(){await async function(){0===s.A.getParameter('world').length&&s.A.setParameter('world','1');'localhost'===window.location.hostname&&'0'===s.A.getParameter('world')?(n.K.st='http://localhost',n.K.nt='http://localhost',n.K.portOffset=0):await async function(t){const i=await o(t,parseInt(s.A.getParameter('world'),10)),e=new URL(i.address);n.K.it=10+i.id-1,n.K.st=`${e.protocol}//${e.hostname}`,n.K.nt=`${e.protocol}//${e.hostname}:${e.port}`,t||(n.K.st=n.K.st.replace('https:','http:'));n.K.portOffset=i.portOffset,n.K.members=!0===i?.members,s.A.setParameter('world',i.id.toString(10))}(window.location.protocol.startsWith('https'))}(),function(){0===s.A.getParameter('detail').length&&s.A.setParameter('detail','high');'low'===s.A.getParameter('detail')?n.K.Lt():n.K.Ot()}(),0===s.A.getParameter('method').length&&s.A.setParameter('method','0')}async function o(t,i,e=0){if(e>=10)throw new Error('could not find world to connect!');const s=t?'https:':'http:';let n;try{n=JSON.parse(await(0,r.Xl)(`${s}//2004scape.org/api/v1/worldlist`))}catch(s){return await(0,r.Ho)(1e3),o(t,i,++e)}n.push({id:0,region:'Local Development',address:'http://localhost',portOffset:0,members:!0,hh:0});const h=n.find((t=>t.id===i));return h||o(t,i,10)}},7046:(t,i,e)=>{e.d(i,{A:()=>l});var s=e(1183),n=e(4583),r=e(9234),h=e(9091),o=e(2595),a=e(7854);class l{static getParameter(t){return new URLSearchParams(window.location.search).get(t)??''}static setParameter(t,i){const e=new URL(window.location.toString());e.searchParams.set(t,i),window.history.pushState(null,'',e.toString())}jl=0;zl=[];Zl=0;xo=null;state=0;ql=20;$l=1;Jl=[];Ql=0;tc=0;ic=[];ec=!0;sc=!1;nc=50;hasFocus=!0;rc=!1;hc=0;oc=0;Ma=0;Da=0;ac=0;lc=0;cc=0;fc=[];uc=[];dc=0;wc=0;input=null;yc=!1;mc=!1;Ac=!1;time=-1;gc=0;Ic=0;_c=0;Cc=0;Ec=0;vc=0;constructor(t=!1){a.bc.tabIndex=-1,a.zo.fillStyle='black',a.zo.fillRect(0,0,a.bc.width,a.bc.height),this.sc=t,this.sc?this.resize(window.innerWidth,window.innerHeight):this.resize(a.bc.width,a.bc.height)}get width(){return a.bc.width}get height(){return a.bc.height}resize=(t,i)=>{a.bc.width=t,a.bc.height=i,this.xo=new s.A(t,i),n.A.Tc()};Rc=async()=>{a.bc.addEventListener('resize',(()=>{this.sc&&this.resize(window.innerWidth,window.innerHeight)}),!1),a.bc.onmousedown=this.onmousedown,a.bc.onmouseup=this.onmouseup,a.bc.onmouseenter=this.onmouseenter,a.bc.onmouseleave=this.onmouseleave,a.bc.onmousemove=this.onmousemove,window.onbeforeunload=this.To,a.bc.onfocus=this.onfocus,a.bc.onblur=this.onblur,this.Oc?(a.bc.ontouchstart=this.ontouchstart,a.bc.ontouchend=this.ontouchend,a.bc.ontouchmove=this.ontouchmove):(a.bc.onkeydown=this.onkeydown,a.bc.onkeyup=this.onkeyup),a.bc.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.Oc&&'low'===l.getParameter('detail')&&(this.nc=30),await this.Go(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.Jl[t]=performance.now();let t,i=0,e=256,s=1,n=0;for(;this.state>=0;){if(this.state>0&&(this.state--,0===this.state))return void this.Lc();const h=e,o=s;e=300,s=1,t=performance.now();const a=this.Jl[i];if(0===a?(e=h,s=o):t>a&&(e=2560*this.ql/(t-a)|0),e<25?e=25:e>256&&(e=256,s=this.ql-(t-a)/10|0),this.Jl[i]=t,i=(i+1)%10,s>1)for(let t=0;t<10;t++)0!==this.Jl[t]&&(this.Jl[t]+=s);for(s0&&(this.Ql=1e3*e/(256*this.ql)|0);const l=performance.now();if(this.ec&&this.refresh(),await this.draw(),this.ic[this.tc]=(performance.now()-l)/1e3,this.tc=(this.tc+1)%this.ic.length,this.nc<50){const i=1e3/this.nc-(performance.now()-t);i>0&&await(0,r.Ho)(i)}}-1===this.state&&this.Lc()};Lc=()=>{this.state=-2,this.To()};Zo=t=>{this.ql=1e3/t|0};Sc=t=>{this.nc=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.ql|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};To=()=>{};draw=async()=>{};refresh=()=>{};async Go(t,i){const e=this.width,s=this.height;this.ec&&(a.zo.fillStyle='black',a.zo.fillRect(0,0,e,s),this.ec=!1);const n=s/2-18;a.zo.fillStyle='rgb(140, 17, 17)',a.zo.rect((e/2|0)-152,n,304,34),a.zo.fillRect((e/2|0)-150,n+2,3*t,30),a.zo.fillStyle='black',a.zo.fillRect((e/2|0)-150+3*t,n+2,300-3*t,30),a.zo.font='bold 13px helvetica, sans-serif',a.zo.textAlign='center',a.zo.fillStyle='white',a.zo.fillText(i,e/2|0,n+22),await(0,r.Ho)(5)}xc=()=>{let t=-1;return this.wc!==this.dc&&(t=this.uc[this.dc],this.dc=this.dc+1&127),t};get ms(){const t=this.ic.length;let i=0;for(let e=0;ethis.jl&&(this.jl=e),this.zl[this.Zl]=e,this.Zl=(this.Zl+1)%250,e}get kc(){return this.zl.reduce(((t,i)=>t+i),0)/250}onkeydown=t=>{const i=t.key;this.hc=0;const e=h.c[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;t.ctrlKey&&(n>='A'.charCodeAt(0)&&n<=']'.charCodeAt(0)||n=='_'.charCodeAt(0)?n-='A'.charCodeAt(0)-1:n>='a'.charCodeAt(0)&&n<='z'.charCodeAt(0)&&(n-='a'.charCodeAt(0)-1)),n<30&&(n=0),s===h.c.ArrowLeft.code?n=1:s===h.c.ArrowRight.code?n=2:s===h.c.ArrowUp.code?n=3:s===h.c.ArrowDown.code?n=4:s===h.c.Control.code?n=5:s===h.c.Shift.code?n=6:s===h.c.Alt.code?n=7:s===h.c.Backspace.code||s===h.c.Delete.code?n=8:s===h.c.Tab.code?n=9:s===h.c.Enter.code?n=10:s>=h.c.F1.code&&s<=h.c.F12.code?n=s+1008-h.c.F1.code:s===h.c.Home.code?n=1e3:s===h.c.End.code?n=1001:s===h.c.PageUp.code?n=1002:s===h.c.PageDown.code&&(n=1003),n>0&&n<128&&(this.fc[n]=1),n>4&&(this.uc[this.wc]=n,this.wc=this.wc+1&127),o.A.enabled&&o.A.Mc(n),h.g.includes(i)||t.preventDefault()};onkeyup=t=>{const i=t.key;this.hc=0;const e=h.c[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;n<30&&(n=0),s===h.c.ArrowLeft.code?n=1:s===h.c.ArrowRight.code?n=2:s===h.c.ArrowUp.code?n=3:s===h.c.ArrowDown.code?n=4:s===h.c.Control.code?n=5:s===h.c.Shift.code?n=6:s===h.c.Alt.code?n=7:s===h.c.Backspace.code||s===h.c.Delete.code?n=8:s===h.c.Tab.code?n=9:s===h.c.Enter.code?n=10:s>=h.c.F1.code&&s<=h.c.F12.code?n=s+1008-h.c.F1.code:s===h.c.Home.code?n=1e3:s===h.c.End.code?n=1001:s===h.c.PageUp.code?n=1002:s===h.c.PageDown.code&&(n=1003),n>0&&n<128&&(this.fc[n]=0),o.A.enabled&&o.A.Dc(n),h.g.includes(i)||t.preventDefault()};onmousedown=t=>{if(this.yc=!1,(t.clientX>0||t.clientY>0)&&this.Nc(t),this.hc=0,this.lc=this.Ma,this.cc=this.Da,this.Oc&&!this.Fc){if(this.Bc()||this.Uc()||this.Pc())return this.ac=1,void(this.oc=1);t.timeStamp>=this.time+500?(this.ac=2,this.oc=2):(this.ac=1,this.oc=1)}else 2===t.button?(this.ac=2,this.oc=2):(this.ac=1,this.oc=1);o.A.enabled&&o.A.Gc(this.lc,this.cc,t.buttons)};onmouseup=t=>{this.Nc(t),this.hc=0,this.oc=0,o.A.enabled&&o.A.Wc(t.buttons)};onmouseenter=t=>{this.Nc(t),o.A.enabled&&o.A.Hc()};onmouseleave=t=>{this.Nc(t),this.hc=0,this.Ma=-1,this.Da=-1,this.oc=0,this.lc=-1,this.cc=-1,o.A.enabled&&o.A.Yc()};onmousemove=t=>{this.Nc(t),this.hc=0,o.A.enabled&&o.A.Vc(this.Ma,this.Da)};onfocus=t=>{this.hasFocus=!0,this.ec=!0,this.refresh(),o.A.enabled&&o.A.Kc()};onblur=t=>{this.hasFocus=!1,o.A.enabled&&o.A.Xc()};ontouchstart=t=>{if(!this.Oc)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.yc=!0;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.gc=this.Ec=this._c=0|i.screenX,this.Ic=this.vc=this.Cc=0|i.screenY,this.time=t.timeStamp,this.mc=this.jc(),this.Ac=this.zc()};ontouchend=t=>{if(!this.Oc||!this.yc)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;if(this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.Ec=0|i.screenX,this.vc=0|i.screenY,this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.mc&&!this.jc())return void(this.yc=!1);if(this.Ac&&!this.zc())return void(this.yc=!1);if(this.Bc()||this.Zc()||this.Uc()||this.Pc()){null!==this.input&&(this.input.parentNode?.contains(this.input)&&this.input.parentNode?.removeChild(this.input),this.input=null);const t=document.createElement('input');return this.Uc()?(t.setAttribute('id','username'),t.setAttribute('placeholder','Username')):this.Pc()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.Bc()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.Zc()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this.qc?t.setAttribute('type','password'):t.setAttribute('type',this.Pc()?'password':'text'),t.setAttribute('autofocus','autofocus'),t.setAttribute('spellcheck','false'),t.setAttribute('autocomplete','off'),t.setAttribute('style',`position: fixed; left: ${e}px; top: ${s}px; width: 1px; height: 1px; opacity: 0;`),document.body.appendChild(t),t.focus(),t.click(),this.qc&&(t.oninput=t=>{if(!(t instanceof InputEvent))return;const i=t,e=i.data;null!==e&&'insertText'===i.inputType&&this.onkeydown(new KeyboardEvent('keydown',{key:e,code:e}))}),t.onkeydown=t=>{this.qc&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this.qc&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeyup(new KeyboardEvent('keyup',{key:t.key,code:t.key}))},t.onfocus=t=>{this.input?.parentNode?.removeChild(this.input),this.input=null,this.onfocus(t)},this.input=t,void(this.yc=!1)}const n=t.timeStamp>=this.time+500,r=Math.abs(this.gc-this.Ec)>16||Math.abs(this.Ic-this.vc)>16;n&&!r?(this.yc=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.oc=0,this.yc=!1)};ontouchmove=t=>{if(!this.Oc||!this.yc)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.Ec=0|i.screenX,this.vc=0|i.screenY,this.mc&&-1===this.Fo()?(this._c-this.Ec>0?this.rotate(2):this._c-this.Ec<0&&this.rotate(0),this.Cc-this.vc>0?this.rotate(3):this.Cc-this.vc<0&&this.rotate(1)):(this.Ac||-1!==this.Fo())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this._c=this.Ec,this.Cc=this.vc};get Oc(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get qc(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get Fc(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}jc=()=>this.rc&&this.Ma>=8&&this.Ma<=520&&this.Da>=11&&this.Da<=345;Bc=()=>this.rc&&-1===this.No()&&!this.Mo()&&!this.Do()&&this.Ma>=11&&this.Ma<=506&&this.Da>=449&&this.Da<=482;Zc=()=>this.rc&&(this.Mo()||this.Do())&&this.Ma>=11&&this.Ma<=506&&this.Da>=383&&this.Da<=482;zc=()=>this.rc&&this.Ma>=562&&this.Ma<=752&&this.Da>=231&&this.Da<=492;Uc=()=>!this.rc&&2===this.ko()&&this.Ma>=301&&this.Ma<=562&&this.Da>=262&&this.Da<=279;Pc=()=>!this.rc&&2===this.ko()&&this.Ma>=301&&this.Ma<=562&&this.Da>=279&&this.Da<=296;rotate=t=>{0===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowLeft',code:'ArrowLeft'}))):1===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowUp',code:'ArrowUp'}))):2===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowRight',code:'ArrowRight'}))):3===t&&(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowDown',code:'ArrowDown'})))};$c=()=>null!==document.fullscreenElement;Nc=t=>{if(this.$c()){const i=t.target.getBoundingClientRect(),e=window.innerHeight/a.bc.height,s=(window.innerWidth-a.bc.width*e)/2;this.Ma=0|this.Jc(t.clientX-i.left-s,0,a.bc.width*e,0,789),this.Da=0|this.Jc(t.clientY-i.top,0,a.bc.height*e,0,532)}else{const i=a.bc.getBoundingClientRect(),e=a.bc.width/i.width,s=a.bc.height/i.height;this.Ma=(t.clientX-i.left)*e|0,this.Da=(t.clientY-i.top)*s|0}this.Ma<0&&(this.Ma=0),this.Da<0&&(this.Da=0),this.Ma>789&&(this.Ma=789),this.Da>532&&(this.Da=532)};Jc=(t,i,e,s,n)=>(t-i)*(n-s)/(e-i)+s}},2595:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1069);class n{static enabled=!1;static Qc=null;static tf=null;static if=0;static ef=0;static sf=0;static nf=0;static rf=0;static hf=()=>{this.Qc=s.A.Ut(1),this.tf=null,this.if=performance.now(),this.enabled=!0};static af=()=>{this.enabled=!1,this.Qc=null};static flush=()=>{let t=null;return this.tf&&this.enabled&&(t=this.tf),this.tf=null,t};static stop=()=>{let t=null;return this.Qc&&this.Qc.lf>0&&this.enabled&&(t=this.Qc),this.af(),t};static Gc=(t,i,e)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;this.ef++;const s=performance.now();let n=(s-this.if)/10|0;n>250&&(n=250),this.if=s,this.cf(5),1===e?this.Qc?.p1(1):this.Qc?.p1(2),this.Qc?.p1(n),this.Qc?.p3(t+(i<<10))};static Wc=t=>{if(!this.enabled)return;this.ef++;const i=performance.now();let e=(i-this.if)/10|0;e>250&&(e=250),this.if=i,this.cf(2),1===t?this.Qc?.p1(3):this.Qc?.p1(4),this.Qc?.p1(e)};static Vc=(t,i)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;const e=performance.now();if(e-this.sf>=50){this.sf=e,this.ef++;let s=(e-this.if)/10|0;s>250&&(s=250),this.if=e,t-this.nf<8&&t-this.nf>=-8&&i-this.rf<8&&i-this.rf>=-8?(this.cf(3),this.Qc?.p1(5),this.Qc?.p1(s),this.Qc?.p1(t+(i-this.rf+8<<4)+8-this.nf)):t-this.nf<128&&t-this.nf>=-128&&i-this.rf<128&&i-this.rf>=-128?(this.cf(4),this.Qc?.p1(6),this.Qc?.p1(s),this.Qc?.p1(t+128-this.nf),this.Qc?.p1(i+128-this.rf)):(this.cf(5),this.Qc?.p1(7),this.Qc?.p1(s),this.Qc?.p3(t+(i<<10))),this.nf=t,this.rf=i}};static Mc=t=>{if(!this.enabled)return;this.ef++;const i=performance.now();let e=(i-this.if)/10|0;e>250&&(e=250),this.if=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.cf(3),this.Qc?.p1(8),this.Qc?.p1(e),this.Qc?.p1(t)};static Dc=t=>{if(!this.enabled)return;this.ef++;const i=performance.now();let e=(i-this.if)/10|0;e>250&&(e=250),this.if=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.cf(3),this.Qc?.p1(9),this.Qc?.p1(e),this.Qc?.p1(t)};static Kc=()=>{if(!this.enabled)return;this.ef++;const t=performance.now();let i=(t-this.if)/10|0;i>250&&(i=250),this.if=t,this.cf(2),this.Qc?.p1(10),this.Qc?.p1(i)};static Xc=()=>{if(!this.enabled)return;this.ef++;const t=performance.now();let i=(t-this.if)/10|0;i>250&&(i=250),this.if=t,this.cf(2),this.Qc?.p1(11),this.Qc?.p1(i)};static Hc=()=>{if(!this.enabled)return;this.ef++;const t=performance.now();let i=(t-this.if)/10|0;i>250&&(i=250),this.if=t,this.cf(2),this.Qc?.p1(12),this.Qc?.p1(i)};static Yc=()=>{if(!this.enabled)return;this.ef++;const t=performance.now();let i=(t-this.if)/10|0;i>250&&(i=250),this.if=t,this.cf(2),this.Qc?.p1(13),this.Qc?.p1(i)};static cf=t=>{if(this.Qc&&this.Qc.lf+t>=500){const t=this.Qc;this.Qc=s.A.Ut(1),this.tf=t}}}},9091:(t,i,e)=>{e.d(i,{c:()=>n,g:()=>s});const s=['F11','F12'],n={'Backspace':{code:8,ch:8},'Enter':{code:10,ch:10},'Shift':{code:16,ch:65535},'Escape':{code:27,ch:27},'Tab':{code:9,ch:9},'CapsLock':{code:20,ch:65535},' ':{code:32,ch:32},'Control':{code:17,ch:65535},'Alt':{code:18,ch:65535},'Meta':{code:524,ch:65535},'ArrowLeft':{code:37,ch:65535},'ArrowRight':{code:39,ch:65535},'ArrowUp':{code:38,ch:65535},'ArrowDown':{code:40,ch:65535},'Insert':{code:155,ch:65535},'Home':{code:36,ch:65535},'PageUp':{code:33,ch:65535},'Delete':{code:127,ch:127},'End':{code:35,ch:65535},'PageDown':{code:34,ch:65535},'`':{code:192,ch:96},'~':{code:192,ch:126},'!':{code:49,ch:33},'@':{code:50,ch:64},'#':{code:51,ch:35},'$':{code:52,ch:36},'%':{code:53,ch:37},'^':{code:54,ch:94},'&':{code:55,ch:38},'*':{code:56,ch:42},'(':{code:57,ch:40},')':{code:48,ch:41},'-':{code:45,ch:45},'_':{code:45,ch:95},'=':{code:61,ch:61},'+':{code:61,ch:43},'[':{code:91,ch:91},'{':{code:91,ch:123},']':{code:93,ch:93},'}':{code:93,ch:125},'\\':{code:92,ch:92},'|':{code:92,ch:124},';':{code:59,ch:59},':':{code:59,ch:58},"'":{code:222,ch:39},'"':{code:222,ch:34},',':{code:44,ch:44},'<':{code:44,ch:60},'.':{code:46,ch:46},'>':{code:46,ch:62},'/':{code:47,ch:47},'?':{code:47,ch:63},'F1':{code:112,ch:65535},'F2':{code:113,ch:65535},'F3':{code:114,ch:65535},'F4':{code:115,ch:65535},'F5':{code:116,ch:65535},'F6':{code:117,ch:65535},'F7':{code:118,ch:65535},'F8':{code:119,ch:65535},'F9':{code:120,ch:65535},'F10':{code:121,ch:65535},'F11':{code:122,ch:65535},'F12':{code:123,ch:65535},0:{code:48,ch:48},1:{code:49,ch:49},2:{code:50,ch:50},3:{code:51,ch:51},4:{code:52,ch:52},5:{code:53,ch:53},6:{code:54,ch:54},7:{code:55,ch:55},8:{code:56,ch:56},9:{code:57,ch:57},'a':{code:65,ch:97},'b':{code:66,ch:98},'c':{code:67,ch:99},'d':{code:68,ch:100},'e':{code:69,ch:101},'f':{code:70,ch:102},'g':{code:71,ch:103},'h':{code:72,ch:104},'i':{code:73,ch:105},'j':{code:74,ch:106},'k':{code:75,ch:107},'l':{code:76,ch:108},'m':{code:77,ch:109},'n':{code:78,ch:110},'o':{code:79,ch:111},'p':{code:80,ch:112},'q':{code:81,ch:113},'r':{code:82,ch:114},'s':{code:83,ch:115},'t':{code:84,ch:116},'u':{code:85,ch:117},'v':{code:86,ch:118},'w':{code:87,ch:119},'x':{code:88,ch:120},'y':{code:89,ch:121},'z':{code:90,ch:122},'A':{code:65,ch:65},'B':{code:66,ch:66},'C':{code:67,ch:67},'D':{code:68,ch:68},'E':{code:69,ch:69},'F':{code:70,ch:70},'G':{code:71,ch:71},'H':{code:72,ch:72},'I':{code:73,ch:73},'J':{code:74,ch:74},'K':{code:75,ch:75},'L':{code:76,ch:76},'M':{code:77,ch:77},'N':{code:78,ch:78},'O':{code:79,ch:79},'P':{code:80,ch:80},'Q':{code:81,ch:81},'R':{code:82,ch:82},'S':{code:83,ch:83},'T':{code:84,ch:84},'U':{code:85,ch:85},'V':{code:86,ch:86},'W':{code:87,ch:87},'X':{code:88,ch:88},'Y':{code:89,ch:89},'Z':{code:90,ch:90}}},1120:(t,i,e)=>{e.d(i,{A:()=>c});var s=e(1069),n=e(8665),r=e(2679),h=e(2511),o=e(3819),a=e(3867),l=e(8950);class c{static Lo=[];static ff=null;static So=null;static Ea=0;static uf=1;static ba=2;static Ha=3;static Va=4;static il=5;static nl=6;static ul=7;static df=1;static wf=2;static yf=3;static mf=4;static Af=5;static Za=6;static yl=1;static ml=100;static Al=101;static pl=200;static pf=201;static gf=202;static gl=203;static If=205;static _f=300;static Cf=301;static Ef=302;static vf=303;static bf=304;static Tf=305;static Rf=306;static Of=307;static Lf=308;static Sf=309;static xf=310;static kf=311;static Mf=312;static Df=313;static Nf=314;static Ff=315;static Bf=316;static Uf=317;static Pf=318;static Gf=319;static Wf=320;static Hf=321;static Yf=322;static Vf=323;static Dl=324;static Nl=325;static Kf=326;static bl=327;static Il=401;static _l=500;static Xf=501;static jf=502;static vl=503;static Fl=600;static zf=601;static Zf=602;static qf=603;static $f=604;static Jf=605;static Qf=606;static tu=607;static iu=608;static eu=609;static su=610;static nu=611;static ru=612;static Bl=613;static Ul=650;static Wl=651;static Hl=652;static Yl=653;static Vl=654;static Pl=655;static hu=(t,i,e)=>{this.ff=new r.A(5e4),this.So=new r.A(5e4);const n=new s.A(t.read('data'));let h=-1;for(n.lf+=2;n.lf0){s.$o=new Uint8Array(r),s.Qo=new Uint16Array(r);for(let t=0;t0){s.scripts=new a.fe(o,null);for(let t=0;t0){const n=e.lastIndexOf(',');s.Wa[t]=this.yu(i,e.substring(0,n),parseInt(e.substring(n+1),10))}}s.mu=new a.fe(5,null);for(let t=0;t<5;t++){const i=n.wu;s.mu[t]=i,0===i.length&&(s.mu[t]=null)}}if(s.type===c.Ha&&(s.fill=1===n.lu),s.type===c.Va||s.type===c.uf){s.$a=1===n.lu;const t=n.lu;e&&(s.font=e[t]),s.Qa=1===n.lu}if(s.type===c.Va&&(s.text=n.wu,s.ja=n.wu),s.type!==c.uf&&s.type!==c.Ha&&s.type!==c.Va||(s.Ya=n.Ko),s.type!==c.Ha&&s.type!==c.Va||(s.Xa=n.Ko,s.Ka=n.Ko),s.type===c.il){const t=n.wu;if(t.length>0){const e=t.lastIndexOf(',');s.sl=this.yu(i,t.substring(0,e),parseInt(t.substring(e+1),10))}const e=n.wu;if(e.length>0){const t=e.lastIndexOf(',');s.el=this.yu(i,e.substring(0,t),parseInt(e.substring(t+1),10))}}if(s.type===c.nl){const t=n.lu;0!==t&&(s.model=this.al((t-1<<8)+n.lu));const i=n.lu;0!==i&&(s.Au=this.al((i-1<<8)+n.lu)),s.la=n.lu,0===s.la?s.la=-1:s.la=(s.la-1<<8)+n.lu,s.ca=n.lu,0===s.ca?s.ca=-1:s.ca=(s.ca-1<<8)+n.lu,s.zoom=n.ou,s.ol=n.ou,s.fl=n.ou}if(s.type===c.ul){s.Oa=new Int32Array(s.width*s.height),s.La=new Int32Array(s.width*s.height),s.$a=1===n.lu;const t=n.lu;e&&(s.font=e[t]),s.Qa=1===n.lu,s.Ya=n.Ko,s.Sa=n.fu,s.xa=n.fu,s.uu=1===n.lu,s.mu=new a.fe(5,null);for(let t=0;t<5;t++){const i=n.wu;s.mu[t]=i,0===i.length&&(s.mu[t]=null)}}s.za!==c.wf&&s.type!==c.ba||(s.pu=n.wu,s.action=n.wu,s.gu=n.ou),s.za!==c.df&&s.za!==c.mf&&s.za!==c.Af&&s.za!==c.Za||(s.Iu=n.wu,0===s.Iu.length&&(s.za===c.df?s.Iu='Ok':s.za===c.mf||s.za===c.Af?s.Iu='Select':s.za===c.Za&&(s.Iu='Continue')))}this.ff=null,this.So=null};static yu=(t,i,e)=>{const s=o.A._u(i)<<8n|BigInt(e);if(this.ff){const t=this.ff.get(s);if(t)return t}let n;try{n=h.A.Cu(t,i,e),this.ff?.put(s,n)}catch(t){return null}return n};static al=t=>{if(this.So){const i=this.So.get(BigInt(t));if(i)return i}const i=n.A.model(t);return this.So?.put(BigInt(t),i),i};id=-1;au=-1;type=-1;za=-1;_a=0;width=0;height=0;cu=-1;$o=null;Qo=null;scripts=null;scroll=0;hide=!1;draggable=!1;uu=!1;du=!1;Sa=0;xa=0;Ta=null;Ra=null;Wa=null;mu=null;fill=!1;$a=!1;font=null;Qa=!1;text=null;ja=null;Ya=0;Xa=0;Ka=0;sl=null;el=null;model=null;Au=null;la=-1;ca=-1;zoom=0;ol=0;fl=0;pu=null;action=null;gu=-1;Iu=null;aa=null;Aa=null;pa=null;x=0;y=0;va=0;Oa=null;La=null;ua=0;fa=0;al(t,i,e){let s=this.model;if(e&&(s=this.Au),!s)return null;if(-1===t&&-1===i&&!s.Eu)return s;const r=n.A.vu(s,!0,!0,!1);return-1===t&&-1===i||r.xl(),-1!==t&&r.kl(t),-1!==i&&r.kl(i),r.Ml(64,768,-50,-10,-50,!0),r}bu(){if(this.au===this.id)return this.x;let t=c.Lo[this.au];if(!t.aa||!t.Aa||!t.pa)return this.x;let i=t.aa.indexOf(this.id);if(-1===i)return this.x;let e=t.Aa[i];for(;t.au!==t.id;){const s=c.Lo[t.au];s.aa&&s.Aa&&s.pa&&(i=s.aa.indexOf(t.id),-1!==i&&(e+=s.Aa[i])),t=s}return e}Tu(){if(this.au===this.id)return this.y;let t=c.Lo[this.au];if(!t.aa||!t.Aa||!t.pa)return this.y;let i=t.aa.indexOf(this.id);if(-1===i)return this.y;let e=t.pa[i];for(;t.au!==t.id;){const s=c.Lo[t.au];s.aa&&s.Aa&&s.pa&&(i=s.aa.indexOf(t.id),-1!==i&&(e+=s.pa[i])),t=s}return e}outline(t){const i=this.bu(),e=this.Tu();l.A.ga(i,e,this.width,this.height,t)}move(t,i){if(this.au===this.id)return;this.x=0,this.y=0;const e=c.Lo[this.au];if(e.aa&&e.Aa&&e.pa){const s=e.aa.indexOf(this.id);-1!==s&&(e.Aa[s]=t,e.pa[s]=i)}}delete(){if(this.au===this.id)return;const t=c.Lo[this.au];if(t.aa&&t.Aa&&t.pa){const i=t.aa.indexOf(this.id);-1!==i&&(t.aa.splice(i,1),t.Aa.splice(i,1),t.pa.splice(i,1))}}}},6333:(t,i,e)=>{e.d(i,{$:()=>s});class s{id;Ru=null;constructor(t){this.id=t}Ou(t){for(;;){const i=t.lu;if(0===i)break;this.decode(i,t)}return this}}},2164:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(6333);class r extends n.${static count=0;static Lo=[];static hu=t=>{const i=new s.A(t.read('flo.dat'));this.count=i.ou;for(let t=0;t(e>179&&(i=i/2|0),e>192&&(i=i/2|0),e>217&&(i=i/2|0),e>243&&(i=i/2|0),(t/4<<10)+(i/32<<7)+(e/2|0));static Su=(t,i)=>-1===t?12345678:((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);static xu=(t,i)=>-2===t?12345678:-1===t?(i<0?i=0:i>127&&(i=127),127-i):((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);ku=0;texture=-1;Mu=!1;Du=!0;Nu=0;Fu=0;Bu=0;Uu=0;Pu=0;Gu=0;decode(t,i){1===t?(this.ku=i.Wu,this.setColor(this.ku)):2===t?this.texture=i.lu:3===t?this.Mu=!0:5===t?this.Du=!1:6===t?this.Ru=i.wu:console.log('Error unrecognised config code: ',t)}setColor(t){const i=(t>>16&255)/256,e=(t>>8&255)/256,s=(255&t)/256;let n=i;ei&&(h=e),s>h&&(h=s);let o=0,a=0;const l=(n+h)/2;n!==h&&(l<.5&&(a=(h-n)/(h+n)),l>=.5&&(a=(h-n)/(2-h-n)),i===h?o=(e-s)/(h-n):e===h?o=(s-i)/(h-n)+2:s===h&&(o=(i-e)/(h-n)+4)),o/=6,this.Nu=256*o|0,this.Fu=256*a|0,this.Bu=256*l|0,this.Fu<0?this.Fu=0:this.Fu>255&&(this.Fu=255),this.Bu<0?this.Bu=0:this.Bu>255&&(this.Bu=255),this.Uu=l>.5?(1-l)*a*512|0:l*a*512|0,this.Uu<1&&(this.Uu=1),this.Pu=o*this.Uu|0;let c=this.Nu+(16*Math.random()|0)-8;c<0?c=0:c>255&&(c=255);let f=this.Fu+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255);let u=this.Bu+(48*Math.random()|0)-24;u<0?u=0:u>255&&(u=255),this.Gu=r.Lu(c,f,u)}}},8317:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(1069),n=e(6333),r=e(8665),h=e(3867);class o extends n.${static count=0;static Lo=[];static hu=t=>{const i=new s.A(t.read('idk.dat'));this.count=i.ou;for(let t=0;t=40&&t<50)this.Vu[t-40]=i.ou;else if(t>=50&&t<60)this.Ku[t-50]=i.ou;else{if(!(t>=60&&t<70))throw new Error(`Unrecognized idk config code: ${t}`);this.Yu[t-60]=i.ou}}al(){if(!this.Hu)return null;const t=new h.fe(this.Hu.length,null);for(let i=0;i{e.d(i,{A:()=>c});var s=e(6333),n=e(1069),r=e(2679),h=e(8665),o=e(1023),a=e(6169),l=e(3867);class c extends s.${static count=0;static cache=null;static ju=null;static zu=null;static Zu=0;static qu=new r.A(500);static $u=new r.A(30);static hu=t=>{this.ju=new n.A(t.read('loc.dat'));const i=new n.A(t.read('loc.idx'));this.count=i.ou,this.zu=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.zu||!this.ju)throw new Error('LocType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Zu=(this.Zu+1)%10;const i=this.cache[this.Zu];return this.ju.lf=this.zu[t],i.id=t,i.reset(),i.Ou(this.ju),i.Ju||(i.Ju=new Int32Array(1)),-1===i.Qu&&i.Ju&&(i.active=i.Ju.length>0&&i.Ju[0]===o.A.td.id,i.ed&&(i.active=!0)),i};static To=()=>{this.qu=null,this.$u=null,this.zu=null,this.cache=null,this.ju=null};Hu=null;Ju=null;name=null;sd=null;Vu=null;Ku=null;width=1;length=1;nd=!0;rd=!0;active=!1;Qu=-1;hd=!1;od=!1;Du=!1;la=-1;ad=!1;ld=16;fd=0;ud=0;ed=null;dd=-1;wd=-1;yd=!1;md=!0;Ad=128;pd=128;gd=128;Id=0;_d=0;Cd=0;Ed=0;vd=!1;decode(t,i){if(1===t){const t=i.lu;this.Hu=new Int32Array(t),this.Ju=new Int32Array(t);for(let e=0;e=30&&t<39)this.ed||(this.ed=new l.fe(5,null)),this.ed[t-30]=i.wu,'hidden'===this.ed[t-30]?.toLowerCase()&&(this.ed[t-30]=null);else if(40===t){const t=i.lu;this.Vu=new Uint16Array(t),this.Ku=new Uint16Array(t);for(let e=0;e=this.Hu.length)return null;let d=this.Hu[l];if(-1===d)return null;const w=this.yd!==i>3;w&&(d+=65536);let y=c.qu?.get(BigInt(d));y||(y=h.A.model(65535&d),w&&y.kd(),c.qu?.put(BigInt(d),y));const m=128!==this.Ad||128!==this.pd||128!==this.gd,A=0!==this._d||0!==this.Cd||0!==this.Ed;let p=h.A.vu(y,!this.Vu,!this.ad,i===a.A.Md&&-1===o&&!m&&!A);for(-1!==o&&(p.xl(),p.kl(o),p.Dd=null,p.Nd=null);i-- >0;)p.Fd();if(this.Vu&&this.Ku)for(let t=0;t{e.d(i,{A:()=>n});var s=e(6333);class n extends s.${static count=0;static Lo=[];static hu=t=>{this.count=t.ou;for(let i=0;i=1&&t<5)this.Pd[t-1]=i.ou;else{if(250!==t)throw new Error(`Unrecognized mesanim config code: ${t}`);this.Ru=i.wu}}}},6948:(t,i,e)=>{e.d(i,{A:()=>a});var s=e(6333),n=e(1069),r=e(2679),h=e(8665),o=e(3867);class a extends s.${static count=0;static cache=null;static ju=null;static zu=null;static Zu=0;static So=new r.A(30);static hu=t=>{this.ju=new n.A(t.read('npc.dat'));const i=new n.A(t.read('npc.idx'));this.count=i.ou,this.zu=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.zu||!this.ju)throw new Error('NpcType not loaded!!!');for(let i=0;i<20;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Zu=(this.Zu+1)%20;const i=this.cache[this.Zu]=new a(t);return this.ju.lf=this.zu[t],i.Ou(this.ju),i};static To=()=>{this.So=null,this.zu=null,this.cache=null,this.ju=null};name=null;sd=null;size=1;Hu=null;Yu=null;ad=!1;Gd=-1;Wd=-1;Hd=-1;Yd=-1;Vd=-1;Vu=null;Ku=null;ed=null;Ad=-1;pd=-1;gd=-1;Kd=!0;Xd=-1;jd=128;zd=128;decode(t,i){if(1===t){const t=i.lu;this.Hu=new Uint16Array(t);for(let e=0;e=30&&t<40)this.ed||(this.ed=new o.fe(5,null)),this.ed[t-30]=i.wu,'hidden'===this.ed[t-30]?.toLowerCase()&&(this.ed[t-30]=null);else if(40===t){const t=i.lu;this.Vu=new Uint16Array(t),this.Ku=new Uint16Array(t);for(let e=0;e{e.d(i,{A:()=>u});var s=e(6333),n=e(1069),r=e(2511),h=e(2679),o=e(8665),a=e(4583),l=e(8950),c=e(9298),f=e(3867);class u extends s.${static count=0;static cache=null;static ju=null;static zu=null;static Zu=0;static tw=!0;static So=new h.A(50);static iw=new h.A(200);static hu=(t,i)=>{this.tw=i,this.ju=new n.A(t.read('obj.dat'));const e=new n.A(t.read('obj.idx'));this.count=e.ou,this.zu=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.zu||!this.ju)throw new Error('ObjType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Zu=(this.Zu+1)%10;const i=this.cache[this.Zu];return this.ju.lf=this.zu[t],i.id=t,i.reset(),i.Ou(this.ju),-1!==i.ew&&i.sw(),!this.tw&&i.members&&(i.name='Members Object',i.sd="Login to a members' server to use this object.",i.ed=null,i.nw=null),i};static To=()=>{this.So=null,this.iw=null,this.zu=null,this.cache=null,this.ju=null};static ka=(t,i)=>{if(u.iw){let e=u.iw.get(BigInt(t));if(e&&e.rw!==i&&-1!==e.rw&&(e.hw(),e=null),e)return e}let e=u.get(t);if(e.ow||(i=-1),e.ow&&e.aw&&i>1){let t=-1;for(let s=0;s<10;s++)i>=e.aw[s]&&0!==e.aw[s]&&(t=e.ow[s]);-1!==t&&(e=u.get(t))}const s=new r.A(32,32),n=a.A.rl,h=a.A.hl,o=a.A.lw,f=l.A.cw,d=l.A.fw,w=l.A.uw,y=l.A.left,m=l.A.right,A=l.A.top,p=l.A.bottom;a.A.dw=!1,l.A.bind(s.cw,32,32),l.A.fillRect(0,0,32,32,c.A.Pa),a.A.Tc();const g=e.ww(1),I=a.A.sin[e.yw]*e.mw>>16,_=a.A.cos[e.yw]*e.mw>>16;g.cl(0,e.Aw,e.pw,e.yw,e.gw,I+(g.Ud/2|0)+e.Iw,_+e.Iw);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.cw[t+32*i]&&(t>0&&s.cw[t+32*i-1]>1||i>0&&s.cw[t+32*(i-1)]>1||t<31&&s.cw[t+32*i+1]>1||i<31&&s.cw[t+32*(i+1)]>1)&&(s.cw[t+32*i]=1);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.cw[t+32*i]&&t>0&&i>0&&s.cw[t+32*(i-1)-1]>0&&(s.cw[t+32*i]=3153952);if(-1!==e.ew){const t=this.ka(e._w,10),i=t.Fa,s=t.rw;t.Fa=32,t.rw=32,t.Cw(5,5,22,22),t.Fa=i,t.rw=s}return u.iw?.put(BigInt(t),s),l.A.bind(f,d,w),l.A.ma(y,A,m,p),a.A.rl=n,a.A.hl=h,a.A.lw=o,a.A.dw=!0,e.dl?s.Fa=33:s.Fa=32,s.rw=i,s};model=0;name=null;sd=null;Vu=null;Ku=null;mw=2e3;yw=0;Aw=0;pw=0;gw=0;Iw=0;Ew=!1;bw=-1;dl=!1;Tw=1;members=!1;ed=null;nw=null;Rw=-1;Ow=-1;Lw=0;Sw=-1;xw=-1;kw=0;Mw=-1;Dw=-1;Nw=-1;Fw=-1;Bw=-1;Uw=-1;ow=null;aw=null;_w=-1;ew=-1;decode(t,i){if(1===t)this.model=i.ou;else if(2===t)this.name=i.wu;else if(3===t)this.sd=i.wu;else if(4===t)this.mw=i.ou;else if(5===t)this.yw=i.ou;else if(6===t)this.Aw=i.ou;else if(7===t)this.gw=i.fu,this.gw>32767&&(this.gw-=65536);else if(8===t)this.Iw=i.fu,this.Iw>32767&&(this.Iw-=65536);else if(9===t)this.Ew=!0;else if(10===t)this.bw=i.ou;else if(11===t)this.dl=!0;else if(12===t)this.Tw=i.Ko;else if(16===t)this.members=!0;else if(23===t)this.Rw=i.ou,this.Lw=i.bd;else if(24===t)this.Ow=i.ou;else if(25===t)this.Sw=i.ou,this.kw=i.bd;else if(26===t)this.xw=i.ou;else if(t>=30&&t<35)this.ed||(this.ed=new f.fe(5,null)),this.ed[t-30]=i.wu,'hidden'===this.ed[t-30]?.toLowerCase()&&(this.ed[t-30]=null);else if(t>=35&&t<40)this.nw||(this.nw=new f.fe(5,null)),this.nw[t-35]=i.wu;else if(40===t){const t=i.lu;this.Vu=new Uint16Array(t),this.Ku=new Uint16Array(t);for(let e=0;e=100&&t<110&&(this.ow&&this.aw||(this.ow=new Uint16Array(10),this.aw=new Uint16Array(10)),this.ow[t-100]=i.ou,this.aw[t-100]=i.ou)}Pw(t){let i=this.Rw;if(1===t&&(i=this.Sw),-1===i)return null;let e=this.Ow,s=this.Mw;1===t&&(e=this.xw,s=this.Dw);let n=o.A.model(i);if(-1!==e){const t=o.A.model(e);if(-1===s){const i=[n,t];n=o.A.Tl(i,2)}else{const i=[n,t,o.A.model(s)];n=o.A.Tl(i,3)}}if(0===t&&0!==this.Lw&&n.translate(this.Lw,0,0),1===t&&0!==this.kw&&n.translate(this.kw,0,0),this.Vu&&this.Ku)for(let t=0;t1){let i=-1;for(let e=0;e<10;e++)t>=this.aw[e]&&0!==this.aw[e]&&(i=this.ow[e]);if(-1!==i)return u.get(i).ww(1)}if(u.So){const t=u.So.get(BigInt(this.id));if(t)return t}const i=o.A.model(this.model);if(this.Vu&&this.Ku)for(let t=0;t{e.d(i,{A:()=>h});var s=e(6333),n=e(1069),r=e(6730);class h extends s.${static count=0;static Lo=[];static hu=t=>{const i=new n.A(t.read('seq.dat'));this.count=i.ou;for(let t=0;t{e.d(i,{A:()=>a});var s=e(6333),n=e(1069),r=e(1312),h=e(8665),o=e(2679);class a extends s.${static count=0;static Lo=[];static So=new o.A(30);static hu=t=>{const i=new n.A(t.read('spotanim.dat'));this.count=i.ou;for(let t=0;t=40&&t<50)this.Vu[t-40]=i.ou;else{if(!(t>=50&&t<60))throw new Error(`Unrecognized spotanim config code: ${t}`);this.Ku[t-50]=i.ou}}al(){let t=a.So?.get(BigInt(this.id));if(t)return t;t=h.A.model(this.model);for(let i=0;i<6;i++)0!==this.Vu[0]&&t.Rl(this.Vu[i],this.Ku[i]);return a.So?.put(BigInt(this.id),t),t}}},3764:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(6333),n=e(1069);class r extends s.${static count=0;static Lo=[];static Xw=[];static jw=0;static hu=t=>{const i=new n.A(t.read('varp.dat'));this.count=i.ou;for(let t=0;t{e.d(i,{A:()=>s});class s{static OPEN=0;static Qw=1;static ty=2;static iy=4;static ey=8;static sy=s.Qw<<4;static ny=s.ty<<4;static hy=s.iy<<4;static oy=s.ey<<4;static ly=256;static uy=512;static wy=1024;static yy=2048;static my=4096;static Ay=s.uy<<4;static py=s.wy<<4;static gy=s.yy<<4;static Iy=s.my<<4;static _y=s.ly<<9;static Cy=524288;static Ey=2097152;static vy=s.Ey|s.Cy;static by=s.ly|s.vy;static Ty=s.ty|s.by;static Ry=s.ey|s.by;static Oy=s.ty|s.iy|s.Ry;static Ly=s.ny|s.by;static Sy=s.ey|s.sy|s.Ly;static xy=s.oy|s.by;static ky=s.Qw|s.ty|s.xy;static My=s.ny|s.hy|s.xy;static Dy=16777215}},670:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(9456),n=e(6169),r=e(1023),h=e(4909);class o{static Dr=4;static jr=104;static index=(t,i)=>t*o.jr+i;offsetX;Ny;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.Ny=0,this.sizeX=o.jr,this.sizeZ=o.jr,this.flags=new Int32Array(this.sizeX*this.sizeZ),this.reset()}reset=()=>{for(let t=0;t{this.flags[o.index(t-this.offsetX,i-this.Ny)]|=s.A.Ey};By=(t,i)=>{this.flags[o.index(t-this.offsetX,i-this.Ny)]&=~s.A.Ey};Uy=(t,i,e,r,h,o)=>{let a=s.A.ly;o&&(a|=s.A._y);const l=t-this.offsetX,c=i-this.Ny;if(h===n.A.Py||h===n.A.Gy){const t=e;e=r,r=t}for(let t=l;t=0&&t=0&&i{let a=s.A.ly;o&&(a|=s.A._y);const l=t-this.offsetX,c=i-this.Ny;if(h===n.A.Py||h===n.A.Gy){const t=e;e=r,r=t}for(let t=l;t=0&&t=0&&i{const a=t-this.offsetX,l=i-this.Ny,c=o?s.A.Iy:s.A.oy,f=o?s.A.my:s.A.ey,u=o?s.A.wy:s.A.ty,d=o?s.A.py:s.A.ny,w=o?s.A.uy:s.A.Qw,y=o?s.A.Ay:s.A.sy,m=o?s.A.yy:s.A.iy,A=o?s.A.gy:s.A.hy;e===r.A.Yy.id?h===n.A.Md?(this.add(a,l,c),this.add(a-1,l,f)):h===n.A.Py?(this.add(a,l,u),this.add(a,l+1,d)):h===n.A.Vy?(this.add(a,l,f),this.add(a+1,l,c)):h===n.A.Gy&&(this.add(a,l,d),this.add(a,l-1,u)):e===r.A.Ky.id||e===r.A.Xy.id?h===n.A.Md?(this.add(a,l,w),this.add(a-1,l+1,y)):h===n.A.Py?(this.add(a,l,m),this.add(a+1,l+1,A)):h===n.A.Vy?(this.add(a,l,y),this.add(a+1,l-1,w)):h===n.A.Gy&&(this.add(a,l,A),this.add(a-1,l-1,m)):e===r.A.jy.id&&(h===n.A.Md?(this.add(a,l,u|c),this.add(a-1,l,f),this.add(a,l+1,d)):h===n.A.Py?(this.add(a,l,u|f),this.add(a,l+1,d),this.add(a+1,l,c)):h===n.A.Vy?(this.add(a,l,d|f),this.add(a+1,l,c),this.add(a,l-1,u)):h===n.A.Gy&&(this.add(a,l,d|c),this.add(a,l-1,u),this.add(a-1,l,f))),o&&this.Hy(t,i,e,h,!1)};zy=(t,i,e,h,o)=>{const a=t-this.offsetX,l=i-this.Ny,c=o?s.A.Iy:s.A.oy,f=o?s.A.my:s.A.ey,u=o?s.A.wy:s.A.ty,d=o?s.A.py:s.A.ny,w=o?s.A.uy:s.A.Qw,y=o?s.A.Ay:s.A.sy,m=o?s.A.yy:s.A.iy,A=o?s.A.gy:s.A.hy;e===r.A.Yy.id?h===n.A.Md?(this.remove(a,l,c),this.remove(a-1,l,f)):h===n.A.Py?(this.remove(a,l,u),this.remove(a,l+1,d)):h===n.A.Vy?(this.remove(a,l,f),this.remove(a+1,l,c)):h===n.A.Gy&&(this.remove(a,l,d),this.remove(a,l-1,u)):e===r.A.Ky.id||e===r.A.Xy.id?h===n.A.Md?(this.remove(a,l,w),this.remove(a-1,l+1,y)):h===n.A.Py?(this.remove(a,l,m),this.remove(a+1,l+1,A)):h===n.A.Vy?(this.remove(a,l,y),this.remove(a+1,l-1,w)):h===n.A.Gy&&(this.remove(a,l,A),this.remove(a-1,l-1,m)):e===r.A.jy.id&&(h===n.A.Md?(this.remove(a,l,u|c),this.remove(a-1,l,f),this.remove(a,l+1,d)):h===n.A.Py?(this.remove(a,l,u|f),this.remove(a,l+1,d),this.remove(a+1,l,c)):h===n.A.Vy?(this.remove(a,l,d|f),this.remove(a+1,l,c),this.remove(a,l-1,u)):h===n.A.Gy&&(this.remove(a,l,d|c),this.remove(a,l-1,u),this.remove(a-1,l,f))),o&&this.zy(t,i,e,h,!1)};Zy=(t,i,e,h,a,l)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.Ny,u=e-this.offsetX,d=h-this.Ny,w=o.index(c,f);if(a===r.A.Yy.id){if(l===n.A.Md){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Ly)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Ty)===s.A.OPEN)return!0}else if(l===n.A.Py){if(c===u&&f===d+1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Ry)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.xy)===s.A.OPEN)return!0}else if(l===n.A.Vy){if(c===u+1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Ly)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Ty)===s.A.OPEN)return!0}else if(l===n.A.Gy){if(c===u&&f===d-1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Ry)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.xy)===s.A.OPEN)return!0}}else if(a===r.A.jy.id){if(l===n.A.Md){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.xy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Ty)===s.A.OPEN)return!0}else if(l===n.A.Py){if(c===u-1&&f===d&&(this.flags[w]&s.A.Ry)===s.A.OPEN)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Ty)===s.A.OPEN)return!0}else if(l===n.A.Vy){if(c===u-1&&f===d&&(this.flags[w]&s.A.Ry)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Ly)===s.A.OPEN)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1)return!0}else if(l===n.A.Gy){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Ly)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.xy)===s.A.OPEN)return!0;if(c===u&&f===d-1)return!0}}else if(a===r.A.qy.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.ny)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.ty)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.ey)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.oy)===s.A.OPEN)return!0}return!1};$y=(t,i,e,h,a,l)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.Ny,u=e-this.offsetX,d=h-this.Ny,w=o.index(c,f);if(a===r.A.Jy.id||a===r.A.Qy.id){if(a===r.A.Qy.id&&(l=l+2&3),l===n.A.Md){if(c===u+1&&f===d&&(this.flags[w]&s.A.oy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.ty)===s.A.OPEN)return!0}else if(l===n.A.Py){if(c===u-1&&f===d&&(this.flags[w]&s.A.ey)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.ty)===s.A.OPEN)return!0}else if(l===n.A.Vy){if(c===u-1&&f===d&&(this.flags[w]&s.A.ey)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.ny)===s.A.OPEN)return!0}else if(l===n.A.Gy){if(c===u+1&&f===d&&(this.flags[w]&s.A.oy)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.ny)===s.A.OPEN)return!0}}else if(a===r.A.tm.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.ny)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.ty)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.ey)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.oy)===s.A.OPEN)return!0}return!1};im=(t,i,e,n,r,a,l)=>{const c=e+r-1,f=n+a-1,u=o.index(t-this.offsetX,i-this.Ny);return t>=e&&t<=c&&i>=n&&i<=f||(t===e-1&&i>=n&&i<=f&&(this.flags[u]&s.A.ey)===s.A.OPEN&&(l&h.A.Md)===s.A.OPEN||(t===c+1&&i>=n&&i<=f&&(this.flags[u]&s.A.oy)===s.A.OPEN&&(l&h.A.Vy)===s.A.OPEN||(i===n-1&&t>=e&&t<=c&&(this.flags[u]&s.A.ty)===s.A.OPEN&&(l&h.A.Gy)===s.A.OPEN||i===f+1&&t>=e&&t<=c&&(this.flags[u]&s.A.ny)===s.A.OPEN&&(l&h.A.Py)===s.A.OPEN)))};add=(t,i,e)=>{this.flags[o.index(t,i)]|=e};remove=(t,i,e)=>{this.flags[o.index(t,i)]&=s.A.Dy-e}}},4909:(t,i,e)=>{e.d(i,{A:()=>s});class s{static Py=1;static Vy=2;static Gy=4;static Md=8}},6169:(t,i,e)=>{e.d(i,{A:()=>s});class s{static Md=0;static Py=1;static Vy=2;static Gy=3}},5599:(t,i,e)=>{e.d(i,{A:()=>s});class s{static sm=0;static nm=1;static rm=2;static hm=3}},1023:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5599);class n{static Yy=new n(0,s.A.sm);static Ky=new n(1,s.A.sm);static jy=new n(2,s.A.sm);static Xy=new n(3,s.A.sm);static om=new n(4,s.A.nm);static am=new n(5,s.A.nm);static Jy=new n(6,s.A.nm);static Qy=new n(7,s.A.nm);static tm=new n(8,s.A.nm);static qy=new n(9,s.A.rm);static td=new n(10,s.A.rm);static lm=new n(11,s.A.rm);static fm=new n(12,s.A.rm);static um=new n(13,s.A.rm);static dm=new n(14,s.A.rm);static wm=new n(15,s.A.rm);static ym=new n(16,s.A.rm);static Am=new n(17,s.A.rm);static pm=new n(18,s.A.rm);static gm=new n(19,s.A.rm);static Im=new n(20,s.A.rm);static _m=new n(21,s.A.rm);static hm=new n(22,s.A.hm);static values(){return[this.Yy,this.Ky,this.Am,this.wm,this.jy,this.dm,this.qy,this.Xy,this.hm,this.fm,this.lm,this.Jy,this.Im,this.td,this.am,this.um,this.Qy,this.om,this.ym,this.tm,this.gm,this._m,this.pm]}static of(t){const i=this.values();for(let e=0;e{e.d(i,{A:()=>m});var s=e(670),n=e(2164),r=e(1069),h=e(4583),o=e(3045),a=e(5637),l=e(4197),c=e(1312),f=e(1023),u=e(6169),d=e(9298),w=e(5518),y=e(3867);class m{static Cm=Int8Array.of(1,2,4,8);static Em=Uint8Array.of(16,32,64,128);static vm=Int8Array.of(1,0,-1,0);static bm=Int8Array.of(0,-1,0,1);static Tm=(17*Math.random()|0)-8;static Rm=(33*Math.random()|0)-16;static et=!0;static Om=0;static Lm=!1;static Sm=(t,i)=>{let e=this.xm(t+45365,i+91923,4)+(this.xm(t+10294,i+37821,2)-128>>1)+(this.xm(t,i,1)-128>>2)-128;return e=35+(.3*e|0),e<10?e=10:e>60&&(e=60),e};static xm=(t,i,e)=>{const s=t/e|0,n=t&e-1,r=i/e|0,h=i&e-1,o=this.km(s,r),a=this.km(s+1,r),l=this.km(s,r+1),c=this.km(s+1,r+1),f=this.Mm(o,a,n,e),u=this.Mm(l,c,n,e);return this.Mm(f,u,h,e)};static Mm=(t,i,e,s)=>{const n=65536-h.A.cos[1024*e/s|0]>>1;return(t*(65536-n)>>16)+(i*n>>16)};static km=(t,i)=>((this.Dm(t-1,i-1)+this.Dm(t+1,i-1)+this.Dm(t-1,i+1)+this.Dm(t+1,i+1))/16|0)+((this.Dm(t-1,i)+this.Dm(t+1,i)+this.Dm(t,i-1)+this.Dm(t,i+1))/8|0)+(this.Dm(t,i)/4|0);static Dm=(t,i)=>{const e=t+57*i,s=BigInt(e<<13^e);return 255&Number((s*(s*s*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static Uy=(t,i,e,s,n,r,h,o,d,w,y)=>{const A=n[y][i][e],p=n[y][i+1][e],g=n[y][i+1][e+1],I=n[y][i][e+1],_=A+p+g+I>>2,C=a.A.get(o);let E=i+(e<<7)+(o<<14)+1073741824|0;C.active||(E+=-2147483648),E|=0;const v=(w<<6)+d<<24>>24;if(d===f.A.hm.id)s?.Nm(C.al(f.A.hm.id,w,A,p,g,I,-1),t,i,e,_,E,v),C.nd&&C.active&&h?.Fy(i,e),-1!==C.la&&r.Fm(new l.A(o,t,3,i,e,c.A.Lo[C.la],!0));else if(d===f.A.td.id||d===f.A.lm.id){const n=C.al(f.A.td.id,w,A,p,g,I,-1);if(n){let r,h,o=0;d===f.A.lm.id&&(o+=256),w===u.A.Py||w===u.A.Gy?(r=C.length,h=C.width):(r=C.width,h=C.length),s?.Uy(t,i,e,_,n,null,E,v,r,h,o)}C.nd&&h?.Uy(i,e,C.width,C.length,w,C.rd),-1!==C.la&&r.Fm(new l.A(o,t,2,i,e,c.A.Lo[C.la],!0))}else if(d>=f.A.fm.id)s?.Uy(t,i,e,_,C.al(d,w,A,p,g,I,-1),null,E,v,1,1,0),C.nd&&h?.Uy(i,e,C.width,C.length,w,C.rd),-1!==C.la&&r.Fm(new l.A(o,t,2,i,e,c.A.Lo[C.la],!0));else if(d===f.A.Yy.id)s?.Hy(t,i,e,_,m.Cm[w],0,C.al(f.A.Yy.id,w,A,p,g,I,-1),null,E,v),C.nd&&h?.Hy(i,e,d,w,C.rd),-1!==C.la&&r.Fm(new l.A(o,t,0,i,e,c.A.Lo[C.la],!0));else if(d===f.A.Ky.id)s?.Hy(t,i,e,_,m.Em[w],0,C.al(f.A.Ky.id,w,A,p,g,I,-1),null,E,v),C.nd&&h?.Hy(i,e,d,w,C.rd),-1!==C.la&&r.Fm(new l.A(o,t,0,i,e,c.A.Lo[C.la],!0));else if(d===f.A.jy.id){const n=w+1&3;s?.Hy(t,i,e,_,m.Cm[w],m.Cm[n],C.al(f.A.jy.id,w+4,A,p,g,I,-1),C.al(f.A.jy.id,n,A,p,g,I,-1),E,v),C.nd&&h?.Hy(i,e,d,w,C.rd),-1!==C.la&&r.Fm(new l.A(o,t,0,i,e,c.A.Lo[C.la],!0))}else if(d===f.A.Xy.id)s?.Hy(t,i,e,_,m.Em[w],0,C.al(f.A.Xy.id,w,A,p,g,I,-1),null,E,v),C.nd&&h?.Hy(i,e,d,w,C.rd),-1!==C.la&&r.Fm(new l.A(o,t,0,i,e,c.A.Lo[C.la],!0));else if(d===f.A.qy.id)s?.Uy(t,i,e,_,C.al(d,w,A,p,g,I,-1),null,E,v,1,1,0),C.nd&&h?.Uy(i,e,C.width,C.length,w,C.rd),-1!==C.la&&r.Fm(new l.A(o,t,2,i,e,c.A.Lo[C.la],!0));else if(d===f.A.om.id)s?.Bm(t,i,e,_,0,0,E,C.al(f.A.om.id,u.A.Md,A,p,g,I,-1),v,512*w,m.Cm[w]),-1!==C.la&&r.Fm(new l.A(o,t,1,i,e,c.A.Lo[C.la],!0));else if(d===f.A.am.id){let n=16;if(s){const r=s.Um(t,i,e);r>0&&(n=a.A.get(r>>14&32767).ld)}s?.Bm(t,i,e,_,m.vm[w]*n,m.bm[w]*n,E,C.al(f.A.om.id,u.A.Md,A,p,g,I,-1),v,512*w,m.Cm[w]),-1!==C.la&&r.Fm(new l.A(o,t,1,i,e,c.A.Lo[C.la],!0))}else d===f.A.Jy.id?(s?.Bm(t,i,e,_,0,0,E,C.al(f.A.om.id,u.A.Md,A,p,g,I,-1),v,w,256),-1!==C.la&&r.Fm(new l.A(o,t,1,i,e,c.A.Lo[C.la],!0))):d===f.A.Qy.id?(s?.Bm(t,i,e,_,0,0,E,C.al(f.A.om.id,u.A.Md,A,p,g,I,-1),v,w,512),-1!==C.la&&r.Fm(new l.A(o,t,1,i,e,c.A.Lo[C.la],!0))):d===f.A.tm.id&&(s?.Bm(t,i,e,_,0,0,E,C.al(f.A.om.id,u.A.Md,A,p,g,I,-1),v,w,768),-1!==C.la&&r.Fm(new l.A(o,t,1,i,e,c.A.Lo[C.la],!0)))};Pm;Gm;Yr;Vr;Wm;Hm;Ym;Vm;Km;Xm;jm;zm;Zm;qm;$m;Jm;constructor(t,i,e,n){this.Pm=t,this.Gm=i,this.Yr=e,this.Vr=n,this.Wm=new y.Qm(s.A.Dr,t,i),this.Hm=new y.Qm(s.A.Dr,t,i),this.Ym=new y.Qm(s.A.Dr,t,i),this.Vm=new y.Qm(s.A.Dr,t,i),this.Jm=new y.tA(s.A.Dr,t+1,i+1),this.Km=new y.Qm(s.A.Dr,t+1,i+1),this.Xm=new y.Xr(t+1,i+1),this.jm=new Int32Array(i),this.zm=new Int32Array(i),this.Zm=new Int32Array(i),this.qm=new Int32Array(i),this.$m=new Int32Array(i)}iA=(t,i)=>{for(let t=0;t=0&&i[s]?.Fy(e,n)}m.Tm+=(5*Math.random()|0)-2,m.Tm<-8?m.Tm=-8:m.Tm>8&&(m.Tm=8),m.Rm+=(5*Math.random()|0)-2,m.Rm<-16?m.Rm=-16:m.Rm>16&&(m.Rm=16);for(let i=0;i>8;for(let t=1;t>2)+(e[n+1][t]>>3)+(e[n][t-1]>>2)+(e[n][t+1]>>3)+(e[n][t]>>1);this.Xm[n][t]=u-d}for(let t=0;t=0&&s0){const i=n.A.Lo[e-1];this.jm[t]+=i.Pu,this.zm[t]+=i.Fu,this.Zm[t]+=i.Bu,this.qm[t]+=i.Uu,r=this.$m[t]++}}const h=e-5;if(h>=0&&h0){const i=n.A.Lo[e-1];this.jm[t]-=i.Pu,this.zm[t]-=i.Fu,this.Zm[t]-=i.Bu,this.qm[t]-=i.Uu,r=this.$m[t]--}}}if(e>=1&&e=0&&f=0&&y=1&&c0||y>0){const A=this.Yr[i][e][c],p=this.Yr[i][e+1][c],g=this.Yr[i][e+1][c+1],I=this.Yr[i][e][c+1],_=this.Xm[e][c],C=this.Xm[e+1][c],E=this.Xm[e+1][c+1],v=this.Xm[e][c+1];let b=-1,T=-1;if(f>0){const t=256*s/a|0,i=r/l|0;let e=o/l|0;b=n.A.Lu(t,i,e);const h=t+m.Tm&255;e+=m.Rm,e<0?e=0:e>255&&(e=255),T=n.A.Lu(h,i,e)}if(i>0){let t=0!==f||this.Ym[i][e][c]===w.A.sA;y>0&&!n.A.Lo[y-1].Du&&(t=!1),t&&A===p&&A===g&&A===I&&(this.Jm[i][e][c]|=2340)}let R=0;if(-1!==b&&(R=h.A.palette[n.A.Su(T,96)]),0===y)t?.nA(i,e,c,w.A.sA,u.A.Md,-1,A,p,g,I,n.A.Su(b,_),n.A.Su(b,C),n.A.Su(b,E),n.A.Su(b,v),d.A.Pa,d.A.Pa,d.A.Pa,d.A.Pa,R,d.A.Pa);else{const s=this.Ym[i][e][c]+1,r=this.Vm[i][e][c],o=n.A.Lo[y-1];let a,l,f=o.texture;f>=0?(l=h.A.rA(f),a=-1):o.ku===d.A.hA?(l=0,a=-2,f=-1):(a=n.A.Lu(o.Nu,o.Fu,o.Bu),l=h.A.palette[n.A.xu(o.Gu,96)]),t?.nA(i,e,c,s,r,f,A,p,g,I,n.A.Su(b,_),n.A.Su(b,C),n.A.Su(b,E),n.A.Su(b,v),n.A.xu(a,_),n.A.xu(a,C),n.A.xu(a,E),n.A.xu(a,v),R,l)}}}}}}for(let e=1;e0&&(t<<=3,i<<=3,e<<=3);for(let s=0;s<=n;s++)for(let r=0;r<=this.Gm;r++)for(let h=0;h<=this.Pm;h++){if(this.Jm[s][h][r]&t){let i=r,e=r,a=s,l=s;for(;i>0&&this.Jm[s][h][i-1]&t;)i--;for(;e0;){for(let s=i;s<=e;s++)if(!(this.Jm[a-1][h][s]&t))break t;a--}t:for(;l=8){const s=this.Yr[l][h][i]-240,r=this.Yr[a][h][i];o.A.cA(n,1,128*h,s,128*i,128*h,r,128*e+128);for(let s=a;s<=l;s++)for(let n=i;n<=e;n++)this.Jm[s][h][n]&=~t}}if(this.Jm[s][h][r]&i){let t=h,e=h,a=s,l=s;for(;t>0&&this.Jm[s][t-1][r]&i;)t--;for(;e0;){for(let s=t;s<=e;s++)if(!(this.Jm[a-1][s][r]&i))break t;a--}t:for(;l=8){const s=this.Yr[l][t][r]-240,h=this.Yr[a][t][r];o.A.cA(n,2,128*t,s,128*r,128*e+128,h,128*r);for(let s=a;s<=l;s++)for(let n=t;n<=e;n++)this.Jm[s][n][r]&=~i}}if(this.Jm[s][h][r]&e){let t=h,i=h,a=r,l=r;for(;a>0&&this.Jm[s][h][a-1]&e;)a--;for(;l0;){for(let i=a;i<=l;i++)if(!(this.Jm[s][t-1][i]&e))break t;t--}t:for(;i=4){const r=this.Yr[s][t][a];o.A.cA(n,4,128*t,r,128*a,128*i+128,r,128*l+128);for(let n=t;n<=i;n++)for(let t=a;t<=l;t++)this.Jm[s][n][t]&=~e}}}}}};fA=(t,i,e,r)=>{let h=0;for(let t=0;t>24;break}for(let n=t;n=0&&t=0&&n{const o=new r.A(new Uint8Array(h));for(let r=0;r=0&&l=0&&c>24,this.Vm[r][l][c]=(f-2&3)<<24>>24):f<=81?this.Vr[r][l][c]=f-49<<24>>24:this.Wm[r][l][c]=f-81<<24>>24}else for(;f=o.lu,0!==f;){if(1===f){o.lu;break}f<=49&&o.lu}}};dA=(t,i,e,n,h,o)=>{const a=new r.A(new Uint8Array(n));let l=-1;for(;;){const n=a.wA;if(0===n)return;l+=n;let r=0;for(;;){const n=a.wA;if(0===n)break;r+=n-1;const c=63&r,f=r>>6&63,u=r>>12,d=a.lu,w=d>>2,y=3&d,m=f+h,A=c+o;if(m>0&&A>0&&m=0&&(n=e[s]),this.Uy(u,m,A,t,i,n,l,w,y)}}}};Uy=(t,i,e,s,n,r,h,o,d)=>{if(m.et){if(16&this.Vr[t][i][e])return;if(this.eA(t,i,e)!==m.Om)return}const w=this.Yr[t][i][e],y=this.Yr[t][i+1][e],A=this.Yr[t][i+1][e+1],p=this.Yr[t][i][e+1],g=w+y+A+p>>2,I=a.A.get(h);let _=i+(e<<7)+(h<<14)+1073741824|0;I.active||(_+=-2147483648),_|=0;const C=(d<<6)+o<<24>>24;if(o===f.A.hm.id)(!m.et||I.active||I.vd)&&(s?.Nm(I.al(f.A.hm.id,d,w,y,A,p,-1),t,i,e,g,_,C),I.nd&&I.active&&r?.Fy(i,e),-1!==I.la&&n.Fm(new l.A(h,t,3,i,e,c.A.Lo[I.la],!0)));else if(o===f.A.td.id||o===f.A.lm.id){const a=I.al(f.A.td.id,d,w,y,A,p,-1);if(a){let n,r,h=0;if(o===f.A.lm.id&&(h+=256),d===u.A.Py||d===u.A.Gy?(n=I.length,r=I.width):(n=I.width,r=I.length),s?.Uy(t,i,e,g,a,null,_,C,n,r,h)&&I.md)for(let s=0;s<=n;s++)for(let n=0;n<=r;n++){let r=a.yA/4|0;r>30&&(r=30),r>this.Km[t][i+s][e+n]&&(this.Km[t][i+s][e+n]=r<<24>>24)}}I.nd&&r?.Uy(i,e,I.width,I.length,d,I.rd),-1!==I.la&&n.Fm(new l.A(h,t,2,i,e,c.A.Lo[I.la],!0))}else if(o>=f.A.fm.id)s?.Uy(t,i,e,g,I.al(o,d,w,y,A,p,-1),null,_,C,1,1,0),o>=f.A.fm.id&&o<=f.A.Am.id&&o!==f.A.um.id&&t>0&&(this.Jm[t][i][e]|=2340),I.nd&&r?.Uy(i,e,I.width,I.length,d,I.rd),-1!==I.la&&n.Fm(new l.A(h,t,2,i,e,c.A.Lo[I.la],!0));else if(o===f.A.Yy.id)s?.Hy(t,i,e,g,m.Cm[d],0,I.al(f.A.Yy.id,d,w,y,A,p,-1),null,_,C),d===u.A.Md?(I.md&&(this.Km[t][i][e]=50,this.Km[t][i][e+1]=50),I.Du&&(this.Jm[t][i][e]|=585)):d===u.A.Py?(I.md&&(this.Km[t][i][e+1]=50,this.Km[t][i+1][e+1]=50),I.Du&&(this.Jm[t][i][e+1]|=1170)):d===u.A.Vy?(I.md&&(this.Km[t][i+1][e]=50,this.Km[t][i+1][e+1]=50),I.Du&&(this.Jm[t][i+1][e]|=585)):d===u.A.Gy&&(I.md&&(this.Km[t][i][e]=50,this.Km[t][i+1][e]=50),I.Du&&(this.Jm[t][i][e]|=1170)),I.nd&&r?.Hy(i,e,o,d,I.rd),-1!==I.la&&n.Fm(new l.A(h,t,0,i,e,c.A.Lo[I.la],!0)),16!==I.ld&&s?.mA(t,i,e,I.ld);else if(o===f.A.Ky.id)s?.Hy(t,i,e,g,m.Em[d],0,I.al(f.A.Ky.id,d,w,y,A,p,-1),null,_,C),I.md&&(d===u.A.Md?this.Km[t][i][e+1]=50:d===u.A.Py?this.Km[t][i+1][e+1]=50:d===u.A.Vy?this.Km[t][i+1][e]=50:d===u.A.Gy&&(this.Km[t][i][e]=50)),I.nd&&r?.Hy(i,e,o,d,I.rd),-1!==I.la&&n.Fm(new l.A(h,t,0,i,e,c.A.Lo[I.la],!0));else if(o===f.A.jy.id){const a=d+1&3;s?.Hy(t,i,e,g,m.Cm[d],m.Cm[a],I.al(f.A.jy.id,d+4,w,y,A,p,-1),I.al(f.A.jy.id,a,w,y,A,p,-1),_,C),I.Du&&(d===u.A.Md?(this.Jm[t][i][e]|=265,this.Jm[t][i][e+1]|=1170):d===u.A.Py?(this.Jm[t][i][e+1]|=1170,this.Jm[t][i+1][e]|=585):d===u.A.Vy?(this.Jm[t][i+1][e]|=585,this.Jm[t][i][e]|=1170):d===u.A.Gy&&(this.Jm[t][i][e]|=1170,this.Jm[t][i][e]|=585)),I.nd&&r?.Hy(i,e,o,d,I.rd),-1!==I.la&&n.Fm(new l.A(h,t,0,i,e,c.A.Lo[I.la],!0)),16!==I.ld&&s?.mA(t,i,e,I.ld)}else if(o===f.A.Xy.id)s?.Hy(t,i,e,g,m.Em[d],0,I.al(f.A.Xy.id,d,w,y,A,p,-1),null,_,C),I.md&&(d===u.A.Md?this.Km[t][i][e+1]=50:d===u.A.Py?this.Km[t][i+1][e+1]=50:d===u.A.Vy?this.Km[t][i+1][e]=50:d===u.A.Gy&&(this.Km[t][i][e]=50)),I.nd&&r?.Hy(i,e,o,d,I.rd),-1!==I.la&&n.Fm(new l.A(h,t,0,i,e,c.A.Lo[I.la],!0));else if(o===f.A.qy.id)s?.Uy(t,i,e,g,I.al(o,d,w,y,A,p,-1),null,_,C,1,1,0),I.nd&&r?.Uy(i,e,I.width,I.length,d,I.rd),-1!==I.la&&n.Fm(new l.A(h,t,2,i,e,c.A.Lo[I.la],!0));else if(o===f.A.om.id)s?.Bm(t,i,e,g,0,0,_,I.al(f.A.om.id,u.A.Md,w,y,A,p,-1),C,512*d,m.Cm[d]),-1!==I.la&&n.Fm(new l.A(h,t,1,i,e,c.A.Lo[I.la],!0));else if(o===f.A.am.id){let r=16;if(s){const n=s.Um(t,i,e);n>0&&(r=a.A.get(n>>14&32767).ld)}s?.Bm(t,i,e,g,m.vm[d]*r,m.bm[d]*r,_,I.al(f.A.om.id,u.A.Md,w,y,A,p,-1),C,512*d,m.Cm[d]),-1!==I.la&&n.Fm(new l.A(h,t,1,i,e,c.A.Lo[I.la],!0))}else o===f.A.Jy.id?(s?.Bm(t,i,e,g,0,0,_,I.al(f.A.om.id,u.A.Md,w,y,A,p,-1),C,d,256),-1!==I.la&&n.Fm(new l.A(h,t,1,i,e,c.A.Lo[I.la],!0))):o===f.A.Qy.id?(s?.Bm(t,i,e,g,0,0,_,I.al(f.A.om.id,u.A.Md,w,y,A,p,-1),C,d,512),-1!==I.la&&n.Fm(new l.A(h,t,1,i,e,c.A.Lo[I.la],!0))):o===f.A.tm.id&&(s?.Bm(t,i,e,g,0,0,_,I.al(f.A.om.id,u.A.Md,w,y,A,p,-1),C,d,768),-1!==I.la&&n.Fm(new l.A(h,t,1,i,e,c.A.Lo[I.la],!0)))};eA=(t,i,e)=>8&this.Vr[t][i][e]?0:t<=0||!(2&this.Vr[1][i][e])?t:t-1}},3045:(t,i,e)=>{e.d(i,{A:()=>g});var s=e(4583),n=e(1161),r=e(3795),h=e(8256),o=e(670),a=e(9222),l=e(6855),c=e(7441),f=e(6666),u=e(5748),d=e(3479),w=e(8950),y=e(2771),m=e(5518),A=e(6169),p=e(3867);class g{static AA=new p.pA(8,32,51,51,!1);static gA=new p.fe(100,null);static IA=new Int32Array(o.A.Dr);static _A=new p.CA(o.A.Dr,500,null);static EA=new p.fe(500,null);static vA=new f.A;static bA=0;static TA=0;static RA=0;static OA=0;static LA=0;static SA=0;static xA=0;static kA=0;static MA=0;static DA=0;static NA=0;static FA=0;static BA=0;static UA=0;static PA=0;static GA=0;static WA=0;static HA=0;static YA=0;static VA=0;static KA=0;static XA=0;static jA=!1;static zA=null;static ZA=Uint8Array.of(19,55,38,155,255,110,137,205,76);static qA=Uint8Array.of(160,192,80,96,0,144,80,48,160);static $A=Uint8Array.of(76,8,137,4,0,1,38,2,19);static JA=Int8Array.of(0,0,2,0,0,2,1,1,0);static QA=Int8Array.of(2,0,0,2,0,0,0,4,4);static tp=Int8Array.of(0,4,4,8,0,0,8,0,0);static ip=Int8Array.of(1,1,0,0,0,8,0,0,8);static ep=Int8Array.of(53,-53,-53,53);static sp=Int8Array.of(-53,-53,53,53);static np=Int8Array.of(-45,45,45,-45);static rp=Int8Array.of(45,45,-45,-45);static hp=[new Int8Array(16),Int8Array.of(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,0,0,0,1,1,0,0,1,1,1,0,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1),Int8Array.of(0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0),Int8Array.of(0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0),Int8Array.of(1,1,1,1,1,1,1,1,0,1,1,1,0,0,1,1),Int8Array.of(1,1,1,1,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,0,0,0,0,1,1,0,1,1,1,0,1,1,1),Int8Array.of(0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1)];static op=[Int8Array.of(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),Int8Array.of(12,8,4,0,13,9,5,1,14,10,6,2,15,11,7,3),Int8Array.of(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0),Int8Array.of(3,7,11,15,2,6,10,14,1,5,9,13,0,4,8,12)];static ap=Int32Array.of(41,39248,41,4643,41,41,41,41,41,41,41,41,41,41,41,43086,41,41,41,41,41,41,41,8602,41,28992,41,41,41,41,41,5056,41,41,41,41,41,41,41,41,41,41,41,41,41,41,3131,41,41,41);static lp=0;static Ma=0;static Da=0;static cp=-1;static fp=-1;static et=!0;static init=(t,i,e,n,r)=>{this.TA=0,this.RA=0,this.OA=t,this.LA=i,this.SA=t/2|0,this.xA=i/2|0;const h=new p.pA(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let i=0;i<2048;i+=64){this.kA=s.A.sin[t],this.MA=s.A.cos[t],this.DA=s.A.sin[i],this.NA=s.A.cos[i];const o=(t-128)/32|0,a=i/64|0;for(let t=-26;t<=26;t++)for(let i=-26;i<=26;i++){const s=128*t,l=128*i;let c=!1;for(let t=-e;t<=n;t+=128)if(this.up(s,l,r[o]+t)){c=!0;break}h[o][a][t+25+1][i+25+1]=c}}for(let t=0;t<8;t++)for(let i=0;i<32;i++)for(let e=-25;e<25;e++)for(let s=-25;s<25;s++){let n=!1;t:for(let r=-1;r<=1;r++)for(let o=-1;o<=1;o++){if(h[t][i][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t][(i+1)%31][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][i][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][(i+1)%31][e+r+25+1][s+o+25+1]){n=!0;break t}}this.AA[t][i][e+25][s+25]=n}};static To=()=>{this.gA=null,this.IA=null,this._A=null,this.vA=null,this.AA=null,this.EA=null,this.zA=null,console.log('World3D unloaded!')};static cA=(t,i,e,s,n,r,o,a)=>{g._A[t][g.IA[t]++]=new h.A(e/128|0,r/128|0,n/128|0,a/128|0,i,e,r,n,a,s,o)};static up=(t,i,e)=>{const s=i*this.DA+t*this.NA>>16,n=i*this.NA-t*this.DA>>16,r=e*this.kA+n*this.MA>>16,h=e*this.MA-n*this.kA>>16;if(r<50||r>3500)return!1;const o=this.SA+((s<<9)/r|0),a=this.xA+((h<<9)/r|0);return o>=this.TA&&o<=this.OA&&a>=this.RA&&a<=this.LA};dp;Pm;Gm;wp;yp;_h;mp;Ap;pp;gp=0;Ip=0;_p=0;constructor(t,i,e,s){this.dp=e,this.Pm=s,this.Gm=i,this.yp=new p.Eh(e,s,i,null),this.mp=new p.tA(e,s+1,i+1),this.wp=t,this._h=new p.fe(5e3,null),this.Ap=new Int32Array(1e4),this.pp=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this.Ip=t;for(let i=0;i{const e=this.yp[0][t][i];for(let e=0;e<3;e++){this.yp[e][t][i]=this.yp[e+1][t][i];const s=this.yp[e][t][i];s&&s.level--}this.yp[0][t][i]||(this.yp[0][t][i]=new r.A(0,t,i));const s=this.yp[0][t][i];s&&(s.Ep=e),this.yp[3][t][i]=null};oA=(t,i,e,s)=>{const n=this.yp[t][i][e];n&&(n.vp=s)};nA=(t,i,e,s,n,h,o,a,l,c,f,u,w,A,p,g,I,_,C,E)=>{if(s===m.A.sA){for(let s=t;s>=0;s--)this.yp[s][i][e]||(this.yp[s][i][e]=new r.A(s,i,e));const s=this.yp[t][i][e];s&&(s.bp=new d.A(f,u,w,A,-1,C,!1))}else if(s===m.A.Tp){for(let s=t;s>=0;s--)this.yp[s][i][e]||(this.yp[s][i][e]=new r.A(s,i,e));const s=this.yp[t][i][e];s&&(s.bp=new d.A(p,g,I,_,h,E,o===a&&o===l&&o===c))}else{for(let s=t;s>=0;s--)this.yp[s][i][e]||(this.yp[s][i][e]=new r.A(s,i,e));const d=this.yp[t][i][e];d&&(d.Rp=new y.A(i,s,g,a,w,n,f,c,E,p,h,_,C,l,I,A,o,e,u))}};Nm=(t,i,e,s,n,h,o)=>{this.yp[i][e][s]||(this.yp[i][e][s]=new r.A(i,e,s));const l=this.yp[i][e][s];l&&(l.Op=new a.A(n,128*e+64,128*s+64,t,h,o))};Lp=(t,i,e)=>{const s=this.yp[t][i][e];s&&(s.Op=null)};Sp=(t,i,e,s,n,h,o,a)=>{let l=0;const c=this.yp[s][t][i];if(c)for(let t=0;tl&&(l=e)}else this.yp[s][t][i]=new r.A(s,t,i);const f=this.yp[s][t][i];f&&(f.Mp=new u.A(e,128*t+64,128*i+64,h,o,a,n,l))};Dp=(t,i,e)=>{const s=this.yp[t][i][e];s&&(s.Mp=null)};Hy=(t,i,e,s,n,h,o,a,c,f)=>{if(!o&&!a)return;for(let s=t;s>=0;s--)this.yp[s][i][e]||(this.yp[s][i][e]=new r.A(s,i,e));const u=this.yp[t][i][e];u&&(u.Np=new l.A(s,128*i+64,128*e+64,n,h,o,a,c,f))};zy=(t,i,e,s)=>{const n=this.yp[t][i][e];1===s&&n&&(n.Np=null)};Bm=(t,i,e,s,n,h,o,a,l,f,u)=>{if(!a)return;for(let s=t;s>=0;s--)this.yp[s][i][e]||(this.yp[s][i][e]=new r.A(s,i,e));const d=this.yp[t][i][e];d&&(d.Fp=new c.A(s,128*i+n+64,128*e+h+64,u,f,a,o,l))};Bp=(t,i,e)=>{const s=this.yp[t][i][e];s&&(s.Fp=null)};mA=(t,i,e,s)=>{const n=this.yp[t][i][e];if(!n)return;const r=n.Fp;if(!r)return;const h=128*i+64,o=128*e+64;r.x=h+((r.x-h)*s/16|0),r.z=o+((r.z-o)*s/16|0)};Up=(t,i,e,s)=>{if(!s)return;const n=this.yp[t][i][e];if(!n)return;const r=n.Fp;r&&(r.model=s)};Pp=(t,i,e,s)=>{if(!s)return;const n=this.yp[t][i][e];if(!n)return;const r=n.Op;r&&(r.model=s)};Gp=(t,i,e,s)=>{if(!s)return;const n=this.yp[t][i][e];if(!n)return;const r=n.Np;r&&(r.Wp=s)};Hp=(t,i,e,s,n)=>{if(!s)return;const r=this.yp[e][t][i];if(!r)return;const h=r.Np;h&&(h.Wp=s,h.Yp=n)};Uy=(t,i,e,s,n,r,h,o,a,l,c)=>{if(!n&&!r)return!0;const f=128*i+64*a,u=128*e+64*l;return this.Vp(f,u,s,t,i,e,a,l,n,r,h,o,c,!1)};Kp=(t,i,e,s,n,r,h,o,a,l)=>{if(!n&&!r)return!0;let c=i-a,f=s-a,u=i+a,d=s+a;return l&&(o>640&&o<1408&&(d+=128),o>1152&&o<1920&&(u+=128),(o>1664||o<384)&&(f-=128),o>128&&o<896&&(c-=128)),c=c/128|0,f=f/128|0,u=u/128|0,d=d/128|0,this.Vp(i,s,e,t,c,f,u+1-c,d-f+1,n,r,h,0,o,!0)};Xp=(t,i,e,s,n,r,h,o,a,l,c,f)=>!a&&!l||this.Vp(i,s,e,t,n,r,h+1-n,o-r+1,a,l,c,0,f,!0);Wy=(t,i,e)=>{const s=this.yp[t][i][e];if(s)for(let t=0;t>29&3)&&n.zp===i&&n.Zp===e)return void this.qp(n)}};$p=(t,i,e,s)=>{if(!s)return;const n=this.yp[t][i][e];if(n)for(let t=0;t>29&3))return void(i.model=s)}};Jp=()=>{for(let t=0;t{const s=this.yp[t][i][e];return s&&s.Np?s.Np.jp:0};Qp=(t,i,e)=>{const s=this.yp[t][e][i];return s&&s.Fp?s.Fp.jp:0};tg=(t,i,e)=>{const s=this.yp[t][i][e];if(!s)return 0;for(let t=0;t>29&3)&&n.zp===i&&n.Zp===e)return n.jp}return 0};ig=(t,i,e)=>{const s=this.yp[t][i][e];return s&&s.Op?s.Op.jp:0};eg=(t,i,e,s)=>{const n=this.yp[t][i][e];if(n){if(n.Np&&n.Np.jp===s)return 255&n.Np.info;if(n.Fp&&n.Fp.jp===s)return 255&n.Fp.info;if(n.Op&&n.Op.jp===s)return 255&n.Op.info;for(let t=0;t{const r=i*(0|Math.sqrt(e*e+s*s+n*n))>>8;for(let i=0;i{if(i0){const n=this.yp[t][i+1][e-1];n&&n.Op&&n.Op.model&&n.Op.model.sg&&this.rg(s,n.Op.model,128,0,-128,!0)}};ng=(t,i,e,s,n,r)=>{let h=!0,o=i;const a=i+s,l=e-1,c=e+n;for(let f=t;f<=t+1;f++)if(f!==this.dp){for(let u=o;u<=a;u++)if(!(u<0||u>=this.Pm))for(let o=l;o<=c;o++){if(o<0||o>=this.Gm||h&&u=e||u===i))continue;const l=this.yp[f][u][o];if(!l)continue;const d=128*(u-i)+64*(1-s),w=128*(o-e)+64*(1-n),y=((this.wp[f][u][o]+this.wp[f][u+1][o]+this.wp[f][u][o+1]+this.wp[f][u+1][o+1])/4|0)-((this.wp[t][i][e]+this.wp[t][i+1][e]+this.wp[t][i][e+1]+this.wp[t][i+1][e+1])/4|0),m=l.Np;m&&m.Wp&&m.Wp.sg&&this.rg(r,m.Wp,d,y,w,h),m&&m.Yp&&m.Yp.sg&&this.rg(r,m.Yp,d,y,w,h);for(let t=0;t{this._p++;let h=0;const o=i.Od,a=i.Rd;if(t.sg&&t.cg)for(let r=0;ri.fg)continue;const u=t.Od[r]-e;if(ui.dg)continue;const d=t.Ld[r]-n;if(di.yg)continue;if(i.sg&&i.cg)for(let t=0;t{const h=this.yp[t][i][e];if(!h)return;const o=h.bp;if(o){const t=o.color;if(0!==t)for(let i=0;i<4;i++)s[n]=t,s[n+1]=t,s[n+2]=t,s[n+3]=t,n+=r;return}const a=h.Rp;if(!a)return;const l=a.shape,c=a.angle,f=a.Cg,u=a.Eg,d=g.hp[l],w=g.op[c];let y=0;if(0===f)for(let t=0;t<4;t++)0!==d[w[y++]]&&(s[n]=u),0!==d[w[y++]]&&(s[n+1]=u),0!==d[w[y++]]&&(s[n+2]=u),0!==d[w[y++]]&&(s[n+3]=u),n+=r;else for(let t=0;t<4;t++)s[n]=0===d[w[y++]]?f:u,s[n+1]=0===d[w[y++]]?f:u,s[n+2]=0===d[w[y++]]?f:u,s[n+3]=0===d[w[y++]]?f:u,n+=r};click=(t,i)=>{g.jA=!0,g.Ma=t,g.Da=i,g.cp=-1,g.fp=-1};draw=(t,i,e,n,r,h,o)=>{t<0?t=0:t>=128*this.Pm&&(t=128*this.Pm-1),e<0?e=0:e>=128*this.Gm&&(e=128*this.Gm-1),g.bA++,g.kA=s.A.sin[h],g.MA=s.A.cos[h],g.DA=s.A.sin[r],g.NA=s.A.cos[r],g.zA=g.AA[(h-128)/32|0][r/64|0],g.FA=t,g.BA=i,g.UA=e,g.PA=t/128|0,g.GA=e/128|0,g.KA=n,g.WA=g.PA-25,g.WA<0&&(g.WA=0),g.YA=g.GA-25,g.YA<0&&(g.YA=0),g.HA=g.PA+25,g.HA>this.Pm&&(g.HA=this.Pm),g.VA=g.GA+25,g.VA>this.Gm&&(g.VA=this.Gm),this.vg(),g.XA=0;for(let t=this.Ip;t=2e3)?(h.visible=!0,h.update=!0,h.bg=h.xp>0,g.XA++):(h.visible=!1,h.update=!1,h.Tg=0))}}for(let t=this.Ip;t=g.HA))for(let t=-25;t<=0;t++){const n=g.GA+t,r=g.GA-t;let h;if(e>=g.WA&&(n>=g.YA&&(h=i[e][n],h&&h.visible&&this.Rg(h,!0,o)),r=g.YA&&(h=i[s][n],h&&h.visible&&this.Rg(h,!0,o)),r=g.HA))for(let t=-25;t<=0;t++){const n=g.GA+t,r=g.GA-t;let h;if(e>=g.WA&&(n>=g.YA&&(h=i[e][n],h&&h.visible&&this.Rg(h,!1,o)),r=g.YA&&(h=i[s][n],h&&h.visible&&this.Rg(h,!1,o)),r{if(!c&&!f)return!1;for(let t=h;t=this.Pm||i>=this.Gm)return!1;const e=this.yp[s][t][i];if(e&&e.xp>=5)return!1}const m=new n.A(s,e,t,i,c,f,w,h,h+a-1,o,o+l-1,u,d);for(let t=h;th&&(e|=1),to&&(e+=8),i=0;e--)this.yp[e][t][i]||(this.yp[e][t][i]=new r.A(e,t,i));const n=this.yp[s][t][i];n&&(n.kp[n.xp]=m,n.Og[n.xp]=e,n.Lg|=e,n.xp++)}return y&&(this._h[this.gp++]=m),!0};qp=t=>{for(let i=t.zp;i<=t.og;i++)for(let e=t.Zp;e<=t.ag;e++){const s=this.yp[t.level][i][e];if(s){for(let i=0;i{const t=g.IA[g.KA],i=g._A[g.KA];g.lp=0;for(let e=0;e=0&&s<=50){n=t.xg+25-g.GA,n<0&&(n=0),r=t.Gm+25-g.GA,r>50&&(r=50);let i=!1;for(;n<=r;)if(g.zA&&g.zA[s][n++]){i=!0;break}if(i){if(h=g.FA-t.ug,h>32)t.mode=1;else{if(h>=-32)continue;t.mode=2,h=-h}t.kg=(t.wg-g.UA<<8)/h|0,t.Mg=(t.yg-g.UA<<8)/h|0,t.Dg=(t.fg-g.BA<<8)/h|0,t.Ng=(t.Ud-g.BA<<8)/h|0,g.EA[g.lp++]=t}}}else if(2===t.type){if(s=t.xg+25-g.GA,s>=0&&s<=50){n=t.Sg+25-g.PA,n<0&&(n=0),r=t.Pm+25-g.PA,r>50&&(r=50);let i=!1;for(;n<=r;)if(g.zA&&g.zA[n++][s]){i=!0;break}if(i){if(h=g.UA-t.wg,h>32)t.mode=3;else{if(h>=-32)continue;t.mode=4,h=-h}t.Fg=(t.ug-g.FA<<8)/h|0,t.Bg=(t.dg-g.FA<<8)/h|0,t.Dg=(t.fg-g.BA<<8)/h|0,t.Ng=(t.Ud-g.BA<<8)/h|0,g.EA[g.lp++]=t}}}else if(4===t.type&&(s=t.fg-g.BA,s>128&&(n=t.xg+25-g.GA,n<0&&(n=0),r=t.Gm+25-g.GA,r>50&&(r=50),n<=r))){let i=t.Sg+25-g.PA;i<0&&(i=0),h=t.Pm+25-g.PA,h>50&&(h=50);let e=!1;t:for(let t=i;t<=h;t++)for(let i=n;i<=r;i++)if(g.zA&&g.zA[t][i]){e=!0;break t}e&&(t.mode=5,t.Fg=(t.ug-g.FA<<8)/s|0,t.Bg=(t.dg-g.FA<<8)/s|0,t.kg=(t.wg-g.UA<<8)/s|0,t.Mg=(t.yg-g.UA<<8)/s|0,g.EA[g.lp++]=t)}}};Rg=(t,i,e)=>{for(g.vA.Fm(t);;){let t;do{if(t=g.vA.Ug(),!t)return}while(!t.update);const s=t.x,n=t.z,r=t.level,h=t.Pg,o=this.yp[r];if(t.visible){if(i){if(r>0){const t=this.yp[r-1][s][n];if(t&&t.update)continue}if(s<=g.PA&&s>g.WA){const i=o[s-1][n];if(i&&i.update&&(i.visible||!(1&t.Lg)))continue}if(s>=g.PA&&sg.YA){const i=o[s][n-1];if(i&&i.update&&(i.visible||!(8&t.Lg)))continue}if(n>=g.GA&&nn&&(l+=6),c=g.ZA[l],t.Kg=g.$A[l]),f&&(f.Xg&g.qA[l]?16===f.Xg?(t.Tg=3,t.jg=g.JA[l],t.zg=3-t.jg):32===f.Xg?(t.Tg=6,t.jg=g.QA[l],t.zg=6-t.jg):64===f.Xg?(t.Tg=12,t.jg=g.tp[l],t.zg=12-t.jg):(t.Tg=9,t.jg=g.ip[l],t.zg=9-t.jg):t.Tg=0,f.Xg&c&&!this.Zg(h,s,n,f.Xg)&&f.Wp?.draw(0,g.kA,g.MA,g.DA,g.NA,f.x-g.FA,f.y-g.BA,f.z-g.UA,f.jp),f.qg&c&&!this.Zg(h,s,n,f.qg)&&f.Yp?.draw(0,g.kA,g.MA,g.DA,g.NA,f.x-g.FA,f.y-g.BA,f.z-g.UA,f.jp)),u&&!this.visible(h,s,n,u.model.Ud))if(u.type&c)u.model.draw(u.angle,g.kA,g.MA,g.DA,g.NA,u.x-g.FA,u.y-g.BA,u.z-g.UA,u.jp);else if(768&u.type){const t=u.x-g.FA,i=u.y-g.BA,e=u.z-g.UA,s=u.angle;let n,r;if(n=s===A.A.Py||s===A.A.Vy?-t:t,r=s===A.A.Vy||s===A.A.Gy?-e:e,256&u.type&&rn){const n=t+g.np[s],r=e+g.rp[s];u.model.draw(512*s+1280&2047,g.kA,g.MA,g.DA,g.NA,n,i,r,u.jp)}}if(a){const i=t.Op;i&&i.model?.draw(0,g.kA,g.MA,g.DA,g.NA,i.x-g.FA,i.y-g.BA,i.z-g.UA,i.jp);const e=t.Mp;e&&0===e.offset&&(e.$g&&e.$g.draw(0,g.kA,g.MA,g.DA,g.NA,e.x-g.FA,e.y-g.BA,e.z-g.UA,e.jp),e.Jg&&e.Jg.draw(0,g.kA,g.MA,g.DA,g.NA,e.x-g.FA,e.y-g.BA,e.z-g.UA,e.jp),e.Qg&&e.Qg.draw(0,g.kA,g.MA,g.DA,g.NA,e.x-g.FA,e.y-g.BA,e.z-g.UA,e.jp))}const d=t.Lg;if(0!==d){if(sg.PA&&1&d){const t=o[s-1][n];t&&t.update&&g.vA.Fm(t)}if(n>g.GA&&8&d){const t=o[s][n-1];t&&t.update&&g.vA.Fm(t)}}}if(0!==t.Tg){let i=!0;for(let e=0;ei.zp&&(r+=1),ei.Zp&&(r+=8),ss&&(s=n);const h=g.GA-i.Zp,a=i.ag-g.GA;i.tI=a>h?s+a:s+h}for(;;){let t=-50,i=-1;for(let e=0;et&&(t=s.tI,i=e))}if(-1===i)break;const a=g.gA[i];if(a){a.bA=g.bA;let t=a.model;t||(t=a.Yg?.draw(e)??null),t&&!this.iI(h,a.zp,a.og,a.Zp,a.ag,t.Ud)&&t.draw(a.Vg,g.kA,g.MA,g.DA,g.NA,a.x-g.FA,a.y-g.BA,a.z-g.UA,a.jp);for(let t=a.zp;t<=a.og;t++)for(let i=a.Zp;i<=a.ag;i++){const e=o[t][i];e&&(0!==e.Tg?g.vA.Fm(e):t===s&&i===n||!e.update||g.vA.Fm(e))}}}if(t.bg)continue}if(!t.update||0!==t.Tg)continue;if(s<=g.PA&&s>g.WA){const t=o[s-1][n];if(t&&t.update)continue}if(s>=g.PA&&sg.YA){const t=o[s][n-1];if(t&&t.update)continue}if(n>=g.GA&&n=r){const r=t+g.ep[n],h=s+g.sp[n];i.model.draw(512*n+256,g.kA,g.MA,g.DA,g.NA,r,e,h,i.jp)}if(512&i.type&&h<=r){const r=t+g.np[n],h=s+g.rp[n];i.model.draw(512*n+1280&2047,g.kA,g.MA,g.DA,g.NA,r,e,h,i.jp)}}const e=t.Np;e&&(e.qg&t.Kg&&!this.Zg(h,s,n,e.qg)&&e.Yp?.draw(0,g.kA,g.MA,g.DA,g.NA,e.x-g.FA,e.y-g.BA,e.z-g.UA,e.jp),e.Xg&t.Kg&&!this.Zg(h,s,n,e.Xg)&&e.Wp?.draw(0,g.kA,g.MA,g.DA,g.NA,e.x-g.FA,e.y-g.BA,e.z-g.UA,e.jp))}if(rg.PA){const t=o[s-1][n];t&&t.update&&g.vA.Fm(t)}if(n>g.GA){const t=o[s][n-1];t&&t.update&&g.vA.Fm(t)}}};Wg=(t,i,e,n,r,h,o,a)=>{let l,c,f,u,d=l=(e<<7)-g.FA,y=c=(n<<7)-g.UA,m=f=d+128,A=u=y+128,p=this.wp[i][e][n]-g.BA,I=this.wp[i][e+1][n]-g.BA,_=this.wp[i][e+1][n+1]-g.BA,C=this.wp[i][e][n+1]-g.BA,E=y*o+d*a>>16;if(y=y*a-d*o>>16,d=E,E=p*h-y*r>>16,y=p*r+y*h>>16,p=E,y<50)return;if(E=c*o+m*a>>16,c=c*a-m*o>>16,m=E,E=I*h-c*r>>16,c=I*r+c*h>>16,I=E,c<50)return;if(E=A*o+f*a>>16,A=A*a-f*o>>16,f=E,E=_*h-A*r>>16,A=_*r+A*h>>16,_=E,A<50)return;if(E=u*o+l*a>>16,u=u*a-l*o>>16,l=E,E=C*h-u*r>>16,u=C*r+u*h>>16,C=E,u<50)return;const v=s.A.rl+((d<<9)/y|0),b=s.A.hl+((p<<9)/y|0),T=s.A.rl+((m<<9)/c|0),R=s.A.hl+((I<<9)/c|0),O=s.A.rl+((f<<9)/A|0),L=s.A.hl+((_<<9)/A|0),S=s.A.rl+((l<<9)/u|0),x=s.A.hl+((C<<9)/u|0);if(s.A.alpha=0,(O-S)*(R-x)-(L-x)*(T-S)>0)if(s.A.eI=O<0||S<0||T<0||O>w.A.sI||S>w.A.sI||T>w.A.sI,g.jA&&this.nI(g.Ma,g.Da,L,x,R,O,S,T)&&(g.cp=e,g.fp=n),-1===t.rI)12345678!==t.hI&&s.A.oI(O,S,T,L,x,R,t.hI,t.aI,t.lI);else if(g.et){const i=g.ap[t.rI];s.A.oI(O,S,T,L,x,R,this.cI(i,t.hI),this.cI(i,t.aI),this.cI(i,t.lI))}else t.flat?s.A.fI(O,S,T,L,x,R,t.hI,t.aI,t.lI,d,p,y,m,l,I,C,c,u,t.rI):s.A.fI(O,S,T,L,x,R,t.hI,t.aI,t.lI,f,_,A,l,m,C,I,u,c,t.rI);if(!((v-T)*(x-R)-(b-R)*(S-T)<=0))if(s.A.eI=v<0||T<0||S<0||v>w.A.sI||T>w.A.sI||S>w.A.sI,g.jA&&this.nI(g.Ma,g.Da,b,R,x,v,T,S)&&(g.cp=e,g.fp=n),-1!==t.rI){if(!g.et)return void s.A.fI(v,T,S,b,R,x,t.uI,t.lI,t.aI,d,p,y,m,l,I,C,c,u,t.rI);const i=g.ap[t.rI];s.A.oI(v,T,S,b,R,x,this.cI(i,t.uI),this.cI(i,t.lI),this.cI(i,t.aI))}else 12345678!==t.uI&&s.A.oI(v,T,S,b,R,x,t.uI,t.lI,t.aI)};Hg=(t,i,e,n,r,h,o)=>{let a=e.Od.length;for(let t=0;t>16;if(l=l*o-i*h>>16,i=c,c=a*r-l*n>>16,l=a*n+l*r>>16,a=c,l<50)return;e.dI&&(y.A.wI[t]=i,y.A.yI[t]=a,y.A.mI[t]=l),y.A.AI[t]=s.A.rl+((i<<9)/l|0),y.A.pI[t]=s.A.hl+((a<<9)/l|0)}s.A.alpha=0,a=e.gI.length;for(let n=0;n0)if(s.A.eI=a<0||l<0||c<0||a>w.A.sI||l>w.A.sI||c>w.A.sI,g.jA&&this.nI(g.Ma,g.Da,f,u,d,a,l,c)&&(g.cp=t,g.fp=i),e.dI&&-1!==e.dI[n])if(g.et){const t=g.ap[e.dI[n]];s.A.oI(a,l,c,f,u,d,this.cI(t,e.CI[n]),this.cI(t,e.EI[n]),this.cI(t,e.vI[n]))}else e.flat?s.A.fI(a,l,c,f,u,d,e.CI[n],e.EI[n],e.vI[n],y.A.wI[0],y.A.yI[0],y.A.mI[0],y.A.wI[1],y.A.wI[3],y.A.yI[1],y.A.yI[3],y.A.mI[1],y.A.mI[3],e.dI[n]):s.A.fI(a,l,c,f,u,d,e.CI[n],e.EI[n],e.vI[n],y.A.wI[r],y.A.yI[r],y.A.mI[r],y.A.wI[h],y.A.wI[o],y.A.yI[h],y.A.yI[o],y.A.mI[h],y.A.mI[o],e.dI[n]);else 12345678!==e.CI[n]&&s.A.oI(a,l,c,f,u,d,e.CI[n],e.EI[n],e.vI[n])}};Gg=(t,i,e)=>{const s=this.mp[t][i][e];if(s===-g.bA)return!1;if(s===g.bA)return!0;{const s=i<<7,n=e<<7;return this.bI(s+1,this.wp[t][i][e],n+1)&&this.bI(s+128-1,this.wp[t][i+1][e],n+1)&&this.bI(s+128-1,this.wp[t][i+1][e+1],n+128-1)&&this.bI(s+1,this.wp[t][i][e+1],n+128-1)?(this.mp[t][i][e]=g.bA,!0):(this.mp[t][i][e]=-g.bA,!1)}};Zg=(t,i,e,s)=>{if(!this.Gg(t,i,e))return!1;const n=i<<7,r=e<<7,h=this.wp[t][i][e]-1,o=h-120,a=h-230,l=h-238;if(s<16){if(1===s){if(n>g.FA){if(!this.bI(n,h,r))return!1;if(!this.bI(n,h,r+128))return!1}if(t>0){if(!this.bI(n,o,r))return!1;if(!this.bI(n,o,r+128))return!1}return!!this.bI(n,a,r)&&this.bI(n,a,r+128)}if(2===s){if(r0){if(!this.bI(n,o,r+128))return!1;if(!this.bI(n+128,o,r+128))return!1}return!!this.bI(n,a,r+128)&&this.bI(n+128,a,r+128)}if(4===s){if(n0){if(!this.bI(n+128,o,r))return!1;if(!this.bI(n+128,o,r+128))return!1}return!!this.bI(n+128,a,r)&&this.bI(n+128,a,r+128)}if(8===s){if(r>g.UA){if(!this.bI(n,h,r))return!1;if(!this.bI(n+128,h,r))return!1}if(t>0){if(!this.bI(n,o,r))return!1;if(!this.bI(n+128,o,r))return!1}return!!this.bI(n,a,r)&&this.bI(n+128,a,r)}}return!!this.bI(n+64,l,r+64)&&(16===s?this.bI(n,a,r+128):32===s?this.bI(n+128,a,r+128):64===s?this.bI(n+128,a,r):128===s?this.bI(n,a,r):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,i,e,s)=>{if(this.Gg(t,i,e)){const n=i<<7,r=e<<7;return this.bI(n+1,this.wp[t][i][e]-s,r+1)&&this.bI(n+128-1,this.wp[t][i+1][e]-s,r+1)&&this.bI(n+128-1,this.wp[t][i+1][e+1]-s,r+128-1)&&this.bI(n+1,this.wp[t][i][e+1]-s,r+128-1)}return!1};iI=(t,i,e,s,n,r)=>{let h,o;if(i!==e||s!==n){for(h=i;h<=e;h++)for(o=s;o<=n;o++)if(this.mp[t][h][o]===-g.bA)return!1;o=1+(i<<7);const a=2+(s<<7),l=this.wp[t][i][s]-r;if(!this.bI(o,l,a))return!1;const c=(e<<7)-1;if(!this.bI(c,l,a))return!1;const f=(n<<7)-1;return!!this.bI(o,l,f)&&this.bI(c,l,f)}return!!this.Gg(t,i,s)&&(h=i<<7,o=s<<7,this.bI(h+1,this.wp[t][i][s]-r,o+1)&&this.bI(h+128-1,this.wp[t][i+1][s]-r,o+1)&&this.bI(h+128-1,this.wp[t][i+1][s+1]-r,o+128-1)&&this.bI(h+1,this.wp[t][i][s+1]-r,o+128-1))};bI=(t,i,e)=>{for(let s=0;s0){const t=n.wg+(n.kg*s>>8),r=n.yg+(n.Mg*s>>8),h=n.fg+(n.Dg*s>>8),o=n.Ud+(n.Ng*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(2===n.mode){const s=t-n.ug;if(s>0){const t=n.wg+(n.kg*s>>8),r=n.yg+(n.Mg*s>>8),h=n.fg+(n.Dg*s>>8),o=n.Ud+(n.Ng*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(3===n.mode){const s=n.wg-e;if(s>0){const e=n.ug+(n.Fg*s>>8),r=n.dg+(n.Bg*s>>8),h=n.fg+(n.Dg*s>>8),o=n.Ud+(n.Ng*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(4===n.mode){const s=e-n.wg;if(s>0){const e=n.ug+(n.Fg*s>>8),r=n.dg+(n.Bg*s>>8),h=n.fg+(n.Dg*s>>8),o=n.Ud+(n.Ng*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(5===n.mode){const s=i-n.fg;if(s>0){const i=n.ug+(n.Fg*s>>8),r=n.dg+(n.Bg*s>>8),h=n.wg+(n.kg*s>>8),o=n.yg+(n.Mg*s>>8);if(t>=i&&t<=r&&e>=h&&e<=o)return!0}}}return!1};nI=(t,i,e,s,n,r,h,o)=>{if(ie&&i>s&&i>n)return!1;if(tr&&t>h&&t>o)return!1;const a=(i-s)*(o-h)-(t-h)*(n-s);return((i-e)*(h-r)-(t-r)*(s-e))*a>0&&a*((i-n)*(r-o)-(t-o)*(e-n))>0};cI=(t,i)=>((i=(127-i)*(127&t)/160|0)<2?i=2:i>126&&(i=126),(65408&t)+i)}},7121:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{}},4197:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{TI;RI;OI;LI;index;Kw;ua;fa;constructor(t,i,e,s,n,r,h){super(),this.TI=i,this.RI=e,this.OI=s,this.LI=n,this.index=t,this.Kw=r,h&&-1!==r.wa&&this.Kw.delay?(this.ua=Math.random()*this.Kw.da|0,this.fa=Math.random()*this.Kw.delay[this.ua]|0):(this.ua=-1,this.fa=0)}}},9418:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(7121),n=e(1312),r=e(3867);class h extends s.A{x=0;z=0;Vg=0;SI=!1;size=1;Sl=-1;xI=-1;kI=-1;MI=-1;DI=-1;NI=-1;FI=-1;BI=null;UI=100;GI=0;WI=0;HI=0;YI=0;VI=-1e3;KI=0;XI=0;jI=-1;zI=0;ZI=0;qI=-1;$I=0;JI=0;QI=-1;t_=0;i_=0;e_=0;s_=0;n_=-1;r_=0;h_=0;o_=0;a_=0;l_=0;c_=0;f_=0;u_=0;d_=0;w_=0;y_=0;bA=0;height=0;m_=0;pathLength=0;A_=new Int32Array(10);p_=new Int32Array(10);g_=new r.fe(10,!1);I_=0;__=-1;C_=-1;E_=-1;v_=-1;move(t,i,e){if(-1!==this.QI&&n.A.Lo[this.QI].priority<=1&&(this.QI=-1),!t){const t=i-this.A_[0],s=e-this.p_[0];if(t>=-8&&t<=8&&s>=-8&&s<=8){this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.A_[t]=this.A_[t-1],this.p_[t]=this.p_[t-1],this.g_[t]=this.g_[t-1];return this.A_[0]=i,this.p_[0]=e,void(this.g_[0]=!1)}}this.pathLength=0,this.I_=0,this.A_[0]=i,this.p_[0]=e,this.x=128*this.A_[0]+64*this.size,this.z=128*this.p_[0]+64*this.size}step(t,i){let e=this.A_[0],s=this.p_[0];0===i?(e--,s++):1===i?s++:2===i?(e++,s++):3===i?e--:4===i?e++:5===i?(e--,s--):6===i?s--:7===i&&(e++,s--),-1!==this.QI&&n.A.Lo[this.QI].priority<=1&&(this.QI=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.A_[t]=this.A_[t-1],this.p_[t]=this.p_[t-1],this.g_[t]=this.g_[t-1];this.A_[0]=e,this.p_[0]=s,this.g_[0]=t}}},8268:(t,i,e)=>{e.d(i,{A:()=>d});var s=e(9418),n=e(8665),r=e(2679),h=e(8738),o=e(1312),a=e(8317),l=e(1302),c=e(3819),f=e(3867),u=e(9298);class d extends s.A{static b_=1;static T_=2;static R_=4;static O_=8;static L_=16;static S_=32;static x_=64;static k_=128;static M_=256;static D_=512;static Ll=[u.A.N_,u.A.F_,u.A.B_,u.A.U_,u.A.P_,u.A.G_,u.A.W_,u.A.H_,u.A.Y_,u.A.V_,u.A.K_,u.A.X_,u.A.j_,u.A.z_,u.A.Z_,u.A.q_];static Ol=[[u.A.J_,u.A.Q_,u.A.tC,u.A.iC,u.A.eC,u.A.sC,u.A.nC,u.A.rC,u.A.hC,u.A.oC,u.A.aC,u.A.lC],[u.A.cC,u.A.fC,u.A.uC,u.A.dC,u.A.wC,u.A.yC,u.A.mC,u.A.AC,u.A.pC,u.A.gC,u.A.IC,u.A._C,u.A.CC,u.A.EC,u.A.vC,u.A.bC],[u.A.bC-1,u.A.cC+1,u.A.fC,u.A.uC,u.A.dC,u.A.wC,u.A.yC,u.A.mC,u.A.AC,u.A.pC,u.A.gC,u.A.IC,u.A._C,u.A.CC,u.A.EC,u.A.vC],[u.A.TC,u.A.RC,u.A.OC,u.A.LC,u.A.SC,u.A.xC],[u.A.kC,u.A.MC,u.A.DC,u.A.NC,u.A.FC,u.A.BC,u.A.UC,u.A.PC]];static So=new r.A(200);name=null;visible=!1;GC=0;WC=0;HC=new Uint16Array(12);YC=new Uint16Array(5);Kl=0;VC=0n;y=0;KC=0;XC=0;jC=0;zC=0;ZC=0;qC=null;Sg=0;xg=0;Pm=0;Gm=0;et=!1;draw(t){if(!this.visible)return null;let i=this.Zd();if(this.height=i.Ud,i.Qd=!0,this.et)return i;if(-1!==this.n_&&-1!==this.r_){const t=h.A.Lo[this.n_],e=n.A.vu(t.al(),!0,!t.ad,!1);e.translate(-this.a_,0,0),e.xl(),t.Kw&&t.Kw.frames&&e.kl(t.Kw.frames[this.r_]),e.Dd=null,e.Nd=null,128===t.jd&&128===t.zd||e.scale(t.jd,t.zd,t.jd),e.Ml(t.fd+64,t.ud+850,-30,-50,-30,!0);const s=[i,e];i=n.A.$C(s,2)}if(this.qC&&(t>=this.XC&&(this.qC=null),t>=this.KC&&t=d.Ol[i].length)&&(e=0),this.YC[i]=e}this.Sl=t.ou,65535===this.Sl&&(this.Sl=-1),this.xI=t.ou,65535===this.xI&&(this.xI=-1),this.kI=t.ou,65535===this.kI&&(this.kI=-1),this.MI=t.ou,65535===this.MI&&(this.MI=-1),this.DI=t.ou,65535===this.DI&&(this.DI=-1),this.NI=t.ou,65535===this.NI&&(this.NI=-1),this.FI=t.ou,65535===this.FI&&(this.FI=-1),this.name=c.A.Cl(c.A.El(t.JC)),this.Kl=t.lu,this.visible=!0,this.VC=0n;for(let t=0;t<12;t++)this.VC<<=0x4n,this.HC[t]>=256&&(this.VC+=BigInt(this.HC[t])-256n);this.HC[0]>=256&&(this.VC+=BigInt(this.HC[0])-256n>>4n),this.HC[1]>=256&&(this.VC+=BigInt(this.HC[1])-256n>>8n);for(let t=0;t<5;t++)this.VC<<=0x3n,this.VC+=BigInt(this.YC[t]);this.VC<<=0x1n,this.VC+=BigInt(this.GC)}Xu(){if(!this.visible)return null;const t=new f.fe(12,null);let i=0;for(let e=0;e<12;e++){const s=this.HC[e];if(s>=256&&s<512&&(t[i++]=a.A.Lo[s-256].Xu()),s>=512){const e=l.A.get(s-512).Xu(this.GC);e&&(t[i++]=e)}}const e=n.A.Tl(t,i);for(let t=0;t<5;t++)0!==this.YC[t]&&(e.Rl(d.Ol[t][0],d.Ol[t][this.YC[t]]),1===t&&e.Rl(d.Ll[0],d.Ll[this.YC[t]]));return e}Zd(){let t=this.VC,i=-1,e=-1,s=-1,r=-1;if(this.QI>=0&&0===this.e_){const n=o.A.Lo[this.QI];if(n.frames&&(i=n.frames[this.t_]),this.qI>=0&&this.qI!==this.Sl){const t=o.A.Lo[this.qI].frames;t&&(e=t[this.$I])}n.Hw>=0&&(s=n.Hw,t+=BigInt(s-this.HC[5])<<8n),n.Yw>=0&&(r=n.Yw,t+=BigInt(r-this.HC[3])<<16n)}else if(this.qI>=0){const t=o.A.Lo[this.qI].frames;t&&(i=t[this.$I])}let h=d.So?.get(t);if(!h){const i=new f.fe(12,null);let e=0;for(let t=0;t<12;t++){let n=this.HC[t];if(r>=0&&3===t&&(n=r),s>=0&&5===t&&(n=s),n>=256&&n<512){const t=a.A.Lo[n-256].al();t&&(i[e++]=t)}if(n>=512){const t=l.A.get(n-512).Pw(this.GC);t&&(i[e++]=t)}}h=n.A.Tl(i,e);for(let t=0;t<5;t++)0!==this.YC[t]&&(h.Rl(d.Ol[t][0],d.Ol[t][this.YC[t]]),1===t&&h.Rl(d.Ll[0],d.Ll[this.YC[t]]));h.xl(),h.Ml(64,850,-30,-50,-30,!0),d.So?.put(t,h)}if(this.et)return h;const c=n.A.qd(h,!0);return-1!==i&&-1!==e?c.$d(i,e,o.A.Lo[this.QI].Gw):-1!==i&&c.kl(i),c.Jd(),c.Dd=null,c.Nd=null,c}}},9222:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;model;jp;info;constructor(t,i,e,s,n,r){this.y=t,this.x=i,this.z=e,this.model=s,this.jp=n,this.info=r}}},1161:(t,i,e)=>{e.d(i,{A:()=>s});class s{level;y;x;z;model;Yg;Vg;zp;og;Zp;ag;jp;info;tI=0;bA=0;constructor(t,i,e,s,n,r,h,o,a,l,c,f,u){this.level=t,this.y=i,this.x=e,this.z=s,this.model=n,this.Yg=r,this.Vg=h,this.zp=o,this.og=a,this.Zp=l,this.ag=c,this.jp=f,this.info=u}}},5748:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;Qg;Jg;$g;jp;offset;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.Qg=s,this.Jg=n,this.$g=r,this.jp=h,this.offset=o}}},8256:(t,i,e)=>{e.d(i,{A:()=>s});class s{Sg;Pm;xg;Gm;type;ug;dg;wg;yg;fg;Ud;mode=0;Fg=0;Bg=0;kg=0;Mg=0;Dg=0;Ng=0;constructor(t,i,e,s,n,r,h,o,a,l,c){this.Sg=t,this.Pm=i,this.xg=e,this.Gm=s,this.type=n,this.ug=r,this.dg=h,this.wg=o,this.yg=a,this.fg=l,this.Ud=c}}},3795:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1982),n=e(3867);class r extends s.A{level;x;z;Pg;kp;Og;bp=null;Rp=null;Np=null;Fp=null;Op=null;Mp=null;Ep=null;xp=0;Lg=0;vp=0;visible=!1;update=!1;bg=!1;Tg=0;jg=0;zg=0;Kg=0;constructor(t,i,e){super(),this.Pg=this.level=t,this.x=i,this.z=e,this.kp=new n.fe(5,null),this.Og=new Int32Array(5)}}},2771:(t,i,e)=>{e.d(i,{A:()=>s});class s{static AI=new Int32Array(6);static pI=new Int32Array(6);static wI=new Int32Array(6);static yI=new Int32Array(6);static mI=new Int32Array(6);static QC=[Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,2,6),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,13,14)];static tE=[Int8Array.of(0,1,2,3,0,0,1,3),Int8Array.of(1,1,2,3,1,0,1,3),Int8Array.of(0,1,2,3,1,0,1,3),Int8Array.of(0,0,1,2,0,0,2,4,1,0,4,3),Int8Array.of(0,0,1,4,0,0,4,3,1,1,2,4),Int8Array.of(0,0,4,3,1,0,1,2,1,0,2,4),Int8Array.of(0,1,2,4,1,0,1,4,1,0,4,3),Int8Array.of(0,4,1,2,0,4,2,5,1,0,4,5,1,0,5,3),Int8Array.of(0,4,1,2,0,4,2,3,0,4,3,5,1,0,4,5),Int8Array.of(0,0,4,5,1,4,1,2,1,4,2,3,1,4,3,5),Int8Array.of(0,0,1,5,0,1,4,5,0,1,2,4,1,0,5,3,1,5,4,3,1,4,2,3),Int8Array.of(1,0,1,5,1,1,4,5,1,1,2,4,0,0,5,3,0,5,4,3,0,4,2,3),Int8Array.of(1,0,5,4,1,0,1,5,0,0,4,3,0,4,5,3,0,5,2,3,0,1,2,5)];static iE=128;static eE=this.iE/2|0;static sE=this.iE/4|0;static nE=3*this.iE/4|0;Od;Sd;Ld;CI;EI;vI;gI;II;_I;dI;flat;shape;angle;Cg;Eg;constructor(t,i,e,n,r,h,o,a,l,c,f,u,d,w,y,m,A,p,g){this.flat=!(A!==n||A!==w||A!==a),this.shape=i,this.angle=h,this.Cg=d,this.Eg=l;const I=s.QC[i],_=I.length;this.Od=new Int32Array(_),this.Sd=new Int32Array(_),this.Ld=new Int32Array(_);const C=new Int32Array(_),E=new Int32Array(_),v=t*s.iE,b=p*s.iE;for(let t=0;t<_;t++){let i,l,f,d,p,_=I[t];!(1&_)&&_<=8&&(_=1+(_-h-h-1&7)),_>8&&_<=12&&(_=9+(_-h-9&3)),_>12&&_<=16&&(_=13+(_-h-13&3)),1===_?(i=v,l=b,f=A,d=o,p=c):2===_?(i=v+s.eE,l=b,f=A+n>>1,d=o+g>>1,p=c+e>>1):3===_?(i=v+s.iE,l=b,f=n,d=g,p=e):4===_?(i=v+s.iE,l=b+s.eE,f=n+w>>1,d=g+r>>1,p=e+y>>1):5===_?(i=v+s.iE,l=b+s.iE,f=w,d=r,p=y):6===_?(i=v+s.eE,l=b+s.iE,f=w+a>>1,d=r+m>>1,p=y+u>>1):7===_?(i=v,l=b+s.iE,f=a,d=m,p=u):8===_?(i=v,l=b+s.eE,f=a+A>>1,d=m+o>>1,p=u+c>>1):9===_?(i=v+s.eE,l=b+s.sE,f=A+n>>1,d=o+g>>1,p=c+e>>1):10===_?(i=v+s.nE,l=b+s.eE,f=n+w>>1,d=g+r>>1,p=e+y>>1):11===_?(i=v+s.eE,l=b+s.nE,f=w+a>>1,d=r+m>>1,p=y+u>>1):12===_?(i=v+s.sE,l=b+s.eE,f=a+A>>1,d=m+o>>1,p=u+c>>1):13===_?(i=v+s.sE,l=b+s.sE,f=A,d=o,p=c):14===_?(i=v+s.nE,l=b+s.sE,f=n,d=g,p=e):15===_?(i=v+s.nE,l=b+s.nE,f=w,d=r,p=y):(i=v+s.sE,l=b+s.nE,f=a,d=m,p=u),this.Od[t]=i,this.Sd[t]=f,this.Ld[t]=l,C[t]=d,E[t]=p}const T=s.tE[i],R=T.length/4|0;this.gI=new Int32Array(R),this.II=new Int32Array(R),this._I=new Int32Array(R),this.CI=new Int32Array(R),this.EI=new Int32Array(R),this.vI=new Int32Array(R),this.dI=-1!==f?new Int32Array(R):null;let O=0;for(let t=0;t{e.d(i,{A:()=>s});class s{static sA=0;static Tp=1;static rE=2;static hE=3;static oE=4;static aE=5;static eE=6;static sE=7;static nE=8;static lE=9;static cE=10;static fE=11}},3479:(t,i,e)=>{e.d(i,{A:()=>s});class s{uI;lI;hI;aI;rI;color;flat;constructor(t,i,e,s,n,r,h){this.uI=t,this.lI=i,this.hI=e,this.aI=s,this.rI=n,this.color=r,this.flat=h}}},6855:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;Xg;qg;Wp;Yp;jp;info;constructor(t,i,e,s,n,r,h,o,a){this.y=t,this.x=i,this.z=e,this.Xg=s,this.qg=n,this.Wp=r,this.Yp=h,this.jp=o,this.info=a}}},7441:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;type;angle;model;jp;info;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.type=s,this.angle=n,this.model=r,this.jp=h,this.info=o}}},7536:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n{uE;dE;constructor(t){this.dE=[],this.uE=t;for(let i=0;i{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{yE;mE;constructor(){super(),this.yE=this,this.mE=this}AE(){this.mE&&this.yE&&(this.mE.yE=this.yE,this.yE.mE=this.mE,this.yE=null,this.mE=null)}}},3819:(t,i,e)=>{e.d(i,{A:()=>s});class s{static pE=['_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9'];static gE=t=>{t=t.trim();let i=0n;for(let e=0;e=65&&s<=90?i+=BigInt(s+1-65):s>=97&&s<=122?i+=BigInt(s+1-97):s>=48&&s<=57&&(i+=BigInt(s+27-48))}return i};static El=t=>{if(t<0n||t>=6582952005840035281n)return'invalid_name';if(t%37n===0n)return'invalid_name';let i=0;const e=Array(12);for(;0n!==t;){const s=t;t/=37n,e[11-i++]=this.pE[Number(s-37n*t)]}return e.slice(12-i).join('')};static IE=t=>{const i=[...t.toLowerCase()];let e=!0;for(let t=0;t='a'&&s<='z'&&(i[t]=s.toUpperCase(),e=!1),'.'!==s&&'!'!==s||(e=!0)}return i.join('')};static _E=t=>{let i='';for(let e=0;e(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static Cl=t=>{if(0===t.length)return t;const i=[...t];for(let t=0;t='a'&&i[t+1]<='z'&&(i[t+1]=String.fromCharCode(i[t+1].charCodeAt(0)+'A'.charCodeAt(0)-97)));return i[0]>='a'&&i[0]<='z'&&(i[0]=String.fromCharCode(i[0].charCodeAt(0)+'A'.charCodeAt(0)-97)),i.join('')};static _u=t=>{const i=t.toUpperCase();let e=0n;for(let t=0;t>56n)&0xffffffffffffffn;return e}}},6666:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n{CE;cursor=null;constructor(){const t=new s.A;t.next=t,t.wE=t,this.CE=t}Fm(t){t.wE&&t.hw(),t.wE=this.CE.wE,t.next=this.CE,t.wE&&(t.wE.next=t),t.next.wE=t}EE(t){t.wE&&t.hw(),t.wE=this.CE,t.next=this.CE.next,t.wE.next=t,t.next&&(t.next.wE=t)}Ug(){const t=this.CE.next;return t===this.CE?null:(t?.hw(),t)}head(){const t=this.CE.next;return t===this.CE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}vE(){const t=this.CE.wE;return t===this.CE?(this.cursor=null,null):(this.cursor=t?.wE||null,t)}next(){const t=this.cursor;return t===this.CE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}wE(){const t=this.cursor;return t===this.CE?(this.cursor=null,null):(this.cursor=t?.wE||null,t)}clear(){for(;;){const t=this.CE.next;if(t===this.CE)return;t?.hw()}}}},1982:(t,i,e)=>{e.d(i,{A:()=>s});class s{key;next;wE;constructor(){this.key=0n,this.next=this,this.wE=this}hw(){this.wE&&this.next&&(this.wE.next=this.next,this.next.wE=this.wE,this.next=null,this.wE=null)}}},2679:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(2512),n=e(7536);class r{bE;TE;history;available;constructor(t){this.bE=t,this.available=t,this.TE=new n.A(1024),this.history=new s.A}get(t){const i=this.TE.get(t);return i&&this.history.push(i),i}put(t,i){if(0===this.available){const t=this.history.pop();t?.hw(),t?.AE()}else this.available--;this.TE.put(t,i),this.history.push(i)}clear(){const t=this.history.pop();t?(t.hw(),t.AE()):this.available=this.bE}}},2512:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n{head;constructor(){this.head=new s.A}push(t){t.mE&&t.AE(),t.mE=this.head.mE,t.yE=this.head,t.mE&&(t.mE.yE=t),t.yE.mE=t}pop(){const t=this.head.yE;return t===this.head?null:(t?.AE(),t)}}},8534:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(3867);class r{static Lo=[];static hu=t=>{const i=new s.A(t.read('base_head.dat')),e=new s.A(t.read('base_type.dat')),h=new s.A(t.read('base_label.dat')),o=i.ou;i.lf+=2;for(let t=0;t{e.d(i,{A:()=>r});var s=e(8534),n=e(1069);class r{static Lo=[];static hu=t=>{const i=new n.A(t.read('frame_head.dat')),e=new n.A(t.read('frame_tran1.dat')),h=new n.A(t.read('frame_tran2.dat')),o=new n.A(t.read('frame_del.dat')),a=i.ou;i.lf+=2;const l=new Int32Array(500),c=new Int32Array(500),f=new Int32Array(500),u=new Int32Array(500);for(let t=0;t0){if(0!==d.types[t])for(let i=t-1;i>y;i--)if(0===d.types[i]){l[m]=i,c[m]=0,f[m]=0,u[m]=0,m++;break}l[m]=t;let e=0;3===d.types[l[m]]&&(e=128),c[m]=1&i?h.OE:e,f[m]=2&i?h.OE:e,u[m]=4&i?h.OE:e,y=t,m++}}n.length=m,n.LE=new Int32Array(m),n.x=new Int32Array(m),n.y=new Int32Array(m),n.z=new Int32Array(m);for(let t=0;t{e.d(i,{bc:()=>s,zo:()=>n,SE:()=>o,xE:()=>h,kE:()=>r});const s=document.getElementById('canvas'),n=s.getContext('2d',{willReadFrequently:!0}),r=document.createElement('canvas'),h=document.createElement('img'),o=r.getContext('2d',{willReadFrequently:!0})},9298:(t,i,e)=>{e.d(i,{A:()=>s});class s{static RED=16711680;static GREEN=65280;static BLUE=255;static Ga=16776960;static ME=65535;static hA=16711935;static Ia=16777215;static Pa=0;static DE=16748608;static NE=8388608;static FE=128;static BE=16756736;static UE=16740352;static PE=16723968;static GE=12648192;static WE=8453888;static HE=4259584;static YE=9179409;static VE=6116423;static ia=2301979;static ea=5063219;static na=7759444;static ha=3353893;static KE=8388736;static XE=13350793;static jE=Int32Array.of(s.Ga,s.RED,s.GREEN,s.ME,s.hA,s.Ia);static J_=6798;static Q_=107;static tC=10283;static iC=16;static eC=4797;static sC=7744;static nC=5799;static rC=4634;static hC=33697;static oC=22433;static aC=2983;static lC=54193;static cC=8741;static fC=12;static uC=64030;static dC=43162;static wC=7735;static yC=8404;static mC=1701;static AC=38430;static pC=24094;static gC=10153;static IC=56621;static _C=4783;static CC=1341;static EC=16578;static vC=35003;static bC=25239;static N_=9104;static F_=10275;static B_=7595;static U_=3610;static P_=7975;static G_=8526;static W_=918;static H_=38802;static Y_=24466;static V_=10145;static K_=58654;static X_=5027;static j_=1457;static z_=16565;static Z_=34991;static q_=25486;static TC=4626;static RC=11146;static OC=6439;static LC=12;static SC=4758;static xC=10270;static PC=4574;static kC=4550;static MC=4537;static DC=5681;static NC=5673;static FC=5790;static BC=6806;static UC=8076}},8950:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n extends s.A{static cw=new Int32Array;static fw=0;static uw=0;static top=0;static bottom=0;static left=0;static right=0;static sI=0;static zE=0;static ZE=0;static bind=(t,i,e)=>{this.cw=t,this.fw=i,this.uw=e,this.ma(0,0,i,e)};static qE=()=>{this.left=0,this.top=0,this.right=this.fw,this.bottom=this.uw,this.sI=this.right-1,this.zE=this.right/2|0};static ma=(t,i,e,s)=>{t<0&&(t=0),i<0&&(i=0),e>this.fw&&(e=this.fw),s>this.uw&&(s=this.uw),this.top=i,this.bottom=s,this.left=t,this.right=e,this.sI=this.right-1,this.zE=this.right/2|0,this.ZE=this.bottom/2|0};static clear=()=>{const t=this.fw*this.uw;for(let i=0;i{this.ra(t,i,n,e),this.ra(t,i+s-1,n,e),this.sa(t,i,n,s),this.sa(t+e-1,i,n,s)};static ra=(t,i,e,s)=>{if(i=this.bottom)return;tthis.right&&(s=this.right-t);const n=t+i*this.fw;for(let t=0;t{if(t=this.right)return;ithis.bottom&&(s=this.bottom-i);const n=t+i*this.fw;for(let t=0;t{const r=Math.abs(e-t),h=Math.abs(s-i),o=t=this.left&&t=this.top&&i-h&&(l-=h,t+=o),e{tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const r=this.fw-e;let h=t+i*this.fw;for(let t=-s;t<0;t++){for(let t=-e;t<0;t++)this.cw[h++]=n;h+=r}};static JE(t,i,e,s,n,r){tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const h=256-r,o=(n>>16&255)*r,a=(n>>8&255)*r,l=(255&n)*r,c=this.fw-e;let f=t+i*this.fw;for(let t=0;t>16&255)*h>>8<<16)+(a+(this.cw[f]>>8&255)*h>>8<<8)+(l+(255&this.cw[f])*h>>8);this.cw[f++]=t}f+=c}}static QE(t,i,e,s,n){const r=256-n,h=(s>>16&255)*n,o=(s>>8&255)*n,a=(255&s)*n;let l=i-e;l<0&&(l=0);let c=i+e;c>=this.uw&&(c=this.uw-1);for(let s=l;s<=c;s++){const n=s-i,l=0|Math.sqrt(e*e-n*n);let c=t-l;c<0&&(c=0);let f=t+l;f>=this.fw&&(f=this.fw-1);let u=c+s*this.fw;for(let t=c;t<=f;t++){const t=(h+(this.cw[u]>>16&255)*r>>8<<16)+(o+(this.cw[u]>>8&255)*r>>8<<8)+(a+(255&this.cw[u])*r>>8);this.cw[u++]=t}}}static tv=(t,i,e)=>{t=this.right||i=this.bottom||(this.cw[t+i*this.fw]=e)}}},4583:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(8950),n=e(1673),r=e(3867);class h extends s.A{static et=!1;static iv=new Int32Array(512);static ev=new Int32Array(2048);static sin=new Int32Array(2048);static cos=new Int32Array(2048);static palette=new Int32Array(65536);static sv=new r.fe(50,null);static nv=0;static lw=new Int32Array;static rl=0;static hl=0;static dw=!0;static eI=!1;static alpha=0;static rv=null;static hv=new r.fe(50,null);static ov=0;static bA=0;static av=new Int32Array(50);static lv=new r.fe(50,null);static cv=!1;static fv=new r.fe(50,!1);static uv=new Int32Array(50);static{for(let t=1;t<512;t++)this.iv[t]=32768/t|0;for(let t=1;t<2048;t++)this.ev[t]=65536/t|0;for(let t=0;t<2048;t++)this.sin[t]=65536*Math.sin(.0030679615757712823*t)|0,this.cos[t]=65536*Math.cos(.0030679615757712823*t)|0}static To=()=>{this.iv=null,this.iv=null,this.sin=null,this.cos=null,this.lw=null,this.sv=null,this.fv=null,this.uv=null,this.rv=null,this.hv=null,this.av=null,this.palette=null,this.lv=null,console.log('Draw3D unloaded!')};static Tc=()=>{this.lw=new Int32Array(this.uw);for(let t=0;t{this.lw=new Int32Array(i);for(let e=0;e{this.rv=null,this.hv.fill(null)};static yv=t=>{this.nv=0;for(let i=0;i<50;i++)try{this.sv[i]=n.A.Cu(t,i.toString()),this.et&&128===this.sv[i]?.Fa?this.sv[i]?.mv():this.sv[i]?.Cw(),this.nv++}catch(t){}};static rA=t=>{if(0!==this.uv[t])return this.uv[t];const i=this.lv[t];if(!i)return 0;let e=0,s=0,n=0;const r=i.length;for(let t=0;t>16&255,s+=i[t]>>8&255,n+=255&i[t];let h=(e/r<<16)+(s/r<<8)+(n/r|0);return h=this.Av(h,1.4),0===h&&(h=1),this.uv[t]=h,h};static pv=t=>{const i=t+.03*Math.random()-.015;let e=0;for(let t=0;t<512;t++){const s=(t/8|0)/64+.0078125,n=(7&t)/8+.0625;for(let t=0;t<128;t++){const r=t/128;let h=r,o=r,a=r;if(0!==n){let t;t=r<.5?r*(n+1):r+n-r*n;const i=2*r-t;let e=s+.3333333333333333;e>1&&e--;let l=s-.3333333333333333;l<0&&l++,h=6*e<1?i+6*(t-i)*e:2*e<1?t:3*e<2?i+(t-i)*(.6666666666666666-e)*6:i,o=6*s<1?i+6*(t-i)*s:2*s<1?t:3*s<2?i+(t-i)*(.6666666666666666-s)*6:i,a=6*l<1?i+6*(t-i)*l:2*l<1?t:3*l<2?i+(t-i)*(.6666666666666666-l)*6:i}const l=((256*h|0)<<16)+((256*o|0)<<8)+(256*a|0);this.palette[e++]=this.Av(l,i)}}for(let t=0;t<50;t++){const e=this.sv[t];if(!e)continue;const s=e.palette;this.lv[t]=new Int32Array(s.length);for(let e=0;e{const e=(t>>16)/256,s=(t>>8&255)/256,n=(255&t)/256;return((256*Math.pow(e,i)|0)<<16)+((256*Math.pow(s,i)|0)<<8)+(256*Math.pow(n,i)|0)};static Iv=t=>{this.rv||(this.ov=t,this.et?this.rv=new r.Xr(t,16384):this.rv=new r.Xr(t,65536),this.hv.fill(null))};static oI=(t,i,e,s,n,r,h,o,a)=>{let l=0,c=0;n!==s&&(l=(i-t<<16)/(n-s)|0,c=(o-h<<15)/(n-s)|0);let f=0,u=0;r!==n&&(f=(e-i<<16)/(r-n)|0,u=(a-o<<15)/(r-n)|0);let d=0,w=0;if(r!==s&&(d=(t-e<<16)/(s-r)|0,w=(h-a<<15)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),nf)for(r-=n,n-=s,s=this.lw[s];;){if(--n<0)for(;;){if(--r<0)return;this._v(e>>16,i>>16,a>>7,o>>7,this.cw,s,0),e+=d,i+=f,a+=w,o+=u,s+=this.fw}this._v(e>>16,t>>16,a>>7,h>>7,this.cw,s,0),e+=d,t+=l,a+=w,h+=c,s+=this.fw}else for(r-=n,n-=s,s=this.lw[s];;){if(--n<0)for(;;){if(--r<0)return;this._v(i>>16,e>>16,o>>7,a>>7,this.cw,s,0),e+=d,i+=f,a+=w,o+=u,s+=this.fw}this._v(t>>16,e>>16,h>>7,a>>7,this.cw,s,0),e+=d,t+=l,a+=w,h+=c,s+=this.fw}else if(i=t<<=16,o=h<<=15,s<0&&(i-=d*s,t-=l*s,o-=w*s,h-=c*s,s=0),e<<=16,a<<=15,r<0&&(e-=f*r,a-=u*r,r=0),s!==r&&dl)for(n-=r,r-=s,s=this.lw[s];;){if(--r<0)for(;;){if(--n<0)return;this._v(e>>16,t>>16,a>>7,h>>7,this.cw,s,0),e+=f,t+=l,a+=u,h+=c,s+=this.fw}this._v(i>>16,t>>16,o>>7,h>>7,this.cw,s,0),i+=d,t+=l,o+=w,h+=c,s+=this.fw}else for(n-=r,r-=s,s=this.lw[s];;){if(--r<0)for(;;){if(--n<0)return;this._v(t>>16,e>>16,h>>7,a>>7,this.cw,s,0),e+=f,t+=l,a+=u,h+=c,s+=this.fw}this._v(t>>16,i>>16,h>>7,o>>7,this.cw,s,0),i+=d,t+=l,o+=w,h+=c,s+=this.fw}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),rd)for(s-=r,r-=n,n=this.lw[n];;){if(--r<0)for(;;){if(--s<0)return;this._v(t>>16,e>>16,h>>7,a>>7,this.cw,n,0),t+=l,e+=d,h+=c,a+=w,n+=this.fw}this._v(t>>16,i>>16,h>>7,o>>7,this.cw,n,0),t+=l,i+=f,h+=c,o+=u,n+=this.fw}else for(s-=r,r-=n,n=this.lw[n];;){if(--r<0)for(;;){if(--s<0)return;this._v(e>>16,t>>16,a>>7,h>>7,this.cw,n,0),t+=l,e+=d,h+=c,a+=w,n+=this.fw}this._v(i>>16,t>>16,o>>7,h>>7,this.cw,n,0),t+=l,i+=f,h+=c,o+=u,n+=this.fw}else if(e=i<<=16,a=o<<=15,n<0&&(e-=l*n,i-=f*n,a-=c*n,o-=u*n,n=0),t<<=16,h<<=15,s<0&&(t-=d*s,h-=w*s,s=0),r-=s,s-=n,n=this.lw[n],l>16,i>>16,h>>7,o>>7,this.cw,n,0),t+=d,i+=f,h+=w,o+=u,n+=this.fw}this._v(e>>16,i>>16,a>>7,o>>7,this.cw,n,0),e+=l,i+=f,a+=c,o+=u,n+=this.fw}else for(;;){if(--s<0)for(;;){if(--r<0)return;this._v(i>>16,t>>16,o>>7,h>>7,this.cw,n,0),t+=d,i+=f,h+=w,o+=u,n+=this.fw}this._v(i>>16,e>>16,o>>7,a>>7,this.cw,n,0),e+=l,i+=f,a+=c,o+=u,n+=this.fw}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,o>>7,h>>7,this.cw,r,0),i+=f,t+=l,o+=u,h+=c,r+=this.fw}this._v(i>>16,e>>16,o>>7,a>>7,this.cw,r,0),i+=f,e+=d,o+=u,a+=w,r+=this.fw}else for(;;){if(--s<0)for(;;){if(--n<0)return;this._v(t>>16,i>>16,h>>7,o>>7,this.cw,r,0),i+=f,t+=l,o+=u,h+=c,r+=this.fw}this._v(e>>16,i>>16,a>>7,o>>7,this.cw,r,0),i+=f,e+=d,o+=u,a+=w,r+=this.fw}else if(t=e<<=16,h=a<<=15,r<0&&(t-=f*r,e-=d*r,h-=u*r,a-=w*r,r=0),i<<=16,o<<=15,n<0&&(i-=l*n,o-=c*n,n=0),s-=n,n-=r,r=this.lw[r],f>16,e>>16,o>>7,a>>7,this.cw,r,0),i+=l,e+=d,o+=c,a+=w,r+=this.fw}this._v(t>>16,e>>16,h>>7,a>>7,this.cw,r,0),t+=f,e+=d,h+=u,a+=w,r+=this.fw}else for(;;){if(--n<0)for(;;){if(--s<0)return;this._v(e>>16,i>>16,a>>7,o>>7,this.cw,r,0),i+=l,e+=d,o+=c,a+=w,r+=this.fw}this._v(e>>16,t>>16,a>>7,h>>7,this.cw,r,0),t+=f,e+=d,h+=u,a+=w,r+=this.fw}};static _v=(t,i,e,s,n,r,h)=>{let o;if(this.dw){let a;if(this.eI){if(a=i-t>3?(s-e)/(i-t)|0:0,i>this.sI&&(i=this.sI),t<0&&(e-=t*a,t=0),t>=i)return;r+=t,h=i-t>>2,a<<=2}else{if(!(t>2)>0?(s-e)*this.iv[h]>>15:0}if(0===this.alpha)for(;;){if(--h<0){if((h=i-t&3)>0){o=this.palette[e>>8];do{n[r++]=o,h--}while(h>0);return}break}o=this.palette[e>>8],e+=a,n[r++]=o,n[r++]=o,n[r++]=o,n[r++]=o}else{const s=this.alpha,l=256-this.alpha;for(;;){if(--h<0){if((h=i-t&3)>0){o=this.palette[e>>8],o=((16711935&o)*l>>8&16711935)+((65280&o)*l>>8&65280);do{n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),h--}while(h>0)}break}o=this.palette[e>>8],e+=a,o=((16711935&o)*l>>8&16711935)+((65280&o)*l>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280)}}}else if(tthis.sI&&(i=this.sI),t<0&&(e-=t*a,t=0),t>=i))return;if(r+=t,h=i-t,0===this.alpha)do{n[r++]=this.palette[e>>8],e+=a,h--}while(h>0);else{const t=this.alpha,i=256-this.alpha;do{o=this.palette[e>>8],e+=a,o=((16711935&o)*i>>8&16711935)+((65280&o)*i>>8&65280),n[r++]=o+((16711935&n[r])*t>>8&16711935)+((65280&n[r])*t>>8&65280),h--}while(h>0)}}};static Cv=(t,i,e,s,n,r,h)=>{let o=0;n!==s&&(o=(i-t<<16)/(n-s)|0);let a=0;r!==n&&(a=(e-i<<16)/(r-n)|0);let l=0;if(r!==s&&(l=(t-e<<16)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),na)for(r-=n,n-=s,s=this.lw[s];;){if(--n<0)for(;;){if(--r<0)return;this.Ev(e>>16,i>>16,this.cw,s,h),e+=l,i+=a,s+=this.fw}this.Ev(e>>16,t>>16,this.cw,s,h),e+=l,t+=o,s+=this.fw}else for(r-=n,n-=s,s=this.lw[s];;){if(--n<0)for(;;){if(--r<0)return;this.Ev(i>>16,e>>16,this.cw,s,h),e+=l,i+=a,s+=this.fw}this.Ev(t>>16,e>>16,this.cw,s,h),e+=l,t+=o,s+=this.fw}else if(i=t<<=16,s<0&&(i-=l*s,t-=o*s,s=0),e<<=16,r<0&&(e-=a*r,r=0),s!==r&&lo)for(n-=r,r-=s,s=this.lw[s];;){if(--r<0)for(;;){if(--n<0)return;this.Ev(e>>16,t>>16,this.cw,s,h),e+=a,t+=o,s+=this.fw}this.Ev(i>>16,t>>16,this.cw,s,h),i+=l,t+=o,s+=this.fw}else for(n-=r,r-=s,s=this.lw[s];;){if(--r<0)for(;;){if(--n<0)return;this.Ev(t>>16,e>>16,this.cw,s,h),e+=a,t+=o,s+=this.fw}this.Ev(t>>16,i>>16,this.cw,s,h),i+=l,t+=o,s+=this.fw}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),rl)for(s-=r,r-=n,n=this.lw[n];;){if(--r<0)for(;;){if(--s<0)return;this.Ev(t>>16,e>>16,this.cw,n,h),t+=o,e+=l,n+=this.fw}this.Ev(t>>16,i>>16,this.cw,n,h),t+=o,i+=a,n+=this.fw}else for(s-=r,r-=n,n=this.lw[n];;){if(--r<0)for(;;){if(--s<0)return;this.Ev(e>>16,t>>16,this.cw,n,h),t+=o,e+=l,n+=this.fw}this.Ev(i>>16,t>>16,this.cw,n,h),t+=o,i+=a,n+=this.fw}else if(e=i<<=16,n<0&&(e-=o*n,i-=a*n,n=0),t<<=16,s<0&&(t-=l*s,s=0),o>16,i>>16,this.cw,n,h),t+=l,i+=a,n+=this.fw}this.Ev(e>>16,i>>16,this.cw,n,h),e+=o,i+=a,n+=this.fw}else for(r-=s,s-=n,n=this.lw[n];;){if(--s<0)for(;;){if(--r<0)return;this.Ev(i>>16,t>>16,this.cw,n,h),t+=l,i+=a,n+=this.fw}this.Ev(i>>16,e>>16,this.cw,n,h),e+=o,i+=a,n+=this.fw}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,this.cw,r,h),i+=a,t+=o,r+=this.fw}this.Ev(i>>16,e>>16,this.cw,r,h),i+=a,e+=l,r+=this.fw}else for(n-=s,s-=r,r=this.lw[r];;){if(--s<0)for(;;){if(--n<0)return;this.Ev(t>>16,i>>16,this.cw,r,h),i+=a,t+=o,r+=this.fw}this.Ev(e>>16,i>>16,this.cw,r,h),i+=a,e+=l,r+=this.fw}else if(t=e<<=16,r<0&&(t-=a*r,e-=l*r,r=0),i<<=16,n<0&&(i-=o*n,n=0),a>16,e>>16,this.cw,r,h),i+=o,e+=l,r+=this.fw}this.Ev(t>>16,e>>16,this.cw,r,h),t+=a,e+=l,r+=this.fw}else for(s-=n,n-=r,r=this.lw[r];;){if(--n<0)for(;;){if(--s<0)return;this.Ev(e>>16,i>>16,this.cw,r,h),i+=o,e+=l,r+=this.fw}this.Ev(e>>16,t>>16,this.cw,r,h),t+=a,e+=l,r+=this.fw}};static fI=(t,i,e,s,n,r,h,o,a,l,c,f,u,d,w,y,m,A,p)=>{const g=this.vv(p);this.cv=!this.fv[p];const I=l-u,_=c-w,C=f-m,E=d-l,v=y-c,b=A-f;let T=E*c-v*l<<14;const R=v*f-b*c<<8,O=b*l-E*f<<5;let L=I*c-_*l<<14;const S=_*f-C*c<<8,x=C*l-I*f<<5;let k=_*E-I*v<<14;const M=C*v-_*b<<8,D=I*b-C*E<<5;let N=0,F=0;n!==s&&(N=(i-t<<16)/(n-s)|0,F=(o-h<<16)/(n-s)|0);let B=0,U=0;r!==n&&(B=(e-i<<16)/(r-n)|0,U=(a-o<<16)/(r-n)|0);let P=0,G=0;if(r!==s&&(P=(t-e<<16)/(s-r)|0,G=(h-a<<16)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),nB)for(r-=n,n-=s,s=this.lw[s];;){if(--n<0)for(;;){if(--r<0)return;this.bv(e>>16,i>>16,this.cw,s,g,0,0,T,L,k,R,S,M,a>>8,o>>8),e+=P,i+=B,a+=G,o+=U,s+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.bv(e>>16,t>>16,this.cw,s,g,0,0,T,L,k,R,S,M,a>>8,h>>8),e+=P,t+=N,a+=G,h+=F,s+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}else for(r-=n,n-=s,s=this.lw[s];;){if(--n<0)for(;;){if(--r<0)return;this.bv(i>>16,e>>16,this.cw,s,g,0,0,T,L,k,R,S,M,o>>8,a>>8),e+=P,i+=B,a+=G,o+=U,s+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.bv(t>>16,e>>16,this.cw,s,g,0,0,T,L,k,R,S,M,h>>8,a>>8),e+=P,t+=N,a+=G,h+=F,s+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}}else{i=t<<=16,o=h<<=16,s<0&&(i-=P*s,t-=N*s,o-=G*s,h-=F*s,s=0),e<<=16,a<<=16,r<0&&(e-=B*r,a-=U*r,r=0);const l=s-this.hl;if(T+=O*l,L+=x*l,k+=D*l,T|=0,L|=0,k|=0,(s===r||P>=N)&&(s!==r||B<=N))for(n-=r,r-=s,s=this.lw[s];;){if(--r<0)for(;;){if(--n<0)return;this.bv(t>>16,e>>16,this.cw,s,g,0,0,T,L,k,R,S,M,h>>8,a>>8),e+=B,t+=N,a+=U,h+=F,s+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.bv(t>>16,i>>16,this.cw,s,g,0,0,T,L,k,R,S,M,h>>8,o>>8),i+=P,t+=N,o+=G,h+=F,s+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}else for(n-=r,r-=s,s=this.lw[s];;){if(--r<0)for(;;){if(--n<0)return;this.bv(e>>16,t>>16,this.cw,s,g,0,0,T,L,k,R,S,M,a>>8,h>>8),e+=B,t+=N,a+=U,h+=F,s+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.bv(i>>16,t>>16,this.cw,s,g,0,0,T,L,k,R,S,M,o>>8,h>>8),i+=P,t+=N,o+=G,h+=F,s+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),rP)for(s-=r,r-=n,n=this.lw[n];;){if(--r<0)for(;;){if(--s<0)return;this.bv(t>>16,e>>16,this.cw,n,g,0,0,T,L,k,R,S,M,h>>8,a>>8),t+=N,e+=P,h+=F,a+=G,n+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.bv(t>>16,i>>16,this.cw,n,g,0,0,T,L,k,R,S,M,h>>8,o>>8),t+=N,i+=B,h+=F,o+=U,n+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}else for(s-=r,r-=n,n=this.lw[n];;){if(--r<0)for(;;){if(--s<0)return;this.bv(e>>16,t>>16,this.cw,n,g,0,0,T,L,k,R,S,M,a>>8,h>>8),t+=N,e+=P,h+=F,a+=G,n+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.bv(i>>16,t>>16,this.cw,n,g,0,0,T,L,k,R,S,M,o>>8,h>>8),t+=N,i+=B,h+=F,o+=U,n+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}}else{e=i<<=16,a=o<<=16,n<0&&(e-=N*n,i-=B*n,a-=F*n,o-=U*n,n=0),t<<=16,h<<=16,s<0&&(t-=P*s,h-=G*s,s=0);const l=n-this.hl;if(T+=O*l,L+=x*l,k+=D*l,T|=0,L|=0,k|=0,r-=s,s-=n,n=this.lw[n],N>16,i>>16,this.cw,n,g,0,0,T,L,k,R,S,M,h>>8,o>>8),t+=P,i+=B,h+=G,o+=U,n+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.bv(e>>16,i>>16,this.cw,n,g,0,0,T,L,k,R,S,M,a>>8,o>>8),e+=N,i+=B,a+=F,o+=U,n+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}else for(;;){if(--s<0)for(;;){if(--r<0)return;this.bv(i>>16,t>>16,this.cw,n,g,0,0,T,L,k,R,S,M,o>>8,h>>8),t+=P,i+=B,h+=G,o+=U,n+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.bv(i>>16,e>>16,this.cw,n,g,0,0,T,L,k,R,S,M,o>>8,a>>8),e+=N,i+=B,a+=F,o+=U,n+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,this.cw,r,g,0,0,T,L,k,R,S,M,o>>8,h>>8),i+=B,t+=N,o+=U,h+=F,r+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.bv(i>>16,e>>16,this.cw,r,g,0,0,T,L,k,R,S,M,o>>8,a>>8),i+=B,e+=P,o+=U,a+=G,r+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}else for(;;){if(--s<0)for(;;){if(--n<0)return;this.bv(t>>16,i>>16,this.cw,r,g,0,0,T,L,k,R,S,M,h>>8,o>>8),i+=B,t+=N,o+=U,h+=F,r+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.bv(e>>16,i>>16,this.cw,r,g,0,0,T,L,k,R,S,M,a>>8,o>>8),i+=B,e+=P,o+=U,a+=G,r+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}}else{t=e<<=16,h=a<<=16,r<0&&(t-=B*r,e-=P*r,h-=U*r,a-=G*r,r=0),i<<=16,o<<=16,n<0&&(i-=N*n,o-=F*n,n=0);const l=r-this.hl;if(T+=O*l,L+=x*l,k+=D*l,T|=0,L|=0,k|=0,s-=n,n-=r,r=this.lw[r],B>16,e>>16,this.cw,r,g,0,0,T,L,k,R,S,M,o>>8,a>>8),i+=N,e+=P,o+=F,a+=G,r+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.bv(t>>16,e>>16,this.cw,r,g,0,0,T,L,k,R,S,M,h>>8,a>>8),t+=B,e+=P,h+=U,a+=G,r+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}else for(;;){if(--n<0)for(;;){if(--s<0)return;this.bv(e>>16,i>>16,this.cw,r,g,0,0,T,L,k,R,S,M,a>>8,o>>8),i+=N,e+=P,o+=F,a+=G,r+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.bv(e>>16,t>>16,this.cw,r,g,0,0,T,L,k,R,S,M,a>>8,h>>8),t+=B,e+=P,h+=U,a+=G,r+=this.fw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}}};static bv=(t,i,e,s,n,r,h,o,a,l,c,f,u,d,w)=>{if(t>=i)return;let y,m,A,p,g,I,_,C,E;if(this.eI){if(y=(w-d)/(i-t)|0,i>this.sI&&(i=this.sI),t<0&&(d-=t*y,t=0),t>=i)return;m=i-t>>3,y<<=12}else i-t>7?(m=i-t>>3,y=(w-d)*this.iv[m]>>6):(m=0,y=0);if(d<<=9,s+=t,this.et&&n)if(A=0,p=0,I=t-this.rl,o+=(c>>3)*I,a+=(f>>3)*I,l+=(u>>3)*I,o|=0,a|=0,g=(l|=0)>>12,0!==g&&(h=a/g|0,(r=o/g|0)<0?r=0:r>4032&&(r=4032)),o+=c,a+=f,l+=u,o|=0,a|=0,g=(l|=0)>>12,0!==g&&(A=o/g|0,p=a/g|0,A<7?A=7:A>4032&&(A=4032)),_=A-r>>3,C=p-h>>3,r+=d>>3&786432,E=d>>23,this.cv){for(;m-- >0;)e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r=A,h=p,o+=c,a+=f,g=(l+=u)>>12,0!==g&&(A=o/g|0,p=a/g|0,A<7?A=7:A>4032&&(A=4032)),_=A-r>>3,C=p-h>>3,r+=(d+=y)>>3&786432,E=d>>23;for(m=i-t&7;m-- >0;)e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C}else{for(;m-- >0;){let t;0!=(t=n[(4032&h)+(r>>6)]>>>E)&&(e[s]=t),s+=1,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s+=1,r=A,h=p,o+=c,a+=f,l+=u,o|=0,a|=0,g=(l|=0)>>12,0!==g&&(A=o/g|0,p=a/g|0,A<7?A=7:A>4032&&(A=4032)),_=A-r>>3,C=p-h>>3,r+=(d+=y)>>3&786432,E=d>>23}for(m=i-t&7;m-- >0;){let t;0!=(t=n[(4032&h)+(r>>6)]>>>E)&&(e[s]=t),s++,r+=_,h+=C}}else if(A=0,p=0,I=t-this.rl,o+=(c>>3)*I,a+=(f>>3)*I,l+=(u>>3)*I,o|=0,a|=0,g=(l|=0)>>14,0!==g&&(h=a/g|0,(r=o/g|0)<0?r=0:r>16256&&(r=16256)),o+=c,a+=f,l+=u,o|=0,a|=0,g=(l|=0)>>14,0!==g&&(A=o/g|0,p=a/g|0,A<7?A=7:A>16256&&(A=16256)),_=A-r>>3,C=p-h>>3,r+=6291456&d,E=d>>23,this.cv&&n){for(;m-- >0;)e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r=A,h=p,o+=c,a+=f,l+=u,o|=0,a|=0,g=(l|=0)>>14,0!==g&&(A=o/g|0,p=a/g|0,A<7?A=7:A>16256&&(A=16256)),_=A-r>>3,C=p-h>>3,r+=6291456&(d+=y),E=d>>23;for(m=i-t&7;m-- >0;)e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C}else{for(;m-- >0&&n;){let t;0!=(t=n[(16256&h)+(r>>7)]>>>E)&&(e[s]=t),s+=1,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,r=A,h=p,o+=c,a+=f,l+=u,o|=0,a|=0,g=(l|=0)>>14,0!==g&&(A=o/g|0,p=a/g|0,A<7?A=7:A>16256&&(A=16256)),_=A-r>>3,C=p-h>>3,r+=6291456&(d+=y),E=d>>23}for(m=i-t&7;m-- >0&&n;){let t;0!=(t=n[(16256&h)+(r>>7)]>>>E)&&(e[s]=t),s++,r+=_,h+=C}}};static Ev=(t,i,e,s,n)=>{if(this.eI&&(i>this.sI&&(i=this.sI),t<0&&(t=0)),t>=i)return;s+=t;let r=i-t>>2;if(0===this.alpha)for(;;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;e[s++]=n}e[s++]=n,e[s++]=n,e[s++]=n,e[s++]=n}const h=this.alpha,o=256-this.alpha;for(n=((16711935&n)*o>>8&16711935)+((65280&n)*o>>8&65280);;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280)}e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280)}};static gv=t=>{this.hv[t]&&this.rv&&(this.rv[this.ov++]=this.hv[t],this.hv[t]=null)};static vv=t=>{if(this.av[t]=this.bA++,this.hv[t])return this.hv[t];let i;if(this.ov>0&&this.rv)i=this.rv[--this.ov],this.rv[this.ov]=null;else{let t=0,e=-1;for(let i=0;i>>3)&16316671,i[n+8192]=r-(r>>>2)&16316671,i[n+12288]=r-(r>>>2)-(r>>>3)&16316671}}else{if(64===e.width)for(let t=0;t<128;t++)for(let n=0;n<128;n++)i[n+(t<<7)]=s[e.cw[(n>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)i[t]=s[e.cw[t]];this.fv[t]=!1;for(let e=0;e<16384;e++){i[e]&=16316671;const s=i[e];0===s&&(this.fv[t]=!0),i[e+16384]=s-(s>>>3)&16316671,i[e+32768]=s-(s>>>2)&16316671,i[e+49152]=s-(s>>>2)-(s>>>3)&16316671}}return i}}},880:(t,i,e)=>{e.d(i,{r:()=>n});var s=e(7854);const n=async t=>{255!==t[0]&&(t[0]=255),URL.revokeObjectURL(s.xE.src),s.xE.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>s.xE.onload=()=>t())),s.SE.clearRect(0,0,s.kE.width,s.kE.height);const i=s.xE.naturalWidth,e=s.xE.naturalHeight;return s.kE.width=i,s.kE.height=e,s.SE.drawImage(s.xE,0,0),s.SE.getImageData(0,0,i,e)}},8665:(t,i,e)=>{e.d(i,{A:()=>f});var s=e(1069),n=e(8950),r=e(4583),h=e(6730),o=e(4474),a=e(3867);class l{Rd=0;Ag=0;Tv=0;Rv=-1;Ov=-1;Lv=-1;Sv=-1;xv=-1;kv=-1;Mv=-1;Dv=-1;Nv=-1;Fv=0;Bv=-1;Uv=-1;Pv=-1;data=null}class c{x=0;y=0;z=0;w=0}class f extends o.A{static metadata=null;static head=null;static Gv=null;static Wv=null;static Hv=null;static Yv=null;static Vv=null;static Kv=null;static Xv=null;static jv=null;static zv=null;static Zv=null;static qv=null;static $v=null;static axis=null;static Jv=new a.fe(4096,!1);static Qv=new a.fe(4096,!1);static tb=new Int32Array(4096);static ib=new Int32Array(4096);static eb=new Int32Array(4096);static sb=new Int32Array(4096);static nb=new Int32Array(4096);static rb=new Int32Array(4096);static hb=new Int32Array(1500);static ob=new a.Xr(1500,512);static ab=new Int32Array(12);static lb=new a.Xr(12,2e3);static cb=new Int32Array(2e3);static fb=new Int32Array(2e3);static ub=new Int32Array(12);static wb=new Int32Array(10);static yb=new Int32Array(10);static mb=new Int32Array(10);static Ir=0;static Ab=0;static _r=0;static pb=!1;static Ma=0;static Da=0;static gb=0;static Ib=new Int32Array(1e3);static _b=!1;static hu(t){try{f.head=new s.A(t.read('ob_head.dat')),f.Gv=new s.A(t.read('ob_face1.dat')),f.Wv=new s.A(t.read('ob_face2.dat')),f.Hv=new s.A(t.read('ob_face3.dat')),f.Yv=new s.A(t.read('ob_face4.dat')),f.Vv=new s.A(t.read('ob_face5.dat')),f.Kv=new s.A(t.read('ob_point1.dat')),f.Xv=new s.A(t.read('ob_point2.dat')),f.jv=new s.A(t.read('ob_point3.dat')),f.zv=new s.A(t.read('ob_point4.dat')),f.Zv=new s.A(t.read('ob_point5.dat')),f.qv=new s.A(t.read('ob_vertex1.dat')),f.$v=new s.A(t.read('ob_vertex2.dat')),f.axis=new s.A(t.read('ob_axis.dat')),f.head.lf=0,f.Kv.lf=0,f.Xv.lf=0,f.jv.lf=0,f.zv.lf=0,f.qv.lf=0,f.$v.lf=0;const i=f.head.ou;f.metadata=new a.fe(i+100,null);let e=0,n=0,r=0,h=0,o=0,c=0,u=0;for(let t=0;t>7)<2?i=2:i>126&&(i=126),(65408&t)+i):(i<0?i=0:i>127&&(i=127),127-i)}static Td=(t,i,e)=>{const s=t.Rd,n=t.Ag,r=t.Tv;let h,o,l,u,d;if(i){h=new Int32Array(s);for(let i=0;i{const n=t.Rd,r=t.Ag,h=t.Tv;let o,a,l,c,u;if(s)o=t.Od,a=t.Sd,l=t.Ld;else{o=new Int32Array(n),a=new Int32Array(n),l=new Int32Array(n);for(let i=0;i{const e=t.Rd,s=t.Ag,n=t.Tv,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e);for(let i=0;i{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,a=0,l=-1;for(let c=0;c{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,a=0,l=-1;for(let c=0;c{let o=-1;const a=t.Od[i],l=t.Sd[i],c=t.Ld[i];for(let t=0;t{if(!f.metadata)throw new Error('cant loading model metadata!!!!!');const i=f.metadata[t];if(!i)throw console.log(`Error model:${t} not found!`),new Error('cant loading model metadata!!!!!');if(!(f.head&&f.Gv&&f.Wv&&f.Hv&&f.Yv&&f.Vv&&f.Kv&&f.Xv&&f.jv&&f.zv&&f.Zv&&f.qv&&f.$v&&f.axis))throw new Error('cant loading model!!!!!');const e=i.Rd,s=i.Ag,n=i.Tv,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e),a=new Int32Array(s),l=new Int32Array(s),c=new Int32Array(s),u=new Int32Array(n),d=new Int32Array(n),w=new Int32Array(n);let y=null;i.xv>=0&&(y=new Int32Array(e));let m=null;i.Nv>=0&&(m=new Int32Array(s));let A=null,p=0;i.Fv>=0?A=new Int32Array(s):p=-i.Fv-1;let g=null;i.Bv>=0&&(g=new Int32Array(s));let I=null;i.Uv>=0&&(I=new Int32Array(s));const _=new Int32Array(s);f.Kv.lf=i.Rv,f.Xv.lf=i.Ov,f.jv.lf=i.Lv,f.zv.lf=i.Sv,f.Zv.lf=i.xv;let C,E,v,b=0,T=0,R=0;for(let t=0;t{if(!f.metadata||!f.metadata[i])throw new Error('No model metadata');const e=f.metadata[i];if(e.data=t,!e.data.length)throw new Error('No model data');const n=e.Rd,r=e.Ag,h=e.Tv,o=new Int32Array(n),a=new Int32Array(n),l=new Int32Array(n),c=new Int32Array(r),u=new Int32Array(r),d=new Int32Array(r),w=new Int32Array(h),y=new Int32Array(h),m=new Int32Array(h);let A=null;e.xv>=0&&(A=new Int32Array(n));let p=null;e.Nv>=0&&(p=new Int32Array(r));let g=null,I=0;e.Fv>=0?g=new Int32Array(r):I=-e.Fv-1;let _=null;e.Bv>=0&&(_=new Int32Array(r));let C=null;e.Uv>=0&&(C=new Int32Array(r));const E=new Int32Array(r),v=new s.A(e.data);v.lf=e.Rv;const b=new s.A(e.data);b.lf=e.Ov;const T=new s.A(e.data);T.lf=e.Lv;const R=new s.A(e.data);R.lf=e.Sv;const O=new s.A(e.data);O.lf=e.xv;let L,S,x,k=0,M=0,D=0;for(let t=0;tthis.Ud&&(this.Ud=-e),e>this.fg&&(this.fg=e);const n=i*i+s*s;n>this.yA&&(this.yA=n)}this.yA=Math.sqrt(this.yA)+.99|0,this.Mb=Math.sqrt(this.yA*this.yA+this.Ud*this.Ud)+.99|0,this.kb=this.Mb+(Math.sqrt(this.yA*this.yA+this.fg*this.fg)+.99|0)}xd(){this.Ud=0,this.fg=0;for(let t=0;tthis.Ud&&(this.Ud=-i),i>this.fg&&(this.fg=i)}this.Mb=Math.sqrt(this.yA*this.yA+this.Ud*this.Ud)+.99|0,this.kb=this.Mb+(Math.sqrt(this.yA*this.yA+this.fg*this.fg)+.99|0)}xl(){if(this.Db){const t=new Int32Array(256);let i=0;for(let e=0;ei&&(i=s)}this.Nd=new a.fe(i+1,null);for(let e=0;e<=i;e++)this.Nd[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;ei&&(i=s)}this.Dd=new a.fe(i+1,null);for(let e=0;e<=i;e++)this.Dd[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;ea;)a=e[o++];r&&r.types&&s.x&&s.y&&s.z&&r.labels&&(i!==a||0===r.types[i])&&this.Pb(s.x[t],s.y[t],s.z[t],r.labels[i],r.types[i])}f.Ir=0,f.Ab=0,f._r=0,o=0,a=e[o++];for(let t=0;ta;)a=e[o++];r&&r.types&&n.x&&n.y&&n.z&&r.labels&&(i===a||0===r.types[i])&&this.Pb(n.x[t],n.y[t],n.z[t],r.labels[i],r.types[i])}}else this.kl(t)}kl(t){if(!this.Nd||-1===t||!h.A.Lo[t])return;const i=h.A.Lo[t],e=i.RE;f.Ir=0,f.Ab=0,f._r=0;for(let t=0;t>16;this.Ld[t]=this.Sd[t]*i+this.Ld[t]*e>>16,this.Sd[t]=s}}translate(t,i,e){for(let s=0;s>8;if(this.vb&&this.bb&&this.Tb||(this.vb=new Int32Array(this.Ag),this.bb=new Int32Array(this.Ag),this.Tb=new Int32Array(this.Ag)),!this.sg){this.sg=new a.fe(this.Rd,null);for(let t=0;t8192||A>8192||p>8192||m<-8192||A<-8192||p<-8192;)m>>=1,A>>=1,p>>=1;let g=0|Math.sqrt(m*m+A*A+p*p);if(g<=0&&(g=1),m=256*m/g|0,A=256*A/g|0,p=256*p/g|0,this.mg&&1&this.mg[i]){const r=t+((e*m+s*A+n*p)/(h+(h/2|0))|0);this.Eu&&(this.vb[i]=f.Eb(this.Eu[i],r,this.mg[i]))}else{let t=this.sg[r];t&&(t.x+=m,t.y+=A,t.z+=p,t.w++),t=this.sg[o],t&&(t.x+=m,t.y+=A,t.z+=p,t.w++),t=this.sg[a],t&&(t.x+=m,t.y+=A,t.z+=p,t.w++)}}if(r)this.hg(t,h,e,s,n);else{this.cg=new a.fe(this.Rd,null);for(let t=0;t>16;for(let s=0;s>16,I=I*w-g*d>>16,g=p),0!==t&&(p=I*l-_*a>>16,_=I*a+_*l>>16,I=p),0!==i&&(p=_*c+g*u>>16,_=_*u-g*c>>16,g=p),g+=n,I+=h,_+=o,p=I*m-_*y>>16,_=I*y+_*m>>16,I=p,f.tb&&f.ib&&f.eb&&(f.eb[s]=_-A,f.tb[s]=r.A.rl+((g<<9)/_|0),f.ib[s]=r.A.hl+((I<<9)/_|0)),this.Tv>0&&f.sb&&f.nb&&f.rb&&(f.sb[s]=g,f.nb[s]=I,f.rb[s]=_)}try{this.Hb(!1,!1,0)}catch(t){}}draw(t,i,e,s,h,o,a,l,c){const u=l*h-o*s>>16,d=a*i+u*e>>16,w=this.yA*e>>16,y=d+w;if(y<=50||d>=3500)return;const m=l*s+o*h>>16;let A=m-this.yA<<9;if((A/y|0)>=n.A.zE)return;let p=m+this.yA<<9;if((p/y|0)<=-n.A.zE)return;const g=a*e-u*i>>16,I=this.yA*i>>16;let _=g+I<<9;if((_/y|0)<=-n.A.ZE)return;let C=g-(I+(this.Ud*e>>16))<<9;if((C/y|0)>=n.A.ZE)return;let E=d-(w+(this.Ud*i>>16))<=50,v=!1;if(c>0&&f.pb){let t=d-w;t<=50&&(t=50),m>0?(A=A/y|0,p=p/t|0):(p=p/y|0,A=A/t|0),g>0?(C=C/y|0,_=_/t|0):(_=_/y|0,C=C/t|0);const i=f.Ma-r.A.rl,e=f.Da-r.A.hl;i>A&&iC&&e<_&&(this.Qd?f.Ib[f.gb++]=c:v=!0)}const b=r.A.rl,T=r.A.hl;let R=0,O=0;0!==t&&(R=r.A.sin[t],O=r.A.cos[t]);for(let n=0;n>16,w=w*O-c*R>>16,c=r),c+=o,u+=a,w+=l,r=w*s+c*h>>16,w=w*h-c*s>>16,c=r,r=u*e-w*i>>16,w=u*i+w*e>>16,u=r,f.eb&&(f.eb[n]=w-d),w>=50&&f.tb&&f.ib?(f.tb[n]=b+((c<<9)/w|0),f.ib[n]=T+((u<<9)/w|0)):f.tb&&(f.tb[n]=-5e3,E=!0),(E||this.Tv>0)&&f.sb&&f.nb&&f.rb&&(f.sb[n]=c,f.nb[n]=u,f.rb[n]=w)}try{this.Hb(E,v,c)}catch(t){}}Hb(t,i,e,s=!1){f._b&&(this.Bb=-1,this.Ub=-1);for(let t=0;tn.A.sI||l>n.A.sI||c>n.A.sI),f.ob&&f.hb){const t=((y+m+A)/3|0)+this.Mb;f.ob[t][f.hb[t]++]=s,f._b&&this.Yb(f.Ma,f.Da,u,d,w,a,l,c)&&this.Ub=0;t--){const i=f.hb[t];if(!(i<=0)&&f.ob){const e=f.ob[t];for(let t=0;t=0;t--){const i=f.hb[t];if(i>0&&f.ob){const e=f.ob[t];for(let s=0;s0||f.ab[2]>0)&&(r=(f.ub[1]+f.ub[2])/(f.ab[1]+f.ab[2])|0);let h=0;f.ab&&f.ub&&(f.ab[3]>0||f.ab[4]>0)&&(h=(f.ub[3]+f.ub[4])/(f.ab[3]+f.ab[4])|0);let o=0;if(f.ab&&f.ub&&(f.ab[6]>0||f.ab[8]>0)&&(o=(f.ub[6]+f.ub[8])/(f.ab[6]+f.ab[8])|0),f.ab&&f.lb){let t,i=0,e=f.ab[10],n=f.lb[10],a=f.cb;i===e&&(i=0,e=f.ab[11],n=f.lb[11],a=f.fb),t=ir;)this.Vb(n[i++],s),i===e&&n!==f.lb[11]&&(i=0,e=f.ab[11],n=f.lb[11],a=f.fb),t=ih;)this.Vb(n[i++],s),i===e&&n!==f.lb[11]&&(i=0,e=f.ab[11],n=f.lb[11],a=f.fb),t=io;)this.Vb(n[i++],s),i===e&&n!==f.lb[11]&&(i=0,e=f.ab[11],n=f.lb[11],a=f.fb),t=i>2,h=this.Lb[i],o=this.Sb[i],a=this.xb[i];r.A.fI(f.tb[e],f.tb[s],f.tb[n],f.ib[e],f.ib[s],f.ib[n],this.vb[t],this.bb[t],this.Tb[t],f.sb[h],f.nb[h],f.rb[h],f.sb[o],f.sb[a],f.nb[o],f.nb[a],f.rb[o],f.rb[a],this.Eu[t])}else if(3===h&&this.mg&&this.Eu&&this.vb&&f.tb&&f.ib&&f.sb&&f.nb&&f.rb){const i=this.mg[t]>>2,h=this.Lb[i],o=this.Sb[i],a=this.xb[i];r.A.fI(f.tb[e],f.tb[s],f.tb[n],f.ib[e],f.ib[s],f.ib[n],this.vb[t],this.vb[t],this.vb[t],f.sb[h],f.nb[h],f.rb[h],f.sb[o],f.sb[a],f.nb[o],f.nb[a],f.rb[o],f.rb[a],this.Eu[t])}}Kb(t,i=!1){let e=0;if(f.rb){const i=r.A.rl,s=r.A.hl,n=this.pg[t],h=this.gg[t],o=this.Ig[t],a=f.rb[n],l=f.rb[h],c=f.rb[o];if(a>=50&&f.tb&&f.ib&&this.vb)f.wb[e]=f.tb[n],f.yb[e]=f.ib[n],f.mb[e++]=this.vb[t];else if(f.sb&&f.nb&&this.vb){const u=f.sb[n],d=f.nb[n],w=this.vb[t];if(c>=50&&this.Tb){const n=(50-a)*r.A.ev[c-a];f.wb[e]=i+((u+((f.sb[o]-u)*n>>16)<<9)/50|0),f.yb[e]=s+((d+((f.nb[o]-d)*n>>16)<<9)/50|0),f.mb[e++]=w+((this.Tb[t]-w)*n>>16)}if(l>=50&&this.bb){const n=(50-a)*r.A.ev[l-a];f.wb[e]=i+((u+((f.sb[h]-u)*n>>16)<<9)/50|0),f.yb[e]=s+((d+((f.nb[h]-d)*n>>16)<<9)/50|0),f.mb[e++]=w+((this.bb[t]-w)*n>>16)}}if(l>=50&&f.tb&&f.ib&&this.bb)f.wb[e]=f.tb[h],f.yb[e]=f.ib[h],f.mb[e++]=this.bb[t];else if(f.sb&&f.nb&&this.bb){const u=f.sb[h],d=f.nb[h],w=this.bb[t];if(a>=50&&this.vb){const h=(50-l)*r.A.ev[a-l];f.wb[e]=i+((u+((f.sb[n]-u)*h>>16)<<9)/50|0),f.yb[e]=s+((d+((f.nb[n]-d)*h>>16)<<9)/50|0),f.mb[e++]=w+((this.vb[t]-w)*h>>16)}if(c>=50&&this.Tb){const n=(50-l)*r.A.ev[c-l];f.wb[e]=i+((u+((f.sb[o]-u)*n>>16)<<9)/50|0),f.yb[e]=s+((d+((f.nb[o]-d)*n>>16)<<9)/50|0),f.mb[e++]=w+((this.Tb[t]-w)*n>>16)}}if(c>=50&&f.tb&&f.ib&&this.Tb)f.wb[e]=f.tb[o],f.yb[e]=f.ib[o],f.mb[e++]=this.Tb[t];else if(f.sb&&f.nb&&this.Tb){const u=f.sb[o],d=f.nb[o],w=this.Tb[t];if(l>=50&&this.bb){const n=(50-c)*r.A.ev[l-c];f.wb[e]=i+((u+((f.sb[h]-u)*n>>16)<<9)/50|0),f.yb[e]=s+((d+((f.nb[h]-d)*n>>16)<<9)/50|0),f.mb[e++]=w+((this.bb[t]-w)*n>>16)}if(a>=50&&this.vb){const h=(50-c)*r.A.ev[a-c];f.wb[e]=i+((u+((f.sb[n]-u)*h>>16)<<9)/50|0),f.yb[e]=s+((d+((f.nb[n]-d)*h>>16)<<9)/50|0),f.mb[e++]=w+((this.vb[t]-w)*h>>16)}}}const s=f.wb[0],h=f.wb[1],o=f.wb[2],a=f.yb[0],l=f.yb[1],c=f.yb[2];if(!((s-h)*(c-l)-(a-l)*(o-h)<=0))if(r.A.eI=!1,3===e){let e;if((s<0||h<0||o<0||s>n.A.sI||h>n.A.sI||o>n.A.sI)&&(r.A.eI=!0),e=this.mg?3&this.mg[t]:0,i)r.A.$E(s,h,a,l,f.mb[0]),r.A.$E(h,o,l,c,f.mb[1]),r.A.$E(o,s,c,a,f.mb[2]);else if(0===e)r.A.oI(s,h,o,a,l,c,f.mb[0],f.mb[1],f.mb[2]);else if(1===e&&this.vb)r.A.Cv(s,h,o,a,l,c,r.A.palette[this.vb[t]]);else if(2===e&&this.mg&&this.Eu&&f.sb&&f.nb&&f.rb){const i=this.mg[t]>>2,e=this.Lb[i],n=this.Sb[i],u=this.xb[i];r.A.fI(s,h,o,a,l,c,f.mb[0],f.mb[1],f.mb[2],f.sb[e],f.nb[e],f.rb[e],f.sb[n],f.sb[u],f.nb[n],f.nb[u],f.rb[n],f.rb[u],this.Eu[t])}else if(3===e&&this.mg&&this.Eu&&this.vb&&f.sb&&f.nb&&f.rb){const i=this.mg[t]>>2,e=this.Lb[i],n=this.Sb[i],u=this.xb[i];r.A.fI(s,h,o,a,l,c,this.vb[t],this.vb[t],this.vb[t],f.sb[e],f.nb[e],f.rb[e],f.sb[n],f.sb[u],f.nb[n],f.nb[u],f.rb[n],f.rb[u],this.Eu[t])}}else if(4===e){let e;if((s<0||h<0||o<0||s>n.A.sI||h>n.A.sI||o>n.A.sI||f.wb[3]<0||f.wb[3]>n.A.sI)&&(r.A.eI=!0),e=this.mg?3&this.mg[t]:0,i)r.A.$E(s,h,a,l,f.mb[0]),r.A.$E(h,o,l,c,f.mb[1]),r.A.$E(o,f.wb[3],c,f.yb[3],f.mb[2]),r.A.$E(f.wb[3],s,f.yb[3],a,f.mb[3]);else if(0===e)r.A.oI(s,h,o,a,l,c,f.mb[0],f.mb[1],f.mb[2]),r.A.oI(s,o,f.wb[3],a,c,f.yb[3],f.mb[0],f.mb[2],f.mb[3]);else if(1===e){if(this.vb){const i=r.A.palette[this.vb[t]];r.A.Cv(s,h,o,a,l,c,i),r.A.Cv(s,o,f.wb[3],a,c,f.yb[3],i)}}else if(2===e&&this.mg&&this.Eu&&f.sb&&f.nb&&f.rb){const i=this.mg[t]>>2,e=this.Lb[i],n=this.Sb[i],u=this.xb[i];r.A.fI(s,h,o,a,l,c,f.mb[0],f.mb[1],f.mb[2],f.sb[e],f.nb[e],f.rb[e],f.sb[n],f.sb[u],f.nb[n],f.nb[u],f.rb[n],f.rb[u],this.Eu[t]),r.A.fI(s,o,f.wb[3],a,c,f.yb[3],f.mb[0],f.mb[2],f.mb[3],f.sb[e],f.nb[e],f.rb[e],f.sb[n],f.sb[u],f.nb[n],f.nb[u],f.rb[n],f.rb[u],this.Eu[t])}else if(3===e&&this.mg&&this.Eu&&this.vb&&f.sb&&f.nb&&f.rb){const i=this.mg[t]>>2,e=this.Lb[i],n=this.Sb[i],u=this.xb[i];r.A.fI(s,h,o,a,l,c,this.vb[t],this.vb[t],this.vb[t],f.sb[e],f.nb[e],f.rb[e],f.sb[n],f.sb[u],f.nb[n],f.nb[u],f.rb[n],f.rb[u],this.Eu[t]),r.A.fI(s,o,f.wb[3],a,c,f.yb[3],this.vb[t],this.vb[t],this.vb[t],f.sb[e],f.nb[e],f.rb[e],f.sb[n],f.sb[u],f.nb[n],f.nb[u],f.rb[n],f.rb[u],this.Eu[t])}}}Pb(t,i,e,s,n){if(!s)return;const h=s.length;if(0===n){let n=0;f.Ir=0,f.Ab=0,f._r=0;for(let t=0;t0?(f.Ir=(f.Ir/n|0)+t,f.Ab=(f.Ab/n|0)+i,f._r=(f._r/n|0)+e):(f.Ir=t,f.Ab=i,f._r=e)}else if(1===n)for(let n=0;n=this.Nd.length)continue;const h=this.Nd[r];if(h)for(let s=0;s=this.Nd.length)continue;const o=this.Nd[h];if(o)for(let s=0;s>16;this.Sd[n]=this.Sd[n]*u-this.Od[n]*c>>16,this.Od[n]=t}if(0!==h){c=r.A.sin[h],u=r.A.cos[h];const t=this.Sd[n]*u-this.Ld[n]*c>>16;this.Ld[n]=this.Sd[n]*c+this.Ld[n]*u>>16,this.Sd[n]=t}if(0!==a){c=r.A.sin[a],u=r.A.cos[a];const t=this.Ld[n]*c+this.Od[n]*u>>16;this.Ld[n]=this.Ld[n]*u-this.Od[n]*c>>16,this.Od[n]=t}this.Od[n]+=f.Ir,this.Sd[n]+=f.Ab,this.Ld[n]+=f._r}}else if(3===n)for(let n=0;n=this.Nd.length)continue;const h=this.Nd[r];if(h)for(let s=0;s=this.Dd.length)continue;const n=this.Dd[e];if(n)for(let i=0;i255&&(this.Ob[e]=255)}}}Wb(){this.Ud=0,this.yA=0,this.fg=0,this.ug=999999,this.dg=-999999,this.yg=-99999,this.wg=99999;for(let t=0;tthis.dg&&(this.dg=i),sthis.yg&&(this.yg=s),-e>this.Ud&&(this.Ud=-e),e>this.fg&&(this.fg=e);const n=i*i+s*s;n>this.yA&&(this.yA=n)}this.yA=0|Math.sqrt(this.yA),this.Mb=0|Math.sqrt(this.yA*this.yA+this.Ud*this.Ud),this.kb=this.Mb+(0|Math.sqrt(this.yA*this.yA+this.fg*this.fg))}Yb(t,i,e,s,n,r,h,o){return!(ie&&i>s&&i>n)&&(!(t{e.d(i,{A:()=>o});var s=e(8950),n=e(1069),r=e(4474),h=e(880);class o extends r.A{cw;width;height;jb;zb;Fa;rw;constructor(t,i){super(),this.cw=new Int32Array(t*i),this.width=this.Fa=t,this.height=this.rw=i,this.jb=this.zb=0}static Zb=async(t,i)=>{const e=t.read(i+'.dat');if(!e)throw new Error(`${i} jpeg not found!`);const s=await(0,h.r)(e),n=new o(s.width,s.height),r=new Uint32Array(s.data.buffer),a=n.cw;for(let t=0;t>24&255)<<24|(255&i)<<16|(i>>8&255)<<8|i>>16&255}return n};static Cu=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.lf=s.ou;const h=r.ou,a=r.ou,l=[],c=r.lu-1;for(let t=0;ts.length||r.lf>r.length)throw new Error;const f=r.lu,u=r.lu,d=r.ou,w=r.ou,y=new o(d,w);y.jb=f,y.zb=u,y.Fa=h,y.rw=a;const m=r.lu;if(0===m){const t=y.width*y.height;for(let i=0;is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,a+=i,o+=i}h>0&&r>0&&this.qb(h,r,this.cw,n,a,s.A.cw,e,o)}Na(t,i,e){i|=0,e|=0;let n=(i+=this.jb)+(e+=this.zb)*s.A.fw,r=0,h=this.height,o=this.width,a=s.A.fw-o,l=0;if(es.A.bottom&&(h-=e+h-s.A.bottom),is.A.right){const t=i+o-s.A.right;o-=t,l+=t,a+=t}o>0&&h>0&&this.$b(o,h,this.cw,r,l,s.A.cw,n,a,t)}Jb(t,i){t|=0,i|=0;let e=(t+=this.jb)+(i+=this.zb)*s.A.fw,n=0,r=this.height,h=this.width,o=s.A.fw-h,a=0;if(is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,a+=i,o+=i}h>0&&r>0&&this.Qb(h,r,this.cw,n,a,s.A.cw,e,o)}tT(){const t=this.cw,i=this.width,e=this.height;for(let s=0;s>16&255;r+=t,r<1?r=1:r>255&&(r=255);let h=n>>8&255;h+=i,h<1?h=1:h>255&&(h=255);let o=255&n;o+=e,o<1?o=1:o>255&&(o=255),this.cw[s]=(r<<16)+(h<<8)+o}}}Cw(t,i,e,n){t|=0,i|=0,e|=0,n|=0;try{const r=this.width;let h=0,o=0;const a=this.Fa,l=this.rw,c=(a<<16)/e|0,f=(l<<16)/n|0;t+=(this.jb*e+a-1)/a|0,i+=(this.zb*n+l-1)/l|0,this.jb*e%a!=0&&(h=(a-this.jb*e%a<<16)/e|0),this.zb*n%l!=0&&(o=(l-this.zb*n%l<<16)/n|0),e=e*(this.width-(h>>16))/a|0,n=n*(this.height-(o>>16))/l|0;let u=t+i*s.A.fw,d=s.A.fw-e;if(is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right){const i=t+e-s.A.right;e-=i,d+=i}this.scale(e,n,this.cw,h,o,s.A.cw,d,u,r,c,f)}catch(t){console.error('error in sprite clipping routine')}}eT(t,i,e,n,r,h,o,a,l,c){t|=0,i|=0,e|=0,n|=0;try{const f=-e/2|0,u=-n/2|0,d=65536*Math.sin(l/326.11)|0,w=65536*Math.cos(l/326.11)|0,y=d*c>>8,m=w*c>>8;let A=(o<<16)+u*y+f*m,p=u*m-f*y+(a<<16),g=t+i*s.A.fw;for(let t=0;t>16)+(o>>16)*this.width],n+=m,o-=y;A+=y,p+=m,g+=s.A.fw}}catch(t){}}sT(t,i,e){t|=0,i|=0;let n=(t+=this.jb)+(i+=this.zb)*s.A.fw,r=0,h=this.height,o=this.width,a=s.A.fw-o,l=0;if(is.A.bottom&&(h-=i+h-s.A.bottom),ts.A.right){const i=t+o-s.A.right;o-=i,l+=i,a+=i}o>0&&h>0&&this.nT(o,h,this.cw,l,r,s.A.cw,n,a,e.cw)}scale(t,i,e,s,n,r,h,o,a,l,c){try{const f=s;for(let u=-i;u<0;u++){const i=(n>>16)*a;for(let n=-t;n<0;n++){const t=e[(s>>16)+i];0===t?o++:r[o++]=t,s+=l}n+=c,s=f,o+=h}}catch(t){console.error('error in plot_scale')}}Qb(t,i,e,s,n,r,h,o){const a=-(t>>2);t=-(3&t);for(let l=-i;l<0;l++){for(let t=a;t<0;t++)r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++];for(let i=t;i<0;i++)r[h++]=e[s++];h+=o,s+=n}}$b(t,i,e,s,n,r,h,o,a){const l=256-a;for(let c=-i;c<0;c++){for(let i=-t;i<0;i++){const t=e[s++];if(0===t)h++;else{const i=r[h];r[h++]=((16711935&t)*a+(16711935&i)*l&4278255360)+((65280&t)*a+(65280&i)*l&16711680)>>8}}h+=o,s+=n}}qb(t,i,e,s,n,r,h,o){const a=-(t>>2);t=-(3&t);for(let l=-i;l<0;l++){for(let t=a;t<0;t++){let t=e[s++];0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=t}h+=o,s+=n}}nT(t,i,e,s,n,r,h,o,a){const l=-(t>>2);t=-(3&t);for(let c=-i;c<0;c++){for(let t=l;t<0;t++){let t=e[n++];0!==t&&0===a[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===a[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===a[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===a[h]?r[h++]=t:h++}for(let i=t;i<0;i++){const t=e[n++];0!==t&&0===a[h]?r[h++]=t:h++}h+=o,n+=s}}}},1673:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(8950),n=e(1069),r=e(4474);class h extends r.A{cw;width;height;jb;zb;Fa;rw;palette;constructor(t,i,e){super(),this.cw=new Int8Array(t*i),this.width=this.Fa=t,this.height=this.rw=i,this.jb=this.zb=0,this.palette=e}static Cu=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.lf=s.ou;const o=r.ou,a=r.ou,l=r.lu,c=new Int32Array(l);for(let t=1;ts.length||r.lf>r.length)throw new Error;const f=r.lu,u=r.lu,d=r.ou,w=r.ou,y=new h(d,w,c);y.jb=f,y.zb=u,y.Fa=o,y.rw=a;const m=y.cw,A=r.lu;if(0===A){const t=y.width*y.height;for(let i=0;is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,a+=i,o+=i}h>0&&r>0&&this.rT(h,r,this.cw,n,a,s.A.cw,e,o)}tT(){const t=this.cw,i=this.width,e=this.height;for(let s=0;s>16&255;n+=t,n<0?n=0:n>255&&(n=255);let r=this.palette[s]>>8&255;r+=i,r<0?r=0:r>255&&(r=255);let h=255&this.palette[s];h+=e,h<0?h=0:h>255&&(h=255),this.palette[s]=(n<<16)+(r<<8)+h}}mv(){this.Fa|=0,this.rw|=0,this.Fa/=2,this.rw/=2,this.Fa|=0,this.rw|=0;const t=new Int8Array(this.Fa*this.rw);let i=0;for(let e=0;e>1)+(e+this.zb>>1)*this.Fa]=this.cw[i++];this.cw=t,this.width=this.Fa,this.height=this.rw,this.jb=0,this.zb=0}Cw(){if(this.width===this.Fa&&this.height===this.rw)return;const t=new Int8Array(this.Fa*this.rw);let i=0;for(let e=0;e>2);t=-(3&t);for(let l=-i;l<0;l++){for(let t=a;t<0;t++){let t=e[s++];0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t]}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=this.palette[255&t]}h+=o,s+=n}}clip(t,i,e,n){try{const r=this.width;this.height;let h=0,o=0;const a=this.Fa,l=this.rw,c=(a<<16)/e|0,f=(l<<16)/n|0;t=t+(this.jb*e+a-1)/a|0,i=i+(this.zb*n+l-1)/l|0,this.jb*e%a!=0&&(h=(a-this.jb*e%a<<16)/e|0),this.zb*n%l!=0&&(o=(l-this.zb*n%l<<16)/n|0),e=e*(this.width-(h>>16))/a|0,n=n*(this.height-(o>>16))/l|0;let u,d=t+i*s.A.fw,w=s.A.fw-e;is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right&&(u=t+e-s.A.right,e-=u,w+=u),this.hT(s.A.cw,this.cw,this.palette,h,o,d,w,e,n,c,f,r)}catch(t){console.log('error in sprite clipping routine')}}hT(t,i,e,s,n,r,h,o,a,l,c,f){try{const u=s;for(let d=-a;d<0;d++){const a=(n>>16)*f;for(let n=-o;n<0;n++){const n=i[(s>>16)+a];0==n?r++:t[r++]=e[255&n],s+=l}n+=c,s=u,r+=h}}catch(t){console.log('error in plot_scale')}}}},2682:(t,i,e)=>{e.d(i,{A:()=>a});var s=e(8950),n=e(1069),r=e(4474);class h{seed;constructor(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}oT(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}aT(){return this.next(32)}next(t){return this.seed=0x5deece66dn*this.seed+0xbn&(1n<<48n)-1n,Number(this.seed)>>>48-t}}var o=e(9298);class a extends r.A{static lT='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!"£$%^&*()-_=+[{]};:\'@#~,<.>/?\\| ';static cT=[];static{const t=navigator.userAgent.includes('Capacitor');for(let i=0;i<256;i++){let e=a.lT.indexOf(String.fromCharCode(i));t&&e>=63&&e--,-1===e&&(e=74),a.cT[i]=e}}fT=[];uT=new Int32Array(94);dT=new Int32Array(94);wT=new Int32Array(94);yT=new Int32Array(94);mT=new Int32Array(95);AT=new Int32Array(256);random=new h(BigInt(Date.now()));height=0;static Cu=(t,i)=>{const e=new n.A(t.read(i+'.dat')),s=new n.A(t.read('index.dat'));s.lf=e.ou+4;const r=s.lu;r>0&&(s.lf+=3*(r-1));const h=new a;for(let t=0;t<94;t++){h.wT[t]=s.lu,h.yT[t]=s.lu;const i=h.uT[t]=s.ou,n=h.dT[t]=s.ou,r=s.lu,o=i*n;if(h.fT[t]=new Int8Array(o),0===r)for(let s=0;sh.height&&(h.height=n),h.wT[t]=1,h.mT[t]=i+2;{let e=0;for(let s=n/7|0;s=s.A.bottom&&(r-=e+r+1-s.A.bottom),i=s.A.right){const t=i+n+1-s.A.right;n-=t,l+=t,a+=t}n>0&&r>0&&this.TT(n,r,t,c,l,s.A.cw,o,a,h)}ET(t,i,e,n,r,h,o){e|=0,n|=0;let a=(t|=0)+(i|=0)*s.A.fw,l=s.A.fw-e,c=0,f=0;if(i=s.A.bottom&&(n-=i+n+1-s.A.bottom),t=s.A.right){const i=t+e+1-s.A.right;e-=i,c+=i,l+=i}e>0&&n>0&&this.RT(e,n,s.A.cw,a,l,o,f,c,r,h)}TT(t,i,e,s,n,r,h,o,a){const l=-((t|=0)>>2);t=-(3&t);for(let c=-(i|=0);c<0;c++){for(let t=l;t<0;t++)0===e[s++]?h++:r[h++]=a,0===e[s++]?h++:r[h++]=a,0===e[s++]?h++:r[h++]=a,0===e[s++]?h++:r[h++]=a;for(let i=t;i<0;i++)0===e[s++]?h++:r[h++]=a;h+=o,s+=n}}RT(t,i,e,s,n,r,h,o,a,l){t|=0;const c=((16711935&a)*l&4278255360)+((65280&a)*l&16711680)>>8,f=256-l;for(let a=-(i|=0);a<0;a++){for(let i=-t;i<0;i++)if(0===r[h++])s++;else{const t=e[s];e[s++]=(((16711935&t)*f&4278255360)+((65280&t)*f&16711680)>>8)+c}s+=n,h+=o}}gT(t){return'red'===t?o.A.RED:'gre'===t?o.A.GREEN:'blu'===t?o.A.BLUE:'yel'===t?o.A.Ga:'cya'===t?o.A.ME:'mag'===t?o.A.hA:'whi'===t?o.A.Ia:'bla'===t?o.A.Pa:'lre'===t?o.A.DE:'dre'===t?o.A.NE:'dbl'===t?o.A.FE:'or1'===t?o.A.BE:'or2'===t?o.A.UE:'or3'===t?o.A.PE:'gr1'===t?o.A.GE:'gr2'===t?o.A.WE:'gr3'===t?o.A.HE:o.A.Pa}split(t,i){if(0===t.length)return[t];const e=[];for(;t.length>0;){if(this.IT(t)<=i&&-1===t.indexOf('|')){e.push(t);break}let s=t.length;for(let e=0;ei)break;s=e}else if('|'===t[e]){s=e;break}e.push(t.substring(0,s)),t=t.substring(s+1)}return e}}},1183:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(8950),n=e(7854);class r{OT;width;height;LT;ST;cw;constructor(t,i,e=n.zo){this.LT=e,this.OT=this.LT.getImageData(0,0,t,i),this.ST=new Uint32Array(this.OT.data.buffer),this.cw=new Int32Array(t*i),this.width=t,this.height=i,this.bind()}clear(){this.cw.fill(0)}bind(){s.A.bind(this.cw,this.width,this.height)}draw(t,i){this.#t(),this.LT.putImageData(this.OT,t,i)}#t(){const t=this.cw.length,i=this.cw,e=this.ST;for(let s=0;s>16&255|(t>>8&255)<<8|(255&t)<<16|4278190080}}}},4544:(t,i,e)=>{e.d(i,{A:()=>s});class s{db;constructor(t){t.onerror=this.onerror,t.onclose=this.onclose,this.db=t}static openDatabase=async()=>await new Promise(((t,i)=>{const e=indexedDB.open('lostcity',1);e.onsuccess=i=>{const e=i.target;console.log('database success!'),t(e.result)},e.onupgradeneeded=t=>{t.target.result.createObjectStore('cache')},e.onerror=t=>{const e=t.target;console.error('database error!: ',e.error),i(e.result)}}));Uo=async t=>await new Promise((i=>{const e=this.db.transaction('cache','readonly').objectStore('cache').get(t);e.onsuccess=()=>{i(e.result)},e.onerror=t=>{i(void 0)}}));Yo=async(t,i)=>await new Promise(((e,s)=>{const n=this.db.transaction('cache','readwrite').objectStore('cache').put(i,t);n.onsuccess=()=>{e()},n.onerror=t=>{s()}}));onclose=t=>{console.log('database close!')};onerror=t=>{console.log('database error!')};xT=t=>{const i=t.trim();let e=0;for(let t=0;t='A'&&s<='Z'?e+=s.charCodeAt(0)+1-65:s>='a'&&s<='z'?e+=s.charCodeAt(0)+1-97:s>='0'&&s<='9'&&(e+=s.charCodeAt(0)+27-48)}return e}}},2901:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(1908);class r{static xT=t=>{let i=0;t=t.toUpperCase();for(let e=0;e=this.MT)return null;if(this.UT[t])return this.UT[t];const i=this.BT[t],e=i+this.FT[t];if(this.kT){const s=Uint8Array.from(this.buffer.subarray(i,i+e));return this.UT[t]=s,s}{const i=Uint8Array.from(n.A.read(this.NT[t],this.buffer,this.FT[t],this.BT[t]));return this.UT[t]=i,i}}}},1069:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(9234),n=e(6666),r=e(4474);class h extends r.A{static GT=3988292384;static WT=new Int32Array(256);static HT=new Uint32Array(33);static YT=new n.A;static VT=new n.A;static KT=new n.A;static XT=0;static jT=0;static zT=0;static{for(let t=0;t<32;t++)h.HT[t]=(1<>>=1:i=i>>>1^h.GT;h.WT[t]=i}}static Po=t=>{let i=4294967295;for(let e=0;e>>8^h.WT[255&(i^t[e])];return~i};view;data;lf=0;ZT=0;random=null;constructor(t){if(!t)throw new Error('Input src packet array was null!');super(),t instanceof Int8Array?this.data=new Uint8Array(t):this.data=t,this.view=new DataView(this.data.buffer,this.data.byteOffset,this.data.byteLength)}get length(){return this.view.byteLength}get available(){return this.length-this.lf}static Ut=t=>{let i=null;return 0===t&&h.XT>0?(h.XT--,i=h.YT.Ug()):1===t&&h.jT>0?(h.jT--,i=h.VT.Ug()):2===t&&h.zT>0&&(h.zT--,i=h.KT.Ug()),i?(i.lf=0,i):new h(0===t?new Uint8Array(100):1===t?new Uint8Array(5e3):new Uint8Array(3e4))};release(){this.lf=0,100===this.view.byteLength&&h.XT<1e3?(h.YT.Fm(this),h.XT++):5e3===this.view.byteLength&&h.jT<250?(h.VT.Fm(this),h.jT++):3e4===this.view.byteLength&&h.zT<50&&(h.KT.Fm(this),h.zT++)}get lu(){return this.view.getUint8(this.lf++)}get bd(){return this.view.getInt8(this.lf++)}get ou(){const t=this.view.getUint16(this.lf);return this.lf+=2,t}get fu(){const t=this.view.getInt16(this.lf);return this.lf+=2,t}get Wu(){const t=this.view.getUint8(this.lf++)<<16|this.view.getUint16(this.lf);return this.lf+=2,t}get Ko(){const t=this.view.getInt32(this.lf);return this.lf+=4,t}get JC(){const t=this.view.getBigInt64(this.lf);return this.lf+=8,t}get OE(){return this.view.getUint8(this.lf)<128?this.lu-64:this.ou-49152}get wA(){return this.view.getUint8(this.lf)<128?this.lu:this.ou-32768}get wu(){const t=this.view,i=t.byteLength;let e,s='';for(;10!==(e=t.getUint8(this.lf++))&&this.lf>16),this.view.setUint16(this.lf,t),this.lf+=2}p4(t){this.view.setInt32(this.lf,t),this.lf+=4}QT(t){this.view.setInt32(this.lf,t,!0),this.lf+=4}tR(t){this.view.setBigInt64(this.lf,t),this.lf+=8}iR(t){const i=this.view,e=t.length;for(let s=0;s>>3,e=8-(7&this.ZT),s=0;for(this.ZT+=t;t>e;e=8)s+=(this.view.getUint8(i++)&h.HT[e])<>>e-t&h.HT[t],s}oR(t,i){const e=this.lf;this.lf=0;const n=new Uint8Array(e);this.qT(e,0,n);const r=(0,s.aR)(n),h=(0,s.lR)(r,i,t),o=(0,s.cR)(h);this.lf=0,this.p1(o.length),this.eR(o,o.length,0)}}},3937:(t,i,e)=>{e.d(i,{A:()=>o});class s{start=0;end=0;form=0;length=0;fR=null;uR=null;threshold=0;position=0;delta=0;amplitude=0;dR=0;read(t){this.form=t.lu,this.start=t.Ko,this.end=t.Ko,this.length=t.lu,this.fR=new Int32Array(this.length),this.uR=new Int32Array(this.length);for(let i=0;i=this.threshold&&this.uR&&this.fR&&(this.amplitude=this.uR[this.position++]<<15,this.position>=this.length&&(this.position=this.length-1),this.threshold=this.fR[this.position]/65536*t|0,this.threshold>this.dR&&(this.delta=((this.uR[this.position]<<15)-this.amplitude)/(this.threshold-this.dR)|0)),this.amplitude+=this.delta,this.dR++,this.amplitude-this.delta>>15}}class n{static buffer=null;static Dm=null;static sin=null;static wR=new Int32Array(5);static yR=new Int32Array(5);static mR=new Int32Array(5);static AR=new Int32Array(5);static pR=new Int32Array(5);gR=null;IR=null;_R=null;CR=null;ER=null;vR=null;release=null;attack=null;bR=new Int32Array(5);TR=new Int32Array(5);RR=new Int32Array(5);start=0;length=500;OR=100;LR=0;static init=()=>{this.Dm=new Int32Array(32768);for(let t=0;t<32768;t++)Math.random()>.5?this.Dm[t]=1:this.Dm[t]=-1;this.sin=new Int32Array(32768);for(let t=0;t<32768;t++)this.sin[t]=16384*Math.sin(t/5215.1903)|0;this.buffer=new Int32Array(220500)};SR(t,i){for(let i=0;i>1,h+=(i*s>>16)+r}if(this.ER&&this.vR){const i=this.ER.evaluate(t),e=this.vR.evaluate(t);c=c*(32768+(this.xR(e,l,this.ER.form)>>1))>>15,l+=(i*o>>16)+a}for(let s=0;s<5;s++)if(0!==this.bR[s]){const r=i+n.yR[s];r>15,n.wR[s],this.gR.form),n.wR[s]+=(e*n.AR[s]>>16)+n.pR[s])}}if(this.release&&this.attack){this.release.reset(),this.attack.reset();let i=0,e=!0;for(let s=0;s>8):this.release.start+((this.release.end-this.release.start)*h>>8),i+=256,i>=o&&(i=0,e=!e),e&&(n.buffer[s]=0)}}if(this.LR>0&&this.OR>0){const i=this.LR*e;for(let e=i;e32767&&(n.buffer[i]=32767);return n.buffer}xR(t,i,e){return 1===e?(32767&i)<16384?t:-t:2===e?n.sin[32767&i]*t>>14:3===e?((32767&i)*t>>14)-t:4===e?n.Dm[i/2607&32767]*t:0}read(t){this.gR=new s,this.gR.read(t),this.IR=new s,this.IR.read(t),0!==t.lu&&(t.lf--,this._R=new s,this._R.read(t),this.CR=new s,this.CR.read(t)),0!==t.lu&&(t.lf--,this.ER=new s,this.ER.read(t),this.vR=new s,this.vR.read(t)),0!==t.lu&&(t.lf--,this.release=new s,this.release.read(t),this.attack=new s,this.attack.read(t));for(let i=0;i<10;i++){const e=t.wA;if(0===e)break;this.bR[i]=e,this.TR[i]=t.OE,this.RR[i]=t.wA}this.LR=t.wA,this.OR=t.wA,this.length=t.ou,this.start=t.ou}}var r=e(1069),h=e(3867);class o{static kR=new Int32Array(1e3);static MR=null;static DR=null;static NR=new h.fe(1e3,null);FR=new h.fe(10,null);BR=0;loopEnd=0;static hu=t=>{const i=new r.A(t.read('sounds.dat'));for(this.MR=new Uint8Array(441e3),this.DR=new r.A(this.MR),n.init();;){const t=i.ou;if(65535===t)break;const e=new o;e.read(i),this.NR[t]=e,this.kR[t]=e.trim()}};static SR=(t,i)=>{if(!this.NR[t])return null;const e=this.NR[t];return e?.UR(i)??null};read(t){for(let i=0;i<10;i++)0!==t.lu&&(t.lf--,this.FR[i]=new n,this.FR[i]?.read(t));this.BR=t.ou,this.loopEnd=t.ou}trim(){let t=9999999;for(let i=0;i<10;i++)this.FR[i]&&(this.FR[i].start/20|0)i&&(i=this.FR[t].length+this.FR[t].start);if(0===i)return 0;let e=22050*i/1e3|0,s=22050*this.BR/1e3|0,n=22050*this.loopEnd/1e3|0;(s<0||n<0||n>e||s>=n)&&(t=0);let r=e+(n-s)*(t-1);for(let t=44;t>8<<24>>24)}if(t>1){s+=44,n+=44,e+=44,r+=44;const i=r-e;for(let t=e-1;t>=n;t--)o.MR&&(o.MR[t+i]=o.MR[t]);for(let i=1;i{e.d(i,{tA:()=>l,Qm:()=>o,fe:()=>s,CA:()=>n,Eh:()=>r,pA:()=>h,Xr:()=>a});class s extends Array{constructor(t,i){super(t);for(let e=0;e{e.d(i,{cR:()=>o,Wo:()=>n,aR:()=>h,Ho:()=>s,Xl:()=>r,lR:()=>a});const s=async t=>new Promise((i=>setTimeout(i,t))),n=async t=>new Int8Array(await(await fetch(t)).arrayBuffer()),r=async t=>(await fetch(t)).text();function h(t){let i=0n;for(let e=0;e0n;)i.unshift(Number(0xffn&t)),t>>=8n;return 128&i[0]&&i.unshift(0),new Uint8Array(i)}function a(t,i,e){let s=1n;for(;i>0n;)i%2n===1n&&(s=s*t%e),t=t*t%e,i>>=1n;return s}},7953:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1069);class n{static PR=new Uint16Array(['d','o','t'].join('').split('').map((t=>t.charCodeAt(0))));static GR=new Uint16Array(['(','a',')'].join('').split('').map((t=>t.charCodeAt(0))));static WR=new Uint16Array(['s','l','a','s','h'].join('').split('').map((t=>t.charCodeAt(0))));static HR=['cook',"cook's",'cooks','seeks','sheet'];static YR=[];static VR=[];static KR=[];static XR=[];static jR=[];static zR=[];static hu=t=>{const i=new s.A(t.read('fragmentsenc.txt')),e=new s.A(t.read('badenc.txt')),n=new s.A(t.read('domainenc.txt')),r=new s.A(t.read('tldlist.txt'));this.read(e,n,i,r)};static filter=t=>{const i=[...t];this.format(i);const e=i.join('').trim(),s=e.toLowerCase(),n=[...s];this.ZR(n),this.qR(n),this.$R(n),this.JR(n);for(let t=0;t{this.iO(t),this.eO(i),this.sO(e),this.nO(s)};static nO=t=>{const i=t.Ko;for(let e=0;et.lu))};static iO=t=>{const i=t.Ko;for(let e=0;et.lu));const i=new Array(t.lu).fill([]).map((()=>[t.bd,t.bd]));i.length>0&&(this.XR[e]=i)}};static eO=t=>{const i=t.Ko;for(let e=0;et.lu))};static sO=t=>{const i=t.Ko;for(let e=0;e{const i=[...t],e=[...t];this.rO(null,i,this.PR),this.rO(null,e,this.WR);for(let s=0;s{for(let i=0;i<2;i++)for(let i=this.KR.length-1;i>=0;i--)this.rO(this.XR[i],t,this.KR[i])};static $R=t=>{const i=[...t],e=[...t];this.rO(null,i,this.GR),this.rO(null,e,this.PR);for(let s=this.jR.length-1;s>=0;s--)this.oO(e,i,this.jR[s],t)};static JR=t=>{for(let i=0;i=0&&n{if(this.wO(t))return!0;const i=this.yO(t),e=this.zR,s=e.length;if(i===e[0]||i===e[s-1])return!0;let n=0,r=s-1;for(;n<=r;){const t=(n+r)/2|0;if(i===e[t])return!0;i{if(t.length>6)return 0;let i=0;for(let e=0;e{for(let e=i;e=0;e++)if(this.AO(t[e]))return e;return-1};static uO=(t,i)=>{for(let e=t;e=0;e++)if(!this.AO(i[e]))return e;return i.length};static pO=(t,i,e)=>i===e||'o'===i&&'0'===e?1:'o'===i&&'('===e&&')'===t?2:'c'!==i||'('!==e&&'<'!==e&&'['!==e?'e'===i&&'€'===e||'s'===i&&'$'===e||'l'===i&&'i'===e?1:0:1;static oO=(t,i,e,s)=>{const n=e.length,r=s.length;for(let h=0;h<=r-n;h++){const{gO:n,IO:r}=this._O(h,e,s);if(!n)continue;const o=this.CO(h,s,3,i,['@']),a=this.EO(r-1,s,3,t,['.',',']);(o>2||a>2)&&this.fO(h,r,s)}};static _O=(t,i,e)=>{const s=i.length;let n=t,r=0;for(;n0)n+=a,r++;else{if(0===r)break;const e=this.pO(o,String.fromCharCode(i[r-1]),h);if(e>0)n+=e,1===r&&t++;else{if(r>=s||!this.lO(h))break;n++}}}return{gO:r>=s,IO:n}};static rO=(t,i,e)=>{if(!(e.length>i.length))for(let s=0;s<=i.length-e.length;s++){let n=s;const{IO:r,vO:h,bO:o,TO:a,RO:l}=this.OO(i,e,n);n=r;let c=i[n],f=n+1=e.length)||a&&l)continue;let u,d=!0;if(o){let t=!1,e=!1;if((s-1<0||this.lO(i[s-1])&&"'"!==i[s-1])&&(t=!0),(n>=i.length||this.lO(i[n])&&"'"!==i[n])&&(e=!0),!t||!e){let e=!1;for(u=s-2,t&&(u=s);!e&&u=0&&(!this.lO(i[u])||"'"===i[u])){const t=[];let s;for(s=0;s<3&&u+s=0&&(!this.lO(i[u-1])||"'"===i[u-1])&&(n=!1),n&&!this.dO(t)&&(e=!0)}u++}e||(d=!1)}}else{c=' ',s-1>=0&&(c=i[s-1]),f=' ',n{let s=e,n=0,r=0,h=!1,o=!1,a=!1;for(;s=t.length||o&&a);){const l=t[s],c=s+10)1===f&&this.AO(l)&&(o=!0),2===f&&(this.AO(l)||this.AO(c))&&(o=!0),s+=f,n++;else{if(0===n)break;let t;if((t=this.kO(c,String.fromCharCode(i[n-1]),l))>0)s+=t;else{if(n>=i.length||!this.cO(l))break;if(this.lO(l)&&"'"!==l&&(h=!0),this.AO(l)&&(a=!0),s++,r++,(100*r/(s-e)|0)>90)break}}}return{IO:s,vO:n,bO:h,TO:o,RO:a}};static kO=(t,i,e)=>{if(i===e)return 1;if(i>='a'&&i<='m'){if('a'===i)return'4'!==e&&'@'!==e&&'^'!==e?'/'===e&&'\\'===t?2:0:1;if('b'===i)return'6'!==e&&'8'!==e?'1'===e&&'3'===t?2:0:1;if('c'===i)return'('!==e&&'<'!==e&&'{'!==e&&'['!==e?0:1;if('d'===i)return'['===e&&')'===t?2:0;if('e'===i)return'3'!==e&&'€'!==e?0:1;if('f'===i)return'p'===e&&'h'===t?2:'£'===e?1:0;if('g'===i)return'9'!==e&&'6'!==e?0:1;if('h'===i)return'#'===e?1:0;if('i'===i)return'y'!==e&&'l'!==e&&'j'!==e&&'1'!==e&&'!'!==e&&':'!==e&&';'!==e&&'|'!==e?0:1;if('j'===i)return 0;if('k'===i)return 0;if('l'===i)return'1'!==e&&'|'!==e&&'i'!==e?0:1;if('m'===i)return 0}if(i>='n'&&i<='z'){if('n'===i)return 0;if('o'===i)return'0'!==e&&'*'!==e?'('===e&&')'===t||'['===e&&']'===t||'{'===e&&'}'===t||'<'===e&&'>'===t?2:0:1;if('p'===i)return 0;if('q'===i)return 0;if('r'===i)return 0;if('s'===i)return'5'!==e&&'z'!==e&&'$'!==e&&'2'!==e?0:1;if('t'===i)return'7'!==e&&'+'!==e?0:1;if('u'===i)return'v'===e?1:'\\'===e&&'/'===t||'\\'===e&&'|'===t||'|'===e&&'/'===t?2:0;if('v'===i)return'\\'===e&&'/'===t||'\\'===e&&'|'===t||'|'===e&&'/'===t?2:0;if('w'===i)return'v'===e&&'v'===t?2:0;if('x'===i)return')'===e&&'('===t||'}'===e&&'{'===t||']'===e&&'['===t||'>'===e&&'<'===t?2:0;if('y'===i)return 0;if('z'===i)return 0}return i>='0'&&i<='9'?'0'===i?'o'===e||'O'===e?1:'('===e&&')'===t||'{'===e&&'}'===t||'['===e&&']'===t?2:0:'1'===i&&'l'===e?1:0:','===i?'.'===e?1:0:'.'===i?','===e?1:0:'!'===i&&'i'===e?1:0};static SO=(t,i,e)=>{let s=0,n=i.length-1;for(;s<=n;){const r=(s+n)/2|0;if(i[r][0]===t&&i[r][1]===e)return!0;tthis.mO(t)?t.charCodeAt(0)+1-'a'.charCodeAt(0):"'"===t?28:this.AO(t)?t.charCodeAt(0)+29-'0'.charCodeAt(0):27;static hO=(t,i,e,s,n)=>{if(!(s.length>e.length))for(let r=0;r<=e.length-s.length;r++){const{IO:h,MO:o}=this.DO(e,s,r);if(o0&&c>0&&(a=!0),2===i&&(l>2&&c>0||l>0&&c>2)&&(a=!0),3===i&&l>0&&c>2&&(a=!0),!a)continue;let f,u=r,d=h-1,w=!1;if(l>2){if(4===l)for(w=!1,f=r-1;f>=0;f--)if(w){if('*'!==n[f])break;u=f}else'*'===n[f]&&(u=f,w=!0);for(w=!1,f=u-1;f>=0;f--)if(w){if(this.lO(e[f]))break;u=f}else this.lO(e[f])||(w=!0,u=f)}if(c>2){if(4===c)for(w=!1,f=d+1;f{let s=0;for(;e0)e+=h,s++;else{if(0===s)break;let t;if((t=this.pO(r,String.fromCharCode(i[s-1]),n))>0)e+=t;else{if(!this.lO(n))break;e++}}}return{IO:e,MO:s}};static lO=t=>!this.xO(t)&&!this.AO(t);static cO=t=>!this.mO(t)||('v'===t||'x'===t||'j'===t||'q'===t||'z'===t);static xO=t=>this.mO(t)||this.NO(t);static AO=t=>t>='0'&&t<='9';static mO=t=>t>='a'&&t<='z';static NO=t=>t>='A'&&t<='Z';static wO=t=>{for(let i=0;i{for(let s=t;s{let e=0;for(let s=i-1;s>=0&&this.lO(t[s]);s--)'*'===t[s]&&e++;return e};static BO=(t,i)=>{let e=0;for(let s=i+1;s(n?this.FO(i,e):this.BO(i,e))>=s?4:this.lO(n?t[e-1]:t[e+1])?1:0;static CO=(t,i,e,s,n)=>{if(0===t)return 2;for(let e=t-1;e>=0&&this.lO(i[e]);e--)if(n.includes(i[e]))return 3;return this.UO(i,s,t,e,!0)};static EO=(t,i,e,s,n)=>{if(t+1===i.length)return 2;for(let e=t+1;e{let i=0;for(let e=0;et>=' '&&t<=''||' '===t||'\n'===t||'\t'===t||'£'===t||'€'===t;static QR=(t,i)=>{for(let e=0;e{let i=!0;for(let e=0;e{e.a(t,(async(t,i)=>{try{var s=e(1312),n=e(5637),r=e(2164),h=e(1302),o=e(6948),a=e(8317),l=e(8738),c=e(3764),f=e(1120),u=e(3709),d=e(8950),w=e(4583),y=e(2682),m=e(8665),A=e(8534),p=e(6730),g=e(7953),I=e(9234),_=e(1069),C=e(3937),E=e(4544),v=e(7854),b=e(1673),T=e(1908),R=e(1651),O=e(7604);class t extends R.K{GO=[];WO=[];HO=-1;YO=new o.A(-1);VO=-1;KO='';async XO(t){const i=new Map,e=(await(0,I.Xl)(t)).split('\n');for(let t=0;t{if(this.kt)this.Mt=!0;else{this.kt=!0;try{await this.Go(10,'Connecting to fileserver'),await T.A.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new E.A(await E.A.openDatabase());const t=new _.A(new Uint8Array(await(0,I.Wo)(`${R.K.nt}/crc`)));for(let i=0;i<9;i++)this.Bt[i]=t.Ko;const i=await this.Bo('title','title screen',this.Bt[1],10);this.di=y.A.Cu(i,'p11'),this.wi=y.A.Cu(i,'p12'),this.yi=y.A.Cu(i,'b12'),this.mi=y.A.Cu(i,'q8');const e=await this.Bo('config','config',this.Bt[2],15),d=await this.Bo('interface','interface',this.Bt[3],20),v=await this.Bo('media','2d graphics',this.Bt[4],30),O=await this.Bo('models','3d graphics',this.Bt[5],40),L=await this.Bo('textures','textures',this.Bt[6],60),S=await this.Bo('wordenc','chat system',this.Bt[7],65),x=await this.Bo('sounds','sound effects',this.Bt[8],70),k=new _.A(new Uint8Array(await(0,I.Wo)(`${R.K.nt}/server/mesanim.dat`)));await this.Go(75,'Unpacking media'),this.re=b.A.Cu(v,'chatback',0),await this.Go(80,'Unpacking textures'),w.A.yv(L),w.A.pv(.8),w.A.Iv(20),await this.Go(83,'Unpacking models'),m.A.hu(O),A.A.hu(O),p.A.hu(O),await this.Go(86,'Unpacking config'),s.A.hu(e),n.A.hu(e),r.A.hu(e),h.A.hu(e,!0),o.A.hu(e),a.A.hu(e),l.A.hu(e),c.A.hu(e),u.A.hu(k),await this.jO(),await this.zO(),await this.Go(90,'Unpacking sounds'),C.A.hu(x),await this.Go(92,'Unpacking interfaces'),f.A.hu(d,v,[this.di,this.wi,this.yi,this.mi]),await this.Go(97,'Preparing game engine'),g.A.hu(S),await this.Go(100,'Getting ready to start...'),this.xo?.bind(),w.A.Tc();const M=document.querySelector('#authentic');null!==M&&(M.onchange=()=>{this.ZO()});const D=document.querySelector('#newline');null!==D&&(D.onclick=()=>{this.KO+='|',this.ZO()});const N=document.querySelector('#clear');null!==N&&(N.onclick=()=>{this.KO='',this.ZO()}),this.qO('bla'),this.qO('red'),this.qO('gre'),this.qO('blu'),this.qO('yel'),this.qO('cya'),this.qO('mag'),this.qO('whi'),this.qO('lre'),this.qO('dre'),this.qO('dbl'),this.qO('or1'),this.qO('or2'),this.qO('or3'),this.qO('gr1'),this.qO('gr2'),this.qO('gr3'),this.YO=o.A.get(0),this.VO=0,this.ZO()}catch(t){this.Dt=!0,console.error(t)}}};update=async()=>{this.Mt||this.Dt||this.Nt||(this.Ft++,this.$O())};draw=async()=>{this.Mt||this.Dt||this.Nt?this.jo():(d.A.clear(),this.JO(),this.xo?.draw(0,0))};async jO(){this.GO[1]=await this.XO(`${R.K.lt}/data/src/pack/npc.pack`);const t=document.querySelector('#npcs');if(!t)return;t.innerHTML='';const i=document.createElement('input');i.type='search',i.placeholder='Search',i.tabIndex=1,i.oninput=()=>{const t=i.value.toLowerCase().replaceAll(' ','_'),e=document.querySelector('#npcList');if(e)for(let i=0;i-1?s.style.display='':s.style.display='none'}},t.appendChild(i);const e=document.createElement('ul');e.id='npcList',e.className='list-group',t.appendChild(e);for(const[t,i]of this.GO[1]){const s=o.A.get(t);if(null===s.Yu||0===s.Yu.length)continue;const n=document.createElement('li');n.id=i,n.className='list-group-item',0===t&&(n.className+=' active'),n.innerText=i+' ('+t+')',n.onclick=()=>{const i=e.querySelector('.active');i&&(i.className='list-group-item'),n.className='list-group-item active',this.YO=o.A.get(t),this.QO(this.YO,this.VO,this.KO)},e.appendChild(n)}}async zO(){const t=document.querySelector('#mesanims');if(!t)return;t.innerHTML='';const i=document.createElement('input');i.type='search',i.placeholder='Search',i.tabIndex=2,i.oninput=()=>{const t=i.value.toLowerCase().replaceAll(' ','_'),e=document.querySelector('#mesanimList');if(e)for(let i=0;i-1?s.style.display='':s.style.display='none'}},t.appendChild(i);const e=document.createElement('ul');e.id='mesanimList',e.className='list-group',t.appendChild(e);for(const t of u.A.Lo){const i=t.id,s=t.Ru??`mesanim_${t.id}`,n=document.createElement('li');n.id=s,n.className='list-group-item',0===i&&(n.className+=' active'),n.innerText=s+' ('+i+')',n.onclick=()=>{const t=e.querySelector('.active');t&&(t.className='list-group-item'),n.className='list-group-item active',this.VO=i,this.ZO()},e.appendChild(n)}}qO(t){const i=document.querySelector(`#${t}`);null!==i&&(i.onclick=()=>{this.KO+=`@${t}@`,this.ZO()})}$O(){let t=!1;for(;;){const i=this.xc();if(-1===i)break;if(document.activeElement!==v.bc)continue;-1!==y.A.lT.indexOf(String.fromCharCode(i))?(this.KO+=String.fromCharCode(i),t=!0):8===i&&this.KO.length>0?(this.KO=this.KO.substring(0,this.KO.length-1),t=!0):10!==i&&13!==i||(this.KO+='|',t=!0)}t&&-1!==this.KO.indexOf('\\n')&&(this.KO=this.KO.replaceAll('\\n','|')),t&&this.ZO()}JO(){this.re?.draw(0,0),this.oa(this.hs,1);try{this.ya(f.A.Lo[this.hs],0,0,0)}catch(t){console.error(t)}}ZO(){if(-1===this.VO||!this.mi)return;this.tL(this.KO,380,4,this.mi,this.VO),this.iL()>1&&(this.KO=''),this.QO(this.YO,this.VO,this.KO);const t=document.querySelector('#export');if(t){const i=u.A.Lo[this.VO],e=document.querySelector('#authentic');if(null===e||!1===e.checked){const e='default'===i.Ru?'"default"':i.Ru??`mesanim_${i.id}`;t.value=`~chatnpc(${e}, "${this.KO}");`}else t.value=`~chatnpc("${this.KO}");`}}tL(t,i,e,s,n){const r=s.split(t,i);for(this.WO=[],this.HO=n;r.length>0;)this.WO.push(r.splice(0,e))}eL(t,i){return this.WO[t][i]}iL(){return this.WO.length}sL(t){return this.WO[t].length}nL(t){if(-1===this.HO)return-1;const i=u.A.Lo[this.HO],e=this.sL(t);return i.Pd[e-1]}QO(t,i,e){if(!this.mi||-1===i)return;this.tL(e,380,4,this.mi,i);const s=this.iL();for(let i=0;i{})),window.onkeydown=function(t){return!(' '===t.key&&(t.target===document.body||t.target===v.bc))},i()}catch(t){i(t)}}),1)},1908:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(9763);class n{static hL=null;static load=async t=>{this.hL=await(0,s.F)(new WebAssembly.Module(t),{env:void 0})};static read=(t,i,e,s)=>{if(!this.hL)throw new Error('bz2 not found!!');return Int8Array.from(this.hL.read(t,i,e,s))}}},123:(t,i,e)=>{function s(t,i){window._tinyMidiPlay&&window._tinyMidiPlay(t,i/256)}function n(){window._tinyMidiStop&&window._tinyMidiStop()}e.d(i,{Xo:()=>s,Ro:()=>n})},9763:(t,i,e)=>{async function s(t,i={}){const e={env:Object.assign(Object.create(globalThis),i.env||{},{abort(t,i,e,s){t=h(t>>>0),i=h(i>>>0),e>>>=0,s>>>=0,(()=>{throw Error(`${t} in ${i}:${e}:${s}`)})()}})},{exports:s}=await WebAssembly.instantiate(t,e),n=s.memory||i.env.memory,r=Object.setPrototypeOf({read:(t,i,e,r)=>(i=function(t,i,e,r,h){if(null==r)return 0;const o=r.length,a=s.__pin(s.__new(o<>>0;if(h)new h(n.buffer,a,o).set(r);else for(let i=0;i>>0),r[i]);return s.__unpin(a),a}(a,6,0,i,Int8Array)||function(){throw TypeError("value must not be null")}(),function(t,i,e){if(!e)return null;const s=function(t){try{return o.getUint32(t,!0)}catch{return o=new DataView(n.buffer),o.getUint32(t,!0)}}(e-4)>>>i,r=new Array(s);for(let n=0;n>>0));return r}(l,0,s.read(t,i,e,r)>>>0))},s);function h(t){if(!t)return null;const i=t+new Uint32Array(n.buffer)[t-4>>>2]>>>1,e=new Uint16Array(n.buffer);let s=t>>>1,r="";for(;i-s>1024;)r+=String.fromCharCode(...e.subarray(s,s+=1024));return r+String.fromCharCode(...e.subarray(s,i))}let o=new DataView(n.buffer);function a(t,i){try{o.setUint8(t,i,!0)}catch{o=new DataView(n.buffer),o.setUint8(t,i,!0)}}function l(t){try{return o.getInt8(t,!0)}catch{return o=new DataView(n.buffer),o.getInt8(t,!0)}}return r}e.d(i,{F:()=>s})},9896:(t,i,e)=>{var s=e(8151);!function(){window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioContext&&(window.audioContext=new window.AudioContext);var t=function(i){if(window.audioContext){var e=window.audioContext.createBuffer(1,1,22050),s=window.audioContext.createBufferSource();s.buffer=e,s.connect(window.audioContext.destination),s.start?s.start(0):s.play?s.play(0):s.noteOn&&s.noteOn(0)}document.removeEventListener('touchstart',t),document.removeEventListener('touchend',t),document.removeEventListener('click',t)};document.addEventListener('touchstart',t),document.addEventListener('touchend',t),document.addEventListener('click',t)}(),(async()=>{let t=new Float32Array,i=window.audioContext.createGain();i.gain.value=.1,i.connect(window.audioContext.destination);let e=window.audioContext.currentTime,n=[];const r=new s.A({oL:30,aL:i=>{let e=new Float32Array(i.buffer),s=new Float32Array(t.length+e.length);s.set(t,0),s.set(e,t.length),t=s},lL:t=>{},bufferSize:102400});await r.init();const h=await fetch('./SCC1_Florestan.sf2'),o=new Uint8Array(await h.arrayBuffer());function a(){if(!window.audioContext||!t.length)return;let s=window.audioContext.createBufferSource();const r=t.length/2,h=window.audioContext.createBuffer(2,r,44100);for(let i=0;i<2;i++){const e=h.getChannelData(i);let s=i;for(let i=0;i{if(l&&clearInterval(l),t=new Float32Array,n.length){let t=i.gain.value;i.gain.value=0,n.forEach((t=>{t.stop(window.audioContext.currentTime)})),n=[],i.gain.value=t}},window._tinyMidiVolume=(t=1)=>{i.gain.value=t},window._tinyMidiPlay=async(t,i=1)=>{t&&(await window._tinyMidiStop(),-1!=i&&window._tinyMidiVolume(i),e=window.audioContext.currentTime,l=setInterval(a,250),r.fL(t))}})()},8151:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5473);const n=class{constructor(t={}){this.uL=void 0,this.dL=0,this.wL=0,this.yL=0,this.oL=t.oL||100,this.sampleRate=t.sampleRate||44100,this.mL=t.mL||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.AL(1),this.aL=t.aL||(()=>{}),this.lL=t.lL||(()=>{}),this.pL=void 0,this.test=0}async init(){if(!this.uL){if('undefined'!=typeof process){const{gL:t}=await import('path'),{IL:i}=await import('module');globalThis.__dirname=t("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js"),globalThis.require=i("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js")}this.uL=await(0,s.A)(),this._L=this.uL._malloc(this.bufferSize),this.CL=this.uL._malloc(8)}}AL(t){this.bufferSize=4*this.sampleRate*this.mL*t}EL(){if(!this.uL)throw new Error(`${this.constructor.name} not initalized. call .init()`)}cL(t){this.EL();const{_malloc:i,_free:e,_tsf_load_memory:s,_tsf_set_output:n,_tsf_channel_set_bank_preset:r,_tsf_set_max_voices:h,_tsf_channel_set_presetnumber:o}=this.uL;e(this.dL),this.dL=i(t.length),this.uL.HEAPU8.set(t,this.dL),this.wL=s(this.dL,t.length),n(this.wL,2===this.mL?0:2,this.sampleRate,this.gain)}vL(){this.EL();const t=new Uint8Array(this.bufferSize);return t.set(this.uL.HEAPU8.subarray(this._L,this._L+this.bufferSize)),t}bL(t){const{_malloc:i,_free:e,_tml_load_memory:s}=this.uL;return e(this.yL),this.yL=i(t.length),this.uL.HEAPU8.set(t,this.yL),s(this.yL,t.length)}TL(t){const{_midi_render:i}=this.uL;return i(this.wL,t,this.mL,this.sampleRate,this._L,this.bufferSize,this.CL)}fL(t){if(this.EL(),!this.wL)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.pL);const{setValue:i,getValue:e}=this.uL;i(this.CL,0,'double'),this.uL._tsf_reset(this.wL),this.uL._tsf_channel_set_bank_preset(this.wL,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let s=this.bL(t);const n=()=>{s=this.TL(s);const t=this.vL();this.aL(t),s?this.pL=setTimeout(n,this.oL):this.lL(e(this.CL,'double'))};this.pL=setTimeout(n,16)}}},8227:(t,i,e)=>{t.exports=e.p+"9f86b5397894e28b5ae2.wasm"},5473:(t,i,e)=>{var s;e.d(i,{A:()=>n});const n=(s="file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/tinymidipcm.mjs",function(t){var i,n,r=void 0!==(t=t||{})?t:{};r.ready=new Promise((function(t,e){i=t,n=e})),["_tsf_load_memory","_tsf_set_output","_tsf_channel_set_bank_preset","_tsf_set_max_voices","_tsf_channel_set_presetnumber","_tsf_reset","_tsf_close","_tml_load_memory","_midi_render","_malloc","_realloc","_free","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(r.ready,t)||Object.defineProperty(r.ready,t,{get:()=>j('You are getting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),set:()=>j('You are setting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js')})}));var h=Object.assign({},r),o=[],a='object'==typeof window,l='function'==typeof importScripts,c='object'==typeof process&&'object'==typeof process.versions&&'string'==typeof process.versions.node,f=!a&&!c&&!l;if(r.ENVIRONMENT)throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');var u,d,w,y='';if(c){if('undefined'==typeof process||!process.release||'node'!==process.release.name)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');var m,A;y=l?require('path').gL(y)+'/':__dirname+'/';var p=()=>{A||(m=require('fs'),A=require('path'))};u=(t,i)=>(p(),t=A.normalize(t),m.RL(t,i?void 0:'utf8')),w=t=>{var i=u(t,!0);return i.buffer||(i=new Uint8Array(i)),D(i.buffer),i},d=(t,i,e)=>{p(),t=A.normalize(t),m.OL(t,(function(t,s){t?e(t):i(s.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,'/'),o=process.argv.slice(2),process.on('uncaughtException',(function(t){if(!(t instanceof nt))throw t})),process.on('unhandledRejection',(function(t){throw t})),r.inspect=function(){return'[Emscripten Module object]'}}else if(f){if('object'==typeof process&&'function'==typeof require||'object'==typeof window||'function'==typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');'undefined'!=typeof read&&(u=function(t){return read(t)}),w=function(t){let i;return'function'==typeof readbuffer?new Uint8Array(readbuffer(t)):(i=read(t,'binary'),D('object'==typeof i),i)},d=function(t,i,e){setTimeout((()=>i(w(t))),0)},'undefined'!=typeof scriptArgs?o=scriptArgs:void 0!==arguments&&(o=arguments),'undefined'!=typeof print&&('undefined'==typeof console&&(console={}),console.log=print,console.warn=console.error='undefined'!=typeof printErr?printErr:print)}else{if(!a&&!l)throw new Error('environment detection error');if(l?y=self.location.href:'undefined'!=typeof document&&document.currentScript&&(y=document.currentScript.src),s&&(y=s),y=0!==y.indexOf('blob:')?y.substr(0,y.replace(/[?#].*/,"").lastIndexOf('/')+1):'','object'!=typeof window&&'function'!=typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');u=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.send(null),i.responseText},l&&(w=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.responseType='arraybuffer',i.send(null),new Uint8Array(i.response)}),d=(t,i,e)=>{var s=new XMLHttpRequest;s.open('GET',t,!0),s.responseType='arraybuffer',s.onload=()=>{200==s.status||0==s.status&&s.response?i(s.response):e()},s.onerror=e,s.send(null)}}r.print||console.log.bind(console);var g,I,_=r.printErr||console.warn.bind(console);function C(t,i){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){j('Module.'+t+' has been replaced with plain '+i+' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')}})}function E(t){return'FS_createPath'===t||'FS_createDataFile'===t||'FS_createPreloadedFile'===t||'FS_unlink'===t||'addRunDependency'===t||'FS_createLazyFile'===t||'FS_createDevice'===t||'removeRunDependency'===t}Object.assign(r,h),h=null,g='fetchSettings',Object.getOwnPropertyDescriptor(r,g)&&j('`Module.'+g+'` was supplied but `'+g+'` not included in INCOMING_MODULE_JS_API'),r.arguments&&(o=r.arguments),C('arguments','arguments_'),r.thisProgram&&r.thisProgram,C('thisProgram','thisProgram'),r.quit&&r.quit,C('quit','quit_'),D(void 0===r.memoryInitializerPrefixURL,'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.pthreadMainPrefixURL,'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.cdInitializerPrefixURL,'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.filePackagePrefixURL,'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.read,'Module.read option was removed (modify read_ in JS)'),D(void 0===r.readAsync,'Module.readAsync option was removed (modify readAsync in JS)'),D(void 0===r.readBinary,'Module.readBinary option was removed (modify readBinary in JS)'),D(void 0===r.setWindowTitle,'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'),D(void 0===r.TOTAL_MEMORY,'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'),C('read','read_'),C('readAsync','readAsync'),C('readBinary','readBinary'),C('setWindowTitle','setWindowTitle'),D(!f,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),r.wasmBinary&&(I=r.wasmBinary),C('wasmBinary','wasmBinary');var v;r.noExitRuntime;C('noExitRuntime','noExitRuntime'),'object'!=typeof WebAssembly&&j('no native wasm support detected');var b,T,R,O,L,S,x,k,M=!1;function D(t,i){t||j('Assertion failed'+(i?': '+i:''))}function N(t){b=t,r.HEAP8=T=new Int8Array(t),r.HEAP16=O=new Int16Array(t),r.HEAP32=L=new Int32Array(t),r.HEAPU8=R=new Uint8Array(t),r.HEAPU16=new Uint16Array(t),r.HEAPU32=S=new Uint32Array(t),r.HEAPF32=x=new Float32Array(t),r.HEAPF64=k=new Float64Array(t)}'undefined'!=typeof TextDecoder&&new TextDecoder('utf8');var F=5242880;r.TOTAL_STACK&&D(F===r.TOTAL_STACK,'the stack size can no longer be determined at runtime');var B=r.INITIAL_MEMORY||16777216;function U(){if(!M){var t=ft(),i=S[t>>2],e=S[t+4>>2];34821223==i&&2310721022==e||j('Stack overflow! Stack cookie has been overwritten at 0x'+t.toString(16)+', expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+e.toString(16)+' 0x'+i.toString(16)),1668509029!==S[0]&&j('Runtime error: The application has corrupted its heap memory area (address zero)!')}}C('INITIAL_MEMORY','INITIAL_MEMORY'),D(B>=F,'INITIAL_MEMORY should be larger than TOTAL_STACK, was '+B+'! (TOTAL_STACK='+F+')'),D('undefined'!=typeof Int32Array&&'undefined'!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,'JS engine does not provide full typed array support'),D(!r.wasmMemory,'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'),D(16777216==B,'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'),function(){var t=new Int16Array(1),i=new Int8Array(t.buffer);if(t[0]=25459,115!==i[0]||99!==i[1])throw'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'}();var P=[],G=[],W=[],H=!1;D(Math.imul,'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.fround,'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.clz32,'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.trunc,'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');var Y=0,V=null,K=null,X={};function j(t){r.onAbort&&r.onAbort(t),_(t='Aborted('+t+')'),M=!0;var i=new WebAssembly.RuntimeError(t);throw n(i),i}var z={error:function(){j('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM')},init:function(){z.error()},LL:function(){z.error()},SL:function(){z.error()},xL:function(){z.error()},open:function(){z.error()},kL:function(){z.error()},ML:function(){z.error()},DL:function(){z.error()},NL:function(){z.error()},FL:function(){z.error()}};r.FS_createDataFile=z.LL,r.FS_createPreloadedFile=z.SL;var Z,q,$,J,Q='data:application/octet-stream;base64,';function tt(t){return t.startsWith(Q)}function it(t){return t.startsWith('file://')}function et(t,i){return function(){var e=t,s=i;return i||(s=r.asm),D(H,'native function `'+e+'` called before runtime initialization'),s[t]||D(s[t],'exported native function `'+e+'` not found'),s[t].apply(null,arguments)}}function st(t){try{if(t==Z&&I)return new Uint8Array(I);if(w)return w(t);throw"both async and sync fetching of the wasm failed"}catch(t){j(t)}}function nt(t){this.name='ExitStatus',this.message='Program terminated with exit('+t+')',this.status=t}function rt(t){for(;t.length>0;)t.shift()(r)}function ht(t){ht.BL||(ht.BL={}),ht.BL[t]||(ht.BL[t]=1,c&&(t='warning: '+t),_(t))}function ot(t){try{return v.UL(t-b.byteLength+65535>>>16),N(v.buffer),1}catch(i){_('emscripten_realloc_buffer: Attempted to grow heap from '+b.byteLength+' bytes to '+t+' bytes, but got error: '+i)}}r.locateFile?tt(Z='tinymidipcm.wasm')||(q=Z,Z=r.locateFile?r.locateFile(q,y):y+q):Z=new URL(e(8227),e.b).toString();var at,lt={"emscripten_memcpy_big":function(t,i,e){R.copyWithin(t,i,i+e)},"emscripten_resize_heap":function(t){var i=R.length;D((t>>>=0)>i);var e,s,n=2147483648;if(t>n)return _('Cannot enlarge memory, asked to go up to '+t+' bytes, but the limit is '+n+' bytes!'),!1;for(var r=1;r<=4;r*=2){var h=i*(1+.2/r);h=Math.min(h,t+100663296);var o=Math.min(n,(e=Math.max(t,h))+((s=65536)-e%s)%s);if(ot(o))return!0}return _('Failed to grow the heap from '+i+' bytes to '+o+' bytes, not enough memory!'),!1}},ct=(function(){var t,i={'env':lt,'wasi_snapshot_preview1':lt};function e(t,i){var e,s=t.exports;r.asm=s,D(v=r.asm.memory,"memory not found in wasm exports"),N(v.buffer),D(r.asm.__indirect_function_table,"table not found in wasm exports"),e=r.asm.__wasm_call_ctors,G.unshift(e),function(t){if(Y--,r.monitorRunDependencies&&r.monitorRunDependencies(Y),t?(D(X[t]),delete X[t]):_('warning: run dependency removed without ID'),0==Y&&(null!==V&&(clearInterval(V),V=null),K)){var i=K;K=null,i()}}('wasm-instantiate')}t='wasm-instantiate',Y++,r.monitorRunDependencies&&r.monitorRunDependencies(Y),t?(D(!X[t]),X[t]=1,null===V&&'undefined'!=typeof setInterval&&(V=setInterval((function(){if(M)return clearInterval(V),void(V=null);var t=!1;for(var i in X)t||(t=!0,_('still waiting on run dependencies:')),_('dependency: '+i);t&&_('(end of list)')}),1e4))):_('warning: run dependency added without ID');var s=r;function h(t){D(r===s,'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'),s=null,e(t.instance)}function o(t){return function(){if(!I&&(a||l)){if('function'==typeof fetch&&!it(Z))return fetch(Z,{credentials:'same-origin'}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+Z+"'";return t.arrayBuffer()})).catch((function(){return st(Z)}));if(d)return new Promise((function(t,i){d(Z,(function(i){t(new Uint8Array(i))}),i)}))}return Promise.resolve().then((function(){return st(Z)}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){_('failed to asynchronously prepare wasm: '+t),it(Z)&&_('warning: Loading from a file URI ('+Z+') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing'),j(t)}))}if(r.instantiateWasm)try{return r.instantiateWasm(i,e)}catch(t){_('Module.instantiateWasm callback failed with error: '+t),n(t)}(I||'function'!=typeof WebAssembly.instantiateStreaming||tt(Z)||it(Z)||c||'function'!=typeof fetch?o(h):fetch(Z,{credentials:'same-origin'}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(h,(function(t){return _('wasm streaming compile failed: '+t),_('falling back to ArrayBuffer instantiation'),o(h)}))}))).catch(n)}(),r.___wasm_call_ctors=et("__wasm_call_ctors"),r._malloc=et("malloc"),r._free=et("free"),r._tsf_load_memory=et("tsf_load_memory"),r._tsf_close=et("tsf_close"),r._tsf_reset=et("tsf_reset"),r._tsf_set_output=et("tsf_set_output"),r._tsf_set_max_voices=et("tsf_set_max_voices"),r._realloc=et("realloc"),r._tsf_channel_set_presetnumber=et("tsf_channel_set_presetnumber"),r._tsf_channel_set_bank_preset=et("tsf_channel_set_bank_preset"),r._tml_load_memory=et("tml_load_memory"),r._midi_render=et("midi_render"),r.___errno_location=et("__errno_location"),r._fflush=et("fflush"),r._emscripten_stack_init=function(){return(ct=r._emscripten_stack_init=r.asm.emscripten_stack_init).apply(null,arguments)}),ft=(r._emscripten_stack_get_free=function(){return(r._emscripten_stack_get_free=r.asm.emscripten_stack_get_free).apply(null,arguments)},r._emscripten_stack_get_base=function(){return(r._emscripten_stack_get_base=r.asm.emscripten_stack_get_base).apply(null,arguments)},r._emscripten_stack_get_end=function(){return(ft=r._emscripten_stack_get_end=r.asm.emscripten_stack_get_end).apply(null,arguments)});function ut(){var t;ct(),D(!(3&(t=ft()))),S[t>>2]=34821223,S[t+4>>2]=2310721022,S[0]=1668509029}function dt(t){function e(){at||(at=!0,r.calledRun=!0,M||(D(!H),H=!0,U(),rt(G),i(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),D(!r._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(U(),r.postRun)for('function'==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)t=r.postRun.shift(),W.unshift(t);var t;rt(W)}()))}t=t||o,Y>0||(ut(),function(){if(r.preRun)for('function'==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)t=r.preRun.shift(),P.unshift(t);var t;rt(P)}(),Y>0||(r.setStatus?(r.setStatus('Running...'),setTimeout((function(){setTimeout((function(){r.setStatus('')}),1),e()}),1)):e(),U()))}if(r.stackSave=et("stackSave"),r.stackRestore=et("stackRestore"),r.stackAlloc=et("stackAlloc"),r.setValue=function(t,i,e="i8"){switch(e.endsWith('*')&&(e='*'),e){case'i1':case'i8':T[0|t]=i;break;case'i16':O[t>>1]=i;break;case'i32':L[t>>2]=i;break;case'i64':J=[i>>>0,($=i,+Math.abs($)>=1?$>0?(0|Math.min(+Math.floor($/4294967296),4294967295))>>>0:~~+Math.ceil(($-+(~~$>>>0))/4294967296)>>>0:0)],L[t>>2]=J[0],L[t+4>>2]=J[1];break;case'float':x[t>>2]=i;break;case'double':k[t>>3]=i;break;case'*':S[t>>2]=i;break;default:j('invalid type for setValue: '+e)}},r.getValue=function(t,i="i8"){switch(i.endsWith('*')&&(i='*'),i){case'i1':case'i8':return T[0|t];case'i16':return O[t>>1];case'i32':case'i64':return L[t>>2];case'float':return x[t>>2];case'double':return k[t>>3];case'*':return S[t>>2];default:j('invalid type for getValue: '+i)}return null},['run','UTF8ArrayToString','UTF8ToString','stringToUTF8Array','stringToUTF8','lengthBytesUTF8','addOnPreRun','addOnInit','addOnPreMain','addOnExit','addOnPostRun','addRunDependency','removeRunDependency','FS_createFolder','FS_createPath','FS_createDataFile','FS_createPreloadedFile','FS_createLazyFile','FS_createLink','FS_createDevice','FS_unlink','getLEB','getFunctionTables','alignFunctionTables','registerFunctions','prettyPrint','getCompilerSetting','print','printErr','callMain','abort','keepRuntimeAlive','wasmMemory','stackAlloc','stackSave','stackRestore','getTempRet0','setTempRet0','writeStackCookie','checkStackCookie','ptrToString','zeroMemory','stringToNewUTF8','exitJS','getHeapMax','emscripten_realloc_buffer','ENV','ERRNO_CODES','ERRNO_MESSAGES','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','DNS','getHostByName','Protocols','Sockets','getRandomDevice','warnOnce','traverseStack','UNWIND_CACHE','convertPCtoSourceLocation','readAsmConstArgsArray','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','handleException','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','freeTableIndexes','functionsInTableMap','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','PATH','PATH_FS','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16Decoder','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeArrayToMemory','writeAsciiToMemory','SYSCALLS','getSocketFromFD','getSocketAddress','JSEvents','registerKeyEventCallback','specialHTMLTargets','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','currentFullscreenStrategy','restoreOldWindowedStyle','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','demangle','demangleAll','jsStackTrace','stackTrace','ExitStatus','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','dlopenMissingError','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','uncaughtExceptionCount','exceptionLast','exceptionCaught','ExceptionInfo','exception_addRef','exception_decRef','Browser','setMainLoop','wget','FS','MEMFS','TTY','PIPEFS','SOCKFS','_setNetworkCallback','tempFixedLengthArray','miniTempWebGLFloatBuffers','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','GL','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','AL','SDL_unicode','SDL_ttfContext','SDL_audio','SDL','SDL_gfx','GLUT','EGL','GLFW_Window','GLFW','GLEW','IDBStore','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){var i="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),j(i)}})})),['ptrToString','zeroMemory','stringToNewUTF8','exitJS','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','getHostByName','getRandomDevice','traverseStack','convertPCtoSourceLocation','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeAsciiToMemory','getSocketFromFD','getSocketAddress','registerKeyEventCallback','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','ExceptionInfo','exception_addRef','exception_decRef','setMainLoop','_setNetworkCallback','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','SDL_unicode','SDL_ttfContext','SDL_audio','GLFW_Window','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){'undefined'==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var i='`'+t+'` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line';E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),ht(i)}})})),K=function t(){at||dt(),at||(K=t)},r.preInit)for('function'==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return dt(),t.ready})}},r={};function h(t){var i=r[t];if(void 0!==i)return i.exports;var e=r[t]={exports:{}};return n[t](e,e.exports,h),e.exports}h.m=n,t="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",i="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",e="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",s=t=>{t&&t.d<1&&(t.d=1,t.forEach((t=>t.r--)),t.forEach((t=>t.r--?t.r++:t())))},h.a=(n,r,h)=>{var o;h&&((o=[]).d=-1);var a,l,c,f=new Set,u=n.exports,d=new Promise(((t,i)=>{c=i,l=t}));d[i]=u,d[t]=t=>(o&&t(o),f.forEach(t),d.catch((t=>{}))),n.exports=d,r((n=>{var r;a=(n=>n.map((n=>{if(null!==n&&"object"==typeof n){if(n[t])return n;if(n.then){var r=[];r.d=0,n.then((t=>{h[i]=t,s(r)}),(t=>{h[e]=t,s(r)}));var h={};return h[t]=t=>t(r),h}}var o={};return o[t]=t=>{},o[i]=n,o})))(n);var h=()=>a.map((t=>{if(t[e])throw t[e];return t[i]})),l=new Promise((i=>{(r=()=>i(h)).r=0;var e=t=>t!==o&&!f.has(t)&&(f.add(t),t&&!t.d&&(r.r++,t.push(r)));a.map((i=>i[t](e)))}));return r.r?l:h()}),(t=>(t?c(d[e]=t):l(u),s(o)))),o&&o.d<0&&(o.d=0)},h.d=(t,i)=>{for(var e in i)h.o(i,e)&&!h.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:i[e]})},h.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),h.p="/Client2/",h.b=document.baseURI||self.location.href;h(5532)})(); \ No newline at end of file diff --git a/playground.js b/playground.js index 4ef42459..c5add534 100644 --- a/playground.js +++ b/playground.js @@ -1 +1 @@ -(()=>{"use strict";var t,i,e,s,n={1651:(t,i,e)=>{e.d(i,{K:()=>k});var s=e(1120),n=e(4583),r=e(2901),h=e(1069),o=e(7046),a=(e(9896),e(6666)),l=e(3045),c=e(818),f=e(670),u=e(8268),d=e(3867),w=e(7854),y=e(8950),A=e(1302),m=e(9298),p=e(8665),g=e(1312),I=e(3819),_=e(8317),C=e(9234),E=e(1908),v=e(123),b=e(5637),T=e(6948),R=e(2164),O=e(8738),L=e(3764),S=e(8534),x=e(6730);class k extends o.A{static tt=225;static it=10;static portOffset=0;static members=!0;static et=!1;static st='';static nt='';static rt=!1;static ht=2;static ot=!1;static lt='https://raw.githubusercontent.com/2004scape/Server/main';static exponent=58778699976184461502525193738213253649000149147835990136706041084440742975821n;static ct=7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789n;static ft=0;static ut=0;static dt=0;static wt=0;static yt=0;static At=0;static gt=0;static It=0;static _t=0;static Ct=0;static Et=0;static vt=0;static bt=0;static Tt=0;static Rt=0;static Ot=()=>{l.A.et=!1,n.A.et=!1,k.et=!1,c.A.et=!1};static Lt=()=>{l.A.et=!0,n.A.et=!0,k.et=!0,c.A.et=!0};St=2048;xt=2047;kt=!1;Mt=!1;Dt=!1;Ft=!1;db=null;Nt=0;Bt=[];stream=null;in=h.A.Ut(1);Pt=h.A.Ut(1);Gt=h.A.Ut(1);Wt=0n;Yt=0;Ht=0;Vt=0;Kt=null;Xt=0;packetSize=0;jt=0;zt=0;Zt=0;qt=null;$t=!0;Jt=0;Qt=0;ti=null;ii=null;ei=null;si=null;ni=null;ri=null;hi=null;oi=null;ai=null;li=null;ci=null;fi='';ui='';username='';password='';di=null;wi=null;yi=null;Ai=null;mi=[];pi=!1;gi=null;Ii=null;_i=null;Ci=null;Ei=null;vi=null;bi=null;Ti=null;Ri=null;Oi=null;Li=new Int32Array(256);Si=0;xi=0;ki=0;Mi=null;Di=null;Fi=null;Ni=null;Bi=null;Ui=null;Pi=null;Gi=null;Wi=null;Yi=null;Hi=null;Vi=null;Ki=null;Xi=null;ji=null;zi=null;Zi=null;qi=null;$i=null;Ji=null;Qi=null;te=new Int32Array(33);ie=new Int32Array(33);ee=new Int32Array(151);se=new Int32Array(151);ne=null;re=null;he=null;oe=null;ae=null;le=null;ce=new d.fe(13,null);ue=null;de=null;we=new d.fe(50,null);ye=new d.fe(50,null);Ae=new d.fe(20,null);me=new d.fe(20,null);pe=null;ge=new d.fe(8,null);Ie=null;_e=null;Ce=null;Ee=null;ve=null;be=null;Te=null;Re=null;Oe=null;Le=null;Se=null;xe=null;ke=null;Me=null;De=null;Fe=null;Ne=null;Be=null;Ue=new d.fe(1e3,null);Pe=!1;Ge=!1;We=!1;Ye=!1;He=-1;Ve=0;Ke=0;Xe=0;je=0;ze=0;Ze=0;qe=!1;$e=0;Je=0;Qe=0;ts=0;es=0;ss=0;ns=[];rs=-1;hs=-1;os=new s.A;ls=78;cs=0;fs=0;us=[];ds=0;ws=0;ys=0;As=0;ps=0;gs=0;Is=0;_s=0;Cs=[];Es=[];vs=[];bs=[];Ts=null;Rs=-1;Os=3;Ls=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];Ss=0;xs=0;ks=0;Ms=!1;Ds=0;Fs=!1;Ns='';Bs='';Us=0;Ps='';Gs=!1;Ws=-1;Ys=new d.fe(100,null);Hs=new d.fe(100,null);messageType=new Int32Array(100);Vs=new Int32Array(100);Ks=0;Xs=0;js=0;zs='';Zs=0;qs=0;$s=0;Js=0;Qs=0;tn=0;en=0;sn=0;nn=0;rn=!1;hn=0;an=0;ln=0;cn=0;fn=null;un=0;dn=0;wn=0;yn=0;An=!1;mn=[];pn=[];gn=0;In=0;_n=0;Cn=null;En=0;vn=new Int32Array(500);bn=new Int32Array(500);Tn=new Int32Array(500);Rn=new Int32Array(500);On=0;Ln=0;Sn=0;xn='';kn=!1;Mn=-1;Dn=0;Fn=0;Nn=0;Bn=0;Un=0;Pn=new Int32Array(1e3);Gn=new Int32Array(1e3);Wn=null;Yn=0;Hn=0;Vn=0;Kn=0;Xn=0;jn=!1;zn=0;Zn=0;qn=0;$n=0;Jn=2;Qn=2;tr=1;ir=new Int32Array(5);er=new d.fe(5,!1);sr=new Int32Array(5);nr=new Int32Array(5);rr=new Int32Array(5);hr=0;ar=0;lr=0;cr=0;ur=0;dr=0;wr=0;yr=0;Ar=0;mr=1;pr=2;gr=-1;Ir=0;_r=0;Cr=0;Er=0;vr=0;br=0;Tr=null;Rr=null;Or=null;Lr=0;Sr=0;kr=new Int8Array(16384);Mr=new d.fe(f.A.Dr,null);Fr=0;Nr=0;Br=128;Ur=0;Pr=0;Gr=0;Wr=0;Yr=0;Hr=null;Vr=null;Kr=new d.Xr(f.A.jr,f.A.jr);zr=0;Zr=0;qr=0;$r=0;Jr=0;Qr=0;th=0;ih=0;eh=0;sh=0;nh=0;rh=0;hh=new d.fe(this.St,null);oh=0;ah=new Int32Array(this.St);lh=0;fh=0;uh=new Int32Array(this.St);dh=new Int32Array(1e3);wh=new d.fe(this.St,null);yh=new d.fe(8192,null);Ah=0;mh=new Int32Array(8192);ph=new a.A;gh=new a.A;Ih=new a.A;_h=new a.A;Ch=new d.Eh(f.A.Dr,f.A.jr,f.A.jr,null);bh=new a.A;Th=new Int32Array(4e3);Rh=new Int32Array(4e3);Oh=new Int32Array(f.A.jr*f.A.jr);Lh=new Int32Array(f.A.jr*f.A.jr);Sh=0;xh=null;kh=0;Mh=0;Dh=-1;Fh=0;Nh=0;Bh=0;Uh=0;Ph=!1;Gh=!0;Wh=!1;Yh=new Int32Array(7);Hh=new Int32Array(5);Vh=0;Kh=0;static Xh=50;jh=new Int32Array(k.Xh);zh=new Int32Array(k.Xh);Zh=new Int32Array(k.Xh);qh=new Int32Array(k.Xh);$h=new Int32Array(k.Xh);Jh=new Int32Array(k.Xh);Qh=new Int32Array(k.Xh);io=new d.fe(k.Xh,null);eo=new d.fe(100,null);so=new BigInt64Array(100);no=new Int32Array(100);ro=null;ho=0;oo=!0;ao=new Int32Array(50);lo=new Int32Array(50);co=new Int32Array(50);fo=192;uo=-1;do=-1;wo=0;yo=0;Ao=0;mo=!0;po=null;Io=0;_o=0;Co=192;Eo=new d.fe(16,null);vo=0;bo=!1;To=()=>{try{this.stream&&this.stream.close()}catch(t){}this.stream=null,(0,v.Ro)(),this.Pt=null,this.Gt=null,this.in=null,this.Or=null,this.Tr=null,this.Rr=null,this.Hr=null,this.Vr=null,this.Wn=null,this.Mr=null,this.Oh=null,this.Lh=null,this.Th=null,this.Rh=null,this.kr=null,this.Di=null,this.Fi=null,this.Ni=null,this.Bi=null,this.Ui=null,this.Pi=null,this.Gi=null,this.Wi=null,this.Yi=null,this.Hi=null,this.Vi=null,this.Ki=null,this.Xi=null,this.ji=null,this.zi=null,this.Zi=null,this.qi=null,this.ne=null,this.he=null,this.re=null,this.oe=null,this.ae=null,this.le=null,this.ce=null,this.Te=null,this.Re=null,this.Oe=null,this.Le=null,this.Se=null,this.xe=null,this.ke=null,this.Me=null,this.De=null,this.Fe=null,this.de=null,this.Ae=null,this.me=null,this.ge=null,this.Ie=null,this._e=null,this.Ce=null,this.Ee=null,this.we=null,this.ye=null,this.Kr=null,this.hh=null,this.ah=null,this.uh=null,this.wh=null,this.dh=null,this.yh=null,this.mh=null,this.Ch=null,this.bh=null,this._h=null,this.ph=null,this.gh=null,this.Ih=null,this.Tn=null,this.Rn=null,this.vn=null,this.bn=null,this.ns=null,this.mn=null,this.Pn=null,this.Gn=null,this.Ue=null,this.ue=null,this.eo=null,this.so=null,this.no=null,this.si=null,this.ni=null,this.ti=null,this.ii=null,this.ei=null,this.ri=null,this.hi=null,this.oi=null,this.ai=null,this.Oo(),b.A.To(),T.A.To(),A.A.To(),R.A.Lo=null,_.A.Lo=null,s.A.Lo=null,g.A.Lo=null,O.A.Lo=null,O.A.So=null,L.A.Lo=null,this.xo=null,u.A.So=null,n.A.To(),l.A.To(),p.A.To(),S.A.Lo=[],x.A.Lo=[]};ko(){return this.Jt}Mo(){return this.Gs}Do(){return this.Fs}Fo(){return this.hs}No(){return this.He}Oo=()=>{this.pi=!1,this.Mi&&(clearInterval(this.Mi),this.Mi=null),this.li=null,this.ci=null,this.mi=[],this.bi=null,this.Ti=null,this.Ri=null,this.Oi=null,this.Ci=null,this._i=null,this.Ei=null,this.vi=null,this.gi=null,this.Ii=null};Bo=async(t,i,e,s)=>{let n=5,o=await(this.db?.Uo(t));if(o&&h.A.Po(o)!==e&&(o=void 0),o)return new r.A(o);for(;!o;){await this.Go(s,`Requesting ${i}`);try{o=await(0,C.Wo)(`${k.nt}/${t}${e}`)}catch(t){o=void 0;for(let t=n;t>0;t--)await this.Go(s,`Error loading - Will retry in ${t} secs.`),await(0,C.Yo)(1e3);n*=2,n>60&&(n=60)}}return await(this.db?.Ho(t,o)),new r.A(o)};Vo=async(t,i,e)=>{let s=await(this.db?.Uo(t+'.mid'));if(s&&12345678!==i&&h.A.Po(s)!==i&&(s=void 0),!s)try{s=await(0,C.Wo)(`${k.nt}/${t}_${i}.mid`),e!==s.length&&(s=s.slice(0,e))}catch(t){}if(!s)return;await(this.db?.Ho(t+'.mid',s));const n=new h.A(Uint8Array.from(s)).Ko,r=E.A.read(n,s,e,4);(0,v.Xo)(r,this.Co)};jo=()=>{if(w.zo.fillStyle='black',w.zo.fillRect(0,0,this.width,this.height),this.Zo(1),this.Dt){this.pi=!1,w.zo.font='bold 16px helvetica, sans-serif',w.zo.textAlign='left',w.zo.fillStyle='yellow';let t=35;w.zo.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,w.zo.fillStyle='white',w.zo.fillText('To fix this try the following (in order):',30,t),t+=50,w.zo.font='bold 12px helvetica, sans-serif',w.zo.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.zo.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,w.zo.fillText('3: Try using a different game-world',30,t),t+=30,w.zo.fillText('4: Try rebooting your computer',30,t),t+=30,w.zo.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.Ft&&(this.pi=!1,w.zo.font='bold 20px helvetica, sans-serif',w.zo.textAlign='left',w.zo.fillStyle='white',w.zo.fillText('Error - unable to load game!',50,50),w.zo.fillText('To play RuneScape make sure you play from',50,100),w.zo.fillText('https://2004scape.org',50,150)),this.Mt){this.pi=!1,w.zo.font='bold 13px helvetica, sans-serif',w.zo.textAlign='left',w.zo.fillStyle='yellow';let t=35;w.zo.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,w.zo.fillStyle='white',w.zo.fillText('To fix this try the following (in order):',30,t),t+=50,w.zo.font='bold 12px helvetica, sans-serif',w.zo.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.zo.fillText('2: Try rebooting your computer, and reloading',30,t)}};qo=t=>{if(!t.$o)return!1;for(let i=0;i=s)return!1}else if(3===t.$o[i]){if(e<=s)return!1}else if(4===t.$o[i]){if(e===s)return!1}else if(e!==s)return!1}return!0};ta=(t,i,e,s,n)=>{this.ve?.draw(t,i),this.be?.draw(t,i+n-16),y.A.fillRect(t,i+16,16,n-32,m.A.ia);let r=(n-32)*n/s|0;r<8&&(r=8);const h=(n-r-32)*e/(s-n)|0;y.A.fillRect(t,i+h+16,16,r,m.A.ea),y.A.sa(t,i+h+16,m.A.na,r),y.A.sa(t+1,i+h+16,m.A.na,r),y.A.ra(t,i+h+16,m.A.na,16),y.A.ra(t,i+h+17,m.A.na,16),y.A.sa(t+15,i+h+16,m.A.ha,r),y.A.sa(t+14,i+h+17,m.A.ha,r-1),y.A.ra(t,i+h+r+15,m.A.ha,16),y.A.ra(t+1,i+h+r+14,m.A.ha,15)};oa=(t,i)=>{let e=!1;const n=s.A.Lo[t];if(!n.aa)return!1;for(let t=0;ts.delay[r.ua];)r.fa-=s.delay[r.ua]+1,r.ua++,r.ua>=s.da&&(r.ua-=s.wa,(r.ua<0||r.ua>=s.da)&&(r.ua=0)),e=!0}}}return e};ya=(t,i,e,r,h=!1)=>{if(0!==t.type||!t.aa||t.hide&&this.Zs!==t.id&&this.qs!==t.id&&this.$s!==t.id)return;const o=y.A.left,a=y.A.top,l=y.A.right,c=y.A.bottom;y.A.Aa(i,e,i+t.width,e+t.height);const f=t.aa.length;for(let o=0;o0&&this.Ca(c),c.type===s.A.Ea)c.va>c.scroll-c.height&&(c.va=c.scroll-c.height),c.va<0&&(c.va=0),this.ya(c,a,l,c.va,h),c.scroll>c.height&&this.ta(a+c.width,l,c.va,c.scroll,c.height);else if(c.type===s.A.ba){let t=0;for(let i=0;i0){let i=0,e=0;const r=c.Oa[t]-1;if(s>=-32&&s<=512&&n>=-32&&n<=334||0!==this.tn&&this.Qs===t){const h=A.A.ka(r,c.La[t]);if(0!==this.tn&&this.Qs===t&&this.Js===c.id?(i=this.Ma-this.en,e=this.Da-this.sn,i<5&&i>-5&&(i=0),e<5&&e>-5&&(e=0),this.nn<5&&(i=0,e=0),h.Fa(128,s+i,n+e)):0!==this.un&&this.dn===t&&this.wn===c.id?h.Fa(128,s,n):h.draw(s,n),33===h.Na||1!==c.La[t]){const r=c.La[t];this.di?.Ba(s+i+1,n+10+e,this.Ua(r),m.A.Pa),this.di?.Ba(s+i,n+9+e,this.Ua(r),m.A.Ga)}}}else if(c.Wa&&t<20){const i=c.Wa[t];i?.draw(s,n)}t++}}else if(c.type===s.A.Ya)c.fill?y.A.fillRect(a,l,c.width,c.height,c.Ha):y.A.ga(a,l,c.width,c.height,c.Ha);else if(c.type===s.A.Va){const t=c.font;let i=c.Ha,e=c.text;if(this.$s!==c.id&&this.qs!==c.id&&this.Zs!==c.id||0===c.Ka||(i=c.Ka),this.qo(c)&&(i=c.Xa,c.ja&&c.ja.length>0&&(e=c.ja)),c.za===s.A.Za&&this.An&&(e='Please wait...',i=c.Ha),!t||!e)continue;for(let s=l+t.height;e.length>0;s+=t.height){if(-1!==e.indexOf('%')){for(;;){const t=e.indexOf('%1');if(-1===t)break;e=e.substring(0,t)+this.qa(this.Jo(c,0))+e.substring(t+2)}for(;;){const t=e.indexOf('%2');if(-1===t)break;e=e.substring(0,t)+this.qa(this.Jo(c,1))+e.substring(t+2)}for(;;){const t=e.indexOf('%3');if(-1===t)break;e=e.substring(0,t)+this.qa(this.Jo(c,2))+e.substring(t+2)}for(;;){const t=e.indexOf('%4');if(-1===t)break;e=e.substring(0,t)+this.qa(this.Jo(c,3))+e.substring(t+2)}for(;;){const t=e.indexOf('%5');if(-1===t)break;e=e.substring(0,t)+this.qa(this.Jo(c,4))+e.substring(t+2)}}const n=e.indexOf('\\n');let r;-1!==n?(r=e.substring(0,n),e=e.substring(n+2)):(r=e,e=''),c.$a?t.Ja(a+(c.width/2|0),s,r,i,c.Qa):t.tl(a,s,r,i,c.Qa)}}else if(c.type===s.A.il){let t;t=this.qo(c)?c.el:c.sl,t?.draw(a,l)}else if(c.type===s.A.nl){const t=n.A.rl,i=n.A.hl;n.A.rl=a+(c.width/2|0),n.A.hl=l+(c.height/2|0);const e=n.A.sin[c.ol]*c.zoom>>16,s=n.A.cos[c.ol]*c.zoom>>16,r=this.qo(c);let h;h=r?c.ca:c.la;let o=null;if(-1===h)o=c.al(-1,-1,r);else{const t=g.A.Lo[h];t.frames&&t.ll&&(o=c.al(t.frames[c.ua],t.ll[c.ua],r))}o&&o.cl(0,c.fl,0,c.ol,0,e,s),n.A.rl=t,n.A.hl=i}else if(c.type===s.A.ul){const t=c.font;if(!t||!c.Oa||!c.La)continue;let i=0;for(let e=0;e0){const n=A.A.get(c.Oa[i]-1);let r=n.name;if((n.dl||1!==c.La[i])&&(r=r+' x'+this.wl(c.La[i])),!r)continue;const h=a+s*(c.Sa+115),o=l+e*(c.xa+12);c.$a?t.Ja(h+(c.width/2|0),o,r,c.Ha,c.Qa):t.tl(h,o,r,c.Ha,c.Qa)}i++}}}y.A.Aa(o,a,l,c)};Ca=t=>{let i=t._a;if(i>=s.A.yl&&i<=s.A.Al)i--,i>=this.Vh?(t.text='',t.za=0):(t.text=this.eo[i],t.za=1);else if(i>=s.A.ml&&i<=s.A.pl)i-=s.A.ml,i>=this.Vh?(t.text='',t.za=0):(0===this.no[i]?t.text='@red@Offline':this.no[i]===k.it?t.text='@gre@World-'+(this.no[i]-9):t.text='@yel@World-'+(this.no[i]-9),t.za=1);else if(i===s.A.gl)t.scroll=15*this.Vh+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i>=s.A.Il&&i<=s.A._l)i-=s.A.Il,i>=this.fs?(t.text='',t.za=0):(t.text=I.A.Cl(I.A.El(this.us[i])),t.za=1);else if(i===s.A.vl)t.scroll=15*this.fs+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i===s.A.bl){if(t.ol=150,t.fl=256*Math.sin(this.Nt/40)&2047,this.Wh){this.Wh=!1;const i=new d.fe(7,null);let e=0;for(let t=0;t<7;t++){const s=this.Yh[t];s>=0&&(i[e++]=_.A.Lo[s].al())}const s=p.A.Tl(i,e);for(let t=0;t<5;t++)0!==this.Hh[t]&&(s.Rl(u.A.Ol[t][0],u.A.Ol[t][this.Hh[t]]),1===t&&s.Rl(u.A.Ll[0],u.A.Ll[this.Hh[t]]));if(this.xh){const i=g.A.Lo[this.xh.Sl].frames;i&&(s.xl(),s.kl(i[0]),s.Ml(64,850,-30,-50,-30,!0),t.model=s)}}}else if(i===s.A.Dl)this.Ne||(this.Ne=t.sl,this.Be=t.el),this.Gh?t.sl=this.Be:t.sl=this.Ne;else if(i===s.A.Fl)this.Ne||(this.Ne=t.sl,this.Be=t.el),this.Gh?t.sl=this.Ne:t.sl=this.Be;else if(i===s.A.Nl)t.text=this.xn,this.Nt%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(i===s.A.Bl)this.Ph?this.kn?(t.Ha=m.A.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.Ha=m.A.Ia,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(i===s.A.Ul||i===s.A.Pl)if(0===this.Dn)t.text='';else{let i;i=0===this.Fn?'earlier today':1===this.Fn?'yesterday':this.Fn+' days ago',t.text='You last logged in '+i+' from: '+I.A.Gl(this.Dn)}else if(i===s.A.Wl)0===this.Bn&&(t.text='0 unread messages',t.Ha=m.A.Ga),1===this.Bn&&(t.text='1 unread message',t.Ha=m.A.GREEN),this.Bn>1&&(t.text=this.Bn+' unread messages',t.Ha=m.A.GREEN);else if(i===s.A.Yl)if(201===this.Nn)t.text='';else if(200===this.Nn)t.text='You have not yet set any password recovery questions.';else{let i;i=0===this.Nn?'Earlier today':1===this.Nn?'Yesterday':this.Nn+' days ago',t.text=i+' you changed your recovery questions'}else i===s.A.Hl?201===this.Nn?t.text='':200===this.Nn?t.text='We strongly recommend you do so now to secure your account.':t.text='If you do not remember making this change then cancel it immediately':i===s.A.Vl&&(201===this.Nn?t.text='':(this.Nn,t.text="Do this from the 'account management' area on our front webpage"))};Jo=(t,i)=>{if(!t.scripts||i>=t.scripts.length)return-2;try{const e=t.scripts[i];if(!e)return-1;let n=0,r=0;for(;;){const t=e[r++];if(0===t)return n;if(1===t)n+=this.Es[e[r++]];else if(2===t)n+=this.vs[e[r++]];else if(3===t)n+=this.Cs[e[r++]];else if(4===t){const t=s.A.Lo[e[r++]],i=e[r++]+1;if(t.Oa&&t.La)for(let e=0;et<999999999?String(t):'*';wl=t=>{let i=String(t);for(let t=i.length-3;t>0;t-=3)i=i.substring(0,t)+','+i.substring(t);return i.length>8?i='@gre@'+i.substring(0,i.length-8)+' million @whi@('+i+')':i.length>4&&(i='@cya@'+i.substring(0,i.length-4)+'K @whi@('+i+')'),' '+i};Ua=t=>t<1e5?String(t):t<1e7?(t/1e3|0)+'K':(t/1e6|0)+'M'}},7604:(t,i,e)=>{e.d(i,{w:()=>h});var s=e(7046),n=e(1651),r=e(9234);async function h(){await async function(){0===s.A.getParameter('world').length&&s.A.setParameter('world','1');'localhost'===window.location.hostname&&'0'===s.A.getParameter('world')?(n.K.st='http://localhost',n.K.nt='http://localhost',n.K.portOffset=0):await async function(t){const i=await o(t,parseInt(s.A.getParameter('world'),10)),e=new URL(i.address);n.K.it=10+i.id-1,n.K.st=`${e.protocol}//${e.hostname}`,n.K.nt=`${e.protocol}//${e.hostname}:${e.port}`,t||(n.K.st=n.K.st.replace('https:','http:'));n.K.portOffset=i.portOffset,n.K.members=!0===i?.members,s.A.setParameter('world',i.id.toString(10))}(window.location.protocol.startsWith('https'))}(),function(){0===s.A.getParameter('detail').length&&s.A.setParameter('detail','high');'low'===s.A.getParameter('detail')?n.K.Lt():n.K.Ot()}(),0===s.A.getParameter('method').length&&s.A.setParameter('method','0')}async function o(t,i,e=0){if(e>=10)throw new Error('could not find world to connect!');const s=t?'https:':'http:';let n;try{n=JSON.parse(await(0,r.Xl)(`${s}//2004scape.org/api/v1/worldlist`))}catch(s){return await(0,r.Yo)(1e3),o(t,i,++e)}n.push({id:0,region:'Local Development',address:'http://localhost',portOffset:0,members:!0,hh:0});const h=n.find((t=>t.id===i));return h||o(t,i,10)}},7046:(t,i,e)=>{e.d(i,{A:()=>l});var s=e(1183),n=e(4583),r=e(9234),h=e(9091),o=e(2595),a=e(7854);class l{static getParameter(t){return new URLSearchParams(window.location.search).get(t)??''}static setParameter(t,i){const e=new URL(window.location.toString());e.searchParams.set(t,i),window.history.pushState(null,'',e.toString())}jl=0;zl=[];Zl=0;xo=null;state=0;ql=20;$l=1;Jl=[];Ql=0;tc=0;ic=[];ec=!0;sc=!1;nc=50;hasFocus=!0;rc=!1;hc=0;oc=0;Ma=0;Da=0;ac=0;lc=0;cc=0;fc=[];uc=[];dc=0;wc=0;input=null;yc=!1;Ac=!1;mc=!1;time=-1;gc=0;Ic=0;_c=0;Cc=0;Ec=0;vc=0;constructor(t=!1){a.bc.tabIndex=-1,a.zo.fillStyle='black',a.zo.fillRect(0,0,a.bc.width,a.bc.height),this.sc=t,this.sc?this.resize(window.innerWidth,window.innerHeight):this.resize(a.bc.width,a.bc.height)}get width(){return a.bc.width}get height(){return a.bc.height}resize=(t,i)=>{a.bc.width=t,a.bc.height=i,this.xo=new s.A(t,i),n.A.Tc()};Rc=async()=>{a.bc.addEventListener('resize',(()=>{this.sc&&this.resize(window.innerWidth,window.innerHeight)}),!1),a.bc.onmousedown=this.onmousedown,a.bc.onmouseup=this.onmouseup,a.bc.onmouseenter=this.onmouseenter,a.bc.onmouseleave=this.onmouseleave,a.bc.onmousemove=this.onmousemove,window.onbeforeunload=this.To,a.bc.onfocus=this.onfocus,a.bc.onblur=this.onblur,this.Oc?(a.bc.ontouchstart=this.ontouchstart,a.bc.ontouchend=this.ontouchend,a.bc.ontouchmove=this.ontouchmove):(a.bc.onkeydown=this.onkeydown,a.bc.onkeyup=this.onkeyup),a.bc.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.Oc&&'low'===l.getParameter('detail')&&(this.nc=30),await this.Go(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.Jl[t]=performance.now();let t,i=0,e=256,s=1,n=0;for(;this.state>=0;){if(this.state>0&&(this.state--,0===this.state))return void this.Lc();const h=e,o=s;e=300,s=1,t=performance.now();const a=this.Jl[i];if(0===a?(e=h,s=o):t>a&&(e=2560*this.ql/(t-a)|0),e<25?e=25:e>256&&(e=256,s=this.ql-(t-a)/10|0),this.Jl[i]=t,i=(i+1)%10,s>1)for(let t=0;t<10;t++)0!==this.Jl[t]&&(this.Jl[t]+=s);for(s0&&(this.Ql=1e3*e/(256*this.ql)|0);const l=performance.now();if(this.ec&&this.refresh(),await this.draw(),this.ic[this.tc]=(performance.now()-l)/1e3,this.tc=(this.tc+1)%this.ic.length,this.nc<50){const i=1e3/this.nc-(performance.now()-t);i>0&&await(0,r.Yo)(i)}}-1===this.state&&this.Lc()};Lc=()=>{this.state=-2,this.To()};Zo=t=>{this.ql=1e3/t|0};Sc=t=>{this.nc=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.ql|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};To=()=>{};draw=async()=>{};refresh=()=>{};async Go(t,i){const e=this.width,s=this.height;this.ec&&(a.zo.fillStyle='black',a.zo.fillRect(0,0,e,s),this.ec=!1);const n=s/2-18;a.zo.fillStyle='rgb(140, 17, 17)',a.zo.rect((e/2|0)-152,n,304,34),a.zo.fillRect((e/2|0)-150,n+2,3*t,30),a.zo.fillStyle='black',a.zo.fillRect((e/2|0)-150+3*t,n+2,300-3*t,30),a.zo.font='bold 13px helvetica, sans-serif',a.zo.textAlign='center',a.zo.fillStyle='white',a.zo.fillText(i,e/2|0,n+22),await(0,r.Yo)(5)}xc=()=>{let t=-1;return this.wc!==this.dc&&(t=this.uc[this.dc],this.dc=this.dc+1&127),t};get ms(){const t=this.ic.length;let i=0;for(let e=0;ethis.jl&&(this.jl=e),this.zl[this.Zl]=e,this.Zl=(this.Zl+1)%250,e}get kc(){return this.zl.reduce(((t,i)=>t+i),0)/250}onkeydown=t=>{const i=t.key;h.p.includes(i)&&t.preventDefault(),this.hc=0;const e=h.L[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;t.ctrlKey&&(n>='A'.charCodeAt(0)&&n<=']'.charCodeAt(0)||n=='_'.charCodeAt(0)?n-='A'.charCodeAt(0)-1:n>='a'.charCodeAt(0)&&n<='z'.charCodeAt(0)&&(n-='a'.charCodeAt(0)-1)),n<30&&(n=0),s===h.L.ArrowLeft.code?n=1:s===h.L.ArrowRight.code?n=2:s===h.L.ArrowUp.code?n=3:s===h.L.ArrowDown.code?n=4:s===h.L.Control.code?n=5:s===h.L.Shift.code?n=6:s===h.L.Alt.code?n=7:s===h.L.Backspace.code||s===h.L.Delete.code?n=8:s===h.L.Tab.code?n=9:s===h.L.Enter.code?n=10:s>=h.L.F1.code&&s<=h.L.F12.code?n=s+1008-h.L.F1.code:s===h.L.Home.code?n=1e3:s===h.L.End.code?n=1001:s===h.L.PageUp.code?n=1002:s===h.L.PageDown.code&&(n=1003),n>0&&n<128&&(this.fc[n]=1),n>4&&(this.uc[this.wc]=n,this.wc=this.wc+1&127),o.A.enabled&&o.A.Mc(n)};onkeyup=t=>{const i=t.key;h.p.includes(i)&&t.preventDefault(),this.hc=0;const e=h.L[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;n<30&&(n=0),s===h.L.ArrowLeft.code?n=1:s===h.L.ArrowRight.code?n=2:s===h.L.ArrowUp.code?n=3:s===h.L.ArrowDown.code?n=4:s===h.L.Control.code?n=5:s===h.L.Shift.code?n=6:s===h.L.Alt.code?n=7:s===h.L.Backspace.code||s===h.L.Delete.code?n=8:s===h.L.Tab.code?n=9:s===h.L.Enter.code?n=10:s>=h.L.F1.code&&s<=h.L.F12.code?n=s+1008-h.L.F1.code:s===h.L.Home.code?n=1e3:s===h.L.End.code?n=1001:s===h.L.PageUp.code?n=1002:s===h.L.PageDown.code&&(n=1003),n>0&&n<128&&(this.fc[n]=0),o.A.enabled&&o.A.Dc(n)};onmousedown=t=>{if(this.yc=!1,(t.clientX>0||t.clientY>0)&&this.Fc(t),this.hc=0,this.lc=this.Ma,this.cc=this.Da,this.Oc&&!this.Nc){if(this.Bc()||this.Uc()||this.Pc())return this.ac=1,void(this.oc=1);t.timeStamp>=this.time+500?(this.ac=2,this.oc=2):(this.ac=1,this.oc=1)}else 2===t.button?(this.ac=2,this.oc=2):(this.ac=1,this.oc=1);o.A.enabled&&o.A.Gc(this.lc,this.cc,t.buttons)};onmouseup=t=>{this.Fc(t),this.hc=0,this.oc=0,o.A.enabled&&o.A.Wc(t.buttons)};onmouseenter=t=>{this.Fc(t),o.A.enabled&&o.A.Yc()};onmouseleave=t=>{this.Fc(t),this.hc=0,this.Ma=-1,this.Da=-1,this.oc=0,this.lc=-1,this.cc=-1,o.A.enabled&&o.A.Hc()};onmousemove=t=>{this.Fc(t),this.hc=0,o.A.enabled&&o.A.Vc(this.Ma,this.Da)};onfocus=t=>{this.hasFocus=!0,this.ec=!0,this.refresh(),o.A.enabled&&o.A.Kc()};onblur=t=>{this.hasFocus=!1,o.A.enabled&&o.A.Xc()};ontouchstart=t=>{if(!this.Oc)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.yc=!0;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.gc=this.Ec=this._c=0|i.screenX,this.Ic=this.vc=this.Cc=0|i.screenY,this.time=t.timeStamp,this.Ac=this.jc(),this.mc=this.zc()};ontouchend=t=>{if(!this.Oc||!this.yc)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;if(this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.Ec=0|i.screenX,this.vc=0|i.screenY,this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.Ac&&!this.jc())return void(this.yc=!1);if(this.mc&&!this.zc())return void(this.yc=!1);if(this.Bc()||this.Zc()||this.Uc()||this.Pc()){null!==this.input&&(this.input.parentNode?.contains(this.input)&&this.input.parentNode?.removeChild(this.input),this.input=null);const t=document.createElement('input');return this.Uc()?(t.setAttribute('id','username'),t.setAttribute('placeholder','Username')):this.Pc()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.Bc()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.Zc()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this.qc?t.setAttribute('type','password'):t.setAttribute('type',this.Pc()?'password':'text'),t.setAttribute('autofocus','autofocus'),t.setAttribute('spellcheck','false'),t.setAttribute('autocomplete','off'),t.setAttribute('style',`position: fixed; left: ${e}px; top: ${s}px; width: 1px; height: 1px; opacity: 0;`),document.body.appendChild(t),t.focus(),t.click(),this.qc&&(t.oninput=t=>{if(!(t instanceof InputEvent))return;const i=t,e=i.data;null!==e&&'insertText'===i.inputType&&this.onkeydown(new KeyboardEvent('keydown',{key:e,code:e}))}),t.onkeydown=t=>{this.qc&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this.qc&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeyup(new KeyboardEvent('keyup',{key:t.key,code:t.key}))},t.onfocus=t=>{this.input?.parentNode?.removeChild(this.input),this.input=null,this.onfocus(t)},this.input=t,void(this.yc=!1)}const n=t.timeStamp>=this.time+500,r=Math.abs(this.gc-this.Ec)>16||Math.abs(this.Ic-this.vc)>16;n&&!r?(this.yc=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.oc=0,this.yc=!1)};ontouchmove=t=>{if(!this.Oc||!this.yc)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.Ec=0|i.screenX,this.vc=0|i.screenY,this.Ac&&-1===this.No()?(this._c-this.Ec>0?this.rotate(2):this._c-this.Ec<0&&this.rotate(0),this.Cc-this.vc>0?this.rotate(3):this.Cc-this.vc<0&&this.rotate(1)):(this.mc||-1!==this.No())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this._c=this.Ec,this.Cc=this.vc};get Oc(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get qc(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get Nc(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}jc=()=>this.rc&&this.Ma>=8&&this.Ma<=520&&this.Da>=11&&this.Da<=345;Bc=()=>this.rc&&-1===this.Fo()&&!this.Mo()&&!this.Do()&&this.Ma>=11&&this.Ma<=506&&this.Da>=449&&this.Da<=482;Zc=()=>this.rc&&(this.Mo()||this.Do())&&this.Ma>=11&&this.Ma<=506&&this.Da>=383&&this.Da<=482;zc=()=>this.rc&&this.Ma>=562&&this.Ma<=752&&this.Da>=231&&this.Da<=492;Uc=()=>!this.rc&&2===this.ko()&&this.Ma>=301&&this.Ma<=562&&this.Da>=262&&this.Da<=279;Pc=()=>!this.rc&&2===this.ko()&&this.Ma>=301&&this.Ma<=562&&this.Da>=279&&this.Da<=296;rotate=t=>{0===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowLeft',code:'ArrowLeft'}))):1===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowUp',code:'ArrowUp'}))):2===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowRight',code:'ArrowRight'}))):3===t&&(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowDown',code:'ArrowDown'})))};$c=()=>null!==document.fullscreenElement;Fc=t=>{if(this.$c()){const i=t.target.getBoundingClientRect(),e=window.innerHeight/a.bc.height,s=(window.innerWidth-a.bc.width*e)/2;this.Ma=0|this.Jc(t.clientX-i.left-s,0,a.bc.width*e,0,789),this.Da=0|this.Jc(t.clientY-i.top,0,a.bc.height*e,0,532)}else{const i=a.bc.getBoundingClientRect(),e=a.bc.width/i.width,s=a.bc.height/i.height;this.Ma=(t.clientX-i.left)*e|0,this.Da=(t.clientY-i.top)*s|0}this.Ma<0&&(this.Ma=0),this.Da<0&&(this.Da=0),this.Ma>789&&(this.Ma=789),this.Da>532&&(this.Da=532)};Jc=(t,i,e,s,n)=>(t-i)*(n-s)/(e-i)+s}},2595:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1069);class n{static enabled=!1;static Qc=null;static tf=null;static if=0;static ef=0;static sf=0;static nf=0;static rf=0;static hf=()=>{this.Qc=s.A.Ut(1),this.tf=null,this.if=performance.now(),this.enabled=!0};static af=()=>{this.enabled=!1,this.Qc=null};static flush=()=>{let t=null;return this.tf&&this.enabled&&(t=this.tf),this.tf=null,t};static stop=()=>{let t=null;return this.Qc&&this.Qc.lf>0&&this.enabled&&(t=this.Qc),this.af(),t};static Gc=(t,i,e)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;this.ef++;const s=performance.now();let n=(s-this.if)/10|0;n>250&&(n=250),this.if=s,this.cf(5),1===e?this.Qc?.p1(1):this.Qc?.p1(2),this.Qc?.p1(n),this.Qc?.p3(t+(i<<10))};static Wc=t=>{if(!this.enabled)return;this.ef++;const i=performance.now();let e=(i-this.if)/10|0;e>250&&(e=250),this.if=i,this.cf(2),1===t?this.Qc?.p1(3):this.Qc?.p1(4),this.Qc?.p1(e)};static Vc=(t,i)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;const e=performance.now();if(e-this.sf>=50){this.sf=e,this.ef++;let s=(e-this.if)/10|0;s>250&&(s=250),this.if=e,t-this.nf<8&&t-this.nf>=-8&&i-this.rf<8&&i-this.rf>=-8?(this.cf(3),this.Qc?.p1(5),this.Qc?.p1(s),this.Qc?.p1(t+(i-this.rf+8<<4)+8-this.nf)):t-this.nf<128&&t-this.nf>=-128&&i-this.rf<128&&i-this.rf>=-128?(this.cf(4),this.Qc?.p1(6),this.Qc?.p1(s),this.Qc?.p1(t+128-this.nf),this.Qc?.p1(i+128-this.rf)):(this.cf(5),this.Qc?.p1(7),this.Qc?.p1(s),this.Qc?.p3(t+(i<<10))),this.nf=t,this.rf=i}};static Mc=t=>{if(!this.enabled)return;this.ef++;const i=performance.now();let e=(i-this.if)/10|0;e>250&&(e=250),this.if=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.cf(3),this.Qc?.p1(8),this.Qc?.p1(e),this.Qc?.p1(t)};static Dc=t=>{if(!this.enabled)return;this.ef++;const i=performance.now();let e=(i-this.if)/10|0;e>250&&(e=250),this.if=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.cf(3),this.Qc?.p1(9),this.Qc?.p1(e),this.Qc?.p1(t)};static Kc=()=>{if(!this.enabled)return;this.ef++;const t=performance.now();let i=(t-this.if)/10|0;i>250&&(i=250),this.if=t,this.cf(2),this.Qc?.p1(10),this.Qc?.p1(i)};static Xc=()=>{if(!this.enabled)return;this.ef++;const t=performance.now();let i=(t-this.if)/10|0;i>250&&(i=250),this.if=t,this.cf(2),this.Qc?.p1(11),this.Qc?.p1(i)};static Yc=()=>{if(!this.enabled)return;this.ef++;const t=performance.now();let i=(t-this.if)/10|0;i>250&&(i=250),this.if=t,this.cf(2),this.Qc?.p1(12),this.Qc?.p1(i)};static Hc=()=>{if(!this.enabled)return;this.ef++;const t=performance.now();let i=(t-this.if)/10|0;i>250&&(i=250),this.if=t,this.cf(2),this.Qc?.p1(13),this.Qc?.p1(i)};static cf=t=>{if(this.Qc&&this.Qc.lf+t>=500){const t=this.Qc;this.Qc=s.A.Ut(1),this.tf=t}}}},9091:(t,i,e)=>{e.d(i,{L:()=>s,p:()=>n});const s={'Backspace':{code:8,ch:8},'Enter':{code:10,ch:10},'Shift':{code:16,ch:65535},'Escape':{code:27,ch:27},'Tab':{code:9,ch:9},'CapsLock':{code:20,ch:65535},' ':{code:32,ch:32},'Control':{code:17,ch:65535},'Alt':{code:18,ch:65535},'Meta':{code:524,ch:65535},'ArrowLeft':{code:37,ch:65535},'ArrowRight':{code:39,ch:65535},'ArrowUp':{code:38,ch:65535},'ArrowDown':{code:40,ch:65535},'Insert':{code:155,ch:65535},'Home':{code:36,ch:65535},'PageUp':{code:33,ch:65535},'Delete':{code:127,ch:127},'End':{code:35,ch:65535},'PageDown':{code:34,ch:65535},'`':{code:192,ch:96},'~':{code:192,ch:126},'!':{code:49,ch:33},'@':{code:50,ch:64},'#':{code:51,ch:35},'$':{code:52,ch:36},'%':{code:53,ch:37},'^':{code:54,ch:94},'&':{code:55,ch:38},'*':{code:56,ch:42},'(':{code:57,ch:40},')':{code:48,ch:41},'-':{code:45,ch:45},'_':{code:45,ch:95},'=':{code:61,ch:61},'+':{code:61,ch:43},'[':{code:91,ch:91},'{':{code:91,ch:123},']':{code:93,ch:93},'}':{code:93,ch:125},'\\':{code:92,ch:92},'|':{code:92,ch:124},';':{code:59,ch:59},':':{code:59,ch:58},"'":{code:222,ch:39},'"':{code:222,ch:34},',':{code:44,ch:44},'<':{code:44,ch:60},'.':{code:46,ch:46},'>':{code:46,ch:62},'/':{code:47,ch:47},'?':{code:47,ch:63},'F1':{code:112,ch:65535},'F2':{code:113,ch:65535},'F3':{code:114,ch:65535},'F4':{code:115,ch:65535},'F5':{code:116,ch:65535},'F6':{code:117,ch:65535},'F7':{code:118,ch:65535},'F8':{code:119,ch:65535},'F9':{code:120,ch:65535},'F10':{code:121,ch:65535},'F11':{code:122,ch:65535},'F12':{code:123,ch:65535},0:{code:48,ch:48},1:{code:49,ch:49},2:{code:50,ch:50},3:{code:51,ch:51},4:{code:52,ch:52},5:{code:53,ch:53},6:{code:54,ch:54},7:{code:55,ch:55},8:{code:56,ch:56},9:{code:57,ch:57},'a':{code:65,ch:97},'b':{code:66,ch:98},'c':{code:67,ch:99},'d':{code:68,ch:100},'e':{code:69,ch:101},'f':{code:70,ch:102},'g':{code:71,ch:103},'h':{code:72,ch:104},'i':{code:73,ch:105},'j':{code:74,ch:106},'k':{code:75,ch:107},'l':{code:76,ch:108},'m':{code:77,ch:109},'n':{code:78,ch:110},'o':{code:79,ch:111},'p':{code:80,ch:112},'q':{code:81,ch:113},'r':{code:82,ch:114},'s':{code:83,ch:115},'t':{code:84,ch:116},'u':{code:85,ch:117},'v':{code:86,ch:118},'w':{code:87,ch:119},'x':{code:88,ch:120},'y':{code:89,ch:121},'z':{code:90,ch:122},'A':{code:65,ch:65},'B':{code:66,ch:66},'C':{code:67,ch:67},'D':{code:68,ch:68},'E':{code:69,ch:69},'F':{code:70,ch:70},'G':{code:71,ch:71},'H':{code:72,ch:72},'I':{code:73,ch:73},'J':{code:74,ch:74},'K':{code:75,ch:75},'L':{code:76,ch:76},'M':{code:77,ch:77},'N':{code:78,ch:78},'O':{code:79,ch:79},'P':{code:80,ch:80},'Q':{code:81,ch:81},'R':{code:82,ch:82},'S':{code:83,ch:83},'T':{code:84,ch:84},'U':{code:85,ch:85},'V':{code:86,ch:86},'W':{code:87,ch:87},'X':{code:88,ch:88},'Y':{code:89,ch:89},'Z':{code:90,ch:90}},n=['Tab','F1','F2','F3','F4','F5','F6','F7','F8','F9','F10','ArrowLeft','ArrowRight','ArrowUp','ArrowDown']},1120:(t,i,e)=>{e.d(i,{A:()=>c});var s=e(1069),n=e(8665),r=e(2679),h=e(2511),o=e(3819),a=e(3867),l=e(8950);class c{static Lo=[];static ff=null;static So=null;static Ea=0;static uf=1;static ba=2;static Ya=3;static Va=4;static il=5;static nl=6;static ul=7;static df=1;static wf=2;static yf=3;static Af=4;static mf=5;static Za=6;static yl=1;static Al=100;static ml=101;static pl=200;static pf=201;static gf=202;static gl=203;static If=205;static _f=300;static Cf=301;static Ef=302;static vf=303;static bf=304;static Tf=305;static Rf=306;static Of=307;static Lf=308;static Sf=309;static xf=310;static kf=311;static Mf=312;static Df=313;static Ff=314;static Nf=315;static Bf=316;static Uf=317;static Pf=318;static Gf=319;static Wf=320;static Yf=321;static Hf=322;static Vf=323;static Dl=324;static Fl=325;static Kf=326;static bl=327;static Il=401;static _l=500;static Xf=501;static jf=502;static vl=503;static Nl=600;static zf=601;static Zf=602;static qf=603;static $f=604;static Jf=605;static Qf=606;static tu=607;static iu=608;static eu=609;static su=610;static nu=611;static ru=612;static Bl=613;static Ul=650;static Wl=651;static Yl=652;static Hl=653;static Vl=654;static Pl=655;static hu=(t,i,e)=>{this.ff=new r.A(5e4),this.So=new r.A(5e4);const n=new s.A(t.read('data'));let h=-1;for(n.lf+=2;n.lf0){s.$o=new Uint8Array(r),s.Qo=new Uint16Array(r);for(let t=0;t0){s.scripts=new a.fe(o,null);for(let t=0;t0){const n=e.lastIndexOf(',');s.Wa[t]=this.yu(i,e.substring(0,n),parseInt(e.substring(n+1),10))}}s.Au=new a.fe(5,null);for(let t=0;t<5;t++){const i=n.wu;s.Au[t]=i,0===i.length&&(s.Au[t]=null)}}if(s.type===c.Ya&&(s.fill=1===n.lu),s.type===c.Va||s.type===c.uf){s.$a=1===n.lu;const t=n.lu;e&&(s.font=e[t]),s.Qa=1===n.lu}if(s.type===c.Va&&(s.text=n.wu,s.ja=n.wu),s.type!==c.uf&&s.type!==c.Ya&&s.type!==c.Va||(s.Ha=n.Ko),s.type!==c.Ya&&s.type!==c.Va||(s.Xa=n.Ko,s.Ka=n.Ko),s.type===c.il){const t=n.wu;if(t.length>0){const e=t.lastIndexOf(',');s.sl=this.yu(i,t.substring(0,e),parseInt(t.substring(e+1),10))}const e=n.wu;if(e.length>0){const t=e.lastIndexOf(',');s.el=this.yu(i,e.substring(0,t),parseInt(e.substring(t+1),10))}}if(s.type===c.nl){const t=n.lu;0!==t&&(s.model=this.al((t-1<<8)+n.lu));const i=n.lu;0!==i&&(s.mu=this.al((i-1<<8)+n.lu)),s.la=n.lu,0===s.la?s.la=-1:s.la=(s.la-1<<8)+n.lu,s.ca=n.lu,0===s.ca?s.ca=-1:s.ca=(s.ca-1<<8)+n.lu,s.zoom=n.ou,s.ol=n.ou,s.fl=n.ou}if(s.type===c.ul){s.Oa=new Int32Array(s.width*s.height),s.La=new Int32Array(s.width*s.height),s.$a=1===n.lu;const t=n.lu;e&&(s.font=e[t]),s.Qa=1===n.lu,s.Ha=n.Ko,s.Sa=n.fu,s.xa=n.fu,s.uu=1===n.lu,s.Au=new a.fe(5,null);for(let t=0;t<5;t++){const i=n.wu;s.Au[t]=i,0===i.length&&(s.Au[t]=null)}}s.za!==c.wf&&s.type!==c.ba||(s.pu=n.wu,s.action=n.wu,s.gu=n.ou),s.za!==c.df&&s.za!==c.Af&&s.za!==c.mf&&s.za!==c.Za||(s.Iu=n.wu,0===s.Iu.length&&(s.za===c.df?s.Iu='Ok':s.za===c.Af||s.za===c.mf?s.Iu='Select':s.za===c.Za&&(s.Iu='Continue')))}this.ff=null,this.So=null};static yu=(t,i,e)=>{const s=o.A._u(i)<<8n|BigInt(e);if(this.ff){const t=this.ff.get(s);if(t)return t}let n;try{n=h.A.Cu(t,i,e),this.ff?.put(s,n)}catch(t){return null}return n};static al=t=>{if(this.So){const i=this.So.get(BigInt(t));if(i)return i}const i=n.A.model(t);return this.So?.put(BigInt(t),i),i};id=-1;au=-1;type=-1;za=-1;_a=0;width=0;height=0;cu=-1;$o=null;Qo=null;scripts=null;scroll=0;hide=!1;draggable=!1;uu=!1;du=!1;Sa=0;xa=0;Ta=null;Ra=null;Wa=null;Au=null;fill=!1;$a=!1;font=null;Qa=!1;text=null;ja=null;Ha=0;Xa=0;Ka=0;sl=null;el=null;model=null;mu=null;la=-1;ca=-1;zoom=0;ol=0;fl=0;pu=null;action=null;gu=-1;Iu=null;aa=null;ma=null;pa=null;x=0;y=0;va=0;Oa=null;La=null;ua=0;fa=0;al(t,i,e){let s=this.model;if(e&&(s=this.mu),!s)return null;if(-1===t&&-1===i&&!s.Eu)return s;const r=n.A.vu(s,!0,!0,!1);return-1===t&&-1===i||r.xl(),-1!==t&&r.kl(t),-1!==i&&r.kl(i),r.Ml(64,768,-50,-10,-50,!0),r}bu(){if(this.au===this.id)return this.x;let t=c.Lo[this.au];if(!t.aa||!t.ma||!t.pa)return this.x;let i=t.aa.indexOf(this.id);if(-1===i)return this.x;let e=t.ma[i];for(;t.au!==t.id;){const s=c.Lo[t.au];s.aa&&s.ma&&s.pa&&(i=s.aa.indexOf(t.id),-1!==i&&(e+=s.ma[i])),t=s}return e}Tu(){if(this.au===this.id)return this.y;let t=c.Lo[this.au];if(!t.aa||!t.ma||!t.pa)return this.y;let i=t.aa.indexOf(this.id);if(-1===i)return this.y;let e=t.pa[i];for(;t.au!==t.id;){const s=c.Lo[t.au];s.aa&&s.ma&&s.pa&&(i=s.aa.indexOf(t.id),-1!==i&&(e+=s.pa[i])),t=s}return e}outline(t){const i=this.bu(),e=this.Tu();l.A.ga(i,e,this.width,this.height,t)}move(t,i){if(this.au===this.id)return;this.x=0,this.y=0;const e=c.Lo[this.au];if(e.aa&&e.ma&&e.pa){const s=e.aa.indexOf(this.id);-1!==s&&(e.ma[s]=t,e.pa[s]=i)}}delete(){if(this.au===this.id)return;const t=c.Lo[this.au];if(t.aa&&t.ma&&t.pa){const i=t.aa.indexOf(this.id);-1!==i&&(t.aa.splice(i,1),t.ma.splice(i,1),t.pa.splice(i,1))}}}},6333:(t,i,e)=>{e.d(i,{$:()=>s});class s{id;Ru=null;constructor(t){this.id=t}Ou(t){for(;;){const i=t.lu;if(0===i)break;this.decode(i,t)}return this}}},2164:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(6333);class r extends n.${static count=0;static Lo=[];static hu=t=>{const i=new s.A(t.read('flo.dat'));this.count=i.ou;for(let t=0;t(e>179&&(i=i/2|0),e>192&&(i=i/2|0),e>217&&(i=i/2|0),e>243&&(i=i/2|0),(t/4<<10)+(i/32<<7)+(e/2|0));static Su=(t,i)=>-1===t?12345678:((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);static xu=(t,i)=>-2===t?12345678:-1===t?(i<0?i=0:i>127&&(i=127),127-i):((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);ku=0;texture=-1;Mu=!1;Du=!0;Fu=0;Nu=0;Bu=0;Uu=0;Pu=0;Gu=0;decode(t,i){1===t?(this.ku=i.Wu,this.setColor(this.ku)):2===t?this.texture=i.lu:3===t?this.Mu=!0:5===t?this.Du=!1:6===t?this.Ru=i.wu:console.log('Error unrecognised config code: ',t)}setColor(t){const i=(t>>16&255)/256,e=(t>>8&255)/256,s=(255&t)/256;let n=i;ei&&(h=e),s>h&&(h=s);let o=0,a=0;const l=(n+h)/2;n!==h&&(l<.5&&(a=(h-n)/(h+n)),l>=.5&&(a=(h-n)/(2-h-n)),i===h?o=(e-s)/(h-n):e===h?o=(s-i)/(h-n)+2:s===h&&(o=(i-e)/(h-n)+4)),o/=6,this.Fu=256*o|0,this.Nu=256*a|0,this.Bu=256*l|0,this.Nu<0?this.Nu=0:this.Nu>255&&(this.Nu=255),this.Bu<0?this.Bu=0:this.Bu>255&&(this.Bu=255),this.Uu=l>.5?(1-l)*a*512|0:l*a*512|0,this.Uu<1&&(this.Uu=1),this.Pu=o*this.Uu|0;let c=this.Fu+(16*Math.random()|0)-8;c<0?c=0:c>255&&(c=255);let f=this.Nu+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255);let u=this.Bu+(48*Math.random()|0)-24;u<0?u=0:u>255&&(u=255),this.Gu=r.Lu(c,f,u)}}},8317:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(1069),n=e(6333),r=e(8665),h=e(3867);class o extends n.${static count=0;static Lo=[];static hu=t=>{const i=new s.A(t.read('idk.dat'));this.count=i.ou;for(let t=0;t=40&&t<50)this.Vu[t-40]=i.ou;else if(t>=50&&t<60)this.Ku[t-50]=i.ou;else{if(!(t>=60&&t<70))throw new Error(`Unrecognized idk config code: ${t}`);this.Hu[t-60]=i.ou}}al(){if(!this.Yu)return null;const t=new h.fe(this.Yu.length,null);for(let i=0;i{e.d(i,{A:()=>c});var s=e(6333),n=e(1069),r=e(2679),h=e(8665),o=e(1023),a=e(6169),l=e(3867);class c extends s.${static count=0;static cache=null;static ju=null;static zu=null;static Zu=0;static qu=new r.A(500);static $u=new r.A(30);static hu=t=>{this.ju=new n.A(t.read('loc.dat'));const i=new n.A(t.read('loc.idx'));this.count=i.ou,this.zu=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.zu||!this.ju)throw new Error('LocType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Zu=(this.Zu+1)%10;const i=this.cache[this.Zu];return this.ju.lf=this.zu[t],i.id=t,i.reset(),i.Ou(this.ju),i.Ju||(i.Ju=new Int32Array(1)),-1===i.Qu&&i.Ju&&(i.active=i.Ju.length>0&&i.Ju[0]===o.A.td.id,i.ed&&(i.active=!0)),i};static To=()=>{this.qu=null,this.$u=null,this.zu=null,this.cache=null,this.ju=null};Yu=null;Ju=null;name=null;sd=null;Vu=null;Ku=null;width=1;length=1;nd=!0;rd=!0;active=!1;Qu=-1;hd=!1;od=!1;Du=!1;la=-1;ad=!1;ld=16;fd=0;ud=0;ed=null;dd=-1;wd=-1;yd=!1;Ad=!0;md=128;pd=128;gd=128;Id=0;_d=0;Cd=0;Ed=0;vd=!1;decode(t,i){if(1===t){const t=i.lu;this.Yu=new Int32Array(t),this.Ju=new Int32Array(t);for(let e=0;e=30&&t<39)this.ed||(this.ed=new l.fe(5,null)),this.ed[t-30]=i.wu,'hidden'===this.ed[t-30]?.toLowerCase()&&(this.ed[t-30]=null);else if(40===t){const t=i.lu;this.Vu=new Uint16Array(t),this.Ku=new Uint16Array(t);for(let e=0;e=this.Yu.length)return null;let d=this.Yu[l];if(-1===d)return null;const w=this.yd!==i>3;w&&(d+=65536);let y=c.qu?.get(BigInt(d));y||(y=h.A.model(65535&d),w&&y.kd(),c.qu?.put(BigInt(d),y));const A=128!==this.md||128!==this.pd||128!==this.gd,m=0!==this._d||0!==this.Cd||0!==this.Ed;let p=h.A.vu(y,!this.Vu,!this.ad,i===a.A.Md&&-1===o&&!A&&!m);for(-1!==o&&(p.xl(),p.kl(o),p.Dd=null,p.Fd=null);i-- >0;)p.Nd();if(this.Vu&&this.Ku)for(let t=0;t{e.d(i,{A:()=>a});var s=e(6333),n=e(1069),r=e(2679),h=e(8665),o=e(3867);class a extends s.${static count=0;static cache=null;static ju=null;static zu=null;static Zu=0;static So=new r.A(30);static hu=t=>{this.ju=new n.A(t.read('npc.dat'));const i=new n.A(t.read('npc.idx'));this.count=i.ou,this.zu=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.zu||!this.ju)throw new Error('NpcType not loaded!!!');for(let i=0;i<20;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Zu=(this.Zu+1)%20;const i=this.cache[this.Zu]=new a(t);return this.ju.lf=this.zu[t],i.Ou(this.ju),i};static To=()=>{this.So=null,this.zu=null,this.cache=null,this.ju=null};name=null;sd=null;size=1;Yu=null;Hu=null;ad=!1;Pd=-1;Gd=-1;Wd=-1;Yd=-1;Hd=-1;Vu=null;Ku=null;ed=null;md=-1;pd=-1;gd=-1;Vd=!0;Kd=-1;Xd=128;jd=128;decode(t,i){if(1===t){const t=i.lu;this.Yu=new Uint16Array(t);for(let e=0;e=30&&t<40)this.ed||(this.ed=new o.fe(5,null)),this.ed[t-30]=i.wu,'hidden'===this.ed[t-30]?.toLowerCase()&&(this.ed[t-30]=null);else if(40===t){const t=i.lu;this.Vu=new Uint16Array(t),this.Ku=new Uint16Array(t);for(let e=0;e{e.d(i,{A:()=>u});var s=e(6333),n=e(1069),r=e(2511),h=e(2679),o=e(8665),a=e(4583),l=e(8950),c=e(9298),f=e(3867);class u extends s.${static count=0;static cache=null;static ju=null;static zu=null;static Zu=0;static Qd=!0;static So=new h.A(50);static tw=new h.A(200);static hu=(t,i)=>{this.Qd=i,this.ju=new n.A(t.read('obj.dat'));const e=new n.A(t.read('obj.idx'));this.count=e.ou,this.zu=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.zu||!this.ju)throw new Error('ObjType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Zu=(this.Zu+1)%10;const i=this.cache[this.Zu];return this.ju.lf=this.zu[t],i.id=t,i.reset(),i.Ou(this.ju),-1!==i.iw&&i.ew(),!this.Qd&&i.members&&(i.name='Members Object',i.sd="Login to a members' server to use this object.",i.ed=null,i.sw=null),i};static To=()=>{this.So=null,this.tw=null,this.zu=null,this.cache=null,this.ju=null};static ka=(t,i)=>{if(u.tw){let e=u.tw.get(BigInt(t));if(e&&e.nw!==i&&-1!==e.nw&&(e.rw(),e=null),e)return e}let e=u.get(t);if(e.hw||(i=-1),e.hw&&e.ow&&i>1){let t=-1;for(let s=0;s<10;s++)i>=e.ow[s]&&0!==e.ow[s]&&(t=e.hw[s]);-1!==t&&(e=u.get(t))}const s=new r.A(32,32),n=a.A.rl,h=a.A.hl,o=a.A.aw,f=l.A.lw,d=l.A.cw,w=l.A.fw,y=l.A.left,A=l.A.right,m=l.A.top,p=l.A.bottom;a.A.uw=!1,l.A.bind(s.lw,32,32),l.A.fillRect(0,0,32,32,c.A.Pa),a.A.Tc();const g=e.dw(1),I=a.A.sin[e.ww]*e.yw>>16,_=a.A.cos[e.ww]*e.yw>>16;g.cl(0,e.Aw,e.mw,e.ww,e.pw,I+(g.Ud/2|0)+e.gw,_+e.gw);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.lw[t+32*i]&&(t>0&&s.lw[t+32*i-1]>1||i>0&&s.lw[t+32*(i-1)]>1||t<31&&s.lw[t+32*i+1]>1||i<31&&s.lw[t+32*(i+1)]>1)&&(s.lw[t+32*i]=1);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.lw[t+32*i]&&t>0&&i>0&&s.lw[t+32*(i-1)-1]>0&&(s.lw[t+32*i]=3153952);if(-1!==e.iw){const t=this.ka(e.Iw,10),i=t.Na,s=t.nw;t.Na=32,t.nw=32,t._w(5,5,22,22),t.Na=i,t.nw=s}return u.tw?.put(BigInt(t),s),l.A.bind(f,d,w),l.A.Aa(y,m,A,p),a.A.rl=n,a.A.hl=h,a.A.aw=o,a.A.uw=!0,e.dl?s.Na=33:s.Na=32,s.nw=i,s};model=0;name=null;sd=null;Vu=null;Ku=null;yw=2e3;ww=0;Aw=0;mw=0;pw=0;gw=0;Cw=!1;Ew=-1;dl=!1;bw=1;members=!1;ed=null;sw=null;Tw=-1;Rw=-1;Ow=0;Lw=-1;Sw=-1;xw=0;kw=-1;Mw=-1;Dw=-1;Fw=-1;Nw=-1;Bw=-1;hw=null;ow=null;Iw=-1;iw=-1;decode(t,i){if(1===t)this.model=i.ou;else if(2===t)this.name=i.wu;else if(3===t)this.sd=i.wu;else if(4===t)this.yw=i.ou;else if(5===t)this.ww=i.ou;else if(6===t)this.Aw=i.ou;else if(7===t)this.pw=i.fu,this.pw>32767&&(this.pw-=65536);else if(8===t)this.gw=i.fu,this.gw>32767&&(this.gw-=65536);else if(9===t)this.Cw=!0;else if(10===t)this.Ew=i.ou;else if(11===t)this.dl=!0;else if(12===t)this.bw=i.Ko;else if(16===t)this.members=!0;else if(23===t)this.Tw=i.ou,this.Ow=i.bd;else if(24===t)this.Rw=i.ou;else if(25===t)this.Lw=i.ou,this.xw=i.bd;else if(26===t)this.Sw=i.ou;else if(t>=30&&t<35)this.ed||(this.ed=new f.fe(5,null)),this.ed[t-30]=i.wu,'hidden'===this.ed[t-30]?.toLowerCase()&&(this.ed[t-30]=null);else if(t>=35&&t<40)this.sw||(this.sw=new f.fe(5,null)),this.sw[t-35]=i.wu;else if(40===t){const t=i.lu;this.Vu=new Uint16Array(t),this.Ku=new Uint16Array(t);for(let e=0;e=100&&t<110&&(this.hw&&this.ow||(this.hw=new Uint16Array(10),this.ow=new Uint16Array(10)),this.hw[t-100]=i.ou,this.ow[t-100]=i.ou)}Uw(t){let i=this.Tw;if(1===t&&(i=this.Lw),-1===i)return null;let e=this.Rw,s=this.kw;1===t&&(e=this.Sw,s=this.Mw);let n=o.A.model(i);if(-1!==e){const t=o.A.model(e);if(-1===s){const i=[n,t];n=o.A.Tl(i,2)}else{const i=[n,t,o.A.model(s)];n=o.A.Tl(i,3)}}if(0===t&&0!==this.Ow&&n.translate(this.Ow,0,0),1===t&&0!==this.xw&&n.translate(this.xw,0,0),this.Vu&&this.Ku)for(let t=0;t1){let i=-1;for(let e=0;e<10;e++)t>=this.ow[e]&&0!==this.ow[e]&&(i=this.hw[e]);if(-1!==i)return u.get(i).dw(1)}if(u.So){const t=u.So.get(BigInt(this.id));if(t)return t}const i=o.A.model(this.model);if(this.Vu&&this.Ku)for(let t=0;t{e.d(i,{A:()=>h});var s=e(6333),n=e(1069),r=e(6730);class h extends s.${static count=0;static Lo=[];static hu=t=>{const i=new n.A(t.read('seq.dat'));this.count=i.ou;for(let t=0;t{e.d(i,{A:()=>a});var s=e(6333),n=e(1069),r=e(1312),h=e(8665),o=e(2679);class a extends s.${static count=0;static Lo=[];static So=new o.A(30);static hu=t=>{const i=new n.A(t.read('spotanim.dat'));this.count=i.ou;for(let t=0;t=40&&t<50)this.Vu[t-40]=i.ou;else{if(!(t>=50&&t<60))throw new Error(`Unrecognized spotanim config code: ${t}`);this.Ku[t-50]=i.ou}}al(){let t=a.So?.get(BigInt(this.id));if(t)return t;t=h.A.model(this.model);for(let i=0;i<6;i++)0!==this.Vu[0]&&t.Rl(this.Vu[i],this.Ku[i]);return a.So?.put(BigInt(this.id),t),t}}},3764:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(6333),n=e(1069);class r extends s.${static count=0;static Lo=[];static Kw=[];static Xw=0;static hu=t=>{const i=new n.A(t.read('varp.dat'));this.count=i.ou;for(let t=0;t{e.d(i,{A:()=>s});class s{static OPEN=0;static Jw=1;static Qw=2;static ty=4;static iy=8;static ey=s.Jw<<4;static sy=s.Qw<<4;static ny=s.ty<<4;static hy=s.iy<<4;static oy=256;static ly=512;static uy=1024;static wy=2048;static yy=4096;static Ay=s.ly<<4;static my=s.uy<<4;static py=s.wy<<4;static gy=s.yy<<4;static Iy=s.oy<<9;static _y=524288;static Cy=2097152;static Ey=s.Cy|s._y;static vy=s.oy|s.Ey;static by=s.Qw|s.vy;static Ty=s.iy|s.vy;static Ry=s.Qw|s.ty|s.Ty;static Oy=s.sy|s.vy;static Ly=s.iy|s.ey|s.Oy;static Sy=s.hy|s.vy;static xy=s.Jw|s.Qw|s.Sy;static ky=s.sy|s.ny|s.Sy;static My=16777215}},670:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(9456),n=e(6169),r=e(1023),h=e(4909);class o{static Dr=4;static jr=104;static index=(t,i)=>t*o.jr+i;offsetX;Dy;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.Dy=0,this.sizeX=o.jr,this.sizeZ=o.jr,this.flags=new Int32Array(this.sizeX*this.sizeZ),this.reset()}reset=()=>{for(let t=0;t{this.flags[o.index(t-this.offsetX,i-this.Dy)]|=s.A.Cy};Ny=(t,i)=>{this.flags[o.index(t-this.offsetX,i-this.Dy)]&=~s.A.Cy};By=(t,i,e,r,h,o)=>{let a=s.A.oy;o&&(a|=s.A.Iy);const l=t-this.offsetX,c=i-this.Dy;if(h===n.A.Uy||h===n.A.Py){const t=e;e=r,r=t}for(let t=l;t=0&&t=0&&i{let a=s.A.oy;o&&(a|=s.A.Iy);const l=t-this.offsetX,c=i-this.Dy;if(h===n.A.Uy||h===n.A.Py){const t=e;e=r,r=t}for(let t=l;t=0&&t=0&&i{const a=t-this.offsetX,l=i-this.Dy,c=o?s.A.gy:s.A.hy,f=o?s.A.yy:s.A.iy,u=o?s.A.uy:s.A.Qw,d=o?s.A.my:s.A.sy,w=o?s.A.ly:s.A.Jw,y=o?s.A.Ay:s.A.ey,A=o?s.A.wy:s.A.ty,m=o?s.A.py:s.A.ny;e===r.A.Yy.id?h===n.A.Md?(this.add(a,l,c),this.add(a-1,l,f)):h===n.A.Uy?(this.add(a,l,u),this.add(a,l+1,d)):h===n.A.Hy?(this.add(a,l,f),this.add(a+1,l,c)):h===n.A.Py&&(this.add(a,l,d),this.add(a,l-1,u)):e===r.A.Vy.id||e===r.A.Ky.id?h===n.A.Md?(this.add(a,l,w),this.add(a-1,l+1,y)):h===n.A.Uy?(this.add(a,l,A),this.add(a+1,l+1,m)):h===n.A.Hy?(this.add(a,l,y),this.add(a+1,l-1,w)):h===n.A.Py&&(this.add(a,l,m),this.add(a-1,l-1,A)):e===r.A.Xy.id&&(h===n.A.Md?(this.add(a,l,u|c),this.add(a-1,l,f),this.add(a,l+1,d)):h===n.A.Uy?(this.add(a,l,u|f),this.add(a,l+1,d),this.add(a+1,l,c)):h===n.A.Hy?(this.add(a,l,d|f),this.add(a+1,l,c),this.add(a,l-1,u)):h===n.A.Py&&(this.add(a,l,d|c),this.add(a,l-1,u),this.add(a-1,l,f))),o&&this.Wy(t,i,e,h,!1)};jy=(t,i,e,h,o)=>{const a=t-this.offsetX,l=i-this.Dy,c=o?s.A.gy:s.A.hy,f=o?s.A.yy:s.A.iy,u=o?s.A.uy:s.A.Qw,d=o?s.A.my:s.A.sy,w=o?s.A.ly:s.A.Jw,y=o?s.A.Ay:s.A.ey,A=o?s.A.wy:s.A.ty,m=o?s.A.py:s.A.ny;e===r.A.Yy.id?h===n.A.Md?(this.remove(a,l,c),this.remove(a-1,l,f)):h===n.A.Uy?(this.remove(a,l,u),this.remove(a,l+1,d)):h===n.A.Hy?(this.remove(a,l,f),this.remove(a+1,l,c)):h===n.A.Py&&(this.remove(a,l,d),this.remove(a,l-1,u)):e===r.A.Vy.id||e===r.A.Ky.id?h===n.A.Md?(this.remove(a,l,w),this.remove(a-1,l+1,y)):h===n.A.Uy?(this.remove(a,l,A),this.remove(a+1,l+1,m)):h===n.A.Hy?(this.remove(a,l,y),this.remove(a+1,l-1,w)):h===n.A.Py&&(this.remove(a,l,m),this.remove(a-1,l-1,A)):e===r.A.Xy.id&&(h===n.A.Md?(this.remove(a,l,u|c),this.remove(a-1,l,f),this.remove(a,l+1,d)):h===n.A.Uy?(this.remove(a,l,u|f),this.remove(a,l+1,d),this.remove(a+1,l,c)):h===n.A.Hy?(this.remove(a,l,d|f),this.remove(a+1,l,c),this.remove(a,l-1,u)):h===n.A.Py&&(this.remove(a,l,d|c),this.remove(a,l-1,u),this.remove(a-1,l,f))),o&&this.jy(t,i,e,h,!1)};zy=(t,i,e,h,a,l)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.Dy,u=e-this.offsetX,d=h-this.Dy,w=o.index(c,f);if(a===r.A.Yy.id){if(l===n.A.Md){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Oy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.by)===s.A.OPEN)return!0}else if(l===n.A.Uy){if(c===u&&f===d+1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Ty)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Sy)===s.A.OPEN)return!0}else if(l===n.A.Hy){if(c===u+1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Oy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.by)===s.A.OPEN)return!0}else if(l===n.A.Py){if(c===u&&f===d-1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Ty)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Sy)===s.A.OPEN)return!0}}else if(a===r.A.Xy.id){if(l===n.A.Md){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Sy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.by)===s.A.OPEN)return!0}else if(l===n.A.Uy){if(c===u-1&&f===d&&(this.flags[w]&s.A.Ty)===s.A.OPEN)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.by)===s.A.OPEN)return!0}else if(l===n.A.Hy){if(c===u-1&&f===d&&(this.flags[w]&s.A.Ty)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Oy)===s.A.OPEN)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1)return!0}else if(l===n.A.Py){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Oy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Sy)===s.A.OPEN)return!0;if(c===u&&f===d-1)return!0}}else if(a===r.A.Zy.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.sy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Qw)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.iy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.hy)===s.A.OPEN)return!0}return!1};qy=(t,i,e,h,a,l)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.Dy,u=e-this.offsetX,d=h-this.Dy,w=o.index(c,f);if(a===r.A.$y.id||a===r.A.Jy.id){if(a===r.A.Jy.id&&(l=l+2&3),l===n.A.Md){if(c===u+1&&f===d&&(this.flags[w]&s.A.hy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Qw)===s.A.OPEN)return!0}else if(l===n.A.Uy){if(c===u-1&&f===d&&(this.flags[w]&s.A.iy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Qw)===s.A.OPEN)return!0}else if(l===n.A.Hy){if(c===u-1&&f===d&&(this.flags[w]&s.A.iy)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.sy)===s.A.OPEN)return!0}else if(l===n.A.Py){if(c===u+1&&f===d&&(this.flags[w]&s.A.hy)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.sy)===s.A.OPEN)return!0}}else if(a===r.A.Qy.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.sy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Qw)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.iy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.hy)===s.A.OPEN)return!0}return!1};tA=(t,i,e,n,r,a,l)=>{const c=e+r-1,f=n+a-1,u=o.index(t-this.offsetX,i-this.Dy);return t>=e&&t<=c&&i>=n&&i<=f||(t===e-1&&i>=n&&i<=f&&(this.flags[u]&s.A.iy)===s.A.OPEN&&(l&h.A.Md)===s.A.OPEN||(t===c+1&&i>=n&&i<=f&&(this.flags[u]&s.A.hy)===s.A.OPEN&&(l&h.A.Hy)===s.A.OPEN||(i===n-1&&t>=e&&t<=c&&(this.flags[u]&s.A.Qw)===s.A.OPEN&&(l&h.A.Py)===s.A.OPEN||i===f+1&&t>=e&&t<=c&&(this.flags[u]&s.A.sy)===s.A.OPEN&&(l&h.A.Uy)===s.A.OPEN)))};add=(t,i,e)=>{this.flags[o.index(t,i)]|=e};remove=(t,i,e)=>{this.flags[o.index(t,i)]&=s.A.My-e}}},4909:(t,i,e)=>{e.d(i,{A:()=>s});class s{static Uy=1;static Hy=2;static Py=4;static Md=8}},6169:(t,i,e)=>{e.d(i,{A:()=>s});class s{static Md=0;static Uy=1;static Hy=2;static Py=3}},5599:(t,i,e)=>{e.d(i,{A:()=>s});class s{static iA=0;static eA=1;static sA=2;static nA=3}},1023:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5599);class n{static Yy=new n(0,s.A.iA);static Vy=new n(1,s.A.iA);static Xy=new n(2,s.A.iA);static Ky=new n(3,s.A.iA);static rA=new n(4,s.A.eA);static hA=new n(5,s.A.eA);static $y=new n(6,s.A.eA);static Jy=new n(7,s.A.eA);static Qy=new n(8,s.A.eA);static Zy=new n(9,s.A.sA);static td=new n(10,s.A.sA);static oA=new n(11,s.A.sA);static aA=new n(12,s.A.sA);static lA=new n(13,s.A.sA);static cA=new n(14,s.A.sA);static fA=new n(15,s.A.sA);static uA=new n(16,s.A.sA);static dA=new n(17,s.A.sA);static wA=new n(18,s.A.sA);static yA=new n(19,s.A.sA);static AA=new n(20,s.A.sA);static mA=new n(21,s.A.sA);static nA=new n(22,s.A.nA);static values(){return[this.Yy,this.Vy,this.dA,this.fA,this.Xy,this.cA,this.Zy,this.Ky,this.nA,this.aA,this.oA,this.$y,this.AA,this.td,this.hA,this.lA,this.Jy,this.rA,this.uA,this.Qy,this.yA,this.mA,this.wA]}static of(t){const i=this.values();for(let e=0;e{e.d(i,{A:()=>A});var s=e(670),n=e(2164),r=e(1069),h=e(4583),o=e(3045),a=e(5637),l=e(4197),c=e(1312),f=e(1023),u=e(6169),d=e(9298),w=e(5518),y=e(3867);class A{static pA=Int8Array.of(1,2,4,8);static gA=Uint8Array.of(16,32,64,128);static IA=Int8Array.of(1,0,-1,0);static _A=Int8Array.of(0,-1,0,1);static CA=(17*Math.random()|0)-8;static EA=(33*Math.random()|0)-16;static et=!0;static vA=0;static bA=!1;static TA=(t,i)=>{let e=this.RA(t+45365,i+91923,4)+(this.RA(t+10294,i+37821,2)-128>>1)+(this.RA(t,i,1)-128>>2)-128;return e=35+(.3*e|0),e<10?e=10:e>60&&(e=60),e};static RA=(t,i,e)=>{const s=t/e|0,n=t&e-1,r=i/e|0,h=i&e-1,o=this.OA(s,r),a=this.OA(s+1,r),l=this.OA(s,r+1),c=this.OA(s+1,r+1),f=this.LA(o,a,n,e),u=this.LA(l,c,n,e);return this.LA(f,u,h,e)};static LA=(t,i,e,s)=>{const n=65536-h.A.cos[1024*e/s|0]>>1;return(t*(65536-n)>>16)+(i*n>>16)};static OA=(t,i)=>((this.SA(t-1,i-1)+this.SA(t+1,i-1)+this.SA(t-1,i+1)+this.SA(t+1,i+1))/16|0)+((this.SA(t-1,i)+this.SA(t+1,i)+this.SA(t,i-1)+this.SA(t,i+1))/8|0)+(this.SA(t,i)/4|0);static SA=(t,i)=>{const e=t+57*i,s=BigInt(e<<13^e);return 255&Number((s*(s*s*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static By=(t,i,e,s,n,r,h,o,d,w,y)=>{const m=n[y][i][e],p=n[y][i+1][e],g=n[y][i+1][e+1],I=n[y][i][e+1],_=m+p+g+I>>2,C=a.A.get(o);let E=i+(e<<7)+(o<<14)+1073741824|0;C.active||(E+=-2147483648),E|=0;const v=(w<<6)+d<<24>>24;if(d===f.A.nA.id)s?.xA(C.al(f.A.nA.id,w,m,p,g,I,-1),t,i,e,_,E,v),C.nd&&C.active&&h?.Fy(i,e),-1!==C.la&&r.kA(new l.A(o,t,3,i,e,c.A.Lo[C.la],!0));else if(d===f.A.td.id||d===f.A.oA.id){const n=C.al(f.A.td.id,w,m,p,g,I,-1);if(n){let r,h,o=0;d===f.A.oA.id&&(o+=256),w===u.A.Uy||w===u.A.Py?(r=C.length,h=C.width):(r=C.width,h=C.length),s?.By(t,i,e,_,n,null,E,v,r,h,o)}C.nd&&h?.By(i,e,C.width,C.length,w,C.rd),-1!==C.la&&r.kA(new l.A(o,t,2,i,e,c.A.Lo[C.la],!0))}else if(d>=f.A.aA.id)s?.By(t,i,e,_,C.al(d,w,m,p,g,I,-1),null,E,v,1,1,0),C.nd&&h?.By(i,e,C.width,C.length,w,C.rd),-1!==C.la&&r.kA(new l.A(o,t,2,i,e,c.A.Lo[C.la],!0));else if(d===f.A.Yy.id)s?.Wy(t,i,e,_,A.pA[w],0,C.al(f.A.Yy.id,w,m,p,g,I,-1),null,E,v),C.nd&&h?.Wy(i,e,d,w,C.rd),-1!==C.la&&r.kA(new l.A(o,t,0,i,e,c.A.Lo[C.la],!0));else if(d===f.A.Vy.id)s?.Wy(t,i,e,_,A.gA[w],0,C.al(f.A.Vy.id,w,m,p,g,I,-1),null,E,v),C.nd&&h?.Wy(i,e,d,w,C.rd),-1!==C.la&&r.kA(new l.A(o,t,0,i,e,c.A.Lo[C.la],!0));else if(d===f.A.Xy.id){const n=w+1&3;s?.Wy(t,i,e,_,A.pA[w],A.pA[n],C.al(f.A.Xy.id,w+4,m,p,g,I,-1),C.al(f.A.Xy.id,n,m,p,g,I,-1),E,v),C.nd&&h?.Wy(i,e,d,w,C.rd),-1!==C.la&&r.kA(new l.A(o,t,0,i,e,c.A.Lo[C.la],!0))}else if(d===f.A.Ky.id)s?.Wy(t,i,e,_,A.gA[w],0,C.al(f.A.Ky.id,w,m,p,g,I,-1),null,E,v),C.nd&&h?.Wy(i,e,d,w,C.rd),-1!==C.la&&r.kA(new l.A(o,t,0,i,e,c.A.Lo[C.la],!0));else if(d===f.A.Zy.id)s?.By(t,i,e,_,C.al(d,w,m,p,g,I,-1),null,E,v,1,1,0),C.nd&&h?.By(i,e,C.width,C.length,w,C.rd),-1!==C.la&&r.kA(new l.A(o,t,2,i,e,c.A.Lo[C.la],!0));else if(d===f.A.rA.id)s?.MA(t,i,e,_,0,0,E,C.al(f.A.rA.id,u.A.Md,m,p,g,I,-1),v,512*w,A.pA[w]),-1!==C.la&&r.kA(new l.A(o,t,1,i,e,c.A.Lo[C.la],!0));else if(d===f.A.hA.id){let n=16;if(s){const r=s.DA(t,i,e);r>0&&(n=a.A.get(r>>14&32767).ld)}s?.MA(t,i,e,_,A.IA[w]*n,A._A[w]*n,E,C.al(f.A.rA.id,u.A.Md,m,p,g,I,-1),v,512*w,A.pA[w]),-1!==C.la&&r.kA(new l.A(o,t,1,i,e,c.A.Lo[C.la],!0))}else d===f.A.$y.id?(s?.MA(t,i,e,_,0,0,E,C.al(f.A.rA.id,u.A.Md,m,p,g,I,-1),v,w,256),-1!==C.la&&r.kA(new l.A(o,t,1,i,e,c.A.Lo[C.la],!0))):d===f.A.Jy.id?(s?.MA(t,i,e,_,0,0,E,C.al(f.A.rA.id,u.A.Md,m,p,g,I,-1),v,w,512),-1!==C.la&&r.kA(new l.A(o,t,1,i,e,c.A.Lo[C.la],!0))):d===f.A.Qy.id&&(s?.MA(t,i,e,_,0,0,E,C.al(f.A.rA.id,u.A.Md,m,p,g,I,-1),v,w,768),-1!==C.la&&r.kA(new l.A(o,t,1,i,e,c.A.Lo[C.la],!0)))};FA;NA;Hr;Vr;BA;UA;PA;GA;WA;YA;HA;VA;KA;XA;jA;zA;constructor(t,i,e,n){this.FA=t,this.NA=i,this.Hr=e,this.Vr=n,this.BA=new y.ZA(s.A.Dr,t,i),this.UA=new y.ZA(s.A.Dr,t,i),this.PA=new y.ZA(s.A.Dr,t,i),this.GA=new y.ZA(s.A.Dr,t,i),this.zA=new y.qA(s.A.Dr,t+1,i+1),this.WA=new y.ZA(s.A.Dr,t+1,i+1),this.YA=new y.Xr(t+1,i+1),this.HA=new Int32Array(i),this.VA=new Int32Array(i),this.KA=new Int32Array(i),this.XA=new Int32Array(i),this.jA=new Int32Array(i)}$A=(t,i)=>{for(let t=0;t=0&&i[s]?.Fy(e,n)}A.CA+=(5*Math.random()|0)-2,A.CA<-8?A.CA=-8:A.CA>8&&(A.CA=8),A.EA+=(5*Math.random()|0)-2,A.EA<-16?A.EA=-16:A.EA>16&&(A.EA=16);for(let i=0;i>8;for(let t=1;t>2)+(e[n+1][t]>>3)+(e[n][t-1]>>2)+(e[n][t+1]>>3)+(e[n][t]>>1);this.YA[n][t]=u-d}for(let t=0;t=0&&s0){const i=n.A.Lo[e-1];this.HA[t]+=i.Pu,this.VA[t]+=i.Nu,this.KA[t]+=i.Bu,this.XA[t]+=i.Uu,r=this.jA[t]++}}const h=e-5;if(h>=0&&h0){const i=n.A.Lo[e-1];this.HA[t]-=i.Pu,this.VA[t]-=i.Nu,this.KA[t]-=i.Bu,this.XA[t]-=i.Uu,r=this.jA[t]--}}}if(e>=1&&e=0&&f=0&&y=1&&c0||y>0){const m=this.Hr[i][e][c],p=this.Hr[i][e+1][c],g=this.Hr[i][e+1][c+1],I=this.Hr[i][e][c+1],_=this.YA[e][c],C=this.YA[e+1][c],E=this.YA[e+1][c+1],v=this.YA[e][c+1];let b=-1,T=-1;if(f>0){const t=256*s/a|0,i=r/l|0;let e=o/l|0;b=n.A.Lu(t,i,e);const h=t+A.CA&255;e+=A.EA,e<0?e=0:e>255&&(e=255),T=n.A.Lu(h,i,e)}if(i>0){let t=0!==f||this.PA[i][e][c]===w.A.QA;y>0&&!n.A.Lo[y-1].Du&&(t=!1),t&&m===p&&m===g&&m===I&&(this.zA[i][e][c]|=2340)}let R=0;if(-1!==b&&(R=h.A.palette[n.A.Su(T,96)]),0===y)t?.tm(i,e,c,w.A.QA,u.A.Md,-1,m,p,g,I,n.A.Su(b,_),n.A.Su(b,C),n.A.Su(b,E),n.A.Su(b,v),d.A.Pa,d.A.Pa,d.A.Pa,d.A.Pa,R,d.A.Pa);else{const s=this.PA[i][e][c]+1,r=this.GA[i][e][c],o=n.A.Lo[y-1];let a,l,f=o.texture;f>=0?(l=h.A.im(f),a=-1):o.ku===d.A.sm?(l=0,a=-2,f=-1):(a=n.A.Lu(o.Fu,o.Nu,o.Bu),l=h.A.palette[n.A.xu(o.Gu,96)]),t?.tm(i,e,c,s,r,f,m,p,g,I,n.A.Su(b,_),n.A.Su(b,C),n.A.Su(b,E),n.A.Su(b,v),n.A.xu(a,_),n.A.xu(a,C),n.A.xu(a,E),n.A.xu(a,v),R,l)}}}}}}for(let e=1;e0&&(t<<=3,i<<=3,e<<=3);for(let s=0;s<=n;s++)for(let r=0;r<=this.NA;r++)for(let h=0;h<=this.FA;h++){if(this.zA[s][h][r]&t){let i=r,e=r,a=s,l=s;for(;i>0&&this.zA[s][h][i-1]&t;)i--;for(;e0;){for(let s=i;s<=e;s++)if(!(this.zA[a-1][h][s]&t))break t;a--}t:for(;l=8){const s=this.Hr[l][h][i]-240,r=this.Hr[a][h][i];o.A.om(n,1,128*h,s,128*i,128*h,r,128*e+128);for(let s=a;s<=l;s++)for(let n=i;n<=e;n++)this.zA[s][h][n]&=~t}}if(this.zA[s][h][r]&i){let t=h,e=h,a=s,l=s;for(;t>0&&this.zA[s][t-1][r]&i;)t--;for(;e0;){for(let s=t;s<=e;s++)if(!(this.zA[a-1][s][r]&i))break t;a--}t:for(;l=8){const s=this.Hr[l][t][r]-240,h=this.Hr[a][t][r];o.A.om(n,2,128*t,s,128*r,128*e+128,h,128*r);for(let s=a;s<=l;s++)for(let n=t;n<=e;n++)this.zA[s][n][r]&=~i}}if(this.zA[s][h][r]&e){let t=h,i=h,a=r,l=r;for(;a>0&&this.zA[s][h][a-1]&e;)a--;for(;l0;){for(let i=a;i<=l;i++)if(!(this.zA[s][t-1][i]&e))break t;t--}t:for(;i=4){const r=this.Hr[s][t][a];o.A.om(n,4,128*t,r,128*a,128*i+128,r,128*l+128);for(let n=t;n<=i;n++)for(let t=a;t<=l;t++)this.zA[s][n][t]&=~e}}}}}};am=(t,i,e,r)=>{let h=0;for(let t=0;t>24;break}for(let n=t;n=0&&t=0&&n{const o=new r.A(new Uint8Array(h));for(let r=0;r=0&&l=0&&c>24,this.GA[r][l][c]=(f-2&3)<<24>>24):f<=81?this.Vr[r][l][c]=f-49<<24>>24:this.BA[r][l][c]=f-81<<24>>24}else for(;f=o.lu,0!==f;){if(1===f){o.lu;break}f<=49&&o.lu}}};fm=(t,i,e,n,h,o)=>{const a=new r.A(new Uint8Array(n));let l=-1;for(;;){const n=a.um;if(0===n)return;l+=n;let r=0;for(;;){const n=a.um;if(0===n)break;r+=n-1;const c=63&r,f=r>>6&63,u=r>>12,d=a.lu,w=d>>2,y=3&d,A=f+h,m=c+o;if(A>0&&m>0&&A=0&&(n=e[s]),this.By(u,A,m,t,i,n,l,w,y)}}}};By=(t,i,e,s,n,r,h,o,d)=>{if(A.et){if(16&this.Vr[t][i][e])return;if(this.JA(t,i,e)!==A.vA)return}const w=this.Hr[t][i][e],y=this.Hr[t][i+1][e],m=this.Hr[t][i+1][e+1],p=this.Hr[t][i][e+1],g=w+y+m+p>>2,I=a.A.get(h);let _=i+(e<<7)+(h<<14)+1073741824|0;I.active||(_+=-2147483648),_|=0;const C=(d<<6)+o<<24>>24;if(o===f.A.nA.id)(!A.et||I.active||I.vd)&&(s?.xA(I.al(f.A.nA.id,d,w,y,m,p,-1),t,i,e,g,_,C),I.nd&&I.active&&r?.Fy(i,e),-1!==I.la&&n.kA(new l.A(h,t,3,i,e,c.A.Lo[I.la],!0)));else if(o===f.A.td.id||o===f.A.oA.id){const a=I.al(f.A.td.id,d,w,y,m,p,-1);if(a){let n,r,h=0;if(o===f.A.oA.id&&(h+=256),d===u.A.Uy||d===u.A.Py?(n=I.length,r=I.width):(n=I.width,r=I.length),s?.By(t,i,e,g,a,null,_,C,n,r,h)&&I.Ad)for(let s=0;s<=n;s++)for(let n=0;n<=r;n++){let r=a.dm/4|0;r>30&&(r=30),r>this.WA[t][i+s][e+n]&&(this.WA[t][i+s][e+n]=r<<24>>24)}}I.nd&&r?.By(i,e,I.width,I.length,d,I.rd),-1!==I.la&&n.kA(new l.A(h,t,2,i,e,c.A.Lo[I.la],!0))}else if(o>=f.A.aA.id)s?.By(t,i,e,g,I.al(o,d,w,y,m,p,-1),null,_,C,1,1,0),o>=f.A.aA.id&&o<=f.A.dA.id&&o!==f.A.lA.id&&t>0&&(this.zA[t][i][e]|=2340),I.nd&&r?.By(i,e,I.width,I.length,d,I.rd),-1!==I.la&&n.kA(new l.A(h,t,2,i,e,c.A.Lo[I.la],!0));else if(o===f.A.Yy.id)s?.Wy(t,i,e,g,A.pA[d],0,I.al(f.A.Yy.id,d,w,y,m,p,-1),null,_,C),d===u.A.Md?(I.Ad&&(this.WA[t][i][e]=50,this.WA[t][i][e+1]=50),I.Du&&(this.zA[t][i][e]|=585)):d===u.A.Uy?(I.Ad&&(this.WA[t][i][e+1]=50,this.WA[t][i+1][e+1]=50),I.Du&&(this.zA[t][i][e+1]|=1170)):d===u.A.Hy?(I.Ad&&(this.WA[t][i+1][e]=50,this.WA[t][i+1][e+1]=50),I.Du&&(this.zA[t][i+1][e]|=585)):d===u.A.Py&&(I.Ad&&(this.WA[t][i][e]=50,this.WA[t][i+1][e]=50),I.Du&&(this.zA[t][i][e]|=1170)),I.nd&&r?.Wy(i,e,o,d,I.rd),-1!==I.la&&n.kA(new l.A(h,t,0,i,e,c.A.Lo[I.la],!0)),16!==I.ld&&s?.wm(t,i,e,I.ld);else if(o===f.A.Vy.id)s?.Wy(t,i,e,g,A.gA[d],0,I.al(f.A.Vy.id,d,w,y,m,p,-1),null,_,C),I.Ad&&(d===u.A.Md?this.WA[t][i][e+1]=50:d===u.A.Uy?this.WA[t][i+1][e+1]=50:d===u.A.Hy?this.WA[t][i+1][e]=50:d===u.A.Py&&(this.WA[t][i][e]=50)),I.nd&&r?.Wy(i,e,o,d,I.rd),-1!==I.la&&n.kA(new l.A(h,t,0,i,e,c.A.Lo[I.la],!0));else if(o===f.A.Xy.id){const a=d+1&3;s?.Wy(t,i,e,g,A.pA[d],A.pA[a],I.al(f.A.Xy.id,d+4,w,y,m,p,-1),I.al(f.A.Xy.id,a,w,y,m,p,-1),_,C),I.Du&&(d===u.A.Md?(this.zA[t][i][e]|=265,this.zA[t][i][e+1]|=1170):d===u.A.Uy?(this.zA[t][i][e+1]|=1170,this.zA[t][i+1][e]|=585):d===u.A.Hy?(this.zA[t][i+1][e]|=585,this.zA[t][i][e]|=1170):d===u.A.Py&&(this.zA[t][i][e]|=1170,this.zA[t][i][e]|=585)),I.nd&&r?.Wy(i,e,o,d,I.rd),-1!==I.la&&n.kA(new l.A(h,t,0,i,e,c.A.Lo[I.la],!0)),16!==I.ld&&s?.wm(t,i,e,I.ld)}else if(o===f.A.Ky.id)s?.Wy(t,i,e,g,A.gA[d],0,I.al(f.A.Ky.id,d,w,y,m,p,-1),null,_,C),I.Ad&&(d===u.A.Md?this.WA[t][i][e+1]=50:d===u.A.Uy?this.WA[t][i+1][e+1]=50:d===u.A.Hy?this.WA[t][i+1][e]=50:d===u.A.Py&&(this.WA[t][i][e]=50)),I.nd&&r?.Wy(i,e,o,d,I.rd),-1!==I.la&&n.kA(new l.A(h,t,0,i,e,c.A.Lo[I.la],!0));else if(o===f.A.Zy.id)s?.By(t,i,e,g,I.al(o,d,w,y,m,p,-1),null,_,C,1,1,0),I.nd&&r?.By(i,e,I.width,I.length,d,I.rd),-1!==I.la&&n.kA(new l.A(h,t,2,i,e,c.A.Lo[I.la],!0));else if(o===f.A.rA.id)s?.MA(t,i,e,g,0,0,_,I.al(f.A.rA.id,u.A.Md,w,y,m,p,-1),C,512*d,A.pA[d]),-1!==I.la&&n.kA(new l.A(h,t,1,i,e,c.A.Lo[I.la],!0));else if(o===f.A.hA.id){let r=16;if(s){const n=s.DA(t,i,e);n>0&&(r=a.A.get(n>>14&32767).ld)}s?.MA(t,i,e,g,A.IA[d]*r,A._A[d]*r,_,I.al(f.A.rA.id,u.A.Md,w,y,m,p,-1),C,512*d,A.pA[d]),-1!==I.la&&n.kA(new l.A(h,t,1,i,e,c.A.Lo[I.la],!0))}else o===f.A.$y.id?(s?.MA(t,i,e,g,0,0,_,I.al(f.A.rA.id,u.A.Md,w,y,m,p,-1),C,d,256),-1!==I.la&&n.kA(new l.A(h,t,1,i,e,c.A.Lo[I.la],!0))):o===f.A.Jy.id?(s?.MA(t,i,e,g,0,0,_,I.al(f.A.rA.id,u.A.Md,w,y,m,p,-1),C,d,512),-1!==I.la&&n.kA(new l.A(h,t,1,i,e,c.A.Lo[I.la],!0))):o===f.A.Qy.id&&(s?.MA(t,i,e,g,0,0,_,I.al(f.A.rA.id,u.A.Md,w,y,m,p,-1),C,d,768),-1!==I.la&&n.kA(new l.A(h,t,1,i,e,c.A.Lo[I.la],!0)))};JA=(t,i,e)=>8&this.Vr[t][i][e]?0:t<=0||!(2&this.Vr[1][i][e])?t:t-1}},3045:(t,i,e)=>{e.d(i,{A:()=>g});var s=e(4583),n=e(1161),r=e(3795),h=e(8256),o=e(670),a=e(9222),l=e(6855),c=e(7441),f=e(6666),u=e(5748),d=e(3479),w=e(8950),y=e(2771),A=e(5518),m=e(6169),p=e(3867);class g{static ym=new p.Am(8,32,51,51,!1);static pm=new p.fe(100,null);static gm=new Int32Array(o.A.Dr);static Im=new p._m(o.A.Dr,500,null);static Cm=new p.fe(500,null);static Em=new f.A;static vm=0;static bm=0;static Tm=0;static Rm=0;static Om=0;static Lm=0;static Sm=0;static xm=0;static km=0;static Mm=0;static Dm=0;static Fm=0;static Nm=0;static Bm=0;static Um=0;static Pm=0;static Gm=0;static Wm=0;static Ym=0;static Hm=0;static Vm=0;static Km=0;static Xm=!1;static jm=null;static zm=Uint8Array.of(19,55,38,155,255,110,137,205,76);static Zm=Uint8Array.of(160,192,80,96,0,144,80,48,160);static qm=Uint8Array.of(76,8,137,4,0,1,38,2,19);static $m=Int8Array.of(0,0,2,0,0,2,1,1,0);static Jm=Int8Array.of(2,0,0,2,0,0,0,4,4);static Qm=Int8Array.of(0,4,4,8,0,0,8,0,0);static tp=Int8Array.of(1,1,0,0,0,8,0,0,8);static ip=Int8Array.of(53,-53,-53,53);static ep=Int8Array.of(-53,-53,53,53);static sp=Int8Array.of(-45,45,45,-45);static np=Int8Array.of(45,45,-45,-45);static rp=[new Int8Array(16),Int8Array.of(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,0,0,0,1,1,0,0,1,1,1,0,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1),Int8Array.of(0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0),Int8Array.of(0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0),Int8Array.of(1,1,1,1,1,1,1,1,0,1,1,1,0,0,1,1),Int8Array.of(1,1,1,1,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,0,0,0,0,1,1,0,1,1,1,0,1,1,1),Int8Array.of(0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1)];static hp=[Int8Array.of(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),Int8Array.of(12,8,4,0,13,9,5,1,14,10,6,2,15,11,7,3),Int8Array.of(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0),Int8Array.of(3,7,11,15,2,6,10,14,1,5,9,13,0,4,8,12)];static op=Int32Array.of(41,39248,41,4643,41,41,41,41,41,41,41,41,41,41,41,43086,41,41,41,41,41,41,41,8602,41,28992,41,41,41,41,41,5056,41,41,41,41,41,41,41,41,41,41,41,41,41,41,3131,41,41,41);static ap=0;static Ma=0;static Da=0;static lp=-1;static cp=-1;static et=!0;static init=(t,i,e,n,r)=>{this.bm=0,this.Tm=0,this.Rm=t,this.Om=i,this.Lm=t/2|0,this.Sm=i/2|0;const h=new p.Am(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let i=0;i<2048;i+=64){this.xm=s.A.sin[t],this.km=s.A.cos[t],this.Mm=s.A.sin[i],this.Dm=s.A.cos[i];const o=(t-128)/32|0,a=i/64|0;for(let t=-26;t<=26;t++)for(let i=-26;i<=26;i++){const s=128*t,l=128*i;let c=!1;for(let t=-e;t<=n;t+=128)if(this.fp(s,l,r[o]+t)){c=!0;break}h[o][a][t+25+1][i+25+1]=c}}for(let t=0;t<8;t++)for(let i=0;i<32;i++)for(let e=-25;e<25;e++)for(let s=-25;s<25;s++){let n=!1;t:for(let r=-1;r<=1;r++)for(let o=-1;o<=1;o++){if(h[t][i][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t][(i+1)%31][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][i][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][(i+1)%31][e+r+25+1][s+o+25+1]){n=!0;break t}}this.ym[t][i][e+25][s+25]=n}};static To=()=>{this.pm=null,this.gm=null,this.Im=null,this.Em=null,this.ym=null,this.Cm=null,this.jm=null,console.log('World3D unloaded!')};static om=(t,i,e,s,n,r,o,a)=>{g.Im[t][g.gm[t]++]=new h.A(e/128|0,r/128|0,n/128|0,a/128|0,i,e,r,n,a,s,o)};static fp=(t,i,e)=>{const s=i*this.Mm+t*this.Dm>>16,n=i*this.Dm-t*this.Mm>>16,r=e*this.xm+n*this.km>>16,h=e*this.km-n*this.xm>>16;if(r<50||r>3500)return!1;const o=this.Lm+((s<<9)/r|0),a=this.Sm+((h<<9)/r|0);return o>=this.bm&&o<=this.Rm&&a>=this.Tm&&a<=this.Om};up;FA;NA;dp;wp;_h;yp;Ap;mp;pp=0;gp=0;Ip=0;constructor(t,i,e,s){this.up=e,this.FA=s,this.NA=i,this.wp=new p.Eh(e,s,i,null),this.yp=new p.qA(e,s+1,i+1),this.dp=t,this._h=new p.fe(5e3,null),this.Ap=new Int32Array(1e4),this.mp=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this.gp=t;for(let i=0;i{const e=this.wp[0][t][i];for(let e=0;e<3;e++){this.wp[e][t][i]=this.wp[e+1][t][i];const s=this.wp[e][t][i];s&&s.level--}this.wp[0][t][i]||(this.wp[0][t][i]=new r.A(0,t,i));const s=this.wp[0][t][i];s&&(s.Cp=e),this.wp[3][t][i]=null};nm=(t,i,e,s)=>{const n=this.wp[t][i][e];n&&(n.Ep=s)};tm=(t,i,e,s,n,h,o,a,l,c,f,u,w,m,p,g,I,_,C,E)=>{if(s===A.A.QA){for(let s=t;s>=0;s--)this.wp[s][i][e]||(this.wp[s][i][e]=new r.A(s,i,e));const s=this.wp[t][i][e];s&&(s.vp=new d.A(f,u,w,m,-1,C,!1))}else if(s===A.A.bp){for(let s=t;s>=0;s--)this.wp[s][i][e]||(this.wp[s][i][e]=new r.A(s,i,e));const s=this.wp[t][i][e];s&&(s.vp=new d.A(p,g,I,_,h,E,o===a&&o===l&&o===c))}else{for(let s=t;s>=0;s--)this.wp[s][i][e]||(this.wp[s][i][e]=new r.A(s,i,e));const d=this.wp[t][i][e];d&&(d.Tp=new y.A(i,s,g,a,w,n,f,c,E,p,h,_,C,l,I,m,o,e,u))}};xA=(t,i,e,s,n,h,o)=>{this.wp[i][e][s]||(this.wp[i][e][s]=new r.A(i,e,s));const l=this.wp[i][e][s];l&&(l.Rp=new a.A(n,128*e+64,128*s+64,t,h,o))};Op=(t,i,e)=>{const s=this.wp[t][i][e];s&&(s.Rp=null)};Lp=(t,i,e,s,n,h,o,a)=>{let l=0;const c=this.wp[s][t][i];if(c)for(let t=0;tl&&(l=e)}else this.wp[s][t][i]=new r.A(s,t,i);const f=this.wp[s][t][i];f&&(f.kp=new u.A(e,128*t+64,128*i+64,h,o,a,n,l))};Mp=(t,i,e)=>{const s=this.wp[t][i][e];s&&(s.kp=null)};Wy=(t,i,e,s,n,h,o,a,c,f)=>{if(!o&&!a)return;for(let s=t;s>=0;s--)this.wp[s][i][e]||(this.wp[s][i][e]=new r.A(s,i,e));const u=this.wp[t][i][e];u&&(u.Dp=new l.A(s,128*i+64,128*e+64,n,h,o,a,c,f))};jy=(t,i,e,s)=>{const n=this.wp[t][i][e];1===s&&n&&(n.Dp=null)};MA=(t,i,e,s,n,h,o,a,l,f,u)=>{if(!a)return;for(let s=t;s>=0;s--)this.wp[s][i][e]||(this.wp[s][i][e]=new r.A(s,i,e));const d=this.wp[t][i][e];d&&(d.Fp=new c.A(s,128*i+n+64,128*e+h+64,u,f,a,o,l))};Np=(t,i,e)=>{const s=this.wp[t][i][e];s&&(s.Fp=null)};wm=(t,i,e,s)=>{const n=this.wp[t][i][e];if(!n)return;const r=n.Fp;if(!r)return;const h=128*i+64,o=128*e+64;r.x=h+((r.x-h)*s/16|0),r.z=o+((r.z-o)*s/16|0)};Bp=(t,i,e,s)=>{if(!s)return;const n=this.wp[t][i][e];if(!n)return;const r=n.Fp;r&&(r.model=s)};Up=(t,i,e,s)=>{if(!s)return;const n=this.wp[t][i][e];if(!n)return;const r=n.Rp;r&&(r.model=s)};Pp=(t,i,e,s)=>{if(!s)return;const n=this.wp[t][i][e];if(!n)return;const r=n.Dp;r&&(r.Gp=s)};Wp=(t,i,e,s,n)=>{if(!s)return;const r=this.wp[e][t][i];if(!r)return;const h=r.Dp;h&&(h.Gp=s,h.Yp=n)};By=(t,i,e,s,n,r,h,o,a,l,c)=>{if(!n&&!r)return!0;const f=128*i+64*a,u=128*e+64*l;return this.Hp(f,u,s,t,i,e,a,l,n,r,h,o,c,!1)};Vp=(t,i,e,s,n,r,h,o,a,l)=>{if(!n&&!r)return!0;let c=i-a,f=s-a,u=i+a,d=s+a;return l&&(o>640&&o<1408&&(d+=128),o>1152&&o<1920&&(u+=128),(o>1664||o<384)&&(f-=128),o>128&&o<896&&(c-=128)),c=c/128|0,f=f/128|0,u=u/128|0,d=d/128|0,this.Hp(i,s,e,t,c,f,u+1-c,d-f+1,n,r,h,0,o,!0)};Kp=(t,i,e,s,n,r,h,o,a,l,c,f)=>!a&&!l||this.Hp(i,s,e,t,n,r,h+1-n,o-r+1,a,l,c,0,f,!0);Gy=(t,i,e)=>{const s=this.wp[t][i][e];if(s)for(let t=0;t>29&3)&&n.jp===i&&n.zp===e)return void this.Zp(n)}};qp=(t,i,e,s)=>{if(!s)return;const n=this.wp[t][i][e];if(n)for(let t=0;t>29&3))return void(i.model=s)}};$p=()=>{for(let t=0;t{const s=this.wp[t][i][e];return s&&s.Dp?s.Dp.Xp:0};Jp=(t,i,e)=>{const s=this.wp[t][e][i];return s&&s.Fp?s.Fp.Xp:0};Qp=(t,i,e)=>{const s=this.wp[t][i][e];if(!s)return 0;for(let t=0;t>29&3)&&n.jp===i&&n.zp===e)return n.Xp}return 0};tg=(t,i,e)=>{const s=this.wp[t][i][e];return s&&s.Rp?s.Rp.Xp:0};ig=(t,i,e,s)=>{const n=this.wp[t][i][e];if(n){if(n.Dp&&n.Dp.Xp===s)return 255&n.Dp.info;if(n.Fp&&n.Fp.Xp===s)return 255&n.Fp.info;if(n.Rp&&n.Rp.Xp===s)return 255&n.Rp.info;for(let t=0;t{const r=i*(0|Math.sqrt(e*e+s*s+n*n))>>8;for(let i=0;i{if(i0){const n=this.wp[t][i+1][e-1];n&&n.Rp&&n.Rp.model&&n.Rp.model.eg&&this.ng(s,n.Rp.model,128,0,-128,!0)}};sg=(t,i,e,s,n,r)=>{let h=!0,o=i;const a=i+s,l=e-1,c=e+n;for(let f=t;f<=t+1;f++)if(f!==this.up){for(let u=o;u<=a;u++)if(!(u<0||u>=this.FA))for(let o=l;o<=c;o++){if(o<0||o>=this.NA||h&&u=e||u===i))continue;const l=this.wp[f][u][o];if(!l)continue;const d=128*(u-i)+64*(1-s),w=128*(o-e)+64*(1-n),y=((this.dp[f][u][o]+this.dp[f][u+1][o]+this.dp[f][u][o+1]+this.dp[f][u+1][o+1])/4|0)-((this.dp[t][i][e]+this.dp[t][i+1][e]+this.dp[t][i][e+1]+this.dp[t][i+1][e+1])/4|0),A=l.Dp;A&&A.Gp&&A.Gp.eg&&this.ng(r,A.Gp,d,y,w,h),A&&A.Yp&&A.Yp.eg&&this.ng(r,A.Yp,d,y,w,h);for(let t=0;t{this.Ip++;let h=0;const o=i.Od,a=i.Rd;if(t.eg&&t.lg)for(let r=0;ri.cg)continue;const u=t.Od[r]-e;if(ui.ug)continue;const d=t.Ld[r]-n;if(di.wg)continue;if(i.eg&&i.lg)for(let t=0;t{const h=this.wp[t][i][e];if(!h)return;const o=h.vp;if(o){const t=o.color;if(0!==t)for(let i=0;i<4;i++)s[n]=t,s[n+1]=t,s[n+2]=t,s[n+3]=t,n+=r;return}const a=h.Tp;if(!a)return;const l=a.shape,c=a.angle,f=a._g,u=a.Cg,d=g.rp[l],w=g.hp[c];let y=0;if(0===f)for(let t=0;t<4;t++)0!==d[w[y++]]&&(s[n]=u),0!==d[w[y++]]&&(s[n+1]=u),0!==d[w[y++]]&&(s[n+2]=u),0!==d[w[y++]]&&(s[n+3]=u),n+=r;else for(let t=0;t<4;t++)s[n]=0===d[w[y++]]?f:u,s[n+1]=0===d[w[y++]]?f:u,s[n+2]=0===d[w[y++]]?f:u,s[n+3]=0===d[w[y++]]?f:u,n+=r};click=(t,i)=>{g.Xm=!0,g.Ma=t,g.Da=i,g.lp=-1,g.cp=-1};draw=(t,i,e,n,r,h,o)=>{t<0?t=0:t>=128*this.FA&&(t=128*this.FA-1),e<0?e=0:e>=128*this.NA&&(e=128*this.NA-1),g.vm++,g.xm=s.A.sin[h],g.km=s.A.cos[h],g.Mm=s.A.sin[r],g.Dm=s.A.cos[r],g.jm=g.ym[(h-128)/32|0][r/64|0],g.Fm=t,g.Nm=i,g.Bm=e,g.Um=t/128|0,g.Pm=e/128|0,g.Vm=n,g.Gm=g.Um-25,g.Gm<0&&(g.Gm=0),g.Ym=g.Pm-25,g.Ym<0&&(g.Ym=0),g.Wm=g.Um+25,g.Wm>this.FA&&(g.Wm=this.FA),g.Hm=g.Pm+25,g.Hm>this.NA&&(g.Hm=this.NA),this.Eg(),g.Km=0;for(let t=this.gp;t=2e3)?(h.visible=!0,h.update=!0,h.vg=h.Sp>0,g.Km++):(h.visible=!1,h.update=!1,h.bg=0))}}for(let t=this.gp;t=g.Wm))for(let t=-25;t<=0;t++){const n=g.Pm+t,r=g.Pm-t;let h;if(e>=g.Gm&&(n>=g.Ym&&(h=i[e][n],h&&h.visible&&this.Tg(h,!0,o)),r=g.Ym&&(h=i[s][n],h&&h.visible&&this.Tg(h,!0,o)),r=g.Wm))for(let t=-25;t<=0;t++){const n=g.Pm+t,r=g.Pm-t;let h;if(e>=g.Gm&&(n>=g.Ym&&(h=i[e][n],h&&h.visible&&this.Tg(h,!1,o)),r=g.Ym&&(h=i[s][n],h&&h.visible&&this.Tg(h,!1,o)),r{if(!c&&!f)return!1;for(let t=h;t=this.FA||i>=this.NA)return!1;const e=this.wp[s][t][i];if(e&&e.Sp>=5)return!1}const A=new n.A(s,e,t,i,c,f,w,h,h+a-1,o,o+l-1,u,d);for(let t=h;th&&(e|=1),to&&(e+=8),i=0;e--)this.wp[e][t][i]||(this.wp[e][t][i]=new r.A(e,t,i));const n=this.wp[s][t][i];n&&(n.xp[n.Sp]=A,n.Rg[n.Sp]=e,n.Og|=e,n.Sp++)}return y&&(this._h[this.pp++]=A),!0};Zp=t=>{for(let i=t.jp;i<=t.hg;i++)for(let e=t.zp;e<=t.og;e++){const s=this.wp[t.level][i][e];if(s){for(let i=0;i{const t=g.gm[g.Vm],i=g.Im[g.Vm];g.ap=0;for(let e=0;e=0&&s<=50){n=t.Sg+25-g.Pm,n<0&&(n=0),r=t.NA+25-g.Pm,r>50&&(r=50);let i=!1;for(;n<=r;)if(g.jm&&g.jm[s][n++]){i=!0;break}if(i){if(h=g.Fm-t.fg,h>32)t.mode=1;else{if(h>=-32)continue;t.mode=2,h=-h}t.xg=(t.dg-g.Bm<<8)/h|0,t.kg=(t.wg-g.Bm<<8)/h|0,t.Mg=(t.cg-g.Nm<<8)/h|0,t.Dg=(t.Ud-g.Nm<<8)/h|0,g.Cm[g.ap++]=t}}}else if(2===t.type){if(s=t.Sg+25-g.Pm,s>=0&&s<=50){n=t.Lg+25-g.Um,n<0&&(n=0),r=t.FA+25-g.Um,r>50&&(r=50);let i=!1;for(;n<=r;)if(g.jm&&g.jm[n++][s]){i=!0;break}if(i){if(h=g.Bm-t.dg,h>32)t.mode=3;else{if(h>=-32)continue;t.mode=4,h=-h}t.Fg=(t.fg-g.Fm<<8)/h|0,t.Ng=(t.ug-g.Fm<<8)/h|0,t.Mg=(t.cg-g.Nm<<8)/h|0,t.Dg=(t.Ud-g.Nm<<8)/h|0,g.Cm[g.ap++]=t}}}else if(4===t.type&&(s=t.cg-g.Nm,s>128&&(n=t.Sg+25-g.Pm,n<0&&(n=0),r=t.NA+25-g.Pm,r>50&&(r=50),n<=r))){let i=t.Lg+25-g.Um;i<0&&(i=0),h=t.FA+25-g.Um,h>50&&(h=50);let e=!1;t:for(let t=i;t<=h;t++)for(let i=n;i<=r;i++)if(g.jm&&g.jm[t][i]){e=!0;break t}e&&(t.mode=5,t.Fg=(t.fg-g.Fm<<8)/s|0,t.Ng=(t.ug-g.Fm<<8)/s|0,t.xg=(t.dg-g.Bm<<8)/s|0,t.kg=(t.wg-g.Bm<<8)/s|0,g.Cm[g.ap++]=t)}}};Tg=(t,i,e)=>{for(g.Em.kA(t);;){let t;do{if(t=g.Em.Bg(),!t)return}while(!t.update);const s=t.x,n=t.z,r=t.level,h=t.Ug,o=this.wp[r];if(t.visible){if(i){if(r>0){const t=this.wp[r-1][s][n];if(t&&t.update)continue}if(s<=g.Um&&s>g.Gm){const i=o[s-1][n];if(i&&i.update&&(i.visible||!(1&t.Og)))continue}if(s>=g.Um&&sg.Ym){const i=o[s][n-1];if(i&&i.update&&(i.visible||!(8&t.Og)))continue}if(n>=g.Pm&&nn&&(l+=6),c=g.zm[l],t.Vg=g.qm[l]),f&&(f.Kg&g.Zm[l]?16===f.Kg?(t.bg=3,t.Xg=g.$m[l],t.jg=3-t.Xg):32===f.Kg?(t.bg=6,t.Xg=g.Jm[l],t.jg=6-t.Xg):64===f.Kg?(t.bg=12,t.Xg=g.Qm[l],t.jg=12-t.Xg):(t.bg=9,t.Xg=g.tp[l],t.jg=9-t.Xg):t.bg=0,f.Kg&c&&!this.zg(h,s,n,f.Kg)&&f.Gp?.draw(0,g.xm,g.km,g.Mm,g.Dm,f.x-g.Fm,f.y-g.Nm,f.z-g.Bm,f.Xp),f.Zg&c&&!this.zg(h,s,n,f.Zg)&&f.Yp?.draw(0,g.xm,g.km,g.Mm,g.Dm,f.x-g.Fm,f.y-g.Nm,f.z-g.Bm,f.Xp)),u&&!this.visible(h,s,n,u.model.Ud))if(u.type&c)u.model.draw(u.angle,g.xm,g.km,g.Mm,g.Dm,u.x-g.Fm,u.y-g.Nm,u.z-g.Bm,u.Xp);else if(768&u.type){const t=u.x-g.Fm,i=u.y-g.Nm,e=u.z-g.Bm,s=u.angle;let n,r;if(n=s===m.A.Uy||s===m.A.Hy?-t:t,r=s===m.A.Hy||s===m.A.Py?-e:e,256&u.type&&rn){const n=t+g.sp[s],r=e+g.np[s];u.model.draw(512*s+1280&2047,g.xm,g.km,g.Mm,g.Dm,n,i,r,u.Xp)}}if(a){const i=t.Rp;i&&i.model?.draw(0,g.xm,g.km,g.Mm,g.Dm,i.x-g.Fm,i.y-g.Nm,i.z-g.Bm,i.Xp);const e=t.kp;e&&0===e.offset&&(e.qg&&e.qg.draw(0,g.xm,g.km,g.Mm,g.Dm,e.x-g.Fm,e.y-g.Nm,e.z-g.Bm,e.Xp),e.$g&&e.$g.draw(0,g.xm,g.km,g.Mm,g.Dm,e.x-g.Fm,e.y-g.Nm,e.z-g.Bm,e.Xp),e.Jg&&e.Jg.draw(0,g.xm,g.km,g.Mm,g.Dm,e.x-g.Fm,e.y-g.Nm,e.z-g.Bm,e.Xp))}const d=t.Og;if(0!==d){if(sg.Um&&1&d){const t=o[s-1][n];t&&t.update&&g.Em.kA(t)}if(n>g.Pm&&8&d){const t=o[s][n-1];t&&t.update&&g.Em.kA(t)}}}if(0!==t.bg){let i=!0;for(let e=0;ei.jp&&(r+=1),ei.zp&&(r+=8),ss&&(s=n);const h=g.Pm-i.zp,a=i.og-g.Pm;i.Qg=a>h?s+a:s+h}for(;;){let t=-50,i=-1;for(let e=0;et&&(t=s.Qg,i=e))}if(-1===i)break;const a=g.pm[i];if(a){a.vm=g.vm;let t=a.model;t||(t=a.Yg?.draw(e)??null),t&&!this.tI(h,a.jp,a.hg,a.zp,a.og,t.Ud)&&t.draw(a.Hg,g.xm,g.km,g.Mm,g.Dm,a.x-g.Fm,a.y-g.Nm,a.z-g.Bm,a.Xp);for(let t=a.jp;t<=a.hg;t++)for(let i=a.zp;i<=a.og;i++){const e=o[t][i];e&&(0!==e.bg?g.Em.kA(e):t===s&&i===n||!e.update||g.Em.kA(e))}}}if(t.vg)continue}if(!t.update||0!==t.bg)continue;if(s<=g.Um&&s>g.Gm){const t=o[s-1][n];if(t&&t.update)continue}if(s>=g.Um&&sg.Ym){const t=o[s][n-1];if(t&&t.update)continue}if(n>=g.Pm&&n=r){const r=t+g.ip[n],h=s+g.ep[n];i.model.draw(512*n+256,g.xm,g.km,g.Mm,g.Dm,r,e,h,i.Xp)}if(512&i.type&&h<=r){const r=t+g.sp[n],h=s+g.np[n];i.model.draw(512*n+1280&2047,g.xm,g.km,g.Mm,g.Dm,r,e,h,i.Xp)}}const e=t.Dp;e&&(e.Zg&t.Vg&&!this.zg(h,s,n,e.Zg)&&e.Yp?.draw(0,g.xm,g.km,g.Mm,g.Dm,e.x-g.Fm,e.y-g.Nm,e.z-g.Bm,e.Xp),e.Kg&t.Vg&&!this.zg(h,s,n,e.Kg)&&e.Gp?.draw(0,g.xm,g.km,g.Mm,g.Dm,e.x-g.Fm,e.y-g.Nm,e.z-g.Bm,e.Xp))}if(rg.Um){const t=o[s-1][n];t&&t.update&&g.Em.kA(t)}if(n>g.Pm){const t=o[s][n-1];t&&t.update&&g.Em.kA(t)}}};Gg=(t,i,e,n,r,h,o,a)=>{let l,c,f,u,d=l=(e<<7)-g.Fm,y=c=(n<<7)-g.Bm,A=f=d+128,m=u=y+128,p=this.dp[i][e][n]-g.Nm,I=this.dp[i][e+1][n]-g.Nm,_=this.dp[i][e+1][n+1]-g.Nm,C=this.dp[i][e][n+1]-g.Nm,E=y*o+d*a>>16;if(y=y*a-d*o>>16,d=E,E=p*h-y*r>>16,y=p*r+y*h>>16,p=E,y<50)return;if(E=c*o+A*a>>16,c=c*a-A*o>>16,A=E,E=I*h-c*r>>16,c=I*r+c*h>>16,I=E,c<50)return;if(E=m*o+f*a>>16,m=m*a-f*o>>16,f=E,E=_*h-m*r>>16,m=_*r+m*h>>16,_=E,m<50)return;if(E=u*o+l*a>>16,u=u*a-l*o>>16,l=E,E=C*h-u*r>>16,u=C*r+u*h>>16,C=E,u<50)return;const v=s.A.rl+((d<<9)/y|0),b=s.A.hl+((p<<9)/y|0),T=s.A.rl+((A<<9)/c|0),R=s.A.hl+((I<<9)/c|0),O=s.A.rl+((f<<9)/m|0),L=s.A.hl+((_<<9)/m|0),S=s.A.rl+((l<<9)/u|0),x=s.A.hl+((C<<9)/u|0);if(s.A.alpha=0,(O-S)*(R-x)-(L-x)*(T-S)>0)if(s.A.iI=O<0||S<0||T<0||O>w.A.eI||S>w.A.eI||T>w.A.eI,g.Xm&&this.sI(g.Ma,g.Da,L,x,R,O,S,T)&&(g.lp=e,g.cp=n),-1===t.nI)12345678!==t.rI&&s.A.hI(O,S,T,L,x,R,t.rI,t.oI,t.aI);else if(g.et){const i=g.op[t.nI];s.A.hI(O,S,T,L,x,R,this.lI(i,t.rI),this.lI(i,t.oI),this.lI(i,t.aI))}else t.flat?s.A.cI(O,S,T,L,x,R,t.rI,t.oI,t.aI,d,p,y,A,l,I,C,c,u,t.nI):s.A.cI(O,S,T,L,x,R,t.rI,t.oI,t.aI,f,_,m,l,A,C,I,u,c,t.nI);if(!((v-T)*(x-R)-(b-R)*(S-T)<=0))if(s.A.iI=v<0||T<0||S<0||v>w.A.eI||T>w.A.eI||S>w.A.eI,g.Xm&&this.sI(g.Ma,g.Da,b,R,x,v,T,S)&&(g.lp=e,g.cp=n),-1!==t.nI){if(!g.et)return void s.A.cI(v,T,S,b,R,x,t.fI,t.aI,t.oI,d,p,y,A,l,I,C,c,u,t.nI);const i=g.op[t.nI];s.A.hI(v,T,S,b,R,x,this.lI(i,t.fI),this.lI(i,t.aI),this.lI(i,t.oI))}else 12345678!==t.fI&&s.A.hI(v,T,S,b,R,x,t.fI,t.aI,t.oI)};Wg=(t,i,e,n,r,h,o)=>{let a=e.Od.length;for(let t=0;t>16;if(l=l*o-i*h>>16,i=c,c=a*r-l*n>>16,l=a*n+l*r>>16,a=c,l<50)return;e.uI&&(y.A.dI[t]=i,y.A.wI[t]=a,y.A.yI[t]=l),y.A.AI[t]=s.A.rl+((i<<9)/l|0),y.A.mI[t]=s.A.hl+((a<<9)/l|0)}s.A.alpha=0,a=e.pI.length;for(let n=0;n0)if(s.A.iI=a<0||l<0||c<0||a>w.A.eI||l>w.A.eI||c>w.A.eI,g.Xm&&this.sI(g.Ma,g.Da,f,u,d,a,l,c)&&(g.lp=t,g.cp=i),e.uI&&-1!==e.uI[n])if(g.et){const t=g.op[e.uI[n]];s.A.hI(a,l,c,f,u,d,this.lI(t,e._I[n]),this.lI(t,e.CI[n]),this.lI(t,e.EI[n]))}else e.flat?s.A.cI(a,l,c,f,u,d,e._I[n],e.CI[n],e.EI[n],y.A.dI[0],y.A.wI[0],y.A.yI[0],y.A.dI[1],y.A.dI[3],y.A.wI[1],y.A.wI[3],y.A.yI[1],y.A.yI[3],e.uI[n]):s.A.cI(a,l,c,f,u,d,e._I[n],e.CI[n],e.EI[n],y.A.dI[r],y.A.wI[r],y.A.yI[r],y.A.dI[h],y.A.dI[o],y.A.wI[h],y.A.wI[o],y.A.yI[h],y.A.yI[o],e.uI[n]);else 12345678!==e._I[n]&&s.A.hI(a,l,c,f,u,d,e._I[n],e.CI[n],e.EI[n])}};Pg=(t,i,e)=>{const s=this.yp[t][i][e];if(s===-g.vm)return!1;if(s===g.vm)return!0;{const s=i<<7,n=e<<7;return this.vI(s+1,this.dp[t][i][e],n+1)&&this.vI(s+128-1,this.dp[t][i+1][e],n+1)&&this.vI(s+128-1,this.dp[t][i+1][e+1],n+128-1)&&this.vI(s+1,this.dp[t][i][e+1],n+128-1)?(this.yp[t][i][e]=g.vm,!0):(this.yp[t][i][e]=-g.vm,!1)}};zg=(t,i,e,s)=>{if(!this.Pg(t,i,e))return!1;const n=i<<7,r=e<<7,h=this.dp[t][i][e]-1,o=h-120,a=h-230,l=h-238;if(s<16){if(1===s){if(n>g.Fm){if(!this.vI(n,h,r))return!1;if(!this.vI(n,h,r+128))return!1}if(t>0){if(!this.vI(n,o,r))return!1;if(!this.vI(n,o,r+128))return!1}return!!this.vI(n,a,r)&&this.vI(n,a,r+128)}if(2===s){if(r0){if(!this.vI(n,o,r+128))return!1;if(!this.vI(n+128,o,r+128))return!1}return!!this.vI(n,a,r+128)&&this.vI(n+128,a,r+128)}if(4===s){if(n0){if(!this.vI(n+128,o,r))return!1;if(!this.vI(n+128,o,r+128))return!1}return!!this.vI(n+128,a,r)&&this.vI(n+128,a,r+128)}if(8===s){if(r>g.Bm){if(!this.vI(n,h,r))return!1;if(!this.vI(n+128,h,r))return!1}if(t>0){if(!this.vI(n,o,r))return!1;if(!this.vI(n+128,o,r))return!1}return!!this.vI(n,a,r)&&this.vI(n+128,a,r)}}return!!this.vI(n+64,l,r+64)&&(16===s?this.vI(n,a,r+128):32===s?this.vI(n+128,a,r+128):64===s?this.vI(n+128,a,r):128===s?this.vI(n,a,r):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,i,e,s)=>{if(this.Pg(t,i,e)){const n=i<<7,r=e<<7;return this.vI(n+1,this.dp[t][i][e]-s,r+1)&&this.vI(n+128-1,this.dp[t][i+1][e]-s,r+1)&&this.vI(n+128-1,this.dp[t][i+1][e+1]-s,r+128-1)&&this.vI(n+1,this.dp[t][i][e+1]-s,r+128-1)}return!1};tI=(t,i,e,s,n,r)=>{let h,o;if(i!==e||s!==n){for(h=i;h<=e;h++)for(o=s;o<=n;o++)if(this.yp[t][h][o]===-g.vm)return!1;o=1+(i<<7);const a=2+(s<<7),l=this.dp[t][i][s]-r;if(!this.vI(o,l,a))return!1;const c=(e<<7)-1;if(!this.vI(c,l,a))return!1;const f=(n<<7)-1;return!!this.vI(o,l,f)&&this.vI(c,l,f)}return!!this.Pg(t,i,s)&&(h=i<<7,o=s<<7,this.vI(h+1,this.dp[t][i][s]-r,o+1)&&this.vI(h+128-1,this.dp[t][i+1][s]-r,o+1)&&this.vI(h+128-1,this.dp[t][i+1][s+1]-r,o+128-1)&&this.vI(h+1,this.dp[t][i][s+1]-r,o+128-1))};vI=(t,i,e)=>{for(let s=0;s0){const t=n.dg+(n.xg*s>>8),r=n.wg+(n.kg*s>>8),h=n.cg+(n.Mg*s>>8),o=n.Ud+(n.Dg*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(2===n.mode){const s=t-n.fg;if(s>0){const t=n.dg+(n.xg*s>>8),r=n.wg+(n.kg*s>>8),h=n.cg+(n.Mg*s>>8),o=n.Ud+(n.Dg*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(3===n.mode){const s=n.dg-e;if(s>0){const e=n.fg+(n.Fg*s>>8),r=n.ug+(n.Ng*s>>8),h=n.cg+(n.Mg*s>>8),o=n.Ud+(n.Dg*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(4===n.mode){const s=e-n.dg;if(s>0){const e=n.fg+(n.Fg*s>>8),r=n.ug+(n.Ng*s>>8),h=n.cg+(n.Mg*s>>8),o=n.Ud+(n.Dg*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(5===n.mode){const s=i-n.cg;if(s>0){const i=n.fg+(n.Fg*s>>8),r=n.ug+(n.Ng*s>>8),h=n.dg+(n.xg*s>>8),o=n.wg+(n.kg*s>>8);if(t>=i&&t<=r&&e>=h&&e<=o)return!0}}}return!1};sI=(t,i,e,s,n,r,h,o)=>{if(ie&&i>s&&i>n)return!1;if(tr&&t>h&&t>o)return!1;const a=(i-s)*(o-h)-(t-h)*(n-s);return((i-e)*(h-r)-(t-r)*(s-e))*a>0&&a*((i-n)*(r-o)-(t-o)*(e-n))>0};lI=(t,i)=>((i=(127-i)*(127&t)/160|0)<2?i=2:i>126&&(i=126),(65408&t)+i)}},7121:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{}},4197:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{bI;TI;RI;OI;index;Vw;ua;fa;constructor(t,i,e,s,n,r,h){super(),this.bI=i,this.TI=e,this.RI=s,this.OI=n,this.index=t,this.Vw=r,h&&-1!==r.wa&&this.Vw.delay?(this.ua=Math.random()*this.Vw.da|0,this.fa=Math.random()*this.Vw.delay[this.ua]|0):(this.ua=-1,this.fa=0)}}},9418:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(7121),n=e(1312),r=e(3867);class h extends s.A{x=0;z=0;Hg=0;LI=!1;size=1;Sl=-1;SI=-1;xI=-1;kI=-1;MI=-1;DI=-1;FI=-1;NI=null;BI=100;UI=0;GI=0;WI=0;YI=0;HI=-1e3;VI=0;KI=0;XI=-1;jI=0;zI=0;ZI=-1;qI=0;$I=0;JI=-1;QI=0;t_=0;i_=0;e_=0;s_=-1;n_=0;r_=0;h_=0;o_=0;a_=0;l_=0;c_=0;f_=0;u_=0;d_=0;w_=0;vm=0;height=0;y_=0;pathLength=0;A_=new Int32Array(10);m_=new Int32Array(10);p_=new r.fe(10,!1);g_=0;I_=-1;__=-1;C_=-1;E_=-1;move(t,i,e){if(-1!==this.JI&&n.A.Lo[this.JI].priority<=1&&(this.JI=-1),!t){const t=i-this.A_[0],s=e-this.m_[0];if(t>=-8&&t<=8&&s>=-8&&s<=8){this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.A_[t]=this.A_[t-1],this.m_[t]=this.m_[t-1],this.p_[t]=this.p_[t-1];return this.A_[0]=i,this.m_[0]=e,void(this.p_[0]=!1)}}this.pathLength=0,this.g_=0,this.A_[0]=i,this.m_[0]=e,this.x=128*this.A_[0]+64*this.size,this.z=128*this.m_[0]+64*this.size}step(t,i){let e=this.A_[0],s=this.m_[0];0===i?(e--,s++):1===i?s++:2===i?(e++,s++):3===i?e--:4===i?e++:5===i?(e--,s--):6===i?s--:7===i&&(e++,s--),-1!==this.JI&&n.A.Lo[this.JI].priority<=1&&(this.JI=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.A_[t]=this.A_[t-1],this.m_[t]=this.m_[t-1],this.p_[t]=this.p_[t-1];this.A_[0]=e,this.m_[0]=s,this.p_[0]=t}}},8268:(t,i,e)=>{e.d(i,{A:()=>d});var s=e(9418),n=e(8665),r=e(2679),h=e(8738),o=e(1312),a=e(8317),l=e(1302),c=e(3819),f=e(3867),u=e(9298);class d extends s.A{static v_=1;static b_=2;static T_=4;static R_=8;static O_=16;static L_=32;static S_=64;static x_=128;static k_=256;static M_=512;static Ll=[u.A.D_,u.A.F_,u.A.N_,u.A.B_,u.A.U_,u.A.P_,u.A.G_,u.A.W_,u.A.Y_,u.A.H_,u.A.V_,u.A.K_,u.A.X_,u.A.j_,u.A.z_,u.A.Z_];static Ol=[[u.A.q_,u.A.J_,u.A.Q_,u.A.tC,u.A.iC,u.A.eC,u.A.sC,u.A.nC,u.A.rC,u.A.hC,u.A.oC,u.A.aC],[u.A.lC,u.A.cC,u.A.fC,u.A.uC,u.A.dC,u.A.wC,u.A.yC,u.A.AC,u.A.mC,u.A.pC,u.A.gC,u.A.IC,u.A._C,u.A.CC,u.A.EC,u.A.vC],[u.A.vC-1,u.A.lC+1,u.A.cC,u.A.fC,u.A.uC,u.A.dC,u.A.wC,u.A.yC,u.A.AC,u.A.mC,u.A.pC,u.A.gC,u.A.IC,u.A._C,u.A.CC,u.A.EC],[u.A.bC,u.A.TC,u.A.RC,u.A.OC,u.A.LC,u.A.SC],[u.A.xC,u.A.kC,u.A.MC,u.A.DC,u.A.FC,u.A.NC,u.A.BC,u.A.UC]];static So=new r.A(200);name=null;visible=!1;PC=0;GC=0;WC=new Uint16Array(12);YC=new Uint16Array(5);Kl=0;HC=0n;y=0;VC=0;KC=0;XC=0;jC=0;zC=0;ZC=null;Lg=0;Sg=0;FA=0;NA=0;et=!1;draw(t){if(!this.visible)return null;let i=this.zd();if(this.height=i.Ud,i.Jd=!0,this.et)return i;if(-1!==this.s_&&-1!==this.n_){const t=h.A.Lo[this.s_],e=n.A.vu(t.al(),!0,!t.ad,!1);e.translate(-this.o_,0,0),e.xl(),t.Vw&&t.Vw.frames&&e.kl(t.Vw.frames[this.n_]),e.Dd=null,e.Fd=null,128===t.Xd&&128===t.jd||e.scale(t.Xd,t.jd,t.Xd),e.Ml(t.fd+64,t.ud+850,-30,-50,-30,!0);const s=[i,e];i=n.A.qC(s,2)}if(this.ZC&&(t>=this.KC&&(this.ZC=null),t>=this.VC&&t=d.Ol[i].length)&&(e=0),this.YC[i]=e}this.Sl=t.ou,65535===this.Sl&&(this.Sl=-1),this.SI=t.ou,65535===this.SI&&(this.SI=-1),this.xI=t.ou,65535===this.xI&&(this.xI=-1),this.kI=t.ou,65535===this.kI&&(this.kI=-1),this.MI=t.ou,65535===this.MI&&(this.MI=-1),this.DI=t.ou,65535===this.DI&&(this.DI=-1),this.FI=t.ou,65535===this.FI&&(this.FI=-1),this.name=c.A.Cl(c.A.El(t.$C)),this.Kl=t.lu,this.visible=!0,this.HC=0n;for(let t=0;t<12;t++)this.HC<<=0x4n,this.WC[t]>=256&&(this.HC+=BigInt(this.WC[t])-256n);this.WC[0]>=256&&(this.HC+=BigInt(this.WC[0])-256n>>4n),this.WC[1]>=256&&(this.HC+=BigInt(this.WC[1])-256n>>8n);for(let t=0;t<5;t++)this.HC<<=0x3n,this.HC+=BigInt(this.YC[t]);this.HC<<=0x1n,this.HC+=BigInt(this.PC)}Xu(){if(!this.visible)return null;const t=new f.fe(12,null);let i=0;for(let e=0;e<12;e++){const s=this.WC[e];if(s>=256&&s<512&&(t[i++]=a.A.Lo[s-256].Xu()),s>=512){const e=l.A.get(s-512).Xu(this.PC);e&&(t[i++]=e)}}const e=n.A.Tl(t,i);for(let t=0;t<5;t++)0!==this.YC[t]&&(e.Rl(d.Ol[t][0],d.Ol[t][this.YC[t]]),1===t&&e.Rl(d.Ll[0],d.Ll[this.YC[t]]));return e}zd(){let t=this.HC,i=-1,e=-1,s=-1,r=-1;if(this.JI>=0&&0===this.i_){const n=o.A.Lo[this.JI];if(n.frames&&(i=n.frames[this.QI]),this.ZI>=0&&this.ZI!==this.Sl){const t=o.A.Lo[this.ZI].frames;t&&(e=t[this.qI])}n.Ww>=0&&(s=n.Ww,t+=BigInt(s-this.WC[5])<<8n),n.Yw>=0&&(r=n.Yw,t+=BigInt(r-this.WC[3])<<16n)}else if(this.ZI>=0){const t=o.A.Lo[this.ZI].frames;t&&(i=t[this.qI])}let h=d.So?.get(t);if(!h){const i=new f.fe(12,null);let e=0;for(let t=0;t<12;t++){let n=this.WC[t];if(r>=0&&3===t&&(n=r),s>=0&&5===t&&(n=s),n>=256&&n<512){const t=a.A.Lo[n-256].al();t&&(i[e++]=t)}if(n>=512){const t=l.A.get(n-512).Uw(this.PC);t&&(i[e++]=t)}}h=n.A.Tl(i,e);for(let t=0;t<5;t++)0!==this.YC[t]&&(h.Rl(d.Ol[t][0],d.Ol[t][this.YC[t]]),1===t&&h.Rl(d.Ll[0],d.Ll[this.YC[t]]));h.xl(),h.Ml(64,850,-30,-50,-30,!0),d.So?.put(t,h)}if(this.et)return h;const c=n.A.Zd(h,!0);return-1!==i&&-1!==e?c.qd(i,e,o.A.Lo[this.JI].Pw):-1!==i&&c.kl(i),c.$d(),c.Dd=null,c.Fd=null,c}}},9222:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;model;Xp;info;constructor(t,i,e,s,n,r){this.y=t,this.x=i,this.z=e,this.model=s,this.Xp=n,this.info=r}}},1161:(t,i,e)=>{e.d(i,{A:()=>s});class s{level;y;x;z;model;Yg;Hg;jp;hg;zp;og;Xp;info;Qg=0;vm=0;constructor(t,i,e,s,n,r,h,o,a,l,c,f,u){this.level=t,this.y=i,this.x=e,this.z=s,this.model=n,this.Yg=r,this.Hg=h,this.jp=o,this.hg=a,this.zp=l,this.og=c,this.Xp=f,this.info=u}}},5748:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;Jg;$g;qg;Xp;offset;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.Jg=s,this.$g=n,this.qg=r,this.Xp=h,this.offset=o}}},8256:(t,i,e)=>{e.d(i,{A:()=>s});class s{Lg;FA;Sg;NA;type;fg;ug;dg;wg;cg;Ud;mode=0;Fg=0;Ng=0;xg=0;kg=0;Mg=0;Dg=0;constructor(t,i,e,s,n,r,h,o,a,l,c){this.Lg=t,this.FA=i,this.Sg=e,this.NA=s,this.type=n,this.fg=r,this.ug=h,this.dg=o,this.wg=a,this.cg=l,this.Ud=c}}},3795:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1982),n=e(3867);class r extends s.A{level;x;z;Ug;xp;Rg;vp=null;Tp=null;Dp=null;Fp=null;Rp=null;kp=null;Cp=null;Sp=0;Og=0;Ep=0;visible=!1;update=!1;vg=!1;bg=0;Xg=0;jg=0;Vg=0;constructor(t,i,e){super(),this.Ug=this.level=t,this.x=i,this.z=e,this.xp=new n.fe(5,null),this.Rg=new Int32Array(5)}}},2771:(t,i,e)=>{e.d(i,{A:()=>s});class s{static AI=new Int32Array(6);static mI=new Int32Array(6);static dI=new Int32Array(6);static wI=new Int32Array(6);static yI=new Int32Array(6);static JC=[Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,2,6),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,13,14)];static QC=[Int8Array.of(0,1,2,3,0,0,1,3),Int8Array.of(1,1,2,3,1,0,1,3),Int8Array.of(0,1,2,3,1,0,1,3),Int8Array.of(0,0,1,2,0,0,2,4,1,0,4,3),Int8Array.of(0,0,1,4,0,0,4,3,1,1,2,4),Int8Array.of(0,0,4,3,1,0,1,2,1,0,2,4),Int8Array.of(0,1,2,4,1,0,1,4,1,0,4,3),Int8Array.of(0,4,1,2,0,4,2,5,1,0,4,5,1,0,5,3),Int8Array.of(0,4,1,2,0,4,2,3,0,4,3,5,1,0,4,5),Int8Array.of(0,0,4,5,1,4,1,2,1,4,2,3,1,4,3,5),Int8Array.of(0,0,1,5,0,1,4,5,0,1,2,4,1,0,5,3,1,5,4,3,1,4,2,3),Int8Array.of(1,0,1,5,1,1,4,5,1,1,2,4,0,0,5,3,0,5,4,3,0,4,2,3),Int8Array.of(1,0,5,4,1,0,1,5,0,0,4,3,0,4,5,3,0,5,2,3,0,1,2,5)];static tE=128;static iE=this.tE/2|0;static eE=this.tE/4|0;static sE=3*this.tE/4|0;Od;Sd;Ld;_I;CI;EI;pI;gI;II;uI;flat;shape;angle;_g;Cg;constructor(t,i,e,n,r,h,o,a,l,c,f,u,d,w,y,A,m,p,g){this.flat=!(m!==n||m!==w||m!==a),this.shape=i,this.angle=h,this._g=d,this.Cg=l;const I=s.JC[i],_=I.length;this.Od=new Int32Array(_),this.Sd=new Int32Array(_),this.Ld=new Int32Array(_);const C=new Int32Array(_),E=new Int32Array(_),v=t*s.tE,b=p*s.tE;for(let t=0;t<_;t++){let i,l,f,d,p,_=I[t];!(1&_)&&_<=8&&(_=1+(_-h-h-1&7)),_>8&&_<=12&&(_=9+(_-h-9&3)),_>12&&_<=16&&(_=13+(_-h-13&3)),1===_?(i=v,l=b,f=m,d=o,p=c):2===_?(i=v+s.iE,l=b,f=m+n>>1,d=o+g>>1,p=c+e>>1):3===_?(i=v+s.tE,l=b,f=n,d=g,p=e):4===_?(i=v+s.tE,l=b+s.iE,f=n+w>>1,d=g+r>>1,p=e+y>>1):5===_?(i=v+s.tE,l=b+s.tE,f=w,d=r,p=y):6===_?(i=v+s.iE,l=b+s.tE,f=w+a>>1,d=r+A>>1,p=y+u>>1):7===_?(i=v,l=b+s.tE,f=a,d=A,p=u):8===_?(i=v,l=b+s.iE,f=a+m>>1,d=A+o>>1,p=u+c>>1):9===_?(i=v+s.iE,l=b+s.eE,f=m+n>>1,d=o+g>>1,p=c+e>>1):10===_?(i=v+s.sE,l=b+s.iE,f=n+w>>1,d=g+r>>1,p=e+y>>1):11===_?(i=v+s.iE,l=b+s.sE,f=w+a>>1,d=r+A>>1,p=y+u>>1):12===_?(i=v+s.eE,l=b+s.iE,f=a+m>>1,d=A+o>>1,p=u+c>>1):13===_?(i=v+s.eE,l=b+s.eE,f=m,d=o,p=c):14===_?(i=v+s.sE,l=b+s.eE,f=n,d=g,p=e):15===_?(i=v+s.sE,l=b+s.sE,f=w,d=r,p=y):(i=v+s.eE,l=b+s.sE,f=a,d=A,p=u),this.Od[t]=i,this.Sd[t]=f,this.Ld[t]=l,C[t]=d,E[t]=p}const T=s.QC[i],R=T.length/4|0;this.pI=new Int32Array(R),this.gI=new Int32Array(R),this.II=new Int32Array(R),this._I=new Int32Array(R),this.CI=new Int32Array(R),this.EI=new Int32Array(R),this.uI=-1!==f?new Int32Array(R):null;let O=0;for(let t=0;t{e.d(i,{A:()=>s});class s{static QA=0;static bp=1;static nE=2;static rE=3;static hE=4;static oE=5;static iE=6;static eE=7;static sE=8;static aE=9;static lE=10;static cE=11}},3479:(t,i,e)=>{e.d(i,{A:()=>s});class s{fI;aI;rI;oI;nI;color;flat;constructor(t,i,e,s,n,r,h){this.fI=t,this.aI=i,this.rI=e,this.oI=s,this.nI=n,this.color=r,this.flat=h}}},6855:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;Kg;Zg;Gp;Yp;Xp;info;constructor(t,i,e,s,n,r,h,o,a){this.y=t,this.x=i,this.z=e,this.Kg=s,this.Zg=n,this.Gp=r,this.Yp=h,this.Xp=o,this.info=a}}},7441:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;type;angle;model;Xp;info;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.type=s,this.angle=n,this.model=r,this.Xp=h,this.info=o}}},7536:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n{fE;uE;constructor(t){this.uE=[],this.fE=t;for(let i=0;i{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{wE;yE;constructor(){super(),this.wE=this,this.yE=this}AE(){this.yE&&this.wE&&(this.yE.wE=this.wE,this.wE.yE=this.yE,this.wE=null,this.yE=null)}}},3819:(t,i,e)=>{e.d(i,{A:()=>s});class s{static mE=['_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9'];static pE=t=>{t=t.trim();let i=0n;for(let e=0;e=65&&s<=90?i+=BigInt(s+1-65):s>=97&&s<=122?i+=BigInt(s+1-97):s>=48&&s<=57&&(i+=BigInt(s+27-48))}return i};static El=t=>{if(t<0n||t>=6582952005840035281n)return'invalid_name';if(t%37n===0n)return'invalid_name';let i=0;const e=Array(12);for(;0n!==t;){const s=t;t/=37n,e[11-i++]=this.mE[Number(s-37n*t)]}return e.slice(12-i).join('')};static gE=t=>{const i=[...t.toLowerCase()];let e=!0;for(let t=0;t='a'&&s<='z'&&(i[t]=s.toUpperCase(),e=!1),'.'!==s&&'!'!==s||(e=!0)}return i.join('')};static IE=t=>{let i='';for(let e=0;e(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static Cl=t=>{if(0===t.length)return t;const i=[...t];for(let t=0;t='a'&&i[t+1]<='z'&&(i[t+1]=String.fromCharCode(i[t+1].charCodeAt(0)+'A'.charCodeAt(0)-97)));return i[0]>='a'&&i[0]<='z'&&(i[0]=String.fromCharCode(i[0].charCodeAt(0)+'A'.charCodeAt(0)-97)),i.join('')};static _u=t=>{const i=t.toUpperCase();let e=0n;for(let t=0;t>56n)&0xffffffffffffffn;return e}}},6666:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n{_E;cursor=null;constructor(){const t=new s.A;t.next=t,t.dE=t,this._E=t}kA(t){t.dE&&t.rw(),t.dE=this._E.dE,t.next=this._E,t.dE&&(t.dE.next=t),t.next.dE=t}CE(t){t.dE&&t.rw(),t.dE=this._E,t.next=this._E.next,t.dE.next=t,t.next&&(t.next.dE=t)}Bg(){const t=this._E.next;return t===this._E?null:(t?.rw(),t)}head(){const t=this._E.next;return t===this._E?(this.cursor=null,null):(this.cursor=t?.next||null,t)}EE(){const t=this._E.dE;return t===this._E?(this.cursor=null,null):(this.cursor=t?.dE||null,t)}next(){const t=this.cursor;return t===this._E?(this.cursor=null,null):(this.cursor=t?.next||null,t)}dE(){const t=this.cursor;return t===this._E?(this.cursor=null,null):(this.cursor=t?.dE||null,t)}clear(){for(;;){const t=this._E.next;if(t===this._E)return;t?.rw()}}}},1982:(t,i,e)=>{e.d(i,{A:()=>s});class s{key;next;dE;constructor(){this.key=0n,this.next=this,this.dE=this}rw(){this.dE&&this.next&&(this.dE.next=this.next,this.next.dE=this.dE,this.next=null,this.dE=null)}}},2679:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(2512),n=e(7536);class r{vE;bE;history;available;constructor(t){this.vE=t,this.available=t,this.bE=new n.A(1024),this.history=new s.A}get(t){const i=this.bE.get(t);return i&&this.history.push(i),i}put(t,i){if(0===this.available){const t=this.history.pop();t?.rw(),t?.AE()}else this.available--;this.bE.put(t,i),this.history.push(i)}clear(){const t=this.history.pop();t?(t.rw(),t.AE()):this.available=this.vE}}},2512:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n{head;constructor(){this.head=new s.A}push(t){t.yE&&t.AE(),t.yE=this.head.yE,t.wE=this.head,t.yE&&(t.yE.wE=t),t.wE.yE=t}pop(){const t=this.head.wE;return t===this.head?null:(t?.AE(),t)}}},8534:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(3867);class r{static Lo=[];static hu=t=>{const i=new s.A(t.read('base_head.dat')),e=new s.A(t.read('base_type.dat')),h=new s.A(t.read('base_label.dat')),o=i.ou;i.lf+=2;for(let t=0;t{e.d(i,{A:()=>r});var s=e(8534),n=e(1069);class r{static Lo=[];static hu=t=>{const i=new n.A(t.read('frame_head.dat')),e=new n.A(t.read('frame_tran1.dat')),h=new n.A(t.read('frame_tran2.dat')),o=new n.A(t.read('frame_del.dat')),a=i.ou;i.lf+=2;const l=new Int32Array(500),c=new Int32Array(500),f=new Int32Array(500),u=new Int32Array(500);for(let t=0;t0){if(0!==d.types[t])for(let i=t-1;i>y;i--)if(0===d.types[i]){l[A]=i,c[A]=0,f[A]=0,u[A]=0,A++;break}l[A]=t;let e=0;3===d.types[l[A]]&&(e=128),c[A]=1&i?h.RE:e,f[A]=2&i?h.RE:e,u[A]=4&i?h.RE:e,y=t,A++}}n.length=A,n.OE=new Int32Array(A),n.x=new Int32Array(A),n.y=new Int32Array(A),n.z=new Int32Array(A);for(let t=0;t{e.d(i,{bc:()=>s,zo:()=>n,LE:()=>o,SE:()=>h,xE:()=>r});const s=document.getElementById('canvas'),n=s.getContext('2d',{willReadFrequently:!0}),r=document.createElement('canvas'),h=document.createElement('img'),o=r.getContext('2d',{willReadFrequently:!0})},9298:(t,i,e)=>{e.d(i,{A:()=>s});class s{static RED=16711680;static GREEN=65280;static BLUE=255;static Ga=16776960;static kE=65535;static sm=16711935;static Ia=16777215;static Pa=0;static ME=16748608;static DE=8388608;static FE=128;static NE=16756736;static BE=16740352;static UE=16723968;static PE=12648192;static GE=8453888;static WE=4259584;static YE=9179409;static HE=6116423;static ia=2301979;static ea=5063219;static na=7759444;static ha=3353893;static VE=8388736;static KE=13350793;static XE=Int32Array.of(s.Ga,s.RED,s.GREEN,s.kE,s.sm,s.Ia);static q_=6798;static J_=107;static Q_=10283;static tC=16;static iC=4797;static eC=7744;static sC=5799;static nC=4634;static rC=33697;static hC=22433;static oC=2983;static aC=54193;static lC=8741;static cC=12;static fC=64030;static uC=43162;static dC=7735;static wC=8404;static yC=1701;static AC=38430;static mC=24094;static pC=10153;static gC=56621;static IC=4783;static _C=1341;static CC=16578;static EC=35003;static vC=25239;static D_=9104;static F_=10275;static N_=7595;static B_=3610;static U_=7975;static P_=8526;static G_=918;static W_=38802;static Y_=24466;static H_=10145;static V_=58654;static K_=5027;static X_=1457;static j_=16565;static z_=34991;static Z_=25486;static bC=4626;static TC=11146;static RC=6439;static OC=12;static LC=4758;static SC=10270;static UC=4574;static xC=4550;static kC=4537;static MC=5681;static DC=5673;static FC=5790;static NC=6806;static BC=8076}},8950:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n extends s.A{static lw=new Int32Array;static cw=0;static fw=0;static top=0;static bottom=0;static left=0;static right=0;static eI=0;static jE=0;static zE=0;static bind=(t,i,e)=>{this.lw=t,this.cw=i,this.fw=e,this.Aa(0,0,i,e)};static ZE=()=>{this.left=0,this.top=0,this.right=this.cw,this.bottom=this.fw,this.eI=this.right-1,this.jE=this.right/2|0};static Aa=(t,i,e,s)=>{t<0&&(t=0),i<0&&(i=0),e>this.cw&&(e=this.cw),s>this.fw&&(s=this.fw),this.top=i,this.bottom=s,this.left=t,this.right=e,this.eI=this.right-1,this.jE=this.right/2|0,this.zE=this.bottom/2|0};static clear=()=>{const t=this.cw*this.fw;for(let i=0;i{this.ra(t,i,n,e),this.ra(t,i+s-1,n,e),this.sa(t,i,n,s),this.sa(t+e-1,i,n,s)};static ra=(t,i,e,s)=>{if(i=this.bottom)return;tthis.right&&(s=this.right-t);const n=t+i*this.cw;for(let t=0;t{if(t=this.right)return;ithis.bottom&&(s=this.bottom-i);const n=t+i*this.cw;for(let t=0;t{const r=Math.abs(e-t),h=Math.abs(s-i),o=t=this.left&&t=this.top&&i-h&&(l-=h,t+=o),e{tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const r=this.cw-e;let h=t+i*this.cw;for(let t=-s;t<0;t++){for(let t=-e;t<0;t++)this.lw[h++]=n;h+=r}};static $E(t,i,e,s,n,r){tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const h=256-r,o=(n>>16&255)*r,a=(n>>8&255)*r,l=(255&n)*r,c=this.cw-e;let f=t+i*this.cw;for(let t=0;t>16&255)*h>>8<<16)+(a+(this.lw[f]>>8&255)*h>>8<<8)+(l+(255&this.lw[f])*h>>8);this.lw[f++]=t}f+=c}}static JE(t,i,e,s,n){const r=256-n,h=(s>>16&255)*n,o=(s>>8&255)*n,a=(255&s)*n;let l=i-e;l<0&&(l=0);let c=i+e;c>=this.fw&&(c=this.fw-1);for(let s=l;s<=c;s++){const n=s-i,l=0|Math.sqrt(e*e-n*n);let c=t-l;c<0&&(c=0);let f=t+l;f>=this.cw&&(f=this.cw-1);let u=c+s*this.cw;for(let t=c;t<=f;t++){const t=(h+(this.lw[u]>>16&255)*r>>8<<16)+(o+(this.lw[u]>>8&255)*r>>8<<8)+(a+(255&this.lw[u])*r>>8);this.lw[u++]=t}}}static QE=(t,i,e)=>{t=this.right||i=this.bottom||(this.lw[t+i*this.cw]=e)}}},4583:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(8950),n=e(1673),r=e(3867);class h extends s.A{static et=!1;static tv=new Int32Array(512);static iv=new Int32Array(2048);static sin=new Int32Array(2048);static cos=new Int32Array(2048);static palette=new Int32Array(65536);static ev=new r.fe(50,null);static sv=0;static aw=new Int32Array;static rl=0;static hl=0;static uw=!0;static iI=!1;static alpha=0;static nv=null;static rv=new r.fe(50,null);static hv=0;static vm=0;static ov=new Int32Array(50);static av=new r.fe(50,null);static lv=!1;static cv=new r.fe(50,!1);static fv=new Int32Array(50);static{for(let t=1;t<512;t++)this.tv[t]=32768/t|0;for(let t=1;t<2048;t++)this.iv[t]=65536/t|0;for(let t=0;t<2048;t++)this.sin[t]=65536*Math.sin(.0030679615757712823*t)|0,this.cos[t]=65536*Math.cos(.0030679615757712823*t)|0}static To=()=>{this.tv=null,this.tv=null,this.sin=null,this.cos=null,this.aw=null,this.ev=null,this.cv=null,this.fv=null,this.nv=null,this.rv=null,this.ov=null,this.palette=null,this.av=null,console.log('Draw3D unloaded!')};static Tc=()=>{this.aw=new Int32Array(this.fw);for(let t=0;t{this.aw=new Int32Array(i);for(let e=0;e{this.nv=null,this.rv.fill(null)};static wv=t=>{this.sv=0;for(let i=0;i<50;i++)try{this.ev[i]=n.A.Cu(t,i.toString()),this.et&&128===this.ev[i]?.Na?this.ev[i]?.yv():this.ev[i]?._w(),this.sv++}catch(t){}};static im=t=>{if(0!==this.fv[t])return this.fv[t];const i=this.av[t];if(!i)return 0;let e=0,s=0,n=0;const r=i.length;for(let t=0;t>16&255,s+=i[t]>>8&255,n+=255&i[t];let h=(e/r<<16)+(s/r<<8)+(n/r|0);return h=this.Av(h,1.4),0===h&&(h=1),this.fv[t]=h,h};static mv=t=>{const i=t+.03*Math.random()-.015;let e=0;for(let t=0;t<512;t++){const s=(t/8|0)/64+.0078125,n=(7&t)/8+.0625;for(let t=0;t<128;t++){const r=t/128;let h=r,o=r,a=r;if(0!==n){let t;t=r<.5?r*(n+1):r+n-r*n;const i=2*r-t;let e=s+.3333333333333333;e>1&&e--;let l=s-.3333333333333333;l<0&&l++,h=6*e<1?i+6*(t-i)*e:2*e<1?t:3*e<2?i+(t-i)*(.6666666666666666-e)*6:i,o=6*s<1?i+6*(t-i)*s:2*s<1?t:3*s<2?i+(t-i)*(.6666666666666666-s)*6:i,a=6*l<1?i+6*(t-i)*l:2*l<1?t:3*l<2?i+(t-i)*(.6666666666666666-l)*6:i}const l=((256*h|0)<<16)+((256*o|0)<<8)+(256*a|0);this.palette[e++]=this.Av(l,i)}}for(let t=0;t<50;t++){const e=this.ev[t];if(!e)continue;const s=e.palette;this.av[t]=new Int32Array(s.length);for(let e=0;e{const e=(t>>16)/256,s=(t>>8&255)/256,n=(255&t)/256;return((256*Math.pow(e,i)|0)<<16)+((256*Math.pow(s,i)|0)<<8)+(256*Math.pow(n,i)|0)};static gv=t=>{this.nv||(this.hv=t,this.et?this.nv=new r.Xr(t,16384):this.nv=new r.Xr(t,65536),this.rv.fill(null))};static hI=(t,i,e,s,n,r,h,o,a)=>{let l=0,c=0;n!==s&&(l=(i-t<<16)/(n-s)|0,c=(o-h<<15)/(n-s)|0);let f=0,u=0;r!==n&&(f=(e-i<<16)/(r-n)|0,u=(a-o<<15)/(r-n)|0);let d=0,w=0;if(r!==s&&(d=(t-e<<16)/(s-r)|0,w=(h-a<<15)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),nf)for(r-=n,n-=s,s=this.aw[s];;){if(--n<0)for(;;){if(--r<0)return;this.Iv(e>>16,i>>16,a>>7,o>>7,this.lw,s,0),e+=d,i+=f,a+=w,o+=u,s+=this.cw}this.Iv(e>>16,t>>16,a>>7,h>>7,this.lw,s,0),e+=d,t+=l,a+=w,h+=c,s+=this.cw}else for(r-=n,n-=s,s=this.aw[s];;){if(--n<0)for(;;){if(--r<0)return;this.Iv(i>>16,e>>16,o>>7,a>>7,this.lw,s,0),e+=d,i+=f,a+=w,o+=u,s+=this.cw}this.Iv(t>>16,e>>16,h>>7,a>>7,this.lw,s,0),e+=d,t+=l,a+=w,h+=c,s+=this.cw}else if(i=t<<=16,o=h<<=15,s<0&&(i-=d*s,t-=l*s,o-=w*s,h-=c*s,s=0),e<<=16,a<<=15,r<0&&(e-=f*r,a-=u*r,r=0),s!==r&&dl)for(n-=r,r-=s,s=this.aw[s];;){if(--r<0)for(;;){if(--n<0)return;this.Iv(e>>16,t>>16,a>>7,h>>7,this.lw,s,0),e+=f,t+=l,a+=u,h+=c,s+=this.cw}this.Iv(i>>16,t>>16,o>>7,h>>7,this.lw,s,0),i+=d,t+=l,o+=w,h+=c,s+=this.cw}else for(n-=r,r-=s,s=this.aw[s];;){if(--r<0)for(;;){if(--n<0)return;this.Iv(t>>16,e>>16,h>>7,a>>7,this.lw,s,0),e+=f,t+=l,a+=u,h+=c,s+=this.cw}this.Iv(t>>16,i>>16,h>>7,o>>7,this.lw,s,0),i+=d,t+=l,o+=w,h+=c,s+=this.cw}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),rd)for(s-=r,r-=n,n=this.aw[n];;){if(--r<0)for(;;){if(--s<0)return;this.Iv(t>>16,e>>16,h>>7,a>>7,this.lw,n,0),t+=l,e+=d,h+=c,a+=w,n+=this.cw}this.Iv(t>>16,i>>16,h>>7,o>>7,this.lw,n,0),t+=l,i+=f,h+=c,o+=u,n+=this.cw}else for(s-=r,r-=n,n=this.aw[n];;){if(--r<0)for(;;){if(--s<0)return;this.Iv(e>>16,t>>16,a>>7,h>>7,this.lw,n,0),t+=l,e+=d,h+=c,a+=w,n+=this.cw}this.Iv(i>>16,t>>16,o>>7,h>>7,this.lw,n,0),t+=l,i+=f,h+=c,o+=u,n+=this.cw}else if(e=i<<=16,a=o<<=15,n<0&&(e-=l*n,i-=f*n,a-=c*n,o-=u*n,n=0),t<<=16,h<<=15,s<0&&(t-=d*s,h-=w*s,s=0),r-=s,s-=n,n=this.aw[n],l>16,i>>16,h>>7,o>>7,this.lw,n,0),t+=d,i+=f,h+=w,o+=u,n+=this.cw}this.Iv(e>>16,i>>16,a>>7,o>>7,this.lw,n,0),e+=l,i+=f,a+=c,o+=u,n+=this.cw}else for(;;){if(--s<0)for(;;){if(--r<0)return;this.Iv(i>>16,t>>16,o>>7,h>>7,this.lw,n,0),t+=d,i+=f,h+=w,o+=u,n+=this.cw}this.Iv(i>>16,e>>16,o>>7,a>>7,this.lw,n,0),e+=l,i+=f,a+=c,o+=u,n+=this.cw}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,o>>7,h>>7,this.lw,r,0),i+=f,t+=l,o+=u,h+=c,r+=this.cw}this.Iv(i>>16,e>>16,o>>7,a>>7,this.lw,r,0),i+=f,e+=d,o+=u,a+=w,r+=this.cw}else for(;;){if(--s<0)for(;;){if(--n<0)return;this.Iv(t>>16,i>>16,h>>7,o>>7,this.lw,r,0),i+=f,t+=l,o+=u,h+=c,r+=this.cw}this.Iv(e>>16,i>>16,a>>7,o>>7,this.lw,r,0),i+=f,e+=d,o+=u,a+=w,r+=this.cw}else if(t=e<<=16,h=a<<=15,r<0&&(t-=f*r,e-=d*r,h-=u*r,a-=w*r,r=0),i<<=16,o<<=15,n<0&&(i-=l*n,o-=c*n,n=0),s-=n,n-=r,r=this.aw[r],f>16,e>>16,o>>7,a>>7,this.lw,r,0),i+=l,e+=d,o+=c,a+=w,r+=this.cw}this.Iv(t>>16,e>>16,h>>7,a>>7,this.lw,r,0),t+=f,e+=d,h+=u,a+=w,r+=this.cw}else for(;;){if(--n<0)for(;;){if(--s<0)return;this.Iv(e>>16,i>>16,a>>7,o>>7,this.lw,r,0),i+=l,e+=d,o+=c,a+=w,r+=this.cw}this.Iv(e>>16,t>>16,a>>7,h>>7,this.lw,r,0),t+=f,e+=d,h+=u,a+=w,r+=this.cw}};static Iv=(t,i,e,s,n,r,h)=>{let o;if(this.uw){let a;if(this.iI){if(a=i-t>3?(s-e)/(i-t)|0:0,i>this.eI&&(i=this.eI),t<0&&(e-=t*a,t=0),t>=i)return;r+=t,h=i-t>>2,a<<=2}else{if(!(t>2)>0?(s-e)*this.tv[h]>>15:0}if(0===this.alpha)for(;;){if(--h<0){if((h=i-t&3)>0){o=this.palette[e>>8];do{n[r++]=o,h--}while(h>0);return}break}o=this.palette[e>>8],e+=a,n[r++]=o,n[r++]=o,n[r++]=o,n[r++]=o}else{const s=this.alpha,l=256-this.alpha;for(;;){if(--h<0){if((h=i-t&3)>0){o=this.palette[e>>8],o=((16711935&o)*l>>8&16711935)+((65280&o)*l>>8&65280);do{n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),h--}while(h>0)}break}o=this.palette[e>>8],e+=a,o=((16711935&o)*l>>8&16711935)+((65280&o)*l>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280)}}}else if(tthis.eI&&(i=this.eI),t<0&&(e-=t*a,t=0),t>=i))return;if(r+=t,h=i-t,0===this.alpha)do{n[r++]=this.palette[e>>8],e+=a,h--}while(h>0);else{const t=this.alpha,i=256-this.alpha;do{o=this.palette[e>>8],e+=a,o=((16711935&o)*i>>8&16711935)+((65280&o)*i>>8&65280),n[r++]=o+((16711935&n[r])*t>>8&16711935)+((65280&n[r])*t>>8&65280),h--}while(h>0)}}};static _v=(t,i,e,s,n,r,h)=>{let o=0;n!==s&&(o=(i-t<<16)/(n-s)|0);let a=0;r!==n&&(a=(e-i<<16)/(r-n)|0);let l=0;if(r!==s&&(l=(t-e<<16)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),na)for(r-=n,n-=s,s=this.aw[s];;){if(--n<0)for(;;){if(--r<0)return;this.Cv(e>>16,i>>16,this.lw,s,h),e+=l,i+=a,s+=this.cw}this.Cv(e>>16,t>>16,this.lw,s,h),e+=l,t+=o,s+=this.cw}else for(r-=n,n-=s,s=this.aw[s];;){if(--n<0)for(;;){if(--r<0)return;this.Cv(i>>16,e>>16,this.lw,s,h),e+=l,i+=a,s+=this.cw}this.Cv(t>>16,e>>16,this.lw,s,h),e+=l,t+=o,s+=this.cw}else if(i=t<<=16,s<0&&(i-=l*s,t-=o*s,s=0),e<<=16,r<0&&(e-=a*r,r=0),s!==r&&lo)for(n-=r,r-=s,s=this.aw[s];;){if(--r<0)for(;;){if(--n<0)return;this.Cv(e>>16,t>>16,this.lw,s,h),e+=a,t+=o,s+=this.cw}this.Cv(i>>16,t>>16,this.lw,s,h),i+=l,t+=o,s+=this.cw}else for(n-=r,r-=s,s=this.aw[s];;){if(--r<0)for(;;){if(--n<0)return;this.Cv(t>>16,e>>16,this.lw,s,h),e+=a,t+=o,s+=this.cw}this.Cv(t>>16,i>>16,this.lw,s,h),i+=l,t+=o,s+=this.cw}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),rl)for(s-=r,r-=n,n=this.aw[n];;){if(--r<0)for(;;){if(--s<0)return;this.Cv(t>>16,e>>16,this.lw,n,h),t+=o,e+=l,n+=this.cw}this.Cv(t>>16,i>>16,this.lw,n,h),t+=o,i+=a,n+=this.cw}else for(s-=r,r-=n,n=this.aw[n];;){if(--r<0)for(;;){if(--s<0)return;this.Cv(e>>16,t>>16,this.lw,n,h),t+=o,e+=l,n+=this.cw}this.Cv(i>>16,t>>16,this.lw,n,h),t+=o,i+=a,n+=this.cw}else if(e=i<<=16,n<0&&(e-=o*n,i-=a*n,n=0),t<<=16,s<0&&(t-=l*s,s=0),o>16,i>>16,this.lw,n,h),t+=l,i+=a,n+=this.cw}this.Cv(e>>16,i>>16,this.lw,n,h),e+=o,i+=a,n+=this.cw}else for(r-=s,s-=n,n=this.aw[n];;){if(--s<0)for(;;){if(--r<0)return;this.Cv(i>>16,t>>16,this.lw,n,h),t+=l,i+=a,n+=this.cw}this.Cv(i>>16,e>>16,this.lw,n,h),e+=o,i+=a,n+=this.cw}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,this.lw,r,h),i+=a,t+=o,r+=this.cw}this.Cv(i>>16,e>>16,this.lw,r,h),i+=a,e+=l,r+=this.cw}else for(n-=s,s-=r,r=this.aw[r];;){if(--s<0)for(;;){if(--n<0)return;this.Cv(t>>16,i>>16,this.lw,r,h),i+=a,t+=o,r+=this.cw}this.Cv(e>>16,i>>16,this.lw,r,h),i+=a,e+=l,r+=this.cw}else if(t=e<<=16,r<0&&(t-=a*r,e-=l*r,r=0),i<<=16,n<0&&(i-=o*n,n=0),a>16,e>>16,this.lw,r,h),i+=o,e+=l,r+=this.cw}this.Cv(t>>16,e>>16,this.lw,r,h),t+=a,e+=l,r+=this.cw}else for(s-=n,n-=r,r=this.aw[r];;){if(--n<0)for(;;){if(--s<0)return;this.Cv(e>>16,i>>16,this.lw,r,h),i+=o,e+=l,r+=this.cw}this.Cv(e>>16,t>>16,this.lw,r,h),t+=a,e+=l,r+=this.cw}};static cI=(t,i,e,s,n,r,h,o,a,l,c,f,u,d,w,y,A,m,p)=>{const g=this.Ev(p);this.lv=!this.cv[p];const I=l-u,_=c-w,C=f-A,E=d-l,v=y-c,b=m-f;let T=E*c-v*l<<14;const R=v*f-b*c<<8,O=b*l-E*f<<5;let L=I*c-_*l<<14;const S=_*f-C*c<<8,x=C*l-I*f<<5;let k=_*E-I*v<<14;const M=C*v-_*b<<8,D=I*b-C*E<<5;let F=0,N=0;n!==s&&(F=(i-t<<16)/(n-s)|0,N=(o-h<<16)/(n-s)|0);let B=0,U=0;r!==n&&(B=(e-i<<16)/(r-n)|0,U=(a-o<<16)/(r-n)|0);let P=0,G=0;if(r!==s&&(P=(t-e<<16)/(s-r)|0,G=(h-a<<16)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),nB)for(r-=n,n-=s,s=this.aw[s];;){if(--n<0)for(;;){if(--r<0)return;this.vv(e>>16,i>>16,this.lw,s,g,0,0,T,L,k,R,S,M,a>>8,o>>8),e+=P,i+=B,a+=G,o+=U,s+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.vv(e>>16,t>>16,this.lw,s,g,0,0,T,L,k,R,S,M,a>>8,h>>8),e+=P,t+=F,a+=G,h+=N,s+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}else for(r-=n,n-=s,s=this.aw[s];;){if(--n<0)for(;;){if(--r<0)return;this.vv(i>>16,e>>16,this.lw,s,g,0,0,T,L,k,R,S,M,o>>8,a>>8),e+=P,i+=B,a+=G,o+=U,s+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.vv(t>>16,e>>16,this.lw,s,g,0,0,T,L,k,R,S,M,h>>8,a>>8),e+=P,t+=F,a+=G,h+=N,s+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}}else{i=t<<=16,o=h<<=16,s<0&&(i-=P*s,t-=F*s,o-=G*s,h-=N*s,s=0),e<<=16,a<<=16,r<0&&(e-=B*r,a-=U*r,r=0);const l=s-this.hl;if(T+=O*l,L+=x*l,k+=D*l,T|=0,L|=0,k|=0,(s===r||P>=F)&&(s!==r||B<=F))for(n-=r,r-=s,s=this.aw[s];;){if(--r<0)for(;;){if(--n<0)return;this.vv(t>>16,e>>16,this.lw,s,g,0,0,T,L,k,R,S,M,h>>8,a>>8),e+=B,t+=F,a+=U,h+=N,s+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.vv(t>>16,i>>16,this.lw,s,g,0,0,T,L,k,R,S,M,h>>8,o>>8),i+=P,t+=F,o+=G,h+=N,s+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}else for(n-=r,r-=s,s=this.aw[s];;){if(--r<0)for(;;){if(--n<0)return;this.vv(e>>16,t>>16,this.lw,s,g,0,0,T,L,k,R,S,M,a>>8,h>>8),e+=B,t+=F,a+=U,h+=N,s+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.vv(i>>16,t>>16,this.lw,s,g,0,0,T,L,k,R,S,M,o>>8,h>>8),i+=P,t+=F,o+=G,h+=N,s+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),rP)for(s-=r,r-=n,n=this.aw[n];;){if(--r<0)for(;;){if(--s<0)return;this.vv(t>>16,e>>16,this.lw,n,g,0,0,T,L,k,R,S,M,h>>8,a>>8),t+=F,e+=P,h+=N,a+=G,n+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.vv(t>>16,i>>16,this.lw,n,g,0,0,T,L,k,R,S,M,h>>8,o>>8),t+=F,i+=B,h+=N,o+=U,n+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}else for(s-=r,r-=n,n=this.aw[n];;){if(--r<0)for(;;){if(--s<0)return;this.vv(e>>16,t>>16,this.lw,n,g,0,0,T,L,k,R,S,M,a>>8,h>>8),t+=F,e+=P,h+=N,a+=G,n+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.vv(i>>16,t>>16,this.lw,n,g,0,0,T,L,k,R,S,M,o>>8,h>>8),t+=F,i+=B,h+=N,o+=U,n+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}}else{e=i<<=16,a=o<<=16,n<0&&(e-=F*n,i-=B*n,a-=N*n,o-=U*n,n=0),t<<=16,h<<=16,s<0&&(t-=P*s,h-=G*s,s=0);const l=n-this.hl;if(T+=O*l,L+=x*l,k+=D*l,T|=0,L|=0,k|=0,r-=s,s-=n,n=this.aw[n],F>16,i>>16,this.lw,n,g,0,0,T,L,k,R,S,M,h>>8,o>>8),t+=P,i+=B,h+=G,o+=U,n+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.vv(e>>16,i>>16,this.lw,n,g,0,0,T,L,k,R,S,M,a>>8,o>>8),e+=F,i+=B,a+=N,o+=U,n+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}else for(;;){if(--s<0)for(;;){if(--r<0)return;this.vv(i>>16,t>>16,this.lw,n,g,0,0,T,L,k,R,S,M,o>>8,h>>8),t+=P,i+=B,h+=G,o+=U,n+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.vv(i>>16,e>>16,this.lw,n,g,0,0,T,L,k,R,S,M,o>>8,a>>8),e+=F,i+=B,a+=N,o+=U,n+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,this.lw,r,g,0,0,T,L,k,R,S,M,o>>8,h>>8),i+=B,t+=F,o+=U,h+=N,r+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.vv(i>>16,e>>16,this.lw,r,g,0,0,T,L,k,R,S,M,o>>8,a>>8),i+=B,e+=P,o+=U,a+=G,r+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}else for(;;){if(--s<0)for(;;){if(--n<0)return;this.vv(t>>16,i>>16,this.lw,r,g,0,0,T,L,k,R,S,M,h>>8,o>>8),i+=B,t+=F,o+=U,h+=N,r+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.vv(e>>16,i>>16,this.lw,r,g,0,0,T,L,k,R,S,M,a>>8,o>>8),i+=B,e+=P,o+=U,a+=G,r+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}}else{t=e<<=16,h=a<<=16,r<0&&(t-=B*r,e-=P*r,h-=U*r,a-=G*r,r=0),i<<=16,o<<=16,n<0&&(i-=F*n,o-=N*n,n=0);const l=r-this.hl;if(T+=O*l,L+=x*l,k+=D*l,T|=0,L|=0,k|=0,s-=n,n-=r,r=this.aw[r],B>16,e>>16,this.lw,r,g,0,0,T,L,k,R,S,M,o>>8,a>>8),i+=F,e+=P,o+=N,a+=G,r+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.vv(t>>16,e>>16,this.lw,r,g,0,0,T,L,k,R,S,M,h>>8,a>>8),t+=B,e+=P,h+=U,a+=G,r+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}else for(;;){if(--n<0)for(;;){if(--s<0)return;this.vv(e>>16,i>>16,this.lw,r,g,0,0,T,L,k,R,S,M,a>>8,o>>8),i+=F,e+=P,o+=N,a+=G,r+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.vv(e>>16,t>>16,this.lw,r,g,0,0,T,L,k,R,S,M,a>>8,h>>8),t+=B,e+=P,h+=U,a+=G,r+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}}};static vv=(t,i,e,s,n,r,h,o,a,l,c,f,u,d,w)=>{if(t>=i)return;let y,A,m,p,g,I,_,C,E;if(this.iI){if(y=(w-d)/(i-t)|0,i>this.eI&&(i=this.eI),t<0&&(d-=t*y,t=0),t>=i)return;A=i-t>>3,y<<=12}else i-t>7?(A=i-t>>3,y=(w-d)*this.tv[A]>>6):(A=0,y=0);if(d<<=9,s+=t,this.et&&n)if(m=0,p=0,I=t-this.rl,o+=(c>>3)*I,a+=(f>>3)*I,l+=(u>>3)*I,o|=0,a|=0,g=(l|=0)>>12,0!==g&&(h=a/g|0,(r=o/g|0)<0?r=0:r>4032&&(r=4032)),o+=c,a+=f,l+=u,o|=0,a|=0,g=(l|=0)>>12,0!==g&&(m=o/g|0,p=a/g|0,m<7?m=7:m>4032&&(m=4032)),_=m-r>>3,C=p-h>>3,r+=d>>3&786432,E=d>>23,this.lv){for(;A-- >0;)e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r=m,h=p,o+=c,a+=f,g=(l+=u)>>12,0!==g&&(m=o/g|0,p=a/g|0,m<7?m=7:m>4032&&(m=4032)),_=m-r>>3,C=p-h>>3,r+=(d+=y)>>3&786432,E=d>>23;for(A=i-t&7;A-- >0;)e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C}else{for(;A-- >0;){let t;0!=(t=n[(4032&h)+(r>>6)]>>>E)&&(e[s]=t),s+=1,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s+=1,r=m,h=p,o+=c,a+=f,l+=u,o|=0,a|=0,g=(l|=0)>>12,0!==g&&(m=o/g|0,p=a/g|0,m<7?m=7:m>4032&&(m=4032)),_=m-r>>3,C=p-h>>3,r+=(d+=y)>>3&786432,E=d>>23}for(A=i-t&7;A-- >0;){let t;0!=(t=n[(4032&h)+(r>>6)]>>>E)&&(e[s]=t),s++,r+=_,h+=C}}else if(m=0,p=0,I=t-this.rl,o+=(c>>3)*I,a+=(f>>3)*I,l+=(u>>3)*I,o|=0,a|=0,g=(l|=0)>>14,0!==g&&(h=a/g|0,(r=o/g|0)<0?r=0:r>16256&&(r=16256)),o+=c,a+=f,l+=u,o|=0,a|=0,g=(l|=0)>>14,0!==g&&(m=o/g|0,p=a/g|0,m<7?m=7:m>16256&&(m=16256)),_=m-r>>3,C=p-h>>3,r+=6291456&d,E=d>>23,this.lv&&n){for(;A-- >0;)e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r=m,h=p,o+=c,a+=f,l+=u,o|=0,a|=0,g=(l|=0)>>14,0!==g&&(m=o/g|0,p=a/g|0,m<7?m=7:m>16256&&(m=16256)),_=m-r>>3,C=p-h>>3,r+=6291456&(d+=y),E=d>>23;for(A=i-t&7;A-- >0;)e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C}else{for(;A-- >0&&n;){let t;0!=(t=n[(16256&h)+(r>>7)]>>>E)&&(e[s]=t),s+=1,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,r=m,h=p,o+=c,a+=f,l+=u,o|=0,a|=0,g=(l|=0)>>14,0!==g&&(m=o/g|0,p=a/g|0,m<7?m=7:m>16256&&(m=16256)),_=m-r>>3,C=p-h>>3,r+=6291456&(d+=y),E=d>>23}for(A=i-t&7;A-- >0&&n;){let t;0!=(t=n[(16256&h)+(r>>7)]>>>E)&&(e[s]=t),s++,r+=_,h+=C}}};static Cv=(t,i,e,s,n)=>{if(this.iI&&(i>this.eI&&(i=this.eI),t<0&&(t=0)),t>=i)return;s+=t;let r=i-t>>2;if(0===this.alpha)for(;;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;e[s++]=n}e[s++]=n,e[s++]=n,e[s++]=n,e[s++]=n}const h=this.alpha,o=256-this.alpha;for(n=((16711935&n)*o>>8&16711935)+((65280&n)*o>>8&65280);;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280)}e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280)}};static pv=t=>{this.rv[t]&&this.nv&&(this.nv[this.hv++]=this.rv[t],this.rv[t]=null)};static Ev=t=>{if(this.ov[t]=this.vm++,this.rv[t])return this.rv[t];let i;if(this.hv>0&&this.nv)i=this.nv[--this.hv],this.nv[this.hv]=null;else{let t=0,e=-1;for(let i=0;i>>3)&16316671,i[n+8192]=r-(r>>>2)&16316671,i[n+12288]=r-(r>>>2)-(r>>>3)&16316671}}else{if(64===e.width)for(let t=0;t<128;t++)for(let n=0;n<128;n++)i[n+(t<<7)]=s[e.lw[(n>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)i[t]=s[e.lw[t]];this.cv[t]=!1;for(let e=0;e<16384;e++){i[e]&=16316671;const s=i[e];0===s&&(this.cv[t]=!0),i[e+16384]=s-(s>>>3)&16316671,i[e+32768]=s-(s>>>2)&16316671,i[e+49152]=s-(s>>>2)-(s>>>3)&16316671}}return i}}},880:(t,i,e)=>{e.d(i,{r:()=>n});var s=e(7854);const n=async t=>{255!==t[0]&&(t[0]=255),URL.revokeObjectURL(s.SE.src),s.SE.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>s.SE.onload=()=>t())),s.LE.clearRect(0,0,s.xE.width,s.xE.height);const i=s.SE.naturalWidth,e=s.SE.naturalHeight;return s.xE.width=i,s.xE.height=e,s.LE.drawImage(s.SE,0,0),s.LE.getImageData(0,0,i,e)}},8665:(t,i,e)=>{e.d(i,{A:()=>f});var s=e(1069),n=e(8950),r=e(4583),h=e(6730),o=e(4474),a=e(3867);class l{Rd=0;Ag=0;bv=0;Tv=-1;Rv=-1;Ov=-1;Lv=-1;Sv=-1;xv=-1;kv=-1;Mv=-1;Dv=-1;Fv=0;Nv=-1;Bv=-1;Uv=-1;data=null}class c{x=0;y=0;z=0;w=0}class f extends o.A{static metadata=null;static head=null;static Pv=null;static Gv=null;static Wv=null;static Yv=null;static Hv=null;static Vv=null;static Kv=null;static Xv=null;static jv=null;static zv=null;static Zv=null;static qv=null;static axis=null;static $v=new a.fe(4096,!1);static Jv=new a.fe(4096,!1);static Qv=new Int32Array(4096);static tb=new Int32Array(4096);static ib=new Int32Array(4096);static eb=new Int32Array(4096);static sb=new Int32Array(4096);static nb=new Int32Array(4096);static rb=new Int32Array(1500);static hb=new a.Xr(1500,512);static ob=new Int32Array(12);static ab=new a.Xr(12,2e3);static lb=new Int32Array(2e3);static cb=new Int32Array(2e3);static fb=new Int32Array(12);static ub=new Int32Array(10);static wb=new Int32Array(10);static yb=new Int32Array(10);static Ir=0;static Ab=0;static _r=0;static mb=!1;static Ma=0;static Da=0;static pb=0;static gb=new Int32Array(1e3);static Ib=!1;static hu(t){try{f.head=new s.A(t.read('ob_head.dat')),f.Pv=new s.A(t.read('ob_face1.dat')),f.Gv=new s.A(t.read('ob_face2.dat')),f.Wv=new s.A(t.read('ob_face3.dat')),f.Yv=new s.A(t.read('ob_face4.dat')),f.Hv=new s.A(t.read('ob_face5.dat')),f.Vv=new s.A(t.read('ob_point1.dat')),f.Kv=new s.A(t.read('ob_point2.dat')),f.Xv=new s.A(t.read('ob_point3.dat')),f.jv=new s.A(t.read('ob_point4.dat')),f.zv=new s.A(t.read('ob_point5.dat')),f.Zv=new s.A(t.read('ob_vertex1.dat')),f.qv=new s.A(t.read('ob_vertex2.dat')),f.axis=new s.A(t.read('ob_axis.dat')),f.head.lf=0,f.Vv.lf=0,f.Kv.lf=0,f.Xv.lf=0,f.jv.lf=0,f.Zv.lf=0,f.qv.lf=0;const i=f.head.ou;f.metadata=new a.fe(i+100,null);let e=0,n=0,r=0,h=0,o=0,c=0,u=0;for(let t=0;t>7)<2?i=2:i>126&&(i=126),(65408&t)+i):(i<0?i=0:i>127&&(i=127),127-i)}static Td=(t,i,e)=>{const s=t.Rd,n=t.Ag,r=t.bv;let h,o,l,u,d;if(i){h=new Int32Array(s);for(let i=0;i{const n=t.Rd,r=t.Ag,h=t.bv;let o,a,l,c,u;if(s)o=t.Od,a=t.Sd,l=t.Ld;else{o=new Int32Array(n),a=new Int32Array(n),l=new Int32Array(n);for(let i=0;i{const e=t.Rd,s=t.Ag,n=t.bv,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e);for(let i=0;i{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,a=0,l=-1;for(let c=0;c{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,a=0,l=-1;for(let c=0;c{let o=-1;const a=t.Od[i],l=t.Sd[i],c=t.Ld[i];for(let t=0;t{if(!f.metadata)throw new Error('cant loading model metadata!!!!!');const i=f.metadata[t];if(!i)throw console.log(`Error model:${t} not found!`),new Error('cant loading model metadata!!!!!');if(!(f.head&&f.Pv&&f.Gv&&f.Wv&&f.Yv&&f.Hv&&f.Vv&&f.Kv&&f.Xv&&f.jv&&f.zv&&f.Zv&&f.qv&&f.axis))throw new Error('cant loading model!!!!!');const e=i.Rd,s=i.Ag,n=i.bv,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e),a=new Int32Array(s),l=new Int32Array(s),c=new Int32Array(s),u=new Int32Array(n),d=new Int32Array(n),w=new Int32Array(n);let y=null;i.Sv>=0&&(y=new Int32Array(e));let A=null;i.Dv>=0&&(A=new Int32Array(s));let m=null,p=0;i.Fv>=0?m=new Int32Array(s):p=-i.Fv-1;let g=null;i.Nv>=0&&(g=new Int32Array(s));let I=null;i.Bv>=0&&(I=new Int32Array(s));const _=new Int32Array(s);f.Vv.lf=i.Tv,f.Kv.lf=i.Rv,f.Xv.lf=i.Ov,f.jv.lf=i.Lv,f.zv.lf=i.Sv;let C,E,v,b=0,T=0,R=0;for(let t=0;t{if(!f.metadata||!f.metadata[i])throw new Error('No model metadata');const e=f.metadata[i];if(e.data=t,!e.data.length)throw new Error('No model data');const n=e.Rd,r=e.Ag,h=e.bv,o=new Int32Array(n),a=new Int32Array(n),l=new Int32Array(n),c=new Int32Array(r),u=new Int32Array(r),d=new Int32Array(r),w=new Int32Array(h),y=new Int32Array(h),A=new Int32Array(h);let m=null;e.Sv>=0&&(m=new Int32Array(n));let p=null;e.Dv>=0&&(p=new Int32Array(r));let g=null,I=0;e.Fv>=0?g=new Int32Array(r):I=-e.Fv-1;let _=null;e.Nv>=0&&(_=new Int32Array(r));let C=null;e.Bv>=0&&(C=new Int32Array(r));const E=new Int32Array(r),v=new s.A(e.data);v.lf=e.Tv;const b=new s.A(e.data);b.lf=e.Rv;const T=new s.A(e.data);T.lf=e.Ov;const R=new s.A(e.data);R.lf=e.Lv;const O=new s.A(e.data);O.lf=e.Sv;let L,S,x,k=0,M=0,D=0;for(let t=0;tthis.Ud&&(this.Ud=-e),e>this.cg&&(this.cg=e);const n=i*i+s*s;n>this.dm&&(this.dm=n)}this.dm=Math.sqrt(this.dm)+.99|0,this.kb=Math.sqrt(this.dm*this.dm+this.Ud*this.Ud)+.99|0,this.xb=this.kb+(Math.sqrt(this.dm*this.dm+this.cg*this.cg)+.99|0)}xd(){this.Ud=0,this.cg=0;for(let t=0;tthis.Ud&&(this.Ud=-i),i>this.cg&&(this.cg=i)}this.kb=Math.sqrt(this.dm*this.dm+this.Ud*this.Ud)+.99|0,this.xb=this.kb+(Math.sqrt(this.dm*this.dm+this.cg*this.cg)+.99|0)}xl(){if(this.Mb){const t=new Int32Array(256);let i=0;for(let e=0;ei&&(i=s)}this.Fd=new a.fe(i+1,null);for(let e=0;e<=i;e++)this.Fd[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;ei&&(i=s)}this.Dd=new a.fe(i+1,null);for(let e=0;e<=i;e++)this.Dd[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;ea;)a=e[o++];r&&r.types&&s.x&&s.y&&s.z&&r.labels&&(i!==a||0===r.types[i])&&this.Ub(s.x[t],s.y[t],s.z[t],r.labels[i],r.types[i])}f.Ir=0,f.Ab=0,f._r=0,o=0,a=e[o++];for(let t=0;ta;)a=e[o++];r&&r.types&&n.x&&n.y&&n.z&&r.labels&&(i===a||0===r.types[i])&&this.Ub(n.x[t],n.y[t],n.z[t],r.labels[i],r.types[i])}}else this.kl(t)}kl(t){if(!this.Fd||-1===t||!h.A.Lo[t])return;const i=h.A.Lo[t],e=i.TE;f.Ir=0,f.Ab=0,f._r=0;for(let t=0;t>16;this.Ld[t]=this.Sd[t]*i+this.Ld[t]*e>>16,this.Sd[t]=s}}translate(t,i,e){for(let s=0;s>8;if(this.Eb&&this.vb&&this.bb||(this.Eb=new Int32Array(this.Ag),this.vb=new Int32Array(this.Ag),this.bb=new Int32Array(this.Ag)),!this.eg){this.eg=new a.fe(this.Rd,null);for(let t=0;t8192||m>8192||p>8192||A<-8192||m<-8192||p<-8192;)A>>=1,m>>=1,p>>=1;let g=0|Math.sqrt(A*A+m*m+p*p);if(g<=0&&(g=1),A=256*A/g|0,m=256*m/g|0,p=256*p/g|0,this.yg&&1&this.yg[i]){const r=t+((e*A+s*m+n*p)/(h+(h/2|0))|0);this.Eu&&(this.Eb[i]=f.Cb(this.Eu[i],r,this.yg[i]))}else{let t=this.eg[r];t&&(t.x+=A,t.y+=m,t.z+=p,t.w++),t=this.eg[o],t&&(t.x+=A,t.y+=m,t.z+=p,t.w++),t=this.eg[a],t&&(t.x+=A,t.y+=m,t.z+=p,t.w++)}}if(r)this.rg(t,h,e,s,n);else{this.lg=new a.fe(this.Rd,null);for(let t=0;t>16;for(let s=0;s>16,I=I*w-g*d>>16,g=p),0!==t&&(p=I*l-_*a>>16,_=I*a+_*l>>16,I=p),0!==i&&(p=_*c+g*u>>16,_=_*u-g*c>>16,g=p),g+=n,I+=h,_+=o,p=I*A-_*y>>16,_=I*y+_*A>>16,I=p,f.Qv&&f.tb&&f.ib&&(f.ib[s]=_-m,f.Qv[s]=r.A.rl+((g<<9)/_|0),f.tb[s]=r.A.hl+((I<<9)/_|0)),this.bv>0&&f.eb&&f.sb&&f.nb&&(f.eb[s]=g,f.sb[s]=I,f.nb[s]=_)}try{this.Wb(!1,!1,0)}catch(t){}}draw(t,i,e,s,h,o,a,l,c){const u=l*h-o*s>>16,d=a*i+u*e>>16,w=this.dm*e>>16,y=d+w;if(y<=50||d>=3500)return;const A=l*s+o*h>>16;let m=A-this.dm<<9;if((m/y|0)>=n.A.jE)return;let p=A+this.dm<<9;if((p/y|0)<=-n.A.jE)return;const g=a*e-u*i>>16,I=this.dm*i>>16;let _=g+I<<9;if((_/y|0)<=-n.A.zE)return;let C=g-(I+(this.Ud*e>>16))<<9;if((C/y|0)>=n.A.zE)return;let E=d-(w+(this.Ud*i>>16))<=50,v=!1;if(c>0&&f.mb){let t=d-w;t<=50&&(t=50),A>0?(m=m/y|0,p=p/t|0):(p=p/y|0,m=m/t|0),g>0?(C=C/y|0,_=_/t|0):(_=_/y|0,C=C/t|0);const i=f.Ma-r.A.rl,e=f.Da-r.A.hl;i>m&&iC&&e<_&&(this.Jd?f.gb[f.pb++]=c:v=!0)}const b=r.A.rl,T=r.A.hl;let R=0,O=0;0!==t&&(R=r.A.sin[t],O=r.A.cos[t]);for(let n=0;n>16,w=w*O-c*R>>16,c=r),c+=o,u+=a,w+=l,r=w*s+c*h>>16,w=w*h-c*s>>16,c=r,r=u*e-w*i>>16,w=u*i+w*e>>16,u=r,f.ib&&(f.ib[n]=w-d),w>=50&&f.Qv&&f.tb?(f.Qv[n]=b+((c<<9)/w|0),f.tb[n]=T+((u<<9)/w|0)):f.Qv&&(f.Qv[n]=-5e3,E=!0),(E||this.bv>0)&&f.eb&&f.sb&&f.nb&&(f.eb[n]=c,f.sb[n]=u,f.nb[n]=w)}try{this.Wb(E,v,c)}catch(t){}}Wb(t,i,e,s=!1){f.Ib&&(this.Nb=-1,this.Bb=-1);for(let t=0;tn.A.eI||l>n.A.eI||c>n.A.eI),f.hb&&f.rb){const t=((y+A+m)/3|0)+this.kb;f.hb[t][f.rb[t]++]=s,f.Ib&&this.Yb(f.Ma,f.Da,u,d,w,a,l,c)&&this.Bb=0;t--){const i=f.rb[t];if(!(i<=0)&&f.hb){const e=f.hb[t];for(let t=0;t=0;t--){const i=f.rb[t];if(i>0&&f.hb){const e=f.hb[t];for(let s=0;s0||f.ob[2]>0)&&(r=(f.fb[1]+f.fb[2])/(f.ob[1]+f.ob[2])|0);let h=0;f.ob&&f.fb&&(f.ob[3]>0||f.ob[4]>0)&&(h=(f.fb[3]+f.fb[4])/(f.ob[3]+f.ob[4])|0);let o=0;if(f.ob&&f.fb&&(f.ob[6]>0||f.ob[8]>0)&&(o=(f.fb[6]+f.fb[8])/(f.ob[6]+f.ob[8])|0),f.ob&&f.ab){let t,i=0,e=f.ob[10],n=f.ab[10],a=f.lb;i===e&&(i=0,e=f.ob[11],n=f.ab[11],a=f.cb),t=ir;)this.Hb(n[i++],s),i===e&&n!==f.ab[11]&&(i=0,e=f.ob[11],n=f.ab[11],a=f.cb),t=ih;)this.Hb(n[i++],s),i===e&&n!==f.ab[11]&&(i=0,e=f.ob[11],n=f.ab[11],a=f.cb),t=io;)this.Hb(n[i++],s),i===e&&n!==f.ab[11]&&(i=0,e=f.ob[11],n=f.ab[11],a=f.cb),t=i>2,h=this.Ob[i],o=this.Lb[i],a=this.Sb[i];r.A.cI(f.Qv[e],f.Qv[s],f.Qv[n],f.tb[e],f.tb[s],f.tb[n],this.Eb[t],this.vb[t],this.bb[t],f.eb[h],f.sb[h],f.nb[h],f.eb[o],f.eb[a],f.sb[o],f.sb[a],f.nb[o],f.nb[a],this.Eu[t])}else if(3===h&&this.yg&&this.Eu&&this.Eb&&f.Qv&&f.tb&&f.eb&&f.sb&&f.nb){const i=this.yg[t]>>2,h=this.Ob[i],o=this.Lb[i],a=this.Sb[i];r.A.cI(f.Qv[e],f.Qv[s],f.Qv[n],f.tb[e],f.tb[s],f.tb[n],this.Eb[t],this.Eb[t],this.Eb[t],f.eb[h],f.sb[h],f.nb[h],f.eb[o],f.eb[a],f.sb[o],f.sb[a],f.nb[o],f.nb[a],this.Eu[t])}}Vb(t,i=!1){let e=0;if(f.nb){const i=r.A.rl,s=r.A.hl,n=this.mg[t],h=this.pg[t],o=this.gg[t],a=f.nb[n],l=f.nb[h],c=f.nb[o];if(a>=50&&f.Qv&&f.tb&&this.Eb)f.ub[e]=f.Qv[n],f.wb[e]=f.tb[n],f.yb[e++]=this.Eb[t];else if(f.eb&&f.sb&&this.Eb){const u=f.eb[n],d=f.sb[n],w=this.Eb[t];if(c>=50&&this.bb){const n=(50-a)*r.A.iv[c-a];f.ub[e]=i+((u+((f.eb[o]-u)*n>>16)<<9)/50|0),f.wb[e]=s+((d+((f.sb[o]-d)*n>>16)<<9)/50|0),f.yb[e++]=w+((this.bb[t]-w)*n>>16)}if(l>=50&&this.vb){const n=(50-a)*r.A.iv[l-a];f.ub[e]=i+((u+((f.eb[h]-u)*n>>16)<<9)/50|0),f.wb[e]=s+((d+((f.sb[h]-d)*n>>16)<<9)/50|0),f.yb[e++]=w+((this.vb[t]-w)*n>>16)}}if(l>=50&&f.Qv&&f.tb&&this.vb)f.ub[e]=f.Qv[h],f.wb[e]=f.tb[h],f.yb[e++]=this.vb[t];else if(f.eb&&f.sb&&this.vb){const u=f.eb[h],d=f.sb[h],w=this.vb[t];if(a>=50&&this.Eb){const h=(50-l)*r.A.iv[a-l];f.ub[e]=i+((u+((f.eb[n]-u)*h>>16)<<9)/50|0),f.wb[e]=s+((d+((f.sb[n]-d)*h>>16)<<9)/50|0),f.yb[e++]=w+((this.Eb[t]-w)*h>>16)}if(c>=50&&this.bb){const n=(50-l)*r.A.iv[c-l];f.ub[e]=i+((u+((f.eb[o]-u)*n>>16)<<9)/50|0),f.wb[e]=s+((d+((f.sb[o]-d)*n>>16)<<9)/50|0),f.yb[e++]=w+((this.bb[t]-w)*n>>16)}}if(c>=50&&f.Qv&&f.tb&&this.bb)f.ub[e]=f.Qv[o],f.wb[e]=f.tb[o],f.yb[e++]=this.bb[t];else if(f.eb&&f.sb&&this.bb){const u=f.eb[o],d=f.sb[o],w=this.bb[t];if(l>=50&&this.vb){const n=(50-c)*r.A.iv[l-c];f.ub[e]=i+((u+((f.eb[h]-u)*n>>16)<<9)/50|0),f.wb[e]=s+((d+((f.sb[h]-d)*n>>16)<<9)/50|0),f.yb[e++]=w+((this.vb[t]-w)*n>>16)}if(a>=50&&this.Eb){const h=(50-c)*r.A.iv[a-c];f.ub[e]=i+((u+((f.eb[n]-u)*h>>16)<<9)/50|0),f.wb[e]=s+((d+((f.sb[n]-d)*h>>16)<<9)/50|0),f.yb[e++]=w+((this.Eb[t]-w)*h>>16)}}}const s=f.ub[0],h=f.ub[1],o=f.ub[2],a=f.wb[0],l=f.wb[1],c=f.wb[2];if(!((s-h)*(c-l)-(a-l)*(o-h)<=0))if(r.A.iI=!1,3===e){let e;if((s<0||h<0||o<0||s>n.A.eI||h>n.A.eI||o>n.A.eI)&&(r.A.iI=!0),e=this.yg?3&this.yg[t]:0,i)r.A.qE(s,h,a,l,f.yb[0]),r.A.qE(h,o,l,c,f.yb[1]),r.A.qE(o,s,c,a,f.yb[2]);else if(0===e)r.A.hI(s,h,o,a,l,c,f.yb[0],f.yb[1],f.yb[2]);else if(1===e&&this.Eb)r.A._v(s,h,o,a,l,c,r.A.palette[this.Eb[t]]);else if(2===e&&this.yg&&this.Eu&&f.eb&&f.sb&&f.nb){const i=this.yg[t]>>2,e=this.Ob[i],n=this.Lb[i],u=this.Sb[i];r.A.cI(s,h,o,a,l,c,f.yb[0],f.yb[1],f.yb[2],f.eb[e],f.sb[e],f.nb[e],f.eb[n],f.eb[u],f.sb[n],f.sb[u],f.nb[n],f.nb[u],this.Eu[t])}else if(3===e&&this.yg&&this.Eu&&this.Eb&&f.eb&&f.sb&&f.nb){const i=this.yg[t]>>2,e=this.Ob[i],n=this.Lb[i],u=this.Sb[i];r.A.cI(s,h,o,a,l,c,this.Eb[t],this.Eb[t],this.Eb[t],f.eb[e],f.sb[e],f.nb[e],f.eb[n],f.eb[u],f.sb[n],f.sb[u],f.nb[n],f.nb[u],this.Eu[t])}}else if(4===e){let e;if((s<0||h<0||o<0||s>n.A.eI||h>n.A.eI||o>n.A.eI||f.ub[3]<0||f.ub[3]>n.A.eI)&&(r.A.iI=!0),e=this.yg?3&this.yg[t]:0,i)r.A.qE(s,h,a,l,f.yb[0]),r.A.qE(h,o,l,c,f.yb[1]),r.A.qE(o,f.ub[3],c,f.wb[3],f.yb[2]),r.A.qE(f.ub[3],s,f.wb[3],a,f.yb[3]);else if(0===e)r.A.hI(s,h,o,a,l,c,f.yb[0],f.yb[1],f.yb[2]),r.A.hI(s,o,f.ub[3],a,c,f.wb[3],f.yb[0],f.yb[2],f.yb[3]);else if(1===e){if(this.Eb){const i=r.A.palette[this.Eb[t]];r.A._v(s,h,o,a,l,c,i),r.A._v(s,o,f.ub[3],a,c,f.wb[3],i)}}else if(2===e&&this.yg&&this.Eu&&f.eb&&f.sb&&f.nb){const i=this.yg[t]>>2,e=this.Ob[i],n=this.Lb[i],u=this.Sb[i];r.A.cI(s,h,o,a,l,c,f.yb[0],f.yb[1],f.yb[2],f.eb[e],f.sb[e],f.nb[e],f.eb[n],f.eb[u],f.sb[n],f.sb[u],f.nb[n],f.nb[u],this.Eu[t]),r.A.cI(s,o,f.ub[3],a,c,f.wb[3],f.yb[0],f.yb[2],f.yb[3],f.eb[e],f.sb[e],f.nb[e],f.eb[n],f.eb[u],f.sb[n],f.sb[u],f.nb[n],f.nb[u],this.Eu[t])}else if(3===e&&this.yg&&this.Eu&&this.Eb&&f.eb&&f.sb&&f.nb){const i=this.yg[t]>>2,e=this.Ob[i],n=this.Lb[i],u=this.Sb[i];r.A.cI(s,h,o,a,l,c,this.Eb[t],this.Eb[t],this.Eb[t],f.eb[e],f.sb[e],f.nb[e],f.eb[n],f.eb[u],f.sb[n],f.sb[u],f.nb[n],f.nb[u],this.Eu[t]),r.A.cI(s,o,f.ub[3],a,c,f.wb[3],this.Eb[t],this.Eb[t],this.Eb[t],f.eb[e],f.sb[e],f.nb[e],f.eb[n],f.eb[u],f.sb[n],f.sb[u],f.nb[n],f.nb[u],this.Eu[t])}}}Ub(t,i,e,s,n){if(!s)return;const h=s.length;if(0===n){let n=0;f.Ir=0,f.Ab=0,f._r=0;for(let t=0;t0?(f.Ir=(f.Ir/n|0)+t,f.Ab=(f.Ab/n|0)+i,f._r=(f._r/n|0)+e):(f.Ir=t,f.Ab=i,f._r=e)}else if(1===n)for(let n=0;n=this.Fd.length)continue;const h=this.Fd[r];if(h)for(let s=0;s=this.Fd.length)continue;const o=this.Fd[h];if(o)for(let s=0;s>16;this.Sd[n]=this.Sd[n]*u-this.Od[n]*c>>16,this.Od[n]=t}if(0!==h){c=r.A.sin[h],u=r.A.cos[h];const t=this.Sd[n]*u-this.Ld[n]*c>>16;this.Ld[n]=this.Sd[n]*c+this.Ld[n]*u>>16,this.Sd[n]=t}if(0!==a){c=r.A.sin[a],u=r.A.cos[a];const t=this.Ld[n]*c+this.Od[n]*u>>16;this.Ld[n]=this.Ld[n]*u-this.Od[n]*c>>16,this.Od[n]=t}this.Od[n]+=f.Ir,this.Sd[n]+=f.Ab,this.Ld[n]+=f._r}}else if(3===n)for(let n=0;n=this.Fd.length)continue;const h=this.Fd[r];if(h)for(let s=0;s=this.Dd.length)continue;const n=this.Dd[e];if(n)for(let i=0;i255&&(this.Rb[e]=255)}}}Gb(){this.Ud=0,this.dm=0,this.cg=0,this.fg=999999,this.ug=-999999,this.wg=-99999,this.dg=99999;for(let t=0;tthis.ug&&(this.ug=i),sthis.wg&&(this.wg=s),-e>this.Ud&&(this.Ud=-e),e>this.cg&&(this.cg=e);const n=i*i+s*s;n>this.dm&&(this.dm=n)}this.dm=0|Math.sqrt(this.dm),this.kb=0|Math.sqrt(this.dm*this.dm+this.Ud*this.Ud),this.xb=this.kb+(0|Math.sqrt(this.dm*this.dm+this.cg*this.cg))}Yb(t,i,e,s,n,r,h,o){return!(ie&&i>s&&i>n)&&(!(t{e.d(i,{A:()=>o});var s=e(8950),n=e(1069),r=e(4474),h=e(880);class o extends r.A{lw;width;height;Xb;jb;Na;nw;constructor(t,i){super(),this.lw=new Int32Array(t*i),this.width=this.Na=t,this.height=this.nw=i,this.Xb=this.jb=0}static zb=async(t,i)=>{const e=t.read(i+'.dat');if(!e)throw new Error(`${i} jpeg not found!`);const s=await(0,h.r)(e),n=new o(s.width,s.height),r=new Uint32Array(s.data.buffer),a=n.lw;for(let t=0;t>24&255)<<24|(255&i)<<16|(i>>8&255)<<8|i>>16&255}return n};static Cu=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.lf=s.ou;const h=r.ou,a=r.ou,l=[],c=r.lu-1;for(let t=0;ts.length||r.lf>r.length)throw new Error;const f=r.lu,u=r.lu,d=r.ou,w=r.ou,y=new o(d,w);y.Xb=f,y.jb=u,y.Na=h,y.nw=a;const A=r.lu;if(0===A){const t=y.width*y.height;for(let i=0;is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,a+=i,o+=i}h>0&&r>0&&this.Zb(h,r,this.lw,n,a,s.A.lw,e,o)}Fa(t,i,e){i|=0,e|=0;let n=(i+=this.Xb)+(e+=this.jb)*s.A.cw,r=0,h=this.height,o=this.width,a=s.A.cw-o,l=0;if(es.A.bottom&&(h-=e+h-s.A.bottom),is.A.right){const t=i+o-s.A.right;o-=t,l+=t,a+=t}o>0&&h>0&&this.qb(o,h,this.lw,r,l,s.A.lw,n,a,t)}$b(t,i){t|=0,i|=0;let e=(t+=this.Xb)+(i+=this.jb)*s.A.cw,n=0,r=this.height,h=this.width,o=s.A.cw-h,a=0;if(is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,a+=i,o+=i}h>0&&r>0&&this.Jb(h,r,this.lw,n,a,s.A.lw,e,o)}Qb(){const t=this.lw,i=this.width,e=this.height;for(let s=0;s>16&255;r+=t,r<1?r=1:r>255&&(r=255);let h=n>>8&255;h+=i,h<1?h=1:h>255&&(h=255);let o=255&n;o+=e,o<1?o=1:o>255&&(o=255),this.lw[s]=(r<<16)+(h<<8)+o}}}_w(t,i,e,n){t|=0,i|=0,e|=0,n|=0;try{const r=this.width;let h=0,o=0;const a=this.Na,l=this.nw,c=(a<<16)/e|0,f=(l<<16)/n|0;t+=(this.Xb*e+a-1)/a|0,i+=(this.jb*n+l-1)/l|0,this.Xb*e%a!=0&&(h=(a-this.Xb*e%a<<16)/e|0),this.jb*n%l!=0&&(o=(l-this.jb*n%l<<16)/n|0),e=e*(this.width-(h>>16))/a|0,n=n*(this.height-(o>>16))/l|0;let u=t+i*s.A.cw,d=s.A.cw-e;if(is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right){const i=t+e-s.A.right;e-=i,d+=i}this.scale(e,n,this.lw,h,o,s.A.lw,d,u,r,c,f)}catch(t){console.error('error in sprite clipping routine')}}iT(t,i,e,n,r,h,o,a,l,c){t|=0,i|=0,e|=0,n|=0;try{const f=-e/2|0,u=-n/2|0,d=65536*Math.sin(l/326.11)|0,w=65536*Math.cos(l/326.11)|0,y=d*c>>8,A=w*c>>8;let m=(o<<16)+u*y+f*A,p=u*A-f*y+(a<<16),g=t+i*s.A.cw;for(let t=0;t>16)+(o>>16)*this.width],n+=A,o-=y;m+=y,p+=A,g+=s.A.cw}}catch(t){}}eT(t,i,e){t|=0,i|=0;let n=(t+=this.Xb)+(i+=this.jb)*s.A.cw,r=0,h=this.height,o=this.width,a=s.A.cw-o,l=0;if(is.A.bottom&&(h-=i+h-s.A.bottom),ts.A.right){const i=t+o-s.A.right;o-=i,l+=i,a+=i}o>0&&h>0&&this.sT(o,h,this.lw,l,r,s.A.lw,n,a,e.lw)}scale(t,i,e,s,n,r,h,o,a,l,c){try{const f=s;for(let u=-i;u<0;u++){const i=(n>>16)*a;for(let n=-t;n<0;n++){const t=e[(s>>16)+i];0===t?o++:r[o++]=t,s+=l}n+=c,s=f,o+=h}}catch(t){console.error('error in plot_scale')}}Jb(t,i,e,s,n,r,h,o){const a=-(t>>2);t=-(3&t);for(let l=-i;l<0;l++){for(let t=a;t<0;t++)r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++];for(let i=t;i<0;i++)r[h++]=e[s++];h+=o,s+=n}}qb(t,i,e,s,n,r,h,o,a){const l=256-a;for(let c=-i;c<0;c++){for(let i=-t;i<0;i++){const t=e[s++];if(0===t)h++;else{const i=r[h];r[h++]=((16711935&t)*a+(16711935&i)*l&4278255360)+((65280&t)*a+(65280&i)*l&16711680)>>8}}h+=o,s+=n}}Zb(t,i,e,s,n,r,h,o){const a=-(t>>2);t=-(3&t);for(let l=-i;l<0;l++){for(let t=a;t<0;t++){let t=e[s++];0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=t}h+=o,s+=n}}sT(t,i,e,s,n,r,h,o,a){const l=-(t>>2);t=-(3&t);for(let c=-i;c<0;c++){for(let t=l;t<0;t++){let t=e[n++];0!==t&&0===a[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===a[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===a[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===a[h]?r[h++]=t:h++}for(let i=t;i<0;i++){const t=e[n++];0!==t&&0===a[h]?r[h++]=t:h++}h+=o,n+=s}}}},1673:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(8950),n=e(1069),r=e(4474);class h extends r.A{lw;width;height;Xb;jb;Na;nw;palette;constructor(t,i,e){super(),this.lw=new Int8Array(t*i),this.width=this.Na=t,this.height=this.nw=i,this.Xb=this.jb=0,this.palette=e}static Cu=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.lf=s.ou;const o=r.ou,a=r.ou,l=r.lu,c=new Int32Array(l);for(let t=1;ts.length||r.lf>r.length)throw new Error;const f=r.lu,u=r.lu,d=r.ou,w=r.ou,y=new h(d,w,c);y.Xb=f,y.jb=u,y.Na=o,y.nw=a;const A=y.lw,m=r.lu;if(0===m){const t=y.width*y.height;for(let i=0;is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,a+=i,o+=i}h>0&&r>0&&this.nT(h,r,this.lw,n,a,s.A.lw,e,o)}Qb(){const t=this.lw,i=this.width,e=this.height;for(let s=0;s>16&255;n+=t,n<0?n=0:n>255&&(n=255);let r=this.palette[s]>>8&255;r+=i,r<0?r=0:r>255&&(r=255);let h=255&this.palette[s];h+=e,h<0?h=0:h>255&&(h=255),this.palette[s]=(n<<16)+(r<<8)+h}}yv(){this.Na|=0,this.nw|=0,this.Na/=2,this.nw/=2,this.Na|=0,this.nw|=0;const t=new Int8Array(this.Na*this.nw);let i=0;for(let e=0;e>1)+(e+this.jb>>1)*this.Na]=this.lw[i++];this.lw=t,this.width=this.Na,this.height=this.nw,this.Xb=0,this.jb=0}_w(){if(this.width===this.Na&&this.height===this.nw)return;const t=new Int8Array(this.Na*this.nw);let i=0;for(let e=0;e>2);t=-(3&t);for(let l=-i;l<0;l++){for(let t=a;t<0;t++){let t=e[s++];0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t]}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=this.palette[255&t]}h+=o,s+=n}}clip(t,i,e,n){try{const r=this.width;this.height;let h=0,o=0;const a=this.Na,l=this.nw,c=(a<<16)/e|0,f=(l<<16)/n|0;t=t+(this.Xb*e+a-1)/a|0,i=i+(this.jb*n+l-1)/l|0,this.Xb*e%a!=0&&(h=(a-this.Xb*e%a<<16)/e|0),this.jb*n%l!=0&&(o=(l-this.jb*n%l<<16)/n|0),e=e*(this.width-(h>>16))/a|0,n=n*(this.height-(o>>16))/l|0;let u,d=t+i*s.A.cw,w=s.A.cw-e;is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right&&(u=t+e-s.A.right,e-=u,w+=u),this.rT(s.A.lw,this.lw,this.palette,h,o,d,w,e,n,c,f,r)}catch(t){console.log('error in sprite clipping routine')}}rT(t,i,e,s,n,r,h,o,a,l,c,f){try{const u=s;for(let d=-a;d<0;d++){const a=(n>>16)*f;for(let n=-o;n<0;n++){const n=i[(s>>16)+a];0==n?r++:t[r++]=e[255&n],s+=l}n+=c,s=u,r+=h}}catch(t){console.log('error in plot_scale')}}}},2682:(t,i,e)=>{e.d(i,{A:()=>a});var s=e(8950),n=e(1069),r=e(4474);class h{seed;constructor(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}hT(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}oT(){return this.next(32)}next(t){return this.seed=0x5deece66dn*this.seed+0xbn&(1n<<48n)-1n,Number(this.seed)>>>48-t}}var o=e(9298);class a extends r.A{static aT='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!"£$%^&*()-_=+[{]};:\'@#~,<.>/?\\| ';static lT=[];static{const t=navigator.userAgent.includes('Capacitor');for(let i=0;i<256;i++){let e=a.aT.indexOf(String.fromCharCode(i));t&&e>=63&&e--,-1===e&&(e=74),a.lT[i]=e}}cT=[];fT=new Int32Array(94);uT=new Int32Array(94);dT=new Int32Array(94);wT=new Int32Array(94);yT=new Int32Array(95);AT=new Int32Array(256);random=new h(BigInt(Date.now()));height=0;static Cu=(t,i)=>{const e=new n.A(t.read(i+'.dat')),s=new n.A(t.read('index.dat'));s.lf=e.ou+4;const r=s.lu;r>0&&(s.lf+=3*(r-1));const h=new a;for(let t=0;t<94;t++){h.dT[t]=s.lu,h.wT[t]=s.lu;const i=h.fT[t]=s.ou,n=h.uT[t]=s.ou,r=s.lu,o=i*n;if(h.cT[t]=new Int8Array(o),0===r)for(let s=0;sh.height&&(h.height=n),h.dT[t]=1,h.yT[t]=i+2;{let e=0;for(let s=n/7|0;s=s.A.bottom&&(r-=e+r+1-s.A.bottom),i=s.A.right){const t=i+n+1-s.A.right;n-=t,l+=t,a+=t}n>0&&r>0&&this.bT(n,r,t,c,l,s.A.lw,o,a,h)}CT(t,i,e,n,r,h,o){e|=0,n|=0;let a=(t|=0)+(i|=0)*s.A.cw,l=s.A.cw-e,c=0,f=0;if(i=s.A.bottom&&(n-=i+n+1-s.A.bottom),t=s.A.right){const i=t+e+1-s.A.right;e-=i,c+=i,l+=i}e>0&&n>0&&this.TT(e,n,s.A.lw,a,l,o,f,c,r,h)}bT(t,i,e,s,n,r,h,o,a){const l=-((t|=0)>>2);t=-(3&t);for(let c=-(i|=0);c<0;c++){for(let t=l;t<0;t++)0===e[s++]?h++:r[h++]=a,0===e[s++]?h++:r[h++]=a,0===e[s++]?h++:r[h++]=a,0===e[s++]?h++:r[h++]=a;for(let i=t;i<0;i++)0===e[s++]?h++:r[h++]=a;h+=o,s+=n}}TT(t,i,e,s,n,r,h,o,a,l){t|=0;const c=((16711935&a)*l&4278255360)+((65280&a)*l&16711680)>>8,f=256-l;for(let a=-(i|=0);a<0;a++){for(let i=-t;i<0;i++)if(0===r[h++])s++;else{const t=e[s];e[s++]=(((16711935&t)*f&4278255360)+((65280&t)*f&16711680)>>8)+c}s+=n,h+=o}}pT(t){return'red'===t?o.A.RED:'gre'===t?o.A.GREEN:'blu'===t?o.A.BLUE:'yel'===t?o.A.Ga:'cya'===t?o.A.kE:'mag'===t?o.A.sm:'whi'===t?o.A.Ia:'bla'===t?o.A.Pa:'lre'===t?o.A.ME:'dre'===t?o.A.DE:'dbl'===t?o.A.FE:'or1'===t?o.A.NE:'or2'===t?o.A.BE:'or3'===t?o.A.UE:'gr1'===t?o.A.PE:'gr2'===t?o.A.GE:'gr3'===t?o.A.WE:o.A.Pa}split(t,i){if(0===t.length)return[t];const e=[];for(;t.length>0;){if(this.gT(t)<=i&&-1===t.indexOf('|')){e.push(t);break}let s=t.length;for(let e=0;ei)break;s=e}else if('|'===t[e]){s=e;break}e.push(t.substring(0,s)),t=t.substring(s+1)}return e}}},1183:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(8950),n=e(7854);class r{RT;width;height;OT;LT;lw;constructor(t,i,e=n.zo){this.OT=e,this.RT=this.OT.getImageData(0,0,t,i),this.LT=new Uint32Array(this.RT.data.buffer),this.lw=new Int32Array(t*i),this.width=t,this.height=i,this.bind()}clear(){this.lw.fill(0)}bind(){s.A.bind(this.lw,this.width,this.height)}draw(t,i){this.#t(),this.OT.putImageData(this.RT,t,i)}#t(){const t=this.lw.length,i=this.lw,e=this.LT;for(let s=0;s>16&255|(t>>8&255)<<8|(255&t)<<16|4278190080}}}},4544:(t,i,e)=>{e.d(i,{A:()=>s});class s{db;constructor(t){t.onerror=this.onerror,t.onclose=this.onclose,this.db=t}static openDatabase=async()=>await new Promise(((t,i)=>{const e=indexedDB.open('lostcity',1);e.onsuccess=i=>{const e=i.target;console.log('database success!'),t(e.result)},e.onupgradeneeded=t=>{t.target.result.createObjectStore('cache')},e.onerror=t=>{const e=t.target;console.error('database error!: ',e.error),i(e.result)}}));Uo=async t=>await new Promise((i=>{const e=this.db.transaction('cache','readonly').objectStore('cache').get(t);e.onsuccess=()=>{i(e.result)},e.onerror=t=>{i(void 0)}}));Ho=async(t,i)=>await new Promise(((e,s)=>{const n=this.db.transaction('cache','readwrite').objectStore('cache').put(i,t);n.onsuccess=()=>{e()},n.onerror=t=>{s()}}));onclose=t=>{console.log('database close!')};onerror=t=>{console.log('database error!')};ST=t=>{const i=t.trim();let e=0;for(let t=0;t='A'&&s<='Z'?e+=s.charCodeAt(0)+1-65:s>='a'&&s<='z'?e+=s.charCodeAt(0)+1-97:s>='0'&&s<='9'&&(e+=s.charCodeAt(0)+27-48)}return e}}},2901:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(1908);class r{static ST=t=>{let i=0;t=t.toUpperCase();for(let e=0;e=this.kT)return null;if(this.BT[t])return this.BT[t];const i=this.NT[t],e=i+this.FT[t];if(this.xT){const s=Uint8Array.from(this.buffer.subarray(i,i+e));return this.BT[t]=s,s}{const i=Uint8Array.from(n.A.read(this.DT[t],this.buffer,this.FT[t],this.NT[t]));return this.BT[t]=i,i}}}},1069:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(9234),n=e(6666),r=e(4474);class h extends r.A{static PT=3988292384;static GT=new Int32Array(256);static WT=new Uint32Array(33);static YT=new n.A;static HT=new n.A;static VT=new n.A;static KT=0;static XT=0;static jT=0;static{for(let t=0;t<32;t++)h.WT[t]=(1<>>=1:i=i>>>1^h.PT;h.GT[t]=i}}static Po=t=>{let i=4294967295;for(let e=0;e>>8^h.GT[255&(i^t[e])];return~i};view;data;lf=0;zT=0;random=null;constructor(t){if(!t)throw new Error('Input src packet array was null!');super(),t instanceof Int8Array?this.data=new Uint8Array(t):this.data=t,this.view=new DataView(this.data.buffer,this.data.byteOffset,this.data.byteLength)}get length(){return this.view.byteLength}get available(){return this.length-this.lf}static Ut=t=>{let i=null;return 0===t&&h.KT>0?(h.KT--,i=h.YT.Bg()):1===t&&h.XT>0?(h.XT--,i=h.HT.Bg()):2===t&&h.jT>0&&(h.jT--,i=h.VT.Bg()),i?(i.lf=0,i):new h(0===t?new Uint8Array(100):1===t?new Uint8Array(5e3):new Uint8Array(3e4))};release(){this.lf=0,100===this.view.byteLength&&h.KT<1e3?(h.YT.kA(this),h.KT++):5e3===this.view.byteLength&&h.XT<250?(h.HT.kA(this),h.XT++):3e4===this.view.byteLength&&h.jT<50&&(h.VT.kA(this),h.jT++)}get lu(){return this.view.getUint8(this.lf++)}get bd(){return this.view.getInt8(this.lf++)}get ou(){const t=this.view.getUint16(this.lf);return this.lf+=2,t}get fu(){const t=this.view.getInt16(this.lf);return this.lf+=2,t}get Wu(){const t=this.view.getUint8(this.lf++)<<16|this.view.getUint16(this.lf);return this.lf+=2,t}get Ko(){const t=this.view.getInt32(this.lf);return this.lf+=4,t}get $C(){const t=this.view.getBigInt64(this.lf);return this.lf+=8,t}get RE(){return this.view.getUint8(this.lf)<128?this.lu-64:this.ou-49152}get um(){return this.view.getUint8(this.lf)<128?this.lu:this.ou-32768}get wu(){const t=this.view,i=t.byteLength;let e,s='';for(;10!==(e=t.getUint8(this.lf++))&&this.lf>16),this.view.setUint16(this.lf,t),this.lf+=2}p4(t){this.view.setInt32(this.lf,t),this.lf+=4}JT(t){this.view.setInt32(this.lf,t,!0),this.lf+=4}QT(t){this.view.setBigInt64(this.lf,t),this.lf+=8}tR(t){const i=this.view,e=t.length;for(let s=0;s>>3,e=8-(7&this.zT),s=0;for(this.zT+=t;t>e;e=8)s+=(this.view.getUint8(i++)&h.WT[e])<>>e-t&h.WT[t],s}hR(t,i){const e=this.lf;this.lf=0;const n=new Uint8Array(e);this.ZT(e,0,n);const r=(0,s.oR)(n),h=(0,s.aR)(r,i,t),o=(0,s.lR)(h);this.lf=0,this.p1(o.length),this.iR(o,o.length,0)}}},3937:(t,i,e)=>{e.d(i,{A:()=>o});class s{start=0;end=0;form=0;length=0;cR=null;fR=null;threshold=0;position=0;delta=0;amplitude=0;uR=0;read(t){this.form=t.lu,this.start=t.Ko,this.end=t.Ko,this.length=t.lu,this.cR=new Int32Array(this.length),this.fR=new Int32Array(this.length);for(let i=0;i=this.threshold&&this.fR&&this.cR&&(this.amplitude=this.fR[this.position++]<<15,this.position>=this.length&&(this.position=this.length-1),this.threshold=this.cR[this.position]/65536*t|0,this.threshold>this.uR&&(this.delta=((this.fR[this.position]<<15)-this.amplitude)/(this.threshold-this.uR)|0)),this.amplitude+=this.delta,this.uR++,this.amplitude-this.delta>>15}}class n{static buffer=null;static SA=null;static sin=null;static dR=new Int32Array(5);static wR=new Int32Array(5);static yR=new Int32Array(5);static AR=new Int32Array(5);static mR=new Int32Array(5);pR=null;gR=null;IR=null;_R=null;CR=null;ER=null;release=null;attack=null;vR=new Int32Array(5);bR=new Int32Array(5);TR=new Int32Array(5);start=0;length=500;RR=100;OR=0;static init=()=>{this.SA=new Int32Array(32768);for(let t=0;t<32768;t++)Math.random()>.5?this.SA[t]=1:this.SA[t]=-1;this.sin=new Int32Array(32768);for(let t=0;t<32768;t++)this.sin[t]=16384*Math.sin(t/5215.1903)|0;this.buffer=new Int32Array(220500)};LR(t,i){for(let i=0;i>1,h+=(i*s>>16)+r}if(this.CR&&this.ER){const i=this.CR.evaluate(t),e=this.ER.evaluate(t);c=c*(32768+(this.SR(e,l,this.CR.form)>>1))>>15,l+=(i*o>>16)+a}for(let s=0;s<5;s++)if(0!==this.vR[s]){const r=i+n.wR[s];r>15,n.dR[s],this.pR.form),n.dR[s]+=(e*n.AR[s]>>16)+n.mR[s])}}if(this.release&&this.attack){this.release.reset(),this.attack.reset();let i=0,e=!0;for(let s=0;s>8):this.release.start+((this.release.end-this.release.start)*h>>8),i+=256,i>=o&&(i=0,e=!e),e&&(n.buffer[s]=0)}}if(this.OR>0&&this.RR>0){const i=this.OR*e;for(let e=i;e32767&&(n.buffer[i]=32767);return n.buffer}SR(t,i,e){return 1===e?(32767&i)<16384?t:-t:2===e?n.sin[32767&i]*t>>14:3===e?((32767&i)*t>>14)-t:4===e?n.SA[i/2607&32767]*t:0}read(t){this.pR=new s,this.pR.read(t),this.gR=new s,this.gR.read(t),0!==t.lu&&(t.lf--,this.IR=new s,this.IR.read(t),this._R=new s,this._R.read(t)),0!==t.lu&&(t.lf--,this.CR=new s,this.CR.read(t),this.ER=new s,this.ER.read(t)),0!==t.lu&&(t.lf--,this.release=new s,this.release.read(t),this.attack=new s,this.attack.read(t));for(let i=0;i<10;i++){const e=t.um;if(0===e)break;this.vR[i]=e,this.bR[i]=t.RE,this.TR[i]=t.um}this.OR=t.um,this.RR=t.um,this.length=t.ou,this.start=t.ou}}var r=e(1069),h=e(3867);class o{static xR=new Int32Array(1e3);static kR=null;static MR=null;static DR=new h.fe(1e3,null);FR=new h.fe(10,null);NR=0;loopEnd=0;static hu=t=>{const i=new r.A(t.read('sounds.dat'));for(this.kR=new Uint8Array(441e3),this.MR=new r.A(this.kR),n.init();;){const t=i.ou;if(65535===t)break;const e=new o;e.read(i),this.DR[t]=e,this.xR[t]=e.trim()}};static LR=(t,i)=>{if(!this.DR[t])return null;const e=this.DR[t];return e?.BR(i)??null};read(t){for(let i=0;i<10;i++)0!==t.lu&&(t.lf--,this.FR[i]=new n,this.FR[i]?.read(t));this.NR=t.ou,this.loopEnd=t.ou}trim(){let t=9999999;for(let i=0;i<10;i++)this.FR[i]&&(this.FR[i].start/20|0)i&&(i=this.FR[t].length+this.FR[t].start);if(0===i)return 0;let e=22050*i/1e3|0,s=22050*this.NR/1e3|0,n=22050*this.loopEnd/1e3|0;(s<0||n<0||n>e||s>=n)&&(t=0);let r=e+(n-s)*(t-1);for(let t=44;t>8<<24>>24)}if(t>1){s+=44,n+=44,e+=44,r+=44;const i=r-e;for(let t=e-1;t>=n;t--)o.kR&&(o.kR[t+i]=o.kR[t]);for(let i=1;i{e.d(i,{qA:()=>l,ZA:()=>o,fe:()=>s,_m:()=>n,Eh:()=>r,Am:()=>h,Xr:()=>a});class s extends Array{constructor(t,i){super(t);for(let e=0;e{e.d(i,{lR:()=>o,Wo:()=>n,oR:()=>h,Yo:()=>s,Xl:()=>r,aR:()=>a});const s=async t=>new Promise((i=>setTimeout(i,t))),n=async t=>new Int8Array(await(await fetch(t)).arrayBuffer()),r=async t=>(await fetch(t)).text();function h(t){let i=0n;for(let e=0;e0n;)i.unshift(Number(0xffn&t)),t>>=8n;return 128&i[0]&&i.unshift(0),new Uint8Array(i)}function a(t,i,e){let s=1n;for(;i>0n;)i%2n===1n&&(s=s*t%e),t=t*t%e,i>>=1n;return s}},7953:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1069);class n{static UR=new Uint16Array(['d','o','t'].join('').split('').map((t=>t.charCodeAt(0))));static PR=new Uint16Array(['(','a',')'].join('').split('').map((t=>t.charCodeAt(0))));static GR=new Uint16Array(['s','l','a','s','h'].join('').split('').map((t=>t.charCodeAt(0))));static WR=['cook',"cook's",'cooks','seeks','sheet'];static YR=[];static HR=[];static VR=[];static KR=[];static XR=[];static jR=[];static hu=t=>{const i=new s.A(t.read('fragmentsenc.txt')),e=new s.A(t.read('badenc.txt')),n=new s.A(t.read('domainenc.txt')),r=new s.A(t.read('tldlist.txt'));this.read(e,n,i,r)};static filter=t=>{const i=[...t];this.format(i);const e=i.join('').trim(),s=e.toLowerCase(),n=[...s];this.zR(n),this.ZR(n),this.qR(n),this.$R(n);for(let t=0;t{this.tO(t),this.iO(i),this.eO(e),this.sO(s)};static sO=t=>{const i=t.Ko;for(let e=0;et.lu))};static tO=t=>{const i=t.Ko;for(let e=0;et.lu));const i=new Array(t.lu).fill([]).map((()=>[t.bd,t.bd]));i.length>0&&(this.KR[e]=i)}};static iO=t=>{const i=t.Ko;for(let e=0;et.lu))};static eO=t=>{const i=t.Ko;for(let e=0;e{const i=[...t],e=[...t];this.nO(null,i,this.UR),this.nO(null,e,this.GR);for(let s=0;s{for(let i=0;i<2;i++)for(let i=this.VR.length-1;i>=0;i--)this.nO(this.KR[i],t,this.VR[i])};static qR=t=>{const i=[...t],e=[...t];this.nO(null,i,this.PR),this.nO(null,e,this.UR);for(let s=this.XR.length-1;s>=0;s--)this.hO(e,i,this.XR[s],t)};static $R=t=>{for(let i=0;i=0&&n{if(this.dO(t))return!0;const i=this.wO(t),e=this.jR,s=e.length;if(i===e[0]||i===e[s-1])return!0;let n=0,r=s-1;for(;n<=r;){const t=(n+r)/2|0;if(i===e[t])return!0;i{if(t.length>6)return 0;let i=0;for(let e=0;e{for(let e=i;e=0;e++)if(this.AO(t[e]))return e;return-1};static fO=(t,i)=>{for(let e=t;e=0;e++)if(!this.AO(i[e]))return e;return i.length};static mO=(t,i,e)=>i===e||'o'===i&&'0'===e?1:'o'===i&&'('===e&&')'===t?2:'c'!==i||'('!==e&&'<'!==e&&'['!==e?'e'===i&&'€'===e||'s'===i&&'$'===e||'l'===i&&'i'===e?1:0:1;static hO=(t,i,e,s)=>{const n=e.length,r=s.length;for(let h=0;h<=r-n;h++){const{pO:n,gO:r}=this.IO(h,e,s);if(!n)continue;const o=this._O(h,s,3,i,['@']),a=this.CO(r-1,s,3,t,['.',',']);(o>2||a>2)&&this.cO(h,r,s)}};static IO=(t,i,e)=>{const s=i.length;let n=t,r=0;for(;n0)n+=a,r++;else{if(0===r)break;const e=this.mO(o,String.fromCharCode(i[r-1]),h);if(e>0)n+=e,1===r&&t++;else{if(r>=s||!this.aO(h))break;n++}}}return{pO:r>=s,gO:n}};static nO=(t,i,e)=>{if(!(e.length>i.length))for(let s=0;s<=i.length-e.length;s++){let n=s;const{gO:r,EO:h,vO:o,bO:a,TO:l}=this.RO(i,e,n);n=r;let c=i[n],f=n+1=e.length)||a&&l)continue;let u,d=!0;if(o){let t=!1,e=!1;if((s-1<0||this.aO(i[s-1])&&"'"!==i[s-1])&&(t=!0),(n>=i.length||this.aO(i[n])&&"'"!==i[n])&&(e=!0),!t||!e){let e=!1;for(u=s-2,t&&(u=s);!e&&u=0&&(!this.aO(i[u])||"'"===i[u])){const t=[];let s;for(s=0;s<3&&u+s=0&&(!this.aO(i[u-1])||"'"===i[u-1])&&(n=!1),n&&!this.uO(t)&&(e=!0)}u++}e||(d=!1)}}else{c=' ',s-1>=0&&(c=i[s-1]),f=' ',n{let s=e,n=0,r=0,h=!1,o=!1,a=!1;for(;s=t.length||o&&a);){const l=t[s],c=s+10)1===f&&this.AO(l)&&(o=!0),2===f&&(this.AO(l)||this.AO(c))&&(o=!0),s+=f,n++;else{if(0===n)break;let t;if((t=this.xO(c,String.fromCharCode(i[n-1]),l))>0)s+=t;else{if(n>=i.length||!this.lO(l))break;if(this.aO(l)&&"'"!==l&&(h=!0),this.AO(l)&&(a=!0),s++,r++,(100*r/(s-e)|0)>90)break}}}return{gO:s,EO:n,vO:h,bO:o,TO:a}};static xO=(t,i,e)=>{if(i===e)return 1;if(i>='a'&&i<='m'){if('a'===i)return'4'!==e&&'@'!==e&&'^'!==e?'/'===e&&'\\'===t?2:0:1;if('b'===i)return'6'!==e&&'8'!==e?'1'===e&&'3'===t?2:0:1;if('c'===i)return'('!==e&&'<'!==e&&'{'!==e&&'['!==e?0:1;if('d'===i)return'['===e&&')'===t?2:0;if('e'===i)return'3'!==e&&'€'!==e?0:1;if('f'===i)return'p'===e&&'h'===t?2:'£'===e?1:0;if('g'===i)return'9'!==e&&'6'!==e?0:1;if('h'===i)return'#'===e?1:0;if('i'===i)return'y'!==e&&'l'!==e&&'j'!==e&&'1'!==e&&'!'!==e&&':'!==e&&';'!==e&&'|'!==e?0:1;if('j'===i)return 0;if('k'===i)return 0;if('l'===i)return'1'!==e&&'|'!==e&&'i'!==e?0:1;if('m'===i)return 0}if(i>='n'&&i<='z'){if('n'===i)return 0;if('o'===i)return'0'!==e&&'*'!==e?'('===e&&')'===t||'['===e&&']'===t||'{'===e&&'}'===t||'<'===e&&'>'===t?2:0:1;if('p'===i)return 0;if('q'===i)return 0;if('r'===i)return 0;if('s'===i)return'5'!==e&&'z'!==e&&'$'!==e&&'2'!==e?0:1;if('t'===i)return'7'!==e&&'+'!==e?0:1;if('u'===i)return'v'===e?1:'\\'===e&&'/'===t||'\\'===e&&'|'===t||'|'===e&&'/'===t?2:0;if('v'===i)return'\\'===e&&'/'===t||'\\'===e&&'|'===t||'|'===e&&'/'===t?2:0;if('w'===i)return'v'===e&&'v'===t?2:0;if('x'===i)return')'===e&&'('===t||'}'===e&&'{'===t||']'===e&&'['===t||'>'===e&&'<'===t?2:0;if('y'===i)return 0;if('z'===i)return 0}return i>='0'&&i<='9'?'0'===i?'o'===e||'O'===e?1:'('===e&&')'===t||'{'===e&&'}'===t||'['===e&&']'===t?2:0:'1'===i&&'l'===e?1:0:','===i?'.'===e?1:0:'.'===i?','===e?1:0:'!'===i&&'i'===e?1:0};static LO=(t,i,e)=>{let s=0,n=i.length-1;for(;s<=n;){const r=(s+n)/2|0;if(i[r][0]===t&&i[r][1]===e)return!0;tthis.yO(t)?t.charCodeAt(0)+1-'a'.charCodeAt(0):"'"===t?28:this.AO(t)?t.charCodeAt(0)+29-'0'.charCodeAt(0):27;static rO=(t,i,e,s,n)=>{if(!(s.length>e.length))for(let r=0;r<=e.length-s.length;r++){const{gO:h,kO:o}=this.MO(e,s,r);if(o0&&c>0&&(a=!0),2===i&&(l>2&&c>0||l>0&&c>2)&&(a=!0),3===i&&l>0&&c>2&&(a=!0),!a)continue;let f,u=r,d=h-1,w=!1;if(l>2){if(4===l)for(w=!1,f=r-1;f>=0;f--)if(w){if('*'!==n[f])break;u=f}else'*'===n[f]&&(u=f,w=!0);for(w=!1,f=u-1;f>=0;f--)if(w){if(this.aO(e[f]))break;u=f}else this.aO(e[f])||(w=!0,u=f)}if(c>2){if(4===c)for(w=!1,f=d+1;f{let s=0;for(;e0)e+=h,s++;else{if(0===s)break;let t;if((t=this.mO(r,String.fromCharCode(i[s-1]),n))>0)e+=t;else{if(!this.aO(n))break;e++}}}return{gO:e,kO:s}};static aO=t=>!this.SO(t)&&!this.AO(t);static lO=t=>!this.yO(t)||('v'===t||'x'===t||'j'===t||'q'===t||'z'===t);static SO=t=>this.yO(t)||this.DO(t);static AO=t=>t>='0'&&t<='9';static yO=t=>t>='a'&&t<='z';static DO=t=>t>='A'&&t<='Z';static dO=t=>{for(let i=0;i{for(let s=t;s{let e=0;for(let s=i-1;s>=0&&this.aO(t[s]);s--)'*'===t[s]&&e++;return e};static NO=(t,i)=>{let e=0;for(let s=i+1;s(n?this.FO(i,e):this.NO(i,e))>=s?4:this.aO(n?t[e-1]:t[e+1])?1:0;static _O=(t,i,e,s,n)=>{if(0===t)return 2;for(let e=t-1;e>=0&&this.aO(i[e]);e--)if(n.includes(i[e]))return 3;return this.BO(i,s,t,e,!0)};static CO=(t,i,e,s,n)=>{if(t+1===i.length)return 2;for(let e=t+1;e{let i=0;for(let e=0;et>=' '&&t<=''||' '===t||'\n'===t||'\t'===t||'£'===t||'€'===t;static JR=(t,i)=>{for(let e=0;e{let i=!0;for(let e=0;e{e.a(t,(async(t,i)=>{try{var s=e(7046),n=e(1312),r=e(5637),h=e(2164),o=e(1302),a=e(6948),l=e(8317),c=e(8738),f=e(3764),u=e(1120),d=e(4583),w=e(2682),y=e(8665),A=e(8534),m=e(6730),p=e(7953),g=e(9234),I=e(8950),_=e(1069),C=e(3937),E=e(4544),v=e(1908),b=e(9298),T=e(1651),R=e(7604);class t extends T.K{PO=0;GO=!0;Fm=0;Nm=0;Bm=0;WO=0;YO=0;HO=2;model={id:parseInt(s.A.getParameter('model'))||0,x:0,y:0,z:420,Hg:0};constructor(){super(!0)}load=async()=>{await this.Go(10,'Connecting to fileserver'),await v.A.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new E.A(await E.A.openDatabase());const t=new _.A(new Uint8Array(await(0,g.Wo)(`${T.K.nt}/crc`))),i=[];for(let e=0;e<9;e++)i[e]=t.Ko;const e=await this.Bo('title','title screen',i[1],10);this.di=w.A.Cu(e,'p11'),this.wi=w.A.Cu(e,'p12'),this.yi=w.A.Cu(e,'b12'),this.Ai=w.A.Cu(e,'q8');const s=await this.Bo('config','config',i[2],15),I=await this.Bo('interface','interface',i[3],20),b=await this.Bo('media','2d graphics',i[4],30),R=await this.Bo('models','3d graphics',i[5],40),O=await this.Bo('textures','textures',i[6],60),L=await this.Bo('wordenc','chat system',i[7],65),S=await this.Bo('sounds','sound effects',i[8],70);await this.Go(75,'Unpacking media'),await this.Go(80,'Unpacking textures'),d.A.wv(O),d.A.mv(.8),d.A.gv(20),await this.Go(83,'Unpacking models'),y.A.hu(R),A.A.hu(R),m.A.hu(R),await this.Go(86,'Unpacking config'),n.A.hu(s),r.A.hu(s),h.A.hu(s),o.A.hu(s,!0),a.A.hu(s),l.A.hu(s),c.A.hu(s),f.A.hu(s),await this.Go(90,'Unpacking sounds'),C.A.hu(S),await this.Go(92,'Unpacking interfaces'),u.A.hu(I,b,[this.di,this.wi,this.yi,this.Ai]),await this.Go(97,'Preparing game engine'),p.A.hu(L),this.xo?.bind(),d.A.Tc()};update=async()=>{this.VO(),this.KO(),this.PO++,this.PO>50&&(this.GO&&(s.A.setParameter('model',this.model.id.toString()),this.GO=!1),this.PO=0)};draw=async()=>{I.A.clear(),I.A.fillRect(0,0,this.width,this.height,5592405);const t=y.A.model(this.model.id);if(t.Ml(64,850,-30,-50,-30,!0),t.draw(this.model.Hg,d.A.sin[this.WO],d.A.cos[this.WO],d.A.sin[this.YO],d.A.cos[this.YO],this.model.x-this.Fm,this.model.y-this.Nm,this.model.z-this.Bm,0),this.yi){this.yi.ET(this.width,this.yi.height,`FPS: ${this.Ql}`,b.A.Ga);let t=this.yi.height;this.yi.Ba(0,t,`Model: ${this.model.id}`,b.A.Ga),t+=this.yi.height,this.yi.Ba(0,t,'Controls:',b.A.Ga),t+=this.yi.height,this.yi.Ba(0,t,'r - reset camera and model rotation + movement speed',b.A.Ga),t+=this.yi.height,this.yi.Ba(0,t,'1 and 2 - change model',b.A.Ga),t+=this.yi.height,this.yi.Ba(0,t,'[ and ] - adjust movement speed',b.A.Ga),t+=this.yi.height,this.yi.Ba(0,t,'left and right - adjust model yaw',b.A.Ga),t+=this.yi.height,this.yi.Ba(0,t,'up and down - adjust model pitch',b.A.Ga),t+=this.yi.height,this.yi.Ba(0,t,'. and / - adjust model roll',b.A.Ga),t+=this.yi.height,this.yi.Ba(0,t,'w and s - move camera along z axis',b.A.Ga),t+=this.yi.height,this.yi.Ba(0,t,'a and d - move camera along x axis',b.A.Ga),t+=this.yi.height,this.yi.Ba(0,t,'q and e - move camera along y axis',b.A.Ga)}this.xo?.draw(0,0)};VO(){for(;;){const t=this.xc();if(-1===t)break;t==='r'.charCodeAt(0)?(this.HO=2,this.GO=!0):t==='1'.charCodeAt(0)?(this.model.id--,this.model.id<0&&y.A.metadata&&(this.model.id=y.A.metadata.length-100-1),this.GO=!0):t==='2'.charCodeAt(0)&&(this.model.id++,y.A.metadata&&this.model.id>=y.A.metadata.length-100&&(this.model.id=0),this.GO=!0)}}KO(){this.fc['['.charCodeAt(0)]?this.HO--:this.fc[']'.charCodeAt(0)]&&this.HO++,this.fc[1]?(this.model.Hg+=this.HO,this.GO=!0):this.fc[2]&&(this.model.Hg-=this.HO,this.GO=!0),this.fc['w'.charCodeAt(0)]?(this.model.z-=this.HO,this.GO=!0):this.fc['s'.charCodeAt(0)]&&(this.model.z+=this.HO,this.GO=!0),this.fc['a'.charCodeAt(0)]?(this.model.x-=this.HO,this.GO=!0):this.fc['d'.charCodeAt(0)]&&(this.model.x+=this.HO,this.GO=!0),this.fc['q'.charCodeAt(0)]?(this.model.y+=this.HO,this.GO=!0):this.fc['e'.charCodeAt(0)]&&(this.model.y-=this.HO,this.GO=!0),this.WO=2047&this.WO,this.YO=2047&this.YO,this.model.Hg=2047&this.model.Hg}}await(0,R.w)(),(new t).Rc().then((()=>{})),i()}catch(t){i(t)}}),1)},1908:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(9763);class n{static XO=null;static load=async t=>{this.XO=await(0,s.F)(new WebAssembly.Module(t),{env:void 0})};static read=(t,i,e,s)=>{if(!this.XO)throw new Error('bz2 not found!!');return Int8Array.from(this.XO.read(t,i,e,s))}}},123:(t,i,e)=>{function s(t,i){window._tinyMidiPlay&&window._tinyMidiPlay(t,i/256)}function n(){window._tinyMidiStop&&window._tinyMidiStop()}e.d(i,{Xo:()=>s,Ro:()=>n})},9763:(t,i,e)=>{async function s(t,i={}){const e={env:Object.assign(Object.create(globalThis),i.env||{},{abort(t,i,e,s){t=h(t>>>0),i=h(i>>>0),e>>>=0,s>>>=0,(()=>{throw Error(`${t} in ${i}:${e}:${s}`)})()}})},{exports:s}=await WebAssembly.instantiate(t,e),n=s.memory||i.env.memory,r=Object.setPrototypeOf({read:(t,i,e,r)=>(i=function(t,i,e,r,h){if(null==r)return 0;const o=r.length,a=s.__pin(s.__new(o<>>0;if(h)new h(n.buffer,a,o).set(r);else for(let i=0;i>>0),r[i]);return s.__unpin(a),a}(a,6,0,i,Int8Array)||function(){throw TypeError("value must not be null")}(),function(t,i,e){if(!e)return null;const s=function(t){try{return o.getUint32(t,!0)}catch{return o=new DataView(n.buffer),o.getUint32(t,!0)}}(e-4)>>>i,r=new Array(s);for(let n=0;n>>0));return r}(l,0,s.read(t,i,e,r)>>>0))},s);function h(t){if(!t)return null;const i=t+new Uint32Array(n.buffer)[t-4>>>2]>>>1,e=new Uint16Array(n.buffer);let s=t>>>1,r="";for(;i-s>1024;)r+=String.fromCharCode(...e.subarray(s,s+=1024));return r+String.fromCharCode(...e.subarray(s,i))}let o=new DataView(n.buffer);function a(t,i){try{o.setUint8(t,i,!0)}catch{o=new DataView(n.buffer),o.setUint8(t,i,!0)}}function l(t){try{return o.getInt8(t,!0)}catch{return o=new DataView(n.buffer),o.getInt8(t,!0)}}return r}e.d(i,{F:()=>s})},9896:(t,i,e)=>{var s=e(8151);!function(){window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioContext&&(window.audioContext=new window.AudioContext);var t=function(i){if(window.audioContext){var e=window.audioContext.createBuffer(1,1,22050),s=window.audioContext.createBufferSource();s.buffer=e,s.connect(window.audioContext.destination),s.start?s.start(0):s.play?s.play(0):s.noteOn&&s.noteOn(0)}document.removeEventListener('touchstart',t),document.removeEventListener('touchend',t),document.removeEventListener('click',t)};document.addEventListener('touchstart',t),document.addEventListener('touchend',t),document.addEventListener('click',t)}(),(async()=>{let t=new Float32Array,i=window.audioContext.createGain();i.gain.value=.1,i.connect(window.audioContext.destination);let e=window.audioContext.currentTime,n=[];const r=new s.A({jO:30,zO:i=>{let e=new Float32Array(i.buffer),s=new Float32Array(t.length+e.length);s.set(t,0),s.set(e,t.length),t=s},ZO:t=>{},bufferSize:102400});await r.init();const h=await fetch('./SCC1_Florestan.sf2'),o=new Uint8Array(await h.arrayBuffer());function a(){if(!window.audioContext||!t.length)return;let s=window.audioContext.createBufferSource();const r=t.length/2,h=window.audioContext.createBuffer(2,r,44100);for(let i=0;i<2;i++){const e=h.getChannelData(i);let s=i;for(let i=0;i{if(l&&clearInterval(l),t=new Float32Array,n.length){let t=i.gain.value;i.gain.value=0,n.forEach((t=>{t.stop(window.audioContext.currentTime)})),n=[],i.gain.value=t}},window._tinyMidiVolume=(t=1)=>{i.gain.value=t},window._tinyMidiPlay=async(t,i=1)=>{t&&(await window._tinyMidiStop(),-1!=i&&window._tinyMidiVolume(i),e=window.audioContext.currentTime,l=setInterval(a,250),r.$O(t))}})()},8151:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5473);const n=class{constructor(t={}){this.JO=void 0,this.QO=0,this.tL=0,this.iL=0,this.jO=t.jO||100,this.sampleRate=t.sampleRate||44100,this.eL=t.eL||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.sL(1),this.zO=t.zO||(()=>{}),this.ZO=t.ZO||(()=>{}),this.nL=void 0,this.test=0}async init(){if(!this.JO){if('undefined'!=typeof process){const{rL:t}=await import('path'),{hL:i}=await import('module');globalThis.__dirname=t("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js"),globalThis.require=i("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js")}this.JO=await(0,s.A)(),this.oL=this.JO._malloc(this.bufferSize),this.aL=this.JO._malloc(8)}}sL(t){this.bufferSize=4*this.sampleRate*this.eL*t}lL(){if(!this.JO)throw new Error(`${this.constructor.name} not initalized. call .init()`)}qO(t){this.lL();const{_malloc:i,_free:e,_tsf_load_memory:s,_tsf_set_output:n,_tsf_channel_set_bank_preset:r,_tsf_set_max_voices:h,_tsf_channel_set_presetnumber:o}=this.JO;e(this.QO),this.QO=i(t.length),this.JO.HEAPU8.set(t,this.QO),this.tL=s(this.QO,t.length),n(this.tL,2===this.eL?0:2,this.sampleRate,this.gain)}cL(){this.lL();const t=new Uint8Array(this.bufferSize);return t.set(this.JO.HEAPU8.subarray(this.oL,this.oL+this.bufferSize)),t}fL(t){const{_malloc:i,_free:e,_tml_load_memory:s}=this.JO;return e(this.iL),this.iL=i(t.length),this.JO.HEAPU8.set(t,this.iL),s(this.iL,t.length)}uL(t){const{_midi_render:i}=this.JO;return i(this.tL,t,this.eL,this.sampleRate,this.oL,this.bufferSize,this.aL)}$O(t){if(this.lL(),!this.tL)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.nL);const{setValue:i,getValue:e}=this.JO;i(this.aL,0,'double'),this.JO._tsf_reset(this.tL),this.JO._tsf_channel_set_bank_preset(this.tL,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let s=this.fL(t);const n=()=>{s=this.uL(s);const t=this.cL();this.zO(t),s?this.nL=setTimeout(n,this.jO):this.ZO(e(this.aL,'double'))};this.nL=setTimeout(n,16)}}},8227:(t,i,e)=>{t.exports=e.p+"9f86b5397894e28b5ae2.wasm"},5473:(t,i,e)=>{var s;e.d(i,{A:()=>n});const n=(s="file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/tinymidipcm.mjs",function(t){var i,n,r=void 0!==(t=t||{})?t:{};r.ready=new Promise((function(t,e){i=t,n=e})),["_tsf_load_memory","_tsf_set_output","_tsf_channel_set_bank_preset","_tsf_set_max_voices","_tsf_channel_set_presetnumber","_tsf_reset","_tsf_close","_tml_load_memory","_midi_render","_malloc","_realloc","_free","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(r.ready,t)||Object.defineProperty(r.ready,t,{get:()=>j('You are getting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),set:()=>j('You are setting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js')})}));var h=Object.assign({},r),o=[],a='object'==typeof window,l='function'==typeof importScripts,c='object'==typeof process&&'object'==typeof process.versions&&'string'==typeof process.versions.node,f=!a&&!c&&!l;if(r.ENVIRONMENT)throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');var u,d,w,y='';if(c){if('undefined'==typeof process||!process.release||'node'!==process.release.name)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');var A,m;y=l?require('path').rL(y)+'/':__dirname+'/';var p=()=>{m||(A=require('fs'),m=require('path'))};u=(t,i)=>(p(),t=m.normalize(t),A.dL(t,i?void 0:'utf8')),w=t=>{var i=u(t,!0);return i.buffer||(i=new Uint8Array(i)),D(i.buffer),i},d=(t,i,e)=>{p(),t=m.normalize(t),A.wL(t,(function(t,s){t?e(t):i(s.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,'/'),o=process.argv.slice(2),process.on('uncaughtException',(function(t){if(!(t instanceof nt))throw t})),process.on('unhandledRejection',(function(t){throw t})),r.inspect=function(){return'[Emscripten Module object]'}}else if(f){if('object'==typeof process&&'function'==typeof require||'object'==typeof window||'function'==typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');'undefined'!=typeof read&&(u=function(t){return read(t)}),w=function(t){let i;return'function'==typeof readbuffer?new Uint8Array(readbuffer(t)):(i=read(t,'binary'),D('object'==typeof i),i)},d=function(t,i,e){setTimeout((()=>i(w(t))),0)},'undefined'!=typeof scriptArgs?o=scriptArgs:void 0!==arguments&&(o=arguments),'undefined'!=typeof print&&('undefined'==typeof console&&(console={}),console.log=print,console.warn=console.error='undefined'!=typeof printErr?printErr:print)}else{if(!a&&!l)throw new Error('environment detection error');if(l?y=self.location.href:'undefined'!=typeof document&&document.currentScript&&(y=document.currentScript.src),s&&(y=s),y=0!==y.indexOf('blob:')?y.substr(0,y.replace(/[?#].*/,"").lastIndexOf('/')+1):'','object'!=typeof window&&'function'!=typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');u=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.send(null),i.responseText},l&&(w=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.responseType='arraybuffer',i.send(null),new Uint8Array(i.response)}),d=(t,i,e)=>{var s=new XMLHttpRequest;s.open('GET',t,!0),s.responseType='arraybuffer',s.onload=()=>{200==s.status||0==s.status&&s.response?i(s.response):e()},s.onerror=e,s.send(null)}}r.print||console.log.bind(console);var g,I,_=r.printErr||console.warn.bind(console);function C(t,i){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){j('Module.'+t+' has been replaced with plain '+i+' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')}})}function E(t){return'FS_createPath'===t||'FS_createDataFile'===t||'FS_createPreloadedFile'===t||'FS_unlink'===t||'addRunDependency'===t||'FS_createLazyFile'===t||'FS_createDevice'===t||'removeRunDependency'===t}Object.assign(r,h),h=null,g='fetchSettings',Object.getOwnPropertyDescriptor(r,g)&&j('`Module.'+g+'` was supplied but `'+g+'` not included in INCOMING_MODULE_JS_API'),r.arguments&&(o=r.arguments),C('arguments','arguments_'),r.thisProgram&&r.thisProgram,C('thisProgram','thisProgram'),r.quit&&r.quit,C('quit','quit_'),D(void 0===r.memoryInitializerPrefixURL,'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.pthreadMainPrefixURL,'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.cdInitializerPrefixURL,'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.filePackagePrefixURL,'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.read,'Module.read option was removed (modify read_ in JS)'),D(void 0===r.readAsync,'Module.readAsync option was removed (modify readAsync in JS)'),D(void 0===r.readBinary,'Module.readBinary option was removed (modify readBinary in JS)'),D(void 0===r.setWindowTitle,'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'),D(void 0===r.TOTAL_MEMORY,'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'),C('read','read_'),C('readAsync','readAsync'),C('readBinary','readBinary'),C('setWindowTitle','setWindowTitle'),D(!f,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),r.wasmBinary&&(I=r.wasmBinary),C('wasmBinary','wasmBinary');var v;r.noExitRuntime;C('noExitRuntime','noExitRuntime'),'object'!=typeof WebAssembly&&j('no native wasm support detected');var b,T,R,O,L,S,x,k,M=!1;function D(t,i){t||j('Assertion failed'+(i?': '+i:''))}function F(t){b=t,r.HEAP8=T=new Int8Array(t),r.HEAP16=O=new Int16Array(t),r.HEAP32=L=new Int32Array(t),r.HEAPU8=R=new Uint8Array(t),r.HEAPU16=new Uint16Array(t),r.HEAPU32=S=new Uint32Array(t),r.HEAPF32=x=new Float32Array(t),r.HEAPF64=k=new Float64Array(t)}'undefined'!=typeof TextDecoder&&new TextDecoder('utf8');var N=5242880;r.TOTAL_STACK&&D(N===r.TOTAL_STACK,'the stack size can no longer be determined at runtime');var B=r.INITIAL_MEMORY||16777216;function U(){if(!M){var t=ft(),i=S[t>>2],e=S[t+4>>2];34821223==i&&2310721022==e||j('Stack overflow! Stack cookie has been overwritten at 0x'+t.toString(16)+', expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+e.toString(16)+' 0x'+i.toString(16)),1668509029!==S[0]&&j('Runtime error: The application has corrupted its heap memory area (address zero)!')}}C('INITIAL_MEMORY','INITIAL_MEMORY'),D(B>=N,'INITIAL_MEMORY should be larger than TOTAL_STACK, was '+B+'! (TOTAL_STACK='+N+')'),D('undefined'!=typeof Int32Array&&'undefined'!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,'JS engine does not provide full typed array support'),D(!r.wasmMemory,'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'),D(16777216==B,'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'),function(){var t=new Int16Array(1),i=new Int8Array(t.buffer);if(t[0]=25459,115!==i[0]||99!==i[1])throw'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'}();var P=[],G=[],W=[],Y=!1;D(Math.imul,'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.fround,'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.clz32,'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.trunc,'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');var H=0,V=null,K=null,X={};function j(t){r.onAbort&&r.onAbort(t),_(t='Aborted('+t+')'),M=!0;var i=new WebAssembly.RuntimeError(t);throw n(i),i}var z={error:function(){j('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM')},init:function(){z.error()},yL:function(){z.error()},AL:function(){z.error()},mL:function(){z.error()},open:function(){z.error()},pL:function(){z.error()},gL:function(){z.error()},IL:function(){z.error()},_L:function(){z.error()},CL:function(){z.error()}};r.FS_createDataFile=z.yL,r.FS_createPreloadedFile=z.AL;var Z,q,$,J,Q='data:application/octet-stream;base64,';function tt(t){return t.startsWith(Q)}function it(t){return t.startsWith('file://')}function et(t,i){return function(){var e=t,s=i;return i||(s=r.asm),D(Y,'native function `'+e+'` called before runtime initialization'),s[t]||D(s[t],'exported native function `'+e+'` not found'),s[t].apply(null,arguments)}}function st(t){try{if(t==Z&&I)return new Uint8Array(I);if(w)return w(t);throw"both async and sync fetching of the wasm failed"}catch(t){j(t)}}function nt(t){this.name='ExitStatus',this.message='Program terminated with exit('+t+')',this.status=t}function rt(t){for(;t.length>0;)t.shift()(r)}function ht(t){ht.EL||(ht.EL={}),ht.EL[t]||(ht.EL[t]=1,c&&(t='warning: '+t),_(t))}function ot(t){try{return v.vL(t-b.byteLength+65535>>>16),F(v.buffer),1}catch(i){_('emscripten_realloc_buffer: Attempted to grow heap from '+b.byteLength+' bytes to '+t+' bytes, but got error: '+i)}}r.locateFile?tt(Z='tinymidipcm.wasm')||(q=Z,Z=r.locateFile?r.locateFile(q,y):y+q):Z=new URL(e(8227),e.b).toString();var at,lt={"emscripten_memcpy_big":function(t,i,e){R.copyWithin(t,i,i+e)},"emscripten_resize_heap":function(t){var i=R.length;D((t>>>=0)>i);var e,s,n=2147483648;if(t>n)return _('Cannot enlarge memory, asked to go up to '+t+' bytes, but the limit is '+n+' bytes!'),!1;for(var r=1;r<=4;r*=2){var h=i*(1+.2/r);h=Math.min(h,t+100663296);var o=Math.min(n,(e=Math.max(t,h))+((s=65536)-e%s)%s);if(ot(o))return!0}return _('Failed to grow the heap from '+i+' bytes to '+o+' bytes, not enough memory!'),!1}},ct=(function(){var t,i={'env':lt,'wasi_snapshot_preview1':lt};function e(t,i){var e,s=t.exports;r.asm=s,D(v=r.asm.memory,"memory not found in wasm exports"),F(v.buffer),D(r.asm.__indirect_function_table,"table not found in wasm exports"),e=r.asm.__wasm_call_ctors,G.unshift(e),function(t){if(H--,r.monitorRunDependencies&&r.monitorRunDependencies(H),t?(D(X[t]),delete X[t]):_('warning: run dependency removed without ID'),0==H&&(null!==V&&(clearInterval(V),V=null),K)){var i=K;K=null,i()}}('wasm-instantiate')}t='wasm-instantiate',H++,r.monitorRunDependencies&&r.monitorRunDependencies(H),t?(D(!X[t]),X[t]=1,null===V&&'undefined'!=typeof setInterval&&(V=setInterval((function(){if(M)return clearInterval(V),void(V=null);var t=!1;for(var i in X)t||(t=!0,_('still waiting on run dependencies:')),_('dependency: '+i);t&&_('(end of list)')}),1e4))):_('warning: run dependency added without ID');var s=r;function h(t){D(r===s,'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'),s=null,e(t.instance)}function o(t){return function(){if(!I&&(a||l)){if('function'==typeof fetch&&!it(Z))return fetch(Z,{credentials:'same-origin'}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+Z+"'";return t.arrayBuffer()})).catch((function(){return st(Z)}));if(d)return new Promise((function(t,i){d(Z,(function(i){t(new Uint8Array(i))}),i)}))}return Promise.resolve().then((function(){return st(Z)}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){_('failed to asynchronously prepare wasm: '+t),it(Z)&&_('warning: Loading from a file URI ('+Z+') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing'),j(t)}))}if(r.instantiateWasm)try{return r.instantiateWasm(i,e)}catch(t){_('Module.instantiateWasm callback failed with error: '+t),n(t)}(I||'function'!=typeof WebAssembly.instantiateStreaming||tt(Z)||it(Z)||c||'function'!=typeof fetch?o(h):fetch(Z,{credentials:'same-origin'}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(h,(function(t){return _('wasm streaming compile failed: '+t),_('falling back to ArrayBuffer instantiation'),o(h)}))}))).catch(n)}(),r.___wasm_call_ctors=et("__wasm_call_ctors"),r._malloc=et("malloc"),r._free=et("free"),r._tsf_load_memory=et("tsf_load_memory"),r._tsf_close=et("tsf_close"),r._tsf_reset=et("tsf_reset"),r._tsf_set_output=et("tsf_set_output"),r._tsf_set_max_voices=et("tsf_set_max_voices"),r._realloc=et("realloc"),r._tsf_channel_set_presetnumber=et("tsf_channel_set_presetnumber"),r._tsf_channel_set_bank_preset=et("tsf_channel_set_bank_preset"),r._tml_load_memory=et("tml_load_memory"),r._midi_render=et("midi_render"),r.___errno_location=et("__errno_location"),r._fflush=et("fflush"),r._emscripten_stack_init=function(){return(ct=r._emscripten_stack_init=r.asm.emscripten_stack_init).apply(null,arguments)}),ft=(r._emscripten_stack_get_free=function(){return(r._emscripten_stack_get_free=r.asm.emscripten_stack_get_free).apply(null,arguments)},r._emscripten_stack_get_base=function(){return(r._emscripten_stack_get_base=r.asm.emscripten_stack_get_base).apply(null,arguments)},r._emscripten_stack_get_end=function(){return(ft=r._emscripten_stack_get_end=r.asm.emscripten_stack_get_end).apply(null,arguments)});function ut(){var t;ct(),D(!(3&(t=ft()))),S[t>>2]=34821223,S[t+4>>2]=2310721022,S[0]=1668509029}function dt(t){function e(){at||(at=!0,r.calledRun=!0,M||(D(!Y),Y=!0,U(),rt(G),i(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),D(!r._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(U(),r.postRun)for('function'==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)t=r.postRun.shift(),W.unshift(t);var t;rt(W)}()))}t=t||o,H>0||(ut(),function(){if(r.preRun)for('function'==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)t=r.preRun.shift(),P.unshift(t);var t;rt(P)}(),H>0||(r.setStatus?(r.setStatus('Running...'),setTimeout((function(){setTimeout((function(){r.setStatus('')}),1),e()}),1)):e(),U()))}if(r.stackSave=et("stackSave"),r.stackRestore=et("stackRestore"),r.stackAlloc=et("stackAlloc"),r.setValue=function(t,i,e="i8"){switch(e.endsWith('*')&&(e='*'),e){case'i1':case'i8':T[0|t]=i;break;case'i16':O[t>>1]=i;break;case'i32':L[t>>2]=i;break;case'i64':J=[i>>>0,($=i,+Math.abs($)>=1?$>0?(0|Math.min(+Math.floor($/4294967296),4294967295))>>>0:~~+Math.ceil(($-+(~~$>>>0))/4294967296)>>>0:0)],L[t>>2]=J[0],L[t+4>>2]=J[1];break;case'float':x[t>>2]=i;break;case'double':k[t>>3]=i;break;case'*':S[t>>2]=i;break;default:j('invalid type for setValue: '+e)}},r.getValue=function(t,i="i8"){switch(i.endsWith('*')&&(i='*'),i){case'i1':case'i8':return T[0|t];case'i16':return O[t>>1];case'i32':case'i64':return L[t>>2];case'float':return x[t>>2];case'double':return k[t>>3];case'*':return S[t>>2];default:j('invalid type for getValue: '+i)}return null},['run','UTF8ArrayToString','UTF8ToString','stringToUTF8Array','stringToUTF8','lengthBytesUTF8','addOnPreRun','addOnInit','addOnPreMain','addOnExit','addOnPostRun','addRunDependency','removeRunDependency','FS_createFolder','FS_createPath','FS_createDataFile','FS_createPreloadedFile','FS_createLazyFile','FS_createLink','FS_createDevice','FS_unlink','getLEB','getFunctionTables','alignFunctionTables','registerFunctions','prettyPrint','getCompilerSetting','print','printErr','callMain','abort','keepRuntimeAlive','wasmMemory','stackAlloc','stackSave','stackRestore','getTempRet0','setTempRet0','writeStackCookie','checkStackCookie','ptrToString','zeroMemory','stringToNewUTF8','exitJS','getHeapMax','emscripten_realloc_buffer','ENV','ERRNO_CODES','ERRNO_MESSAGES','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','DNS','getHostByName','Protocols','Sockets','getRandomDevice','warnOnce','traverseStack','UNWIND_CACHE','convertPCtoSourceLocation','readAsmConstArgsArray','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','handleException','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','freeTableIndexes','functionsInTableMap','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','PATH','PATH_FS','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16Decoder','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeArrayToMemory','writeAsciiToMemory','SYSCALLS','getSocketFromFD','getSocketAddress','JSEvents','registerKeyEventCallback','specialHTMLTargets','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','currentFullscreenStrategy','restoreOldWindowedStyle','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','demangle','demangleAll','jsStackTrace','stackTrace','ExitStatus','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','dlopenMissingError','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','uncaughtExceptionCount','exceptionLast','exceptionCaught','ExceptionInfo','exception_addRef','exception_decRef','Browser','setMainLoop','wget','FS','MEMFS','TTY','PIPEFS','SOCKFS','_setNetworkCallback','tempFixedLengthArray','miniTempWebGLFloatBuffers','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','GL','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','AL','SDL_unicode','SDL_ttfContext','SDL_audio','SDL','SDL_gfx','GLUT','EGL','GLFW_Window','GLFW','GLEW','IDBStore','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){var i="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),j(i)}})})),['ptrToString','zeroMemory','stringToNewUTF8','exitJS','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','getHostByName','getRandomDevice','traverseStack','convertPCtoSourceLocation','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeAsciiToMemory','getSocketFromFD','getSocketAddress','registerKeyEventCallback','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','ExceptionInfo','exception_addRef','exception_decRef','setMainLoop','_setNetworkCallback','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','SDL_unicode','SDL_ttfContext','SDL_audio','GLFW_Window','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){'undefined'==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var i='`'+t+'` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line';E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),ht(i)}})})),K=function t(){at||dt(),at||(K=t)},r.preInit)for('function'==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return dt(),t.ready})}},r={};function h(t){var i=r[t];if(void 0!==i)return i.exports;var e=r[t]={exports:{}};return n[t](e,e.exports,h),e.exports}h.m=n,t="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",i="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",e="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",s=t=>{t&&t.d<1&&(t.d=1,t.forEach((t=>t.r--)),t.forEach((t=>t.r--?t.r++:t())))},h.a=(n,r,h)=>{var o;h&&((o=[]).d=-1);var a,l,c,f=new Set,u=n.exports,d=new Promise(((t,i)=>{c=i,l=t}));d[i]=u,d[t]=t=>(o&&t(o),f.forEach(t),d.catch((t=>{}))),n.exports=d,r((n=>{var r;a=(n=>n.map((n=>{if(null!==n&&"object"==typeof n){if(n[t])return n;if(n.then){var r=[];r.d=0,n.then((t=>{h[i]=t,s(r)}),(t=>{h[e]=t,s(r)}));var h={};return h[t]=t=>t(r),h}}var o={};return o[t]=t=>{},o[i]=n,o})))(n);var h=()=>a.map((t=>{if(t[e])throw t[e];return t[i]})),l=new Promise((i=>{(r=()=>i(h)).r=0;var e=t=>t!==o&&!f.has(t)&&(f.add(t),t&&!t.d&&(r.r++,t.push(r)));a.map((i=>i[t](e)))}));return r.r?l:h()}),(t=>(t?c(d[e]=t):l(u),s(o)))),o&&o.d<0&&(o.d=0)},h.d=(t,i)=>{for(var e in i)h.o(i,e)&&!h.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:i[e]})},h.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),h.p="/Client2/",h.b=document.baseURI||self.location.href;h(8073)})(); \ No newline at end of file +(()=>{"use strict";var t,i,e,s,n={1651:(t,i,e)=>{e.d(i,{K:()=>k});var s=e(1120),n=e(4583),r=e(2901),h=e(1069),o=e(7046),a=(e(9896),e(6666)),l=e(3045),c=e(818),f=e(670),u=e(8268),d=e(3867),w=e(7854),y=e(8950),A=e(1302),m=e(9298),p=e(8665),g=e(1312),I=e(3819),_=e(8317),C=e(9234),E=e(1908),v=e(123),b=e(5637),T=e(6948),R=e(2164),O=e(8738),L=e(3764),S=e(8534),x=e(6730);class k extends o.A{static tt=225;static it=10;static portOffset=0;static members=!0;static et=!1;static st='';static nt='';static rt=!1;static ht=2;static ot=!1;static lt='https://raw.githubusercontent.com/2004scape/Server/main';static exponent=58778699976184461502525193738213253649000149147835990136706041084440742975821n;static ct=7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789n;static ft=0;static ut=0;static dt=0;static wt=0;static yt=0;static At=0;static gt=0;static It=0;static _t=0;static Ct=0;static Et=0;static vt=0;static bt=0;static Tt=0;static Rt=0;static Ot=()=>{l.A.et=!1,n.A.et=!1,k.et=!1,c.A.et=!1};static Lt=()=>{l.A.et=!0,n.A.et=!0,k.et=!0,c.A.et=!0};St=2048;xt=2047;kt=!1;Mt=!1;Dt=!1;Nt=!1;db=null;Ft=0;Bt=[];stream=null;in=h.A.Ut(1);Pt=h.A.Ut(1);Gt=h.A.Ut(1);Wt=0n;Yt=0;Ht=0;Vt=0;Kt=null;Xt=0;packetSize=0;jt=0;zt=0;Zt=0;qt=null;$t=!0;Jt=0;Qt=0;ti=null;ii=null;ei=null;si=null;ni=null;ri=null;hi=null;oi=null;ai=null;li=null;ci=null;fi='';ui='';username='';password='';di=null;wi=null;yi=null;Ai=null;mi=[];pi=!1;gi=null;Ii=null;_i=null;Ci=null;Ei=null;vi=null;bi=null;Ti=null;Ri=null;Oi=null;Li=new Int32Array(256);Si=0;xi=0;ki=0;Mi=null;Di=null;Ni=null;Fi=null;Bi=null;Ui=null;Pi=null;Gi=null;Wi=null;Yi=null;Hi=null;Vi=null;Ki=null;Xi=null;ji=null;zi=null;Zi=null;qi=null;$i=null;Ji=null;Qi=null;te=new Int32Array(33);ie=new Int32Array(33);ee=new Int32Array(151);se=new Int32Array(151);ne=null;re=null;he=null;oe=null;ae=null;le=null;ce=new d.fe(13,null);ue=null;de=null;we=new d.fe(50,null);ye=new d.fe(50,null);Ae=new d.fe(20,null);me=new d.fe(20,null);pe=null;ge=new d.fe(8,null);Ie=null;_e=null;Ce=null;Ee=null;ve=null;be=null;Te=null;Re=null;Oe=null;Le=null;Se=null;xe=null;ke=null;Me=null;De=null;Ne=null;Fe=null;Be=null;Ue=new d.fe(1e3,null);Pe=!1;Ge=!1;We=!1;Ye=!1;He=-1;Ve=0;Ke=0;Xe=0;je=0;ze=0;Ze=0;qe=!1;$e=0;Je=0;Qe=0;ts=0;es=0;ss=0;ns=[];rs=-1;hs=-1;os=new s.A;ls=78;cs=0;fs=0;us=[];ds=0;ws=0;ys=0;As=0;ps=0;gs=0;Is=0;_s=0;Cs=[];Es=[];vs=[];bs=[];Ts=null;Rs=-1;Os=3;Ls=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];Ss=0;xs=0;ks=0;Ms=!1;Ds=0;Ns=!1;Fs='';Bs='';Us=0;Ps='';Gs=!1;Ws=-1;Ys=new d.fe(100,null);Hs=new d.fe(100,null);messageType=new Int32Array(100);Vs=new Int32Array(100);Ks=0;Xs=0;js=0;zs='';Zs=0;qs=0;$s=0;Js=0;Qs=0;tn=0;en=0;sn=0;nn=0;rn=!1;hn=0;an=0;ln=0;cn=0;fn=null;un=0;dn=0;wn=0;yn=0;An=!1;mn=[];pn=[];gn=0;In=0;_n=0;Cn=null;En=0;vn=new Int32Array(500);bn=new Int32Array(500);Tn=new Int32Array(500);Rn=new Int32Array(500);On=0;Ln=0;Sn=0;xn='';kn=!1;Mn=-1;Dn=0;Nn=0;Fn=0;Bn=0;Un=0;Pn=new Int32Array(1e3);Gn=new Int32Array(1e3);Wn=null;Yn=0;Hn=0;Vn=0;Kn=0;Xn=0;jn=!1;zn=0;Zn=0;qn=0;$n=0;Jn=2;Qn=2;tr=1;ir=new Int32Array(5);er=new d.fe(5,!1);sr=new Int32Array(5);nr=new Int32Array(5);rr=new Int32Array(5);hr=0;ar=0;lr=0;cr=0;ur=0;dr=0;wr=0;yr=0;Ar=0;mr=1;pr=2;gr=-1;Ir=0;_r=0;Cr=0;Er=0;vr=0;br=0;Tr=null;Rr=null;Or=null;Lr=0;Sr=0;kr=new Int8Array(16384);Mr=new d.fe(f.A.Dr,null);Nr=0;Fr=0;Br=128;Ur=0;Pr=0;Gr=0;Wr=0;Yr=0;Hr=null;Vr=null;Kr=new d.Xr(f.A.jr,f.A.jr);zr=0;Zr=0;qr=0;$r=0;Jr=0;Qr=0;th=0;ih=0;eh=0;sh=0;nh=0;rh=0;hh=new d.fe(this.St,null);oh=0;ah=new Int32Array(this.St);lh=0;fh=0;uh=new Int32Array(this.St);dh=new Int32Array(1e3);wh=new d.fe(this.St,null);yh=new d.fe(8192,null);Ah=0;mh=new Int32Array(8192);ph=new a.A;gh=new a.A;Ih=new a.A;_h=new a.A;Ch=new d.Eh(f.A.Dr,f.A.jr,f.A.jr,null);bh=new a.A;Th=new Int32Array(4e3);Rh=new Int32Array(4e3);Oh=new Int32Array(f.A.jr*f.A.jr);Lh=new Int32Array(f.A.jr*f.A.jr);Sh=0;xh=null;kh=0;Mh=0;Dh=-1;Nh=0;Fh=0;Bh=0;Uh=0;Ph=!1;Gh=!0;Wh=!1;Yh=new Int32Array(7);Hh=new Int32Array(5);Vh=0;Kh=0;static Xh=50;jh=new Int32Array(k.Xh);zh=new Int32Array(k.Xh);Zh=new Int32Array(k.Xh);qh=new Int32Array(k.Xh);$h=new Int32Array(k.Xh);Jh=new Int32Array(k.Xh);Qh=new Int32Array(k.Xh);io=new d.fe(k.Xh,null);eo=new d.fe(100,null);so=new BigInt64Array(100);no=new Int32Array(100);ro=null;ho=0;oo=!0;ao=new Int32Array(50);lo=new Int32Array(50);co=new Int32Array(50);fo=192;uo=-1;do=-1;wo=0;yo=0;Ao=0;mo=!0;po=null;Io=0;_o=0;Co=192;Eo=new d.fe(16,null);vo=0;bo=!1;To=()=>{try{this.stream&&this.stream.close()}catch(t){}this.stream=null,(0,v.Ro)(),this.Pt=null,this.Gt=null,this.in=null,this.Or=null,this.Tr=null,this.Rr=null,this.Hr=null,this.Vr=null,this.Wn=null,this.Mr=null,this.Oh=null,this.Lh=null,this.Th=null,this.Rh=null,this.kr=null,this.Di=null,this.Ni=null,this.Fi=null,this.Bi=null,this.Ui=null,this.Pi=null,this.Gi=null,this.Wi=null,this.Yi=null,this.Hi=null,this.Vi=null,this.Ki=null,this.Xi=null,this.ji=null,this.zi=null,this.Zi=null,this.qi=null,this.ne=null,this.he=null,this.re=null,this.oe=null,this.ae=null,this.le=null,this.ce=null,this.Te=null,this.Re=null,this.Oe=null,this.Le=null,this.Se=null,this.xe=null,this.ke=null,this.Me=null,this.De=null,this.Ne=null,this.de=null,this.Ae=null,this.me=null,this.ge=null,this.Ie=null,this._e=null,this.Ce=null,this.Ee=null,this.we=null,this.ye=null,this.Kr=null,this.hh=null,this.ah=null,this.uh=null,this.wh=null,this.dh=null,this.yh=null,this.mh=null,this.Ch=null,this.bh=null,this._h=null,this.ph=null,this.gh=null,this.Ih=null,this.Tn=null,this.Rn=null,this.vn=null,this.bn=null,this.ns=null,this.mn=null,this.Pn=null,this.Gn=null,this.Ue=null,this.ue=null,this.eo=null,this.so=null,this.no=null,this.si=null,this.ni=null,this.ti=null,this.ii=null,this.ei=null,this.ri=null,this.hi=null,this.oi=null,this.ai=null,this.Oo(),b.A.To(),T.A.To(),A.A.To(),R.A.Lo=null,_.A.Lo=null,s.A.Lo=null,g.A.Lo=null,O.A.Lo=null,O.A.So=null,L.A.Lo=null,this.xo=null,u.A.So=null,n.A.To(),l.A.To(),p.A.To(),S.A.Lo=[],x.A.Lo=[]};ko(){return this.Jt}Mo(){return this.Gs}Do(){return this.Ns}No(){return this.hs}Fo(){return this.He}Oo=()=>{this.pi=!1,this.Mi&&(clearInterval(this.Mi),this.Mi=null),this.li=null,this.ci=null,this.mi=[],this.bi=null,this.Ti=null,this.Ri=null,this.Oi=null,this.Ci=null,this._i=null,this.Ei=null,this.vi=null,this.gi=null,this.Ii=null};Bo=async(t,i,e,s)=>{let n=5,o=await(this.db?.Uo(t));if(o&&h.A.Po(o)!==e&&(o=void 0),o)return new r.A(o);for(;!o;){await this.Go(s,`Requesting ${i}`);try{o=await(0,C.Wo)(`${k.nt}/${t}${e}`)}catch(t){o=void 0;for(let t=n;t>0;t--)await this.Go(s,`Error loading - Will retry in ${t} secs.`),await(0,C.Yo)(1e3);n*=2,n>60&&(n=60)}}return await(this.db?.Ho(t,o)),new r.A(o)};Vo=async(t,i,e)=>{let s=await(this.db?.Uo(t+'.mid'));if(s&&12345678!==i&&h.A.Po(s)!==i&&(s=void 0),!s)try{s=await(0,C.Wo)(`${k.nt}/${t}_${i}.mid`),e!==s.length&&(s=s.slice(0,e))}catch(t){}if(!s)return;await(this.db?.Ho(t+'.mid',s));const n=new h.A(Uint8Array.from(s)).Ko,r=E.A.read(n,s,e,4);(0,v.Xo)(r,this.Co)};jo=()=>{if(w.zo.fillStyle='black',w.zo.fillRect(0,0,this.width,this.height),this.Zo(1),this.Dt){this.pi=!1,w.zo.font='bold 16px helvetica, sans-serif',w.zo.textAlign='left',w.zo.fillStyle='yellow';let t=35;w.zo.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,w.zo.fillStyle='white',w.zo.fillText('To fix this try the following (in order):',30,t),t+=50,w.zo.font='bold 12px helvetica, sans-serif',w.zo.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.zo.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,w.zo.fillText('3: Try using a different game-world',30,t),t+=30,w.zo.fillText('4: Try rebooting your computer',30,t),t+=30,w.zo.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.Nt&&(this.pi=!1,w.zo.font='bold 20px helvetica, sans-serif',w.zo.textAlign='left',w.zo.fillStyle='white',w.zo.fillText('Error - unable to load game!',50,50),w.zo.fillText('To play RuneScape make sure you play from',50,100),w.zo.fillText('https://2004scape.org',50,150)),this.Mt){this.pi=!1,w.zo.font='bold 13px helvetica, sans-serif',w.zo.textAlign='left',w.zo.fillStyle='yellow';let t=35;w.zo.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,w.zo.fillStyle='white',w.zo.fillText('To fix this try the following (in order):',30,t),t+=50,w.zo.font='bold 12px helvetica, sans-serif',w.zo.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.zo.fillText('2: Try rebooting your computer, and reloading',30,t)}};qo=t=>{if(!t.$o)return!1;for(let i=0;i=s)return!1}else if(3===t.$o[i]){if(e<=s)return!1}else if(4===t.$o[i]){if(e===s)return!1}else if(e!==s)return!1}return!0};ta=(t,i,e,s,n)=>{this.ve?.draw(t,i),this.be?.draw(t,i+n-16),y.A.fillRect(t,i+16,16,n-32,m.A.ia);let r=(n-32)*n/s|0;r<8&&(r=8);const h=(n-r-32)*e/(s-n)|0;y.A.fillRect(t,i+h+16,16,r,m.A.ea),y.A.sa(t,i+h+16,m.A.na,r),y.A.sa(t+1,i+h+16,m.A.na,r),y.A.ra(t,i+h+16,m.A.na,16),y.A.ra(t,i+h+17,m.A.na,16),y.A.sa(t+15,i+h+16,m.A.ha,r),y.A.sa(t+14,i+h+17,m.A.ha,r-1),y.A.ra(t,i+h+r+15,m.A.ha,16),y.A.ra(t+1,i+h+r+14,m.A.ha,15)};oa=(t,i)=>{let e=!1;const n=s.A.Lo[t];if(!n.aa)return!1;for(let t=0;ts.delay[r.ua];)r.fa-=s.delay[r.ua]+1,r.ua++,r.ua>=s.da&&(r.ua-=s.wa,(r.ua<0||r.ua>=s.da)&&(r.ua=0)),e=!0}}}return e};ya=(t,i,e,r,h=!1)=>{if(0!==t.type||!t.aa||t.hide&&this.Zs!==t.id&&this.qs!==t.id&&this.$s!==t.id)return;const o=y.A.left,a=y.A.top,l=y.A.right,c=y.A.bottom;y.A.Aa(i,e,i+t.width,e+t.height);const f=t.aa.length;for(let o=0;o0&&this.Ca(c),c.type===s.A.Ea)c.va>c.scroll-c.height&&(c.va=c.scroll-c.height),c.va<0&&(c.va=0),this.ya(c,a,l,c.va,h),c.scroll>c.height&&this.ta(a+c.width,l,c.va,c.scroll,c.height);else if(c.type===s.A.ba){let t=0;for(let i=0;i0){let i=0,e=0;const r=c.Oa[t]-1;if(s>=-32&&s<=512&&n>=-32&&n<=334||0!==this.tn&&this.Qs===t){const h=A.A.ka(r,c.La[t]);if(0!==this.tn&&this.Qs===t&&this.Js===c.id?(i=this.Ma-this.en,e=this.Da-this.sn,i<5&&i>-5&&(i=0),e<5&&e>-5&&(e=0),this.nn<5&&(i=0,e=0),h.Na(128,s+i,n+e)):0!==this.un&&this.dn===t&&this.wn===c.id?h.Na(128,s,n):h.draw(s,n),33===h.Fa||1!==c.La[t]){const r=c.La[t];this.di?.Ba(s+i+1,n+10+e,this.Ua(r),m.A.Pa),this.di?.Ba(s+i,n+9+e,this.Ua(r),m.A.Ga)}}}else if(c.Wa&&t<20){const i=c.Wa[t];i?.draw(s,n)}t++}}else if(c.type===s.A.Ya)c.fill?y.A.fillRect(a,l,c.width,c.height,c.Ha):y.A.ga(a,l,c.width,c.height,c.Ha);else if(c.type===s.A.Va){const t=c.font;let i=c.Ha,e=c.text;if(this.$s!==c.id&&this.qs!==c.id&&this.Zs!==c.id||0===c.Ka||(i=c.Ka),this.qo(c)&&(i=c.Xa,c.ja&&c.ja.length>0&&(e=c.ja)),c.za===s.A.Za&&this.An&&(e='Please wait...',i=c.Ha),!t||!e)continue;for(let s=l+t.height;e.length>0;s+=t.height){if(-1!==e.indexOf('%')){for(;;){const t=e.indexOf('%1');if(-1===t)break;e=e.substring(0,t)+this.qa(this.Jo(c,0))+e.substring(t+2)}for(;;){const t=e.indexOf('%2');if(-1===t)break;e=e.substring(0,t)+this.qa(this.Jo(c,1))+e.substring(t+2)}for(;;){const t=e.indexOf('%3');if(-1===t)break;e=e.substring(0,t)+this.qa(this.Jo(c,2))+e.substring(t+2)}for(;;){const t=e.indexOf('%4');if(-1===t)break;e=e.substring(0,t)+this.qa(this.Jo(c,3))+e.substring(t+2)}for(;;){const t=e.indexOf('%5');if(-1===t)break;e=e.substring(0,t)+this.qa(this.Jo(c,4))+e.substring(t+2)}}const n=e.indexOf('\\n');let r;-1!==n?(r=e.substring(0,n),e=e.substring(n+2)):(r=e,e=''),c.$a?t.Ja(a+(c.width/2|0),s,r,i,c.Qa):t.tl(a,s,r,i,c.Qa)}}else if(c.type===s.A.il){let t;t=this.qo(c)?c.el:c.sl,t?.draw(a,l)}else if(c.type===s.A.nl){const t=n.A.rl,i=n.A.hl;n.A.rl=a+(c.width/2|0),n.A.hl=l+(c.height/2|0);const e=n.A.sin[c.ol]*c.zoom>>16,s=n.A.cos[c.ol]*c.zoom>>16,r=this.qo(c);let h;h=r?c.ca:c.la;let o=null;if(-1===h)o=c.al(-1,-1,r);else{const t=g.A.Lo[h];t.frames&&t.ll&&(o=c.al(t.frames[c.ua],t.ll[c.ua],r))}o&&o.cl(0,c.fl,0,c.ol,0,e,s),n.A.rl=t,n.A.hl=i}else if(c.type===s.A.ul){const t=c.font;if(!t||!c.Oa||!c.La)continue;let i=0;for(let e=0;e0){const n=A.A.get(c.Oa[i]-1);let r=n.name;if((n.dl||1!==c.La[i])&&(r=r+' x'+this.wl(c.La[i])),!r)continue;const h=a+s*(c.Sa+115),o=l+e*(c.xa+12);c.$a?t.Ja(h+(c.width/2|0),o,r,c.Ha,c.Qa):t.tl(h,o,r,c.Ha,c.Qa)}i++}}}y.A.Aa(o,a,l,c)};Ca=t=>{let i=t._a;if(i>=s.A.yl&&i<=s.A.Al)i--,i>=this.Vh?(t.text='',t.za=0):(t.text=this.eo[i],t.za=1);else if(i>=s.A.ml&&i<=s.A.pl)i-=s.A.ml,i>=this.Vh?(t.text='',t.za=0):(0===this.no[i]?t.text='@red@Offline':this.no[i]===k.it?t.text='@gre@World-'+(this.no[i]-9):t.text='@yel@World-'+(this.no[i]-9),t.za=1);else if(i===s.A.gl)t.scroll=15*this.Vh+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i>=s.A.Il&&i<=s.A._l)i-=s.A.Il,i>=this.fs?(t.text='',t.za=0):(t.text=I.A.Cl(I.A.El(this.us[i])),t.za=1);else if(i===s.A.vl)t.scroll=15*this.fs+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i===s.A.bl){if(t.ol=150,t.fl=256*Math.sin(this.Ft/40)&2047,this.Wh){this.Wh=!1;const i=new d.fe(7,null);let e=0;for(let t=0;t<7;t++){const s=this.Yh[t];s>=0&&(i[e++]=_.A.Lo[s].al())}const s=p.A.Tl(i,e);for(let t=0;t<5;t++)0!==this.Hh[t]&&(s.Rl(u.A.Ol[t][0],u.A.Ol[t][this.Hh[t]]),1===t&&s.Rl(u.A.Ll[0],u.A.Ll[this.Hh[t]]));if(this.xh){const i=g.A.Lo[this.xh.Sl].frames;i&&(s.xl(),s.kl(i[0]),s.Ml(64,850,-30,-50,-30,!0),t.model=s)}}}else if(i===s.A.Dl)this.Fe||(this.Fe=t.sl,this.Be=t.el),this.Gh?t.sl=this.Be:t.sl=this.Fe;else if(i===s.A.Nl)this.Fe||(this.Fe=t.sl,this.Be=t.el),this.Gh?t.sl=this.Fe:t.sl=this.Be;else if(i===s.A.Fl)t.text=this.xn,this.Ft%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(i===s.A.Bl)this.Ph?this.kn?(t.Ha=m.A.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.Ha=m.A.Ia,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(i===s.A.Ul||i===s.A.Pl)if(0===this.Dn)t.text='';else{let i;i=0===this.Nn?'earlier today':1===this.Nn?'yesterday':this.Nn+' days ago',t.text='You last logged in '+i+' from: '+I.A.Gl(this.Dn)}else if(i===s.A.Wl)0===this.Bn&&(t.text='0 unread messages',t.Ha=m.A.Ga),1===this.Bn&&(t.text='1 unread message',t.Ha=m.A.GREEN),this.Bn>1&&(t.text=this.Bn+' unread messages',t.Ha=m.A.GREEN);else if(i===s.A.Yl)if(201===this.Fn)t.text='';else if(200===this.Fn)t.text='You have not yet set any password recovery questions.';else{let i;i=0===this.Fn?'Earlier today':1===this.Fn?'Yesterday':this.Fn+' days ago',t.text=i+' you changed your recovery questions'}else i===s.A.Hl?201===this.Fn?t.text='':200===this.Fn?t.text='We strongly recommend you do so now to secure your account.':t.text='If you do not remember making this change then cancel it immediately':i===s.A.Vl&&(201===this.Fn?t.text='':(this.Fn,t.text="Do this from the 'account management' area on our front webpage"))};Jo=(t,i)=>{if(!t.scripts||i>=t.scripts.length)return-2;try{const e=t.scripts[i];if(!e)return-1;let n=0,r=0;for(;;){const t=e[r++];if(0===t)return n;if(1===t)n+=this.Es[e[r++]];else if(2===t)n+=this.vs[e[r++]];else if(3===t)n+=this.Cs[e[r++]];else if(4===t){const t=s.A.Lo[e[r++]],i=e[r++]+1;if(t.Oa&&t.La)for(let e=0;et<999999999?String(t):'*';wl=t=>{let i=String(t);for(let t=i.length-3;t>0;t-=3)i=i.substring(0,t)+','+i.substring(t);return i.length>8?i='@gre@'+i.substring(0,i.length-8)+' million @whi@('+i+')':i.length>4&&(i='@cya@'+i.substring(0,i.length-4)+'K @whi@('+i+')'),' '+i};Ua=t=>t<1e5?String(t):t<1e7?(t/1e3|0)+'K':(t/1e6|0)+'M'}},7604:(t,i,e)=>{e.d(i,{w:()=>h});var s=e(7046),n=e(1651),r=e(9234);async function h(){await async function(){0===s.A.getParameter('world').length&&s.A.setParameter('world','1');'localhost'===window.location.hostname&&'0'===s.A.getParameter('world')?(n.K.st='http://localhost',n.K.nt='http://localhost',n.K.portOffset=0):await async function(t){const i=await o(t,parseInt(s.A.getParameter('world'),10)),e=new URL(i.address);n.K.it=10+i.id-1,n.K.st=`${e.protocol}//${e.hostname}`,n.K.nt=`${e.protocol}//${e.hostname}:${e.port}`,t||(n.K.st=n.K.st.replace('https:','http:'));n.K.portOffset=i.portOffset,n.K.members=!0===i?.members,s.A.setParameter('world',i.id.toString(10))}(window.location.protocol.startsWith('https'))}(),function(){0===s.A.getParameter('detail').length&&s.A.setParameter('detail','high');'low'===s.A.getParameter('detail')?n.K.Lt():n.K.Ot()}(),0===s.A.getParameter('method').length&&s.A.setParameter('method','0')}async function o(t,i,e=0){if(e>=10)throw new Error('could not find world to connect!');const s=t?'https:':'http:';let n;try{n=JSON.parse(await(0,r.Xl)(`${s}//2004scape.org/api/v1/worldlist`))}catch(s){return await(0,r.Yo)(1e3),o(t,i,++e)}n.push({id:0,region:'Local Development',address:'http://localhost',portOffset:0,members:!0,hh:0});const h=n.find((t=>t.id===i));return h||o(t,i,10)}},7046:(t,i,e)=>{e.d(i,{A:()=>l});var s=e(1183),n=e(4583),r=e(9234),h=e(9091),o=e(2595),a=e(7854);class l{static getParameter(t){return new URLSearchParams(window.location.search).get(t)??''}static setParameter(t,i){const e=new URL(window.location.toString());e.searchParams.set(t,i),window.history.pushState(null,'',e.toString())}jl=0;zl=[];Zl=0;xo=null;state=0;ql=20;$l=1;Jl=[];Ql=0;tc=0;ic=[];ec=!0;sc=!1;nc=50;hasFocus=!0;rc=!1;hc=0;oc=0;Ma=0;Da=0;ac=0;lc=0;cc=0;fc=[];uc=[];dc=0;wc=0;input=null;yc=!1;Ac=!1;mc=!1;time=-1;gc=0;Ic=0;_c=0;Cc=0;Ec=0;vc=0;constructor(t=!1){a.bc.tabIndex=-1,a.zo.fillStyle='black',a.zo.fillRect(0,0,a.bc.width,a.bc.height),this.sc=t,this.sc?this.resize(window.innerWidth,window.innerHeight):this.resize(a.bc.width,a.bc.height)}get width(){return a.bc.width}get height(){return a.bc.height}resize=(t,i)=>{a.bc.width=t,a.bc.height=i,this.xo=new s.A(t,i),n.A.Tc()};Rc=async()=>{a.bc.addEventListener('resize',(()=>{this.sc&&this.resize(window.innerWidth,window.innerHeight)}),!1),a.bc.onmousedown=this.onmousedown,a.bc.onmouseup=this.onmouseup,a.bc.onmouseenter=this.onmouseenter,a.bc.onmouseleave=this.onmouseleave,a.bc.onmousemove=this.onmousemove,window.onbeforeunload=this.To,a.bc.onfocus=this.onfocus,a.bc.onblur=this.onblur,this.Oc?(a.bc.ontouchstart=this.ontouchstart,a.bc.ontouchend=this.ontouchend,a.bc.ontouchmove=this.ontouchmove):(a.bc.onkeydown=this.onkeydown,a.bc.onkeyup=this.onkeyup),a.bc.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.Oc&&'low'===l.getParameter('detail')&&(this.nc=30),await this.Go(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.Jl[t]=performance.now();let t,i=0,e=256,s=1,n=0;for(;this.state>=0;){if(this.state>0&&(this.state--,0===this.state))return void this.Lc();const h=e,o=s;e=300,s=1,t=performance.now();const a=this.Jl[i];if(0===a?(e=h,s=o):t>a&&(e=2560*this.ql/(t-a)|0),e<25?e=25:e>256&&(e=256,s=this.ql-(t-a)/10|0),this.Jl[i]=t,i=(i+1)%10,s>1)for(let t=0;t<10;t++)0!==this.Jl[t]&&(this.Jl[t]+=s);for(s0&&(this.Ql=1e3*e/(256*this.ql)|0);const l=performance.now();if(this.ec&&this.refresh(),await this.draw(),this.ic[this.tc]=(performance.now()-l)/1e3,this.tc=(this.tc+1)%this.ic.length,this.nc<50){const i=1e3/this.nc-(performance.now()-t);i>0&&await(0,r.Yo)(i)}}-1===this.state&&this.Lc()};Lc=()=>{this.state=-2,this.To()};Zo=t=>{this.ql=1e3/t|0};Sc=t=>{this.nc=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.ql|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};To=()=>{};draw=async()=>{};refresh=()=>{};async Go(t,i){const e=this.width,s=this.height;this.ec&&(a.zo.fillStyle='black',a.zo.fillRect(0,0,e,s),this.ec=!1);const n=s/2-18;a.zo.fillStyle='rgb(140, 17, 17)',a.zo.rect((e/2|0)-152,n,304,34),a.zo.fillRect((e/2|0)-150,n+2,3*t,30),a.zo.fillStyle='black',a.zo.fillRect((e/2|0)-150+3*t,n+2,300-3*t,30),a.zo.font='bold 13px helvetica, sans-serif',a.zo.textAlign='center',a.zo.fillStyle='white',a.zo.fillText(i,e/2|0,n+22),await(0,r.Yo)(5)}xc=()=>{let t=-1;return this.wc!==this.dc&&(t=this.uc[this.dc],this.dc=this.dc+1&127),t};get ms(){const t=this.ic.length;let i=0;for(let e=0;ethis.jl&&(this.jl=e),this.zl[this.Zl]=e,this.Zl=(this.Zl+1)%250,e}get kc(){return this.zl.reduce(((t,i)=>t+i),0)/250}onkeydown=t=>{const i=t.key;this.hc=0;const e=h.c[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;t.ctrlKey&&(n>='A'.charCodeAt(0)&&n<=']'.charCodeAt(0)||n=='_'.charCodeAt(0)?n-='A'.charCodeAt(0)-1:n>='a'.charCodeAt(0)&&n<='z'.charCodeAt(0)&&(n-='a'.charCodeAt(0)-1)),n<30&&(n=0),s===h.c.ArrowLeft.code?n=1:s===h.c.ArrowRight.code?n=2:s===h.c.ArrowUp.code?n=3:s===h.c.ArrowDown.code?n=4:s===h.c.Control.code?n=5:s===h.c.Shift.code?n=6:s===h.c.Alt.code?n=7:s===h.c.Backspace.code||s===h.c.Delete.code?n=8:s===h.c.Tab.code?n=9:s===h.c.Enter.code?n=10:s>=h.c.F1.code&&s<=h.c.F12.code?n=s+1008-h.c.F1.code:s===h.c.Home.code?n=1e3:s===h.c.End.code?n=1001:s===h.c.PageUp.code?n=1002:s===h.c.PageDown.code&&(n=1003),n>0&&n<128&&(this.fc[n]=1),n>4&&(this.uc[this.wc]=n,this.wc=this.wc+1&127),o.A.enabled&&o.A.Mc(n),h.g.includes(i)||t.preventDefault()};onkeyup=t=>{const i=t.key;this.hc=0;const e=h.c[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;n<30&&(n=0),s===h.c.ArrowLeft.code?n=1:s===h.c.ArrowRight.code?n=2:s===h.c.ArrowUp.code?n=3:s===h.c.ArrowDown.code?n=4:s===h.c.Control.code?n=5:s===h.c.Shift.code?n=6:s===h.c.Alt.code?n=7:s===h.c.Backspace.code||s===h.c.Delete.code?n=8:s===h.c.Tab.code?n=9:s===h.c.Enter.code?n=10:s>=h.c.F1.code&&s<=h.c.F12.code?n=s+1008-h.c.F1.code:s===h.c.Home.code?n=1e3:s===h.c.End.code?n=1001:s===h.c.PageUp.code?n=1002:s===h.c.PageDown.code&&(n=1003),n>0&&n<128&&(this.fc[n]=0),o.A.enabled&&o.A.Dc(n),h.g.includes(i)||t.preventDefault()};onmousedown=t=>{if(this.yc=!1,(t.clientX>0||t.clientY>0)&&this.Nc(t),this.hc=0,this.lc=this.Ma,this.cc=this.Da,this.Oc&&!this.Fc){if(this.Bc()||this.Uc()||this.Pc())return this.ac=1,void(this.oc=1);t.timeStamp>=this.time+500?(this.ac=2,this.oc=2):(this.ac=1,this.oc=1)}else 2===t.button?(this.ac=2,this.oc=2):(this.ac=1,this.oc=1);o.A.enabled&&o.A.Gc(this.lc,this.cc,t.buttons)};onmouseup=t=>{this.Nc(t),this.hc=0,this.oc=0,o.A.enabled&&o.A.Wc(t.buttons)};onmouseenter=t=>{this.Nc(t),o.A.enabled&&o.A.Yc()};onmouseleave=t=>{this.Nc(t),this.hc=0,this.Ma=-1,this.Da=-1,this.oc=0,this.lc=-1,this.cc=-1,o.A.enabled&&o.A.Hc()};onmousemove=t=>{this.Nc(t),this.hc=0,o.A.enabled&&o.A.Vc(this.Ma,this.Da)};onfocus=t=>{this.hasFocus=!0,this.ec=!0,this.refresh(),o.A.enabled&&o.A.Kc()};onblur=t=>{this.hasFocus=!1,o.A.enabled&&o.A.Xc()};ontouchstart=t=>{if(!this.Oc)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.yc=!0;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.gc=this.Ec=this._c=0|i.screenX,this.Ic=this.vc=this.Cc=0|i.screenY,this.time=t.timeStamp,this.Ac=this.jc(),this.mc=this.zc()};ontouchend=t=>{if(!this.Oc||!this.yc)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;if(this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.Ec=0|i.screenX,this.vc=0|i.screenY,this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.Ac&&!this.jc())return void(this.yc=!1);if(this.mc&&!this.zc())return void(this.yc=!1);if(this.Bc()||this.Zc()||this.Uc()||this.Pc()){null!==this.input&&(this.input.parentNode?.contains(this.input)&&this.input.parentNode?.removeChild(this.input),this.input=null);const t=document.createElement('input');return this.Uc()?(t.setAttribute('id','username'),t.setAttribute('placeholder','Username')):this.Pc()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.Bc()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.Zc()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this.qc?t.setAttribute('type','password'):t.setAttribute('type',this.Pc()?'password':'text'),t.setAttribute('autofocus','autofocus'),t.setAttribute('spellcheck','false'),t.setAttribute('autocomplete','off'),t.setAttribute('style',`position: fixed; left: ${e}px; top: ${s}px; width: 1px; height: 1px; opacity: 0;`),document.body.appendChild(t),t.focus(),t.click(),this.qc&&(t.oninput=t=>{if(!(t instanceof InputEvent))return;const i=t,e=i.data;null!==e&&'insertText'===i.inputType&&this.onkeydown(new KeyboardEvent('keydown',{key:e,code:e}))}),t.onkeydown=t=>{this.qc&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this.qc&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeyup(new KeyboardEvent('keyup',{key:t.key,code:t.key}))},t.onfocus=t=>{this.input?.parentNode?.removeChild(this.input),this.input=null,this.onfocus(t)},this.input=t,void(this.yc=!1)}const n=t.timeStamp>=this.time+500,r=Math.abs(this.gc-this.Ec)>16||Math.abs(this.Ic-this.vc)>16;n&&!r?(this.yc=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.oc=0,this.yc=!1)};ontouchmove=t=>{if(!this.Oc||!this.yc)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.Ec=0|i.screenX,this.vc=0|i.screenY,this.Ac&&-1===this.Fo()?(this._c-this.Ec>0?this.rotate(2):this._c-this.Ec<0&&this.rotate(0),this.Cc-this.vc>0?this.rotate(3):this.Cc-this.vc<0&&this.rotate(1)):(this.mc||-1!==this.Fo())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this._c=this.Ec,this.Cc=this.vc};get Oc(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get qc(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get Fc(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}jc=()=>this.rc&&this.Ma>=8&&this.Ma<=520&&this.Da>=11&&this.Da<=345;Bc=()=>this.rc&&-1===this.No()&&!this.Mo()&&!this.Do()&&this.Ma>=11&&this.Ma<=506&&this.Da>=449&&this.Da<=482;Zc=()=>this.rc&&(this.Mo()||this.Do())&&this.Ma>=11&&this.Ma<=506&&this.Da>=383&&this.Da<=482;zc=()=>this.rc&&this.Ma>=562&&this.Ma<=752&&this.Da>=231&&this.Da<=492;Uc=()=>!this.rc&&2===this.ko()&&this.Ma>=301&&this.Ma<=562&&this.Da>=262&&this.Da<=279;Pc=()=>!this.rc&&2===this.ko()&&this.Ma>=301&&this.Ma<=562&&this.Da>=279&&this.Da<=296;rotate=t=>{0===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowLeft',code:'ArrowLeft'}))):1===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowUp',code:'ArrowUp'}))):2===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowRight',code:'ArrowRight'}))):3===t&&(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowDown',code:'ArrowDown'})))};$c=()=>null!==document.fullscreenElement;Nc=t=>{if(this.$c()){const i=t.target.getBoundingClientRect(),e=window.innerHeight/a.bc.height,s=(window.innerWidth-a.bc.width*e)/2;this.Ma=0|this.Jc(t.clientX-i.left-s,0,a.bc.width*e,0,789),this.Da=0|this.Jc(t.clientY-i.top,0,a.bc.height*e,0,532)}else{const i=a.bc.getBoundingClientRect(),e=a.bc.width/i.width,s=a.bc.height/i.height;this.Ma=(t.clientX-i.left)*e|0,this.Da=(t.clientY-i.top)*s|0}this.Ma<0&&(this.Ma=0),this.Da<0&&(this.Da=0),this.Ma>789&&(this.Ma=789),this.Da>532&&(this.Da=532)};Jc=(t,i,e,s,n)=>(t-i)*(n-s)/(e-i)+s}},2595:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1069);class n{static enabled=!1;static Qc=null;static tf=null;static if=0;static ef=0;static sf=0;static nf=0;static rf=0;static hf=()=>{this.Qc=s.A.Ut(1),this.tf=null,this.if=performance.now(),this.enabled=!0};static af=()=>{this.enabled=!1,this.Qc=null};static flush=()=>{let t=null;return this.tf&&this.enabled&&(t=this.tf),this.tf=null,t};static stop=()=>{let t=null;return this.Qc&&this.Qc.lf>0&&this.enabled&&(t=this.Qc),this.af(),t};static Gc=(t,i,e)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;this.ef++;const s=performance.now();let n=(s-this.if)/10|0;n>250&&(n=250),this.if=s,this.cf(5),1===e?this.Qc?.p1(1):this.Qc?.p1(2),this.Qc?.p1(n),this.Qc?.p3(t+(i<<10))};static Wc=t=>{if(!this.enabled)return;this.ef++;const i=performance.now();let e=(i-this.if)/10|0;e>250&&(e=250),this.if=i,this.cf(2),1===t?this.Qc?.p1(3):this.Qc?.p1(4),this.Qc?.p1(e)};static Vc=(t,i)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;const e=performance.now();if(e-this.sf>=50){this.sf=e,this.ef++;let s=(e-this.if)/10|0;s>250&&(s=250),this.if=e,t-this.nf<8&&t-this.nf>=-8&&i-this.rf<8&&i-this.rf>=-8?(this.cf(3),this.Qc?.p1(5),this.Qc?.p1(s),this.Qc?.p1(t+(i-this.rf+8<<4)+8-this.nf)):t-this.nf<128&&t-this.nf>=-128&&i-this.rf<128&&i-this.rf>=-128?(this.cf(4),this.Qc?.p1(6),this.Qc?.p1(s),this.Qc?.p1(t+128-this.nf),this.Qc?.p1(i+128-this.rf)):(this.cf(5),this.Qc?.p1(7),this.Qc?.p1(s),this.Qc?.p3(t+(i<<10))),this.nf=t,this.rf=i}};static Mc=t=>{if(!this.enabled)return;this.ef++;const i=performance.now();let e=(i-this.if)/10|0;e>250&&(e=250),this.if=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.cf(3),this.Qc?.p1(8),this.Qc?.p1(e),this.Qc?.p1(t)};static Dc=t=>{if(!this.enabled)return;this.ef++;const i=performance.now();let e=(i-this.if)/10|0;e>250&&(e=250),this.if=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.cf(3),this.Qc?.p1(9),this.Qc?.p1(e),this.Qc?.p1(t)};static Kc=()=>{if(!this.enabled)return;this.ef++;const t=performance.now();let i=(t-this.if)/10|0;i>250&&(i=250),this.if=t,this.cf(2),this.Qc?.p1(10),this.Qc?.p1(i)};static Xc=()=>{if(!this.enabled)return;this.ef++;const t=performance.now();let i=(t-this.if)/10|0;i>250&&(i=250),this.if=t,this.cf(2),this.Qc?.p1(11),this.Qc?.p1(i)};static Yc=()=>{if(!this.enabled)return;this.ef++;const t=performance.now();let i=(t-this.if)/10|0;i>250&&(i=250),this.if=t,this.cf(2),this.Qc?.p1(12),this.Qc?.p1(i)};static Hc=()=>{if(!this.enabled)return;this.ef++;const t=performance.now();let i=(t-this.if)/10|0;i>250&&(i=250),this.if=t,this.cf(2),this.Qc?.p1(13),this.Qc?.p1(i)};static cf=t=>{if(this.Qc&&this.Qc.lf+t>=500){const t=this.Qc;this.Qc=s.A.Ut(1),this.tf=t}}}},9091:(t,i,e)=>{e.d(i,{c:()=>n,g:()=>s});const s=['F11','F12'],n={'Backspace':{code:8,ch:8},'Enter':{code:10,ch:10},'Shift':{code:16,ch:65535},'Escape':{code:27,ch:27},'Tab':{code:9,ch:9},'CapsLock':{code:20,ch:65535},' ':{code:32,ch:32},'Control':{code:17,ch:65535},'Alt':{code:18,ch:65535},'Meta':{code:524,ch:65535},'ArrowLeft':{code:37,ch:65535},'ArrowRight':{code:39,ch:65535},'ArrowUp':{code:38,ch:65535},'ArrowDown':{code:40,ch:65535},'Insert':{code:155,ch:65535},'Home':{code:36,ch:65535},'PageUp':{code:33,ch:65535},'Delete':{code:127,ch:127},'End':{code:35,ch:65535},'PageDown':{code:34,ch:65535},'`':{code:192,ch:96},'~':{code:192,ch:126},'!':{code:49,ch:33},'@':{code:50,ch:64},'#':{code:51,ch:35},'$':{code:52,ch:36},'%':{code:53,ch:37},'^':{code:54,ch:94},'&':{code:55,ch:38},'*':{code:56,ch:42},'(':{code:57,ch:40},')':{code:48,ch:41},'-':{code:45,ch:45},'_':{code:45,ch:95},'=':{code:61,ch:61},'+':{code:61,ch:43},'[':{code:91,ch:91},'{':{code:91,ch:123},']':{code:93,ch:93},'}':{code:93,ch:125},'\\':{code:92,ch:92},'|':{code:92,ch:124},';':{code:59,ch:59},':':{code:59,ch:58},"'":{code:222,ch:39},'"':{code:222,ch:34},',':{code:44,ch:44},'<':{code:44,ch:60},'.':{code:46,ch:46},'>':{code:46,ch:62},'/':{code:47,ch:47},'?':{code:47,ch:63},'F1':{code:112,ch:65535},'F2':{code:113,ch:65535},'F3':{code:114,ch:65535},'F4':{code:115,ch:65535},'F5':{code:116,ch:65535},'F6':{code:117,ch:65535},'F7':{code:118,ch:65535},'F8':{code:119,ch:65535},'F9':{code:120,ch:65535},'F10':{code:121,ch:65535},'F11':{code:122,ch:65535},'F12':{code:123,ch:65535},0:{code:48,ch:48},1:{code:49,ch:49},2:{code:50,ch:50},3:{code:51,ch:51},4:{code:52,ch:52},5:{code:53,ch:53},6:{code:54,ch:54},7:{code:55,ch:55},8:{code:56,ch:56},9:{code:57,ch:57},'a':{code:65,ch:97},'b':{code:66,ch:98},'c':{code:67,ch:99},'d':{code:68,ch:100},'e':{code:69,ch:101},'f':{code:70,ch:102},'g':{code:71,ch:103},'h':{code:72,ch:104},'i':{code:73,ch:105},'j':{code:74,ch:106},'k':{code:75,ch:107},'l':{code:76,ch:108},'m':{code:77,ch:109},'n':{code:78,ch:110},'o':{code:79,ch:111},'p':{code:80,ch:112},'q':{code:81,ch:113},'r':{code:82,ch:114},'s':{code:83,ch:115},'t':{code:84,ch:116},'u':{code:85,ch:117},'v':{code:86,ch:118},'w':{code:87,ch:119},'x':{code:88,ch:120},'y':{code:89,ch:121},'z':{code:90,ch:122},'A':{code:65,ch:65},'B':{code:66,ch:66},'C':{code:67,ch:67},'D':{code:68,ch:68},'E':{code:69,ch:69},'F':{code:70,ch:70},'G':{code:71,ch:71},'H':{code:72,ch:72},'I':{code:73,ch:73},'J':{code:74,ch:74},'K':{code:75,ch:75},'L':{code:76,ch:76},'M':{code:77,ch:77},'N':{code:78,ch:78},'O':{code:79,ch:79},'P':{code:80,ch:80},'Q':{code:81,ch:81},'R':{code:82,ch:82},'S':{code:83,ch:83},'T':{code:84,ch:84},'U':{code:85,ch:85},'V':{code:86,ch:86},'W':{code:87,ch:87},'X':{code:88,ch:88},'Y':{code:89,ch:89},'Z':{code:90,ch:90}}},1120:(t,i,e)=>{e.d(i,{A:()=>c});var s=e(1069),n=e(8665),r=e(2679),h=e(2511),o=e(3819),a=e(3867),l=e(8950);class c{static Lo=[];static ff=null;static So=null;static Ea=0;static uf=1;static ba=2;static Ya=3;static Va=4;static il=5;static nl=6;static ul=7;static df=1;static wf=2;static yf=3;static Af=4;static mf=5;static Za=6;static yl=1;static Al=100;static ml=101;static pl=200;static pf=201;static gf=202;static gl=203;static If=205;static _f=300;static Cf=301;static Ef=302;static vf=303;static bf=304;static Tf=305;static Rf=306;static Of=307;static Lf=308;static Sf=309;static xf=310;static kf=311;static Mf=312;static Df=313;static Nf=314;static Ff=315;static Bf=316;static Uf=317;static Pf=318;static Gf=319;static Wf=320;static Yf=321;static Hf=322;static Vf=323;static Dl=324;static Nl=325;static Kf=326;static bl=327;static Il=401;static _l=500;static Xf=501;static jf=502;static vl=503;static Fl=600;static zf=601;static Zf=602;static qf=603;static $f=604;static Jf=605;static Qf=606;static tu=607;static iu=608;static eu=609;static su=610;static nu=611;static ru=612;static Bl=613;static Ul=650;static Wl=651;static Yl=652;static Hl=653;static Vl=654;static Pl=655;static hu=(t,i,e)=>{this.ff=new r.A(5e4),this.So=new r.A(5e4);const n=new s.A(t.read('data'));let h=-1;for(n.lf+=2;n.lf0){s.$o=new Uint8Array(r),s.Qo=new Uint16Array(r);for(let t=0;t0){s.scripts=new a.fe(o,null);for(let t=0;t0){const n=e.lastIndexOf(',');s.Wa[t]=this.yu(i,e.substring(0,n),parseInt(e.substring(n+1),10))}}s.Au=new a.fe(5,null);for(let t=0;t<5;t++){const i=n.wu;s.Au[t]=i,0===i.length&&(s.Au[t]=null)}}if(s.type===c.Ya&&(s.fill=1===n.lu),s.type===c.Va||s.type===c.uf){s.$a=1===n.lu;const t=n.lu;e&&(s.font=e[t]),s.Qa=1===n.lu}if(s.type===c.Va&&(s.text=n.wu,s.ja=n.wu),s.type!==c.uf&&s.type!==c.Ya&&s.type!==c.Va||(s.Ha=n.Ko),s.type!==c.Ya&&s.type!==c.Va||(s.Xa=n.Ko,s.Ka=n.Ko),s.type===c.il){const t=n.wu;if(t.length>0){const e=t.lastIndexOf(',');s.sl=this.yu(i,t.substring(0,e),parseInt(t.substring(e+1),10))}const e=n.wu;if(e.length>0){const t=e.lastIndexOf(',');s.el=this.yu(i,e.substring(0,t),parseInt(e.substring(t+1),10))}}if(s.type===c.nl){const t=n.lu;0!==t&&(s.model=this.al((t-1<<8)+n.lu));const i=n.lu;0!==i&&(s.mu=this.al((i-1<<8)+n.lu)),s.la=n.lu,0===s.la?s.la=-1:s.la=(s.la-1<<8)+n.lu,s.ca=n.lu,0===s.ca?s.ca=-1:s.ca=(s.ca-1<<8)+n.lu,s.zoom=n.ou,s.ol=n.ou,s.fl=n.ou}if(s.type===c.ul){s.Oa=new Int32Array(s.width*s.height),s.La=new Int32Array(s.width*s.height),s.$a=1===n.lu;const t=n.lu;e&&(s.font=e[t]),s.Qa=1===n.lu,s.Ha=n.Ko,s.Sa=n.fu,s.xa=n.fu,s.uu=1===n.lu,s.Au=new a.fe(5,null);for(let t=0;t<5;t++){const i=n.wu;s.Au[t]=i,0===i.length&&(s.Au[t]=null)}}s.za!==c.wf&&s.type!==c.ba||(s.pu=n.wu,s.action=n.wu,s.gu=n.ou),s.za!==c.df&&s.za!==c.Af&&s.za!==c.mf&&s.za!==c.Za||(s.Iu=n.wu,0===s.Iu.length&&(s.za===c.df?s.Iu='Ok':s.za===c.Af||s.za===c.mf?s.Iu='Select':s.za===c.Za&&(s.Iu='Continue')))}this.ff=null,this.So=null};static yu=(t,i,e)=>{const s=o.A._u(i)<<8n|BigInt(e);if(this.ff){const t=this.ff.get(s);if(t)return t}let n;try{n=h.A.Cu(t,i,e),this.ff?.put(s,n)}catch(t){return null}return n};static al=t=>{if(this.So){const i=this.So.get(BigInt(t));if(i)return i}const i=n.A.model(t);return this.So?.put(BigInt(t),i),i};id=-1;au=-1;type=-1;za=-1;_a=0;width=0;height=0;cu=-1;$o=null;Qo=null;scripts=null;scroll=0;hide=!1;draggable=!1;uu=!1;du=!1;Sa=0;xa=0;Ta=null;Ra=null;Wa=null;Au=null;fill=!1;$a=!1;font=null;Qa=!1;text=null;ja=null;Ha=0;Xa=0;Ka=0;sl=null;el=null;model=null;mu=null;la=-1;ca=-1;zoom=0;ol=0;fl=0;pu=null;action=null;gu=-1;Iu=null;aa=null;ma=null;pa=null;x=0;y=0;va=0;Oa=null;La=null;ua=0;fa=0;al(t,i,e){let s=this.model;if(e&&(s=this.mu),!s)return null;if(-1===t&&-1===i&&!s.Eu)return s;const r=n.A.vu(s,!0,!0,!1);return-1===t&&-1===i||r.xl(),-1!==t&&r.kl(t),-1!==i&&r.kl(i),r.Ml(64,768,-50,-10,-50,!0),r}bu(){if(this.au===this.id)return this.x;let t=c.Lo[this.au];if(!t.aa||!t.ma||!t.pa)return this.x;let i=t.aa.indexOf(this.id);if(-1===i)return this.x;let e=t.ma[i];for(;t.au!==t.id;){const s=c.Lo[t.au];s.aa&&s.ma&&s.pa&&(i=s.aa.indexOf(t.id),-1!==i&&(e+=s.ma[i])),t=s}return e}Tu(){if(this.au===this.id)return this.y;let t=c.Lo[this.au];if(!t.aa||!t.ma||!t.pa)return this.y;let i=t.aa.indexOf(this.id);if(-1===i)return this.y;let e=t.pa[i];for(;t.au!==t.id;){const s=c.Lo[t.au];s.aa&&s.ma&&s.pa&&(i=s.aa.indexOf(t.id),-1!==i&&(e+=s.pa[i])),t=s}return e}outline(t){const i=this.bu(),e=this.Tu();l.A.ga(i,e,this.width,this.height,t)}move(t,i){if(this.au===this.id)return;this.x=0,this.y=0;const e=c.Lo[this.au];if(e.aa&&e.ma&&e.pa){const s=e.aa.indexOf(this.id);-1!==s&&(e.ma[s]=t,e.pa[s]=i)}}delete(){if(this.au===this.id)return;const t=c.Lo[this.au];if(t.aa&&t.ma&&t.pa){const i=t.aa.indexOf(this.id);-1!==i&&(t.aa.splice(i,1),t.ma.splice(i,1),t.pa.splice(i,1))}}}},6333:(t,i,e)=>{e.d(i,{$:()=>s});class s{id;Ru=null;constructor(t){this.id=t}Ou(t){for(;;){const i=t.lu;if(0===i)break;this.decode(i,t)}return this}}},2164:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(6333);class r extends n.${static count=0;static Lo=[];static hu=t=>{const i=new s.A(t.read('flo.dat'));this.count=i.ou;for(let t=0;t(e>179&&(i=i/2|0),e>192&&(i=i/2|0),e>217&&(i=i/2|0),e>243&&(i=i/2|0),(t/4<<10)+(i/32<<7)+(e/2|0));static Su=(t,i)=>-1===t?12345678:((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);static xu=(t,i)=>-2===t?12345678:-1===t?(i<0?i=0:i>127&&(i=127),127-i):((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);ku=0;texture=-1;Mu=!1;Du=!0;Nu=0;Fu=0;Bu=0;Uu=0;Pu=0;Gu=0;decode(t,i){1===t?(this.ku=i.Wu,this.setColor(this.ku)):2===t?this.texture=i.lu:3===t?this.Mu=!0:5===t?this.Du=!1:6===t?this.Ru=i.wu:console.log('Error unrecognised config code: ',t)}setColor(t){const i=(t>>16&255)/256,e=(t>>8&255)/256,s=(255&t)/256;let n=i;ei&&(h=e),s>h&&(h=s);let o=0,a=0;const l=(n+h)/2;n!==h&&(l<.5&&(a=(h-n)/(h+n)),l>=.5&&(a=(h-n)/(2-h-n)),i===h?o=(e-s)/(h-n):e===h?o=(s-i)/(h-n)+2:s===h&&(o=(i-e)/(h-n)+4)),o/=6,this.Nu=256*o|0,this.Fu=256*a|0,this.Bu=256*l|0,this.Fu<0?this.Fu=0:this.Fu>255&&(this.Fu=255),this.Bu<0?this.Bu=0:this.Bu>255&&(this.Bu=255),this.Uu=l>.5?(1-l)*a*512|0:l*a*512|0,this.Uu<1&&(this.Uu=1),this.Pu=o*this.Uu|0;let c=this.Nu+(16*Math.random()|0)-8;c<0?c=0:c>255&&(c=255);let f=this.Fu+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255);let u=this.Bu+(48*Math.random()|0)-24;u<0?u=0:u>255&&(u=255),this.Gu=r.Lu(c,f,u)}}},8317:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(1069),n=e(6333),r=e(8665),h=e(3867);class o extends n.${static count=0;static Lo=[];static hu=t=>{const i=new s.A(t.read('idk.dat'));this.count=i.ou;for(let t=0;t=40&&t<50)this.Vu[t-40]=i.ou;else if(t>=50&&t<60)this.Ku[t-50]=i.ou;else{if(!(t>=60&&t<70))throw new Error(`Unrecognized idk config code: ${t}`);this.Hu[t-60]=i.ou}}al(){if(!this.Yu)return null;const t=new h.fe(this.Yu.length,null);for(let i=0;i{e.d(i,{A:()=>c});var s=e(6333),n=e(1069),r=e(2679),h=e(8665),o=e(1023),a=e(6169),l=e(3867);class c extends s.${static count=0;static cache=null;static ju=null;static zu=null;static Zu=0;static qu=new r.A(500);static $u=new r.A(30);static hu=t=>{this.ju=new n.A(t.read('loc.dat'));const i=new n.A(t.read('loc.idx'));this.count=i.ou,this.zu=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.zu||!this.ju)throw new Error('LocType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Zu=(this.Zu+1)%10;const i=this.cache[this.Zu];return this.ju.lf=this.zu[t],i.id=t,i.reset(),i.Ou(this.ju),i.Ju||(i.Ju=new Int32Array(1)),-1===i.Qu&&i.Ju&&(i.active=i.Ju.length>0&&i.Ju[0]===o.A.td.id,i.ed&&(i.active=!0)),i};static To=()=>{this.qu=null,this.$u=null,this.zu=null,this.cache=null,this.ju=null};Yu=null;Ju=null;name=null;sd=null;Vu=null;Ku=null;width=1;length=1;nd=!0;rd=!0;active=!1;Qu=-1;hd=!1;od=!1;Du=!1;la=-1;ad=!1;ld=16;fd=0;ud=0;ed=null;dd=-1;wd=-1;yd=!1;Ad=!0;md=128;pd=128;gd=128;Id=0;_d=0;Cd=0;Ed=0;vd=!1;decode(t,i){if(1===t){const t=i.lu;this.Yu=new Int32Array(t),this.Ju=new Int32Array(t);for(let e=0;e=30&&t<39)this.ed||(this.ed=new l.fe(5,null)),this.ed[t-30]=i.wu,'hidden'===this.ed[t-30]?.toLowerCase()&&(this.ed[t-30]=null);else if(40===t){const t=i.lu;this.Vu=new Uint16Array(t),this.Ku=new Uint16Array(t);for(let e=0;e=this.Yu.length)return null;let d=this.Yu[l];if(-1===d)return null;const w=this.yd!==i>3;w&&(d+=65536);let y=c.qu?.get(BigInt(d));y||(y=h.A.model(65535&d),w&&y.kd(),c.qu?.put(BigInt(d),y));const A=128!==this.md||128!==this.pd||128!==this.gd,m=0!==this._d||0!==this.Cd||0!==this.Ed;let p=h.A.vu(y,!this.Vu,!this.ad,i===a.A.Md&&-1===o&&!A&&!m);for(-1!==o&&(p.xl(),p.kl(o),p.Dd=null,p.Nd=null);i-- >0;)p.Fd();if(this.Vu&&this.Ku)for(let t=0;t{e.d(i,{A:()=>a});var s=e(6333),n=e(1069),r=e(2679),h=e(8665),o=e(3867);class a extends s.${static count=0;static cache=null;static ju=null;static zu=null;static Zu=0;static So=new r.A(30);static hu=t=>{this.ju=new n.A(t.read('npc.dat'));const i=new n.A(t.read('npc.idx'));this.count=i.ou,this.zu=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.zu||!this.ju)throw new Error('NpcType not loaded!!!');for(let i=0;i<20;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Zu=(this.Zu+1)%20;const i=this.cache[this.Zu]=new a(t);return this.ju.lf=this.zu[t],i.Ou(this.ju),i};static To=()=>{this.So=null,this.zu=null,this.cache=null,this.ju=null};name=null;sd=null;size=1;Yu=null;Hu=null;ad=!1;Pd=-1;Gd=-1;Wd=-1;Yd=-1;Hd=-1;Vu=null;Ku=null;ed=null;md=-1;pd=-1;gd=-1;Vd=!0;Kd=-1;Xd=128;jd=128;decode(t,i){if(1===t){const t=i.lu;this.Yu=new Uint16Array(t);for(let e=0;e=30&&t<40)this.ed||(this.ed=new o.fe(5,null)),this.ed[t-30]=i.wu,'hidden'===this.ed[t-30]?.toLowerCase()&&(this.ed[t-30]=null);else if(40===t){const t=i.lu;this.Vu=new Uint16Array(t),this.Ku=new Uint16Array(t);for(let e=0;e{e.d(i,{A:()=>u});var s=e(6333),n=e(1069),r=e(2511),h=e(2679),o=e(8665),a=e(4583),l=e(8950),c=e(9298),f=e(3867);class u extends s.${static count=0;static cache=null;static ju=null;static zu=null;static Zu=0;static Qd=!0;static So=new h.A(50);static tw=new h.A(200);static hu=(t,i)=>{this.Qd=i,this.ju=new n.A(t.read('obj.dat'));const e=new n.A(t.read('obj.idx'));this.count=e.ou,this.zu=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.zu||!this.ju)throw new Error('ObjType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Zu=(this.Zu+1)%10;const i=this.cache[this.Zu];return this.ju.lf=this.zu[t],i.id=t,i.reset(),i.Ou(this.ju),-1!==i.iw&&i.ew(),!this.Qd&&i.members&&(i.name='Members Object',i.sd="Login to a members' server to use this object.",i.ed=null,i.sw=null),i};static To=()=>{this.So=null,this.tw=null,this.zu=null,this.cache=null,this.ju=null};static ka=(t,i)=>{if(u.tw){let e=u.tw.get(BigInt(t));if(e&&e.nw!==i&&-1!==e.nw&&(e.rw(),e=null),e)return e}let e=u.get(t);if(e.hw||(i=-1),e.hw&&e.ow&&i>1){let t=-1;for(let s=0;s<10;s++)i>=e.ow[s]&&0!==e.ow[s]&&(t=e.hw[s]);-1!==t&&(e=u.get(t))}const s=new r.A(32,32),n=a.A.rl,h=a.A.hl,o=a.A.aw,f=l.A.lw,d=l.A.cw,w=l.A.fw,y=l.A.left,A=l.A.right,m=l.A.top,p=l.A.bottom;a.A.uw=!1,l.A.bind(s.lw,32,32),l.A.fillRect(0,0,32,32,c.A.Pa),a.A.Tc();const g=e.dw(1),I=a.A.sin[e.ww]*e.yw>>16,_=a.A.cos[e.ww]*e.yw>>16;g.cl(0,e.Aw,e.mw,e.ww,e.pw,I+(g.Ud/2|0)+e.gw,_+e.gw);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.lw[t+32*i]&&(t>0&&s.lw[t+32*i-1]>1||i>0&&s.lw[t+32*(i-1)]>1||t<31&&s.lw[t+32*i+1]>1||i<31&&s.lw[t+32*(i+1)]>1)&&(s.lw[t+32*i]=1);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.lw[t+32*i]&&t>0&&i>0&&s.lw[t+32*(i-1)-1]>0&&(s.lw[t+32*i]=3153952);if(-1!==e.iw){const t=this.ka(e.Iw,10),i=t.Fa,s=t.nw;t.Fa=32,t.nw=32,t._w(5,5,22,22),t.Fa=i,t.nw=s}return u.tw?.put(BigInt(t),s),l.A.bind(f,d,w),l.A.Aa(y,m,A,p),a.A.rl=n,a.A.hl=h,a.A.aw=o,a.A.uw=!0,e.dl?s.Fa=33:s.Fa=32,s.nw=i,s};model=0;name=null;sd=null;Vu=null;Ku=null;yw=2e3;ww=0;Aw=0;mw=0;pw=0;gw=0;Cw=!1;Ew=-1;dl=!1;bw=1;members=!1;ed=null;sw=null;Tw=-1;Rw=-1;Ow=0;Lw=-1;Sw=-1;xw=0;kw=-1;Mw=-1;Dw=-1;Nw=-1;Fw=-1;Bw=-1;hw=null;ow=null;Iw=-1;iw=-1;decode(t,i){if(1===t)this.model=i.ou;else if(2===t)this.name=i.wu;else if(3===t)this.sd=i.wu;else if(4===t)this.yw=i.ou;else if(5===t)this.ww=i.ou;else if(6===t)this.Aw=i.ou;else if(7===t)this.pw=i.fu,this.pw>32767&&(this.pw-=65536);else if(8===t)this.gw=i.fu,this.gw>32767&&(this.gw-=65536);else if(9===t)this.Cw=!0;else if(10===t)this.Ew=i.ou;else if(11===t)this.dl=!0;else if(12===t)this.bw=i.Ko;else if(16===t)this.members=!0;else if(23===t)this.Tw=i.ou,this.Ow=i.bd;else if(24===t)this.Rw=i.ou;else if(25===t)this.Lw=i.ou,this.xw=i.bd;else if(26===t)this.Sw=i.ou;else if(t>=30&&t<35)this.ed||(this.ed=new f.fe(5,null)),this.ed[t-30]=i.wu,'hidden'===this.ed[t-30]?.toLowerCase()&&(this.ed[t-30]=null);else if(t>=35&&t<40)this.sw||(this.sw=new f.fe(5,null)),this.sw[t-35]=i.wu;else if(40===t){const t=i.lu;this.Vu=new Uint16Array(t),this.Ku=new Uint16Array(t);for(let e=0;e=100&&t<110&&(this.hw&&this.ow||(this.hw=new Uint16Array(10),this.ow=new Uint16Array(10)),this.hw[t-100]=i.ou,this.ow[t-100]=i.ou)}Uw(t){let i=this.Tw;if(1===t&&(i=this.Lw),-1===i)return null;let e=this.Rw,s=this.kw;1===t&&(e=this.Sw,s=this.Mw);let n=o.A.model(i);if(-1!==e){const t=o.A.model(e);if(-1===s){const i=[n,t];n=o.A.Tl(i,2)}else{const i=[n,t,o.A.model(s)];n=o.A.Tl(i,3)}}if(0===t&&0!==this.Ow&&n.translate(this.Ow,0,0),1===t&&0!==this.xw&&n.translate(this.xw,0,0),this.Vu&&this.Ku)for(let t=0;t1){let i=-1;for(let e=0;e<10;e++)t>=this.ow[e]&&0!==this.ow[e]&&(i=this.hw[e]);if(-1!==i)return u.get(i).dw(1)}if(u.So){const t=u.So.get(BigInt(this.id));if(t)return t}const i=o.A.model(this.model);if(this.Vu&&this.Ku)for(let t=0;t{e.d(i,{A:()=>h});var s=e(6333),n=e(1069),r=e(6730);class h extends s.${static count=0;static Lo=[];static hu=t=>{const i=new n.A(t.read('seq.dat'));this.count=i.ou;for(let t=0;t{e.d(i,{A:()=>a});var s=e(6333),n=e(1069),r=e(1312),h=e(8665),o=e(2679);class a extends s.${static count=0;static Lo=[];static So=new o.A(30);static hu=t=>{const i=new n.A(t.read('spotanim.dat'));this.count=i.ou;for(let t=0;t=40&&t<50)this.Vu[t-40]=i.ou;else{if(!(t>=50&&t<60))throw new Error(`Unrecognized spotanim config code: ${t}`);this.Ku[t-50]=i.ou}}al(){let t=a.So?.get(BigInt(this.id));if(t)return t;t=h.A.model(this.model);for(let i=0;i<6;i++)0!==this.Vu[0]&&t.Rl(this.Vu[i],this.Ku[i]);return a.So?.put(BigInt(this.id),t),t}}},3764:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(6333),n=e(1069);class r extends s.${static count=0;static Lo=[];static Kw=[];static Xw=0;static hu=t=>{const i=new n.A(t.read('varp.dat'));this.count=i.ou;for(let t=0;t{e.d(i,{A:()=>s});class s{static OPEN=0;static Jw=1;static Qw=2;static ty=4;static iy=8;static ey=s.Jw<<4;static sy=s.Qw<<4;static ny=s.ty<<4;static hy=s.iy<<4;static oy=256;static ly=512;static uy=1024;static wy=2048;static yy=4096;static Ay=s.ly<<4;static my=s.uy<<4;static py=s.wy<<4;static gy=s.yy<<4;static Iy=s.oy<<9;static _y=524288;static Cy=2097152;static Ey=s.Cy|s._y;static vy=s.oy|s.Ey;static by=s.Qw|s.vy;static Ty=s.iy|s.vy;static Ry=s.Qw|s.ty|s.Ty;static Oy=s.sy|s.vy;static Ly=s.iy|s.ey|s.Oy;static Sy=s.hy|s.vy;static xy=s.Jw|s.Qw|s.Sy;static ky=s.sy|s.ny|s.Sy;static My=16777215}},670:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(9456),n=e(6169),r=e(1023),h=e(4909);class o{static Dr=4;static jr=104;static index=(t,i)=>t*o.jr+i;offsetX;Dy;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.Dy=0,this.sizeX=o.jr,this.sizeZ=o.jr,this.flags=new Int32Array(this.sizeX*this.sizeZ),this.reset()}reset=()=>{for(let t=0;t{this.flags[o.index(t-this.offsetX,i-this.Dy)]|=s.A.Cy};Fy=(t,i)=>{this.flags[o.index(t-this.offsetX,i-this.Dy)]&=~s.A.Cy};By=(t,i,e,r,h,o)=>{let a=s.A.oy;o&&(a|=s.A.Iy);const l=t-this.offsetX,c=i-this.Dy;if(h===n.A.Uy||h===n.A.Py){const t=e;e=r,r=t}for(let t=l;t=0&&t=0&&i{let a=s.A.oy;o&&(a|=s.A.Iy);const l=t-this.offsetX,c=i-this.Dy;if(h===n.A.Uy||h===n.A.Py){const t=e;e=r,r=t}for(let t=l;t=0&&t=0&&i{const a=t-this.offsetX,l=i-this.Dy,c=o?s.A.gy:s.A.hy,f=o?s.A.yy:s.A.iy,u=o?s.A.uy:s.A.Qw,d=o?s.A.my:s.A.sy,w=o?s.A.ly:s.A.Jw,y=o?s.A.Ay:s.A.ey,A=o?s.A.wy:s.A.ty,m=o?s.A.py:s.A.ny;e===r.A.Yy.id?h===n.A.Md?(this.add(a,l,c),this.add(a-1,l,f)):h===n.A.Uy?(this.add(a,l,u),this.add(a,l+1,d)):h===n.A.Hy?(this.add(a,l,f),this.add(a+1,l,c)):h===n.A.Py&&(this.add(a,l,d),this.add(a,l-1,u)):e===r.A.Vy.id||e===r.A.Ky.id?h===n.A.Md?(this.add(a,l,w),this.add(a-1,l+1,y)):h===n.A.Uy?(this.add(a,l,A),this.add(a+1,l+1,m)):h===n.A.Hy?(this.add(a,l,y),this.add(a+1,l-1,w)):h===n.A.Py&&(this.add(a,l,m),this.add(a-1,l-1,A)):e===r.A.Xy.id&&(h===n.A.Md?(this.add(a,l,u|c),this.add(a-1,l,f),this.add(a,l+1,d)):h===n.A.Uy?(this.add(a,l,u|f),this.add(a,l+1,d),this.add(a+1,l,c)):h===n.A.Hy?(this.add(a,l,d|f),this.add(a+1,l,c),this.add(a,l-1,u)):h===n.A.Py&&(this.add(a,l,d|c),this.add(a,l-1,u),this.add(a-1,l,f))),o&&this.Wy(t,i,e,h,!1)};jy=(t,i,e,h,o)=>{const a=t-this.offsetX,l=i-this.Dy,c=o?s.A.gy:s.A.hy,f=o?s.A.yy:s.A.iy,u=o?s.A.uy:s.A.Qw,d=o?s.A.my:s.A.sy,w=o?s.A.ly:s.A.Jw,y=o?s.A.Ay:s.A.ey,A=o?s.A.wy:s.A.ty,m=o?s.A.py:s.A.ny;e===r.A.Yy.id?h===n.A.Md?(this.remove(a,l,c),this.remove(a-1,l,f)):h===n.A.Uy?(this.remove(a,l,u),this.remove(a,l+1,d)):h===n.A.Hy?(this.remove(a,l,f),this.remove(a+1,l,c)):h===n.A.Py&&(this.remove(a,l,d),this.remove(a,l-1,u)):e===r.A.Vy.id||e===r.A.Ky.id?h===n.A.Md?(this.remove(a,l,w),this.remove(a-1,l+1,y)):h===n.A.Uy?(this.remove(a,l,A),this.remove(a+1,l+1,m)):h===n.A.Hy?(this.remove(a,l,y),this.remove(a+1,l-1,w)):h===n.A.Py&&(this.remove(a,l,m),this.remove(a-1,l-1,A)):e===r.A.Xy.id&&(h===n.A.Md?(this.remove(a,l,u|c),this.remove(a-1,l,f),this.remove(a,l+1,d)):h===n.A.Uy?(this.remove(a,l,u|f),this.remove(a,l+1,d),this.remove(a+1,l,c)):h===n.A.Hy?(this.remove(a,l,d|f),this.remove(a+1,l,c),this.remove(a,l-1,u)):h===n.A.Py&&(this.remove(a,l,d|c),this.remove(a,l-1,u),this.remove(a-1,l,f))),o&&this.jy(t,i,e,h,!1)};zy=(t,i,e,h,a,l)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.Dy,u=e-this.offsetX,d=h-this.Dy,w=o.index(c,f);if(a===r.A.Yy.id){if(l===n.A.Md){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Oy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.by)===s.A.OPEN)return!0}else if(l===n.A.Uy){if(c===u&&f===d+1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Ty)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Sy)===s.A.OPEN)return!0}else if(l===n.A.Hy){if(c===u+1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Oy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.by)===s.A.OPEN)return!0}else if(l===n.A.Py){if(c===u&&f===d-1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Ty)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Sy)===s.A.OPEN)return!0}}else if(a===r.A.Xy.id){if(l===n.A.Md){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Sy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.by)===s.A.OPEN)return!0}else if(l===n.A.Uy){if(c===u-1&&f===d&&(this.flags[w]&s.A.Ty)===s.A.OPEN)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.by)===s.A.OPEN)return!0}else if(l===n.A.Hy){if(c===u-1&&f===d&&(this.flags[w]&s.A.Ty)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Oy)===s.A.OPEN)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1)return!0}else if(l===n.A.Py){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Oy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Sy)===s.A.OPEN)return!0;if(c===u&&f===d-1)return!0}}else if(a===r.A.Zy.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.sy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Qw)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.iy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.hy)===s.A.OPEN)return!0}return!1};qy=(t,i,e,h,a,l)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.Dy,u=e-this.offsetX,d=h-this.Dy,w=o.index(c,f);if(a===r.A.$y.id||a===r.A.Jy.id){if(a===r.A.Jy.id&&(l=l+2&3),l===n.A.Md){if(c===u+1&&f===d&&(this.flags[w]&s.A.hy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Qw)===s.A.OPEN)return!0}else if(l===n.A.Uy){if(c===u-1&&f===d&&(this.flags[w]&s.A.iy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Qw)===s.A.OPEN)return!0}else if(l===n.A.Hy){if(c===u-1&&f===d&&(this.flags[w]&s.A.iy)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.sy)===s.A.OPEN)return!0}else if(l===n.A.Py){if(c===u+1&&f===d&&(this.flags[w]&s.A.hy)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.sy)===s.A.OPEN)return!0}}else if(a===r.A.Qy.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.sy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Qw)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.iy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.hy)===s.A.OPEN)return!0}return!1};tA=(t,i,e,n,r,a,l)=>{const c=e+r-1,f=n+a-1,u=o.index(t-this.offsetX,i-this.Dy);return t>=e&&t<=c&&i>=n&&i<=f||(t===e-1&&i>=n&&i<=f&&(this.flags[u]&s.A.iy)===s.A.OPEN&&(l&h.A.Md)===s.A.OPEN||(t===c+1&&i>=n&&i<=f&&(this.flags[u]&s.A.hy)===s.A.OPEN&&(l&h.A.Hy)===s.A.OPEN||(i===n-1&&t>=e&&t<=c&&(this.flags[u]&s.A.Qw)===s.A.OPEN&&(l&h.A.Py)===s.A.OPEN||i===f+1&&t>=e&&t<=c&&(this.flags[u]&s.A.sy)===s.A.OPEN&&(l&h.A.Uy)===s.A.OPEN)))};add=(t,i,e)=>{this.flags[o.index(t,i)]|=e};remove=(t,i,e)=>{this.flags[o.index(t,i)]&=s.A.My-e}}},4909:(t,i,e)=>{e.d(i,{A:()=>s});class s{static Uy=1;static Hy=2;static Py=4;static Md=8}},6169:(t,i,e)=>{e.d(i,{A:()=>s});class s{static Md=0;static Uy=1;static Hy=2;static Py=3}},5599:(t,i,e)=>{e.d(i,{A:()=>s});class s{static iA=0;static eA=1;static sA=2;static nA=3}},1023:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5599);class n{static Yy=new n(0,s.A.iA);static Vy=new n(1,s.A.iA);static Xy=new n(2,s.A.iA);static Ky=new n(3,s.A.iA);static rA=new n(4,s.A.eA);static hA=new n(5,s.A.eA);static $y=new n(6,s.A.eA);static Jy=new n(7,s.A.eA);static Qy=new n(8,s.A.eA);static Zy=new n(9,s.A.sA);static td=new n(10,s.A.sA);static oA=new n(11,s.A.sA);static aA=new n(12,s.A.sA);static lA=new n(13,s.A.sA);static cA=new n(14,s.A.sA);static fA=new n(15,s.A.sA);static uA=new n(16,s.A.sA);static dA=new n(17,s.A.sA);static wA=new n(18,s.A.sA);static yA=new n(19,s.A.sA);static AA=new n(20,s.A.sA);static mA=new n(21,s.A.sA);static nA=new n(22,s.A.nA);static values(){return[this.Yy,this.Vy,this.dA,this.fA,this.Xy,this.cA,this.Zy,this.Ky,this.nA,this.aA,this.oA,this.$y,this.AA,this.td,this.hA,this.lA,this.Jy,this.rA,this.uA,this.Qy,this.yA,this.mA,this.wA]}static of(t){const i=this.values();for(let e=0;e{e.d(i,{A:()=>A});var s=e(670),n=e(2164),r=e(1069),h=e(4583),o=e(3045),a=e(5637),l=e(4197),c=e(1312),f=e(1023),u=e(6169),d=e(9298),w=e(5518),y=e(3867);class A{static pA=Int8Array.of(1,2,4,8);static gA=Uint8Array.of(16,32,64,128);static IA=Int8Array.of(1,0,-1,0);static _A=Int8Array.of(0,-1,0,1);static CA=(17*Math.random()|0)-8;static EA=(33*Math.random()|0)-16;static et=!0;static vA=0;static bA=!1;static TA=(t,i)=>{let e=this.RA(t+45365,i+91923,4)+(this.RA(t+10294,i+37821,2)-128>>1)+(this.RA(t,i,1)-128>>2)-128;return e=35+(.3*e|0),e<10?e=10:e>60&&(e=60),e};static RA=(t,i,e)=>{const s=t/e|0,n=t&e-1,r=i/e|0,h=i&e-1,o=this.OA(s,r),a=this.OA(s+1,r),l=this.OA(s,r+1),c=this.OA(s+1,r+1),f=this.LA(o,a,n,e),u=this.LA(l,c,n,e);return this.LA(f,u,h,e)};static LA=(t,i,e,s)=>{const n=65536-h.A.cos[1024*e/s|0]>>1;return(t*(65536-n)>>16)+(i*n>>16)};static OA=(t,i)=>((this.SA(t-1,i-1)+this.SA(t+1,i-1)+this.SA(t-1,i+1)+this.SA(t+1,i+1))/16|0)+((this.SA(t-1,i)+this.SA(t+1,i)+this.SA(t,i-1)+this.SA(t,i+1))/8|0)+(this.SA(t,i)/4|0);static SA=(t,i)=>{const e=t+57*i,s=BigInt(e<<13^e);return 255&Number((s*(s*s*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static By=(t,i,e,s,n,r,h,o,d,w,y)=>{const m=n[y][i][e],p=n[y][i+1][e],g=n[y][i+1][e+1],I=n[y][i][e+1],_=m+p+g+I>>2,C=a.A.get(o);let E=i+(e<<7)+(o<<14)+1073741824|0;C.active||(E+=-2147483648),E|=0;const v=(w<<6)+d<<24>>24;if(d===f.A.nA.id)s?.xA(C.al(f.A.nA.id,w,m,p,g,I,-1),t,i,e,_,E,v),C.nd&&C.active&&h?.Ny(i,e),-1!==C.la&&r.kA(new l.A(o,t,3,i,e,c.A.Lo[C.la],!0));else if(d===f.A.td.id||d===f.A.oA.id){const n=C.al(f.A.td.id,w,m,p,g,I,-1);if(n){let r,h,o=0;d===f.A.oA.id&&(o+=256),w===u.A.Uy||w===u.A.Py?(r=C.length,h=C.width):(r=C.width,h=C.length),s?.By(t,i,e,_,n,null,E,v,r,h,o)}C.nd&&h?.By(i,e,C.width,C.length,w,C.rd),-1!==C.la&&r.kA(new l.A(o,t,2,i,e,c.A.Lo[C.la],!0))}else if(d>=f.A.aA.id)s?.By(t,i,e,_,C.al(d,w,m,p,g,I,-1),null,E,v,1,1,0),C.nd&&h?.By(i,e,C.width,C.length,w,C.rd),-1!==C.la&&r.kA(new l.A(o,t,2,i,e,c.A.Lo[C.la],!0));else if(d===f.A.Yy.id)s?.Wy(t,i,e,_,A.pA[w],0,C.al(f.A.Yy.id,w,m,p,g,I,-1),null,E,v),C.nd&&h?.Wy(i,e,d,w,C.rd),-1!==C.la&&r.kA(new l.A(o,t,0,i,e,c.A.Lo[C.la],!0));else if(d===f.A.Vy.id)s?.Wy(t,i,e,_,A.gA[w],0,C.al(f.A.Vy.id,w,m,p,g,I,-1),null,E,v),C.nd&&h?.Wy(i,e,d,w,C.rd),-1!==C.la&&r.kA(new l.A(o,t,0,i,e,c.A.Lo[C.la],!0));else if(d===f.A.Xy.id){const n=w+1&3;s?.Wy(t,i,e,_,A.pA[w],A.pA[n],C.al(f.A.Xy.id,w+4,m,p,g,I,-1),C.al(f.A.Xy.id,n,m,p,g,I,-1),E,v),C.nd&&h?.Wy(i,e,d,w,C.rd),-1!==C.la&&r.kA(new l.A(o,t,0,i,e,c.A.Lo[C.la],!0))}else if(d===f.A.Ky.id)s?.Wy(t,i,e,_,A.gA[w],0,C.al(f.A.Ky.id,w,m,p,g,I,-1),null,E,v),C.nd&&h?.Wy(i,e,d,w,C.rd),-1!==C.la&&r.kA(new l.A(o,t,0,i,e,c.A.Lo[C.la],!0));else if(d===f.A.Zy.id)s?.By(t,i,e,_,C.al(d,w,m,p,g,I,-1),null,E,v,1,1,0),C.nd&&h?.By(i,e,C.width,C.length,w,C.rd),-1!==C.la&&r.kA(new l.A(o,t,2,i,e,c.A.Lo[C.la],!0));else if(d===f.A.rA.id)s?.MA(t,i,e,_,0,0,E,C.al(f.A.rA.id,u.A.Md,m,p,g,I,-1),v,512*w,A.pA[w]),-1!==C.la&&r.kA(new l.A(o,t,1,i,e,c.A.Lo[C.la],!0));else if(d===f.A.hA.id){let n=16;if(s){const r=s.DA(t,i,e);r>0&&(n=a.A.get(r>>14&32767).ld)}s?.MA(t,i,e,_,A.IA[w]*n,A._A[w]*n,E,C.al(f.A.rA.id,u.A.Md,m,p,g,I,-1),v,512*w,A.pA[w]),-1!==C.la&&r.kA(new l.A(o,t,1,i,e,c.A.Lo[C.la],!0))}else d===f.A.$y.id?(s?.MA(t,i,e,_,0,0,E,C.al(f.A.rA.id,u.A.Md,m,p,g,I,-1),v,w,256),-1!==C.la&&r.kA(new l.A(o,t,1,i,e,c.A.Lo[C.la],!0))):d===f.A.Jy.id?(s?.MA(t,i,e,_,0,0,E,C.al(f.A.rA.id,u.A.Md,m,p,g,I,-1),v,w,512),-1!==C.la&&r.kA(new l.A(o,t,1,i,e,c.A.Lo[C.la],!0))):d===f.A.Qy.id&&(s?.MA(t,i,e,_,0,0,E,C.al(f.A.rA.id,u.A.Md,m,p,g,I,-1),v,w,768),-1!==C.la&&r.kA(new l.A(o,t,1,i,e,c.A.Lo[C.la],!0)))};NA;FA;Hr;Vr;BA;UA;PA;GA;WA;YA;HA;VA;KA;XA;jA;zA;constructor(t,i,e,n){this.NA=t,this.FA=i,this.Hr=e,this.Vr=n,this.BA=new y.ZA(s.A.Dr,t,i),this.UA=new y.ZA(s.A.Dr,t,i),this.PA=new y.ZA(s.A.Dr,t,i),this.GA=new y.ZA(s.A.Dr,t,i),this.zA=new y.qA(s.A.Dr,t+1,i+1),this.WA=new y.ZA(s.A.Dr,t+1,i+1),this.YA=new y.Xr(t+1,i+1),this.HA=new Int32Array(i),this.VA=new Int32Array(i),this.KA=new Int32Array(i),this.XA=new Int32Array(i),this.jA=new Int32Array(i)}$A=(t,i)=>{for(let t=0;t=0&&i[s]?.Ny(e,n)}A.CA+=(5*Math.random()|0)-2,A.CA<-8?A.CA=-8:A.CA>8&&(A.CA=8),A.EA+=(5*Math.random()|0)-2,A.EA<-16?A.EA=-16:A.EA>16&&(A.EA=16);for(let i=0;i>8;for(let t=1;t>2)+(e[n+1][t]>>3)+(e[n][t-1]>>2)+(e[n][t+1]>>3)+(e[n][t]>>1);this.YA[n][t]=u-d}for(let t=0;t=0&&s0){const i=n.A.Lo[e-1];this.HA[t]+=i.Pu,this.VA[t]+=i.Fu,this.KA[t]+=i.Bu,this.XA[t]+=i.Uu,r=this.jA[t]++}}const h=e-5;if(h>=0&&h0){const i=n.A.Lo[e-1];this.HA[t]-=i.Pu,this.VA[t]-=i.Fu,this.KA[t]-=i.Bu,this.XA[t]-=i.Uu,r=this.jA[t]--}}}if(e>=1&&e=0&&f=0&&y=1&&c0||y>0){const m=this.Hr[i][e][c],p=this.Hr[i][e+1][c],g=this.Hr[i][e+1][c+1],I=this.Hr[i][e][c+1],_=this.YA[e][c],C=this.YA[e+1][c],E=this.YA[e+1][c+1],v=this.YA[e][c+1];let b=-1,T=-1;if(f>0){const t=256*s/a|0,i=r/l|0;let e=o/l|0;b=n.A.Lu(t,i,e);const h=t+A.CA&255;e+=A.EA,e<0?e=0:e>255&&(e=255),T=n.A.Lu(h,i,e)}if(i>0){let t=0!==f||this.PA[i][e][c]===w.A.QA;y>0&&!n.A.Lo[y-1].Du&&(t=!1),t&&m===p&&m===g&&m===I&&(this.zA[i][e][c]|=2340)}let R=0;if(-1!==b&&(R=h.A.palette[n.A.Su(T,96)]),0===y)t?.tm(i,e,c,w.A.QA,u.A.Md,-1,m,p,g,I,n.A.Su(b,_),n.A.Su(b,C),n.A.Su(b,E),n.A.Su(b,v),d.A.Pa,d.A.Pa,d.A.Pa,d.A.Pa,R,d.A.Pa);else{const s=this.PA[i][e][c]+1,r=this.GA[i][e][c],o=n.A.Lo[y-1];let a,l,f=o.texture;f>=0?(l=h.A.im(f),a=-1):o.ku===d.A.sm?(l=0,a=-2,f=-1):(a=n.A.Lu(o.Nu,o.Fu,o.Bu),l=h.A.palette[n.A.xu(o.Gu,96)]),t?.tm(i,e,c,s,r,f,m,p,g,I,n.A.Su(b,_),n.A.Su(b,C),n.A.Su(b,E),n.A.Su(b,v),n.A.xu(a,_),n.A.xu(a,C),n.A.xu(a,E),n.A.xu(a,v),R,l)}}}}}}for(let e=1;e0&&(t<<=3,i<<=3,e<<=3);for(let s=0;s<=n;s++)for(let r=0;r<=this.FA;r++)for(let h=0;h<=this.NA;h++){if(this.zA[s][h][r]&t){let i=r,e=r,a=s,l=s;for(;i>0&&this.zA[s][h][i-1]&t;)i--;for(;e0;){for(let s=i;s<=e;s++)if(!(this.zA[a-1][h][s]&t))break t;a--}t:for(;l=8){const s=this.Hr[l][h][i]-240,r=this.Hr[a][h][i];o.A.om(n,1,128*h,s,128*i,128*h,r,128*e+128);for(let s=a;s<=l;s++)for(let n=i;n<=e;n++)this.zA[s][h][n]&=~t}}if(this.zA[s][h][r]&i){let t=h,e=h,a=s,l=s;for(;t>0&&this.zA[s][t-1][r]&i;)t--;for(;e0;){for(let s=t;s<=e;s++)if(!(this.zA[a-1][s][r]&i))break t;a--}t:for(;l=8){const s=this.Hr[l][t][r]-240,h=this.Hr[a][t][r];o.A.om(n,2,128*t,s,128*r,128*e+128,h,128*r);for(let s=a;s<=l;s++)for(let n=t;n<=e;n++)this.zA[s][n][r]&=~i}}if(this.zA[s][h][r]&e){let t=h,i=h,a=r,l=r;for(;a>0&&this.zA[s][h][a-1]&e;)a--;for(;l0;){for(let i=a;i<=l;i++)if(!(this.zA[s][t-1][i]&e))break t;t--}t:for(;i=4){const r=this.Hr[s][t][a];o.A.om(n,4,128*t,r,128*a,128*i+128,r,128*l+128);for(let n=t;n<=i;n++)for(let t=a;t<=l;t++)this.zA[s][n][t]&=~e}}}}}};am=(t,i,e,r)=>{let h=0;for(let t=0;t>24;break}for(let n=t;n=0&&t=0&&n{const o=new r.A(new Uint8Array(h));for(let r=0;r=0&&l=0&&c>24,this.GA[r][l][c]=(f-2&3)<<24>>24):f<=81?this.Vr[r][l][c]=f-49<<24>>24:this.BA[r][l][c]=f-81<<24>>24}else for(;f=o.lu,0!==f;){if(1===f){o.lu;break}f<=49&&o.lu}}};fm=(t,i,e,n,h,o)=>{const a=new r.A(new Uint8Array(n));let l=-1;for(;;){const n=a.um;if(0===n)return;l+=n;let r=0;for(;;){const n=a.um;if(0===n)break;r+=n-1;const c=63&r,f=r>>6&63,u=r>>12,d=a.lu,w=d>>2,y=3&d,A=f+h,m=c+o;if(A>0&&m>0&&A=0&&(n=e[s]),this.By(u,A,m,t,i,n,l,w,y)}}}};By=(t,i,e,s,n,r,h,o,d)=>{if(A.et){if(16&this.Vr[t][i][e])return;if(this.JA(t,i,e)!==A.vA)return}const w=this.Hr[t][i][e],y=this.Hr[t][i+1][e],m=this.Hr[t][i+1][e+1],p=this.Hr[t][i][e+1],g=w+y+m+p>>2,I=a.A.get(h);let _=i+(e<<7)+(h<<14)+1073741824|0;I.active||(_+=-2147483648),_|=0;const C=(d<<6)+o<<24>>24;if(o===f.A.nA.id)(!A.et||I.active||I.vd)&&(s?.xA(I.al(f.A.nA.id,d,w,y,m,p,-1),t,i,e,g,_,C),I.nd&&I.active&&r?.Ny(i,e),-1!==I.la&&n.kA(new l.A(h,t,3,i,e,c.A.Lo[I.la],!0)));else if(o===f.A.td.id||o===f.A.oA.id){const a=I.al(f.A.td.id,d,w,y,m,p,-1);if(a){let n,r,h=0;if(o===f.A.oA.id&&(h+=256),d===u.A.Uy||d===u.A.Py?(n=I.length,r=I.width):(n=I.width,r=I.length),s?.By(t,i,e,g,a,null,_,C,n,r,h)&&I.Ad)for(let s=0;s<=n;s++)for(let n=0;n<=r;n++){let r=a.dm/4|0;r>30&&(r=30),r>this.WA[t][i+s][e+n]&&(this.WA[t][i+s][e+n]=r<<24>>24)}}I.nd&&r?.By(i,e,I.width,I.length,d,I.rd),-1!==I.la&&n.kA(new l.A(h,t,2,i,e,c.A.Lo[I.la],!0))}else if(o>=f.A.aA.id)s?.By(t,i,e,g,I.al(o,d,w,y,m,p,-1),null,_,C,1,1,0),o>=f.A.aA.id&&o<=f.A.dA.id&&o!==f.A.lA.id&&t>0&&(this.zA[t][i][e]|=2340),I.nd&&r?.By(i,e,I.width,I.length,d,I.rd),-1!==I.la&&n.kA(new l.A(h,t,2,i,e,c.A.Lo[I.la],!0));else if(o===f.A.Yy.id)s?.Wy(t,i,e,g,A.pA[d],0,I.al(f.A.Yy.id,d,w,y,m,p,-1),null,_,C),d===u.A.Md?(I.Ad&&(this.WA[t][i][e]=50,this.WA[t][i][e+1]=50),I.Du&&(this.zA[t][i][e]|=585)):d===u.A.Uy?(I.Ad&&(this.WA[t][i][e+1]=50,this.WA[t][i+1][e+1]=50),I.Du&&(this.zA[t][i][e+1]|=1170)):d===u.A.Hy?(I.Ad&&(this.WA[t][i+1][e]=50,this.WA[t][i+1][e+1]=50),I.Du&&(this.zA[t][i+1][e]|=585)):d===u.A.Py&&(I.Ad&&(this.WA[t][i][e]=50,this.WA[t][i+1][e]=50),I.Du&&(this.zA[t][i][e]|=1170)),I.nd&&r?.Wy(i,e,o,d,I.rd),-1!==I.la&&n.kA(new l.A(h,t,0,i,e,c.A.Lo[I.la],!0)),16!==I.ld&&s?.wm(t,i,e,I.ld);else if(o===f.A.Vy.id)s?.Wy(t,i,e,g,A.gA[d],0,I.al(f.A.Vy.id,d,w,y,m,p,-1),null,_,C),I.Ad&&(d===u.A.Md?this.WA[t][i][e+1]=50:d===u.A.Uy?this.WA[t][i+1][e+1]=50:d===u.A.Hy?this.WA[t][i+1][e]=50:d===u.A.Py&&(this.WA[t][i][e]=50)),I.nd&&r?.Wy(i,e,o,d,I.rd),-1!==I.la&&n.kA(new l.A(h,t,0,i,e,c.A.Lo[I.la],!0));else if(o===f.A.Xy.id){const a=d+1&3;s?.Wy(t,i,e,g,A.pA[d],A.pA[a],I.al(f.A.Xy.id,d+4,w,y,m,p,-1),I.al(f.A.Xy.id,a,w,y,m,p,-1),_,C),I.Du&&(d===u.A.Md?(this.zA[t][i][e]|=265,this.zA[t][i][e+1]|=1170):d===u.A.Uy?(this.zA[t][i][e+1]|=1170,this.zA[t][i+1][e]|=585):d===u.A.Hy?(this.zA[t][i+1][e]|=585,this.zA[t][i][e]|=1170):d===u.A.Py&&(this.zA[t][i][e]|=1170,this.zA[t][i][e]|=585)),I.nd&&r?.Wy(i,e,o,d,I.rd),-1!==I.la&&n.kA(new l.A(h,t,0,i,e,c.A.Lo[I.la],!0)),16!==I.ld&&s?.wm(t,i,e,I.ld)}else if(o===f.A.Ky.id)s?.Wy(t,i,e,g,A.gA[d],0,I.al(f.A.Ky.id,d,w,y,m,p,-1),null,_,C),I.Ad&&(d===u.A.Md?this.WA[t][i][e+1]=50:d===u.A.Uy?this.WA[t][i+1][e+1]=50:d===u.A.Hy?this.WA[t][i+1][e]=50:d===u.A.Py&&(this.WA[t][i][e]=50)),I.nd&&r?.Wy(i,e,o,d,I.rd),-1!==I.la&&n.kA(new l.A(h,t,0,i,e,c.A.Lo[I.la],!0));else if(o===f.A.Zy.id)s?.By(t,i,e,g,I.al(o,d,w,y,m,p,-1),null,_,C,1,1,0),I.nd&&r?.By(i,e,I.width,I.length,d,I.rd),-1!==I.la&&n.kA(new l.A(h,t,2,i,e,c.A.Lo[I.la],!0));else if(o===f.A.rA.id)s?.MA(t,i,e,g,0,0,_,I.al(f.A.rA.id,u.A.Md,w,y,m,p,-1),C,512*d,A.pA[d]),-1!==I.la&&n.kA(new l.A(h,t,1,i,e,c.A.Lo[I.la],!0));else if(o===f.A.hA.id){let r=16;if(s){const n=s.DA(t,i,e);n>0&&(r=a.A.get(n>>14&32767).ld)}s?.MA(t,i,e,g,A.IA[d]*r,A._A[d]*r,_,I.al(f.A.rA.id,u.A.Md,w,y,m,p,-1),C,512*d,A.pA[d]),-1!==I.la&&n.kA(new l.A(h,t,1,i,e,c.A.Lo[I.la],!0))}else o===f.A.$y.id?(s?.MA(t,i,e,g,0,0,_,I.al(f.A.rA.id,u.A.Md,w,y,m,p,-1),C,d,256),-1!==I.la&&n.kA(new l.A(h,t,1,i,e,c.A.Lo[I.la],!0))):o===f.A.Jy.id?(s?.MA(t,i,e,g,0,0,_,I.al(f.A.rA.id,u.A.Md,w,y,m,p,-1),C,d,512),-1!==I.la&&n.kA(new l.A(h,t,1,i,e,c.A.Lo[I.la],!0))):o===f.A.Qy.id&&(s?.MA(t,i,e,g,0,0,_,I.al(f.A.rA.id,u.A.Md,w,y,m,p,-1),C,d,768),-1!==I.la&&n.kA(new l.A(h,t,1,i,e,c.A.Lo[I.la],!0)))};JA=(t,i,e)=>8&this.Vr[t][i][e]?0:t<=0||!(2&this.Vr[1][i][e])?t:t-1}},3045:(t,i,e)=>{e.d(i,{A:()=>g});var s=e(4583),n=e(1161),r=e(3795),h=e(8256),o=e(670),a=e(9222),l=e(6855),c=e(7441),f=e(6666),u=e(5748),d=e(3479),w=e(8950),y=e(2771),A=e(5518),m=e(6169),p=e(3867);class g{static ym=new p.Am(8,32,51,51,!1);static pm=new p.fe(100,null);static gm=new Int32Array(o.A.Dr);static Im=new p._m(o.A.Dr,500,null);static Cm=new p.fe(500,null);static Em=new f.A;static vm=0;static bm=0;static Tm=0;static Rm=0;static Om=0;static Lm=0;static Sm=0;static xm=0;static km=0;static Mm=0;static Dm=0;static Nm=0;static Fm=0;static Bm=0;static Um=0;static Pm=0;static Gm=0;static Wm=0;static Ym=0;static Hm=0;static Vm=0;static Km=0;static Xm=!1;static jm=null;static zm=Uint8Array.of(19,55,38,155,255,110,137,205,76);static Zm=Uint8Array.of(160,192,80,96,0,144,80,48,160);static qm=Uint8Array.of(76,8,137,4,0,1,38,2,19);static $m=Int8Array.of(0,0,2,0,0,2,1,1,0);static Jm=Int8Array.of(2,0,0,2,0,0,0,4,4);static Qm=Int8Array.of(0,4,4,8,0,0,8,0,0);static tp=Int8Array.of(1,1,0,0,0,8,0,0,8);static ip=Int8Array.of(53,-53,-53,53);static ep=Int8Array.of(-53,-53,53,53);static sp=Int8Array.of(-45,45,45,-45);static np=Int8Array.of(45,45,-45,-45);static rp=[new Int8Array(16),Int8Array.of(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,0,0,0,1,1,0,0,1,1,1,0,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1),Int8Array.of(0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0),Int8Array.of(0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0),Int8Array.of(1,1,1,1,1,1,1,1,0,1,1,1,0,0,1,1),Int8Array.of(1,1,1,1,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,0,0,0,0,1,1,0,1,1,1,0,1,1,1),Int8Array.of(0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1)];static hp=[Int8Array.of(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),Int8Array.of(12,8,4,0,13,9,5,1,14,10,6,2,15,11,7,3),Int8Array.of(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0),Int8Array.of(3,7,11,15,2,6,10,14,1,5,9,13,0,4,8,12)];static op=Int32Array.of(41,39248,41,4643,41,41,41,41,41,41,41,41,41,41,41,43086,41,41,41,41,41,41,41,8602,41,28992,41,41,41,41,41,5056,41,41,41,41,41,41,41,41,41,41,41,41,41,41,3131,41,41,41);static ap=0;static Ma=0;static Da=0;static lp=-1;static cp=-1;static et=!0;static init=(t,i,e,n,r)=>{this.bm=0,this.Tm=0,this.Rm=t,this.Om=i,this.Lm=t/2|0,this.Sm=i/2|0;const h=new p.Am(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let i=0;i<2048;i+=64){this.xm=s.A.sin[t],this.km=s.A.cos[t],this.Mm=s.A.sin[i],this.Dm=s.A.cos[i];const o=(t-128)/32|0,a=i/64|0;for(let t=-26;t<=26;t++)for(let i=-26;i<=26;i++){const s=128*t,l=128*i;let c=!1;for(let t=-e;t<=n;t+=128)if(this.fp(s,l,r[o]+t)){c=!0;break}h[o][a][t+25+1][i+25+1]=c}}for(let t=0;t<8;t++)for(let i=0;i<32;i++)for(let e=-25;e<25;e++)for(let s=-25;s<25;s++){let n=!1;t:for(let r=-1;r<=1;r++)for(let o=-1;o<=1;o++){if(h[t][i][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t][(i+1)%31][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][i][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][(i+1)%31][e+r+25+1][s+o+25+1]){n=!0;break t}}this.ym[t][i][e+25][s+25]=n}};static To=()=>{this.pm=null,this.gm=null,this.Im=null,this.Em=null,this.ym=null,this.Cm=null,this.jm=null,console.log('World3D unloaded!')};static om=(t,i,e,s,n,r,o,a)=>{g.Im[t][g.gm[t]++]=new h.A(e/128|0,r/128|0,n/128|0,a/128|0,i,e,r,n,a,s,o)};static fp=(t,i,e)=>{const s=i*this.Mm+t*this.Dm>>16,n=i*this.Dm-t*this.Mm>>16,r=e*this.xm+n*this.km>>16,h=e*this.km-n*this.xm>>16;if(r<50||r>3500)return!1;const o=this.Lm+((s<<9)/r|0),a=this.Sm+((h<<9)/r|0);return o>=this.bm&&o<=this.Rm&&a>=this.Tm&&a<=this.Om};up;NA;FA;dp;wp;_h;yp;Ap;mp;pp=0;gp=0;Ip=0;constructor(t,i,e,s){this.up=e,this.NA=s,this.FA=i,this.wp=new p.Eh(e,s,i,null),this.yp=new p.qA(e,s+1,i+1),this.dp=t,this._h=new p.fe(5e3,null),this.Ap=new Int32Array(1e4),this.mp=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this.gp=t;for(let i=0;i{const e=this.wp[0][t][i];for(let e=0;e<3;e++){this.wp[e][t][i]=this.wp[e+1][t][i];const s=this.wp[e][t][i];s&&s.level--}this.wp[0][t][i]||(this.wp[0][t][i]=new r.A(0,t,i));const s=this.wp[0][t][i];s&&(s.Cp=e),this.wp[3][t][i]=null};nm=(t,i,e,s)=>{const n=this.wp[t][i][e];n&&(n.Ep=s)};tm=(t,i,e,s,n,h,o,a,l,c,f,u,w,m,p,g,I,_,C,E)=>{if(s===A.A.QA){for(let s=t;s>=0;s--)this.wp[s][i][e]||(this.wp[s][i][e]=new r.A(s,i,e));const s=this.wp[t][i][e];s&&(s.vp=new d.A(f,u,w,m,-1,C,!1))}else if(s===A.A.bp){for(let s=t;s>=0;s--)this.wp[s][i][e]||(this.wp[s][i][e]=new r.A(s,i,e));const s=this.wp[t][i][e];s&&(s.vp=new d.A(p,g,I,_,h,E,o===a&&o===l&&o===c))}else{for(let s=t;s>=0;s--)this.wp[s][i][e]||(this.wp[s][i][e]=new r.A(s,i,e));const d=this.wp[t][i][e];d&&(d.Tp=new y.A(i,s,g,a,w,n,f,c,E,p,h,_,C,l,I,m,o,e,u))}};xA=(t,i,e,s,n,h,o)=>{this.wp[i][e][s]||(this.wp[i][e][s]=new r.A(i,e,s));const l=this.wp[i][e][s];l&&(l.Rp=new a.A(n,128*e+64,128*s+64,t,h,o))};Op=(t,i,e)=>{const s=this.wp[t][i][e];s&&(s.Rp=null)};Lp=(t,i,e,s,n,h,o,a)=>{let l=0;const c=this.wp[s][t][i];if(c)for(let t=0;tl&&(l=e)}else this.wp[s][t][i]=new r.A(s,t,i);const f=this.wp[s][t][i];f&&(f.kp=new u.A(e,128*t+64,128*i+64,h,o,a,n,l))};Mp=(t,i,e)=>{const s=this.wp[t][i][e];s&&(s.kp=null)};Wy=(t,i,e,s,n,h,o,a,c,f)=>{if(!o&&!a)return;for(let s=t;s>=0;s--)this.wp[s][i][e]||(this.wp[s][i][e]=new r.A(s,i,e));const u=this.wp[t][i][e];u&&(u.Dp=new l.A(s,128*i+64,128*e+64,n,h,o,a,c,f))};jy=(t,i,e,s)=>{const n=this.wp[t][i][e];1===s&&n&&(n.Dp=null)};MA=(t,i,e,s,n,h,o,a,l,f,u)=>{if(!a)return;for(let s=t;s>=0;s--)this.wp[s][i][e]||(this.wp[s][i][e]=new r.A(s,i,e));const d=this.wp[t][i][e];d&&(d.Np=new c.A(s,128*i+n+64,128*e+h+64,u,f,a,o,l))};Fp=(t,i,e)=>{const s=this.wp[t][i][e];s&&(s.Np=null)};wm=(t,i,e,s)=>{const n=this.wp[t][i][e];if(!n)return;const r=n.Np;if(!r)return;const h=128*i+64,o=128*e+64;r.x=h+((r.x-h)*s/16|0),r.z=o+((r.z-o)*s/16|0)};Bp=(t,i,e,s)=>{if(!s)return;const n=this.wp[t][i][e];if(!n)return;const r=n.Np;r&&(r.model=s)};Up=(t,i,e,s)=>{if(!s)return;const n=this.wp[t][i][e];if(!n)return;const r=n.Rp;r&&(r.model=s)};Pp=(t,i,e,s)=>{if(!s)return;const n=this.wp[t][i][e];if(!n)return;const r=n.Dp;r&&(r.Gp=s)};Wp=(t,i,e,s,n)=>{if(!s)return;const r=this.wp[e][t][i];if(!r)return;const h=r.Dp;h&&(h.Gp=s,h.Yp=n)};By=(t,i,e,s,n,r,h,o,a,l,c)=>{if(!n&&!r)return!0;const f=128*i+64*a,u=128*e+64*l;return this.Hp(f,u,s,t,i,e,a,l,n,r,h,o,c,!1)};Vp=(t,i,e,s,n,r,h,o,a,l)=>{if(!n&&!r)return!0;let c=i-a,f=s-a,u=i+a,d=s+a;return l&&(o>640&&o<1408&&(d+=128),o>1152&&o<1920&&(u+=128),(o>1664||o<384)&&(f-=128),o>128&&o<896&&(c-=128)),c=c/128|0,f=f/128|0,u=u/128|0,d=d/128|0,this.Hp(i,s,e,t,c,f,u+1-c,d-f+1,n,r,h,0,o,!0)};Kp=(t,i,e,s,n,r,h,o,a,l,c,f)=>!a&&!l||this.Hp(i,s,e,t,n,r,h+1-n,o-r+1,a,l,c,0,f,!0);Gy=(t,i,e)=>{const s=this.wp[t][i][e];if(s)for(let t=0;t>29&3)&&n.jp===i&&n.zp===e)return void this.Zp(n)}};qp=(t,i,e,s)=>{if(!s)return;const n=this.wp[t][i][e];if(n)for(let t=0;t>29&3))return void(i.model=s)}};$p=()=>{for(let t=0;t{const s=this.wp[t][i][e];return s&&s.Dp?s.Dp.Xp:0};Jp=(t,i,e)=>{const s=this.wp[t][e][i];return s&&s.Np?s.Np.Xp:0};Qp=(t,i,e)=>{const s=this.wp[t][i][e];if(!s)return 0;for(let t=0;t>29&3)&&n.jp===i&&n.zp===e)return n.Xp}return 0};tg=(t,i,e)=>{const s=this.wp[t][i][e];return s&&s.Rp?s.Rp.Xp:0};ig=(t,i,e,s)=>{const n=this.wp[t][i][e];if(n){if(n.Dp&&n.Dp.Xp===s)return 255&n.Dp.info;if(n.Np&&n.Np.Xp===s)return 255&n.Np.info;if(n.Rp&&n.Rp.Xp===s)return 255&n.Rp.info;for(let t=0;t{const r=i*(0|Math.sqrt(e*e+s*s+n*n))>>8;for(let i=0;i{if(i0){const n=this.wp[t][i+1][e-1];n&&n.Rp&&n.Rp.model&&n.Rp.model.eg&&this.ng(s,n.Rp.model,128,0,-128,!0)}};sg=(t,i,e,s,n,r)=>{let h=!0,o=i;const a=i+s,l=e-1,c=e+n;for(let f=t;f<=t+1;f++)if(f!==this.up){for(let u=o;u<=a;u++)if(!(u<0||u>=this.NA))for(let o=l;o<=c;o++){if(o<0||o>=this.FA||h&&u=e||u===i))continue;const l=this.wp[f][u][o];if(!l)continue;const d=128*(u-i)+64*(1-s),w=128*(o-e)+64*(1-n),y=((this.dp[f][u][o]+this.dp[f][u+1][o]+this.dp[f][u][o+1]+this.dp[f][u+1][o+1])/4|0)-((this.dp[t][i][e]+this.dp[t][i+1][e]+this.dp[t][i][e+1]+this.dp[t][i+1][e+1])/4|0),A=l.Dp;A&&A.Gp&&A.Gp.eg&&this.ng(r,A.Gp,d,y,w,h),A&&A.Yp&&A.Yp.eg&&this.ng(r,A.Yp,d,y,w,h);for(let t=0;t{this.Ip++;let h=0;const o=i.Od,a=i.Rd;if(t.eg&&t.lg)for(let r=0;ri.cg)continue;const u=t.Od[r]-e;if(ui.ug)continue;const d=t.Ld[r]-n;if(di.wg)continue;if(i.eg&&i.lg)for(let t=0;t{const h=this.wp[t][i][e];if(!h)return;const o=h.vp;if(o){const t=o.color;if(0!==t)for(let i=0;i<4;i++)s[n]=t,s[n+1]=t,s[n+2]=t,s[n+3]=t,n+=r;return}const a=h.Tp;if(!a)return;const l=a.shape,c=a.angle,f=a._g,u=a.Cg,d=g.rp[l],w=g.hp[c];let y=0;if(0===f)for(let t=0;t<4;t++)0!==d[w[y++]]&&(s[n]=u),0!==d[w[y++]]&&(s[n+1]=u),0!==d[w[y++]]&&(s[n+2]=u),0!==d[w[y++]]&&(s[n+3]=u),n+=r;else for(let t=0;t<4;t++)s[n]=0===d[w[y++]]?f:u,s[n+1]=0===d[w[y++]]?f:u,s[n+2]=0===d[w[y++]]?f:u,s[n+3]=0===d[w[y++]]?f:u,n+=r};click=(t,i)=>{g.Xm=!0,g.Ma=t,g.Da=i,g.lp=-1,g.cp=-1};draw=(t,i,e,n,r,h,o)=>{t<0?t=0:t>=128*this.NA&&(t=128*this.NA-1),e<0?e=0:e>=128*this.FA&&(e=128*this.FA-1),g.vm++,g.xm=s.A.sin[h],g.km=s.A.cos[h],g.Mm=s.A.sin[r],g.Dm=s.A.cos[r],g.jm=g.ym[(h-128)/32|0][r/64|0],g.Nm=t,g.Fm=i,g.Bm=e,g.Um=t/128|0,g.Pm=e/128|0,g.Vm=n,g.Gm=g.Um-25,g.Gm<0&&(g.Gm=0),g.Ym=g.Pm-25,g.Ym<0&&(g.Ym=0),g.Wm=g.Um+25,g.Wm>this.NA&&(g.Wm=this.NA),g.Hm=g.Pm+25,g.Hm>this.FA&&(g.Hm=this.FA),this.Eg(),g.Km=0;for(let t=this.gp;t=2e3)?(h.visible=!0,h.update=!0,h.vg=h.Sp>0,g.Km++):(h.visible=!1,h.update=!1,h.bg=0))}}for(let t=this.gp;t=g.Wm))for(let t=-25;t<=0;t++){const n=g.Pm+t,r=g.Pm-t;let h;if(e>=g.Gm&&(n>=g.Ym&&(h=i[e][n],h&&h.visible&&this.Tg(h,!0,o)),r=g.Ym&&(h=i[s][n],h&&h.visible&&this.Tg(h,!0,o)),r=g.Wm))for(let t=-25;t<=0;t++){const n=g.Pm+t,r=g.Pm-t;let h;if(e>=g.Gm&&(n>=g.Ym&&(h=i[e][n],h&&h.visible&&this.Tg(h,!1,o)),r=g.Ym&&(h=i[s][n],h&&h.visible&&this.Tg(h,!1,o)),r{if(!c&&!f)return!1;for(let t=h;t=this.NA||i>=this.FA)return!1;const e=this.wp[s][t][i];if(e&&e.Sp>=5)return!1}const A=new n.A(s,e,t,i,c,f,w,h,h+a-1,o,o+l-1,u,d);for(let t=h;th&&(e|=1),to&&(e+=8),i=0;e--)this.wp[e][t][i]||(this.wp[e][t][i]=new r.A(e,t,i));const n=this.wp[s][t][i];n&&(n.xp[n.Sp]=A,n.Rg[n.Sp]=e,n.Og|=e,n.Sp++)}return y&&(this._h[this.pp++]=A),!0};Zp=t=>{for(let i=t.jp;i<=t.hg;i++)for(let e=t.zp;e<=t.og;e++){const s=this.wp[t.level][i][e];if(s){for(let i=0;i{const t=g.gm[g.Vm],i=g.Im[g.Vm];g.ap=0;for(let e=0;e=0&&s<=50){n=t.Sg+25-g.Pm,n<0&&(n=0),r=t.FA+25-g.Pm,r>50&&(r=50);let i=!1;for(;n<=r;)if(g.jm&&g.jm[s][n++]){i=!0;break}if(i){if(h=g.Nm-t.fg,h>32)t.mode=1;else{if(h>=-32)continue;t.mode=2,h=-h}t.xg=(t.dg-g.Bm<<8)/h|0,t.kg=(t.wg-g.Bm<<8)/h|0,t.Mg=(t.cg-g.Fm<<8)/h|0,t.Dg=(t.Ud-g.Fm<<8)/h|0,g.Cm[g.ap++]=t}}}else if(2===t.type){if(s=t.Sg+25-g.Pm,s>=0&&s<=50){n=t.Lg+25-g.Um,n<0&&(n=0),r=t.NA+25-g.Um,r>50&&(r=50);let i=!1;for(;n<=r;)if(g.jm&&g.jm[n++][s]){i=!0;break}if(i){if(h=g.Bm-t.dg,h>32)t.mode=3;else{if(h>=-32)continue;t.mode=4,h=-h}t.Ng=(t.fg-g.Nm<<8)/h|0,t.Fg=(t.ug-g.Nm<<8)/h|0,t.Mg=(t.cg-g.Fm<<8)/h|0,t.Dg=(t.Ud-g.Fm<<8)/h|0,g.Cm[g.ap++]=t}}}else if(4===t.type&&(s=t.cg-g.Fm,s>128&&(n=t.Sg+25-g.Pm,n<0&&(n=0),r=t.FA+25-g.Pm,r>50&&(r=50),n<=r))){let i=t.Lg+25-g.Um;i<0&&(i=0),h=t.NA+25-g.Um,h>50&&(h=50);let e=!1;t:for(let t=i;t<=h;t++)for(let i=n;i<=r;i++)if(g.jm&&g.jm[t][i]){e=!0;break t}e&&(t.mode=5,t.Ng=(t.fg-g.Nm<<8)/s|0,t.Fg=(t.ug-g.Nm<<8)/s|0,t.xg=(t.dg-g.Bm<<8)/s|0,t.kg=(t.wg-g.Bm<<8)/s|0,g.Cm[g.ap++]=t)}}};Tg=(t,i,e)=>{for(g.Em.kA(t);;){let t;do{if(t=g.Em.Bg(),!t)return}while(!t.update);const s=t.x,n=t.z,r=t.level,h=t.Ug,o=this.wp[r];if(t.visible){if(i){if(r>0){const t=this.wp[r-1][s][n];if(t&&t.update)continue}if(s<=g.Um&&s>g.Gm){const i=o[s-1][n];if(i&&i.update&&(i.visible||!(1&t.Og)))continue}if(s>=g.Um&&sg.Ym){const i=o[s][n-1];if(i&&i.update&&(i.visible||!(8&t.Og)))continue}if(n>=g.Pm&&nn&&(l+=6),c=g.zm[l],t.Vg=g.qm[l]),f&&(f.Kg&g.Zm[l]?16===f.Kg?(t.bg=3,t.Xg=g.$m[l],t.jg=3-t.Xg):32===f.Kg?(t.bg=6,t.Xg=g.Jm[l],t.jg=6-t.Xg):64===f.Kg?(t.bg=12,t.Xg=g.Qm[l],t.jg=12-t.Xg):(t.bg=9,t.Xg=g.tp[l],t.jg=9-t.Xg):t.bg=0,f.Kg&c&&!this.zg(h,s,n,f.Kg)&&f.Gp?.draw(0,g.xm,g.km,g.Mm,g.Dm,f.x-g.Nm,f.y-g.Fm,f.z-g.Bm,f.Xp),f.Zg&c&&!this.zg(h,s,n,f.Zg)&&f.Yp?.draw(0,g.xm,g.km,g.Mm,g.Dm,f.x-g.Nm,f.y-g.Fm,f.z-g.Bm,f.Xp)),u&&!this.visible(h,s,n,u.model.Ud))if(u.type&c)u.model.draw(u.angle,g.xm,g.km,g.Mm,g.Dm,u.x-g.Nm,u.y-g.Fm,u.z-g.Bm,u.Xp);else if(768&u.type){const t=u.x-g.Nm,i=u.y-g.Fm,e=u.z-g.Bm,s=u.angle;let n,r;if(n=s===m.A.Uy||s===m.A.Hy?-t:t,r=s===m.A.Hy||s===m.A.Py?-e:e,256&u.type&&rn){const n=t+g.sp[s],r=e+g.np[s];u.model.draw(512*s+1280&2047,g.xm,g.km,g.Mm,g.Dm,n,i,r,u.Xp)}}if(a){const i=t.Rp;i&&i.model?.draw(0,g.xm,g.km,g.Mm,g.Dm,i.x-g.Nm,i.y-g.Fm,i.z-g.Bm,i.Xp);const e=t.kp;e&&0===e.offset&&(e.qg&&e.qg.draw(0,g.xm,g.km,g.Mm,g.Dm,e.x-g.Nm,e.y-g.Fm,e.z-g.Bm,e.Xp),e.$g&&e.$g.draw(0,g.xm,g.km,g.Mm,g.Dm,e.x-g.Nm,e.y-g.Fm,e.z-g.Bm,e.Xp),e.Jg&&e.Jg.draw(0,g.xm,g.km,g.Mm,g.Dm,e.x-g.Nm,e.y-g.Fm,e.z-g.Bm,e.Xp))}const d=t.Og;if(0!==d){if(sg.Um&&1&d){const t=o[s-1][n];t&&t.update&&g.Em.kA(t)}if(n>g.Pm&&8&d){const t=o[s][n-1];t&&t.update&&g.Em.kA(t)}}}if(0!==t.bg){let i=!0;for(let e=0;ei.jp&&(r+=1),ei.zp&&(r+=8),ss&&(s=n);const h=g.Pm-i.zp,a=i.og-g.Pm;i.Qg=a>h?s+a:s+h}for(;;){let t=-50,i=-1;for(let e=0;et&&(t=s.Qg,i=e))}if(-1===i)break;const a=g.pm[i];if(a){a.vm=g.vm;let t=a.model;t||(t=a.Yg?.draw(e)??null),t&&!this.tI(h,a.jp,a.hg,a.zp,a.og,t.Ud)&&t.draw(a.Hg,g.xm,g.km,g.Mm,g.Dm,a.x-g.Nm,a.y-g.Fm,a.z-g.Bm,a.Xp);for(let t=a.jp;t<=a.hg;t++)for(let i=a.zp;i<=a.og;i++){const e=o[t][i];e&&(0!==e.bg?g.Em.kA(e):t===s&&i===n||!e.update||g.Em.kA(e))}}}if(t.vg)continue}if(!t.update||0!==t.bg)continue;if(s<=g.Um&&s>g.Gm){const t=o[s-1][n];if(t&&t.update)continue}if(s>=g.Um&&sg.Ym){const t=o[s][n-1];if(t&&t.update)continue}if(n>=g.Pm&&n=r){const r=t+g.ip[n],h=s+g.ep[n];i.model.draw(512*n+256,g.xm,g.km,g.Mm,g.Dm,r,e,h,i.Xp)}if(512&i.type&&h<=r){const r=t+g.sp[n],h=s+g.np[n];i.model.draw(512*n+1280&2047,g.xm,g.km,g.Mm,g.Dm,r,e,h,i.Xp)}}const e=t.Dp;e&&(e.Zg&t.Vg&&!this.zg(h,s,n,e.Zg)&&e.Yp?.draw(0,g.xm,g.km,g.Mm,g.Dm,e.x-g.Nm,e.y-g.Fm,e.z-g.Bm,e.Xp),e.Kg&t.Vg&&!this.zg(h,s,n,e.Kg)&&e.Gp?.draw(0,g.xm,g.km,g.Mm,g.Dm,e.x-g.Nm,e.y-g.Fm,e.z-g.Bm,e.Xp))}if(rg.Um){const t=o[s-1][n];t&&t.update&&g.Em.kA(t)}if(n>g.Pm){const t=o[s][n-1];t&&t.update&&g.Em.kA(t)}}};Gg=(t,i,e,n,r,h,o,a)=>{let l,c,f,u,d=l=(e<<7)-g.Nm,y=c=(n<<7)-g.Bm,A=f=d+128,m=u=y+128,p=this.dp[i][e][n]-g.Fm,I=this.dp[i][e+1][n]-g.Fm,_=this.dp[i][e+1][n+1]-g.Fm,C=this.dp[i][e][n+1]-g.Fm,E=y*o+d*a>>16;if(y=y*a-d*o>>16,d=E,E=p*h-y*r>>16,y=p*r+y*h>>16,p=E,y<50)return;if(E=c*o+A*a>>16,c=c*a-A*o>>16,A=E,E=I*h-c*r>>16,c=I*r+c*h>>16,I=E,c<50)return;if(E=m*o+f*a>>16,m=m*a-f*o>>16,f=E,E=_*h-m*r>>16,m=_*r+m*h>>16,_=E,m<50)return;if(E=u*o+l*a>>16,u=u*a-l*o>>16,l=E,E=C*h-u*r>>16,u=C*r+u*h>>16,C=E,u<50)return;const v=s.A.rl+((d<<9)/y|0),b=s.A.hl+((p<<9)/y|0),T=s.A.rl+((A<<9)/c|0),R=s.A.hl+((I<<9)/c|0),O=s.A.rl+((f<<9)/m|0),L=s.A.hl+((_<<9)/m|0),S=s.A.rl+((l<<9)/u|0),x=s.A.hl+((C<<9)/u|0);if(s.A.alpha=0,(O-S)*(R-x)-(L-x)*(T-S)>0)if(s.A.iI=O<0||S<0||T<0||O>w.A.eI||S>w.A.eI||T>w.A.eI,g.Xm&&this.sI(g.Ma,g.Da,L,x,R,O,S,T)&&(g.lp=e,g.cp=n),-1===t.nI)12345678!==t.rI&&s.A.hI(O,S,T,L,x,R,t.rI,t.oI,t.aI);else if(g.et){const i=g.op[t.nI];s.A.hI(O,S,T,L,x,R,this.lI(i,t.rI),this.lI(i,t.oI),this.lI(i,t.aI))}else t.flat?s.A.cI(O,S,T,L,x,R,t.rI,t.oI,t.aI,d,p,y,A,l,I,C,c,u,t.nI):s.A.cI(O,S,T,L,x,R,t.rI,t.oI,t.aI,f,_,m,l,A,C,I,u,c,t.nI);if(!((v-T)*(x-R)-(b-R)*(S-T)<=0))if(s.A.iI=v<0||T<0||S<0||v>w.A.eI||T>w.A.eI||S>w.A.eI,g.Xm&&this.sI(g.Ma,g.Da,b,R,x,v,T,S)&&(g.lp=e,g.cp=n),-1!==t.nI){if(!g.et)return void s.A.cI(v,T,S,b,R,x,t.fI,t.aI,t.oI,d,p,y,A,l,I,C,c,u,t.nI);const i=g.op[t.nI];s.A.hI(v,T,S,b,R,x,this.lI(i,t.fI),this.lI(i,t.aI),this.lI(i,t.oI))}else 12345678!==t.fI&&s.A.hI(v,T,S,b,R,x,t.fI,t.aI,t.oI)};Wg=(t,i,e,n,r,h,o)=>{let a=e.Od.length;for(let t=0;t>16;if(l=l*o-i*h>>16,i=c,c=a*r-l*n>>16,l=a*n+l*r>>16,a=c,l<50)return;e.uI&&(y.A.dI[t]=i,y.A.wI[t]=a,y.A.yI[t]=l),y.A.AI[t]=s.A.rl+((i<<9)/l|0),y.A.mI[t]=s.A.hl+((a<<9)/l|0)}s.A.alpha=0,a=e.pI.length;for(let n=0;n0)if(s.A.iI=a<0||l<0||c<0||a>w.A.eI||l>w.A.eI||c>w.A.eI,g.Xm&&this.sI(g.Ma,g.Da,f,u,d,a,l,c)&&(g.lp=t,g.cp=i),e.uI&&-1!==e.uI[n])if(g.et){const t=g.op[e.uI[n]];s.A.hI(a,l,c,f,u,d,this.lI(t,e._I[n]),this.lI(t,e.CI[n]),this.lI(t,e.EI[n]))}else e.flat?s.A.cI(a,l,c,f,u,d,e._I[n],e.CI[n],e.EI[n],y.A.dI[0],y.A.wI[0],y.A.yI[0],y.A.dI[1],y.A.dI[3],y.A.wI[1],y.A.wI[3],y.A.yI[1],y.A.yI[3],e.uI[n]):s.A.cI(a,l,c,f,u,d,e._I[n],e.CI[n],e.EI[n],y.A.dI[r],y.A.wI[r],y.A.yI[r],y.A.dI[h],y.A.dI[o],y.A.wI[h],y.A.wI[o],y.A.yI[h],y.A.yI[o],e.uI[n]);else 12345678!==e._I[n]&&s.A.hI(a,l,c,f,u,d,e._I[n],e.CI[n],e.EI[n])}};Pg=(t,i,e)=>{const s=this.yp[t][i][e];if(s===-g.vm)return!1;if(s===g.vm)return!0;{const s=i<<7,n=e<<7;return this.vI(s+1,this.dp[t][i][e],n+1)&&this.vI(s+128-1,this.dp[t][i+1][e],n+1)&&this.vI(s+128-1,this.dp[t][i+1][e+1],n+128-1)&&this.vI(s+1,this.dp[t][i][e+1],n+128-1)?(this.yp[t][i][e]=g.vm,!0):(this.yp[t][i][e]=-g.vm,!1)}};zg=(t,i,e,s)=>{if(!this.Pg(t,i,e))return!1;const n=i<<7,r=e<<7,h=this.dp[t][i][e]-1,o=h-120,a=h-230,l=h-238;if(s<16){if(1===s){if(n>g.Nm){if(!this.vI(n,h,r))return!1;if(!this.vI(n,h,r+128))return!1}if(t>0){if(!this.vI(n,o,r))return!1;if(!this.vI(n,o,r+128))return!1}return!!this.vI(n,a,r)&&this.vI(n,a,r+128)}if(2===s){if(r0){if(!this.vI(n,o,r+128))return!1;if(!this.vI(n+128,o,r+128))return!1}return!!this.vI(n,a,r+128)&&this.vI(n+128,a,r+128)}if(4===s){if(n0){if(!this.vI(n+128,o,r))return!1;if(!this.vI(n+128,o,r+128))return!1}return!!this.vI(n+128,a,r)&&this.vI(n+128,a,r+128)}if(8===s){if(r>g.Bm){if(!this.vI(n,h,r))return!1;if(!this.vI(n+128,h,r))return!1}if(t>0){if(!this.vI(n,o,r))return!1;if(!this.vI(n+128,o,r))return!1}return!!this.vI(n,a,r)&&this.vI(n+128,a,r)}}return!!this.vI(n+64,l,r+64)&&(16===s?this.vI(n,a,r+128):32===s?this.vI(n+128,a,r+128):64===s?this.vI(n+128,a,r):128===s?this.vI(n,a,r):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,i,e,s)=>{if(this.Pg(t,i,e)){const n=i<<7,r=e<<7;return this.vI(n+1,this.dp[t][i][e]-s,r+1)&&this.vI(n+128-1,this.dp[t][i+1][e]-s,r+1)&&this.vI(n+128-1,this.dp[t][i+1][e+1]-s,r+128-1)&&this.vI(n+1,this.dp[t][i][e+1]-s,r+128-1)}return!1};tI=(t,i,e,s,n,r)=>{let h,o;if(i!==e||s!==n){for(h=i;h<=e;h++)for(o=s;o<=n;o++)if(this.yp[t][h][o]===-g.vm)return!1;o=1+(i<<7);const a=2+(s<<7),l=this.dp[t][i][s]-r;if(!this.vI(o,l,a))return!1;const c=(e<<7)-1;if(!this.vI(c,l,a))return!1;const f=(n<<7)-1;return!!this.vI(o,l,f)&&this.vI(c,l,f)}return!!this.Pg(t,i,s)&&(h=i<<7,o=s<<7,this.vI(h+1,this.dp[t][i][s]-r,o+1)&&this.vI(h+128-1,this.dp[t][i+1][s]-r,o+1)&&this.vI(h+128-1,this.dp[t][i+1][s+1]-r,o+128-1)&&this.vI(h+1,this.dp[t][i][s+1]-r,o+128-1))};vI=(t,i,e)=>{for(let s=0;s0){const t=n.dg+(n.xg*s>>8),r=n.wg+(n.kg*s>>8),h=n.cg+(n.Mg*s>>8),o=n.Ud+(n.Dg*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(2===n.mode){const s=t-n.fg;if(s>0){const t=n.dg+(n.xg*s>>8),r=n.wg+(n.kg*s>>8),h=n.cg+(n.Mg*s>>8),o=n.Ud+(n.Dg*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(3===n.mode){const s=n.dg-e;if(s>0){const e=n.fg+(n.Ng*s>>8),r=n.ug+(n.Fg*s>>8),h=n.cg+(n.Mg*s>>8),o=n.Ud+(n.Dg*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(4===n.mode){const s=e-n.dg;if(s>0){const e=n.fg+(n.Ng*s>>8),r=n.ug+(n.Fg*s>>8),h=n.cg+(n.Mg*s>>8),o=n.Ud+(n.Dg*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(5===n.mode){const s=i-n.cg;if(s>0){const i=n.fg+(n.Ng*s>>8),r=n.ug+(n.Fg*s>>8),h=n.dg+(n.xg*s>>8),o=n.wg+(n.kg*s>>8);if(t>=i&&t<=r&&e>=h&&e<=o)return!0}}}return!1};sI=(t,i,e,s,n,r,h,o)=>{if(ie&&i>s&&i>n)return!1;if(tr&&t>h&&t>o)return!1;const a=(i-s)*(o-h)-(t-h)*(n-s);return((i-e)*(h-r)-(t-r)*(s-e))*a>0&&a*((i-n)*(r-o)-(t-o)*(e-n))>0};lI=(t,i)=>((i=(127-i)*(127&t)/160|0)<2?i=2:i>126&&(i=126),(65408&t)+i)}},7121:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{}},4197:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{bI;TI;RI;OI;index;Vw;ua;fa;constructor(t,i,e,s,n,r,h){super(),this.bI=i,this.TI=e,this.RI=s,this.OI=n,this.index=t,this.Vw=r,h&&-1!==r.wa&&this.Vw.delay?(this.ua=Math.random()*this.Vw.da|0,this.fa=Math.random()*this.Vw.delay[this.ua]|0):(this.ua=-1,this.fa=0)}}},9418:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(7121),n=e(1312),r=e(3867);class h extends s.A{x=0;z=0;Hg=0;LI=!1;size=1;Sl=-1;SI=-1;xI=-1;kI=-1;MI=-1;DI=-1;NI=-1;FI=null;BI=100;UI=0;GI=0;WI=0;YI=0;HI=-1e3;VI=0;KI=0;XI=-1;jI=0;zI=0;ZI=-1;qI=0;$I=0;JI=-1;QI=0;t_=0;i_=0;e_=0;s_=-1;n_=0;r_=0;h_=0;o_=0;a_=0;l_=0;c_=0;f_=0;u_=0;d_=0;w_=0;vm=0;height=0;y_=0;pathLength=0;A_=new Int32Array(10);m_=new Int32Array(10);p_=new r.fe(10,!1);g_=0;I_=-1;__=-1;C_=-1;E_=-1;move(t,i,e){if(-1!==this.JI&&n.A.Lo[this.JI].priority<=1&&(this.JI=-1),!t){const t=i-this.A_[0],s=e-this.m_[0];if(t>=-8&&t<=8&&s>=-8&&s<=8){this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.A_[t]=this.A_[t-1],this.m_[t]=this.m_[t-1],this.p_[t]=this.p_[t-1];return this.A_[0]=i,this.m_[0]=e,void(this.p_[0]=!1)}}this.pathLength=0,this.g_=0,this.A_[0]=i,this.m_[0]=e,this.x=128*this.A_[0]+64*this.size,this.z=128*this.m_[0]+64*this.size}step(t,i){let e=this.A_[0],s=this.m_[0];0===i?(e--,s++):1===i?s++:2===i?(e++,s++):3===i?e--:4===i?e++:5===i?(e--,s--):6===i?s--:7===i&&(e++,s--),-1!==this.JI&&n.A.Lo[this.JI].priority<=1&&(this.JI=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.A_[t]=this.A_[t-1],this.m_[t]=this.m_[t-1],this.p_[t]=this.p_[t-1];this.A_[0]=e,this.m_[0]=s,this.p_[0]=t}}},8268:(t,i,e)=>{e.d(i,{A:()=>d});var s=e(9418),n=e(8665),r=e(2679),h=e(8738),o=e(1312),a=e(8317),l=e(1302),c=e(3819),f=e(3867),u=e(9298);class d extends s.A{static v_=1;static b_=2;static T_=4;static R_=8;static O_=16;static L_=32;static S_=64;static x_=128;static k_=256;static M_=512;static Ll=[u.A.D_,u.A.N_,u.A.F_,u.A.B_,u.A.U_,u.A.P_,u.A.G_,u.A.W_,u.A.Y_,u.A.H_,u.A.V_,u.A.K_,u.A.X_,u.A.j_,u.A.z_,u.A.Z_];static Ol=[[u.A.q_,u.A.J_,u.A.Q_,u.A.tC,u.A.iC,u.A.eC,u.A.sC,u.A.nC,u.A.rC,u.A.hC,u.A.oC,u.A.aC],[u.A.lC,u.A.cC,u.A.fC,u.A.uC,u.A.dC,u.A.wC,u.A.yC,u.A.AC,u.A.mC,u.A.pC,u.A.gC,u.A.IC,u.A._C,u.A.CC,u.A.EC,u.A.vC],[u.A.vC-1,u.A.lC+1,u.A.cC,u.A.fC,u.A.uC,u.A.dC,u.A.wC,u.A.yC,u.A.AC,u.A.mC,u.A.pC,u.A.gC,u.A.IC,u.A._C,u.A.CC,u.A.EC],[u.A.bC,u.A.TC,u.A.RC,u.A.OC,u.A.LC,u.A.SC],[u.A.xC,u.A.kC,u.A.MC,u.A.DC,u.A.NC,u.A.FC,u.A.BC,u.A.UC]];static So=new r.A(200);name=null;visible=!1;PC=0;GC=0;WC=new Uint16Array(12);YC=new Uint16Array(5);Kl=0;HC=0n;y=0;VC=0;KC=0;XC=0;jC=0;zC=0;ZC=null;Lg=0;Sg=0;NA=0;FA=0;et=!1;draw(t){if(!this.visible)return null;let i=this.zd();if(this.height=i.Ud,i.Jd=!0,this.et)return i;if(-1!==this.s_&&-1!==this.n_){const t=h.A.Lo[this.s_],e=n.A.vu(t.al(),!0,!t.ad,!1);e.translate(-this.o_,0,0),e.xl(),t.Vw&&t.Vw.frames&&e.kl(t.Vw.frames[this.n_]),e.Dd=null,e.Nd=null,128===t.Xd&&128===t.jd||e.scale(t.Xd,t.jd,t.Xd),e.Ml(t.fd+64,t.ud+850,-30,-50,-30,!0);const s=[i,e];i=n.A.qC(s,2)}if(this.ZC&&(t>=this.KC&&(this.ZC=null),t>=this.VC&&t=d.Ol[i].length)&&(e=0),this.YC[i]=e}this.Sl=t.ou,65535===this.Sl&&(this.Sl=-1),this.SI=t.ou,65535===this.SI&&(this.SI=-1),this.xI=t.ou,65535===this.xI&&(this.xI=-1),this.kI=t.ou,65535===this.kI&&(this.kI=-1),this.MI=t.ou,65535===this.MI&&(this.MI=-1),this.DI=t.ou,65535===this.DI&&(this.DI=-1),this.NI=t.ou,65535===this.NI&&(this.NI=-1),this.name=c.A.Cl(c.A.El(t.$C)),this.Kl=t.lu,this.visible=!0,this.HC=0n;for(let t=0;t<12;t++)this.HC<<=0x4n,this.WC[t]>=256&&(this.HC+=BigInt(this.WC[t])-256n);this.WC[0]>=256&&(this.HC+=BigInt(this.WC[0])-256n>>4n),this.WC[1]>=256&&(this.HC+=BigInt(this.WC[1])-256n>>8n);for(let t=0;t<5;t++)this.HC<<=0x3n,this.HC+=BigInt(this.YC[t]);this.HC<<=0x1n,this.HC+=BigInt(this.PC)}Xu(){if(!this.visible)return null;const t=new f.fe(12,null);let i=0;for(let e=0;e<12;e++){const s=this.WC[e];if(s>=256&&s<512&&(t[i++]=a.A.Lo[s-256].Xu()),s>=512){const e=l.A.get(s-512).Xu(this.PC);e&&(t[i++]=e)}}const e=n.A.Tl(t,i);for(let t=0;t<5;t++)0!==this.YC[t]&&(e.Rl(d.Ol[t][0],d.Ol[t][this.YC[t]]),1===t&&e.Rl(d.Ll[0],d.Ll[this.YC[t]]));return e}zd(){let t=this.HC,i=-1,e=-1,s=-1,r=-1;if(this.JI>=0&&0===this.i_){const n=o.A.Lo[this.JI];if(n.frames&&(i=n.frames[this.QI]),this.ZI>=0&&this.ZI!==this.Sl){const t=o.A.Lo[this.ZI].frames;t&&(e=t[this.qI])}n.Ww>=0&&(s=n.Ww,t+=BigInt(s-this.WC[5])<<8n),n.Yw>=0&&(r=n.Yw,t+=BigInt(r-this.WC[3])<<16n)}else if(this.ZI>=0){const t=o.A.Lo[this.ZI].frames;t&&(i=t[this.qI])}let h=d.So?.get(t);if(!h){const i=new f.fe(12,null);let e=0;for(let t=0;t<12;t++){let n=this.WC[t];if(r>=0&&3===t&&(n=r),s>=0&&5===t&&(n=s),n>=256&&n<512){const t=a.A.Lo[n-256].al();t&&(i[e++]=t)}if(n>=512){const t=l.A.get(n-512).Uw(this.PC);t&&(i[e++]=t)}}h=n.A.Tl(i,e);for(let t=0;t<5;t++)0!==this.YC[t]&&(h.Rl(d.Ol[t][0],d.Ol[t][this.YC[t]]),1===t&&h.Rl(d.Ll[0],d.Ll[this.YC[t]]));h.xl(),h.Ml(64,850,-30,-50,-30,!0),d.So?.put(t,h)}if(this.et)return h;const c=n.A.Zd(h,!0);return-1!==i&&-1!==e?c.qd(i,e,o.A.Lo[this.JI].Pw):-1!==i&&c.kl(i),c.$d(),c.Dd=null,c.Nd=null,c}}},9222:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;model;Xp;info;constructor(t,i,e,s,n,r){this.y=t,this.x=i,this.z=e,this.model=s,this.Xp=n,this.info=r}}},1161:(t,i,e)=>{e.d(i,{A:()=>s});class s{level;y;x;z;model;Yg;Hg;jp;hg;zp;og;Xp;info;Qg=0;vm=0;constructor(t,i,e,s,n,r,h,o,a,l,c,f,u){this.level=t,this.y=i,this.x=e,this.z=s,this.model=n,this.Yg=r,this.Hg=h,this.jp=o,this.hg=a,this.zp=l,this.og=c,this.Xp=f,this.info=u}}},5748:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;Jg;$g;qg;Xp;offset;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.Jg=s,this.$g=n,this.qg=r,this.Xp=h,this.offset=o}}},8256:(t,i,e)=>{e.d(i,{A:()=>s});class s{Lg;NA;Sg;FA;type;fg;ug;dg;wg;cg;Ud;mode=0;Ng=0;Fg=0;xg=0;kg=0;Mg=0;Dg=0;constructor(t,i,e,s,n,r,h,o,a,l,c){this.Lg=t,this.NA=i,this.Sg=e,this.FA=s,this.type=n,this.fg=r,this.ug=h,this.dg=o,this.wg=a,this.cg=l,this.Ud=c}}},3795:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1982),n=e(3867);class r extends s.A{level;x;z;Ug;xp;Rg;vp=null;Tp=null;Dp=null;Np=null;Rp=null;kp=null;Cp=null;Sp=0;Og=0;Ep=0;visible=!1;update=!1;vg=!1;bg=0;Xg=0;jg=0;Vg=0;constructor(t,i,e){super(),this.Ug=this.level=t,this.x=i,this.z=e,this.xp=new n.fe(5,null),this.Rg=new Int32Array(5)}}},2771:(t,i,e)=>{e.d(i,{A:()=>s});class s{static AI=new Int32Array(6);static mI=new Int32Array(6);static dI=new Int32Array(6);static wI=new Int32Array(6);static yI=new Int32Array(6);static JC=[Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,2,6),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,13,14)];static QC=[Int8Array.of(0,1,2,3,0,0,1,3),Int8Array.of(1,1,2,3,1,0,1,3),Int8Array.of(0,1,2,3,1,0,1,3),Int8Array.of(0,0,1,2,0,0,2,4,1,0,4,3),Int8Array.of(0,0,1,4,0,0,4,3,1,1,2,4),Int8Array.of(0,0,4,3,1,0,1,2,1,0,2,4),Int8Array.of(0,1,2,4,1,0,1,4,1,0,4,3),Int8Array.of(0,4,1,2,0,4,2,5,1,0,4,5,1,0,5,3),Int8Array.of(0,4,1,2,0,4,2,3,0,4,3,5,1,0,4,5),Int8Array.of(0,0,4,5,1,4,1,2,1,4,2,3,1,4,3,5),Int8Array.of(0,0,1,5,0,1,4,5,0,1,2,4,1,0,5,3,1,5,4,3,1,4,2,3),Int8Array.of(1,0,1,5,1,1,4,5,1,1,2,4,0,0,5,3,0,5,4,3,0,4,2,3),Int8Array.of(1,0,5,4,1,0,1,5,0,0,4,3,0,4,5,3,0,5,2,3,0,1,2,5)];static tE=128;static iE=this.tE/2|0;static eE=this.tE/4|0;static sE=3*this.tE/4|0;Od;Sd;Ld;_I;CI;EI;pI;gI;II;uI;flat;shape;angle;_g;Cg;constructor(t,i,e,n,r,h,o,a,l,c,f,u,d,w,y,A,m,p,g){this.flat=!(m!==n||m!==w||m!==a),this.shape=i,this.angle=h,this._g=d,this.Cg=l;const I=s.JC[i],_=I.length;this.Od=new Int32Array(_),this.Sd=new Int32Array(_),this.Ld=new Int32Array(_);const C=new Int32Array(_),E=new Int32Array(_),v=t*s.tE,b=p*s.tE;for(let t=0;t<_;t++){let i,l,f,d,p,_=I[t];!(1&_)&&_<=8&&(_=1+(_-h-h-1&7)),_>8&&_<=12&&(_=9+(_-h-9&3)),_>12&&_<=16&&(_=13+(_-h-13&3)),1===_?(i=v,l=b,f=m,d=o,p=c):2===_?(i=v+s.iE,l=b,f=m+n>>1,d=o+g>>1,p=c+e>>1):3===_?(i=v+s.tE,l=b,f=n,d=g,p=e):4===_?(i=v+s.tE,l=b+s.iE,f=n+w>>1,d=g+r>>1,p=e+y>>1):5===_?(i=v+s.tE,l=b+s.tE,f=w,d=r,p=y):6===_?(i=v+s.iE,l=b+s.tE,f=w+a>>1,d=r+A>>1,p=y+u>>1):7===_?(i=v,l=b+s.tE,f=a,d=A,p=u):8===_?(i=v,l=b+s.iE,f=a+m>>1,d=A+o>>1,p=u+c>>1):9===_?(i=v+s.iE,l=b+s.eE,f=m+n>>1,d=o+g>>1,p=c+e>>1):10===_?(i=v+s.sE,l=b+s.iE,f=n+w>>1,d=g+r>>1,p=e+y>>1):11===_?(i=v+s.iE,l=b+s.sE,f=w+a>>1,d=r+A>>1,p=y+u>>1):12===_?(i=v+s.eE,l=b+s.iE,f=a+m>>1,d=A+o>>1,p=u+c>>1):13===_?(i=v+s.eE,l=b+s.eE,f=m,d=o,p=c):14===_?(i=v+s.sE,l=b+s.eE,f=n,d=g,p=e):15===_?(i=v+s.sE,l=b+s.sE,f=w,d=r,p=y):(i=v+s.eE,l=b+s.sE,f=a,d=A,p=u),this.Od[t]=i,this.Sd[t]=f,this.Ld[t]=l,C[t]=d,E[t]=p}const T=s.QC[i],R=T.length/4|0;this.pI=new Int32Array(R),this.gI=new Int32Array(R),this.II=new Int32Array(R),this._I=new Int32Array(R),this.CI=new Int32Array(R),this.EI=new Int32Array(R),this.uI=-1!==f?new Int32Array(R):null;let O=0;for(let t=0;t{e.d(i,{A:()=>s});class s{static QA=0;static bp=1;static nE=2;static rE=3;static hE=4;static oE=5;static iE=6;static eE=7;static sE=8;static aE=9;static lE=10;static cE=11}},3479:(t,i,e)=>{e.d(i,{A:()=>s});class s{fI;aI;rI;oI;nI;color;flat;constructor(t,i,e,s,n,r,h){this.fI=t,this.aI=i,this.rI=e,this.oI=s,this.nI=n,this.color=r,this.flat=h}}},6855:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;Kg;Zg;Gp;Yp;Xp;info;constructor(t,i,e,s,n,r,h,o,a){this.y=t,this.x=i,this.z=e,this.Kg=s,this.Zg=n,this.Gp=r,this.Yp=h,this.Xp=o,this.info=a}}},7441:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;type;angle;model;Xp;info;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.type=s,this.angle=n,this.model=r,this.Xp=h,this.info=o}}},7536:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n{fE;uE;constructor(t){this.uE=[],this.fE=t;for(let i=0;i{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{wE;yE;constructor(){super(),this.wE=this,this.yE=this}AE(){this.yE&&this.wE&&(this.yE.wE=this.wE,this.wE.yE=this.yE,this.wE=null,this.yE=null)}}},3819:(t,i,e)=>{e.d(i,{A:()=>s});class s{static mE=['_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9'];static pE=t=>{t=t.trim();let i=0n;for(let e=0;e=65&&s<=90?i+=BigInt(s+1-65):s>=97&&s<=122?i+=BigInt(s+1-97):s>=48&&s<=57&&(i+=BigInt(s+27-48))}return i};static El=t=>{if(t<0n||t>=6582952005840035281n)return'invalid_name';if(t%37n===0n)return'invalid_name';let i=0;const e=Array(12);for(;0n!==t;){const s=t;t/=37n,e[11-i++]=this.mE[Number(s-37n*t)]}return e.slice(12-i).join('')};static gE=t=>{const i=[...t.toLowerCase()];let e=!0;for(let t=0;t='a'&&s<='z'&&(i[t]=s.toUpperCase(),e=!1),'.'!==s&&'!'!==s||(e=!0)}return i.join('')};static IE=t=>{let i='';for(let e=0;e(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static Cl=t=>{if(0===t.length)return t;const i=[...t];for(let t=0;t='a'&&i[t+1]<='z'&&(i[t+1]=String.fromCharCode(i[t+1].charCodeAt(0)+'A'.charCodeAt(0)-97)));return i[0]>='a'&&i[0]<='z'&&(i[0]=String.fromCharCode(i[0].charCodeAt(0)+'A'.charCodeAt(0)-97)),i.join('')};static _u=t=>{const i=t.toUpperCase();let e=0n;for(let t=0;t>56n)&0xffffffffffffffn;return e}}},6666:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n{_E;cursor=null;constructor(){const t=new s.A;t.next=t,t.dE=t,this._E=t}kA(t){t.dE&&t.rw(),t.dE=this._E.dE,t.next=this._E,t.dE&&(t.dE.next=t),t.next.dE=t}CE(t){t.dE&&t.rw(),t.dE=this._E,t.next=this._E.next,t.dE.next=t,t.next&&(t.next.dE=t)}Bg(){const t=this._E.next;return t===this._E?null:(t?.rw(),t)}head(){const t=this._E.next;return t===this._E?(this.cursor=null,null):(this.cursor=t?.next||null,t)}EE(){const t=this._E.dE;return t===this._E?(this.cursor=null,null):(this.cursor=t?.dE||null,t)}next(){const t=this.cursor;return t===this._E?(this.cursor=null,null):(this.cursor=t?.next||null,t)}dE(){const t=this.cursor;return t===this._E?(this.cursor=null,null):(this.cursor=t?.dE||null,t)}clear(){for(;;){const t=this._E.next;if(t===this._E)return;t?.rw()}}}},1982:(t,i,e)=>{e.d(i,{A:()=>s});class s{key;next;dE;constructor(){this.key=0n,this.next=this,this.dE=this}rw(){this.dE&&this.next&&(this.dE.next=this.next,this.next.dE=this.dE,this.next=null,this.dE=null)}}},2679:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(2512),n=e(7536);class r{vE;bE;history;available;constructor(t){this.vE=t,this.available=t,this.bE=new n.A(1024),this.history=new s.A}get(t){const i=this.bE.get(t);return i&&this.history.push(i),i}put(t,i){if(0===this.available){const t=this.history.pop();t?.rw(),t?.AE()}else this.available--;this.bE.put(t,i),this.history.push(i)}clear(){const t=this.history.pop();t?(t.rw(),t.AE()):this.available=this.vE}}},2512:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n{head;constructor(){this.head=new s.A}push(t){t.yE&&t.AE(),t.yE=this.head.yE,t.wE=this.head,t.yE&&(t.yE.wE=t),t.wE.yE=t}pop(){const t=this.head.wE;return t===this.head?null:(t?.AE(),t)}}},8534:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(3867);class r{static Lo=[];static hu=t=>{const i=new s.A(t.read('base_head.dat')),e=new s.A(t.read('base_type.dat')),h=new s.A(t.read('base_label.dat')),o=i.ou;i.lf+=2;for(let t=0;t{e.d(i,{A:()=>r});var s=e(8534),n=e(1069);class r{static Lo=[];static hu=t=>{const i=new n.A(t.read('frame_head.dat')),e=new n.A(t.read('frame_tran1.dat')),h=new n.A(t.read('frame_tran2.dat')),o=new n.A(t.read('frame_del.dat')),a=i.ou;i.lf+=2;const l=new Int32Array(500),c=new Int32Array(500),f=new Int32Array(500),u=new Int32Array(500);for(let t=0;t0){if(0!==d.types[t])for(let i=t-1;i>y;i--)if(0===d.types[i]){l[A]=i,c[A]=0,f[A]=0,u[A]=0,A++;break}l[A]=t;let e=0;3===d.types[l[A]]&&(e=128),c[A]=1&i?h.RE:e,f[A]=2&i?h.RE:e,u[A]=4&i?h.RE:e,y=t,A++}}n.length=A,n.OE=new Int32Array(A),n.x=new Int32Array(A),n.y=new Int32Array(A),n.z=new Int32Array(A);for(let t=0;t{e.d(i,{bc:()=>s,zo:()=>n,LE:()=>o,SE:()=>h,xE:()=>r});const s=document.getElementById('canvas'),n=s.getContext('2d',{willReadFrequently:!0}),r=document.createElement('canvas'),h=document.createElement('img'),o=r.getContext('2d',{willReadFrequently:!0})},9298:(t,i,e)=>{e.d(i,{A:()=>s});class s{static RED=16711680;static GREEN=65280;static BLUE=255;static Ga=16776960;static kE=65535;static sm=16711935;static Ia=16777215;static Pa=0;static ME=16748608;static DE=8388608;static NE=128;static FE=16756736;static BE=16740352;static UE=16723968;static PE=12648192;static GE=8453888;static WE=4259584;static YE=9179409;static HE=6116423;static ia=2301979;static ea=5063219;static na=7759444;static ha=3353893;static VE=8388736;static KE=13350793;static XE=Int32Array.of(s.Ga,s.RED,s.GREEN,s.kE,s.sm,s.Ia);static q_=6798;static J_=107;static Q_=10283;static tC=16;static iC=4797;static eC=7744;static sC=5799;static nC=4634;static rC=33697;static hC=22433;static oC=2983;static aC=54193;static lC=8741;static cC=12;static fC=64030;static uC=43162;static dC=7735;static wC=8404;static yC=1701;static AC=38430;static mC=24094;static pC=10153;static gC=56621;static IC=4783;static _C=1341;static CC=16578;static EC=35003;static vC=25239;static D_=9104;static N_=10275;static F_=7595;static B_=3610;static U_=7975;static P_=8526;static G_=918;static W_=38802;static Y_=24466;static H_=10145;static V_=58654;static K_=5027;static X_=1457;static j_=16565;static z_=34991;static Z_=25486;static bC=4626;static TC=11146;static RC=6439;static OC=12;static LC=4758;static SC=10270;static UC=4574;static xC=4550;static kC=4537;static MC=5681;static DC=5673;static NC=5790;static FC=6806;static BC=8076}},8950:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n extends s.A{static lw=new Int32Array;static cw=0;static fw=0;static top=0;static bottom=0;static left=0;static right=0;static eI=0;static jE=0;static zE=0;static bind=(t,i,e)=>{this.lw=t,this.cw=i,this.fw=e,this.Aa(0,0,i,e)};static ZE=()=>{this.left=0,this.top=0,this.right=this.cw,this.bottom=this.fw,this.eI=this.right-1,this.jE=this.right/2|0};static Aa=(t,i,e,s)=>{t<0&&(t=0),i<0&&(i=0),e>this.cw&&(e=this.cw),s>this.fw&&(s=this.fw),this.top=i,this.bottom=s,this.left=t,this.right=e,this.eI=this.right-1,this.jE=this.right/2|0,this.zE=this.bottom/2|0};static clear=()=>{const t=this.cw*this.fw;for(let i=0;i{this.ra(t,i,n,e),this.ra(t,i+s-1,n,e),this.sa(t,i,n,s),this.sa(t+e-1,i,n,s)};static ra=(t,i,e,s)=>{if(i=this.bottom)return;tthis.right&&(s=this.right-t);const n=t+i*this.cw;for(let t=0;t{if(t=this.right)return;ithis.bottom&&(s=this.bottom-i);const n=t+i*this.cw;for(let t=0;t{const r=Math.abs(e-t),h=Math.abs(s-i),o=t=this.left&&t=this.top&&i-h&&(l-=h,t+=o),e{tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const r=this.cw-e;let h=t+i*this.cw;for(let t=-s;t<0;t++){for(let t=-e;t<0;t++)this.lw[h++]=n;h+=r}};static $E(t,i,e,s,n,r){tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const h=256-r,o=(n>>16&255)*r,a=(n>>8&255)*r,l=(255&n)*r,c=this.cw-e;let f=t+i*this.cw;for(let t=0;t>16&255)*h>>8<<16)+(a+(this.lw[f]>>8&255)*h>>8<<8)+(l+(255&this.lw[f])*h>>8);this.lw[f++]=t}f+=c}}static JE(t,i,e,s,n){const r=256-n,h=(s>>16&255)*n,o=(s>>8&255)*n,a=(255&s)*n;let l=i-e;l<0&&(l=0);let c=i+e;c>=this.fw&&(c=this.fw-1);for(let s=l;s<=c;s++){const n=s-i,l=0|Math.sqrt(e*e-n*n);let c=t-l;c<0&&(c=0);let f=t+l;f>=this.cw&&(f=this.cw-1);let u=c+s*this.cw;for(let t=c;t<=f;t++){const t=(h+(this.lw[u]>>16&255)*r>>8<<16)+(o+(this.lw[u]>>8&255)*r>>8<<8)+(a+(255&this.lw[u])*r>>8);this.lw[u++]=t}}}static QE=(t,i,e)=>{t=this.right||i=this.bottom||(this.lw[t+i*this.cw]=e)}}},4583:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(8950),n=e(1673),r=e(3867);class h extends s.A{static et=!1;static tv=new Int32Array(512);static iv=new Int32Array(2048);static sin=new Int32Array(2048);static cos=new Int32Array(2048);static palette=new Int32Array(65536);static ev=new r.fe(50,null);static sv=0;static aw=new Int32Array;static rl=0;static hl=0;static uw=!0;static iI=!1;static alpha=0;static nv=null;static rv=new r.fe(50,null);static hv=0;static vm=0;static ov=new Int32Array(50);static av=new r.fe(50,null);static lv=!1;static cv=new r.fe(50,!1);static fv=new Int32Array(50);static{for(let t=1;t<512;t++)this.tv[t]=32768/t|0;for(let t=1;t<2048;t++)this.iv[t]=65536/t|0;for(let t=0;t<2048;t++)this.sin[t]=65536*Math.sin(.0030679615757712823*t)|0,this.cos[t]=65536*Math.cos(.0030679615757712823*t)|0}static To=()=>{this.tv=null,this.tv=null,this.sin=null,this.cos=null,this.aw=null,this.ev=null,this.cv=null,this.fv=null,this.nv=null,this.rv=null,this.ov=null,this.palette=null,this.av=null,console.log('Draw3D unloaded!')};static Tc=()=>{this.aw=new Int32Array(this.fw);for(let t=0;t{this.aw=new Int32Array(i);for(let e=0;e{this.nv=null,this.rv.fill(null)};static wv=t=>{this.sv=0;for(let i=0;i<50;i++)try{this.ev[i]=n.A.Cu(t,i.toString()),this.et&&128===this.ev[i]?.Fa?this.ev[i]?.yv():this.ev[i]?._w(),this.sv++}catch(t){}};static im=t=>{if(0!==this.fv[t])return this.fv[t];const i=this.av[t];if(!i)return 0;let e=0,s=0,n=0;const r=i.length;for(let t=0;t>16&255,s+=i[t]>>8&255,n+=255&i[t];let h=(e/r<<16)+(s/r<<8)+(n/r|0);return h=this.Av(h,1.4),0===h&&(h=1),this.fv[t]=h,h};static mv=t=>{const i=t+.03*Math.random()-.015;let e=0;for(let t=0;t<512;t++){const s=(t/8|0)/64+.0078125,n=(7&t)/8+.0625;for(let t=0;t<128;t++){const r=t/128;let h=r,o=r,a=r;if(0!==n){let t;t=r<.5?r*(n+1):r+n-r*n;const i=2*r-t;let e=s+.3333333333333333;e>1&&e--;let l=s-.3333333333333333;l<0&&l++,h=6*e<1?i+6*(t-i)*e:2*e<1?t:3*e<2?i+(t-i)*(.6666666666666666-e)*6:i,o=6*s<1?i+6*(t-i)*s:2*s<1?t:3*s<2?i+(t-i)*(.6666666666666666-s)*6:i,a=6*l<1?i+6*(t-i)*l:2*l<1?t:3*l<2?i+(t-i)*(.6666666666666666-l)*6:i}const l=((256*h|0)<<16)+((256*o|0)<<8)+(256*a|0);this.palette[e++]=this.Av(l,i)}}for(let t=0;t<50;t++){const e=this.ev[t];if(!e)continue;const s=e.palette;this.av[t]=new Int32Array(s.length);for(let e=0;e{const e=(t>>16)/256,s=(t>>8&255)/256,n=(255&t)/256;return((256*Math.pow(e,i)|0)<<16)+((256*Math.pow(s,i)|0)<<8)+(256*Math.pow(n,i)|0)};static gv=t=>{this.nv||(this.hv=t,this.et?this.nv=new r.Xr(t,16384):this.nv=new r.Xr(t,65536),this.rv.fill(null))};static hI=(t,i,e,s,n,r,h,o,a)=>{let l=0,c=0;n!==s&&(l=(i-t<<16)/(n-s)|0,c=(o-h<<15)/(n-s)|0);let f=0,u=0;r!==n&&(f=(e-i<<16)/(r-n)|0,u=(a-o<<15)/(r-n)|0);let d=0,w=0;if(r!==s&&(d=(t-e<<16)/(s-r)|0,w=(h-a<<15)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),nf)for(r-=n,n-=s,s=this.aw[s];;){if(--n<0)for(;;){if(--r<0)return;this.Iv(e>>16,i>>16,a>>7,o>>7,this.lw,s,0),e+=d,i+=f,a+=w,o+=u,s+=this.cw}this.Iv(e>>16,t>>16,a>>7,h>>7,this.lw,s,0),e+=d,t+=l,a+=w,h+=c,s+=this.cw}else for(r-=n,n-=s,s=this.aw[s];;){if(--n<0)for(;;){if(--r<0)return;this.Iv(i>>16,e>>16,o>>7,a>>7,this.lw,s,0),e+=d,i+=f,a+=w,o+=u,s+=this.cw}this.Iv(t>>16,e>>16,h>>7,a>>7,this.lw,s,0),e+=d,t+=l,a+=w,h+=c,s+=this.cw}else if(i=t<<=16,o=h<<=15,s<0&&(i-=d*s,t-=l*s,o-=w*s,h-=c*s,s=0),e<<=16,a<<=15,r<0&&(e-=f*r,a-=u*r,r=0),s!==r&&dl)for(n-=r,r-=s,s=this.aw[s];;){if(--r<0)for(;;){if(--n<0)return;this.Iv(e>>16,t>>16,a>>7,h>>7,this.lw,s,0),e+=f,t+=l,a+=u,h+=c,s+=this.cw}this.Iv(i>>16,t>>16,o>>7,h>>7,this.lw,s,0),i+=d,t+=l,o+=w,h+=c,s+=this.cw}else for(n-=r,r-=s,s=this.aw[s];;){if(--r<0)for(;;){if(--n<0)return;this.Iv(t>>16,e>>16,h>>7,a>>7,this.lw,s,0),e+=f,t+=l,a+=u,h+=c,s+=this.cw}this.Iv(t>>16,i>>16,h>>7,o>>7,this.lw,s,0),i+=d,t+=l,o+=w,h+=c,s+=this.cw}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),rd)for(s-=r,r-=n,n=this.aw[n];;){if(--r<0)for(;;){if(--s<0)return;this.Iv(t>>16,e>>16,h>>7,a>>7,this.lw,n,0),t+=l,e+=d,h+=c,a+=w,n+=this.cw}this.Iv(t>>16,i>>16,h>>7,o>>7,this.lw,n,0),t+=l,i+=f,h+=c,o+=u,n+=this.cw}else for(s-=r,r-=n,n=this.aw[n];;){if(--r<0)for(;;){if(--s<0)return;this.Iv(e>>16,t>>16,a>>7,h>>7,this.lw,n,0),t+=l,e+=d,h+=c,a+=w,n+=this.cw}this.Iv(i>>16,t>>16,o>>7,h>>7,this.lw,n,0),t+=l,i+=f,h+=c,o+=u,n+=this.cw}else if(e=i<<=16,a=o<<=15,n<0&&(e-=l*n,i-=f*n,a-=c*n,o-=u*n,n=0),t<<=16,h<<=15,s<0&&(t-=d*s,h-=w*s,s=0),r-=s,s-=n,n=this.aw[n],l>16,i>>16,h>>7,o>>7,this.lw,n,0),t+=d,i+=f,h+=w,o+=u,n+=this.cw}this.Iv(e>>16,i>>16,a>>7,o>>7,this.lw,n,0),e+=l,i+=f,a+=c,o+=u,n+=this.cw}else for(;;){if(--s<0)for(;;){if(--r<0)return;this.Iv(i>>16,t>>16,o>>7,h>>7,this.lw,n,0),t+=d,i+=f,h+=w,o+=u,n+=this.cw}this.Iv(i>>16,e>>16,o>>7,a>>7,this.lw,n,0),e+=l,i+=f,a+=c,o+=u,n+=this.cw}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,o>>7,h>>7,this.lw,r,0),i+=f,t+=l,o+=u,h+=c,r+=this.cw}this.Iv(i>>16,e>>16,o>>7,a>>7,this.lw,r,0),i+=f,e+=d,o+=u,a+=w,r+=this.cw}else for(;;){if(--s<0)for(;;){if(--n<0)return;this.Iv(t>>16,i>>16,h>>7,o>>7,this.lw,r,0),i+=f,t+=l,o+=u,h+=c,r+=this.cw}this.Iv(e>>16,i>>16,a>>7,o>>7,this.lw,r,0),i+=f,e+=d,o+=u,a+=w,r+=this.cw}else if(t=e<<=16,h=a<<=15,r<0&&(t-=f*r,e-=d*r,h-=u*r,a-=w*r,r=0),i<<=16,o<<=15,n<0&&(i-=l*n,o-=c*n,n=0),s-=n,n-=r,r=this.aw[r],f>16,e>>16,o>>7,a>>7,this.lw,r,0),i+=l,e+=d,o+=c,a+=w,r+=this.cw}this.Iv(t>>16,e>>16,h>>7,a>>7,this.lw,r,0),t+=f,e+=d,h+=u,a+=w,r+=this.cw}else for(;;){if(--n<0)for(;;){if(--s<0)return;this.Iv(e>>16,i>>16,a>>7,o>>7,this.lw,r,0),i+=l,e+=d,o+=c,a+=w,r+=this.cw}this.Iv(e>>16,t>>16,a>>7,h>>7,this.lw,r,0),t+=f,e+=d,h+=u,a+=w,r+=this.cw}};static Iv=(t,i,e,s,n,r,h)=>{let o;if(this.uw){let a;if(this.iI){if(a=i-t>3?(s-e)/(i-t)|0:0,i>this.eI&&(i=this.eI),t<0&&(e-=t*a,t=0),t>=i)return;r+=t,h=i-t>>2,a<<=2}else{if(!(t>2)>0?(s-e)*this.tv[h]>>15:0}if(0===this.alpha)for(;;){if(--h<0){if((h=i-t&3)>0){o=this.palette[e>>8];do{n[r++]=o,h--}while(h>0);return}break}o=this.palette[e>>8],e+=a,n[r++]=o,n[r++]=o,n[r++]=o,n[r++]=o}else{const s=this.alpha,l=256-this.alpha;for(;;){if(--h<0){if((h=i-t&3)>0){o=this.palette[e>>8],o=((16711935&o)*l>>8&16711935)+((65280&o)*l>>8&65280);do{n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),h--}while(h>0)}break}o=this.palette[e>>8],e+=a,o=((16711935&o)*l>>8&16711935)+((65280&o)*l>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280)}}}else if(tthis.eI&&(i=this.eI),t<0&&(e-=t*a,t=0),t>=i))return;if(r+=t,h=i-t,0===this.alpha)do{n[r++]=this.palette[e>>8],e+=a,h--}while(h>0);else{const t=this.alpha,i=256-this.alpha;do{o=this.palette[e>>8],e+=a,o=((16711935&o)*i>>8&16711935)+((65280&o)*i>>8&65280),n[r++]=o+((16711935&n[r])*t>>8&16711935)+((65280&n[r])*t>>8&65280),h--}while(h>0)}}};static _v=(t,i,e,s,n,r,h)=>{let o=0;n!==s&&(o=(i-t<<16)/(n-s)|0);let a=0;r!==n&&(a=(e-i<<16)/(r-n)|0);let l=0;if(r!==s&&(l=(t-e<<16)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),na)for(r-=n,n-=s,s=this.aw[s];;){if(--n<0)for(;;){if(--r<0)return;this.Cv(e>>16,i>>16,this.lw,s,h),e+=l,i+=a,s+=this.cw}this.Cv(e>>16,t>>16,this.lw,s,h),e+=l,t+=o,s+=this.cw}else for(r-=n,n-=s,s=this.aw[s];;){if(--n<0)for(;;){if(--r<0)return;this.Cv(i>>16,e>>16,this.lw,s,h),e+=l,i+=a,s+=this.cw}this.Cv(t>>16,e>>16,this.lw,s,h),e+=l,t+=o,s+=this.cw}else if(i=t<<=16,s<0&&(i-=l*s,t-=o*s,s=0),e<<=16,r<0&&(e-=a*r,r=0),s!==r&&lo)for(n-=r,r-=s,s=this.aw[s];;){if(--r<0)for(;;){if(--n<0)return;this.Cv(e>>16,t>>16,this.lw,s,h),e+=a,t+=o,s+=this.cw}this.Cv(i>>16,t>>16,this.lw,s,h),i+=l,t+=o,s+=this.cw}else for(n-=r,r-=s,s=this.aw[s];;){if(--r<0)for(;;){if(--n<0)return;this.Cv(t>>16,e>>16,this.lw,s,h),e+=a,t+=o,s+=this.cw}this.Cv(t>>16,i>>16,this.lw,s,h),i+=l,t+=o,s+=this.cw}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),rl)for(s-=r,r-=n,n=this.aw[n];;){if(--r<0)for(;;){if(--s<0)return;this.Cv(t>>16,e>>16,this.lw,n,h),t+=o,e+=l,n+=this.cw}this.Cv(t>>16,i>>16,this.lw,n,h),t+=o,i+=a,n+=this.cw}else for(s-=r,r-=n,n=this.aw[n];;){if(--r<0)for(;;){if(--s<0)return;this.Cv(e>>16,t>>16,this.lw,n,h),t+=o,e+=l,n+=this.cw}this.Cv(i>>16,t>>16,this.lw,n,h),t+=o,i+=a,n+=this.cw}else if(e=i<<=16,n<0&&(e-=o*n,i-=a*n,n=0),t<<=16,s<0&&(t-=l*s,s=0),o>16,i>>16,this.lw,n,h),t+=l,i+=a,n+=this.cw}this.Cv(e>>16,i>>16,this.lw,n,h),e+=o,i+=a,n+=this.cw}else for(r-=s,s-=n,n=this.aw[n];;){if(--s<0)for(;;){if(--r<0)return;this.Cv(i>>16,t>>16,this.lw,n,h),t+=l,i+=a,n+=this.cw}this.Cv(i>>16,e>>16,this.lw,n,h),e+=o,i+=a,n+=this.cw}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,this.lw,r,h),i+=a,t+=o,r+=this.cw}this.Cv(i>>16,e>>16,this.lw,r,h),i+=a,e+=l,r+=this.cw}else for(n-=s,s-=r,r=this.aw[r];;){if(--s<0)for(;;){if(--n<0)return;this.Cv(t>>16,i>>16,this.lw,r,h),i+=a,t+=o,r+=this.cw}this.Cv(e>>16,i>>16,this.lw,r,h),i+=a,e+=l,r+=this.cw}else if(t=e<<=16,r<0&&(t-=a*r,e-=l*r,r=0),i<<=16,n<0&&(i-=o*n,n=0),a>16,e>>16,this.lw,r,h),i+=o,e+=l,r+=this.cw}this.Cv(t>>16,e>>16,this.lw,r,h),t+=a,e+=l,r+=this.cw}else for(s-=n,n-=r,r=this.aw[r];;){if(--n<0)for(;;){if(--s<0)return;this.Cv(e>>16,i>>16,this.lw,r,h),i+=o,e+=l,r+=this.cw}this.Cv(e>>16,t>>16,this.lw,r,h),t+=a,e+=l,r+=this.cw}};static cI=(t,i,e,s,n,r,h,o,a,l,c,f,u,d,w,y,A,m,p)=>{const g=this.Ev(p);this.lv=!this.cv[p];const I=l-u,_=c-w,C=f-A,E=d-l,v=y-c,b=m-f;let T=E*c-v*l<<14;const R=v*f-b*c<<8,O=b*l-E*f<<5;let L=I*c-_*l<<14;const S=_*f-C*c<<8,x=C*l-I*f<<5;let k=_*E-I*v<<14;const M=C*v-_*b<<8,D=I*b-C*E<<5;let N=0,F=0;n!==s&&(N=(i-t<<16)/(n-s)|0,F=(o-h<<16)/(n-s)|0);let B=0,U=0;r!==n&&(B=(e-i<<16)/(r-n)|0,U=(a-o<<16)/(r-n)|0);let P=0,G=0;if(r!==s&&(P=(t-e<<16)/(s-r)|0,G=(h-a<<16)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),nB)for(r-=n,n-=s,s=this.aw[s];;){if(--n<0)for(;;){if(--r<0)return;this.vv(e>>16,i>>16,this.lw,s,g,0,0,T,L,k,R,S,M,a>>8,o>>8),e+=P,i+=B,a+=G,o+=U,s+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.vv(e>>16,t>>16,this.lw,s,g,0,0,T,L,k,R,S,M,a>>8,h>>8),e+=P,t+=N,a+=G,h+=F,s+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}else for(r-=n,n-=s,s=this.aw[s];;){if(--n<0)for(;;){if(--r<0)return;this.vv(i>>16,e>>16,this.lw,s,g,0,0,T,L,k,R,S,M,o>>8,a>>8),e+=P,i+=B,a+=G,o+=U,s+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.vv(t>>16,e>>16,this.lw,s,g,0,0,T,L,k,R,S,M,h>>8,a>>8),e+=P,t+=N,a+=G,h+=F,s+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}}else{i=t<<=16,o=h<<=16,s<0&&(i-=P*s,t-=N*s,o-=G*s,h-=F*s,s=0),e<<=16,a<<=16,r<0&&(e-=B*r,a-=U*r,r=0);const l=s-this.hl;if(T+=O*l,L+=x*l,k+=D*l,T|=0,L|=0,k|=0,(s===r||P>=N)&&(s!==r||B<=N))for(n-=r,r-=s,s=this.aw[s];;){if(--r<0)for(;;){if(--n<0)return;this.vv(t>>16,e>>16,this.lw,s,g,0,0,T,L,k,R,S,M,h>>8,a>>8),e+=B,t+=N,a+=U,h+=F,s+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.vv(t>>16,i>>16,this.lw,s,g,0,0,T,L,k,R,S,M,h>>8,o>>8),i+=P,t+=N,o+=G,h+=F,s+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}else for(n-=r,r-=s,s=this.aw[s];;){if(--r<0)for(;;){if(--n<0)return;this.vv(e>>16,t>>16,this.lw,s,g,0,0,T,L,k,R,S,M,a>>8,h>>8),e+=B,t+=N,a+=U,h+=F,s+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.vv(i>>16,t>>16,this.lw,s,g,0,0,T,L,k,R,S,M,o>>8,h>>8),i+=P,t+=N,o+=G,h+=F,s+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),rP)for(s-=r,r-=n,n=this.aw[n];;){if(--r<0)for(;;){if(--s<0)return;this.vv(t>>16,e>>16,this.lw,n,g,0,0,T,L,k,R,S,M,h>>8,a>>8),t+=N,e+=P,h+=F,a+=G,n+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.vv(t>>16,i>>16,this.lw,n,g,0,0,T,L,k,R,S,M,h>>8,o>>8),t+=N,i+=B,h+=F,o+=U,n+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}else for(s-=r,r-=n,n=this.aw[n];;){if(--r<0)for(;;){if(--s<0)return;this.vv(e>>16,t>>16,this.lw,n,g,0,0,T,L,k,R,S,M,a>>8,h>>8),t+=N,e+=P,h+=F,a+=G,n+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.vv(i>>16,t>>16,this.lw,n,g,0,0,T,L,k,R,S,M,o>>8,h>>8),t+=N,i+=B,h+=F,o+=U,n+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}}else{e=i<<=16,a=o<<=16,n<0&&(e-=N*n,i-=B*n,a-=F*n,o-=U*n,n=0),t<<=16,h<<=16,s<0&&(t-=P*s,h-=G*s,s=0);const l=n-this.hl;if(T+=O*l,L+=x*l,k+=D*l,T|=0,L|=0,k|=0,r-=s,s-=n,n=this.aw[n],N>16,i>>16,this.lw,n,g,0,0,T,L,k,R,S,M,h>>8,o>>8),t+=P,i+=B,h+=G,o+=U,n+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.vv(e>>16,i>>16,this.lw,n,g,0,0,T,L,k,R,S,M,a>>8,o>>8),e+=N,i+=B,a+=F,o+=U,n+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}else for(;;){if(--s<0)for(;;){if(--r<0)return;this.vv(i>>16,t>>16,this.lw,n,g,0,0,T,L,k,R,S,M,o>>8,h>>8),t+=P,i+=B,h+=G,o+=U,n+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.vv(i>>16,e>>16,this.lw,n,g,0,0,T,L,k,R,S,M,o>>8,a>>8),e+=N,i+=B,a+=F,o+=U,n+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,this.lw,r,g,0,0,T,L,k,R,S,M,o>>8,h>>8),i+=B,t+=N,o+=U,h+=F,r+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.vv(i>>16,e>>16,this.lw,r,g,0,0,T,L,k,R,S,M,o>>8,a>>8),i+=B,e+=P,o+=U,a+=G,r+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}else for(;;){if(--s<0)for(;;){if(--n<0)return;this.vv(t>>16,i>>16,this.lw,r,g,0,0,T,L,k,R,S,M,h>>8,o>>8),i+=B,t+=N,o+=U,h+=F,r+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.vv(e>>16,i>>16,this.lw,r,g,0,0,T,L,k,R,S,M,a>>8,o>>8),i+=B,e+=P,o+=U,a+=G,r+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}}else{t=e<<=16,h=a<<=16,r<0&&(t-=B*r,e-=P*r,h-=U*r,a-=G*r,r=0),i<<=16,o<<=16,n<0&&(i-=N*n,o-=F*n,n=0);const l=r-this.hl;if(T+=O*l,L+=x*l,k+=D*l,T|=0,L|=0,k|=0,s-=n,n-=r,r=this.aw[r],B>16,e>>16,this.lw,r,g,0,0,T,L,k,R,S,M,o>>8,a>>8),i+=N,e+=P,o+=F,a+=G,r+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.vv(t>>16,e>>16,this.lw,r,g,0,0,T,L,k,R,S,M,h>>8,a>>8),t+=B,e+=P,h+=U,a+=G,r+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}else for(;;){if(--n<0)for(;;){if(--s<0)return;this.vv(e>>16,i>>16,this.lw,r,g,0,0,T,L,k,R,S,M,a>>8,o>>8),i+=N,e+=P,o+=F,a+=G,r+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}this.vv(e>>16,t>>16,this.lw,r,g,0,0,T,L,k,R,S,M,a>>8,h>>8),t+=B,e+=P,h+=U,a+=G,r+=this.cw,T+=O,L+=x,k+=D,T|=0,L|=0,k|=0}}};static vv=(t,i,e,s,n,r,h,o,a,l,c,f,u,d,w)=>{if(t>=i)return;let y,A,m,p,g,I,_,C,E;if(this.iI){if(y=(w-d)/(i-t)|0,i>this.eI&&(i=this.eI),t<0&&(d-=t*y,t=0),t>=i)return;A=i-t>>3,y<<=12}else i-t>7?(A=i-t>>3,y=(w-d)*this.tv[A]>>6):(A=0,y=0);if(d<<=9,s+=t,this.et&&n)if(m=0,p=0,I=t-this.rl,o+=(c>>3)*I,a+=(f>>3)*I,l+=(u>>3)*I,o|=0,a|=0,g=(l|=0)>>12,0!==g&&(h=a/g|0,(r=o/g|0)<0?r=0:r>4032&&(r=4032)),o+=c,a+=f,l+=u,o|=0,a|=0,g=(l|=0)>>12,0!==g&&(m=o/g|0,p=a/g|0,m<7?m=7:m>4032&&(m=4032)),_=m-r>>3,C=p-h>>3,r+=d>>3&786432,E=d>>23,this.lv){for(;A-- >0;)e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r=m,h=p,o+=c,a+=f,g=(l+=u)>>12,0!==g&&(m=o/g|0,p=a/g|0,m<7?m=7:m>4032&&(m=4032)),_=m-r>>3,C=p-h>>3,r+=(d+=y)>>3&786432,E=d>>23;for(A=i-t&7;A-- >0;)e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=_,h+=C}else{for(;A-- >0;){let t;0!=(t=n[(4032&h)+(r>>6)]>>>E)&&(e[s]=t),s+=1,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=_)>>6)]>>>E)&&(e[s]=t),s+=1,r=m,h=p,o+=c,a+=f,l+=u,o|=0,a|=0,g=(l|=0)>>12,0!==g&&(m=o/g|0,p=a/g|0,m<7?m=7:m>4032&&(m=4032)),_=m-r>>3,C=p-h>>3,r+=(d+=y)>>3&786432,E=d>>23}for(A=i-t&7;A-- >0;){let t;0!=(t=n[(4032&h)+(r>>6)]>>>E)&&(e[s]=t),s++,r+=_,h+=C}}else if(m=0,p=0,I=t-this.rl,o+=(c>>3)*I,a+=(f>>3)*I,l+=(u>>3)*I,o|=0,a|=0,g=(l|=0)>>14,0!==g&&(h=a/g|0,(r=o/g|0)<0?r=0:r>16256&&(r=16256)),o+=c,a+=f,l+=u,o|=0,a|=0,g=(l|=0)>>14,0!==g&&(m=o/g|0,p=a/g|0,m<7?m=7:m>16256&&(m=16256)),_=m-r>>3,C=p-h>>3,r+=6291456&d,E=d>>23,this.lv&&n){for(;A-- >0;)e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r=m,h=p,o+=c,a+=f,l+=u,o|=0,a|=0,g=(l|=0)>>14,0!==g&&(m=o/g|0,p=a/g|0,m<7?m=7:m>16256&&(m=16256)),_=m-r>>3,C=p-h>>3,r+=6291456&(d+=y),E=d>>23;for(A=i-t&7;A-- >0;)e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=_,h+=C}else{for(;A-- >0&&n;){let t;0!=(t=n[(16256&h)+(r>>7)]>>>E)&&(e[s]=t),s+=1,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=_)>>7)]>>>E)&&(e[s]=t),s++,r=m,h=p,o+=c,a+=f,l+=u,o|=0,a|=0,g=(l|=0)>>14,0!==g&&(m=o/g|0,p=a/g|0,m<7?m=7:m>16256&&(m=16256)),_=m-r>>3,C=p-h>>3,r+=6291456&(d+=y),E=d>>23}for(A=i-t&7;A-- >0&&n;){let t;0!=(t=n[(16256&h)+(r>>7)]>>>E)&&(e[s]=t),s++,r+=_,h+=C}}};static Cv=(t,i,e,s,n)=>{if(this.iI&&(i>this.eI&&(i=this.eI),t<0&&(t=0)),t>=i)return;s+=t;let r=i-t>>2;if(0===this.alpha)for(;;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;e[s++]=n}e[s++]=n,e[s++]=n,e[s++]=n,e[s++]=n}const h=this.alpha,o=256-this.alpha;for(n=((16711935&n)*o>>8&16711935)+((65280&n)*o>>8&65280);;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280)}e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280)}};static pv=t=>{this.rv[t]&&this.nv&&(this.nv[this.hv++]=this.rv[t],this.rv[t]=null)};static Ev=t=>{if(this.ov[t]=this.vm++,this.rv[t])return this.rv[t];let i;if(this.hv>0&&this.nv)i=this.nv[--this.hv],this.nv[this.hv]=null;else{let t=0,e=-1;for(let i=0;i>>3)&16316671,i[n+8192]=r-(r>>>2)&16316671,i[n+12288]=r-(r>>>2)-(r>>>3)&16316671}}else{if(64===e.width)for(let t=0;t<128;t++)for(let n=0;n<128;n++)i[n+(t<<7)]=s[e.lw[(n>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)i[t]=s[e.lw[t]];this.cv[t]=!1;for(let e=0;e<16384;e++){i[e]&=16316671;const s=i[e];0===s&&(this.cv[t]=!0),i[e+16384]=s-(s>>>3)&16316671,i[e+32768]=s-(s>>>2)&16316671,i[e+49152]=s-(s>>>2)-(s>>>3)&16316671}}return i}}},880:(t,i,e)=>{e.d(i,{r:()=>n});var s=e(7854);const n=async t=>{255!==t[0]&&(t[0]=255),URL.revokeObjectURL(s.SE.src),s.SE.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>s.SE.onload=()=>t())),s.LE.clearRect(0,0,s.xE.width,s.xE.height);const i=s.SE.naturalWidth,e=s.SE.naturalHeight;return s.xE.width=i,s.xE.height=e,s.LE.drawImage(s.SE,0,0),s.LE.getImageData(0,0,i,e)}},8665:(t,i,e)=>{e.d(i,{A:()=>f});var s=e(1069),n=e(8950),r=e(4583),h=e(6730),o=e(4474),a=e(3867);class l{Rd=0;Ag=0;bv=0;Tv=-1;Rv=-1;Ov=-1;Lv=-1;Sv=-1;xv=-1;kv=-1;Mv=-1;Dv=-1;Nv=0;Fv=-1;Bv=-1;Uv=-1;data=null}class c{x=0;y=0;z=0;w=0}class f extends o.A{static metadata=null;static head=null;static Pv=null;static Gv=null;static Wv=null;static Yv=null;static Hv=null;static Vv=null;static Kv=null;static Xv=null;static jv=null;static zv=null;static Zv=null;static qv=null;static axis=null;static $v=new a.fe(4096,!1);static Jv=new a.fe(4096,!1);static Qv=new Int32Array(4096);static tb=new Int32Array(4096);static ib=new Int32Array(4096);static eb=new Int32Array(4096);static sb=new Int32Array(4096);static nb=new Int32Array(4096);static rb=new Int32Array(1500);static hb=new a.Xr(1500,512);static ob=new Int32Array(12);static ab=new a.Xr(12,2e3);static lb=new Int32Array(2e3);static cb=new Int32Array(2e3);static fb=new Int32Array(12);static ub=new Int32Array(10);static wb=new Int32Array(10);static yb=new Int32Array(10);static Ir=0;static Ab=0;static _r=0;static mb=!1;static Ma=0;static Da=0;static pb=0;static gb=new Int32Array(1e3);static Ib=!1;static hu(t){try{f.head=new s.A(t.read('ob_head.dat')),f.Pv=new s.A(t.read('ob_face1.dat')),f.Gv=new s.A(t.read('ob_face2.dat')),f.Wv=new s.A(t.read('ob_face3.dat')),f.Yv=new s.A(t.read('ob_face4.dat')),f.Hv=new s.A(t.read('ob_face5.dat')),f.Vv=new s.A(t.read('ob_point1.dat')),f.Kv=new s.A(t.read('ob_point2.dat')),f.Xv=new s.A(t.read('ob_point3.dat')),f.jv=new s.A(t.read('ob_point4.dat')),f.zv=new s.A(t.read('ob_point5.dat')),f.Zv=new s.A(t.read('ob_vertex1.dat')),f.qv=new s.A(t.read('ob_vertex2.dat')),f.axis=new s.A(t.read('ob_axis.dat')),f.head.lf=0,f.Vv.lf=0,f.Kv.lf=0,f.Xv.lf=0,f.jv.lf=0,f.Zv.lf=0,f.qv.lf=0;const i=f.head.ou;f.metadata=new a.fe(i+100,null);let e=0,n=0,r=0,h=0,o=0,c=0,u=0;for(let t=0;t>7)<2?i=2:i>126&&(i=126),(65408&t)+i):(i<0?i=0:i>127&&(i=127),127-i)}static Td=(t,i,e)=>{const s=t.Rd,n=t.Ag,r=t.bv;let h,o,l,u,d;if(i){h=new Int32Array(s);for(let i=0;i{const n=t.Rd,r=t.Ag,h=t.bv;let o,a,l,c,u;if(s)o=t.Od,a=t.Sd,l=t.Ld;else{o=new Int32Array(n),a=new Int32Array(n),l=new Int32Array(n);for(let i=0;i{const e=t.Rd,s=t.Ag,n=t.bv,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e);for(let i=0;i{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,a=0,l=-1;for(let c=0;c{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,a=0,l=-1;for(let c=0;c{let o=-1;const a=t.Od[i],l=t.Sd[i],c=t.Ld[i];for(let t=0;t{if(!f.metadata)throw new Error('cant loading model metadata!!!!!');const i=f.metadata[t];if(!i)throw console.log(`Error model:${t} not found!`),new Error('cant loading model metadata!!!!!');if(!(f.head&&f.Pv&&f.Gv&&f.Wv&&f.Yv&&f.Hv&&f.Vv&&f.Kv&&f.Xv&&f.jv&&f.zv&&f.Zv&&f.qv&&f.axis))throw new Error('cant loading model!!!!!');const e=i.Rd,s=i.Ag,n=i.bv,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e),a=new Int32Array(s),l=new Int32Array(s),c=new Int32Array(s),u=new Int32Array(n),d=new Int32Array(n),w=new Int32Array(n);let y=null;i.Sv>=0&&(y=new Int32Array(e));let A=null;i.Dv>=0&&(A=new Int32Array(s));let m=null,p=0;i.Nv>=0?m=new Int32Array(s):p=-i.Nv-1;let g=null;i.Fv>=0&&(g=new Int32Array(s));let I=null;i.Bv>=0&&(I=new Int32Array(s));const _=new Int32Array(s);f.Vv.lf=i.Tv,f.Kv.lf=i.Rv,f.Xv.lf=i.Ov,f.jv.lf=i.Lv,f.zv.lf=i.Sv;let C,E,v,b=0,T=0,R=0;for(let t=0;t{if(!f.metadata||!f.metadata[i])throw new Error('No model metadata');const e=f.metadata[i];if(e.data=t,!e.data.length)throw new Error('No model data');const n=e.Rd,r=e.Ag,h=e.bv,o=new Int32Array(n),a=new Int32Array(n),l=new Int32Array(n),c=new Int32Array(r),u=new Int32Array(r),d=new Int32Array(r),w=new Int32Array(h),y=new Int32Array(h),A=new Int32Array(h);let m=null;e.Sv>=0&&(m=new Int32Array(n));let p=null;e.Dv>=0&&(p=new Int32Array(r));let g=null,I=0;e.Nv>=0?g=new Int32Array(r):I=-e.Nv-1;let _=null;e.Fv>=0&&(_=new Int32Array(r));let C=null;e.Bv>=0&&(C=new Int32Array(r));const E=new Int32Array(r),v=new s.A(e.data);v.lf=e.Tv;const b=new s.A(e.data);b.lf=e.Rv;const T=new s.A(e.data);T.lf=e.Ov;const R=new s.A(e.data);R.lf=e.Lv;const O=new s.A(e.data);O.lf=e.Sv;let L,S,x,k=0,M=0,D=0;for(let t=0;tthis.Ud&&(this.Ud=-e),e>this.cg&&(this.cg=e);const n=i*i+s*s;n>this.dm&&(this.dm=n)}this.dm=Math.sqrt(this.dm)+.99|0,this.kb=Math.sqrt(this.dm*this.dm+this.Ud*this.Ud)+.99|0,this.xb=this.kb+(Math.sqrt(this.dm*this.dm+this.cg*this.cg)+.99|0)}xd(){this.Ud=0,this.cg=0;for(let t=0;tthis.Ud&&(this.Ud=-i),i>this.cg&&(this.cg=i)}this.kb=Math.sqrt(this.dm*this.dm+this.Ud*this.Ud)+.99|0,this.xb=this.kb+(Math.sqrt(this.dm*this.dm+this.cg*this.cg)+.99|0)}xl(){if(this.Mb){const t=new Int32Array(256);let i=0;for(let e=0;ei&&(i=s)}this.Nd=new a.fe(i+1,null);for(let e=0;e<=i;e++)this.Nd[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;ei&&(i=s)}this.Dd=new a.fe(i+1,null);for(let e=0;e<=i;e++)this.Dd[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;ea;)a=e[o++];r&&r.types&&s.x&&s.y&&s.z&&r.labels&&(i!==a||0===r.types[i])&&this.Ub(s.x[t],s.y[t],s.z[t],r.labels[i],r.types[i])}f.Ir=0,f.Ab=0,f._r=0,o=0,a=e[o++];for(let t=0;ta;)a=e[o++];r&&r.types&&n.x&&n.y&&n.z&&r.labels&&(i===a||0===r.types[i])&&this.Ub(n.x[t],n.y[t],n.z[t],r.labels[i],r.types[i])}}else this.kl(t)}kl(t){if(!this.Nd||-1===t||!h.A.Lo[t])return;const i=h.A.Lo[t],e=i.TE;f.Ir=0,f.Ab=0,f._r=0;for(let t=0;t>16;this.Ld[t]=this.Sd[t]*i+this.Ld[t]*e>>16,this.Sd[t]=s}}translate(t,i,e){for(let s=0;s>8;if(this.Eb&&this.vb&&this.bb||(this.Eb=new Int32Array(this.Ag),this.vb=new Int32Array(this.Ag),this.bb=new Int32Array(this.Ag)),!this.eg){this.eg=new a.fe(this.Rd,null);for(let t=0;t8192||m>8192||p>8192||A<-8192||m<-8192||p<-8192;)A>>=1,m>>=1,p>>=1;let g=0|Math.sqrt(A*A+m*m+p*p);if(g<=0&&(g=1),A=256*A/g|0,m=256*m/g|0,p=256*p/g|0,this.yg&&1&this.yg[i]){const r=t+((e*A+s*m+n*p)/(h+(h/2|0))|0);this.Eu&&(this.Eb[i]=f.Cb(this.Eu[i],r,this.yg[i]))}else{let t=this.eg[r];t&&(t.x+=A,t.y+=m,t.z+=p,t.w++),t=this.eg[o],t&&(t.x+=A,t.y+=m,t.z+=p,t.w++),t=this.eg[a],t&&(t.x+=A,t.y+=m,t.z+=p,t.w++)}}if(r)this.rg(t,h,e,s,n);else{this.lg=new a.fe(this.Rd,null);for(let t=0;t>16;for(let s=0;s>16,I=I*w-g*d>>16,g=p),0!==t&&(p=I*l-_*a>>16,_=I*a+_*l>>16,I=p),0!==i&&(p=_*c+g*u>>16,_=_*u-g*c>>16,g=p),g+=n,I+=h,_+=o,p=I*A-_*y>>16,_=I*y+_*A>>16,I=p,f.Qv&&f.tb&&f.ib&&(f.ib[s]=_-m,f.Qv[s]=r.A.rl+((g<<9)/_|0),f.tb[s]=r.A.hl+((I<<9)/_|0)),this.bv>0&&f.eb&&f.sb&&f.nb&&(f.eb[s]=g,f.sb[s]=I,f.nb[s]=_)}try{this.Wb(!1,!1,0)}catch(t){}}draw(t,i,e,s,h,o,a,l,c){const u=l*h-o*s>>16,d=a*i+u*e>>16,w=this.dm*e>>16,y=d+w;if(y<=50||d>=3500)return;const A=l*s+o*h>>16;let m=A-this.dm<<9;if((m/y|0)>=n.A.jE)return;let p=A+this.dm<<9;if((p/y|0)<=-n.A.jE)return;const g=a*e-u*i>>16,I=this.dm*i>>16;let _=g+I<<9;if((_/y|0)<=-n.A.zE)return;let C=g-(I+(this.Ud*e>>16))<<9;if((C/y|0)>=n.A.zE)return;let E=d-(w+(this.Ud*i>>16))<=50,v=!1;if(c>0&&f.mb){let t=d-w;t<=50&&(t=50),A>0?(m=m/y|0,p=p/t|0):(p=p/y|0,m=m/t|0),g>0?(C=C/y|0,_=_/t|0):(_=_/y|0,C=C/t|0);const i=f.Ma-r.A.rl,e=f.Da-r.A.hl;i>m&&iC&&e<_&&(this.Jd?f.gb[f.pb++]=c:v=!0)}const b=r.A.rl,T=r.A.hl;let R=0,O=0;0!==t&&(R=r.A.sin[t],O=r.A.cos[t]);for(let n=0;n>16,w=w*O-c*R>>16,c=r),c+=o,u+=a,w+=l,r=w*s+c*h>>16,w=w*h-c*s>>16,c=r,r=u*e-w*i>>16,w=u*i+w*e>>16,u=r,f.ib&&(f.ib[n]=w-d),w>=50&&f.Qv&&f.tb?(f.Qv[n]=b+((c<<9)/w|0),f.tb[n]=T+((u<<9)/w|0)):f.Qv&&(f.Qv[n]=-5e3,E=!0),(E||this.bv>0)&&f.eb&&f.sb&&f.nb&&(f.eb[n]=c,f.sb[n]=u,f.nb[n]=w)}try{this.Wb(E,v,c)}catch(t){}}Wb(t,i,e,s=!1){f.Ib&&(this.Fb=-1,this.Bb=-1);for(let t=0;tn.A.eI||l>n.A.eI||c>n.A.eI),f.hb&&f.rb){const t=((y+A+m)/3|0)+this.kb;f.hb[t][f.rb[t]++]=s,f.Ib&&this.Yb(f.Ma,f.Da,u,d,w,a,l,c)&&this.Bb=0;t--){const i=f.rb[t];if(!(i<=0)&&f.hb){const e=f.hb[t];for(let t=0;t=0;t--){const i=f.rb[t];if(i>0&&f.hb){const e=f.hb[t];for(let s=0;s0||f.ob[2]>0)&&(r=(f.fb[1]+f.fb[2])/(f.ob[1]+f.ob[2])|0);let h=0;f.ob&&f.fb&&(f.ob[3]>0||f.ob[4]>0)&&(h=(f.fb[3]+f.fb[4])/(f.ob[3]+f.ob[4])|0);let o=0;if(f.ob&&f.fb&&(f.ob[6]>0||f.ob[8]>0)&&(o=(f.fb[6]+f.fb[8])/(f.ob[6]+f.ob[8])|0),f.ob&&f.ab){let t,i=0,e=f.ob[10],n=f.ab[10],a=f.lb;i===e&&(i=0,e=f.ob[11],n=f.ab[11],a=f.cb),t=ir;)this.Hb(n[i++],s),i===e&&n!==f.ab[11]&&(i=0,e=f.ob[11],n=f.ab[11],a=f.cb),t=ih;)this.Hb(n[i++],s),i===e&&n!==f.ab[11]&&(i=0,e=f.ob[11],n=f.ab[11],a=f.cb),t=io;)this.Hb(n[i++],s),i===e&&n!==f.ab[11]&&(i=0,e=f.ob[11],n=f.ab[11],a=f.cb),t=i>2,h=this.Ob[i],o=this.Lb[i],a=this.Sb[i];r.A.cI(f.Qv[e],f.Qv[s],f.Qv[n],f.tb[e],f.tb[s],f.tb[n],this.Eb[t],this.vb[t],this.bb[t],f.eb[h],f.sb[h],f.nb[h],f.eb[o],f.eb[a],f.sb[o],f.sb[a],f.nb[o],f.nb[a],this.Eu[t])}else if(3===h&&this.yg&&this.Eu&&this.Eb&&f.Qv&&f.tb&&f.eb&&f.sb&&f.nb){const i=this.yg[t]>>2,h=this.Ob[i],o=this.Lb[i],a=this.Sb[i];r.A.cI(f.Qv[e],f.Qv[s],f.Qv[n],f.tb[e],f.tb[s],f.tb[n],this.Eb[t],this.Eb[t],this.Eb[t],f.eb[h],f.sb[h],f.nb[h],f.eb[o],f.eb[a],f.sb[o],f.sb[a],f.nb[o],f.nb[a],this.Eu[t])}}Vb(t,i=!1){let e=0;if(f.nb){const i=r.A.rl,s=r.A.hl,n=this.mg[t],h=this.pg[t],o=this.gg[t],a=f.nb[n],l=f.nb[h],c=f.nb[o];if(a>=50&&f.Qv&&f.tb&&this.Eb)f.ub[e]=f.Qv[n],f.wb[e]=f.tb[n],f.yb[e++]=this.Eb[t];else if(f.eb&&f.sb&&this.Eb){const u=f.eb[n],d=f.sb[n],w=this.Eb[t];if(c>=50&&this.bb){const n=(50-a)*r.A.iv[c-a];f.ub[e]=i+((u+((f.eb[o]-u)*n>>16)<<9)/50|0),f.wb[e]=s+((d+((f.sb[o]-d)*n>>16)<<9)/50|0),f.yb[e++]=w+((this.bb[t]-w)*n>>16)}if(l>=50&&this.vb){const n=(50-a)*r.A.iv[l-a];f.ub[e]=i+((u+((f.eb[h]-u)*n>>16)<<9)/50|0),f.wb[e]=s+((d+((f.sb[h]-d)*n>>16)<<9)/50|0),f.yb[e++]=w+((this.vb[t]-w)*n>>16)}}if(l>=50&&f.Qv&&f.tb&&this.vb)f.ub[e]=f.Qv[h],f.wb[e]=f.tb[h],f.yb[e++]=this.vb[t];else if(f.eb&&f.sb&&this.vb){const u=f.eb[h],d=f.sb[h],w=this.vb[t];if(a>=50&&this.Eb){const h=(50-l)*r.A.iv[a-l];f.ub[e]=i+((u+((f.eb[n]-u)*h>>16)<<9)/50|0),f.wb[e]=s+((d+((f.sb[n]-d)*h>>16)<<9)/50|0),f.yb[e++]=w+((this.Eb[t]-w)*h>>16)}if(c>=50&&this.bb){const n=(50-l)*r.A.iv[c-l];f.ub[e]=i+((u+((f.eb[o]-u)*n>>16)<<9)/50|0),f.wb[e]=s+((d+((f.sb[o]-d)*n>>16)<<9)/50|0),f.yb[e++]=w+((this.bb[t]-w)*n>>16)}}if(c>=50&&f.Qv&&f.tb&&this.bb)f.ub[e]=f.Qv[o],f.wb[e]=f.tb[o],f.yb[e++]=this.bb[t];else if(f.eb&&f.sb&&this.bb){const u=f.eb[o],d=f.sb[o],w=this.bb[t];if(l>=50&&this.vb){const n=(50-c)*r.A.iv[l-c];f.ub[e]=i+((u+((f.eb[h]-u)*n>>16)<<9)/50|0),f.wb[e]=s+((d+((f.sb[h]-d)*n>>16)<<9)/50|0),f.yb[e++]=w+((this.vb[t]-w)*n>>16)}if(a>=50&&this.Eb){const h=(50-c)*r.A.iv[a-c];f.ub[e]=i+((u+((f.eb[n]-u)*h>>16)<<9)/50|0),f.wb[e]=s+((d+((f.sb[n]-d)*h>>16)<<9)/50|0),f.yb[e++]=w+((this.Eb[t]-w)*h>>16)}}}const s=f.ub[0],h=f.ub[1],o=f.ub[2],a=f.wb[0],l=f.wb[1],c=f.wb[2];if(!((s-h)*(c-l)-(a-l)*(o-h)<=0))if(r.A.iI=!1,3===e){let e;if((s<0||h<0||o<0||s>n.A.eI||h>n.A.eI||o>n.A.eI)&&(r.A.iI=!0),e=this.yg?3&this.yg[t]:0,i)r.A.qE(s,h,a,l,f.yb[0]),r.A.qE(h,o,l,c,f.yb[1]),r.A.qE(o,s,c,a,f.yb[2]);else if(0===e)r.A.hI(s,h,o,a,l,c,f.yb[0],f.yb[1],f.yb[2]);else if(1===e&&this.Eb)r.A._v(s,h,o,a,l,c,r.A.palette[this.Eb[t]]);else if(2===e&&this.yg&&this.Eu&&f.eb&&f.sb&&f.nb){const i=this.yg[t]>>2,e=this.Ob[i],n=this.Lb[i],u=this.Sb[i];r.A.cI(s,h,o,a,l,c,f.yb[0],f.yb[1],f.yb[2],f.eb[e],f.sb[e],f.nb[e],f.eb[n],f.eb[u],f.sb[n],f.sb[u],f.nb[n],f.nb[u],this.Eu[t])}else if(3===e&&this.yg&&this.Eu&&this.Eb&&f.eb&&f.sb&&f.nb){const i=this.yg[t]>>2,e=this.Ob[i],n=this.Lb[i],u=this.Sb[i];r.A.cI(s,h,o,a,l,c,this.Eb[t],this.Eb[t],this.Eb[t],f.eb[e],f.sb[e],f.nb[e],f.eb[n],f.eb[u],f.sb[n],f.sb[u],f.nb[n],f.nb[u],this.Eu[t])}}else if(4===e){let e;if((s<0||h<0||o<0||s>n.A.eI||h>n.A.eI||o>n.A.eI||f.ub[3]<0||f.ub[3]>n.A.eI)&&(r.A.iI=!0),e=this.yg?3&this.yg[t]:0,i)r.A.qE(s,h,a,l,f.yb[0]),r.A.qE(h,o,l,c,f.yb[1]),r.A.qE(o,f.ub[3],c,f.wb[3],f.yb[2]),r.A.qE(f.ub[3],s,f.wb[3],a,f.yb[3]);else if(0===e)r.A.hI(s,h,o,a,l,c,f.yb[0],f.yb[1],f.yb[2]),r.A.hI(s,o,f.ub[3],a,c,f.wb[3],f.yb[0],f.yb[2],f.yb[3]);else if(1===e){if(this.Eb){const i=r.A.palette[this.Eb[t]];r.A._v(s,h,o,a,l,c,i),r.A._v(s,o,f.ub[3],a,c,f.wb[3],i)}}else if(2===e&&this.yg&&this.Eu&&f.eb&&f.sb&&f.nb){const i=this.yg[t]>>2,e=this.Ob[i],n=this.Lb[i],u=this.Sb[i];r.A.cI(s,h,o,a,l,c,f.yb[0],f.yb[1],f.yb[2],f.eb[e],f.sb[e],f.nb[e],f.eb[n],f.eb[u],f.sb[n],f.sb[u],f.nb[n],f.nb[u],this.Eu[t]),r.A.cI(s,o,f.ub[3],a,c,f.wb[3],f.yb[0],f.yb[2],f.yb[3],f.eb[e],f.sb[e],f.nb[e],f.eb[n],f.eb[u],f.sb[n],f.sb[u],f.nb[n],f.nb[u],this.Eu[t])}else if(3===e&&this.yg&&this.Eu&&this.Eb&&f.eb&&f.sb&&f.nb){const i=this.yg[t]>>2,e=this.Ob[i],n=this.Lb[i],u=this.Sb[i];r.A.cI(s,h,o,a,l,c,this.Eb[t],this.Eb[t],this.Eb[t],f.eb[e],f.sb[e],f.nb[e],f.eb[n],f.eb[u],f.sb[n],f.sb[u],f.nb[n],f.nb[u],this.Eu[t]),r.A.cI(s,o,f.ub[3],a,c,f.wb[3],this.Eb[t],this.Eb[t],this.Eb[t],f.eb[e],f.sb[e],f.nb[e],f.eb[n],f.eb[u],f.sb[n],f.sb[u],f.nb[n],f.nb[u],this.Eu[t])}}}Ub(t,i,e,s,n){if(!s)return;const h=s.length;if(0===n){let n=0;f.Ir=0,f.Ab=0,f._r=0;for(let t=0;t0?(f.Ir=(f.Ir/n|0)+t,f.Ab=(f.Ab/n|0)+i,f._r=(f._r/n|0)+e):(f.Ir=t,f.Ab=i,f._r=e)}else if(1===n)for(let n=0;n=this.Nd.length)continue;const h=this.Nd[r];if(h)for(let s=0;s=this.Nd.length)continue;const o=this.Nd[h];if(o)for(let s=0;s>16;this.Sd[n]=this.Sd[n]*u-this.Od[n]*c>>16,this.Od[n]=t}if(0!==h){c=r.A.sin[h],u=r.A.cos[h];const t=this.Sd[n]*u-this.Ld[n]*c>>16;this.Ld[n]=this.Sd[n]*c+this.Ld[n]*u>>16,this.Sd[n]=t}if(0!==a){c=r.A.sin[a],u=r.A.cos[a];const t=this.Ld[n]*c+this.Od[n]*u>>16;this.Ld[n]=this.Ld[n]*u-this.Od[n]*c>>16,this.Od[n]=t}this.Od[n]+=f.Ir,this.Sd[n]+=f.Ab,this.Ld[n]+=f._r}}else if(3===n)for(let n=0;n=this.Nd.length)continue;const h=this.Nd[r];if(h)for(let s=0;s=this.Dd.length)continue;const n=this.Dd[e];if(n)for(let i=0;i255&&(this.Rb[e]=255)}}}Gb(){this.Ud=0,this.dm=0,this.cg=0,this.fg=999999,this.ug=-999999,this.wg=-99999,this.dg=99999;for(let t=0;tthis.ug&&(this.ug=i),sthis.wg&&(this.wg=s),-e>this.Ud&&(this.Ud=-e),e>this.cg&&(this.cg=e);const n=i*i+s*s;n>this.dm&&(this.dm=n)}this.dm=0|Math.sqrt(this.dm),this.kb=0|Math.sqrt(this.dm*this.dm+this.Ud*this.Ud),this.xb=this.kb+(0|Math.sqrt(this.dm*this.dm+this.cg*this.cg))}Yb(t,i,e,s,n,r,h,o){return!(ie&&i>s&&i>n)&&(!(t{e.d(i,{A:()=>o});var s=e(8950),n=e(1069),r=e(4474),h=e(880);class o extends r.A{lw;width;height;Xb;jb;Fa;nw;constructor(t,i){super(),this.lw=new Int32Array(t*i),this.width=this.Fa=t,this.height=this.nw=i,this.Xb=this.jb=0}static zb=async(t,i)=>{const e=t.read(i+'.dat');if(!e)throw new Error(`${i} jpeg not found!`);const s=await(0,h.r)(e),n=new o(s.width,s.height),r=new Uint32Array(s.data.buffer),a=n.lw;for(let t=0;t>24&255)<<24|(255&i)<<16|(i>>8&255)<<8|i>>16&255}return n};static Cu=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.lf=s.ou;const h=r.ou,a=r.ou,l=[],c=r.lu-1;for(let t=0;ts.length||r.lf>r.length)throw new Error;const f=r.lu,u=r.lu,d=r.ou,w=r.ou,y=new o(d,w);y.Xb=f,y.jb=u,y.Fa=h,y.nw=a;const A=r.lu;if(0===A){const t=y.width*y.height;for(let i=0;is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,a+=i,o+=i}h>0&&r>0&&this.Zb(h,r,this.lw,n,a,s.A.lw,e,o)}Na(t,i,e){i|=0,e|=0;let n=(i+=this.Xb)+(e+=this.jb)*s.A.cw,r=0,h=this.height,o=this.width,a=s.A.cw-o,l=0;if(es.A.bottom&&(h-=e+h-s.A.bottom),is.A.right){const t=i+o-s.A.right;o-=t,l+=t,a+=t}o>0&&h>0&&this.qb(o,h,this.lw,r,l,s.A.lw,n,a,t)}$b(t,i){t|=0,i|=0;let e=(t+=this.Xb)+(i+=this.jb)*s.A.cw,n=0,r=this.height,h=this.width,o=s.A.cw-h,a=0;if(is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,a+=i,o+=i}h>0&&r>0&&this.Jb(h,r,this.lw,n,a,s.A.lw,e,o)}Qb(){const t=this.lw,i=this.width,e=this.height;for(let s=0;s>16&255;r+=t,r<1?r=1:r>255&&(r=255);let h=n>>8&255;h+=i,h<1?h=1:h>255&&(h=255);let o=255&n;o+=e,o<1?o=1:o>255&&(o=255),this.lw[s]=(r<<16)+(h<<8)+o}}}_w(t,i,e,n){t|=0,i|=0,e|=0,n|=0;try{const r=this.width;let h=0,o=0;const a=this.Fa,l=this.nw,c=(a<<16)/e|0,f=(l<<16)/n|0;t+=(this.Xb*e+a-1)/a|0,i+=(this.jb*n+l-1)/l|0,this.Xb*e%a!=0&&(h=(a-this.Xb*e%a<<16)/e|0),this.jb*n%l!=0&&(o=(l-this.jb*n%l<<16)/n|0),e=e*(this.width-(h>>16))/a|0,n=n*(this.height-(o>>16))/l|0;let u=t+i*s.A.cw,d=s.A.cw-e;if(is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right){const i=t+e-s.A.right;e-=i,d+=i}this.scale(e,n,this.lw,h,o,s.A.lw,d,u,r,c,f)}catch(t){console.error('error in sprite clipping routine')}}iT(t,i,e,n,r,h,o,a,l,c){t|=0,i|=0,e|=0,n|=0;try{const f=-e/2|0,u=-n/2|0,d=65536*Math.sin(l/326.11)|0,w=65536*Math.cos(l/326.11)|0,y=d*c>>8,A=w*c>>8;let m=(o<<16)+u*y+f*A,p=u*A-f*y+(a<<16),g=t+i*s.A.cw;for(let t=0;t>16)+(o>>16)*this.width],n+=A,o-=y;m+=y,p+=A,g+=s.A.cw}}catch(t){}}eT(t,i,e){t|=0,i|=0;let n=(t+=this.Xb)+(i+=this.jb)*s.A.cw,r=0,h=this.height,o=this.width,a=s.A.cw-o,l=0;if(is.A.bottom&&(h-=i+h-s.A.bottom),ts.A.right){const i=t+o-s.A.right;o-=i,l+=i,a+=i}o>0&&h>0&&this.sT(o,h,this.lw,l,r,s.A.lw,n,a,e.lw)}scale(t,i,e,s,n,r,h,o,a,l,c){try{const f=s;for(let u=-i;u<0;u++){const i=(n>>16)*a;for(let n=-t;n<0;n++){const t=e[(s>>16)+i];0===t?o++:r[o++]=t,s+=l}n+=c,s=f,o+=h}}catch(t){console.error('error in plot_scale')}}Jb(t,i,e,s,n,r,h,o){const a=-(t>>2);t=-(3&t);for(let l=-i;l<0;l++){for(let t=a;t<0;t++)r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++];for(let i=t;i<0;i++)r[h++]=e[s++];h+=o,s+=n}}qb(t,i,e,s,n,r,h,o,a){const l=256-a;for(let c=-i;c<0;c++){for(let i=-t;i<0;i++){const t=e[s++];if(0===t)h++;else{const i=r[h];r[h++]=((16711935&t)*a+(16711935&i)*l&4278255360)+((65280&t)*a+(65280&i)*l&16711680)>>8}}h+=o,s+=n}}Zb(t,i,e,s,n,r,h,o){const a=-(t>>2);t=-(3&t);for(let l=-i;l<0;l++){for(let t=a;t<0;t++){let t=e[s++];0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=t}h+=o,s+=n}}sT(t,i,e,s,n,r,h,o,a){const l=-(t>>2);t=-(3&t);for(let c=-i;c<0;c++){for(let t=l;t<0;t++){let t=e[n++];0!==t&&0===a[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===a[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===a[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===a[h]?r[h++]=t:h++}for(let i=t;i<0;i++){const t=e[n++];0!==t&&0===a[h]?r[h++]=t:h++}h+=o,n+=s}}}},1673:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(8950),n=e(1069),r=e(4474);class h extends r.A{lw;width;height;Xb;jb;Fa;nw;palette;constructor(t,i,e){super(),this.lw=new Int8Array(t*i),this.width=this.Fa=t,this.height=this.nw=i,this.Xb=this.jb=0,this.palette=e}static Cu=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.lf=s.ou;const o=r.ou,a=r.ou,l=r.lu,c=new Int32Array(l);for(let t=1;ts.length||r.lf>r.length)throw new Error;const f=r.lu,u=r.lu,d=r.ou,w=r.ou,y=new h(d,w,c);y.Xb=f,y.jb=u,y.Fa=o,y.nw=a;const A=y.lw,m=r.lu;if(0===m){const t=y.width*y.height;for(let i=0;is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,a+=i,o+=i}h>0&&r>0&&this.nT(h,r,this.lw,n,a,s.A.lw,e,o)}Qb(){const t=this.lw,i=this.width,e=this.height;for(let s=0;s>16&255;n+=t,n<0?n=0:n>255&&(n=255);let r=this.palette[s]>>8&255;r+=i,r<0?r=0:r>255&&(r=255);let h=255&this.palette[s];h+=e,h<0?h=0:h>255&&(h=255),this.palette[s]=(n<<16)+(r<<8)+h}}yv(){this.Fa|=0,this.nw|=0,this.Fa/=2,this.nw/=2,this.Fa|=0,this.nw|=0;const t=new Int8Array(this.Fa*this.nw);let i=0;for(let e=0;e>1)+(e+this.jb>>1)*this.Fa]=this.lw[i++];this.lw=t,this.width=this.Fa,this.height=this.nw,this.Xb=0,this.jb=0}_w(){if(this.width===this.Fa&&this.height===this.nw)return;const t=new Int8Array(this.Fa*this.nw);let i=0;for(let e=0;e>2);t=-(3&t);for(let l=-i;l<0;l++){for(let t=a;t<0;t++){let t=e[s++];0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t]}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=this.palette[255&t]}h+=o,s+=n}}clip(t,i,e,n){try{const r=this.width;this.height;let h=0,o=0;const a=this.Fa,l=this.nw,c=(a<<16)/e|0,f=(l<<16)/n|0;t=t+(this.Xb*e+a-1)/a|0,i=i+(this.jb*n+l-1)/l|0,this.Xb*e%a!=0&&(h=(a-this.Xb*e%a<<16)/e|0),this.jb*n%l!=0&&(o=(l-this.jb*n%l<<16)/n|0),e=e*(this.width-(h>>16))/a|0,n=n*(this.height-(o>>16))/l|0;let u,d=t+i*s.A.cw,w=s.A.cw-e;is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right&&(u=t+e-s.A.right,e-=u,w+=u),this.rT(s.A.lw,this.lw,this.palette,h,o,d,w,e,n,c,f,r)}catch(t){console.log('error in sprite clipping routine')}}rT(t,i,e,s,n,r,h,o,a,l,c,f){try{const u=s;for(let d=-a;d<0;d++){const a=(n>>16)*f;for(let n=-o;n<0;n++){const n=i[(s>>16)+a];0==n?r++:t[r++]=e[255&n],s+=l}n+=c,s=u,r+=h}}catch(t){console.log('error in plot_scale')}}}},2682:(t,i,e)=>{e.d(i,{A:()=>a});var s=e(8950),n=e(1069),r=e(4474);class h{seed;constructor(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}hT(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}oT(){return this.next(32)}next(t){return this.seed=0x5deece66dn*this.seed+0xbn&(1n<<48n)-1n,Number(this.seed)>>>48-t}}var o=e(9298);class a extends r.A{static aT='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!"£$%^&*()-_=+[{]};:\'@#~,<.>/?\\| ';static lT=[];static{const t=navigator.userAgent.includes('Capacitor');for(let i=0;i<256;i++){let e=a.aT.indexOf(String.fromCharCode(i));t&&e>=63&&e--,-1===e&&(e=74),a.lT[i]=e}}cT=[];fT=new Int32Array(94);uT=new Int32Array(94);dT=new Int32Array(94);wT=new Int32Array(94);yT=new Int32Array(95);AT=new Int32Array(256);random=new h(BigInt(Date.now()));height=0;static Cu=(t,i)=>{const e=new n.A(t.read(i+'.dat')),s=new n.A(t.read('index.dat'));s.lf=e.ou+4;const r=s.lu;r>0&&(s.lf+=3*(r-1));const h=new a;for(let t=0;t<94;t++){h.dT[t]=s.lu,h.wT[t]=s.lu;const i=h.fT[t]=s.ou,n=h.uT[t]=s.ou,r=s.lu,o=i*n;if(h.cT[t]=new Int8Array(o),0===r)for(let s=0;sh.height&&(h.height=n),h.dT[t]=1,h.yT[t]=i+2;{let e=0;for(let s=n/7|0;s=s.A.bottom&&(r-=e+r+1-s.A.bottom),i=s.A.right){const t=i+n+1-s.A.right;n-=t,l+=t,a+=t}n>0&&r>0&&this.bT(n,r,t,c,l,s.A.lw,o,a,h)}CT(t,i,e,n,r,h,o){e|=0,n|=0;let a=(t|=0)+(i|=0)*s.A.cw,l=s.A.cw-e,c=0,f=0;if(i=s.A.bottom&&(n-=i+n+1-s.A.bottom),t=s.A.right){const i=t+e+1-s.A.right;e-=i,c+=i,l+=i}e>0&&n>0&&this.TT(e,n,s.A.lw,a,l,o,f,c,r,h)}bT(t,i,e,s,n,r,h,o,a){const l=-((t|=0)>>2);t=-(3&t);for(let c=-(i|=0);c<0;c++){for(let t=l;t<0;t++)0===e[s++]?h++:r[h++]=a,0===e[s++]?h++:r[h++]=a,0===e[s++]?h++:r[h++]=a,0===e[s++]?h++:r[h++]=a;for(let i=t;i<0;i++)0===e[s++]?h++:r[h++]=a;h+=o,s+=n}}TT(t,i,e,s,n,r,h,o,a,l){t|=0;const c=((16711935&a)*l&4278255360)+((65280&a)*l&16711680)>>8,f=256-l;for(let a=-(i|=0);a<0;a++){for(let i=-t;i<0;i++)if(0===r[h++])s++;else{const t=e[s];e[s++]=(((16711935&t)*f&4278255360)+((65280&t)*f&16711680)>>8)+c}s+=n,h+=o}}pT(t){return'red'===t?o.A.RED:'gre'===t?o.A.GREEN:'blu'===t?o.A.BLUE:'yel'===t?o.A.Ga:'cya'===t?o.A.kE:'mag'===t?o.A.sm:'whi'===t?o.A.Ia:'bla'===t?o.A.Pa:'lre'===t?o.A.ME:'dre'===t?o.A.DE:'dbl'===t?o.A.NE:'or1'===t?o.A.FE:'or2'===t?o.A.BE:'or3'===t?o.A.UE:'gr1'===t?o.A.PE:'gr2'===t?o.A.GE:'gr3'===t?o.A.WE:o.A.Pa}split(t,i){if(0===t.length)return[t];const e=[];for(;t.length>0;){if(this.gT(t)<=i&&-1===t.indexOf('|')){e.push(t);break}let s=t.length;for(let e=0;ei)break;s=e}else if('|'===t[e]){s=e;break}e.push(t.substring(0,s)),t=t.substring(s+1)}return e}}},1183:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(8950),n=e(7854);class r{RT;width;height;OT;LT;lw;constructor(t,i,e=n.zo){this.OT=e,this.RT=this.OT.getImageData(0,0,t,i),this.LT=new Uint32Array(this.RT.data.buffer),this.lw=new Int32Array(t*i),this.width=t,this.height=i,this.bind()}clear(){this.lw.fill(0)}bind(){s.A.bind(this.lw,this.width,this.height)}draw(t,i){this.#t(),this.OT.putImageData(this.RT,t,i)}#t(){const t=this.lw.length,i=this.lw,e=this.LT;for(let s=0;s>16&255|(t>>8&255)<<8|(255&t)<<16|4278190080}}}},4544:(t,i,e)=>{e.d(i,{A:()=>s});class s{db;constructor(t){t.onerror=this.onerror,t.onclose=this.onclose,this.db=t}static openDatabase=async()=>await new Promise(((t,i)=>{const e=indexedDB.open('lostcity',1);e.onsuccess=i=>{const e=i.target;console.log('database success!'),t(e.result)},e.onupgradeneeded=t=>{t.target.result.createObjectStore('cache')},e.onerror=t=>{const e=t.target;console.error('database error!: ',e.error),i(e.result)}}));Uo=async t=>await new Promise((i=>{const e=this.db.transaction('cache','readonly').objectStore('cache').get(t);e.onsuccess=()=>{i(e.result)},e.onerror=t=>{i(void 0)}}));Ho=async(t,i)=>await new Promise(((e,s)=>{const n=this.db.transaction('cache','readwrite').objectStore('cache').put(i,t);n.onsuccess=()=>{e()},n.onerror=t=>{s()}}));onclose=t=>{console.log('database close!')};onerror=t=>{console.log('database error!')};ST=t=>{const i=t.trim();let e=0;for(let t=0;t='A'&&s<='Z'?e+=s.charCodeAt(0)+1-65:s>='a'&&s<='z'?e+=s.charCodeAt(0)+1-97:s>='0'&&s<='9'&&(e+=s.charCodeAt(0)+27-48)}return e}}},2901:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(1908);class r{static ST=t=>{let i=0;t=t.toUpperCase();for(let e=0;e=this.kT)return null;if(this.BT[t])return this.BT[t];const i=this.FT[t],e=i+this.NT[t];if(this.xT){const s=Uint8Array.from(this.buffer.subarray(i,i+e));return this.BT[t]=s,s}{const i=Uint8Array.from(n.A.read(this.DT[t],this.buffer,this.NT[t],this.FT[t]));return this.BT[t]=i,i}}}},1069:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(9234),n=e(6666),r=e(4474);class h extends r.A{static PT=3988292384;static GT=new Int32Array(256);static WT=new Uint32Array(33);static YT=new n.A;static HT=new n.A;static VT=new n.A;static KT=0;static XT=0;static jT=0;static{for(let t=0;t<32;t++)h.WT[t]=(1<>>=1:i=i>>>1^h.PT;h.GT[t]=i}}static Po=t=>{let i=4294967295;for(let e=0;e>>8^h.GT[255&(i^t[e])];return~i};view;data;lf=0;zT=0;random=null;constructor(t){if(!t)throw new Error('Input src packet array was null!');super(),t instanceof Int8Array?this.data=new Uint8Array(t):this.data=t,this.view=new DataView(this.data.buffer,this.data.byteOffset,this.data.byteLength)}get length(){return this.view.byteLength}get available(){return this.length-this.lf}static Ut=t=>{let i=null;return 0===t&&h.KT>0?(h.KT--,i=h.YT.Bg()):1===t&&h.XT>0?(h.XT--,i=h.HT.Bg()):2===t&&h.jT>0&&(h.jT--,i=h.VT.Bg()),i?(i.lf=0,i):new h(0===t?new Uint8Array(100):1===t?new Uint8Array(5e3):new Uint8Array(3e4))};release(){this.lf=0,100===this.view.byteLength&&h.KT<1e3?(h.YT.kA(this),h.KT++):5e3===this.view.byteLength&&h.XT<250?(h.HT.kA(this),h.XT++):3e4===this.view.byteLength&&h.jT<50&&(h.VT.kA(this),h.jT++)}get lu(){return this.view.getUint8(this.lf++)}get bd(){return this.view.getInt8(this.lf++)}get ou(){const t=this.view.getUint16(this.lf);return this.lf+=2,t}get fu(){const t=this.view.getInt16(this.lf);return this.lf+=2,t}get Wu(){const t=this.view.getUint8(this.lf++)<<16|this.view.getUint16(this.lf);return this.lf+=2,t}get Ko(){const t=this.view.getInt32(this.lf);return this.lf+=4,t}get $C(){const t=this.view.getBigInt64(this.lf);return this.lf+=8,t}get RE(){return this.view.getUint8(this.lf)<128?this.lu-64:this.ou-49152}get um(){return this.view.getUint8(this.lf)<128?this.lu:this.ou-32768}get wu(){const t=this.view,i=t.byteLength;let e,s='';for(;10!==(e=t.getUint8(this.lf++))&&this.lf>16),this.view.setUint16(this.lf,t),this.lf+=2}p4(t){this.view.setInt32(this.lf,t),this.lf+=4}JT(t){this.view.setInt32(this.lf,t,!0),this.lf+=4}QT(t){this.view.setBigInt64(this.lf,t),this.lf+=8}tR(t){const i=this.view,e=t.length;for(let s=0;s>>3,e=8-(7&this.zT),s=0;for(this.zT+=t;t>e;e=8)s+=(this.view.getUint8(i++)&h.WT[e])<>>e-t&h.WT[t],s}hR(t,i){const e=this.lf;this.lf=0;const n=new Uint8Array(e);this.ZT(e,0,n);const r=(0,s.oR)(n),h=(0,s.aR)(r,i,t),o=(0,s.lR)(h);this.lf=0,this.p1(o.length),this.iR(o,o.length,0)}}},3937:(t,i,e)=>{e.d(i,{A:()=>o});class s{start=0;end=0;form=0;length=0;cR=null;fR=null;threshold=0;position=0;delta=0;amplitude=0;uR=0;read(t){this.form=t.lu,this.start=t.Ko,this.end=t.Ko,this.length=t.lu,this.cR=new Int32Array(this.length),this.fR=new Int32Array(this.length);for(let i=0;i=this.threshold&&this.fR&&this.cR&&(this.amplitude=this.fR[this.position++]<<15,this.position>=this.length&&(this.position=this.length-1),this.threshold=this.cR[this.position]/65536*t|0,this.threshold>this.uR&&(this.delta=((this.fR[this.position]<<15)-this.amplitude)/(this.threshold-this.uR)|0)),this.amplitude+=this.delta,this.uR++,this.amplitude-this.delta>>15}}class n{static buffer=null;static SA=null;static sin=null;static dR=new Int32Array(5);static wR=new Int32Array(5);static yR=new Int32Array(5);static AR=new Int32Array(5);static mR=new Int32Array(5);pR=null;gR=null;IR=null;_R=null;CR=null;ER=null;release=null;attack=null;vR=new Int32Array(5);bR=new Int32Array(5);TR=new Int32Array(5);start=0;length=500;RR=100;OR=0;static init=()=>{this.SA=new Int32Array(32768);for(let t=0;t<32768;t++)Math.random()>.5?this.SA[t]=1:this.SA[t]=-1;this.sin=new Int32Array(32768);for(let t=0;t<32768;t++)this.sin[t]=16384*Math.sin(t/5215.1903)|0;this.buffer=new Int32Array(220500)};LR(t,i){for(let i=0;i>1,h+=(i*s>>16)+r}if(this.CR&&this.ER){const i=this.CR.evaluate(t),e=this.ER.evaluate(t);c=c*(32768+(this.SR(e,l,this.CR.form)>>1))>>15,l+=(i*o>>16)+a}for(let s=0;s<5;s++)if(0!==this.vR[s]){const r=i+n.wR[s];r>15,n.dR[s],this.pR.form),n.dR[s]+=(e*n.AR[s]>>16)+n.mR[s])}}if(this.release&&this.attack){this.release.reset(),this.attack.reset();let i=0,e=!0;for(let s=0;s>8):this.release.start+((this.release.end-this.release.start)*h>>8),i+=256,i>=o&&(i=0,e=!e),e&&(n.buffer[s]=0)}}if(this.OR>0&&this.RR>0){const i=this.OR*e;for(let e=i;e32767&&(n.buffer[i]=32767);return n.buffer}SR(t,i,e){return 1===e?(32767&i)<16384?t:-t:2===e?n.sin[32767&i]*t>>14:3===e?((32767&i)*t>>14)-t:4===e?n.SA[i/2607&32767]*t:0}read(t){this.pR=new s,this.pR.read(t),this.gR=new s,this.gR.read(t),0!==t.lu&&(t.lf--,this.IR=new s,this.IR.read(t),this._R=new s,this._R.read(t)),0!==t.lu&&(t.lf--,this.CR=new s,this.CR.read(t),this.ER=new s,this.ER.read(t)),0!==t.lu&&(t.lf--,this.release=new s,this.release.read(t),this.attack=new s,this.attack.read(t));for(let i=0;i<10;i++){const e=t.um;if(0===e)break;this.vR[i]=e,this.bR[i]=t.RE,this.TR[i]=t.um}this.OR=t.um,this.RR=t.um,this.length=t.ou,this.start=t.ou}}var r=e(1069),h=e(3867);class o{static xR=new Int32Array(1e3);static kR=null;static MR=null;static DR=new h.fe(1e3,null);NR=new h.fe(10,null);FR=0;loopEnd=0;static hu=t=>{const i=new r.A(t.read('sounds.dat'));for(this.kR=new Uint8Array(441e3),this.MR=new r.A(this.kR),n.init();;){const t=i.ou;if(65535===t)break;const e=new o;e.read(i),this.DR[t]=e,this.xR[t]=e.trim()}};static LR=(t,i)=>{if(!this.DR[t])return null;const e=this.DR[t];return e?.BR(i)??null};read(t){for(let i=0;i<10;i++)0!==t.lu&&(t.lf--,this.NR[i]=new n,this.NR[i]?.read(t));this.FR=t.ou,this.loopEnd=t.ou}trim(){let t=9999999;for(let i=0;i<10;i++)this.NR[i]&&(this.NR[i].start/20|0)i&&(i=this.NR[t].length+this.NR[t].start);if(0===i)return 0;let e=22050*i/1e3|0,s=22050*this.FR/1e3|0,n=22050*this.loopEnd/1e3|0;(s<0||n<0||n>e||s>=n)&&(t=0);let r=e+(n-s)*(t-1);for(let t=44;t>8<<24>>24)}if(t>1){s+=44,n+=44,e+=44,r+=44;const i=r-e;for(let t=e-1;t>=n;t--)o.kR&&(o.kR[t+i]=o.kR[t]);for(let i=1;i{e.d(i,{qA:()=>l,ZA:()=>o,fe:()=>s,_m:()=>n,Eh:()=>r,Am:()=>h,Xr:()=>a});class s extends Array{constructor(t,i){super(t);for(let e=0;e{e.d(i,{lR:()=>o,Wo:()=>n,oR:()=>h,Yo:()=>s,Xl:()=>r,aR:()=>a});const s=async t=>new Promise((i=>setTimeout(i,t))),n=async t=>new Int8Array(await(await fetch(t)).arrayBuffer()),r=async t=>(await fetch(t)).text();function h(t){let i=0n;for(let e=0;e0n;)i.unshift(Number(0xffn&t)),t>>=8n;return 128&i[0]&&i.unshift(0),new Uint8Array(i)}function a(t,i,e){let s=1n;for(;i>0n;)i%2n===1n&&(s=s*t%e),t=t*t%e,i>>=1n;return s}},7953:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1069);class n{static UR=new Uint16Array(['d','o','t'].join('').split('').map((t=>t.charCodeAt(0))));static PR=new Uint16Array(['(','a',')'].join('').split('').map((t=>t.charCodeAt(0))));static GR=new Uint16Array(['s','l','a','s','h'].join('').split('').map((t=>t.charCodeAt(0))));static WR=['cook',"cook's",'cooks','seeks','sheet'];static YR=[];static HR=[];static VR=[];static KR=[];static XR=[];static jR=[];static hu=t=>{const i=new s.A(t.read('fragmentsenc.txt')),e=new s.A(t.read('badenc.txt')),n=new s.A(t.read('domainenc.txt')),r=new s.A(t.read('tldlist.txt'));this.read(e,n,i,r)};static filter=t=>{const i=[...t];this.format(i);const e=i.join('').trim(),s=e.toLowerCase(),n=[...s];this.zR(n),this.ZR(n),this.qR(n),this.$R(n);for(let t=0;t{this.tO(t),this.iO(i),this.eO(e),this.sO(s)};static sO=t=>{const i=t.Ko;for(let e=0;et.lu))};static tO=t=>{const i=t.Ko;for(let e=0;et.lu));const i=new Array(t.lu).fill([]).map((()=>[t.bd,t.bd]));i.length>0&&(this.KR[e]=i)}};static iO=t=>{const i=t.Ko;for(let e=0;et.lu))};static eO=t=>{const i=t.Ko;for(let e=0;e{const i=[...t],e=[...t];this.nO(null,i,this.UR),this.nO(null,e,this.GR);for(let s=0;s{for(let i=0;i<2;i++)for(let i=this.VR.length-1;i>=0;i--)this.nO(this.KR[i],t,this.VR[i])};static qR=t=>{const i=[...t],e=[...t];this.nO(null,i,this.PR),this.nO(null,e,this.UR);for(let s=this.XR.length-1;s>=0;s--)this.hO(e,i,this.XR[s],t)};static $R=t=>{for(let i=0;i=0&&n{if(this.dO(t))return!0;const i=this.wO(t),e=this.jR,s=e.length;if(i===e[0]||i===e[s-1])return!0;let n=0,r=s-1;for(;n<=r;){const t=(n+r)/2|0;if(i===e[t])return!0;i{if(t.length>6)return 0;let i=0;for(let e=0;e{for(let e=i;e=0;e++)if(this.AO(t[e]))return e;return-1};static fO=(t,i)=>{for(let e=t;e=0;e++)if(!this.AO(i[e]))return e;return i.length};static mO=(t,i,e)=>i===e||'o'===i&&'0'===e?1:'o'===i&&'('===e&&')'===t?2:'c'!==i||'('!==e&&'<'!==e&&'['!==e?'e'===i&&'€'===e||'s'===i&&'$'===e||'l'===i&&'i'===e?1:0:1;static hO=(t,i,e,s)=>{const n=e.length,r=s.length;for(let h=0;h<=r-n;h++){const{pO:n,gO:r}=this.IO(h,e,s);if(!n)continue;const o=this._O(h,s,3,i,['@']),a=this.CO(r-1,s,3,t,['.',',']);(o>2||a>2)&&this.cO(h,r,s)}};static IO=(t,i,e)=>{const s=i.length;let n=t,r=0;for(;n0)n+=a,r++;else{if(0===r)break;const e=this.mO(o,String.fromCharCode(i[r-1]),h);if(e>0)n+=e,1===r&&t++;else{if(r>=s||!this.aO(h))break;n++}}}return{pO:r>=s,gO:n}};static nO=(t,i,e)=>{if(!(e.length>i.length))for(let s=0;s<=i.length-e.length;s++){let n=s;const{gO:r,EO:h,vO:o,bO:a,TO:l}=this.RO(i,e,n);n=r;let c=i[n],f=n+1=e.length)||a&&l)continue;let u,d=!0;if(o){let t=!1,e=!1;if((s-1<0||this.aO(i[s-1])&&"'"!==i[s-1])&&(t=!0),(n>=i.length||this.aO(i[n])&&"'"!==i[n])&&(e=!0),!t||!e){let e=!1;for(u=s-2,t&&(u=s);!e&&u=0&&(!this.aO(i[u])||"'"===i[u])){const t=[];let s;for(s=0;s<3&&u+s=0&&(!this.aO(i[u-1])||"'"===i[u-1])&&(n=!1),n&&!this.uO(t)&&(e=!0)}u++}e||(d=!1)}}else{c=' ',s-1>=0&&(c=i[s-1]),f=' ',n{let s=e,n=0,r=0,h=!1,o=!1,a=!1;for(;s=t.length||o&&a);){const l=t[s],c=s+10)1===f&&this.AO(l)&&(o=!0),2===f&&(this.AO(l)||this.AO(c))&&(o=!0),s+=f,n++;else{if(0===n)break;let t;if((t=this.xO(c,String.fromCharCode(i[n-1]),l))>0)s+=t;else{if(n>=i.length||!this.lO(l))break;if(this.aO(l)&&"'"!==l&&(h=!0),this.AO(l)&&(a=!0),s++,r++,(100*r/(s-e)|0)>90)break}}}return{gO:s,EO:n,vO:h,bO:o,TO:a}};static xO=(t,i,e)=>{if(i===e)return 1;if(i>='a'&&i<='m'){if('a'===i)return'4'!==e&&'@'!==e&&'^'!==e?'/'===e&&'\\'===t?2:0:1;if('b'===i)return'6'!==e&&'8'!==e?'1'===e&&'3'===t?2:0:1;if('c'===i)return'('!==e&&'<'!==e&&'{'!==e&&'['!==e?0:1;if('d'===i)return'['===e&&')'===t?2:0;if('e'===i)return'3'!==e&&'€'!==e?0:1;if('f'===i)return'p'===e&&'h'===t?2:'£'===e?1:0;if('g'===i)return'9'!==e&&'6'!==e?0:1;if('h'===i)return'#'===e?1:0;if('i'===i)return'y'!==e&&'l'!==e&&'j'!==e&&'1'!==e&&'!'!==e&&':'!==e&&';'!==e&&'|'!==e?0:1;if('j'===i)return 0;if('k'===i)return 0;if('l'===i)return'1'!==e&&'|'!==e&&'i'!==e?0:1;if('m'===i)return 0}if(i>='n'&&i<='z'){if('n'===i)return 0;if('o'===i)return'0'!==e&&'*'!==e?'('===e&&')'===t||'['===e&&']'===t||'{'===e&&'}'===t||'<'===e&&'>'===t?2:0:1;if('p'===i)return 0;if('q'===i)return 0;if('r'===i)return 0;if('s'===i)return'5'!==e&&'z'!==e&&'$'!==e&&'2'!==e?0:1;if('t'===i)return'7'!==e&&'+'!==e?0:1;if('u'===i)return'v'===e?1:'\\'===e&&'/'===t||'\\'===e&&'|'===t||'|'===e&&'/'===t?2:0;if('v'===i)return'\\'===e&&'/'===t||'\\'===e&&'|'===t||'|'===e&&'/'===t?2:0;if('w'===i)return'v'===e&&'v'===t?2:0;if('x'===i)return')'===e&&'('===t||'}'===e&&'{'===t||']'===e&&'['===t||'>'===e&&'<'===t?2:0;if('y'===i)return 0;if('z'===i)return 0}return i>='0'&&i<='9'?'0'===i?'o'===e||'O'===e?1:'('===e&&')'===t||'{'===e&&'}'===t||'['===e&&']'===t?2:0:'1'===i&&'l'===e?1:0:','===i?'.'===e?1:0:'.'===i?','===e?1:0:'!'===i&&'i'===e?1:0};static LO=(t,i,e)=>{let s=0,n=i.length-1;for(;s<=n;){const r=(s+n)/2|0;if(i[r][0]===t&&i[r][1]===e)return!0;tthis.yO(t)?t.charCodeAt(0)+1-'a'.charCodeAt(0):"'"===t?28:this.AO(t)?t.charCodeAt(0)+29-'0'.charCodeAt(0):27;static rO=(t,i,e,s,n)=>{if(!(s.length>e.length))for(let r=0;r<=e.length-s.length;r++){const{gO:h,kO:o}=this.MO(e,s,r);if(o0&&c>0&&(a=!0),2===i&&(l>2&&c>0||l>0&&c>2)&&(a=!0),3===i&&l>0&&c>2&&(a=!0),!a)continue;let f,u=r,d=h-1,w=!1;if(l>2){if(4===l)for(w=!1,f=r-1;f>=0;f--)if(w){if('*'!==n[f])break;u=f}else'*'===n[f]&&(u=f,w=!0);for(w=!1,f=u-1;f>=0;f--)if(w){if(this.aO(e[f]))break;u=f}else this.aO(e[f])||(w=!0,u=f)}if(c>2){if(4===c)for(w=!1,f=d+1;f{let s=0;for(;e0)e+=h,s++;else{if(0===s)break;let t;if((t=this.mO(r,String.fromCharCode(i[s-1]),n))>0)e+=t;else{if(!this.aO(n))break;e++}}}return{gO:e,kO:s}};static aO=t=>!this.SO(t)&&!this.AO(t);static lO=t=>!this.yO(t)||('v'===t||'x'===t||'j'===t||'q'===t||'z'===t);static SO=t=>this.yO(t)||this.DO(t);static AO=t=>t>='0'&&t<='9';static yO=t=>t>='a'&&t<='z';static DO=t=>t>='A'&&t<='Z';static dO=t=>{for(let i=0;i{for(let s=t;s{let e=0;for(let s=i-1;s>=0&&this.aO(t[s]);s--)'*'===t[s]&&e++;return e};static FO=(t,i)=>{let e=0;for(let s=i+1;s(n?this.NO(i,e):this.FO(i,e))>=s?4:this.aO(n?t[e-1]:t[e+1])?1:0;static _O=(t,i,e,s,n)=>{if(0===t)return 2;for(let e=t-1;e>=0&&this.aO(i[e]);e--)if(n.includes(i[e]))return 3;return this.BO(i,s,t,e,!0)};static CO=(t,i,e,s,n)=>{if(t+1===i.length)return 2;for(let e=t+1;e{let i=0;for(let e=0;et>=' '&&t<=''||' '===t||'\n'===t||'\t'===t||'£'===t||'€'===t;static JR=(t,i)=>{for(let e=0;e{let i=!0;for(let e=0;e{e.a(t,(async(t,i)=>{try{var s=e(7046),n=e(1312),r=e(5637),h=e(2164),o=e(1302),a=e(6948),l=e(8317),c=e(8738),f=e(3764),u=e(1120),d=e(4583),w=e(2682),y=e(8665),A=e(8534),m=e(6730),p=e(7953),g=e(9234),I=e(8950),_=e(1069),C=e(3937),E=e(4544),v=e(1908),b=e(9298),T=e(1651),R=e(7604);class t extends T.K{PO=0;GO=!0;Nm=0;Fm=0;Bm=0;WO=0;YO=0;HO=2;model={id:parseInt(s.A.getParameter('model'))||0,x:0,y:0,z:420,Hg:0};constructor(){super(!0)}load=async()=>{await this.Go(10,'Connecting to fileserver'),await v.A.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new E.A(await E.A.openDatabase());const t=new _.A(new Uint8Array(await(0,g.Wo)(`${T.K.nt}/crc`))),i=[];for(let e=0;e<9;e++)i[e]=t.Ko;const e=await this.Bo('title','title screen',i[1],10);this.di=w.A.Cu(e,'p11'),this.wi=w.A.Cu(e,'p12'),this.yi=w.A.Cu(e,'b12'),this.Ai=w.A.Cu(e,'q8');const s=await this.Bo('config','config',i[2],15),I=await this.Bo('interface','interface',i[3],20),b=await this.Bo('media','2d graphics',i[4],30),R=await this.Bo('models','3d graphics',i[5],40),O=await this.Bo('textures','textures',i[6],60),L=await this.Bo('wordenc','chat system',i[7],65),S=await this.Bo('sounds','sound effects',i[8],70);await this.Go(75,'Unpacking media'),await this.Go(80,'Unpacking textures'),d.A.wv(O),d.A.mv(.8),d.A.gv(20),await this.Go(83,'Unpacking models'),y.A.hu(R),A.A.hu(R),m.A.hu(R),await this.Go(86,'Unpacking config'),n.A.hu(s),r.A.hu(s),h.A.hu(s),o.A.hu(s,!0),a.A.hu(s),l.A.hu(s),c.A.hu(s),f.A.hu(s),await this.Go(90,'Unpacking sounds'),C.A.hu(S),await this.Go(92,'Unpacking interfaces'),u.A.hu(I,b,[this.di,this.wi,this.yi,this.Ai]),await this.Go(97,'Preparing game engine'),p.A.hu(L),this.xo?.bind(),d.A.Tc()};update=async()=>{this.VO(),this.KO(),this.PO++,this.PO>50&&(this.GO&&(s.A.setParameter('model',this.model.id.toString()),this.GO=!1),this.PO=0)};draw=async()=>{I.A.clear(),I.A.fillRect(0,0,this.width,this.height,5592405);const t=y.A.model(this.model.id);if(t.Ml(64,850,-30,-50,-30,!0),t.draw(this.model.Hg,d.A.sin[this.WO],d.A.cos[this.WO],d.A.sin[this.YO],d.A.cos[this.YO],this.model.x-this.Nm,this.model.y-this.Fm,this.model.z-this.Bm,0),this.yi){this.yi.ET(this.width,this.yi.height,`FPS: ${this.Ql}`,b.A.Ga);let t=this.yi.height;this.yi.Ba(0,t,`Model: ${this.model.id}`,b.A.Ga),t+=this.yi.height,this.yi.Ba(0,t,'Controls:',b.A.Ga),t+=this.yi.height,this.yi.Ba(0,t,'r - reset camera and model rotation + movement speed',b.A.Ga),t+=this.yi.height,this.yi.Ba(0,t,'1 and 2 - change model',b.A.Ga),t+=this.yi.height,this.yi.Ba(0,t,'[ and ] - adjust movement speed',b.A.Ga),t+=this.yi.height,this.yi.Ba(0,t,'left and right - adjust model yaw',b.A.Ga),t+=this.yi.height,this.yi.Ba(0,t,'up and down - adjust model pitch',b.A.Ga),t+=this.yi.height,this.yi.Ba(0,t,'. and / - adjust model roll',b.A.Ga),t+=this.yi.height,this.yi.Ba(0,t,'w and s - move camera along z axis',b.A.Ga),t+=this.yi.height,this.yi.Ba(0,t,'a and d - move camera along x axis',b.A.Ga),t+=this.yi.height,this.yi.Ba(0,t,'q and e - move camera along y axis',b.A.Ga)}this.xo?.draw(0,0)};VO(){for(;;){const t=this.xc();if(-1===t)break;t==='r'.charCodeAt(0)?(this.HO=2,this.GO=!0):t==='1'.charCodeAt(0)?(this.model.id--,this.model.id<0&&y.A.metadata&&(this.model.id=y.A.metadata.length-100-1),this.GO=!0):t==='2'.charCodeAt(0)&&(this.model.id++,y.A.metadata&&this.model.id>=y.A.metadata.length-100&&(this.model.id=0),this.GO=!0)}}KO(){this.fc['['.charCodeAt(0)]?this.HO--:this.fc[']'.charCodeAt(0)]&&this.HO++,this.fc[1]?(this.model.Hg+=this.HO,this.GO=!0):this.fc[2]&&(this.model.Hg-=this.HO,this.GO=!0),this.fc['w'.charCodeAt(0)]?(this.model.z-=this.HO,this.GO=!0):this.fc['s'.charCodeAt(0)]&&(this.model.z+=this.HO,this.GO=!0),this.fc['a'.charCodeAt(0)]?(this.model.x-=this.HO,this.GO=!0):this.fc['d'.charCodeAt(0)]&&(this.model.x+=this.HO,this.GO=!0),this.fc['q'.charCodeAt(0)]?(this.model.y+=this.HO,this.GO=!0):this.fc['e'.charCodeAt(0)]&&(this.model.y-=this.HO,this.GO=!0),this.WO=2047&this.WO,this.YO=2047&this.YO,this.model.Hg=2047&this.model.Hg}}await(0,R.w)(),(new t).Rc().then((()=>{})),i()}catch(t){i(t)}}),1)},1908:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(9763);class n{static XO=null;static load=async t=>{this.XO=await(0,s.F)(new WebAssembly.Module(t),{env:void 0})};static read=(t,i,e,s)=>{if(!this.XO)throw new Error('bz2 not found!!');return Int8Array.from(this.XO.read(t,i,e,s))}}},123:(t,i,e)=>{function s(t,i){window._tinyMidiPlay&&window._tinyMidiPlay(t,i/256)}function n(){window._tinyMidiStop&&window._tinyMidiStop()}e.d(i,{Xo:()=>s,Ro:()=>n})},9763:(t,i,e)=>{async function s(t,i={}){const e={env:Object.assign(Object.create(globalThis),i.env||{},{abort(t,i,e,s){t=h(t>>>0),i=h(i>>>0),e>>>=0,s>>>=0,(()=>{throw Error(`${t} in ${i}:${e}:${s}`)})()}})},{exports:s}=await WebAssembly.instantiate(t,e),n=s.memory||i.env.memory,r=Object.setPrototypeOf({read:(t,i,e,r)=>(i=function(t,i,e,r,h){if(null==r)return 0;const o=r.length,a=s.__pin(s.__new(o<>>0;if(h)new h(n.buffer,a,o).set(r);else for(let i=0;i>>0),r[i]);return s.__unpin(a),a}(a,6,0,i,Int8Array)||function(){throw TypeError("value must not be null")}(),function(t,i,e){if(!e)return null;const s=function(t){try{return o.getUint32(t,!0)}catch{return o=new DataView(n.buffer),o.getUint32(t,!0)}}(e-4)>>>i,r=new Array(s);for(let n=0;n>>0));return r}(l,0,s.read(t,i,e,r)>>>0))},s);function h(t){if(!t)return null;const i=t+new Uint32Array(n.buffer)[t-4>>>2]>>>1,e=new Uint16Array(n.buffer);let s=t>>>1,r="";for(;i-s>1024;)r+=String.fromCharCode(...e.subarray(s,s+=1024));return r+String.fromCharCode(...e.subarray(s,i))}let o=new DataView(n.buffer);function a(t,i){try{o.setUint8(t,i,!0)}catch{o=new DataView(n.buffer),o.setUint8(t,i,!0)}}function l(t){try{return o.getInt8(t,!0)}catch{return o=new DataView(n.buffer),o.getInt8(t,!0)}}return r}e.d(i,{F:()=>s})},9896:(t,i,e)=>{var s=e(8151);!function(){window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioContext&&(window.audioContext=new window.AudioContext);var t=function(i){if(window.audioContext){var e=window.audioContext.createBuffer(1,1,22050),s=window.audioContext.createBufferSource();s.buffer=e,s.connect(window.audioContext.destination),s.start?s.start(0):s.play?s.play(0):s.noteOn&&s.noteOn(0)}document.removeEventListener('touchstart',t),document.removeEventListener('touchend',t),document.removeEventListener('click',t)};document.addEventListener('touchstart',t),document.addEventListener('touchend',t),document.addEventListener('click',t)}(),(async()=>{let t=new Float32Array,i=window.audioContext.createGain();i.gain.value=.1,i.connect(window.audioContext.destination);let e=window.audioContext.currentTime,n=[];const r=new s.A({jO:30,zO:i=>{let e=new Float32Array(i.buffer),s=new Float32Array(t.length+e.length);s.set(t,0),s.set(e,t.length),t=s},ZO:t=>{},bufferSize:102400});await r.init();const h=await fetch('./SCC1_Florestan.sf2'),o=new Uint8Array(await h.arrayBuffer());function a(){if(!window.audioContext||!t.length)return;let s=window.audioContext.createBufferSource();const r=t.length/2,h=window.audioContext.createBuffer(2,r,44100);for(let i=0;i<2;i++){const e=h.getChannelData(i);let s=i;for(let i=0;i{if(l&&clearInterval(l),t=new Float32Array,n.length){let t=i.gain.value;i.gain.value=0,n.forEach((t=>{t.stop(window.audioContext.currentTime)})),n=[],i.gain.value=t}},window._tinyMidiVolume=(t=1)=>{i.gain.value=t},window._tinyMidiPlay=async(t,i=1)=>{t&&(await window._tinyMidiStop(),-1!=i&&window._tinyMidiVolume(i),e=window.audioContext.currentTime,l=setInterval(a,250),r.$O(t))}})()},8151:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5473);const n=class{constructor(t={}){this.JO=void 0,this.QO=0,this.tL=0,this.iL=0,this.jO=t.jO||100,this.sampleRate=t.sampleRate||44100,this.eL=t.eL||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.sL(1),this.zO=t.zO||(()=>{}),this.ZO=t.ZO||(()=>{}),this.nL=void 0,this.test=0}async init(){if(!this.JO){if('undefined'!=typeof process){const{rL:t}=await import('path'),{hL:i}=await import('module');globalThis.__dirname=t("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js"),globalThis.require=i("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js")}this.JO=await(0,s.A)(),this.oL=this.JO._malloc(this.bufferSize),this.aL=this.JO._malloc(8)}}sL(t){this.bufferSize=4*this.sampleRate*this.eL*t}lL(){if(!this.JO)throw new Error(`${this.constructor.name} not initalized. call .init()`)}qO(t){this.lL();const{_malloc:i,_free:e,_tsf_load_memory:s,_tsf_set_output:n,_tsf_channel_set_bank_preset:r,_tsf_set_max_voices:h,_tsf_channel_set_presetnumber:o}=this.JO;e(this.QO),this.QO=i(t.length),this.JO.HEAPU8.set(t,this.QO),this.tL=s(this.QO,t.length),n(this.tL,2===this.eL?0:2,this.sampleRate,this.gain)}cL(){this.lL();const t=new Uint8Array(this.bufferSize);return t.set(this.JO.HEAPU8.subarray(this.oL,this.oL+this.bufferSize)),t}fL(t){const{_malloc:i,_free:e,_tml_load_memory:s}=this.JO;return e(this.iL),this.iL=i(t.length),this.JO.HEAPU8.set(t,this.iL),s(this.iL,t.length)}uL(t){const{_midi_render:i}=this.JO;return i(this.tL,t,this.eL,this.sampleRate,this.oL,this.bufferSize,this.aL)}$O(t){if(this.lL(),!this.tL)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.nL);const{setValue:i,getValue:e}=this.JO;i(this.aL,0,'double'),this.JO._tsf_reset(this.tL),this.JO._tsf_channel_set_bank_preset(this.tL,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let s=this.fL(t);const n=()=>{s=this.uL(s);const t=this.cL();this.zO(t),s?this.nL=setTimeout(n,this.jO):this.ZO(e(this.aL,'double'))};this.nL=setTimeout(n,16)}}},8227:(t,i,e)=>{t.exports=e.p+"9f86b5397894e28b5ae2.wasm"},5473:(t,i,e)=>{var s;e.d(i,{A:()=>n});const n=(s="file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/tinymidipcm.mjs",function(t){var i,n,r=void 0!==(t=t||{})?t:{};r.ready=new Promise((function(t,e){i=t,n=e})),["_tsf_load_memory","_tsf_set_output","_tsf_channel_set_bank_preset","_tsf_set_max_voices","_tsf_channel_set_presetnumber","_tsf_reset","_tsf_close","_tml_load_memory","_midi_render","_malloc","_realloc","_free","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(r.ready,t)||Object.defineProperty(r.ready,t,{get:()=>j('You are getting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),set:()=>j('You are setting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js')})}));var h=Object.assign({},r),o=[],a='object'==typeof window,l='function'==typeof importScripts,c='object'==typeof process&&'object'==typeof process.versions&&'string'==typeof process.versions.node,f=!a&&!c&&!l;if(r.ENVIRONMENT)throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');var u,d,w,y='';if(c){if('undefined'==typeof process||!process.release||'node'!==process.release.name)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');var A,m;y=l?require('path').rL(y)+'/':__dirname+'/';var p=()=>{m||(A=require('fs'),m=require('path'))};u=(t,i)=>(p(),t=m.normalize(t),A.dL(t,i?void 0:'utf8')),w=t=>{var i=u(t,!0);return i.buffer||(i=new Uint8Array(i)),D(i.buffer),i},d=(t,i,e)=>{p(),t=m.normalize(t),A.wL(t,(function(t,s){t?e(t):i(s.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,'/'),o=process.argv.slice(2),process.on('uncaughtException',(function(t){if(!(t instanceof nt))throw t})),process.on('unhandledRejection',(function(t){throw t})),r.inspect=function(){return'[Emscripten Module object]'}}else if(f){if('object'==typeof process&&'function'==typeof require||'object'==typeof window||'function'==typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');'undefined'!=typeof read&&(u=function(t){return read(t)}),w=function(t){let i;return'function'==typeof readbuffer?new Uint8Array(readbuffer(t)):(i=read(t,'binary'),D('object'==typeof i),i)},d=function(t,i,e){setTimeout((()=>i(w(t))),0)},'undefined'!=typeof scriptArgs?o=scriptArgs:void 0!==arguments&&(o=arguments),'undefined'!=typeof print&&('undefined'==typeof console&&(console={}),console.log=print,console.warn=console.error='undefined'!=typeof printErr?printErr:print)}else{if(!a&&!l)throw new Error('environment detection error');if(l?y=self.location.href:'undefined'!=typeof document&&document.currentScript&&(y=document.currentScript.src),s&&(y=s),y=0!==y.indexOf('blob:')?y.substr(0,y.replace(/[?#].*/,"").lastIndexOf('/')+1):'','object'!=typeof window&&'function'!=typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');u=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.send(null),i.responseText},l&&(w=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.responseType='arraybuffer',i.send(null),new Uint8Array(i.response)}),d=(t,i,e)=>{var s=new XMLHttpRequest;s.open('GET',t,!0),s.responseType='arraybuffer',s.onload=()=>{200==s.status||0==s.status&&s.response?i(s.response):e()},s.onerror=e,s.send(null)}}r.print||console.log.bind(console);var g,I,_=r.printErr||console.warn.bind(console);function C(t,i){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){j('Module.'+t+' has been replaced with plain '+i+' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')}})}function E(t){return'FS_createPath'===t||'FS_createDataFile'===t||'FS_createPreloadedFile'===t||'FS_unlink'===t||'addRunDependency'===t||'FS_createLazyFile'===t||'FS_createDevice'===t||'removeRunDependency'===t}Object.assign(r,h),h=null,g='fetchSettings',Object.getOwnPropertyDescriptor(r,g)&&j('`Module.'+g+'` was supplied but `'+g+'` not included in INCOMING_MODULE_JS_API'),r.arguments&&(o=r.arguments),C('arguments','arguments_'),r.thisProgram&&r.thisProgram,C('thisProgram','thisProgram'),r.quit&&r.quit,C('quit','quit_'),D(void 0===r.memoryInitializerPrefixURL,'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.pthreadMainPrefixURL,'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.cdInitializerPrefixURL,'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.filePackagePrefixURL,'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.read,'Module.read option was removed (modify read_ in JS)'),D(void 0===r.readAsync,'Module.readAsync option was removed (modify readAsync in JS)'),D(void 0===r.readBinary,'Module.readBinary option was removed (modify readBinary in JS)'),D(void 0===r.setWindowTitle,'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'),D(void 0===r.TOTAL_MEMORY,'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'),C('read','read_'),C('readAsync','readAsync'),C('readBinary','readBinary'),C('setWindowTitle','setWindowTitle'),D(!f,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),r.wasmBinary&&(I=r.wasmBinary),C('wasmBinary','wasmBinary');var v;r.noExitRuntime;C('noExitRuntime','noExitRuntime'),'object'!=typeof WebAssembly&&j('no native wasm support detected');var b,T,R,O,L,S,x,k,M=!1;function D(t,i){t||j('Assertion failed'+(i?': '+i:''))}function N(t){b=t,r.HEAP8=T=new Int8Array(t),r.HEAP16=O=new Int16Array(t),r.HEAP32=L=new Int32Array(t),r.HEAPU8=R=new Uint8Array(t),r.HEAPU16=new Uint16Array(t),r.HEAPU32=S=new Uint32Array(t),r.HEAPF32=x=new Float32Array(t),r.HEAPF64=k=new Float64Array(t)}'undefined'!=typeof TextDecoder&&new TextDecoder('utf8');var F=5242880;r.TOTAL_STACK&&D(F===r.TOTAL_STACK,'the stack size can no longer be determined at runtime');var B=r.INITIAL_MEMORY||16777216;function U(){if(!M){var t=ft(),i=S[t>>2],e=S[t+4>>2];34821223==i&&2310721022==e||j('Stack overflow! Stack cookie has been overwritten at 0x'+t.toString(16)+', expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+e.toString(16)+' 0x'+i.toString(16)),1668509029!==S[0]&&j('Runtime error: The application has corrupted its heap memory area (address zero)!')}}C('INITIAL_MEMORY','INITIAL_MEMORY'),D(B>=F,'INITIAL_MEMORY should be larger than TOTAL_STACK, was '+B+'! (TOTAL_STACK='+F+')'),D('undefined'!=typeof Int32Array&&'undefined'!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,'JS engine does not provide full typed array support'),D(!r.wasmMemory,'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'),D(16777216==B,'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'),function(){var t=new Int16Array(1),i=new Int8Array(t.buffer);if(t[0]=25459,115!==i[0]||99!==i[1])throw'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'}();var P=[],G=[],W=[],Y=!1;D(Math.imul,'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.fround,'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.clz32,'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.trunc,'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');var H=0,V=null,K=null,X={};function j(t){r.onAbort&&r.onAbort(t),_(t='Aborted('+t+')'),M=!0;var i=new WebAssembly.RuntimeError(t);throw n(i),i}var z={error:function(){j('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM')},init:function(){z.error()},yL:function(){z.error()},AL:function(){z.error()},mL:function(){z.error()},open:function(){z.error()},pL:function(){z.error()},gL:function(){z.error()},IL:function(){z.error()},_L:function(){z.error()},CL:function(){z.error()}};r.FS_createDataFile=z.yL,r.FS_createPreloadedFile=z.AL;var Z,q,$,J,Q='data:application/octet-stream;base64,';function tt(t){return t.startsWith(Q)}function it(t){return t.startsWith('file://')}function et(t,i){return function(){var e=t,s=i;return i||(s=r.asm),D(Y,'native function `'+e+'` called before runtime initialization'),s[t]||D(s[t],'exported native function `'+e+'` not found'),s[t].apply(null,arguments)}}function st(t){try{if(t==Z&&I)return new Uint8Array(I);if(w)return w(t);throw"both async and sync fetching of the wasm failed"}catch(t){j(t)}}function nt(t){this.name='ExitStatus',this.message='Program terminated with exit('+t+')',this.status=t}function rt(t){for(;t.length>0;)t.shift()(r)}function ht(t){ht.EL||(ht.EL={}),ht.EL[t]||(ht.EL[t]=1,c&&(t='warning: '+t),_(t))}function ot(t){try{return v.vL(t-b.byteLength+65535>>>16),N(v.buffer),1}catch(i){_('emscripten_realloc_buffer: Attempted to grow heap from '+b.byteLength+' bytes to '+t+' bytes, but got error: '+i)}}r.locateFile?tt(Z='tinymidipcm.wasm')||(q=Z,Z=r.locateFile?r.locateFile(q,y):y+q):Z=new URL(e(8227),e.b).toString();var at,lt={"emscripten_memcpy_big":function(t,i,e){R.copyWithin(t,i,i+e)},"emscripten_resize_heap":function(t){var i=R.length;D((t>>>=0)>i);var e,s,n=2147483648;if(t>n)return _('Cannot enlarge memory, asked to go up to '+t+' bytes, but the limit is '+n+' bytes!'),!1;for(var r=1;r<=4;r*=2){var h=i*(1+.2/r);h=Math.min(h,t+100663296);var o=Math.min(n,(e=Math.max(t,h))+((s=65536)-e%s)%s);if(ot(o))return!0}return _('Failed to grow the heap from '+i+' bytes to '+o+' bytes, not enough memory!'),!1}},ct=(function(){var t,i={'env':lt,'wasi_snapshot_preview1':lt};function e(t,i){var e,s=t.exports;r.asm=s,D(v=r.asm.memory,"memory not found in wasm exports"),N(v.buffer),D(r.asm.__indirect_function_table,"table not found in wasm exports"),e=r.asm.__wasm_call_ctors,G.unshift(e),function(t){if(H--,r.monitorRunDependencies&&r.monitorRunDependencies(H),t?(D(X[t]),delete X[t]):_('warning: run dependency removed without ID'),0==H&&(null!==V&&(clearInterval(V),V=null),K)){var i=K;K=null,i()}}('wasm-instantiate')}t='wasm-instantiate',H++,r.monitorRunDependencies&&r.monitorRunDependencies(H),t?(D(!X[t]),X[t]=1,null===V&&'undefined'!=typeof setInterval&&(V=setInterval((function(){if(M)return clearInterval(V),void(V=null);var t=!1;for(var i in X)t||(t=!0,_('still waiting on run dependencies:')),_('dependency: '+i);t&&_('(end of list)')}),1e4))):_('warning: run dependency added without ID');var s=r;function h(t){D(r===s,'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'),s=null,e(t.instance)}function o(t){return function(){if(!I&&(a||l)){if('function'==typeof fetch&&!it(Z))return fetch(Z,{credentials:'same-origin'}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+Z+"'";return t.arrayBuffer()})).catch((function(){return st(Z)}));if(d)return new Promise((function(t,i){d(Z,(function(i){t(new Uint8Array(i))}),i)}))}return Promise.resolve().then((function(){return st(Z)}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){_('failed to asynchronously prepare wasm: '+t),it(Z)&&_('warning: Loading from a file URI ('+Z+') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing'),j(t)}))}if(r.instantiateWasm)try{return r.instantiateWasm(i,e)}catch(t){_('Module.instantiateWasm callback failed with error: '+t),n(t)}(I||'function'!=typeof WebAssembly.instantiateStreaming||tt(Z)||it(Z)||c||'function'!=typeof fetch?o(h):fetch(Z,{credentials:'same-origin'}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(h,(function(t){return _('wasm streaming compile failed: '+t),_('falling back to ArrayBuffer instantiation'),o(h)}))}))).catch(n)}(),r.___wasm_call_ctors=et("__wasm_call_ctors"),r._malloc=et("malloc"),r._free=et("free"),r._tsf_load_memory=et("tsf_load_memory"),r._tsf_close=et("tsf_close"),r._tsf_reset=et("tsf_reset"),r._tsf_set_output=et("tsf_set_output"),r._tsf_set_max_voices=et("tsf_set_max_voices"),r._realloc=et("realloc"),r._tsf_channel_set_presetnumber=et("tsf_channel_set_presetnumber"),r._tsf_channel_set_bank_preset=et("tsf_channel_set_bank_preset"),r._tml_load_memory=et("tml_load_memory"),r._midi_render=et("midi_render"),r.___errno_location=et("__errno_location"),r._fflush=et("fflush"),r._emscripten_stack_init=function(){return(ct=r._emscripten_stack_init=r.asm.emscripten_stack_init).apply(null,arguments)}),ft=(r._emscripten_stack_get_free=function(){return(r._emscripten_stack_get_free=r.asm.emscripten_stack_get_free).apply(null,arguments)},r._emscripten_stack_get_base=function(){return(r._emscripten_stack_get_base=r.asm.emscripten_stack_get_base).apply(null,arguments)},r._emscripten_stack_get_end=function(){return(ft=r._emscripten_stack_get_end=r.asm.emscripten_stack_get_end).apply(null,arguments)});function ut(){var t;ct(),D(!(3&(t=ft()))),S[t>>2]=34821223,S[t+4>>2]=2310721022,S[0]=1668509029}function dt(t){function e(){at||(at=!0,r.calledRun=!0,M||(D(!Y),Y=!0,U(),rt(G),i(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),D(!r._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(U(),r.postRun)for('function'==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)t=r.postRun.shift(),W.unshift(t);var t;rt(W)}()))}t=t||o,H>0||(ut(),function(){if(r.preRun)for('function'==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)t=r.preRun.shift(),P.unshift(t);var t;rt(P)}(),H>0||(r.setStatus?(r.setStatus('Running...'),setTimeout((function(){setTimeout((function(){r.setStatus('')}),1),e()}),1)):e(),U()))}if(r.stackSave=et("stackSave"),r.stackRestore=et("stackRestore"),r.stackAlloc=et("stackAlloc"),r.setValue=function(t,i,e="i8"){switch(e.endsWith('*')&&(e='*'),e){case'i1':case'i8':T[0|t]=i;break;case'i16':O[t>>1]=i;break;case'i32':L[t>>2]=i;break;case'i64':J=[i>>>0,($=i,+Math.abs($)>=1?$>0?(0|Math.min(+Math.floor($/4294967296),4294967295))>>>0:~~+Math.ceil(($-+(~~$>>>0))/4294967296)>>>0:0)],L[t>>2]=J[0],L[t+4>>2]=J[1];break;case'float':x[t>>2]=i;break;case'double':k[t>>3]=i;break;case'*':S[t>>2]=i;break;default:j('invalid type for setValue: '+e)}},r.getValue=function(t,i="i8"){switch(i.endsWith('*')&&(i='*'),i){case'i1':case'i8':return T[0|t];case'i16':return O[t>>1];case'i32':case'i64':return L[t>>2];case'float':return x[t>>2];case'double':return k[t>>3];case'*':return S[t>>2];default:j('invalid type for getValue: '+i)}return null},['run','UTF8ArrayToString','UTF8ToString','stringToUTF8Array','stringToUTF8','lengthBytesUTF8','addOnPreRun','addOnInit','addOnPreMain','addOnExit','addOnPostRun','addRunDependency','removeRunDependency','FS_createFolder','FS_createPath','FS_createDataFile','FS_createPreloadedFile','FS_createLazyFile','FS_createLink','FS_createDevice','FS_unlink','getLEB','getFunctionTables','alignFunctionTables','registerFunctions','prettyPrint','getCompilerSetting','print','printErr','callMain','abort','keepRuntimeAlive','wasmMemory','stackAlloc','stackSave','stackRestore','getTempRet0','setTempRet0','writeStackCookie','checkStackCookie','ptrToString','zeroMemory','stringToNewUTF8','exitJS','getHeapMax','emscripten_realloc_buffer','ENV','ERRNO_CODES','ERRNO_MESSAGES','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','DNS','getHostByName','Protocols','Sockets','getRandomDevice','warnOnce','traverseStack','UNWIND_CACHE','convertPCtoSourceLocation','readAsmConstArgsArray','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','handleException','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','freeTableIndexes','functionsInTableMap','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','PATH','PATH_FS','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16Decoder','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeArrayToMemory','writeAsciiToMemory','SYSCALLS','getSocketFromFD','getSocketAddress','JSEvents','registerKeyEventCallback','specialHTMLTargets','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','currentFullscreenStrategy','restoreOldWindowedStyle','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','demangle','demangleAll','jsStackTrace','stackTrace','ExitStatus','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','dlopenMissingError','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','uncaughtExceptionCount','exceptionLast','exceptionCaught','ExceptionInfo','exception_addRef','exception_decRef','Browser','setMainLoop','wget','FS','MEMFS','TTY','PIPEFS','SOCKFS','_setNetworkCallback','tempFixedLengthArray','miniTempWebGLFloatBuffers','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','GL','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','AL','SDL_unicode','SDL_ttfContext','SDL_audio','SDL','SDL_gfx','GLUT','EGL','GLFW_Window','GLFW','GLEW','IDBStore','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){var i="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),j(i)}})})),['ptrToString','zeroMemory','stringToNewUTF8','exitJS','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','getHostByName','getRandomDevice','traverseStack','convertPCtoSourceLocation','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeAsciiToMemory','getSocketFromFD','getSocketAddress','registerKeyEventCallback','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','ExceptionInfo','exception_addRef','exception_decRef','setMainLoop','_setNetworkCallback','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','SDL_unicode','SDL_ttfContext','SDL_audio','GLFW_Window','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){'undefined'==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var i='`'+t+'` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line';E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),ht(i)}})})),K=function t(){at||dt(),at||(K=t)},r.preInit)for('function'==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return dt(),t.ready})}},r={};function h(t){var i=r[t];if(void 0!==i)return i.exports;var e=r[t]={exports:{}};return n[t](e,e.exports,h),e.exports}h.m=n,t="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",i="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",e="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",s=t=>{t&&t.d<1&&(t.d=1,t.forEach((t=>t.r--)),t.forEach((t=>t.r--?t.r++:t())))},h.a=(n,r,h)=>{var o;h&&((o=[]).d=-1);var a,l,c,f=new Set,u=n.exports,d=new Promise(((t,i)=>{c=i,l=t}));d[i]=u,d[t]=t=>(o&&t(o),f.forEach(t),d.catch((t=>{}))),n.exports=d,r((n=>{var r;a=(n=>n.map((n=>{if(null!==n&&"object"==typeof n){if(n[t])return n;if(n.then){var r=[];r.d=0,n.then((t=>{h[i]=t,s(r)}),(t=>{h[e]=t,s(r)}));var h={};return h[t]=t=>t(r),h}}var o={};return o[t]=t=>{},o[i]=n,o})))(n);var h=()=>a.map((t=>{if(t[e])throw t[e];return t[i]})),l=new Promise((i=>{(r=()=>i(h)).r=0;var e=t=>t!==o&&!f.has(t)&&(f.add(t),t&&!t.d&&(r.r++,t.push(r)));a.map((i=>i[t](e)))}));return r.r?l:h()}),(t=>(t?c(d[e]=t):l(u),s(o)))),o&&o.d<0&&(o.d=0)},h.d=(t,i)=>{for(var e in i)h.o(i,e)&&!h.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:i[e]})},h.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),h.p="/Client2/",h.b=document.baseURI||self.location.href;h(8073)})(); \ No newline at end of file diff --git a/sounds.js b/sounds.js index 1232fb98..73545d5e 100644 --- a/sounds.js +++ b/sounds.js @@ -1 +1 @@ -(()=>{"use strict";var t,i,e,s,n={1651:(t,i,e)=>{e.d(i,{K:()=>M});var s=e(1120),n=e(4583),r=e(2901),h=e(1069),o=e(7046),l=(e(9896),e(6666)),a=e(3045),c=e(818),f=e(670),u=e(8268),d=e(3867),w=e(7854),y=e(8950),A=e(1302),m=e(9298),p=e(8665),_=e(1312),I=e(3819),g=e(8317),C=e(9234),E=e(1908),v=e(123),b=e(5637),T=e(6948),R=e(2164),O=e(8738),L=e(3764),S=e(8534),x=e(6730);class M extends o.A{static tt=225;static it=10;static portOffset=0;static members=!0;static et=!1;static st='';static nt='';static rt=!1;static ht=2;static ot=!1;static lt='https://raw.githubusercontent.com/2004scape/Server/main';static exponent=58778699976184461502525193738213253649000149147835990136706041084440742975821n;static ct=7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789n;static ft=0;static ut=0;static dt=0;static wt=0;static yt=0;static At=0;static _t=0;static It=0;static gt=0;static Ct=0;static Et=0;static vt=0;static bt=0;static Tt=0;static Rt=0;static Ot=()=>{a.A.et=!1,n.A.et=!1,M.et=!1,c.A.et=!1};static Lt=()=>{a.A.et=!0,n.A.et=!0,M.et=!0,c.A.et=!0};St=2048;xt=2047;Mt=!1;kt=!1;Dt=!1;Ft=!1;db=null;Nt=0;Bt=[];stream=null;in=h.A.Ut(1);Pt=h.A.Ut(1);Gt=h.A.Ut(1);Wt=0n;Yt=0;Ht=0;Vt=0;Kt=null;Xt=0;packetSize=0;jt=0;zt=0;Zt=0;qt=null;Jt=!0;$t=0;Qt=0;ti=null;ii=null;ei=null;si=null;ni=null;ri=null;hi=null;oi=null;li=null;ai=null;ci=null;fi='';ui='';username='';password='';di=null;wi=null;yi=null;Ai=null;mi=[];pi=!1;_i=null;Ii=null;gi=null;Ci=null;Ei=null;vi=null;bi=null;Ti=null;Ri=null;Oi=null;Li=new Int32Array(256);Si=0;xi=0;Mi=0;ki=null;Di=null;Fi=null;Ni=null;Bi=null;Ui=null;Pi=null;Gi=null;Wi=null;Yi=null;Hi=null;Vi=null;Ki=null;Xi=null;ji=null;zi=null;Zi=null;qi=null;Ji=null;$i=null;Qi=null;te=new Int32Array(33);ie=new Int32Array(33);ee=new Int32Array(151);se=new Int32Array(151);ne=null;re=null;he=null;oe=null;le=null;ae=null;ce=new d.fe(13,null);ue=null;de=null;we=new d.fe(50,null);ye=new d.fe(50,null);Ae=new d.fe(20,null);me=new d.fe(20,null);pe=null;_e=new d.fe(8,null);Ie=null;ge=null;Ce=null;Ee=null;ve=null;be=null;Te=null;Re=null;Oe=null;Le=null;Se=null;xe=null;Me=null;ke=null;De=null;Fe=null;Ne=null;Be=null;Ue=new d.fe(1e3,null);Pe=!1;Ge=!1;We=!1;Ye=!1;He=-1;Ve=0;Ke=0;Xe=0;je=0;ze=0;Ze=0;qe=!1;Je=0;$e=0;Qe=0;ts=0;es=0;ss=0;ns=[];rs=-1;hs=-1;os=new s.A;ls=78;cs=0;fs=0;us=[];ds=0;ws=0;ys=0;As=0;ps=0;_s=0;Is=0;gs=0;Cs=[];Es=[];vs=[];bs=[];Ts=null;Rs=-1;Os=3;Ls=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];Ss=0;xs=0;Ms=0;ks=!1;Ds=0;Fs=!1;Ns='';Bs='';Us=0;Ps='';Gs=!1;Ws=-1;Ys=new d.fe(100,null);Hs=new d.fe(100,null);messageType=new Int32Array(100);Vs=new Int32Array(100);Ks=0;Xs=0;js=0;zs='';Zs=0;qs=0;Js=0;$s=0;Qs=0;tn=0;en=0;sn=0;nn=0;rn=!1;hn=0;ln=0;an=0;cn=0;fn=null;un=0;dn=0;wn=0;yn=0;An=!1;mn=[];pn=[];_n=0;In=0;gn=0;Cn=null;En=0;vn=new Int32Array(500);bn=new Int32Array(500);Tn=new Int32Array(500);Rn=new Int32Array(500);On=0;Ln=0;Sn=0;xn='';Mn=!1;kn=-1;Dn=0;Fn=0;Nn=0;Bn=0;Un=0;Pn=new Int32Array(1e3);Gn=new Int32Array(1e3);Wn=null;Yn=0;Hn=0;Vn=0;Kn=0;Xn=0;jn=!1;zn=0;Zn=0;qn=0;Jn=0;$n=2;Qn=2;tr=1;ir=new Int32Array(5);er=new d.fe(5,!1);sr=new Int32Array(5);nr=new Int32Array(5);rr=new Int32Array(5);hr=0;lr=0;ar=0;cr=0;ur=0;dr=0;wr=0;yr=0;Ar=0;mr=1;pr=2;_r=-1;Ir=0;gr=0;Cr=0;Er=0;vr=0;br=0;Tr=null;Rr=null;Or=null;Lr=0;Sr=0;Mr=new Int8Array(16384);kr=new d.fe(f.A.Dr,null);Fr=0;Nr=0;Br=128;Ur=0;Pr=0;Gr=0;Wr=0;Yr=0;Hr=null;Vr=null;Kr=new d.Xr(f.A.jr,f.A.jr);zr=0;Zr=0;qr=0;Jr=0;$r=0;Qr=0;th=0;ih=0;eh=0;sh=0;nh=0;rh=0;hh=new d.fe(this.St,null);oh=0;lh=new Int32Array(this.St);ah=0;fh=0;uh=new Int32Array(this.St);dh=new Int32Array(1e3);wh=new d.fe(this.St,null);yh=new d.fe(8192,null);Ah=0;mh=new Int32Array(8192);ph=new l.A;_h=new l.A;Ih=new l.A;gh=new l.A;Ch=new d.Eh(f.A.Dr,f.A.jr,f.A.jr,null);bh=new l.A;Th=new Int32Array(4e3);Rh=new Int32Array(4e3);Oh=new Int32Array(f.A.jr*f.A.jr);Lh=new Int32Array(f.A.jr*f.A.jr);Sh=0;xh=null;Mh=0;kh=0;Dh=-1;Fh=0;Nh=0;Bh=0;Uh=0;Ph=!1;Gh=!0;Wh=!1;Yh=new Int32Array(7);Hh=new Int32Array(5);Vh=0;Kh=0;static Xh=50;jh=new Int32Array(M.Xh);zh=new Int32Array(M.Xh);Zh=new Int32Array(M.Xh);qh=new Int32Array(M.Xh);Jh=new Int32Array(M.Xh);$h=new Int32Array(M.Xh);Qh=new Int32Array(M.Xh);io=new d.fe(M.Xh,null);eo=new d.fe(100,null);so=new BigInt64Array(100);no=new Int32Array(100);ro=null;ho=0;oo=!0;lo=new Int32Array(50);ao=new Int32Array(50);co=new Int32Array(50);fo=192;uo=-1;do=-1;wo=0;yo=0;Ao=0;mo=!0;po=null;_o=0;Io=0;Co=192;Eo=new d.fe(16,null);vo=0;bo=!1;To=()=>{try{this.stream&&this.stream.close()}catch(t){}this.stream=null,(0,v.Ro)(),this.Pt=null,this.Gt=null,this.in=null,this.Or=null,this.Tr=null,this.Rr=null,this.Hr=null,this.Vr=null,this.Wn=null,this.kr=null,this.Oh=null,this.Lh=null,this.Th=null,this.Rh=null,this.Mr=null,this.Di=null,this.Fi=null,this.Ni=null,this.Bi=null,this.Ui=null,this.Pi=null,this.Gi=null,this.Wi=null,this.Yi=null,this.Hi=null,this.Vi=null,this.Ki=null,this.Xi=null,this.ji=null,this.zi=null,this.Zi=null,this.qi=null,this.ne=null,this.he=null,this.re=null,this.oe=null,this.le=null,this.ae=null,this.ce=null,this.Te=null,this.Re=null,this.Oe=null,this.Le=null,this.Se=null,this.xe=null,this.Me=null,this.ke=null,this.De=null,this.Fe=null,this.de=null,this.Ae=null,this.me=null,this._e=null,this.Ie=null,this.ge=null,this.Ce=null,this.Ee=null,this.we=null,this.ye=null,this.Kr=null,this.hh=null,this.lh=null,this.uh=null,this.wh=null,this.dh=null,this.yh=null,this.mh=null,this.Ch=null,this.bh=null,this.gh=null,this.ph=null,this._h=null,this.Ih=null,this.Tn=null,this.Rn=null,this.vn=null,this.bn=null,this.ns=null,this.mn=null,this.Pn=null,this.Gn=null,this.Ue=null,this.ue=null,this.eo=null,this.so=null,this.no=null,this.si=null,this.ni=null,this.ti=null,this.ii=null,this.ei=null,this.ri=null,this.hi=null,this.oi=null,this.li=null,this.Oo(),b.A.To(),T.A.To(),A.A.To(),R.A.Lo=null,g.A.Lo=null,s.A.Lo=null,_.A.Lo=null,O.A.Lo=null,O.A.So=null,L.A.Lo=null,this.xo=null,u.A.So=null,n.A.To(),a.A.To(),p.A.To(),S.A.Lo=[],x.A.Lo=[]};Mo(){return this.$t}ko(){return this.Gs}Do(){return this.Fs}Fo(){return this.hs}No(){return this.He}Oo=()=>{this.pi=!1,this.ki&&(clearInterval(this.ki),this.ki=null),this.ai=null,this.ci=null,this.mi=[],this.bi=null,this.Ti=null,this.Ri=null,this.Oi=null,this.Ci=null,this.gi=null,this.Ei=null,this.vi=null,this._i=null,this.Ii=null};Bo=async(t,i,e,s)=>{let n=5,o=await(this.db?.Uo(t));if(o&&h.A.Po(o)!==e&&(o=void 0),o)return new r.A(o);for(;!o;){await this.Go(s,`Requesting ${i}`);try{o=await(0,C.Wo)(`${M.nt}/${t}${e}`)}catch(t){o=void 0;for(let t=n;t>0;t--)await this.Go(s,`Error loading - Will retry in ${t} secs.`),await(0,C.Yo)(1e3);n*=2,n>60&&(n=60)}}return await(this.db?.Ho(t,o)),new r.A(o)};Vo=async(t,i,e)=>{let s=await(this.db?.Uo(t+'.mid'));if(s&&12345678!==i&&h.A.Po(s)!==i&&(s=void 0),!s)try{s=await(0,C.Wo)(`${M.nt}/${t}_${i}.mid`),e!==s.length&&(s=s.slice(0,e))}catch(t){}if(!s)return;await(this.db?.Ho(t+'.mid',s));const n=new h.A(Uint8Array.from(s)).Ko,r=E.A.read(n,s,e,4);(0,v.Xo)(r,this.Co)};jo=()=>{if(w.zo.fillStyle='black',w.zo.fillRect(0,0,this.width,this.height),this.Zo(1),this.Dt){this.pi=!1,w.zo.font='bold 16px helvetica, sans-serif',w.zo.textAlign='left',w.zo.fillStyle='yellow';let t=35;w.zo.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,w.zo.fillStyle='white',w.zo.fillText('To fix this try the following (in order):',30,t),t+=50,w.zo.font='bold 12px helvetica, sans-serif',w.zo.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.zo.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,w.zo.fillText('3: Try using a different game-world',30,t),t+=30,w.zo.fillText('4: Try rebooting your computer',30,t),t+=30,w.zo.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.Ft&&(this.pi=!1,w.zo.font='bold 20px helvetica, sans-serif',w.zo.textAlign='left',w.zo.fillStyle='white',w.zo.fillText('Error - unable to load game!',50,50),w.zo.fillText('To play RuneScape make sure you play from',50,100),w.zo.fillText('https://2004scape.org',50,150)),this.kt){this.pi=!1,w.zo.font='bold 13px helvetica, sans-serif',w.zo.textAlign='left',w.zo.fillStyle='yellow';let t=35;w.zo.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,w.zo.fillStyle='white',w.zo.fillText('To fix this try the following (in order):',30,t),t+=50,w.zo.font='bold 12px helvetica, sans-serif',w.zo.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.zo.fillText('2: Try rebooting your computer, and reloading',30,t)}};qo=t=>{if(!t.Jo)return!1;for(let i=0;i=s)return!1}else if(3===t.Jo[i]){if(e<=s)return!1}else if(4===t.Jo[i]){if(e===s)return!1}else if(e!==s)return!1}return!0};tl=(t,i,e,s,n)=>{this.ve?.draw(t,i),this.be?.draw(t,i+n-16),y.A.fillRect(t,i+16,16,n-32,m.A.il);let r=(n-32)*n/s|0;r<8&&(r=8);const h=(n-r-32)*e/(s-n)|0;y.A.fillRect(t,i+h+16,16,r,m.A.el),y.A.sl(t,i+h+16,m.A.nl,r),y.A.sl(t+1,i+h+16,m.A.nl,r),y.A.rl(t,i+h+16,m.A.nl,16),y.A.rl(t,i+h+17,m.A.nl,16),y.A.sl(t+15,i+h+16,m.A.hl,r),y.A.sl(t+14,i+h+17,m.A.hl,r-1),y.A.rl(t,i+h+r+15,m.A.hl,16),y.A.rl(t+1,i+h+r+14,m.A.hl,15)};ol=(t,i)=>{let e=!1;const n=s.A.Lo[t];if(!n.ll)return!1;for(let t=0;ts.delay[r.ul];)r.fl-=s.delay[r.ul]+1,r.ul++,r.ul>=s.dl&&(r.ul-=s.wl,(r.ul<0||r.ul>=s.dl)&&(r.ul=0)),e=!0}}}return e};yl=(t,i,e,r,h=!1)=>{if(0!==t.type||!t.ll||t.hide&&this.Zs!==t.id&&this.qs!==t.id&&this.Js!==t.id)return;const o=y.A.left,l=y.A.top,a=y.A.right,c=y.A.bottom;y.A.Al(i,e,i+t.width,e+t.height);const f=t.ll.length;for(let o=0;o0&&this.Cl(c),c.type===s.A.El)c.vl>c.scroll-c.height&&(c.vl=c.scroll-c.height),c.vl<0&&(c.vl=0),this.yl(c,l,a,c.vl,h),c.scroll>c.height&&this.tl(l+c.width,a,c.vl,c.scroll,c.height);else if(c.type===s.A.bl){let t=0;for(let i=0;i0){let i=0,e=0;const r=c.Ol[t]-1;if(s>=-32&&s<=512&&n>=-32&&n<=334||0!==this.tn&&this.Qs===t){const h=A.A.Ml(r,c.Ll[t]);if(0!==this.tn&&this.Qs===t&&this.$s===c.id?(i=this.kl-this.en,e=this.Dl-this.sn,i<5&&i>-5&&(i=0),e<5&&e>-5&&(e=0),this.nn<5&&(i=0,e=0),h.Fl(128,s+i,n+e)):0!==this.un&&this.dn===t&&this.wn===c.id?h.Fl(128,s,n):h.draw(s,n),33===h.Nl||1!==c.Ll[t]){const r=c.Ll[t];this.di?.Bl(s+i+1,n+10+e,this.Ul(r),m.A.Pl),this.di?.Bl(s+i,n+9+e,this.Ul(r),m.A.Gl)}}}else if(c.Wl&&t<20){const i=c.Wl[t];i?.draw(s,n)}t++}}else if(c.type===s.A.Yl)c.fill?y.A.fillRect(l,a,c.width,c.height,c.Hl):y.A._l(l,a,c.width,c.height,c.Hl);else if(c.type===s.A.Vl){const t=c.font;let i=c.Hl,e=c.text;if(this.Js!==c.id&&this.qs!==c.id&&this.Zs!==c.id||0===c.Kl||(i=c.Kl),this.qo(c)&&(i=c.Xl,c.jl&&c.jl.length>0&&(e=c.jl)),c.zl===s.A.Zl&&this.An&&(e='Please wait...',i=c.Hl),!t||!e)continue;for(let s=a+t.height;e.length>0;s+=t.height){if(-1!==e.indexOf('%')){for(;;){const t=e.indexOf('%1');if(-1===t)break;e=e.substring(0,t)+this.ql(this.$o(c,0))+e.substring(t+2)}for(;;){const t=e.indexOf('%2');if(-1===t)break;e=e.substring(0,t)+this.ql(this.$o(c,1))+e.substring(t+2)}for(;;){const t=e.indexOf('%3');if(-1===t)break;e=e.substring(0,t)+this.ql(this.$o(c,2))+e.substring(t+2)}for(;;){const t=e.indexOf('%4');if(-1===t)break;e=e.substring(0,t)+this.ql(this.$o(c,3))+e.substring(t+2)}for(;;){const t=e.indexOf('%5');if(-1===t)break;e=e.substring(0,t)+this.ql(this.$o(c,4))+e.substring(t+2)}}const n=e.indexOf('\\n');let r;-1!==n?(r=e.substring(0,n),e=e.substring(n+2)):(r=e,e=''),c.Jl?t.$l(l+(c.width/2|0),s,r,i,c.Ql):t.ta(l,s,r,i,c.Ql)}}else if(c.type===s.A.ia){let t;t=this.qo(c)?c.ea:c.sa,t?.draw(l,a)}else if(c.type===s.A.na){const t=n.A.ra,i=n.A.ha;n.A.ra=l+(c.width/2|0),n.A.ha=a+(c.height/2|0);const e=n.A.sin[c.oa]*c.zoom>>16,s=n.A.cos[c.oa]*c.zoom>>16,r=this.qo(c);let h;h=r?c.cl:c.al;let o=null;if(-1===h)o=c.la(-1,-1,r);else{const t=_.A.Lo[h];t.frames&&t.aa&&(o=c.la(t.frames[c.ul],t.aa[c.ul],r))}o&&o.ca(0,c.fa,0,c.oa,0,e,s),n.A.ra=t,n.A.ha=i}else if(c.type===s.A.ua){const t=c.font;if(!t||!c.Ol||!c.Ll)continue;let i=0;for(let e=0;e0){const n=A.A.get(c.Ol[i]-1);let r=n.name;if((n.da||1!==c.Ll[i])&&(r=r+' x'+this.wa(c.Ll[i])),!r)continue;const h=l+s*(c.Sl+115),o=a+e*(c.xl+12);c.Jl?t.$l(h+(c.width/2|0),o,r,c.Hl,c.Ql):t.ta(h,o,r,c.Hl,c.Ql)}i++}}}y.A.Al(o,l,a,c)};Cl=t=>{let i=t.gl;if(i>=s.A.ya&&i<=s.A.Aa)i--,i>=this.Vh?(t.text='',t.zl=0):(t.text=this.eo[i],t.zl=1);else if(i>=s.A.ma&&i<=s.A.pa)i-=s.A.ma,i>=this.Vh?(t.text='',t.zl=0):(0===this.no[i]?t.text='@red@Offline':this.no[i]===M.it?t.text='@gre@World-'+(this.no[i]-9):t.text='@yel@World-'+(this.no[i]-9),t.zl=1);else if(i===s.A._a)t.scroll=15*this.Vh+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i>=s.A.Ia&&i<=s.A.ga)i-=s.A.Ia,i>=this.fs?(t.text='',t.zl=0):(t.text=I.A.Ca(I.A.Ea(this.us[i])),t.zl=1);else if(i===s.A.va)t.scroll=15*this.fs+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i===s.A.ba){if(t.oa=150,t.fa=256*Math.sin(this.Nt/40)&2047,this.Wh){this.Wh=!1;const i=new d.fe(7,null);let e=0;for(let t=0;t<7;t++){const s=this.Yh[t];s>=0&&(i[e++]=g.A.Lo[s].la())}const s=p.A.Ta(i,e);for(let t=0;t<5;t++)0!==this.Hh[t]&&(s.Ra(u.A.Oa[t][0],u.A.Oa[t][this.Hh[t]]),1===t&&s.Ra(u.A.La[0],u.A.La[this.Hh[t]]));if(this.xh){const i=_.A.Lo[this.xh.Sa].frames;i&&(s.xa(),s.Ma(i[0]),s.ka(64,850,-30,-50,-30,!0),t.model=s)}}}else if(i===s.A.Da)this.Ne||(this.Ne=t.sa,this.Be=t.ea),this.Gh?t.sa=this.Be:t.sa=this.Ne;else if(i===s.A.Fa)this.Ne||(this.Ne=t.sa,this.Be=t.ea),this.Gh?t.sa=this.Ne:t.sa=this.Be;else if(i===s.A.Na)t.text=this.xn,this.Nt%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(i===s.A.Ba)this.Ph?this.Mn?(t.Hl=m.A.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.Hl=m.A.Il,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(i===s.A.Ua||i===s.A.Pa)if(0===this.Dn)t.text='';else{let i;i=0===this.Fn?'earlier today':1===this.Fn?'yesterday':this.Fn+' days ago',t.text='You last logged in '+i+' from: '+I.A.Ga(this.Dn)}else if(i===s.A.Wa)0===this.Bn&&(t.text='0 unread messages',t.Hl=m.A.Gl),1===this.Bn&&(t.text='1 unread message',t.Hl=m.A.GREEN),this.Bn>1&&(t.text=this.Bn+' unread messages',t.Hl=m.A.GREEN);else if(i===s.A.Ya)if(201===this.Nn)t.text='';else if(200===this.Nn)t.text='You have not yet set any password recovery questions.';else{let i;i=0===this.Nn?'Earlier today':1===this.Nn?'Yesterday':this.Nn+' days ago',t.text=i+' you changed your recovery questions'}else i===s.A.Ha?201===this.Nn?t.text='':200===this.Nn?t.text='We strongly recommend you do so now to secure your account.':t.text='If you do not remember making this change then cancel it immediately':i===s.A.Va&&(201===this.Nn?t.text='':(this.Nn,t.text="Do this from the 'account management' area on our front webpage"))};$o=(t,i)=>{if(!t.scripts||i>=t.scripts.length)return-2;try{const e=t.scripts[i];if(!e)return-1;let n=0,r=0;for(;;){const t=e[r++];if(0===t)return n;if(1===t)n+=this.Es[e[r++]];else if(2===t)n+=this.vs[e[r++]];else if(3===t)n+=this.Cs[e[r++]];else if(4===t){const t=s.A.Lo[e[r++]],i=e[r++]+1;if(t.Ol&&t.Ll)for(let e=0;et<999999999?String(t):'*';wa=t=>{let i=String(t);for(let t=i.length-3;t>0;t-=3)i=i.substring(0,t)+','+i.substring(t);return i.length>8?i='@gre@'+i.substring(0,i.length-8)+' million @whi@('+i+')':i.length>4&&(i='@cya@'+i.substring(0,i.length-4)+'K @whi@('+i+')'),' '+i};Ul=t=>t<1e5?String(t):t<1e7?(t/1e3|0)+'K':(t/1e6|0)+'M'}},7604:(t,i,e)=>{e.d(i,{w:()=>h});var s=e(7046),n=e(1651),r=e(9234);async function h(){await async function(){0===s.A.getParameter('world').length&&s.A.setParameter('world','1');'localhost'===window.location.hostname&&'0'===s.A.getParameter('world')?(n.K.st='http://localhost',n.K.nt='http://localhost',n.K.portOffset=0):await async function(t){const i=await o(t,parseInt(s.A.getParameter('world'),10)),e=new URL(i.address);n.K.it=10+i.id-1,n.K.st=`${e.protocol}//${e.hostname}`,n.K.nt=`${e.protocol}//${e.hostname}:${e.port}`,t||(n.K.st=n.K.st.replace('https:','http:'));n.K.portOffset=i.portOffset,n.K.members=!0===i?.members,s.A.setParameter('world',i.id.toString(10))}(window.location.protocol.startsWith('https'))}(),function(){0===s.A.getParameter('detail').length&&s.A.setParameter('detail','high');'low'===s.A.getParameter('detail')?n.K.Lt():n.K.Ot()}(),0===s.A.getParameter('method').length&&s.A.setParameter('method','0')}async function o(t,i,e=0){if(e>=10)throw new Error('could not find world to connect!');const s=t?'https:':'http:';let n;try{n=JSON.parse(await(0,r.Xa)(`${s}//2004scape.org/api/v1/worldlist`))}catch(s){return await(0,r.Yo)(1e3),o(t,i,++e)}n.push({id:0,region:'Local Development',address:'http://localhost',portOffset:0,members:!0,hh:0});const h=n.find((t=>t.id===i));return h||o(t,i,10)}},7046:(t,i,e)=>{e.d(i,{A:()=>a});var s=e(1183),n=e(4583),r=e(9234),h=e(9091),o=e(2595),l=e(7854);class a{static getParameter(t){return new URLSearchParams(window.location.search).get(t)??''}static setParameter(t,i){const e=new URL(window.location.toString());e.searchParams.set(t,i),window.history.pushState(null,'',e.toString())}ja=0;za=[];Za=0;xo=null;state=0;qa=20;Ja=1;$a=[];Qa=0;tc=0;ic=[];ec=!0;sc=!1;nc=50;hasFocus=!0;rc=!1;hc=0;oc=0;kl=0;Dl=0;lc=0;ac=0;cc=0;fc=[];uc=[];dc=0;wc=0;input=null;yc=!1;Ac=!1;mc=!1;time=-1;_c=0;Ic=0;gc=0;Cc=0;Ec=0;vc=0;constructor(t=!1){l.bc.tabIndex=-1,l.zo.fillStyle='black',l.zo.fillRect(0,0,l.bc.width,l.bc.height),this.sc=t,this.sc?this.resize(window.innerWidth,window.innerHeight):this.resize(l.bc.width,l.bc.height)}get width(){return l.bc.width}get height(){return l.bc.height}resize=(t,i)=>{l.bc.width=t,l.bc.height=i,this.xo=new s.A(t,i),n.A.Tc()};Rc=async()=>{l.bc.addEventListener('resize',(()=>{this.sc&&this.resize(window.innerWidth,window.innerHeight)}),!1),l.bc.onmousedown=this.onmousedown,l.bc.onmouseup=this.onmouseup,l.bc.onmouseenter=this.onmouseenter,l.bc.onmouseleave=this.onmouseleave,l.bc.onmousemove=this.onmousemove,window.onbeforeunload=this.To,l.bc.onfocus=this.onfocus,l.bc.onblur=this.onblur,this.Oc?(l.bc.ontouchstart=this.ontouchstart,l.bc.ontouchend=this.ontouchend,l.bc.ontouchmove=this.ontouchmove):(l.bc.onkeydown=this.onkeydown,l.bc.onkeyup=this.onkeyup),l.bc.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.Oc&&'low'===a.getParameter('detail')&&(this.nc=30),await this.Go(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.$a[t]=performance.now();let t,i=0,e=256,s=1,n=0;for(;this.state>=0;){if(this.state>0&&(this.state--,0===this.state))return void this.Lc();const h=e,o=s;e=300,s=1,t=performance.now();const l=this.$a[i];if(0===l?(e=h,s=o):t>l&&(e=2560*this.qa/(t-l)|0),e<25?e=25:e>256&&(e=256,s=this.qa-(t-l)/10|0),this.$a[i]=t,i=(i+1)%10,s>1)for(let t=0;t<10;t++)0!==this.$a[t]&&(this.$a[t]+=s);for(s0&&(this.Qa=1e3*e/(256*this.qa)|0);const a=performance.now();if(this.ec&&this.refresh(),await this.draw(),this.ic[this.tc]=(performance.now()-a)/1e3,this.tc=(this.tc+1)%this.ic.length,this.nc<50){const i=1e3/this.nc-(performance.now()-t);i>0&&await(0,r.Yo)(i)}}-1===this.state&&this.Lc()};Lc=()=>{this.state=-2,this.To()};Zo=t=>{this.qa=1e3/t|0};Sc=t=>{this.nc=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.qa|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};To=()=>{};draw=async()=>{};refresh=()=>{};async Go(t,i){const e=this.width,s=this.height;this.ec&&(l.zo.fillStyle='black',l.zo.fillRect(0,0,e,s),this.ec=!1);const n=s/2-18;l.zo.fillStyle='rgb(140, 17, 17)',l.zo.rect((e/2|0)-152,n,304,34),l.zo.fillRect((e/2|0)-150,n+2,3*t,30),l.zo.fillStyle='black',l.zo.fillRect((e/2|0)-150+3*t,n+2,300-3*t,30),l.zo.font='bold 13px helvetica, sans-serif',l.zo.textAlign='center',l.zo.fillStyle='white',l.zo.fillText(i,e/2|0,n+22),await(0,r.Yo)(5)}xc=()=>{let t=-1;return this.wc!==this.dc&&(t=this.uc[this.dc],this.dc=this.dc+1&127),t};get ms(){const t=this.ic.length;let i=0;for(let e=0;ethis.ja&&(this.ja=e),this.za[this.Za]=e,this.Za=(this.Za+1)%250,e}get Mc(){return this.za.reduce(((t,i)=>t+i),0)/250}onkeydown=t=>{const i=t.key;h.p.includes(i)&&t.preventDefault(),this.hc=0;const e=h.L[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;t.ctrlKey&&(n>='A'.charCodeAt(0)&&n<=']'.charCodeAt(0)||n=='_'.charCodeAt(0)?n-='A'.charCodeAt(0)-1:n>='a'.charCodeAt(0)&&n<='z'.charCodeAt(0)&&(n-='a'.charCodeAt(0)-1)),n<30&&(n=0),s===h.L.ArrowLeft.code?n=1:s===h.L.ArrowRight.code?n=2:s===h.L.ArrowUp.code?n=3:s===h.L.ArrowDown.code?n=4:s===h.L.Control.code?n=5:s===h.L.Shift.code?n=6:s===h.L.Alt.code?n=7:s===h.L.Backspace.code||s===h.L.Delete.code?n=8:s===h.L.Tab.code?n=9:s===h.L.Enter.code?n=10:s>=h.L.F1.code&&s<=h.L.F12.code?n=s+1008-h.L.F1.code:s===h.L.Home.code?n=1e3:s===h.L.End.code?n=1001:s===h.L.PageUp.code?n=1002:s===h.L.PageDown.code&&(n=1003),n>0&&n<128&&(this.fc[n]=1),n>4&&(this.uc[this.wc]=n,this.wc=this.wc+1&127),o.A.enabled&&o.A.kc(n)};onkeyup=t=>{const i=t.key;h.p.includes(i)&&t.preventDefault(),this.hc=0;const e=h.L[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;n<30&&(n=0),s===h.L.ArrowLeft.code?n=1:s===h.L.ArrowRight.code?n=2:s===h.L.ArrowUp.code?n=3:s===h.L.ArrowDown.code?n=4:s===h.L.Control.code?n=5:s===h.L.Shift.code?n=6:s===h.L.Alt.code?n=7:s===h.L.Backspace.code||s===h.L.Delete.code?n=8:s===h.L.Tab.code?n=9:s===h.L.Enter.code?n=10:s>=h.L.F1.code&&s<=h.L.F12.code?n=s+1008-h.L.F1.code:s===h.L.Home.code?n=1e3:s===h.L.End.code?n=1001:s===h.L.PageUp.code?n=1002:s===h.L.PageDown.code&&(n=1003),n>0&&n<128&&(this.fc[n]=0),o.A.enabled&&o.A.Dc(n)};onmousedown=t=>{if(this.yc=!1,(t.clientX>0||t.clientY>0)&&this.Fc(t),this.hc=0,this.ac=this.kl,this.cc=this.Dl,this.Oc&&!this.Nc){if(this.Bc()||this.Uc()||this.Pc())return this.lc=1,void(this.oc=1);t.timeStamp>=this.time+500?(this.lc=2,this.oc=2):(this.lc=1,this.oc=1)}else 2===t.button?(this.lc=2,this.oc=2):(this.lc=1,this.oc=1);o.A.enabled&&o.A.Gc(this.ac,this.cc,t.buttons)};onmouseup=t=>{this.Fc(t),this.hc=0,this.oc=0,o.A.enabled&&o.A.Wc(t.buttons)};onmouseenter=t=>{this.Fc(t),o.A.enabled&&o.A.Yc()};onmouseleave=t=>{this.Fc(t),this.hc=0,this.kl=-1,this.Dl=-1,this.oc=0,this.ac=-1,this.cc=-1,o.A.enabled&&o.A.Hc()};onmousemove=t=>{this.Fc(t),this.hc=0,o.A.enabled&&o.A.Vc(this.kl,this.Dl)};onfocus=t=>{this.hasFocus=!0,this.ec=!0,this.refresh(),o.A.enabled&&o.A.Kc()};onblur=t=>{this.hasFocus=!1,o.A.enabled&&o.A.Xc()};ontouchstart=t=>{if(!this.Oc)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.yc=!0;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this._c=this.Ec=this.gc=0|i.screenX,this.Ic=this.vc=this.Cc=0|i.screenY,this.time=t.timeStamp,this.Ac=this.jc(),this.mc=this.zc()};ontouchend=t=>{if(!this.Oc||!this.yc)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;if(this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.Ec=0|i.screenX,this.vc=0|i.screenY,this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.Ac&&!this.jc())return void(this.yc=!1);if(this.mc&&!this.zc())return void(this.yc=!1);if(this.Bc()||this.Zc()||this.Uc()||this.Pc()){null!==this.input&&(this.input.parentNode?.contains(this.input)&&this.input.parentNode?.removeChild(this.input),this.input=null);const t=document.createElement('input');return this.Uc()?(t.setAttribute('id','username'),t.setAttribute('placeholder','Username')):this.Pc()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.Bc()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.Zc()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this.qc?t.setAttribute('type','password'):t.setAttribute('type',this.Pc()?'password':'text'),t.setAttribute('autofocus','autofocus'),t.setAttribute('spellcheck','false'),t.setAttribute('autocomplete','off'),t.setAttribute('style',`position: fixed; left: ${e}px; top: ${s}px; width: 1px; height: 1px; opacity: 0;`),document.body.appendChild(t),t.focus(),t.click(),this.qc&&(t.oninput=t=>{if(!(t instanceof InputEvent))return;const i=t,e=i.data;null!==e&&'insertText'===i.inputType&&this.onkeydown(new KeyboardEvent('keydown',{key:e,code:e}))}),t.onkeydown=t=>{this.qc&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this.qc&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeyup(new KeyboardEvent('keyup',{key:t.key,code:t.key}))},t.onfocus=t=>{this.input?.parentNode?.removeChild(this.input),this.input=null,this.onfocus(t)},this.input=t,void(this.yc=!1)}const n=t.timeStamp>=this.time+500,r=Math.abs(this._c-this.Ec)>16||Math.abs(this.Ic-this.vc)>16;n&&!r?(this.yc=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.oc=0,this.yc=!1)};ontouchmove=t=>{if(!this.Oc||!this.yc)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.Ec=0|i.screenX,this.vc=0|i.screenY,this.Ac&&-1===this.No()?(this.gc-this.Ec>0?this.rotate(2):this.gc-this.Ec<0&&this.rotate(0),this.Cc-this.vc>0?this.rotate(3):this.Cc-this.vc<0&&this.rotate(1)):(this.mc||-1!==this.No())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this.gc=this.Ec,this.Cc=this.vc};get Oc(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get qc(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get Nc(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}jc=()=>this.rc&&this.kl>=8&&this.kl<=520&&this.Dl>=11&&this.Dl<=345;Bc=()=>this.rc&&-1===this.Fo()&&!this.ko()&&!this.Do()&&this.kl>=11&&this.kl<=506&&this.Dl>=449&&this.Dl<=482;Zc=()=>this.rc&&(this.ko()||this.Do())&&this.kl>=11&&this.kl<=506&&this.Dl>=383&&this.Dl<=482;zc=()=>this.rc&&this.kl>=562&&this.kl<=752&&this.Dl>=231&&this.Dl<=492;Uc=()=>!this.rc&&2===this.Mo()&&this.kl>=301&&this.kl<=562&&this.Dl>=262&&this.Dl<=279;Pc=()=>!this.rc&&2===this.Mo()&&this.kl>=301&&this.kl<=562&&this.Dl>=279&&this.Dl<=296;rotate=t=>{0===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowLeft',code:'ArrowLeft'}))):1===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowUp',code:'ArrowUp'}))):2===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowRight',code:'ArrowRight'}))):3===t&&(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowDown',code:'ArrowDown'})))};Jc=()=>null!==document.fullscreenElement;Fc=t=>{if(this.Jc()){const i=t.target.getBoundingClientRect(),e=window.innerHeight/l.bc.height,s=(window.innerWidth-l.bc.width*e)/2;this.kl=0|this.$c(t.clientX-i.left-s,0,l.bc.width*e,0,789),this.Dl=0|this.$c(t.clientY-i.top,0,l.bc.height*e,0,532)}else{const i=l.bc.getBoundingClientRect(),e=l.bc.width/i.width,s=l.bc.height/i.height;this.kl=(t.clientX-i.left)*e|0,this.Dl=(t.clientY-i.top)*s|0}this.kl<0&&(this.kl=0),this.Dl<0&&(this.Dl=0),this.kl>789&&(this.kl=789),this.Dl>532&&(this.Dl=532)};$c=(t,i,e,s,n)=>(t-i)*(n-s)/(e-i)+s}},2595:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1069);class n{static enabled=!1;static Qc=null;static tf=null;static if=0;static ef=0;static sf=0;static nf=0;static rf=0;static hf=()=>{this.Qc=s.A.Ut(1),this.tf=null,this.if=performance.now(),this.enabled=!0};static lf=()=>{this.enabled=!1,this.Qc=null};static flush=()=>{let t=null;return this.tf&&this.enabled&&(t=this.tf),this.tf=null,t};static stop=()=>{let t=null;return this.Qc&&this.Qc.af>0&&this.enabled&&(t=this.Qc),this.lf(),t};static Gc=(t,i,e)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;this.ef++;const s=performance.now();let n=(s-this.if)/10|0;n>250&&(n=250),this.if=s,this.cf(5),1===e?this.Qc?.p1(1):this.Qc?.p1(2),this.Qc?.p1(n),this.Qc?.p3(t+(i<<10))};static Wc=t=>{if(!this.enabled)return;this.ef++;const i=performance.now();let e=(i-this.if)/10|0;e>250&&(e=250),this.if=i,this.cf(2),1===t?this.Qc?.p1(3):this.Qc?.p1(4),this.Qc?.p1(e)};static Vc=(t,i)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;const e=performance.now();if(e-this.sf>=50){this.sf=e,this.ef++;let s=(e-this.if)/10|0;s>250&&(s=250),this.if=e,t-this.nf<8&&t-this.nf>=-8&&i-this.rf<8&&i-this.rf>=-8?(this.cf(3),this.Qc?.p1(5),this.Qc?.p1(s),this.Qc?.p1(t+(i-this.rf+8<<4)+8-this.nf)):t-this.nf<128&&t-this.nf>=-128&&i-this.rf<128&&i-this.rf>=-128?(this.cf(4),this.Qc?.p1(6),this.Qc?.p1(s),this.Qc?.p1(t+128-this.nf),this.Qc?.p1(i+128-this.rf)):(this.cf(5),this.Qc?.p1(7),this.Qc?.p1(s),this.Qc?.p3(t+(i<<10))),this.nf=t,this.rf=i}};static kc=t=>{if(!this.enabled)return;this.ef++;const i=performance.now();let e=(i-this.if)/10|0;e>250&&(e=250),this.if=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.cf(3),this.Qc?.p1(8),this.Qc?.p1(e),this.Qc?.p1(t)};static Dc=t=>{if(!this.enabled)return;this.ef++;const i=performance.now();let e=(i-this.if)/10|0;e>250&&(e=250),this.if=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.cf(3),this.Qc?.p1(9),this.Qc?.p1(e),this.Qc?.p1(t)};static Kc=()=>{if(!this.enabled)return;this.ef++;const t=performance.now();let i=(t-this.if)/10|0;i>250&&(i=250),this.if=t,this.cf(2),this.Qc?.p1(10),this.Qc?.p1(i)};static Xc=()=>{if(!this.enabled)return;this.ef++;const t=performance.now();let i=(t-this.if)/10|0;i>250&&(i=250),this.if=t,this.cf(2),this.Qc?.p1(11),this.Qc?.p1(i)};static Yc=()=>{if(!this.enabled)return;this.ef++;const t=performance.now();let i=(t-this.if)/10|0;i>250&&(i=250),this.if=t,this.cf(2),this.Qc?.p1(12),this.Qc?.p1(i)};static Hc=()=>{if(!this.enabled)return;this.ef++;const t=performance.now();let i=(t-this.if)/10|0;i>250&&(i=250),this.if=t,this.cf(2),this.Qc?.p1(13),this.Qc?.p1(i)};static cf=t=>{if(this.Qc&&this.Qc.af+t>=500){const t=this.Qc;this.Qc=s.A.Ut(1),this.tf=t}}}},9091:(t,i,e)=>{e.d(i,{L:()=>s,p:()=>n});const s={'Backspace':{code:8,ch:8},'Enter':{code:10,ch:10},'Shift':{code:16,ch:65535},'Escape':{code:27,ch:27},'Tab':{code:9,ch:9},'CapsLock':{code:20,ch:65535},' ':{code:32,ch:32},'Control':{code:17,ch:65535},'Alt':{code:18,ch:65535},'Meta':{code:524,ch:65535},'ArrowLeft':{code:37,ch:65535},'ArrowRight':{code:39,ch:65535},'ArrowUp':{code:38,ch:65535},'ArrowDown':{code:40,ch:65535},'Insert':{code:155,ch:65535},'Home':{code:36,ch:65535},'PageUp':{code:33,ch:65535},'Delete':{code:127,ch:127},'End':{code:35,ch:65535},'PageDown':{code:34,ch:65535},'`':{code:192,ch:96},'~':{code:192,ch:126},'!':{code:49,ch:33},'@':{code:50,ch:64},'#':{code:51,ch:35},'$':{code:52,ch:36},'%':{code:53,ch:37},'^':{code:54,ch:94},'&':{code:55,ch:38},'*':{code:56,ch:42},'(':{code:57,ch:40},')':{code:48,ch:41},'-':{code:45,ch:45},'_':{code:45,ch:95},'=':{code:61,ch:61},'+':{code:61,ch:43},'[':{code:91,ch:91},'{':{code:91,ch:123},']':{code:93,ch:93},'}':{code:93,ch:125},'\\':{code:92,ch:92},'|':{code:92,ch:124},';':{code:59,ch:59},':':{code:59,ch:58},"'":{code:222,ch:39},'"':{code:222,ch:34},',':{code:44,ch:44},'<':{code:44,ch:60},'.':{code:46,ch:46},'>':{code:46,ch:62},'/':{code:47,ch:47},'?':{code:47,ch:63},'F1':{code:112,ch:65535},'F2':{code:113,ch:65535},'F3':{code:114,ch:65535},'F4':{code:115,ch:65535},'F5':{code:116,ch:65535},'F6':{code:117,ch:65535},'F7':{code:118,ch:65535},'F8':{code:119,ch:65535},'F9':{code:120,ch:65535},'F10':{code:121,ch:65535},'F11':{code:122,ch:65535},'F12':{code:123,ch:65535},0:{code:48,ch:48},1:{code:49,ch:49},2:{code:50,ch:50},3:{code:51,ch:51},4:{code:52,ch:52},5:{code:53,ch:53},6:{code:54,ch:54},7:{code:55,ch:55},8:{code:56,ch:56},9:{code:57,ch:57},'a':{code:65,ch:97},'b':{code:66,ch:98},'c':{code:67,ch:99},'d':{code:68,ch:100},'e':{code:69,ch:101},'f':{code:70,ch:102},'g':{code:71,ch:103},'h':{code:72,ch:104},'i':{code:73,ch:105},'j':{code:74,ch:106},'k':{code:75,ch:107},'l':{code:76,ch:108},'m':{code:77,ch:109},'n':{code:78,ch:110},'o':{code:79,ch:111},'p':{code:80,ch:112},'q':{code:81,ch:113},'r':{code:82,ch:114},'s':{code:83,ch:115},'t':{code:84,ch:116},'u':{code:85,ch:117},'v':{code:86,ch:118},'w':{code:87,ch:119},'x':{code:88,ch:120},'y':{code:89,ch:121},'z':{code:90,ch:122},'A':{code:65,ch:65},'B':{code:66,ch:66},'C':{code:67,ch:67},'D':{code:68,ch:68},'E':{code:69,ch:69},'F':{code:70,ch:70},'G':{code:71,ch:71},'H':{code:72,ch:72},'I':{code:73,ch:73},'J':{code:74,ch:74},'K':{code:75,ch:75},'L':{code:76,ch:76},'M':{code:77,ch:77},'N':{code:78,ch:78},'O':{code:79,ch:79},'P':{code:80,ch:80},'Q':{code:81,ch:81},'R':{code:82,ch:82},'S':{code:83,ch:83},'T':{code:84,ch:84},'U':{code:85,ch:85},'V':{code:86,ch:86},'W':{code:87,ch:87},'X':{code:88,ch:88},'Y':{code:89,ch:89},'Z':{code:90,ch:90}},n=['Tab','F1','F2','F3','F4','F5','F6','F7','F8','F9','F10','ArrowLeft','ArrowRight','ArrowUp','ArrowDown']},1120:(t,i,e)=>{e.d(i,{A:()=>c});var s=e(1069),n=e(8665),r=e(2679),h=e(2511),o=e(3819),l=e(3867),a=e(8950);class c{static Lo=[];static ff=null;static So=null;static El=0;static uf=1;static bl=2;static Yl=3;static Vl=4;static ia=5;static na=6;static ua=7;static df=1;static wf=2;static yf=3;static Af=4;static mf=5;static Zl=6;static ya=1;static Aa=100;static ma=101;static pa=200;static pf=201;static _f=202;static _a=203;static If=205;static gf=300;static Cf=301;static Ef=302;static vf=303;static bf=304;static Tf=305;static Rf=306;static Of=307;static Lf=308;static Sf=309;static xf=310;static Mf=311;static kf=312;static Df=313;static Ff=314;static Nf=315;static Bf=316;static Uf=317;static Pf=318;static Gf=319;static Wf=320;static Yf=321;static Hf=322;static Vf=323;static Da=324;static Fa=325;static Kf=326;static ba=327;static Ia=401;static ga=500;static Xf=501;static jf=502;static va=503;static Na=600;static zf=601;static Zf=602;static qf=603;static Jf=604;static $f=605;static Qf=606;static tu=607;static iu=608;static eu=609;static su=610;static nu=611;static ru=612;static Ba=613;static Ua=650;static Wa=651;static Ya=652;static Ha=653;static Va=654;static Pa=655;static hu=(t,i,e)=>{this.ff=new r.A(5e4),this.So=new r.A(5e4);const n=new s.A(t.read('data'));let h=-1;for(n.af+=2;n.af0){s.Jo=new Uint8Array(r),s.Qo=new Uint16Array(r);for(let t=0;t0){s.scripts=new l.fe(o,null);for(let t=0;t0){const n=e.lastIndexOf(',');s.Wl[t]=this.yu(i,e.substring(0,n),parseInt(e.substring(n+1),10))}}s.Au=new l.fe(5,null);for(let t=0;t<5;t++){const i=n.wu;s.Au[t]=i,0===i.length&&(s.Au[t]=null)}}if(s.type===c.Yl&&(s.fill=1===n.au),s.type===c.Vl||s.type===c.uf){s.Jl=1===n.au;const t=n.au;e&&(s.font=e[t]),s.Ql=1===n.au}if(s.type===c.Vl&&(s.text=n.wu,s.jl=n.wu),s.type!==c.uf&&s.type!==c.Yl&&s.type!==c.Vl||(s.Hl=n.Ko),s.type!==c.Yl&&s.type!==c.Vl||(s.Xl=n.Ko,s.Kl=n.Ko),s.type===c.ia){const t=n.wu;if(t.length>0){const e=t.lastIndexOf(',');s.sa=this.yu(i,t.substring(0,e),parseInt(t.substring(e+1),10))}const e=n.wu;if(e.length>0){const t=e.lastIndexOf(',');s.ea=this.yu(i,e.substring(0,t),parseInt(e.substring(t+1),10))}}if(s.type===c.na){const t=n.au;0!==t&&(s.model=this.la((t-1<<8)+n.au));const i=n.au;0!==i&&(s.mu=this.la((i-1<<8)+n.au)),s.al=n.au,0===s.al?s.al=-1:s.al=(s.al-1<<8)+n.au,s.cl=n.au,0===s.cl?s.cl=-1:s.cl=(s.cl-1<<8)+n.au,s.zoom=n.ou,s.oa=n.ou,s.fa=n.ou}if(s.type===c.ua){s.Ol=new Int32Array(s.width*s.height),s.Ll=new Int32Array(s.width*s.height),s.Jl=1===n.au;const t=n.au;e&&(s.font=e[t]),s.Ql=1===n.au,s.Hl=n.Ko,s.Sl=n.fu,s.xl=n.fu,s.uu=1===n.au,s.Au=new l.fe(5,null);for(let t=0;t<5;t++){const i=n.wu;s.Au[t]=i,0===i.length&&(s.Au[t]=null)}}s.zl!==c.wf&&s.type!==c.bl||(s.pu=n.wu,s.action=n.wu,s._u=n.ou),s.zl!==c.df&&s.zl!==c.Af&&s.zl!==c.mf&&s.zl!==c.Zl||(s.Iu=n.wu,0===s.Iu.length&&(s.zl===c.df?s.Iu='Ok':s.zl===c.Af||s.zl===c.mf?s.Iu='Select':s.zl===c.Zl&&(s.Iu='Continue')))}this.ff=null,this.So=null};static yu=(t,i,e)=>{const s=o.A.gu(i)<<8n|BigInt(e);if(this.ff){const t=this.ff.get(s);if(t)return t}let n;try{n=h.A.Cu(t,i,e),this.ff?.put(s,n)}catch(t){return null}return n};static la=t=>{if(this.So){const i=this.So.get(BigInt(t));if(i)return i}const i=n.A.model(t);return this.So?.put(BigInt(t),i),i};id=-1;lu=-1;type=-1;zl=-1;gl=0;width=0;height=0;cu=-1;Jo=null;Qo=null;scripts=null;scroll=0;hide=!1;draggable=!1;uu=!1;du=!1;Sl=0;xl=0;Tl=null;Rl=null;Wl=null;Au=null;fill=!1;Jl=!1;font=null;Ql=!1;text=null;jl=null;Hl=0;Xl=0;Kl=0;sa=null;ea=null;model=null;mu=null;al=-1;cl=-1;zoom=0;oa=0;fa=0;pu=null;action=null;_u=-1;Iu=null;ll=null;ml=null;pl=null;x=0;y=0;vl=0;Ol=null;Ll=null;ul=0;fl=0;la(t,i,e){let s=this.model;if(e&&(s=this.mu),!s)return null;if(-1===t&&-1===i&&!s.Eu)return s;const r=n.A.vu(s,!0,!0,!1);return-1===t&&-1===i||r.xa(),-1!==t&&r.Ma(t),-1!==i&&r.Ma(i),r.ka(64,768,-50,-10,-50,!0),r}bu(){if(this.lu===this.id)return this.x;let t=c.Lo[this.lu];if(!t.ll||!t.ml||!t.pl)return this.x;let i=t.ll.indexOf(this.id);if(-1===i)return this.x;let e=t.ml[i];for(;t.lu!==t.id;){const s=c.Lo[t.lu];s.ll&&s.ml&&s.pl&&(i=s.ll.indexOf(t.id),-1!==i&&(e+=s.ml[i])),t=s}return e}Tu(){if(this.lu===this.id)return this.y;let t=c.Lo[this.lu];if(!t.ll||!t.ml||!t.pl)return this.y;let i=t.ll.indexOf(this.id);if(-1===i)return this.y;let e=t.pl[i];for(;t.lu!==t.id;){const s=c.Lo[t.lu];s.ll&&s.ml&&s.pl&&(i=s.ll.indexOf(t.id),-1!==i&&(e+=s.pl[i])),t=s}return e}outline(t){const i=this.bu(),e=this.Tu();a.A._l(i,e,this.width,this.height,t)}move(t,i){if(this.lu===this.id)return;this.x=0,this.y=0;const e=c.Lo[this.lu];if(e.ll&&e.ml&&e.pl){const s=e.ll.indexOf(this.id);-1!==s&&(e.ml[s]=t,e.pl[s]=i)}}delete(){if(this.lu===this.id)return;const t=c.Lo[this.lu];if(t.ll&&t.ml&&t.pl){const i=t.ll.indexOf(this.id);-1!==i&&(t.ll.splice(i,1),t.ml.splice(i,1),t.pl.splice(i,1))}}}},6333:(t,i,e)=>{e.d(i,{$:()=>s});class s{id;Ru=null;constructor(t){this.id=t}Ou(t){for(;;){const i=t.au;if(0===i)break;this.decode(i,t)}return this}}},2164:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(6333);class r extends n.${static count=0;static Lo=[];static hu=t=>{const i=new s.A(t.read('flo.dat'));this.count=i.ou;for(let t=0;t(e>179&&(i=i/2|0),e>192&&(i=i/2|0),e>217&&(i=i/2|0),e>243&&(i=i/2|0),(t/4<<10)+(i/32<<7)+(e/2|0));static Su=(t,i)=>-1===t?12345678:((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);static xu=(t,i)=>-2===t?12345678:-1===t?(i<0?i=0:i>127&&(i=127),127-i):((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);Mu=0;texture=-1;ku=!1;Du=!0;Fu=0;Nu=0;Bu=0;Uu=0;Pu=0;Gu=0;decode(t,i){1===t?(this.Mu=i.Wu,this.setColor(this.Mu)):2===t?this.texture=i.au:3===t?this.ku=!0:5===t?this.Du=!1:6===t?this.Ru=i.wu:console.log('Error unrecognised config code: ',t)}setColor(t){const i=(t>>16&255)/256,e=(t>>8&255)/256,s=(255&t)/256;let n=i;ei&&(h=e),s>h&&(h=s);let o=0,l=0;const a=(n+h)/2;n!==h&&(a<.5&&(l=(h-n)/(h+n)),a>=.5&&(l=(h-n)/(2-h-n)),i===h?o=(e-s)/(h-n):e===h?o=(s-i)/(h-n)+2:s===h&&(o=(i-e)/(h-n)+4)),o/=6,this.Fu=256*o|0,this.Nu=256*l|0,this.Bu=256*a|0,this.Nu<0?this.Nu=0:this.Nu>255&&(this.Nu=255),this.Bu<0?this.Bu=0:this.Bu>255&&(this.Bu=255),this.Uu=a>.5?(1-a)*l*512|0:a*l*512|0,this.Uu<1&&(this.Uu=1),this.Pu=o*this.Uu|0;let c=this.Fu+(16*Math.random()|0)-8;c<0?c=0:c>255&&(c=255);let f=this.Nu+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255);let u=this.Bu+(48*Math.random()|0)-24;u<0?u=0:u>255&&(u=255),this.Gu=r.Lu(c,f,u)}}},8317:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(1069),n=e(6333),r=e(8665),h=e(3867);class o extends n.${static count=0;static Lo=[];static hu=t=>{const i=new s.A(t.read('idk.dat'));this.count=i.ou;for(let t=0;t=40&&t<50)this.Vu[t-40]=i.ou;else if(t>=50&&t<60)this.Ku[t-50]=i.ou;else{if(!(t>=60&&t<70))throw new Error(`Unrecognized idk config code: ${t}`);this.Hu[t-60]=i.ou}}la(){if(!this.Yu)return null;const t=new h.fe(this.Yu.length,null);for(let i=0;i{e.d(i,{A:()=>c});var s=e(6333),n=e(1069),r=e(2679),h=e(8665),o=e(1023),l=e(6169),a=e(3867);class c extends s.${static count=0;static cache=null;static ju=null;static zu=null;static Zu=0;static qu=new r.A(500);static Ju=new r.A(30);static hu=t=>{this.ju=new n.A(t.read('loc.dat'));const i=new n.A(t.read('loc.idx'));this.count=i.ou,this.zu=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.zu||!this.ju)throw new Error('LocType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Zu=(this.Zu+1)%10;const i=this.cache[this.Zu];return this.ju.af=this.zu[t],i.id=t,i.reset(),i.Ou(this.ju),i.$u||(i.$u=new Int32Array(1)),-1===i.Qu&&i.$u&&(i.active=i.$u.length>0&&i.$u[0]===o.A.td.id,i.ed&&(i.active=!0)),i};static To=()=>{this.qu=null,this.Ju=null,this.zu=null,this.cache=null,this.ju=null};Yu=null;$u=null;name=null;sd=null;Vu=null;Ku=null;width=1;length=1;nd=!0;rd=!0;active=!1;Qu=-1;hd=!1;od=!1;Du=!1;al=-1;ld=!1;ad=16;fd=0;ud=0;ed=null;dd=-1;wd=-1;yd=!1;Ad=!0;md=128;pd=128;_d=128;Id=0;gd=0;Cd=0;Ed=0;vd=!1;decode(t,i){if(1===t){const t=i.au;this.Yu=new Int32Array(t),this.$u=new Int32Array(t);for(let e=0;e=30&&t<39)this.ed||(this.ed=new a.fe(5,null)),this.ed[t-30]=i.wu,'hidden'===this.ed[t-30]?.toLowerCase()&&(this.ed[t-30]=null);else if(40===t){const t=i.au;this.Vu=new Uint16Array(t),this.Ku=new Uint16Array(t);for(let e=0;e=this.Yu.length)return null;let d=this.Yu[a];if(-1===d)return null;const w=this.yd!==i>3;w&&(d+=65536);let y=c.qu?.get(BigInt(d));y||(y=h.A.model(65535&d),w&&y.Md(),c.qu?.put(BigInt(d),y));const A=128!==this.md||128!==this.pd||128!==this._d,m=0!==this.gd||0!==this.Cd||0!==this.Ed;let p=h.A.vu(y,!this.Vu,!this.ld,i===l.A.kd&&-1===o&&!A&&!m);for(-1!==o&&(p.xa(),p.Ma(o),p.Dd=null,p.Fd=null);i-- >0;)p.Nd();if(this.Vu&&this.Ku)for(let t=0;t{e.d(i,{A:()=>l});var s=e(6333),n=e(1069),r=e(2679),h=e(8665),o=e(3867);class l extends s.${static count=0;static cache=null;static ju=null;static zu=null;static Zu=0;static So=new r.A(30);static hu=t=>{this.ju=new n.A(t.read('npc.dat'));const i=new n.A(t.read('npc.idx'));this.count=i.ou,this.zu=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.zu||!this.ju)throw new Error('NpcType not loaded!!!');for(let i=0;i<20;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Zu=(this.Zu+1)%20;const i=this.cache[this.Zu]=new l(t);return this.ju.af=this.zu[t],i.Ou(this.ju),i};static To=()=>{this.So=null,this.zu=null,this.cache=null,this.ju=null};name=null;sd=null;size=1;Yu=null;Hu=null;ld=!1;Pd=-1;Gd=-1;Wd=-1;Yd=-1;Hd=-1;Vu=null;Ku=null;ed=null;md=-1;pd=-1;_d=-1;Vd=!0;Kd=-1;Xd=128;jd=128;decode(t,i){if(1===t){const t=i.au;this.Yu=new Uint16Array(t);for(let e=0;e=30&&t<40)this.ed||(this.ed=new o.fe(5,null)),this.ed[t-30]=i.wu,'hidden'===this.ed[t-30]?.toLowerCase()&&(this.ed[t-30]=null);else if(40===t){const t=i.au;this.Vu=new Uint16Array(t),this.Ku=new Uint16Array(t);for(let e=0;e{e.d(i,{A:()=>u});var s=e(6333),n=e(1069),r=e(2511),h=e(2679),o=e(8665),l=e(4583),a=e(8950),c=e(9298),f=e(3867);class u extends s.${static count=0;static cache=null;static ju=null;static zu=null;static Zu=0;static Qd=!0;static So=new h.A(50);static tw=new h.A(200);static hu=(t,i)=>{this.Qd=i,this.ju=new n.A(t.read('obj.dat'));const e=new n.A(t.read('obj.idx'));this.count=e.ou,this.zu=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.zu||!this.ju)throw new Error('ObjType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Zu=(this.Zu+1)%10;const i=this.cache[this.Zu];return this.ju.af=this.zu[t],i.id=t,i.reset(),i.Ou(this.ju),-1!==i.iw&&i.ew(),!this.Qd&&i.members&&(i.name='Members Object',i.sd="Login to a members' server to use this object.",i.ed=null,i.sw=null),i};static To=()=>{this.So=null,this.tw=null,this.zu=null,this.cache=null,this.ju=null};static Ml=(t,i)=>{if(u.tw){let e=u.tw.get(BigInt(t));if(e&&e.nw!==i&&-1!==e.nw&&(e.rw(),e=null),e)return e}let e=u.get(t);if(e.hw||(i=-1),e.hw&&e.ow&&i>1){let t=-1;for(let s=0;s<10;s++)i>=e.ow[s]&&0!==e.ow[s]&&(t=e.hw[s]);-1!==t&&(e=u.get(t))}const s=new r.A(32,32),n=l.A.ra,h=l.A.ha,o=l.A.lw,f=a.A.aw,d=a.A.cw,w=a.A.fw,y=a.A.left,A=a.A.right,m=a.A.top,p=a.A.bottom;l.A.uw=!1,a.A.bind(s.aw,32,32),a.A.fillRect(0,0,32,32,c.A.Pl),l.A.Tc();const _=e.dw(1),I=l.A.sin[e.ww]*e.yw>>16,g=l.A.cos[e.ww]*e.yw>>16;_.ca(0,e.Aw,e.mw,e.ww,e.pw,I+(_.Ud/2|0)+e._w,g+e._w);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.aw[t+32*i]&&(t>0&&s.aw[t+32*i-1]>1||i>0&&s.aw[t+32*(i-1)]>1||t<31&&s.aw[t+32*i+1]>1||i<31&&s.aw[t+32*(i+1)]>1)&&(s.aw[t+32*i]=1);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.aw[t+32*i]&&t>0&&i>0&&s.aw[t+32*(i-1)-1]>0&&(s.aw[t+32*i]=3153952);if(-1!==e.iw){const t=this.Ml(e.Iw,10),i=t.Nl,s=t.nw;t.Nl=32,t.nw=32,t.gw(5,5,22,22),t.Nl=i,t.nw=s}return u.tw?.put(BigInt(t),s),a.A.bind(f,d,w),a.A.Al(y,m,A,p),l.A.ra=n,l.A.ha=h,l.A.lw=o,l.A.uw=!0,e.da?s.Nl=33:s.Nl=32,s.nw=i,s};model=0;name=null;sd=null;Vu=null;Ku=null;yw=2e3;ww=0;Aw=0;mw=0;pw=0;_w=0;Cw=!1;Ew=-1;da=!1;bw=1;members=!1;ed=null;sw=null;Tw=-1;Rw=-1;Ow=0;Lw=-1;Sw=-1;xw=0;Mw=-1;kw=-1;Dw=-1;Fw=-1;Nw=-1;Bw=-1;hw=null;ow=null;Iw=-1;iw=-1;decode(t,i){if(1===t)this.model=i.ou;else if(2===t)this.name=i.wu;else if(3===t)this.sd=i.wu;else if(4===t)this.yw=i.ou;else if(5===t)this.ww=i.ou;else if(6===t)this.Aw=i.ou;else if(7===t)this.pw=i.fu,this.pw>32767&&(this.pw-=65536);else if(8===t)this._w=i.fu,this._w>32767&&(this._w-=65536);else if(9===t)this.Cw=!0;else if(10===t)this.Ew=i.ou;else if(11===t)this.da=!0;else if(12===t)this.bw=i.Ko;else if(16===t)this.members=!0;else if(23===t)this.Tw=i.ou,this.Ow=i.bd;else if(24===t)this.Rw=i.ou;else if(25===t)this.Lw=i.ou,this.xw=i.bd;else if(26===t)this.Sw=i.ou;else if(t>=30&&t<35)this.ed||(this.ed=new f.fe(5,null)),this.ed[t-30]=i.wu,'hidden'===this.ed[t-30]?.toLowerCase()&&(this.ed[t-30]=null);else if(t>=35&&t<40)this.sw||(this.sw=new f.fe(5,null)),this.sw[t-35]=i.wu;else if(40===t){const t=i.au;this.Vu=new Uint16Array(t),this.Ku=new Uint16Array(t);for(let e=0;e=100&&t<110&&(this.hw&&this.ow||(this.hw=new Uint16Array(10),this.ow=new Uint16Array(10)),this.hw[t-100]=i.ou,this.ow[t-100]=i.ou)}Uw(t){let i=this.Tw;if(1===t&&(i=this.Lw),-1===i)return null;let e=this.Rw,s=this.Mw;1===t&&(e=this.Sw,s=this.kw);let n=o.A.model(i);if(-1!==e){const t=o.A.model(e);if(-1===s){const i=[n,t];n=o.A.Ta(i,2)}else{const i=[n,t,o.A.model(s)];n=o.A.Ta(i,3)}}if(0===t&&0!==this.Ow&&n.translate(this.Ow,0,0),1===t&&0!==this.xw&&n.translate(this.xw,0,0),this.Vu&&this.Ku)for(let t=0;t1){let i=-1;for(let e=0;e<10;e++)t>=this.ow[e]&&0!==this.ow[e]&&(i=this.hw[e]);if(-1!==i)return u.get(i).dw(1)}if(u.So){const t=u.So.get(BigInt(this.id));if(t)return t}const i=o.A.model(this.model);if(this.Vu&&this.Ku)for(let t=0;t{e.d(i,{A:()=>h});var s=e(6333),n=e(1069),r=e(6730);class h extends s.${static count=0;static Lo=[];static hu=t=>{const i=new n.A(t.read('seq.dat'));this.count=i.ou;for(let t=0;t{e.d(i,{A:()=>l});var s=e(6333),n=e(1069),r=e(1312),h=e(8665),o=e(2679);class l extends s.${static count=0;static Lo=[];static So=new o.A(30);static hu=t=>{const i=new n.A(t.read('spotanim.dat'));this.count=i.ou;for(let t=0;t=40&&t<50)this.Vu[t-40]=i.ou;else{if(!(t>=50&&t<60))throw new Error(`Unrecognized spotanim config code: ${t}`);this.Ku[t-50]=i.ou}}la(){let t=l.So?.get(BigInt(this.id));if(t)return t;t=h.A.model(this.model);for(let i=0;i<6;i++)0!==this.Vu[0]&&t.Ra(this.Vu[i],this.Ku[i]);return l.So?.put(BigInt(this.id),t),t}}},3764:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(6333),n=e(1069);class r extends s.${static count=0;static Lo=[];static Kw=[];static Xw=0;static hu=t=>{const i=new n.A(t.read('varp.dat'));this.count=i.ou;for(let t=0;t{e.d(i,{A:()=>s});class s{static OPEN=0;static $w=1;static Qw=2;static ty=4;static iy=8;static ey=s.$w<<4;static sy=s.Qw<<4;static ny=s.ty<<4;static hy=s.iy<<4;static oy=256;static ly=512;static uy=1024;static wy=2048;static yy=4096;static Ay=s.ly<<4;static my=s.uy<<4;static py=s.wy<<4;static _y=s.yy<<4;static Iy=s.oy<<9;static gy=524288;static Cy=2097152;static Ey=s.Cy|s.gy;static vy=s.oy|s.Ey;static by=s.Qw|s.vy;static Ty=s.iy|s.vy;static Ry=s.Qw|s.ty|s.Ty;static Oy=s.sy|s.vy;static Ly=s.iy|s.ey|s.Oy;static Sy=s.hy|s.vy;static xy=s.$w|s.Qw|s.Sy;static My=s.sy|s.ny|s.Sy;static ky=16777215}},670:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(9456),n=e(6169),r=e(1023),h=e(4909);class o{static Dr=4;static jr=104;static index=(t,i)=>t*o.jr+i;offsetX;Dy;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.Dy=0,this.sizeX=o.jr,this.sizeZ=o.jr,this.flags=new Int32Array(this.sizeX*this.sizeZ),this.reset()}reset=()=>{for(let t=0;t{this.flags[o.index(t-this.offsetX,i-this.Dy)]|=s.A.Cy};Ny=(t,i)=>{this.flags[o.index(t-this.offsetX,i-this.Dy)]&=~s.A.Cy};By=(t,i,e,r,h,o)=>{let l=s.A.oy;o&&(l|=s.A.Iy);const a=t-this.offsetX,c=i-this.Dy;if(h===n.A.Uy||h===n.A.Py){const t=e;e=r,r=t}for(let t=a;t=0&&t=0&&i{let l=s.A.oy;o&&(l|=s.A.Iy);const a=t-this.offsetX,c=i-this.Dy;if(h===n.A.Uy||h===n.A.Py){const t=e;e=r,r=t}for(let t=a;t=0&&t=0&&i{const l=t-this.offsetX,a=i-this.Dy,c=o?s.A._y:s.A.hy,f=o?s.A.yy:s.A.iy,u=o?s.A.uy:s.A.Qw,d=o?s.A.my:s.A.sy,w=o?s.A.ly:s.A.$w,y=o?s.A.Ay:s.A.ey,A=o?s.A.wy:s.A.ty,m=o?s.A.py:s.A.ny;e===r.A.Yy.id?h===n.A.kd?(this.add(l,a,c),this.add(l-1,a,f)):h===n.A.Uy?(this.add(l,a,u),this.add(l,a+1,d)):h===n.A.Hy?(this.add(l,a,f),this.add(l+1,a,c)):h===n.A.Py&&(this.add(l,a,d),this.add(l,a-1,u)):e===r.A.Vy.id||e===r.A.Ky.id?h===n.A.kd?(this.add(l,a,w),this.add(l-1,a+1,y)):h===n.A.Uy?(this.add(l,a,A),this.add(l+1,a+1,m)):h===n.A.Hy?(this.add(l,a,y),this.add(l+1,a-1,w)):h===n.A.Py&&(this.add(l,a,m),this.add(l-1,a-1,A)):e===r.A.Xy.id&&(h===n.A.kd?(this.add(l,a,u|c),this.add(l-1,a,f),this.add(l,a+1,d)):h===n.A.Uy?(this.add(l,a,u|f),this.add(l,a+1,d),this.add(l+1,a,c)):h===n.A.Hy?(this.add(l,a,d|f),this.add(l+1,a,c),this.add(l,a-1,u)):h===n.A.Py&&(this.add(l,a,d|c),this.add(l,a-1,u),this.add(l-1,a,f))),o&&this.Wy(t,i,e,h,!1)};jy=(t,i,e,h,o)=>{const l=t-this.offsetX,a=i-this.Dy,c=o?s.A._y:s.A.hy,f=o?s.A.yy:s.A.iy,u=o?s.A.uy:s.A.Qw,d=o?s.A.my:s.A.sy,w=o?s.A.ly:s.A.$w,y=o?s.A.Ay:s.A.ey,A=o?s.A.wy:s.A.ty,m=o?s.A.py:s.A.ny;e===r.A.Yy.id?h===n.A.kd?(this.remove(l,a,c),this.remove(l-1,a,f)):h===n.A.Uy?(this.remove(l,a,u),this.remove(l,a+1,d)):h===n.A.Hy?(this.remove(l,a,f),this.remove(l+1,a,c)):h===n.A.Py&&(this.remove(l,a,d),this.remove(l,a-1,u)):e===r.A.Vy.id||e===r.A.Ky.id?h===n.A.kd?(this.remove(l,a,w),this.remove(l-1,a+1,y)):h===n.A.Uy?(this.remove(l,a,A),this.remove(l+1,a+1,m)):h===n.A.Hy?(this.remove(l,a,y),this.remove(l+1,a-1,w)):h===n.A.Py&&(this.remove(l,a,m),this.remove(l-1,a-1,A)):e===r.A.Xy.id&&(h===n.A.kd?(this.remove(l,a,u|c),this.remove(l-1,a,f),this.remove(l,a+1,d)):h===n.A.Uy?(this.remove(l,a,u|f),this.remove(l,a+1,d),this.remove(l+1,a,c)):h===n.A.Hy?(this.remove(l,a,d|f),this.remove(l+1,a,c),this.remove(l,a-1,u)):h===n.A.Py&&(this.remove(l,a,d|c),this.remove(l,a-1,u),this.remove(l-1,a,f))),o&&this.jy(t,i,e,h,!1)};zy=(t,i,e,h,l,a)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.Dy,u=e-this.offsetX,d=h-this.Dy,w=o.index(c,f);if(l===r.A.Yy.id){if(a===n.A.kd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Oy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.by)===s.A.OPEN)return!0}else if(a===n.A.Uy){if(c===u&&f===d+1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Ty)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Sy)===s.A.OPEN)return!0}else if(a===n.A.Hy){if(c===u+1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Oy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.by)===s.A.OPEN)return!0}else if(a===n.A.Py){if(c===u&&f===d-1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Ty)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Sy)===s.A.OPEN)return!0}}else if(l===r.A.Xy.id){if(a===n.A.kd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Sy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.by)===s.A.OPEN)return!0}else if(a===n.A.Uy){if(c===u-1&&f===d&&(this.flags[w]&s.A.Ty)===s.A.OPEN)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.by)===s.A.OPEN)return!0}else if(a===n.A.Hy){if(c===u-1&&f===d&&(this.flags[w]&s.A.Ty)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Oy)===s.A.OPEN)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1)return!0}else if(a===n.A.Py){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Oy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Sy)===s.A.OPEN)return!0;if(c===u&&f===d-1)return!0}}else if(l===r.A.Zy.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.sy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Qw)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.iy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.hy)===s.A.OPEN)return!0}return!1};qy=(t,i,e,h,l,a)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.Dy,u=e-this.offsetX,d=h-this.Dy,w=o.index(c,f);if(l===r.A.Jy.id||l===r.A.$y.id){if(l===r.A.$y.id&&(a=a+2&3),a===n.A.kd){if(c===u+1&&f===d&&(this.flags[w]&s.A.hy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Qw)===s.A.OPEN)return!0}else if(a===n.A.Uy){if(c===u-1&&f===d&&(this.flags[w]&s.A.iy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Qw)===s.A.OPEN)return!0}else if(a===n.A.Hy){if(c===u-1&&f===d&&(this.flags[w]&s.A.iy)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.sy)===s.A.OPEN)return!0}else if(a===n.A.Py){if(c===u+1&&f===d&&(this.flags[w]&s.A.hy)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.sy)===s.A.OPEN)return!0}}else if(l===r.A.Qy.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.sy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Qw)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.iy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.hy)===s.A.OPEN)return!0}return!1};tA=(t,i,e,n,r,l,a)=>{const c=e+r-1,f=n+l-1,u=o.index(t-this.offsetX,i-this.Dy);return t>=e&&t<=c&&i>=n&&i<=f||(t===e-1&&i>=n&&i<=f&&(this.flags[u]&s.A.iy)===s.A.OPEN&&(a&h.A.kd)===s.A.OPEN||(t===c+1&&i>=n&&i<=f&&(this.flags[u]&s.A.hy)===s.A.OPEN&&(a&h.A.Hy)===s.A.OPEN||(i===n-1&&t>=e&&t<=c&&(this.flags[u]&s.A.Qw)===s.A.OPEN&&(a&h.A.Py)===s.A.OPEN||i===f+1&&t>=e&&t<=c&&(this.flags[u]&s.A.sy)===s.A.OPEN&&(a&h.A.Uy)===s.A.OPEN)))};add=(t,i,e)=>{this.flags[o.index(t,i)]|=e};remove=(t,i,e)=>{this.flags[o.index(t,i)]&=s.A.ky-e}}},4909:(t,i,e)=>{e.d(i,{A:()=>s});class s{static Uy=1;static Hy=2;static Py=4;static kd=8}},6169:(t,i,e)=>{e.d(i,{A:()=>s});class s{static kd=0;static Uy=1;static Hy=2;static Py=3}},5599:(t,i,e)=>{e.d(i,{A:()=>s});class s{static iA=0;static eA=1;static sA=2;static nA=3}},1023:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5599);class n{static Yy=new n(0,s.A.iA);static Vy=new n(1,s.A.iA);static Xy=new n(2,s.A.iA);static Ky=new n(3,s.A.iA);static rA=new n(4,s.A.eA);static hA=new n(5,s.A.eA);static Jy=new n(6,s.A.eA);static $y=new n(7,s.A.eA);static Qy=new n(8,s.A.eA);static Zy=new n(9,s.A.sA);static td=new n(10,s.A.sA);static oA=new n(11,s.A.sA);static lA=new n(12,s.A.sA);static aA=new n(13,s.A.sA);static cA=new n(14,s.A.sA);static fA=new n(15,s.A.sA);static uA=new n(16,s.A.sA);static dA=new n(17,s.A.sA);static wA=new n(18,s.A.sA);static yA=new n(19,s.A.sA);static AA=new n(20,s.A.sA);static mA=new n(21,s.A.sA);static nA=new n(22,s.A.nA);static values(){return[this.Yy,this.Vy,this.dA,this.fA,this.Xy,this.cA,this.Zy,this.Ky,this.nA,this.lA,this.oA,this.Jy,this.AA,this.td,this.hA,this.aA,this.$y,this.rA,this.uA,this.Qy,this.yA,this.mA,this.wA]}static of(t){const i=this.values();for(let e=0;e{e.d(i,{A:()=>A});var s=e(670),n=e(2164),r=e(1069),h=e(4583),o=e(3045),l=e(5637),a=e(4197),c=e(1312),f=e(1023),u=e(6169),d=e(9298),w=e(5518),y=e(3867);class A{static pA=Int8Array.of(1,2,4,8);static _A=Uint8Array.of(16,32,64,128);static IA=Int8Array.of(1,0,-1,0);static gA=Int8Array.of(0,-1,0,1);static CA=(17*Math.random()|0)-8;static EA=(33*Math.random()|0)-16;static et=!0;static vA=0;static bA=!1;static TA=(t,i)=>{let e=this.RA(t+45365,i+91923,4)+(this.RA(t+10294,i+37821,2)-128>>1)+(this.RA(t,i,1)-128>>2)-128;return e=35+(.3*e|0),e<10?e=10:e>60&&(e=60),e};static RA=(t,i,e)=>{const s=t/e|0,n=t&e-1,r=i/e|0,h=i&e-1,o=this.OA(s,r),l=this.OA(s+1,r),a=this.OA(s,r+1),c=this.OA(s+1,r+1),f=this.LA(o,l,n,e),u=this.LA(a,c,n,e);return this.LA(f,u,h,e)};static LA=(t,i,e,s)=>{const n=65536-h.A.cos[1024*e/s|0]>>1;return(t*(65536-n)>>16)+(i*n>>16)};static OA=(t,i)=>((this.SA(t-1,i-1)+this.SA(t+1,i-1)+this.SA(t-1,i+1)+this.SA(t+1,i+1))/16|0)+((this.SA(t-1,i)+this.SA(t+1,i)+this.SA(t,i-1)+this.SA(t,i+1))/8|0)+(this.SA(t,i)/4|0);static SA=(t,i)=>{const e=t+57*i,s=BigInt(e<<13^e);return 255&Number((s*(s*s*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static By=(t,i,e,s,n,r,h,o,d,w,y)=>{const m=n[y][i][e],p=n[y][i+1][e],_=n[y][i+1][e+1],I=n[y][i][e+1],g=m+p+_+I>>2,C=l.A.get(o);let E=i+(e<<7)+(o<<14)+1073741824|0;C.active||(E+=-2147483648),E|=0;const v=(w<<6)+d<<24>>24;if(d===f.A.nA.id)s?.xA(C.la(f.A.nA.id,w,m,p,_,I,-1),t,i,e,g,E,v),C.nd&&C.active&&h?.Fy(i,e),-1!==C.al&&r.MA(new a.A(o,t,3,i,e,c.A.Lo[C.al],!0));else if(d===f.A.td.id||d===f.A.oA.id){const n=C.la(f.A.td.id,w,m,p,_,I,-1);if(n){let r,h,o=0;d===f.A.oA.id&&(o+=256),w===u.A.Uy||w===u.A.Py?(r=C.length,h=C.width):(r=C.width,h=C.length),s?.By(t,i,e,g,n,null,E,v,r,h,o)}C.nd&&h?.By(i,e,C.width,C.length,w,C.rd),-1!==C.al&&r.MA(new a.A(o,t,2,i,e,c.A.Lo[C.al],!0))}else if(d>=f.A.lA.id)s?.By(t,i,e,g,C.la(d,w,m,p,_,I,-1),null,E,v,1,1,0),C.nd&&h?.By(i,e,C.width,C.length,w,C.rd),-1!==C.al&&r.MA(new a.A(o,t,2,i,e,c.A.Lo[C.al],!0));else if(d===f.A.Yy.id)s?.Wy(t,i,e,g,A.pA[w],0,C.la(f.A.Yy.id,w,m,p,_,I,-1),null,E,v),C.nd&&h?.Wy(i,e,d,w,C.rd),-1!==C.al&&r.MA(new a.A(o,t,0,i,e,c.A.Lo[C.al],!0));else if(d===f.A.Vy.id)s?.Wy(t,i,e,g,A._A[w],0,C.la(f.A.Vy.id,w,m,p,_,I,-1),null,E,v),C.nd&&h?.Wy(i,e,d,w,C.rd),-1!==C.al&&r.MA(new a.A(o,t,0,i,e,c.A.Lo[C.al],!0));else if(d===f.A.Xy.id){const n=w+1&3;s?.Wy(t,i,e,g,A.pA[w],A.pA[n],C.la(f.A.Xy.id,w+4,m,p,_,I,-1),C.la(f.A.Xy.id,n,m,p,_,I,-1),E,v),C.nd&&h?.Wy(i,e,d,w,C.rd),-1!==C.al&&r.MA(new a.A(o,t,0,i,e,c.A.Lo[C.al],!0))}else if(d===f.A.Ky.id)s?.Wy(t,i,e,g,A._A[w],0,C.la(f.A.Ky.id,w,m,p,_,I,-1),null,E,v),C.nd&&h?.Wy(i,e,d,w,C.rd),-1!==C.al&&r.MA(new a.A(o,t,0,i,e,c.A.Lo[C.al],!0));else if(d===f.A.Zy.id)s?.By(t,i,e,g,C.la(d,w,m,p,_,I,-1),null,E,v,1,1,0),C.nd&&h?.By(i,e,C.width,C.length,w,C.rd),-1!==C.al&&r.MA(new a.A(o,t,2,i,e,c.A.Lo[C.al],!0));else if(d===f.A.rA.id)s?.kA(t,i,e,g,0,0,E,C.la(f.A.rA.id,u.A.kd,m,p,_,I,-1),v,512*w,A.pA[w]),-1!==C.al&&r.MA(new a.A(o,t,1,i,e,c.A.Lo[C.al],!0));else if(d===f.A.hA.id){let n=16;if(s){const r=s.DA(t,i,e);r>0&&(n=l.A.get(r>>14&32767).ad)}s?.kA(t,i,e,g,A.IA[w]*n,A.gA[w]*n,E,C.la(f.A.rA.id,u.A.kd,m,p,_,I,-1),v,512*w,A.pA[w]),-1!==C.al&&r.MA(new a.A(o,t,1,i,e,c.A.Lo[C.al],!0))}else d===f.A.Jy.id?(s?.kA(t,i,e,g,0,0,E,C.la(f.A.rA.id,u.A.kd,m,p,_,I,-1),v,w,256),-1!==C.al&&r.MA(new a.A(o,t,1,i,e,c.A.Lo[C.al],!0))):d===f.A.$y.id?(s?.kA(t,i,e,g,0,0,E,C.la(f.A.rA.id,u.A.kd,m,p,_,I,-1),v,w,512),-1!==C.al&&r.MA(new a.A(o,t,1,i,e,c.A.Lo[C.al],!0))):d===f.A.Qy.id&&(s?.kA(t,i,e,g,0,0,E,C.la(f.A.rA.id,u.A.kd,m,p,_,I,-1),v,w,768),-1!==C.al&&r.MA(new a.A(o,t,1,i,e,c.A.Lo[C.al],!0)))};FA;NA;Hr;Vr;BA;UA;PA;GA;WA;YA;HA;VA;KA;XA;jA;zA;constructor(t,i,e,n){this.FA=t,this.NA=i,this.Hr=e,this.Vr=n,this.BA=new y.ZA(s.A.Dr,t,i),this.UA=new y.ZA(s.A.Dr,t,i),this.PA=new y.ZA(s.A.Dr,t,i),this.GA=new y.ZA(s.A.Dr,t,i),this.zA=new y.qA(s.A.Dr,t+1,i+1),this.WA=new y.ZA(s.A.Dr,t+1,i+1),this.YA=new y.Xr(t+1,i+1),this.HA=new Int32Array(i),this.VA=new Int32Array(i),this.KA=new Int32Array(i),this.XA=new Int32Array(i),this.jA=new Int32Array(i)}JA=(t,i)=>{for(let t=0;t=0&&i[s]?.Fy(e,n)}A.CA+=(5*Math.random()|0)-2,A.CA<-8?A.CA=-8:A.CA>8&&(A.CA=8),A.EA+=(5*Math.random()|0)-2,A.EA<-16?A.EA=-16:A.EA>16&&(A.EA=16);for(let i=0;i>8;for(let t=1;t>2)+(e[n+1][t]>>3)+(e[n][t-1]>>2)+(e[n][t+1]>>3)+(e[n][t]>>1);this.YA[n][t]=u-d}for(let t=0;t=0&&s0){const i=n.A.Lo[e-1];this.HA[t]+=i.Pu,this.VA[t]+=i.Nu,this.KA[t]+=i.Bu,this.XA[t]+=i.Uu,r=this.jA[t]++}}const h=e-5;if(h>=0&&h0){const i=n.A.Lo[e-1];this.HA[t]-=i.Pu,this.VA[t]-=i.Nu,this.KA[t]-=i.Bu,this.XA[t]-=i.Uu,r=this.jA[t]--}}}if(e>=1&&e=0&&f=0&&y=1&&c0||y>0){const m=this.Hr[i][e][c],p=this.Hr[i][e+1][c],_=this.Hr[i][e+1][c+1],I=this.Hr[i][e][c+1],g=this.YA[e][c],C=this.YA[e+1][c],E=this.YA[e+1][c+1],v=this.YA[e][c+1];let b=-1,T=-1;if(f>0){const t=256*s/l|0,i=r/a|0;let e=o/a|0;b=n.A.Lu(t,i,e);const h=t+A.CA&255;e+=A.EA,e<0?e=0:e>255&&(e=255),T=n.A.Lu(h,i,e)}if(i>0){let t=0!==f||this.PA[i][e][c]===w.A.QA;y>0&&!n.A.Lo[y-1].Du&&(t=!1),t&&m===p&&m===_&&m===I&&(this.zA[i][e][c]|=2340)}let R=0;if(-1!==b&&(R=h.A.palette[n.A.Su(T,96)]),0===y)t?.tm(i,e,c,w.A.QA,u.A.kd,-1,m,p,_,I,n.A.Su(b,g),n.A.Su(b,C),n.A.Su(b,E),n.A.Su(b,v),d.A.Pl,d.A.Pl,d.A.Pl,d.A.Pl,R,d.A.Pl);else{const s=this.PA[i][e][c]+1,r=this.GA[i][e][c],o=n.A.Lo[y-1];let l,a,f=o.texture;f>=0?(a=h.A.im(f),l=-1):o.Mu===d.A.sm?(a=0,l=-2,f=-1):(l=n.A.Lu(o.Fu,o.Nu,o.Bu),a=h.A.palette[n.A.xu(o.Gu,96)]),t?.tm(i,e,c,s,r,f,m,p,_,I,n.A.Su(b,g),n.A.Su(b,C),n.A.Su(b,E),n.A.Su(b,v),n.A.xu(l,g),n.A.xu(l,C),n.A.xu(l,E),n.A.xu(l,v),R,a)}}}}}}for(let e=1;e0&&(t<<=3,i<<=3,e<<=3);for(let s=0;s<=n;s++)for(let r=0;r<=this.NA;r++)for(let h=0;h<=this.FA;h++){if(this.zA[s][h][r]&t){let i=r,e=r,l=s,a=s;for(;i>0&&this.zA[s][h][i-1]&t;)i--;for(;e0;){for(let s=i;s<=e;s++)if(!(this.zA[l-1][h][s]&t))break t;l--}t:for(;a=8){const s=this.Hr[a][h][i]-240,r=this.Hr[l][h][i];o.A.om(n,1,128*h,s,128*i,128*h,r,128*e+128);for(let s=l;s<=a;s++)for(let n=i;n<=e;n++)this.zA[s][h][n]&=~t}}if(this.zA[s][h][r]&i){let t=h,e=h,l=s,a=s;for(;t>0&&this.zA[s][t-1][r]&i;)t--;for(;e0;){for(let s=t;s<=e;s++)if(!(this.zA[l-1][s][r]&i))break t;l--}t:for(;a=8){const s=this.Hr[a][t][r]-240,h=this.Hr[l][t][r];o.A.om(n,2,128*t,s,128*r,128*e+128,h,128*r);for(let s=l;s<=a;s++)for(let n=t;n<=e;n++)this.zA[s][n][r]&=~i}}if(this.zA[s][h][r]&e){let t=h,i=h,l=r,a=r;for(;l>0&&this.zA[s][h][l-1]&e;)l--;for(;a0;){for(let i=l;i<=a;i++)if(!(this.zA[s][t-1][i]&e))break t;t--}t:for(;i=4){const r=this.Hr[s][t][l];o.A.om(n,4,128*t,r,128*l,128*i+128,r,128*a+128);for(let n=t;n<=i;n++)for(let t=l;t<=a;t++)this.zA[s][n][t]&=~e}}}}}};lm=(t,i,e,r)=>{let h=0;for(let t=0;t>24;break}for(let n=t;n=0&&t=0&&n{const o=new r.A(new Uint8Array(h));for(let r=0;r=0&&a=0&&c>24,this.GA[r][a][c]=(f-2&3)<<24>>24):f<=81?this.Vr[r][a][c]=f-49<<24>>24:this.BA[r][a][c]=f-81<<24>>24}else for(;f=o.au,0!==f;){if(1===f){o.au;break}f<=49&&o.au}}};fm=(t,i,e,n,h,o)=>{const l=new r.A(new Uint8Array(n));let a=-1;for(;;){const n=l.um;if(0===n)return;a+=n;let r=0;for(;;){const n=l.um;if(0===n)break;r+=n-1;const c=63&r,f=r>>6&63,u=r>>12,d=l.au,w=d>>2,y=3&d,A=f+h,m=c+o;if(A>0&&m>0&&A=0&&(n=e[s]),this.By(u,A,m,t,i,n,a,w,y)}}}};By=(t,i,e,s,n,r,h,o,d)=>{if(A.et){if(16&this.Vr[t][i][e])return;if(this.$A(t,i,e)!==A.vA)return}const w=this.Hr[t][i][e],y=this.Hr[t][i+1][e],m=this.Hr[t][i+1][e+1],p=this.Hr[t][i][e+1],_=w+y+m+p>>2,I=l.A.get(h);let g=i+(e<<7)+(h<<14)+1073741824|0;I.active||(g+=-2147483648),g|=0;const C=(d<<6)+o<<24>>24;if(o===f.A.nA.id)(!A.et||I.active||I.vd)&&(s?.xA(I.la(f.A.nA.id,d,w,y,m,p,-1),t,i,e,_,g,C),I.nd&&I.active&&r?.Fy(i,e),-1!==I.al&&n.MA(new a.A(h,t,3,i,e,c.A.Lo[I.al],!0)));else if(o===f.A.td.id||o===f.A.oA.id){const l=I.la(f.A.td.id,d,w,y,m,p,-1);if(l){let n,r,h=0;if(o===f.A.oA.id&&(h+=256),d===u.A.Uy||d===u.A.Py?(n=I.length,r=I.width):(n=I.width,r=I.length),s?.By(t,i,e,_,l,null,g,C,n,r,h)&&I.Ad)for(let s=0;s<=n;s++)for(let n=0;n<=r;n++){let r=l.dm/4|0;r>30&&(r=30),r>this.WA[t][i+s][e+n]&&(this.WA[t][i+s][e+n]=r<<24>>24)}}I.nd&&r?.By(i,e,I.width,I.length,d,I.rd),-1!==I.al&&n.MA(new a.A(h,t,2,i,e,c.A.Lo[I.al],!0))}else if(o>=f.A.lA.id)s?.By(t,i,e,_,I.la(o,d,w,y,m,p,-1),null,g,C,1,1,0),o>=f.A.lA.id&&o<=f.A.dA.id&&o!==f.A.aA.id&&t>0&&(this.zA[t][i][e]|=2340),I.nd&&r?.By(i,e,I.width,I.length,d,I.rd),-1!==I.al&&n.MA(new a.A(h,t,2,i,e,c.A.Lo[I.al],!0));else if(o===f.A.Yy.id)s?.Wy(t,i,e,_,A.pA[d],0,I.la(f.A.Yy.id,d,w,y,m,p,-1),null,g,C),d===u.A.kd?(I.Ad&&(this.WA[t][i][e]=50,this.WA[t][i][e+1]=50),I.Du&&(this.zA[t][i][e]|=585)):d===u.A.Uy?(I.Ad&&(this.WA[t][i][e+1]=50,this.WA[t][i+1][e+1]=50),I.Du&&(this.zA[t][i][e+1]|=1170)):d===u.A.Hy?(I.Ad&&(this.WA[t][i+1][e]=50,this.WA[t][i+1][e+1]=50),I.Du&&(this.zA[t][i+1][e]|=585)):d===u.A.Py&&(I.Ad&&(this.WA[t][i][e]=50,this.WA[t][i+1][e]=50),I.Du&&(this.zA[t][i][e]|=1170)),I.nd&&r?.Wy(i,e,o,d,I.rd),-1!==I.al&&n.MA(new a.A(h,t,0,i,e,c.A.Lo[I.al],!0)),16!==I.ad&&s?.wm(t,i,e,I.ad);else if(o===f.A.Vy.id)s?.Wy(t,i,e,_,A._A[d],0,I.la(f.A.Vy.id,d,w,y,m,p,-1),null,g,C),I.Ad&&(d===u.A.kd?this.WA[t][i][e+1]=50:d===u.A.Uy?this.WA[t][i+1][e+1]=50:d===u.A.Hy?this.WA[t][i+1][e]=50:d===u.A.Py&&(this.WA[t][i][e]=50)),I.nd&&r?.Wy(i,e,o,d,I.rd),-1!==I.al&&n.MA(new a.A(h,t,0,i,e,c.A.Lo[I.al],!0));else if(o===f.A.Xy.id){const l=d+1&3;s?.Wy(t,i,e,_,A.pA[d],A.pA[l],I.la(f.A.Xy.id,d+4,w,y,m,p,-1),I.la(f.A.Xy.id,l,w,y,m,p,-1),g,C),I.Du&&(d===u.A.kd?(this.zA[t][i][e]|=265,this.zA[t][i][e+1]|=1170):d===u.A.Uy?(this.zA[t][i][e+1]|=1170,this.zA[t][i+1][e]|=585):d===u.A.Hy?(this.zA[t][i+1][e]|=585,this.zA[t][i][e]|=1170):d===u.A.Py&&(this.zA[t][i][e]|=1170,this.zA[t][i][e]|=585)),I.nd&&r?.Wy(i,e,o,d,I.rd),-1!==I.al&&n.MA(new a.A(h,t,0,i,e,c.A.Lo[I.al],!0)),16!==I.ad&&s?.wm(t,i,e,I.ad)}else if(o===f.A.Ky.id)s?.Wy(t,i,e,_,A._A[d],0,I.la(f.A.Ky.id,d,w,y,m,p,-1),null,g,C),I.Ad&&(d===u.A.kd?this.WA[t][i][e+1]=50:d===u.A.Uy?this.WA[t][i+1][e+1]=50:d===u.A.Hy?this.WA[t][i+1][e]=50:d===u.A.Py&&(this.WA[t][i][e]=50)),I.nd&&r?.Wy(i,e,o,d,I.rd),-1!==I.al&&n.MA(new a.A(h,t,0,i,e,c.A.Lo[I.al],!0));else if(o===f.A.Zy.id)s?.By(t,i,e,_,I.la(o,d,w,y,m,p,-1),null,g,C,1,1,0),I.nd&&r?.By(i,e,I.width,I.length,d,I.rd),-1!==I.al&&n.MA(new a.A(h,t,2,i,e,c.A.Lo[I.al],!0));else if(o===f.A.rA.id)s?.kA(t,i,e,_,0,0,g,I.la(f.A.rA.id,u.A.kd,w,y,m,p,-1),C,512*d,A.pA[d]),-1!==I.al&&n.MA(new a.A(h,t,1,i,e,c.A.Lo[I.al],!0));else if(o===f.A.hA.id){let r=16;if(s){const n=s.DA(t,i,e);n>0&&(r=l.A.get(n>>14&32767).ad)}s?.kA(t,i,e,_,A.IA[d]*r,A.gA[d]*r,g,I.la(f.A.rA.id,u.A.kd,w,y,m,p,-1),C,512*d,A.pA[d]),-1!==I.al&&n.MA(new a.A(h,t,1,i,e,c.A.Lo[I.al],!0))}else o===f.A.Jy.id?(s?.kA(t,i,e,_,0,0,g,I.la(f.A.rA.id,u.A.kd,w,y,m,p,-1),C,d,256),-1!==I.al&&n.MA(new a.A(h,t,1,i,e,c.A.Lo[I.al],!0))):o===f.A.$y.id?(s?.kA(t,i,e,_,0,0,g,I.la(f.A.rA.id,u.A.kd,w,y,m,p,-1),C,d,512),-1!==I.al&&n.MA(new a.A(h,t,1,i,e,c.A.Lo[I.al],!0))):o===f.A.Qy.id&&(s?.kA(t,i,e,_,0,0,g,I.la(f.A.rA.id,u.A.kd,w,y,m,p,-1),C,d,768),-1!==I.al&&n.MA(new a.A(h,t,1,i,e,c.A.Lo[I.al],!0)))};$A=(t,i,e)=>8&this.Vr[t][i][e]?0:t<=0||!(2&this.Vr[1][i][e])?t:t-1}},3045:(t,i,e)=>{e.d(i,{A:()=>_});var s=e(4583),n=e(1161),r=e(3795),h=e(8256),o=e(670),l=e(9222),a=e(6855),c=e(7441),f=e(6666),u=e(5748),d=e(3479),w=e(8950),y=e(2771),A=e(5518),m=e(6169),p=e(3867);class _{static ym=new p.Am(8,32,51,51,!1);static pm=new p.fe(100,null);static _m=new Int32Array(o.A.Dr);static Im=new p.gm(o.A.Dr,500,null);static Cm=new p.fe(500,null);static Em=new f.A;static vm=0;static bm=0;static Tm=0;static Rm=0;static Om=0;static Lm=0;static Sm=0;static xm=0;static Mm=0;static km=0;static Dm=0;static Fm=0;static Nm=0;static Bm=0;static Um=0;static Pm=0;static Gm=0;static Wm=0;static Ym=0;static Hm=0;static Vm=0;static Km=0;static Xm=!1;static jm=null;static zm=Uint8Array.of(19,55,38,155,255,110,137,205,76);static Zm=Uint8Array.of(160,192,80,96,0,144,80,48,160);static qm=Uint8Array.of(76,8,137,4,0,1,38,2,19);static Jm=Int8Array.of(0,0,2,0,0,2,1,1,0);static $m=Int8Array.of(2,0,0,2,0,0,0,4,4);static Qm=Int8Array.of(0,4,4,8,0,0,8,0,0);static tp=Int8Array.of(1,1,0,0,0,8,0,0,8);static ip=Int8Array.of(53,-53,-53,53);static ep=Int8Array.of(-53,-53,53,53);static sp=Int8Array.of(-45,45,45,-45);static np=Int8Array.of(45,45,-45,-45);static rp=[new Int8Array(16),Int8Array.of(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,0,0,0,1,1,0,0,1,1,1,0,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1),Int8Array.of(0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0),Int8Array.of(0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0),Int8Array.of(1,1,1,1,1,1,1,1,0,1,1,1,0,0,1,1),Int8Array.of(1,1,1,1,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,0,0,0,0,1,1,0,1,1,1,0,1,1,1),Int8Array.of(0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1)];static hp=[Int8Array.of(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),Int8Array.of(12,8,4,0,13,9,5,1,14,10,6,2,15,11,7,3),Int8Array.of(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0),Int8Array.of(3,7,11,15,2,6,10,14,1,5,9,13,0,4,8,12)];static op=Int32Array.of(41,39248,41,4643,41,41,41,41,41,41,41,41,41,41,41,43086,41,41,41,41,41,41,41,8602,41,28992,41,41,41,41,41,5056,41,41,41,41,41,41,41,41,41,41,41,41,41,41,3131,41,41,41);static lp=0;static kl=0;static Dl=0;static ap=-1;static cp=-1;static et=!0;static init=(t,i,e,n,r)=>{this.bm=0,this.Tm=0,this.Rm=t,this.Om=i,this.Lm=t/2|0,this.Sm=i/2|0;const h=new p.Am(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let i=0;i<2048;i+=64){this.xm=s.A.sin[t],this.Mm=s.A.cos[t],this.km=s.A.sin[i],this.Dm=s.A.cos[i];const o=(t-128)/32|0,l=i/64|0;for(let t=-26;t<=26;t++)for(let i=-26;i<=26;i++){const s=128*t,a=128*i;let c=!1;for(let t=-e;t<=n;t+=128)if(this.fp(s,a,r[o]+t)){c=!0;break}h[o][l][t+25+1][i+25+1]=c}}for(let t=0;t<8;t++)for(let i=0;i<32;i++)for(let e=-25;e<25;e++)for(let s=-25;s<25;s++){let n=!1;t:for(let r=-1;r<=1;r++)for(let o=-1;o<=1;o++){if(h[t][i][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t][(i+1)%31][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][i][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][(i+1)%31][e+r+25+1][s+o+25+1]){n=!0;break t}}this.ym[t][i][e+25][s+25]=n}};static To=()=>{this.pm=null,this._m=null,this.Im=null,this.Em=null,this.ym=null,this.Cm=null,this.jm=null,console.log('World3D unloaded!')};static om=(t,i,e,s,n,r,o,l)=>{_.Im[t][_._m[t]++]=new h.A(e/128|0,r/128|0,n/128|0,l/128|0,i,e,r,n,l,s,o)};static fp=(t,i,e)=>{const s=i*this.km+t*this.Dm>>16,n=i*this.Dm-t*this.km>>16,r=e*this.xm+n*this.Mm>>16,h=e*this.Mm-n*this.xm>>16;if(r<50||r>3500)return!1;const o=this.Lm+((s<<9)/r|0),l=this.Sm+((h<<9)/r|0);return o>=this.bm&&o<=this.Rm&&l>=this.Tm&&l<=this.Om};up;FA;NA;dp;wp;gh;yp;Ap;mp;pp=0;_p=0;Ip=0;constructor(t,i,e,s){this.up=e,this.FA=s,this.NA=i,this.wp=new p.Eh(e,s,i,null),this.yp=new p.qA(e,s+1,i+1),this.dp=t,this.gh=new p.fe(5e3,null),this.Ap=new Int32Array(1e4),this.mp=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this._p=t;for(let i=0;i{const e=this.wp[0][t][i];for(let e=0;e<3;e++){this.wp[e][t][i]=this.wp[e+1][t][i];const s=this.wp[e][t][i];s&&s.level--}this.wp[0][t][i]||(this.wp[0][t][i]=new r.A(0,t,i));const s=this.wp[0][t][i];s&&(s.Cp=e),this.wp[3][t][i]=null};nm=(t,i,e,s)=>{const n=this.wp[t][i][e];n&&(n.Ep=s)};tm=(t,i,e,s,n,h,o,l,a,c,f,u,w,m,p,_,I,g,C,E)=>{if(s===A.A.QA){for(let s=t;s>=0;s--)this.wp[s][i][e]||(this.wp[s][i][e]=new r.A(s,i,e));const s=this.wp[t][i][e];s&&(s.vp=new d.A(f,u,w,m,-1,C,!1))}else if(s===A.A.bp){for(let s=t;s>=0;s--)this.wp[s][i][e]||(this.wp[s][i][e]=new r.A(s,i,e));const s=this.wp[t][i][e];s&&(s.vp=new d.A(p,_,I,g,h,E,o===l&&o===a&&o===c))}else{for(let s=t;s>=0;s--)this.wp[s][i][e]||(this.wp[s][i][e]=new r.A(s,i,e));const d=this.wp[t][i][e];d&&(d.Tp=new y.A(i,s,_,l,w,n,f,c,E,p,h,g,C,a,I,m,o,e,u))}};xA=(t,i,e,s,n,h,o)=>{this.wp[i][e][s]||(this.wp[i][e][s]=new r.A(i,e,s));const a=this.wp[i][e][s];a&&(a.Rp=new l.A(n,128*e+64,128*s+64,t,h,o))};Op=(t,i,e)=>{const s=this.wp[t][i][e];s&&(s.Rp=null)};Lp=(t,i,e,s,n,h,o,l)=>{let a=0;const c=this.wp[s][t][i];if(c)for(let t=0;ta&&(a=e)}else this.wp[s][t][i]=new r.A(s,t,i);const f=this.wp[s][t][i];f&&(f.Mp=new u.A(e,128*t+64,128*i+64,h,o,l,n,a))};kp=(t,i,e)=>{const s=this.wp[t][i][e];s&&(s.Mp=null)};Wy=(t,i,e,s,n,h,o,l,c,f)=>{if(!o&&!l)return;for(let s=t;s>=0;s--)this.wp[s][i][e]||(this.wp[s][i][e]=new r.A(s,i,e));const u=this.wp[t][i][e];u&&(u.Dp=new a.A(s,128*i+64,128*e+64,n,h,o,l,c,f))};jy=(t,i,e,s)=>{const n=this.wp[t][i][e];1===s&&n&&(n.Dp=null)};kA=(t,i,e,s,n,h,o,l,a,f,u)=>{if(!l)return;for(let s=t;s>=0;s--)this.wp[s][i][e]||(this.wp[s][i][e]=new r.A(s,i,e));const d=this.wp[t][i][e];d&&(d.Fp=new c.A(s,128*i+n+64,128*e+h+64,u,f,l,o,a))};Np=(t,i,e)=>{const s=this.wp[t][i][e];s&&(s.Fp=null)};wm=(t,i,e,s)=>{const n=this.wp[t][i][e];if(!n)return;const r=n.Fp;if(!r)return;const h=128*i+64,o=128*e+64;r.x=h+((r.x-h)*s/16|0),r.z=o+((r.z-o)*s/16|0)};Bp=(t,i,e,s)=>{if(!s)return;const n=this.wp[t][i][e];if(!n)return;const r=n.Fp;r&&(r.model=s)};Up=(t,i,e,s)=>{if(!s)return;const n=this.wp[t][i][e];if(!n)return;const r=n.Rp;r&&(r.model=s)};Pp=(t,i,e,s)=>{if(!s)return;const n=this.wp[t][i][e];if(!n)return;const r=n.Dp;r&&(r.Gp=s)};Wp=(t,i,e,s,n)=>{if(!s)return;const r=this.wp[e][t][i];if(!r)return;const h=r.Dp;h&&(h.Gp=s,h.Yp=n)};By=(t,i,e,s,n,r,h,o,l,a,c)=>{if(!n&&!r)return!0;const f=128*i+64*l,u=128*e+64*a;return this.Hp(f,u,s,t,i,e,l,a,n,r,h,o,c,!1)};Vp=(t,i,e,s,n,r,h,o,l,a)=>{if(!n&&!r)return!0;let c=i-l,f=s-l,u=i+l,d=s+l;return a&&(o>640&&o<1408&&(d+=128),o>1152&&o<1920&&(u+=128),(o>1664||o<384)&&(f-=128),o>128&&o<896&&(c-=128)),c=c/128|0,f=f/128|0,u=u/128|0,d=d/128|0,this.Hp(i,s,e,t,c,f,u+1-c,d-f+1,n,r,h,0,o,!0)};Kp=(t,i,e,s,n,r,h,o,l,a,c,f)=>!l&&!a||this.Hp(i,s,e,t,n,r,h+1-n,o-r+1,l,a,c,0,f,!0);Gy=(t,i,e)=>{const s=this.wp[t][i][e];if(s)for(let t=0;t>29&3)&&n.jp===i&&n.zp===e)return void this.Zp(n)}};qp=(t,i,e,s)=>{if(!s)return;const n=this.wp[t][i][e];if(n)for(let t=0;t>29&3))return void(i.model=s)}};Jp=()=>{for(let t=0;t{const s=this.wp[t][i][e];return s&&s.Dp?s.Dp.Xp:0};$p=(t,i,e)=>{const s=this.wp[t][e][i];return s&&s.Fp?s.Fp.Xp:0};Qp=(t,i,e)=>{const s=this.wp[t][i][e];if(!s)return 0;for(let t=0;t>29&3)&&n.jp===i&&n.zp===e)return n.Xp}return 0};t_=(t,i,e)=>{const s=this.wp[t][i][e];return s&&s.Rp?s.Rp.Xp:0};i_=(t,i,e,s)=>{const n=this.wp[t][i][e];if(n){if(n.Dp&&n.Dp.Xp===s)return 255&n.Dp.info;if(n.Fp&&n.Fp.Xp===s)return 255&n.Fp.info;if(n.Rp&&n.Rp.Xp===s)return 255&n.Rp.info;for(let t=0;t{const r=i*(0|Math.sqrt(e*e+s*s+n*n))>>8;for(let i=0;i{if(i0){const n=this.wp[t][i+1][e-1];n&&n.Rp&&n.Rp.model&&n.Rp.model.e_&&this.n_(s,n.Rp.model,128,0,-128,!0)}};s_=(t,i,e,s,n,r)=>{let h=!0,o=i;const l=i+s,a=e-1,c=e+n;for(let f=t;f<=t+1;f++)if(f!==this.up){for(let u=o;u<=l;u++)if(!(u<0||u>=this.FA))for(let o=a;o<=c;o++){if(o<0||o>=this.NA||h&&u=e||u===i))continue;const a=this.wp[f][u][o];if(!a)continue;const d=128*(u-i)+64*(1-s),w=128*(o-e)+64*(1-n),y=((this.dp[f][u][o]+this.dp[f][u+1][o]+this.dp[f][u][o+1]+this.dp[f][u+1][o+1])/4|0)-((this.dp[t][i][e]+this.dp[t][i+1][e]+this.dp[t][i][e+1]+this.dp[t][i+1][e+1])/4|0),A=a.Dp;A&&A.Gp&&A.Gp.e_&&this.n_(r,A.Gp,d,y,w,h),A&&A.Yp&&A.Yp.e_&&this.n_(r,A.Yp,d,y,w,h);for(let t=0;t{this.Ip++;let h=0;const o=i.Od,l=i.Rd;if(t.e_&&t.a_)for(let r=0;ri.c_)continue;const u=t.Od[r]-e;if(ui.u_)continue;const d=t.Ld[r]-n;if(di.w_)continue;if(i.e_&&i.a_)for(let t=0;t{const h=this.wp[t][i][e];if(!h)return;const o=h.vp;if(o){const t=o.color;if(0!==t)for(let i=0;i<4;i++)s[n]=t,s[n+1]=t,s[n+2]=t,s[n+3]=t,n+=r;return}const l=h.Tp;if(!l)return;const a=l.shape,c=l.angle,f=l.g_,u=l.C_,d=_.rp[a],w=_.hp[c];let y=0;if(0===f)for(let t=0;t<4;t++)0!==d[w[y++]]&&(s[n]=u),0!==d[w[y++]]&&(s[n+1]=u),0!==d[w[y++]]&&(s[n+2]=u),0!==d[w[y++]]&&(s[n+3]=u),n+=r;else for(let t=0;t<4;t++)s[n]=0===d[w[y++]]?f:u,s[n+1]=0===d[w[y++]]?f:u,s[n+2]=0===d[w[y++]]?f:u,s[n+3]=0===d[w[y++]]?f:u,n+=r};click=(t,i)=>{_.Xm=!0,_.kl=t,_.Dl=i,_.ap=-1,_.cp=-1};draw=(t,i,e,n,r,h,o)=>{t<0?t=0:t>=128*this.FA&&(t=128*this.FA-1),e<0?e=0:e>=128*this.NA&&(e=128*this.NA-1),_.vm++,_.xm=s.A.sin[h],_.Mm=s.A.cos[h],_.km=s.A.sin[r],_.Dm=s.A.cos[r],_.jm=_.ym[(h-128)/32|0][r/64|0],_.Fm=t,_.Nm=i,_.Bm=e,_.Um=t/128|0,_.Pm=e/128|0,_.Vm=n,_.Gm=_.Um-25,_.Gm<0&&(_.Gm=0),_.Ym=_.Pm-25,_.Ym<0&&(_.Ym=0),_.Wm=_.Um+25,_.Wm>this.FA&&(_.Wm=this.FA),_.Hm=_.Pm+25,_.Hm>this.NA&&(_.Hm=this.NA),this.E_(),_.Km=0;for(let t=this._p;t=2e3)?(h.visible=!0,h.update=!0,h.v_=h.Sp>0,_.Km++):(h.visible=!1,h.update=!1,h.b_=0))}}for(let t=this._p;t=_.Wm))for(let t=-25;t<=0;t++){const n=_.Pm+t,r=_.Pm-t;let h;if(e>=_.Gm&&(n>=_.Ym&&(h=i[e][n],h&&h.visible&&this.T_(h,!0,o)),r<_.Hm&&(h=i[e][r],h&&h.visible&&this.T_(h,!0,o))),s<_.Wm&&(n>=_.Ym&&(h=i[s][n],h&&h.visible&&this.T_(h,!0,o)),r<_.Hm&&(h=i[s][r],h&&h.visible&&this.T_(h,!0,o))),0===_.Km)return void(_.Xm=!1)}}}for(let t=this._p;t=_.Wm))for(let t=-25;t<=0;t++){const n=_.Pm+t,r=_.Pm-t;let h;if(e>=_.Gm&&(n>=_.Ym&&(h=i[e][n],h&&h.visible&&this.T_(h,!1,o)),r<_.Hm&&(h=i[e][r],h&&h.visible&&this.T_(h,!1,o))),s<_.Wm&&(n>=_.Ym&&(h=i[s][n],h&&h.visible&&this.T_(h,!1,o)),r<_.Hm&&(h=i[s][r],h&&h.visible&&this.T_(h,!1,o))),0===_.Km)return void(_.Xm=!1)}}}};Hp=(t,i,e,s,h,o,l,a,c,f,u,d,w,y)=>{if(!c&&!f)return!1;for(let t=h;t=this.FA||i>=this.NA)return!1;const e=this.wp[s][t][i];if(e&&e.Sp>=5)return!1}const A=new n.A(s,e,t,i,c,f,w,h,h+l-1,o,o+a-1,u,d);for(let t=h;th&&(e|=1),to&&(e+=8),i=0;e--)this.wp[e][t][i]||(this.wp[e][t][i]=new r.A(e,t,i));const n=this.wp[s][t][i];n&&(n.xp[n.Sp]=A,n.R_[n.Sp]=e,n.O_|=e,n.Sp++)}return y&&(this.gh[this.pp++]=A),!0};Zp=t=>{for(let i=t.jp;i<=t.h_;i++)for(let e=t.zp;e<=t.o_;e++){const s=this.wp[t.level][i][e];if(s){for(let i=0;i{const t=_._m[_.Vm],i=_.Im[_.Vm];_.lp=0;for(let e=0;e=0&&s<=50){n=t.S_+25-_.Pm,n<0&&(n=0),r=t.NA+25-_.Pm,r>50&&(r=50);let i=!1;for(;n<=r;)if(_.jm&&_.jm[s][n++]){i=!0;break}if(i){if(h=_.Fm-t.f_,h>32)t.mode=1;else{if(h>=-32)continue;t.mode=2,h=-h}t.x_=(t.d_-_.Bm<<8)/h|0,t.M_=(t.w_-_.Bm<<8)/h|0,t.k_=(t.c_-_.Nm<<8)/h|0,t.D_=(t.Ud-_.Nm<<8)/h|0,_.Cm[_.lp++]=t}}}else if(2===t.type){if(s=t.S_+25-_.Pm,s>=0&&s<=50){n=t.L_+25-_.Um,n<0&&(n=0),r=t.FA+25-_.Um,r>50&&(r=50);let i=!1;for(;n<=r;)if(_.jm&&_.jm[n++][s]){i=!0;break}if(i){if(h=_.Bm-t.d_,h>32)t.mode=3;else{if(h>=-32)continue;t.mode=4,h=-h}t.F_=(t.f_-_.Fm<<8)/h|0,t.N_=(t.u_-_.Fm<<8)/h|0,t.k_=(t.c_-_.Nm<<8)/h|0,t.D_=(t.Ud-_.Nm<<8)/h|0,_.Cm[_.lp++]=t}}}else if(4===t.type&&(s=t.c_-_.Nm,s>128&&(n=t.S_+25-_.Pm,n<0&&(n=0),r=t.NA+25-_.Pm,r>50&&(r=50),n<=r))){let i=t.L_+25-_.Um;i<0&&(i=0),h=t.FA+25-_.Um,h>50&&(h=50);let e=!1;t:for(let t=i;t<=h;t++)for(let i=n;i<=r;i++)if(_.jm&&_.jm[t][i]){e=!0;break t}e&&(t.mode=5,t.F_=(t.f_-_.Fm<<8)/s|0,t.N_=(t.u_-_.Fm<<8)/s|0,t.x_=(t.d_-_.Bm<<8)/s|0,t.M_=(t.w_-_.Bm<<8)/s|0,_.Cm[_.lp++]=t)}}};T_=(t,i,e)=>{for(_.Em.MA(t);;){let t;do{if(t=_.Em.B_(),!t)return}while(!t.update);const s=t.x,n=t.z,r=t.level,h=t.U_,o=this.wp[r];if(t.visible){if(i){if(r>0){const t=this.wp[r-1][s][n];if(t&&t.update)continue}if(s<=_.Um&&s>_.Gm){const i=o[s-1][n];if(i&&i.update&&(i.visible||!(1&t.O_)))continue}if(s>=_.Um&&s<_.Wm-1){const i=o[s+1][n];if(i&&i.update&&(i.visible||!(4&t.O_)))continue}if(n<=_.Pm&&n>_.Ym){const i=o[s][n-1];if(i&&i.update&&(i.visible||!(8&t.O_)))continue}if(n>=_.Pm&&n<_.Hm-1){const i=o[s][n+1];if(i&&i.update&&(i.visible||!(2&t.O_)))continue}}else i=!0;if(t.visible=!1,t.Cp){const i=t.Cp;i.vp?this.P_(0,s,n)||this.G_(i.vp,0,s,n,_.xm,_.Mm,_.km,_.Dm):i.Tp&&!this.P_(0,s,n)&&this.W_(s,n,i.Tp,_.xm,_.Mm,_.km,_.Dm);const r=i.Dp;r&&r.Gp?.draw(0,_.xm,_.Mm,_.km,_.Dm,r.x-_.Fm,r.y-_.Nm,r.z-_.Bm,r.Xp);for(let t=0;tn&&(a+=6),c=_.zm[a],t.V_=_.qm[a]),f&&(f.K_&_.Zm[a]?16===f.K_?(t.b_=3,t.X_=_.Jm[a],t.j_=3-t.X_):32===f.K_?(t.b_=6,t.X_=_.$m[a],t.j_=6-t.X_):64===f.K_?(t.b_=12,t.X_=_.Qm[a],t.j_=12-t.X_):(t.b_=9,t.X_=_.tp[a],t.j_=9-t.X_):t.b_=0,f.K_&c&&!this.z_(h,s,n,f.K_)&&f.Gp?.draw(0,_.xm,_.Mm,_.km,_.Dm,f.x-_.Fm,f.y-_.Nm,f.z-_.Bm,f.Xp),f.Z_&c&&!this.z_(h,s,n,f.Z_)&&f.Yp?.draw(0,_.xm,_.Mm,_.km,_.Dm,f.x-_.Fm,f.y-_.Nm,f.z-_.Bm,f.Xp)),u&&!this.visible(h,s,n,u.model.Ud))if(u.type&c)u.model.draw(u.angle,_.xm,_.Mm,_.km,_.Dm,u.x-_.Fm,u.y-_.Nm,u.z-_.Bm,u.Xp);else if(768&u.type){const t=u.x-_.Fm,i=u.y-_.Nm,e=u.z-_.Bm,s=u.angle;let n,r;if(n=s===m.A.Uy||s===m.A.Hy?-t:t,r=s===m.A.Hy||s===m.A.Py?-e:e,256&u.type&&rn){const n=t+_.sp[s],r=e+_.np[s];u.model.draw(512*s+1280&2047,_.xm,_.Mm,_.km,_.Dm,n,i,r,u.Xp)}}if(l){const i=t.Rp;i&&i.model?.draw(0,_.xm,_.Mm,_.km,_.Dm,i.x-_.Fm,i.y-_.Nm,i.z-_.Bm,i.Xp);const e=t.Mp;e&&0===e.offset&&(e.q_&&e.q_.draw(0,_.xm,_.Mm,_.km,_.Dm,e.x-_.Fm,e.y-_.Nm,e.z-_.Bm,e.Xp),e.J_&&e.J_.draw(0,_.xm,_.Mm,_.km,_.Dm,e.x-_.Fm,e.y-_.Nm,e.z-_.Bm,e.Xp),e.Q_&&e.Q_.draw(0,_.xm,_.Mm,_.km,_.Dm,e.x-_.Fm,e.y-_.Nm,e.z-_.Bm,e.Xp))}const d=t.O_;if(0!==d){if(s<_.Um&&4&d){const t=o[s+1][n];t&&t.update&&_.Em.MA(t)}if(n<_.Pm&&2&d){const t=o[s][n+1];t&&t.update&&_.Em.MA(t)}if(s>_.Um&&1&d){const t=o[s-1][n];t&&t.update&&_.Em.MA(t)}if(n>_.Pm&&8&d){const t=o[s][n-1];t&&t.update&&_.Em.MA(t)}}}if(0!==t.b_){let i=!0;for(let e=0;ei.jp&&(r+=1),ei.zp&&(r+=8),ss&&(s=n);const h=_.Pm-i.zp,l=i.o_-_.Pm;i.tI=l>h?s+l:s+h}for(;;){let t=-50,i=-1;for(let e=0;et&&(t=s.tI,i=e))}if(-1===i)break;const l=_.pm[i];if(l){l.vm=_.vm;let t=l.model;t||(t=l.Y_?.draw(e)??null),t&&!this.iI(h,l.jp,l.h_,l.zp,l.o_,t.Ud)&&t.draw(l.H_,_.xm,_.Mm,_.km,_.Dm,l.x-_.Fm,l.y-_.Nm,l.z-_.Bm,l.Xp);for(let t=l.jp;t<=l.h_;t++)for(let i=l.zp;i<=l.o_;i++){const e=o[t][i];e&&(0!==e.b_?_.Em.MA(e):t===s&&i===n||!e.update||_.Em.MA(e))}}}if(t.v_)continue}if(!t.update||0!==t.b_)continue;if(s<=_.Um&&s>_.Gm){const t=o[s-1][n];if(t&&t.update)continue}if(s>=_.Um&&s<_.Wm-1){const t=o[s+1][n];if(t&&t.update)continue}if(n<=_.Pm&&n>_.Ym){const t=o[s][n-1];if(t&&t.update)continue}if(n>=_.Pm&&n<_.Hm-1){const t=o[s][n+1];if(t&&t.update)continue}t.update=!1,_.Km--;const l=t.Mp;if(l&&0!==l.offset&&(l.q_&&l.q_.draw(0,_.xm,_.Mm,_.km,_.Dm,l.x-_.Fm,l.y-_.Nm-l.offset,l.z-_.Bm,l.Xp),l.J_&&l.J_.draw(0,_.xm,_.Mm,_.km,_.Dm,l.x-_.Fm,l.y-_.Nm-l.offset,l.z-_.Bm,l.Xp),l.Q_&&l.Q_.draw(0,_.xm,_.Mm,_.km,_.Dm,l.x-_.Fm,l.y-_.Nm-l.offset,l.z-_.Bm,l.Xp)),0!==t.V_){const i=t.Fp;if(i&&!this.visible(h,s,n,i.model.Ud))if(i.type&t.V_)i.model.draw(i.angle,_.xm,_.Mm,_.km,_.Dm,i.x-_.Fm,i.y-_.Nm,i.z-_.Bm,i.Xp);else if(768&i.type){const t=i.x-_.Fm,e=i.y-_.Nm,s=i.z-_.Bm,n=i.angle;let r,h;if(r=n===m.A.Uy||n===m.A.Hy?-t:t,h=n===m.A.Hy||n===m.A.Py?-s:s,256&i.type&&h>=r){const r=t+_.ip[n],h=s+_.ep[n];i.model.draw(512*n+256,_.xm,_.Mm,_.km,_.Dm,r,e,h,i.Xp)}if(512&i.type&&h<=r){const r=t+_.sp[n],h=s+_.np[n];i.model.draw(512*n+1280&2047,_.xm,_.Mm,_.km,_.Dm,r,e,h,i.Xp)}}const e=t.Dp;e&&(e.Z_&t.V_&&!this.z_(h,s,n,e.Z_)&&e.Yp?.draw(0,_.xm,_.Mm,_.km,_.Dm,e.x-_.Fm,e.y-_.Nm,e.z-_.Bm,e.Xp),e.K_&t.V_&&!this.z_(h,s,n,e.K_)&&e.Gp?.draw(0,_.xm,_.Mm,_.km,_.Dm,e.x-_.Fm,e.y-_.Nm,e.z-_.Bm,e.Xp))}if(r_.Um){const t=o[s-1][n];t&&t.update&&_.Em.MA(t)}if(n>_.Pm){const t=o[s][n-1];t&&t.update&&_.Em.MA(t)}}};G_=(t,i,e,n,r,h,o,l)=>{let a,c,f,u,d=a=(e<<7)-_.Fm,y=c=(n<<7)-_.Bm,A=f=d+128,m=u=y+128,p=this.dp[i][e][n]-_.Nm,I=this.dp[i][e+1][n]-_.Nm,g=this.dp[i][e+1][n+1]-_.Nm,C=this.dp[i][e][n+1]-_.Nm,E=y*o+d*l>>16;if(y=y*l-d*o>>16,d=E,E=p*h-y*r>>16,y=p*r+y*h>>16,p=E,y<50)return;if(E=c*o+A*l>>16,c=c*l-A*o>>16,A=E,E=I*h-c*r>>16,c=I*r+c*h>>16,I=E,c<50)return;if(E=m*o+f*l>>16,m=m*l-f*o>>16,f=E,E=g*h-m*r>>16,m=g*r+m*h>>16,g=E,m<50)return;if(E=u*o+a*l>>16,u=u*l-a*o>>16,a=E,E=C*h-u*r>>16,u=C*r+u*h>>16,C=E,u<50)return;const v=s.A.ra+((d<<9)/y|0),b=s.A.ha+((p<<9)/y|0),T=s.A.ra+((A<<9)/c|0),R=s.A.ha+((I<<9)/c|0),O=s.A.ra+((f<<9)/m|0),L=s.A.ha+((g<<9)/m|0),S=s.A.ra+((a<<9)/u|0),x=s.A.ha+((C<<9)/u|0);if(s.A.alpha=0,(O-S)*(R-x)-(L-x)*(T-S)>0)if(s.A.eI=O<0||S<0||T<0||O>w.A.sI||S>w.A.sI||T>w.A.sI,_.Xm&&this.nI(_.kl,_.Dl,L,x,R,O,S,T)&&(_.ap=e,_.cp=n),-1===t.rI)12345678!==t.hI&&s.A.oI(O,S,T,L,x,R,t.hI,t.lI,t.aI);else if(_.et){const i=_.op[t.rI];s.A.oI(O,S,T,L,x,R,this.cI(i,t.hI),this.cI(i,t.lI),this.cI(i,t.aI))}else t.flat?s.A.fI(O,S,T,L,x,R,t.hI,t.lI,t.aI,d,p,y,A,a,I,C,c,u,t.rI):s.A.fI(O,S,T,L,x,R,t.hI,t.lI,t.aI,f,g,m,a,A,C,I,u,c,t.rI);if(!((v-T)*(x-R)-(b-R)*(S-T)<=0))if(s.A.eI=v<0||T<0||S<0||v>w.A.sI||T>w.A.sI||S>w.A.sI,_.Xm&&this.nI(_.kl,_.Dl,b,R,x,v,T,S)&&(_.ap=e,_.cp=n),-1!==t.rI){if(!_.et)return void s.A.fI(v,T,S,b,R,x,t.uI,t.aI,t.lI,d,p,y,A,a,I,C,c,u,t.rI);const i=_.op[t.rI];s.A.oI(v,T,S,b,R,x,this.cI(i,t.uI),this.cI(i,t.aI),this.cI(i,t.lI))}else 12345678!==t.uI&&s.A.oI(v,T,S,b,R,x,t.uI,t.aI,t.lI)};W_=(t,i,e,n,r,h,o)=>{let l=e.Od.length;for(let t=0;t>16;if(a=a*o-i*h>>16,i=c,c=l*r-a*n>>16,a=l*n+a*r>>16,l=c,a<50)return;e.dI&&(y.A.wI[t]=i,y.A.yI[t]=l,y.A.AI[t]=a),y.A.mI[t]=s.A.ra+((i<<9)/a|0),y.A.pI[t]=s.A.ha+((l<<9)/a|0)}s.A.alpha=0,l=e._I.length;for(let n=0;n0)if(s.A.eI=l<0||a<0||c<0||l>w.A.sI||a>w.A.sI||c>w.A.sI,_.Xm&&this.nI(_.kl,_.Dl,f,u,d,l,a,c)&&(_.ap=t,_.cp=i),e.dI&&-1!==e.dI[n])if(_.et){const t=_.op[e.dI[n]];s.A.oI(l,a,c,f,u,d,this.cI(t,e.CI[n]),this.cI(t,e.EI[n]),this.cI(t,e.vI[n]))}else e.flat?s.A.fI(l,a,c,f,u,d,e.CI[n],e.EI[n],e.vI[n],y.A.wI[0],y.A.yI[0],y.A.AI[0],y.A.wI[1],y.A.wI[3],y.A.yI[1],y.A.yI[3],y.A.AI[1],y.A.AI[3],e.dI[n]):s.A.fI(l,a,c,f,u,d,e.CI[n],e.EI[n],e.vI[n],y.A.wI[r],y.A.yI[r],y.A.AI[r],y.A.wI[h],y.A.wI[o],y.A.yI[h],y.A.yI[o],y.A.AI[h],y.A.AI[o],e.dI[n]);else 12345678!==e.CI[n]&&s.A.oI(l,a,c,f,u,d,e.CI[n],e.EI[n],e.vI[n])}};P_=(t,i,e)=>{const s=this.yp[t][i][e];if(s===-_.vm)return!1;if(s===_.vm)return!0;{const s=i<<7,n=e<<7;return this.bI(s+1,this.dp[t][i][e],n+1)&&this.bI(s+128-1,this.dp[t][i+1][e],n+1)&&this.bI(s+128-1,this.dp[t][i+1][e+1],n+128-1)&&this.bI(s+1,this.dp[t][i][e+1],n+128-1)?(this.yp[t][i][e]=_.vm,!0):(this.yp[t][i][e]=-_.vm,!1)}};z_=(t,i,e,s)=>{if(!this.P_(t,i,e))return!1;const n=i<<7,r=e<<7,h=this.dp[t][i][e]-1,o=h-120,l=h-230,a=h-238;if(s<16){if(1===s){if(n>_.Fm){if(!this.bI(n,h,r))return!1;if(!this.bI(n,h,r+128))return!1}if(t>0){if(!this.bI(n,o,r))return!1;if(!this.bI(n,o,r+128))return!1}return!!this.bI(n,l,r)&&this.bI(n,l,r+128)}if(2===s){if(r<_.Bm){if(!this.bI(n,h,r+128))return!1;if(!this.bI(n+128,h,r+128))return!1}if(t>0){if(!this.bI(n,o,r+128))return!1;if(!this.bI(n+128,o,r+128))return!1}return!!this.bI(n,l,r+128)&&this.bI(n+128,l,r+128)}if(4===s){if(n<_.Fm){if(!this.bI(n+128,h,r))return!1;if(!this.bI(n+128,h,r+128))return!1}if(t>0){if(!this.bI(n+128,o,r))return!1;if(!this.bI(n+128,o,r+128))return!1}return!!this.bI(n+128,l,r)&&this.bI(n+128,l,r+128)}if(8===s){if(r>_.Bm){if(!this.bI(n,h,r))return!1;if(!this.bI(n+128,h,r))return!1}if(t>0){if(!this.bI(n,o,r))return!1;if(!this.bI(n+128,o,r))return!1}return!!this.bI(n,l,r)&&this.bI(n+128,l,r)}}return!!this.bI(n+64,a,r+64)&&(16===s?this.bI(n,l,r+128):32===s?this.bI(n+128,l,r+128):64===s?this.bI(n+128,l,r):128===s?this.bI(n,l,r):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,i,e,s)=>{if(this.P_(t,i,e)){const n=i<<7,r=e<<7;return this.bI(n+1,this.dp[t][i][e]-s,r+1)&&this.bI(n+128-1,this.dp[t][i+1][e]-s,r+1)&&this.bI(n+128-1,this.dp[t][i+1][e+1]-s,r+128-1)&&this.bI(n+1,this.dp[t][i][e+1]-s,r+128-1)}return!1};iI=(t,i,e,s,n,r)=>{let h,o;if(i!==e||s!==n){for(h=i;h<=e;h++)for(o=s;o<=n;o++)if(this.yp[t][h][o]===-_.vm)return!1;o=1+(i<<7);const l=2+(s<<7),a=this.dp[t][i][s]-r;if(!this.bI(o,a,l))return!1;const c=(e<<7)-1;if(!this.bI(c,a,l))return!1;const f=(n<<7)-1;return!!this.bI(o,a,f)&&this.bI(c,a,f)}return!!this.P_(t,i,s)&&(h=i<<7,o=s<<7,this.bI(h+1,this.dp[t][i][s]-r,o+1)&&this.bI(h+128-1,this.dp[t][i+1][s]-r,o+1)&&this.bI(h+128-1,this.dp[t][i+1][s+1]-r,o+128-1)&&this.bI(h+1,this.dp[t][i][s+1]-r,o+128-1))};bI=(t,i,e)=>{for(let s=0;s<_.lp;s++){const n=_.Cm[s];if(n)if(1===n.mode){const s=n.f_-t;if(s>0){const t=n.d_+(n.x_*s>>8),r=n.w_+(n.M_*s>>8),h=n.c_+(n.k_*s>>8),o=n.Ud+(n.D_*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(2===n.mode){const s=t-n.f_;if(s>0){const t=n.d_+(n.x_*s>>8),r=n.w_+(n.M_*s>>8),h=n.c_+(n.k_*s>>8),o=n.Ud+(n.D_*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(3===n.mode){const s=n.d_-e;if(s>0){const e=n.f_+(n.F_*s>>8),r=n.u_+(n.N_*s>>8),h=n.c_+(n.k_*s>>8),o=n.Ud+(n.D_*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(4===n.mode){const s=e-n.d_;if(s>0){const e=n.f_+(n.F_*s>>8),r=n.u_+(n.N_*s>>8),h=n.c_+(n.k_*s>>8),o=n.Ud+(n.D_*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(5===n.mode){const s=i-n.c_;if(s>0){const i=n.f_+(n.F_*s>>8),r=n.u_+(n.N_*s>>8),h=n.d_+(n.x_*s>>8),o=n.w_+(n.M_*s>>8);if(t>=i&&t<=r&&e>=h&&e<=o)return!0}}}return!1};nI=(t,i,e,s,n,r,h,o)=>{if(ie&&i>s&&i>n)return!1;if(tr&&t>h&&t>o)return!1;const l=(i-s)*(o-h)-(t-h)*(n-s);return((i-e)*(h-r)-(t-r)*(s-e))*l>0&&l*((i-n)*(r-o)-(t-o)*(e-n))>0};cI=(t,i)=>((i=(127-i)*(127&t)/160|0)<2?i=2:i>126&&(i=126),(65408&t)+i)}},7121:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{}},4197:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{TI;RI;OI;LI;index;Vw;ul;fl;constructor(t,i,e,s,n,r,h){super(),this.TI=i,this.RI=e,this.OI=s,this.LI=n,this.index=t,this.Vw=r,h&&-1!==r.wl&&this.Vw.delay?(this.ul=Math.random()*this.Vw.dl|0,this.fl=Math.random()*this.Vw.delay[this.ul]|0):(this.ul=-1,this.fl=0)}}},9418:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(7121),n=e(1312),r=e(3867);class h extends s.A{x=0;z=0;H_=0;SI=!1;size=1;Sa=-1;xI=-1;MI=-1;kI=-1;DI=-1;FI=-1;NI=-1;BI=null;UI=100;GI=0;WI=0;YI=0;HI=0;VI=-1e3;KI=0;XI=0;jI=-1;zI=0;ZI=0;qI=-1;JI=0;$I=0;QI=-1;tg=0;ig=0;eg=0;sg=0;ng=-1;rg=0;hg=0;og=0;lg=0;ag=0;cg=0;fg=0;ug=0;dg=0;wg=0;yg=0;vm=0;height=0;Ag=0;pathLength=0;mg=new Int32Array(10);pg=new Int32Array(10);_g=new r.fe(10,!1);Ig=0;gg=-1;Cg=-1;Eg=-1;vg=-1;move(t,i,e){if(-1!==this.QI&&n.A.Lo[this.QI].priority<=1&&(this.QI=-1),!t){const t=i-this.mg[0],s=e-this.pg[0];if(t>=-8&&t<=8&&s>=-8&&s<=8){this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.mg[t]=this.mg[t-1],this.pg[t]=this.pg[t-1],this._g[t]=this._g[t-1];return this.mg[0]=i,this.pg[0]=e,void(this._g[0]=!1)}}this.pathLength=0,this.Ig=0,this.mg[0]=i,this.pg[0]=e,this.x=128*this.mg[0]+64*this.size,this.z=128*this.pg[0]+64*this.size}step(t,i){let e=this.mg[0],s=this.pg[0];0===i?(e--,s++):1===i?s++:2===i?(e++,s++):3===i?e--:4===i?e++:5===i?(e--,s--):6===i?s--:7===i&&(e++,s--),-1!==this.QI&&n.A.Lo[this.QI].priority<=1&&(this.QI=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.mg[t]=this.mg[t-1],this.pg[t]=this.pg[t-1],this._g[t]=this._g[t-1];this.mg[0]=e,this.pg[0]=s,this._g[0]=t}}},8268:(t,i,e)=>{e.d(i,{A:()=>d});var s=e(9418),n=e(8665),r=e(2679),h=e(8738),o=e(1312),l=e(8317),a=e(1302),c=e(3819),f=e(3867),u=e(9298);class d extends s.A{static bg=1;static Tg=2;static Rg=4;static Og=8;static Lg=16;static Sg=32;static xg=64;static Mg=128;static kg=256;static Dg=512;static La=[u.A.Fg,u.A.Ng,u.A.Bg,u.A.Ug,u.A.Pg,u.A.Gg,u.A.Wg,u.A.Yg,u.A.Hg,u.A.Vg,u.A.Kg,u.A.Xg,u.A.jg,u.A.zg,u.A.Zg,u.A.qg];static Oa=[[u.A.Jg,u.A.$g,u.A.Qg,u.A.tC,u.A.iC,u.A.eC,u.A.sC,u.A.nC,u.A.rC,u.A.hC,u.A.oC,u.A.lC],[u.A.aC,u.A.cC,u.A.fC,u.A.uC,u.A.dC,u.A.wC,u.A.yC,u.A.AC,u.A.mC,u.A.pC,u.A._C,u.A.IC,u.A.gC,u.A.CC,u.A.EC,u.A.vC],[u.A.vC-1,u.A.aC+1,u.A.cC,u.A.fC,u.A.uC,u.A.dC,u.A.wC,u.A.yC,u.A.AC,u.A.mC,u.A.pC,u.A._C,u.A.IC,u.A.gC,u.A.CC,u.A.EC],[u.A.bC,u.A.TC,u.A.RC,u.A.OC,u.A.LC,u.A.SC],[u.A.xC,u.A.MC,u.A.kC,u.A.DC,u.A.FC,u.A.NC,u.A.BC,u.A.UC]];static So=new r.A(200);name=null;visible=!1;PC=0;GC=0;WC=new Uint16Array(12);YC=new Uint16Array(5);Ka=0;HC=0n;y=0;VC=0;KC=0;XC=0;jC=0;zC=0;ZC=null;L_=0;S_=0;FA=0;NA=0;et=!1;draw(t){if(!this.visible)return null;let i=this.zd();if(this.height=i.Ud,i.$d=!0,this.et)return i;if(-1!==this.ng&&-1!==this.rg){const t=h.A.Lo[this.ng],e=n.A.vu(t.la(),!0,!t.ld,!1);e.translate(-this.lg,0,0),e.xa(),t.Vw&&t.Vw.frames&&e.Ma(t.Vw.frames[this.rg]),e.Dd=null,e.Fd=null,128===t.Xd&&128===t.jd||e.scale(t.Xd,t.jd,t.Xd),e.ka(t.fd+64,t.ud+850,-30,-50,-30,!0);const s=[i,e];i=n.A.qC(s,2)}if(this.ZC&&(t>=this.KC&&(this.ZC=null),t>=this.VC&&t=d.Oa[i].length)&&(e=0),this.YC[i]=e}this.Sa=t.ou,65535===this.Sa&&(this.Sa=-1),this.xI=t.ou,65535===this.xI&&(this.xI=-1),this.MI=t.ou,65535===this.MI&&(this.MI=-1),this.kI=t.ou,65535===this.kI&&(this.kI=-1),this.DI=t.ou,65535===this.DI&&(this.DI=-1),this.FI=t.ou,65535===this.FI&&(this.FI=-1),this.NI=t.ou,65535===this.NI&&(this.NI=-1),this.name=c.A.Ca(c.A.Ea(t.JC)),this.Ka=t.au,this.visible=!0,this.HC=0n;for(let t=0;t<12;t++)this.HC<<=0x4n,this.WC[t]>=256&&(this.HC+=BigInt(this.WC[t])-256n);this.WC[0]>=256&&(this.HC+=BigInt(this.WC[0])-256n>>4n),this.WC[1]>=256&&(this.HC+=BigInt(this.WC[1])-256n>>8n);for(let t=0;t<5;t++)this.HC<<=0x3n,this.HC+=BigInt(this.YC[t]);this.HC<<=0x1n,this.HC+=BigInt(this.PC)}Xu(){if(!this.visible)return null;const t=new f.fe(12,null);let i=0;for(let e=0;e<12;e++){const s=this.WC[e];if(s>=256&&s<512&&(t[i++]=l.A.Lo[s-256].Xu()),s>=512){const e=a.A.get(s-512).Xu(this.PC);e&&(t[i++]=e)}}const e=n.A.Ta(t,i);for(let t=0;t<5;t++)0!==this.YC[t]&&(e.Ra(d.Oa[t][0],d.Oa[t][this.YC[t]]),1===t&&e.Ra(d.La[0],d.La[this.YC[t]]));return e}zd(){let t=this.HC,i=-1,e=-1,s=-1,r=-1;if(this.QI>=0&&0===this.eg){const n=o.A.Lo[this.QI];if(n.frames&&(i=n.frames[this.tg]),this.qI>=0&&this.qI!==this.Sa){const t=o.A.Lo[this.qI].frames;t&&(e=t[this.JI])}n.Ww>=0&&(s=n.Ww,t+=BigInt(s-this.WC[5])<<8n),n.Yw>=0&&(r=n.Yw,t+=BigInt(r-this.WC[3])<<16n)}else if(this.qI>=0){const t=o.A.Lo[this.qI].frames;t&&(i=t[this.JI])}let h=d.So?.get(t);if(!h){const i=new f.fe(12,null);let e=0;for(let t=0;t<12;t++){let n=this.WC[t];if(r>=0&&3===t&&(n=r),s>=0&&5===t&&(n=s),n>=256&&n<512){const t=l.A.Lo[n-256].la();t&&(i[e++]=t)}if(n>=512){const t=a.A.get(n-512).Uw(this.PC);t&&(i[e++]=t)}}h=n.A.Ta(i,e);for(let t=0;t<5;t++)0!==this.YC[t]&&(h.Ra(d.Oa[t][0],d.Oa[t][this.YC[t]]),1===t&&h.Ra(d.La[0],d.La[this.YC[t]]));h.xa(),h.ka(64,850,-30,-50,-30,!0),d.So?.put(t,h)}if(this.et)return h;const c=n.A.Zd(h,!0);return-1!==i&&-1!==e?c.qd(i,e,o.A.Lo[this.QI].Pw):-1!==i&&c.Ma(i),c.Jd(),c.Dd=null,c.Fd=null,c}}},9222:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;model;Xp;info;constructor(t,i,e,s,n,r){this.y=t,this.x=i,this.z=e,this.model=s,this.Xp=n,this.info=r}}},1161:(t,i,e)=>{e.d(i,{A:()=>s});class s{level;y;x;z;model;Y_;H_;jp;h_;zp;o_;Xp;info;tI=0;vm=0;constructor(t,i,e,s,n,r,h,o,l,a,c,f,u){this.level=t,this.y=i,this.x=e,this.z=s,this.model=n,this.Y_=r,this.H_=h,this.jp=o,this.h_=l,this.zp=a,this.o_=c,this.Xp=f,this.info=u}}},5748:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;Q_;J_;q_;Xp;offset;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.Q_=s,this.J_=n,this.q_=r,this.Xp=h,this.offset=o}}},8256:(t,i,e)=>{e.d(i,{A:()=>s});class s{L_;FA;S_;NA;type;f_;u_;d_;w_;c_;Ud;mode=0;F_=0;N_=0;x_=0;M_=0;k_=0;D_=0;constructor(t,i,e,s,n,r,h,o,l,a,c){this.L_=t,this.FA=i,this.S_=e,this.NA=s,this.type=n,this.f_=r,this.u_=h,this.d_=o,this.w_=l,this.c_=a,this.Ud=c}}},3795:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1982),n=e(3867);class r extends s.A{level;x;z;U_;xp;R_;vp=null;Tp=null;Dp=null;Fp=null;Rp=null;Mp=null;Cp=null;Sp=0;O_=0;Ep=0;visible=!1;update=!1;v_=!1;b_=0;X_=0;j_=0;V_=0;constructor(t,i,e){super(),this.U_=this.level=t,this.x=i,this.z=e,this.xp=new n.fe(5,null),this.R_=new Int32Array(5)}}},2771:(t,i,e)=>{e.d(i,{A:()=>s});class s{static mI=new Int32Array(6);static pI=new Int32Array(6);static wI=new Int32Array(6);static yI=new Int32Array(6);static AI=new Int32Array(6);static $C=[Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,2,6),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,13,14)];static QC=[Int8Array.of(0,1,2,3,0,0,1,3),Int8Array.of(1,1,2,3,1,0,1,3),Int8Array.of(0,1,2,3,1,0,1,3),Int8Array.of(0,0,1,2,0,0,2,4,1,0,4,3),Int8Array.of(0,0,1,4,0,0,4,3,1,1,2,4),Int8Array.of(0,0,4,3,1,0,1,2,1,0,2,4),Int8Array.of(0,1,2,4,1,0,1,4,1,0,4,3),Int8Array.of(0,4,1,2,0,4,2,5,1,0,4,5,1,0,5,3),Int8Array.of(0,4,1,2,0,4,2,3,0,4,3,5,1,0,4,5),Int8Array.of(0,0,4,5,1,4,1,2,1,4,2,3,1,4,3,5),Int8Array.of(0,0,1,5,0,1,4,5,0,1,2,4,1,0,5,3,1,5,4,3,1,4,2,3),Int8Array.of(1,0,1,5,1,1,4,5,1,1,2,4,0,0,5,3,0,5,4,3,0,4,2,3),Int8Array.of(1,0,5,4,1,0,1,5,0,0,4,3,0,4,5,3,0,5,2,3,0,1,2,5)];static tE=128;static iE=this.tE/2|0;static eE=this.tE/4|0;static sE=3*this.tE/4|0;Od;Sd;Ld;CI;EI;vI;_I;II;gI;dI;flat;shape;angle;g_;C_;constructor(t,i,e,n,r,h,o,l,a,c,f,u,d,w,y,A,m,p,_){this.flat=!(m!==n||m!==w||m!==l),this.shape=i,this.angle=h,this.g_=d,this.C_=a;const I=s.$C[i],g=I.length;this.Od=new Int32Array(g),this.Sd=new Int32Array(g),this.Ld=new Int32Array(g);const C=new Int32Array(g),E=new Int32Array(g),v=t*s.tE,b=p*s.tE;for(let t=0;t8&&g<=12&&(g=9+(g-h-9&3)),g>12&&g<=16&&(g=13+(g-h-13&3)),1===g?(i=v,a=b,f=m,d=o,p=c):2===g?(i=v+s.iE,a=b,f=m+n>>1,d=o+_>>1,p=c+e>>1):3===g?(i=v+s.tE,a=b,f=n,d=_,p=e):4===g?(i=v+s.tE,a=b+s.iE,f=n+w>>1,d=_+r>>1,p=e+y>>1):5===g?(i=v+s.tE,a=b+s.tE,f=w,d=r,p=y):6===g?(i=v+s.iE,a=b+s.tE,f=w+l>>1,d=r+A>>1,p=y+u>>1):7===g?(i=v,a=b+s.tE,f=l,d=A,p=u):8===g?(i=v,a=b+s.iE,f=l+m>>1,d=A+o>>1,p=u+c>>1):9===g?(i=v+s.iE,a=b+s.eE,f=m+n>>1,d=o+_>>1,p=c+e>>1):10===g?(i=v+s.sE,a=b+s.iE,f=n+w>>1,d=_+r>>1,p=e+y>>1):11===g?(i=v+s.iE,a=b+s.sE,f=w+l>>1,d=r+A>>1,p=y+u>>1):12===g?(i=v+s.eE,a=b+s.iE,f=l+m>>1,d=A+o>>1,p=u+c>>1):13===g?(i=v+s.eE,a=b+s.eE,f=m,d=o,p=c):14===g?(i=v+s.sE,a=b+s.eE,f=n,d=_,p=e):15===g?(i=v+s.sE,a=b+s.sE,f=w,d=r,p=y):(i=v+s.eE,a=b+s.sE,f=l,d=A,p=u),this.Od[t]=i,this.Sd[t]=f,this.Ld[t]=a,C[t]=d,E[t]=p}const T=s.QC[i],R=T.length/4|0;this._I=new Int32Array(R),this.II=new Int32Array(R),this.gI=new Int32Array(R),this.CI=new Int32Array(R),this.EI=new Int32Array(R),this.vI=new Int32Array(R),this.dI=-1!==f?new Int32Array(R):null;let O=0;for(let t=0;t{e.d(i,{A:()=>s});class s{static QA=0;static bp=1;static nE=2;static rE=3;static hE=4;static oE=5;static iE=6;static eE=7;static sE=8;static lE=9;static aE=10;static cE=11}},3479:(t,i,e)=>{e.d(i,{A:()=>s});class s{uI;aI;hI;lI;rI;color;flat;constructor(t,i,e,s,n,r,h){this.uI=t,this.aI=i,this.hI=e,this.lI=s,this.rI=n,this.color=r,this.flat=h}}},6855:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;K_;Z_;Gp;Yp;Xp;info;constructor(t,i,e,s,n,r,h,o,l){this.y=t,this.x=i,this.z=e,this.K_=s,this.Z_=n,this.Gp=r,this.Yp=h,this.Xp=o,this.info=l}}},7441:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;type;angle;model;Xp;info;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.type=s,this.angle=n,this.model=r,this.Xp=h,this.info=o}}},7536:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n{fE;uE;constructor(t){this.uE=[],this.fE=t;for(let i=0;i{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{wE;yE;constructor(){super(),this.wE=this,this.yE=this}AE(){this.yE&&this.wE&&(this.yE.wE=this.wE,this.wE.yE=this.yE,this.wE=null,this.yE=null)}}},3819:(t,i,e)=>{e.d(i,{A:()=>s});class s{static mE=['_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9'];static pE=t=>{t=t.trim();let i=0n;for(let e=0;e=65&&s<=90?i+=BigInt(s+1-65):s>=97&&s<=122?i+=BigInt(s+1-97):s>=48&&s<=57&&(i+=BigInt(s+27-48))}return i};static Ea=t=>{if(t<0n||t>=6582952005840035281n)return'invalid_name';if(t%37n===0n)return'invalid_name';let i=0;const e=Array(12);for(;0n!==t;){const s=t;t/=37n,e[11-i++]=this.mE[Number(s-37n*t)]}return e.slice(12-i).join('')};static _E=t=>{const i=[...t.toLowerCase()];let e=!0;for(let t=0;t='a'&&s<='z'&&(i[t]=s.toUpperCase(),e=!1),'.'!==s&&'!'!==s||(e=!0)}return i.join('')};static IE=t=>{let i='';for(let e=0;e(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static Ca=t=>{if(0===t.length)return t;const i=[...t];for(let t=0;t='a'&&i[t+1]<='z'&&(i[t+1]=String.fromCharCode(i[t+1].charCodeAt(0)+'A'.charCodeAt(0)-97)));return i[0]>='a'&&i[0]<='z'&&(i[0]=String.fromCharCode(i[0].charCodeAt(0)+'A'.charCodeAt(0)-97)),i.join('')};static gu=t=>{const i=t.toUpperCase();let e=0n;for(let t=0;t>56n)&0xffffffffffffffn;return e}}},6666:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n{gE;cursor=null;constructor(){const t=new s.A;t.next=t,t.dE=t,this.gE=t}MA(t){t.dE&&t.rw(),t.dE=this.gE.dE,t.next=this.gE,t.dE&&(t.dE.next=t),t.next.dE=t}CE(t){t.dE&&t.rw(),t.dE=this.gE,t.next=this.gE.next,t.dE.next=t,t.next&&(t.next.dE=t)}B_(){const t=this.gE.next;return t===this.gE?null:(t?.rw(),t)}head(){const t=this.gE.next;return t===this.gE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}EE(){const t=this.gE.dE;return t===this.gE?(this.cursor=null,null):(this.cursor=t?.dE||null,t)}next(){const t=this.cursor;return t===this.gE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}dE(){const t=this.cursor;return t===this.gE?(this.cursor=null,null):(this.cursor=t?.dE||null,t)}clear(){for(;;){const t=this.gE.next;if(t===this.gE)return;t?.rw()}}}},1982:(t,i,e)=>{e.d(i,{A:()=>s});class s{key;next;dE;constructor(){this.key=0n,this.next=this,this.dE=this}rw(){this.dE&&this.next&&(this.dE.next=this.next,this.next.dE=this.dE,this.next=null,this.dE=null)}}},2679:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(2512),n=e(7536);class r{vE;bE;history;available;constructor(t){this.vE=t,this.available=t,this.bE=new n.A(1024),this.history=new s.A}get(t){const i=this.bE.get(t);return i&&this.history.push(i),i}put(t,i){if(0===this.available){const t=this.history.pop();t?.rw(),t?.AE()}else this.available--;this.bE.put(t,i),this.history.push(i)}clear(){const t=this.history.pop();t?(t.rw(),t.AE()):this.available=this.vE}}},2512:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n{head;constructor(){this.head=new s.A}push(t){t.yE&&t.AE(),t.yE=this.head.yE,t.wE=this.head,t.yE&&(t.yE.wE=t),t.wE.yE=t}pop(){const t=this.head.wE;return t===this.head?null:(t?.AE(),t)}}},8534:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(3867);class r{static Lo=[];static hu=t=>{const i=new s.A(t.read('base_head.dat')),e=new s.A(t.read('base_type.dat')),h=new s.A(t.read('base_label.dat')),o=i.ou;i.af+=2;for(let t=0;t{e.d(i,{A:()=>r});var s=e(8534),n=e(1069);class r{static Lo=[];static hu=t=>{const i=new n.A(t.read('frame_head.dat')),e=new n.A(t.read('frame_tran1.dat')),h=new n.A(t.read('frame_tran2.dat')),o=new n.A(t.read('frame_del.dat')),l=i.ou;i.af+=2;const a=new Int32Array(500),c=new Int32Array(500),f=new Int32Array(500),u=new Int32Array(500);for(let t=0;t0){if(0!==d.types[t])for(let i=t-1;i>y;i--)if(0===d.types[i]){a[A]=i,c[A]=0,f[A]=0,u[A]=0,A++;break}a[A]=t;let e=0;3===d.types[a[A]]&&(e=128),c[A]=1&i?h.RE:e,f[A]=2&i?h.RE:e,u[A]=4&i?h.RE:e,y=t,A++}}n.length=A,n.OE=new Int32Array(A),n.x=new Int32Array(A),n.y=new Int32Array(A),n.z=new Int32Array(A);for(let t=0;t{e.d(i,{bc:()=>s,zo:()=>n,LE:()=>o,SE:()=>h,xE:()=>r});const s=document.getElementById('canvas'),n=s.getContext('2d',{willReadFrequently:!0}),r=document.createElement('canvas'),h=document.createElement('img'),o=r.getContext('2d',{willReadFrequently:!0})},9298:(t,i,e)=>{e.d(i,{A:()=>s});class s{static RED=16711680;static GREEN=65280;static BLUE=255;static Gl=16776960;static ME=65535;static sm=16711935;static Il=16777215;static Pl=0;static kE=16748608;static DE=8388608;static FE=128;static NE=16756736;static BE=16740352;static UE=16723968;static PE=12648192;static GE=8453888;static WE=4259584;static YE=9179409;static HE=6116423;static il=2301979;static el=5063219;static nl=7759444;static hl=3353893;static VE=8388736;static KE=13350793;static XE=Int32Array.of(s.Gl,s.RED,s.GREEN,s.ME,s.sm,s.Il);static Jg=6798;static $g=107;static Qg=10283;static tC=16;static iC=4797;static eC=7744;static sC=5799;static nC=4634;static rC=33697;static hC=22433;static oC=2983;static lC=54193;static aC=8741;static cC=12;static fC=64030;static uC=43162;static dC=7735;static wC=8404;static yC=1701;static AC=38430;static mC=24094;static pC=10153;static _C=56621;static IC=4783;static gC=1341;static CC=16578;static EC=35003;static vC=25239;static Fg=9104;static Ng=10275;static Bg=7595;static Ug=3610;static Pg=7975;static Gg=8526;static Wg=918;static Yg=38802;static Hg=24466;static Vg=10145;static Kg=58654;static Xg=5027;static jg=1457;static zg=16565;static Zg=34991;static qg=25486;static bC=4626;static TC=11146;static RC=6439;static OC=12;static LC=4758;static SC=10270;static UC=4574;static xC=4550;static MC=4537;static kC=5681;static DC=5673;static FC=5790;static NC=6806;static BC=8076}},8950:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n extends s.A{static aw=new Int32Array;static cw=0;static fw=0;static top=0;static bottom=0;static left=0;static right=0;static sI=0;static jE=0;static zE=0;static bind=(t,i,e)=>{this.aw=t,this.cw=i,this.fw=e,this.Al(0,0,i,e)};static ZE=()=>{this.left=0,this.top=0,this.right=this.cw,this.bottom=this.fw,this.sI=this.right-1,this.jE=this.right/2|0};static Al=(t,i,e,s)=>{t<0&&(t=0),i<0&&(i=0),e>this.cw&&(e=this.cw),s>this.fw&&(s=this.fw),this.top=i,this.bottom=s,this.left=t,this.right=e,this.sI=this.right-1,this.jE=this.right/2|0,this.zE=this.bottom/2|0};static clear=()=>{const t=this.cw*this.fw;for(let i=0;i{this.rl(t,i,n,e),this.rl(t,i+s-1,n,e),this.sl(t,i,n,s),this.sl(t+e-1,i,n,s)};static rl=(t,i,e,s)=>{if(i=this.bottom)return;tthis.right&&(s=this.right-t);const n=t+i*this.cw;for(let t=0;t{if(t=this.right)return;ithis.bottom&&(s=this.bottom-i);const n=t+i*this.cw;for(let t=0;t{const r=Math.abs(e-t),h=Math.abs(s-i),o=t=this.left&&t=this.top&&i-h&&(a-=h,t+=o),e{tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const r=this.cw-e;let h=t+i*this.cw;for(let t=-s;t<0;t++){for(let t=-e;t<0;t++)this.aw[h++]=n;h+=r}};static JE(t,i,e,s,n,r){tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const h=256-r,o=(n>>16&255)*r,l=(n>>8&255)*r,a=(255&n)*r,c=this.cw-e;let f=t+i*this.cw;for(let t=0;t>16&255)*h>>8<<16)+(l+(this.aw[f]>>8&255)*h>>8<<8)+(a+(255&this.aw[f])*h>>8);this.aw[f++]=t}f+=c}}static $E(t,i,e,s,n){const r=256-n,h=(s>>16&255)*n,o=(s>>8&255)*n,l=(255&s)*n;let a=i-e;a<0&&(a=0);let c=i+e;c>=this.fw&&(c=this.fw-1);for(let s=a;s<=c;s++){const n=s-i,a=0|Math.sqrt(e*e-n*n);let c=t-a;c<0&&(c=0);let f=t+a;f>=this.cw&&(f=this.cw-1);let u=c+s*this.cw;for(let t=c;t<=f;t++){const t=(h+(this.aw[u]>>16&255)*r>>8<<16)+(o+(this.aw[u]>>8&255)*r>>8<<8)+(l+(255&this.aw[u])*r>>8);this.aw[u++]=t}}}static QE=(t,i,e)=>{t=this.right||i=this.bottom||(this.aw[t+i*this.cw]=e)}}},4583:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(8950),n=e(1673),r=e(3867);class h extends s.A{static et=!1;static tv=new Int32Array(512);static iv=new Int32Array(2048);static sin=new Int32Array(2048);static cos=new Int32Array(2048);static palette=new Int32Array(65536);static ev=new r.fe(50,null);static sv=0;static lw=new Int32Array;static ra=0;static ha=0;static uw=!0;static eI=!1;static alpha=0;static nv=null;static rv=new r.fe(50,null);static hv=0;static vm=0;static ov=new Int32Array(50);static lv=new r.fe(50,null);static av=!1;static cv=new r.fe(50,!1);static fv=new Int32Array(50);static{for(let t=1;t<512;t++)this.tv[t]=32768/t|0;for(let t=1;t<2048;t++)this.iv[t]=65536/t|0;for(let t=0;t<2048;t++)this.sin[t]=65536*Math.sin(.0030679615757712823*t)|0,this.cos[t]=65536*Math.cos(.0030679615757712823*t)|0}static To=()=>{this.tv=null,this.tv=null,this.sin=null,this.cos=null,this.lw=null,this.ev=null,this.cv=null,this.fv=null,this.nv=null,this.rv=null,this.ov=null,this.palette=null,this.lv=null,console.log('Draw3D unloaded!')};static Tc=()=>{this.lw=new Int32Array(this.fw);for(let t=0;t{this.lw=new Int32Array(i);for(let e=0;e{this.nv=null,this.rv.fill(null)};static wv=t=>{this.sv=0;for(let i=0;i<50;i++)try{this.ev[i]=n.A.Cu(t,i.toString()),this.et&&128===this.ev[i]?.Nl?this.ev[i]?.yv():this.ev[i]?.gw(),this.sv++}catch(t){}};static im=t=>{if(0!==this.fv[t])return this.fv[t];const i=this.lv[t];if(!i)return 0;let e=0,s=0,n=0;const r=i.length;for(let t=0;t>16&255,s+=i[t]>>8&255,n+=255&i[t];let h=(e/r<<16)+(s/r<<8)+(n/r|0);return h=this.Av(h,1.4),0===h&&(h=1),this.fv[t]=h,h};static mv=t=>{const i=t+.03*Math.random()-.015;let e=0;for(let t=0;t<512;t++){const s=(t/8|0)/64+.0078125,n=(7&t)/8+.0625;for(let t=0;t<128;t++){const r=t/128;let h=r,o=r,l=r;if(0!==n){let t;t=r<.5?r*(n+1):r+n-r*n;const i=2*r-t;let e=s+.3333333333333333;e>1&&e--;let a=s-.3333333333333333;a<0&&a++,h=6*e<1?i+6*(t-i)*e:2*e<1?t:3*e<2?i+(t-i)*(.6666666666666666-e)*6:i,o=6*s<1?i+6*(t-i)*s:2*s<1?t:3*s<2?i+(t-i)*(.6666666666666666-s)*6:i,l=6*a<1?i+6*(t-i)*a:2*a<1?t:3*a<2?i+(t-i)*(.6666666666666666-a)*6:i}const a=((256*h|0)<<16)+((256*o|0)<<8)+(256*l|0);this.palette[e++]=this.Av(a,i)}}for(let t=0;t<50;t++){const e=this.ev[t];if(!e)continue;const s=e.palette;this.lv[t]=new Int32Array(s.length);for(let e=0;e{const e=(t>>16)/256,s=(t>>8&255)/256,n=(255&t)/256;return((256*Math.pow(e,i)|0)<<16)+((256*Math.pow(s,i)|0)<<8)+(256*Math.pow(n,i)|0)};static _v=t=>{this.nv||(this.hv=t,this.et?this.nv=new r.Xr(t,16384):this.nv=new r.Xr(t,65536),this.rv.fill(null))};static oI=(t,i,e,s,n,r,h,o,l)=>{let a=0,c=0;n!==s&&(a=(i-t<<16)/(n-s)|0,c=(o-h<<15)/(n-s)|0);let f=0,u=0;r!==n&&(f=(e-i<<16)/(r-n)|0,u=(l-o<<15)/(r-n)|0);let d=0,w=0;if(r!==s&&(d=(t-e<<16)/(s-r)|0,w=(h-l<<15)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),nf)for(r-=n,n-=s,s=this.lw[s];;){if(--n<0)for(;;){if(--r<0)return;this.Iv(e>>16,i>>16,l>>7,o>>7,this.aw,s,0),e+=d,i+=f,l+=w,o+=u,s+=this.cw}this.Iv(e>>16,t>>16,l>>7,h>>7,this.aw,s,0),e+=d,t+=a,l+=w,h+=c,s+=this.cw}else for(r-=n,n-=s,s=this.lw[s];;){if(--n<0)for(;;){if(--r<0)return;this.Iv(i>>16,e>>16,o>>7,l>>7,this.aw,s,0),e+=d,i+=f,l+=w,o+=u,s+=this.cw}this.Iv(t>>16,e>>16,h>>7,l>>7,this.aw,s,0),e+=d,t+=a,l+=w,h+=c,s+=this.cw}else if(i=t<<=16,o=h<<=15,s<0&&(i-=d*s,t-=a*s,o-=w*s,h-=c*s,s=0),e<<=16,l<<=15,r<0&&(e-=f*r,l-=u*r,r=0),s!==r&&da)for(n-=r,r-=s,s=this.lw[s];;){if(--r<0)for(;;){if(--n<0)return;this.Iv(e>>16,t>>16,l>>7,h>>7,this.aw,s,0),e+=f,t+=a,l+=u,h+=c,s+=this.cw}this.Iv(i>>16,t>>16,o>>7,h>>7,this.aw,s,0),i+=d,t+=a,o+=w,h+=c,s+=this.cw}else for(n-=r,r-=s,s=this.lw[s];;){if(--r<0)for(;;){if(--n<0)return;this.Iv(t>>16,e>>16,h>>7,l>>7,this.aw,s,0),e+=f,t+=a,l+=u,h+=c,s+=this.cw}this.Iv(t>>16,i>>16,h>>7,o>>7,this.aw,s,0),i+=d,t+=a,o+=w,h+=c,s+=this.cw}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),rd)for(s-=r,r-=n,n=this.lw[n];;){if(--r<0)for(;;){if(--s<0)return;this.Iv(t>>16,e>>16,h>>7,l>>7,this.aw,n,0),t+=a,e+=d,h+=c,l+=w,n+=this.cw}this.Iv(t>>16,i>>16,h>>7,o>>7,this.aw,n,0),t+=a,i+=f,h+=c,o+=u,n+=this.cw}else for(s-=r,r-=n,n=this.lw[n];;){if(--r<0)for(;;){if(--s<0)return;this.Iv(e>>16,t>>16,l>>7,h>>7,this.aw,n,0),t+=a,e+=d,h+=c,l+=w,n+=this.cw}this.Iv(i>>16,t>>16,o>>7,h>>7,this.aw,n,0),t+=a,i+=f,h+=c,o+=u,n+=this.cw}else if(e=i<<=16,l=o<<=15,n<0&&(e-=a*n,i-=f*n,l-=c*n,o-=u*n,n=0),t<<=16,h<<=15,s<0&&(t-=d*s,h-=w*s,s=0),r-=s,s-=n,n=this.lw[n],a>16,i>>16,h>>7,o>>7,this.aw,n,0),t+=d,i+=f,h+=w,o+=u,n+=this.cw}this.Iv(e>>16,i>>16,l>>7,o>>7,this.aw,n,0),e+=a,i+=f,l+=c,o+=u,n+=this.cw}else for(;;){if(--s<0)for(;;){if(--r<0)return;this.Iv(i>>16,t>>16,o>>7,h>>7,this.aw,n,0),t+=d,i+=f,h+=w,o+=u,n+=this.cw}this.Iv(i>>16,e>>16,o>>7,l>>7,this.aw,n,0),e+=a,i+=f,l+=c,o+=u,n+=this.cw}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,o>>7,h>>7,this.aw,r,0),i+=f,t+=a,o+=u,h+=c,r+=this.cw}this.Iv(i>>16,e>>16,o>>7,l>>7,this.aw,r,0),i+=f,e+=d,o+=u,l+=w,r+=this.cw}else for(;;){if(--s<0)for(;;){if(--n<0)return;this.Iv(t>>16,i>>16,h>>7,o>>7,this.aw,r,0),i+=f,t+=a,o+=u,h+=c,r+=this.cw}this.Iv(e>>16,i>>16,l>>7,o>>7,this.aw,r,0),i+=f,e+=d,o+=u,l+=w,r+=this.cw}else if(t=e<<=16,h=l<<=15,r<0&&(t-=f*r,e-=d*r,h-=u*r,l-=w*r,r=0),i<<=16,o<<=15,n<0&&(i-=a*n,o-=c*n,n=0),s-=n,n-=r,r=this.lw[r],f>16,e>>16,o>>7,l>>7,this.aw,r,0),i+=a,e+=d,o+=c,l+=w,r+=this.cw}this.Iv(t>>16,e>>16,h>>7,l>>7,this.aw,r,0),t+=f,e+=d,h+=u,l+=w,r+=this.cw}else for(;;){if(--n<0)for(;;){if(--s<0)return;this.Iv(e>>16,i>>16,l>>7,o>>7,this.aw,r,0),i+=a,e+=d,o+=c,l+=w,r+=this.cw}this.Iv(e>>16,t>>16,l>>7,h>>7,this.aw,r,0),t+=f,e+=d,h+=u,l+=w,r+=this.cw}};static Iv=(t,i,e,s,n,r,h)=>{let o;if(this.uw){let l;if(this.eI){if(l=i-t>3?(s-e)/(i-t)|0:0,i>this.sI&&(i=this.sI),t<0&&(e-=t*l,t=0),t>=i)return;r+=t,h=i-t>>2,l<<=2}else{if(!(t>2)>0?(s-e)*this.tv[h]>>15:0}if(0===this.alpha)for(;;){if(--h<0){if((h=i-t&3)>0){o=this.palette[e>>8];do{n[r++]=o,h--}while(h>0);return}break}o=this.palette[e>>8],e+=l,n[r++]=o,n[r++]=o,n[r++]=o,n[r++]=o}else{const s=this.alpha,a=256-this.alpha;for(;;){if(--h<0){if((h=i-t&3)>0){o=this.palette[e>>8],o=((16711935&o)*a>>8&16711935)+((65280&o)*a>>8&65280);do{n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),h--}while(h>0)}break}o=this.palette[e>>8],e+=l,o=((16711935&o)*a>>8&16711935)+((65280&o)*a>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280)}}}else if(tthis.sI&&(i=this.sI),t<0&&(e-=t*l,t=0),t>=i))return;if(r+=t,h=i-t,0===this.alpha)do{n[r++]=this.palette[e>>8],e+=l,h--}while(h>0);else{const t=this.alpha,i=256-this.alpha;do{o=this.palette[e>>8],e+=l,o=((16711935&o)*i>>8&16711935)+((65280&o)*i>>8&65280),n[r++]=o+((16711935&n[r])*t>>8&16711935)+((65280&n[r])*t>>8&65280),h--}while(h>0)}}};static gv=(t,i,e,s,n,r,h)=>{let o=0;n!==s&&(o=(i-t<<16)/(n-s)|0);let l=0;r!==n&&(l=(e-i<<16)/(r-n)|0);let a=0;if(r!==s&&(a=(t-e<<16)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),nl)for(r-=n,n-=s,s=this.lw[s];;){if(--n<0)for(;;){if(--r<0)return;this.Cv(e>>16,i>>16,this.aw,s,h),e+=a,i+=l,s+=this.cw}this.Cv(e>>16,t>>16,this.aw,s,h),e+=a,t+=o,s+=this.cw}else for(r-=n,n-=s,s=this.lw[s];;){if(--n<0)for(;;){if(--r<0)return;this.Cv(i>>16,e>>16,this.aw,s,h),e+=a,i+=l,s+=this.cw}this.Cv(t>>16,e>>16,this.aw,s,h),e+=a,t+=o,s+=this.cw}else if(i=t<<=16,s<0&&(i-=a*s,t-=o*s,s=0),e<<=16,r<0&&(e-=l*r,r=0),s!==r&&ao)for(n-=r,r-=s,s=this.lw[s];;){if(--r<0)for(;;){if(--n<0)return;this.Cv(e>>16,t>>16,this.aw,s,h),e+=l,t+=o,s+=this.cw}this.Cv(i>>16,t>>16,this.aw,s,h),i+=a,t+=o,s+=this.cw}else for(n-=r,r-=s,s=this.lw[s];;){if(--r<0)for(;;){if(--n<0)return;this.Cv(t>>16,e>>16,this.aw,s,h),e+=l,t+=o,s+=this.cw}this.Cv(t>>16,i>>16,this.aw,s,h),i+=a,t+=o,s+=this.cw}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),ra)for(s-=r,r-=n,n=this.lw[n];;){if(--r<0)for(;;){if(--s<0)return;this.Cv(t>>16,e>>16,this.aw,n,h),t+=o,e+=a,n+=this.cw}this.Cv(t>>16,i>>16,this.aw,n,h),t+=o,i+=l,n+=this.cw}else for(s-=r,r-=n,n=this.lw[n];;){if(--r<0)for(;;){if(--s<0)return;this.Cv(e>>16,t>>16,this.aw,n,h),t+=o,e+=a,n+=this.cw}this.Cv(i>>16,t>>16,this.aw,n,h),t+=o,i+=l,n+=this.cw}else if(e=i<<=16,n<0&&(e-=o*n,i-=l*n,n=0),t<<=16,s<0&&(t-=a*s,s=0),o>16,i>>16,this.aw,n,h),t+=a,i+=l,n+=this.cw}this.Cv(e>>16,i>>16,this.aw,n,h),e+=o,i+=l,n+=this.cw}else for(r-=s,s-=n,n=this.lw[n];;){if(--s<0)for(;;){if(--r<0)return;this.Cv(i>>16,t>>16,this.aw,n,h),t+=a,i+=l,n+=this.cw}this.Cv(i>>16,e>>16,this.aw,n,h),e+=o,i+=l,n+=this.cw}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,this.aw,r,h),i+=l,t+=o,r+=this.cw}this.Cv(i>>16,e>>16,this.aw,r,h),i+=l,e+=a,r+=this.cw}else for(n-=s,s-=r,r=this.lw[r];;){if(--s<0)for(;;){if(--n<0)return;this.Cv(t>>16,i>>16,this.aw,r,h),i+=l,t+=o,r+=this.cw}this.Cv(e>>16,i>>16,this.aw,r,h),i+=l,e+=a,r+=this.cw}else if(t=e<<=16,r<0&&(t-=l*r,e-=a*r,r=0),i<<=16,n<0&&(i-=o*n,n=0),l>16,e>>16,this.aw,r,h),i+=o,e+=a,r+=this.cw}this.Cv(t>>16,e>>16,this.aw,r,h),t+=l,e+=a,r+=this.cw}else for(s-=n,n-=r,r=this.lw[r];;){if(--n<0)for(;;){if(--s<0)return;this.Cv(e>>16,i>>16,this.aw,r,h),i+=o,e+=a,r+=this.cw}this.Cv(e>>16,t>>16,this.aw,r,h),t+=l,e+=a,r+=this.cw}};static fI=(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w,y,A,m,p)=>{const _=this.Ev(p);this.av=!this.cv[p];const I=a-u,g=c-w,C=f-A,E=d-a,v=y-c,b=m-f;let T=E*c-v*a<<14;const R=v*f-b*c<<8,O=b*a-E*f<<5;let L=I*c-g*a<<14;const S=g*f-C*c<<8,x=C*a-I*f<<5;let M=g*E-I*v<<14;const k=C*v-g*b<<8,D=I*b-C*E<<5;let F=0,N=0;n!==s&&(F=(i-t<<16)/(n-s)|0,N=(o-h<<16)/(n-s)|0);let B=0,U=0;r!==n&&(B=(e-i<<16)/(r-n)|0,U=(l-o<<16)/(r-n)|0);let P=0,G=0;if(r!==s&&(P=(t-e<<16)/(s-r)|0,G=(h-l<<16)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),nB)for(r-=n,n-=s,s=this.lw[s];;){if(--n<0)for(;;){if(--r<0)return;this.vv(e>>16,i>>16,this.aw,s,_,0,0,T,L,M,R,S,k,l>>8,o>>8),e+=P,i+=B,l+=G,o+=U,s+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.vv(e>>16,t>>16,this.aw,s,_,0,0,T,L,M,R,S,k,l>>8,h>>8),e+=P,t+=F,l+=G,h+=N,s+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}else for(r-=n,n-=s,s=this.lw[s];;){if(--n<0)for(;;){if(--r<0)return;this.vv(i>>16,e>>16,this.aw,s,_,0,0,T,L,M,R,S,k,o>>8,l>>8),e+=P,i+=B,l+=G,o+=U,s+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.vv(t>>16,e>>16,this.aw,s,_,0,0,T,L,M,R,S,k,h>>8,l>>8),e+=P,t+=F,l+=G,h+=N,s+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}}else{i=t<<=16,o=h<<=16,s<0&&(i-=P*s,t-=F*s,o-=G*s,h-=N*s,s=0),e<<=16,l<<=16,r<0&&(e-=B*r,l-=U*r,r=0);const a=s-this.ha;if(T+=O*a,L+=x*a,M+=D*a,T|=0,L|=0,M|=0,(s===r||P>=F)&&(s!==r||B<=F))for(n-=r,r-=s,s=this.lw[s];;){if(--r<0)for(;;){if(--n<0)return;this.vv(t>>16,e>>16,this.aw,s,_,0,0,T,L,M,R,S,k,h>>8,l>>8),e+=B,t+=F,l+=U,h+=N,s+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.vv(t>>16,i>>16,this.aw,s,_,0,0,T,L,M,R,S,k,h>>8,o>>8),i+=P,t+=F,o+=G,h+=N,s+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}else for(n-=r,r-=s,s=this.lw[s];;){if(--r<0)for(;;){if(--n<0)return;this.vv(e>>16,t>>16,this.aw,s,_,0,0,T,L,M,R,S,k,l>>8,h>>8),e+=B,t+=F,l+=U,h+=N,s+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.vv(i>>16,t>>16,this.aw,s,_,0,0,T,L,M,R,S,k,o>>8,h>>8),i+=P,t+=F,o+=G,h+=N,s+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),rP)for(s-=r,r-=n,n=this.lw[n];;){if(--r<0)for(;;){if(--s<0)return;this.vv(t>>16,e>>16,this.aw,n,_,0,0,T,L,M,R,S,k,h>>8,l>>8),t+=F,e+=P,h+=N,l+=G,n+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.vv(t>>16,i>>16,this.aw,n,_,0,0,T,L,M,R,S,k,h>>8,o>>8),t+=F,i+=B,h+=N,o+=U,n+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}else for(s-=r,r-=n,n=this.lw[n];;){if(--r<0)for(;;){if(--s<0)return;this.vv(e>>16,t>>16,this.aw,n,_,0,0,T,L,M,R,S,k,l>>8,h>>8),t+=F,e+=P,h+=N,l+=G,n+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.vv(i>>16,t>>16,this.aw,n,_,0,0,T,L,M,R,S,k,o>>8,h>>8),t+=F,i+=B,h+=N,o+=U,n+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}}else{e=i<<=16,l=o<<=16,n<0&&(e-=F*n,i-=B*n,l-=N*n,o-=U*n,n=0),t<<=16,h<<=16,s<0&&(t-=P*s,h-=G*s,s=0);const a=n-this.ha;if(T+=O*a,L+=x*a,M+=D*a,T|=0,L|=0,M|=0,r-=s,s-=n,n=this.lw[n],F>16,i>>16,this.aw,n,_,0,0,T,L,M,R,S,k,h>>8,o>>8),t+=P,i+=B,h+=G,o+=U,n+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.vv(e>>16,i>>16,this.aw,n,_,0,0,T,L,M,R,S,k,l>>8,o>>8),e+=F,i+=B,l+=N,o+=U,n+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}else for(;;){if(--s<0)for(;;){if(--r<0)return;this.vv(i>>16,t>>16,this.aw,n,_,0,0,T,L,M,R,S,k,o>>8,h>>8),t+=P,i+=B,h+=G,o+=U,n+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.vv(i>>16,e>>16,this.aw,n,_,0,0,T,L,M,R,S,k,o>>8,l>>8),e+=F,i+=B,l+=N,o+=U,n+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,this.aw,r,_,0,0,T,L,M,R,S,k,o>>8,h>>8),i+=B,t+=F,o+=U,h+=N,r+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.vv(i>>16,e>>16,this.aw,r,_,0,0,T,L,M,R,S,k,o>>8,l>>8),i+=B,e+=P,o+=U,l+=G,r+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}else for(;;){if(--s<0)for(;;){if(--n<0)return;this.vv(t>>16,i>>16,this.aw,r,_,0,0,T,L,M,R,S,k,h>>8,o>>8),i+=B,t+=F,o+=U,h+=N,r+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.vv(e>>16,i>>16,this.aw,r,_,0,0,T,L,M,R,S,k,l>>8,o>>8),i+=B,e+=P,o+=U,l+=G,r+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}}else{t=e<<=16,h=l<<=16,r<0&&(t-=B*r,e-=P*r,h-=U*r,l-=G*r,r=0),i<<=16,o<<=16,n<0&&(i-=F*n,o-=N*n,n=0);const a=r-this.ha;if(T+=O*a,L+=x*a,M+=D*a,T|=0,L|=0,M|=0,s-=n,n-=r,r=this.lw[r],B>16,e>>16,this.aw,r,_,0,0,T,L,M,R,S,k,o>>8,l>>8),i+=F,e+=P,o+=N,l+=G,r+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.vv(t>>16,e>>16,this.aw,r,_,0,0,T,L,M,R,S,k,h>>8,l>>8),t+=B,e+=P,h+=U,l+=G,r+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}else for(;;){if(--n<0)for(;;){if(--s<0)return;this.vv(e>>16,i>>16,this.aw,r,_,0,0,T,L,M,R,S,k,l>>8,o>>8),i+=F,e+=P,o+=N,l+=G,r+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.vv(e>>16,t>>16,this.aw,r,_,0,0,T,L,M,R,S,k,l>>8,h>>8),t+=B,e+=P,h+=U,l+=G,r+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}}};static vv=(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w)=>{if(t>=i)return;let y,A,m,p,_,I,g,C,E;if(this.eI){if(y=(w-d)/(i-t)|0,i>this.sI&&(i=this.sI),t<0&&(d-=t*y,t=0),t>=i)return;A=i-t>>3,y<<=12}else i-t>7?(A=i-t>>3,y=(w-d)*this.tv[A]>>6):(A=0,y=0);if(d<<=9,s+=t,this.et&&n)if(m=0,p=0,I=t-this.ra,o+=(c>>3)*I,l+=(f>>3)*I,a+=(u>>3)*I,o|=0,l|=0,_=(a|=0)>>12,0!==_&&(h=l/_|0,(r=o/_|0)<0?r=0:r>4032&&(r=4032)),o+=c,l+=f,a+=u,o|=0,l|=0,_=(a|=0)>>12,0!==_&&(m=o/_|0,p=l/_|0,m<7?m=7:m>4032&&(m=4032)),g=m-r>>3,C=p-h>>3,r+=d>>3&786432,E=d>>23,this.av){for(;A-- >0;)e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r=m,h=p,o+=c,l+=f,_=(a+=u)>>12,0!==_&&(m=o/_|0,p=l/_|0,m<7?m=7:m>4032&&(m=4032)),g=m-r>>3,C=p-h>>3,r+=(d+=y)>>3&786432,E=d>>23;for(A=i-t&7;A-- >0;)e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C}else{for(;A-- >0;){let t;0!=(t=n[(4032&h)+(r>>6)]>>>E)&&(e[s]=t),s+=1,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s+=1,r=m,h=p,o+=c,l+=f,a+=u,o|=0,l|=0,_=(a|=0)>>12,0!==_&&(m=o/_|0,p=l/_|0,m<7?m=7:m>4032&&(m=4032)),g=m-r>>3,C=p-h>>3,r+=(d+=y)>>3&786432,E=d>>23}for(A=i-t&7;A-- >0;){let t;0!=(t=n[(4032&h)+(r>>6)]>>>E)&&(e[s]=t),s++,r+=g,h+=C}}else if(m=0,p=0,I=t-this.ra,o+=(c>>3)*I,l+=(f>>3)*I,a+=(u>>3)*I,o|=0,l|=0,_=(a|=0)>>14,0!==_&&(h=l/_|0,(r=o/_|0)<0?r=0:r>16256&&(r=16256)),o+=c,l+=f,a+=u,o|=0,l|=0,_=(a|=0)>>14,0!==_&&(m=o/_|0,p=l/_|0,m<7?m=7:m>16256&&(m=16256)),g=m-r>>3,C=p-h>>3,r+=6291456&d,E=d>>23,this.av&&n){for(;A-- >0;)e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r=m,h=p,o+=c,l+=f,a+=u,o|=0,l|=0,_=(a|=0)>>14,0!==_&&(m=o/_|0,p=l/_|0,m<7?m=7:m>16256&&(m=16256)),g=m-r>>3,C=p-h>>3,r+=6291456&(d+=y),E=d>>23;for(A=i-t&7;A-- >0;)e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C}else{for(;A-- >0&&n;){let t;0!=(t=n[(16256&h)+(r>>7)]>>>E)&&(e[s]=t),s+=1,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,r=m,h=p,o+=c,l+=f,a+=u,o|=0,l|=0,_=(a|=0)>>14,0!==_&&(m=o/_|0,p=l/_|0,m<7?m=7:m>16256&&(m=16256)),g=m-r>>3,C=p-h>>3,r+=6291456&(d+=y),E=d>>23}for(A=i-t&7;A-- >0&&n;){let t;0!=(t=n[(16256&h)+(r>>7)]>>>E)&&(e[s]=t),s++,r+=g,h+=C}}};static Cv=(t,i,e,s,n)=>{if(this.eI&&(i>this.sI&&(i=this.sI),t<0&&(t=0)),t>=i)return;s+=t;let r=i-t>>2;if(0===this.alpha)for(;;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;e[s++]=n}e[s++]=n,e[s++]=n,e[s++]=n,e[s++]=n}const h=this.alpha,o=256-this.alpha;for(n=((16711935&n)*o>>8&16711935)+((65280&n)*o>>8&65280);;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280)}e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280)}};static pv=t=>{this.rv[t]&&this.nv&&(this.nv[this.hv++]=this.rv[t],this.rv[t]=null)};static Ev=t=>{if(this.ov[t]=this.vm++,this.rv[t])return this.rv[t];let i;if(this.hv>0&&this.nv)i=this.nv[--this.hv],this.nv[this.hv]=null;else{let t=0,e=-1;for(let i=0;i>>3)&16316671,i[n+8192]=r-(r>>>2)&16316671,i[n+12288]=r-(r>>>2)-(r>>>3)&16316671}}else{if(64===e.width)for(let t=0;t<128;t++)for(let n=0;n<128;n++)i[n+(t<<7)]=s[e.aw[(n>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)i[t]=s[e.aw[t]];this.cv[t]=!1;for(let e=0;e<16384;e++){i[e]&=16316671;const s=i[e];0===s&&(this.cv[t]=!0),i[e+16384]=s-(s>>>3)&16316671,i[e+32768]=s-(s>>>2)&16316671,i[e+49152]=s-(s>>>2)-(s>>>3)&16316671}}return i}}},880:(t,i,e)=>{e.d(i,{r:()=>n});var s=e(7854);const n=async t=>{255!==t[0]&&(t[0]=255),URL.revokeObjectURL(s.SE.src),s.SE.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>s.SE.onload=()=>t())),s.LE.clearRect(0,0,s.xE.width,s.xE.height);const i=s.SE.naturalWidth,e=s.SE.naturalHeight;return s.xE.width=i,s.xE.height=e,s.LE.drawImage(s.SE,0,0),s.LE.getImageData(0,0,i,e)}},8665:(t,i,e)=>{e.d(i,{A:()=>f});var s=e(1069),n=e(8950),r=e(4583),h=e(6730),o=e(4474),l=e(3867);class a{Rd=0;A_=0;bv=0;Tv=-1;Rv=-1;Ov=-1;Lv=-1;Sv=-1;xv=-1;Mv=-1;kv=-1;Dv=-1;Fv=0;Nv=-1;Bv=-1;Uv=-1;data=null}class c{x=0;y=0;z=0;w=0}class f extends o.A{static metadata=null;static head=null;static Pv=null;static Gv=null;static Wv=null;static Yv=null;static Hv=null;static Vv=null;static Kv=null;static Xv=null;static jv=null;static zv=null;static Zv=null;static qv=null;static axis=null;static Jv=new l.fe(4096,!1);static $v=new l.fe(4096,!1);static Qv=new Int32Array(4096);static tb=new Int32Array(4096);static ib=new Int32Array(4096);static eb=new Int32Array(4096);static sb=new Int32Array(4096);static nb=new Int32Array(4096);static rb=new Int32Array(1500);static hb=new l.Xr(1500,512);static ob=new Int32Array(12);static lb=new l.Xr(12,2e3);static ab=new Int32Array(2e3);static cb=new Int32Array(2e3);static fb=new Int32Array(12);static ub=new Int32Array(10);static wb=new Int32Array(10);static yb=new Int32Array(10);static Ir=0;static Ab=0;static gr=0;static mb=!1;static kl=0;static Dl=0;static pb=0;static _b=new Int32Array(1e3);static Ib=!1;static hu(t){try{f.head=new s.A(t.read('ob_head.dat')),f.Pv=new s.A(t.read('ob_face1.dat')),f.Gv=new s.A(t.read('ob_face2.dat')),f.Wv=new s.A(t.read('ob_face3.dat')),f.Yv=new s.A(t.read('ob_face4.dat')),f.Hv=new s.A(t.read('ob_face5.dat')),f.Vv=new s.A(t.read('ob_point1.dat')),f.Kv=new s.A(t.read('ob_point2.dat')),f.Xv=new s.A(t.read('ob_point3.dat')),f.jv=new s.A(t.read('ob_point4.dat')),f.zv=new s.A(t.read('ob_point5.dat')),f.Zv=new s.A(t.read('ob_vertex1.dat')),f.qv=new s.A(t.read('ob_vertex2.dat')),f.axis=new s.A(t.read('ob_axis.dat')),f.head.af=0,f.Vv.af=0,f.Kv.af=0,f.Xv.af=0,f.jv.af=0,f.Zv.af=0,f.qv.af=0;const i=f.head.ou;f.metadata=new l.fe(i+100,null);let e=0,n=0,r=0,h=0,o=0,c=0,u=0;for(let t=0;t>7)<2?i=2:i>126&&(i=126),(65408&t)+i):(i<0?i=0:i>127&&(i=127),127-i)}static Td=(t,i,e)=>{const s=t.Rd,n=t.A_,r=t.bv;let h,o,a,u,d;if(i){h=new Int32Array(s);for(let i=0;i{const n=t.Rd,r=t.A_,h=t.bv;let o,l,a,c,u;if(s)o=t.Od,l=t.Sd,a=t.Ld;else{o=new Int32Array(n),l=new Int32Array(n),a=new Int32Array(n);for(let i=0;i{const e=t.Rd,s=t.A_,n=t.bv,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e);for(let i=0;i{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,l=0,a=-1;for(let c=0;c{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,l=0,a=-1;for(let c=0;c{let o=-1;const l=t.Od[i],a=t.Sd[i],c=t.Ld[i];for(let t=0;t{if(!f.metadata)throw new Error('cant loading model metadata!!!!!');const i=f.metadata[t];if(!i)throw console.log(`Error model:${t} not found!`),new Error('cant loading model metadata!!!!!');if(!(f.head&&f.Pv&&f.Gv&&f.Wv&&f.Yv&&f.Hv&&f.Vv&&f.Kv&&f.Xv&&f.jv&&f.zv&&f.Zv&&f.qv&&f.axis))throw new Error('cant loading model!!!!!');const e=i.Rd,s=i.A_,n=i.bv,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e),l=new Int32Array(s),a=new Int32Array(s),c=new Int32Array(s),u=new Int32Array(n),d=new Int32Array(n),w=new Int32Array(n);let y=null;i.Sv>=0&&(y=new Int32Array(e));let A=null;i.Dv>=0&&(A=new Int32Array(s));let m=null,p=0;i.Fv>=0?m=new Int32Array(s):p=-i.Fv-1;let _=null;i.Nv>=0&&(_=new Int32Array(s));let I=null;i.Bv>=0&&(I=new Int32Array(s));const g=new Int32Array(s);f.Vv.af=i.Tv,f.Kv.af=i.Rv,f.Xv.af=i.Ov,f.jv.af=i.Lv,f.zv.af=i.Sv;let C,E,v,b=0,T=0,R=0;for(let t=0;t{if(!f.metadata||!f.metadata[i])throw new Error('No model metadata');const e=f.metadata[i];if(e.data=t,!e.data.length)throw new Error('No model data');const n=e.Rd,r=e.A_,h=e.bv,o=new Int32Array(n),l=new Int32Array(n),a=new Int32Array(n),c=new Int32Array(r),u=new Int32Array(r),d=new Int32Array(r),w=new Int32Array(h),y=new Int32Array(h),A=new Int32Array(h);let m=null;e.Sv>=0&&(m=new Int32Array(n));let p=null;e.Dv>=0&&(p=new Int32Array(r));let _=null,I=0;e.Fv>=0?_=new Int32Array(r):I=-e.Fv-1;let g=null;e.Nv>=0&&(g=new Int32Array(r));let C=null;e.Bv>=0&&(C=new Int32Array(r));const E=new Int32Array(r),v=new s.A(e.data);v.af=e.Tv;const b=new s.A(e.data);b.af=e.Rv;const T=new s.A(e.data);T.af=e.Ov;const R=new s.A(e.data);R.af=e.Lv;const O=new s.A(e.data);O.af=e.Sv;let L,S,x,M=0,k=0,D=0;for(let t=0;tthis.Ud&&(this.Ud=-e),e>this.c_&&(this.c_=e);const n=i*i+s*s;n>this.dm&&(this.dm=n)}this.dm=Math.sqrt(this.dm)+.99|0,this.Mb=Math.sqrt(this.dm*this.dm+this.Ud*this.Ud)+.99|0,this.xb=this.Mb+(Math.sqrt(this.dm*this.dm+this.c_*this.c_)+.99|0)}xd(){this.Ud=0,this.c_=0;for(let t=0;tthis.Ud&&(this.Ud=-i),i>this.c_&&(this.c_=i)}this.Mb=Math.sqrt(this.dm*this.dm+this.Ud*this.Ud)+.99|0,this.xb=this.Mb+(Math.sqrt(this.dm*this.dm+this.c_*this.c_)+.99|0)}xa(){if(this.kb){const t=new Int32Array(256);let i=0;for(let e=0;ei&&(i=s)}this.Fd=new l.fe(i+1,null);for(let e=0;e<=i;e++)this.Fd[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;ei&&(i=s)}this.Dd=new l.fe(i+1,null);for(let e=0;e<=i;e++)this.Dd[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;el;)l=e[o++];r&&r.types&&s.x&&s.y&&s.z&&r.labels&&(i!==l||0===r.types[i])&&this.Ub(s.x[t],s.y[t],s.z[t],r.labels[i],r.types[i])}f.Ir=0,f.Ab=0,f.gr=0,o=0,l=e[o++];for(let t=0;tl;)l=e[o++];r&&r.types&&n.x&&n.y&&n.z&&r.labels&&(i===l||0===r.types[i])&&this.Ub(n.x[t],n.y[t],n.z[t],r.labels[i],r.types[i])}}else this.Ma(t)}Ma(t){if(!this.Fd||-1===t||!h.A.Lo[t])return;const i=h.A.Lo[t],e=i.TE;f.Ir=0,f.Ab=0,f.gr=0;for(let t=0;t>16;this.Ld[t]=this.Sd[t]*i+this.Ld[t]*e>>16,this.Sd[t]=s}}translate(t,i,e){for(let s=0;s>8;if(this.Eb&&this.vb&&this.bb||(this.Eb=new Int32Array(this.A_),this.vb=new Int32Array(this.A_),this.bb=new Int32Array(this.A_)),!this.e_){this.e_=new l.fe(this.Rd,null);for(let t=0;t8192||m>8192||p>8192||A<-8192||m<-8192||p<-8192;)A>>=1,m>>=1,p>>=1;let _=0|Math.sqrt(A*A+m*m+p*p);if(_<=0&&(_=1),A=256*A/_|0,m=256*m/_|0,p=256*p/_|0,this.y_&&1&this.y_[i]){const r=t+((e*A+s*m+n*p)/(h+(h/2|0))|0);this.Eu&&(this.Eb[i]=f.Cb(this.Eu[i],r,this.y_[i]))}else{let t=this.e_[r];t&&(t.x+=A,t.y+=m,t.z+=p,t.w++),t=this.e_[o],t&&(t.x+=A,t.y+=m,t.z+=p,t.w++),t=this.e_[l],t&&(t.x+=A,t.y+=m,t.z+=p,t.w++)}}if(r)this.r_(t,h,e,s,n);else{this.a_=new l.fe(this.Rd,null);for(let t=0;t>16;for(let s=0;s>16,I=I*w-_*d>>16,_=p),0!==t&&(p=I*a-g*l>>16,g=I*l+g*a>>16,I=p),0!==i&&(p=g*c+_*u>>16,g=g*u-_*c>>16,_=p),_+=n,I+=h,g+=o,p=I*A-g*y>>16,g=I*y+g*A>>16,I=p,f.Qv&&f.tb&&f.ib&&(f.ib[s]=g-m,f.Qv[s]=r.A.ra+((_<<9)/g|0),f.tb[s]=r.A.ha+((I<<9)/g|0)),this.bv>0&&f.eb&&f.sb&&f.nb&&(f.eb[s]=_,f.sb[s]=I,f.nb[s]=g)}try{this.Wb(!1,!1,0)}catch(t){}}draw(t,i,e,s,h,o,l,a,c){const u=a*h-o*s>>16,d=l*i+u*e>>16,w=this.dm*e>>16,y=d+w;if(y<=50||d>=3500)return;const A=a*s+o*h>>16;let m=A-this.dm<<9;if((m/y|0)>=n.A.jE)return;let p=A+this.dm<<9;if((p/y|0)<=-n.A.jE)return;const _=l*e-u*i>>16,I=this.dm*i>>16;let g=_+I<<9;if((g/y|0)<=-n.A.zE)return;let C=_-(I+(this.Ud*e>>16))<<9;if((C/y|0)>=n.A.zE)return;let E=d-(w+(this.Ud*i>>16))<=50,v=!1;if(c>0&&f.mb){let t=d-w;t<=50&&(t=50),A>0?(m=m/y|0,p=p/t|0):(p=p/y|0,m=m/t|0),_>0?(C=C/y|0,g=g/t|0):(g=g/y|0,C=C/t|0);const i=f.kl-r.A.ra,e=f.Dl-r.A.ha;i>m&&iC&&e>16,w=w*O-c*R>>16,c=r),c+=o,u+=l,w+=a,r=w*s+c*h>>16,w=w*h-c*s>>16,c=r,r=u*e-w*i>>16,w=u*i+w*e>>16,u=r,f.ib&&(f.ib[n]=w-d),w>=50&&f.Qv&&f.tb?(f.Qv[n]=b+((c<<9)/w|0),f.tb[n]=T+((u<<9)/w|0)):f.Qv&&(f.Qv[n]=-5e3,E=!0),(E||this.bv>0)&&f.eb&&f.sb&&f.nb&&(f.eb[n]=c,f.sb[n]=u,f.nb[n]=w)}try{this.Wb(E,v,c)}catch(t){}}Wb(t,i,e,s=!1){f.Ib&&(this.Nb=-1,this.Bb=-1);for(let t=0;tn.A.sI||a>n.A.sI||c>n.A.sI),f.hb&&f.rb){const t=((y+A+m)/3|0)+this.Mb;f.hb[t][f.rb[t]++]=s,f.Ib&&this.Yb(f.kl,f.Dl,u,d,w,l,a,c)&&this.Bb=0;t--){const i=f.rb[t];if(!(i<=0)&&f.hb){const e=f.hb[t];for(let t=0;t=0;t--){const i=f.rb[t];if(i>0&&f.hb){const e=f.hb[t];for(let s=0;s0||f.ob[2]>0)&&(r=(f.fb[1]+f.fb[2])/(f.ob[1]+f.ob[2])|0);let h=0;f.ob&&f.fb&&(f.ob[3]>0||f.ob[4]>0)&&(h=(f.fb[3]+f.fb[4])/(f.ob[3]+f.ob[4])|0);let o=0;if(f.ob&&f.fb&&(f.ob[6]>0||f.ob[8]>0)&&(o=(f.fb[6]+f.fb[8])/(f.ob[6]+f.ob[8])|0),f.ob&&f.lb){let t,i=0,e=f.ob[10],n=f.lb[10],l=f.ab;i===e&&(i=0,e=f.ob[11],n=f.lb[11],l=f.cb),t=ir;)this.Hb(n[i++],s),i===e&&n!==f.lb[11]&&(i=0,e=f.ob[11],n=f.lb[11],l=f.cb),t=ih;)this.Hb(n[i++],s),i===e&&n!==f.lb[11]&&(i=0,e=f.ob[11],n=f.lb[11],l=f.cb),t=io;)this.Hb(n[i++],s),i===e&&n!==f.lb[11]&&(i=0,e=f.ob[11],n=f.lb[11],l=f.cb),t=i>2,h=this.Ob[i],o=this.Lb[i],l=this.Sb[i];r.A.fI(f.Qv[e],f.Qv[s],f.Qv[n],f.tb[e],f.tb[s],f.tb[n],this.Eb[t],this.vb[t],this.bb[t],f.eb[h],f.sb[h],f.nb[h],f.eb[o],f.eb[l],f.sb[o],f.sb[l],f.nb[o],f.nb[l],this.Eu[t])}else if(3===h&&this.y_&&this.Eu&&this.Eb&&f.Qv&&f.tb&&f.eb&&f.sb&&f.nb){const i=this.y_[t]>>2,h=this.Ob[i],o=this.Lb[i],l=this.Sb[i];r.A.fI(f.Qv[e],f.Qv[s],f.Qv[n],f.tb[e],f.tb[s],f.tb[n],this.Eb[t],this.Eb[t],this.Eb[t],f.eb[h],f.sb[h],f.nb[h],f.eb[o],f.eb[l],f.sb[o],f.sb[l],f.nb[o],f.nb[l],this.Eu[t])}}Vb(t,i=!1){let e=0;if(f.nb){const i=r.A.ra,s=r.A.ha,n=this.m_[t],h=this.p_[t],o=this.__[t],l=f.nb[n],a=f.nb[h],c=f.nb[o];if(l>=50&&f.Qv&&f.tb&&this.Eb)f.ub[e]=f.Qv[n],f.wb[e]=f.tb[n],f.yb[e++]=this.Eb[t];else if(f.eb&&f.sb&&this.Eb){const u=f.eb[n],d=f.sb[n],w=this.Eb[t];if(c>=50&&this.bb){const n=(50-l)*r.A.iv[c-l];f.ub[e]=i+((u+((f.eb[o]-u)*n>>16)<<9)/50|0),f.wb[e]=s+((d+((f.sb[o]-d)*n>>16)<<9)/50|0),f.yb[e++]=w+((this.bb[t]-w)*n>>16)}if(a>=50&&this.vb){const n=(50-l)*r.A.iv[a-l];f.ub[e]=i+((u+((f.eb[h]-u)*n>>16)<<9)/50|0),f.wb[e]=s+((d+((f.sb[h]-d)*n>>16)<<9)/50|0),f.yb[e++]=w+((this.vb[t]-w)*n>>16)}}if(a>=50&&f.Qv&&f.tb&&this.vb)f.ub[e]=f.Qv[h],f.wb[e]=f.tb[h],f.yb[e++]=this.vb[t];else if(f.eb&&f.sb&&this.vb){const u=f.eb[h],d=f.sb[h],w=this.vb[t];if(l>=50&&this.Eb){const h=(50-a)*r.A.iv[l-a];f.ub[e]=i+((u+((f.eb[n]-u)*h>>16)<<9)/50|0),f.wb[e]=s+((d+((f.sb[n]-d)*h>>16)<<9)/50|0),f.yb[e++]=w+((this.Eb[t]-w)*h>>16)}if(c>=50&&this.bb){const n=(50-a)*r.A.iv[c-a];f.ub[e]=i+((u+((f.eb[o]-u)*n>>16)<<9)/50|0),f.wb[e]=s+((d+((f.sb[o]-d)*n>>16)<<9)/50|0),f.yb[e++]=w+((this.bb[t]-w)*n>>16)}}if(c>=50&&f.Qv&&f.tb&&this.bb)f.ub[e]=f.Qv[o],f.wb[e]=f.tb[o],f.yb[e++]=this.bb[t];else if(f.eb&&f.sb&&this.bb){const u=f.eb[o],d=f.sb[o],w=this.bb[t];if(a>=50&&this.vb){const n=(50-c)*r.A.iv[a-c];f.ub[e]=i+((u+((f.eb[h]-u)*n>>16)<<9)/50|0),f.wb[e]=s+((d+((f.sb[h]-d)*n>>16)<<9)/50|0),f.yb[e++]=w+((this.vb[t]-w)*n>>16)}if(l>=50&&this.Eb){const h=(50-c)*r.A.iv[l-c];f.ub[e]=i+((u+((f.eb[n]-u)*h>>16)<<9)/50|0),f.wb[e]=s+((d+((f.sb[n]-d)*h>>16)<<9)/50|0),f.yb[e++]=w+((this.Eb[t]-w)*h>>16)}}}const s=f.ub[0],h=f.ub[1],o=f.ub[2],l=f.wb[0],a=f.wb[1],c=f.wb[2];if(!((s-h)*(c-a)-(l-a)*(o-h)<=0))if(r.A.eI=!1,3===e){let e;if((s<0||h<0||o<0||s>n.A.sI||h>n.A.sI||o>n.A.sI)&&(r.A.eI=!0),e=this.y_?3&this.y_[t]:0,i)r.A.qE(s,h,l,a,f.yb[0]),r.A.qE(h,o,a,c,f.yb[1]),r.A.qE(o,s,c,l,f.yb[2]);else if(0===e)r.A.oI(s,h,o,l,a,c,f.yb[0],f.yb[1],f.yb[2]);else if(1===e&&this.Eb)r.A.gv(s,h,o,l,a,c,r.A.palette[this.Eb[t]]);else if(2===e&&this.y_&&this.Eu&&f.eb&&f.sb&&f.nb){const i=this.y_[t]>>2,e=this.Ob[i],n=this.Lb[i],u=this.Sb[i];r.A.fI(s,h,o,l,a,c,f.yb[0],f.yb[1],f.yb[2],f.eb[e],f.sb[e],f.nb[e],f.eb[n],f.eb[u],f.sb[n],f.sb[u],f.nb[n],f.nb[u],this.Eu[t])}else if(3===e&&this.y_&&this.Eu&&this.Eb&&f.eb&&f.sb&&f.nb){const i=this.y_[t]>>2,e=this.Ob[i],n=this.Lb[i],u=this.Sb[i];r.A.fI(s,h,o,l,a,c,this.Eb[t],this.Eb[t],this.Eb[t],f.eb[e],f.sb[e],f.nb[e],f.eb[n],f.eb[u],f.sb[n],f.sb[u],f.nb[n],f.nb[u],this.Eu[t])}}else if(4===e){let e;if((s<0||h<0||o<0||s>n.A.sI||h>n.A.sI||o>n.A.sI||f.ub[3]<0||f.ub[3]>n.A.sI)&&(r.A.eI=!0),e=this.y_?3&this.y_[t]:0,i)r.A.qE(s,h,l,a,f.yb[0]),r.A.qE(h,o,a,c,f.yb[1]),r.A.qE(o,f.ub[3],c,f.wb[3],f.yb[2]),r.A.qE(f.ub[3],s,f.wb[3],l,f.yb[3]);else if(0===e)r.A.oI(s,h,o,l,a,c,f.yb[0],f.yb[1],f.yb[2]),r.A.oI(s,o,f.ub[3],l,c,f.wb[3],f.yb[0],f.yb[2],f.yb[3]);else if(1===e){if(this.Eb){const i=r.A.palette[this.Eb[t]];r.A.gv(s,h,o,l,a,c,i),r.A.gv(s,o,f.ub[3],l,c,f.wb[3],i)}}else if(2===e&&this.y_&&this.Eu&&f.eb&&f.sb&&f.nb){const i=this.y_[t]>>2,e=this.Ob[i],n=this.Lb[i],u=this.Sb[i];r.A.fI(s,h,o,l,a,c,f.yb[0],f.yb[1],f.yb[2],f.eb[e],f.sb[e],f.nb[e],f.eb[n],f.eb[u],f.sb[n],f.sb[u],f.nb[n],f.nb[u],this.Eu[t]),r.A.fI(s,o,f.ub[3],l,c,f.wb[3],f.yb[0],f.yb[2],f.yb[3],f.eb[e],f.sb[e],f.nb[e],f.eb[n],f.eb[u],f.sb[n],f.sb[u],f.nb[n],f.nb[u],this.Eu[t])}else if(3===e&&this.y_&&this.Eu&&this.Eb&&f.eb&&f.sb&&f.nb){const i=this.y_[t]>>2,e=this.Ob[i],n=this.Lb[i],u=this.Sb[i];r.A.fI(s,h,o,l,a,c,this.Eb[t],this.Eb[t],this.Eb[t],f.eb[e],f.sb[e],f.nb[e],f.eb[n],f.eb[u],f.sb[n],f.sb[u],f.nb[n],f.nb[u],this.Eu[t]),r.A.fI(s,o,f.ub[3],l,c,f.wb[3],this.Eb[t],this.Eb[t],this.Eb[t],f.eb[e],f.sb[e],f.nb[e],f.eb[n],f.eb[u],f.sb[n],f.sb[u],f.nb[n],f.nb[u],this.Eu[t])}}}Ub(t,i,e,s,n){if(!s)return;const h=s.length;if(0===n){let n=0;f.Ir=0,f.Ab=0,f.gr=0;for(let t=0;t0?(f.Ir=(f.Ir/n|0)+t,f.Ab=(f.Ab/n|0)+i,f.gr=(f.gr/n|0)+e):(f.Ir=t,f.Ab=i,f.gr=e)}else if(1===n)for(let n=0;n=this.Fd.length)continue;const h=this.Fd[r];if(h)for(let s=0;s=this.Fd.length)continue;const o=this.Fd[h];if(o)for(let s=0;s>16;this.Sd[n]=this.Sd[n]*u-this.Od[n]*c>>16,this.Od[n]=t}if(0!==h){c=r.A.sin[h],u=r.A.cos[h];const t=this.Sd[n]*u-this.Ld[n]*c>>16;this.Ld[n]=this.Sd[n]*c+this.Ld[n]*u>>16,this.Sd[n]=t}if(0!==l){c=r.A.sin[l],u=r.A.cos[l];const t=this.Ld[n]*c+this.Od[n]*u>>16;this.Ld[n]=this.Ld[n]*u-this.Od[n]*c>>16,this.Od[n]=t}this.Od[n]+=f.Ir,this.Sd[n]+=f.Ab,this.Ld[n]+=f.gr}}else if(3===n)for(let n=0;n=this.Fd.length)continue;const h=this.Fd[r];if(h)for(let s=0;s=this.Dd.length)continue;const n=this.Dd[e];if(n)for(let i=0;i255&&(this.Rb[e]=255)}}}Gb(){this.Ud=0,this.dm=0,this.c_=0,this.f_=999999,this.u_=-999999,this.w_=-99999,this.d_=99999;for(let t=0;tthis.u_&&(this.u_=i),sthis.w_&&(this.w_=s),-e>this.Ud&&(this.Ud=-e),e>this.c_&&(this.c_=e);const n=i*i+s*s;n>this.dm&&(this.dm=n)}this.dm=0|Math.sqrt(this.dm),this.Mb=0|Math.sqrt(this.dm*this.dm+this.Ud*this.Ud),this.xb=this.Mb+(0|Math.sqrt(this.dm*this.dm+this.c_*this.c_))}Yb(t,i,e,s,n,r,h,o){return!(ie&&i>s&&i>n)&&(!(t{e.d(i,{A:()=>o});var s=e(8950),n=e(1069),r=e(4474),h=e(880);class o extends r.A{aw;width;height;Xb;jb;Nl;nw;constructor(t,i){super(),this.aw=new Int32Array(t*i),this.width=this.Nl=t,this.height=this.nw=i,this.Xb=this.jb=0}static zb=async(t,i)=>{const e=t.read(i+'.dat');if(!e)throw new Error(`${i} jpeg not found!`);const s=await(0,h.r)(e),n=new o(s.width,s.height),r=new Uint32Array(s.data.buffer),l=n.aw;for(let t=0;t>24&255)<<24|(255&i)<<16|(i>>8&255)<<8|i>>16&255}return n};static Cu=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.af=s.ou;const h=r.ou,l=r.ou,a=[],c=r.au-1;for(let t=0;ts.length||r.af>r.length)throw new Error;const f=r.au,u=r.au,d=r.ou,w=r.ou,y=new o(d,w);y.Xb=f,y.jb=u,y.Nl=h,y.nw=l;const A=r.au;if(0===A){const t=y.width*y.height;for(let i=0;is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,l+=i,o+=i}h>0&&r>0&&this.Zb(h,r,this.aw,n,l,s.A.aw,e,o)}Fl(t,i,e){i|=0,e|=0;let n=(i+=this.Xb)+(e+=this.jb)*s.A.cw,r=0,h=this.height,o=this.width,l=s.A.cw-o,a=0;if(es.A.bottom&&(h-=e+h-s.A.bottom),is.A.right){const t=i+o-s.A.right;o-=t,a+=t,l+=t}o>0&&h>0&&this.qb(o,h,this.aw,r,a,s.A.aw,n,l,t)}Jb(t,i){t|=0,i|=0;let e=(t+=this.Xb)+(i+=this.jb)*s.A.cw,n=0,r=this.height,h=this.width,o=s.A.cw-h,l=0;if(is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,l+=i,o+=i}h>0&&r>0&&this.$b(h,r,this.aw,n,l,s.A.aw,e,o)}Qb(){const t=this.aw,i=this.width,e=this.height;for(let s=0;s>16&255;r+=t,r<1?r=1:r>255&&(r=255);let h=n>>8&255;h+=i,h<1?h=1:h>255&&(h=255);let o=255&n;o+=e,o<1?o=1:o>255&&(o=255),this.aw[s]=(r<<16)+(h<<8)+o}}}gw(t,i,e,n){t|=0,i|=0,e|=0,n|=0;try{const r=this.width;let h=0,o=0;const l=this.Nl,a=this.nw,c=(l<<16)/e|0,f=(a<<16)/n|0;t+=(this.Xb*e+l-1)/l|0,i+=(this.jb*n+a-1)/a|0,this.Xb*e%l!=0&&(h=(l-this.Xb*e%l<<16)/e|0),this.jb*n%a!=0&&(o=(a-this.jb*n%a<<16)/n|0),e=e*(this.width-(h>>16))/l|0,n=n*(this.height-(o>>16))/a|0;let u=t+i*s.A.cw,d=s.A.cw-e;if(is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right){const i=t+e-s.A.right;e-=i,d+=i}this.scale(e,n,this.aw,h,o,s.A.aw,d,u,r,c,f)}catch(t){console.error('error in sprite clipping routine')}}iT(t,i,e,n,r,h,o,l,a,c){t|=0,i|=0,e|=0,n|=0;try{const f=-e/2|0,u=-n/2|0,d=65536*Math.sin(a/326.11)|0,w=65536*Math.cos(a/326.11)|0,y=d*c>>8,A=w*c>>8;let m=(o<<16)+u*y+f*A,p=u*A-f*y+(l<<16),_=t+i*s.A.cw;for(let t=0;t>16)+(o>>16)*this.width],n+=A,o-=y;m+=y,p+=A,_+=s.A.cw}}catch(t){}}eT(t,i,e){t|=0,i|=0;let n=(t+=this.Xb)+(i+=this.jb)*s.A.cw,r=0,h=this.height,o=this.width,l=s.A.cw-o,a=0;if(is.A.bottom&&(h-=i+h-s.A.bottom),ts.A.right){const i=t+o-s.A.right;o-=i,a+=i,l+=i}o>0&&h>0&&this.sT(o,h,this.aw,a,r,s.A.aw,n,l,e.aw)}scale(t,i,e,s,n,r,h,o,l,a,c){try{const f=s;for(let u=-i;u<0;u++){const i=(n>>16)*l;for(let n=-t;n<0;n++){const t=e[(s>>16)+i];0===t?o++:r[o++]=t,s+=a}n+=c,s=f,o+=h}}catch(t){console.error('error in plot_scale')}}$b(t,i,e,s,n,r,h,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++)r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++];for(let i=t;i<0;i++)r[h++]=e[s++];h+=o,s+=n}}qb(t,i,e,s,n,r,h,o,l){const a=256-l;for(let c=-i;c<0;c++){for(let i=-t;i<0;i++){const t=e[s++];if(0===t)h++;else{const i=r[h];r[h++]=((16711935&t)*l+(16711935&i)*a&4278255360)+((65280&t)*l+(65280&i)*a&16711680)>>8}}h+=o,s+=n}}Zb(t,i,e,s,n,r,h,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=e[s++];0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=t}h+=o,s+=n}}sT(t,i,e,s,n,r,h,o,l){const a=-(t>>2);t=-(3&t);for(let c=-i;c<0;c++){for(let t=a;t<0;t++){let t=e[n++];0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++}for(let i=t;i<0;i++){const t=e[n++];0!==t&&0===l[h]?r[h++]=t:h++}h+=o,n+=s}}}},1673:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(8950),n=e(1069),r=e(4474);class h extends r.A{aw;width;height;Xb;jb;Nl;nw;palette;constructor(t,i,e){super(),this.aw=new Int8Array(t*i),this.width=this.Nl=t,this.height=this.nw=i,this.Xb=this.jb=0,this.palette=e}static Cu=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.af=s.ou;const o=r.ou,l=r.ou,a=r.au,c=new Int32Array(a);for(let t=1;ts.length||r.af>r.length)throw new Error;const f=r.au,u=r.au,d=r.ou,w=r.ou,y=new h(d,w,c);y.Xb=f,y.jb=u,y.Nl=o,y.nw=l;const A=y.aw,m=r.au;if(0===m){const t=y.width*y.height;for(let i=0;is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,l+=i,o+=i}h>0&&r>0&&this.nT(h,r,this.aw,n,l,s.A.aw,e,o)}Qb(){const t=this.aw,i=this.width,e=this.height;for(let s=0;s>16&255;n+=t,n<0?n=0:n>255&&(n=255);let r=this.palette[s]>>8&255;r+=i,r<0?r=0:r>255&&(r=255);let h=255&this.palette[s];h+=e,h<0?h=0:h>255&&(h=255),this.palette[s]=(n<<16)+(r<<8)+h}}yv(){this.Nl|=0,this.nw|=0,this.Nl/=2,this.nw/=2,this.Nl|=0,this.nw|=0;const t=new Int8Array(this.Nl*this.nw);let i=0;for(let e=0;e>1)+(e+this.jb>>1)*this.Nl]=this.aw[i++];this.aw=t,this.width=this.Nl,this.height=this.nw,this.Xb=0,this.jb=0}gw(){if(this.width===this.Nl&&this.height===this.nw)return;const t=new Int8Array(this.Nl*this.nw);let i=0;for(let e=0;e>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=e[s++];0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t]}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=this.palette[255&t]}h+=o,s+=n}}clip(t,i,e,n){try{const r=this.width;this.height;let h=0,o=0;const l=this.Nl,a=this.nw,c=(l<<16)/e|0,f=(a<<16)/n|0;t=t+(this.Xb*e+l-1)/l|0,i=i+(this.jb*n+a-1)/a|0,this.Xb*e%l!=0&&(h=(l-this.Xb*e%l<<16)/e|0),this.jb*n%a!=0&&(o=(a-this.jb*n%a<<16)/n|0),e=e*(this.width-(h>>16))/l|0,n=n*(this.height-(o>>16))/a|0;let u,d=t+i*s.A.cw,w=s.A.cw-e;is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right&&(u=t+e-s.A.right,e-=u,w+=u),this.rT(s.A.aw,this.aw,this.palette,h,o,d,w,e,n,c,f,r)}catch(t){console.log('error in sprite clipping routine')}}rT(t,i,e,s,n,r,h,o,l,a,c,f){try{const u=s;for(let d=-l;d<0;d++){const l=(n>>16)*f;for(let n=-o;n<0;n++){const n=i[(s>>16)+l];0==n?r++:t[r++]=e[255&n],s+=a}n+=c,s=u,r+=h}}catch(t){console.log('error in plot_scale')}}}},1183:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(8950),n=e(7854);class r{hT;width;height;oT;lT;aw;constructor(t,i,e=n.zo){this.oT=e,this.hT=this.oT.getImageData(0,0,t,i),this.lT=new Uint32Array(this.hT.data.buffer),this.aw=new Int32Array(t*i),this.width=t,this.height=i,this.bind()}clear(){this.aw.fill(0)}bind(){s.A.bind(this.aw,this.width,this.height)}draw(t,i){this.#t(),this.oT.putImageData(this.hT,t,i)}#t(){const t=this.aw.length,i=this.aw,e=this.lT;for(let s=0;s>16&255|(t>>8&255)<<8|(255&t)<<16|4278190080}}}},4544:(t,i,e)=>{e.d(i,{A:()=>s});class s{db;constructor(t){t.onerror=this.onerror,t.onclose=this.onclose,this.db=t}static openDatabase=async()=>await new Promise(((t,i)=>{const e=indexedDB.open('lostcity',1);e.onsuccess=i=>{const e=i.target;console.log('database success!'),t(e.result)},e.onupgradeneeded=t=>{t.target.result.createObjectStore('cache')},e.onerror=t=>{const e=t.target;console.error('database error!: ',e.error),i(e.result)}}));Uo=async t=>await new Promise((i=>{const e=this.db.transaction('cache','readonly').objectStore('cache').get(t);e.onsuccess=()=>{i(e.result)},e.onerror=t=>{i(void 0)}}));Ho=async(t,i)=>await new Promise(((e,s)=>{const n=this.db.transaction('cache','readwrite').objectStore('cache').put(i,t);n.onsuccess=()=>{e()},n.onerror=t=>{s()}}));onclose=t=>{console.log('database close!')};onerror=t=>{console.log('database error!')};aT=t=>{const i=t.trim();let e=0;for(let t=0;t='A'&&s<='Z'?e+=s.charCodeAt(0)+1-65:s>='a'&&s<='z'?e+=s.charCodeAt(0)+1-97:s>='0'&&s<='9'&&(e+=s.charCodeAt(0)+27-48)}return e}}},2901:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(1908);class r{static aT=t=>{let i=0;t=t.toUpperCase();for(let e=0;e=this.fT)return null;if(this.AT[t])return this.AT[t];const i=this.yT[t],e=i+this.wT[t];if(this.cT){const s=Uint8Array.from(this.buffer.subarray(i,i+e));return this.AT[t]=s,s}{const i=Uint8Array.from(n.A.read(this.dT[t],this.buffer,this.wT[t],this.yT[t]));return this.AT[t]=i,i}}}},1069:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(9234),n=e(6666),r=e(4474);class h extends r.A{static pT=3988292384;static _T=new Int32Array(256);static IT=new Uint32Array(33);static gT=new n.A;static CT=new n.A;static ET=new n.A;static vT=0;static bT=0;static TT=0;static{for(let t=0;t<32;t++)h.IT[t]=(1<>>=1:i=i>>>1^h.pT;h._T[t]=i}}static Po=t=>{let i=4294967295;for(let e=0;e>>8^h._T[255&(i^t[e])];return~i};view;data;af=0;RT=0;random=null;constructor(t){if(!t)throw new Error('Input src packet array was null!');super(),t instanceof Int8Array?this.data=new Uint8Array(t):this.data=t,this.view=new DataView(this.data.buffer,this.data.byteOffset,this.data.byteLength)}get length(){return this.view.byteLength}get available(){return this.length-this.af}static Ut=t=>{let i=null;return 0===t&&h.vT>0?(h.vT--,i=h.gT.B_()):1===t&&h.bT>0?(h.bT--,i=h.CT.B_()):2===t&&h.TT>0&&(h.TT--,i=h.ET.B_()),i?(i.af=0,i):new h(0===t?new Uint8Array(100):1===t?new Uint8Array(5e3):new Uint8Array(3e4))};release(){this.af=0,100===this.view.byteLength&&h.vT<1e3?(h.gT.MA(this),h.vT++):5e3===this.view.byteLength&&h.bT<250?(h.CT.MA(this),h.bT++):3e4===this.view.byteLength&&h.TT<50&&(h.ET.MA(this),h.TT++)}get au(){return this.view.getUint8(this.af++)}get bd(){return this.view.getInt8(this.af++)}get ou(){const t=this.view.getUint16(this.af);return this.af+=2,t}get fu(){const t=this.view.getInt16(this.af);return this.af+=2,t}get Wu(){const t=this.view.getUint8(this.af++)<<16|this.view.getUint16(this.af);return this.af+=2,t}get Ko(){const t=this.view.getInt32(this.af);return this.af+=4,t}get JC(){const t=this.view.getBigInt64(this.af);return this.af+=8,t}get RE(){return this.view.getUint8(this.af)<128?this.au-64:this.ou-49152}get um(){return this.view.getUint8(this.af)<128?this.au:this.ou-32768}get wu(){const t=this.view,i=t.byteLength;let e,s='';for(;10!==(e=t.getUint8(this.af++))&&this.af>16),this.view.setUint16(this.af,t),this.af+=2}p4(t){this.view.setInt32(this.af,t),this.af+=4}MT(t){this.view.setInt32(this.af,t,!0),this.af+=4}kT(t){this.view.setBigInt64(this.af,t),this.af+=8}DT(t){const i=this.view,e=t.length;for(let s=0;s>>3,e=8-(7&this.RT),s=0;for(this.RT+=t;t>e;e=8)s+=(this.view.getUint8(i++)&h.IT[e])<>>e-t&h.IT[t],s}GT(t,i){const e=this.af;this.af=0;const n=new Uint8Array(e);this.OT(e,0,n);const r=(0,s.WT)(n),h=(0,s.YT)(r,i,t),o=(0,s.HT)(h);this.af=0,this.p1(o.length),this.FT(o,o.length,0)}}},3937:(t,i,e)=>{e.d(i,{A:()=>o});class s{start=0;end=0;form=0;length=0;VT=null;KT=null;threshold=0;position=0;delta=0;amplitude=0;XT=0;read(t){this.form=t.au,this.start=t.Ko,this.end=t.Ko,this.length=t.au,this.VT=new Int32Array(this.length),this.KT=new Int32Array(this.length);for(let i=0;i=this.threshold&&this.KT&&this.VT&&(this.amplitude=this.KT[this.position++]<<15,this.position>=this.length&&(this.position=this.length-1),this.threshold=this.VT[this.position]/65536*t|0,this.threshold>this.XT&&(this.delta=((this.KT[this.position]<<15)-this.amplitude)/(this.threshold-this.XT)|0)),this.amplitude+=this.delta,this.XT++,this.amplitude-this.delta>>15}}class n{static buffer=null;static SA=null;static sin=null;static jT=new Int32Array(5);static zT=new Int32Array(5);static ZT=new Int32Array(5);static qT=new Int32Array(5);static JT=new Int32Array(5);$T=null;QT=null;tR=null;iR=null;eR=null;sR=null;release=null;attack=null;nR=new Int32Array(5);rR=new Int32Array(5);hR=new Int32Array(5);start=0;length=500;oR=100;lR=0;static init=()=>{this.SA=new Int32Array(32768);for(let t=0;t<32768;t++)Math.random()>.5?this.SA[t]=1:this.SA[t]=-1;this.sin=new Int32Array(32768);for(let t=0;t<32768;t++)this.sin[t]=16384*Math.sin(t/5215.1903)|0;this.buffer=new Int32Array(220500)};aR(t,i){for(let i=0;i>1,h+=(i*s>>16)+r}if(this.eR&&this.sR){const i=this.eR.evaluate(t),e=this.sR.evaluate(t);c=c*(32768+(this.cR(e,a,this.eR.form)>>1))>>15,a+=(i*o>>16)+l}for(let s=0;s<5;s++)if(0!==this.nR[s]){const r=i+n.zT[s];r>15,n.jT[s],this.$T.form),n.jT[s]+=(e*n.qT[s]>>16)+n.JT[s])}}if(this.release&&this.attack){this.release.reset(),this.attack.reset();let i=0,e=!0;for(let s=0;s>8):this.release.start+((this.release.end-this.release.start)*h>>8),i+=256,i>=o&&(i=0,e=!e),e&&(n.buffer[s]=0)}}if(this.lR>0&&this.oR>0){const i=this.lR*e;for(let e=i;e32767&&(n.buffer[i]=32767);return n.buffer}cR(t,i,e){return 1===e?(32767&i)<16384?t:-t:2===e?n.sin[32767&i]*t>>14:3===e?((32767&i)*t>>14)-t:4===e?n.SA[i/2607&32767]*t:0}read(t){this.$T=new s,this.$T.read(t),this.QT=new s,this.QT.read(t),0!==t.au&&(t.af--,this.tR=new s,this.tR.read(t),this.iR=new s,this.iR.read(t)),0!==t.au&&(t.af--,this.eR=new s,this.eR.read(t),this.sR=new s,this.sR.read(t)),0!==t.au&&(t.af--,this.release=new s,this.release.read(t),this.attack=new s,this.attack.read(t));for(let i=0;i<10;i++){const e=t.um;if(0===e)break;this.nR[i]=e,this.rR[i]=t.RE,this.hR[i]=t.um}this.lR=t.um,this.oR=t.um,this.length=t.ou,this.start=t.ou}}var r=e(1069),h=e(3867);class o{static fR=new Int32Array(1e3);static uR=null;static dR=null;static wR=new h.fe(1e3,null);yR=new h.fe(10,null);AR=0;loopEnd=0;static hu=t=>{const i=new r.A(t.read('sounds.dat'));for(this.uR=new Uint8Array(441e3),this.dR=new r.A(this.uR),n.init();;){const t=i.ou;if(65535===t)break;const e=new o;e.read(i),this.wR[t]=e,this.fR[t]=e.trim()}};static aR=(t,i)=>{if(!this.wR[t])return null;const e=this.wR[t];return e?.mR(i)??null};read(t){for(let i=0;i<10;i++)0!==t.au&&(t.af--,this.yR[i]=new n,this.yR[i]?.read(t));this.AR=t.ou,this.loopEnd=t.ou}trim(){let t=9999999;for(let i=0;i<10;i++)this.yR[i]&&(this.yR[i].start/20|0)i&&(i=this.yR[t].length+this.yR[t].start);if(0===i)return 0;let e=22050*i/1e3|0,s=22050*this.AR/1e3|0,n=22050*this.loopEnd/1e3|0;(s<0||n<0||n>e||s>=n)&&(t=0);let r=e+(n-s)*(t-1);for(let t=44;t>8<<24>>24)}if(t>1){s+=44,n+=44,e+=44,r+=44;const i=r-e;for(let t=e-1;t>=n;t--)o.uR&&(o.uR[t+i]=o.uR[t]);for(let i=1;i{e.d(i,{qA:()=>a,ZA:()=>o,fe:()=>s,gm:()=>n,Eh:()=>r,Am:()=>h,Xr:()=>l});class s extends Array{constructor(t,i){super(t);for(let e=0;e{e.d(i,{HT:()=>o,Wo:()=>n,WT:()=>h,Yo:()=>s,Xa:()=>r,YT:()=>l});const s=async t=>new Promise((i=>setTimeout(i,t))),n=async t=>new Int8Array(await(await fetch(t)).arrayBuffer()),r=async t=>(await fetch(t)).text();function h(t){let i=0n;for(let e=0;e0n;)i.unshift(Number(0xffn&t)),t>>=8n;return 128&i[0]&&i.unshift(0),new Uint8Array(i)}function l(t,i,e){let s=1n;for(;i>0n;)i%2n===1n&&(s=s*t%e),t=t*t%e,i>>=1n;return s}},7608:(t,i,e)=>{e.a(t,(async(t,i)=>{try{var s=e(9234),n=e(1069),r=e(3937),h=e(4544),o=e(1908),l=e(123),a=(e(9896),e(7604)),c=e(1651);class t extends c.K{pR=[];async _R(t){const i=new Map,e=(await(0,s.Xa)(t)).split('\n');for(let t=0;t{if(this.Mt)this.kt=!0;else{this.Mt=!0;try{await this.Go(10,'Connecting to fileserver'),await o.A.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new h.A(await h.A.openDatabase());const t=new n.A(new Uint8Array(await(0,s.Wo)(`${c.K.nt}/crc`)));for(let i=0;i<9;i++)this.Bt[i]=t.Ko;const i=await this.Bo('sounds','sound effects',this.Bt[8],70);await this.Go(50,'Unpacking sounds'),r.A.hu(i),await this.Go(100,'Getting ready to start...'),await this.IR()}catch(t){this.Dt=!0,console.error(t)}}};async IR(){const t=document.getElementById('sounds');if(!t)return;t.innerHTML='',this.pR[1]=await this._R(`${c.K.lt}/data/src/pack/sound.pack`);const i=document.createElement('input');i.type='search',i.placeholder='Search',i.tabIndex=1,i.oninput=()=>{const t=document.querySelector('#soundList');if(!t)return;const e=i.value.toLowerCase().replaceAll(' ','_');for(let i=0;i-1||n.indexOf(e)>-1||r.indexOf(e)>-1?s.style.display='':s.style.display='none'}},t.appendChild(i);const e=document.createElement('ul');e.id='soundList',e.className='list-group',t.appendChild(e);for(const[t,i]of this.pR[1]){const s=document.createElement('li');s.id=i,s.setAttribute('rs-id',t.toString()),s.setAttribute('rs-debugname',i),s.className='list-group-item list-group-item-center',s.innerText=i+' - '+t,0===t&&(s.className+=' active'),s.onclick=async()=>{const i=e.querySelector('.active');i&&(i.className='list-group-item list-group-item-center'),s.className='list-group-item list-group-item-center active';const n=r.A.aR(t,0);n&&await(0,l.gR)(n.data.slice(0,n.af),128)},e.appendChild(s)}}}await(0,a.w)(),(new t).Rc().then((()=>{})),window.onkeydown=function(t){return!(' '===t.key&&t.target===document.body)},i()}catch(t){i(t)}}),1)},1908:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(9763);class n{static CR=null;static load=async t=>{this.CR=await(0,s.F)(new WebAssembly.Module(t),{env:void 0})};static read=(t,i,e,s)=>{if(!this.CR)throw new Error('bz2 not found!!');return Int8Array.from(this.CR.read(t,i,e,s))}}},123:(t,i,e)=>{let s;async function n(t,i){!function(t){s||(s=window.audioContext.createGain(),s.connect(window.audioContext.destination));s.gain.value=t/256}(i);try{const i=await window.audioContext.decodeAudioData(Uint8Array.from(t).buffer);let e=window.audioContext.createBufferSource();e.buffer=i,e.connect(s),e.start()}catch(t){console.log(t)}}function r(t,i){window._tinyMidiPlay&&window._tinyMidiPlay(t,i/256)}function h(){window._tinyMidiStop&&window._tinyMidiStop()}e.d(i,{gR:()=>n,Xo:()=>r,Ro:()=>h})},9763:(t,i,e)=>{async function s(t,i={}){const e={env:Object.assign(Object.create(globalThis),i.env||{},{abort(t,i,e,s){t=h(t>>>0),i=h(i>>>0),e>>>=0,s>>>=0,(()=>{throw Error(`${t} in ${i}:${e}:${s}`)})()}})},{exports:s}=await WebAssembly.instantiate(t,e),n=s.memory||i.env.memory,r=Object.setPrototypeOf({read:(t,i,e,r)=>(i=function(t,i,e,r,h){if(null==r)return 0;const o=r.length,l=s.__pin(s.__new(o<>>0;if(h)new h(n.buffer,l,o).set(r);else for(let i=0;i>>0),r[i]);return s.__unpin(l),l}(l,6,0,i,Int8Array)||function(){throw TypeError("value must not be null")}(),function(t,i,e){if(!e)return null;const s=function(t){try{return o.getUint32(t,!0)}catch{return o=new DataView(n.buffer),o.getUint32(t,!0)}}(e-4)>>>i,r=new Array(s);for(let n=0;n>>0));return r}(a,0,s.read(t,i,e,r)>>>0))},s);function h(t){if(!t)return null;const i=t+new Uint32Array(n.buffer)[t-4>>>2]>>>1,e=new Uint16Array(n.buffer);let s=t>>>1,r="";for(;i-s>1024;)r+=String.fromCharCode(...e.subarray(s,s+=1024));return r+String.fromCharCode(...e.subarray(s,i))}let o=new DataView(n.buffer);function l(t,i){try{o.setUint8(t,i,!0)}catch{o=new DataView(n.buffer),o.setUint8(t,i,!0)}}function a(t){try{return o.getInt8(t,!0)}catch{return o=new DataView(n.buffer),o.getInt8(t,!0)}}return r}e.d(i,{F:()=>s})},9896:(t,i,e)=>{var s=e(8151);!function(){window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioContext&&(window.audioContext=new window.AudioContext);var t=function(i){if(window.audioContext){var e=window.audioContext.createBuffer(1,1,22050),s=window.audioContext.createBufferSource();s.buffer=e,s.connect(window.audioContext.destination),s.start?s.start(0):s.play?s.play(0):s.noteOn&&s.noteOn(0)}document.removeEventListener('touchstart',t),document.removeEventListener('touchend',t),document.removeEventListener('click',t)};document.addEventListener('touchstart',t),document.addEventListener('touchend',t),document.addEventListener('click',t)}(),(async()=>{let t=new Float32Array,i=window.audioContext.createGain();i.gain.value=.1,i.connect(window.audioContext.destination);let e=window.audioContext.currentTime,n=[];const r=new s.A({ER:30,vR:i=>{let e=new Float32Array(i.buffer),s=new Float32Array(t.length+e.length);s.set(t,0),s.set(e,t.length),t=s},bR:t=>{},bufferSize:102400});await r.init();const h=await fetch('./SCC1_Florestan.sf2'),o=new Uint8Array(await h.arrayBuffer());function l(){if(!window.audioContext||!t.length)return;let s=window.audioContext.createBufferSource();const r=t.length/2,h=window.audioContext.createBuffer(2,r,44100);for(let i=0;i<2;i++){const e=h.getChannelData(i);let s=i;for(let i=0;i{if(a&&clearInterval(a),t=new Float32Array,n.length){let t=i.gain.value;i.gain.value=0,n.forEach((t=>{t.stop(window.audioContext.currentTime)})),n=[],i.gain.value=t}},window._tinyMidiVolume=(t=1)=>{i.gain.value=t},window._tinyMidiPlay=async(t,i=1)=>{t&&(await window._tinyMidiStop(),-1!=i&&window._tinyMidiVolume(i),e=window.audioContext.currentTime,a=setInterval(l,250),r.RR(t))}})()},8151:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5473);const n=class{constructor(t={}){this.OR=void 0,this.LR=0,this.SR=0,this.xR=0,this.ER=t.ER||100,this.sampleRate=t.sampleRate||44100,this.MR=t.MR||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.kR(1),this.vR=t.vR||(()=>{}),this.bR=t.bR||(()=>{}),this.DR=void 0,this.test=0}async init(){if(!this.OR){if('undefined'!=typeof process){const{FR:t}=await import('path'),{NR:i}=await import('module');globalThis.__dirname=t("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js"),globalThis.require=i("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js")}this.OR=await(0,s.A)(),this.BR=this.OR._malloc(this.bufferSize),this.UR=this.OR._malloc(8)}}kR(t){this.bufferSize=4*this.sampleRate*this.MR*t}PR(){if(!this.OR)throw new Error(`${this.constructor.name} not initalized. call .init()`)}TR(t){this.PR();const{_malloc:i,_free:e,_tsf_load_memory:s,_tsf_set_output:n,_tsf_channel_set_bank_preset:r,_tsf_set_max_voices:h,_tsf_channel_set_presetnumber:o}=this.OR;e(this.LR),this.LR=i(t.length),this.OR.HEAPU8.set(t,this.LR),this.SR=s(this.LR,t.length),n(this.SR,2===this.MR?0:2,this.sampleRate,this.gain)}GR(){this.PR();const t=new Uint8Array(this.bufferSize);return t.set(this.OR.HEAPU8.subarray(this.BR,this.BR+this.bufferSize)),t}WR(t){const{_malloc:i,_free:e,_tml_load_memory:s}=this.OR;return e(this.xR),this.xR=i(t.length),this.OR.HEAPU8.set(t,this.xR),s(this.xR,t.length)}YR(t){const{_midi_render:i}=this.OR;return i(this.SR,t,this.MR,this.sampleRate,this.BR,this.bufferSize,this.UR)}RR(t){if(this.PR(),!this.SR)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.DR);const{setValue:i,getValue:e}=this.OR;i(this.UR,0,'double'),this.OR._tsf_reset(this.SR),this.OR._tsf_channel_set_bank_preset(this.SR,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let s=this.WR(t);const n=()=>{s=this.YR(s);const t=this.GR();this.vR(t),s?this.DR=setTimeout(n,this.ER):this.bR(e(this.UR,'double'))};this.DR=setTimeout(n,16)}}},8227:(t,i,e)=>{t.exports=e.p+"9f86b5397894e28b5ae2.wasm"},5473:(t,i,e)=>{var s;e.d(i,{A:()=>n});const n=(s="file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/tinymidipcm.mjs",function(t){var i,n,r=void 0!==(t=t||{})?t:{};r.ready=new Promise((function(t,e){i=t,n=e})),["_tsf_load_memory","_tsf_set_output","_tsf_channel_set_bank_preset","_tsf_set_max_voices","_tsf_channel_set_presetnumber","_tsf_reset","_tsf_close","_tml_load_memory","_midi_render","_malloc","_realloc","_free","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(r.ready,t)||Object.defineProperty(r.ready,t,{get:()=>j('You are getting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),set:()=>j('You are setting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js')})}));var h=Object.assign({},r),o=[],l='object'==typeof window,a='function'==typeof importScripts,c='object'==typeof process&&'object'==typeof process.versions&&'string'==typeof process.versions.node,f=!l&&!c&&!a;if(r.ENVIRONMENT)throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');var u,d,w,y='';if(c){if('undefined'==typeof process||!process.release||'node'!==process.release.name)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');var A,m;y=a?require('path').FR(y)+'/':__dirname+'/';var p=()=>{m||(A=require('fs'),m=require('path'))};u=(t,i)=>(p(),t=m.normalize(t),A.HR(t,i?void 0:'utf8')),w=t=>{var i=u(t,!0);return i.buffer||(i=new Uint8Array(i)),D(i.buffer),i},d=(t,i,e)=>{p(),t=m.normalize(t),A.VR(t,(function(t,s){t?e(t):i(s.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,'/'),o=process.argv.slice(2),process.on('uncaughtException',(function(t){if(!(t instanceof nt))throw t})),process.on('unhandledRejection',(function(t){throw t})),r.inspect=function(){return'[Emscripten Module object]'}}else if(f){if('object'==typeof process&&'function'==typeof require||'object'==typeof window||'function'==typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');'undefined'!=typeof read&&(u=function(t){return read(t)}),w=function(t){let i;return'function'==typeof readbuffer?new Uint8Array(readbuffer(t)):(i=read(t,'binary'),D('object'==typeof i),i)},d=function(t,i,e){setTimeout((()=>i(w(t))),0)},'undefined'!=typeof scriptArgs?o=scriptArgs:void 0!==arguments&&(o=arguments),'undefined'!=typeof print&&('undefined'==typeof console&&(console={}),console.log=print,console.warn=console.error='undefined'!=typeof printErr?printErr:print)}else{if(!l&&!a)throw new Error('environment detection error');if(a?y=self.location.href:'undefined'!=typeof document&&document.currentScript&&(y=document.currentScript.src),s&&(y=s),y=0!==y.indexOf('blob:')?y.substr(0,y.replace(/[?#].*/,"").lastIndexOf('/')+1):'','object'!=typeof window&&'function'!=typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');u=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.send(null),i.responseText},a&&(w=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.responseType='arraybuffer',i.send(null),new Uint8Array(i.response)}),d=(t,i,e)=>{var s=new XMLHttpRequest;s.open('GET',t,!0),s.responseType='arraybuffer',s.onload=()=>{200==s.status||0==s.status&&s.response?i(s.response):e()},s.onerror=e,s.send(null)}}r.print||console.log.bind(console);var _,I,g=r.printErr||console.warn.bind(console);function C(t,i){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){j('Module.'+t+' has been replaced with plain '+i+' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')}})}function E(t){return'FS_createPath'===t||'FS_createDataFile'===t||'FS_createPreloadedFile'===t||'FS_unlink'===t||'addRunDependency'===t||'FS_createLazyFile'===t||'FS_createDevice'===t||'removeRunDependency'===t}Object.assign(r,h),h=null,_='fetchSettings',Object.getOwnPropertyDescriptor(r,_)&&j('`Module.'+_+'` was supplied but `'+_+'` not included in INCOMING_MODULE_JS_API'),r.arguments&&(o=r.arguments),C('arguments','arguments_'),r.thisProgram&&r.thisProgram,C('thisProgram','thisProgram'),r.quit&&r.quit,C('quit','quit_'),D(void 0===r.memoryInitializerPrefixURL,'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.pthreadMainPrefixURL,'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.cdInitializerPrefixURL,'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.filePackagePrefixURL,'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.read,'Module.read option was removed (modify read_ in JS)'),D(void 0===r.readAsync,'Module.readAsync option was removed (modify readAsync in JS)'),D(void 0===r.readBinary,'Module.readBinary option was removed (modify readBinary in JS)'),D(void 0===r.setWindowTitle,'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'),D(void 0===r.TOTAL_MEMORY,'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'),C('read','read_'),C('readAsync','readAsync'),C('readBinary','readBinary'),C('setWindowTitle','setWindowTitle'),D(!f,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),r.wasmBinary&&(I=r.wasmBinary),C('wasmBinary','wasmBinary');var v;r.noExitRuntime;C('noExitRuntime','noExitRuntime'),'object'!=typeof WebAssembly&&j('no native wasm support detected');var b,T,R,O,L,S,x,M,k=!1;function D(t,i){t||j('Assertion failed'+(i?': '+i:''))}function F(t){b=t,r.HEAP8=T=new Int8Array(t),r.HEAP16=O=new Int16Array(t),r.HEAP32=L=new Int32Array(t),r.HEAPU8=R=new Uint8Array(t),r.HEAPU16=new Uint16Array(t),r.HEAPU32=S=new Uint32Array(t),r.HEAPF32=x=new Float32Array(t),r.HEAPF64=M=new Float64Array(t)}'undefined'!=typeof TextDecoder&&new TextDecoder('utf8');var N=5242880;r.TOTAL_STACK&&D(N===r.TOTAL_STACK,'the stack size can no longer be determined at runtime');var B=r.INITIAL_MEMORY||16777216;function U(){if(!k){var t=ft(),i=S[t>>2],e=S[t+4>>2];34821223==i&&2310721022==e||j('Stack overflow! Stack cookie has been overwritten at 0x'+t.toString(16)+', expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+e.toString(16)+' 0x'+i.toString(16)),1668509029!==S[0]&&j('Runtime error: The application has corrupted its heap memory area (address zero)!')}}C('INITIAL_MEMORY','INITIAL_MEMORY'),D(B>=N,'INITIAL_MEMORY should be larger than TOTAL_STACK, was '+B+'! (TOTAL_STACK='+N+')'),D('undefined'!=typeof Int32Array&&'undefined'!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,'JS engine does not provide full typed array support'),D(!r.wasmMemory,'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'),D(16777216==B,'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'),function(){var t=new Int16Array(1),i=new Int8Array(t.buffer);if(t[0]=25459,115!==i[0]||99!==i[1])throw'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'}();var P=[],G=[],W=[],Y=!1;D(Math.imul,'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.fround,'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.clz32,'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.trunc,'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');var H=0,V=null,K=null,X={};function j(t){r.onAbort&&r.onAbort(t),g(t='Aborted('+t+')'),k=!0;var i=new WebAssembly.RuntimeError(t);throw n(i),i}var z={error:function(){j('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM')},init:function(){z.error()},KR:function(){z.error()},XR:function(){z.error()},jR:function(){z.error()},open:function(){z.error()},zR:function(){z.error()},ZR:function(){z.error()},qR:function(){z.error()},JR:function(){z.error()},$R:function(){z.error()}};r.FS_createDataFile=z.KR,r.FS_createPreloadedFile=z.XR;var Z,q,J,$,Q='data:application/octet-stream;base64,';function tt(t){return t.startsWith(Q)}function it(t){return t.startsWith('file://')}function et(t,i){return function(){var e=t,s=i;return i||(s=r.asm),D(Y,'native function `'+e+'` called before runtime initialization'),s[t]||D(s[t],'exported native function `'+e+'` not found'),s[t].apply(null,arguments)}}function st(t){try{if(t==Z&&I)return new Uint8Array(I);if(w)return w(t);throw"both async and sync fetching of the wasm failed"}catch(t){j(t)}}function nt(t){this.name='ExitStatus',this.message='Program terminated with exit('+t+')',this.status=t}function rt(t){for(;t.length>0;)t.shift()(r)}function ht(t){ht.QR||(ht.QR={}),ht.QR[t]||(ht.QR[t]=1,c&&(t='warning: '+t),g(t))}function ot(t){try{return v.tO(t-b.byteLength+65535>>>16),F(v.buffer),1}catch(i){g('emscripten_realloc_buffer: Attempted to grow heap from '+b.byteLength+' bytes to '+t+' bytes, but got error: '+i)}}r.locateFile?tt(Z='tinymidipcm.wasm')||(q=Z,Z=r.locateFile?r.locateFile(q,y):y+q):Z=new URL(e(8227),e.b).toString();var lt,at={"emscripten_memcpy_big":function(t,i,e){R.copyWithin(t,i,i+e)},"emscripten_resize_heap":function(t){var i=R.length;D((t>>>=0)>i);var e,s,n=2147483648;if(t>n)return g('Cannot enlarge memory, asked to go up to '+t+' bytes, but the limit is '+n+' bytes!'),!1;for(var r=1;r<=4;r*=2){var h=i*(1+.2/r);h=Math.min(h,t+100663296);var o=Math.min(n,(e=Math.max(t,h))+((s=65536)-e%s)%s);if(ot(o))return!0}return g('Failed to grow the heap from '+i+' bytes to '+o+' bytes, not enough memory!'),!1}},ct=(function(){var t,i={'env':at,'wasi_snapshot_preview1':at};function e(t,i){var e,s=t.exports;r.asm=s,D(v=r.asm.memory,"memory not found in wasm exports"),F(v.buffer),D(r.asm.__indirect_function_table,"table not found in wasm exports"),e=r.asm.__wasm_call_ctors,G.unshift(e),function(t){if(H--,r.monitorRunDependencies&&r.monitorRunDependencies(H),t?(D(X[t]),delete X[t]):g('warning: run dependency removed without ID'),0==H&&(null!==V&&(clearInterval(V),V=null),K)){var i=K;K=null,i()}}('wasm-instantiate')}t='wasm-instantiate',H++,r.monitorRunDependencies&&r.monitorRunDependencies(H),t?(D(!X[t]),X[t]=1,null===V&&'undefined'!=typeof setInterval&&(V=setInterval((function(){if(k)return clearInterval(V),void(V=null);var t=!1;for(var i in X)t||(t=!0,g('still waiting on run dependencies:')),g('dependency: '+i);t&&g('(end of list)')}),1e4))):g('warning: run dependency added without ID');var s=r;function h(t){D(r===s,'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'),s=null,e(t.instance)}function o(t){return function(){if(!I&&(l||a)){if('function'==typeof fetch&&!it(Z))return fetch(Z,{credentials:'same-origin'}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+Z+"'";return t.arrayBuffer()})).catch((function(){return st(Z)}));if(d)return new Promise((function(t,i){d(Z,(function(i){t(new Uint8Array(i))}),i)}))}return Promise.resolve().then((function(){return st(Z)}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){g('failed to asynchronously prepare wasm: '+t),it(Z)&&g('warning: Loading from a file URI ('+Z+') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing'),j(t)}))}if(r.instantiateWasm)try{return r.instantiateWasm(i,e)}catch(t){g('Module.instantiateWasm callback failed with error: '+t),n(t)}(I||'function'!=typeof WebAssembly.instantiateStreaming||tt(Z)||it(Z)||c||'function'!=typeof fetch?o(h):fetch(Z,{credentials:'same-origin'}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(h,(function(t){return g('wasm streaming compile failed: '+t),g('falling back to ArrayBuffer instantiation'),o(h)}))}))).catch(n)}(),r.___wasm_call_ctors=et("__wasm_call_ctors"),r._malloc=et("malloc"),r._free=et("free"),r._tsf_load_memory=et("tsf_load_memory"),r._tsf_close=et("tsf_close"),r._tsf_reset=et("tsf_reset"),r._tsf_set_output=et("tsf_set_output"),r._tsf_set_max_voices=et("tsf_set_max_voices"),r._realloc=et("realloc"),r._tsf_channel_set_presetnumber=et("tsf_channel_set_presetnumber"),r._tsf_channel_set_bank_preset=et("tsf_channel_set_bank_preset"),r._tml_load_memory=et("tml_load_memory"),r._midi_render=et("midi_render"),r.___errno_location=et("__errno_location"),r._fflush=et("fflush"),r._emscripten_stack_init=function(){return(ct=r._emscripten_stack_init=r.asm.emscripten_stack_init).apply(null,arguments)}),ft=(r._emscripten_stack_get_free=function(){return(r._emscripten_stack_get_free=r.asm.emscripten_stack_get_free).apply(null,arguments)},r._emscripten_stack_get_base=function(){return(r._emscripten_stack_get_base=r.asm.emscripten_stack_get_base).apply(null,arguments)},r._emscripten_stack_get_end=function(){return(ft=r._emscripten_stack_get_end=r.asm.emscripten_stack_get_end).apply(null,arguments)});function ut(){var t;ct(),D(!(3&(t=ft()))),S[t>>2]=34821223,S[t+4>>2]=2310721022,S[0]=1668509029}function dt(t){function e(){lt||(lt=!0,r.calledRun=!0,k||(D(!Y),Y=!0,U(),rt(G),i(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),D(!r._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(U(),r.postRun)for('function'==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)t=r.postRun.shift(),W.unshift(t);var t;rt(W)}()))}t=t||o,H>0||(ut(),function(){if(r.preRun)for('function'==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)t=r.preRun.shift(),P.unshift(t);var t;rt(P)}(),H>0||(r.setStatus?(r.setStatus('Running...'),setTimeout((function(){setTimeout((function(){r.setStatus('')}),1),e()}),1)):e(),U()))}if(r.stackSave=et("stackSave"),r.stackRestore=et("stackRestore"),r.stackAlloc=et("stackAlloc"),r.setValue=function(t,i,e="i8"){switch(e.endsWith('*')&&(e='*'),e){case'i1':case'i8':T[0|t]=i;break;case'i16':O[t>>1]=i;break;case'i32':L[t>>2]=i;break;case'i64':$=[i>>>0,(J=i,+Math.abs(J)>=1?J>0?(0|Math.min(+Math.floor(J/4294967296),4294967295))>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],L[t>>2]=$[0],L[t+4>>2]=$[1];break;case'float':x[t>>2]=i;break;case'double':M[t>>3]=i;break;case'*':S[t>>2]=i;break;default:j('invalid type for setValue: '+e)}},r.getValue=function(t,i="i8"){switch(i.endsWith('*')&&(i='*'),i){case'i1':case'i8':return T[0|t];case'i16':return O[t>>1];case'i32':case'i64':return L[t>>2];case'float':return x[t>>2];case'double':return M[t>>3];case'*':return S[t>>2];default:j('invalid type for getValue: '+i)}return null},['run','UTF8ArrayToString','UTF8ToString','stringToUTF8Array','stringToUTF8','lengthBytesUTF8','addOnPreRun','addOnInit','addOnPreMain','addOnExit','addOnPostRun','addRunDependency','removeRunDependency','FS_createFolder','FS_createPath','FS_createDataFile','FS_createPreloadedFile','FS_createLazyFile','FS_createLink','FS_createDevice','FS_unlink','getLEB','getFunctionTables','alignFunctionTables','registerFunctions','prettyPrint','getCompilerSetting','print','printErr','callMain','abort','keepRuntimeAlive','wasmMemory','stackAlloc','stackSave','stackRestore','getTempRet0','setTempRet0','writeStackCookie','checkStackCookie','ptrToString','zeroMemory','stringToNewUTF8','exitJS','getHeapMax','emscripten_realloc_buffer','ENV','ERRNO_CODES','ERRNO_MESSAGES','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','DNS','getHostByName','Protocols','Sockets','getRandomDevice','warnOnce','traverseStack','UNWIND_CACHE','convertPCtoSourceLocation','readAsmConstArgsArray','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','handleException','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','freeTableIndexes','functionsInTableMap','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','PATH','PATH_FS','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16Decoder','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeArrayToMemory','writeAsciiToMemory','SYSCALLS','getSocketFromFD','getSocketAddress','JSEvents','registerKeyEventCallback','specialHTMLTargets','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','currentFullscreenStrategy','restoreOldWindowedStyle','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','demangle','demangleAll','jsStackTrace','stackTrace','ExitStatus','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','dlopenMissingError','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','uncaughtExceptionCount','exceptionLast','exceptionCaught','ExceptionInfo','exception_addRef','exception_decRef','Browser','setMainLoop','wget','FS','MEMFS','TTY','PIPEFS','SOCKFS','_setNetworkCallback','tempFixedLengthArray','miniTempWebGLFloatBuffers','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','GL','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','AL','SDL_unicode','SDL_ttfContext','SDL_audio','SDL','SDL_gfx','GLUT','EGL','GLFW_Window','GLFW','GLEW','IDBStore','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){var i="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),j(i)}})})),['ptrToString','zeroMemory','stringToNewUTF8','exitJS','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','getHostByName','getRandomDevice','traverseStack','convertPCtoSourceLocation','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeAsciiToMemory','getSocketFromFD','getSocketAddress','registerKeyEventCallback','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','ExceptionInfo','exception_addRef','exception_decRef','setMainLoop','_setNetworkCallback','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','SDL_unicode','SDL_ttfContext','SDL_audio','GLFW_Window','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){'undefined'==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var i='`'+t+'` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line';E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),ht(i)}})})),K=function t(){lt||dt(),lt||(K=t)},r.preInit)for('function'==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return dt(),t.ready})}},r={};function h(t){var i=r[t];if(void 0!==i)return i.exports;var e=r[t]={exports:{}};return n[t](e,e.exports,h),e.exports}h.m=n,t="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",i="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",e="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",s=t=>{t&&t.d<1&&(t.d=1,t.forEach((t=>t.r--)),t.forEach((t=>t.r--?t.r++:t())))},h.a=(n,r,h)=>{var o;h&&((o=[]).d=-1);var l,a,c,f=new Set,u=n.exports,d=new Promise(((t,i)=>{c=i,a=t}));d[i]=u,d[t]=t=>(o&&t(o),f.forEach(t),d.catch((t=>{}))),n.exports=d,r((n=>{var r;l=(n=>n.map((n=>{if(null!==n&&"object"==typeof n){if(n[t])return n;if(n.then){var r=[];r.d=0,n.then((t=>{h[i]=t,s(r)}),(t=>{h[e]=t,s(r)}));var h={};return h[t]=t=>t(r),h}}var o={};return o[t]=t=>{},o[i]=n,o})))(n);var h=()=>l.map((t=>{if(t[e])throw t[e];return t[i]})),a=new Promise((i=>{(r=()=>i(h)).r=0;var e=t=>t!==o&&!f.has(t)&&(f.add(t),t&&!t.d&&(r.r++,t.push(r)));l.map((i=>i[t](e)))}));return r.r?a:h()}),(t=>(t?c(d[e]=t):a(u),s(o)))),o&&o.d<0&&(o.d=0)},h.d=(t,i)=>{for(var e in i)h.o(i,e)&&!h.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:i[e]})},h.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),h.p="/Client2/",h.b=document.baseURI||self.location.href;h(7608)})(); \ No newline at end of file +(()=>{"use strict";var t,i,e,s,n={1651:(t,i,e)=>{e.d(i,{K:()=>M});var s=e(1120),n=e(4583),r=e(2901),h=e(1069),o=e(7046),l=(e(9896),e(6666)),a=e(3045),c=e(818),f=e(670),u=e(8268),d=e(3867),w=e(7854),y=e(8950),A=e(1302),m=e(9298),p=e(8665),_=e(1312),I=e(3819),g=e(8317),C=e(9234),E=e(1908),v=e(123),b=e(5637),T=e(6948),R=e(2164),O=e(8738),L=e(3764),S=e(8534),x=e(6730);class M extends o.A{static tt=225;static it=10;static portOffset=0;static members=!0;static et=!1;static st='';static nt='';static rt=!1;static ht=2;static ot=!1;static lt='https://raw.githubusercontent.com/2004scape/Server/main';static exponent=58778699976184461502525193738213253649000149147835990136706041084440742975821n;static ct=7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789n;static ft=0;static ut=0;static dt=0;static wt=0;static yt=0;static At=0;static _t=0;static It=0;static gt=0;static Ct=0;static Et=0;static vt=0;static bt=0;static Tt=0;static Rt=0;static Ot=()=>{a.A.et=!1,n.A.et=!1,M.et=!1,c.A.et=!1};static Lt=()=>{a.A.et=!0,n.A.et=!0,M.et=!0,c.A.et=!0};St=2048;xt=2047;Mt=!1;kt=!1;Dt=!1;Nt=!1;db=null;Ft=0;Bt=[];stream=null;in=h.A.Ut(1);Pt=h.A.Ut(1);Gt=h.A.Ut(1);Wt=0n;Yt=0;Ht=0;Vt=0;Kt=null;Xt=0;packetSize=0;jt=0;zt=0;Zt=0;qt=null;Jt=!0;$t=0;Qt=0;ti=null;ii=null;ei=null;si=null;ni=null;ri=null;hi=null;oi=null;li=null;ai=null;ci=null;fi='';ui='';username='';password='';di=null;wi=null;yi=null;Ai=null;mi=[];pi=!1;_i=null;Ii=null;gi=null;Ci=null;Ei=null;vi=null;bi=null;Ti=null;Ri=null;Oi=null;Li=new Int32Array(256);Si=0;xi=0;Mi=0;ki=null;Di=null;Ni=null;Fi=null;Bi=null;Ui=null;Pi=null;Gi=null;Wi=null;Yi=null;Hi=null;Vi=null;Ki=null;Xi=null;ji=null;zi=null;Zi=null;qi=null;Ji=null;$i=null;Qi=null;te=new Int32Array(33);ie=new Int32Array(33);ee=new Int32Array(151);se=new Int32Array(151);ne=null;re=null;he=null;oe=null;le=null;ae=null;ce=new d.fe(13,null);ue=null;de=null;we=new d.fe(50,null);ye=new d.fe(50,null);Ae=new d.fe(20,null);me=new d.fe(20,null);pe=null;_e=new d.fe(8,null);Ie=null;ge=null;Ce=null;Ee=null;ve=null;be=null;Te=null;Re=null;Oe=null;Le=null;Se=null;xe=null;Me=null;ke=null;De=null;Ne=null;Fe=null;Be=null;Ue=new d.fe(1e3,null);Pe=!1;Ge=!1;We=!1;Ye=!1;He=-1;Ve=0;Ke=0;Xe=0;je=0;ze=0;Ze=0;qe=!1;Je=0;$e=0;Qe=0;ts=0;es=0;ss=0;ns=[];rs=-1;hs=-1;os=new s.A;ls=78;cs=0;fs=0;us=[];ds=0;ws=0;ys=0;As=0;ps=0;_s=0;Is=0;gs=0;Cs=[];Es=[];vs=[];bs=[];Ts=null;Rs=-1;Os=3;Ls=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];Ss=0;xs=0;Ms=0;ks=!1;Ds=0;Ns=!1;Fs='';Bs='';Us=0;Ps='';Gs=!1;Ws=-1;Ys=new d.fe(100,null);Hs=new d.fe(100,null);messageType=new Int32Array(100);Vs=new Int32Array(100);Ks=0;Xs=0;js=0;zs='';Zs=0;qs=0;Js=0;$s=0;Qs=0;tn=0;en=0;sn=0;nn=0;rn=!1;hn=0;ln=0;an=0;cn=0;fn=null;un=0;dn=0;wn=0;yn=0;An=!1;mn=[];pn=[];_n=0;In=0;gn=0;Cn=null;En=0;vn=new Int32Array(500);bn=new Int32Array(500);Tn=new Int32Array(500);Rn=new Int32Array(500);On=0;Ln=0;Sn=0;xn='';Mn=!1;kn=-1;Dn=0;Nn=0;Fn=0;Bn=0;Un=0;Pn=new Int32Array(1e3);Gn=new Int32Array(1e3);Wn=null;Yn=0;Hn=0;Vn=0;Kn=0;Xn=0;jn=!1;zn=0;Zn=0;qn=0;Jn=0;$n=2;Qn=2;tr=1;ir=new Int32Array(5);er=new d.fe(5,!1);sr=new Int32Array(5);nr=new Int32Array(5);rr=new Int32Array(5);hr=0;lr=0;ar=0;cr=0;ur=0;dr=0;wr=0;yr=0;Ar=0;mr=1;pr=2;_r=-1;Ir=0;gr=0;Cr=0;Er=0;vr=0;br=0;Tr=null;Rr=null;Or=null;Lr=0;Sr=0;Mr=new Int8Array(16384);kr=new d.fe(f.A.Dr,null);Nr=0;Fr=0;Br=128;Ur=0;Pr=0;Gr=0;Wr=0;Yr=0;Hr=null;Vr=null;Kr=new d.Xr(f.A.jr,f.A.jr);zr=0;Zr=0;qr=0;Jr=0;$r=0;Qr=0;th=0;ih=0;eh=0;sh=0;nh=0;rh=0;hh=new d.fe(this.St,null);oh=0;lh=new Int32Array(this.St);ah=0;fh=0;uh=new Int32Array(this.St);dh=new Int32Array(1e3);wh=new d.fe(this.St,null);yh=new d.fe(8192,null);Ah=0;mh=new Int32Array(8192);ph=new l.A;_h=new l.A;Ih=new l.A;gh=new l.A;Ch=new d.Eh(f.A.Dr,f.A.jr,f.A.jr,null);bh=new l.A;Th=new Int32Array(4e3);Rh=new Int32Array(4e3);Oh=new Int32Array(f.A.jr*f.A.jr);Lh=new Int32Array(f.A.jr*f.A.jr);Sh=0;xh=null;Mh=0;kh=0;Dh=-1;Nh=0;Fh=0;Bh=0;Uh=0;Ph=!1;Gh=!0;Wh=!1;Yh=new Int32Array(7);Hh=new Int32Array(5);Vh=0;Kh=0;static Xh=50;jh=new Int32Array(M.Xh);zh=new Int32Array(M.Xh);Zh=new Int32Array(M.Xh);qh=new Int32Array(M.Xh);Jh=new Int32Array(M.Xh);$h=new Int32Array(M.Xh);Qh=new Int32Array(M.Xh);io=new d.fe(M.Xh,null);eo=new d.fe(100,null);so=new BigInt64Array(100);no=new Int32Array(100);ro=null;ho=0;oo=!0;lo=new Int32Array(50);ao=new Int32Array(50);co=new Int32Array(50);fo=192;uo=-1;do=-1;wo=0;yo=0;Ao=0;mo=!0;po=null;_o=0;Io=0;Co=192;Eo=new d.fe(16,null);vo=0;bo=!1;To=()=>{try{this.stream&&this.stream.close()}catch(t){}this.stream=null,(0,v.Ro)(),this.Pt=null,this.Gt=null,this.in=null,this.Or=null,this.Tr=null,this.Rr=null,this.Hr=null,this.Vr=null,this.Wn=null,this.kr=null,this.Oh=null,this.Lh=null,this.Th=null,this.Rh=null,this.Mr=null,this.Di=null,this.Ni=null,this.Fi=null,this.Bi=null,this.Ui=null,this.Pi=null,this.Gi=null,this.Wi=null,this.Yi=null,this.Hi=null,this.Vi=null,this.Ki=null,this.Xi=null,this.ji=null,this.zi=null,this.Zi=null,this.qi=null,this.ne=null,this.he=null,this.re=null,this.oe=null,this.le=null,this.ae=null,this.ce=null,this.Te=null,this.Re=null,this.Oe=null,this.Le=null,this.Se=null,this.xe=null,this.Me=null,this.ke=null,this.De=null,this.Ne=null,this.de=null,this.Ae=null,this.me=null,this._e=null,this.Ie=null,this.ge=null,this.Ce=null,this.Ee=null,this.we=null,this.ye=null,this.Kr=null,this.hh=null,this.lh=null,this.uh=null,this.wh=null,this.dh=null,this.yh=null,this.mh=null,this.Ch=null,this.bh=null,this.gh=null,this.ph=null,this._h=null,this.Ih=null,this.Tn=null,this.Rn=null,this.vn=null,this.bn=null,this.ns=null,this.mn=null,this.Pn=null,this.Gn=null,this.Ue=null,this.ue=null,this.eo=null,this.so=null,this.no=null,this.si=null,this.ni=null,this.ti=null,this.ii=null,this.ei=null,this.ri=null,this.hi=null,this.oi=null,this.li=null,this.Oo(),b.A.To(),T.A.To(),A.A.To(),R.A.Lo=null,g.A.Lo=null,s.A.Lo=null,_.A.Lo=null,O.A.Lo=null,O.A.So=null,L.A.Lo=null,this.xo=null,u.A.So=null,n.A.To(),a.A.To(),p.A.To(),S.A.Lo=[],x.A.Lo=[]};Mo(){return this.$t}ko(){return this.Gs}Do(){return this.Ns}No(){return this.hs}Fo(){return this.He}Oo=()=>{this.pi=!1,this.ki&&(clearInterval(this.ki),this.ki=null),this.ai=null,this.ci=null,this.mi=[],this.bi=null,this.Ti=null,this.Ri=null,this.Oi=null,this.Ci=null,this.gi=null,this.Ei=null,this.vi=null,this._i=null,this.Ii=null};Bo=async(t,i,e,s)=>{let n=5,o=await(this.db?.Uo(t));if(o&&h.A.Po(o)!==e&&(o=void 0),o)return new r.A(o);for(;!o;){await this.Go(s,`Requesting ${i}`);try{o=await(0,C.Wo)(`${M.nt}/${t}${e}`)}catch(t){o=void 0;for(let t=n;t>0;t--)await this.Go(s,`Error loading - Will retry in ${t} secs.`),await(0,C.Yo)(1e3);n*=2,n>60&&(n=60)}}return await(this.db?.Ho(t,o)),new r.A(o)};Vo=async(t,i,e)=>{let s=await(this.db?.Uo(t+'.mid'));if(s&&12345678!==i&&h.A.Po(s)!==i&&(s=void 0),!s)try{s=await(0,C.Wo)(`${M.nt}/${t}_${i}.mid`),e!==s.length&&(s=s.slice(0,e))}catch(t){}if(!s)return;await(this.db?.Ho(t+'.mid',s));const n=new h.A(Uint8Array.from(s)).Ko,r=E.A.read(n,s,e,4);(0,v.Xo)(r,this.Co)};jo=()=>{if(w.zo.fillStyle='black',w.zo.fillRect(0,0,this.width,this.height),this.Zo(1),this.Dt){this.pi=!1,w.zo.font='bold 16px helvetica, sans-serif',w.zo.textAlign='left',w.zo.fillStyle='yellow';let t=35;w.zo.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,w.zo.fillStyle='white',w.zo.fillText('To fix this try the following (in order):',30,t),t+=50,w.zo.font='bold 12px helvetica, sans-serif',w.zo.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.zo.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,w.zo.fillText('3: Try using a different game-world',30,t),t+=30,w.zo.fillText('4: Try rebooting your computer',30,t),t+=30,w.zo.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.Nt&&(this.pi=!1,w.zo.font='bold 20px helvetica, sans-serif',w.zo.textAlign='left',w.zo.fillStyle='white',w.zo.fillText('Error - unable to load game!',50,50),w.zo.fillText('To play RuneScape make sure you play from',50,100),w.zo.fillText('https://2004scape.org',50,150)),this.kt){this.pi=!1,w.zo.font='bold 13px helvetica, sans-serif',w.zo.textAlign='left',w.zo.fillStyle='yellow';let t=35;w.zo.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,w.zo.fillStyle='white',w.zo.fillText('To fix this try the following (in order):',30,t),t+=50,w.zo.font='bold 12px helvetica, sans-serif',w.zo.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.zo.fillText('2: Try rebooting your computer, and reloading',30,t)}};qo=t=>{if(!t.Jo)return!1;for(let i=0;i=s)return!1}else if(3===t.Jo[i]){if(e<=s)return!1}else if(4===t.Jo[i]){if(e===s)return!1}else if(e!==s)return!1}return!0};tl=(t,i,e,s,n)=>{this.ve?.draw(t,i),this.be?.draw(t,i+n-16),y.A.fillRect(t,i+16,16,n-32,m.A.il);let r=(n-32)*n/s|0;r<8&&(r=8);const h=(n-r-32)*e/(s-n)|0;y.A.fillRect(t,i+h+16,16,r,m.A.el),y.A.sl(t,i+h+16,m.A.nl,r),y.A.sl(t+1,i+h+16,m.A.nl,r),y.A.rl(t,i+h+16,m.A.nl,16),y.A.rl(t,i+h+17,m.A.nl,16),y.A.sl(t+15,i+h+16,m.A.hl,r),y.A.sl(t+14,i+h+17,m.A.hl,r-1),y.A.rl(t,i+h+r+15,m.A.hl,16),y.A.rl(t+1,i+h+r+14,m.A.hl,15)};ol=(t,i)=>{let e=!1;const n=s.A.Lo[t];if(!n.ll)return!1;for(let t=0;ts.delay[r.ul];)r.fl-=s.delay[r.ul]+1,r.ul++,r.ul>=s.dl&&(r.ul-=s.wl,(r.ul<0||r.ul>=s.dl)&&(r.ul=0)),e=!0}}}return e};yl=(t,i,e,r,h=!1)=>{if(0!==t.type||!t.ll||t.hide&&this.Zs!==t.id&&this.qs!==t.id&&this.Js!==t.id)return;const o=y.A.left,l=y.A.top,a=y.A.right,c=y.A.bottom;y.A.Al(i,e,i+t.width,e+t.height);const f=t.ll.length;for(let o=0;o0&&this.Cl(c),c.type===s.A.El)c.vl>c.scroll-c.height&&(c.vl=c.scroll-c.height),c.vl<0&&(c.vl=0),this.yl(c,l,a,c.vl,h),c.scroll>c.height&&this.tl(l+c.width,a,c.vl,c.scroll,c.height);else if(c.type===s.A.bl){let t=0;for(let i=0;i0){let i=0,e=0;const r=c.Ol[t]-1;if(s>=-32&&s<=512&&n>=-32&&n<=334||0!==this.tn&&this.Qs===t){const h=A.A.Ml(r,c.Ll[t]);if(0!==this.tn&&this.Qs===t&&this.$s===c.id?(i=this.kl-this.en,e=this.Dl-this.sn,i<5&&i>-5&&(i=0),e<5&&e>-5&&(e=0),this.nn<5&&(i=0,e=0),h.Nl(128,s+i,n+e)):0!==this.un&&this.dn===t&&this.wn===c.id?h.Nl(128,s,n):h.draw(s,n),33===h.Fl||1!==c.Ll[t]){const r=c.Ll[t];this.di?.Bl(s+i+1,n+10+e,this.Ul(r),m.A.Pl),this.di?.Bl(s+i,n+9+e,this.Ul(r),m.A.Gl)}}}else if(c.Wl&&t<20){const i=c.Wl[t];i?.draw(s,n)}t++}}else if(c.type===s.A.Yl)c.fill?y.A.fillRect(l,a,c.width,c.height,c.Hl):y.A._l(l,a,c.width,c.height,c.Hl);else if(c.type===s.A.Vl){const t=c.font;let i=c.Hl,e=c.text;if(this.Js!==c.id&&this.qs!==c.id&&this.Zs!==c.id||0===c.Kl||(i=c.Kl),this.qo(c)&&(i=c.Xl,c.jl&&c.jl.length>0&&(e=c.jl)),c.zl===s.A.Zl&&this.An&&(e='Please wait...',i=c.Hl),!t||!e)continue;for(let s=a+t.height;e.length>0;s+=t.height){if(-1!==e.indexOf('%')){for(;;){const t=e.indexOf('%1');if(-1===t)break;e=e.substring(0,t)+this.ql(this.$o(c,0))+e.substring(t+2)}for(;;){const t=e.indexOf('%2');if(-1===t)break;e=e.substring(0,t)+this.ql(this.$o(c,1))+e.substring(t+2)}for(;;){const t=e.indexOf('%3');if(-1===t)break;e=e.substring(0,t)+this.ql(this.$o(c,2))+e.substring(t+2)}for(;;){const t=e.indexOf('%4');if(-1===t)break;e=e.substring(0,t)+this.ql(this.$o(c,3))+e.substring(t+2)}for(;;){const t=e.indexOf('%5');if(-1===t)break;e=e.substring(0,t)+this.ql(this.$o(c,4))+e.substring(t+2)}}const n=e.indexOf('\\n');let r;-1!==n?(r=e.substring(0,n),e=e.substring(n+2)):(r=e,e=''),c.Jl?t.$l(l+(c.width/2|0),s,r,i,c.Ql):t.ta(l,s,r,i,c.Ql)}}else if(c.type===s.A.ia){let t;t=this.qo(c)?c.ea:c.sa,t?.draw(l,a)}else if(c.type===s.A.na){const t=n.A.ra,i=n.A.ha;n.A.ra=l+(c.width/2|0),n.A.ha=a+(c.height/2|0);const e=n.A.sin[c.oa]*c.zoom>>16,s=n.A.cos[c.oa]*c.zoom>>16,r=this.qo(c);let h;h=r?c.cl:c.al;let o=null;if(-1===h)o=c.la(-1,-1,r);else{const t=_.A.Lo[h];t.frames&&t.aa&&(o=c.la(t.frames[c.ul],t.aa[c.ul],r))}o&&o.ca(0,c.fa,0,c.oa,0,e,s),n.A.ra=t,n.A.ha=i}else if(c.type===s.A.ua){const t=c.font;if(!t||!c.Ol||!c.Ll)continue;let i=0;for(let e=0;e0){const n=A.A.get(c.Ol[i]-1);let r=n.name;if((n.da||1!==c.Ll[i])&&(r=r+' x'+this.wa(c.Ll[i])),!r)continue;const h=l+s*(c.Sl+115),o=a+e*(c.xl+12);c.Jl?t.$l(h+(c.width/2|0),o,r,c.Hl,c.Ql):t.ta(h,o,r,c.Hl,c.Ql)}i++}}}y.A.Al(o,l,a,c)};Cl=t=>{let i=t.gl;if(i>=s.A.ya&&i<=s.A.Aa)i--,i>=this.Vh?(t.text='',t.zl=0):(t.text=this.eo[i],t.zl=1);else if(i>=s.A.ma&&i<=s.A.pa)i-=s.A.ma,i>=this.Vh?(t.text='',t.zl=0):(0===this.no[i]?t.text='@red@Offline':this.no[i]===M.it?t.text='@gre@World-'+(this.no[i]-9):t.text='@yel@World-'+(this.no[i]-9),t.zl=1);else if(i===s.A._a)t.scroll=15*this.Vh+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i>=s.A.Ia&&i<=s.A.ga)i-=s.A.Ia,i>=this.fs?(t.text='',t.zl=0):(t.text=I.A.Ca(I.A.Ea(this.us[i])),t.zl=1);else if(i===s.A.va)t.scroll=15*this.fs+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i===s.A.ba){if(t.oa=150,t.fa=256*Math.sin(this.Ft/40)&2047,this.Wh){this.Wh=!1;const i=new d.fe(7,null);let e=0;for(let t=0;t<7;t++){const s=this.Yh[t];s>=0&&(i[e++]=g.A.Lo[s].la())}const s=p.A.Ta(i,e);for(let t=0;t<5;t++)0!==this.Hh[t]&&(s.Ra(u.A.Oa[t][0],u.A.Oa[t][this.Hh[t]]),1===t&&s.Ra(u.A.La[0],u.A.La[this.Hh[t]]));if(this.xh){const i=_.A.Lo[this.xh.Sa].frames;i&&(s.xa(),s.Ma(i[0]),s.ka(64,850,-30,-50,-30,!0),t.model=s)}}}else if(i===s.A.Da)this.Fe||(this.Fe=t.sa,this.Be=t.ea),this.Gh?t.sa=this.Be:t.sa=this.Fe;else if(i===s.A.Na)this.Fe||(this.Fe=t.sa,this.Be=t.ea),this.Gh?t.sa=this.Fe:t.sa=this.Be;else if(i===s.A.Fa)t.text=this.xn,this.Ft%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(i===s.A.Ba)this.Ph?this.Mn?(t.Hl=m.A.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.Hl=m.A.Il,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(i===s.A.Ua||i===s.A.Pa)if(0===this.Dn)t.text='';else{let i;i=0===this.Nn?'earlier today':1===this.Nn?'yesterday':this.Nn+' days ago',t.text='You last logged in '+i+' from: '+I.A.Ga(this.Dn)}else if(i===s.A.Wa)0===this.Bn&&(t.text='0 unread messages',t.Hl=m.A.Gl),1===this.Bn&&(t.text='1 unread message',t.Hl=m.A.GREEN),this.Bn>1&&(t.text=this.Bn+' unread messages',t.Hl=m.A.GREEN);else if(i===s.A.Ya)if(201===this.Fn)t.text='';else if(200===this.Fn)t.text='You have not yet set any password recovery questions.';else{let i;i=0===this.Fn?'Earlier today':1===this.Fn?'Yesterday':this.Fn+' days ago',t.text=i+' you changed your recovery questions'}else i===s.A.Ha?201===this.Fn?t.text='':200===this.Fn?t.text='We strongly recommend you do so now to secure your account.':t.text='If you do not remember making this change then cancel it immediately':i===s.A.Va&&(201===this.Fn?t.text='':(this.Fn,t.text="Do this from the 'account management' area on our front webpage"))};$o=(t,i)=>{if(!t.scripts||i>=t.scripts.length)return-2;try{const e=t.scripts[i];if(!e)return-1;let n=0,r=0;for(;;){const t=e[r++];if(0===t)return n;if(1===t)n+=this.Es[e[r++]];else if(2===t)n+=this.vs[e[r++]];else if(3===t)n+=this.Cs[e[r++]];else if(4===t){const t=s.A.Lo[e[r++]],i=e[r++]+1;if(t.Ol&&t.Ll)for(let e=0;et<999999999?String(t):'*';wa=t=>{let i=String(t);for(let t=i.length-3;t>0;t-=3)i=i.substring(0,t)+','+i.substring(t);return i.length>8?i='@gre@'+i.substring(0,i.length-8)+' million @whi@('+i+')':i.length>4&&(i='@cya@'+i.substring(0,i.length-4)+'K @whi@('+i+')'),' '+i};Ul=t=>t<1e5?String(t):t<1e7?(t/1e3|0)+'K':(t/1e6|0)+'M'}},7604:(t,i,e)=>{e.d(i,{w:()=>h});var s=e(7046),n=e(1651),r=e(9234);async function h(){await async function(){0===s.A.getParameter('world').length&&s.A.setParameter('world','1');'localhost'===window.location.hostname&&'0'===s.A.getParameter('world')?(n.K.st='http://localhost',n.K.nt='http://localhost',n.K.portOffset=0):await async function(t){const i=await o(t,parseInt(s.A.getParameter('world'),10)),e=new URL(i.address);n.K.it=10+i.id-1,n.K.st=`${e.protocol}//${e.hostname}`,n.K.nt=`${e.protocol}//${e.hostname}:${e.port}`,t||(n.K.st=n.K.st.replace('https:','http:'));n.K.portOffset=i.portOffset,n.K.members=!0===i?.members,s.A.setParameter('world',i.id.toString(10))}(window.location.protocol.startsWith('https'))}(),function(){0===s.A.getParameter('detail').length&&s.A.setParameter('detail','high');'low'===s.A.getParameter('detail')?n.K.Lt():n.K.Ot()}(),0===s.A.getParameter('method').length&&s.A.setParameter('method','0')}async function o(t,i,e=0){if(e>=10)throw new Error('could not find world to connect!');const s=t?'https:':'http:';let n;try{n=JSON.parse(await(0,r.Xa)(`${s}//2004scape.org/api/v1/worldlist`))}catch(s){return await(0,r.Yo)(1e3),o(t,i,++e)}n.push({id:0,region:'Local Development',address:'http://localhost',portOffset:0,members:!0,hh:0});const h=n.find((t=>t.id===i));return h||o(t,i,10)}},7046:(t,i,e)=>{e.d(i,{A:()=>a});var s=e(1183),n=e(4583),r=e(9234),h=e(9091),o=e(2595),l=e(7854);class a{static getParameter(t){return new URLSearchParams(window.location.search).get(t)??''}static setParameter(t,i){const e=new URL(window.location.toString());e.searchParams.set(t,i),window.history.pushState(null,'',e.toString())}ja=0;za=[];Za=0;xo=null;state=0;qa=20;Ja=1;$a=[];Qa=0;tc=0;ic=[];ec=!0;sc=!1;nc=50;hasFocus=!0;rc=!1;hc=0;oc=0;kl=0;Dl=0;lc=0;ac=0;cc=0;fc=[];uc=[];dc=0;wc=0;input=null;yc=!1;Ac=!1;mc=!1;time=-1;_c=0;Ic=0;gc=0;Cc=0;Ec=0;vc=0;constructor(t=!1){l.bc.tabIndex=-1,l.zo.fillStyle='black',l.zo.fillRect(0,0,l.bc.width,l.bc.height),this.sc=t,this.sc?this.resize(window.innerWidth,window.innerHeight):this.resize(l.bc.width,l.bc.height)}get width(){return l.bc.width}get height(){return l.bc.height}resize=(t,i)=>{l.bc.width=t,l.bc.height=i,this.xo=new s.A(t,i),n.A.Tc()};Rc=async()=>{l.bc.addEventListener('resize',(()=>{this.sc&&this.resize(window.innerWidth,window.innerHeight)}),!1),l.bc.onmousedown=this.onmousedown,l.bc.onmouseup=this.onmouseup,l.bc.onmouseenter=this.onmouseenter,l.bc.onmouseleave=this.onmouseleave,l.bc.onmousemove=this.onmousemove,window.onbeforeunload=this.To,l.bc.onfocus=this.onfocus,l.bc.onblur=this.onblur,this.Oc?(l.bc.ontouchstart=this.ontouchstart,l.bc.ontouchend=this.ontouchend,l.bc.ontouchmove=this.ontouchmove):(l.bc.onkeydown=this.onkeydown,l.bc.onkeyup=this.onkeyup),l.bc.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.Oc&&'low'===a.getParameter('detail')&&(this.nc=30),await this.Go(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.$a[t]=performance.now();let t,i=0,e=256,s=1,n=0;for(;this.state>=0;){if(this.state>0&&(this.state--,0===this.state))return void this.Lc();const h=e,o=s;e=300,s=1,t=performance.now();const l=this.$a[i];if(0===l?(e=h,s=o):t>l&&(e=2560*this.qa/(t-l)|0),e<25?e=25:e>256&&(e=256,s=this.qa-(t-l)/10|0),this.$a[i]=t,i=(i+1)%10,s>1)for(let t=0;t<10;t++)0!==this.$a[t]&&(this.$a[t]+=s);for(s0&&(this.Qa=1e3*e/(256*this.qa)|0);const a=performance.now();if(this.ec&&this.refresh(),await this.draw(),this.ic[this.tc]=(performance.now()-a)/1e3,this.tc=(this.tc+1)%this.ic.length,this.nc<50){const i=1e3/this.nc-(performance.now()-t);i>0&&await(0,r.Yo)(i)}}-1===this.state&&this.Lc()};Lc=()=>{this.state=-2,this.To()};Zo=t=>{this.qa=1e3/t|0};Sc=t=>{this.nc=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.qa|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};To=()=>{};draw=async()=>{};refresh=()=>{};async Go(t,i){const e=this.width,s=this.height;this.ec&&(l.zo.fillStyle='black',l.zo.fillRect(0,0,e,s),this.ec=!1);const n=s/2-18;l.zo.fillStyle='rgb(140, 17, 17)',l.zo.rect((e/2|0)-152,n,304,34),l.zo.fillRect((e/2|0)-150,n+2,3*t,30),l.zo.fillStyle='black',l.zo.fillRect((e/2|0)-150+3*t,n+2,300-3*t,30),l.zo.font='bold 13px helvetica, sans-serif',l.zo.textAlign='center',l.zo.fillStyle='white',l.zo.fillText(i,e/2|0,n+22),await(0,r.Yo)(5)}xc=()=>{let t=-1;return this.wc!==this.dc&&(t=this.uc[this.dc],this.dc=this.dc+1&127),t};get ms(){const t=this.ic.length;let i=0;for(let e=0;ethis.ja&&(this.ja=e),this.za[this.Za]=e,this.Za=(this.Za+1)%250,e}get Mc(){return this.za.reduce(((t,i)=>t+i),0)/250}onkeydown=t=>{const i=t.key;this.hc=0;const e=h.c[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;t.ctrlKey&&(n>='A'.charCodeAt(0)&&n<=']'.charCodeAt(0)||n=='_'.charCodeAt(0)?n-='A'.charCodeAt(0)-1:n>='a'.charCodeAt(0)&&n<='z'.charCodeAt(0)&&(n-='a'.charCodeAt(0)-1)),n<30&&(n=0),s===h.c.ArrowLeft.code?n=1:s===h.c.ArrowRight.code?n=2:s===h.c.ArrowUp.code?n=3:s===h.c.ArrowDown.code?n=4:s===h.c.Control.code?n=5:s===h.c.Shift.code?n=6:s===h.c.Alt.code?n=7:s===h.c.Backspace.code||s===h.c.Delete.code?n=8:s===h.c.Tab.code?n=9:s===h.c.Enter.code?n=10:s>=h.c.F1.code&&s<=h.c.F12.code?n=s+1008-h.c.F1.code:s===h.c.Home.code?n=1e3:s===h.c.End.code?n=1001:s===h.c.PageUp.code?n=1002:s===h.c.PageDown.code&&(n=1003),n>0&&n<128&&(this.fc[n]=1),n>4&&(this.uc[this.wc]=n,this.wc=this.wc+1&127),o.A.enabled&&o.A.kc(n),h.g.includes(i)||t.preventDefault()};onkeyup=t=>{const i=t.key;this.hc=0;const e=h.c[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;n<30&&(n=0),s===h.c.ArrowLeft.code?n=1:s===h.c.ArrowRight.code?n=2:s===h.c.ArrowUp.code?n=3:s===h.c.ArrowDown.code?n=4:s===h.c.Control.code?n=5:s===h.c.Shift.code?n=6:s===h.c.Alt.code?n=7:s===h.c.Backspace.code||s===h.c.Delete.code?n=8:s===h.c.Tab.code?n=9:s===h.c.Enter.code?n=10:s>=h.c.F1.code&&s<=h.c.F12.code?n=s+1008-h.c.F1.code:s===h.c.Home.code?n=1e3:s===h.c.End.code?n=1001:s===h.c.PageUp.code?n=1002:s===h.c.PageDown.code&&(n=1003),n>0&&n<128&&(this.fc[n]=0),o.A.enabled&&o.A.Dc(n),h.g.includes(i)||t.preventDefault()};onmousedown=t=>{if(this.yc=!1,(t.clientX>0||t.clientY>0)&&this.Nc(t),this.hc=0,this.ac=this.kl,this.cc=this.Dl,this.Oc&&!this.Fc){if(this.Bc()||this.Uc()||this.Pc())return this.lc=1,void(this.oc=1);t.timeStamp>=this.time+500?(this.lc=2,this.oc=2):(this.lc=1,this.oc=1)}else 2===t.button?(this.lc=2,this.oc=2):(this.lc=1,this.oc=1);o.A.enabled&&o.A.Gc(this.ac,this.cc,t.buttons)};onmouseup=t=>{this.Nc(t),this.hc=0,this.oc=0,o.A.enabled&&o.A.Wc(t.buttons)};onmouseenter=t=>{this.Nc(t),o.A.enabled&&o.A.Yc()};onmouseleave=t=>{this.Nc(t),this.hc=0,this.kl=-1,this.Dl=-1,this.oc=0,this.ac=-1,this.cc=-1,o.A.enabled&&o.A.Hc()};onmousemove=t=>{this.Nc(t),this.hc=0,o.A.enabled&&o.A.Vc(this.kl,this.Dl)};onfocus=t=>{this.hasFocus=!0,this.ec=!0,this.refresh(),o.A.enabled&&o.A.Kc()};onblur=t=>{this.hasFocus=!1,o.A.enabled&&o.A.Xc()};ontouchstart=t=>{if(!this.Oc)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.yc=!0;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this._c=this.Ec=this.gc=0|i.screenX,this.Ic=this.vc=this.Cc=0|i.screenY,this.time=t.timeStamp,this.Ac=this.jc(),this.mc=this.zc()};ontouchend=t=>{if(!this.Oc||!this.yc)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;if(this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.Ec=0|i.screenX,this.vc=0|i.screenY,this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.Ac&&!this.jc())return void(this.yc=!1);if(this.mc&&!this.zc())return void(this.yc=!1);if(this.Bc()||this.Zc()||this.Uc()||this.Pc()){null!==this.input&&(this.input.parentNode?.contains(this.input)&&this.input.parentNode?.removeChild(this.input),this.input=null);const t=document.createElement('input');return this.Uc()?(t.setAttribute('id','username'),t.setAttribute('placeholder','Username')):this.Pc()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.Bc()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.Zc()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this.qc?t.setAttribute('type','password'):t.setAttribute('type',this.Pc()?'password':'text'),t.setAttribute('autofocus','autofocus'),t.setAttribute('spellcheck','false'),t.setAttribute('autocomplete','off'),t.setAttribute('style',`position: fixed; left: ${e}px; top: ${s}px; width: 1px; height: 1px; opacity: 0;`),document.body.appendChild(t),t.focus(),t.click(),this.qc&&(t.oninput=t=>{if(!(t instanceof InputEvent))return;const i=t,e=i.data;null!==e&&'insertText'===i.inputType&&this.onkeydown(new KeyboardEvent('keydown',{key:e,code:e}))}),t.onkeydown=t=>{this.qc&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this.qc&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeyup(new KeyboardEvent('keyup',{key:t.key,code:t.key}))},t.onfocus=t=>{this.input?.parentNode?.removeChild(this.input),this.input=null,this.onfocus(t)},this.input=t,void(this.yc=!1)}const n=t.timeStamp>=this.time+500,r=Math.abs(this._c-this.Ec)>16||Math.abs(this.Ic-this.vc)>16;n&&!r?(this.yc=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.oc=0,this.yc=!1)};ontouchmove=t=>{if(!this.Oc||!this.yc)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.Ec=0|i.screenX,this.vc=0|i.screenY,this.Ac&&-1===this.Fo()?(this.gc-this.Ec>0?this.rotate(2):this.gc-this.Ec<0&&this.rotate(0),this.Cc-this.vc>0?this.rotate(3):this.Cc-this.vc<0&&this.rotate(1)):(this.mc||-1!==this.Fo())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this.gc=this.Ec,this.Cc=this.vc};get Oc(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get qc(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get Fc(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}jc=()=>this.rc&&this.kl>=8&&this.kl<=520&&this.Dl>=11&&this.Dl<=345;Bc=()=>this.rc&&-1===this.No()&&!this.ko()&&!this.Do()&&this.kl>=11&&this.kl<=506&&this.Dl>=449&&this.Dl<=482;Zc=()=>this.rc&&(this.ko()||this.Do())&&this.kl>=11&&this.kl<=506&&this.Dl>=383&&this.Dl<=482;zc=()=>this.rc&&this.kl>=562&&this.kl<=752&&this.Dl>=231&&this.Dl<=492;Uc=()=>!this.rc&&2===this.Mo()&&this.kl>=301&&this.kl<=562&&this.Dl>=262&&this.Dl<=279;Pc=()=>!this.rc&&2===this.Mo()&&this.kl>=301&&this.kl<=562&&this.Dl>=279&&this.Dl<=296;rotate=t=>{0===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowLeft',code:'ArrowLeft'}))):1===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowUp',code:'ArrowUp'}))):2===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowRight',code:'ArrowRight'}))):3===t&&(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowDown',code:'ArrowDown'})))};Jc=()=>null!==document.fullscreenElement;Nc=t=>{if(this.Jc()){const i=t.target.getBoundingClientRect(),e=window.innerHeight/l.bc.height,s=(window.innerWidth-l.bc.width*e)/2;this.kl=0|this.$c(t.clientX-i.left-s,0,l.bc.width*e,0,789),this.Dl=0|this.$c(t.clientY-i.top,0,l.bc.height*e,0,532)}else{const i=l.bc.getBoundingClientRect(),e=l.bc.width/i.width,s=l.bc.height/i.height;this.kl=(t.clientX-i.left)*e|0,this.Dl=(t.clientY-i.top)*s|0}this.kl<0&&(this.kl=0),this.Dl<0&&(this.Dl=0),this.kl>789&&(this.kl=789),this.Dl>532&&(this.Dl=532)};$c=(t,i,e,s,n)=>(t-i)*(n-s)/(e-i)+s}},2595:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1069);class n{static enabled=!1;static Qc=null;static tf=null;static if=0;static ef=0;static sf=0;static nf=0;static rf=0;static hf=()=>{this.Qc=s.A.Ut(1),this.tf=null,this.if=performance.now(),this.enabled=!0};static lf=()=>{this.enabled=!1,this.Qc=null};static flush=()=>{let t=null;return this.tf&&this.enabled&&(t=this.tf),this.tf=null,t};static stop=()=>{let t=null;return this.Qc&&this.Qc.af>0&&this.enabled&&(t=this.Qc),this.lf(),t};static Gc=(t,i,e)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;this.ef++;const s=performance.now();let n=(s-this.if)/10|0;n>250&&(n=250),this.if=s,this.cf(5),1===e?this.Qc?.p1(1):this.Qc?.p1(2),this.Qc?.p1(n),this.Qc?.p3(t+(i<<10))};static Wc=t=>{if(!this.enabled)return;this.ef++;const i=performance.now();let e=(i-this.if)/10|0;e>250&&(e=250),this.if=i,this.cf(2),1===t?this.Qc?.p1(3):this.Qc?.p1(4),this.Qc?.p1(e)};static Vc=(t,i)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;const e=performance.now();if(e-this.sf>=50){this.sf=e,this.ef++;let s=(e-this.if)/10|0;s>250&&(s=250),this.if=e,t-this.nf<8&&t-this.nf>=-8&&i-this.rf<8&&i-this.rf>=-8?(this.cf(3),this.Qc?.p1(5),this.Qc?.p1(s),this.Qc?.p1(t+(i-this.rf+8<<4)+8-this.nf)):t-this.nf<128&&t-this.nf>=-128&&i-this.rf<128&&i-this.rf>=-128?(this.cf(4),this.Qc?.p1(6),this.Qc?.p1(s),this.Qc?.p1(t+128-this.nf),this.Qc?.p1(i+128-this.rf)):(this.cf(5),this.Qc?.p1(7),this.Qc?.p1(s),this.Qc?.p3(t+(i<<10))),this.nf=t,this.rf=i}};static kc=t=>{if(!this.enabled)return;this.ef++;const i=performance.now();let e=(i-this.if)/10|0;e>250&&(e=250),this.if=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.cf(3),this.Qc?.p1(8),this.Qc?.p1(e),this.Qc?.p1(t)};static Dc=t=>{if(!this.enabled)return;this.ef++;const i=performance.now();let e=(i-this.if)/10|0;e>250&&(e=250),this.if=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.cf(3),this.Qc?.p1(9),this.Qc?.p1(e),this.Qc?.p1(t)};static Kc=()=>{if(!this.enabled)return;this.ef++;const t=performance.now();let i=(t-this.if)/10|0;i>250&&(i=250),this.if=t,this.cf(2),this.Qc?.p1(10),this.Qc?.p1(i)};static Xc=()=>{if(!this.enabled)return;this.ef++;const t=performance.now();let i=(t-this.if)/10|0;i>250&&(i=250),this.if=t,this.cf(2),this.Qc?.p1(11),this.Qc?.p1(i)};static Yc=()=>{if(!this.enabled)return;this.ef++;const t=performance.now();let i=(t-this.if)/10|0;i>250&&(i=250),this.if=t,this.cf(2),this.Qc?.p1(12),this.Qc?.p1(i)};static Hc=()=>{if(!this.enabled)return;this.ef++;const t=performance.now();let i=(t-this.if)/10|0;i>250&&(i=250),this.if=t,this.cf(2),this.Qc?.p1(13),this.Qc?.p1(i)};static cf=t=>{if(this.Qc&&this.Qc.af+t>=500){const t=this.Qc;this.Qc=s.A.Ut(1),this.tf=t}}}},9091:(t,i,e)=>{e.d(i,{c:()=>n,g:()=>s});const s=['F11','F12'],n={'Backspace':{code:8,ch:8},'Enter':{code:10,ch:10},'Shift':{code:16,ch:65535},'Escape':{code:27,ch:27},'Tab':{code:9,ch:9},'CapsLock':{code:20,ch:65535},' ':{code:32,ch:32},'Control':{code:17,ch:65535},'Alt':{code:18,ch:65535},'Meta':{code:524,ch:65535},'ArrowLeft':{code:37,ch:65535},'ArrowRight':{code:39,ch:65535},'ArrowUp':{code:38,ch:65535},'ArrowDown':{code:40,ch:65535},'Insert':{code:155,ch:65535},'Home':{code:36,ch:65535},'PageUp':{code:33,ch:65535},'Delete':{code:127,ch:127},'End':{code:35,ch:65535},'PageDown':{code:34,ch:65535},'`':{code:192,ch:96},'~':{code:192,ch:126},'!':{code:49,ch:33},'@':{code:50,ch:64},'#':{code:51,ch:35},'$':{code:52,ch:36},'%':{code:53,ch:37},'^':{code:54,ch:94},'&':{code:55,ch:38},'*':{code:56,ch:42},'(':{code:57,ch:40},')':{code:48,ch:41},'-':{code:45,ch:45},'_':{code:45,ch:95},'=':{code:61,ch:61},'+':{code:61,ch:43},'[':{code:91,ch:91},'{':{code:91,ch:123},']':{code:93,ch:93},'}':{code:93,ch:125},'\\':{code:92,ch:92},'|':{code:92,ch:124},';':{code:59,ch:59},':':{code:59,ch:58},"'":{code:222,ch:39},'"':{code:222,ch:34},',':{code:44,ch:44},'<':{code:44,ch:60},'.':{code:46,ch:46},'>':{code:46,ch:62},'/':{code:47,ch:47},'?':{code:47,ch:63},'F1':{code:112,ch:65535},'F2':{code:113,ch:65535},'F3':{code:114,ch:65535},'F4':{code:115,ch:65535},'F5':{code:116,ch:65535},'F6':{code:117,ch:65535},'F7':{code:118,ch:65535},'F8':{code:119,ch:65535},'F9':{code:120,ch:65535},'F10':{code:121,ch:65535},'F11':{code:122,ch:65535},'F12':{code:123,ch:65535},0:{code:48,ch:48},1:{code:49,ch:49},2:{code:50,ch:50},3:{code:51,ch:51},4:{code:52,ch:52},5:{code:53,ch:53},6:{code:54,ch:54},7:{code:55,ch:55},8:{code:56,ch:56},9:{code:57,ch:57},'a':{code:65,ch:97},'b':{code:66,ch:98},'c':{code:67,ch:99},'d':{code:68,ch:100},'e':{code:69,ch:101},'f':{code:70,ch:102},'g':{code:71,ch:103},'h':{code:72,ch:104},'i':{code:73,ch:105},'j':{code:74,ch:106},'k':{code:75,ch:107},'l':{code:76,ch:108},'m':{code:77,ch:109},'n':{code:78,ch:110},'o':{code:79,ch:111},'p':{code:80,ch:112},'q':{code:81,ch:113},'r':{code:82,ch:114},'s':{code:83,ch:115},'t':{code:84,ch:116},'u':{code:85,ch:117},'v':{code:86,ch:118},'w':{code:87,ch:119},'x':{code:88,ch:120},'y':{code:89,ch:121},'z':{code:90,ch:122},'A':{code:65,ch:65},'B':{code:66,ch:66},'C':{code:67,ch:67},'D':{code:68,ch:68},'E':{code:69,ch:69},'F':{code:70,ch:70},'G':{code:71,ch:71},'H':{code:72,ch:72},'I':{code:73,ch:73},'J':{code:74,ch:74},'K':{code:75,ch:75},'L':{code:76,ch:76},'M':{code:77,ch:77},'N':{code:78,ch:78},'O':{code:79,ch:79},'P':{code:80,ch:80},'Q':{code:81,ch:81},'R':{code:82,ch:82},'S':{code:83,ch:83},'T':{code:84,ch:84},'U':{code:85,ch:85},'V':{code:86,ch:86},'W':{code:87,ch:87},'X':{code:88,ch:88},'Y':{code:89,ch:89},'Z':{code:90,ch:90}}},1120:(t,i,e)=>{e.d(i,{A:()=>c});var s=e(1069),n=e(8665),r=e(2679),h=e(2511),o=e(3819),l=e(3867),a=e(8950);class c{static Lo=[];static ff=null;static So=null;static El=0;static uf=1;static bl=2;static Yl=3;static Vl=4;static ia=5;static na=6;static ua=7;static df=1;static wf=2;static yf=3;static Af=4;static mf=5;static Zl=6;static ya=1;static Aa=100;static ma=101;static pa=200;static pf=201;static _f=202;static _a=203;static If=205;static gf=300;static Cf=301;static Ef=302;static vf=303;static bf=304;static Tf=305;static Rf=306;static Of=307;static Lf=308;static Sf=309;static xf=310;static Mf=311;static kf=312;static Df=313;static Nf=314;static Ff=315;static Bf=316;static Uf=317;static Pf=318;static Gf=319;static Wf=320;static Yf=321;static Hf=322;static Vf=323;static Da=324;static Na=325;static Kf=326;static ba=327;static Ia=401;static ga=500;static Xf=501;static jf=502;static va=503;static Fa=600;static zf=601;static Zf=602;static qf=603;static Jf=604;static $f=605;static Qf=606;static tu=607;static iu=608;static eu=609;static su=610;static nu=611;static ru=612;static Ba=613;static Ua=650;static Wa=651;static Ya=652;static Ha=653;static Va=654;static Pa=655;static hu=(t,i,e)=>{this.ff=new r.A(5e4),this.So=new r.A(5e4);const n=new s.A(t.read('data'));let h=-1;for(n.af+=2;n.af0){s.Jo=new Uint8Array(r),s.Qo=new Uint16Array(r);for(let t=0;t0){s.scripts=new l.fe(o,null);for(let t=0;t0){const n=e.lastIndexOf(',');s.Wl[t]=this.yu(i,e.substring(0,n),parseInt(e.substring(n+1),10))}}s.Au=new l.fe(5,null);for(let t=0;t<5;t++){const i=n.wu;s.Au[t]=i,0===i.length&&(s.Au[t]=null)}}if(s.type===c.Yl&&(s.fill=1===n.au),s.type===c.Vl||s.type===c.uf){s.Jl=1===n.au;const t=n.au;e&&(s.font=e[t]),s.Ql=1===n.au}if(s.type===c.Vl&&(s.text=n.wu,s.jl=n.wu),s.type!==c.uf&&s.type!==c.Yl&&s.type!==c.Vl||(s.Hl=n.Ko),s.type!==c.Yl&&s.type!==c.Vl||(s.Xl=n.Ko,s.Kl=n.Ko),s.type===c.ia){const t=n.wu;if(t.length>0){const e=t.lastIndexOf(',');s.sa=this.yu(i,t.substring(0,e),parseInt(t.substring(e+1),10))}const e=n.wu;if(e.length>0){const t=e.lastIndexOf(',');s.ea=this.yu(i,e.substring(0,t),parseInt(e.substring(t+1),10))}}if(s.type===c.na){const t=n.au;0!==t&&(s.model=this.la((t-1<<8)+n.au));const i=n.au;0!==i&&(s.mu=this.la((i-1<<8)+n.au)),s.al=n.au,0===s.al?s.al=-1:s.al=(s.al-1<<8)+n.au,s.cl=n.au,0===s.cl?s.cl=-1:s.cl=(s.cl-1<<8)+n.au,s.zoom=n.ou,s.oa=n.ou,s.fa=n.ou}if(s.type===c.ua){s.Ol=new Int32Array(s.width*s.height),s.Ll=new Int32Array(s.width*s.height),s.Jl=1===n.au;const t=n.au;e&&(s.font=e[t]),s.Ql=1===n.au,s.Hl=n.Ko,s.Sl=n.fu,s.xl=n.fu,s.uu=1===n.au,s.Au=new l.fe(5,null);for(let t=0;t<5;t++){const i=n.wu;s.Au[t]=i,0===i.length&&(s.Au[t]=null)}}s.zl!==c.wf&&s.type!==c.bl||(s.pu=n.wu,s.action=n.wu,s._u=n.ou),s.zl!==c.df&&s.zl!==c.Af&&s.zl!==c.mf&&s.zl!==c.Zl||(s.Iu=n.wu,0===s.Iu.length&&(s.zl===c.df?s.Iu='Ok':s.zl===c.Af||s.zl===c.mf?s.Iu='Select':s.zl===c.Zl&&(s.Iu='Continue')))}this.ff=null,this.So=null};static yu=(t,i,e)=>{const s=o.A.gu(i)<<8n|BigInt(e);if(this.ff){const t=this.ff.get(s);if(t)return t}let n;try{n=h.A.Cu(t,i,e),this.ff?.put(s,n)}catch(t){return null}return n};static la=t=>{if(this.So){const i=this.So.get(BigInt(t));if(i)return i}const i=n.A.model(t);return this.So?.put(BigInt(t),i),i};id=-1;lu=-1;type=-1;zl=-1;gl=0;width=0;height=0;cu=-1;Jo=null;Qo=null;scripts=null;scroll=0;hide=!1;draggable=!1;uu=!1;du=!1;Sl=0;xl=0;Tl=null;Rl=null;Wl=null;Au=null;fill=!1;Jl=!1;font=null;Ql=!1;text=null;jl=null;Hl=0;Xl=0;Kl=0;sa=null;ea=null;model=null;mu=null;al=-1;cl=-1;zoom=0;oa=0;fa=0;pu=null;action=null;_u=-1;Iu=null;ll=null;ml=null;pl=null;x=0;y=0;vl=0;Ol=null;Ll=null;ul=0;fl=0;la(t,i,e){let s=this.model;if(e&&(s=this.mu),!s)return null;if(-1===t&&-1===i&&!s.Eu)return s;const r=n.A.vu(s,!0,!0,!1);return-1===t&&-1===i||r.xa(),-1!==t&&r.Ma(t),-1!==i&&r.Ma(i),r.ka(64,768,-50,-10,-50,!0),r}bu(){if(this.lu===this.id)return this.x;let t=c.Lo[this.lu];if(!t.ll||!t.ml||!t.pl)return this.x;let i=t.ll.indexOf(this.id);if(-1===i)return this.x;let e=t.ml[i];for(;t.lu!==t.id;){const s=c.Lo[t.lu];s.ll&&s.ml&&s.pl&&(i=s.ll.indexOf(t.id),-1!==i&&(e+=s.ml[i])),t=s}return e}Tu(){if(this.lu===this.id)return this.y;let t=c.Lo[this.lu];if(!t.ll||!t.ml||!t.pl)return this.y;let i=t.ll.indexOf(this.id);if(-1===i)return this.y;let e=t.pl[i];for(;t.lu!==t.id;){const s=c.Lo[t.lu];s.ll&&s.ml&&s.pl&&(i=s.ll.indexOf(t.id),-1!==i&&(e+=s.pl[i])),t=s}return e}outline(t){const i=this.bu(),e=this.Tu();a.A._l(i,e,this.width,this.height,t)}move(t,i){if(this.lu===this.id)return;this.x=0,this.y=0;const e=c.Lo[this.lu];if(e.ll&&e.ml&&e.pl){const s=e.ll.indexOf(this.id);-1!==s&&(e.ml[s]=t,e.pl[s]=i)}}delete(){if(this.lu===this.id)return;const t=c.Lo[this.lu];if(t.ll&&t.ml&&t.pl){const i=t.ll.indexOf(this.id);-1!==i&&(t.ll.splice(i,1),t.ml.splice(i,1),t.pl.splice(i,1))}}}},6333:(t,i,e)=>{e.d(i,{$:()=>s});class s{id;Ru=null;constructor(t){this.id=t}Ou(t){for(;;){const i=t.au;if(0===i)break;this.decode(i,t)}return this}}},2164:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(6333);class r extends n.${static count=0;static Lo=[];static hu=t=>{const i=new s.A(t.read('flo.dat'));this.count=i.ou;for(let t=0;t(e>179&&(i=i/2|0),e>192&&(i=i/2|0),e>217&&(i=i/2|0),e>243&&(i=i/2|0),(t/4<<10)+(i/32<<7)+(e/2|0));static Su=(t,i)=>-1===t?12345678:((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);static xu=(t,i)=>-2===t?12345678:-1===t?(i<0?i=0:i>127&&(i=127),127-i):((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);Mu=0;texture=-1;ku=!1;Du=!0;Nu=0;Fu=0;Bu=0;Uu=0;Pu=0;Gu=0;decode(t,i){1===t?(this.Mu=i.Wu,this.setColor(this.Mu)):2===t?this.texture=i.au:3===t?this.ku=!0:5===t?this.Du=!1:6===t?this.Ru=i.wu:console.log('Error unrecognised config code: ',t)}setColor(t){const i=(t>>16&255)/256,e=(t>>8&255)/256,s=(255&t)/256;let n=i;ei&&(h=e),s>h&&(h=s);let o=0,l=0;const a=(n+h)/2;n!==h&&(a<.5&&(l=(h-n)/(h+n)),a>=.5&&(l=(h-n)/(2-h-n)),i===h?o=(e-s)/(h-n):e===h?o=(s-i)/(h-n)+2:s===h&&(o=(i-e)/(h-n)+4)),o/=6,this.Nu=256*o|0,this.Fu=256*l|0,this.Bu=256*a|0,this.Fu<0?this.Fu=0:this.Fu>255&&(this.Fu=255),this.Bu<0?this.Bu=0:this.Bu>255&&(this.Bu=255),this.Uu=a>.5?(1-a)*l*512|0:a*l*512|0,this.Uu<1&&(this.Uu=1),this.Pu=o*this.Uu|0;let c=this.Nu+(16*Math.random()|0)-8;c<0?c=0:c>255&&(c=255);let f=this.Fu+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255);let u=this.Bu+(48*Math.random()|0)-24;u<0?u=0:u>255&&(u=255),this.Gu=r.Lu(c,f,u)}}},8317:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(1069),n=e(6333),r=e(8665),h=e(3867);class o extends n.${static count=0;static Lo=[];static hu=t=>{const i=new s.A(t.read('idk.dat'));this.count=i.ou;for(let t=0;t=40&&t<50)this.Vu[t-40]=i.ou;else if(t>=50&&t<60)this.Ku[t-50]=i.ou;else{if(!(t>=60&&t<70))throw new Error(`Unrecognized idk config code: ${t}`);this.Hu[t-60]=i.ou}}la(){if(!this.Yu)return null;const t=new h.fe(this.Yu.length,null);for(let i=0;i{e.d(i,{A:()=>c});var s=e(6333),n=e(1069),r=e(2679),h=e(8665),o=e(1023),l=e(6169),a=e(3867);class c extends s.${static count=0;static cache=null;static ju=null;static zu=null;static Zu=0;static qu=new r.A(500);static Ju=new r.A(30);static hu=t=>{this.ju=new n.A(t.read('loc.dat'));const i=new n.A(t.read('loc.idx'));this.count=i.ou,this.zu=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.zu||!this.ju)throw new Error('LocType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Zu=(this.Zu+1)%10;const i=this.cache[this.Zu];return this.ju.af=this.zu[t],i.id=t,i.reset(),i.Ou(this.ju),i.$u||(i.$u=new Int32Array(1)),-1===i.Qu&&i.$u&&(i.active=i.$u.length>0&&i.$u[0]===o.A.td.id,i.ed&&(i.active=!0)),i};static To=()=>{this.qu=null,this.Ju=null,this.zu=null,this.cache=null,this.ju=null};Yu=null;$u=null;name=null;sd=null;Vu=null;Ku=null;width=1;length=1;nd=!0;rd=!0;active=!1;Qu=-1;hd=!1;od=!1;Du=!1;al=-1;ld=!1;ad=16;fd=0;ud=0;ed=null;dd=-1;wd=-1;yd=!1;Ad=!0;md=128;pd=128;_d=128;Id=0;gd=0;Cd=0;Ed=0;vd=!1;decode(t,i){if(1===t){const t=i.au;this.Yu=new Int32Array(t),this.$u=new Int32Array(t);for(let e=0;e=30&&t<39)this.ed||(this.ed=new a.fe(5,null)),this.ed[t-30]=i.wu,'hidden'===this.ed[t-30]?.toLowerCase()&&(this.ed[t-30]=null);else if(40===t){const t=i.au;this.Vu=new Uint16Array(t),this.Ku=new Uint16Array(t);for(let e=0;e=this.Yu.length)return null;let d=this.Yu[a];if(-1===d)return null;const w=this.yd!==i>3;w&&(d+=65536);let y=c.qu?.get(BigInt(d));y||(y=h.A.model(65535&d),w&&y.Md(),c.qu?.put(BigInt(d),y));const A=128!==this.md||128!==this.pd||128!==this._d,m=0!==this.gd||0!==this.Cd||0!==this.Ed;let p=h.A.vu(y,!this.Vu,!this.ld,i===l.A.kd&&-1===o&&!A&&!m);for(-1!==o&&(p.xa(),p.Ma(o),p.Dd=null,p.Nd=null);i-- >0;)p.Fd();if(this.Vu&&this.Ku)for(let t=0;t{e.d(i,{A:()=>l});var s=e(6333),n=e(1069),r=e(2679),h=e(8665),o=e(3867);class l extends s.${static count=0;static cache=null;static ju=null;static zu=null;static Zu=0;static So=new r.A(30);static hu=t=>{this.ju=new n.A(t.read('npc.dat'));const i=new n.A(t.read('npc.idx'));this.count=i.ou,this.zu=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.zu||!this.ju)throw new Error('NpcType not loaded!!!');for(let i=0;i<20;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Zu=(this.Zu+1)%20;const i=this.cache[this.Zu]=new l(t);return this.ju.af=this.zu[t],i.Ou(this.ju),i};static To=()=>{this.So=null,this.zu=null,this.cache=null,this.ju=null};name=null;sd=null;size=1;Yu=null;Hu=null;ld=!1;Pd=-1;Gd=-1;Wd=-1;Yd=-1;Hd=-1;Vu=null;Ku=null;ed=null;md=-1;pd=-1;_d=-1;Vd=!0;Kd=-1;Xd=128;jd=128;decode(t,i){if(1===t){const t=i.au;this.Yu=new Uint16Array(t);for(let e=0;e=30&&t<40)this.ed||(this.ed=new o.fe(5,null)),this.ed[t-30]=i.wu,'hidden'===this.ed[t-30]?.toLowerCase()&&(this.ed[t-30]=null);else if(40===t){const t=i.au;this.Vu=new Uint16Array(t),this.Ku=new Uint16Array(t);for(let e=0;e{e.d(i,{A:()=>u});var s=e(6333),n=e(1069),r=e(2511),h=e(2679),o=e(8665),l=e(4583),a=e(8950),c=e(9298),f=e(3867);class u extends s.${static count=0;static cache=null;static ju=null;static zu=null;static Zu=0;static Qd=!0;static So=new h.A(50);static tw=new h.A(200);static hu=(t,i)=>{this.Qd=i,this.ju=new n.A(t.read('obj.dat'));const e=new n.A(t.read('obj.idx'));this.count=e.ou,this.zu=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.zu||!this.ju)throw new Error('ObjType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Zu=(this.Zu+1)%10;const i=this.cache[this.Zu];return this.ju.af=this.zu[t],i.id=t,i.reset(),i.Ou(this.ju),-1!==i.iw&&i.ew(),!this.Qd&&i.members&&(i.name='Members Object',i.sd="Login to a members' server to use this object.",i.ed=null,i.sw=null),i};static To=()=>{this.So=null,this.tw=null,this.zu=null,this.cache=null,this.ju=null};static Ml=(t,i)=>{if(u.tw){let e=u.tw.get(BigInt(t));if(e&&e.nw!==i&&-1!==e.nw&&(e.rw(),e=null),e)return e}let e=u.get(t);if(e.hw||(i=-1),e.hw&&e.ow&&i>1){let t=-1;for(let s=0;s<10;s++)i>=e.ow[s]&&0!==e.ow[s]&&(t=e.hw[s]);-1!==t&&(e=u.get(t))}const s=new r.A(32,32),n=l.A.ra,h=l.A.ha,o=l.A.lw,f=a.A.aw,d=a.A.cw,w=a.A.fw,y=a.A.left,A=a.A.right,m=a.A.top,p=a.A.bottom;l.A.uw=!1,a.A.bind(s.aw,32,32),a.A.fillRect(0,0,32,32,c.A.Pl),l.A.Tc();const _=e.dw(1),I=l.A.sin[e.ww]*e.yw>>16,g=l.A.cos[e.ww]*e.yw>>16;_.ca(0,e.Aw,e.mw,e.ww,e.pw,I+(_.Ud/2|0)+e._w,g+e._w);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.aw[t+32*i]&&(t>0&&s.aw[t+32*i-1]>1||i>0&&s.aw[t+32*(i-1)]>1||t<31&&s.aw[t+32*i+1]>1||i<31&&s.aw[t+32*(i+1)]>1)&&(s.aw[t+32*i]=1);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.aw[t+32*i]&&t>0&&i>0&&s.aw[t+32*(i-1)-1]>0&&(s.aw[t+32*i]=3153952);if(-1!==e.iw){const t=this.Ml(e.Iw,10),i=t.Fl,s=t.nw;t.Fl=32,t.nw=32,t.gw(5,5,22,22),t.Fl=i,t.nw=s}return u.tw?.put(BigInt(t),s),a.A.bind(f,d,w),a.A.Al(y,m,A,p),l.A.ra=n,l.A.ha=h,l.A.lw=o,l.A.uw=!0,e.da?s.Fl=33:s.Fl=32,s.nw=i,s};model=0;name=null;sd=null;Vu=null;Ku=null;yw=2e3;ww=0;Aw=0;mw=0;pw=0;_w=0;Cw=!1;Ew=-1;da=!1;bw=1;members=!1;ed=null;sw=null;Tw=-1;Rw=-1;Ow=0;Lw=-1;Sw=-1;xw=0;Mw=-1;kw=-1;Dw=-1;Nw=-1;Fw=-1;Bw=-1;hw=null;ow=null;Iw=-1;iw=-1;decode(t,i){if(1===t)this.model=i.ou;else if(2===t)this.name=i.wu;else if(3===t)this.sd=i.wu;else if(4===t)this.yw=i.ou;else if(5===t)this.ww=i.ou;else if(6===t)this.Aw=i.ou;else if(7===t)this.pw=i.fu,this.pw>32767&&(this.pw-=65536);else if(8===t)this._w=i.fu,this._w>32767&&(this._w-=65536);else if(9===t)this.Cw=!0;else if(10===t)this.Ew=i.ou;else if(11===t)this.da=!0;else if(12===t)this.bw=i.Ko;else if(16===t)this.members=!0;else if(23===t)this.Tw=i.ou,this.Ow=i.bd;else if(24===t)this.Rw=i.ou;else if(25===t)this.Lw=i.ou,this.xw=i.bd;else if(26===t)this.Sw=i.ou;else if(t>=30&&t<35)this.ed||(this.ed=new f.fe(5,null)),this.ed[t-30]=i.wu,'hidden'===this.ed[t-30]?.toLowerCase()&&(this.ed[t-30]=null);else if(t>=35&&t<40)this.sw||(this.sw=new f.fe(5,null)),this.sw[t-35]=i.wu;else if(40===t){const t=i.au;this.Vu=new Uint16Array(t),this.Ku=new Uint16Array(t);for(let e=0;e=100&&t<110&&(this.hw&&this.ow||(this.hw=new Uint16Array(10),this.ow=new Uint16Array(10)),this.hw[t-100]=i.ou,this.ow[t-100]=i.ou)}Uw(t){let i=this.Tw;if(1===t&&(i=this.Lw),-1===i)return null;let e=this.Rw,s=this.Mw;1===t&&(e=this.Sw,s=this.kw);let n=o.A.model(i);if(-1!==e){const t=o.A.model(e);if(-1===s){const i=[n,t];n=o.A.Ta(i,2)}else{const i=[n,t,o.A.model(s)];n=o.A.Ta(i,3)}}if(0===t&&0!==this.Ow&&n.translate(this.Ow,0,0),1===t&&0!==this.xw&&n.translate(this.xw,0,0),this.Vu&&this.Ku)for(let t=0;t1){let i=-1;for(let e=0;e<10;e++)t>=this.ow[e]&&0!==this.ow[e]&&(i=this.hw[e]);if(-1!==i)return u.get(i).dw(1)}if(u.So){const t=u.So.get(BigInt(this.id));if(t)return t}const i=o.A.model(this.model);if(this.Vu&&this.Ku)for(let t=0;t{e.d(i,{A:()=>h});var s=e(6333),n=e(1069),r=e(6730);class h extends s.${static count=0;static Lo=[];static hu=t=>{const i=new n.A(t.read('seq.dat'));this.count=i.ou;for(let t=0;t{e.d(i,{A:()=>l});var s=e(6333),n=e(1069),r=e(1312),h=e(8665),o=e(2679);class l extends s.${static count=0;static Lo=[];static So=new o.A(30);static hu=t=>{const i=new n.A(t.read('spotanim.dat'));this.count=i.ou;for(let t=0;t=40&&t<50)this.Vu[t-40]=i.ou;else{if(!(t>=50&&t<60))throw new Error(`Unrecognized spotanim config code: ${t}`);this.Ku[t-50]=i.ou}}la(){let t=l.So?.get(BigInt(this.id));if(t)return t;t=h.A.model(this.model);for(let i=0;i<6;i++)0!==this.Vu[0]&&t.Ra(this.Vu[i],this.Ku[i]);return l.So?.put(BigInt(this.id),t),t}}},3764:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(6333),n=e(1069);class r extends s.${static count=0;static Lo=[];static Kw=[];static Xw=0;static hu=t=>{const i=new n.A(t.read('varp.dat'));this.count=i.ou;for(let t=0;t{e.d(i,{A:()=>s});class s{static OPEN=0;static $w=1;static Qw=2;static ty=4;static iy=8;static ey=s.$w<<4;static sy=s.Qw<<4;static ny=s.ty<<4;static hy=s.iy<<4;static oy=256;static ly=512;static uy=1024;static wy=2048;static yy=4096;static Ay=s.ly<<4;static my=s.uy<<4;static py=s.wy<<4;static _y=s.yy<<4;static Iy=s.oy<<9;static gy=524288;static Cy=2097152;static Ey=s.Cy|s.gy;static vy=s.oy|s.Ey;static by=s.Qw|s.vy;static Ty=s.iy|s.vy;static Ry=s.Qw|s.ty|s.Ty;static Oy=s.sy|s.vy;static Ly=s.iy|s.ey|s.Oy;static Sy=s.hy|s.vy;static xy=s.$w|s.Qw|s.Sy;static My=s.sy|s.ny|s.Sy;static ky=16777215}},670:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(9456),n=e(6169),r=e(1023),h=e(4909);class o{static Dr=4;static jr=104;static index=(t,i)=>t*o.jr+i;offsetX;Dy;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.Dy=0,this.sizeX=o.jr,this.sizeZ=o.jr,this.flags=new Int32Array(this.sizeX*this.sizeZ),this.reset()}reset=()=>{for(let t=0;t{this.flags[o.index(t-this.offsetX,i-this.Dy)]|=s.A.Cy};Fy=(t,i)=>{this.flags[o.index(t-this.offsetX,i-this.Dy)]&=~s.A.Cy};By=(t,i,e,r,h,o)=>{let l=s.A.oy;o&&(l|=s.A.Iy);const a=t-this.offsetX,c=i-this.Dy;if(h===n.A.Uy||h===n.A.Py){const t=e;e=r,r=t}for(let t=a;t=0&&t=0&&i{let l=s.A.oy;o&&(l|=s.A.Iy);const a=t-this.offsetX,c=i-this.Dy;if(h===n.A.Uy||h===n.A.Py){const t=e;e=r,r=t}for(let t=a;t=0&&t=0&&i{const l=t-this.offsetX,a=i-this.Dy,c=o?s.A._y:s.A.hy,f=o?s.A.yy:s.A.iy,u=o?s.A.uy:s.A.Qw,d=o?s.A.my:s.A.sy,w=o?s.A.ly:s.A.$w,y=o?s.A.Ay:s.A.ey,A=o?s.A.wy:s.A.ty,m=o?s.A.py:s.A.ny;e===r.A.Yy.id?h===n.A.kd?(this.add(l,a,c),this.add(l-1,a,f)):h===n.A.Uy?(this.add(l,a,u),this.add(l,a+1,d)):h===n.A.Hy?(this.add(l,a,f),this.add(l+1,a,c)):h===n.A.Py&&(this.add(l,a,d),this.add(l,a-1,u)):e===r.A.Vy.id||e===r.A.Ky.id?h===n.A.kd?(this.add(l,a,w),this.add(l-1,a+1,y)):h===n.A.Uy?(this.add(l,a,A),this.add(l+1,a+1,m)):h===n.A.Hy?(this.add(l,a,y),this.add(l+1,a-1,w)):h===n.A.Py&&(this.add(l,a,m),this.add(l-1,a-1,A)):e===r.A.Xy.id&&(h===n.A.kd?(this.add(l,a,u|c),this.add(l-1,a,f),this.add(l,a+1,d)):h===n.A.Uy?(this.add(l,a,u|f),this.add(l,a+1,d),this.add(l+1,a,c)):h===n.A.Hy?(this.add(l,a,d|f),this.add(l+1,a,c),this.add(l,a-1,u)):h===n.A.Py&&(this.add(l,a,d|c),this.add(l,a-1,u),this.add(l-1,a,f))),o&&this.Wy(t,i,e,h,!1)};jy=(t,i,e,h,o)=>{const l=t-this.offsetX,a=i-this.Dy,c=o?s.A._y:s.A.hy,f=o?s.A.yy:s.A.iy,u=o?s.A.uy:s.A.Qw,d=o?s.A.my:s.A.sy,w=o?s.A.ly:s.A.$w,y=o?s.A.Ay:s.A.ey,A=o?s.A.wy:s.A.ty,m=o?s.A.py:s.A.ny;e===r.A.Yy.id?h===n.A.kd?(this.remove(l,a,c),this.remove(l-1,a,f)):h===n.A.Uy?(this.remove(l,a,u),this.remove(l,a+1,d)):h===n.A.Hy?(this.remove(l,a,f),this.remove(l+1,a,c)):h===n.A.Py&&(this.remove(l,a,d),this.remove(l,a-1,u)):e===r.A.Vy.id||e===r.A.Ky.id?h===n.A.kd?(this.remove(l,a,w),this.remove(l-1,a+1,y)):h===n.A.Uy?(this.remove(l,a,A),this.remove(l+1,a+1,m)):h===n.A.Hy?(this.remove(l,a,y),this.remove(l+1,a-1,w)):h===n.A.Py&&(this.remove(l,a,m),this.remove(l-1,a-1,A)):e===r.A.Xy.id&&(h===n.A.kd?(this.remove(l,a,u|c),this.remove(l-1,a,f),this.remove(l,a+1,d)):h===n.A.Uy?(this.remove(l,a,u|f),this.remove(l,a+1,d),this.remove(l+1,a,c)):h===n.A.Hy?(this.remove(l,a,d|f),this.remove(l+1,a,c),this.remove(l,a-1,u)):h===n.A.Py&&(this.remove(l,a,d|c),this.remove(l,a-1,u),this.remove(l-1,a,f))),o&&this.jy(t,i,e,h,!1)};zy=(t,i,e,h,l,a)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.Dy,u=e-this.offsetX,d=h-this.Dy,w=o.index(c,f);if(l===r.A.Yy.id){if(a===n.A.kd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Oy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.by)===s.A.OPEN)return!0}else if(a===n.A.Uy){if(c===u&&f===d+1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Ty)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Sy)===s.A.OPEN)return!0}else if(a===n.A.Hy){if(c===u+1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Oy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.by)===s.A.OPEN)return!0}else if(a===n.A.Py){if(c===u&&f===d-1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Ty)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Sy)===s.A.OPEN)return!0}}else if(l===r.A.Xy.id){if(a===n.A.kd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Sy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.by)===s.A.OPEN)return!0}else if(a===n.A.Uy){if(c===u-1&&f===d&&(this.flags[w]&s.A.Ty)===s.A.OPEN)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.by)===s.A.OPEN)return!0}else if(a===n.A.Hy){if(c===u-1&&f===d&&(this.flags[w]&s.A.Ty)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Oy)===s.A.OPEN)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1)return!0}else if(a===n.A.Py){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Oy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Sy)===s.A.OPEN)return!0;if(c===u&&f===d-1)return!0}}else if(l===r.A.Zy.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.sy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Qw)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.iy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.hy)===s.A.OPEN)return!0}return!1};qy=(t,i,e,h,l,a)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.Dy,u=e-this.offsetX,d=h-this.Dy,w=o.index(c,f);if(l===r.A.Jy.id||l===r.A.$y.id){if(l===r.A.$y.id&&(a=a+2&3),a===n.A.kd){if(c===u+1&&f===d&&(this.flags[w]&s.A.hy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Qw)===s.A.OPEN)return!0}else if(a===n.A.Uy){if(c===u-1&&f===d&&(this.flags[w]&s.A.iy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Qw)===s.A.OPEN)return!0}else if(a===n.A.Hy){if(c===u-1&&f===d&&(this.flags[w]&s.A.iy)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.sy)===s.A.OPEN)return!0}else if(a===n.A.Py){if(c===u+1&&f===d&&(this.flags[w]&s.A.hy)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.sy)===s.A.OPEN)return!0}}else if(l===r.A.Qy.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.sy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Qw)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.iy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.hy)===s.A.OPEN)return!0}return!1};tA=(t,i,e,n,r,l,a)=>{const c=e+r-1,f=n+l-1,u=o.index(t-this.offsetX,i-this.Dy);return t>=e&&t<=c&&i>=n&&i<=f||(t===e-1&&i>=n&&i<=f&&(this.flags[u]&s.A.iy)===s.A.OPEN&&(a&h.A.kd)===s.A.OPEN||(t===c+1&&i>=n&&i<=f&&(this.flags[u]&s.A.hy)===s.A.OPEN&&(a&h.A.Hy)===s.A.OPEN||(i===n-1&&t>=e&&t<=c&&(this.flags[u]&s.A.Qw)===s.A.OPEN&&(a&h.A.Py)===s.A.OPEN||i===f+1&&t>=e&&t<=c&&(this.flags[u]&s.A.sy)===s.A.OPEN&&(a&h.A.Uy)===s.A.OPEN)))};add=(t,i,e)=>{this.flags[o.index(t,i)]|=e};remove=(t,i,e)=>{this.flags[o.index(t,i)]&=s.A.ky-e}}},4909:(t,i,e)=>{e.d(i,{A:()=>s});class s{static Uy=1;static Hy=2;static Py=4;static kd=8}},6169:(t,i,e)=>{e.d(i,{A:()=>s});class s{static kd=0;static Uy=1;static Hy=2;static Py=3}},5599:(t,i,e)=>{e.d(i,{A:()=>s});class s{static iA=0;static eA=1;static sA=2;static nA=3}},1023:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5599);class n{static Yy=new n(0,s.A.iA);static Vy=new n(1,s.A.iA);static Xy=new n(2,s.A.iA);static Ky=new n(3,s.A.iA);static rA=new n(4,s.A.eA);static hA=new n(5,s.A.eA);static Jy=new n(6,s.A.eA);static $y=new n(7,s.A.eA);static Qy=new n(8,s.A.eA);static Zy=new n(9,s.A.sA);static td=new n(10,s.A.sA);static oA=new n(11,s.A.sA);static lA=new n(12,s.A.sA);static aA=new n(13,s.A.sA);static cA=new n(14,s.A.sA);static fA=new n(15,s.A.sA);static uA=new n(16,s.A.sA);static dA=new n(17,s.A.sA);static wA=new n(18,s.A.sA);static yA=new n(19,s.A.sA);static AA=new n(20,s.A.sA);static mA=new n(21,s.A.sA);static nA=new n(22,s.A.nA);static values(){return[this.Yy,this.Vy,this.dA,this.fA,this.Xy,this.cA,this.Zy,this.Ky,this.nA,this.lA,this.oA,this.Jy,this.AA,this.td,this.hA,this.aA,this.$y,this.rA,this.uA,this.Qy,this.yA,this.mA,this.wA]}static of(t){const i=this.values();for(let e=0;e{e.d(i,{A:()=>A});var s=e(670),n=e(2164),r=e(1069),h=e(4583),o=e(3045),l=e(5637),a=e(4197),c=e(1312),f=e(1023),u=e(6169),d=e(9298),w=e(5518),y=e(3867);class A{static pA=Int8Array.of(1,2,4,8);static _A=Uint8Array.of(16,32,64,128);static IA=Int8Array.of(1,0,-1,0);static gA=Int8Array.of(0,-1,0,1);static CA=(17*Math.random()|0)-8;static EA=(33*Math.random()|0)-16;static et=!0;static vA=0;static bA=!1;static TA=(t,i)=>{let e=this.RA(t+45365,i+91923,4)+(this.RA(t+10294,i+37821,2)-128>>1)+(this.RA(t,i,1)-128>>2)-128;return e=35+(.3*e|0),e<10?e=10:e>60&&(e=60),e};static RA=(t,i,e)=>{const s=t/e|0,n=t&e-1,r=i/e|0,h=i&e-1,o=this.OA(s,r),l=this.OA(s+1,r),a=this.OA(s,r+1),c=this.OA(s+1,r+1),f=this.LA(o,l,n,e),u=this.LA(a,c,n,e);return this.LA(f,u,h,e)};static LA=(t,i,e,s)=>{const n=65536-h.A.cos[1024*e/s|0]>>1;return(t*(65536-n)>>16)+(i*n>>16)};static OA=(t,i)=>((this.SA(t-1,i-1)+this.SA(t+1,i-1)+this.SA(t-1,i+1)+this.SA(t+1,i+1))/16|0)+((this.SA(t-1,i)+this.SA(t+1,i)+this.SA(t,i-1)+this.SA(t,i+1))/8|0)+(this.SA(t,i)/4|0);static SA=(t,i)=>{const e=t+57*i,s=BigInt(e<<13^e);return 255&Number((s*(s*s*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static By=(t,i,e,s,n,r,h,o,d,w,y)=>{const m=n[y][i][e],p=n[y][i+1][e],_=n[y][i+1][e+1],I=n[y][i][e+1],g=m+p+_+I>>2,C=l.A.get(o);let E=i+(e<<7)+(o<<14)+1073741824|0;C.active||(E+=-2147483648),E|=0;const v=(w<<6)+d<<24>>24;if(d===f.A.nA.id)s?.xA(C.la(f.A.nA.id,w,m,p,_,I,-1),t,i,e,g,E,v),C.nd&&C.active&&h?.Ny(i,e),-1!==C.al&&r.MA(new a.A(o,t,3,i,e,c.A.Lo[C.al],!0));else if(d===f.A.td.id||d===f.A.oA.id){const n=C.la(f.A.td.id,w,m,p,_,I,-1);if(n){let r,h,o=0;d===f.A.oA.id&&(o+=256),w===u.A.Uy||w===u.A.Py?(r=C.length,h=C.width):(r=C.width,h=C.length),s?.By(t,i,e,g,n,null,E,v,r,h,o)}C.nd&&h?.By(i,e,C.width,C.length,w,C.rd),-1!==C.al&&r.MA(new a.A(o,t,2,i,e,c.A.Lo[C.al],!0))}else if(d>=f.A.lA.id)s?.By(t,i,e,g,C.la(d,w,m,p,_,I,-1),null,E,v,1,1,0),C.nd&&h?.By(i,e,C.width,C.length,w,C.rd),-1!==C.al&&r.MA(new a.A(o,t,2,i,e,c.A.Lo[C.al],!0));else if(d===f.A.Yy.id)s?.Wy(t,i,e,g,A.pA[w],0,C.la(f.A.Yy.id,w,m,p,_,I,-1),null,E,v),C.nd&&h?.Wy(i,e,d,w,C.rd),-1!==C.al&&r.MA(new a.A(o,t,0,i,e,c.A.Lo[C.al],!0));else if(d===f.A.Vy.id)s?.Wy(t,i,e,g,A._A[w],0,C.la(f.A.Vy.id,w,m,p,_,I,-1),null,E,v),C.nd&&h?.Wy(i,e,d,w,C.rd),-1!==C.al&&r.MA(new a.A(o,t,0,i,e,c.A.Lo[C.al],!0));else if(d===f.A.Xy.id){const n=w+1&3;s?.Wy(t,i,e,g,A.pA[w],A.pA[n],C.la(f.A.Xy.id,w+4,m,p,_,I,-1),C.la(f.A.Xy.id,n,m,p,_,I,-1),E,v),C.nd&&h?.Wy(i,e,d,w,C.rd),-1!==C.al&&r.MA(new a.A(o,t,0,i,e,c.A.Lo[C.al],!0))}else if(d===f.A.Ky.id)s?.Wy(t,i,e,g,A._A[w],0,C.la(f.A.Ky.id,w,m,p,_,I,-1),null,E,v),C.nd&&h?.Wy(i,e,d,w,C.rd),-1!==C.al&&r.MA(new a.A(o,t,0,i,e,c.A.Lo[C.al],!0));else if(d===f.A.Zy.id)s?.By(t,i,e,g,C.la(d,w,m,p,_,I,-1),null,E,v,1,1,0),C.nd&&h?.By(i,e,C.width,C.length,w,C.rd),-1!==C.al&&r.MA(new a.A(o,t,2,i,e,c.A.Lo[C.al],!0));else if(d===f.A.rA.id)s?.kA(t,i,e,g,0,0,E,C.la(f.A.rA.id,u.A.kd,m,p,_,I,-1),v,512*w,A.pA[w]),-1!==C.al&&r.MA(new a.A(o,t,1,i,e,c.A.Lo[C.al],!0));else if(d===f.A.hA.id){let n=16;if(s){const r=s.DA(t,i,e);r>0&&(n=l.A.get(r>>14&32767).ad)}s?.kA(t,i,e,g,A.IA[w]*n,A.gA[w]*n,E,C.la(f.A.rA.id,u.A.kd,m,p,_,I,-1),v,512*w,A.pA[w]),-1!==C.al&&r.MA(new a.A(o,t,1,i,e,c.A.Lo[C.al],!0))}else d===f.A.Jy.id?(s?.kA(t,i,e,g,0,0,E,C.la(f.A.rA.id,u.A.kd,m,p,_,I,-1),v,w,256),-1!==C.al&&r.MA(new a.A(o,t,1,i,e,c.A.Lo[C.al],!0))):d===f.A.$y.id?(s?.kA(t,i,e,g,0,0,E,C.la(f.A.rA.id,u.A.kd,m,p,_,I,-1),v,w,512),-1!==C.al&&r.MA(new a.A(o,t,1,i,e,c.A.Lo[C.al],!0))):d===f.A.Qy.id&&(s?.kA(t,i,e,g,0,0,E,C.la(f.A.rA.id,u.A.kd,m,p,_,I,-1),v,w,768),-1!==C.al&&r.MA(new a.A(o,t,1,i,e,c.A.Lo[C.al],!0)))};NA;FA;Hr;Vr;BA;UA;PA;GA;WA;YA;HA;VA;KA;XA;jA;zA;constructor(t,i,e,n){this.NA=t,this.FA=i,this.Hr=e,this.Vr=n,this.BA=new y.ZA(s.A.Dr,t,i),this.UA=new y.ZA(s.A.Dr,t,i),this.PA=new y.ZA(s.A.Dr,t,i),this.GA=new y.ZA(s.A.Dr,t,i),this.zA=new y.qA(s.A.Dr,t+1,i+1),this.WA=new y.ZA(s.A.Dr,t+1,i+1),this.YA=new y.Xr(t+1,i+1),this.HA=new Int32Array(i),this.VA=new Int32Array(i),this.KA=new Int32Array(i),this.XA=new Int32Array(i),this.jA=new Int32Array(i)}JA=(t,i)=>{for(let t=0;t=0&&i[s]?.Ny(e,n)}A.CA+=(5*Math.random()|0)-2,A.CA<-8?A.CA=-8:A.CA>8&&(A.CA=8),A.EA+=(5*Math.random()|0)-2,A.EA<-16?A.EA=-16:A.EA>16&&(A.EA=16);for(let i=0;i>8;for(let t=1;t>2)+(e[n+1][t]>>3)+(e[n][t-1]>>2)+(e[n][t+1]>>3)+(e[n][t]>>1);this.YA[n][t]=u-d}for(let t=0;t=0&&s0){const i=n.A.Lo[e-1];this.HA[t]+=i.Pu,this.VA[t]+=i.Fu,this.KA[t]+=i.Bu,this.XA[t]+=i.Uu,r=this.jA[t]++}}const h=e-5;if(h>=0&&h0){const i=n.A.Lo[e-1];this.HA[t]-=i.Pu,this.VA[t]-=i.Fu,this.KA[t]-=i.Bu,this.XA[t]-=i.Uu,r=this.jA[t]--}}}if(e>=1&&e=0&&f=0&&y=1&&c0||y>0){const m=this.Hr[i][e][c],p=this.Hr[i][e+1][c],_=this.Hr[i][e+1][c+1],I=this.Hr[i][e][c+1],g=this.YA[e][c],C=this.YA[e+1][c],E=this.YA[e+1][c+1],v=this.YA[e][c+1];let b=-1,T=-1;if(f>0){const t=256*s/l|0,i=r/a|0;let e=o/a|0;b=n.A.Lu(t,i,e);const h=t+A.CA&255;e+=A.EA,e<0?e=0:e>255&&(e=255),T=n.A.Lu(h,i,e)}if(i>0){let t=0!==f||this.PA[i][e][c]===w.A.QA;y>0&&!n.A.Lo[y-1].Du&&(t=!1),t&&m===p&&m===_&&m===I&&(this.zA[i][e][c]|=2340)}let R=0;if(-1!==b&&(R=h.A.palette[n.A.Su(T,96)]),0===y)t?.tm(i,e,c,w.A.QA,u.A.kd,-1,m,p,_,I,n.A.Su(b,g),n.A.Su(b,C),n.A.Su(b,E),n.A.Su(b,v),d.A.Pl,d.A.Pl,d.A.Pl,d.A.Pl,R,d.A.Pl);else{const s=this.PA[i][e][c]+1,r=this.GA[i][e][c],o=n.A.Lo[y-1];let l,a,f=o.texture;f>=0?(a=h.A.im(f),l=-1):o.Mu===d.A.sm?(a=0,l=-2,f=-1):(l=n.A.Lu(o.Nu,o.Fu,o.Bu),a=h.A.palette[n.A.xu(o.Gu,96)]),t?.tm(i,e,c,s,r,f,m,p,_,I,n.A.Su(b,g),n.A.Su(b,C),n.A.Su(b,E),n.A.Su(b,v),n.A.xu(l,g),n.A.xu(l,C),n.A.xu(l,E),n.A.xu(l,v),R,a)}}}}}}for(let e=1;e0&&(t<<=3,i<<=3,e<<=3);for(let s=0;s<=n;s++)for(let r=0;r<=this.FA;r++)for(let h=0;h<=this.NA;h++){if(this.zA[s][h][r]&t){let i=r,e=r,l=s,a=s;for(;i>0&&this.zA[s][h][i-1]&t;)i--;for(;e0;){for(let s=i;s<=e;s++)if(!(this.zA[l-1][h][s]&t))break t;l--}t:for(;a=8){const s=this.Hr[a][h][i]-240,r=this.Hr[l][h][i];o.A.om(n,1,128*h,s,128*i,128*h,r,128*e+128);for(let s=l;s<=a;s++)for(let n=i;n<=e;n++)this.zA[s][h][n]&=~t}}if(this.zA[s][h][r]&i){let t=h,e=h,l=s,a=s;for(;t>0&&this.zA[s][t-1][r]&i;)t--;for(;e0;){for(let s=t;s<=e;s++)if(!(this.zA[l-1][s][r]&i))break t;l--}t:for(;a=8){const s=this.Hr[a][t][r]-240,h=this.Hr[l][t][r];o.A.om(n,2,128*t,s,128*r,128*e+128,h,128*r);for(let s=l;s<=a;s++)for(let n=t;n<=e;n++)this.zA[s][n][r]&=~i}}if(this.zA[s][h][r]&e){let t=h,i=h,l=r,a=r;for(;l>0&&this.zA[s][h][l-1]&e;)l--;for(;a0;){for(let i=l;i<=a;i++)if(!(this.zA[s][t-1][i]&e))break t;t--}t:for(;i=4){const r=this.Hr[s][t][l];o.A.om(n,4,128*t,r,128*l,128*i+128,r,128*a+128);for(let n=t;n<=i;n++)for(let t=l;t<=a;t++)this.zA[s][n][t]&=~e}}}}}};lm=(t,i,e,r)=>{let h=0;for(let t=0;t>24;break}for(let n=t;n=0&&t=0&&n{const o=new r.A(new Uint8Array(h));for(let r=0;r=0&&a=0&&c>24,this.GA[r][a][c]=(f-2&3)<<24>>24):f<=81?this.Vr[r][a][c]=f-49<<24>>24:this.BA[r][a][c]=f-81<<24>>24}else for(;f=o.au,0!==f;){if(1===f){o.au;break}f<=49&&o.au}}};fm=(t,i,e,n,h,o)=>{const l=new r.A(new Uint8Array(n));let a=-1;for(;;){const n=l.um;if(0===n)return;a+=n;let r=0;for(;;){const n=l.um;if(0===n)break;r+=n-1;const c=63&r,f=r>>6&63,u=r>>12,d=l.au,w=d>>2,y=3&d,A=f+h,m=c+o;if(A>0&&m>0&&A=0&&(n=e[s]),this.By(u,A,m,t,i,n,a,w,y)}}}};By=(t,i,e,s,n,r,h,o,d)=>{if(A.et){if(16&this.Vr[t][i][e])return;if(this.$A(t,i,e)!==A.vA)return}const w=this.Hr[t][i][e],y=this.Hr[t][i+1][e],m=this.Hr[t][i+1][e+1],p=this.Hr[t][i][e+1],_=w+y+m+p>>2,I=l.A.get(h);let g=i+(e<<7)+(h<<14)+1073741824|0;I.active||(g+=-2147483648),g|=0;const C=(d<<6)+o<<24>>24;if(o===f.A.nA.id)(!A.et||I.active||I.vd)&&(s?.xA(I.la(f.A.nA.id,d,w,y,m,p,-1),t,i,e,_,g,C),I.nd&&I.active&&r?.Ny(i,e),-1!==I.al&&n.MA(new a.A(h,t,3,i,e,c.A.Lo[I.al],!0)));else if(o===f.A.td.id||o===f.A.oA.id){const l=I.la(f.A.td.id,d,w,y,m,p,-1);if(l){let n,r,h=0;if(o===f.A.oA.id&&(h+=256),d===u.A.Uy||d===u.A.Py?(n=I.length,r=I.width):(n=I.width,r=I.length),s?.By(t,i,e,_,l,null,g,C,n,r,h)&&I.Ad)for(let s=0;s<=n;s++)for(let n=0;n<=r;n++){let r=l.dm/4|0;r>30&&(r=30),r>this.WA[t][i+s][e+n]&&(this.WA[t][i+s][e+n]=r<<24>>24)}}I.nd&&r?.By(i,e,I.width,I.length,d,I.rd),-1!==I.al&&n.MA(new a.A(h,t,2,i,e,c.A.Lo[I.al],!0))}else if(o>=f.A.lA.id)s?.By(t,i,e,_,I.la(o,d,w,y,m,p,-1),null,g,C,1,1,0),o>=f.A.lA.id&&o<=f.A.dA.id&&o!==f.A.aA.id&&t>0&&(this.zA[t][i][e]|=2340),I.nd&&r?.By(i,e,I.width,I.length,d,I.rd),-1!==I.al&&n.MA(new a.A(h,t,2,i,e,c.A.Lo[I.al],!0));else if(o===f.A.Yy.id)s?.Wy(t,i,e,_,A.pA[d],0,I.la(f.A.Yy.id,d,w,y,m,p,-1),null,g,C),d===u.A.kd?(I.Ad&&(this.WA[t][i][e]=50,this.WA[t][i][e+1]=50),I.Du&&(this.zA[t][i][e]|=585)):d===u.A.Uy?(I.Ad&&(this.WA[t][i][e+1]=50,this.WA[t][i+1][e+1]=50),I.Du&&(this.zA[t][i][e+1]|=1170)):d===u.A.Hy?(I.Ad&&(this.WA[t][i+1][e]=50,this.WA[t][i+1][e+1]=50),I.Du&&(this.zA[t][i+1][e]|=585)):d===u.A.Py&&(I.Ad&&(this.WA[t][i][e]=50,this.WA[t][i+1][e]=50),I.Du&&(this.zA[t][i][e]|=1170)),I.nd&&r?.Wy(i,e,o,d,I.rd),-1!==I.al&&n.MA(new a.A(h,t,0,i,e,c.A.Lo[I.al],!0)),16!==I.ad&&s?.wm(t,i,e,I.ad);else if(o===f.A.Vy.id)s?.Wy(t,i,e,_,A._A[d],0,I.la(f.A.Vy.id,d,w,y,m,p,-1),null,g,C),I.Ad&&(d===u.A.kd?this.WA[t][i][e+1]=50:d===u.A.Uy?this.WA[t][i+1][e+1]=50:d===u.A.Hy?this.WA[t][i+1][e]=50:d===u.A.Py&&(this.WA[t][i][e]=50)),I.nd&&r?.Wy(i,e,o,d,I.rd),-1!==I.al&&n.MA(new a.A(h,t,0,i,e,c.A.Lo[I.al],!0));else if(o===f.A.Xy.id){const l=d+1&3;s?.Wy(t,i,e,_,A.pA[d],A.pA[l],I.la(f.A.Xy.id,d+4,w,y,m,p,-1),I.la(f.A.Xy.id,l,w,y,m,p,-1),g,C),I.Du&&(d===u.A.kd?(this.zA[t][i][e]|=265,this.zA[t][i][e+1]|=1170):d===u.A.Uy?(this.zA[t][i][e+1]|=1170,this.zA[t][i+1][e]|=585):d===u.A.Hy?(this.zA[t][i+1][e]|=585,this.zA[t][i][e]|=1170):d===u.A.Py&&(this.zA[t][i][e]|=1170,this.zA[t][i][e]|=585)),I.nd&&r?.Wy(i,e,o,d,I.rd),-1!==I.al&&n.MA(new a.A(h,t,0,i,e,c.A.Lo[I.al],!0)),16!==I.ad&&s?.wm(t,i,e,I.ad)}else if(o===f.A.Ky.id)s?.Wy(t,i,e,_,A._A[d],0,I.la(f.A.Ky.id,d,w,y,m,p,-1),null,g,C),I.Ad&&(d===u.A.kd?this.WA[t][i][e+1]=50:d===u.A.Uy?this.WA[t][i+1][e+1]=50:d===u.A.Hy?this.WA[t][i+1][e]=50:d===u.A.Py&&(this.WA[t][i][e]=50)),I.nd&&r?.Wy(i,e,o,d,I.rd),-1!==I.al&&n.MA(new a.A(h,t,0,i,e,c.A.Lo[I.al],!0));else if(o===f.A.Zy.id)s?.By(t,i,e,_,I.la(o,d,w,y,m,p,-1),null,g,C,1,1,0),I.nd&&r?.By(i,e,I.width,I.length,d,I.rd),-1!==I.al&&n.MA(new a.A(h,t,2,i,e,c.A.Lo[I.al],!0));else if(o===f.A.rA.id)s?.kA(t,i,e,_,0,0,g,I.la(f.A.rA.id,u.A.kd,w,y,m,p,-1),C,512*d,A.pA[d]),-1!==I.al&&n.MA(new a.A(h,t,1,i,e,c.A.Lo[I.al],!0));else if(o===f.A.hA.id){let r=16;if(s){const n=s.DA(t,i,e);n>0&&(r=l.A.get(n>>14&32767).ad)}s?.kA(t,i,e,_,A.IA[d]*r,A.gA[d]*r,g,I.la(f.A.rA.id,u.A.kd,w,y,m,p,-1),C,512*d,A.pA[d]),-1!==I.al&&n.MA(new a.A(h,t,1,i,e,c.A.Lo[I.al],!0))}else o===f.A.Jy.id?(s?.kA(t,i,e,_,0,0,g,I.la(f.A.rA.id,u.A.kd,w,y,m,p,-1),C,d,256),-1!==I.al&&n.MA(new a.A(h,t,1,i,e,c.A.Lo[I.al],!0))):o===f.A.$y.id?(s?.kA(t,i,e,_,0,0,g,I.la(f.A.rA.id,u.A.kd,w,y,m,p,-1),C,d,512),-1!==I.al&&n.MA(new a.A(h,t,1,i,e,c.A.Lo[I.al],!0))):o===f.A.Qy.id&&(s?.kA(t,i,e,_,0,0,g,I.la(f.A.rA.id,u.A.kd,w,y,m,p,-1),C,d,768),-1!==I.al&&n.MA(new a.A(h,t,1,i,e,c.A.Lo[I.al],!0)))};$A=(t,i,e)=>8&this.Vr[t][i][e]?0:t<=0||!(2&this.Vr[1][i][e])?t:t-1}},3045:(t,i,e)=>{e.d(i,{A:()=>_});var s=e(4583),n=e(1161),r=e(3795),h=e(8256),o=e(670),l=e(9222),a=e(6855),c=e(7441),f=e(6666),u=e(5748),d=e(3479),w=e(8950),y=e(2771),A=e(5518),m=e(6169),p=e(3867);class _{static ym=new p.Am(8,32,51,51,!1);static pm=new p.fe(100,null);static _m=new Int32Array(o.A.Dr);static Im=new p.gm(o.A.Dr,500,null);static Cm=new p.fe(500,null);static Em=new f.A;static vm=0;static bm=0;static Tm=0;static Rm=0;static Om=0;static Lm=0;static Sm=0;static xm=0;static Mm=0;static km=0;static Dm=0;static Nm=0;static Fm=0;static Bm=0;static Um=0;static Pm=0;static Gm=0;static Wm=0;static Ym=0;static Hm=0;static Vm=0;static Km=0;static Xm=!1;static jm=null;static zm=Uint8Array.of(19,55,38,155,255,110,137,205,76);static Zm=Uint8Array.of(160,192,80,96,0,144,80,48,160);static qm=Uint8Array.of(76,8,137,4,0,1,38,2,19);static Jm=Int8Array.of(0,0,2,0,0,2,1,1,0);static $m=Int8Array.of(2,0,0,2,0,0,0,4,4);static Qm=Int8Array.of(0,4,4,8,0,0,8,0,0);static tp=Int8Array.of(1,1,0,0,0,8,0,0,8);static ip=Int8Array.of(53,-53,-53,53);static ep=Int8Array.of(-53,-53,53,53);static sp=Int8Array.of(-45,45,45,-45);static np=Int8Array.of(45,45,-45,-45);static rp=[new Int8Array(16),Int8Array.of(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,0,0,0,1,1,0,0,1,1,1,0,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1),Int8Array.of(0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0),Int8Array.of(0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0),Int8Array.of(1,1,1,1,1,1,1,1,0,1,1,1,0,0,1,1),Int8Array.of(1,1,1,1,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,0,0,0,0,1,1,0,1,1,1,0,1,1,1),Int8Array.of(0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1)];static hp=[Int8Array.of(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),Int8Array.of(12,8,4,0,13,9,5,1,14,10,6,2,15,11,7,3),Int8Array.of(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0),Int8Array.of(3,7,11,15,2,6,10,14,1,5,9,13,0,4,8,12)];static op=Int32Array.of(41,39248,41,4643,41,41,41,41,41,41,41,41,41,41,41,43086,41,41,41,41,41,41,41,8602,41,28992,41,41,41,41,41,5056,41,41,41,41,41,41,41,41,41,41,41,41,41,41,3131,41,41,41);static lp=0;static kl=0;static Dl=0;static ap=-1;static cp=-1;static et=!0;static init=(t,i,e,n,r)=>{this.bm=0,this.Tm=0,this.Rm=t,this.Om=i,this.Lm=t/2|0,this.Sm=i/2|0;const h=new p.Am(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let i=0;i<2048;i+=64){this.xm=s.A.sin[t],this.Mm=s.A.cos[t],this.km=s.A.sin[i],this.Dm=s.A.cos[i];const o=(t-128)/32|0,l=i/64|0;for(let t=-26;t<=26;t++)for(let i=-26;i<=26;i++){const s=128*t,a=128*i;let c=!1;for(let t=-e;t<=n;t+=128)if(this.fp(s,a,r[o]+t)){c=!0;break}h[o][l][t+25+1][i+25+1]=c}}for(let t=0;t<8;t++)for(let i=0;i<32;i++)for(let e=-25;e<25;e++)for(let s=-25;s<25;s++){let n=!1;t:for(let r=-1;r<=1;r++)for(let o=-1;o<=1;o++){if(h[t][i][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t][(i+1)%31][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][i][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][(i+1)%31][e+r+25+1][s+o+25+1]){n=!0;break t}}this.ym[t][i][e+25][s+25]=n}};static To=()=>{this.pm=null,this._m=null,this.Im=null,this.Em=null,this.ym=null,this.Cm=null,this.jm=null,console.log('World3D unloaded!')};static om=(t,i,e,s,n,r,o,l)=>{_.Im[t][_._m[t]++]=new h.A(e/128|0,r/128|0,n/128|0,l/128|0,i,e,r,n,l,s,o)};static fp=(t,i,e)=>{const s=i*this.km+t*this.Dm>>16,n=i*this.Dm-t*this.km>>16,r=e*this.xm+n*this.Mm>>16,h=e*this.Mm-n*this.xm>>16;if(r<50||r>3500)return!1;const o=this.Lm+((s<<9)/r|0),l=this.Sm+((h<<9)/r|0);return o>=this.bm&&o<=this.Rm&&l>=this.Tm&&l<=this.Om};up;NA;FA;dp;wp;gh;yp;Ap;mp;pp=0;_p=0;Ip=0;constructor(t,i,e,s){this.up=e,this.NA=s,this.FA=i,this.wp=new p.Eh(e,s,i,null),this.yp=new p.qA(e,s+1,i+1),this.dp=t,this.gh=new p.fe(5e3,null),this.Ap=new Int32Array(1e4),this.mp=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this._p=t;for(let i=0;i{const e=this.wp[0][t][i];for(let e=0;e<3;e++){this.wp[e][t][i]=this.wp[e+1][t][i];const s=this.wp[e][t][i];s&&s.level--}this.wp[0][t][i]||(this.wp[0][t][i]=new r.A(0,t,i));const s=this.wp[0][t][i];s&&(s.Cp=e),this.wp[3][t][i]=null};nm=(t,i,e,s)=>{const n=this.wp[t][i][e];n&&(n.Ep=s)};tm=(t,i,e,s,n,h,o,l,a,c,f,u,w,m,p,_,I,g,C,E)=>{if(s===A.A.QA){for(let s=t;s>=0;s--)this.wp[s][i][e]||(this.wp[s][i][e]=new r.A(s,i,e));const s=this.wp[t][i][e];s&&(s.vp=new d.A(f,u,w,m,-1,C,!1))}else if(s===A.A.bp){for(let s=t;s>=0;s--)this.wp[s][i][e]||(this.wp[s][i][e]=new r.A(s,i,e));const s=this.wp[t][i][e];s&&(s.vp=new d.A(p,_,I,g,h,E,o===l&&o===a&&o===c))}else{for(let s=t;s>=0;s--)this.wp[s][i][e]||(this.wp[s][i][e]=new r.A(s,i,e));const d=this.wp[t][i][e];d&&(d.Tp=new y.A(i,s,_,l,w,n,f,c,E,p,h,g,C,a,I,m,o,e,u))}};xA=(t,i,e,s,n,h,o)=>{this.wp[i][e][s]||(this.wp[i][e][s]=new r.A(i,e,s));const a=this.wp[i][e][s];a&&(a.Rp=new l.A(n,128*e+64,128*s+64,t,h,o))};Op=(t,i,e)=>{const s=this.wp[t][i][e];s&&(s.Rp=null)};Lp=(t,i,e,s,n,h,o,l)=>{let a=0;const c=this.wp[s][t][i];if(c)for(let t=0;ta&&(a=e)}else this.wp[s][t][i]=new r.A(s,t,i);const f=this.wp[s][t][i];f&&(f.Mp=new u.A(e,128*t+64,128*i+64,h,o,l,n,a))};kp=(t,i,e)=>{const s=this.wp[t][i][e];s&&(s.Mp=null)};Wy=(t,i,e,s,n,h,o,l,c,f)=>{if(!o&&!l)return;for(let s=t;s>=0;s--)this.wp[s][i][e]||(this.wp[s][i][e]=new r.A(s,i,e));const u=this.wp[t][i][e];u&&(u.Dp=new a.A(s,128*i+64,128*e+64,n,h,o,l,c,f))};jy=(t,i,e,s)=>{const n=this.wp[t][i][e];1===s&&n&&(n.Dp=null)};kA=(t,i,e,s,n,h,o,l,a,f,u)=>{if(!l)return;for(let s=t;s>=0;s--)this.wp[s][i][e]||(this.wp[s][i][e]=new r.A(s,i,e));const d=this.wp[t][i][e];d&&(d.Np=new c.A(s,128*i+n+64,128*e+h+64,u,f,l,o,a))};Fp=(t,i,e)=>{const s=this.wp[t][i][e];s&&(s.Np=null)};wm=(t,i,e,s)=>{const n=this.wp[t][i][e];if(!n)return;const r=n.Np;if(!r)return;const h=128*i+64,o=128*e+64;r.x=h+((r.x-h)*s/16|0),r.z=o+((r.z-o)*s/16|0)};Bp=(t,i,e,s)=>{if(!s)return;const n=this.wp[t][i][e];if(!n)return;const r=n.Np;r&&(r.model=s)};Up=(t,i,e,s)=>{if(!s)return;const n=this.wp[t][i][e];if(!n)return;const r=n.Rp;r&&(r.model=s)};Pp=(t,i,e,s)=>{if(!s)return;const n=this.wp[t][i][e];if(!n)return;const r=n.Dp;r&&(r.Gp=s)};Wp=(t,i,e,s,n)=>{if(!s)return;const r=this.wp[e][t][i];if(!r)return;const h=r.Dp;h&&(h.Gp=s,h.Yp=n)};By=(t,i,e,s,n,r,h,o,l,a,c)=>{if(!n&&!r)return!0;const f=128*i+64*l,u=128*e+64*a;return this.Hp(f,u,s,t,i,e,l,a,n,r,h,o,c,!1)};Vp=(t,i,e,s,n,r,h,o,l,a)=>{if(!n&&!r)return!0;let c=i-l,f=s-l,u=i+l,d=s+l;return a&&(o>640&&o<1408&&(d+=128),o>1152&&o<1920&&(u+=128),(o>1664||o<384)&&(f-=128),o>128&&o<896&&(c-=128)),c=c/128|0,f=f/128|0,u=u/128|0,d=d/128|0,this.Hp(i,s,e,t,c,f,u+1-c,d-f+1,n,r,h,0,o,!0)};Kp=(t,i,e,s,n,r,h,o,l,a,c,f)=>!l&&!a||this.Hp(i,s,e,t,n,r,h+1-n,o-r+1,l,a,c,0,f,!0);Gy=(t,i,e)=>{const s=this.wp[t][i][e];if(s)for(let t=0;t>29&3)&&n.jp===i&&n.zp===e)return void this.Zp(n)}};qp=(t,i,e,s)=>{if(!s)return;const n=this.wp[t][i][e];if(n)for(let t=0;t>29&3))return void(i.model=s)}};Jp=()=>{for(let t=0;t{const s=this.wp[t][i][e];return s&&s.Dp?s.Dp.Xp:0};$p=(t,i,e)=>{const s=this.wp[t][e][i];return s&&s.Np?s.Np.Xp:0};Qp=(t,i,e)=>{const s=this.wp[t][i][e];if(!s)return 0;for(let t=0;t>29&3)&&n.jp===i&&n.zp===e)return n.Xp}return 0};t_=(t,i,e)=>{const s=this.wp[t][i][e];return s&&s.Rp?s.Rp.Xp:0};i_=(t,i,e,s)=>{const n=this.wp[t][i][e];if(n){if(n.Dp&&n.Dp.Xp===s)return 255&n.Dp.info;if(n.Np&&n.Np.Xp===s)return 255&n.Np.info;if(n.Rp&&n.Rp.Xp===s)return 255&n.Rp.info;for(let t=0;t{const r=i*(0|Math.sqrt(e*e+s*s+n*n))>>8;for(let i=0;i{if(i0){const n=this.wp[t][i+1][e-1];n&&n.Rp&&n.Rp.model&&n.Rp.model.e_&&this.n_(s,n.Rp.model,128,0,-128,!0)}};s_=(t,i,e,s,n,r)=>{let h=!0,o=i;const l=i+s,a=e-1,c=e+n;for(let f=t;f<=t+1;f++)if(f!==this.up){for(let u=o;u<=l;u++)if(!(u<0||u>=this.NA))for(let o=a;o<=c;o++){if(o<0||o>=this.FA||h&&u=e||u===i))continue;const a=this.wp[f][u][o];if(!a)continue;const d=128*(u-i)+64*(1-s),w=128*(o-e)+64*(1-n),y=((this.dp[f][u][o]+this.dp[f][u+1][o]+this.dp[f][u][o+1]+this.dp[f][u+1][o+1])/4|0)-((this.dp[t][i][e]+this.dp[t][i+1][e]+this.dp[t][i][e+1]+this.dp[t][i+1][e+1])/4|0),A=a.Dp;A&&A.Gp&&A.Gp.e_&&this.n_(r,A.Gp,d,y,w,h),A&&A.Yp&&A.Yp.e_&&this.n_(r,A.Yp,d,y,w,h);for(let t=0;t{this.Ip++;let h=0;const o=i.Od,l=i.Rd;if(t.e_&&t.a_)for(let r=0;ri.c_)continue;const u=t.Od[r]-e;if(ui.u_)continue;const d=t.Ld[r]-n;if(di.w_)continue;if(i.e_&&i.a_)for(let t=0;t{const h=this.wp[t][i][e];if(!h)return;const o=h.vp;if(o){const t=o.color;if(0!==t)for(let i=0;i<4;i++)s[n]=t,s[n+1]=t,s[n+2]=t,s[n+3]=t,n+=r;return}const l=h.Tp;if(!l)return;const a=l.shape,c=l.angle,f=l.g_,u=l.C_,d=_.rp[a],w=_.hp[c];let y=0;if(0===f)for(let t=0;t<4;t++)0!==d[w[y++]]&&(s[n]=u),0!==d[w[y++]]&&(s[n+1]=u),0!==d[w[y++]]&&(s[n+2]=u),0!==d[w[y++]]&&(s[n+3]=u),n+=r;else for(let t=0;t<4;t++)s[n]=0===d[w[y++]]?f:u,s[n+1]=0===d[w[y++]]?f:u,s[n+2]=0===d[w[y++]]?f:u,s[n+3]=0===d[w[y++]]?f:u,n+=r};click=(t,i)=>{_.Xm=!0,_.kl=t,_.Dl=i,_.ap=-1,_.cp=-1};draw=(t,i,e,n,r,h,o)=>{t<0?t=0:t>=128*this.NA&&(t=128*this.NA-1),e<0?e=0:e>=128*this.FA&&(e=128*this.FA-1),_.vm++,_.xm=s.A.sin[h],_.Mm=s.A.cos[h],_.km=s.A.sin[r],_.Dm=s.A.cos[r],_.jm=_.ym[(h-128)/32|0][r/64|0],_.Nm=t,_.Fm=i,_.Bm=e,_.Um=t/128|0,_.Pm=e/128|0,_.Vm=n,_.Gm=_.Um-25,_.Gm<0&&(_.Gm=0),_.Ym=_.Pm-25,_.Ym<0&&(_.Ym=0),_.Wm=_.Um+25,_.Wm>this.NA&&(_.Wm=this.NA),_.Hm=_.Pm+25,_.Hm>this.FA&&(_.Hm=this.FA),this.E_(),_.Km=0;for(let t=this._p;t=2e3)?(h.visible=!0,h.update=!0,h.v_=h.Sp>0,_.Km++):(h.visible=!1,h.update=!1,h.b_=0))}}for(let t=this._p;t=_.Wm))for(let t=-25;t<=0;t++){const n=_.Pm+t,r=_.Pm-t;let h;if(e>=_.Gm&&(n>=_.Ym&&(h=i[e][n],h&&h.visible&&this.T_(h,!0,o)),r<_.Hm&&(h=i[e][r],h&&h.visible&&this.T_(h,!0,o))),s<_.Wm&&(n>=_.Ym&&(h=i[s][n],h&&h.visible&&this.T_(h,!0,o)),r<_.Hm&&(h=i[s][r],h&&h.visible&&this.T_(h,!0,o))),0===_.Km)return void(_.Xm=!1)}}}for(let t=this._p;t=_.Wm))for(let t=-25;t<=0;t++){const n=_.Pm+t,r=_.Pm-t;let h;if(e>=_.Gm&&(n>=_.Ym&&(h=i[e][n],h&&h.visible&&this.T_(h,!1,o)),r<_.Hm&&(h=i[e][r],h&&h.visible&&this.T_(h,!1,o))),s<_.Wm&&(n>=_.Ym&&(h=i[s][n],h&&h.visible&&this.T_(h,!1,o)),r<_.Hm&&(h=i[s][r],h&&h.visible&&this.T_(h,!1,o))),0===_.Km)return void(_.Xm=!1)}}}};Hp=(t,i,e,s,h,o,l,a,c,f,u,d,w,y)=>{if(!c&&!f)return!1;for(let t=h;t=this.NA||i>=this.FA)return!1;const e=this.wp[s][t][i];if(e&&e.Sp>=5)return!1}const A=new n.A(s,e,t,i,c,f,w,h,h+l-1,o,o+a-1,u,d);for(let t=h;th&&(e|=1),to&&(e+=8),i=0;e--)this.wp[e][t][i]||(this.wp[e][t][i]=new r.A(e,t,i));const n=this.wp[s][t][i];n&&(n.xp[n.Sp]=A,n.R_[n.Sp]=e,n.O_|=e,n.Sp++)}return y&&(this.gh[this.pp++]=A),!0};Zp=t=>{for(let i=t.jp;i<=t.h_;i++)for(let e=t.zp;e<=t.o_;e++){const s=this.wp[t.level][i][e];if(s){for(let i=0;i{const t=_._m[_.Vm],i=_.Im[_.Vm];_.lp=0;for(let e=0;e=0&&s<=50){n=t.S_+25-_.Pm,n<0&&(n=0),r=t.FA+25-_.Pm,r>50&&(r=50);let i=!1;for(;n<=r;)if(_.jm&&_.jm[s][n++]){i=!0;break}if(i){if(h=_.Nm-t.f_,h>32)t.mode=1;else{if(h>=-32)continue;t.mode=2,h=-h}t.x_=(t.d_-_.Bm<<8)/h|0,t.M_=(t.w_-_.Bm<<8)/h|0,t.k_=(t.c_-_.Fm<<8)/h|0,t.D_=(t.Ud-_.Fm<<8)/h|0,_.Cm[_.lp++]=t}}}else if(2===t.type){if(s=t.S_+25-_.Pm,s>=0&&s<=50){n=t.L_+25-_.Um,n<0&&(n=0),r=t.NA+25-_.Um,r>50&&(r=50);let i=!1;for(;n<=r;)if(_.jm&&_.jm[n++][s]){i=!0;break}if(i){if(h=_.Bm-t.d_,h>32)t.mode=3;else{if(h>=-32)continue;t.mode=4,h=-h}t.N_=(t.f_-_.Nm<<8)/h|0,t.F_=(t.u_-_.Nm<<8)/h|0,t.k_=(t.c_-_.Fm<<8)/h|0,t.D_=(t.Ud-_.Fm<<8)/h|0,_.Cm[_.lp++]=t}}}else if(4===t.type&&(s=t.c_-_.Fm,s>128&&(n=t.S_+25-_.Pm,n<0&&(n=0),r=t.FA+25-_.Pm,r>50&&(r=50),n<=r))){let i=t.L_+25-_.Um;i<0&&(i=0),h=t.NA+25-_.Um,h>50&&(h=50);let e=!1;t:for(let t=i;t<=h;t++)for(let i=n;i<=r;i++)if(_.jm&&_.jm[t][i]){e=!0;break t}e&&(t.mode=5,t.N_=(t.f_-_.Nm<<8)/s|0,t.F_=(t.u_-_.Nm<<8)/s|0,t.x_=(t.d_-_.Bm<<8)/s|0,t.M_=(t.w_-_.Bm<<8)/s|0,_.Cm[_.lp++]=t)}}};T_=(t,i,e)=>{for(_.Em.MA(t);;){let t;do{if(t=_.Em.B_(),!t)return}while(!t.update);const s=t.x,n=t.z,r=t.level,h=t.U_,o=this.wp[r];if(t.visible){if(i){if(r>0){const t=this.wp[r-1][s][n];if(t&&t.update)continue}if(s<=_.Um&&s>_.Gm){const i=o[s-1][n];if(i&&i.update&&(i.visible||!(1&t.O_)))continue}if(s>=_.Um&&s<_.Wm-1){const i=o[s+1][n];if(i&&i.update&&(i.visible||!(4&t.O_)))continue}if(n<=_.Pm&&n>_.Ym){const i=o[s][n-1];if(i&&i.update&&(i.visible||!(8&t.O_)))continue}if(n>=_.Pm&&n<_.Hm-1){const i=o[s][n+1];if(i&&i.update&&(i.visible||!(2&t.O_)))continue}}else i=!0;if(t.visible=!1,t.Cp){const i=t.Cp;i.vp?this.P_(0,s,n)||this.G_(i.vp,0,s,n,_.xm,_.Mm,_.km,_.Dm):i.Tp&&!this.P_(0,s,n)&&this.W_(s,n,i.Tp,_.xm,_.Mm,_.km,_.Dm);const r=i.Dp;r&&r.Gp?.draw(0,_.xm,_.Mm,_.km,_.Dm,r.x-_.Nm,r.y-_.Fm,r.z-_.Bm,r.Xp);for(let t=0;tn&&(a+=6),c=_.zm[a],t.V_=_.qm[a]),f&&(f.K_&_.Zm[a]?16===f.K_?(t.b_=3,t.X_=_.Jm[a],t.j_=3-t.X_):32===f.K_?(t.b_=6,t.X_=_.$m[a],t.j_=6-t.X_):64===f.K_?(t.b_=12,t.X_=_.Qm[a],t.j_=12-t.X_):(t.b_=9,t.X_=_.tp[a],t.j_=9-t.X_):t.b_=0,f.K_&c&&!this.z_(h,s,n,f.K_)&&f.Gp?.draw(0,_.xm,_.Mm,_.km,_.Dm,f.x-_.Nm,f.y-_.Fm,f.z-_.Bm,f.Xp),f.Z_&c&&!this.z_(h,s,n,f.Z_)&&f.Yp?.draw(0,_.xm,_.Mm,_.km,_.Dm,f.x-_.Nm,f.y-_.Fm,f.z-_.Bm,f.Xp)),u&&!this.visible(h,s,n,u.model.Ud))if(u.type&c)u.model.draw(u.angle,_.xm,_.Mm,_.km,_.Dm,u.x-_.Nm,u.y-_.Fm,u.z-_.Bm,u.Xp);else if(768&u.type){const t=u.x-_.Nm,i=u.y-_.Fm,e=u.z-_.Bm,s=u.angle;let n,r;if(n=s===m.A.Uy||s===m.A.Hy?-t:t,r=s===m.A.Hy||s===m.A.Py?-e:e,256&u.type&&rn){const n=t+_.sp[s],r=e+_.np[s];u.model.draw(512*s+1280&2047,_.xm,_.Mm,_.km,_.Dm,n,i,r,u.Xp)}}if(l){const i=t.Rp;i&&i.model?.draw(0,_.xm,_.Mm,_.km,_.Dm,i.x-_.Nm,i.y-_.Fm,i.z-_.Bm,i.Xp);const e=t.Mp;e&&0===e.offset&&(e.q_&&e.q_.draw(0,_.xm,_.Mm,_.km,_.Dm,e.x-_.Nm,e.y-_.Fm,e.z-_.Bm,e.Xp),e.J_&&e.J_.draw(0,_.xm,_.Mm,_.km,_.Dm,e.x-_.Nm,e.y-_.Fm,e.z-_.Bm,e.Xp),e.Q_&&e.Q_.draw(0,_.xm,_.Mm,_.km,_.Dm,e.x-_.Nm,e.y-_.Fm,e.z-_.Bm,e.Xp))}const d=t.O_;if(0!==d){if(s<_.Um&&4&d){const t=o[s+1][n];t&&t.update&&_.Em.MA(t)}if(n<_.Pm&&2&d){const t=o[s][n+1];t&&t.update&&_.Em.MA(t)}if(s>_.Um&&1&d){const t=o[s-1][n];t&&t.update&&_.Em.MA(t)}if(n>_.Pm&&8&d){const t=o[s][n-1];t&&t.update&&_.Em.MA(t)}}}if(0!==t.b_){let i=!0;for(let e=0;ei.jp&&(r+=1),ei.zp&&(r+=8),ss&&(s=n);const h=_.Pm-i.zp,l=i.o_-_.Pm;i.tI=l>h?s+l:s+h}for(;;){let t=-50,i=-1;for(let e=0;et&&(t=s.tI,i=e))}if(-1===i)break;const l=_.pm[i];if(l){l.vm=_.vm;let t=l.model;t||(t=l.Y_?.draw(e)??null),t&&!this.iI(h,l.jp,l.h_,l.zp,l.o_,t.Ud)&&t.draw(l.H_,_.xm,_.Mm,_.km,_.Dm,l.x-_.Nm,l.y-_.Fm,l.z-_.Bm,l.Xp);for(let t=l.jp;t<=l.h_;t++)for(let i=l.zp;i<=l.o_;i++){const e=o[t][i];e&&(0!==e.b_?_.Em.MA(e):t===s&&i===n||!e.update||_.Em.MA(e))}}}if(t.v_)continue}if(!t.update||0!==t.b_)continue;if(s<=_.Um&&s>_.Gm){const t=o[s-1][n];if(t&&t.update)continue}if(s>=_.Um&&s<_.Wm-1){const t=o[s+1][n];if(t&&t.update)continue}if(n<=_.Pm&&n>_.Ym){const t=o[s][n-1];if(t&&t.update)continue}if(n>=_.Pm&&n<_.Hm-1){const t=o[s][n+1];if(t&&t.update)continue}t.update=!1,_.Km--;const l=t.Mp;if(l&&0!==l.offset&&(l.q_&&l.q_.draw(0,_.xm,_.Mm,_.km,_.Dm,l.x-_.Nm,l.y-_.Fm-l.offset,l.z-_.Bm,l.Xp),l.J_&&l.J_.draw(0,_.xm,_.Mm,_.km,_.Dm,l.x-_.Nm,l.y-_.Fm-l.offset,l.z-_.Bm,l.Xp),l.Q_&&l.Q_.draw(0,_.xm,_.Mm,_.km,_.Dm,l.x-_.Nm,l.y-_.Fm-l.offset,l.z-_.Bm,l.Xp)),0!==t.V_){const i=t.Np;if(i&&!this.visible(h,s,n,i.model.Ud))if(i.type&t.V_)i.model.draw(i.angle,_.xm,_.Mm,_.km,_.Dm,i.x-_.Nm,i.y-_.Fm,i.z-_.Bm,i.Xp);else if(768&i.type){const t=i.x-_.Nm,e=i.y-_.Fm,s=i.z-_.Bm,n=i.angle;let r,h;if(r=n===m.A.Uy||n===m.A.Hy?-t:t,h=n===m.A.Hy||n===m.A.Py?-s:s,256&i.type&&h>=r){const r=t+_.ip[n],h=s+_.ep[n];i.model.draw(512*n+256,_.xm,_.Mm,_.km,_.Dm,r,e,h,i.Xp)}if(512&i.type&&h<=r){const r=t+_.sp[n],h=s+_.np[n];i.model.draw(512*n+1280&2047,_.xm,_.Mm,_.km,_.Dm,r,e,h,i.Xp)}}const e=t.Dp;e&&(e.Z_&t.V_&&!this.z_(h,s,n,e.Z_)&&e.Yp?.draw(0,_.xm,_.Mm,_.km,_.Dm,e.x-_.Nm,e.y-_.Fm,e.z-_.Bm,e.Xp),e.K_&t.V_&&!this.z_(h,s,n,e.K_)&&e.Gp?.draw(0,_.xm,_.Mm,_.km,_.Dm,e.x-_.Nm,e.y-_.Fm,e.z-_.Bm,e.Xp))}if(r_.Um){const t=o[s-1][n];t&&t.update&&_.Em.MA(t)}if(n>_.Pm){const t=o[s][n-1];t&&t.update&&_.Em.MA(t)}}};G_=(t,i,e,n,r,h,o,l)=>{let a,c,f,u,d=a=(e<<7)-_.Nm,y=c=(n<<7)-_.Bm,A=f=d+128,m=u=y+128,p=this.dp[i][e][n]-_.Fm,I=this.dp[i][e+1][n]-_.Fm,g=this.dp[i][e+1][n+1]-_.Fm,C=this.dp[i][e][n+1]-_.Fm,E=y*o+d*l>>16;if(y=y*l-d*o>>16,d=E,E=p*h-y*r>>16,y=p*r+y*h>>16,p=E,y<50)return;if(E=c*o+A*l>>16,c=c*l-A*o>>16,A=E,E=I*h-c*r>>16,c=I*r+c*h>>16,I=E,c<50)return;if(E=m*o+f*l>>16,m=m*l-f*o>>16,f=E,E=g*h-m*r>>16,m=g*r+m*h>>16,g=E,m<50)return;if(E=u*o+a*l>>16,u=u*l-a*o>>16,a=E,E=C*h-u*r>>16,u=C*r+u*h>>16,C=E,u<50)return;const v=s.A.ra+((d<<9)/y|0),b=s.A.ha+((p<<9)/y|0),T=s.A.ra+((A<<9)/c|0),R=s.A.ha+((I<<9)/c|0),O=s.A.ra+((f<<9)/m|0),L=s.A.ha+((g<<9)/m|0),S=s.A.ra+((a<<9)/u|0),x=s.A.ha+((C<<9)/u|0);if(s.A.alpha=0,(O-S)*(R-x)-(L-x)*(T-S)>0)if(s.A.eI=O<0||S<0||T<0||O>w.A.sI||S>w.A.sI||T>w.A.sI,_.Xm&&this.nI(_.kl,_.Dl,L,x,R,O,S,T)&&(_.ap=e,_.cp=n),-1===t.rI)12345678!==t.hI&&s.A.oI(O,S,T,L,x,R,t.hI,t.lI,t.aI);else if(_.et){const i=_.op[t.rI];s.A.oI(O,S,T,L,x,R,this.cI(i,t.hI),this.cI(i,t.lI),this.cI(i,t.aI))}else t.flat?s.A.fI(O,S,T,L,x,R,t.hI,t.lI,t.aI,d,p,y,A,a,I,C,c,u,t.rI):s.A.fI(O,S,T,L,x,R,t.hI,t.lI,t.aI,f,g,m,a,A,C,I,u,c,t.rI);if(!((v-T)*(x-R)-(b-R)*(S-T)<=0))if(s.A.eI=v<0||T<0||S<0||v>w.A.sI||T>w.A.sI||S>w.A.sI,_.Xm&&this.nI(_.kl,_.Dl,b,R,x,v,T,S)&&(_.ap=e,_.cp=n),-1!==t.rI){if(!_.et)return void s.A.fI(v,T,S,b,R,x,t.uI,t.aI,t.lI,d,p,y,A,a,I,C,c,u,t.rI);const i=_.op[t.rI];s.A.oI(v,T,S,b,R,x,this.cI(i,t.uI),this.cI(i,t.aI),this.cI(i,t.lI))}else 12345678!==t.uI&&s.A.oI(v,T,S,b,R,x,t.uI,t.aI,t.lI)};W_=(t,i,e,n,r,h,o)=>{let l=e.Od.length;for(let t=0;t>16;if(a=a*o-i*h>>16,i=c,c=l*r-a*n>>16,a=l*n+a*r>>16,l=c,a<50)return;e.dI&&(y.A.wI[t]=i,y.A.yI[t]=l,y.A.AI[t]=a),y.A.mI[t]=s.A.ra+((i<<9)/a|0),y.A.pI[t]=s.A.ha+((l<<9)/a|0)}s.A.alpha=0,l=e._I.length;for(let n=0;n0)if(s.A.eI=l<0||a<0||c<0||l>w.A.sI||a>w.A.sI||c>w.A.sI,_.Xm&&this.nI(_.kl,_.Dl,f,u,d,l,a,c)&&(_.ap=t,_.cp=i),e.dI&&-1!==e.dI[n])if(_.et){const t=_.op[e.dI[n]];s.A.oI(l,a,c,f,u,d,this.cI(t,e.CI[n]),this.cI(t,e.EI[n]),this.cI(t,e.vI[n]))}else e.flat?s.A.fI(l,a,c,f,u,d,e.CI[n],e.EI[n],e.vI[n],y.A.wI[0],y.A.yI[0],y.A.AI[0],y.A.wI[1],y.A.wI[3],y.A.yI[1],y.A.yI[3],y.A.AI[1],y.A.AI[3],e.dI[n]):s.A.fI(l,a,c,f,u,d,e.CI[n],e.EI[n],e.vI[n],y.A.wI[r],y.A.yI[r],y.A.AI[r],y.A.wI[h],y.A.wI[o],y.A.yI[h],y.A.yI[o],y.A.AI[h],y.A.AI[o],e.dI[n]);else 12345678!==e.CI[n]&&s.A.oI(l,a,c,f,u,d,e.CI[n],e.EI[n],e.vI[n])}};P_=(t,i,e)=>{const s=this.yp[t][i][e];if(s===-_.vm)return!1;if(s===_.vm)return!0;{const s=i<<7,n=e<<7;return this.bI(s+1,this.dp[t][i][e],n+1)&&this.bI(s+128-1,this.dp[t][i+1][e],n+1)&&this.bI(s+128-1,this.dp[t][i+1][e+1],n+128-1)&&this.bI(s+1,this.dp[t][i][e+1],n+128-1)?(this.yp[t][i][e]=_.vm,!0):(this.yp[t][i][e]=-_.vm,!1)}};z_=(t,i,e,s)=>{if(!this.P_(t,i,e))return!1;const n=i<<7,r=e<<7,h=this.dp[t][i][e]-1,o=h-120,l=h-230,a=h-238;if(s<16){if(1===s){if(n>_.Nm){if(!this.bI(n,h,r))return!1;if(!this.bI(n,h,r+128))return!1}if(t>0){if(!this.bI(n,o,r))return!1;if(!this.bI(n,o,r+128))return!1}return!!this.bI(n,l,r)&&this.bI(n,l,r+128)}if(2===s){if(r<_.Bm){if(!this.bI(n,h,r+128))return!1;if(!this.bI(n+128,h,r+128))return!1}if(t>0){if(!this.bI(n,o,r+128))return!1;if(!this.bI(n+128,o,r+128))return!1}return!!this.bI(n,l,r+128)&&this.bI(n+128,l,r+128)}if(4===s){if(n<_.Nm){if(!this.bI(n+128,h,r))return!1;if(!this.bI(n+128,h,r+128))return!1}if(t>0){if(!this.bI(n+128,o,r))return!1;if(!this.bI(n+128,o,r+128))return!1}return!!this.bI(n+128,l,r)&&this.bI(n+128,l,r+128)}if(8===s){if(r>_.Bm){if(!this.bI(n,h,r))return!1;if(!this.bI(n+128,h,r))return!1}if(t>0){if(!this.bI(n,o,r))return!1;if(!this.bI(n+128,o,r))return!1}return!!this.bI(n,l,r)&&this.bI(n+128,l,r)}}return!!this.bI(n+64,a,r+64)&&(16===s?this.bI(n,l,r+128):32===s?this.bI(n+128,l,r+128):64===s?this.bI(n+128,l,r):128===s?this.bI(n,l,r):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,i,e,s)=>{if(this.P_(t,i,e)){const n=i<<7,r=e<<7;return this.bI(n+1,this.dp[t][i][e]-s,r+1)&&this.bI(n+128-1,this.dp[t][i+1][e]-s,r+1)&&this.bI(n+128-1,this.dp[t][i+1][e+1]-s,r+128-1)&&this.bI(n+1,this.dp[t][i][e+1]-s,r+128-1)}return!1};iI=(t,i,e,s,n,r)=>{let h,o;if(i!==e||s!==n){for(h=i;h<=e;h++)for(o=s;o<=n;o++)if(this.yp[t][h][o]===-_.vm)return!1;o=1+(i<<7);const l=2+(s<<7),a=this.dp[t][i][s]-r;if(!this.bI(o,a,l))return!1;const c=(e<<7)-1;if(!this.bI(c,a,l))return!1;const f=(n<<7)-1;return!!this.bI(o,a,f)&&this.bI(c,a,f)}return!!this.P_(t,i,s)&&(h=i<<7,o=s<<7,this.bI(h+1,this.dp[t][i][s]-r,o+1)&&this.bI(h+128-1,this.dp[t][i+1][s]-r,o+1)&&this.bI(h+128-1,this.dp[t][i+1][s+1]-r,o+128-1)&&this.bI(h+1,this.dp[t][i][s+1]-r,o+128-1))};bI=(t,i,e)=>{for(let s=0;s<_.lp;s++){const n=_.Cm[s];if(n)if(1===n.mode){const s=n.f_-t;if(s>0){const t=n.d_+(n.x_*s>>8),r=n.w_+(n.M_*s>>8),h=n.c_+(n.k_*s>>8),o=n.Ud+(n.D_*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(2===n.mode){const s=t-n.f_;if(s>0){const t=n.d_+(n.x_*s>>8),r=n.w_+(n.M_*s>>8),h=n.c_+(n.k_*s>>8),o=n.Ud+(n.D_*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(3===n.mode){const s=n.d_-e;if(s>0){const e=n.f_+(n.N_*s>>8),r=n.u_+(n.F_*s>>8),h=n.c_+(n.k_*s>>8),o=n.Ud+(n.D_*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(4===n.mode){const s=e-n.d_;if(s>0){const e=n.f_+(n.N_*s>>8),r=n.u_+(n.F_*s>>8),h=n.c_+(n.k_*s>>8),o=n.Ud+(n.D_*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(5===n.mode){const s=i-n.c_;if(s>0){const i=n.f_+(n.N_*s>>8),r=n.u_+(n.F_*s>>8),h=n.d_+(n.x_*s>>8),o=n.w_+(n.M_*s>>8);if(t>=i&&t<=r&&e>=h&&e<=o)return!0}}}return!1};nI=(t,i,e,s,n,r,h,o)=>{if(ie&&i>s&&i>n)return!1;if(tr&&t>h&&t>o)return!1;const l=(i-s)*(o-h)-(t-h)*(n-s);return((i-e)*(h-r)-(t-r)*(s-e))*l>0&&l*((i-n)*(r-o)-(t-o)*(e-n))>0};cI=(t,i)=>((i=(127-i)*(127&t)/160|0)<2?i=2:i>126&&(i=126),(65408&t)+i)}},7121:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{}},4197:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{TI;RI;OI;LI;index;Vw;ul;fl;constructor(t,i,e,s,n,r,h){super(),this.TI=i,this.RI=e,this.OI=s,this.LI=n,this.index=t,this.Vw=r,h&&-1!==r.wl&&this.Vw.delay?(this.ul=Math.random()*this.Vw.dl|0,this.fl=Math.random()*this.Vw.delay[this.ul]|0):(this.ul=-1,this.fl=0)}}},9418:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(7121),n=e(1312),r=e(3867);class h extends s.A{x=0;z=0;H_=0;SI=!1;size=1;Sa=-1;xI=-1;MI=-1;kI=-1;DI=-1;NI=-1;FI=-1;BI=null;UI=100;GI=0;WI=0;YI=0;HI=0;VI=-1e3;KI=0;XI=0;jI=-1;zI=0;ZI=0;qI=-1;JI=0;$I=0;QI=-1;tg=0;ig=0;eg=0;sg=0;ng=-1;rg=0;hg=0;og=0;lg=0;ag=0;cg=0;fg=0;ug=0;dg=0;wg=0;yg=0;vm=0;height=0;Ag=0;pathLength=0;mg=new Int32Array(10);pg=new Int32Array(10);_g=new r.fe(10,!1);Ig=0;gg=-1;Cg=-1;Eg=-1;vg=-1;move(t,i,e){if(-1!==this.QI&&n.A.Lo[this.QI].priority<=1&&(this.QI=-1),!t){const t=i-this.mg[0],s=e-this.pg[0];if(t>=-8&&t<=8&&s>=-8&&s<=8){this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.mg[t]=this.mg[t-1],this.pg[t]=this.pg[t-1],this._g[t]=this._g[t-1];return this.mg[0]=i,this.pg[0]=e,void(this._g[0]=!1)}}this.pathLength=0,this.Ig=0,this.mg[0]=i,this.pg[0]=e,this.x=128*this.mg[0]+64*this.size,this.z=128*this.pg[0]+64*this.size}step(t,i){let e=this.mg[0],s=this.pg[0];0===i?(e--,s++):1===i?s++:2===i?(e++,s++):3===i?e--:4===i?e++:5===i?(e--,s--):6===i?s--:7===i&&(e++,s--),-1!==this.QI&&n.A.Lo[this.QI].priority<=1&&(this.QI=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.mg[t]=this.mg[t-1],this.pg[t]=this.pg[t-1],this._g[t]=this._g[t-1];this.mg[0]=e,this.pg[0]=s,this._g[0]=t}}},8268:(t,i,e)=>{e.d(i,{A:()=>d});var s=e(9418),n=e(8665),r=e(2679),h=e(8738),o=e(1312),l=e(8317),a=e(1302),c=e(3819),f=e(3867),u=e(9298);class d extends s.A{static bg=1;static Tg=2;static Rg=4;static Og=8;static Lg=16;static Sg=32;static xg=64;static Mg=128;static kg=256;static Dg=512;static La=[u.A.Ng,u.A.Fg,u.A.Bg,u.A.Ug,u.A.Pg,u.A.Gg,u.A.Wg,u.A.Yg,u.A.Hg,u.A.Vg,u.A.Kg,u.A.Xg,u.A.jg,u.A.zg,u.A.Zg,u.A.qg];static Oa=[[u.A.Jg,u.A.$g,u.A.Qg,u.A.tC,u.A.iC,u.A.eC,u.A.sC,u.A.nC,u.A.rC,u.A.hC,u.A.oC,u.A.lC],[u.A.aC,u.A.cC,u.A.fC,u.A.uC,u.A.dC,u.A.wC,u.A.yC,u.A.AC,u.A.mC,u.A.pC,u.A._C,u.A.IC,u.A.gC,u.A.CC,u.A.EC,u.A.vC],[u.A.vC-1,u.A.aC+1,u.A.cC,u.A.fC,u.A.uC,u.A.dC,u.A.wC,u.A.yC,u.A.AC,u.A.mC,u.A.pC,u.A._C,u.A.IC,u.A.gC,u.A.CC,u.A.EC],[u.A.bC,u.A.TC,u.A.RC,u.A.OC,u.A.LC,u.A.SC],[u.A.xC,u.A.MC,u.A.kC,u.A.DC,u.A.NC,u.A.FC,u.A.BC,u.A.UC]];static So=new r.A(200);name=null;visible=!1;PC=0;GC=0;WC=new Uint16Array(12);YC=new Uint16Array(5);Ka=0;HC=0n;y=0;VC=0;KC=0;XC=0;jC=0;zC=0;ZC=null;L_=0;S_=0;NA=0;FA=0;et=!1;draw(t){if(!this.visible)return null;let i=this.zd();if(this.height=i.Ud,i.$d=!0,this.et)return i;if(-1!==this.ng&&-1!==this.rg){const t=h.A.Lo[this.ng],e=n.A.vu(t.la(),!0,!t.ld,!1);e.translate(-this.lg,0,0),e.xa(),t.Vw&&t.Vw.frames&&e.Ma(t.Vw.frames[this.rg]),e.Dd=null,e.Nd=null,128===t.Xd&&128===t.jd||e.scale(t.Xd,t.jd,t.Xd),e.ka(t.fd+64,t.ud+850,-30,-50,-30,!0);const s=[i,e];i=n.A.qC(s,2)}if(this.ZC&&(t>=this.KC&&(this.ZC=null),t>=this.VC&&t=d.Oa[i].length)&&(e=0),this.YC[i]=e}this.Sa=t.ou,65535===this.Sa&&(this.Sa=-1),this.xI=t.ou,65535===this.xI&&(this.xI=-1),this.MI=t.ou,65535===this.MI&&(this.MI=-1),this.kI=t.ou,65535===this.kI&&(this.kI=-1),this.DI=t.ou,65535===this.DI&&(this.DI=-1),this.NI=t.ou,65535===this.NI&&(this.NI=-1),this.FI=t.ou,65535===this.FI&&(this.FI=-1),this.name=c.A.Ca(c.A.Ea(t.JC)),this.Ka=t.au,this.visible=!0,this.HC=0n;for(let t=0;t<12;t++)this.HC<<=0x4n,this.WC[t]>=256&&(this.HC+=BigInt(this.WC[t])-256n);this.WC[0]>=256&&(this.HC+=BigInt(this.WC[0])-256n>>4n),this.WC[1]>=256&&(this.HC+=BigInt(this.WC[1])-256n>>8n);for(let t=0;t<5;t++)this.HC<<=0x3n,this.HC+=BigInt(this.YC[t]);this.HC<<=0x1n,this.HC+=BigInt(this.PC)}Xu(){if(!this.visible)return null;const t=new f.fe(12,null);let i=0;for(let e=0;e<12;e++){const s=this.WC[e];if(s>=256&&s<512&&(t[i++]=l.A.Lo[s-256].Xu()),s>=512){const e=a.A.get(s-512).Xu(this.PC);e&&(t[i++]=e)}}const e=n.A.Ta(t,i);for(let t=0;t<5;t++)0!==this.YC[t]&&(e.Ra(d.Oa[t][0],d.Oa[t][this.YC[t]]),1===t&&e.Ra(d.La[0],d.La[this.YC[t]]));return e}zd(){let t=this.HC,i=-1,e=-1,s=-1,r=-1;if(this.QI>=0&&0===this.eg){const n=o.A.Lo[this.QI];if(n.frames&&(i=n.frames[this.tg]),this.qI>=0&&this.qI!==this.Sa){const t=o.A.Lo[this.qI].frames;t&&(e=t[this.JI])}n.Ww>=0&&(s=n.Ww,t+=BigInt(s-this.WC[5])<<8n),n.Yw>=0&&(r=n.Yw,t+=BigInt(r-this.WC[3])<<16n)}else if(this.qI>=0){const t=o.A.Lo[this.qI].frames;t&&(i=t[this.JI])}let h=d.So?.get(t);if(!h){const i=new f.fe(12,null);let e=0;for(let t=0;t<12;t++){let n=this.WC[t];if(r>=0&&3===t&&(n=r),s>=0&&5===t&&(n=s),n>=256&&n<512){const t=l.A.Lo[n-256].la();t&&(i[e++]=t)}if(n>=512){const t=a.A.get(n-512).Uw(this.PC);t&&(i[e++]=t)}}h=n.A.Ta(i,e);for(let t=0;t<5;t++)0!==this.YC[t]&&(h.Ra(d.Oa[t][0],d.Oa[t][this.YC[t]]),1===t&&h.Ra(d.La[0],d.La[this.YC[t]]));h.xa(),h.ka(64,850,-30,-50,-30,!0),d.So?.put(t,h)}if(this.et)return h;const c=n.A.Zd(h,!0);return-1!==i&&-1!==e?c.qd(i,e,o.A.Lo[this.QI].Pw):-1!==i&&c.Ma(i),c.Jd(),c.Dd=null,c.Nd=null,c}}},9222:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;model;Xp;info;constructor(t,i,e,s,n,r){this.y=t,this.x=i,this.z=e,this.model=s,this.Xp=n,this.info=r}}},1161:(t,i,e)=>{e.d(i,{A:()=>s});class s{level;y;x;z;model;Y_;H_;jp;h_;zp;o_;Xp;info;tI=0;vm=0;constructor(t,i,e,s,n,r,h,o,l,a,c,f,u){this.level=t,this.y=i,this.x=e,this.z=s,this.model=n,this.Y_=r,this.H_=h,this.jp=o,this.h_=l,this.zp=a,this.o_=c,this.Xp=f,this.info=u}}},5748:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;Q_;J_;q_;Xp;offset;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.Q_=s,this.J_=n,this.q_=r,this.Xp=h,this.offset=o}}},8256:(t,i,e)=>{e.d(i,{A:()=>s});class s{L_;NA;S_;FA;type;f_;u_;d_;w_;c_;Ud;mode=0;N_=0;F_=0;x_=0;M_=0;k_=0;D_=0;constructor(t,i,e,s,n,r,h,o,l,a,c){this.L_=t,this.NA=i,this.S_=e,this.FA=s,this.type=n,this.f_=r,this.u_=h,this.d_=o,this.w_=l,this.c_=a,this.Ud=c}}},3795:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1982),n=e(3867);class r extends s.A{level;x;z;U_;xp;R_;vp=null;Tp=null;Dp=null;Np=null;Rp=null;Mp=null;Cp=null;Sp=0;O_=0;Ep=0;visible=!1;update=!1;v_=!1;b_=0;X_=0;j_=0;V_=0;constructor(t,i,e){super(),this.U_=this.level=t,this.x=i,this.z=e,this.xp=new n.fe(5,null),this.R_=new Int32Array(5)}}},2771:(t,i,e)=>{e.d(i,{A:()=>s});class s{static mI=new Int32Array(6);static pI=new Int32Array(6);static wI=new Int32Array(6);static yI=new Int32Array(6);static AI=new Int32Array(6);static $C=[Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,2,6),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,13,14)];static QC=[Int8Array.of(0,1,2,3,0,0,1,3),Int8Array.of(1,1,2,3,1,0,1,3),Int8Array.of(0,1,2,3,1,0,1,3),Int8Array.of(0,0,1,2,0,0,2,4,1,0,4,3),Int8Array.of(0,0,1,4,0,0,4,3,1,1,2,4),Int8Array.of(0,0,4,3,1,0,1,2,1,0,2,4),Int8Array.of(0,1,2,4,1,0,1,4,1,0,4,3),Int8Array.of(0,4,1,2,0,4,2,5,1,0,4,5,1,0,5,3),Int8Array.of(0,4,1,2,0,4,2,3,0,4,3,5,1,0,4,5),Int8Array.of(0,0,4,5,1,4,1,2,1,4,2,3,1,4,3,5),Int8Array.of(0,0,1,5,0,1,4,5,0,1,2,4,1,0,5,3,1,5,4,3,1,4,2,3),Int8Array.of(1,0,1,5,1,1,4,5,1,1,2,4,0,0,5,3,0,5,4,3,0,4,2,3),Int8Array.of(1,0,5,4,1,0,1,5,0,0,4,3,0,4,5,3,0,5,2,3,0,1,2,5)];static tE=128;static iE=this.tE/2|0;static eE=this.tE/4|0;static sE=3*this.tE/4|0;Od;Sd;Ld;CI;EI;vI;_I;II;gI;dI;flat;shape;angle;g_;C_;constructor(t,i,e,n,r,h,o,l,a,c,f,u,d,w,y,A,m,p,_){this.flat=!(m!==n||m!==w||m!==l),this.shape=i,this.angle=h,this.g_=d,this.C_=a;const I=s.$C[i],g=I.length;this.Od=new Int32Array(g),this.Sd=new Int32Array(g),this.Ld=new Int32Array(g);const C=new Int32Array(g),E=new Int32Array(g),v=t*s.tE,b=p*s.tE;for(let t=0;t8&&g<=12&&(g=9+(g-h-9&3)),g>12&&g<=16&&(g=13+(g-h-13&3)),1===g?(i=v,a=b,f=m,d=o,p=c):2===g?(i=v+s.iE,a=b,f=m+n>>1,d=o+_>>1,p=c+e>>1):3===g?(i=v+s.tE,a=b,f=n,d=_,p=e):4===g?(i=v+s.tE,a=b+s.iE,f=n+w>>1,d=_+r>>1,p=e+y>>1):5===g?(i=v+s.tE,a=b+s.tE,f=w,d=r,p=y):6===g?(i=v+s.iE,a=b+s.tE,f=w+l>>1,d=r+A>>1,p=y+u>>1):7===g?(i=v,a=b+s.tE,f=l,d=A,p=u):8===g?(i=v,a=b+s.iE,f=l+m>>1,d=A+o>>1,p=u+c>>1):9===g?(i=v+s.iE,a=b+s.eE,f=m+n>>1,d=o+_>>1,p=c+e>>1):10===g?(i=v+s.sE,a=b+s.iE,f=n+w>>1,d=_+r>>1,p=e+y>>1):11===g?(i=v+s.iE,a=b+s.sE,f=w+l>>1,d=r+A>>1,p=y+u>>1):12===g?(i=v+s.eE,a=b+s.iE,f=l+m>>1,d=A+o>>1,p=u+c>>1):13===g?(i=v+s.eE,a=b+s.eE,f=m,d=o,p=c):14===g?(i=v+s.sE,a=b+s.eE,f=n,d=_,p=e):15===g?(i=v+s.sE,a=b+s.sE,f=w,d=r,p=y):(i=v+s.eE,a=b+s.sE,f=l,d=A,p=u),this.Od[t]=i,this.Sd[t]=f,this.Ld[t]=a,C[t]=d,E[t]=p}const T=s.QC[i],R=T.length/4|0;this._I=new Int32Array(R),this.II=new Int32Array(R),this.gI=new Int32Array(R),this.CI=new Int32Array(R),this.EI=new Int32Array(R),this.vI=new Int32Array(R),this.dI=-1!==f?new Int32Array(R):null;let O=0;for(let t=0;t{e.d(i,{A:()=>s});class s{static QA=0;static bp=1;static nE=2;static rE=3;static hE=4;static oE=5;static iE=6;static eE=7;static sE=8;static lE=9;static aE=10;static cE=11}},3479:(t,i,e)=>{e.d(i,{A:()=>s});class s{uI;aI;hI;lI;rI;color;flat;constructor(t,i,e,s,n,r,h){this.uI=t,this.aI=i,this.hI=e,this.lI=s,this.rI=n,this.color=r,this.flat=h}}},6855:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;K_;Z_;Gp;Yp;Xp;info;constructor(t,i,e,s,n,r,h,o,l){this.y=t,this.x=i,this.z=e,this.K_=s,this.Z_=n,this.Gp=r,this.Yp=h,this.Xp=o,this.info=l}}},7441:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;type;angle;model;Xp;info;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.type=s,this.angle=n,this.model=r,this.Xp=h,this.info=o}}},7536:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n{fE;uE;constructor(t){this.uE=[],this.fE=t;for(let i=0;i{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{wE;yE;constructor(){super(),this.wE=this,this.yE=this}AE(){this.yE&&this.wE&&(this.yE.wE=this.wE,this.wE.yE=this.yE,this.wE=null,this.yE=null)}}},3819:(t,i,e)=>{e.d(i,{A:()=>s});class s{static mE=['_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9'];static pE=t=>{t=t.trim();let i=0n;for(let e=0;e=65&&s<=90?i+=BigInt(s+1-65):s>=97&&s<=122?i+=BigInt(s+1-97):s>=48&&s<=57&&(i+=BigInt(s+27-48))}return i};static Ea=t=>{if(t<0n||t>=6582952005840035281n)return'invalid_name';if(t%37n===0n)return'invalid_name';let i=0;const e=Array(12);for(;0n!==t;){const s=t;t/=37n,e[11-i++]=this.mE[Number(s-37n*t)]}return e.slice(12-i).join('')};static _E=t=>{const i=[...t.toLowerCase()];let e=!0;for(let t=0;t='a'&&s<='z'&&(i[t]=s.toUpperCase(),e=!1),'.'!==s&&'!'!==s||(e=!0)}return i.join('')};static IE=t=>{let i='';for(let e=0;e(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static Ca=t=>{if(0===t.length)return t;const i=[...t];for(let t=0;t='a'&&i[t+1]<='z'&&(i[t+1]=String.fromCharCode(i[t+1].charCodeAt(0)+'A'.charCodeAt(0)-97)));return i[0]>='a'&&i[0]<='z'&&(i[0]=String.fromCharCode(i[0].charCodeAt(0)+'A'.charCodeAt(0)-97)),i.join('')};static gu=t=>{const i=t.toUpperCase();let e=0n;for(let t=0;t>56n)&0xffffffffffffffn;return e}}},6666:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n{gE;cursor=null;constructor(){const t=new s.A;t.next=t,t.dE=t,this.gE=t}MA(t){t.dE&&t.rw(),t.dE=this.gE.dE,t.next=this.gE,t.dE&&(t.dE.next=t),t.next.dE=t}CE(t){t.dE&&t.rw(),t.dE=this.gE,t.next=this.gE.next,t.dE.next=t,t.next&&(t.next.dE=t)}B_(){const t=this.gE.next;return t===this.gE?null:(t?.rw(),t)}head(){const t=this.gE.next;return t===this.gE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}EE(){const t=this.gE.dE;return t===this.gE?(this.cursor=null,null):(this.cursor=t?.dE||null,t)}next(){const t=this.cursor;return t===this.gE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}dE(){const t=this.cursor;return t===this.gE?(this.cursor=null,null):(this.cursor=t?.dE||null,t)}clear(){for(;;){const t=this.gE.next;if(t===this.gE)return;t?.rw()}}}},1982:(t,i,e)=>{e.d(i,{A:()=>s});class s{key;next;dE;constructor(){this.key=0n,this.next=this,this.dE=this}rw(){this.dE&&this.next&&(this.dE.next=this.next,this.next.dE=this.dE,this.next=null,this.dE=null)}}},2679:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(2512),n=e(7536);class r{vE;bE;history;available;constructor(t){this.vE=t,this.available=t,this.bE=new n.A(1024),this.history=new s.A}get(t){const i=this.bE.get(t);return i&&this.history.push(i),i}put(t,i){if(0===this.available){const t=this.history.pop();t?.rw(),t?.AE()}else this.available--;this.bE.put(t,i),this.history.push(i)}clear(){const t=this.history.pop();t?(t.rw(),t.AE()):this.available=this.vE}}},2512:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n{head;constructor(){this.head=new s.A}push(t){t.yE&&t.AE(),t.yE=this.head.yE,t.wE=this.head,t.yE&&(t.yE.wE=t),t.wE.yE=t}pop(){const t=this.head.wE;return t===this.head?null:(t?.AE(),t)}}},8534:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(3867);class r{static Lo=[];static hu=t=>{const i=new s.A(t.read('base_head.dat')),e=new s.A(t.read('base_type.dat')),h=new s.A(t.read('base_label.dat')),o=i.ou;i.af+=2;for(let t=0;t{e.d(i,{A:()=>r});var s=e(8534),n=e(1069);class r{static Lo=[];static hu=t=>{const i=new n.A(t.read('frame_head.dat')),e=new n.A(t.read('frame_tran1.dat')),h=new n.A(t.read('frame_tran2.dat')),o=new n.A(t.read('frame_del.dat')),l=i.ou;i.af+=2;const a=new Int32Array(500),c=new Int32Array(500),f=new Int32Array(500),u=new Int32Array(500);for(let t=0;t0){if(0!==d.types[t])for(let i=t-1;i>y;i--)if(0===d.types[i]){a[A]=i,c[A]=0,f[A]=0,u[A]=0,A++;break}a[A]=t;let e=0;3===d.types[a[A]]&&(e=128),c[A]=1&i?h.RE:e,f[A]=2&i?h.RE:e,u[A]=4&i?h.RE:e,y=t,A++}}n.length=A,n.OE=new Int32Array(A),n.x=new Int32Array(A),n.y=new Int32Array(A),n.z=new Int32Array(A);for(let t=0;t{e.d(i,{bc:()=>s,zo:()=>n,LE:()=>o,SE:()=>h,xE:()=>r});const s=document.getElementById('canvas'),n=s.getContext('2d',{willReadFrequently:!0}),r=document.createElement('canvas'),h=document.createElement('img'),o=r.getContext('2d',{willReadFrequently:!0})},9298:(t,i,e)=>{e.d(i,{A:()=>s});class s{static RED=16711680;static GREEN=65280;static BLUE=255;static Gl=16776960;static ME=65535;static sm=16711935;static Il=16777215;static Pl=0;static kE=16748608;static DE=8388608;static NE=128;static FE=16756736;static BE=16740352;static UE=16723968;static PE=12648192;static GE=8453888;static WE=4259584;static YE=9179409;static HE=6116423;static il=2301979;static el=5063219;static nl=7759444;static hl=3353893;static VE=8388736;static KE=13350793;static XE=Int32Array.of(s.Gl,s.RED,s.GREEN,s.ME,s.sm,s.Il);static Jg=6798;static $g=107;static Qg=10283;static tC=16;static iC=4797;static eC=7744;static sC=5799;static nC=4634;static rC=33697;static hC=22433;static oC=2983;static lC=54193;static aC=8741;static cC=12;static fC=64030;static uC=43162;static dC=7735;static wC=8404;static yC=1701;static AC=38430;static mC=24094;static pC=10153;static _C=56621;static IC=4783;static gC=1341;static CC=16578;static EC=35003;static vC=25239;static Ng=9104;static Fg=10275;static Bg=7595;static Ug=3610;static Pg=7975;static Gg=8526;static Wg=918;static Yg=38802;static Hg=24466;static Vg=10145;static Kg=58654;static Xg=5027;static jg=1457;static zg=16565;static Zg=34991;static qg=25486;static bC=4626;static TC=11146;static RC=6439;static OC=12;static LC=4758;static SC=10270;static UC=4574;static xC=4550;static MC=4537;static kC=5681;static DC=5673;static NC=5790;static FC=6806;static BC=8076}},8950:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n extends s.A{static aw=new Int32Array;static cw=0;static fw=0;static top=0;static bottom=0;static left=0;static right=0;static sI=0;static jE=0;static zE=0;static bind=(t,i,e)=>{this.aw=t,this.cw=i,this.fw=e,this.Al(0,0,i,e)};static ZE=()=>{this.left=0,this.top=0,this.right=this.cw,this.bottom=this.fw,this.sI=this.right-1,this.jE=this.right/2|0};static Al=(t,i,e,s)=>{t<0&&(t=0),i<0&&(i=0),e>this.cw&&(e=this.cw),s>this.fw&&(s=this.fw),this.top=i,this.bottom=s,this.left=t,this.right=e,this.sI=this.right-1,this.jE=this.right/2|0,this.zE=this.bottom/2|0};static clear=()=>{const t=this.cw*this.fw;for(let i=0;i{this.rl(t,i,n,e),this.rl(t,i+s-1,n,e),this.sl(t,i,n,s),this.sl(t+e-1,i,n,s)};static rl=(t,i,e,s)=>{if(i=this.bottom)return;tthis.right&&(s=this.right-t);const n=t+i*this.cw;for(let t=0;t{if(t=this.right)return;ithis.bottom&&(s=this.bottom-i);const n=t+i*this.cw;for(let t=0;t{const r=Math.abs(e-t),h=Math.abs(s-i),o=t=this.left&&t=this.top&&i-h&&(a-=h,t+=o),e{tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const r=this.cw-e;let h=t+i*this.cw;for(let t=-s;t<0;t++){for(let t=-e;t<0;t++)this.aw[h++]=n;h+=r}};static JE(t,i,e,s,n,r){tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const h=256-r,o=(n>>16&255)*r,l=(n>>8&255)*r,a=(255&n)*r,c=this.cw-e;let f=t+i*this.cw;for(let t=0;t>16&255)*h>>8<<16)+(l+(this.aw[f]>>8&255)*h>>8<<8)+(a+(255&this.aw[f])*h>>8);this.aw[f++]=t}f+=c}}static $E(t,i,e,s,n){const r=256-n,h=(s>>16&255)*n,o=(s>>8&255)*n,l=(255&s)*n;let a=i-e;a<0&&(a=0);let c=i+e;c>=this.fw&&(c=this.fw-1);for(let s=a;s<=c;s++){const n=s-i,a=0|Math.sqrt(e*e-n*n);let c=t-a;c<0&&(c=0);let f=t+a;f>=this.cw&&(f=this.cw-1);let u=c+s*this.cw;for(let t=c;t<=f;t++){const t=(h+(this.aw[u]>>16&255)*r>>8<<16)+(o+(this.aw[u]>>8&255)*r>>8<<8)+(l+(255&this.aw[u])*r>>8);this.aw[u++]=t}}}static QE=(t,i,e)=>{t=this.right||i=this.bottom||(this.aw[t+i*this.cw]=e)}}},4583:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(8950),n=e(1673),r=e(3867);class h extends s.A{static et=!1;static tv=new Int32Array(512);static iv=new Int32Array(2048);static sin=new Int32Array(2048);static cos=new Int32Array(2048);static palette=new Int32Array(65536);static ev=new r.fe(50,null);static sv=0;static lw=new Int32Array;static ra=0;static ha=0;static uw=!0;static eI=!1;static alpha=0;static nv=null;static rv=new r.fe(50,null);static hv=0;static vm=0;static ov=new Int32Array(50);static lv=new r.fe(50,null);static av=!1;static cv=new r.fe(50,!1);static fv=new Int32Array(50);static{for(let t=1;t<512;t++)this.tv[t]=32768/t|0;for(let t=1;t<2048;t++)this.iv[t]=65536/t|0;for(let t=0;t<2048;t++)this.sin[t]=65536*Math.sin(.0030679615757712823*t)|0,this.cos[t]=65536*Math.cos(.0030679615757712823*t)|0}static To=()=>{this.tv=null,this.tv=null,this.sin=null,this.cos=null,this.lw=null,this.ev=null,this.cv=null,this.fv=null,this.nv=null,this.rv=null,this.ov=null,this.palette=null,this.lv=null,console.log('Draw3D unloaded!')};static Tc=()=>{this.lw=new Int32Array(this.fw);for(let t=0;t{this.lw=new Int32Array(i);for(let e=0;e{this.nv=null,this.rv.fill(null)};static wv=t=>{this.sv=0;for(let i=0;i<50;i++)try{this.ev[i]=n.A.Cu(t,i.toString()),this.et&&128===this.ev[i]?.Fl?this.ev[i]?.yv():this.ev[i]?.gw(),this.sv++}catch(t){}};static im=t=>{if(0!==this.fv[t])return this.fv[t];const i=this.lv[t];if(!i)return 0;let e=0,s=0,n=0;const r=i.length;for(let t=0;t>16&255,s+=i[t]>>8&255,n+=255&i[t];let h=(e/r<<16)+(s/r<<8)+(n/r|0);return h=this.Av(h,1.4),0===h&&(h=1),this.fv[t]=h,h};static mv=t=>{const i=t+.03*Math.random()-.015;let e=0;for(let t=0;t<512;t++){const s=(t/8|0)/64+.0078125,n=(7&t)/8+.0625;for(let t=0;t<128;t++){const r=t/128;let h=r,o=r,l=r;if(0!==n){let t;t=r<.5?r*(n+1):r+n-r*n;const i=2*r-t;let e=s+.3333333333333333;e>1&&e--;let a=s-.3333333333333333;a<0&&a++,h=6*e<1?i+6*(t-i)*e:2*e<1?t:3*e<2?i+(t-i)*(.6666666666666666-e)*6:i,o=6*s<1?i+6*(t-i)*s:2*s<1?t:3*s<2?i+(t-i)*(.6666666666666666-s)*6:i,l=6*a<1?i+6*(t-i)*a:2*a<1?t:3*a<2?i+(t-i)*(.6666666666666666-a)*6:i}const a=((256*h|0)<<16)+((256*o|0)<<8)+(256*l|0);this.palette[e++]=this.Av(a,i)}}for(let t=0;t<50;t++){const e=this.ev[t];if(!e)continue;const s=e.palette;this.lv[t]=new Int32Array(s.length);for(let e=0;e{const e=(t>>16)/256,s=(t>>8&255)/256,n=(255&t)/256;return((256*Math.pow(e,i)|0)<<16)+((256*Math.pow(s,i)|0)<<8)+(256*Math.pow(n,i)|0)};static _v=t=>{this.nv||(this.hv=t,this.et?this.nv=new r.Xr(t,16384):this.nv=new r.Xr(t,65536),this.rv.fill(null))};static oI=(t,i,e,s,n,r,h,o,l)=>{let a=0,c=0;n!==s&&(a=(i-t<<16)/(n-s)|0,c=(o-h<<15)/(n-s)|0);let f=0,u=0;r!==n&&(f=(e-i<<16)/(r-n)|0,u=(l-o<<15)/(r-n)|0);let d=0,w=0;if(r!==s&&(d=(t-e<<16)/(s-r)|0,w=(h-l<<15)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),nf)for(r-=n,n-=s,s=this.lw[s];;){if(--n<0)for(;;){if(--r<0)return;this.Iv(e>>16,i>>16,l>>7,o>>7,this.aw,s,0),e+=d,i+=f,l+=w,o+=u,s+=this.cw}this.Iv(e>>16,t>>16,l>>7,h>>7,this.aw,s,0),e+=d,t+=a,l+=w,h+=c,s+=this.cw}else for(r-=n,n-=s,s=this.lw[s];;){if(--n<0)for(;;){if(--r<0)return;this.Iv(i>>16,e>>16,o>>7,l>>7,this.aw,s,0),e+=d,i+=f,l+=w,o+=u,s+=this.cw}this.Iv(t>>16,e>>16,h>>7,l>>7,this.aw,s,0),e+=d,t+=a,l+=w,h+=c,s+=this.cw}else if(i=t<<=16,o=h<<=15,s<0&&(i-=d*s,t-=a*s,o-=w*s,h-=c*s,s=0),e<<=16,l<<=15,r<0&&(e-=f*r,l-=u*r,r=0),s!==r&&da)for(n-=r,r-=s,s=this.lw[s];;){if(--r<0)for(;;){if(--n<0)return;this.Iv(e>>16,t>>16,l>>7,h>>7,this.aw,s,0),e+=f,t+=a,l+=u,h+=c,s+=this.cw}this.Iv(i>>16,t>>16,o>>7,h>>7,this.aw,s,0),i+=d,t+=a,o+=w,h+=c,s+=this.cw}else for(n-=r,r-=s,s=this.lw[s];;){if(--r<0)for(;;){if(--n<0)return;this.Iv(t>>16,e>>16,h>>7,l>>7,this.aw,s,0),e+=f,t+=a,l+=u,h+=c,s+=this.cw}this.Iv(t>>16,i>>16,h>>7,o>>7,this.aw,s,0),i+=d,t+=a,o+=w,h+=c,s+=this.cw}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),rd)for(s-=r,r-=n,n=this.lw[n];;){if(--r<0)for(;;){if(--s<0)return;this.Iv(t>>16,e>>16,h>>7,l>>7,this.aw,n,0),t+=a,e+=d,h+=c,l+=w,n+=this.cw}this.Iv(t>>16,i>>16,h>>7,o>>7,this.aw,n,0),t+=a,i+=f,h+=c,o+=u,n+=this.cw}else for(s-=r,r-=n,n=this.lw[n];;){if(--r<0)for(;;){if(--s<0)return;this.Iv(e>>16,t>>16,l>>7,h>>7,this.aw,n,0),t+=a,e+=d,h+=c,l+=w,n+=this.cw}this.Iv(i>>16,t>>16,o>>7,h>>7,this.aw,n,0),t+=a,i+=f,h+=c,o+=u,n+=this.cw}else if(e=i<<=16,l=o<<=15,n<0&&(e-=a*n,i-=f*n,l-=c*n,o-=u*n,n=0),t<<=16,h<<=15,s<0&&(t-=d*s,h-=w*s,s=0),r-=s,s-=n,n=this.lw[n],a>16,i>>16,h>>7,o>>7,this.aw,n,0),t+=d,i+=f,h+=w,o+=u,n+=this.cw}this.Iv(e>>16,i>>16,l>>7,o>>7,this.aw,n,0),e+=a,i+=f,l+=c,o+=u,n+=this.cw}else for(;;){if(--s<0)for(;;){if(--r<0)return;this.Iv(i>>16,t>>16,o>>7,h>>7,this.aw,n,0),t+=d,i+=f,h+=w,o+=u,n+=this.cw}this.Iv(i>>16,e>>16,o>>7,l>>7,this.aw,n,0),e+=a,i+=f,l+=c,o+=u,n+=this.cw}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,o>>7,h>>7,this.aw,r,0),i+=f,t+=a,o+=u,h+=c,r+=this.cw}this.Iv(i>>16,e>>16,o>>7,l>>7,this.aw,r,0),i+=f,e+=d,o+=u,l+=w,r+=this.cw}else for(;;){if(--s<0)for(;;){if(--n<0)return;this.Iv(t>>16,i>>16,h>>7,o>>7,this.aw,r,0),i+=f,t+=a,o+=u,h+=c,r+=this.cw}this.Iv(e>>16,i>>16,l>>7,o>>7,this.aw,r,0),i+=f,e+=d,o+=u,l+=w,r+=this.cw}else if(t=e<<=16,h=l<<=15,r<0&&(t-=f*r,e-=d*r,h-=u*r,l-=w*r,r=0),i<<=16,o<<=15,n<0&&(i-=a*n,o-=c*n,n=0),s-=n,n-=r,r=this.lw[r],f>16,e>>16,o>>7,l>>7,this.aw,r,0),i+=a,e+=d,o+=c,l+=w,r+=this.cw}this.Iv(t>>16,e>>16,h>>7,l>>7,this.aw,r,0),t+=f,e+=d,h+=u,l+=w,r+=this.cw}else for(;;){if(--n<0)for(;;){if(--s<0)return;this.Iv(e>>16,i>>16,l>>7,o>>7,this.aw,r,0),i+=a,e+=d,o+=c,l+=w,r+=this.cw}this.Iv(e>>16,t>>16,l>>7,h>>7,this.aw,r,0),t+=f,e+=d,h+=u,l+=w,r+=this.cw}};static Iv=(t,i,e,s,n,r,h)=>{let o;if(this.uw){let l;if(this.eI){if(l=i-t>3?(s-e)/(i-t)|0:0,i>this.sI&&(i=this.sI),t<0&&(e-=t*l,t=0),t>=i)return;r+=t,h=i-t>>2,l<<=2}else{if(!(t>2)>0?(s-e)*this.tv[h]>>15:0}if(0===this.alpha)for(;;){if(--h<0){if((h=i-t&3)>0){o=this.palette[e>>8];do{n[r++]=o,h--}while(h>0);return}break}o=this.palette[e>>8],e+=l,n[r++]=o,n[r++]=o,n[r++]=o,n[r++]=o}else{const s=this.alpha,a=256-this.alpha;for(;;){if(--h<0){if((h=i-t&3)>0){o=this.palette[e>>8],o=((16711935&o)*a>>8&16711935)+((65280&o)*a>>8&65280);do{n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),h--}while(h>0)}break}o=this.palette[e>>8],e+=l,o=((16711935&o)*a>>8&16711935)+((65280&o)*a>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280)}}}else if(tthis.sI&&(i=this.sI),t<0&&(e-=t*l,t=0),t>=i))return;if(r+=t,h=i-t,0===this.alpha)do{n[r++]=this.palette[e>>8],e+=l,h--}while(h>0);else{const t=this.alpha,i=256-this.alpha;do{o=this.palette[e>>8],e+=l,o=((16711935&o)*i>>8&16711935)+((65280&o)*i>>8&65280),n[r++]=o+((16711935&n[r])*t>>8&16711935)+((65280&n[r])*t>>8&65280),h--}while(h>0)}}};static gv=(t,i,e,s,n,r,h)=>{let o=0;n!==s&&(o=(i-t<<16)/(n-s)|0);let l=0;r!==n&&(l=(e-i<<16)/(r-n)|0);let a=0;if(r!==s&&(a=(t-e<<16)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),nl)for(r-=n,n-=s,s=this.lw[s];;){if(--n<0)for(;;){if(--r<0)return;this.Cv(e>>16,i>>16,this.aw,s,h),e+=a,i+=l,s+=this.cw}this.Cv(e>>16,t>>16,this.aw,s,h),e+=a,t+=o,s+=this.cw}else for(r-=n,n-=s,s=this.lw[s];;){if(--n<0)for(;;){if(--r<0)return;this.Cv(i>>16,e>>16,this.aw,s,h),e+=a,i+=l,s+=this.cw}this.Cv(t>>16,e>>16,this.aw,s,h),e+=a,t+=o,s+=this.cw}else if(i=t<<=16,s<0&&(i-=a*s,t-=o*s,s=0),e<<=16,r<0&&(e-=l*r,r=0),s!==r&&ao)for(n-=r,r-=s,s=this.lw[s];;){if(--r<0)for(;;){if(--n<0)return;this.Cv(e>>16,t>>16,this.aw,s,h),e+=l,t+=o,s+=this.cw}this.Cv(i>>16,t>>16,this.aw,s,h),i+=a,t+=o,s+=this.cw}else for(n-=r,r-=s,s=this.lw[s];;){if(--r<0)for(;;){if(--n<0)return;this.Cv(t>>16,e>>16,this.aw,s,h),e+=l,t+=o,s+=this.cw}this.Cv(t>>16,i>>16,this.aw,s,h),i+=a,t+=o,s+=this.cw}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),ra)for(s-=r,r-=n,n=this.lw[n];;){if(--r<0)for(;;){if(--s<0)return;this.Cv(t>>16,e>>16,this.aw,n,h),t+=o,e+=a,n+=this.cw}this.Cv(t>>16,i>>16,this.aw,n,h),t+=o,i+=l,n+=this.cw}else for(s-=r,r-=n,n=this.lw[n];;){if(--r<0)for(;;){if(--s<0)return;this.Cv(e>>16,t>>16,this.aw,n,h),t+=o,e+=a,n+=this.cw}this.Cv(i>>16,t>>16,this.aw,n,h),t+=o,i+=l,n+=this.cw}else if(e=i<<=16,n<0&&(e-=o*n,i-=l*n,n=0),t<<=16,s<0&&(t-=a*s,s=0),o>16,i>>16,this.aw,n,h),t+=a,i+=l,n+=this.cw}this.Cv(e>>16,i>>16,this.aw,n,h),e+=o,i+=l,n+=this.cw}else for(r-=s,s-=n,n=this.lw[n];;){if(--s<0)for(;;){if(--r<0)return;this.Cv(i>>16,t>>16,this.aw,n,h),t+=a,i+=l,n+=this.cw}this.Cv(i>>16,e>>16,this.aw,n,h),e+=o,i+=l,n+=this.cw}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,this.aw,r,h),i+=l,t+=o,r+=this.cw}this.Cv(i>>16,e>>16,this.aw,r,h),i+=l,e+=a,r+=this.cw}else for(n-=s,s-=r,r=this.lw[r];;){if(--s<0)for(;;){if(--n<0)return;this.Cv(t>>16,i>>16,this.aw,r,h),i+=l,t+=o,r+=this.cw}this.Cv(e>>16,i>>16,this.aw,r,h),i+=l,e+=a,r+=this.cw}else if(t=e<<=16,r<0&&(t-=l*r,e-=a*r,r=0),i<<=16,n<0&&(i-=o*n,n=0),l>16,e>>16,this.aw,r,h),i+=o,e+=a,r+=this.cw}this.Cv(t>>16,e>>16,this.aw,r,h),t+=l,e+=a,r+=this.cw}else for(s-=n,n-=r,r=this.lw[r];;){if(--n<0)for(;;){if(--s<0)return;this.Cv(e>>16,i>>16,this.aw,r,h),i+=o,e+=a,r+=this.cw}this.Cv(e>>16,t>>16,this.aw,r,h),t+=l,e+=a,r+=this.cw}};static fI=(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w,y,A,m,p)=>{const _=this.Ev(p);this.av=!this.cv[p];const I=a-u,g=c-w,C=f-A,E=d-a,v=y-c,b=m-f;let T=E*c-v*a<<14;const R=v*f-b*c<<8,O=b*a-E*f<<5;let L=I*c-g*a<<14;const S=g*f-C*c<<8,x=C*a-I*f<<5;let M=g*E-I*v<<14;const k=C*v-g*b<<8,D=I*b-C*E<<5;let N=0,F=0;n!==s&&(N=(i-t<<16)/(n-s)|0,F=(o-h<<16)/(n-s)|0);let B=0,U=0;r!==n&&(B=(e-i<<16)/(r-n)|0,U=(l-o<<16)/(r-n)|0);let P=0,G=0;if(r!==s&&(P=(t-e<<16)/(s-r)|0,G=(h-l<<16)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),nB)for(r-=n,n-=s,s=this.lw[s];;){if(--n<0)for(;;){if(--r<0)return;this.vv(e>>16,i>>16,this.aw,s,_,0,0,T,L,M,R,S,k,l>>8,o>>8),e+=P,i+=B,l+=G,o+=U,s+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.vv(e>>16,t>>16,this.aw,s,_,0,0,T,L,M,R,S,k,l>>8,h>>8),e+=P,t+=N,l+=G,h+=F,s+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}else for(r-=n,n-=s,s=this.lw[s];;){if(--n<0)for(;;){if(--r<0)return;this.vv(i>>16,e>>16,this.aw,s,_,0,0,T,L,M,R,S,k,o>>8,l>>8),e+=P,i+=B,l+=G,o+=U,s+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.vv(t>>16,e>>16,this.aw,s,_,0,0,T,L,M,R,S,k,h>>8,l>>8),e+=P,t+=N,l+=G,h+=F,s+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}}else{i=t<<=16,o=h<<=16,s<0&&(i-=P*s,t-=N*s,o-=G*s,h-=F*s,s=0),e<<=16,l<<=16,r<0&&(e-=B*r,l-=U*r,r=0);const a=s-this.ha;if(T+=O*a,L+=x*a,M+=D*a,T|=0,L|=0,M|=0,(s===r||P>=N)&&(s!==r||B<=N))for(n-=r,r-=s,s=this.lw[s];;){if(--r<0)for(;;){if(--n<0)return;this.vv(t>>16,e>>16,this.aw,s,_,0,0,T,L,M,R,S,k,h>>8,l>>8),e+=B,t+=N,l+=U,h+=F,s+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.vv(t>>16,i>>16,this.aw,s,_,0,0,T,L,M,R,S,k,h>>8,o>>8),i+=P,t+=N,o+=G,h+=F,s+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}else for(n-=r,r-=s,s=this.lw[s];;){if(--r<0)for(;;){if(--n<0)return;this.vv(e>>16,t>>16,this.aw,s,_,0,0,T,L,M,R,S,k,l>>8,h>>8),e+=B,t+=N,l+=U,h+=F,s+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.vv(i>>16,t>>16,this.aw,s,_,0,0,T,L,M,R,S,k,o>>8,h>>8),i+=P,t+=N,o+=G,h+=F,s+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),rP)for(s-=r,r-=n,n=this.lw[n];;){if(--r<0)for(;;){if(--s<0)return;this.vv(t>>16,e>>16,this.aw,n,_,0,0,T,L,M,R,S,k,h>>8,l>>8),t+=N,e+=P,h+=F,l+=G,n+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.vv(t>>16,i>>16,this.aw,n,_,0,0,T,L,M,R,S,k,h>>8,o>>8),t+=N,i+=B,h+=F,o+=U,n+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}else for(s-=r,r-=n,n=this.lw[n];;){if(--r<0)for(;;){if(--s<0)return;this.vv(e>>16,t>>16,this.aw,n,_,0,0,T,L,M,R,S,k,l>>8,h>>8),t+=N,e+=P,h+=F,l+=G,n+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.vv(i>>16,t>>16,this.aw,n,_,0,0,T,L,M,R,S,k,o>>8,h>>8),t+=N,i+=B,h+=F,o+=U,n+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}}else{e=i<<=16,l=o<<=16,n<0&&(e-=N*n,i-=B*n,l-=F*n,o-=U*n,n=0),t<<=16,h<<=16,s<0&&(t-=P*s,h-=G*s,s=0);const a=n-this.ha;if(T+=O*a,L+=x*a,M+=D*a,T|=0,L|=0,M|=0,r-=s,s-=n,n=this.lw[n],N>16,i>>16,this.aw,n,_,0,0,T,L,M,R,S,k,h>>8,o>>8),t+=P,i+=B,h+=G,o+=U,n+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.vv(e>>16,i>>16,this.aw,n,_,0,0,T,L,M,R,S,k,l>>8,o>>8),e+=N,i+=B,l+=F,o+=U,n+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}else for(;;){if(--s<0)for(;;){if(--r<0)return;this.vv(i>>16,t>>16,this.aw,n,_,0,0,T,L,M,R,S,k,o>>8,h>>8),t+=P,i+=B,h+=G,o+=U,n+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.vv(i>>16,e>>16,this.aw,n,_,0,0,T,L,M,R,S,k,o>>8,l>>8),e+=N,i+=B,l+=F,o+=U,n+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,this.aw,r,_,0,0,T,L,M,R,S,k,o>>8,h>>8),i+=B,t+=N,o+=U,h+=F,r+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.vv(i>>16,e>>16,this.aw,r,_,0,0,T,L,M,R,S,k,o>>8,l>>8),i+=B,e+=P,o+=U,l+=G,r+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}else for(;;){if(--s<0)for(;;){if(--n<0)return;this.vv(t>>16,i>>16,this.aw,r,_,0,0,T,L,M,R,S,k,h>>8,o>>8),i+=B,t+=N,o+=U,h+=F,r+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.vv(e>>16,i>>16,this.aw,r,_,0,0,T,L,M,R,S,k,l>>8,o>>8),i+=B,e+=P,o+=U,l+=G,r+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}}else{t=e<<=16,h=l<<=16,r<0&&(t-=B*r,e-=P*r,h-=U*r,l-=G*r,r=0),i<<=16,o<<=16,n<0&&(i-=N*n,o-=F*n,n=0);const a=r-this.ha;if(T+=O*a,L+=x*a,M+=D*a,T|=0,L|=0,M|=0,s-=n,n-=r,r=this.lw[r],B>16,e>>16,this.aw,r,_,0,0,T,L,M,R,S,k,o>>8,l>>8),i+=N,e+=P,o+=F,l+=G,r+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.vv(t>>16,e>>16,this.aw,r,_,0,0,T,L,M,R,S,k,h>>8,l>>8),t+=B,e+=P,h+=U,l+=G,r+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}else for(;;){if(--n<0)for(;;){if(--s<0)return;this.vv(e>>16,i>>16,this.aw,r,_,0,0,T,L,M,R,S,k,l>>8,o>>8),i+=N,e+=P,o+=F,l+=G,r+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}this.vv(e>>16,t>>16,this.aw,r,_,0,0,T,L,M,R,S,k,l>>8,h>>8),t+=B,e+=P,h+=U,l+=G,r+=this.cw,T+=O,L+=x,M+=D,T|=0,L|=0,M|=0}}};static vv=(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w)=>{if(t>=i)return;let y,A,m,p,_,I,g,C,E;if(this.eI){if(y=(w-d)/(i-t)|0,i>this.sI&&(i=this.sI),t<0&&(d-=t*y,t=0),t>=i)return;A=i-t>>3,y<<=12}else i-t>7?(A=i-t>>3,y=(w-d)*this.tv[A]>>6):(A=0,y=0);if(d<<=9,s+=t,this.et&&n)if(m=0,p=0,I=t-this.ra,o+=(c>>3)*I,l+=(f>>3)*I,a+=(u>>3)*I,o|=0,l|=0,_=(a|=0)>>12,0!==_&&(h=l/_|0,(r=o/_|0)<0?r=0:r>4032&&(r=4032)),o+=c,l+=f,a+=u,o|=0,l|=0,_=(a|=0)>>12,0!==_&&(m=o/_|0,p=l/_|0,m<7?m=7:m>4032&&(m=4032)),g=m-r>>3,C=p-h>>3,r+=d>>3&786432,E=d>>23,this.av){for(;A-- >0;)e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r=m,h=p,o+=c,l+=f,_=(a+=u)>>12,0!==_&&(m=o/_|0,p=l/_|0,m<7?m=7:m>4032&&(m=4032)),g=m-r>>3,C=p-h>>3,r+=(d+=y)>>3&786432,E=d>>23;for(A=i-t&7;A-- >0;)e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C}else{for(;A-- >0;){let t;0!=(t=n[(4032&h)+(r>>6)]>>>E)&&(e[s]=t),s+=1,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s+=1,r=m,h=p,o+=c,l+=f,a+=u,o|=0,l|=0,_=(a|=0)>>12,0!==_&&(m=o/_|0,p=l/_|0,m<7?m=7:m>4032&&(m=4032)),g=m-r>>3,C=p-h>>3,r+=(d+=y)>>3&786432,E=d>>23}for(A=i-t&7;A-- >0;){let t;0!=(t=n[(4032&h)+(r>>6)]>>>E)&&(e[s]=t),s++,r+=g,h+=C}}else if(m=0,p=0,I=t-this.ra,o+=(c>>3)*I,l+=(f>>3)*I,a+=(u>>3)*I,o|=0,l|=0,_=(a|=0)>>14,0!==_&&(h=l/_|0,(r=o/_|0)<0?r=0:r>16256&&(r=16256)),o+=c,l+=f,a+=u,o|=0,l|=0,_=(a|=0)>>14,0!==_&&(m=o/_|0,p=l/_|0,m<7?m=7:m>16256&&(m=16256)),g=m-r>>3,C=p-h>>3,r+=6291456&d,E=d>>23,this.av&&n){for(;A-- >0;)e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r=m,h=p,o+=c,l+=f,a+=u,o|=0,l|=0,_=(a|=0)>>14,0!==_&&(m=o/_|0,p=l/_|0,m<7?m=7:m>16256&&(m=16256)),g=m-r>>3,C=p-h>>3,r+=6291456&(d+=y),E=d>>23;for(A=i-t&7;A-- >0;)e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C}else{for(;A-- >0&&n;){let t;0!=(t=n[(16256&h)+(r>>7)]>>>E)&&(e[s]=t),s+=1,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,r=m,h=p,o+=c,l+=f,a+=u,o|=0,l|=0,_=(a|=0)>>14,0!==_&&(m=o/_|0,p=l/_|0,m<7?m=7:m>16256&&(m=16256)),g=m-r>>3,C=p-h>>3,r+=6291456&(d+=y),E=d>>23}for(A=i-t&7;A-- >0&&n;){let t;0!=(t=n[(16256&h)+(r>>7)]>>>E)&&(e[s]=t),s++,r+=g,h+=C}}};static Cv=(t,i,e,s,n)=>{if(this.eI&&(i>this.sI&&(i=this.sI),t<0&&(t=0)),t>=i)return;s+=t;let r=i-t>>2;if(0===this.alpha)for(;;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;e[s++]=n}e[s++]=n,e[s++]=n,e[s++]=n,e[s++]=n}const h=this.alpha,o=256-this.alpha;for(n=((16711935&n)*o>>8&16711935)+((65280&n)*o>>8&65280);;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280)}e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280)}};static pv=t=>{this.rv[t]&&this.nv&&(this.nv[this.hv++]=this.rv[t],this.rv[t]=null)};static Ev=t=>{if(this.ov[t]=this.vm++,this.rv[t])return this.rv[t];let i;if(this.hv>0&&this.nv)i=this.nv[--this.hv],this.nv[this.hv]=null;else{let t=0,e=-1;for(let i=0;i>>3)&16316671,i[n+8192]=r-(r>>>2)&16316671,i[n+12288]=r-(r>>>2)-(r>>>3)&16316671}}else{if(64===e.width)for(let t=0;t<128;t++)for(let n=0;n<128;n++)i[n+(t<<7)]=s[e.aw[(n>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)i[t]=s[e.aw[t]];this.cv[t]=!1;for(let e=0;e<16384;e++){i[e]&=16316671;const s=i[e];0===s&&(this.cv[t]=!0),i[e+16384]=s-(s>>>3)&16316671,i[e+32768]=s-(s>>>2)&16316671,i[e+49152]=s-(s>>>2)-(s>>>3)&16316671}}return i}}},880:(t,i,e)=>{e.d(i,{r:()=>n});var s=e(7854);const n=async t=>{255!==t[0]&&(t[0]=255),URL.revokeObjectURL(s.SE.src),s.SE.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>s.SE.onload=()=>t())),s.LE.clearRect(0,0,s.xE.width,s.xE.height);const i=s.SE.naturalWidth,e=s.SE.naturalHeight;return s.xE.width=i,s.xE.height=e,s.LE.drawImage(s.SE,0,0),s.LE.getImageData(0,0,i,e)}},8665:(t,i,e)=>{e.d(i,{A:()=>f});var s=e(1069),n=e(8950),r=e(4583),h=e(6730),o=e(4474),l=e(3867);class a{Rd=0;A_=0;bv=0;Tv=-1;Rv=-1;Ov=-1;Lv=-1;Sv=-1;xv=-1;Mv=-1;kv=-1;Dv=-1;Nv=0;Fv=-1;Bv=-1;Uv=-1;data=null}class c{x=0;y=0;z=0;w=0}class f extends o.A{static metadata=null;static head=null;static Pv=null;static Gv=null;static Wv=null;static Yv=null;static Hv=null;static Vv=null;static Kv=null;static Xv=null;static jv=null;static zv=null;static Zv=null;static qv=null;static axis=null;static Jv=new l.fe(4096,!1);static $v=new l.fe(4096,!1);static Qv=new Int32Array(4096);static tb=new Int32Array(4096);static ib=new Int32Array(4096);static eb=new Int32Array(4096);static sb=new Int32Array(4096);static nb=new Int32Array(4096);static rb=new Int32Array(1500);static hb=new l.Xr(1500,512);static ob=new Int32Array(12);static lb=new l.Xr(12,2e3);static ab=new Int32Array(2e3);static cb=new Int32Array(2e3);static fb=new Int32Array(12);static ub=new Int32Array(10);static wb=new Int32Array(10);static yb=new Int32Array(10);static Ir=0;static Ab=0;static gr=0;static mb=!1;static kl=0;static Dl=0;static pb=0;static _b=new Int32Array(1e3);static Ib=!1;static hu(t){try{f.head=new s.A(t.read('ob_head.dat')),f.Pv=new s.A(t.read('ob_face1.dat')),f.Gv=new s.A(t.read('ob_face2.dat')),f.Wv=new s.A(t.read('ob_face3.dat')),f.Yv=new s.A(t.read('ob_face4.dat')),f.Hv=new s.A(t.read('ob_face5.dat')),f.Vv=new s.A(t.read('ob_point1.dat')),f.Kv=new s.A(t.read('ob_point2.dat')),f.Xv=new s.A(t.read('ob_point3.dat')),f.jv=new s.A(t.read('ob_point4.dat')),f.zv=new s.A(t.read('ob_point5.dat')),f.Zv=new s.A(t.read('ob_vertex1.dat')),f.qv=new s.A(t.read('ob_vertex2.dat')),f.axis=new s.A(t.read('ob_axis.dat')),f.head.af=0,f.Vv.af=0,f.Kv.af=0,f.Xv.af=0,f.jv.af=0,f.Zv.af=0,f.qv.af=0;const i=f.head.ou;f.metadata=new l.fe(i+100,null);let e=0,n=0,r=0,h=0,o=0,c=0,u=0;for(let t=0;t>7)<2?i=2:i>126&&(i=126),(65408&t)+i):(i<0?i=0:i>127&&(i=127),127-i)}static Td=(t,i,e)=>{const s=t.Rd,n=t.A_,r=t.bv;let h,o,a,u,d;if(i){h=new Int32Array(s);for(let i=0;i{const n=t.Rd,r=t.A_,h=t.bv;let o,l,a,c,u;if(s)o=t.Od,l=t.Sd,a=t.Ld;else{o=new Int32Array(n),l=new Int32Array(n),a=new Int32Array(n);for(let i=0;i{const e=t.Rd,s=t.A_,n=t.bv,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e);for(let i=0;i{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,l=0,a=-1;for(let c=0;c{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,l=0,a=-1;for(let c=0;c{let o=-1;const l=t.Od[i],a=t.Sd[i],c=t.Ld[i];for(let t=0;t{if(!f.metadata)throw new Error('cant loading model metadata!!!!!');const i=f.metadata[t];if(!i)throw console.log(`Error model:${t} not found!`),new Error('cant loading model metadata!!!!!');if(!(f.head&&f.Pv&&f.Gv&&f.Wv&&f.Yv&&f.Hv&&f.Vv&&f.Kv&&f.Xv&&f.jv&&f.zv&&f.Zv&&f.qv&&f.axis))throw new Error('cant loading model!!!!!');const e=i.Rd,s=i.A_,n=i.bv,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e),l=new Int32Array(s),a=new Int32Array(s),c=new Int32Array(s),u=new Int32Array(n),d=new Int32Array(n),w=new Int32Array(n);let y=null;i.Sv>=0&&(y=new Int32Array(e));let A=null;i.Dv>=0&&(A=new Int32Array(s));let m=null,p=0;i.Nv>=0?m=new Int32Array(s):p=-i.Nv-1;let _=null;i.Fv>=0&&(_=new Int32Array(s));let I=null;i.Bv>=0&&(I=new Int32Array(s));const g=new Int32Array(s);f.Vv.af=i.Tv,f.Kv.af=i.Rv,f.Xv.af=i.Ov,f.jv.af=i.Lv,f.zv.af=i.Sv;let C,E,v,b=0,T=0,R=0;for(let t=0;t{if(!f.metadata||!f.metadata[i])throw new Error('No model metadata');const e=f.metadata[i];if(e.data=t,!e.data.length)throw new Error('No model data');const n=e.Rd,r=e.A_,h=e.bv,o=new Int32Array(n),l=new Int32Array(n),a=new Int32Array(n),c=new Int32Array(r),u=new Int32Array(r),d=new Int32Array(r),w=new Int32Array(h),y=new Int32Array(h),A=new Int32Array(h);let m=null;e.Sv>=0&&(m=new Int32Array(n));let p=null;e.Dv>=0&&(p=new Int32Array(r));let _=null,I=0;e.Nv>=0?_=new Int32Array(r):I=-e.Nv-1;let g=null;e.Fv>=0&&(g=new Int32Array(r));let C=null;e.Bv>=0&&(C=new Int32Array(r));const E=new Int32Array(r),v=new s.A(e.data);v.af=e.Tv;const b=new s.A(e.data);b.af=e.Rv;const T=new s.A(e.data);T.af=e.Ov;const R=new s.A(e.data);R.af=e.Lv;const O=new s.A(e.data);O.af=e.Sv;let L,S,x,M=0,k=0,D=0;for(let t=0;tthis.Ud&&(this.Ud=-e),e>this.c_&&(this.c_=e);const n=i*i+s*s;n>this.dm&&(this.dm=n)}this.dm=Math.sqrt(this.dm)+.99|0,this.Mb=Math.sqrt(this.dm*this.dm+this.Ud*this.Ud)+.99|0,this.xb=this.Mb+(Math.sqrt(this.dm*this.dm+this.c_*this.c_)+.99|0)}xd(){this.Ud=0,this.c_=0;for(let t=0;tthis.Ud&&(this.Ud=-i),i>this.c_&&(this.c_=i)}this.Mb=Math.sqrt(this.dm*this.dm+this.Ud*this.Ud)+.99|0,this.xb=this.Mb+(Math.sqrt(this.dm*this.dm+this.c_*this.c_)+.99|0)}xa(){if(this.kb){const t=new Int32Array(256);let i=0;for(let e=0;ei&&(i=s)}this.Nd=new l.fe(i+1,null);for(let e=0;e<=i;e++)this.Nd[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;ei&&(i=s)}this.Dd=new l.fe(i+1,null);for(let e=0;e<=i;e++)this.Dd[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;el;)l=e[o++];r&&r.types&&s.x&&s.y&&s.z&&r.labels&&(i!==l||0===r.types[i])&&this.Ub(s.x[t],s.y[t],s.z[t],r.labels[i],r.types[i])}f.Ir=0,f.Ab=0,f.gr=0,o=0,l=e[o++];for(let t=0;tl;)l=e[o++];r&&r.types&&n.x&&n.y&&n.z&&r.labels&&(i===l||0===r.types[i])&&this.Ub(n.x[t],n.y[t],n.z[t],r.labels[i],r.types[i])}}else this.Ma(t)}Ma(t){if(!this.Nd||-1===t||!h.A.Lo[t])return;const i=h.A.Lo[t],e=i.TE;f.Ir=0,f.Ab=0,f.gr=0;for(let t=0;t>16;this.Ld[t]=this.Sd[t]*i+this.Ld[t]*e>>16,this.Sd[t]=s}}translate(t,i,e){for(let s=0;s>8;if(this.Eb&&this.vb&&this.bb||(this.Eb=new Int32Array(this.A_),this.vb=new Int32Array(this.A_),this.bb=new Int32Array(this.A_)),!this.e_){this.e_=new l.fe(this.Rd,null);for(let t=0;t8192||m>8192||p>8192||A<-8192||m<-8192||p<-8192;)A>>=1,m>>=1,p>>=1;let _=0|Math.sqrt(A*A+m*m+p*p);if(_<=0&&(_=1),A=256*A/_|0,m=256*m/_|0,p=256*p/_|0,this.y_&&1&this.y_[i]){const r=t+((e*A+s*m+n*p)/(h+(h/2|0))|0);this.Eu&&(this.Eb[i]=f.Cb(this.Eu[i],r,this.y_[i]))}else{let t=this.e_[r];t&&(t.x+=A,t.y+=m,t.z+=p,t.w++),t=this.e_[o],t&&(t.x+=A,t.y+=m,t.z+=p,t.w++),t=this.e_[l],t&&(t.x+=A,t.y+=m,t.z+=p,t.w++)}}if(r)this.r_(t,h,e,s,n);else{this.a_=new l.fe(this.Rd,null);for(let t=0;t>16;for(let s=0;s>16,I=I*w-_*d>>16,_=p),0!==t&&(p=I*a-g*l>>16,g=I*l+g*a>>16,I=p),0!==i&&(p=g*c+_*u>>16,g=g*u-_*c>>16,_=p),_+=n,I+=h,g+=o,p=I*A-g*y>>16,g=I*y+g*A>>16,I=p,f.Qv&&f.tb&&f.ib&&(f.ib[s]=g-m,f.Qv[s]=r.A.ra+((_<<9)/g|0),f.tb[s]=r.A.ha+((I<<9)/g|0)),this.bv>0&&f.eb&&f.sb&&f.nb&&(f.eb[s]=_,f.sb[s]=I,f.nb[s]=g)}try{this.Wb(!1,!1,0)}catch(t){}}draw(t,i,e,s,h,o,l,a,c){const u=a*h-o*s>>16,d=l*i+u*e>>16,w=this.dm*e>>16,y=d+w;if(y<=50||d>=3500)return;const A=a*s+o*h>>16;let m=A-this.dm<<9;if((m/y|0)>=n.A.jE)return;let p=A+this.dm<<9;if((p/y|0)<=-n.A.jE)return;const _=l*e-u*i>>16,I=this.dm*i>>16;let g=_+I<<9;if((g/y|0)<=-n.A.zE)return;let C=_-(I+(this.Ud*e>>16))<<9;if((C/y|0)>=n.A.zE)return;let E=d-(w+(this.Ud*i>>16))<=50,v=!1;if(c>0&&f.mb){let t=d-w;t<=50&&(t=50),A>0?(m=m/y|0,p=p/t|0):(p=p/y|0,m=m/t|0),_>0?(C=C/y|0,g=g/t|0):(g=g/y|0,C=C/t|0);const i=f.kl-r.A.ra,e=f.Dl-r.A.ha;i>m&&iC&&e>16,w=w*O-c*R>>16,c=r),c+=o,u+=l,w+=a,r=w*s+c*h>>16,w=w*h-c*s>>16,c=r,r=u*e-w*i>>16,w=u*i+w*e>>16,u=r,f.ib&&(f.ib[n]=w-d),w>=50&&f.Qv&&f.tb?(f.Qv[n]=b+((c<<9)/w|0),f.tb[n]=T+((u<<9)/w|0)):f.Qv&&(f.Qv[n]=-5e3,E=!0),(E||this.bv>0)&&f.eb&&f.sb&&f.nb&&(f.eb[n]=c,f.sb[n]=u,f.nb[n]=w)}try{this.Wb(E,v,c)}catch(t){}}Wb(t,i,e,s=!1){f.Ib&&(this.Fb=-1,this.Bb=-1);for(let t=0;tn.A.sI||a>n.A.sI||c>n.A.sI),f.hb&&f.rb){const t=((y+A+m)/3|0)+this.Mb;f.hb[t][f.rb[t]++]=s,f.Ib&&this.Yb(f.kl,f.Dl,u,d,w,l,a,c)&&this.Bb=0;t--){const i=f.rb[t];if(!(i<=0)&&f.hb){const e=f.hb[t];for(let t=0;t=0;t--){const i=f.rb[t];if(i>0&&f.hb){const e=f.hb[t];for(let s=0;s0||f.ob[2]>0)&&(r=(f.fb[1]+f.fb[2])/(f.ob[1]+f.ob[2])|0);let h=0;f.ob&&f.fb&&(f.ob[3]>0||f.ob[4]>0)&&(h=(f.fb[3]+f.fb[4])/(f.ob[3]+f.ob[4])|0);let o=0;if(f.ob&&f.fb&&(f.ob[6]>0||f.ob[8]>0)&&(o=(f.fb[6]+f.fb[8])/(f.ob[6]+f.ob[8])|0),f.ob&&f.lb){let t,i=0,e=f.ob[10],n=f.lb[10],l=f.ab;i===e&&(i=0,e=f.ob[11],n=f.lb[11],l=f.cb),t=ir;)this.Hb(n[i++],s),i===e&&n!==f.lb[11]&&(i=0,e=f.ob[11],n=f.lb[11],l=f.cb),t=ih;)this.Hb(n[i++],s),i===e&&n!==f.lb[11]&&(i=0,e=f.ob[11],n=f.lb[11],l=f.cb),t=io;)this.Hb(n[i++],s),i===e&&n!==f.lb[11]&&(i=0,e=f.ob[11],n=f.lb[11],l=f.cb),t=i>2,h=this.Ob[i],o=this.Lb[i],l=this.Sb[i];r.A.fI(f.Qv[e],f.Qv[s],f.Qv[n],f.tb[e],f.tb[s],f.tb[n],this.Eb[t],this.vb[t],this.bb[t],f.eb[h],f.sb[h],f.nb[h],f.eb[o],f.eb[l],f.sb[o],f.sb[l],f.nb[o],f.nb[l],this.Eu[t])}else if(3===h&&this.y_&&this.Eu&&this.Eb&&f.Qv&&f.tb&&f.eb&&f.sb&&f.nb){const i=this.y_[t]>>2,h=this.Ob[i],o=this.Lb[i],l=this.Sb[i];r.A.fI(f.Qv[e],f.Qv[s],f.Qv[n],f.tb[e],f.tb[s],f.tb[n],this.Eb[t],this.Eb[t],this.Eb[t],f.eb[h],f.sb[h],f.nb[h],f.eb[o],f.eb[l],f.sb[o],f.sb[l],f.nb[o],f.nb[l],this.Eu[t])}}Vb(t,i=!1){let e=0;if(f.nb){const i=r.A.ra,s=r.A.ha,n=this.m_[t],h=this.p_[t],o=this.__[t],l=f.nb[n],a=f.nb[h],c=f.nb[o];if(l>=50&&f.Qv&&f.tb&&this.Eb)f.ub[e]=f.Qv[n],f.wb[e]=f.tb[n],f.yb[e++]=this.Eb[t];else if(f.eb&&f.sb&&this.Eb){const u=f.eb[n],d=f.sb[n],w=this.Eb[t];if(c>=50&&this.bb){const n=(50-l)*r.A.iv[c-l];f.ub[e]=i+((u+((f.eb[o]-u)*n>>16)<<9)/50|0),f.wb[e]=s+((d+((f.sb[o]-d)*n>>16)<<9)/50|0),f.yb[e++]=w+((this.bb[t]-w)*n>>16)}if(a>=50&&this.vb){const n=(50-l)*r.A.iv[a-l];f.ub[e]=i+((u+((f.eb[h]-u)*n>>16)<<9)/50|0),f.wb[e]=s+((d+((f.sb[h]-d)*n>>16)<<9)/50|0),f.yb[e++]=w+((this.vb[t]-w)*n>>16)}}if(a>=50&&f.Qv&&f.tb&&this.vb)f.ub[e]=f.Qv[h],f.wb[e]=f.tb[h],f.yb[e++]=this.vb[t];else if(f.eb&&f.sb&&this.vb){const u=f.eb[h],d=f.sb[h],w=this.vb[t];if(l>=50&&this.Eb){const h=(50-a)*r.A.iv[l-a];f.ub[e]=i+((u+((f.eb[n]-u)*h>>16)<<9)/50|0),f.wb[e]=s+((d+((f.sb[n]-d)*h>>16)<<9)/50|0),f.yb[e++]=w+((this.Eb[t]-w)*h>>16)}if(c>=50&&this.bb){const n=(50-a)*r.A.iv[c-a];f.ub[e]=i+((u+((f.eb[o]-u)*n>>16)<<9)/50|0),f.wb[e]=s+((d+((f.sb[o]-d)*n>>16)<<9)/50|0),f.yb[e++]=w+((this.bb[t]-w)*n>>16)}}if(c>=50&&f.Qv&&f.tb&&this.bb)f.ub[e]=f.Qv[o],f.wb[e]=f.tb[o],f.yb[e++]=this.bb[t];else if(f.eb&&f.sb&&this.bb){const u=f.eb[o],d=f.sb[o],w=this.bb[t];if(a>=50&&this.vb){const n=(50-c)*r.A.iv[a-c];f.ub[e]=i+((u+((f.eb[h]-u)*n>>16)<<9)/50|0),f.wb[e]=s+((d+((f.sb[h]-d)*n>>16)<<9)/50|0),f.yb[e++]=w+((this.vb[t]-w)*n>>16)}if(l>=50&&this.Eb){const h=(50-c)*r.A.iv[l-c];f.ub[e]=i+((u+((f.eb[n]-u)*h>>16)<<9)/50|0),f.wb[e]=s+((d+((f.sb[n]-d)*h>>16)<<9)/50|0),f.yb[e++]=w+((this.Eb[t]-w)*h>>16)}}}const s=f.ub[0],h=f.ub[1],o=f.ub[2],l=f.wb[0],a=f.wb[1],c=f.wb[2];if(!((s-h)*(c-a)-(l-a)*(o-h)<=0))if(r.A.eI=!1,3===e){let e;if((s<0||h<0||o<0||s>n.A.sI||h>n.A.sI||o>n.A.sI)&&(r.A.eI=!0),e=this.y_?3&this.y_[t]:0,i)r.A.qE(s,h,l,a,f.yb[0]),r.A.qE(h,o,a,c,f.yb[1]),r.A.qE(o,s,c,l,f.yb[2]);else if(0===e)r.A.oI(s,h,o,l,a,c,f.yb[0],f.yb[1],f.yb[2]);else if(1===e&&this.Eb)r.A.gv(s,h,o,l,a,c,r.A.palette[this.Eb[t]]);else if(2===e&&this.y_&&this.Eu&&f.eb&&f.sb&&f.nb){const i=this.y_[t]>>2,e=this.Ob[i],n=this.Lb[i],u=this.Sb[i];r.A.fI(s,h,o,l,a,c,f.yb[0],f.yb[1],f.yb[2],f.eb[e],f.sb[e],f.nb[e],f.eb[n],f.eb[u],f.sb[n],f.sb[u],f.nb[n],f.nb[u],this.Eu[t])}else if(3===e&&this.y_&&this.Eu&&this.Eb&&f.eb&&f.sb&&f.nb){const i=this.y_[t]>>2,e=this.Ob[i],n=this.Lb[i],u=this.Sb[i];r.A.fI(s,h,o,l,a,c,this.Eb[t],this.Eb[t],this.Eb[t],f.eb[e],f.sb[e],f.nb[e],f.eb[n],f.eb[u],f.sb[n],f.sb[u],f.nb[n],f.nb[u],this.Eu[t])}}else if(4===e){let e;if((s<0||h<0||o<0||s>n.A.sI||h>n.A.sI||o>n.A.sI||f.ub[3]<0||f.ub[3]>n.A.sI)&&(r.A.eI=!0),e=this.y_?3&this.y_[t]:0,i)r.A.qE(s,h,l,a,f.yb[0]),r.A.qE(h,o,a,c,f.yb[1]),r.A.qE(o,f.ub[3],c,f.wb[3],f.yb[2]),r.A.qE(f.ub[3],s,f.wb[3],l,f.yb[3]);else if(0===e)r.A.oI(s,h,o,l,a,c,f.yb[0],f.yb[1],f.yb[2]),r.A.oI(s,o,f.ub[3],l,c,f.wb[3],f.yb[0],f.yb[2],f.yb[3]);else if(1===e){if(this.Eb){const i=r.A.palette[this.Eb[t]];r.A.gv(s,h,o,l,a,c,i),r.A.gv(s,o,f.ub[3],l,c,f.wb[3],i)}}else if(2===e&&this.y_&&this.Eu&&f.eb&&f.sb&&f.nb){const i=this.y_[t]>>2,e=this.Ob[i],n=this.Lb[i],u=this.Sb[i];r.A.fI(s,h,o,l,a,c,f.yb[0],f.yb[1],f.yb[2],f.eb[e],f.sb[e],f.nb[e],f.eb[n],f.eb[u],f.sb[n],f.sb[u],f.nb[n],f.nb[u],this.Eu[t]),r.A.fI(s,o,f.ub[3],l,c,f.wb[3],f.yb[0],f.yb[2],f.yb[3],f.eb[e],f.sb[e],f.nb[e],f.eb[n],f.eb[u],f.sb[n],f.sb[u],f.nb[n],f.nb[u],this.Eu[t])}else if(3===e&&this.y_&&this.Eu&&this.Eb&&f.eb&&f.sb&&f.nb){const i=this.y_[t]>>2,e=this.Ob[i],n=this.Lb[i],u=this.Sb[i];r.A.fI(s,h,o,l,a,c,this.Eb[t],this.Eb[t],this.Eb[t],f.eb[e],f.sb[e],f.nb[e],f.eb[n],f.eb[u],f.sb[n],f.sb[u],f.nb[n],f.nb[u],this.Eu[t]),r.A.fI(s,o,f.ub[3],l,c,f.wb[3],this.Eb[t],this.Eb[t],this.Eb[t],f.eb[e],f.sb[e],f.nb[e],f.eb[n],f.eb[u],f.sb[n],f.sb[u],f.nb[n],f.nb[u],this.Eu[t])}}}Ub(t,i,e,s,n){if(!s)return;const h=s.length;if(0===n){let n=0;f.Ir=0,f.Ab=0,f.gr=0;for(let t=0;t0?(f.Ir=(f.Ir/n|0)+t,f.Ab=(f.Ab/n|0)+i,f.gr=(f.gr/n|0)+e):(f.Ir=t,f.Ab=i,f.gr=e)}else if(1===n)for(let n=0;n=this.Nd.length)continue;const h=this.Nd[r];if(h)for(let s=0;s=this.Nd.length)continue;const o=this.Nd[h];if(o)for(let s=0;s>16;this.Sd[n]=this.Sd[n]*u-this.Od[n]*c>>16,this.Od[n]=t}if(0!==h){c=r.A.sin[h],u=r.A.cos[h];const t=this.Sd[n]*u-this.Ld[n]*c>>16;this.Ld[n]=this.Sd[n]*c+this.Ld[n]*u>>16,this.Sd[n]=t}if(0!==l){c=r.A.sin[l],u=r.A.cos[l];const t=this.Ld[n]*c+this.Od[n]*u>>16;this.Ld[n]=this.Ld[n]*u-this.Od[n]*c>>16,this.Od[n]=t}this.Od[n]+=f.Ir,this.Sd[n]+=f.Ab,this.Ld[n]+=f.gr}}else if(3===n)for(let n=0;n=this.Nd.length)continue;const h=this.Nd[r];if(h)for(let s=0;s=this.Dd.length)continue;const n=this.Dd[e];if(n)for(let i=0;i255&&(this.Rb[e]=255)}}}Gb(){this.Ud=0,this.dm=0,this.c_=0,this.f_=999999,this.u_=-999999,this.w_=-99999,this.d_=99999;for(let t=0;tthis.u_&&(this.u_=i),sthis.w_&&(this.w_=s),-e>this.Ud&&(this.Ud=-e),e>this.c_&&(this.c_=e);const n=i*i+s*s;n>this.dm&&(this.dm=n)}this.dm=0|Math.sqrt(this.dm),this.Mb=0|Math.sqrt(this.dm*this.dm+this.Ud*this.Ud),this.xb=this.Mb+(0|Math.sqrt(this.dm*this.dm+this.c_*this.c_))}Yb(t,i,e,s,n,r,h,o){return!(ie&&i>s&&i>n)&&(!(t{e.d(i,{A:()=>o});var s=e(8950),n=e(1069),r=e(4474),h=e(880);class o extends r.A{aw;width;height;Xb;jb;Fl;nw;constructor(t,i){super(),this.aw=new Int32Array(t*i),this.width=this.Fl=t,this.height=this.nw=i,this.Xb=this.jb=0}static zb=async(t,i)=>{const e=t.read(i+'.dat');if(!e)throw new Error(`${i} jpeg not found!`);const s=await(0,h.r)(e),n=new o(s.width,s.height),r=new Uint32Array(s.data.buffer),l=n.aw;for(let t=0;t>24&255)<<24|(255&i)<<16|(i>>8&255)<<8|i>>16&255}return n};static Cu=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.af=s.ou;const h=r.ou,l=r.ou,a=[],c=r.au-1;for(let t=0;ts.length||r.af>r.length)throw new Error;const f=r.au,u=r.au,d=r.ou,w=r.ou,y=new o(d,w);y.Xb=f,y.jb=u,y.Fl=h,y.nw=l;const A=r.au;if(0===A){const t=y.width*y.height;for(let i=0;is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,l+=i,o+=i}h>0&&r>0&&this.Zb(h,r,this.aw,n,l,s.A.aw,e,o)}Nl(t,i,e){i|=0,e|=0;let n=(i+=this.Xb)+(e+=this.jb)*s.A.cw,r=0,h=this.height,o=this.width,l=s.A.cw-o,a=0;if(es.A.bottom&&(h-=e+h-s.A.bottom),is.A.right){const t=i+o-s.A.right;o-=t,a+=t,l+=t}o>0&&h>0&&this.qb(o,h,this.aw,r,a,s.A.aw,n,l,t)}Jb(t,i){t|=0,i|=0;let e=(t+=this.Xb)+(i+=this.jb)*s.A.cw,n=0,r=this.height,h=this.width,o=s.A.cw-h,l=0;if(is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,l+=i,o+=i}h>0&&r>0&&this.$b(h,r,this.aw,n,l,s.A.aw,e,o)}Qb(){const t=this.aw,i=this.width,e=this.height;for(let s=0;s>16&255;r+=t,r<1?r=1:r>255&&(r=255);let h=n>>8&255;h+=i,h<1?h=1:h>255&&(h=255);let o=255&n;o+=e,o<1?o=1:o>255&&(o=255),this.aw[s]=(r<<16)+(h<<8)+o}}}gw(t,i,e,n){t|=0,i|=0,e|=0,n|=0;try{const r=this.width;let h=0,o=0;const l=this.Fl,a=this.nw,c=(l<<16)/e|0,f=(a<<16)/n|0;t+=(this.Xb*e+l-1)/l|0,i+=(this.jb*n+a-1)/a|0,this.Xb*e%l!=0&&(h=(l-this.Xb*e%l<<16)/e|0),this.jb*n%a!=0&&(o=(a-this.jb*n%a<<16)/n|0),e=e*(this.width-(h>>16))/l|0,n=n*(this.height-(o>>16))/a|0;let u=t+i*s.A.cw,d=s.A.cw-e;if(is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right){const i=t+e-s.A.right;e-=i,d+=i}this.scale(e,n,this.aw,h,o,s.A.aw,d,u,r,c,f)}catch(t){console.error('error in sprite clipping routine')}}iT(t,i,e,n,r,h,o,l,a,c){t|=0,i|=0,e|=0,n|=0;try{const f=-e/2|0,u=-n/2|0,d=65536*Math.sin(a/326.11)|0,w=65536*Math.cos(a/326.11)|0,y=d*c>>8,A=w*c>>8;let m=(o<<16)+u*y+f*A,p=u*A-f*y+(l<<16),_=t+i*s.A.cw;for(let t=0;t>16)+(o>>16)*this.width],n+=A,o-=y;m+=y,p+=A,_+=s.A.cw}}catch(t){}}eT(t,i,e){t|=0,i|=0;let n=(t+=this.Xb)+(i+=this.jb)*s.A.cw,r=0,h=this.height,o=this.width,l=s.A.cw-o,a=0;if(is.A.bottom&&(h-=i+h-s.A.bottom),ts.A.right){const i=t+o-s.A.right;o-=i,a+=i,l+=i}o>0&&h>0&&this.sT(o,h,this.aw,a,r,s.A.aw,n,l,e.aw)}scale(t,i,e,s,n,r,h,o,l,a,c){try{const f=s;for(let u=-i;u<0;u++){const i=(n>>16)*l;for(let n=-t;n<0;n++){const t=e[(s>>16)+i];0===t?o++:r[o++]=t,s+=a}n+=c,s=f,o+=h}}catch(t){console.error('error in plot_scale')}}$b(t,i,e,s,n,r,h,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++)r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++];for(let i=t;i<0;i++)r[h++]=e[s++];h+=o,s+=n}}qb(t,i,e,s,n,r,h,o,l){const a=256-l;for(let c=-i;c<0;c++){for(let i=-t;i<0;i++){const t=e[s++];if(0===t)h++;else{const i=r[h];r[h++]=((16711935&t)*l+(16711935&i)*a&4278255360)+((65280&t)*l+(65280&i)*a&16711680)>>8}}h+=o,s+=n}}Zb(t,i,e,s,n,r,h,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=e[s++];0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=t}h+=o,s+=n}}sT(t,i,e,s,n,r,h,o,l){const a=-(t>>2);t=-(3&t);for(let c=-i;c<0;c++){for(let t=a;t<0;t++){let t=e[n++];0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++}for(let i=t;i<0;i++){const t=e[n++];0!==t&&0===l[h]?r[h++]=t:h++}h+=o,n+=s}}}},1673:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(8950),n=e(1069),r=e(4474);class h extends r.A{aw;width;height;Xb;jb;Fl;nw;palette;constructor(t,i,e){super(),this.aw=new Int8Array(t*i),this.width=this.Fl=t,this.height=this.nw=i,this.Xb=this.jb=0,this.palette=e}static Cu=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.af=s.ou;const o=r.ou,l=r.ou,a=r.au,c=new Int32Array(a);for(let t=1;ts.length||r.af>r.length)throw new Error;const f=r.au,u=r.au,d=r.ou,w=r.ou,y=new h(d,w,c);y.Xb=f,y.jb=u,y.Fl=o,y.nw=l;const A=y.aw,m=r.au;if(0===m){const t=y.width*y.height;for(let i=0;is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,l+=i,o+=i}h>0&&r>0&&this.nT(h,r,this.aw,n,l,s.A.aw,e,o)}Qb(){const t=this.aw,i=this.width,e=this.height;for(let s=0;s>16&255;n+=t,n<0?n=0:n>255&&(n=255);let r=this.palette[s]>>8&255;r+=i,r<0?r=0:r>255&&(r=255);let h=255&this.palette[s];h+=e,h<0?h=0:h>255&&(h=255),this.palette[s]=(n<<16)+(r<<8)+h}}yv(){this.Fl|=0,this.nw|=0,this.Fl/=2,this.nw/=2,this.Fl|=0,this.nw|=0;const t=new Int8Array(this.Fl*this.nw);let i=0;for(let e=0;e>1)+(e+this.jb>>1)*this.Fl]=this.aw[i++];this.aw=t,this.width=this.Fl,this.height=this.nw,this.Xb=0,this.jb=0}gw(){if(this.width===this.Fl&&this.height===this.nw)return;const t=new Int8Array(this.Fl*this.nw);let i=0;for(let e=0;e>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=e[s++];0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t]}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=this.palette[255&t]}h+=o,s+=n}}clip(t,i,e,n){try{const r=this.width;this.height;let h=0,o=0;const l=this.Fl,a=this.nw,c=(l<<16)/e|0,f=(a<<16)/n|0;t=t+(this.Xb*e+l-1)/l|0,i=i+(this.jb*n+a-1)/a|0,this.Xb*e%l!=0&&(h=(l-this.Xb*e%l<<16)/e|0),this.jb*n%a!=0&&(o=(a-this.jb*n%a<<16)/n|0),e=e*(this.width-(h>>16))/l|0,n=n*(this.height-(o>>16))/a|0;let u,d=t+i*s.A.cw,w=s.A.cw-e;is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right&&(u=t+e-s.A.right,e-=u,w+=u),this.rT(s.A.aw,this.aw,this.palette,h,o,d,w,e,n,c,f,r)}catch(t){console.log('error in sprite clipping routine')}}rT(t,i,e,s,n,r,h,o,l,a,c,f){try{const u=s;for(let d=-l;d<0;d++){const l=(n>>16)*f;for(let n=-o;n<0;n++){const n=i[(s>>16)+l];0==n?r++:t[r++]=e[255&n],s+=a}n+=c,s=u,r+=h}}catch(t){console.log('error in plot_scale')}}}},1183:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(8950),n=e(7854);class r{hT;width;height;oT;lT;aw;constructor(t,i,e=n.zo){this.oT=e,this.hT=this.oT.getImageData(0,0,t,i),this.lT=new Uint32Array(this.hT.data.buffer),this.aw=new Int32Array(t*i),this.width=t,this.height=i,this.bind()}clear(){this.aw.fill(0)}bind(){s.A.bind(this.aw,this.width,this.height)}draw(t,i){this.#t(),this.oT.putImageData(this.hT,t,i)}#t(){const t=this.aw.length,i=this.aw,e=this.lT;for(let s=0;s>16&255|(t>>8&255)<<8|(255&t)<<16|4278190080}}}},4544:(t,i,e)=>{e.d(i,{A:()=>s});class s{db;constructor(t){t.onerror=this.onerror,t.onclose=this.onclose,this.db=t}static openDatabase=async()=>await new Promise(((t,i)=>{const e=indexedDB.open('lostcity',1);e.onsuccess=i=>{const e=i.target;console.log('database success!'),t(e.result)},e.onupgradeneeded=t=>{t.target.result.createObjectStore('cache')},e.onerror=t=>{const e=t.target;console.error('database error!: ',e.error),i(e.result)}}));Uo=async t=>await new Promise((i=>{const e=this.db.transaction('cache','readonly').objectStore('cache').get(t);e.onsuccess=()=>{i(e.result)},e.onerror=t=>{i(void 0)}}));Ho=async(t,i)=>await new Promise(((e,s)=>{const n=this.db.transaction('cache','readwrite').objectStore('cache').put(i,t);n.onsuccess=()=>{e()},n.onerror=t=>{s()}}));onclose=t=>{console.log('database close!')};onerror=t=>{console.log('database error!')};aT=t=>{const i=t.trim();let e=0;for(let t=0;t='A'&&s<='Z'?e+=s.charCodeAt(0)+1-65:s>='a'&&s<='z'?e+=s.charCodeAt(0)+1-97:s>='0'&&s<='9'&&(e+=s.charCodeAt(0)+27-48)}return e}}},2901:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(1908);class r{static aT=t=>{let i=0;t=t.toUpperCase();for(let e=0;e=this.fT)return null;if(this.AT[t])return this.AT[t];const i=this.yT[t],e=i+this.wT[t];if(this.cT){const s=Uint8Array.from(this.buffer.subarray(i,i+e));return this.AT[t]=s,s}{const i=Uint8Array.from(n.A.read(this.dT[t],this.buffer,this.wT[t],this.yT[t]));return this.AT[t]=i,i}}}},1069:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(9234),n=e(6666),r=e(4474);class h extends r.A{static pT=3988292384;static _T=new Int32Array(256);static IT=new Uint32Array(33);static gT=new n.A;static CT=new n.A;static ET=new n.A;static vT=0;static bT=0;static TT=0;static{for(let t=0;t<32;t++)h.IT[t]=(1<>>=1:i=i>>>1^h.pT;h._T[t]=i}}static Po=t=>{let i=4294967295;for(let e=0;e>>8^h._T[255&(i^t[e])];return~i};view;data;af=0;RT=0;random=null;constructor(t){if(!t)throw new Error('Input src packet array was null!');super(),t instanceof Int8Array?this.data=new Uint8Array(t):this.data=t,this.view=new DataView(this.data.buffer,this.data.byteOffset,this.data.byteLength)}get length(){return this.view.byteLength}get available(){return this.length-this.af}static Ut=t=>{let i=null;return 0===t&&h.vT>0?(h.vT--,i=h.gT.B_()):1===t&&h.bT>0?(h.bT--,i=h.CT.B_()):2===t&&h.TT>0&&(h.TT--,i=h.ET.B_()),i?(i.af=0,i):new h(0===t?new Uint8Array(100):1===t?new Uint8Array(5e3):new Uint8Array(3e4))};release(){this.af=0,100===this.view.byteLength&&h.vT<1e3?(h.gT.MA(this),h.vT++):5e3===this.view.byteLength&&h.bT<250?(h.CT.MA(this),h.bT++):3e4===this.view.byteLength&&h.TT<50&&(h.ET.MA(this),h.TT++)}get au(){return this.view.getUint8(this.af++)}get bd(){return this.view.getInt8(this.af++)}get ou(){const t=this.view.getUint16(this.af);return this.af+=2,t}get fu(){const t=this.view.getInt16(this.af);return this.af+=2,t}get Wu(){const t=this.view.getUint8(this.af++)<<16|this.view.getUint16(this.af);return this.af+=2,t}get Ko(){const t=this.view.getInt32(this.af);return this.af+=4,t}get JC(){const t=this.view.getBigInt64(this.af);return this.af+=8,t}get RE(){return this.view.getUint8(this.af)<128?this.au-64:this.ou-49152}get um(){return this.view.getUint8(this.af)<128?this.au:this.ou-32768}get wu(){const t=this.view,i=t.byteLength;let e,s='';for(;10!==(e=t.getUint8(this.af++))&&this.af>16),this.view.setUint16(this.af,t),this.af+=2}p4(t){this.view.setInt32(this.af,t),this.af+=4}MT(t){this.view.setInt32(this.af,t,!0),this.af+=4}kT(t){this.view.setBigInt64(this.af,t),this.af+=8}DT(t){const i=this.view,e=t.length;for(let s=0;s>>3,e=8-(7&this.RT),s=0;for(this.RT+=t;t>e;e=8)s+=(this.view.getUint8(i++)&h.IT[e])<>>e-t&h.IT[t],s}GT(t,i){const e=this.af;this.af=0;const n=new Uint8Array(e);this.OT(e,0,n);const r=(0,s.WT)(n),h=(0,s.YT)(r,i,t),o=(0,s.HT)(h);this.af=0,this.p1(o.length),this.NT(o,o.length,0)}}},3937:(t,i,e)=>{e.d(i,{A:()=>o});class s{start=0;end=0;form=0;length=0;VT=null;KT=null;threshold=0;position=0;delta=0;amplitude=0;XT=0;read(t){this.form=t.au,this.start=t.Ko,this.end=t.Ko,this.length=t.au,this.VT=new Int32Array(this.length),this.KT=new Int32Array(this.length);for(let i=0;i=this.threshold&&this.KT&&this.VT&&(this.amplitude=this.KT[this.position++]<<15,this.position>=this.length&&(this.position=this.length-1),this.threshold=this.VT[this.position]/65536*t|0,this.threshold>this.XT&&(this.delta=((this.KT[this.position]<<15)-this.amplitude)/(this.threshold-this.XT)|0)),this.amplitude+=this.delta,this.XT++,this.amplitude-this.delta>>15}}class n{static buffer=null;static SA=null;static sin=null;static jT=new Int32Array(5);static zT=new Int32Array(5);static ZT=new Int32Array(5);static qT=new Int32Array(5);static JT=new Int32Array(5);$T=null;QT=null;tR=null;iR=null;eR=null;sR=null;release=null;attack=null;nR=new Int32Array(5);rR=new Int32Array(5);hR=new Int32Array(5);start=0;length=500;oR=100;lR=0;static init=()=>{this.SA=new Int32Array(32768);for(let t=0;t<32768;t++)Math.random()>.5?this.SA[t]=1:this.SA[t]=-1;this.sin=new Int32Array(32768);for(let t=0;t<32768;t++)this.sin[t]=16384*Math.sin(t/5215.1903)|0;this.buffer=new Int32Array(220500)};aR(t,i){for(let i=0;i>1,h+=(i*s>>16)+r}if(this.eR&&this.sR){const i=this.eR.evaluate(t),e=this.sR.evaluate(t);c=c*(32768+(this.cR(e,a,this.eR.form)>>1))>>15,a+=(i*o>>16)+l}for(let s=0;s<5;s++)if(0!==this.nR[s]){const r=i+n.zT[s];r>15,n.jT[s],this.$T.form),n.jT[s]+=(e*n.qT[s]>>16)+n.JT[s])}}if(this.release&&this.attack){this.release.reset(),this.attack.reset();let i=0,e=!0;for(let s=0;s>8):this.release.start+((this.release.end-this.release.start)*h>>8),i+=256,i>=o&&(i=0,e=!e),e&&(n.buffer[s]=0)}}if(this.lR>0&&this.oR>0){const i=this.lR*e;for(let e=i;e32767&&(n.buffer[i]=32767);return n.buffer}cR(t,i,e){return 1===e?(32767&i)<16384?t:-t:2===e?n.sin[32767&i]*t>>14:3===e?((32767&i)*t>>14)-t:4===e?n.SA[i/2607&32767]*t:0}read(t){this.$T=new s,this.$T.read(t),this.QT=new s,this.QT.read(t),0!==t.au&&(t.af--,this.tR=new s,this.tR.read(t),this.iR=new s,this.iR.read(t)),0!==t.au&&(t.af--,this.eR=new s,this.eR.read(t),this.sR=new s,this.sR.read(t)),0!==t.au&&(t.af--,this.release=new s,this.release.read(t),this.attack=new s,this.attack.read(t));for(let i=0;i<10;i++){const e=t.um;if(0===e)break;this.nR[i]=e,this.rR[i]=t.RE,this.hR[i]=t.um}this.lR=t.um,this.oR=t.um,this.length=t.ou,this.start=t.ou}}var r=e(1069),h=e(3867);class o{static fR=new Int32Array(1e3);static uR=null;static dR=null;static wR=new h.fe(1e3,null);yR=new h.fe(10,null);AR=0;loopEnd=0;static hu=t=>{const i=new r.A(t.read('sounds.dat'));for(this.uR=new Uint8Array(441e3),this.dR=new r.A(this.uR),n.init();;){const t=i.ou;if(65535===t)break;const e=new o;e.read(i),this.wR[t]=e,this.fR[t]=e.trim()}};static aR=(t,i)=>{if(!this.wR[t])return null;const e=this.wR[t];return e?.mR(i)??null};read(t){for(let i=0;i<10;i++)0!==t.au&&(t.af--,this.yR[i]=new n,this.yR[i]?.read(t));this.AR=t.ou,this.loopEnd=t.ou}trim(){let t=9999999;for(let i=0;i<10;i++)this.yR[i]&&(this.yR[i].start/20|0)i&&(i=this.yR[t].length+this.yR[t].start);if(0===i)return 0;let e=22050*i/1e3|0,s=22050*this.AR/1e3|0,n=22050*this.loopEnd/1e3|0;(s<0||n<0||n>e||s>=n)&&(t=0);let r=e+(n-s)*(t-1);for(let t=44;t>8<<24>>24)}if(t>1){s+=44,n+=44,e+=44,r+=44;const i=r-e;for(let t=e-1;t>=n;t--)o.uR&&(o.uR[t+i]=o.uR[t]);for(let i=1;i{e.d(i,{qA:()=>a,ZA:()=>o,fe:()=>s,gm:()=>n,Eh:()=>r,Am:()=>h,Xr:()=>l});class s extends Array{constructor(t,i){super(t);for(let e=0;e{e.d(i,{HT:()=>o,Wo:()=>n,WT:()=>h,Yo:()=>s,Xa:()=>r,YT:()=>l});const s=async t=>new Promise((i=>setTimeout(i,t))),n=async t=>new Int8Array(await(await fetch(t)).arrayBuffer()),r=async t=>(await fetch(t)).text();function h(t){let i=0n;for(let e=0;e0n;)i.unshift(Number(0xffn&t)),t>>=8n;return 128&i[0]&&i.unshift(0),new Uint8Array(i)}function l(t,i,e){let s=1n;for(;i>0n;)i%2n===1n&&(s=s*t%e),t=t*t%e,i>>=1n;return s}},7608:(t,i,e)=>{e.a(t,(async(t,i)=>{try{var s=e(9234),n=e(1069),r=e(3937),h=e(4544),o=e(1908),l=e(123),a=(e(9896),e(7604)),c=e(1651);class t extends c.K{pR=[];async _R(t){const i=new Map,e=(await(0,s.Xa)(t)).split('\n');for(let t=0;t{if(this.Mt)this.kt=!0;else{this.Mt=!0;try{await this.Go(10,'Connecting to fileserver'),await o.A.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new h.A(await h.A.openDatabase());const t=new n.A(new Uint8Array(await(0,s.Wo)(`${c.K.nt}/crc`)));for(let i=0;i<9;i++)this.Bt[i]=t.Ko;const i=await this.Bo('sounds','sound effects',this.Bt[8],70);await this.Go(50,'Unpacking sounds'),r.A.hu(i),await this.Go(100,'Getting ready to start...'),await this.IR()}catch(t){this.Dt=!0,console.error(t)}}};async IR(){const t=document.getElementById('sounds');if(!t)return;t.innerHTML='',this.pR[1]=await this._R(`${c.K.lt}/data/src/pack/sound.pack`);const i=document.createElement('input');i.type='search',i.placeholder='Search',i.tabIndex=1,i.oninput=()=>{const t=document.querySelector('#soundList');if(!t)return;const e=i.value.toLowerCase().replaceAll(' ','_');for(let i=0;i-1||n.indexOf(e)>-1||r.indexOf(e)>-1?s.style.display='':s.style.display='none'}},t.appendChild(i);const e=document.createElement('ul');e.id='soundList',e.className='list-group',t.appendChild(e);for(const[t,i]of this.pR[1]){const s=document.createElement('li');s.id=i,s.setAttribute('rs-id',t.toString()),s.setAttribute('rs-debugname',i),s.className='list-group-item list-group-item-center',s.innerText=i+' - '+t,0===t&&(s.className+=' active'),s.onclick=async()=>{const i=e.querySelector('.active');i&&(i.className='list-group-item list-group-item-center'),s.className='list-group-item list-group-item-center active';const n=r.A.aR(t,0);n&&await(0,l.gR)(n.data.slice(0,n.af),128)},e.appendChild(s)}}}await(0,a.w)(),(new t).Rc().then((()=>{})),window.onkeydown=function(t){return!(' '===t.key&&t.target===document.body)},i()}catch(t){i(t)}}),1)},1908:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(9763);class n{static CR=null;static load=async t=>{this.CR=await(0,s.F)(new WebAssembly.Module(t),{env:void 0})};static read=(t,i,e,s)=>{if(!this.CR)throw new Error('bz2 not found!!');return Int8Array.from(this.CR.read(t,i,e,s))}}},123:(t,i,e)=>{let s;async function n(t,i){!function(t){s||(s=window.audioContext.createGain(),s.connect(window.audioContext.destination));s.gain.value=t/256}(i);try{const i=await window.audioContext.decodeAudioData(Uint8Array.from(t).buffer);let e=window.audioContext.createBufferSource();e.buffer=i,e.connect(s),e.start()}catch(t){console.log(t)}}function r(t,i){window._tinyMidiPlay&&window._tinyMidiPlay(t,i/256)}function h(){window._tinyMidiStop&&window._tinyMidiStop()}e.d(i,{gR:()=>n,Xo:()=>r,Ro:()=>h})},9763:(t,i,e)=>{async function s(t,i={}){const e={env:Object.assign(Object.create(globalThis),i.env||{},{abort(t,i,e,s){t=h(t>>>0),i=h(i>>>0),e>>>=0,s>>>=0,(()=>{throw Error(`${t} in ${i}:${e}:${s}`)})()}})},{exports:s}=await WebAssembly.instantiate(t,e),n=s.memory||i.env.memory,r=Object.setPrototypeOf({read:(t,i,e,r)=>(i=function(t,i,e,r,h){if(null==r)return 0;const o=r.length,l=s.__pin(s.__new(o<>>0;if(h)new h(n.buffer,l,o).set(r);else for(let i=0;i>>0),r[i]);return s.__unpin(l),l}(l,6,0,i,Int8Array)||function(){throw TypeError("value must not be null")}(),function(t,i,e){if(!e)return null;const s=function(t){try{return o.getUint32(t,!0)}catch{return o=new DataView(n.buffer),o.getUint32(t,!0)}}(e-4)>>>i,r=new Array(s);for(let n=0;n>>0));return r}(a,0,s.read(t,i,e,r)>>>0))},s);function h(t){if(!t)return null;const i=t+new Uint32Array(n.buffer)[t-4>>>2]>>>1,e=new Uint16Array(n.buffer);let s=t>>>1,r="";for(;i-s>1024;)r+=String.fromCharCode(...e.subarray(s,s+=1024));return r+String.fromCharCode(...e.subarray(s,i))}let o=new DataView(n.buffer);function l(t,i){try{o.setUint8(t,i,!0)}catch{o=new DataView(n.buffer),o.setUint8(t,i,!0)}}function a(t){try{return o.getInt8(t,!0)}catch{return o=new DataView(n.buffer),o.getInt8(t,!0)}}return r}e.d(i,{F:()=>s})},9896:(t,i,e)=>{var s=e(8151);!function(){window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioContext&&(window.audioContext=new window.AudioContext);var t=function(i){if(window.audioContext){var e=window.audioContext.createBuffer(1,1,22050),s=window.audioContext.createBufferSource();s.buffer=e,s.connect(window.audioContext.destination),s.start?s.start(0):s.play?s.play(0):s.noteOn&&s.noteOn(0)}document.removeEventListener('touchstart',t),document.removeEventListener('touchend',t),document.removeEventListener('click',t)};document.addEventListener('touchstart',t),document.addEventListener('touchend',t),document.addEventListener('click',t)}(),(async()=>{let t=new Float32Array,i=window.audioContext.createGain();i.gain.value=.1,i.connect(window.audioContext.destination);let e=window.audioContext.currentTime,n=[];const r=new s.A({ER:30,vR:i=>{let e=new Float32Array(i.buffer),s=new Float32Array(t.length+e.length);s.set(t,0),s.set(e,t.length),t=s},bR:t=>{},bufferSize:102400});await r.init();const h=await fetch('./SCC1_Florestan.sf2'),o=new Uint8Array(await h.arrayBuffer());function l(){if(!window.audioContext||!t.length)return;let s=window.audioContext.createBufferSource();const r=t.length/2,h=window.audioContext.createBuffer(2,r,44100);for(let i=0;i<2;i++){const e=h.getChannelData(i);let s=i;for(let i=0;i{if(a&&clearInterval(a),t=new Float32Array,n.length){let t=i.gain.value;i.gain.value=0,n.forEach((t=>{t.stop(window.audioContext.currentTime)})),n=[],i.gain.value=t}},window._tinyMidiVolume=(t=1)=>{i.gain.value=t},window._tinyMidiPlay=async(t,i=1)=>{t&&(await window._tinyMidiStop(),-1!=i&&window._tinyMidiVolume(i),e=window.audioContext.currentTime,a=setInterval(l,250),r.RR(t))}})()},8151:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5473);const n=class{constructor(t={}){this.OR=void 0,this.LR=0,this.SR=0,this.xR=0,this.ER=t.ER||100,this.sampleRate=t.sampleRate||44100,this.MR=t.MR||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.kR(1),this.vR=t.vR||(()=>{}),this.bR=t.bR||(()=>{}),this.DR=void 0,this.test=0}async init(){if(!this.OR){if('undefined'!=typeof process){const{NR:t}=await import('path'),{FR:i}=await import('module');globalThis.__dirname=t("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js"),globalThis.require=i("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js")}this.OR=await(0,s.A)(),this.BR=this.OR._malloc(this.bufferSize),this.UR=this.OR._malloc(8)}}kR(t){this.bufferSize=4*this.sampleRate*this.MR*t}PR(){if(!this.OR)throw new Error(`${this.constructor.name} not initalized. call .init()`)}TR(t){this.PR();const{_malloc:i,_free:e,_tsf_load_memory:s,_tsf_set_output:n,_tsf_channel_set_bank_preset:r,_tsf_set_max_voices:h,_tsf_channel_set_presetnumber:o}=this.OR;e(this.LR),this.LR=i(t.length),this.OR.HEAPU8.set(t,this.LR),this.SR=s(this.LR,t.length),n(this.SR,2===this.MR?0:2,this.sampleRate,this.gain)}GR(){this.PR();const t=new Uint8Array(this.bufferSize);return t.set(this.OR.HEAPU8.subarray(this.BR,this.BR+this.bufferSize)),t}WR(t){const{_malloc:i,_free:e,_tml_load_memory:s}=this.OR;return e(this.xR),this.xR=i(t.length),this.OR.HEAPU8.set(t,this.xR),s(this.xR,t.length)}YR(t){const{_midi_render:i}=this.OR;return i(this.SR,t,this.MR,this.sampleRate,this.BR,this.bufferSize,this.UR)}RR(t){if(this.PR(),!this.SR)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.DR);const{setValue:i,getValue:e}=this.OR;i(this.UR,0,'double'),this.OR._tsf_reset(this.SR),this.OR._tsf_channel_set_bank_preset(this.SR,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let s=this.WR(t);const n=()=>{s=this.YR(s);const t=this.GR();this.vR(t),s?this.DR=setTimeout(n,this.ER):this.bR(e(this.UR,'double'))};this.DR=setTimeout(n,16)}}},8227:(t,i,e)=>{t.exports=e.p+"9f86b5397894e28b5ae2.wasm"},5473:(t,i,e)=>{var s;e.d(i,{A:()=>n});const n=(s="file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/tinymidipcm.mjs",function(t){var i,n,r=void 0!==(t=t||{})?t:{};r.ready=new Promise((function(t,e){i=t,n=e})),["_tsf_load_memory","_tsf_set_output","_tsf_channel_set_bank_preset","_tsf_set_max_voices","_tsf_channel_set_presetnumber","_tsf_reset","_tsf_close","_tml_load_memory","_midi_render","_malloc","_realloc","_free","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(r.ready,t)||Object.defineProperty(r.ready,t,{get:()=>j('You are getting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),set:()=>j('You are setting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js')})}));var h=Object.assign({},r),o=[],l='object'==typeof window,a='function'==typeof importScripts,c='object'==typeof process&&'object'==typeof process.versions&&'string'==typeof process.versions.node,f=!l&&!c&&!a;if(r.ENVIRONMENT)throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');var u,d,w,y='';if(c){if('undefined'==typeof process||!process.release||'node'!==process.release.name)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');var A,m;y=a?require('path').NR(y)+'/':__dirname+'/';var p=()=>{m||(A=require('fs'),m=require('path'))};u=(t,i)=>(p(),t=m.normalize(t),A.HR(t,i?void 0:'utf8')),w=t=>{var i=u(t,!0);return i.buffer||(i=new Uint8Array(i)),D(i.buffer),i},d=(t,i,e)=>{p(),t=m.normalize(t),A.VR(t,(function(t,s){t?e(t):i(s.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,'/'),o=process.argv.slice(2),process.on('uncaughtException',(function(t){if(!(t instanceof nt))throw t})),process.on('unhandledRejection',(function(t){throw t})),r.inspect=function(){return'[Emscripten Module object]'}}else if(f){if('object'==typeof process&&'function'==typeof require||'object'==typeof window||'function'==typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');'undefined'!=typeof read&&(u=function(t){return read(t)}),w=function(t){let i;return'function'==typeof readbuffer?new Uint8Array(readbuffer(t)):(i=read(t,'binary'),D('object'==typeof i),i)},d=function(t,i,e){setTimeout((()=>i(w(t))),0)},'undefined'!=typeof scriptArgs?o=scriptArgs:void 0!==arguments&&(o=arguments),'undefined'!=typeof print&&('undefined'==typeof console&&(console={}),console.log=print,console.warn=console.error='undefined'!=typeof printErr?printErr:print)}else{if(!l&&!a)throw new Error('environment detection error');if(a?y=self.location.href:'undefined'!=typeof document&&document.currentScript&&(y=document.currentScript.src),s&&(y=s),y=0!==y.indexOf('blob:')?y.substr(0,y.replace(/[?#].*/,"").lastIndexOf('/')+1):'','object'!=typeof window&&'function'!=typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');u=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.send(null),i.responseText},a&&(w=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.responseType='arraybuffer',i.send(null),new Uint8Array(i.response)}),d=(t,i,e)=>{var s=new XMLHttpRequest;s.open('GET',t,!0),s.responseType='arraybuffer',s.onload=()=>{200==s.status||0==s.status&&s.response?i(s.response):e()},s.onerror=e,s.send(null)}}r.print||console.log.bind(console);var _,I,g=r.printErr||console.warn.bind(console);function C(t,i){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){j('Module.'+t+' has been replaced with plain '+i+' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')}})}function E(t){return'FS_createPath'===t||'FS_createDataFile'===t||'FS_createPreloadedFile'===t||'FS_unlink'===t||'addRunDependency'===t||'FS_createLazyFile'===t||'FS_createDevice'===t||'removeRunDependency'===t}Object.assign(r,h),h=null,_='fetchSettings',Object.getOwnPropertyDescriptor(r,_)&&j('`Module.'+_+'` was supplied but `'+_+'` not included in INCOMING_MODULE_JS_API'),r.arguments&&(o=r.arguments),C('arguments','arguments_'),r.thisProgram&&r.thisProgram,C('thisProgram','thisProgram'),r.quit&&r.quit,C('quit','quit_'),D(void 0===r.memoryInitializerPrefixURL,'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.pthreadMainPrefixURL,'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.cdInitializerPrefixURL,'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.filePackagePrefixURL,'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.read,'Module.read option was removed (modify read_ in JS)'),D(void 0===r.readAsync,'Module.readAsync option was removed (modify readAsync in JS)'),D(void 0===r.readBinary,'Module.readBinary option was removed (modify readBinary in JS)'),D(void 0===r.setWindowTitle,'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'),D(void 0===r.TOTAL_MEMORY,'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'),C('read','read_'),C('readAsync','readAsync'),C('readBinary','readBinary'),C('setWindowTitle','setWindowTitle'),D(!f,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),r.wasmBinary&&(I=r.wasmBinary),C('wasmBinary','wasmBinary');var v;r.noExitRuntime;C('noExitRuntime','noExitRuntime'),'object'!=typeof WebAssembly&&j('no native wasm support detected');var b,T,R,O,L,S,x,M,k=!1;function D(t,i){t||j('Assertion failed'+(i?': '+i:''))}function N(t){b=t,r.HEAP8=T=new Int8Array(t),r.HEAP16=O=new Int16Array(t),r.HEAP32=L=new Int32Array(t),r.HEAPU8=R=new Uint8Array(t),r.HEAPU16=new Uint16Array(t),r.HEAPU32=S=new Uint32Array(t),r.HEAPF32=x=new Float32Array(t),r.HEAPF64=M=new Float64Array(t)}'undefined'!=typeof TextDecoder&&new TextDecoder('utf8');var F=5242880;r.TOTAL_STACK&&D(F===r.TOTAL_STACK,'the stack size can no longer be determined at runtime');var B=r.INITIAL_MEMORY||16777216;function U(){if(!k){var t=ft(),i=S[t>>2],e=S[t+4>>2];34821223==i&&2310721022==e||j('Stack overflow! Stack cookie has been overwritten at 0x'+t.toString(16)+', expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+e.toString(16)+' 0x'+i.toString(16)),1668509029!==S[0]&&j('Runtime error: The application has corrupted its heap memory area (address zero)!')}}C('INITIAL_MEMORY','INITIAL_MEMORY'),D(B>=F,'INITIAL_MEMORY should be larger than TOTAL_STACK, was '+B+'! (TOTAL_STACK='+F+')'),D('undefined'!=typeof Int32Array&&'undefined'!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,'JS engine does not provide full typed array support'),D(!r.wasmMemory,'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'),D(16777216==B,'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'),function(){var t=new Int16Array(1),i=new Int8Array(t.buffer);if(t[0]=25459,115!==i[0]||99!==i[1])throw'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'}();var P=[],G=[],W=[],Y=!1;D(Math.imul,'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.fround,'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.clz32,'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.trunc,'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');var H=0,V=null,K=null,X={};function j(t){r.onAbort&&r.onAbort(t),g(t='Aborted('+t+')'),k=!0;var i=new WebAssembly.RuntimeError(t);throw n(i),i}var z={error:function(){j('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM')},init:function(){z.error()},KR:function(){z.error()},XR:function(){z.error()},jR:function(){z.error()},open:function(){z.error()},zR:function(){z.error()},ZR:function(){z.error()},qR:function(){z.error()},JR:function(){z.error()},$R:function(){z.error()}};r.FS_createDataFile=z.KR,r.FS_createPreloadedFile=z.XR;var Z,q,J,$,Q='data:application/octet-stream;base64,';function tt(t){return t.startsWith(Q)}function it(t){return t.startsWith('file://')}function et(t,i){return function(){var e=t,s=i;return i||(s=r.asm),D(Y,'native function `'+e+'` called before runtime initialization'),s[t]||D(s[t],'exported native function `'+e+'` not found'),s[t].apply(null,arguments)}}function st(t){try{if(t==Z&&I)return new Uint8Array(I);if(w)return w(t);throw"both async and sync fetching of the wasm failed"}catch(t){j(t)}}function nt(t){this.name='ExitStatus',this.message='Program terminated with exit('+t+')',this.status=t}function rt(t){for(;t.length>0;)t.shift()(r)}function ht(t){ht.QR||(ht.QR={}),ht.QR[t]||(ht.QR[t]=1,c&&(t='warning: '+t),g(t))}function ot(t){try{return v.tO(t-b.byteLength+65535>>>16),N(v.buffer),1}catch(i){g('emscripten_realloc_buffer: Attempted to grow heap from '+b.byteLength+' bytes to '+t+' bytes, but got error: '+i)}}r.locateFile?tt(Z='tinymidipcm.wasm')||(q=Z,Z=r.locateFile?r.locateFile(q,y):y+q):Z=new URL(e(8227),e.b).toString();var lt,at={"emscripten_memcpy_big":function(t,i,e){R.copyWithin(t,i,i+e)},"emscripten_resize_heap":function(t){var i=R.length;D((t>>>=0)>i);var e,s,n=2147483648;if(t>n)return g('Cannot enlarge memory, asked to go up to '+t+' bytes, but the limit is '+n+' bytes!'),!1;for(var r=1;r<=4;r*=2){var h=i*(1+.2/r);h=Math.min(h,t+100663296);var o=Math.min(n,(e=Math.max(t,h))+((s=65536)-e%s)%s);if(ot(o))return!0}return g('Failed to grow the heap from '+i+' bytes to '+o+' bytes, not enough memory!'),!1}},ct=(function(){var t,i={'env':at,'wasi_snapshot_preview1':at};function e(t,i){var e,s=t.exports;r.asm=s,D(v=r.asm.memory,"memory not found in wasm exports"),N(v.buffer),D(r.asm.__indirect_function_table,"table not found in wasm exports"),e=r.asm.__wasm_call_ctors,G.unshift(e),function(t){if(H--,r.monitorRunDependencies&&r.monitorRunDependencies(H),t?(D(X[t]),delete X[t]):g('warning: run dependency removed without ID'),0==H&&(null!==V&&(clearInterval(V),V=null),K)){var i=K;K=null,i()}}('wasm-instantiate')}t='wasm-instantiate',H++,r.monitorRunDependencies&&r.monitorRunDependencies(H),t?(D(!X[t]),X[t]=1,null===V&&'undefined'!=typeof setInterval&&(V=setInterval((function(){if(k)return clearInterval(V),void(V=null);var t=!1;for(var i in X)t||(t=!0,g('still waiting on run dependencies:')),g('dependency: '+i);t&&g('(end of list)')}),1e4))):g('warning: run dependency added without ID');var s=r;function h(t){D(r===s,'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'),s=null,e(t.instance)}function o(t){return function(){if(!I&&(l||a)){if('function'==typeof fetch&&!it(Z))return fetch(Z,{credentials:'same-origin'}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+Z+"'";return t.arrayBuffer()})).catch((function(){return st(Z)}));if(d)return new Promise((function(t,i){d(Z,(function(i){t(new Uint8Array(i))}),i)}))}return Promise.resolve().then((function(){return st(Z)}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){g('failed to asynchronously prepare wasm: '+t),it(Z)&&g('warning: Loading from a file URI ('+Z+') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing'),j(t)}))}if(r.instantiateWasm)try{return r.instantiateWasm(i,e)}catch(t){g('Module.instantiateWasm callback failed with error: '+t),n(t)}(I||'function'!=typeof WebAssembly.instantiateStreaming||tt(Z)||it(Z)||c||'function'!=typeof fetch?o(h):fetch(Z,{credentials:'same-origin'}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(h,(function(t){return g('wasm streaming compile failed: '+t),g('falling back to ArrayBuffer instantiation'),o(h)}))}))).catch(n)}(),r.___wasm_call_ctors=et("__wasm_call_ctors"),r._malloc=et("malloc"),r._free=et("free"),r._tsf_load_memory=et("tsf_load_memory"),r._tsf_close=et("tsf_close"),r._tsf_reset=et("tsf_reset"),r._tsf_set_output=et("tsf_set_output"),r._tsf_set_max_voices=et("tsf_set_max_voices"),r._realloc=et("realloc"),r._tsf_channel_set_presetnumber=et("tsf_channel_set_presetnumber"),r._tsf_channel_set_bank_preset=et("tsf_channel_set_bank_preset"),r._tml_load_memory=et("tml_load_memory"),r._midi_render=et("midi_render"),r.___errno_location=et("__errno_location"),r._fflush=et("fflush"),r._emscripten_stack_init=function(){return(ct=r._emscripten_stack_init=r.asm.emscripten_stack_init).apply(null,arguments)}),ft=(r._emscripten_stack_get_free=function(){return(r._emscripten_stack_get_free=r.asm.emscripten_stack_get_free).apply(null,arguments)},r._emscripten_stack_get_base=function(){return(r._emscripten_stack_get_base=r.asm.emscripten_stack_get_base).apply(null,arguments)},r._emscripten_stack_get_end=function(){return(ft=r._emscripten_stack_get_end=r.asm.emscripten_stack_get_end).apply(null,arguments)});function ut(){var t;ct(),D(!(3&(t=ft()))),S[t>>2]=34821223,S[t+4>>2]=2310721022,S[0]=1668509029}function dt(t){function e(){lt||(lt=!0,r.calledRun=!0,k||(D(!Y),Y=!0,U(),rt(G),i(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),D(!r._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(U(),r.postRun)for('function'==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)t=r.postRun.shift(),W.unshift(t);var t;rt(W)}()))}t=t||o,H>0||(ut(),function(){if(r.preRun)for('function'==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)t=r.preRun.shift(),P.unshift(t);var t;rt(P)}(),H>0||(r.setStatus?(r.setStatus('Running...'),setTimeout((function(){setTimeout((function(){r.setStatus('')}),1),e()}),1)):e(),U()))}if(r.stackSave=et("stackSave"),r.stackRestore=et("stackRestore"),r.stackAlloc=et("stackAlloc"),r.setValue=function(t,i,e="i8"){switch(e.endsWith('*')&&(e='*'),e){case'i1':case'i8':T[0|t]=i;break;case'i16':O[t>>1]=i;break;case'i32':L[t>>2]=i;break;case'i64':$=[i>>>0,(J=i,+Math.abs(J)>=1?J>0?(0|Math.min(+Math.floor(J/4294967296),4294967295))>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],L[t>>2]=$[0],L[t+4>>2]=$[1];break;case'float':x[t>>2]=i;break;case'double':M[t>>3]=i;break;case'*':S[t>>2]=i;break;default:j('invalid type for setValue: '+e)}},r.getValue=function(t,i="i8"){switch(i.endsWith('*')&&(i='*'),i){case'i1':case'i8':return T[0|t];case'i16':return O[t>>1];case'i32':case'i64':return L[t>>2];case'float':return x[t>>2];case'double':return M[t>>3];case'*':return S[t>>2];default:j('invalid type for getValue: '+i)}return null},['run','UTF8ArrayToString','UTF8ToString','stringToUTF8Array','stringToUTF8','lengthBytesUTF8','addOnPreRun','addOnInit','addOnPreMain','addOnExit','addOnPostRun','addRunDependency','removeRunDependency','FS_createFolder','FS_createPath','FS_createDataFile','FS_createPreloadedFile','FS_createLazyFile','FS_createLink','FS_createDevice','FS_unlink','getLEB','getFunctionTables','alignFunctionTables','registerFunctions','prettyPrint','getCompilerSetting','print','printErr','callMain','abort','keepRuntimeAlive','wasmMemory','stackAlloc','stackSave','stackRestore','getTempRet0','setTempRet0','writeStackCookie','checkStackCookie','ptrToString','zeroMemory','stringToNewUTF8','exitJS','getHeapMax','emscripten_realloc_buffer','ENV','ERRNO_CODES','ERRNO_MESSAGES','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','DNS','getHostByName','Protocols','Sockets','getRandomDevice','warnOnce','traverseStack','UNWIND_CACHE','convertPCtoSourceLocation','readAsmConstArgsArray','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','handleException','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','freeTableIndexes','functionsInTableMap','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','PATH','PATH_FS','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16Decoder','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeArrayToMemory','writeAsciiToMemory','SYSCALLS','getSocketFromFD','getSocketAddress','JSEvents','registerKeyEventCallback','specialHTMLTargets','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','currentFullscreenStrategy','restoreOldWindowedStyle','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','demangle','demangleAll','jsStackTrace','stackTrace','ExitStatus','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','dlopenMissingError','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','uncaughtExceptionCount','exceptionLast','exceptionCaught','ExceptionInfo','exception_addRef','exception_decRef','Browser','setMainLoop','wget','FS','MEMFS','TTY','PIPEFS','SOCKFS','_setNetworkCallback','tempFixedLengthArray','miniTempWebGLFloatBuffers','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','GL','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','AL','SDL_unicode','SDL_ttfContext','SDL_audio','SDL','SDL_gfx','GLUT','EGL','GLFW_Window','GLFW','GLEW','IDBStore','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){var i="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),j(i)}})})),['ptrToString','zeroMemory','stringToNewUTF8','exitJS','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','getHostByName','getRandomDevice','traverseStack','convertPCtoSourceLocation','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeAsciiToMemory','getSocketFromFD','getSocketAddress','registerKeyEventCallback','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','ExceptionInfo','exception_addRef','exception_decRef','setMainLoop','_setNetworkCallback','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','SDL_unicode','SDL_ttfContext','SDL_audio','GLFW_Window','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){'undefined'==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var i='`'+t+'` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line';E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),ht(i)}})})),K=function t(){lt||dt(),lt||(K=t)},r.preInit)for('function'==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return dt(),t.ready})}},r={};function h(t){var i=r[t];if(void 0!==i)return i.exports;var e=r[t]={exports:{}};return n[t](e,e.exports,h),e.exports}h.m=n,t="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",i="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",e="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",s=t=>{t&&t.d<1&&(t.d=1,t.forEach((t=>t.r--)),t.forEach((t=>t.r--?t.r++:t())))},h.a=(n,r,h)=>{var o;h&&((o=[]).d=-1);var l,a,c,f=new Set,u=n.exports,d=new Promise(((t,i)=>{c=i,a=t}));d[i]=u,d[t]=t=>(o&&t(o),f.forEach(t),d.catch((t=>{}))),n.exports=d,r((n=>{var r;l=(n=>n.map((n=>{if(null!==n&&"object"==typeof n){if(n[t])return n;if(n.then){var r=[];r.d=0,n.then((t=>{h[i]=t,s(r)}),(t=>{h[e]=t,s(r)}));var h={};return h[t]=t=>t(r),h}}var o={};return o[t]=t=>{},o[i]=n,o})))(n);var h=()=>l.map((t=>{if(t[e])throw t[e];return t[i]})),a=new Promise((i=>{(r=()=>i(h)).r=0;var e=t=>t!==o&&!f.has(t)&&(f.add(t),t&&!t.d&&(r.r++,t.push(r)));l.map((i=>i[t](e)))}));return r.r?a:h()}),(t=>(t?c(d[e]=t):a(u),s(o)))),o&&o.d<0&&(o.d=0)},h.d=(t,i)=>{for(var e in i)h.o(i,e)&&!h.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:i[e]})},h.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),h.p="/Client2/",h.b=document.baseURI||self.location.href;h(7608)})(); \ No newline at end of file diff --git a/viewer.js b/viewer.js index c76b7ea7..18974df0 100644 --- a/viewer.js +++ b/viewer.js @@ -1 +1 @@ -(()=>{"use strict";var t={7444:(t,i,e)=>{t.exports=e.p+"0c791968973e1f25c170.wasm"},8227:(t,i,e)=>{t.exports=e.p+"9f86b5397894e28b5ae2.wasm"}},i={};function e(s){var n=i[s];if(void 0!==n)return n.exports;var r=i[s]={exports:{}};return t[s](r,r.exports,e),r.exports}e.m=t,e.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),e.p="/Client2/",e.b=document.baseURI||self.location.href,(()=>{async function t(t,i={}){const e={env:Object.assign(Object.create(globalThis),i.env||{},{abort(t,i,e,s){t=h(t>>>0),i=h(i>>>0),e>>>=0,s>>>=0,(()=>{throw Error(`${t} in ${i}:${e}:${s}`)})()}})},{exports:s}=await WebAssembly.instantiate(t,e),n=s.memory||i.env.memory,r=Object.setPrototypeOf({read:(t,i,e,r)=>(i=function(t,i,e,r,h){if(null==r)return 0;const o=r.length,l=s.__pin(s.__new(o<>>0;if(h)new h(n.buffer,l,o).set(r);else for(let i=0;i>>0),r[i]);return s.__unpin(l),l}(l,6,0,i,Int8Array)||function(){throw TypeError("value must not be null")}(),function(t,i,e){if(!e)return null;const s=function(t){try{return o.getUint32(t,!0)}catch{return o=new DataView(n.buffer),o.getUint32(t,!0)}}(e-4)>>>i,r=new Array(s);for(let n=0;n>>0));return r}(a,0,s.read(t,i,e,r)>>>0))},s);function h(t){if(!t)return null;const i=t+new Uint32Array(n.buffer)[t-4>>>2]>>>1,e=new Uint16Array(n.buffer);let s=t>>>1,r="";for(;i-s>1024;)r+=String.fromCharCode(...e.subarray(s,s+=1024));return r+String.fromCharCode(...e.subarray(s,i))}let o=new DataView(n.buffer);function l(t,i){try{o.setUint8(t,i,!0)}catch{o=new DataView(n.buffer),o.setUint8(t,i,!0)}}function a(t){try{return o.getInt8(t,!0)}catch{return o=new DataView(n.buffer),o.getInt8(t,!0)}}return r}class i{static tt=null;static load=async i=>{this.tt=await t(new WebAssembly.Module(i),{env:void 0})};static read=(t,i,e,s)=>{if(!this.tt)throw new Error('bz2 not found!!');return Int8Array.from(this.tt.read(t,i,e,s))}}let s;function n(t,i){return s=t.exports,r.it=i,s}async function r(t){void 0===t&&(t=new URL(e(7444),e.b));const i={et:{}};('string'==typeof t||'function'==typeof Request&&t instanceof Request||'function'==typeof URL&&t instanceof URL)&&(t=fetch(t));const{instance:s,module:r}=await async function(t,i){if('function'==typeof Response&&t instanceof Response){if('function'==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(t,i)}catch(i){if('application/wasm'==t.headers.get('Content-Type'))throw i;console.warn('`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n',i)}const e=await t.arrayBuffer();return await WebAssembly.instantiate(e,i)}{const e=await WebAssembly.instantiate(t,i);return e instanceof WebAssembly.Instance?{instance:e,module:t}:e}}(await t,i);return n(s,r)}let h=null,o=!1;class l extends Error{constructor(t){super(t),this.name='DecompressionError'}}let a=0,c=null,f=null;function u(t,i,e){let s;if(e){const n=i;s=t.st(n);const r=new Uint8Array(t.memory.buffer,s,n);try{e(r)}catch(i){throw t.nt(s,n),i}return a=n,s}if('string'==typeof i){const e=a=function(t){let i=0,e=0,s=0;const n=t.length;for(;i{this.ft=t,this.ut=i,this.dt=e,this._t(0,0,i,e)};static It=()=>{this.left=0,this.top=0,this.right=this.ut,this.bottom=this.dt,this.wt=this.right-1,this.yt=this.right/2|0};static _t=(t,i,e,s)=>{t<0&&(t=0),i<0&&(i=0),e>this.ut&&(e=this.ut),s>this.dt&&(s=this.dt),this.top=i,this.bottom=s,this.left=t,this.right=e,this.wt=this.right-1,this.yt=this.right/2|0,this.At=this.bottom/2|0};static clear=()=>{const t=this.ut*this.dt;for(let i=0;i{this.Ct(t,i,n,e),this.Ct(t,i+s-1,n,e),this.Et(t,i,n,s),this.Et(t+e-1,i,n,s)};static Ct=(t,i,e,s)=>{if(i=this.bottom)return;tthis.right&&(s=this.right-t);const n=t+i*this.ut;for(let t=0;t{if(t=this.right)return;ithis.bottom&&(s=this.bottom-i);const n=t+i*this.ut;for(let t=0;t{const r=Math.abs(e-t),h=Math.abs(s-i),o=t=this.left&&t=this.top&&i-h&&(a-=h,t+=o),e{tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const r=this.ut-e;let h=t+i*this.ut;for(let t=-s;t<0;t++){for(let t=-e;t<0;t++)this.ft[h++]=n;h+=r}};static bt(t,i,e,s,n,r){tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const h=256-r,o=(n>>16&255)*r,l=(n>>8&255)*r,a=(255&n)*r,c=this.ut-e;let f=t+i*this.ut;for(let t=0;t>16&255)*h>>8<<16)+(l+(this.ft[f]>>8&255)*h>>8<<8)+(a+(255&this.ft[f])*h>>8);this.ft[f++]=t}f+=c}}static Rt(t,i,e,s,n){const r=256-n,h=(s>>16&255)*n,o=(s>>8&255)*n,l=(255&s)*n;let a=i-e;a<0&&(a=0);let c=i+e;c>=this.dt&&(c=this.dt-1);for(let s=a;s<=c;s++){const n=s-i,a=0|Math.sqrt(e*e-n*n);let c=t-a;c<0&&(c=0);let f=t+a;f>=this.ut&&(f=this.ut-1);let u=c+s*this.ut;for(let t=c;t<=f;t++){const t=(h+(this.ft[u]>>16&255)*r>>8<<16)+(o+(this.ft[u]>>8&255)*r>>8<<8)+(l+(255&this.ft[u])*r>>8);this.ft[u++]=t}}}static Ot=(t,i,e)=>{t=this.right||i=this.bottom||(this.ft[t+i*this.ut]=e)}}const A=document.getElementById('canvas'),p=A.getContext('2d',{willReadFrequently:!0}),_=document.createElement('canvas'),I=document.createElement('img'),g=_.getContext('2d',{willReadFrequently:!0});class C{vt;width;height;Lt;St;ft;constructor(t,i,e=p){this.Lt=e,this.vt=this.Lt.getImageData(0,0,t,i),this.St=new Uint32Array(this.vt.data.buffer),this.ft=new Int32Array(t*i),this.width=t,this.height=i,this.bind()}clear(){this.ft.fill(0)}bind(){m.bind(this.ft,this.width,this.height)}draw(t,i){this.#t(),this.Lt.putImageData(this.vt,t,i)}#t(){const t=this.ft.length,i=this.ft,e=this.St;for(let s=0;s>16&255|(t>>8&255)<<8|(255&t)<<16|4278190080}}}const E=async t=>new Promise((i=>setTimeout(i,t))),T=async t=>new Int8Array(await(await fetch(t)).arrayBuffer());class b{xt;cursor=null;constructor(){const t=new w;t.next=t,t.rt=t,this.xt=t}Mt(t){t.rt&&t.ht(),t.rt=this.xt.rt,t.next=this.xt,t.rt&&(t.rt.next=t),t.next.rt=t}kt(t){t.rt&&t.ht(),t.rt=this.xt,t.next=this.xt.next,t.rt.next=t,t.next&&(t.next.rt=t)}Dt(){const t=this.xt.next;return t===this.xt?null:(t?.ht(),t)}head(){const t=this.xt.next;return t===this.xt?(this.cursor=null,null):(this.cursor=t?.next||null,t)}Ft(){const t=this.xt.rt;return t===this.xt?(this.cursor=null,null):(this.cursor=t?.rt||null,t)}next(){const t=this.cursor;return t===this.xt?(this.cursor=null,null):(this.cursor=t?.next||null,t)}rt(){const t=this.cursor;return t===this.xt?(this.cursor=null,null):(this.cursor=t?.rt||null,t)}clear(){for(;;){const t=this.xt.next;if(t===this.xt)return;t?.ht()}}}class R extends y{static Nt=3988292384;static Bt=new Int32Array(256);static Ut=new Uint32Array(33);static Pt=new b;static Gt=new b;static Wt=new b;static Yt=0;static Ht=0;static Vt=0;static{for(let t=0;t<32;t++)R.Ut[t]=(1<>>=1:i=i>>>1^R.Nt;R.Bt[t]=i}}static Kt=t=>{let i=4294967295;for(let e=0;e>>8^R.Bt[255&(i^t[e])];return~i};view;data;Xt=0;jt=0;random=null;constructor(t){if(!t)throw new Error('Input src packet array was null!');super(),t instanceof Int8Array?this.data=new Uint8Array(t):this.data=t,this.view=new DataView(this.data.buffer,this.data.byteOffset,this.data.byteLength)}get length(){return this.view.byteLength}get available(){return this.length-this.Xt}static zt=t=>{let i=null;return 0===t&&R.Yt>0?(R.Yt--,i=R.Pt.Dt()):1===t&&R.Ht>0?(R.Ht--,i=R.Gt.Dt()):2===t&&R.Vt>0&&(R.Vt--,i=R.Wt.Dt()),i?(i.Xt=0,i):new R(0===t?new Uint8Array(100):1===t?new Uint8Array(5e3):new Uint8Array(3e4))};release(){this.Xt=0,100===this.view.byteLength&&R.Yt<1e3?(R.Pt.Mt(this),R.Yt++):5e3===this.view.byteLength&&R.Ht<250?(R.Gt.Mt(this),R.Ht++):3e4===this.view.byteLength&&R.Vt<50&&(R.Wt.Mt(this),R.Vt++)}get Zt(){return this.view.getUint8(this.Xt++)}get qt(){return this.view.getInt8(this.Xt++)}get Jt(){const t=this.view.getUint16(this.Xt);return this.Xt+=2,t}get $t(){const t=this.view.getInt16(this.Xt);return this.Xt+=2,t}get Qt(){const t=this.view.getUint8(this.Xt++)<<16|this.view.getUint16(this.Xt);return this.Xt+=2,t}get ti(){const t=this.view.getInt32(this.Xt);return this.Xt+=4,t}get ii(){const t=this.view.getBigInt64(this.Xt);return this.Xt+=8,t}get ei(){return this.view.getUint8(this.Xt)<128?this.Zt-64:this.Jt-49152}get si(){return this.view.getUint8(this.Xt)<128?this.Zt:this.Jt-32768}get ni(){const t=this.view,i=t.byteLength;let e,s='';for(;10!==(e=t.getUint8(this.Xt++))&&this.Xt>16),this.view.setUint16(this.Xt,t),this.Xt+=2}p4(t){this.view.setInt32(this.Xt,t),this.Xt+=4}ai(t){this.view.setInt32(this.Xt,t,!0),this.Xt+=4}ci(t){this.view.setBigInt64(this.Xt,t),this.Xt+=8}fi(t){const i=this.view,e=t.length;for(let s=0;s>>3,e=8-(7&this.jt),s=0;for(this.jt+=t;t>e;e=8)s+=(this.view.getUint8(i++)&R.Ut[e])<>>e-t&R.Ut[t],s}Ai(t,i){const e=this.Xt;this.Xt=0;const s=new Uint8Array(e);this.ri(e,0,s);const n=function(t){const i=[];for(;t>0n;)i.unshift(Number(0xffn&t)),t>>=8n;return 128&i[0]&&i.unshift(0),new Uint8Array(i)}(function(t,i,e){let s=1n;for(;i>0n;)i%2n===1n&&(s=s*t%e),t=t*t%e,i>>=1n;return s}(function(t){let i=0n;for(let e=0;e{const s=new R(t.read(i+'.dat')),n=new R(t.read('index.dat'));n.Xt=s.Jt;const r=n.Jt,h=n.Jt,o=n.Zt,l=new Int32Array(o);for(let t=1;ts.length||n.Xt>n.length)throw new Error;const a=n.Zt,c=n.Zt,f=n.Jt,u=n.Jt,d=new O(f,u,l);d.pi=a,d._i=c,d.Ii=r,d.gi=h;const w=d.ft,y=n.Zt;if(0===y){const t=d.width*d.height;for(let i=0;im.bottom&&(n-=i+n-m.bottom),tm.right){const i=t+r-m.right;r-=i,o+=i,h+=i}r>0&&n>0&&this.Ei(r,n,this.ft,s,o,m.ft,e,h)}Ti(){const t=this.ft,i=this.width,e=this.height;for(let s=0;s>16&255;n+=t,n<0?n=0:n>255&&(n=255);let r=this.palette[s]>>8&255;r+=i,r<0?r=0:r>255&&(r=255);let h=255&this.palette[s];h+=e,h<0?h=0:h>255&&(h=255),this.palette[s]=(n<<16)+(r<<8)+h}}Ri(){this.Ii|=0,this.gi|=0,this.Ii/=2,this.gi/=2,this.Ii|=0,this.gi|=0;const t=new Int8Array(this.Ii*this.gi);let i=0;for(let e=0;e>1)+(e+this._i>>1)*this.Ii]=this.ft[i++];this.ft=t,this.width=this.Ii,this.height=this.gi,this.pi=0,this._i=0}Oi(){if(this.width===this.Ii&&this.height===this.gi)return;const t=new Int8Array(this.Ii*this.gi);let i=0;for(let e=0;e>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=e[s++];0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t]}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=this.palette[255&t]}h+=o,s+=n}}clip(t,i,e,s){try{const n=this.width;this.height;let r=0,h=0;const o=this.Ii,l=this.gi,a=(o<<16)/e|0,c=(l<<16)/s|0;t=t+(this.pi*e+o-1)/o|0,i=i+(this._i*s+l-1)/l|0,this.pi*e%o!=0&&(r=(o-this.pi*e%o<<16)/e|0),this._i*s%l!=0&&(h=(l-this._i*s%l<<16)/s|0),e=e*(this.width-(r>>16))/o|0,s=s*(this.height-(h>>16))/l|0;let f,u=t+i*m.ut,d=m.ut-e;im.bottom&&(s-=i+s-m.bottom),tm.right&&(f=t+e-m.right,e-=f,d+=f),this.vi(m.ft,this.ft,this.palette,r,h,u,d,e,s,a,c,n)}catch(t){console.log('error in sprite clipping routine')}}vi(t,i,e,s,n,r,h,o,l,a,c,f){try{const u=s;for(let d=-l;d<0;d++){const l=(n>>16)*f;for(let n=-o;n<0;n++){const n=i[(s>>16)+l];0==n?r++:t[r++]=e[255&n],s+=a}n+=c,s=u,r+=h}}catch(t){console.log('error in plot_scale')}}}class v extends Array{constructor(t,i){super(t);for(let e=0;e{this.Si=null,this.Si=null,this.sin=null,this.cos=null,this.Di=null,this.Mi=null,this.Xi=null,this.ji=null,this.Pi=null,this.Gi=null,this.Hi=null,this.palette=null,this.Vi=null,console.log('Draw3D unloaded!')};static Zi=()=>{this.Di=new Int32Array(this.dt);for(let t=0;t{this.Di=new Int32Array(i);for(let e=0;e{this.Pi=null,this.Gi.fill(null)};static $i=t=>{this.ki=0;for(let i=0;i<50;i++)try{this.Mi[i]=O.Ci(t,i.toString()),this.Li&&128===this.Mi[i]?.Ii?this.Mi[i]?.Ri():this.Mi[i]?.Oi(),this.ki++}catch(t){}};static Qi=t=>{if(0!==this.ji[t])return this.ji[t];const i=this.Vi[t];if(!i)return 0;let e=0,s=0,n=0;const r=i.length;for(let t=0;t>16&255,s+=i[t]>>8&255,n+=255&i[t];let h=(e/r<<16)+(s/r<<8)+(n/r|0);return h=this.te(h,1.4),0===h&&(h=1),this.ji[t]=h,h};static ie=t=>{const i=t+.03*Math.random()-.015;let e=0;for(let t=0;t<512;t++){const s=(t/8|0)/64+.0078125,n=(7&t)/8+.0625;for(let t=0;t<128;t++){const r=t/128;let h=r,o=r,l=r;if(0!==n){let t;t=r<.5?r*(n+1):r+n-r*n;const i=2*r-t;let e=s+.3333333333333333;e>1&&e--;let a=s-.3333333333333333;a<0&&a++,h=6*e<1?i+6*(t-i)*e:2*e<1?t:3*e<2?i+(t-i)*(.6666666666666666-e)*6:i,o=6*s<1?i+6*(t-i)*s:2*s<1?t:3*s<2?i+(t-i)*(.6666666666666666-s)*6:i,l=6*a<1?i+6*(t-i)*a:2*a<1?t:3*a<2?i+(t-i)*(.6666666666666666-a)*6:i}const a=((256*h|0)<<16)+((256*o|0)<<8)+(256*l|0);this.palette[e++]=this.te(a,i)}}for(let t=0;t<50;t++){const e=this.Mi[t];if(!e)continue;const s=e.palette;this.Vi[t]=new Int32Array(s.length);for(let e=0;e{const e=(t>>16)/256,s=(t>>8&255)/256,n=(255&t)/256;return((256*Math.pow(e,i)|0)<<16)+((256*Math.pow(s,i)|0)<<8)+(256*Math.pow(n,i)|0)};static se=t=>{this.Pi||(this.Wi=t,this.Li?this.Pi=new k(t,16384):this.Pi=new k(t,65536),this.Gi.fill(null))};static ne=(t,i,e,s,n,r,h,o,l)=>{let a=0,c=0;n!==s&&(a=(i-t<<16)/(n-s)|0,c=(o-h<<15)/(n-s)|0);let f=0,u=0;r!==n&&(f=(e-i<<16)/(r-n)|0,u=(l-o<<15)/(r-n)|0);let d=0,w=0;if(r!==s&&(d=(t-e<<16)/(s-r)|0,w=(h-l<<15)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),nf)for(r-=n,n-=s,s=this.Di[s];;){if(--n<0)for(;;){if(--r<0)return;this.re(e>>16,i>>16,l>>7,o>>7,this.ft,s,0),e+=d,i+=f,l+=w,o+=u,s+=this.ut}this.re(e>>16,t>>16,l>>7,h>>7,this.ft,s,0),e+=d,t+=a,l+=w,h+=c,s+=this.ut}else for(r-=n,n-=s,s=this.Di[s];;){if(--n<0)for(;;){if(--r<0)return;this.re(i>>16,e>>16,o>>7,l>>7,this.ft,s,0),e+=d,i+=f,l+=w,o+=u,s+=this.ut}this.re(t>>16,e>>16,h>>7,l>>7,this.ft,s,0),e+=d,t+=a,l+=w,h+=c,s+=this.ut}else if(i=t<<=16,o=h<<=15,s<0&&(i-=d*s,t-=a*s,o-=w*s,h-=c*s,s=0),e<<=16,l<<=15,r<0&&(e-=f*r,l-=u*r,r=0),s!==r&&da)for(n-=r,r-=s,s=this.Di[s];;){if(--r<0)for(;;){if(--n<0)return;this.re(e>>16,t>>16,l>>7,h>>7,this.ft,s,0),e+=f,t+=a,l+=u,h+=c,s+=this.ut}this.re(i>>16,t>>16,o>>7,h>>7,this.ft,s,0),i+=d,t+=a,o+=w,h+=c,s+=this.ut}else for(n-=r,r-=s,s=this.Di[s];;){if(--r<0)for(;;){if(--n<0)return;this.re(t>>16,e>>16,h>>7,l>>7,this.ft,s,0),e+=f,t+=a,l+=u,h+=c,s+=this.ut}this.re(t>>16,i>>16,h>>7,o>>7,this.ft,s,0),i+=d,t+=a,o+=w,h+=c,s+=this.ut}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),rd)for(s-=r,r-=n,n=this.Di[n];;){if(--r<0)for(;;){if(--s<0)return;this.re(t>>16,e>>16,h>>7,l>>7,this.ft,n,0),t+=a,e+=d,h+=c,l+=w,n+=this.ut}this.re(t>>16,i>>16,h>>7,o>>7,this.ft,n,0),t+=a,i+=f,h+=c,o+=u,n+=this.ut}else for(s-=r,r-=n,n=this.Di[n];;){if(--r<0)for(;;){if(--s<0)return;this.re(e>>16,t>>16,l>>7,h>>7,this.ft,n,0),t+=a,e+=d,h+=c,l+=w,n+=this.ut}this.re(i>>16,t>>16,o>>7,h>>7,this.ft,n,0),t+=a,i+=f,h+=c,o+=u,n+=this.ut}else if(e=i<<=16,l=o<<=15,n<0&&(e-=a*n,i-=f*n,l-=c*n,o-=u*n,n=0),t<<=16,h<<=15,s<0&&(t-=d*s,h-=w*s,s=0),r-=s,s-=n,n=this.Di[n],a>16,i>>16,h>>7,o>>7,this.ft,n,0),t+=d,i+=f,h+=w,o+=u,n+=this.ut}this.re(e>>16,i>>16,l>>7,o>>7,this.ft,n,0),e+=a,i+=f,l+=c,o+=u,n+=this.ut}else for(;;){if(--s<0)for(;;){if(--r<0)return;this.re(i>>16,t>>16,o>>7,h>>7,this.ft,n,0),t+=d,i+=f,h+=w,o+=u,n+=this.ut}this.re(i>>16,e>>16,o>>7,l>>7,this.ft,n,0),e+=a,i+=f,l+=c,o+=u,n+=this.ut}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,o>>7,h>>7,this.ft,r,0),i+=f,t+=a,o+=u,h+=c,r+=this.ut}this.re(i>>16,e>>16,o>>7,l>>7,this.ft,r,0),i+=f,e+=d,o+=u,l+=w,r+=this.ut}else for(;;){if(--s<0)for(;;){if(--n<0)return;this.re(t>>16,i>>16,h>>7,o>>7,this.ft,r,0),i+=f,t+=a,o+=u,h+=c,r+=this.ut}this.re(e>>16,i>>16,l>>7,o>>7,this.ft,r,0),i+=f,e+=d,o+=u,l+=w,r+=this.ut}else if(t=e<<=16,h=l<<=15,r<0&&(t-=f*r,e-=d*r,h-=u*r,l-=w*r,r=0),i<<=16,o<<=15,n<0&&(i-=a*n,o-=c*n,n=0),s-=n,n-=r,r=this.Di[r],f>16,e>>16,o>>7,l>>7,this.ft,r,0),i+=a,e+=d,o+=c,l+=w,r+=this.ut}this.re(t>>16,e>>16,h>>7,l>>7,this.ft,r,0),t+=f,e+=d,h+=u,l+=w,r+=this.ut}else for(;;){if(--n<0)for(;;){if(--s<0)return;this.re(e>>16,i>>16,l>>7,o>>7,this.ft,r,0),i+=a,e+=d,o+=c,l+=w,r+=this.ut}this.re(e>>16,t>>16,l>>7,h>>7,this.ft,r,0),t+=f,e+=d,h+=u,l+=w,r+=this.ut}};static re=(t,i,e,s,n,r,h)=>{let o;if(this.Bi){let l;if(this.Ui){if(l=i-t>3?(s-e)/(i-t)|0:0,i>this.wt&&(i=this.wt),t<0&&(e-=t*l,t=0),t>=i)return;r+=t,h=i-t>>2,l<<=2}else{if(!(t>2)>0?(s-e)*this.Si[h]>>15:0}if(0===this.alpha)for(;;){if(--h<0){if((h=i-t&3)>0){o=this.palette[e>>8];do{n[r++]=o,h--}while(h>0);return}break}o=this.palette[e>>8],e+=l,n[r++]=o,n[r++]=o,n[r++]=o,n[r++]=o}else{const s=this.alpha,a=256-this.alpha;for(;;){if(--h<0){if((h=i-t&3)>0){o=this.palette[e>>8],o=((16711935&o)*a>>8&16711935)+((65280&o)*a>>8&65280);do{n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),h--}while(h>0)}break}o=this.palette[e>>8],e+=l,o=((16711935&o)*a>>8&16711935)+((65280&o)*a>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280)}}}else if(tthis.wt&&(i=this.wt),t<0&&(e-=t*l,t=0),t>=i))return;if(r+=t,h=i-t,0===this.alpha)do{n[r++]=this.palette[e>>8],e+=l,h--}while(h>0);else{const t=this.alpha,i=256-this.alpha;do{o=this.palette[e>>8],e+=l,o=((16711935&o)*i>>8&16711935)+((65280&o)*i>>8&65280),n[r++]=o+((16711935&n[r])*t>>8&16711935)+((65280&n[r])*t>>8&65280),h--}while(h>0)}}};static he=(t,i,e,s,n,r,h)=>{let o=0;n!==s&&(o=(i-t<<16)/(n-s)|0);let l=0;r!==n&&(l=(e-i<<16)/(r-n)|0);let a=0;if(r!==s&&(a=(t-e<<16)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),nl)for(r-=n,n-=s,s=this.Di[s];;){if(--n<0)for(;;){if(--r<0)return;this.oe(e>>16,i>>16,this.ft,s,h),e+=a,i+=l,s+=this.ut}this.oe(e>>16,t>>16,this.ft,s,h),e+=a,t+=o,s+=this.ut}else for(r-=n,n-=s,s=this.Di[s];;){if(--n<0)for(;;){if(--r<0)return;this.oe(i>>16,e>>16,this.ft,s,h),e+=a,i+=l,s+=this.ut}this.oe(t>>16,e>>16,this.ft,s,h),e+=a,t+=o,s+=this.ut}else if(i=t<<=16,s<0&&(i-=a*s,t-=o*s,s=0),e<<=16,r<0&&(e-=l*r,r=0),s!==r&&ao)for(n-=r,r-=s,s=this.Di[s];;){if(--r<0)for(;;){if(--n<0)return;this.oe(e>>16,t>>16,this.ft,s,h),e+=l,t+=o,s+=this.ut}this.oe(i>>16,t>>16,this.ft,s,h),i+=a,t+=o,s+=this.ut}else for(n-=r,r-=s,s=this.Di[s];;){if(--r<0)for(;;){if(--n<0)return;this.oe(t>>16,e>>16,this.ft,s,h),e+=l,t+=o,s+=this.ut}this.oe(t>>16,i>>16,this.ft,s,h),i+=a,t+=o,s+=this.ut}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),ra)for(s-=r,r-=n,n=this.Di[n];;){if(--r<0)for(;;){if(--s<0)return;this.oe(t>>16,e>>16,this.ft,n,h),t+=o,e+=a,n+=this.ut}this.oe(t>>16,i>>16,this.ft,n,h),t+=o,i+=l,n+=this.ut}else for(s-=r,r-=n,n=this.Di[n];;){if(--r<0)for(;;){if(--s<0)return;this.oe(e>>16,t>>16,this.ft,n,h),t+=o,e+=a,n+=this.ut}this.oe(i>>16,t>>16,this.ft,n,h),t+=o,i+=l,n+=this.ut}else if(e=i<<=16,n<0&&(e-=o*n,i-=l*n,n=0),t<<=16,s<0&&(t-=a*s,s=0),o>16,i>>16,this.ft,n,h),t+=a,i+=l,n+=this.ut}this.oe(e>>16,i>>16,this.ft,n,h),e+=o,i+=l,n+=this.ut}else for(r-=s,s-=n,n=this.Di[n];;){if(--s<0)for(;;){if(--r<0)return;this.oe(i>>16,t>>16,this.ft,n,h),t+=a,i+=l,n+=this.ut}this.oe(i>>16,e>>16,this.ft,n,h),e+=o,i+=l,n+=this.ut}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,this.ft,r,h),i+=l,t+=o,r+=this.ut}this.oe(i>>16,e>>16,this.ft,r,h),i+=l,e+=a,r+=this.ut}else for(n-=s,s-=r,r=this.Di[r];;){if(--s<0)for(;;){if(--n<0)return;this.oe(t>>16,i>>16,this.ft,r,h),i+=l,t+=o,r+=this.ut}this.oe(e>>16,i>>16,this.ft,r,h),i+=l,e+=a,r+=this.ut}else if(t=e<<=16,r<0&&(t-=l*r,e-=a*r,r=0),i<<=16,n<0&&(i-=o*n,n=0),l>16,e>>16,this.ft,r,h),i+=o,e+=a,r+=this.ut}this.oe(t>>16,e>>16,this.ft,r,h),t+=l,e+=a,r+=this.ut}else for(s-=n,n-=r,r=this.Di[r];;){if(--n<0)for(;;){if(--s<0)return;this.oe(e>>16,i>>16,this.ft,r,h),i+=o,e+=a,r+=this.ut}this.oe(e>>16,t>>16,this.ft,r,h),t+=l,e+=a,r+=this.ut}};static le=(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w,y,m,A,p)=>{const _=this.ae(p);this.Ki=!this.Xi[p];const I=a-u,g=c-w,C=f-m,E=d-a,T=y-c,b=A-f;let R=E*c-T*a<<14;const O=T*f-b*c<<8,v=b*a-E*f<<5;let L=I*c-g*a<<14;const S=g*f-C*c<<8,x=C*a-I*f<<5;let M=g*E-I*T<<14;const k=C*T-g*b<<8,D=I*b-C*E<<5;let F=0,N=0;n!==s&&(F=(i-t<<16)/(n-s)|0,N=(o-h<<16)/(n-s)|0);let B=0,U=0;r!==n&&(B=(e-i<<16)/(r-n)|0,U=(l-o<<16)/(r-n)|0);let P=0,G=0;if(r!==s&&(P=(t-e<<16)/(s-r)|0,G=(h-l<<16)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),nB)for(r-=n,n-=s,s=this.Di[s];;){if(--n<0)for(;;){if(--r<0)return;this.ce(e>>16,i>>16,this.ft,s,_,0,0,R,L,M,O,S,k,l>>8,o>>8),e+=P,i+=B,l+=G,o+=U,s+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(e>>16,t>>16,this.ft,s,_,0,0,R,L,M,O,S,k,l>>8,h>>8),e+=P,t+=F,l+=G,h+=N,s+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}else for(r-=n,n-=s,s=this.Di[s];;){if(--n<0)for(;;){if(--r<0)return;this.ce(i>>16,e>>16,this.ft,s,_,0,0,R,L,M,O,S,k,o>>8,l>>8),e+=P,i+=B,l+=G,o+=U,s+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(t>>16,e>>16,this.ft,s,_,0,0,R,L,M,O,S,k,h>>8,l>>8),e+=P,t+=F,l+=G,h+=N,s+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}}else{i=t<<=16,o=h<<=16,s<0&&(i-=P*s,t-=F*s,o-=G*s,h-=N*s,s=0),e<<=16,l<<=16,r<0&&(e-=B*r,l-=U*r,r=0);const a=s-this.Ni;if(R+=v*a,L+=x*a,M+=D*a,R|=0,L|=0,M|=0,(s===r||P>=F)&&(s!==r||B<=F))for(n-=r,r-=s,s=this.Di[s];;){if(--r<0)for(;;){if(--n<0)return;this.ce(t>>16,e>>16,this.ft,s,_,0,0,R,L,M,O,S,k,h>>8,l>>8),e+=B,t+=F,l+=U,h+=N,s+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(t>>16,i>>16,this.ft,s,_,0,0,R,L,M,O,S,k,h>>8,o>>8),i+=P,t+=F,o+=G,h+=N,s+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}else for(n-=r,r-=s,s=this.Di[s];;){if(--r<0)for(;;){if(--n<0)return;this.ce(e>>16,t>>16,this.ft,s,_,0,0,R,L,M,O,S,k,l>>8,h>>8),e+=B,t+=F,l+=U,h+=N,s+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(i>>16,t>>16,this.ft,s,_,0,0,R,L,M,O,S,k,o>>8,h>>8),i+=P,t+=F,o+=G,h+=N,s+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),rP)for(s-=r,r-=n,n=this.Di[n];;){if(--r<0)for(;;){if(--s<0)return;this.ce(t>>16,e>>16,this.ft,n,_,0,0,R,L,M,O,S,k,h>>8,l>>8),t+=F,e+=P,h+=N,l+=G,n+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(t>>16,i>>16,this.ft,n,_,0,0,R,L,M,O,S,k,h>>8,o>>8),t+=F,i+=B,h+=N,o+=U,n+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}else for(s-=r,r-=n,n=this.Di[n];;){if(--r<0)for(;;){if(--s<0)return;this.ce(e>>16,t>>16,this.ft,n,_,0,0,R,L,M,O,S,k,l>>8,h>>8),t+=F,e+=P,h+=N,l+=G,n+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(i>>16,t>>16,this.ft,n,_,0,0,R,L,M,O,S,k,o>>8,h>>8),t+=F,i+=B,h+=N,o+=U,n+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}}else{e=i<<=16,l=o<<=16,n<0&&(e-=F*n,i-=B*n,l-=N*n,o-=U*n,n=0),t<<=16,h<<=16,s<0&&(t-=P*s,h-=G*s,s=0);const a=n-this.Ni;if(R+=v*a,L+=x*a,M+=D*a,R|=0,L|=0,M|=0,r-=s,s-=n,n=this.Di[n],F>16,i>>16,this.ft,n,_,0,0,R,L,M,O,S,k,h>>8,o>>8),t+=P,i+=B,h+=G,o+=U,n+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(e>>16,i>>16,this.ft,n,_,0,0,R,L,M,O,S,k,l>>8,o>>8),e+=F,i+=B,l+=N,o+=U,n+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}else for(;;){if(--s<0)for(;;){if(--r<0)return;this.ce(i>>16,t>>16,this.ft,n,_,0,0,R,L,M,O,S,k,o>>8,h>>8),t+=P,i+=B,h+=G,o+=U,n+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(i>>16,e>>16,this.ft,n,_,0,0,R,L,M,O,S,k,o>>8,l>>8),e+=F,i+=B,l+=N,o+=U,n+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,this.ft,r,_,0,0,R,L,M,O,S,k,o>>8,h>>8),i+=B,t+=F,o+=U,h+=N,r+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(i>>16,e>>16,this.ft,r,_,0,0,R,L,M,O,S,k,o>>8,l>>8),i+=B,e+=P,o+=U,l+=G,r+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}else for(;;){if(--s<0)for(;;){if(--n<0)return;this.ce(t>>16,i>>16,this.ft,r,_,0,0,R,L,M,O,S,k,h>>8,o>>8),i+=B,t+=F,o+=U,h+=N,r+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(e>>16,i>>16,this.ft,r,_,0,0,R,L,M,O,S,k,l>>8,o>>8),i+=B,e+=P,o+=U,l+=G,r+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}}else{t=e<<=16,h=l<<=16,r<0&&(t-=B*r,e-=P*r,h-=U*r,l-=G*r,r=0),i<<=16,o<<=16,n<0&&(i-=F*n,o-=N*n,n=0);const a=r-this.Ni;if(R+=v*a,L+=x*a,M+=D*a,R|=0,L|=0,M|=0,s-=n,n-=r,r=this.Di[r],B>16,e>>16,this.ft,r,_,0,0,R,L,M,O,S,k,o>>8,l>>8),i+=F,e+=P,o+=N,l+=G,r+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(t>>16,e>>16,this.ft,r,_,0,0,R,L,M,O,S,k,h>>8,l>>8),t+=B,e+=P,h+=U,l+=G,r+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}else for(;;){if(--n<0)for(;;){if(--s<0)return;this.ce(e>>16,i>>16,this.ft,r,_,0,0,R,L,M,O,S,k,l>>8,o>>8),i+=F,e+=P,o+=N,l+=G,r+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(e>>16,t>>16,this.ft,r,_,0,0,R,L,M,O,S,k,l>>8,h>>8),t+=B,e+=P,h+=U,l+=G,r+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}}};static ce=(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w)=>{if(t>=i)return;let y,m,A,p,_,I,g,C,E;if(this.Ui){if(y=(w-d)/(i-t)|0,i>this.wt&&(i=this.wt),t<0&&(d-=t*y,t=0),t>=i)return;m=i-t>>3,y<<=12}else i-t>7?(m=i-t>>3,y=(w-d)*this.Si[m]>>6):(m=0,y=0);if(d<<=9,s+=t,this.Li&&n)if(A=0,p=0,I=t-this.Fi,o+=(c>>3)*I,l+=(f>>3)*I,a+=(u>>3)*I,o|=0,l|=0,_=(a|=0)>>12,0!==_&&(h=l/_|0,(r=o/_|0)<0?r=0:r>4032&&(r=4032)),o+=c,l+=f,a+=u,o|=0,l|=0,_=(a|=0)>>12,0!==_&&(A=o/_|0,p=l/_|0,A<7?A=7:A>4032&&(A=4032)),g=A-r>>3,C=p-h>>3,r+=d>>3&786432,E=d>>23,this.Ki){for(;m-- >0;)e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r=A,h=p,o+=c,l+=f,_=(a+=u)>>12,0!==_&&(A=o/_|0,p=l/_|0,A<7?A=7:A>4032&&(A=4032)),g=A-r>>3,C=p-h>>3,r+=(d+=y)>>3&786432,E=d>>23;for(m=i-t&7;m-- >0;)e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C}else{for(;m-- >0;){let t;0!=(t=n[(4032&h)+(r>>6)]>>>E)&&(e[s]=t),s+=1,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s+=1,r=A,h=p,o+=c,l+=f,a+=u,o|=0,l|=0,_=(a|=0)>>12,0!==_&&(A=o/_|0,p=l/_|0,A<7?A=7:A>4032&&(A=4032)),g=A-r>>3,C=p-h>>3,r+=(d+=y)>>3&786432,E=d>>23}for(m=i-t&7;m-- >0;){let t;0!=(t=n[(4032&h)+(r>>6)]>>>E)&&(e[s]=t),s++,r+=g,h+=C}}else if(A=0,p=0,I=t-this.Fi,o+=(c>>3)*I,l+=(f>>3)*I,a+=(u>>3)*I,o|=0,l|=0,_=(a|=0)>>14,0!==_&&(h=l/_|0,(r=o/_|0)<0?r=0:r>16256&&(r=16256)),o+=c,l+=f,a+=u,o|=0,l|=0,_=(a|=0)>>14,0!==_&&(A=o/_|0,p=l/_|0,A<7?A=7:A>16256&&(A=16256)),g=A-r>>3,C=p-h>>3,r+=6291456&d,E=d>>23,this.Ki&&n){for(;m-- >0;)e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r=A,h=p,o+=c,l+=f,a+=u,o|=0,l|=0,_=(a|=0)>>14,0!==_&&(A=o/_|0,p=l/_|0,A<7?A=7:A>16256&&(A=16256)),g=A-r>>3,C=p-h>>3,r+=6291456&(d+=y),E=d>>23;for(m=i-t&7;m-- >0;)e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C}else{for(;m-- >0&&n;){let t;0!=(t=n[(16256&h)+(r>>7)]>>>E)&&(e[s]=t),s+=1,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,r=A,h=p,o+=c,l+=f,a+=u,o|=0,l|=0,_=(a|=0)>>14,0!==_&&(A=o/_|0,p=l/_|0,A<7?A=7:A>16256&&(A=16256)),g=A-r>>3,C=p-h>>3,r+=6291456&(d+=y),E=d>>23}for(m=i-t&7;m-- >0&&n;){let t;0!=(t=n[(16256&h)+(r>>7)]>>>E)&&(e[s]=t),s++,r+=g,h+=C}}};static oe=(t,i,e,s,n)=>{if(this.Ui&&(i>this.wt&&(i=this.wt),t<0&&(t=0)),t>=i)return;s+=t;let r=i-t>>2;if(0===this.alpha)for(;;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;e[s++]=n}e[s++]=n,e[s++]=n,e[s++]=n,e[s++]=n}const h=this.alpha,o=256-this.alpha;for(n=((16711935&n)*o>>8&16711935)+((65280&n)*o>>8&65280);;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280)}e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280)}};static ee=t=>{this.Gi[t]&&this.Pi&&(this.Pi[this.Wi++]=this.Gi[t],this.Gi[t]=null)};static ae=t=>{if(this.Hi[t]=this.Yi++,this.Gi[t])return this.Gi[t];let i;if(this.Wi>0&&this.Pi)i=this.Pi[--this.Wi],this.Pi[this.Wi]=null;else{let t=0,e=-1;for(let i=0;i>>3)&16316671,i[n+8192]=r-(r>>>2)&16316671,i[n+12288]=r-(r>>>2)-(r>>>3)&16316671}}else{if(64===e.width)for(let t=0;t<128;t++)for(let n=0;n<128;n++)i[n+(t<<7)]=s[e.ft[(n>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)i[t]=s[e.ft[t]];this.Xi[t]=!1;for(let e=0;e<16384;e++){i[e]&=16316671;const s=i[e];0===s&&(this.Xi[t]=!0),i[e+16384]=s-(s>>>3)&16316671,i[e+32768]=s-(s>>>2)&16316671,i[e+49152]=s-(s>>>2)-(s>>>3)&16316671}}return i}}const N={'Backspace':{code:8,ch:8},'Enter':{code:10,ch:10},'Shift':{code:16,ch:65535},'Escape':{code:27,ch:27},'Tab':{code:9,ch:9},'CapsLock':{code:20,ch:65535},' ':{code:32,ch:32},'Control':{code:17,ch:65535},'Alt':{code:18,ch:65535},'Meta':{code:524,ch:65535},'ArrowLeft':{code:37,ch:65535},'ArrowRight':{code:39,ch:65535},'ArrowUp':{code:38,ch:65535},'ArrowDown':{code:40,ch:65535},'Insert':{code:155,ch:65535},'Home':{code:36,ch:65535},'PageUp':{code:33,ch:65535},'Delete':{code:127,ch:127},'End':{code:35,ch:65535},'PageDown':{code:34,ch:65535},'`':{code:192,ch:96},'~':{code:192,ch:126},'!':{code:49,ch:33},'@':{code:50,ch:64},'#':{code:51,ch:35},'$':{code:52,ch:36},'%':{code:53,ch:37},'^':{code:54,ch:94},'&':{code:55,ch:38},'*':{code:56,ch:42},'(':{code:57,ch:40},')':{code:48,ch:41},'-':{code:45,ch:45},'_':{code:45,ch:95},'=':{code:61,ch:61},'+':{code:61,ch:43},'[':{code:91,ch:91},'{':{code:91,ch:123},']':{code:93,ch:93},'}':{code:93,ch:125},'\\':{code:92,ch:92},'|':{code:92,ch:124},';':{code:59,ch:59},':':{code:59,ch:58},"'":{code:222,ch:39},'"':{code:222,ch:34},',':{code:44,ch:44},'<':{code:44,ch:60},'.':{code:46,ch:46},'>':{code:46,ch:62},'/':{code:47,ch:47},'?':{code:47,ch:63},'F1':{code:112,ch:65535},'F2':{code:113,ch:65535},'F3':{code:114,ch:65535},'F4':{code:115,ch:65535},'F5':{code:116,ch:65535},'F6':{code:117,ch:65535},'F7':{code:118,ch:65535},'F8':{code:119,ch:65535},'F9':{code:120,ch:65535},'F10':{code:121,ch:65535},'F11':{code:122,ch:65535},'F12':{code:123,ch:65535},0:{code:48,ch:48},1:{code:49,ch:49},2:{code:50,ch:50},3:{code:51,ch:51},4:{code:52,ch:52},5:{code:53,ch:53},6:{code:54,ch:54},7:{code:55,ch:55},8:{code:56,ch:56},9:{code:57,ch:57},'a':{code:65,ch:97},'b':{code:66,ch:98},'c':{code:67,ch:99},'d':{code:68,ch:100},'e':{code:69,ch:101},'f':{code:70,ch:102},'g':{code:71,ch:103},'h':{code:72,ch:104},'i':{code:73,ch:105},'j':{code:74,ch:106},'k':{code:75,ch:107},'l':{code:76,ch:108},'m':{code:77,ch:109},'n':{code:78,ch:110},'o':{code:79,ch:111},'p':{code:80,ch:112},'q':{code:81,ch:113},'r':{code:82,ch:114},'s':{code:83,ch:115},'t':{code:84,ch:116},'u':{code:85,ch:117},'v':{code:86,ch:118},'w':{code:87,ch:119},'x':{code:88,ch:120},'y':{code:89,ch:121},'z':{code:90,ch:122},'A':{code:65,ch:65},'B':{code:66,ch:66},'C':{code:67,ch:67},'D':{code:68,ch:68},'E':{code:69,ch:69},'F':{code:70,ch:70},'G':{code:71,ch:71},'H':{code:72,ch:72},'I':{code:73,ch:73},'J':{code:74,ch:74},'K':{code:75,ch:75},'L':{code:76,ch:76},'M':{code:77,ch:77},'N':{code:78,ch:78},'O':{code:79,ch:79},'P':{code:80,ch:80},'Q':{code:81,ch:81},'R':{code:82,ch:82},'S':{code:83,ch:83},'T':{code:84,ch:84},'U':{code:85,ch:85},'V':{code:86,ch:86},'W':{code:87,ch:87},'X':{code:88,ch:88},'Y':{code:89,ch:89},'Z':{code:90,ch:90}},B=['Tab','F1','F2','F3','F4','F5','F6','F7','F8','F9','F10','ArrowLeft','ArrowRight','ArrowUp','ArrowDown'];class U{static enabled=!1;static fe=null;static ue=null;static de=0;static we=0;static ye=0;static me=0;static Ae=0;static pe=()=>{this.fe=R.zt(1),this.ue=null,this.de=performance.now(),this.enabled=!0};static _e=()=>{this.enabled=!1,this.fe=null};static flush=()=>{let t=null;return this.ue&&this.enabled&&(t=this.ue),this.ue=null,t};static stop=()=>{let t=null;return this.fe&&this.fe.Xt>0&&this.enabled&&(t=this.fe),this._e(),t};static Ie=(t,i,e)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;this.we++;const s=performance.now();let n=(s-this.de)/10|0;n>250&&(n=250),this.de=s,this.ge(5),1===e?this.fe?.p1(1):this.fe?.p1(2),this.fe?.p1(n),this.fe?.p3(t+(i<<10))};static Ce=t=>{if(!this.enabled)return;this.we++;const i=performance.now();let e=(i-this.de)/10|0;e>250&&(e=250),this.de=i,this.ge(2),1===t?this.fe?.p1(3):this.fe?.p1(4),this.fe?.p1(e)};static Ee=(t,i)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;const e=performance.now();if(e-this.ye>=50){this.ye=e,this.we++;let s=(e-this.de)/10|0;s>250&&(s=250),this.de=e,t-this.me<8&&t-this.me>=-8&&i-this.Ae<8&&i-this.Ae>=-8?(this.ge(3),this.fe?.p1(5),this.fe?.p1(s),this.fe?.p1(t+(i-this.Ae+8<<4)+8-this.me)):t-this.me<128&&t-this.me>=-128&&i-this.Ae<128&&i-this.Ae>=-128?(this.ge(4),this.fe?.p1(6),this.fe?.p1(s),this.fe?.p1(t+128-this.me),this.fe?.p1(i+128-this.Ae)):(this.ge(5),this.fe?.p1(7),this.fe?.p1(s),this.fe?.p3(t+(i<<10))),this.me=t,this.Ae=i}};static Te=t=>{if(!this.enabled)return;this.we++;const i=performance.now();let e=(i-this.de)/10|0;e>250&&(e=250),this.de=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.ge(3),this.fe?.p1(8),this.fe?.p1(e),this.fe?.p1(t)};static be=t=>{if(!this.enabled)return;this.we++;const i=performance.now();let e=(i-this.de)/10|0;e>250&&(e=250),this.de=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.ge(3),this.fe?.p1(9),this.fe?.p1(e),this.fe?.p1(t)};static Re=()=>{if(!this.enabled)return;this.we++;const t=performance.now();let i=(t-this.de)/10|0;i>250&&(i=250),this.de=t,this.ge(2),this.fe?.p1(10),this.fe?.p1(i)};static Oe=()=>{if(!this.enabled)return;this.we++;const t=performance.now();let i=(t-this.de)/10|0;i>250&&(i=250),this.de=t,this.ge(2),this.fe?.p1(11),this.fe?.p1(i)};static ve=()=>{if(!this.enabled)return;this.we++;const t=performance.now();let i=(t-this.de)/10|0;i>250&&(i=250),this.de=t,this.ge(2),this.fe?.p1(12),this.fe?.p1(i)};static Le=()=>{if(!this.enabled)return;this.we++;const t=performance.now();let i=(t-this.de)/10|0;i>250&&(i=250),this.de=t,this.ge(2),this.fe?.p1(13),this.fe?.p1(i)};static ge=t=>{if(this.fe&&this.fe.Xt+t>=500){const t=this.fe;this.fe=R.zt(1),this.ue=t}}}class P{static getParameter(t){return new URLSearchParams(window.location.search).get(t)??''}static setParameter(t,i){const e=new URL(window.location.toString());e.searchParams.set(t,i),window.history.pushState(null,'',e.toString())}Se=0;xe=[];Me=0;ke=null;state=0;De=20;Fe=1;Ne=[];Be=0;Ue=0;Pe=[];Ge=!0;We=!1;Ye=50;hasFocus=!0;He=!1;Ve=0;Ke=0;Xe=0;je=0;ze=0;Ze=0;qe=0;Je=[];$e=[];Qe=0;ts=0;input=null;es=!1;ss=!1;ns=!1;time=-1;rs=0;hs=0;os=0;ls=0;cs=0;fs=0;constructor(t=!1){A.tabIndex=-1,p.fillStyle='black',p.fillRect(0,0,A.width,A.height),this.We=t,this.We?this.resize(window.innerWidth,window.innerHeight):this.resize(A.width,A.height)}get width(){return A.width}get height(){return A.height}resize=(t,i)=>{A.width=t,A.height=i,this.ke=new C(t,i),F.Zi()};us=async()=>{A.addEventListener('resize',(()=>{this.We&&this.resize(window.innerWidth,window.innerHeight)}),!1),A.onmousedown=this.onmousedown,A.onmouseup=this.onmouseup,A.onmouseenter=this.onmouseenter,A.onmouseleave=this.onmouseleave,A.onmousemove=this.onmousemove,window.onbeforeunload=this.zi,A.onfocus=this.onfocus,A.onblur=this.onblur,this.ds?(A.ontouchstart=this.ontouchstart,A.ontouchend=this.ontouchend,A.ontouchmove=this.ontouchmove):(A.onkeydown=this.onkeydown,A.onkeyup=this.onkeyup),A.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.ds&&'low'===P.getParameter('detail')&&(this.Ye=30),await this.ws(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.Ne[t]=performance.now();let t,i=0,e=256,s=1,n=0;for(;this.state>=0;){if(this.state>0&&(this.state--,0===this.state))return void this.ys();const r=e,h=s;e=300,s=1,t=performance.now();const o=this.Ne[i];if(0===o?(e=r,s=h):t>o&&(e=2560*this.De/(t-o)|0),e<25?e=25:e>256&&(e=256,s=this.De-(t-o)/10|0),this.Ne[i]=t,i=(i+1)%10,s>1)for(let t=0;t<10;t++)0!==this.Ne[t]&&(this.Ne[t]+=s);for(s0&&(this.Be=1e3*e/(256*this.De)|0);const l=performance.now();if(this.Ge&&this.refresh(),await this.draw(),this.Pe[this.Ue]=(performance.now()-l)/1e3,this.Ue=(this.Ue+1)%this.Pe.length,this.Ye<50){const i=1e3/this.Ye-(performance.now()-t);i>0&&await E(i)}}-1===this.state&&this.ys()};ys=()=>{this.state=-2,this.zi()};As=t=>{this.De=1e3/t|0};ps=t=>{this.Ye=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.De|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};zi=()=>{};draw=async()=>{};refresh=()=>{};async ws(t,i){const e=this.width,s=this.height;this.Ge&&(p.fillStyle='black',p.fillRect(0,0,e,s),this.Ge=!1);const n=s/2-18;p.fillStyle='rgb(140, 17, 17)',p.rect((e/2|0)-152,n,304,34),p.fillRect((e/2|0)-150,n+2,3*t,30),p.fillStyle='black',p.fillRect((e/2|0)-150+3*t,n+2,300-3*t,30),p.font='bold 13px helvetica, sans-serif',p.textAlign='center',p.fillStyle='white',p.fillText(i,e/2|0,n+22),await E(5)}_s=()=>{let t=-1;return this.ts!==this.Qe&&(t=this.$e[this.Qe],this.Qe=this.Qe+1&127),t};get ms(){const t=this.Pe.length;let i=0;for(let e=0;ethis.Se&&(this.Se=e),this.xe[this.Me]=e,this.Me=(this.Me+1)%250,e}get Is(){return this.xe.reduce(((t,i)=>t+i),0)/250}onkeydown=t=>{const i=t.key;B.includes(i)&&t.preventDefault(),this.Ve=0;const e=N[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;t.ctrlKey&&(n>='A'.charCodeAt(0)&&n<=']'.charCodeAt(0)||n=='_'.charCodeAt(0)?n-='A'.charCodeAt(0)-1:n>='a'.charCodeAt(0)&&n<='z'.charCodeAt(0)&&(n-='a'.charCodeAt(0)-1)),n<30&&(n=0),s===N.ArrowLeft.code?n=1:s===N.ArrowRight.code?n=2:s===N.ArrowUp.code?n=3:s===N.ArrowDown.code?n=4:s===N.Control.code?n=5:s===N.Shift.code?n=6:s===N.Alt.code?n=7:s===N.Backspace.code||s===N.Delete.code?n=8:s===N.Tab.code?n=9:s===N.Enter.code?n=10:s>=N.F1.code&&s<=N.F12.code?n=s+1008-N.F1.code:s===N.Home.code?n=1e3:s===N.End.code?n=1001:s===N.PageUp.code?n=1002:s===N.PageDown.code&&(n=1003),n>0&&n<128&&(this.Je[n]=1),n>4&&(this.$e[this.ts]=n,this.ts=this.ts+1&127),U.enabled&&U.Te(n)};onkeyup=t=>{const i=t.key;B.includes(i)&&t.preventDefault(),this.Ve=0;const e=N[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;n<30&&(n=0),s===N.ArrowLeft.code?n=1:s===N.ArrowRight.code?n=2:s===N.ArrowUp.code?n=3:s===N.ArrowDown.code?n=4:s===N.Control.code?n=5:s===N.Shift.code?n=6:s===N.Alt.code?n=7:s===N.Backspace.code||s===N.Delete.code?n=8:s===N.Tab.code?n=9:s===N.Enter.code?n=10:s>=N.F1.code&&s<=N.F12.code?n=s+1008-N.F1.code:s===N.Home.code?n=1e3:s===N.End.code?n=1001:s===N.PageUp.code?n=1002:s===N.PageDown.code&&(n=1003),n>0&&n<128&&(this.Je[n]=0),U.enabled&&U.be(n)};onmousedown=t=>{if(this.es=!1,(t.clientX>0||t.clientY>0)&&this.gs(t),this.Ve=0,this.Ze=this.Xe,this.qe=this.je,this.ds&&!this.Cs){if(this.Es()||this.Ts()||this.bs())return this.ze=1,void(this.Ke=1);t.timeStamp>=this.time+500?(this.ze=2,this.Ke=2):(this.ze=1,this.Ke=1)}else 2===t.button?(this.ze=2,this.Ke=2):(this.ze=1,this.Ke=1);U.enabled&&U.Ie(this.Ze,this.qe,t.buttons)};onmouseup=t=>{this.gs(t),this.Ve=0,this.Ke=0,U.enabled&&U.Ce(t.buttons)};onmouseenter=t=>{this.gs(t),U.enabled&&U.ve()};onmouseleave=t=>{this.gs(t),this.Ve=0,this.Xe=-1,this.je=-1,this.Ke=0,this.Ze=-1,this.qe=-1,U.enabled&&U.Le()};onmousemove=t=>{this.gs(t),this.Ve=0,U.enabled&&U.Ee(this.Xe,this.je)};onfocus=t=>{this.hasFocus=!0,this.Ge=!0,this.refresh(),U.enabled&&U.Re()};onblur=t=>{this.hasFocus=!1,U.enabled&&U.Oe()};ontouchstart=t=>{if(!this.ds)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.es=!0;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.rs=this.cs=this.os=0|i.screenX,this.hs=this.fs=this.ls=0|i.screenY,this.time=t.timeStamp,this.ss=this.Rs(),this.ns=this.Os()};ontouchend=t=>{if(!this.ds||!this.es)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;if(this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.cs=0|i.screenX,this.fs=0|i.screenY,this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.ss&&!this.Rs())return void(this.es=!1);if(this.ns&&!this.Os())return void(this.es=!1);if(this.Es()||this.vs()||this.Ts()||this.bs()){null!==this.input&&(this.input.parentNode?.contains(this.input)&&this.input.parentNode?.removeChild(this.input),this.input=null);const t=document.createElement('input');return this.Ts()?(t.setAttribute('id','username'),t.setAttribute('placeholder','Username')):this.bs()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.Es()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.vs()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this.Ls?t.setAttribute('type','password'):t.setAttribute('type',this.bs()?'password':'text'),t.setAttribute('autofocus','autofocus'),t.setAttribute('spellcheck','false'),t.setAttribute('autocomplete','off'),t.setAttribute('style',`position: fixed; left: ${e}px; top: ${s}px; width: 1px; height: 1px; opacity: 0;`),document.body.appendChild(t),t.focus(),t.click(),this.Ls&&(t.oninput=t=>{if(!(t instanceof InputEvent))return;const i=t,e=i.data;null!==e&&'insertText'===i.inputType&&this.onkeydown(new KeyboardEvent('keydown',{key:e,code:e}))}),t.onkeydown=t=>{this.Ls&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this.Ls&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeyup(new KeyboardEvent('keyup',{key:t.key,code:t.key}))},t.onfocus=t=>{this.input?.parentNode?.removeChild(this.input),this.input=null,this.onfocus(t)},this.input=t,void(this.es=!1)}const n=t.timeStamp>=this.time+500,r=Math.abs(this.rs-this.cs)>16||Math.abs(this.hs-this.fs)>16;n&&!r?(this.es=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.Ke=0,this.es=!1)};ontouchmove=t=>{if(!this.ds||!this.es)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.cs=0|i.screenX,this.fs=0|i.screenY,this.ss&&-1===this.Ss()?(this.os-this.cs>0?this.rotate(2):this.os-this.cs<0&&this.rotate(0),this.ls-this.fs>0?this.rotate(3):this.ls-this.fs<0&&this.rotate(1)):(this.ns||-1!==this.Ss())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this.os=this.cs,this.ls=this.fs};get ds(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get Ls(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get Cs(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}Rs=()=>this.He&&this.Xe>=8&&this.Xe<=520&&this.je>=11&&this.je<=345;Es=()=>this.He&&-1===this.xs()&&!this.Ms()&&!this.ks()&&this.Xe>=11&&this.Xe<=506&&this.je>=449&&this.je<=482;vs=()=>this.He&&(this.Ms()||this.ks())&&this.Xe>=11&&this.Xe<=506&&this.je>=383&&this.je<=482;Os=()=>this.He&&this.Xe>=562&&this.Xe<=752&&this.je>=231&&this.je<=492;Ts=()=>!this.He&&2===this.Ds()&&this.Xe>=301&&this.Xe<=562&&this.je>=262&&this.je<=279;bs=()=>!this.He&&2===this.Ds()&&this.Xe>=301&&this.Xe<=562&&this.je>=279&&this.je<=296;rotate=t=>{0===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowLeft',code:'ArrowLeft'}))):1===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowUp',code:'ArrowUp'}))):2===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowRight',code:'ArrowRight'}))):3===t&&(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowDown',code:'ArrowDown'})))};Fs=()=>null!==document.fullscreenElement;gs=t=>{if(this.Fs()){const i=t.target.getBoundingClientRect(),e=window.innerHeight/A.height,s=(window.innerWidth-A.width*e)/2;this.Xe=0|this.Ns(t.clientX-i.left-s,0,A.width*e,0,789),this.je=0|this.Ns(t.clientY-i.top,0,A.height*e,0,532)}else{const i=A.getBoundingClientRect(),e=A.width/i.width,s=A.height/i.height;this.Xe=(t.clientX-i.left)*e|0,this.je=(t.clientY-i.top)*s|0}this.Xe<0&&(this.Xe=0),this.je<0&&(this.je=0),this.Xe>789&&(this.Xe=789),this.je>532&&(this.je=532)};Ns=(t,i,e,s,n)=>(t-i)*(n-s)/(e-i)+s}class G{db;constructor(t){t.onerror=this.onerror,t.onclose=this.onclose,this.db=t}static openDatabase=async()=>await new Promise(((t,i)=>{const e=indexedDB.open('lostcity',1);e.onsuccess=i=>{const e=i.target;console.log('database success!'),t(e.result)},e.onupgradeneeded=t=>{t.target.result.createObjectStore('cache')},e.onerror=t=>{const e=t.target;console.error('database error!: ',e.error),i(e.result)}}));Bs=async t=>await new Promise((i=>{const e=this.db.transaction('cache','readonly').objectStore('cache').get(t);e.onsuccess=()=>{i(e.result)},e.onerror=t=>{i(void 0)}}));Us=async(t,i)=>await new Promise(((e,s)=>{const n=this.db.transaction('cache','readwrite').objectStore('cache').put(i,t);n.onsuccess=()=>{e()},n.onerror=t=>{s()}}));onclose=t=>{console.log('database close!')};onerror=t=>{console.log('database error!')};Ps=t=>{const i=t.trim();let e=0;for(let t=0;t='A'&&s<='Z'?e+=s.charCodeAt(0)+1-65:s>='a'&&s<='z'?e+=s.charCodeAt(0)+1-97:s>='0'&&s<='9'&&(e+=s.charCodeAt(0)+27-48)}return e}}class W{static Ps=t=>{let i=0;t=t.toUpperCase();for(let e=0;e=this.Ws)return null;if(this.Xs[t])return this.Xs[t];const e=this.Ks[t],s=e+this.Vs[t];if(this.Gs){const i=Uint8Array.from(this.buffer.subarray(e,e+s));return this.Xs[t]=i,i}{const e=Uint8Array.from(i.read(this.Hs[t],this.buffer,this.Vs[t],this.Ks[t]));return this.Xs[t]=e,e}}}class Y{static zs=new Uint8Array(520);Zs;qs;store;constructor(t,i,e){this.Zs=new R(t),this.qs=new R(i),this.store=e+1}get Ws(){return this.qs.length/6}read(t,i=!1){this.qs.Xt=6*t;const e=this.qs.Qt;let s=this.qs.Qt;if(s<=0||s>this.Zs.length/520)return null;const n=new Uint8Array(e);let r=0;for(let i=0;r512&&(h=512),this.Zs.ri(h+8,0,Y.zs);const o=(255&Y.zs[0])<<8|255&Y.zs[1],l=(255&Y.zs[2])<<8|255&Y.zs[3],a=(255&Y.zs[4])<<16|(255&Y.zs[5])<<8|255&Y.zs[6],c=255&Y.zs[7];if(o!==t||l!==i||c!==this.store)return null;if(a<0||a>this.Zs.length/520)return null;for(let t=0;t>>0;if(h.nt(e,a),4294967295===s){const t=h.$s(),i=h.Qs(),e=new Uint8Array(h.memory.buffer,t,i),s=(new TextDecoder).decode(e);throw new l(s)}const n=h.buffer()>>>0;return new Uint8Array(h.memory.buffer,n,s)}(n)}}class H{static tn=[];static en=t=>{const i=new R(t.read('base_head.dat')),e=new R(t.read('base_type.dat')),s=new R(t.read('base_label.dat')),n=i.Jt;i.Xt+=2;for(let t=0;t{const i=new R(t.read('frame_head.dat')),e=new R(t.read('frame_tran1.dat')),s=new R(t.read('frame_tran2.dat')),n=new R(t.read('frame_del.dat')),r=i.Jt;i.Xt+=2;const h=new Int32Array(500),o=new Int32Array(500),l=new Int32Array(500),a=new Int32Array(500);for(let t=0;t0){if(0!==f.types[t])for(let i=t-1;i>d;i--)if(0===f.types[i]){h[w]=i,o[w]=0,l[w]=0,a[w]=0,w++;break}h[w]=t;let e=0;3===f.types[h[w]]&&(e=128),o[w]=1&i?s.ei:e,l[w]=2&i?s.ei:e,a[w]=4&i?s.ei:e,d=t,w++}}r.length=w,r.nn=new Int32Array(w),r.x=new Int32Array(w),r.y=new Int32Array(w),r.z=new Int32Array(w);for(let t=0;t>7)<2?i=2:i>126&&(i=126),(65408&t)+i):(i<0?i=0:i>127&&(i=127),127-i)}static lr=(t,i,e)=>{const s=t.rn,n=t.hn,r=t.ln;let h,o,l,a,c;if(i){h=new Int32Array(s);for(let i=0;i{const n=t.rn,r=t.hn,h=t.ln;let o,l,a,c,f;if(s)o=t.Ar,l=t.ar,a=t.pr;else{o=new Int32Array(n),l=new Int32Array(n),a=new Int32Array(n);for(let i=0;i{const e=t.rn,s=t.hn,n=t.ln,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e);for(let i=0;i{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,l=0,a=-1;for(let c=0;c{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,l=0,a=-1;for(let c=0;c{let o=-1;const l=t.Ar[i],a=t.ar[i],c=t.pr[i];for(let t=0;t{if(!j.metadata)throw new Error('cant loading model metadata!!!!!');const i=j.metadata[t];if(!i)throw console.log(`Error model:${t} not found!`),new Error('cant loading model metadata!!!!!');if(!(j.head&&j.Cn&&j.En&&j.Tn&&j.bn&&j.Rn&&j.On&&j.vn&&j.Ln&&j.Sn&&j.xn&&j.Mn&&j.kn&&j.axis))throw new Error('cant loading model!!!!!');const e=i.rn,s=i.hn,n=i.ln,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e),l=new Int32Array(s),a=new Int32Array(s),c=new Int32Array(s),f=new Int32Array(n),u=new Int32Array(n),d=new Int32Array(n);let w=null;i.dn>=0&&(w=new Int32Array(e));let y=null;i.An>=0&&(y=new Int32Array(s));let m=null,A=0;i.pn>=0?m=new Int32Array(s):A=-i.pn-1;let p=null;i._n>=0&&(p=new Int32Array(s));let _=null;i.In>=0&&(_=new Int32Array(s));const I=new Int32Array(s);j.On.Xt=i.an,j.vn.Xt=i.cn,j.Ln.Xt=i.fn,j.Sn.Xt=i.un,j.xn.Xt=i.dn;let g,C,E,T=0,b=0,R=0;for(let t=0;t{if(!j.metadata||!j.metadata[i])throw new Error('No model metadata');const e=j.metadata[i];if(e.data=t,!e.data.length)throw new Error('No model data');const s=e.rn,n=e.hn,r=e.ln,h=new Int32Array(s),o=new Int32Array(s),l=new Int32Array(s),a=new Int32Array(n),c=new Int32Array(n),f=new Int32Array(n),u=new Int32Array(r),d=new Int32Array(r),w=new Int32Array(r);let y=null;e.dn>=0&&(y=new Int32Array(s));let m=null;e.An>=0&&(m=new Int32Array(n));let A=null,p=0;e.pn>=0?A=new Int32Array(n):p=-e.pn-1;let _=null;e._n>=0&&(_=new Int32Array(n));let I=null;e.In>=0&&(I=new Int32Array(n));const g=new Int32Array(n),C=new R(e.data);C.Xt=e.an;const E=new R(e.data);E.Xt=e.cn;const T=new R(e.data);T.Xt=e.fn;const b=new R(e.data);b.Xt=e.un;const O=new R(e.data);O.Xt=e.dn;let v,L,S,x=0,M=0,k=0;for(let t=0;tthis.Fr&&(this.Fr=-e),e>this.Dr&&(this.Dr=e);const n=i*i+s*s;n>this.kr&&(this.kr=n)}this.kr=Math.sqrt(this.kr)+.99|0,this.Br=Math.sqrt(this.kr*this.kr+this.Fr*this.Fr)+.99|0,this.Nr=this.Br+(Math.sqrt(this.kr*this.kr+this.Dr*this.Dr)+.99|0)}$r(){this.Fr=0,this.Dr=0;for(let t=0;tthis.Fr&&(this.Fr=-i),i>this.Dr&&(this.Dr=i)}this.Br=Math.sqrt(this.kr*this.kr+this.Fr*this.Fr)+.99|0,this.Nr=this.Br+(Math.sqrt(this.kr*this.kr+this.Dr*this.Dr)+.99|0)}Qr(){if(this.Pr){const t=new Int32Array(256);let i=0;for(let e=0;ei&&(i=s)}this.Yr=new v(i+1,null);for(let e=0;e<=i;e++)this.Yr[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;ei&&(i=s)}this.Hr=new v(i+1,null);for(let e=0;e<=i;e++)this.Hr[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;eo;)o=e[h++];r&&r.types&&s.x&&s.y&&s.z&&r.labels&&(i!==o||0===r.types[i])&&this.ih(s.x[t],s.y[t],s.z[t],r.labels[i],r.types[i])}j.$n=0,j.Qn=0,j.tr=0,h=0,o=e[h++];for(let t=0;to;)o=e[h++];r&&r.types&&n.x&&n.y&&n.z&&r.labels&&(i===o||0===r.types[i])&&this.ih(n.x[t],n.y[t],n.z[t],r.labels[i],r.types[i])}}else this.eh(t)}eh(t){if(!this.Yr||-1===t||!V.tn[t])return;const i=V.tn[t],e=i.sn;j.$n=0,j.Qn=0,j.tr=0;for(let t=0;t>16;this.pr[t]=this.ar[t]*i+this.pr[t]*e>>16,this.ar[t]=s}}translate(t,i,e){for(let s=0;s>8;if(this.cr&&this.ur&&this.dr||(this.cr=new Int32Array(this.hn),this.ur=new Int32Array(this.hn),this.dr=new Int32Array(this.hn)),!this.yr){this.yr=new v(this.rn,null);for(let t=0;t8192||m>8192||A>8192||y<-8192||m<-8192||A<-8192;)y>>=1,m>>=1,A>>=1;let p=0|Math.sqrt(y*y+m*m+A*A);if(p<=0&&(p=1),y=256*y/p|0,m=256*m/p|0,A=256*A/p|0,this.wr&&1&this.wr[i]){const r=t+((e*y+s*m+n*A)/(h+(h/2|0))|0);this.Tr&&(this.cr[i]=j.hr(this.Tr[i],r,this.wr[i]))}else{let t=this.yr[r];t&&(t.x+=y,t.y+=m,t.z+=A,t.w++),t=this.yr[o],t&&(t.x+=y,t.y+=m,t.z+=A,t.w++),t=this.yr[l],t&&(t.x+=y,t.y+=m,t.z+=A,t.w++)}}if(r)this.lh(t,h,e,s,n);else{this.mr=new v(this.rn,null);for(let t=0;t>16;for(let s=0;s>16,p=p*u-A*f>>16,A=m),0!==t&&(m=p*l-_*o>>16,_=p*o+_*l>>16,p=m),0!==i&&(m=_*a+A*c>>16,_=_*c-A*a>>16,A=m),A+=n,p+=r,_+=h,m=p*w-_*d>>16,_=p*d+_*w>>16,p=m,j.Nn&&j.Bn&&j.Un&&(j.Un[s]=_-y,j.Nn[s]=F.Fi+((A<<9)/_|0),j.Bn[s]=F.Ni+((p<<9)/_|0)),this.ln>0&&j.Pn&&j.Gn&&j.Wn&&(j.Pn[s]=A,j.Gn[s]=p,j.Wn[s]=_)}try{this.uh(!1,!1,0)}catch(t){}}draw(t,i,e,s,n,r,h,o,l){const a=o*n-r*s>>16,c=h*i+a*e>>16,f=this.kr*e>>16,u=c+f;if(u<=50||c>=3500)return;const d=o*s+r*n>>16;let w=d-this.kr<<9;if((w/u|0)>=m.yt)return;let y=d+this.kr<<9;if((y/u|0)<=-m.yt)return;const A=h*e-a*i>>16,p=this.kr*i>>16;let _=A+p<<9;if((_/u|0)<=-m.At)return;let I=A-(p+(this.Fr*e>>16))<<9;if((I/u|0)>=m.At)return;let g=c-(f+(this.Fr*i>>16))<=50,C=!1;if(l>0&&j.ir){let t=c-f;t<=50&&(t=50),d>0?(w=w/u|0,y=y/t|0):(y=y/u|0,w=w/t|0),A>0?(I=I/u|0,_=_/t|0):(_=_/u|0,I=I/t|0);const i=j.Xe-F.Fi,e=j.je-F.Ni;i>w&&iI&&e<_&&(this.Zr?j.sr[j.er++]=l:C=!0)}const E=F.Fi,T=F.Ni;let b=0,R=0;0!==t&&(b=F.sin[t],R=F.cos[t]);for(let l=0;l>16,d=d*R-f*b>>16,f=a),f+=r,u+=h,d+=o,a=d*s+f*n>>16,d=d*n-f*s>>16,f=a,a=u*e-d*i>>16,d=u*i+d*e>>16,u=a,j.Un&&(j.Un[l]=d-c),d>=50&&j.Nn&&j.Bn?(j.Nn[l]=E+((f<<9)/d|0),j.Bn[l]=T+((u<<9)/d|0)):j.Nn&&(j.Nn[l]=-5e3,g=!0),(g||this.ln>0)&&j.Pn&&j.Gn&&j.Wn&&(j.Pn[l]=f,j.Gn[l]=u,j.Wn[l]=d)}try{this.uh(g,C,l)}catch(t){}}uh(t,i,e,s=!1){j.nr&&(this.qr=-1,this.Jr=-1);for(let t=0;tm.wt||l>m.wt||a>m.wt),j.Hn&&j.Yn){const t=((d+w+y)/3|0)+this.Br;j.Hn[t][j.Yn[t]++]=s,j.nr&&this.dh(j.Xe,j.je,c,f,u,o,l,a)&&this.Jr=0;t--){const i=j.Yn[t];if(!(i<=0)&&j.Hn){const e=j.Hn[t];for(let t=0;t=0;t--){const i=j.Yn[t];if(i>0&&j.Hn){const e=j.Hn[t];for(let s=0;s0||j.Vn[2]>0)&&(n=(j.zn[1]+j.zn[2])/(j.Vn[1]+j.Vn[2])|0);let r=0;j.Vn&&j.zn&&(j.Vn[3]>0||j.Vn[4]>0)&&(r=(j.zn[3]+j.zn[4])/(j.Vn[3]+j.Vn[4])|0);let h=0;if(j.Vn&&j.zn&&(j.Vn[6]>0||j.Vn[8]>0)&&(h=(j.zn[6]+j.zn[8])/(j.Vn[6]+j.Vn[8])|0),j.Vn&&j.Kn){let t,i=0,e=j.Vn[10],o=j.Kn[10],l=j.Xn;i===e&&(i=0,e=j.Vn[11],o=j.Kn[11],l=j.jn),t=in;)this.wh(o[i++],s),i===e&&o!==j.Kn[11]&&(i=0,e=j.Vn[11],o=j.Kn[11],l=j.jn),t=ir;)this.wh(o[i++],s),i===e&&o!==j.Kn[11]&&(i=0,e=j.Vn[11],o=j.Kn[11],l=j.jn),t=ih;)this.wh(o[i++],s),i===e&&o!==j.Kn[11]&&(i=0,e=j.Vn[11],o=j.Kn[11],l=j.jn),t=i>2,r=this.br[i],h=this.Rr[i],o=this.Or[i];F.le(j.Nn[e],j.Nn[s],j.Nn[n],j.Bn[e],j.Bn[s],j.Bn[n],this.cr[t],this.ur[t],this.dr[t],j.Pn[r],j.Gn[r],j.Wn[r],j.Pn[h],j.Pn[o],j.Gn[h],j.Gn[o],j.Wn[h],j.Wn[o],this.Tr[t])}else if(3===r&&this.wr&&this.Tr&&this.cr&&j.Nn&&j.Bn&&j.Pn&&j.Gn&&j.Wn){const i=this.wr[t]>>2,r=this.br[i],h=this.Rr[i],o=this.Or[i];F.le(j.Nn[e],j.Nn[s],j.Nn[n],j.Bn[e],j.Bn[s],j.Bn[n],this.cr[t],this.cr[t],this.cr[t],j.Pn[r],j.Gn[r],j.Wn[r],j.Pn[h],j.Pn[o],j.Gn[h],j.Gn[o],j.Wn[h],j.Wn[o],this.Tr[t])}}yh(t,i=!1){let e=0;if(j.Wn){const i=F.Fi,s=F.Ni,n=this._r[t],r=this.Ir[t],h=this.gr[t],o=j.Wn[n],l=j.Wn[r],a=j.Wn[h];if(o>=50&&j.Nn&&j.Bn&&this.cr)j.Zn[e]=j.Nn[n],j.qn[e]=j.Bn[n],j.Jn[e++]=this.cr[t];else if(j.Pn&&j.Gn&&this.cr){const c=j.Pn[n],f=j.Gn[n],u=this.cr[t];if(a>=50&&this.dr){const n=(50-o)*F.xi[a-o];j.Zn[e]=i+((c+((j.Pn[h]-c)*n>>16)<<9)/50|0),j.qn[e]=s+((f+((j.Gn[h]-f)*n>>16)<<9)/50|0),j.Jn[e++]=u+((this.dr[t]-u)*n>>16)}if(l>=50&&this.ur){const n=(50-o)*F.xi[l-o];j.Zn[e]=i+((c+((j.Pn[r]-c)*n>>16)<<9)/50|0),j.qn[e]=s+((f+((j.Gn[r]-f)*n>>16)<<9)/50|0),j.Jn[e++]=u+((this.ur[t]-u)*n>>16)}}if(l>=50&&j.Nn&&j.Bn&&this.ur)j.Zn[e]=j.Nn[r],j.qn[e]=j.Bn[r],j.Jn[e++]=this.ur[t];else if(j.Pn&&j.Gn&&this.ur){const c=j.Pn[r],f=j.Gn[r],u=this.ur[t];if(o>=50&&this.cr){const r=(50-l)*F.xi[o-l];j.Zn[e]=i+((c+((j.Pn[n]-c)*r>>16)<<9)/50|0),j.qn[e]=s+((f+((j.Gn[n]-f)*r>>16)<<9)/50|0),j.Jn[e++]=u+((this.cr[t]-u)*r>>16)}if(a>=50&&this.dr){const n=(50-l)*F.xi[a-l];j.Zn[e]=i+((c+((j.Pn[h]-c)*n>>16)<<9)/50|0),j.qn[e]=s+((f+((j.Gn[h]-f)*n>>16)<<9)/50|0),j.Jn[e++]=u+((this.dr[t]-u)*n>>16)}}if(a>=50&&j.Nn&&j.Bn&&this.dr)j.Zn[e]=j.Nn[h],j.qn[e]=j.Bn[h],j.Jn[e++]=this.dr[t];else if(j.Pn&&j.Gn&&this.dr){const c=j.Pn[h],f=j.Gn[h],u=this.dr[t];if(l>=50&&this.ur){const n=(50-a)*F.xi[l-a];j.Zn[e]=i+((c+((j.Pn[r]-c)*n>>16)<<9)/50|0),j.qn[e]=s+((f+((j.Gn[r]-f)*n>>16)<<9)/50|0),j.Jn[e++]=u+((this.ur[t]-u)*n>>16)}if(o>=50&&this.cr){const r=(50-a)*F.xi[o-a];j.Zn[e]=i+((c+((j.Pn[n]-c)*r>>16)<<9)/50|0),j.qn[e]=s+((f+((j.Gn[n]-f)*r>>16)<<9)/50|0),j.Jn[e++]=u+((this.cr[t]-u)*r>>16)}}}const s=j.Zn[0],n=j.Zn[1],r=j.Zn[2],h=j.qn[0],o=j.qn[1],l=j.qn[2];if(!((s-n)*(l-o)-(h-o)*(r-n)<=0))if(F.Ui=!1,3===e){let e;if((s<0||n<0||r<0||s>m.wt||n>m.wt||r>m.wt)&&(F.Ui=!0),e=this.wr?3&this.wr[t]:0,i)F.Tt(s,n,h,o,j.Jn[0]),F.Tt(n,r,o,l,j.Jn[1]),F.Tt(r,s,l,h,j.Jn[2]);else if(0===e)F.ne(s,n,r,h,o,l,j.Jn[0],j.Jn[1],j.Jn[2]);else if(1===e&&this.cr)F.he(s,n,r,h,o,l,F.palette[this.cr[t]]);else if(2===e&&this.wr&&this.Tr&&j.Pn&&j.Gn&&j.Wn){const i=this.wr[t]>>2,e=this.br[i],a=this.Rr[i],c=this.Or[i];F.le(s,n,r,h,o,l,j.Jn[0],j.Jn[1],j.Jn[2],j.Pn[e],j.Gn[e],j.Wn[e],j.Pn[a],j.Pn[c],j.Gn[a],j.Gn[c],j.Wn[a],j.Wn[c],this.Tr[t])}else if(3===e&&this.wr&&this.Tr&&this.cr&&j.Pn&&j.Gn&&j.Wn){const i=this.wr[t]>>2,e=this.br[i],a=this.Rr[i],c=this.Or[i];F.le(s,n,r,h,o,l,this.cr[t],this.cr[t],this.cr[t],j.Pn[e],j.Gn[e],j.Wn[e],j.Pn[a],j.Pn[c],j.Gn[a],j.Gn[c],j.Wn[a],j.Wn[c],this.Tr[t])}}else if(4===e){let e;if((s<0||n<0||r<0||s>m.wt||n>m.wt||r>m.wt||j.Zn[3]<0||j.Zn[3]>m.wt)&&(F.Ui=!0),e=this.wr?3&this.wr[t]:0,i)F.Tt(s,n,h,o,j.Jn[0]),F.Tt(n,r,o,l,j.Jn[1]),F.Tt(r,j.Zn[3],l,j.qn[3],j.Jn[2]),F.Tt(j.Zn[3],s,j.qn[3],h,j.Jn[3]);else if(0===e)F.ne(s,n,r,h,o,l,j.Jn[0],j.Jn[1],j.Jn[2]),F.ne(s,r,j.Zn[3],h,l,j.qn[3],j.Jn[0],j.Jn[2],j.Jn[3]);else if(1===e){if(this.cr){const i=F.palette[this.cr[t]];F.he(s,n,r,h,o,l,i),F.he(s,r,j.Zn[3],h,l,j.qn[3],i)}}else if(2===e&&this.wr&&this.Tr&&j.Pn&&j.Gn&&j.Wn){const i=this.wr[t]>>2,e=this.br[i],a=this.Rr[i],c=this.Or[i];F.le(s,n,r,h,o,l,j.Jn[0],j.Jn[1],j.Jn[2],j.Pn[e],j.Gn[e],j.Wn[e],j.Pn[a],j.Pn[c],j.Gn[a],j.Gn[c],j.Wn[a],j.Wn[c],this.Tr[t]),F.le(s,r,j.Zn[3],h,l,j.qn[3],j.Jn[0],j.Jn[2],j.Jn[3],j.Pn[e],j.Gn[e],j.Wn[e],j.Pn[a],j.Pn[c],j.Gn[a],j.Gn[c],j.Wn[a],j.Wn[c],this.Tr[t])}else if(3===e&&this.wr&&this.Tr&&this.cr&&j.Pn&&j.Gn&&j.Wn){const i=this.wr[t]>>2,e=this.br[i],a=this.Rr[i],c=this.Or[i];F.le(s,n,r,h,o,l,this.cr[t],this.cr[t],this.cr[t],j.Pn[e],j.Gn[e],j.Wn[e],j.Pn[a],j.Pn[c],j.Gn[a],j.Gn[c],j.Wn[a],j.Wn[c],this.Tr[t]),F.le(s,r,j.Zn[3],h,l,j.qn[3],this.cr[t],this.cr[t],this.cr[t],j.Pn[e],j.Gn[e],j.Wn[e],j.Pn[a],j.Pn[c],j.Gn[a],j.Gn[c],j.Wn[a],j.Wn[c],this.Tr[t])}}}ih(t,i,e,s,n){if(!s)return;const r=s.length;if(0===n){let n=0;j.$n=0,j.Qn=0,j.tr=0;for(let t=0;t0?(j.$n=(j.$n/n|0)+t,j.Qn=(j.Qn/n|0)+i,j.tr=(j.tr/n|0)+e):(j.$n=t,j.Qn=i,j.tr=e)}else if(1===n)for(let n=0;n=this.Yr.length)continue;const h=this.Yr[r];if(h)for(let s=0;s=this.Yr.length)continue;const h=this.Yr[r];if(h)for(let s=0;s>16;this.ar[n]=this.ar[n]*c-this.Ar[n]*a>>16,this.Ar[n]=t}if(0!==r){a=F.sin[r],c=F.cos[r];const t=this.ar[n]*c-this.pr[n]*a>>16;this.pr[n]=this.ar[n]*a+this.pr[n]*c>>16,this.ar[n]=t}if(0!==o){a=F.sin[o],c=F.cos[o];const t=this.pr[n]*a+this.Ar[n]*c>>16;this.pr[n]=this.pr[n]*c-this.Ar[n]*a>>16,this.Ar[n]=t}this.Ar[n]+=j.$n,this.ar[n]+=j.Qn,this.pr[n]+=j.tr}}else if(3===n)for(let n=0;n=this.Yr.length)continue;const h=this.Yr[r];if(h)for(let s=0;s=this.Hr.length)continue;const n=this.Hr[e];if(n)for(let i=0;i255&&(this.Er[e]=255)}}}ah(){this.Fr=0,this.kr=0,this.Dr=0,this.vr=999999,this.Lr=-999999,this.Mr=-99999,this.Sr=99999;for(let t=0;tthis.Lr&&(this.Lr=i),sthis.Mr&&(this.Mr=s),-e>this.Fr&&(this.Fr=-e),e>this.Dr&&(this.Dr=e);const n=i*i+s*s;n>this.kr&&(this.kr=n)}this.kr=0|Math.sqrt(this.kr),this.Br=0|Math.sqrt(this.kr*this.kr+this.Fr*this.Fr),this.Nr=this.Br+(0|Math.sqrt(this.kr*this.kr+this.Dr*this.Dr))}dh(t,i,e,s,n,r,h,o){return!(ie&&i>s&&i>n)&&(!(t{const e=t.read(i+'.dat');if(!e)throw new Error(`${i} jpeg not found!`);const s=await(async t=>{255!==t[0]&&(t[0]=255),URL.revokeObjectURL(I.src),I.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>I.onload=()=>t())),g.clearRect(0,0,_.width,_.height);const i=I.naturalWidth,e=I.naturalHeight;return _.width=i,_.height=e,g.drawImage(I,0,0),g.getImageData(0,0,i,e)})(e),n=new J(s.width,s.height),r=new Uint32Array(s.data.buffer),h=n.ft;for(let t=0;t>24&255)<<24|(255&i)<<16|(i>>8&255)<<8|i>>16&255}return n};static Ci=(t,i,e=0)=>{const s=new R(t.read(i+'.dat')),n=new R(t.read('index.dat'));n.Xt=s.Jt;const r=n.Jt,h=n.Jt,o=[],l=n.Zt-1;for(let t=0;ts.length||n.Xt>n.length)throw new Error;const a=n.Zt,c=n.Zt,f=n.Jt,u=n.Jt,d=new J(f,u);d.pi=a,d._i=c,d.Ii=r,d.gi=h;const w=n.Zt;if(0===w){const t=d.width*d.height;for(let i=0;im.bottom&&(n-=i+n-m.bottom),tm.right){const i=t+r-m.right;r-=i,o+=i,h+=i}r>0&&n>0&&this.Ch(r,n,this.ft,s,o,m.ft,e,h)}Eh(t,i,e){i|=0,e|=0;let s=(i+=this.pi)+(e+=this._i)*m.ut,n=0,r=this.height,h=this.width,o=m.ut-h,l=0;if(em.bottom&&(r-=e+r-m.bottom),im.right){const t=i+h-m.right;h-=t,l+=t,o+=t}h>0&&r>0&&this.Th(h,r,this.ft,n,l,m.ft,s,o,t)}bh(t,i){t|=0,i|=0;let e=(t+=this.pi)+(i+=this._i)*m.ut,s=0,n=this.height,r=this.width,h=m.ut-r,o=0;if(im.bottom&&(n-=i+n-m.bottom),tm.right){const i=t+r-m.right;r-=i,o+=i,h+=i}r>0&&n>0&&this.Rh(r,n,this.ft,s,o,m.ft,e,h)}Ti(){const t=this.ft,i=this.width,e=this.height;for(let s=0;s>16&255;r+=t,r<1?r=1:r>255&&(r=255);let h=n>>8&255;h+=i,h<1?h=1:h>255&&(h=255);let o=255&n;o+=e,o<1?o=1:o>255&&(o=255),this.ft[s]=(r<<16)+(h<<8)+o}}}Oi(t,i,e,s){t|=0,i|=0,e|=0,s|=0;try{const n=this.width;let r=0,h=0;const o=this.Ii,l=this.gi,a=(o<<16)/e|0,c=(l<<16)/s|0;t+=(this.pi*e+o-1)/o|0,i+=(this._i*s+l-1)/l|0,this.pi*e%o!=0&&(r=(o-this.pi*e%o<<16)/e|0),this._i*s%l!=0&&(h=(l-this._i*s%l<<16)/s|0),e=e*(this.width-(r>>16))/o|0,s=s*(this.height-(h>>16))/l|0;let f=t+i*m.ut,u=m.ut-e;if(im.bottom&&(s-=i+s-m.bottom),tm.right){const i=t+e-m.right;e-=i,u+=i}this.scale(e,s,this.ft,r,h,m.ft,u,f,n,a,c)}catch(t){console.error('error in sprite clipping routine')}}Oh(t,i,e,s,n,r,h,o,l,a){t|=0,i|=0,e|=0,s|=0;try{const c=-e/2|0,f=-s/2|0,u=65536*Math.sin(l/326.11)|0,d=65536*Math.cos(l/326.11)|0,w=u*a>>8,y=d*a>>8;let A=(h<<16)+f*w+c*y,p=f*y-c*w+(o<<16),_=t+i*m.ut;for(let t=0;t>16)+(h>>16)*this.width],s+=y,h-=w;A+=w,p+=y,_+=m.ut}}catch(t){}}Lh(t,i,e){t|=0,i|=0;let s=(t+=this.pi)+(i+=this._i)*m.ut,n=0,r=this.height,h=this.width,o=m.ut-h,l=0;if(im.bottom&&(r-=i+r-m.bottom),tm.right){const i=t+h-m.right;h-=i,l+=i,o+=i}h>0&&r>0&&this.Sh(h,r,this.ft,l,n,m.ft,s,o,e.ft)}scale(t,i,e,s,n,r,h,o,l,a,c){try{const f=s;for(let u=-i;u<0;u++){const i=(n>>16)*l;for(let n=-t;n<0;n++){const t=e[(s>>16)+i];0===t?o++:r[o++]=t,s+=a}n+=c,s=f,o+=h}}catch(t){console.error('error in plot_scale')}}Rh(t,i,e,s,n,r,h,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++)r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++];for(let i=t;i<0;i++)r[h++]=e[s++];h+=o,s+=n}}Th(t,i,e,s,n,r,h,o,l){const a=256-l;for(let c=-i;c<0;c++){for(let i=-t;i<0;i++){const t=e[s++];if(0===t)h++;else{const i=r[h];r[h++]=((16711935&t)*l+(16711935&i)*a&4278255360)+((65280&t)*l+(65280&i)*a&16711680)>>8}}h+=o,s+=n}}Ch(t,i,e,s,n,r,h,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=e[s++];0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=t}h+=o,s+=n}}Sh(t,i,e,s,n,r,h,o,l){const a=-(t>>2);t=-(3&t);for(let c=-i;c<0;c++){for(let t=a;t<0;t++){let t=e[n++];0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++}for(let i=t;i<0;i++){const t=e[n++];0!==t&&0===l[h]?r[h++]=t:h++}h+=o,n+=s}}}class ${static xh=['_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9'];static Mh=t=>{t=t.trim();let i=0n;for(let e=0;e=65&&s<=90?i+=BigInt(s+1-65):s>=97&&s<=122?i+=BigInt(s+1-97):s>=48&&s<=57&&(i+=BigInt(s+27-48))}return i};static kh=t=>{if(t<0n||t>=6582952005840035281n)return'invalid_name';if(t%37n===0n)return'invalid_name';let i=0;const e=Array(12);for(;0n!==t;){const s=t;t/=37n,e[11-i++]=this.xh[Number(s-37n*t)]}return e.slice(12-i).join('')};static Dh=t=>{const i=[...t.toLowerCase()];let e=!0;for(let t=0;t='a'&&s<='z'&&(i[t]=s.toUpperCase(),e=!1),'.'!==s&&'!'!==s||(e=!0)}return i.join('')};static Fh=t=>{let i='';for(let e=0;e(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static Bh=t=>{if(0===t.length)return t;const i=[...t];for(let t=0;t='a'&&i[t+1]<='z'&&(i[t+1]=String.fromCharCode(i[t+1].charCodeAt(0)+'A'.charCodeAt(0)-97)));return i[0]>='a'&&i[0]<='z'&&(i[0]=String.fromCharCode(i[0].charCodeAt(0)+'A'.charCodeAt(0)-97)),i.join('')};static Uh=t=>{const i=t.toUpperCase();let e=0n;for(let t=0;t>56n)&0xffffffffffffffn;return e}}class Q{static tn=[];static Ph=null;static Gh=null;static Wh=0;static Yh=1;static Hh=2;static Vh=3;static Kh=4;static Xh=5;static jh=6;static zh=7;static Zh=1;static qh=2;static Jh=3;static $h=4;static Qh=5;static io=6;static eo=1;static so=100;static no=101;static ro=200;static ho=201;static oo=202;static lo=203;static ao=205;static co=300;static fo=301;static uo=302;static do=303;static wo=304;static yo=305;static mo=306;static Ao=307;static po=308;static _o=309;static Io=310;static Co=311;static Eo=312;static To=313;static bo=314;static Ro=315;static Oo=316;static vo=317;static Lo=318;static So=319;static xo=320;static Mo=321;static ko=322;static Do=323;static Fo=324;static No=325;static Bo=326;static Uo=327;static Po=401;static Go=500;static Wo=501;static Yo=502;static Ho=503;static Vo=600;static Ko=601;static Xo=602;static jo=603;static zo=604;static Zo=605;static qo=606;static Jo=607;static $o=608;static Qo=609;static tl=610;static il=611;static el=612;static sl=613;static nl=650;static rl=651;static hl=652;static ol=653;static ll=654;static al=655;static en=(t,i,e)=>{this.Ph=new q(5e4),this.Gh=new q(5e4);const s=new R(t.read('data'));let n=-1;for(s.Xt+=2;s.Xt0){r.wl=new Uint8Array(h),r.yl=new Uint16Array(h);for(let t=0;t0){r.scripts=new v(o,null);for(let t=0;t0){const s=e.lastIndexOf(',');r.Ol[t]=this.vl(i,e.substring(0,s),parseInt(e.substring(s+1),10))}}r.Ll=new v(5,null);for(let t=0;t<5;t++){const i=s.ni;r.Ll[t]=i,0===i.length&&(r.Ll[t]=null)}}if(r.type===Q.Vh&&(r.fill=1===s.Zt),r.type===Q.Kh||r.type===Q.Yh){r.Sl=1===s.Zt;const t=s.Zt;e&&(r.font=e[t]),r.xl=1===s.Zt}if(r.type===Q.Kh&&(r.text=s.ni,r.Ml=s.ni),r.type!==Q.Yh&&r.type!==Q.Vh&&r.type!==Q.Kh||(r.kl=s.ti),r.type!==Q.Vh&&r.type!==Q.Kh||(r.Dl=s.ti,r.Fl=s.ti),r.type===Q.Xh){const t=s.ni;if(t.length>0){const e=t.lastIndexOf(',');r.Nl=this.vl(i,t.substring(0,e),parseInt(t.substring(e+1),10))}const e=s.ni;if(e.length>0){const t=e.lastIndexOf(',');r.Bl=this.vl(i,e.substring(0,t),parseInt(e.substring(t+1),10))}}if(r.type===Q.jh){const t=s.Zt;0!==t&&(r.model=this.Ul((t-1<<8)+s.Zt));const i=s.Zt;0!==i&&(r.Pl=this.Ul((i-1<<8)+s.Zt)),r.Gl=s.Zt,0===r.Gl?r.Gl=-1:r.Gl=(r.Gl-1<<8)+s.Zt,r.Wl=s.Zt,0===r.Wl?r.Wl=-1:r.Wl=(r.Wl-1<<8)+s.Zt,r.zoom=s.Jt,r.Yl=s.Jt,r.Hl=s.Jt}if(r.type===Q.zh){r._l=new Int32Array(r.width*r.height),r.Il=new Int32Array(r.width*r.height),r.Sl=1===s.Zt;const t=s.Zt;e&&(r.font=e[t]),r.xl=1===s.Zt,r.kl=s.ti,r.El=s.$t,r.Tl=s.$t,r.gl=1===s.Zt,r.Ll=new v(5,null);for(let t=0;t<5;t++){const i=s.ni;r.Ll[t]=i,0===i.length&&(r.Ll[t]=null)}}r.fl!==Q.qh&&r.type!==Q.Hh||(r.Vl=s.ni,r.action=s.ni,r.Kl=s.Jt),r.fl!==Q.Zh&&r.fl!==Q.$h&&r.fl!==Q.Qh&&r.fl!==Q.io||(r.Xl=s.ni,0===r.Xl.length&&(r.fl===Q.Zh?r.Xl='Ok':r.fl===Q.$h||r.fl===Q.Qh?r.Xl='Select':r.fl===Q.io&&(r.Xl='Continue')))}this.Ph=null,this.Gh=null};static vl=(t,i,e)=>{const s=$.Uh(i)<<8n|BigInt(e);if(this.Ph){const t=this.Ph.get(s);if(t)return t}let n;try{n=J.Ci(t,i,e),this.Ph?.put(s,n)}catch(t){return null}return n};static Ul=t=>{if(this.Gh){const i=this.Gh.get(BigInt(t));if(i)return i}const i=j.model(t);return this.Gh?.put(BigInt(t),i),i};id=-1;cl=-1;type=-1;fl=-1;ul=0;width=0;height=0;dl=-1;wl=null;yl=null;scripts=null;scroll=0;hide=!1;draggable=!1;gl=!1;Cl=!1;El=0;Tl=0;bl=null;Rl=null;Ol=null;Ll=null;fill=!1;Sl=!1;font=null;xl=!1;text=null;Ml=null;kl=0;Dl=0;Fl=0;Nl=null;Bl=null;model=null;Pl=null;Gl=-1;Wl=-1;zoom=0;Yl=0;Hl=0;Vl=null;action=null;Kl=-1;Xl=null;ml=null;Al=null;pl=null;x=0;y=0;jl=0;_l=null;Il=null;zl=0;Zl=0;Ul(t,i,e){let s=this.model;if(e&&(s=this.Pl),!s)return null;if(-1===t&&-1===i&&!s.Tr)return s;const n=j.Ur(s,!0,!0,!1);return-1===t&&-1===i||n.Qr(),-1!==t&&n.eh(t),-1!==i&&n.eh(i),n.oh(64,768,-50,-10,-50,!0),n}ql(){if(this.cl===this.id)return this.x;let t=Q.tn[this.cl];if(!t.ml||!t.Al||!t.pl)return this.x;let i=t.ml.indexOf(this.id);if(-1===i)return this.x;let e=t.Al[i];for(;t.cl!==t.id;){const s=Q.tn[t.cl];s.ml&&s.Al&&s.pl&&(i=s.ml.indexOf(t.id),-1!==i&&(e+=s.Al[i])),t=s}return e}Jl(){if(this.cl===this.id)return this.y;let t=Q.tn[this.cl];if(!t.ml||!t.Al||!t.pl)return this.y;let i=t.ml.indexOf(this.id);if(-1===i)return this.y;let e=t.pl[i];for(;t.cl!==t.id;){const s=Q.tn[t.cl];s.ml&&s.Al&&s.pl&&(i=s.ml.indexOf(t.id),-1!==i&&(e+=s.pl[i])),t=s}return e}outline(t){const i=this.ql(),e=this.Jl();m.gt(i,e,this.width,this.height,t)}move(t,i){if(this.cl===this.id)return;this.x=0,this.y=0;const e=Q.tn[this.cl];if(e.ml&&e.Al&&e.pl){const s=e.ml.indexOf(this.id);-1!==s&&(e.Al[s]=t,e.pl[s]=i)}}delete(){if(this.cl===this.id)return;const t=Q.tn[this.cl];if(t.ml&&t.Al&&t.pl){const i=t.ml.indexOf(this.id);-1!==i&&(t.ml.splice(i,1),t.Al.splice(i,1),t.pl.splice(i,1))}}}var tt,it=(tt="file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/tinymidipcm.mjs",function(t){var i,s,n=void 0!==(t=t||{})?t:{};n.ready=new Promise((function(t,e){i=t,s=e})),["_tsf_load_memory","_tsf_set_output","_tsf_channel_set_bank_preset","_tsf_set_max_voices","_tsf_channel_set_presetnumber","_tsf_reset","_tsf_close","_tml_load_memory","_midi_render","_malloc","_realloc","_free","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(n.ready,t)||Object.defineProperty(n.ready,t,{get:()=>X('You are getting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),set:()=>X('You are setting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js')})}));var r=Object.assign({},n),h=[],o='object'==typeof window,l='function'==typeof importScripts,a='object'==typeof process&&'object'==typeof process.versions&&'string'==typeof process.versions.node,c=!o&&!a&&!l;if(n.ENVIRONMENT)throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');var f,u,d,w='';if(a){if('undefined'==typeof process||!process.release||'node'!==process.release.name)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');var y,m;w=l?require('path').$l(w)+'/':__dirname+'/';var A=()=>{m||(y=require('fs'),m=require('path'))};f=(t,i)=>(A(),t=m.normalize(t),y.Ql(t,i?void 0:'utf8')),d=t=>{var i=f(t,!0);return i.buffer||(i=new Uint8Array(i)),k(i.buffer),i},u=(t,i,e)=>{A(),t=m.normalize(t),y.ta(t,(function(t,s){t?e(t):i(s.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,'/'),h=process.argv.slice(2),process.on('uncaughtException',(function(t){if(!(t instanceof nt))throw t})),process.on('unhandledRejection',(function(t){throw t})),n.inspect=function(){return'[Emscripten Module object]'}}else if(c){if('object'==typeof process&&'function'==typeof require||'object'==typeof window||'function'==typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');'undefined'!=typeof read&&(f=function(t){return read(t)}),d=function(t){let i;return'function'==typeof readbuffer?new Uint8Array(readbuffer(t)):(i=read(t,'binary'),k('object'==typeof i),i)},u=function(t,i,e){setTimeout((()=>i(d(t))),0)},'undefined'!=typeof scriptArgs?h=scriptArgs:void 0!==arguments&&(h=arguments),'undefined'!=typeof print&&('undefined'==typeof console&&(console={}),console.log=print,console.warn=console.error='undefined'!=typeof printErr?printErr:print)}else{if(!o&&!l)throw new Error('environment detection error');if(l?w=self.location.href:'undefined'!=typeof document&&document.currentScript&&(w=document.currentScript.src),tt&&(w=tt),w=0!==w.indexOf('blob:')?w.substr(0,w.replace(/[?#].*/,"").lastIndexOf('/')+1):'','object'!=typeof window&&'function'!=typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');f=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.send(null),i.responseText},l&&(d=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.responseType='arraybuffer',i.send(null),new Uint8Array(i.response)}),u=(t,i,e)=>{var s=new XMLHttpRequest;s.open('GET',t,!0),s.responseType='arraybuffer',s.onload=()=>{200==s.status||0==s.status&&s.response?i(s.response):e()},s.onerror=e,s.send(null)}}n.print||console.log.bind(console);var p,_,I=n.printErr||console.warn.bind(console);function g(t,i){Object.getOwnPropertyDescriptor(n,t)||Object.defineProperty(n,t,{configurable:!0,get:function(){X('Module.'+t+' has been replaced with plain '+i+' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')}})}function C(t){return'FS_createPath'===t||'FS_createDataFile'===t||'FS_createPreloadedFile'===t||'FS_unlink'===t||'addRunDependency'===t||'FS_createLazyFile'===t||'FS_createDevice'===t||'removeRunDependency'===t}Object.assign(n,r),r=null,p='fetchSettings',Object.getOwnPropertyDescriptor(n,p)&&X('`Module.'+p+'` was supplied but `'+p+'` not included in INCOMING_MODULE_JS_API'),n.arguments&&(h=n.arguments),g('arguments','arguments_'),n.thisProgram&&n.thisProgram,g('thisProgram','thisProgram'),n.quit&&n.quit,g('quit','quit_'),k(void 0===n.memoryInitializerPrefixURL,'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'),k(void 0===n.pthreadMainPrefixURL,'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'),k(void 0===n.cdInitializerPrefixURL,'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'),k(void 0===n.filePackagePrefixURL,'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'),k(void 0===n.read,'Module.read option was removed (modify read_ in JS)'),k(void 0===n.readAsync,'Module.readAsync option was removed (modify readAsync in JS)'),k(void 0===n.readBinary,'Module.readBinary option was removed (modify readBinary in JS)'),k(void 0===n.setWindowTitle,'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'),k(void 0===n.TOTAL_MEMORY,'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'),g('read','read_'),g('readAsync','readAsync'),g('readBinary','readBinary'),g('setWindowTitle','setWindowTitle'),k(!c,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),n.wasmBinary&&(_=n.wasmBinary),g('wasmBinary','wasmBinary');var E;n.noExitRuntime;g('noExitRuntime','noExitRuntime'),'object'!=typeof WebAssembly&&X('no native wasm support detected');var T,b,R,O,v,L,S,x,M=!1;function k(t,i){t||X('Assertion failed'+(i?': '+i:''))}function D(t){T=t,n.HEAP8=b=new Int8Array(t),n.HEAP16=O=new Int16Array(t),n.HEAP32=v=new Int32Array(t),n.HEAPU8=R=new Uint8Array(t),n.HEAPU16=new Uint16Array(t),n.HEAPU32=L=new Uint32Array(t),n.HEAPF32=S=new Float32Array(t),n.HEAPF64=x=new Float64Array(t)}'undefined'!=typeof TextDecoder&&new TextDecoder('utf8');var F=5242880;n.TOTAL_STACK&&k(F===n.TOTAL_STACK,'the stack size can no longer be determined at runtime');var N=n.INITIAL_MEMORY||16777216;function B(){if(!M){var t=ft(),i=L[t>>2],e=L[t+4>>2];34821223==i&&2310721022==e||X('Stack overflow! Stack cookie has been overwritten at 0x'+t.toString(16)+', expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+e.toString(16)+' 0x'+i.toString(16)),1668509029!==L[0]&&X('Runtime error: The application has corrupted its heap memory area (address zero)!')}}g('INITIAL_MEMORY','INITIAL_MEMORY'),k(N>=F,'INITIAL_MEMORY should be larger than TOTAL_STACK, was '+N+'! (TOTAL_STACK='+F+')'),k('undefined'!=typeof Int32Array&&'undefined'!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,'JS engine does not provide full typed array support'),k(!n.wasmMemory,'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'),k(16777216==N,'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'),function(){var t=new Int16Array(1),i=new Int8Array(t.buffer);if(t[0]=25459,115!==i[0]||99!==i[1])throw'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'}();var U=[],P=[],G=[],W=!1;k(Math.imul,'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),k(Math.fround,'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),k(Math.clz32,'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),k(Math.trunc,'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');var Y=0,H=null,V=null,K={};function X(t){n.onAbort&&n.onAbort(t),I(t='Aborted('+t+')'),M=!0;var i=new WebAssembly.RuntimeError(t);throw s(i),i}var j={error:function(){X('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM')},init:function(){j.error()},ia:function(){j.error()},ea:function(){j.error()},sa:function(){j.error()},open:function(){j.error()},na:function(){j.error()},ra:function(){j.error()},ha:function(){j.error()},oa:function(){j.error()},la:function(){j.error()}};n.FS_createDataFile=j.ia,n.FS_createPreloadedFile=j.ea;var z,Z,q,J,$='data:application/octet-stream;base64,';function Q(t){return t.startsWith($)}function it(t){return t.startsWith('file://')}function et(t,i){return function(){var e=t,s=i;return i||(s=n.asm),k(W,'native function `'+e+'` called before runtime initialization'),s[t]||k(s[t],'exported native function `'+e+'` not found'),s[t].apply(null,arguments)}}function st(t){try{if(t==z&&_)return new Uint8Array(_);if(d)return d(t);throw"both async and sync fetching of the wasm failed"}catch(t){X(t)}}function nt(t){this.name='ExitStatus',this.message='Program terminated with exit('+t+')',this.status=t}function rt(t){for(;t.length>0;)t.shift()(n)}function ht(t){ht.aa||(ht.aa={}),ht.aa[t]||(ht.aa[t]=1,a&&(t='warning: '+t),I(t))}function ot(t){try{return E.ca(t-T.byteLength+65535>>>16),D(E.buffer),1}catch(i){I('emscripten_realloc_buffer: Attempted to grow heap from '+T.byteLength+' bytes to '+t+' bytes, but got error: '+i)}}n.locateFile?Q(z='tinymidipcm.wasm')||(Z=z,z=n.locateFile?n.locateFile(Z,w):w+Z):z=new URL(e(8227),e.b).toString();var lt,at={"emscripten_memcpy_big":function(t,i,e){R.copyWithin(t,i,i+e)},"emscripten_resize_heap":function(t){var i=R.length;k((t>>>=0)>i);var e,s,n=2147483648;if(t>n)return I('Cannot enlarge memory, asked to go up to '+t+' bytes, but the limit is '+n+' bytes!'),!1;for(var r=1;r<=4;r*=2){var h=i*(1+.2/r);h=Math.min(h,t+100663296);var o=Math.min(n,(e=Math.max(t,h))+((s=65536)-e%s)%s);if(ot(o))return!0}return I('Failed to grow the heap from '+i+' bytes to '+o+' bytes, not enough memory!'),!1}},ct=(function(){var t,i={'env':at,'wasi_snapshot_preview1':at};function e(t,i){var e,s=t.exports;n.asm=s,k(E=n.asm.memory,"memory not found in wasm exports"),D(E.buffer),k(n.asm.__indirect_function_table,"table not found in wasm exports"),e=n.asm.__wasm_call_ctors,P.unshift(e),function(t){if(Y--,n.monitorRunDependencies&&n.monitorRunDependencies(Y),t?(k(K[t]),delete K[t]):I('warning: run dependency removed without ID'),0==Y&&(null!==H&&(clearInterval(H),H=null),V)){var i=V;V=null,i()}}('wasm-instantiate')}t='wasm-instantiate',Y++,n.monitorRunDependencies&&n.monitorRunDependencies(Y),t?(k(!K[t]),K[t]=1,null===H&&'undefined'!=typeof setInterval&&(H=setInterval((function(){if(M)return clearInterval(H),void(H=null);var t=!1;for(var i in K)t||(t=!0,I('still waiting on run dependencies:')),I('dependency: '+i);t&&I('(end of list)')}),1e4))):I('warning: run dependency added without ID');var r=n;function h(t){k(n===r,'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'),r=null,e(t.instance)}function c(t){return function(){if(!_&&(o||l)){if('function'==typeof fetch&&!it(z))return fetch(z,{credentials:'same-origin'}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+z+"'";return t.arrayBuffer()})).catch((function(){return st(z)}));if(u)return new Promise((function(t,i){u(z,(function(i){t(new Uint8Array(i))}),i)}))}return Promise.resolve().then((function(){return st(z)}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){I('failed to asynchronously prepare wasm: '+t),it(z)&&I('warning: Loading from a file URI ('+z+') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing'),X(t)}))}if(n.instantiateWasm)try{return n.instantiateWasm(i,e)}catch(t){I('Module.instantiateWasm callback failed with error: '+t),s(t)}(_||'function'!=typeof WebAssembly.instantiateStreaming||Q(z)||it(z)||a||'function'!=typeof fetch?c(h):fetch(z,{credentials:'same-origin'}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(h,(function(t){return I('wasm streaming compile failed: '+t),I('falling back to ArrayBuffer instantiation'),c(h)}))}))).catch(s)}(),n.___wasm_call_ctors=et("__wasm_call_ctors"),n._malloc=et("malloc"),n._free=et("free"),n._tsf_load_memory=et("tsf_load_memory"),n._tsf_close=et("tsf_close"),n._tsf_reset=et("tsf_reset"),n._tsf_set_output=et("tsf_set_output"),n._tsf_set_max_voices=et("tsf_set_max_voices"),n._realloc=et("realloc"),n._tsf_channel_set_presetnumber=et("tsf_channel_set_presetnumber"),n._tsf_channel_set_bank_preset=et("tsf_channel_set_bank_preset"),n._tml_load_memory=et("tml_load_memory"),n._midi_render=et("midi_render"),n.___errno_location=et("__errno_location"),n._fflush=et("fflush"),n._emscripten_stack_init=function(){return(ct=n._emscripten_stack_init=n.asm.emscripten_stack_init).apply(null,arguments)}),ft=(n._emscripten_stack_get_free=function(){return(n._emscripten_stack_get_free=n.asm.emscripten_stack_get_free).apply(null,arguments)},n._emscripten_stack_get_base=function(){return(n._emscripten_stack_get_base=n.asm.emscripten_stack_get_base).apply(null,arguments)},n._emscripten_stack_get_end=function(){return(ft=n._emscripten_stack_get_end=n.asm.emscripten_stack_get_end).apply(null,arguments)});function ut(){var t;ct(),k(!(3&(t=ft()))),L[t>>2]=34821223,L[t+4>>2]=2310721022,L[0]=1668509029}function dt(t){function e(){lt||(lt=!0,n.calledRun=!0,M||(k(!W),W=!0,B(),rt(P),i(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),k(!n._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(B(),n.postRun)for('function'==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)t=n.postRun.shift(),G.unshift(t);var t;rt(G)}()))}t=t||h,Y>0||(ut(),function(){if(n.preRun)for('function'==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)t=n.preRun.shift(),U.unshift(t);var t;rt(U)}(),Y>0||(n.setStatus?(n.setStatus('Running...'),setTimeout((function(){setTimeout((function(){n.setStatus('')}),1),e()}),1)):e(),B()))}if(n.stackSave=et("stackSave"),n.stackRestore=et("stackRestore"),n.stackAlloc=et("stackAlloc"),n.setValue=function(t,i,e="i8"){switch(e.endsWith('*')&&(e='*'),e){case'i1':case'i8':b[0|t]=i;break;case'i16':O[t>>1]=i;break;case'i32':v[t>>2]=i;break;case'i64':J=[i>>>0,(q=i,+Math.abs(q)>=1?q>0?(0|Math.min(+Math.floor(q/4294967296),4294967295))>>>0:~~+Math.ceil((q-+(~~q>>>0))/4294967296)>>>0:0)],v[t>>2]=J[0],v[t+4>>2]=J[1];break;case'float':S[t>>2]=i;break;case'double':x[t>>3]=i;break;case'*':L[t>>2]=i;break;default:X('invalid type for setValue: '+e)}},n.getValue=function(t,i="i8"){switch(i.endsWith('*')&&(i='*'),i){case'i1':case'i8':return b[0|t];case'i16':return O[t>>1];case'i32':case'i64':return v[t>>2];case'float':return S[t>>2];case'double':return x[t>>3];case'*':return L[t>>2];default:X('invalid type for getValue: '+i)}return null},['run','UTF8ArrayToString','UTF8ToString','stringToUTF8Array','stringToUTF8','lengthBytesUTF8','addOnPreRun','addOnInit','addOnPreMain','addOnExit','addOnPostRun','addRunDependency','removeRunDependency','FS_createFolder','FS_createPath','FS_createDataFile','FS_createPreloadedFile','FS_createLazyFile','FS_createLink','FS_createDevice','FS_unlink','getLEB','getFunctionTables','alignFunctionTables','registerFunctions','prettyPrint','getCompilerSetting','print','printErr','callMain','abort','keepRuntimeAlive','wasmMemory','stackAlloc','stackSave','stackRestore','getTempRet0','setTempRet0','writeStackCookie','checkStackCookie','ptrToString','zeroMemory','stringToNewUTF8','exitJS','getHeapMax','emscripten_realloc_buffer','ENV','ERRNO_CODES','ERRNO_MESSAGES','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','DNS','getHostByName','Protocols','Sockets','getRandomDevice','warnOnce','traverseStack','UNWIND_CACHE','convertPCtoSourceLocation','readAsmConstArgsArray','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','handleException','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','freeTableIndexes','functionsInTableMap','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','PATH','PATH_FS','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16Decoder','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeArrayToMemory','writeAsciiToMemory','SYSCALLS','getSocketFromFD','getSocketAddress','JSEvents','registerKeyEventCallback','specialHTMLTargets','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','currentFullscreenStrategy','restoreOldWindowedStyle','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','demangle','demangleAll','jsStackTrace','stackTrace','ExitStatus','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','dlopenMissingError','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','uncaughtExceptionCount','exceptionLast','exceptionCaught','ExceptionInfo','exception_addRef','exception_decRef','Browser','setMainLoop','wget','FS','MEMFS','TTY','PIPEFS','SOCKFS','_setNetworkCallback','tempFixedLengthArray','miniTempWebGLFloatBuffers','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','GL','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','AL','SDL_unicode','SDL_ttfContext','SDL_audio','SDL','SDL_gfx','GLUT','EGL','GLFW_Window','GLFW','GLEW','IDBStore','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){Object.getOwnPropertyDescriptor(n,t)||Object.defineProperty(n,t,{configurable:!0,get:function(){var i="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";C(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),X(i)}})})),['ptrToString','zeroMemory','stringToNewUTF8','exitJS','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','getHostByName','getRandomDevice','traverseStack','convertPCtoSourceLocation','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeAsciiToMemory','getSocketFromFD','getSocketAddress','registerKeyEventCallback','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','ExceptionInfo','exception_addRef','exception_decRef','setMainLoop','_setNetworkCallback','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','SDL_unicode','SDL_ttfContext','SDL_audio','GLFW_Window','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){'undefined'==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var i='`'+t+'` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line';C(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),ht(i)}})})),V=function t(){lt||dt(),lt||(V=t)},n.preInit)for('function'==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return dt(),t.ready});const et=it;const st=class{constructor(t={}){this.fa=void 0,this.ua=0,this.da=0,this.wa=0,this.ya=t.ya||100,this.sampleRate=t.sampleRate||44100,this.ma=t.ma||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.Aa(1),this.pa=t.pa||(()=>{}),this._a=t._a||(()=>{}),this.Ia=void 0,this.test=0}async init(){if(!this.fa){if('undefined'!=typeof process){const{$l:t}=await import('path'),{ga:i}=await import('module');globalThis.__dirname=t("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js"),globalThis.require=i("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js")}this.fa=await et(),this.Ca=this.fa._malloc(this.bufferSize),this.Ea=this.fa._malloc(8)}}Aa(t){this.bufferSize=4*this.sampleRate*this.ma*t}Ta(){if(!this.fa)throw new Error(`${this.constructor.name} not initalized. call .init()`)}ba(t){this.Ta();const{_malloc:i,_free:e,_tsf_load_memory:s,_tsf_set_output:n,_tsf_channel_set_bank_preset:r,_tsf_set_max_voices:h,_tsf_channel_set_presetnumber:o}=this.fa;e(this.ua),this.ua=i(t.length),this.fa.HEAPU8.set(t,this.ua),this.da=s(this.ua,t.length),n(this.da,2===this.ma?0:2,this.sampleRate,this.gain)}Ra(){this.Ta();const t=new Uint8Array(this.bufferSize);return t.set(this.fa.HEAPU8.subarray(this.Ca,this.Ca+this.bufferSize)),t}Oa(t){const{_malloc:i,_free:e,_tml_load_memory:s}=this.fa;return e(this.wa),this.wa=i(t.length),this.fa.HEAPU8.set(t,this.wa),s(this.wa,t.length)}va(t){const{_midi_render:i}=this.fa;return i(this.da,t,this.ma,this.sampleRate,this.Ca,this.bufferSize,this.Ea)}La(t){if(this.Ta(),!this.da)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.Ia);const{setValue:i,getValue:e}=this.fa;i(this.Ea,0,'double'),this.fa._tsf_reset(this.da),this.fa._tsf_channel_set_bank_preset(this.da,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let s=this.Oa(t);const n=()=>{s=this.va(s);const t=this.Ra();this.pa(t),s?this.Ia=setTimeout(n,this.ya):this._a(e(this.Ea,'double'))};this.Ia=setTimeout(n,16)}};!function(){window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioContext&&(window.audioContext=new window.AudioContext);var t=function(i){if(window.audioContext){var e=window.audioContext.createBuffer(1,1,22050),s=window.audioContext.createBufferSource();s.buffer=e,s.connect(window.audioContext.destination),s.start?s.start(0):s.play?s.play(0):s.noteOn&&s.noteOn(0)}document.removeEventListener('touchstart',t),document.removeEventListener('touchend',t),document.removeEventListener('click',t)};document.addEventListener('touchstart',t),document.addEventListener('touchend',t),document.addEventListener('click',t)}(),(async()=>{let t=new Float32Array,i=window.audioContext.createGain();i.gain.value=.1,i.connect(window.audioContext.destination);let e=window.audioContext.currentTime,s=[];const n=new st({ya:30,pa:i=>{let e=new Float32Array(i.buffer),s=new Float32Array(t.length+e.length);s.set(t,0),s.set(e,t.length),t=s},_a:t=>{},bufferSize:102400});await n.init();const r=await fetch('./SCC1_Florestan.sf2'),h=new Uint8Array(await r.arrayBuffer());function o(){if(!window.audioContext||!t.length)return;let n=window.audioContext.createBufferSource();const r=t.length/2,h=window.audioContext.createBuffer(2,r,44100);for(let i=0;i<2;i++){const e=h.getChannelData(i);let s=i;for(let i=0;i{if(l&&clearInterval(l),t=new Float32Array,s.length){let t=i.gain.value;i.gain.value=0,s.forEach((t=>{t.stop(window.audioContext.currentTime)})),s=[],i.gain.value=t}},window._tinyMidiVolume=(t=1)=>{i.gain.value=t},window._tinyMidiPlay=async(t,i=1)=>{t&&(await window._tinyMidiStop(),-1!=i&&window._tinyMidiVolume(i),e=window.audioContext.currentTime,l=setInterval(o,250),n.La(t))}})();class nt{level;y;x;z;model;Sa;xa;Ma;ka;Da;Fa;Na;info;Ba=0;Yi=0;constructor(t,i,e,s,n,r,h,o,l,a,c,f,u){this.level=t,this.y=i,this.x=e,this.z=s,this.model=n,this.Sa=r,this.xa=h,this.Ma=o,this.ka=l,this.Da=a,this.Fa=c,this.Na=f,this.info=u}}class rt extends w{level;x;z;Ua;Pa;Ga;Wa=null;Ya=null;Ha=null;Va=null;Ka=null;Xa=null;ja=null;za=0;Za=0;qa=0;visible=!1;update=!1;Ja=!1;$a=0;Qa=0;tc=0;ic=0;constructor(t,i,e){super(),this.Ua=this.level=t,this.x=i,this.z=e,this.Pa=new v(5,null),this.Ga=new Int32Array(5)}}class ht{ec;sc;nc;rc;type;vr;Lr;Sr;Mr;Dr;Fr;mode=0;hc=0;oc=0;lc=0;ac=0;cc=0;fc=0;constructor(t,i,e,s,n,r,h,o,l,a,c){this.ec=t,this.sc=i,this.nc=e,this.rc=s,this.type=n,this.vr=r,this.Lr=h,this.Sr=o,this.Mr=l,this.Dr=a,this.Fr=c}}class ot{static OPEN=0;static uc=1;static dc=2;static wc=4;static yc=8;static mc=ot.uc<<4;static Ac=ot.dc<<4;static _c=ot.wc<<4;static Ic=ot.yc<<4;static gc=256;static Cc=512;static Ec=1024;static Tc=2048;static bc=4096;static Rc=ot.Cc<<4;static Oc=ot.Ec<<4;static vc=ot.Tc<<4;static Lc=ot.bc<<4;static Sc=ot.gc<<9;static xc=524288;static Mc=2097152;static kc=ot.Mc|ot.xc;static Dc=ot.gc|ot.kc;static Fc=ot.dc|ot.Dc;static Nc=ot.yc|ot.Dc;static Bc=ot.dc|ot.wc|ot.Nc;static Uc=ot.Ac|ot.Dc;static Pc=ot.yc|ot.mc|ot.Uc;static Gc=ot.Ic|ot.Dc;static Wc=ot.uc|ot.dc|ot.Gc;static Yc=ot.Ac|ot._c|ot.Gc;static Hc=16777215}class lt{static Vc=0;static Kc=1;static Xc=2;static jc=3}class at{static zc=0;static Zc=1;static qc=2;static Jc=3}class ct{static $c=new ct(0,at.zc);static Qc=new ct(1,at.zc);static tf=new ct(2,at.zc);static if=new ct(3,at.zc);static ef=new ct(4,at.Zc);static sf=new ct(5,at.Zc);static nf=new ct(6,at.Zc);static rf=new ct(7,at.Zc);static hf=new ct(8,at.Zc);static lf=new ct(9,at.qc);static af=new ct(10,at.qc);static cf=new ct(11,at.qc);static ff=new ct(12,at.qc);static uf=new ct(13,at.qc);static df=new ct(14,at.qc);static wf=new ct(15,at.qc);static yf=new ct(16,at.qc);static mf=new ct(17,at.qc);static Af=new ct(18,at.qc);static pf=new ct(19,at.qc);static _f=new ct(20,at.qc);static If=new ct(21,at.qc);static Jc=new ct(22,at.Jc);static values(){return[this.$c,this.Qc,this.mf,this.wf,this.tf,this.df,this.lf,this.if,this.Jc,this.ff,this.cf,this.nf,this._f,this.af,this.sf,this.uf,this.rf,this.ef,this.yf,this.hf,this.pf,this.If,this.Af]}static of(t){const i=this.values();for(let e=0;et*ut.Cf+i;offsetX;Ef;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.Ef=0,this.sizeX=ut.Cf,this.sizeZ=ut.Cf,this.flags=new Int32Array(this.sizeX*this.sizeZ),this.reset()}reset=()=>{for(let t=0;t{this.flags[ut.index(t-this.offsetX,i-this.Ef)]|=ot.Mc};bf=(t,i)=>{this.flags[ut.index(t-this.offsetX,i-this.Ef)]&=~ot.Mc};Rf=(t,i,e,s,n,r)=>{let h=ot.gc;r&&(h|=ot.Sc);const o=t-this.offsetX,l=i-this.Ef;if(n===lt.Kc||n===lt.jc){const t=e;e=s,s=t}for(let t=o;t=0&&t=0&&i{let h=ot.gc;r&&(h|=ot.Sc);const o=t-this.offsetX,l=i-this.Ef;if(n===lt.Kc||n===lt.jc){const t=e;e=s,s=t}for(let t=o;t=0&&t=0&&i{const r=t-this.offsetX,h=i-this.Ef,o=n?ot.Lc:ot.Ic,l=n?ot.bc:ot.yc,a=n?ot.Ec:ot.dc,c=n?ot.Oc:ot.Ac,f=n?ot.Cc:ot.uc,u=n?ot.Rc:ot.mc,d=n?ot.Tc:ot.wc,w=n?ot.vc:ot._c;e===ct.$c.id?s===lt.Vc?(this.add(r,h,o),this.add(r-1,h,l)):s===lt.Kc?(this.add(r,h,a),this.add(r,h+1,c)):s===lt.Xc?(this.add(r,h,l),this.add(r+1,h,o)):s===lt.jc&&(this.add(r,h,c),this.add(r,h-1,a)):e===ct.Qc.id||e===ct.if.id?s===lt.Vc?(this.add(r,h,f),this.add(r-1,h+1,u)):s===lt.Kc?(this.add(r,h,d),this.add(r+1,h+1,w)):s===lt.Xc?(this.add(r,h,u),this.add(r+1,h-1,f)):s===lt.jc&&(this.add(r,h,w),this.add(r-1,h-1,d)):e===ct.tf.id&&(s===lt.Vc?(this.add(r,h,a|o),this.add(r-1,h,l),this.add(r,h+1,c)):s===lt.Kc?(this.add(r,h,a|l),this.add(r,h+1,c),this.add(r+1,h,o)):s===lt.Xc?(this.add(r,h,c|l),this.add(r+1,h,o),this.add(r,h-1,a)):s===lt.jc&&(this.add(r,h,c|o),this.add(r,h-1,a),this.add(r-1,h,l))),n&&this.vf(t,i,e,s,!1)};Lf=(t,i,e,s,n)=>{const r=t-this.offsetX,h=i-this.Ef,o=n?ot.Lc:ot.Ic,l=n?ot.bc:ot.yc,a=n?ot.Ec:ot.dc,c=n?ot.Oc:ot.Ac,f=n?ot.Cc:ot.uc,u=n?ot.Rc:ot.mc,d=n?ot.Tc:ot.wc,w=n?ot.vc:ot._c;e===ct.$c.id?s===lt.Vc?(this.remove(r,h,o),this.remove(r-1,h,l)):s===lt.Kc?(this.remove(r,h,a),this.remove(r,h+1,c)):s===lt.Xc?(this.remove(r,h,l),this.remove(r+1,h,o)):s===lt.jc&&(this.remove(r,h,c),this.remove(r,h-1,a)):e===ct.Qc.id||e===ct.if.id?s===lt.Vc?(this.remove(r,h,f),this.remove(r-1,h+1,u)):s===lt.Kc?(this.remove(r,h,d),this.remove(r+1,h+1,w)):s===lt.Xc?(this.remove(r,h,u),this.remove(r+1,h-1,f)):s===lt.jc&&(this.remove(r,h,w),this.remove(r-1,h-1,d)):e===ct.tf.id&&(s===lt.Vc?(this.remove(r,h,a|o),this.remove(r-1,h,l),this.remove(r,h+1,c)):s===lt.Kc?(this.remove(r,h,a|l),this.remove(r,h+1,c),this.remove(r+1,h,o)):s===lt.Xc?(this.remove(r,h,c|l),this.remove(r+1,h,o),this.remove(r,h-1,a)):s===lt.jc&&(this.remove(r,h,c|o),this.remove(r,h-1,a),this.remove(r-1,h,l))),n&&this.Lf(t,i,e,s,!1)};Sf=(t,i,e,s,n,r)=>{if(t===e&&i===s)return!0;const h=t-this.offsetX,o=i-this.Ef,l=e-this.offsetX,a=s-this.Ef,c=ut.index(h,o);if(n===ct.$c.id){if(r===lt.Vc){if(h===l-1&&o===a)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.Uc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.Fc)===ot.OPEN)return!0}else if(r===lt.Kc){if(h===l&&o===a+1)return!0;if(h===l-1&&o===a&&(this.flags[c]&ot.Nc)===ot.OPEN)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.Gc)===ot.OPEN)return!0}else if(r===lt.Xc){if(h===l+1&&o===a)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.Uc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.Fc)===ot.OPEN)return!0}else if(r===lt.jc){if(h===l&&o===a-1)return!0;if(h===l-1&&o===a&&(this.flags[c]&ot.Nc)===ot.OPEN)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.Gc)===ot.OPEN)return!0}}else if(n===ct.tf.id){if(r===lt.Vc){if(h===l-1&&o===a)return!0;if(h===l&&o===a+1)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.Gc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.Fc)===ot.OPEN)return!0}else if(r===lt.Kc){if(h===l-1&&o===a&&(this.flags[c]&ot.Nc)===ot.OPEN)return!0;if(h===l&&o===a+1)return!0;if(h===l+1&&o===a)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.Fc)===ot.OPEN)return!0}else if(r===lt.Xc){if(h===l-1&&o===a&&(this.flags[c]&ot.Nc)===ot.OPEN)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.Uc)===ot.OPEN)return!0;if(h===l+1&&o===a)return!0;if(h===l&&o===a-1)return!0}else if(r===lt.jc){if(h===l-1&&o===a)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.Uc)===ot.OPEN)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.Gc)===ot.OPEN)return!0;if(h===l&&o===a-1)return!0}}else if(n===ct.lf.id){if(h===l&&o===a+1&&(this.flags[c]&ot.Ac)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.dc)===ot.OPEN)return!0;if(h===l-1&&o===a&&(this.flags[c]&ot.yc)===ot.OPEN)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.Ic)===ot.OPEN)return!0}return!1};xf=(t,i,e,s,n,r)=>{if(t===e&&i===s)return!0;const h=t-this.offsetX,o=i-this.Ef,l=e-this.offsetX,a=s-this.Ef,c=ut.index(h,o);if(n===ct.nf.id||n===ct.rf.id){if(n===ct.rf.id&&(r=r+2&3),r===lt.Vc){if(h===l+1&&o===a&&(this.flags[c]&ot.Ic)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.dc)===ot.OPEN)return!0}else if(r===lt.Kc){if(h===l-1&&o===a&&(this.flags[c]&ot.yc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.dc)===ot.OPEN)return!0}else if(r===lt.Xc){if(h===l-1&&o===a&&(this.flags[c]&ot.yc)===ot.OPEN)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.Ac)===ot.OPEN)return!0}else if(r===lt.jc){if(h===l+1&&o===a&&(this.flags[c]&ot.Ic)===ot.OPEN)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.Ac)===ot.OPEN)return!0}}else if(n===ct.hf.id){if(h===l&&o===a+1&&(this.flags[c]&ot.Ac)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.dc)===ot.OPEN)return!0;if(h===l-1&&o===a&&(this.flags[c]&ot.yc)===ot.OPEN)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.Ic)===ot.OPEN)return!0}return!1};Mf=(t,i,e,s,n,r,h)=>{const o=e+n-1,l=s+r-1,a=ut.index(t-this.offsetX,i-this.Ef);return t>=e&&t<=o&&i>=s&&i<=l||(t===e-1&&i>=s&&i<=l&&(this.flags[a]&ot.yc)===ot.OPEN&&(h&ft.Vc)===ot.OPEN||(t===o+1&&i>=s&&i<=l&&(this.flags[a]&ot.Ic)===ot.OPEN&&(h&ft.Xc)===ot.OPEN||(i===s-1&&t>=e&&t<=o&&(this.flags[a]&ot.dc)===ot.OPEN&&(h&ft.jc)===ot.OPEN||i===l+1&&t>=e&&t<=o&&(this.flags[a]&ot.Ac)===ot.OPEN&&(h&ft.Kc)===ot.OPEN)))};add=(t,i,e)=>{this.flags[ut.index(t,i)]|=e};remove=(t,i,e)=>{this.flags[ut.index(t,i)]&=ot.Hc-e}}class dt{y;x;z;model;Na;info;constructor(t,i,e,s,n,r){this.y=t,this.x=i,this.z=e,this.model=s,this.Na=n,this.info=r}}class wt{y;x;z;kf;Df;Ff;Nf;Na;info;constructor(t,i,e,s,n,r,h,o,l){this.y=t,this.x=i,this.z=e,this.kf=s,this.Df=n,this.Ff=r,this.Nf=h,this.Na=o,this.info=l}}class yt{y;x;z;type;angle;model;Na;info;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.type=s,this.angle=n,this.model=r,this.Na=h,this.info=o}}class mt{y;x;z;Bf;Uf;Pf;Na;offset;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.Bf=s,this.Uf=n,this.Pf=r,this.Na=h,this.offset=o}}class At{Gf;Wf;Yf;Hf;Vf;color;flat;constructor(t,i,e,s,n,r,h){this.Gf=t,this.Wf=i,this.Yf=e,this.Hf=s,this.Vf=n,this.color=r,this.flat=h}}class pt{static Kf=new Int32Array(6);static Xf=new Int32Array(6);static jf=new Int32Array(6);static zf=new Int32Array(6);static Zf=new Int32Array(6);static qf=[Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,2,6),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,13,14)];static Jf=[Int8Array.of(0,1,2,3,0,0,1,3),Int8Array.of(1,1,2,3,1,0,1,3),Int8Array.of(0,1,2,3,1,0,1,3),Int8Array.of(0,0,1,2,0,0,2,4,1,0,4,3),Int8Array.of(0,0,1,4,0,0,4,3,1,1,2,4),Int8Array.of(0,0,4,3,1,0,1,2,1,0,2,4),Int8Array.of(0,1,2,4,1,0,1,4,1,0,4,3),Int8Array.of(0,4,1,2,0,4,2,5,1,0,4,5,1,0,5,3),Int8Array.of(0,4,1,2,0,4,2,3,0,4,3,5,1,0,4,5),Int8Array.of(0,0,4,5,1,4,1,2,1,4,2,3,1,4,3,5),Int8Array.of(0,0,1,5,0,1,4,5,0,1,2,4,1,0,5,3,1,5,4,3,1,4,2,3),Int8Array.of(1,0,1,5,1,1,4,5,1,1,2,4,0,0,5,3,0,5,4,3,0,4,2,3),Int8Array.of(1,0,5,4,1,0,1,5,0,0,4,3,0,4,5,3,0,5,2,3,0,1,2,5)];static $f=128;static Qf=this.$f/2|0;static tu=this.$f/4|0;static iu=3*this.$f/4|0;Ar;ar;pr;eu;su;nu;ru;hu;ou;lu;flat;shape;angle;au;cu;constructor(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w,y,m,A,p){this.flat=!(m!==s||m!==d||m!==o),this.shape=i,this.angle=r,this.au=u,this.cu=l;const _=pt.qf[i],I=_.length;this.Ar=new Int32Array(I),this.ar=new Int32Array(I),this.pr=new Int32Array(I);const g=new Int32Array(I),C=new Int32Array(I),E=t*pt.$f,T=A*pt.$f;for(let t=0;t8&&I<=12&&(I=9+(I-r-9&3)),I>12&&I<=16&&(I=13+(I-r-13&3)),1===I?(i=E,l=T,c=m,u=h,A=a):2===I?(i=E+pt.Qf,l=T,c=m+s>>1,u=h+p>>1,A=a+e>>1):3===I?(i=E+pt.$f,l=T,c=s,u=p,A=e):4===I?(i=E+pt.$f,l=T+pt.Qf,c=s+d>>1,u=p+n>>1,A=e+w>>1):5===I?(i=E+pt.$f,l=T+pt.$f,c=d,u=n,A=w):6===I?(i=E+pt.Qf,l=T+pt.$f,c=d+o>>1,u=n+y>>1,A=w+f>>1):7===I?(i=E,l=T+pt.$f,c=o,u=y,A=f):8===I?(i=E,l=T+pt.Qf,c=o+m>>1,u=y+h>>1,A=f+a>>1):9===I?(i=E+pt.Qf,l=T+pt.tu,c=m+s>>1,u=h+p>>1,A=a+e>>1):10===I?(i=E+pt.iu,l=T+pt.Qf,c=s+d>>1,u=p+n>>1,A=e+w>>1):11===I?(i=E+pt.Qf,l=T+pt.iu,c=d+o>>1,u=n+y>>1,A=w+f>>1):12===I?(i=E+pt.tu,l=T+pt.Qf,c=o+m>>1,u=y+h>>1,A=f+a>>1):13===I?(i=E+pt.tu,l=T+pt.tu,c=m,u=h,A=a):14===I?(i=E+pt.iu,l=T+pt.tu,c=s,u=p,A=e):15===I?(i=E+pt.iu,l=T+pt.iu,c=d,u=n,A=w):(i=E+pt.tu,l=T+pt.iu,c=o,u=y,A=f),this.Ar[t]=i,this.ar[t]=c,this.pr[t]=l,g[t]=u,C[t]=A}const b=pt.Jf[i],R=b.length/4|0;this.ru=new Int32Array(R),this.hu=new Int32Array(R),this.ou=new Int32Array(R),this.eu=new Int32Array(R),this.su=new Int32Array(R),this.nu=new Int32Array(R),this.lu=-1!==c?new Int32Array(R):null;let O=0;for(let t=0;t{this.Ru=0,this.Ou=0,this.vu=t,this.Lu=i,this.Su=t/2|0,this.xu=i/2|0;const r=new x(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let i=0;i<2048;i+=64){this.Mu=F.sin[t],this.ku=F.cos[t],this.Du=F.sin[i],this.Fu=F.cos[i];const h=(t-128)/32|0,o=i/64|0;for(let t=-26;t<=26;t++)for(let i=-26;i<=26;i++){const l=128*t,a=128*i;let c=!1;for(let t=-e;t<=s;t+=128)if(this.wd(l,a,n[h]+t)){c=!0;break}r[h][o][t+25+1][i+25+1]=c}}for(let t=0;t<8;t++)for(let i=0;i<32;i++)for(let e=-25;e<25;e++)for(let s=-25;s<25;s++){let n=!1;t:for(let h=-1;h<=1;h++)for(let o=-1;o<=1;o++){if(r[t][i][e+h+25+1][s+o+25+1]){n=!0;break t}if(r[t][(i+1)%31][e+h+25+1][s+o+25+1]){n=!0;break t}if(r[t+1][i][e+h+25+1][s+o+25+1]){n=!0;break t}if(r[t+1][(i+1)%31][e+h+25+1][s+o+25+1]){n=!0;break t}}this.Iu[t][i][e+25][s+25]=n}};static zi=()=>{this.gu=null,this.Cu=null,this.Eu=null,this.bu=null,this.Iu=null,this.Tu=null,this.zu=null,console.log('World3D unloaded!')};static yd=(t,i,e,s,n,r,h,o)=>{It.Eu[t][It.Cu[t]++]=new ht(e/128|0,r/128|0,n/128|0,o/128|0,i,e,r,n,o,s,h)};static wd=(t,i,e)=>{const s=i*this.Du+t*this.Fu>>16,n=i*this.Fu-t*this.Du>>16,r=e*this.Mu+n*this.ku>>16,h=e*this.ku-n*this.Mu>>16;if(r<50||r>3500)return!1;const o=this.Su+((s<<9)/r|0),l=this.xu+((h<<9)/r|0);return o>=this.Ru&&o<=this.vu&&l>=this.Ou&&l<=this.Lu};md;sc;rc;Ad;pd;_d;Id;gd;Cd;Ed=0;Td=0;bd=0;constructor(t,i,e,s){this.md=e,this.sc=s,this.rc=i,this.pd=new S(e,s,i,null),this.Id=new D(e,s+1,i+1),this.Ad=t,this._d=new v(5e3,null),this.gd=new Int32Array(1e4),this.Cd=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this.Td=t;for(let i=0;i{const e=this.pd[0][t][i];for(let e=0;e<3;e++){this.pd[e][t][i]=this.pd[e+1][t][i];const s=this.pd[e][t][i];s&&s.level--}this.pd[0][t][i]||(this.pd[0][t][i]=new rt(0,t,i));const s=this.pd[0][t][i];s&&(s.ja=e),this.pd[3][t][i]=null};vd=(t,i,e,s)=>{const n=this.pd[t][i][e];n&&(n.qa=s)};Ld=(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w,y,m,A,p,_)=>{if(s===_t.fu){for(let s=t;s>=0;s--)this.pd[s][i][e]||(this.pd[s][i][e]=new rt(s,i,e));const s=this.pd[t][i][e];s&&(s.Wa=new At(c,f,u,d,-1,p,!1))}else if(s===_t.uu){for(let s=t;s>=0;s--)this.pd[s][i][e]||(this.pd[s][i][e]=new rt(s,i,e));const s=this.pd[t][i][e];s&&(s.Wa=new At(w,y,m,A,r,_,h===o&&h===l&&h===a))}else{for(let s=t;s>=0;s--)this.pd[s][i][e]||(this.pd[s][i][e]=new rt(s,i,e));const I=this.pd[t][i][e];I&&(I.Ya=new pt(i,s,y,o,u,n,c,a,_,w,r,A,p,l,m,d,h,e,f))}};Sd=(t,i,e,s,n,r,h)=>{this.pd[i][e][s]||(this.pd[i][e][s]=new rt(i,e,s));const o=this.pd[i][e][s];o&&(o.Ka=new dt(n,128*e+64,128*s+64,t,r,h))};xd=(t,i,e)=>{const s=this.pd[t][i][e];s&&(s.Ka=null)};Md=(t,i,e,s,n,r,h,o)=>{let l=0;const a=this.pd[s][t][i];if(a)for(let t=0;tl&&(l=e)}else this.pd[s][t][i]=new rt(s,t,i);const c=this.pd[s][t][i];c&&(c.Xa=new mt(e,128*t+64,128*i+64,r,h,o,n,l))};kd=(t,i,e)=>{const s=this.pd[t][i][e];s&&(s.Xa=null)};vf=(t,i,e,s,n,r,h,o,l,a)=>{if(!h&&!o)return;for(let s=t;s>=0;s--)this.pd[s][i][e]||(this.pd[s][i][e]=new rt(s,i,e));const c=this.pd[t][i][e];c&&(c.Ha=new wt(s,128*i+64,128*e+64,n,r,h,o,l,a))};Lf=(t,i,e,s)=>{const n=this.pd[t][i][e];1===s&&n&&(n.Ha=null)};Dd=(t,i,e,s,n,r,h,o,l,a,c)=>{if(!o)return;for(let s=t;s>=0;s--)this.pd[s][i][e]||(this.pd[s][i][e]=new rt(s,i,e));const f=this.pd[t][i][e];f&&(f.Va=new yt(s,128*i+n+64,128*e+r+64,c,a,o,h,l))};Fd=(t,i,e)=>{const s=this.pd[t][i][e];s&&(s.Va=null)};Nd=(t,i,e,s)=>{const n=this.pd[t][i][e];if(!n)return;const r=n.Va;if(!r)return;const h=128*i+64,o=128*e+64;r.x=h+((r.x-h)*s/16|0),r.z=o+((r.z-o)*s/16|0)};Bd=(t,i,e,s)=>{if(!s)return;const n=this.pd[t][i][e];if(!n)return;const r=n.Va;r&&(r.model=s)};Ud=(t,i,e,s)=>{if(!s)return;const n=this.pd[t][i][e];if(!n)return;const r=n.Ka;r&&(r.model=s)};Pd=(t,i,e,s)=>{if(!s)return;const n=this.pd[t][i][e];if(!n)return;const r=n.Ha;r&&(r.Ff=s)};Gd=(t,i,e,s,n)=>{if(!s)return;const r=this.pd[e][t][i];if(!r)return;const h=r.Ha;h&&(h.Ff=s,h.Nf=n)};Rf=(t,i,e,s,n,r,h,o,l,a,c)=>{if(!n&&!r)return!0;const f=128*i+64*l,u=128*e+64*a;return this.Wd(f,u,s,t,i,e,l,a,n,r,h,o,c,!1)};Yd=(t,i,e,s,n,r,h,o,l,a)=>{if(!n&&!r)return!0;let c=i-l,f=s-l,u=i+l,d=s+l;return a&&(o>640&&o<1408&&(d+=128),o>1152&&o<1920&&(u+=128),(o>1664||o<384)&&(f-=128),o>128&&o<896&&(c-=128)),c=c/128|0,f=f/128|0,u=u/128|0,d=d/128|0,this.Wd(i,s,e,t,c,f,u+1-c,d-f+1,n,r,h,0,o,!0)};Hd=(t,i,e,s,n,r,h,o,l,a,c,f)=>!l&&!a||this.Wd(i,s,e,t,n,r,h+1-n,o-r+1,l,a,c,0,f,!0);Of=(t,i,e)=>{const s=this.pd[t][i][e];if(s)for(let t=0;t>29&3)&&n.Ma===i&&n.Da===e)return void this.Vd(n)}};Kd=(t,i,e,s)=>{if(!s)return;const n=this.pd[t][i][e];if(n)for(let t=0;t>29&3))return void(i.model=s)}};Xd=()=>{for(let t=0;t{const s=this.pd[t][i][e];return s&&s.Ha?s.Ha.Na:0};zd=(t,i,e)=>{const s=this.pd[t][e][i];return s&&s.Va?s.Va.Na:0};Zd=(t,i,e)=>{const s=this.pd[t][i][e];if(!s)return 0;for(let t=0;t>29&3)&&n.Ma===i&&n.Da===e)return n.Na}return 0};qd=(t,i,e)=>{const s=this.pd[t][i][e];return s&&s.Ka?s.Ka.Na:0};Jd=(t,i,e,s)=>{const n=this.pd[t][i][e];if(n){if(n.Ha&&n.Ha.Na===s)return 255&n.Ha.info;if(n.Va&&n.Va.Na===s)return 255&n.Va.info;if(n.Ka&&n.Ka.Na===s)return 255&n.Ka.info;for(let t=0;t{const r=i*(0|Math.sqrt(e*e+s*s+n*n))>>8;for(let i=0;i{if(i0){const n=this.pd[t][i+1][e-1];n&&n.Ka&&n.Ka.model&&n.Ka.model.yr&&this.tw(s,n.Ka.model,128,0,-128,!0)}};Qd=(t,i,e,s,n,r)=>{let h=!0,o=i;const l=i+s,a=e-1,c=e+n;for(let f=t;f<=t+1;f++)if(f!==this.md){for(let u=o;u<=l;u++)if(!(u<0||u>=this.sc))for(let o=a;o<=c;o++){if(o<0||o>=this.rc||h&&u=e||u===i))continue;const a=this.pd[f][u][o];if(!a)continue;const d=128*(u-i)+64*(1-s),w=128*(o-e)+64*(1-n),y=((this.Ad[f][u][o]+this.Ad[f][u+1][o]+this.Ad[f][u][o+1]+this.Ad[f][u+1][o+1])/4|0)-((this.Ad[t][i][e]+this.Ad[t][i+1][e]+this.Ad[t][i][e+1]+this.Ad[t][i+1][e+1])/4|0),m=a.Ha;m&&m.Ff&&m.Ff.yr&&this.tw(r,m.Ff,d,y,w,h),m&&m.Nf&&m.Nf.yr&&this.tw(r,m.Nf,d,y,w,h);for(let t=0;t{this.bd++;let h=0;const o=i.Ar,l=i.rn;if(t.yr&&t.mr)for(let r=0;ri.Dr)continue;const u=t.Ar[r]-e;if(ui.Lr)continue;const d=t.pr[r]-n;if(di.Mr)continue;if(i.yr&&i.mr)for(let t=0;t{const h=this.pd[t][i][e];if(!h)return;const o=h.Wa;if(o){const t=o.color;if(0!==t)for(let i=0;i<4;i++)s[n]=t,s[n+1]=t,s[n+2]=t,s[n+3]=t,n+=r;return}const l=h.Ya;if(!l)return;const a=l.shape,c=l.angle,f=l.au,u=l.cu,d=It.od[a],w=It.ld[c];let y=0;if(0===f)for(let t=0;t<4;t++)0!==d[w[y++]]&&(s[n]=u),0!==d[w[y++]]&&(s[n+1]=u),0!==d[w[y++]]&&(s[n+2]=u),0!==d[w[y++]]&&(s[n+3]=u),n+=r;else for(let t=0;t<4;t++)s[n]=0===d[w[y++]]?f:u,s[n+1]=0===d[w[y++]]?f:u,s[n+2]=0===d[w[y++]]?f:u,s[n+3]=0===d[w[y++]]?f:u,n+=r};click=(t,i)=>{It.ju=!0,It.Xe=t,It.je=i,It.ud=-1,It.dd=-1};draw=(t,i,e,s,n,r,h)=>{t<0?t=0:t>=128*this.sc&&(t=128*this.sc-1),e<0?e=0:e>=128*this.rc&&(e=128*this.rc-1),It.Yi++,It.Mu=F.sin[r],It.ku=F.cos[r],It.Du=F.sin[n],It.Fu=F.cos[n],It.zu=It.Iu[(r-128)/32|0][n/64|0],It.Nu=t,It.Bu=i,It.Uu=e,It.Pu=t/128|0,It.Gu=e/128|0,It.Ku=s,It.Wu=It.Pu-25,It.Wu<0&&(It.Wu=0),It.Hu=It.Gu-25,It.Hu<0&&(It.Hu=0),It.Yu=It.Pu+25,It.Yu>this.sc&&(It.Yu=this.sc),It.Vu=It.Gu+25,It.Vu>this.rc&&(It.Vu=this.rc),this.sw(),It.Xu=0;for(let t=this.Td;t=2e3)?(h.visible=!0,h.update=!0,h.Ja=h.za>0,It.Xu++):(h.visible=!1,h.update=!1,h.$a=0))}}for(let t=this.Td;t=It.Yu))for(let t=-25;t<=0;t++){const n=It.Gu+t,r=It.Gu-t;let o;if(e>=It.Wu&&(n>=It.Hu&&(o=i[e][n],o&&o.visible&&this.nw(o,!0,h)),r=It.Hu&&(o=i[s][n],o&&o.visible&&this.nw(o,!0,h)),r=It.Yu))for(let t=-25;t<=0;t++){const n=It.Gu+t,r=It.Gu-t;let o;if(e>=It.Wu&&(n>=It.Hu&&(o=i[e][n],o&&o.visible&&this.nw(o,!1,h)),r=It.Hu&&(o=i[s][n],o&&o.visible&&this.nw(o,!1,h)),r{if(!l&&!a)return!1;for(let t=n;t=this.sc||i>=this.rc)return!1;const e=this.pd[s][t][i];if(e&&e.za>=5)return!1}const w=new nt(s,e,t,i,l,a,u,n,n+h-1,r,r+o-1,c,f);for(let t=n;tn&&(e|=1),tr&&(e+=8),i=0;e--)this.pd[e][t][i]||(this.pd[e][t][i]=new rt(e,t,i));const l=this.pd[s][t][i];l&&(l.Pa[l.za]=w,l.Ga[l.za]=e,l.Za|=e,l.za++)}return d&&(this._d[this.Ed++]=w),!0};Vd=t=>{for(let i=t.Ma;i<=t.ka;i++)for(let e=t.Da;e<=t.Fa;e++){const s=this.pd[t.level][i][e];if(s){for(let i=0;i{const t=It.Cu[It.Ku],i=It.Eu[It.Ku];It.fd=0;for(let e=0;e=0&&s<=50){n=t.nc+25-It.Gu,n<0&&(n=0),r=t.rc+25-It.Gu,r>50&&(r=50);let i=!1;for(;n<=r;)if(It.zu&&It.zu[s][n++]){i=!0;break}if(i){if(h=It.Nu-t.vr,h>32)t.mode=1;else{if(h>=-32)continue;t.mode=2,h=-h}t.lc=(t.Sr-It.Uu<<8)/h|0,t.ac=(t.Mr-It.Uu<<8)/h|0,t.cc=(t.Dr-It.Bu<<8)/h|0,t.fc=(t.Fr-It.Bu<<8)/h|0,It.Tu[It.fd++]=t}}}else if(2===t.type){if(s=t.nc+25-It.Gu,s>=0&&s<=50){n=t.ec+25-It.Pu,n<0&&(n=0),r=t.sc+25-It.Pu,r>50&&(r=50);let i=!1;for(;n<=r;)if(It.zu&&It.zu[n++][s]){i=!0;break}if(i){if(h=It.Uu-t.Sr,h>32)t.mode=3;else{if(h>=-32)continue;t.mode=4,h=-h}t.hc=(t.vr-It.Nu<<8)/h|0,t.oc=(t.Lr-It.Nu<<8)/h|0,t.cc=(t.Dr-It.Bu<<8)/h|0,t.fc=(t.Fr-It.Bu<<8)/h|0,It.Tu[It.fd++]=t}}}else if(4===t.type&&(s=t.Dr-It.Bu,s>128&&(n=t.nc+25-It.Gu,n<0&&(n=0),r=t.rc+25-It.Gu,r>50&&(r=50),n<=r))){let i=t.ec+25-It.Pu;i<0&&(i=0),h=t.sc+25-It.Pu,h>50&&(h=50);let e=!1;t:for(let t=i;t<=h;t++)for(let i=n;i<=r;i++)if(It.zu&&It.zu[t][i]){e=!0;break t}e&&(t.mode=5,t.hc=(t.vr-It.Nu<<8)/s|0,t.oc=(t.Lr-It.Nu<<8)/s|0,t.lc=(t.Sr-It.Uu<<8)/s|0,t.ac=(t.Mr-It.Uu<<8)/s|0,It.Tu[It.fd++]=t)}}};nw=(t,i,e)=>{for(It.bu.Mt(t);;){let t;do{if(t=It.bu.Dt(),!t)return}while(!t.update);const s=t.x,n=t.z,r=t.level,h=t.Ua,o=this.pd[r];if(t.visible){if(i){if(r>0){const t=this.pd[r-1][s][n];if(t&&t.update)continue}if(s<=It.Pu&&s>It.Wu){const i=o[s-1][n];if(i&&i.update&&(i.visible||!(1&t.Za)))continue}if(s>=It.Pu&&sIt.Hu){const i=o[s][n-1];if(i&&i.update&&(i.visible||!(8&t.Za)))continue}if(n>=It.Gu&&nn&&(a+=6),c=It.Zu[a],t.ic=It.Ju[a]),f&&(f.kf&It.qu[a]?16===f.kf?(t.$a=3,t.Qa=It.$u[a],t.tc=3-t.Qa):32===f.kf?(t.$a=6,t.Qa=It.Qu[a],t.tc=6-t.Qa):64===f.kf?(t.$a=12,t.Qa=It.td[a],t.tc=12-t.Qa):(t.$a=9,t.Qa=It.ed[a],t.tc=9-t.Qa):t.$a=0,f.kf&c&&!this.lw(h,s,n,f.kf)&&f.Ff?.draw(0,It.Mu,It.ku,It.Du,It.Fu,f.x-It.Nu,f.y-It.Bu,f.z-It.Uu,f.Na),f.Df&c&&!this.lw(h,s,n,f.Df)&&f.Nf?.draw(0,It.Mu,It.ku,It.Du,It.Fu,f.x-It.Nu,f.y-It.Bu,f.z-It.Uu,f.Na)),u&&!this.visible(h,s,n,u.model.Fr))if(u.type&c)u.model.draw(u.angle,It.Mu,It.ku,It.Du,It.Fu,u.x-It.Nu,u.y-It.Bu,u.z-It.Uu,u.Na);else if(768&u.type){const t=u.x-It.Nu,i=u.y-It.Bu,e=u.z-It.Uu,s=u.angle;let n,r;if(n=s===lt.Kc||s===lt.Xc?-t:t,r=s===lt.Xc||s===lt.jc?-e:e,256&u.type&&rn){const n=t+It.rd[s],r=e+It.hd[s];u.model.draw(512*s+1280&2047,It.Mu,It.ku,It.Du,It.Fu,n,i,r,u.Na)}}if(l){const i=t.Ka;i&&i.model?.draw(0,It.Mu,It.ku,It.Du,It.Fu,i.x-It.Nu,i.y-It.Bu,i.z-It.Uu,i.Na);const e=t.Xa;e&&0===e.offset&&(e.Pf&&e.Pf.draw(0,It.Mu,It.ku,It.Du,It.Fu,e.x-It.Nu,e.y-It.Bu,e.z-It.Uu,e.Na),e.Uf&&e.Uf.draw(0,It.Mu,It.ku,It.Du,It.Fu,e.x-It.Nu,e.y-It.Bu,e.z-It.Uu,e.Na),e.Bf&&e.Bf.draw(0,It.Mu,It.ku,It.Du,It.Fu,e.x-It.Nu,e.y-It.Bu,e.z-It.Uu,e.Na))}const d=t.Za;if(0!==d){if(sIt.Pu&&1&d){const t=o[s-1][n];t&&t.update&&It.bu.Mt(t)}if(n>It.Gu&&8&d){const t=o[s][n-1];t&&t.update&&It.bu.Mt(t)}}}if(0!==t.$a){let i=!0;for(let e=0;ei.Ma&&(r+=1),ei.Da&&(r+=8),ss&&(s=n);const h=It.Gu-i.Da,l=i.Fa-It.Gu;i.Ba=l>h?s+l:s+h}for(;;){let t=-50,i=-1;for(let e=0;et&&(t=s.Ba,i=e))}if(-1===i)break;const l=It.gu[i];if(l){l.Yi=It.Yi;let t=l.model;t||(t=l.Sa?.draw(e)??null),t&&!this.aw(h,l.Ma,l.ka,l.Da,l.Fa,t.Fr)&&t.draw(l.xa,It.Mu,It.ku,It.Du,It.Fu,l.x-It.Nu,l.y-It.Bu,l.z-It.Uu,l.Na);for(let t=l.Ma;t<=l.ka;t++)for(let i=l.Da;i<=l.Fa;i++){const e=o[t][i];e&&(0!==e.$a?It.bu.Mt(e):t===s&&i===n||!e.update||It.bu.Mt(e))}}}if(t.Ja)continue}if(!t.update||0!==t.$a)continue;if(s<=It.Pu&&s>It.Wu){const t=o[s-1][n];if(t&&t.update)continue}if(s>=It.Pu&&sIt.Hu){const t=o[s][n-1];if(t&&t.update)continue}if(n>=It.Gu&&n=r){const r=t+It.sd[n],h=s+It.nd[n];i.model.draw(512*n+256,It.Mu,It.ku,It.Du,It.Fu,r,e,h,i.Na)}if(512&i.type&&h<=r){const r=t+It.rd[n],h=s+It.hd[n];i.model.draw(512*n+1280&2047,It.Mu,It.ku,It.Du,It.Fu,r,e,h,i.Na)}}const e=t.Ha;e&&(e.Df&t.ic&&!this.lw(h,s,n,e.Df)&&e.Nf?.draw(0,It.Mu,It.ku,It.Du,It.Fu,e.x-It.Nu,e.y-It.Bu,e.z-It.Uu,e.Na),e.kf&t.ic&&!this.lw(h,s,n,e.kf)&&e.Ff?.draw(0,It.Mu,It.ku,It.Du,It.Fu,e.x-It.Nu,e.y-It.Bu,e.z-It.Uu,e.Na))}if(rIt.Pu){const t=o[s-1][n];t&&t.update&&It.bu.Mt(t)}if(n>It.Gu){const t=o[s][n-1];t&&t.update&&It.bu.Mt(t)}}};hw=(t,i,e,s,n,r,h,o)=>{let l,a,c,f,u=l=(e<<7)-It.Nu,d=a=(s<<7)-It.Uu,w=c=u+128,y=f=d+128,A=this.Ad[i][e][s]-It.Bu,p=this.Ad[i][e+1][s]-It.Bu,_=this.Ad[i][e+1][s+1]-It.Bu,I=this.Ad[i][e][s+1]-It.Bu,g=d*h+u*o>>16;if(d=d*o-u*h>>16,u=g,g=A*r-d*n>>16,d=A*n+d*r>>16,A=g,d<50)return;if(g=a*h+w*o>>16,a=a*o-w*h>>16,w=g,g=p*r-a*n>>16,a=p*n+a*r>>16,p=g,a<50)return;if(g=y*h+c*o>>16,y=y*o-c*h>>16,c=g,g=_*r-y*n>>16,y=_*n+y*r>>16,_=g,y<50)return;if(g=f*h+l*o>>16,f=f*o-l*h>>16,l=g,g=I*r-f*n>>16,f=I*n+f*r>>16,I=g,f<50)return;const C=F.Fi+((u<<9)/d|0),E=F.Ni+((A<<9)/d|0),T=F.Fi+((w<<9)/a|0),b=F.Ni+((p<<9)/a|0),R=F.Fi+((c<<9)/y|0),O=F.Ni+((_<<9)/y|0),v=F.Fi+((l<<9)/f|0),L=F.Ni+((I<<9)/f|0);if(F.alpha=0,(R-v)*(b-L)-(O-L)*(T-v)>0)if(F.Ui=R<0||v<0||T<0||R>m.wt||v>m.wt||T>m.wt,It.ju&&this.cw(It.Xe,It.je,O,L,b,R,v,T)&&(It.ud=e,It.dd=s),-1===t.Vf)12345678!==t.Yf&&F.ne(R,v,T,O,L,b,t.Yf,t.Hf,t.Wf);else if(It.Li){const i=It.ad[t.Vf];F.ne(R,v,T,O,L,b,this.fw(i,t.Yf),this.fw(i,t.Hf),this.fw(i,t.Wf))}else t.flat?F.le(R,v,T,O,L,b,t.Yf,t.Hf,t.Wf,u,A,d,w,l,p,I,a,f,t.Vf):F.le(R,v,T,O,L,b,t.Yf,t.Hf,t.Wf,c,_,y,l,w,I,p,f,a,t.Vf);if(!((C-T)*(L-b)-(E-b)*(v-T)<=0))if(F.Ui=C<0||T<0||v<0||C>m.wt||T>m.wt||v>m.wt,It.ju&&this.cw(It.Xe,It.je,E,b,L,C,T,v)&&(It.ud=e,It.dd=s),-1!==t.Vf){if(!It.Li)return void F.le(C,T,v,E,b,L,t.Gf,t.Wf,t.Hf,u,A,d,w,l,p,I,a,f,t.Vf);const i=It.ad[t.Vf];F.ne(C,T,v,E,b,L,this.fw(i,t.Gf),this.fw(i,t.Wf),this.fw(i,t.Hf))}else 12345678!==t.Gf&&F.ne(C,T,v,E,b,L,t.Gf,t.Wf,t.Hf)};ow=(t,i,e,s,n,r,h)=>{let o=e.Ar.length;for(let t=0;t>16;if(l=l*h-i*r>>16,i=a,a=o*n-l*s>>16,l=o*s+l*n>>16,o=a,l<50)return;e.lu&&(pt.jf[t]=i,pt.zf[t]=o,pt.Zf[t]=l),pt.Kf[t]=F.Fi+((i<<9)/l|0),pt.Xf[t]=F.Ni+((o<<9)/l|0)}F.alpha=0,o=e.ru.length;for(let s=0;s0)if(F.Ui=o<0||l<0||a<0||o>m.wt||l>m.wt||a>m.wt,It.ju&&this.cw(It.Xe,It.je,c,f,u,o,l,a)&&(It.ud=t,It.dd=i),e.lu&&-1!==e.lu[s])if(It.Li){const t=It.ad[e.lu[s]];F.ne(o,l,a,c,f,u,this.fw(t,e.eu[s]),this.fw(t,e.su[s]),this.fw(t,e.nu[s]))}else e.flat?F.le(o,l,a,c,f,u,e.eu[s],e.su[s],e.nu[s],pt.jf[0],pt.zf[0],pt.Zf[0],pt.jf[1],pt.jf[3],pt.zf[1],pt.zf[3],pt.Zf[1],pt.Zf[3],e.lu[s]):F.le(o,l,a,c,f,u,e.eu[s],e.su[s],e.nu[s],pt.jf[n],pt.zf[n],pt.Zf[n],pt.jf[r],pt.jf[h],pt.zf[r],pt.zf[h],pt.Zf[r],pt.Zf[h],e.lu[s]);else 12345678!==e.eu[s]&&F.ne(o,l,a,c,f,u,e.eu[s],e.su[s],e.nu[s])}};rw=(t,i,e)=>{const s=this.Id[t][i][e];if(s===-It.Yi)return!1;if(s===It.Yi)return!0;{const s=i<<7,n=e<<7;return this.uw(s+1,this.Ad[t][i][e],n+1)&&this.uw(s+128-1,this.Ad[t][i+1][e],n+1)&&this.uw(s+128-1,this.Ad[t][i+1][e+1],n+128-1)&&this.uw(s+1,this.Ad[t][i][e+1],n+128-1)?(this.Id[t][i][e]=It.Yi,!0):(this.Id[t][i][e]=-It.Yi,!1)}};lw=(t,i,e,s)=>{if(!this.rw(t,i,e))return!1;const n=i<<7,r=e<<7,h=this.Ad[t][i][e]-1,o=h-120,l=h-230,a=h-238;if(s<16){if(1===s){if(n>It.Nu){if(!this.uw(n,h,r))return!1;if(!this.uw(n,h,r+128))return!1}if(t>0){if(!this.uw(n,o,r))return!1;if(!this.uw(n,o,r+128))return!1}return!!this.uw(n,l,r)&&this.uw(n,l,r+128)}if(2===s){if(r0){if(!this.uw(n,o,r+128))return!1;if(!this.uw(n+128,o,r+128))return!1}return!!this.uw(n,l,r+128)&&this.uw(n+128,l,r+128)}if(4===s){if(n0){if(!this.uw(n+128,o,r))return!1;if(!this.uw(n+128,o,r+128))return!1}return!!this.uw(n+128,l,r)&&this.uw(n+128,l,r+128)}if(8===s){if(r>It.Uu){if(!this.uw(n,h,r))return!1;if(!this.uw(n+128,h,r))return!1}if(t>0){if(!this.uw(n,o,r))return!1;if(!this.uw(n+128,o,r))return!1}return!!this.uw(n,l,r)&&this.uw(n+128,l,r)}}return!!this.uw(n+64,a,r+64)&&(16===s?this.uw(n,l,r+128):32===s?this.uw(n+128,l,r+128):64===s?this.uw(n+128,l,r):128===s?this.uw(n,l,r):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,i,e,s)=>{if(this.rw(t,i,e)){const n=i<<7,r=e<<7;return this.uw(n+1,this.Ad[t][i][e]-s,r+1)&&this.uw(n+128-1,this.Ad[t][i+1][e]-s,r+1)&&this.uw(n+128-1,this.Ad[t][i+1][e+1]-s,r+128-1)&&this.uw(n+1,this.Ad[t][i][e+1]-s,r+128-1)}return!1};aw=(t,i,e,s,n,r)=>{let h,o;if(i!==e||s!==n){for(h=i;h<=e;h++)for(o=s;o<=n;o++)if(this.Id[t][h][o]===-It.Yi)return!1;o=1+(i<<7);const l=2+(s<<7),a=this.Ad[t][i][s]-r;if(!this.uw(o,a,l))return!1;const c=(e<<7)-1;if(!this.uw(c,a,l))return!1;const f=(n<<7)-1;return!!this.uw(o,a,f)&&this.uw(c,a,f)}return!!this.rw(t,i,s)&&(h=i<<7,o=s<<7,this.uw(h+1,this.Ad[t][i][s]-r,o+1)&&this.uw(h+128-1,this.Ad[t][i+1][s]-r,o+1)&&this.uw(h+128-1,this.Ad[t][i+1][s+1]-r,o+128-1)&&this.uw(h+1,this.Ad[t][i][s+1]-r,o+128-1))};uw=(t,i,e)=>{for(let s=0;s0){const t=n.Sr+(n.lc*s>>8),r=n.Mr+(n.ac*s>>8),h=n.Dr+(n.cc*s>>8),o=n.Fr+(n.fc*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(2===n.mode){const s=t-n.vr;if(s>0){const t=n.Sr+(n.lc*s>>8),r=n.Mr+(n.ac*s>>8),h=n.Dr+(n.cc*s>>8),o=n.Fr+(n.fc*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(3===n.mode){const s=n.Sr-e;if(s>0){const e=n.vr+(n.hc*s>>8),r=n.Lr+(n.oc*s>>8),h=n.Dr+(n.cc*s>>8),o=n.Fr+(n.fc*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(4===n.mode){const s=e-n.Sr;if(s>0){const e=n.vr+(n.hc*s>>8),r=n.Lr+(n.oc*s>>8),h=n.Dr+(n.cc*s>>8),o=n.Fr+(n.fc*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(5===n.mode){const s=i-n.Dr;if(s>0){const i=n.vr+(n.hc*s>>8),r=n.Lr+(n.oc*s>>8),h=n.Sr+(n.lc*s>>8),o=n.Mr+(n.ac*s>>8);if(t>=i&&t<=r&&e>=h&&e<=o)return!0}}}return!1};cw=(t,i,e,s,n,r,h,o)=>{if(ie&&i>s&&i>n)return!1;if(tr&&t>h&&t>o)return!1;const l=(i-s)*(o-h)-(t-h)*(n-s);return((i-e)*(h-r)-(t-r)*(s-e))*l>0&&l*((i-n)*(r-o)-(t-o)*(e-n))>0};fw=(t,i)=>((i=(127-i)*(127&t)/160|0)<2?i=2:i>126&&(i=126),(65408&t)+i)}class gt{id;dw=null;constructor(t){this.id=t}ww(t){for(;;){const i=t.Zt;if(0===i)break;this.decode(i,t)}return this}}class Ct extends gt{static count=0;static tn=[];static en=t=>{const i=new R(t.read('flo.dat'));this.count=i.Jt;for(let t=0;t(e>179&&(i=i/2|0),e>192&&(i=i/2|0),e>217&&(i=i/2|0),e>243&&(i=i/2|0),(t/4<<10)+(i/32<<7)+(e/2|0));static mw=(t,i)=>-1===t?12345678:((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);static Aw=(t,i)=>-2===t?12345678:-1===t?(i<0?i=0:i>127&&(i=127),127-i):((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);pw=0;texture=-1;_w=!1;Iw=!0;gw=0;Cw=0;Ew=0;Tw=0;bw=0;Rw=0;decode(t,i){1===t?(this.pw=i.Qt,this.setColor(this.pw)):2===t?this.texture=i.Zt:3===t?this._w=!0:5===t?this.Iw=!1:6===t?this.dw=i.ni:console.log('Error unrecognised config code: ',t)}setColor(t){const i=(t>>16&255)/256,e=(t>>8&255)/256,s=(255&t)/256;let n=i;ei&&(r=e),s>r&&(r=s);let h=0,o=0;const l=(n+r)/2;n!==r&&(l<.5&&(o=(r-n)/(r+n)),l>=.5&&(o=(r-n)/(2-r-n)),i===r?h=(e-s)/(r-n):e===r?h=(s-i)/(r-n)+2:s===r&&(h=(i-e)/(r-n)+4)),h/=6,this.gw=256*h|0,this.Cw=256*o|0,this.Ew=256*l|0,this.Cw<0?this.Cw=0:this.Cw>255&&(this.Cw=255),this.Ew<0?this.Ew=0:this.Ew>255&&(this.Ew=255),this.Tw=l>.5?(1-l)*o*512|0:l*o*512|0,this.Tw<1&&(this.Tw=1),this.bw=h*this.Tw|0;let a=this.gw+(16*Math.random()|0)-8;a<0?a=0:a>255&&(a=255);let c=this.Cw+(48*Math.random()|0)-24;c<0?c=0:c>255&&(c=255);let f=this.Ew+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255),this.Rw=Ct.yw(a,c,f)}}class Et extends gt{static count=0;static cache=null;static Zs=null;static Ow=null;static Lw=0;static Sw=new q(500);static xw=new q(30);static en=t=>{this.Zs=new R(t.read('loc.dat'));const i=new R(t.read('loc.idx'));this.count=i.Jt,this.Ow=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.Ow||!this.Zs)throw new Error('LocType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Lw=(this.Lw+1)%10;const i=this.cache[this.Lw];return this.Zs.Xt=this.Ow[t],i.id=t,i.reset(),i.ww(this.Zs),i.Mw||(i.Mw=new Int32Array(1)),-1===i.kw&&i.Mw&&(i.active=i.Mw.length>0&&i.Mw[0]===ct.af.id,i.Dw&&(i.active=!0)),i};static zi=()=>{this.Sw=null,this.xw=null,this.Ow=null,this.cache=null,this.Zs=null};Fw=null;Mw=null;name=null;Nw=null;Bw=null;Uw=null;width=1;length=1;Pw=!0;Gw=!0;active=!1;kw=-1;Ww=!1;Yw=!1;Iw=!1;Gl=-1;Hw=!1;Vw=16;Kw=0;Xw=0;Dw=null;jw=-1;zw=-1;Zw=!1;qw=!0;Jw=128;$w=128;Qw=128;ty=0;iy=0;ey=0;sy=0;ny=!1;decode(t,i){if(1===t){const t=i.Zt;this.Fw=new Int32Array(t),this.Mw=new Int32Array(t);for(let e=0;e=30&&t<39)this.Dw||(this.Dw=new v(5,null)),this.Dw[t-30]=i.ni,'hidden'===this.Dw[t-30]?.toLowerCase()&&(this.Dw[t-30]=null);else if(40===t){const t=i.Zt;this.Bw=new Uint16Array(t),this.Uw=new Uint16Array(t);for(let e=0;e=this.Fw.length)return null;let c=this.Fw[o];if(-1===c)return null;const f=this.Zw!==i>3;f&&(c+=65536);let u=Et.Sw?.get(BigInt(c));u||(u=j.model(65535&c),f&&u.hh(),Et.Sw?.put(BigInt(c),u));const d=128!==this.Jw||128!==this.$w||128!==this.Qw,w=0!==this.iy||0!==this.ey||0!==this.sy;let y=j.Ur(u,!this.Bw,!this.Hw,i===lt.Vc&&-1===h&&!d&&!w);for(-1!==h&&(y.Qr(),y.eh(h),y.Hr=null,y.Yr=null);i-- >0;)y.sh();if(this.Bw&&this.Uw)for(let t=0;t{const i=new R(t.read('seq.dat'));this.count=i.Jt;for(let t=0;t{let e=this.lA(t+45365,i+91923,4)+(this.lA(t+10294,i+37821,2)-128>>1)+(this.lA(t,i,1)-128>>2)-128;return e=35+(.3*e|0),e<10?e=10:e>60&&(e=60),e};static lA=(t,i,e)=>{const s=t/e|0,n=t&e-1,r=i/e|0,h=i&e-1,o=this.aA(s,r),l=this.aA(s+1,r),a=this.aA(s,r+1),c=this.aA(s+1,r+1),f=this.cA(o,l,n,e),u=this.cA(a,c,n,e);return this.cA(f,u,h,e)};static cA=(t,i,e,s)=>{const n=65536-F.cos[1024*e/s|0]>>1;return(t*(65536-n)>>16)+(i*n>>16)};static aA=(t,i)=>((this.fA(t-1,i-1)+this.fA(t+1,i-1)+this.fA(t-1,i+1)+this.fA(t+1,i+1))/16|0)+((this.fA(t-1,i)+this.fA(t+1,i)+this.fA(t,i-1)+this.fA(t,i+1))/8|0)+(this.fA(t,i)/4|0);static fA=(t,i)=>{const e=t+57*i,s=BigInt(e<<13^e);return 255&Number((s*(s*s*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static Rf=(t,i,e,s,n,r,h,o,l,a,c)=>{const f=n[c][i][e],u=n[c][i+1][e],d=n[c][i+1][e+1],w=n[c][i][e+1],y=f+u+d+w>>2,m=Et.get(o);let A=i+(e<<7)+(o<<14)+1073741824|0;m.active||(A+=-2147483648),A|=0;const p=(a<<6)+l<<24>>24;if(l===ct.Jc.id)s?.Sd(m.Ul(ct.Jc.id,a,f,u,d,w,-1),t,i,e,y,A,p),m.Pw&&m.active&&h?.Tf(i,e),-1!==m.Gl&&r.Mt(new Tt(o,t,3,i,e,bt.tn[m.Gl],!0));else if(l===ct.af.id||l===ct.cf.id){const n=m.Ul(ct.af.id,a,f,u,d,w,-1);if(n){let r,h,o=0;l===ct.cf.id&&(o+=256),a===lt.Kc||a===lt.jc?(r=m.length,h=m.width):(r=m.width,h=m.length),s?.Rf(t,i,e,y,n,null,A,p,r,h,o)}m.Pw&&h?.Rf(i,e,m.width,m.length,a,m.Gw),-1!==m.Gl&&r.Mt(new Tt(o,t,2,i,e,bt.tn[m.Gl],!0))}else if(l>=ct.ff.id)s?.Rf(t,i,e,y,m.Ul(l,a,f,u,d,w,-1),null,A,p,1,1,0),m.Pw&&h?.Rf(i,e,m.width,m.length,a,m.Gw),-1!==m.Gl&&r.Mt(new Tt(o,t,2,i,e,bt.tn[m.Gl],!0));else if(l===ct.$c.id)s?.vf(t,i,e,y,Ot.Qm[a],0,m.Ul(ct.$c.id,a,f,u,d,w,-1),null,A,p),m.Pw&&h?.vf(i,e,l,a,m.Gw),-1!==m.Gl&&r.Mt(new Tt(o,t,0,i,e,bt.tn[m.Gl],!0));else if(l===ct.Qc.id)s?.vf(t,i,e,y,Ot.tA[a],0,m.Ul(ct.Qc.id,a,f,u,d,w,-1),null,A,p),m.Pw&&h?.vf(i,e,l,a,m.Gw),-1!==m.Gl&&r.Mt(new Tt(o,t,0,i,e,bt.tn[m.Gl],!0));else if(l===ct.tf.id){const n=a+1&3;s?.vf(t,i,e,y,Ot.Qm[a],Ot.Qm[n],m.Ul(ct.tf.id,a+4,f,u,d,w,-1),m.Ul(ct.tf.id,n,f,u,d,w,-1),A,p),m.Pw&&h?.vf(i,e,l,a,m.Gw),-1!==m.Gl&&r.Mt(new Tt(o,t,0,i,e,bt.tn[m.Gl],!0))}else if(l===ct.if.id)s?.vf(t,i,e,y,Ot.tA[a],0,m.Ul(ct.if.id,a,f,u,d,w,-1),null,A,p),m.Pw&&h?.vf(i,e,l,a,m.Gw),-1!==m.Gl&&r.Mt(new Tt(o,t,0,i,e,bt.tn[m.Gl],!0));else if(l===ct.lf.id)s?.Rf(t,i,e,y,m.Ul(l,a,f,u,d,w,-1),null,A,p,1,1,0),m.Pw&&h?.Rf(i,e,m.width,m.length,a,m.Gw),-1!==m.Gl&&r.Mt(new Tt(o,t,2,i,e,bt.tn[m.Gl],!0));else if(l===ct.ef.id)s?.Dd(t,i,e,y,0,0,A,m.Ul(ct.ef.id,lt.Vc,f,u,d,w,-1),p,512*a,Ot.Qm[a]),-1!==m.Gl&&r.Mt(new Tt(o,t,1,i,e,bt.tn[m.Gl],!0));else if(l===ct.sf.id){let n=16;if(s){const r=s.jd(t,i,e);r>0&&(n=Et.get(r>>14&32767).Vw)}s?.Dd(t,i,e,y,Ot.iA[a]*n,Ot.eA[a]*n,A,m.Ul(ct.ef.id,lt.Vc,f,u,d,w,-1),p,512*a,Ot.Qm[a]),-1!==m.Gl&&r.Mt(new Tt(o,t,1,i,e,bt.tn[m.Gl],!0))}else l===ct.nf.id?(s?.Dd(t,i,e,y,0,0,A,m.Ul(ct.ef.id,lt.Vc,f,u,d,w,-1),p,a,256),-1!==m.Gl&&r.Mt(new Tt(o,t,1,i,e,bt.tn[m.Gl],!0))):l===ct.rf.id?(s?.Dd(t,i,e,y,0,0,A,m.Ul(ct.ef.id,lt.Vc,f,u,d,w,-1),p,a,512),-1!==m.Gl&&r.Mt(new Tt(o,t,1,i,e,bt.tn[m.Gl],!0))):l===ct.hf.id&&(s?.Dd(t,i,e,y,0,0,A,m.Ul(ct.ef.id,lt.Vc,f,u,d,w,-1),p,a,768),-1!==m.Gl&&r.Mt(new Tt(o,t,1,i,e,bt.tn[m.Gl],!0)))};sc;rc;uA;dA;wA;yA;mA;AA;pA;_A;IA;gA;CA;EA;TA;bA;constructor(t,i,e,s){this.sc=t,this.rc=i,this.uA=e,this.dA=s,this.wA=new M(ut.gf,t,i),this.yA=new M(ut.gf,t,i),this.mA=new M(ut.gf,t,i),this.AA=new M(ut.gf,t,i),this.bA=new D(ut.gf,t+1,i+1),this.pA=new M(ut.gf,t+1,i+1),this._A=new k(t+1,i+1),this.IA=new Int32Array(i),this.gA=new Int32Array(i),this.CA=new Int32Array(i),this.EA=new Int32Array(i),this.TA=new Int32Array(i)}RA=(t,i)=>{for(let t=0;t=0&&i[n]?.Tf(e,s)}Ot.sA+=(5*Math.random()|0)-2,Ot.sA<-8?Ot.sA=-8:Ot.sA>8&&(Ot.sA=8),Ot.nA+=(5*Math.random()|0)-2,Ot.nA<-16?Ot.nA=-16:Ot.nA>16&&(Ot.nA=16);for(let i=0;i>8;for(let t=1;t>2)+(e[l+1][t]>>3)+(e[l][t-1]>>2)+(e[l][t+1]>>3)+(e[l][t]>>1);this._A[l][t]=u-d}for(let t=0;t=0&&s0){const i=Ct.tn[e-1];this.IA[t]+=i.bw,this.gA[t]+=i.Cw,this.CA[t]+=i.Ew,this.EA[t]+=i.Tw,n=this.TA[t]++}}const r=e-5;if(r>=0&&r0){const i=Ct.tn[e-1];this.IA[t]-=i.bw,this.gA[t]-=i.Cw,this.CA[t]-=i.Ew,this.EA[t]-=i.Tw,n=this.TA[t]--}}}if(e>=1&&e=0&&a=0&&c=1&&l0||c>0){const f=this.uA[i][e][l],u=this.uA[i][e+1][l],d=this.uA[i][e+1][l+1],w=this.uA[i][e][l+1],y=this._A[e][l],m=this._A[e+1][l],A=this._A[e+1][l+1],p=this._A[e][l+1];let _=-1,I=-1;if(a>0){const t=256*s/h|0,i=n/o|0;let e=r/o|0;_=Ct.yw(t,i,e);const l=t+Ot.sA&255;e+=Ot.nA,e<0?e=0:e>255&&(e=255),I=Ct.yw(l,i,e)}if(i>0){let t=0!==a||this.mA[i][e][l]===_t.fu;c>0&&!Ct.tn[c-1].Iw&&(t=!1),t&&f===u&&f===d&&f===w&&(this.bA[i][e][l]|=2340)}let g=0;if(-1!==_&&(g=F.palette[Ct.mw(I,96)]),0===c)t?.Ld(i,e,l,_t.fu,lt.Vc,-1,f,u,d,w,Ct.mw(_,y),Ct.mw(_,m),Ct.mw(_,A),Ct.mw(_,p),Rt.Oy,Rt.Oy,Rt.Oy,Rt.Oy,g,Rt.Oy);else{const s=this.mA[i][e][l]+1,n=this.AA[i][e][l],r=Ct.tn[c-1];let h,o,a=r.texture;a>=0?(o=F.Qi(a),h=-1):r.pw===Rt.by?(o=0,h=-2,a=-1):(h=Ct.yw(r.gw,r.Cw,r.Ew),o=F.palette[Ct.Aw(r.Rw,96)]),t?.Ld(i,e,l,s,n,a,f,u,d,w,Ct.mw(_,y),Ct.mw(_,m),Ct.mw(_,A),Ct.mw(_,p),Ct.Aw(h,y),Ct.Aw(h,m),Ct.Aw(h,A),Ct.Aw(h,p),g,o)}}}}}}for(let e=1;e0&&(t<<=3,i<<=3,e<<=3);for(let n=0;n<=s;n++)for(let r=0;r<=this.rc;r++)for(let h=0;h<=this.sc;h++){if(this.bA[n][h][r]&t){let i=r,e=r,o=n,l=n;for(;i>0&&this.bA[n][h][i-1]&t;)i--;for(;e0;){for(let s=i;s<=e;s++)if(!(this.bA[o-1][h][s]&t))break t;o--}t:for(;l=8){const n=this.uA[l][h][i]-240,r=this.uA[o][h][i];It.yd(s,1,128*h,n,128*i,128*h,r,128*e+128);for(let s=o;s<=l;s++)for(let n=i;n<=e;n++)this.bA[s][h][n]&=~t}}if(this.bA[n][h][r]&i){let t=h,e=h,o=n,l=n;for(;t>0&&this.bA[n][t-1][r]&i;)t--;for(;e0;){for(let s=t;s<=e;s++)if(!(this.bA[o-1][s][r]&i))break t;o--}t:for(;l=8){const n=this.uA[l][t][r]-240,h=this.uA[o][t][r];It.yd(s,2,128*t,n,128*r,128*e+128,h,128*r);for(let s=o;s<=l;s++)for(let n=t;n<=e;n++)this.bA[s][n][r]&=~i}}if(this.bA[n][h][r]&e){let t=h,i=h,o=r,l=r;for(;o>0&&this.bA[n][h][o-1]&e;)o--;for(;l0;){for(let i=o;i<=l;i++)if(!(this.bA[n][t-1][i]&e))break t;t--}t:for(;i=4){const r=this.uA[n][t][o];It.yd(s,4,128*t,r,128*o,128*i+128,r,128*l+128);for(let s=t;s<=i;s++)for(let t=o;t<=l;t++)this.bA[n][s][t]&=~e}}}}}};vA=(t,i,e,s)=>{let n=0;for(let t=0;t>24;break}for(let r=t;r=0&&t=0&&r{const r=new R(new Uint8Array(n));for(let n=0;n=0&&l=0&&a>24,this.AA[n][l][a]=(c-2&3)<<24>>24):c<=81?this.dA[n][l][a]=c-49<<24>>24:this.wA[n][l][a]=c-81<<24>>24}else for(;c=r.Zt,0!==c;){if(1===c){r.Zt;break}c<=49&&r.Zt}}};SA=(t,i,e,s,n,r)=>{const h=new R(new Uint8Array(s));let o=-1;for(;;){const s=h.si;if(0===s)return;o+=s;let l=0;for(;;){const s=h.si;if(0===s)break;l+=s-1;const a=63&l,c=l>>6&63,f=l>>12,u=h.Zt,d=u>>2,w=3&u,y=c+n,m=a+r;if(y>0&&m>0&&y=0&&(n=e[s]),this.Rf(f,y,m,t,i,n,o,d,w)}}}};Rf=(t,i,e,s,n,r,h,o,l)=>{if(Ot.Li){if(16&this.dA[t][i][e])return;if(this.OA(t,i,e)!==Ot.rA)return}const a=this.uA[t][i][e],c=this.uA[t][i+1][e],f=this.uA[t][i+1][e+1],u=this.uA[t][i][e+1],d=a+c+f+u>>2,w=Et.get(h);let y=i+(e<<7)+(h<<14)+1073741824|0;w.active||(y+=-2147483648),y|=0;const m=(l<<6)+o<<24>>24;if(o===ct.Jc.id)(!Ot.Li||w.active||w.ny)&&(s?.Sd(w.Ul(ct.Jc.id,l,a,c,f,u,-1),t,i,e,d,y,m),w.Pw&&w.active&&r?.Tf(i,e),-1!==w.Gl&&n.Mt(new Tt(h,t,3,i,e,bt.tn[w.Gl],!0)));else if(o===ct.af.id||o===ct.cf.id){const A=w.Ul(ct.af.id,l,a,c,f,u,-1);if(A){let n,r,h=0;if(o===ct.cf.id&&(h+=256),l===lt.Kc||l===lt.jc?(n=w.length,r=w.width):(n=w.width,r=w.length),s?.Rf(t,i,e,d,A,null,y,m,n,r,h)&&w.qw)for(let s=0;s<=n;s++)for(let n=0;n<=r;n++){let r=A.kr/4|0;r>30&&(r=30),r>this.pA[t][i+s][e+n]&&(this.pA[t][i+s][e+n]=r<<24>>24)}}w.Pw&&r?.Rf(i,e,w.width,w.length,l,w.Gw),-1!==w.Gl&&n.Mt(new Tt(h,t,2,i,e,bt.tn[w.Gl],!0))}else if(o>=ct.ff.id)s?.Rf(t,i,e,d,w.Ul(o,l,a,c,f,u,-1),null,y,m,1,1,0),o>=ct.ff.id&&o<=ct.mf.id&&o!==ct.uf.id&&t>0&&(this.bA[t][i][e]|=2340),w.Pw&&r?.Rf(i,e,w.width,w.length,l,w.Gw),-1!==w.Gl&&n.Mt(new Tt(h,t,2,i,e,bt.tn[w.Gl],!0));else if(o===ct.$c.id)s?.vf(t,i,e,d,Ot.Qm[l],0,w.Ul(ct.$c.id,l,a,c,f,u,-1),null,y,m),l===lt.Vc?(w.qw&&(this.pA[t][i][e]=50,this.pA[t][i][e+1]=50),w.Iw&&(this.bA[t][i][e]|=585)):l===lt.Kc?(w.qw&&(this.pA[t][i][e+1]=50,this.pA[t][i+1][e+1]=50),w.Iw&&(this.bA[t][i][e+1]|=1170)):l===lt.Xc?(w.qw&&(this.pA[t][i+1][e]=50,this.pA[t][i+1][e+1]=50),w.Iw&&(this.bA[t][i+1][e]|=585)):l===lt.jc&&(w.qw&&(this.pA[t][i][e]=50,this.pA[t][i+1][e]=50),w.Iw&&(this.bA[t][i][e]|=1170)),w.Pw&&r?.vf(i,e,o,l,w.Gw),-1!==w.Gl&&n.Mt(new Tt(h,t,0,i,e,bt.tn[w.Gl],!0)),16!==w.Vw&&s?.Nd(t,i,e,w.Vw);else if(o===ct.Qc.id)s?.vf(t,i,e,d,Ot.tA[l],0,w.Ul(ct.Qc.id,l,a,c,f,u,-1),null,y,m),w.qw&&(l===lt.Vc?this.pA[t][i][e+1]=50:l===lt.Kc?this.pA[t][i+1][e+1]=50:l===lt.Xc?this.pA[t][i+1][e]=50:l===lt.jc&&(this.pA[t][i][e]=50)),w.Pw&&r?.vf(i,e,o,l,w.Gw),-1!==w.Gl&&n.Mt(new Tt(h,t,0,i,e,bt.tn[w.Gl],!0));else if(o===ct.tf.id){const A=l+1&3;s?.vf(t,i,e,d,Ot.Qm[l],Ot.Qm[A],w.Ul(ct.tf.id,l+4,a,c,f,u,-1),w.Ul(ct.tf.id,A,a,c,f,u,-1),y,m),w.Iw&&(l===lt.Vc?(this.bA[t][i][e]|=265,this.bA[t][i][e+1]|=1170):l===lt.Kc?(this.bA[t][i][e+1]|=1170,this.bA[t][i+1][e]|=585):l===lt.Xc?(this.bA[t][i+1][e]|=585,this.bA[t][i][e]|=1170):l===lt.jc&&(this.bA[t][i][e]|=1170,this.bA[t][i][e]|=585)),w.Pw&&r?.vf(i,e,o,l,w.Gw),-1!==w.Gl&&n.Mt(new Tt(h,t,0,i,e,bt.tn[w.Gl],!0)),16!==w.Vw&&s?.Nd(t,i,e,w.Vw)}else if(o===ct.if.id)s?.vf(t,i,e,d,Ot.tA[l],0,w.Ul(ct.if.id,l,a,c,f,u,-1),null,y,m),w.qw&&(l===lt.Vc?this.pA[t][i][e+1]=50:l===lt.Kc?this.pA[t][i+1][e+1]=50:l===lt.Xc?this.pA[t][i+1][e]=50:l===lt.jc&&(this.pA[t][i][e]=50)),w.Pw&&r?.vf(i,e,o,l,w.Gw),-1!==w.Gl&&n.Mt(new Tt(h,t,0,i,e,bt.tn[w.Gl],!0));else if(o===ct.lf.id)s?.Rf(t,i,e,d,w.Ul(o,l,a,c,f,u,-1),null,y,m,1,1,0),w.Pw&&r?.Rf(i,e,w.width,w.length,l,w.Gw),-1!==w.Gl&&n.Mt(new Tt(h,t,2,i,e,bt.tn[w.Gl],!0));else if(o===ct.ef.id)s?.Dd(t,i,e,d,0,0,y,w.Ul(ct.ef.id,lt.Vc,a,c,f,u,-1),m,512*l,Ot.Qm[l]),-1!==w.Gl&&n.Mt(new Tt(h,t,1,i,e,bt.tn[w.Gl],!0));else if(o===ct.sf.id){let r=16;if(s){const n=s.jd(t,i,e);n>0&&(r=Et.get(n>>14&32767).Vw)}s?.Dd(t,i,e,d,Ot.iA[l]*r,Ot.eA[l]*r,y,w.Ul(ct.ef.id,lt.Vc,a,c,f,u,-1),m,512*l,Ot.Qm[l]),-1!==w.Gl&&n.Mt(new Tt(h,t,1,i,e,bt.tn[w.Gl],!0))}else o===ct.nf.id?(s?.Dd(t,i,e,d,0,0,y,w.Ul(ct.ef.id,lt.Vc,a,c,f,u,-1),m,l,256),-1!==w.Gl&&n.Mt(new Tt(h,t,1,i,e,bt.tn[w.Gl],!0))):o===ct.rf.id?(s?.Dd(t,i,e,d,0,0,y,w.Ul(ct.ef.id,lt.Vc,a,c,f,u,-1),m,l,512),-1!==w.Gl&&n.Mt(new Tt(h,t,1,i,e,bt.tn[w.Gl],!0))):o===ct.hf.id&&(s?.Dd(t,i,e,d,0,0,y,w.Ul(ct.ef.id,lt.Vc,a,c,f,u,-1),m,l,768),-1!==w.Gl&&n.Mt(new Tt(h,t,1,i,e,bt.tn[w.Gl],!0)))};OA=(t,i,e)=>8&this.dA[t][i][e]?0:t<=0||!(2&this.dA[1][i][e])?t:t-1}class vt extends w{}class Lt extends vt{x=0;z=0;xa=0;xA=!1;size=1;MA=-1;kA=-1;DA=-1;FA=-1;NA=-1;BA=-1;UA=-1;PA=null;GA=100;WA=0;YA=0;HA=0;VA=0;KA=-1e3;XA=0;jA=0;zA=-1;ZA=0;qA=0;JA=-1;$A=0;QA=0;tp=-1;ip=0;ep=0;sp=0;np=0;rp=-1;hp=0;op=0;lp=0;ap=0;cp=0;fp=0;up=0;dp=0;wp=0;yp=0;mp=0;Yi=0;height=0;Ap=0;pathLength=0;pp=new Int32Array(10);_p=new Int32Array(10);Ip=new v(10,!1);gp=0;Cp=-1;Ep=-1;Tp=-1;bp=-1;move(t,i,e){if(-1!==this.tp&&bt.tn[this.tp].priority<=1&&(this.tp=-1),!t){const t=i-this.pp[0],s=e-this._p[0];if(t>=-8&&t<=8&&s>=-8&&s<=8){this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.pp[t]=this.pp[t-1],this._p[t]=this._p[t-1],this.Ip[t]=this.Ip[t-1];return this.pp[0]=i,this._p[0]=e,void(this.Ip[0]=!1)}}this.pathLength=0,this.gp=0,this.pp[0]=i,this._p[0]=e,this.x=128*this.pp[0]+64*this.size,this.z=128*this._p[0]+64*this.size}step(t,i){let e=this.pp[0],s=this._p[0];0===i?(e--,s++):1===i?s++:2===i?(e++,s++):3===i?e--:4===i?e++:5===i?(e--,s--):6===i?s--:7===i&&(e++,s--),-1!==this.tp&&bt.tn[this.tp].priority<=1&&(this.tp=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.pp[t]=this.pp[t-1],this._p[t]=this._p[t-1],this.Ip[t]=this.Ip[t-1];this.pp[0]=e,this._p[0]=s,this.Ip[0]=t}}class St extends gt{static count=0;static tn=[];static Gh=new q(30);static en=t=>{const i=new R(t.read('spotanim.dat'));this.count=i.Jt;for(let t=0;t=40&&t<50)this.Bw[t-40]=i.Jt;else{if(!(t>=50&&t<60))throw new Error(`Unrecognized spotanim config code: ${t}`);this.Uw[t-50]=i.Jt}}Ul(){let t=St.Gh?.get(BigInt(this.id));if(t)return t;t=j.model(this.model);for(let i=0;i<6;i++)0!==this.Bw[0]&&t.rh(this.Bw[i],this.Uw[i]);return St.Gh?.put(BigInt(this.id),t),t}}class xt extends gt{static count=0;static tn=[];static en=t=>{const i=new R(t.read('idk.dat'));this.count=i.Jt;for(let t=0;t=40&&t<50)this.Bw[t-40]=i.Jt;else if(t>=50&&t<60)this.Uw[t-50]=i.Jt;else{if(!(t>=60&&t<70))throw new Error(`Unrecognized idk config code: ${t}`);this.vp[t-60]=i.Jt}}Ul(){if(!this.Fw)return null;const t=new v(this.Fw.length,null);for(let i=0;i{this.Sp=i,this.Zs=new R(t.read('obj.dat'));const e=new R(t.read('obj.idx'));this.count=e.Jt,this.Ow=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.Ow||!this.Zs)throw new Error('ObjType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Lw=(this.Lw+1)%10;const i=this.cache[this.Lw];return this.Zs.Xt=this.Ow[t],i.id=t,i.reset(),i.ww(this.Zs),-1!==i.Mp&&i.kp(),!this.Sp&&i.members&&(i.name='Members Object',i.Nw="Login to a members' server to use this object.",i.Dw=null,i.Dp=null),i};static zi=()=>{this.Gh=null,this.xp=null,this.Ow=null,this.cache=null,this.Zs=null};static Fp=(t,i)=>{if(Mt.xp){let e=Mt.xp.get(BigInt(t));if(e&&e.gi!==i&&-1!==e.gi&&(e.ht(),e=null),e)return e}let e=Mt.get(t);if(e.Np||(i=-1),e.Np&&e.Bp&&i>1){let t=-1;for(let s=0;s<10;s++)i>=e.Bp[s]&&0!==e.Bp[s]&&(t=e.Np[s]);-1!==t&&(e=Mt.get(t))}const s=new J(32,32),n=F.Fi,r=F.Ni,h=F.Di,o=m.ft,l=m.ut,a=m.dt,c=m.left,f=m.right,u=m.top,d=m.bottom;F.Bi=!1,m.bind(s.ft,32,32),m.fillRect(0,0,32,32,Rt.Oy),F.Zi();const w=e.Up(1),y=F.sin[e.Pp]*e.Gp>>16,A=F.cos[e.Pp]*e.Gp>>16;w.fh(0,e.Wp,e.Yp,e.Pp,e.Hp,y+(w.Fr/2|0)+e.Vp,A+e.Vp);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.ft[t+32*i]&&(t>0&&s.ft[t+32*i-1]>1||i>0&&s.ft[t+32*(i-1)]>1||t<31&&s.ft[t+32*i+1]>1||i<31&&s.ft[t+32*(i+1)]>1)&&(s.ft[t+32*i]=1);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.ft[t+32*i]&&t>0&&i>0&&s.ft[t+32*(i-1)-1]>0&&(s.ft[t+32*i]=3153952);if(-1!==e.Mp){const t=this.Fp(e.Kp,10),i=t.Ii,s=t.gi;t.Ii=32,t.gi=32,t.Oi(5,5,22,22),t.Ii=i,t.gi=s}return Mt.xp?.put(BigInt(t),s),m.bind(o,l,a),m._t(c,u,f,d),F.Fi=n,F.Ni=r,F.Di=h,F.Bi=!0,e.Xp?s.Ii=33:s.Ii=32,s.gi=i,s};model=0;name=null;Nw=null;Bw=null;Uw=null;Gp=2e3;Pp=0;Wp=0;Yp=0;Hp=0;Vp=0;jp=!1;zp=-1;Xp=!1;Zp=1;members=!1;Dw=null;Dp=null;qp=-1;Jp=-1;$p=0;Qp=-1;t_=-1;i_=0;e_=-1;s_=-1;n_=-1;r_=-1;h_=-1;o_=-1;Np=null;Bp=null;Kp=-1;Mp=-1;decode(t,i){if(1===t)this.model=i.Jt;else if(2===t)this.name=i.ni;else if(3===t)this.Nw=i.ni;else if(4===t)this.Gp=i.Jt;else if(5===t)this.Pp=i.Jt;else if(6===t)this.Wp=i.Jt;else if(7===t)this.Hp=i.$t,this.Hp>32767&&(this.Hp-=65536);else if(8===t)this.Vp=i.$t,this.Vp>32767&&(this.Vp-=65536);else if(9===t)this.jp=!0;else if(10===t)this.zp=i.Jt;else if(11===t)this.Xp=!0;else if(12===t)this.Zp=i.ti;else if(16===t)this.members=!0;else if(23===t)this.qp=i.Jt,this.$p=i.qt;else if(24===t)this.Jp=i.Jt;else if(25===t)this.Qp=i.Jt,this.i_=i.qt;else if(26===t)this.t_=i.Jt;else if(t>=30&&t<35)this.Dw||(this.Dw=new v(5,null)),this.Dw[t-30]=i.ni,'hidden'===this.Dw[t-30]?.toLowerCase()&&(this.Dw[t-30]=null);else if(t>=35&&t<40)this.Dp||(this.Dp=new v(5,null)),this.Dp[t-35]=i.ni;else if(40===t){const t=i.Zt;this.Bw=new Uint16Array(t),this.Uw=new Uint16Array(t);for(let e=0;e=100&&t<110&&(this.Np&&this.Bp||(this.Np=new Uint16Array(10),this.Bp=new Uint16Array(10)),this.Np[t-100]=i.Jt,this.Bp[t-100]=i.Jt)}l_(t){let i=this.qp;if(1===t&&(i=this.Qp),-1===i)return null;let e=this.Jp,s=this.e_;1===t&&(e=this.t_,s=this.s_);let n=j.model(i);if(-1!==e){const t=j.model(e);if(-1===s){const i=[n,t];n=j.Xr(i,2)}else{const i=[n,t,j.model(s)];n=j.Xr(i,3)}}if(0===t&&0!==this.$p&&n.translate(this.$p,0,0),1===t&&0!==this.i_&&n.translate(this.i_,0,0),this.Bw&&this.Uw)for(let t=0;t1){let i=-1;for(let e=0;e<10;e++)t>=this.Bp[e]&&0!==this.Bp[e]&&(i=this.Np[e]);if(-1!==i)return Mt.get(i).Up(1)}if(Mt.Gh){const t=Mt.Gh.get(BigInt(this.id));if(t)return t}const i=j.model(this.model);if(this.Bw&&this.Uw)for(let t=0;t=this.v_&&(this.M_=null),t>=this.O_&&t=kt.I_[i].length)&&(e=0),this.T_[i]=e}this.MA=t.Jt,65535===this.MA&&(this.MA=-1),this.kA=t.Jt,65535===this.kA&&(this.kA=-1),this.DA=t.Jt,65535===this.DA&&(this.DA=-1),this.FA=t.Jt,65535===this.FA&&(this.FA=-1),this.NA=t.Jt,65535===this.NA&&(this.NA=-1),this.BA=t.Jt,65535===this.BA&&(this.BA=-1),this.UA=t.Jt,65535===this.UA&&(this.UA=-1),this.name=$.Bh($.kh(t.ii)),this.b_=t.Zt,this.visible=!0,this.R_=0n;for(let t=0;t<12;t++)this.R_<<=0x4n,this.E_[t]>=256&&(this.R_+=BigInt(this.E_[t])-256n);this.E_[0]>=256&&(this.R_+=BigInt(this.E_[0])-256n>>4n),this.E_[1]>=256&&(this.R_+=BigInt(this.E_[1])-256n>>8n);for(let t=0;t<5;t++)this.R_<<=0x3n,this.R_+=BigInt(this.T_[t]);this.R_<<=0x1n,this.R_+=BigInt(this.g_)}Lp(){if(!this.visible)return null;const t=new v(12,null);let i=0;for(let e=0;e<12;e++){const s=this.E_[e];if(s>=256&&s<512&&(t[i++]=xt.tn[s-256].Lp()),s>=512){const e=Mt.get(s-512).Lp(this.g_);e&&(t[i++]=e)}}const e=j.Xr(t,i);for(let t=0;t<5;t++)0!==this.T_[t]&&(e.rh(kt.I_[t][0],kt.I_[t][this.T_[t]]),1===t&&e.rh(kt.__[0],kt.__[this.T_[t]]));return e}k_(){let t=this.R_,i=-1,e=-1,s=-1,n=-1;if(this.tp>=0&&0===this.sp){const r=bt.tn[this.tp];if(r.frames&&(i=r.frames[this.ip]),this.JA>=0&&this.JA!==this.MA){const t=bt.tn[this.JA].frames;t&&(e=t[this.$A])}r.Iy>=0&&(s=r.Iy,t+=BigInt(s-this.E_[5])<<8n),r.gy>=0&&(n=r.gy,t+=BigInt(n-this.E_[3])<<16n)}else if(this.JA>=0){const t=bt.tn[this.JA].frames;t&&(i=t[this.$A])}let r=kt.Gh?.get(t);if(!r){const i=new v(12,null);let e=0;for(let t=0;t<12;t++){let r=this.E_[t];if(n>=0&&3===t&&(r=n),s>=0&&5===t&&(r=s),r>=256&&r<512){const t=xt.tn[r-256].Ul();t&&(i[e++]=t)}if(r>=512){const t=Mt.get(r-512).l_(this.g_);t&&(i[e++]=t)}}r=j.Xr(i,e);for(let t=0;t<5;t++)0!==this.T_[t]&&(r.rh(kt.I_[t][0],kt.I_[t][this.T_[t]]),1===t&&r.rh(kt.__[0],kt.__[this.T_[t]]));r.Qr(),r.oh(64,850,-30,-50,-30,!0),kt.Gh?.put(t,r)}if(this.Li)return r;const h=j.Wr(r,!0);return-1!==i&&-1!==e?h.th(i,e,bt.tn[this.tp].py):-1!==i&&h.eh(i),h.Kr(),h.Hr=null,h.Yr=null,h}}class Dt extends gt{static count=0;static cache=null;static Zs=null;static Ow=null;static Lw=0;static Gh=new q(30);static en=t=>{this.Zs=new R(t.read('npc.dat'));const i=new R(t.read('npc.idx'));this.count=i.Jt,this.Ow=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.Ow||!this.Zs)throw new Error('NpcType not loaded!!!');for(let i=0;i<20;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Lw=(this.Lw+1)%20;const i=this.cache[this.Lw]=new Dt(t);return this.Zs.Xt=this.Ow[t],i.ww(this.Zs),i};static zi=()=>{this.Gh=null,this.Ow=null,this.cache=null,this.Zs=null};name=null;Nw=null;size=1;Fw=null;vp=null;Hw=!1;D_=-1;F_=-1;N_=-1;B_=-1;U_=-1;Bw=null;Uw=null;Dw=null;Jw=-1;$w=-1;Qw=-1;P_=!0;G_=-1;Rp=128;Op=128;decode(t,i){if(1===t){const t=i.Zt;this.Fw=new Uint16Array(t);for(let e=0;e=30&&t<40)this.Dw||(this.Dw=new v(5,null)),this.Dw[t-30]=i.ni,'hidden'===this.Dw[t-30]?.toLowerCase()&&(this.Dw[t-30]=null);else if(40===t){const t=i.Zt;this.Bw=new Uint16Array(t),this.Uw=new Uint16Array(t);for(let e=0;e{const i=new R(t.read('varp.dat'));this.count=i.Jt;for(let t=0;t{It.Li=!1,F.Li=!1,Nt.Li=!1,Ot.Li=!1};static II=()=>{It.Li=!0,F.Li=!0,Nt.Li=!0,Ot.Li=!0};gI=2048;CI=2047;EI=!1;TI=!1;bI=!1;RI=!1;db=null;OI=0;vI=[];stream=null;in=R.zt(1);LI=R.zt(1);SI=R.zt(1);xI=0n;MI=0;kI=0;DI=0;FI=null;NI=0;packetSize=0;BI=0;UI=0;GI=0;WI=null;YI=!0;HI=0;VI=0;KI=null;XI=null;jI=null;zI=null;ZI=null;qI=null;JI=null;$I=null;QI=null;tg=null;ig=null;eg='';sg='';username='';password='';ng=null;rg=null;hg=null;og=null;lg=[];ag=!1;cg=null;fg=null;ug=null;dg=null;wg=null;yg=null;mg=null;Ag=null;pg=null;_g=null;Ig=new Int32Array(256);gg=0;Cg=0;Eg=0;Tg=null;bg=null;Rg=null;Og=null;vg=null;Lg=null;Sg=null;xg=null;Mg=null;kg=null;Dg=null;Fg=null;Ng=null;Bg=null;Ug=null;Pg=null;Gg=null;Wg=null;Yg=null;Hg=null;Vg=null;Kg=new Int32Array(33);Xg=new Int32Array(33);jg=new Int32Array(151);zg=new Int32Array(151);Zg=null;qg=null;Jg=null;$g=null;Qg=null;tC=null;iC=new v(13,null);eC=null;sC=null;nC=new v(50,null);rC=new v(50,null);hC=new v(20,null);oC=new v(20,null);lC=null;aC=new v(8,null);cC=null;fC=null;uC=null;dC=null;wC=null;yC=null;mC=null;AC=null;pC=null;_C=null;IC=null;gC=null;CC=null;EC=null;TC=null;bC=null;RC=null;OC=null;vC=new v(1e3,null);LC=!1;SC=!1;xC=!1;MC=!1;kC=-1;DC=0;FC=0;NC=0;BC=0;UC=0;PC=0;GC=!1;WC=0;YC=0;HC=0;VC=0;KC=0;XC=0;jC=[];zC=-1;ZC=-1;qC=new Q;JC=78;$C=0;QC=0;tE=[];iE=0;eE=0;sE=0;nE=0;rE=0;hE=0;oE=0;lE=0;aE=[];cE=[];fE=[];uE=[];dE=null;wE=-1;yE=3;mE=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];AE=0;pE=0;_E=0;IE=!1;gE=0;CE=!1;EE='';TE='';bE=0;RE='';OE=!1;vE=-1;LE=new v(100,null);SE=new v(100,null);messageType=new Int32Array(100);xE=new Int32Array(100);ME=0;kE=0;DE=0;FE='';NE=0;BE=0;UE=0;PE=0;GE=0;WE=0;YE=0;HE=0;VE=0;KE=!1;XE=0;jE=0;zE=0;ZE=0;qE=null;JE=0;$E=0;QE=0;tT=0;iT=!1;eT=[];sT=[];nT=0;rT=0;hT=0;oT=null;lT=0;aT=new Int32Array(500);cT=new Int32Array(500);fT=new Int32Array(500);uT=new Int32Array(500);dT=0;wT=0;yT=0;mT='';AT=!1;pT=-1;_T=0;IT=0;gT=0;CT=0;ET=0;TT=new Int32Array(1e3);bT=new Int32Array(1e3);RT=null;OT=0;vT=0;LT=0;ST=0;xT=0;MT=!1;kT=0;DT=0;FT=0;NT=0;BT=2;UT=2;PT=1;GT=new Int32Array(5);WT=new v(5,!1);YT=new Int32Array(5);HT=new Int32Array(5);VT=new Int32Array(5);KT=0;XT=0;jT=0;zT=0;ZT=0;qT=0;JT=0;$T=0;QT=0;tb=1;ib=2;eb=-1;$n=0;tr=0;sb=0;nb=0;rb=0;hb=0;ob=null;lb=null;ab=null;cb=0;fb=0;ub=new Int8Array(16384);wb=new v(ut.gf,null);yb=0;mb=0;Ab=128;pb=0;_b=0;Ib=0;gb=0;Cb=0;uA=null;dA=null;Eb=new k(ut.Cf,ut.Cf);Tb=0;bb=0;Rb=0;Ob=0;vb=0;Lb=0;Sb=0;xb=0;Mb=0;kb=0;Db=0;Fb=0;Nb=new v(this.gI,null);Bb=0;Ub=new Int32Array(this.gI);Pb=0;Gb=0;Wb=new Int32Array(this.gI);Yb=new Int32Array(1e3);Hb=new v(this.gI,null);Vb=new v(8192,null);Kb=0;Xb=new Int32Array(8192);jb=new b;zb=new b;Zb=new b;_d=new b;qb=new S(ut.gf,ut.Cf,ut.Cf,null);Jb=new b;$b=new Int32Array(4e3);Qb=new Int32Array(4e3);tR=new Int32Array(ut.Cf*ut.Cf);iR=new Int32Array(ut.Cf*ut.Cf);eR=0;sR=null;nR=0;rR=0;hR=-1;oR=0;lR=0;aR=0;cR=0;fR=!1;uR=!0;dR=!1;wR=new Int32Array(7);yR=new Int32Array(5);mR=0;AR=0;static pR=50;_R=new Int32Array(Nt.pR);IR=new Int32Array(Nt.pR);gR=new Int32Array(Nt.pR);CR=new Int32Array(Nt.pR);ER=new Int32Array(Nt.pR);TR=new Int32Array(Nt.pR);bR=new Int32Array(Nt.pR);RR=new v(Nt.pR,null);OR=new v(100,null);vR=new BigInt64Array(100);LR=new Int32Array(100);SR=null;xR=0;MR=!0;kR=new Int32Array(50);DR=new Int32Array(50);FR=new Int32Array(50);NR=192;BR=-1;UR=-1;PR=0;GR=0;WR=0;YR=!0;HR=null;VR=0;KR=0;XR=192;jR=new v(16,null);zR=0;ZR=!1;zi=()=>{try{this.stream&&this.stream.close()}catch(t){}this.stream=null,window._tinyMidiStop&&window._tinyMidiStop(),this.LI=null,this.SI=null,this.in=null,this.ab=null,this.ob=null,this.lb=null,this.uA=null,this.dA=null,this.RT=null,this.wb=null,this.tR=null,this.iR=null,this.$b=null,this.Qb=null,this.ub=null,this.bg=null,this.Rg=null,this.Og=null,this.vg=null,this.Lg=null,this.Sg=null,this.xg=null,this.Mg=null,this.kg=null,this.Dg=null,this.Fg=null,this.Ng=null,this.Bg=null,this.Ug=null,this.Pg=null,this.Gg=null,this.Wg=null,this.Zg=null,this.Jg=null,this.qg=null,this.$g=null,this.Qg=null,this.tC=null,this.iC=null,this.mC=null,this.AC=null,this.pC=null,this._C=null,this.IC=null,this.gC=null,this.CC=null,this.EC=null,this.TC=null,this.bC=null,this.sC=null,this.hC=null,this.oC=null,this.aC=null,this.cC=null,this.fC=null,this.uC=null,this.dC=null,this.nC=null,this.rC=null,this.Eb=null,this.Nb=null,this.Ub=null,this.Wb=null,this.Hb=null,this.Yb=null,this.Vb=null,this.Xb=null,this.qb=null,this.Jb=null,this._d=null,this.jb=null,this.zb=null,this.Zb=null,this.fT=null,this.uT=null,this.aT=null,this.cT=null,this.jC=null,this.eT=null,this.TT=null,this.bT=null,this.vC=null,this.eC=null,this.OR=null,this.vR=null,this.LR=null,this.zI=null,this.ZI=null,this.KI=null,this.XI=null,this.jI=null,this.qI=null,this.JI=null,this.$I=null,this.QI=null,this.qR(),Et.zi(),Dt.zi(),Mt.zi(),Ct.tn=null,xt.tn=null,Q.tn=null,bt.tn=null,St.tn=null,St.Gh=null,Ft.tn=null,this.ke=null,kt.Gh=null,F.zi(),It.zi(),j.zi(),H.tn=[],V.tn=[]};Ds(){return this.HI}Ms(){return this.OE}ks(){return this.CE}xs(){return this.ZC}Ss(){return this.kC}qR=()=>{this.ag=!1,this.Tg&&(clearInterval(this.Tg),this.Tg=null),this.tg=null,this.ig=null,this.lg=[],this.mg=null,this.Ag=null,this.pg=null,this._g=null,this.dg=null,this.ug=null,this.wg=null,this.yg=null,this.cg=null,this.fg=null};JR=async(t,i,e,s)=>{let n=5,r=await(this.db?.Bs(t));if(r&&R.Kt(r)!==e&&(r=void 0),r)return new W(r);for(;!r;){await this.ws(s,`Requesting ${i}`);try{r=await T(`${Nt.J_}/${t}${e}`)}catch(t){r=void 0;for(let t=n;t>0;t--)await this.ws(s,`Error loading - Will retry in ${t} secs.`),await E(1e3);n*=2,n>60&&(n=60)}}return await(this.db?.Us(t,r)),new W(r)};$R=async(t,e,s)=>{let n=await(this.db?.Bs(t+'.mid'));if(n&&12345678!==e&&R.Kt(n)!==e&&(n=void 0),!n)try{n=await T(`${Nt.J_}/${t}_${e}.mid`),s!==n.length&&(n=n.slice(0,s))}catch(t){}if(!n)return;await(this.db?.Us(t+'.mid',n));const r=new R(Uint8Array.from(n)).ti;!function(t,i){window._tinyMidiPlay&&window._tinyMidiPlay(t,i/256)}(i.read(r,n,s,4),this.XR)};QR=()=>{if(p.fillStyle='black',p.fillRect(0,0,this.width,this.height),this.As(1),this.bI){this.ag=!1,p.font='bold 16px helvetica, sans-serif',p.textAlign='left',p.fillStyle='yellow';let t=35;p.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,p.fillStyle='white',p.fillText('To fix this try the following (in order):',30,t),t+=50,p.font='bold 12px helvetica, sans-serif',p.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,p.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,p.fillText('3: Try using a different game-world',30,t),t+=30,p.fillText('4: Try rebooting your computer',30,t),t+=30,p.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.RI&&(this.ag=!1,p.font='bold 20px helvetica, sans-serif',p.textAlign='left',p.fillStyle='white',p.fillText('Error - unable to load game!',50,50),p.fillText('To play RuneScape make sure you play from',50,100),p.fillText('https://2004scape.org',50,150)),this.TI){this.ag=!1,p.font='bold 13px helvetica, sans-serif',p.textAlign='left',p.fillStyle='yellow';let t=35;p.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,p.fillStyle='white',p.fillText('To fix this try the following (in order):',30,t),t+=50,p.font='bold 12px helvetica, sans-serif',p.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,p.fillText('2: Try rebooting your computer, and reloading',30,t)}};tO=t=>{if(!t.wl)return!1;for(let i=0;i=s)return!1}else if(3===t.wl[i]){if(e<=s)return!1}else if(4===t.wl[i]){if(e===s)return!1}else if(e!==s)return!1}return!0};eO=(t,i,e,s,n)=>{this.wC?.draw(t,i),this.yC?.draw(t,i+n-16),m.fillRect(t,i+16,16,n-32,Rt.Py);let r=(n-32)*n/s|0;r<8&&(r=8);const h=(n-r-32)*e/(s-n)|0;m.fillRect(t,i+h+16,16,r,Rt.Gy),m.Et(t,i+h+16,Rt.Wy,r),m.Et(t+1,i+h+16,Rt.Wy,r),m.Ct(t,i+h+16,Rt.Wy,16),m.Ct(t,i+h+17,Rt.Wy,16),m.Et(t+15,i+h+16,Rt.Yy,r),m.Et(t+14,i+h+17,Rt.Yy,r-1),m.Ct(t,i+h+r+15,Rt.Yy,16),m.Ct(t+1,i+h+r+14,Rt.Yy,15)};sO=(t,i)=>{let e=!1;const s=Q.tn[t];if(!s.ml)return!1;for(let t=0;ts.delay[n.zl];)n.Zl-=s.delay[n.zl]+1,n.zl++,n.zl>=s.my&&(n.zl-=s.yy,(n.zl<0||n.zl>=s.my)&&(n.zl=0)),e=!0}}}return e};nO=(t,i,e,s,n=!1)=>{if(0!==t.type||!t.ml||t.hide&&this.NE!==t.id&&this.BE!==t.id&&this.UE!==t.id)return;const r=m.left,h=m.top,o=m.right,l=m.bottom;m._t(i,e,i+t.width,e+t.height);const a=t.ml.length;for(let r=0;r0&&this.rO(l),l.type===Q.Wh)l.jl>l.scroll-l.height&&(l.jl=l.scroll-l.height),l.jl<0&&(l.jl=0),this.nO(l,h,o,l.jl,n),l.scroll>l.height&&this.eO(h+l.width,o,l.jl,l.scroll,l.height);else if(l.type===Q.Hh){let t=0;for(let i=0;i0){let i=0,e=0;const r=l._l[t]-1;if(s>=-32&&s<=512&&n>=-32&&n<=334||0!==this.WE&&this.GE===t){const h=Mt.Fp(r,l.Il[t]);if(0!==this.WE&&this.GE===t&&this.PE===l.id?(i=this.Xe-this.YE,e=this.je-this.HE,i<5&&i>-5&&(i=0),e<5&&e>-5&&(e=0),this.VE<5&&(i=0,e=0),h.Eh(128,s+i,n+e)):0!==this.JE&&this.$E===t&&this.QE===l.id?h.Eh(128,s,n):h.draw(s,n),33===h.Ii||1!==l.Il[t]){const r=l.Il[t];this.ng?.hO(s+i+1,n+10+e,this.oO(r),Rt.Oy),this.ng?.hO(s+i,n+9+e,this.oO(r),Rt.Ey)}}}else if(l.Ol&&t<20){const i=l.Ol[t];i?.draw(s,n)}t++}}else if(l.type===Q.Vh)l.fill?m.fillRect(h,o,l.width,l.height,l.kl):m.gt(h,o,l.width,l.height,l.kl);else if(l.type===Q.Kh){const t=l.font;let i=l.kl,e=l.text;if(this.UE!==l.id&&this.BE!==l.id&&this.NE!==l.id||0===l.Fl||(i=l.Fl),this.tO(l)&&(i=l.Dl,l.Ml&&l.Ml.length>0&&(e=l.Ml)),l.fl===Q.io&&this.iT&&(e='Please wait...',i=l.kl),!t||!e)continue;for(let s=o+t.height;e.length>0;s+=t.height){if(-1!==e.indexOf('%')){for(;;){const t=e.indexOf('%1');if(-1===t)break;e=e.substring(0,t)+this.lO(this.iO(l,0))+e.substring(t+2)}for(;;){const t=e.indexOf('%2');if(-1===t)break;e=e.substring(0,t)+this.lO(this.iO(l,1))+e.substring(t+2)}for(;;){const t=e.indexOf('%3');if(-1===t)break;e=e.substring(0,t)+this.lO(this.iO(l,2))+e.substring(t+2)}for(;;){const t=e.indexOf('%4');if(-1===t)break;e=e.substring(0,t)+this.lO(this.iO(l,3))+e.substring(t+2)}for(;;){const t=e.indexOf('%5');if(-1===t)break;e=e.substring(0,t)+this.lO(this.iO(l,4))+e.substring(t+2)}}const n=e.indexOf('\\n');let r;-1!==n?(r=e.substring(0,n),e=e.substring(n+2)):(r=e,e=''),l.Sl?t.aO(h+(l.width/2|0),s,r,i,l.xl):t.cO(h,s,r,i,l.xl)}}else if(l.type===Q.Xh){let t;t=this.tO(l)?l.Bl:l.Nl,t?.draw(h,o)}else if(l.type===Q.jh){const t=F.Fi,i=F.Ni;F.Fi=h+(l.width/2|0),F.Ni=o+(l.height/2|0);const e=F.sin[l.Yl]*l.zoom>>16,s=F.cos[l.Yl]*l.zoom>>16,n=this.tO(l);let r;r=n?l.Wl:l.Gl;let a=null;if(-1===r)a=l.Ul(-1,-1,n);else{const t=bt.tn[r];t.frames&&t.Ay&&(a=l.Ul(t.frames[l.zl],t.Ay[l.zl],n))}a&&a.fh(0,l.Hl,0,l.Yl,0,e,s),F.Fi=t,F.Ni=i}else if(l.type===Q.zh){const t=l.font;if(!t||!l._l||!l.Il)continue;let i=0;for(let e=0;e0){const n=Mt.get(l._l[i]-1);let r=n.name;if((n.Xp||1!==l.Il[i])&&(r=r+' x'+this.fO(l.Il[i])),!r)continue;const a=h+s*(l.El+115),c=o+e*(l.Tl+12);l.Sl?t.aO(a+(l.width/2|0),c,r,l.kl,l.xl):t.cO(a,c,r,l.kl,l.xl)}i++}}}m._t(r,h,o,l)};rO=t=>{let i=t.ul;if(i>=Q.eo&&i<=Q.so)i--,i>=this.mR?(t.text='',t.fl=0):(t.text=this.OR[i],t.fl=1);else if(i>=Q.no&&i<=Q.ro)i-=Q.no,i>=this.mR?(t.text='',t.fl=0):(0===this.LR[i]?t.text='@red@Offline':this.LR[i]===Nt.Z_?t.text='@gre@World-'+(this.LR[i]-9):t.text='@yel@World-'+(this.LR[i]-9),t.fl=1);else if(i===Q.lo)t.scroll=15*this.mR+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i>=Q.Po&&i<=Q.Go)i-=Q.Po,i>=this.QC?(t.text='',t.fl=0):(t.text=$.Bh($.kh(this.tE[i])),t.fl=1);else if(i===Q.Ho)t.scroll=15*this.QC+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i===Q.Uo){if(t.Yl=150,t.Hl=256*Math.sin(this.OI/40)&2047,this.dR){this.dR=!1;const i=new v(7,null);let e=0;for(let t=0;t<7;t++){const s=this.wR[t];s>=0&&(i[e++]=xt.tn[s].Ul())}const s=j.Xr(i,e);for(let t=0;t<5;t++)0!==this.yR[t]&&(s.rh(kt.I_[t][0],kt.I_[t][this.yR[t]]),1===t&&s.rh(kt.__[0],kt.__[this.yR[t]]));if(this.sR){const i=bt.tn[this.sR.MA].frames;i&&(s.Qr(),s.eh(i[0]),s.oh(64,850,-30,-50,-30,!0),t.model=s)}}}else if(i===Q.Fo)this.RC||(this.RC=t.Nl,this.OC=t.Bl),this.uR?t.Nl=this.OC:t.Nl=this.RC;else if(i===Q.No)this.RC||(this.RC=t.Nl,this.OC=t.Bl),this.uR?t.Nl=this.RC:t.Nl=this.OC;else if(i===Q.Vo)t.text=this.mT,this.OI%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(i===Q.sl)this.fR?this.AT?(t.kl=Rt.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.kl=Rt.Ry,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(i===Q.nl||i===Q.al)if(0===this._T)t.text='';else{let i;i=0===this.IT?'earlier today':1===this.IT?'yesterday':this.IT+' days ago',t.text='You last logged in '+i+' from: '+$.Nh(this._T)}else if(i===Q.rl)0===this.CT&&(t.text='0 unread messages',t.kl=Rt.Ey),1===this.CT&&(t.text='1 unread message',t.kl=Rt.GREEN),this.CT>1&&(t.text=this.CT+' unread messages',t.kl=Rt.GREEN);else if(i===Q.hl)if(201===this.gT)t.text='';else if(200===this.gT)t.text='You have not yet set any password recovery questions.';else{let i;i=0===this.gT?'Earlier today':1===this.gT?'Yesterday':this.gT+' days ago',t.text=i+' you changed your recovery questions'}else i===Q.ol?201===this.gT?t.text='':200===this.gT?t.text='We strongly recommend you do so now to secure your account.':t.text='If you do not remember making this change then cancel it immediately':i===Q.ll&&(201===this.gT?t.text='':(this.gT,t.text="Do this from the 'account management' area on our front webpage"))};iO=(t,i)=>{if(!t.scripts||i>=t.scripts.length)return-2;try{const e=t.scripts[i];if(!e)return-1;let s=0,n=0;for(;;){const t=e[n++];if(0===t)return s;if(1===t)s+=this.cE[e[n++]];else if(2===t)s+=this.fE[e[n++]];else if(3===t)s+=this.aE[e[n++]];else if(4===t){const t=Q.tn[e[n++]],i=e[n++]+1;if(t._l&&t.Il)for(let e=0;et<999999999?String(t):'*';fO=t=>{let i=String(t);for(let t=i.length-3;t>0;t-=3)i=i.substring(0,t)+','+i.substring(t);return i.length>8?i='@gre@'+i.substring(0,i.length-8)+' million @whi@('+i+')':i.length>4&&(i='@cya@'+i.substring(0,i.length-4)+'K @whi@('+i+')'),' '+i};oO=t=>t<1e5?String(t):t<1e7?(t/1e3|0)+'K':(t/1e6|0)+'M'}(new class extends Nt{EI=!1;TI=!1;bI=!1;RI=!1;uO=null;dO=null;wO=null;yO=null;mO=null;AO=null;Nu=0;Bu=0;Uu=0;pO=0;_O=0;IO=2;model={id:parseInt(P.getParameter('model'))||0,gO:null,x:0,y:0,z:420,xa:0};constructor(){super(!0)}load=async()=>{if(this.EI)this.TI=!0;else{this.EI=!0;try{await async function(t){if(o||h)return;o=!0;const i=await r(t);h||(h=i)}(),await i.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new G(await G.openDatabase()),this.ke?.bind(),F.Zi(),this.uO=document.getElementById('rightPanel');const t=document.getElementById('mainPanel');t&&(t.ondragover=t=>{t.preventDefault(),t.stopPropagation()},t.ondrop=async t=>{if(t.preventDefault(),t.stopPropagation(),!t.dataTransfer||!t.dataTransfer.files.length)return;const i=['main_file_cache.dat','main_file_cache.idx0','main_file_cache.idx1','main_file_cache.idx2','main_file_cache.idx3','main_file_cache.idx4'],e=[];for(let s=0;s{this.TI||this.bI||this.RI||(this.CO(),this.EO())};draw=async()=>{this.TI||this.bI||this.RI?this.QR():(m.clear(),m.fillRect(0,0,this.width,this.height,Rt.Oy),null!==this.model.gO&&this.model.gO.draw(this.model.xa,F.sin[this.pO],F.cos[this.pO],F.sin[this._O],F.cos[this._O],this.model.x-this.Nu,this.model.y-this.Bu,this.model.z-this.Uu,0),this.ke?.draw(0,0))};init=async()=>{const t=await(this.db?.Bs('main_file_cache.dat'));if(!t){return document.getElementById('helpme').style.display='block',void(A.style.display='none')}const i=await(this.db?.Bs('main_file_cache.idx0')),e=await(this.db?.Bs('main_file_cache.idx1')),s=await(this.db?.Bs('main_file_cache.idx2')),n=await(this.db?.Bs('main_file_cache.idx3')),r=await(this.db?.Bs('main_file_cache.idx4'));if(!(i&&e&&s&&n&&r)){return document.getElementById('helpme').style.display='block',void(A.style.display='none')}document.getElementById('helpme').style.display='none',A.style.display='block',this.dO=new Y(t,i,0),this.wO=new Y(t,e,1),this.yO=new Y(t,s,2),this.mO=new Y(t,n,3),this.AO=new Y(t,r,4),await this.ws(10,'Unpacking textures');const h=this.dO.read(6);F.$i(h),F.ie(.8),F.se(20),await this.ws(20,'Loading models...');for(let t=0;t{this.model.id=i,this.TO(i)},t.appendChild(e)}}};TO(t){if(null===this.wO)return;const i=this.wO.read(t);null!==i?(this.model.gO=j.jr(i,t),this.model.gO.oh(64,850,-30,-50,-30,!0),document.title=`Model ${t} | 2004Scape Tools`):document.title=`Missing model ${t} | 2004Scape Tools`}CO(){for(;;){const t=this._s();if(-1===t)break;t==='r'.charCodeAt(0)?(this.IO=2,this.Nu=0,this.Bu=0,this.Uu=0,this.pO=0,this._O=0,this.model.x=0,this.model.y=0,this.model.z=420,this.model.xa=0):t==='1'.charCodeAt(0)?(this.model.id--,j.metadata&&this.model.id<0&&(this.model.id=j.metadata.length-1),this.TO(this.model.id)):t==='2'.charCodeAt(0)&&(this.model.id++,j.metadata&&this.model.id>=j.metadata.length&&(this.model.id=0),this.TO(this.model.id))}}EO(){this.Je['['.charCodeAt(0)]?this.IO--:this.Je[']'.charCodeAt(0)]&&this.IO++,this.Je[1]?this.model.xa+=this.IO:this.Je[2]&&(this.model.xa-=this.IO),this.Je['w'.charCodeAt(0)]?this.model.z-=this.IO:this.Je['s'.charCodeAt(0)]&&(this.model.z+=this.IO),this.Je['a'.charCodeAt(0)]?this.model.x-=this.IO:this.Je['d'.charCodeAt(0)]&&(this.model.x+=this.IO),this.Je['q'.charCodeAt(0)]?this.model.y-=this.IO:this.Je['e'.charCodeAt(0)]&&(this.model.y+=this.IO),this.pO=2047&this.pO,this._O=2047&this._O,this.model.xa=2047&this.model.xa}}).us().then((()=>{}))})()})(); \ No newline at end of file +(()=>{"use strict";var t={7444:(t,i,e)=>{t.exports=e.p+"0c791968973e1f25c170.wasm"},8227:(t,i,e)=>{t.exports=e.p+"9f86b5397894e28b5ae2.wasm"}},i={};function e(s){var n=i[s];if(void 0!==n)return n.exports;var r=i[s]={exports:{}};return t[s](r,r.exports,e),r.exports}e.m=t,e.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),e.p="/Client2/",e.b=document.baseURI||self.location.href,(()=>{async function t(t,i={}){const e={env:Object.assign(Object.create(globalThis),i.env||{},{abort(t,i,e,s){t=h(t>>>0),i=h(i>>>0),e>>>=0,s>>>=0,(()=>{throw Error(`${t} in ${i}:${e}:${s}`)})()}})},{exports:s}=await WebAssembly.instantiate(t,e),n=s.memory||i.env.memory,r=Object.setPrototypeOf({read:(t,i,e,r)=>(i=function(t,i,e,r,h){if(null==r)return 0;const o=r.length,l=s.__pin(s.__new(o<>>0;if(h)new h(n.buffer,l,o).set(r);else for(let i=0;i>>0),r[i]);return s.__unpin(l),l}(l,6,0,i,Int8Array)||function(){throw TypeError("value must not be null")}(),function(t,i,e){if(!e)return null;const s=function(t){try{return o.getUint32(t,!0)}catch{return o=new DataView(n.buffer),o.getUint32(t,!0)}}(e-4)>>>i,r=new Array(s);for(let n=0;n>>0));return r}(a,0,s.read(t,i,e,r)>>>0))},s);function h(t){if(!t)return null;const i=t+new Uint32Array(n.buffer)[t-4>>>2]>>>1,e=new Uint16Array(n.buffer);let s=t>>>1,r="";for(;i-s>1024;)r+=String.fromCharCode(...e.subarray(s,s+=1024));return r+String.fromCharCode(...e.subarray(s,i))}let o=new DataView(n.buffer);function l(t,i){try{o.setUint8(t,i,!0)}catch{o=new DataView(n.buffer),o.setUint8(t,i,!0)}}function a(t){try{return o.getInt8(t,!0)}catch{return o=new DataView(n.buffer),o.getInt8(t,!0)}}return r}class i{static tt=null;static load=async i=>{this.tt=await t(new WebAssembly.Module(i),{env:void 0})};static read=(t,i,e,s)=>{if(!this.tt)throw new Error('bz2 not found!!');return Int8Array.from(this.tt.read(t,i,e,s))}}let s;function n(t,i){return s=t.exports,r.it=i,s}async function r(t){void 0===t&&(t=new URL(e(7444),e.b));const i={et:{}};('string'==typeof t||'function'==typeof Request&&t instanceof Request||'function'==typeof URL&&t instanceof URL)&&(t=fetch(t));const{instance:s,module:r}=await async function(t,i){if('function'==typeof Response&&t instanceof Response){if('function'==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(t,i)}catch(i){if('application/wasm'==t.headers.get('Content-Type'))throw i;console.warn('`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n',i)}const e=await t.arrayBuffer();return await WebAssembly.instantiate(e,i)}{const e=await WebAssembly.instantiate(t,i);return e instanceof WebAssembly.Instance?{instance:e,module:t}:e}}(await t,i);return n(s,r)}let h=null,o=!1;class l extends Error{constructor(t){super(t),this.name='DecompressionError'}}let a=0,c=null,f=null;function u(t,i,e){let s;if(e){const n=i;s=t.st(n);const r=new Uint8Array(t.memory.buffer,s,n);try{e(r)}catch(i){throw t.nt(s,n),i}return a=n,s}if('string'==typeof i){const e=a=function(t){let i=0,e=0,s=0;const n=t.length;for(;i{this.ft=t,this.ut=i,this.dt=e,this._t(0,0,i,e)};static It=()=>{this.left=0,this.top=0,this.right=this.ut,this.bottom=this.dt,this.wt=this.right-1,this.yt=this.right/2|0};static _t=(t,i,e,s)=>{t<0&&(t=0),i<0&&(i=0),e>this.ut&&(e=this.ut),s>this.dt&&(s=this.dt),this.top=i,this.bottom=s,this.left=t,this.right=e,this.wt=this.right-1,this.yt=this.right/2|0,this.At=this.bottom/2|0};static clear=()=>{const t=this.ut*this.dt;for(let i=0;i{this.Ct(t,i,n,e),this.Ct(t,i+s-1,n,e),this.Et(t,i,n,s),this.Et(t+e-1,i,n,s)};static Ct=(t,i,e,s)=>{if(i=this.bottom)return;tthis.right&&(s=this.right-t);const n=t+i*this.ut;for(let t=0;t{if(t=this.right)return;ithis.bottom&&(s=this.bottom-i);const n=t+i*this.ut;for(let t=0;t{const r=Math.abs(e-t),h=Math.abs(s-i),o=t=this.left&&t=this.top&&i-h&&(a-=h,t+=o),e{tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const r=this.ut-e;let h=t+i*this.ut;for(let t=-s;t<0;t++){for(let t=-e;t<0;t++)this.ft[h++]=n;h+=r}};static bt(t,i,e,s,n,r){tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const h=256-r,o=(n>>16&255)*r,l=(n>>8&255)*r,a=(255&n)*r,c=this.ut-e;let f=t+i*this.ut;for(let t=0;t>16&255)*h>>8<<16)+(l+(this.ft[f]>>8&255)*h>>8<<8)+(a+(255&this.ft[f])*h>>8);this.ft[f++]=t}f+=c}}static Rt(t,i,e,s,n){const r=256-n,h=(s>>16&255)*n,o=(s>>8&255)*n,l=(255&s)*n;let a=i-e;a<0&&(a=0);let c=i+e;c>=this.dt&&(c=this.dt-1);for(let s=a;s<=c;s++){const n=s-i,a=0|Math.sqrt(e*e-n*n);let c=t-a;c<0&&(c=0);let f=t+a;f>=this.ut&&(f=this.ut-1);let u=c+s*this.ut;for(let t=c;t<=f;t++){const t=(h+(this.ft[u]>>16&255)*r>>8<<16)+(o+(this.ft[u]>>8&255)*r>>8<<8)+(l+(255&this.ft[u])*r>>8);this.ft[u++]=t}}}static Ot=(t,i,e)=>{t=this.right||i=this.bottom||(this.ft[t+i*this.ut]=e)}}const A=document.getElementById('canvas'),p=A.getContext('2d',{willReadFrequently:!0}),_=document.createElement('canvas'),I=document.createElement('img'),g=_.getContext('2d',{willReadFrequently:!0});class C{vt;width;height;Lt;St;ft;constructor(t,i,e=p){this.Lt=e,this.vt=this.Lt.getImageData(0,0,t,i),this.St=new Uint32Array(this.vt.data.buffer),this.ft=new Int32Array(t*i),this.width=t,this.height=i,this.bind()}clear(){this.ft.fill(0)}bind(){m.bind(this.ft,this.width,this.height)}draw(t,i){this.#t(),this.Lt.putImageData(this.vt,t,i)}#t(){const t=this.ft.length,i=this.ft,e=this.St;for(let s=0;s>16&255|(t>>8&255)<<8|(255&t)<<16|4278190080}}}const E=async t=>new Promise((i=>setTimeout(i,t))),T=async t=>new Int8Array(await(await fetch(t)).arrayBuffer());class b{xt;cursor=null;constructor(){const t=new w;t.next=t,t.rt=t,this.xt=t}Mt(t){t.rt&&t.ht(),t.rt=this.xt.rt,t.next=this.xt,t.rt&&(t.rt.next=t),t.next.rt=t}kt(t){t.rt&&t.ht(),t.rt=this.xt,t.next=this.xt.next,t.rt.next=t,t.next&&(t.next.rt=t)}Dt(){const t=this.xt.next;return t===this.xt?null:(t?.ht(),t)}head(){const t=this.xt.next;return t===this.xt?(this.cursor=null,null):(this.cursor=t?.next||null,t)}Nt(){const t=this.xt.rt;return t===this.xt?(this.cursor=null,null):(this.cursor=t?.rt||null,t)}next(){const t=this.cursor;return t===this.xt?(this.cursor=null,null):(this.cursor=t?.next||null,t)}rt(){const t=this.cursor;return t===this.xt?(this.cursor=null,null):(this.cursor=t?.rt||null,t)}clear(){for(;;){const t=this.xt.next;if(t===this.xt)return;t?.ht()}}}class R extends y{static Ft=3988292384;static Bt=new Int32Array(256);static Ut=new Uint32Array(33);static Pt=new b;static Gt=new b;static Wt=new b;static Yt=0;static Ht=0;static Vt=0;static{for(let t=0;t<32;t++)R.Ut[t]=(1<>>=1:i=i>>>1^R.Ft;R.Bt[t]=i}}static Kt=t=>{let i=4294967295;for(let e=0;e>>8^R.Bt[255&(i^t[e])];return~i};view;data;Xt=0;jt=0;random=null;constructor(t){if(!t)throw new Error('Input src packet array was null!');super(),t instanceof Int8Array?this.data=new Uint8Array(t):this.data=t,this.view=new DataView(this.data.buffer,this.data.byteOffset,this.data.byteLength)}get length(){return this.view.byteLength}get available(){return this.length-this.Xt}static zt=t=>{let i=null;return 0===t&&R.Yt>0?(R.Yt--,i=R.Pt.Dt()):1===t&&R.Ht>0?(R.Ht--,i=R.Gt.Dt()):2===t&&R.Vt>0&&(R.Vt--,i=R.Wt.Dt()),i?(i.Xt=0,i):new R(0===t?new Uint8Array(100):1===t?new Uint8Array(5e3):new Uint8Array(3e4))};release(){this.Xt=0,100===this.view.byteLength&&R.Yt<1e3?(R.Pt.Mt(this),R.Yt++):5e3===this.view.byteLength&&R.Ht<250?(R.Gt.Mt(this),R.Ht++):3e4===this.view.byteLength&&R.Vt<50&&(R.Wt.Mt(this),R.Vt++)}get Zt(){return this.view.getUint8(this.Xt++)}get qt(){return this.view.getInt8(this.Xt++)}get Jt(){const t=this.view.getUint16(this.Xt);return this.Xt+=2,t}get $t(){const t=this.view.getInt16(this.Xt);return this.Xt+=2,t}get Qt(){const t=this.view.getUint8(this.Xt++)<<16|this.view.getUint16(this.Xt);return this.Xt+=2,t}get ti(){const t=this.view.getInt32(this.Xt);return this.Xt+=4,t}get ii(){const t=this.view.getBigInt64(this.Xt);return this.Xt+=8,t}get ei(){return this.view.getUint8(this.Xt)<128?this.Zt-64:this.Jt-49152}get si(){return this.view.getUint8(this.Xt)<128?this.Zt:this.Jt-32768}get ni(){const t=this.view,i=t.byteLength;let e,s='';for(;10!==(e=t.getUint8(this.Xt++))&&this.Xt>16),this.view.setUint16(this.Xt,t),this.Xt+=2}p4(t){this.view.setInt32(this.Xt,t),this.Xt+=4}ai(t){this.view.setInt32(this.Xt,t,!0),this.Xt+=4}ci(t){this.view.setBigInt64(this.Xt,t),this.Xt+=8}fi(t){const i=this.view,e=t.length;for(let s=0;s>>3,e=8-(7&this.jt),s=0;for(this.jt+=t;t>e;e=8)s+=(this.view.getUint8(i++)&R.Ut[e])<>>e-t&R.Ut[t],s}Ai(t,i){const e=this.Xt;this.Xt=0;const s=new Uint8Array(e);this.ri(e,0,s);const n=function(t){const i=[];for(;t>0n;)i.unshift(Number(0xffn&t)),t>>=8n;return 128&i[0]&&i.unshift(0),new Uint8Array(i)}(function(t,i,e){let s=1n;for(;i>0n;)i%2n===1n&&(s=s*t%e),t=t*t%e,i>>=1n;return s}(function(t){let i=0n;for(let e=0;e{const s=new R(t.read(i+'.dat')),n=new R(t.read('index.dat'));n.Xt=s.Jt;const r=n.Jt,h=n.Jt,o=n.Zt,l=new Int32Array(o);for(let t=1;ts.length||n.Xt>n.length)throw new Error;const a=n.Zt,c=n.Zt,f=n.Jt,u=n.Jt,d=new O(f,u,l);d.pi=a,d._i=c,d.Ii=r,d.gi=h;const w=d.ft,y=n.Zt;if(0===y){const t=d.width*d.height;for(let i=0;im.bottom&&(n-=i+n-m.bottom),tm.right){const i=t+r-m.right;r-=i,o+=i,h+=i}r>0&&n>0&&this.Ei(r,n,this.ft,s,o,m.ft,e,h)}Ti(){const t=this.ft,i=this.width,e=this.height;for(let s=0;s>16&255;n+=t,n<0?n=0:n>255&&(n=255);let r=this.palette[s]>>8&255;r+=i,r<0?r=0:r>255&&(r=255);let h=255&this.palette[s];h+=e,h<0?h=0:h>255&&(h=255),this.palette[s]=(n<<16)+(r<<8)+h}}Ri(){this.Ii|=0,this.gi|=0,this.Ii/=2,this.gi/=2,this.Ii|=0,this.gi|=0;const t=new Int8Array(this.Ii*this.gi);let i=0;for(let e=0;e>1)+(e+this._i>>1)*this.Ii]=this.ft[i++];this.ft=t,this.width=this.Ii,this.height=this.gi,this.pi=0,this._i=0}Oi(){if(this.width===this.Ii&&this.height===this.gi)return;const t=new Int8Array(this.Ii*this.gi);let i=0;for(let e=0;e>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=e[s++];0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t]}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=this.palette[255&t]}h+=o,s+=n}}clip(t,i,e,s){try{const n=this.width;this.height;let r=0,h=0;const o=this.Ii,l=this.gi,a=(o<<16)/e|0,c=(l<<16)/s|0;t=t+(this.pi*e+o-1)/o|0,i=i+(this._i*s+l-1)/l|0,this.pi*e%o!=0&&(r=(o-this.pi*e%o<<16)/e|0),this._i*s%l!=0&&(h=(l-this._i*s%l<<16)/s|0),e=e*(this.width-(r>>16))/o|0,s=s*(this.height-(h>>16))/l|0;let f,u=t+i*m.ut,d=m.ut-e;im.bottom&&(s-=i+s-m.bottom),tm.right&&(f=t+e-m.right,e-=f,d+=f),this.vi(m.ft,this.ft,this.palette,r,h,u,d,e,s,a,c,n)}catch(t){console.log('error in sprite clipping routine')}}vi(t,i,e,s,n,r,h,o,l,a,c,f){try{const u=s;for(let d=-l;d<0;d++){const l=(n>>16)*f;for(let n=-o;n<0;n++){const n=i[(s>>16)+l];0==n?r++:t[r++]=e[255&n],s+=a}n+=c,s=u,r+=h}}catch(t){console.log('error in plot_scale')}}}class v extends Array{constructor(t,i){super(t);for(let e=0;e{this.Si=null,this.Si=null,this.sin=null,this.cos=null,this.Di=null,this.Mi=null,this.Xi=null,this.ji=null,this.Pi=null,this.Gi=null,this.Hi=null,this.palette=null,this.Vi=null,console.log('Draw3D unloaded!')};static Zi=()=>{this.Di=new Int32Array(this.dt);for(let t=0;t{this.Di=new Int32Array(i);for(let e=0;e{this.Pi=null,this.Gi.fill(null)};static $i=t=>{this.ki=0;for(let i=0;i<50;i++)try{this.Mi[i]=O.Ci(t,i.toString()),this.Li&&128===this.Mi[i]?.Ii?this.Mi[i]?.Ri():this.Mi[i]?.Oi(),this.ki++}catch(t){}};static Qi=t=>{if(0!==this.ji[t])return this.ji[t];const i=this.Vi[t];if(!i)return 0;let e=0,s=0,n=0;const r=i.length;for(let t=0;t>16&255,s+=i[t]>>8&255,n+=255&i[t];let h=(e/r<<16)+(s/r<<8)+(n/r|0);return h=this.te(h,1.4),0===h&&(h=1),this.ji[t]=h,h};static ie=t=>{const i=t+.03*Math.random()-.015;let e=0;for(let t=0;t<512;t++){const s=(t/8|0)/64+.0078125,n=(7&t)/8+.0625;for(let t=0;t<128;t++){const r=t/128;let h=r,o=r,l=r;if(0!==n){let t;t=r<.5?r*(n+1):r+n-r*n;const i=2*r-t;let e=s+.3333333333333333;e>1&&e--;let a=s-.3333333333333333;a<0&&a++,h=6*e<1?i+6*(t-i)*e:2*e<1?t:3*e<2?i+(t-i)*(.6666666666666666-e)*6:i,o=6*s<1?i+6*(t-i)*s:2*s<1?t:3*s<2?i+(t-i)*(.6666666666666666-s)*6:i,l=6*a<1?i+6*(t-i)*a:2*a<1?t:3*a<2?i+(t-i)*(.6666666666666666-a)*6:i}const a=((256*h|0)<<16)+((256*o|0)<<8)+(256*l|0);this.palette[e++]=this.te(a,i)}}for(let t=0;t<50;t++){const e=this.Mi[t];if(!e)continue;const s=e.palette;this.Vi[t]=new Int32Array(s.length);for(let e=0;e{const e=(t>>16)/256,s=(t>>8&255)/256,n=(255&t)/256;return((256*Math.pow(e,i)|0)<<16)+((256*Math.pow(s,i)|0)<<8)+(256*Math.pow(n,i)|0)};static se=t=>{this.Pi||(this.Wi=t,this.Li?this.Pi=new k(t,16384):this.Pi=new k(t,65536),this.Gi.fill(null))};static ne=(t,i,e,s,n,r,h,o,l)=>{let a=0,c=0;n!==s&&(a=(i-t<<16)/(n-s)|0,c=(o-h<<15)/(n-s)|0);let f=0,u=0;r!==n&&(f=(e-i<<16)/(r-n)|0,u=(l-o<<15)/(r-n)|0);let d=0,w=0;if(r!==s&&(d=(t-e<<16)/(s-r)|0,w=(h-l<<15)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),nf)for(r-=n,n-=s,s=this.Di[s];;){if(--n<0)for(;;){if(--r<0)return;this.re(e>>16,i>>16,l>>7,o>>7,this.ft,s,0),e+=d,i+=f,l+=w,o+=u,s+=this.ut}this.re(e>>16,t>>16,l>>7,h>>7,this.ft,s,0),e+=d,t+=a,l+=w,h+=c,s+=this.ut}else for(r-=n,n-=s,s=this.Di[s];;){if(--n<0)for(;;){if(--r<0)return;this.re(i>>16,e>>16,o>>7,l>>7,this.ft,s,0),e+=d,i+=f,l+=w,o+=u,s+=this.ut}this.re(t>>16,e>>16,h>>7,l>>7,this.ft,s,0),e+=d,t+=a,l+=w,h+=c,s+=this.ut}else if(i=t<<=16,o=h<<=15,s<0&&(i-=d*s,t-=a*s,o-=w*s,h-=c*s,s=0),e<<=16,l<<=15,r<0&&(e-=f*r,l-=u*r,r=0),s!==r&&da)for(n-=r,r-=s,s=this.Di[s];;){if(--r<0)for(;;){if(--n<0)return;this.re(e>>16,t>>16,l>>7,h>>7,this.ft,s,0),e+=f,t+=a,l+=u,h+=c,s+=this.ut}this.re(i>>16,t>>16,o>>7,h>>7,this.ft,s,0),i+=d,t+=a,o+=w,h+=c,s+=this.ut}else for(n-=r,r-=s,s=this.Di[s];;){if(--r<0)for(;;){if(--n<0)return;this.re(t>>16,e>>16,h>>7,l>>7,this.ft,s,0),e+=f,t+=a,l+=u,h+=c,s+=this.ut}this.re(t>>16,i>>16,h>>7,o>>7,this.ft,s,0),i+=d,t+=a,o+=w,h+=c,s+=this.ut}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),rd)for(s-=r,r-=n,n=this.Di[n];;){if(--r<0)for(;;){if(--s<0)return;this.re(t>>16,e>>16,h>>7,l>>7,this.ft,n,0),t+=a,e+=d,h+=c,l+=w,n+=this.ut}this.re(t>>16,i>>16,h>>7,o>>7,this.ft,n,0),t+=a,i+=f,h+=c,o+=u,n+=this.ut}else for(s-=r,r-=n,n=this.Di[n];;){if(--r<0)for(;;){if(--s<0)return;this.re(e>>16,t>>16,l>>7,h>>7,this.ft,n,0),t+=a,e+=d,h+=c,l+=w,n+=this.ut}this.re(i>>16,t>>16,o>>7,h>>7,this.ft,n,0),t+=a,i+=f,h+=c,o+=u,n+=this.ut}else if(e=i<<=16,l=o<<=15,n<0&&(e-=a*n,i-=f*n,l-=c*n,o-=u*n,n=0),t<<=16,h<<=15,s<0&&(t-=d*s,h-=w*s,s=0),r-=s,s-=n,n=this.Di[n],a>16,i>>16,h>>7,o>>7,this.ft,n,0),t+=d,i+=f,h+=w,o+=u,n+=this.ut}this.re(e>>16,i>>16,l>>7,o>>7,this.ft,n,0),e+=a,i+=f,l+=c,o+=u,n+=this.ut}else for(;;){if(--s<0)for(;;){if(--r<0)return;this.re(i>>16,t>>16,o>>7,h>>7,this.ft,n,0),t+=d,i+=f,h+=w,o+=u,n+=this.ut}this.re(i>>16,e>>16,o>>7,l>>7,this.ft,n,0),e+=a,i+=f,l+=c,o+=u,n+=this.ut}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,o>>7,h>>7,this.ft,r,0),i+=f,t+=a,o+=u,h+=c,r+=this.ut}this.re(i>>16,e>>16,o>>7,l>>7,this.ft,r,0),i+=f,e+=d,o+=u,l+=w,r+=this.ut}else for(;;){if(--s<0)for(;;){if(--n<0)return;this.re(t>>16,i>>16,h>>7,o>>7,this.ft,r,0),i+=f,t+=a,o+=u,h+=c,r+=this.ut}this.re(e>>16,i>>16,l>>7,o>>7,this.ft,r,0),i+=f,e+=d,o+=u,l+=w,r+=this.ut}else if(t=e<<=16,h=l<<=15,r<0&&(t-=f*r,e-=d*r,h-=u*r,l-=w*r,r=0),i<<=16,o<<=15,n<0&&(i-=a*n,o-=c*n,n=0),s-=n,n-=r,r=this.Di[r],f>16,e>>16,o>>7,l>>7,this.ft,r,0),i+=a,e+=d,o+=c,l+=w,r+=this.ut}this.re(t>>16,e>>16,h>>7,l>>7,this.ft,r,0),t+=f,e+=d,h+=u,l+=w,r+=this.ut}else for(;;){if(--n<0)for(;;){if(--s<0)return;this.re(e>>16,i>>16,l>>7,o>>7,this.ft,r,0),i+=a,e+=d,o+=c,l+=w,r+=this.ut}this.re(e>>16,t>>16,l>>7,h>>7,this.ft,r,0),t+=f,e+=d,h+=u,l+=w,r+=this.ut}};static re=(t,i,e,s,n,r,h)=>{let o;if(this.Bi){let l;if(this.Ui){if(l=i-t>3?(s-e)/(i-t)|0:0,i>this.wt&&(i=this.wt),t<0&&(e-=t*l,t=0),t>=i)return;r+=t,h=i-t>>2,l<<=2}else{if(!(t>2)>0?(s-e)*this.Si[h]>>15:0}if(0===this.alpha)for(;;){if(--h<0){if((h=i-t&3)>0){o=this.palette[e>>8];do{n[r++]=o,h--}while(h>0);return}break}o=this.palette[e>>8],e+=l,n[r++]=o,n[r++]=o,n[r++]=o,n[r++]=o}else{const s=this.alpha,a=256-this.alpha;for(;;){if(--h<0){if((h=i-t&3)>0){o=this.palette[e>>8],o=((16711935&o)*a>>8&16711935)+((65280&o)*a>>8&65280);do{n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),h--}while(h>0)}break}o=this.palette[e>>8],e+=l,o=((16711935&o)*a>>8&16711935)+((65280&o)*a>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280)}}}else if(tthis.wt&&(i=this.wt),t<0&&(e-=t*l,t=0),t>=i))return;if(r+=t,h=i-t,0===this.alpha)do{n[r++]=this.palette[e>>8],e+=l,h--}while(h>0);else{const t=this.alpha,i=256-this.alpha;do{o=this.palette[e>>8],e+=l,o=((16711935&o)*i>>8&16711935)+((65280&o)*i>>8&65280),n[r++]=o+((16711935&n[r])*t>>8&16711935)+((65280&n[r])*t>>8&65280),h--}while(h>0)}}};static he=(t,i,e,s,n,r,h)=>{let o=0;n!==s&&(o=(i-t<<16)/(n-s)|0);let l=0;r!==n&&(l=(e-i<<16)/(r-n)|0);let a=0;if(r!==s&&(a=(t-e<<16)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),nl)for(r-=n,n-=s,s=this.Di[s];;){if(--n<0)for(;;){if(--r<0)return;this.oe(e>>16,i>>16,this.ft,s,h),e+=a,i+=l,s+=this.ut}this.oe(e>>16,t>>16,this.ft,s,h),e+=a,t+=o,s+=this.ut}else for(r-=n,n-=s,s=this.Di[s];;){if(--n<0)for(;;){if(--r<0)return;this.oe(i>>16,e>>16,this.ft,s,h),e+=a,i+=l,s+=this.ut}this.oe(t>>16,e>>16,this.ft,s,h),e+=a,t+=o,s+=this.ut}else if(i=t<<=16,s<0&&(i-=a*s,t-=o*s,s=0),e<<=16,r<0&&(e-=l*r,r=0),s!==r&&ao)for(n-=r,r-=s,s=this.Di[s];;){if(--r<0)for(;;){if(--n<0)return;this.oe(e>>16,t>>16,this.ft,s,h),e+=l,t+=o,s+=this.ut}this.oe(i>>16,t>>16,this.ft,s,h),i+=a,t+=o,s+=this.ut}else for(n-=r,r-=s,s=this.Di[s];;){if(--r<0)for(;;){if(--n<0)return;this.oe(t>>16,e>>16,this.ft,s,h),e+=l,t+=o,s+=this.ut}this.oe(t>>16,i>>16,this.ft,s,h),i+=a,t+=o,s+=this.ut}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),ra)for(s-=r,r-=n,n=this.Di[n];;){if(--r<0)for(;;){if(--s<0)return;this.oe(t>>16,e>>16,this.ft,n,h),t+=o,e+=a,n+=this.ut}this.oe(t>>16,i>>16,this.ft,n,h),t+=o,i+=l,n+=this.ut}else for(s-=r,r-=n,n=this.Di[n];;){if(--r<0)for(;;){if(--s<0)return;this.oe(e>>16,t>>16,this.ft,n,h),t+=o,e+=a,n+=this.ut}this.oe(i>>16,t>>16,this.ft,n,h),t+=o,i+=l,n+=this.ut}else if(e=i<<=16,n<0&&(e-=o*n,i-=l*n,n=0),t<<=16,s<0&&(t-=a*s,s=0),o>16,i>>16,this.ft,n,h),t+=a,i+=l,n+=this.ut}this.oe(e>>16,i>>16,this.ft,n,h),e+=o,i+=l,n+=this.ut}else for(r-=s,s-=n,n=this.Di[n];;){if(--s<0)for(;;){if(--r<0)return;this.oe(i>>16,t>>16,this.ft,n,h),t+=a,i+=l,n+=this.ut}this.oe(i>>16,e>>16,this.ft,n,h),e+=o,i+=l,n+=this.ut}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,this.ft,r,h),i+=l,t+=o,r+=this.ut}this.oe(i>>16,e>>16,this.ft,r,h),i+=l,e+=a,r+=this.ut}else for(n-=s,s-=r,r=this.Di[r];;){if(--s<0)for(;;){if(--n<0)return;this.oe(t>>16,i>>16,this.ft,r,h),i+=l,t+=o,r+=this.ut}this.oe(e>>16,i>>16,this.ft,r,h),i+=l,e+=a,r+=this.ut}else if(t=e<<=16,r<0&&(t-=l*r,e-=a*r,r=0),i<<=16,n<0&&(i-=o*n,n=0),l>16,e>>16,this.ft,r,h),i+=o,e+=a,r+=this.ut}this.oe(t>>16,e>>16,this.ft,r,h),t+=l,e+=a,r+=this.ut}else for(s-=n,n-=r,r=this.Di[r];;){if(--n<0)for(;;){if(--s<0)return;this.oe(e>>16,i>>16,this.ft,r,h),i+=o,e+=a,r+=this.ut}this.oe(e>>16,t>>16,this.ft,r,h),t+=l,e+=a,r+=this.ut}};static le=(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w,y,m,A,p)=>{const _=this.ae(p);this.Ki=!this.Xi[p];const I=a-u,g=c-w,C=f-m,E=d-a,T=y-c,b=A-f;let R=E*c-T*a<<14;const O=T*f-b*c<<8,v=b*a-E*f<<5;let L=I*c-g*a<<14;const S=g*f-C*c<<8,x=C*a-I*f<<5;let M=g*E-I*T<<14;const k=C*T-g*b<<8,D=I*b-C*E<<5;let N=0,F=0;n!==s&&(N=(i-t<<16)/(n-s)|0,F=(o-h<<16)/(n-s)|0);let B=0,U=0;r!==n&&(B=(e-i<<16)/(r-n)|0,U=(l-o<<16)/(r-n)|0);let P=0,G=0;if(r!==s&&(P=(t-e<<16)/(s-r)|0,G=(h-l<<16)/(s-r)|0),s<=n&&s<=r){if(sthis.bottom&&(n=this.bottom),r>this.bottom&&(r=this.bottom),nB)for(r-=n,n-=s,s=this.Di[s];;){if(--n<0)for(;;){if(--r<0)return;this.ce(e>>16,i>>16,this.ft,s,_,0,0,R,L,M,O,S,k,l>>8,o>>8),e+=P,i+=B,l+=G,o+=U,s+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(e>>16,t>>16,this.ft,s,_,0,0,R,L,M,O,S,k,l>>8,h>>8),e+=P,t+=N,l+=G,h+=F,s+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}else for(r-=n,n-=s,s=this.Di[s];;){if(--n<0)for(;;){if(--r<0)return;this.ce(i>>16,e>>16,this.ft,s,_,0,0,R,L,M,O,S,k,o>>8,l>>8),e+=P,i+=B,l+=G,o+=U,s+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(t>>16,e>>16,this.ft,s,_,0,0,R,L,M,O,S,k,h>>8,l>>8),e+=P,t+=N,l+=G,h+=F,s+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}}else{i=t<<=16,o=h<<=16,s<0&&(i-=P*s,t-=N*s,o-=G*s,h-=F*s,s=0),e<<=16,l<<=16,r<0&&(e-=B*r,l-=U*r,r=0);const a=s-this.Fi;if(R+=v*a,L+=x*a,M+=D*a,R|=0,L|=0,M|=0,(s===r||P>=N)&&(s!==r||B<=N))for(n-=r,r-=s,s=this.Di[s];;){if(--r<0)for(;;){if(--n<0)return;this.ce(t>>16,e>>16,this.ft,s,_,0,0,R,L,M,O,S,k,h>>8,l>>8),e+=B,t+=N,l+=U,h+=F,s+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(t>>16,i>>16,this.ft,s,_,0,0,R,L,M,O,S,k,h>>8,o>>8),i+=P,t+=N,o+=G,h+=F,s+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}else for(n-=r,r-=s,s=this.Di[s];;){if(--r<0)for(;;){if(--n<0)return;this.ce(e>>16,t>>16,this.ft,s,_,0,0,R,L,M,O,S,k,l>>8,h>>8),e+=B,t+=N,l+=U,h+=F,s+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(i>>16,t>>16,this.ft,s,_,0,0,R,L,M,O,S,k,o>>8,h>>8),i+=P,t+=N,o+=G,h+=F,s+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}}}else if(n<=r){if(nthis.bottom&&(r=this.bottom),s>this.bottom&&(s=this.bottom),rP)for(s-=r,r-=n,n=this.Di[n];;){if(--r<0)for(;;){if(--s<0)return;this.ce(t>>16,e>>16,this.ft,n,_,0,0,R,L,M,O,S,k,h>>8,l>>8),t+=N,e+=P,h+=F,l+=G,n+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(t>>16,i>>16,this.ft,n,_,0,0,R,L,M,O,S,k,h>>8,o>>8),t+=N,i+=B,h+=F,o+=U,n+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}else for(s-=r,r-=n,n=this.Di[n];;){if(--r<0)for(;;){if(--s<0)return;this.ce(e>>16,t>>16,this.ft,n,_,0,0,R,L,M,O,S,k,l>>8,h>>8),t+=N,e+=P,h+=F,l+=G,n+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(i>>16,t>>16,this.ft,n,_,0,0,R,L,M,O,S,k,o>>8,h>>8),t+=N,i+=B,h+=F,o+=U,n+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}}else{e=i<<=16,l=o<<=16,n<0&&(e-=N*n,i-=B*n,l-=F*n,o-=U*n,n=0),t<<=16,h<<=16,s<0&&(t-=P*s,h-=G*s,s=0);const a=n-this.Fi;if(R+=v*a,L+=x*a,M+=D*a,R|=0,L|=0,M|=0,r-=s,s-=n,n=this.Di[n],N>16,i>>16,this.ft,n,_,0,0,R,L,M,O,S,k,h>>8,o>>8),t+=P,i+=B,h+=G,o+=U,n+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(e>>16,i>>16,this.ft,n,_,0,0,R,L,M,O,S,k,l>>8,o>>8),e+=N,i+=B,l+=F,o+=U,n+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}else for(;;){if(--s<0)for(;;){if(--r<0)return;this.ce(i>>16,t>>16,this.ft,n,_,0,0,R,L,M,O,S,k,o>>8,h>>8),t+=P,i+=B,h+=G,o+=U,n+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(i>>16,e>>16,this.ft,n,_,0,0,R,L,M,O,S,k,o>>8,l>>8),e+=N,i+=B,l+=F,o+=U,n+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}}}else if(rthis.bottom&&(s=this.bottom),n>this.bottom&&(n=this.bottom),s>16,t>>16,this.ft,r,_,0,0,R,L,M,O,S,k,o>>8,h>>8),i+=B,t+=N,o+=U,h+=F,r+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(i>>16,e>>16,this.ft,r,_,0,0,R,L,M,O,S,k,o>>8,l>>8),i+=B,e+=P,o+=U,l+=G,r+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}else for(;;){if(--s<0)for(;;){if(--n<0)return;this.ce(t>>16,i>>16,this.ft,r,_,0,0,R,L,M,O,S,k,h>>8,o>>8),i+=B,t+=N,o+=U,h+=F,r+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(e>>16,i>>16,this.ft,r,_,0,0,R,L,M,O,S,k,l>>8,o>>8),i+=B,e+=P,o+=U,l+=G,r+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}}else{t=e<<=16,h=l<<=16,r<0&&(t-=B*r,e-=P*r,h-=U*r,l-=G*r,r=0),i<<=16,o<<=16,n<0&&(i-=N*n,o-=F*n,n=0);const a=r-this.Fi;if(R+=v*a,L+=x*a,M+=D*a,R|=0,L|=0,M|=0,s-=n,n-=r,r=this.Di[r],B>16,e>>16,this.ft,r,_,0,0,R,L,M,O,S,k,o>>8,l>>8),i+=N,e+=P,o+=F,l+=G,r+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(t>>16,e>>16,this.ft,r,_,0,0,R,L,M,O,S,k,h>>8,l>>8),t+=B,e+=P,h+=U,l+=G,r+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}else for(;;){if(--n<0)for(;;){if(--s<0)return;this.ce(e>>16,i>>16,this.ft,r,_,0,0,R,L,M,O,S,k,l>>8,o>>8),i+=N,e+=P,o+=F,l+=G,r+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}this.ce(e>>16,t>>16,this.ft,r,_,0,0,R,L,M,O,S,k,l>>8,h>>8),t+=B,e+=P,h+=U,l+=G,r+=this.ut,R+=v,L+=x,M+=D,R|=0,L|=0,M|=0}}};static ce=(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w)=>{if(t>=i)return;let y,m,A,p,_,I,g,C,E;if(this.Ui){if(y=(w-d)/(i-t)|0,i>this.wt&&(i=this.wt),t<0&&(d-=t*y,t=0),t>=i)return;m=i-t>>3,y<<=12}else i-t>7?(m=i-t>>3,y=(w-d)*this.Si[m]>>6):(m=0,y=0);if(d<<=9,s+=t,this.Li&&n)if(A=0,p=0,I=t-this.Ni,o+=(c>>3)*I,l+=(f>>3)*I,a+=(u>>3)*I,o|=0,l|=0,_=(a|=0)>>12,0!==_&&(h=l/_|0,(r=o/_|0)<0?r=0:r>4032&&(r=4032)),o+=c,l+=f,a+=u,o|=0,l|=0,_=(a|=0)>>12,0!==_&&(A=o/_|0,p=l/_|0,A<7?A=7:A>4032&&(A=4032)),g=A-r>>3,C=p-h>>3,r+=d>>3&786432,E=d>>23,this.Ki){for(;m-- >0;)e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C,e[s++]=n[(4032&h)+(r>>6)]>>>E,r=A,h=p,o+=c,l+=f,_=(a+=u)>>12,0!==_&&(A=o/_|0,p=l/_|0,A<7?A=7:A>4032&&(A=4032)),g=A-r>>3,C=p-h>>3,r+=(d+=y)>>3&786432,E=d>>23;for(m=i-t&7;m-- >0;)e[s++]=n[(4032&h)+(r>>6)]>>>E,r+=g,h+=C}else{for(;m-- >0;){let t;0!=(t=n[(4032&h)+(r>>6)]>>>E)&&(e[s]=t),s+=1,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=C))+((r+=g)>>6)]>>>E)&&(e[s]=t),s+=1,r=A,h=p,o+=c,l+=f,a+=u,o|=0,l|=0,_=(a|=0)>>12,0!==_&&(A=o/_|0,p=l/_|0,A<7?A=7:A>4032&&(A=4032)),g=A-r>>3,C=p-h>>3,r+=(d+=y)>>3&786432,E=d>>23}for(m=i-t&7;m-- >0;){let t;0!=(t=n[(4032&h)+(r>>6)]>>>E)&&(e[s]=t),s++,r+=g,h+=C}}else if(A=0,p=0,I=t-this.Ni,o+=(c>>3)*I,l+=(f>>3)*I,a+=(u>>3)*I,o|=0,l|=0,_=(a|=0)>>14,0!==_&&(h=l/_|0,(r=o/_|0)<0?r=0:r>16256&&(r=16256)),o+=c,l+=f,a+=u,o|=0,l|=0,_=(a|=0)>>14,0!==_&&(A=o/_|0,p=l/_|0,A<7?A=7:A>16256&&(A=16256)),g=A-r>>3,C=p-h>>3,r+=6291456&d,E=d>>23,this.Ki&&n){for(;m-- >0;)e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C,e[s++]=n[(16256&h)+(r>>7)]>>>E,r=A,h=p,o+=c,l+=f,a+=u,o|=0,l|=0,_=(a|=0)>>14,0!==_&&(A=o/_|0,p=l/_|0,A<7?A=7:A>16256&&(A=16256)),g=A-r>>3,C=p-h>>3,r+=6291456&(d+=y),E=d>>23;for(m=i-t&7;m-- >0;)e[s++]=n[(16256&h)+(r>>7)]>>>E,r+=g,h+=C}else{for(;m-- >0&&n;){let t;0!=(t=n[(16256&h)+(r>>7)]>>>E)&&(e[s]=t),s+=1,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=C))+((r+=g)>>7)]>>>E)&&(e[s]=t),s++,r=A,h=p,o+=c,l+=f,a+=u,o|=0,l|=0,_=(a|=0)>>14,0!==_&&(A=o/_|0,p=l/_|0,A<7?A=7:A>16256&&(A=16256)),g=A-r>>3,C=p-h>>3,r+=6291456&(d+=y),E=d>>23}for(m=i-t&7;m-- >0&&n;){let t;0!=(t=n[(16256&h)+(r>>7)]>>>E)&&(e[s]=t),s++,r+=g,h+=C}}};static oe=(t,i,e,s,n)=>{if(this.Ui&&(i>this.wt&&(i=this.wt),t<0&&(t=0)),t>=i)return;s+=t;let r=i-t>>2;if(0===this.alpha)for(;;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;e[s++]=n}e[s++]=n,e[s++]=n,e[s++]=n,e[s++]=n}const h=this.alpha,o=256-this.alpha;for(n=((16711935&n)*o>>8&16711935)+((65280&n)*o>>8&65280);;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280)}e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280)}};static ee=t=>{this.Gi[t]&&this.Pi&&(this.Pi[this.Wi++]=this.Gi[t],this.Gi[t]=null)};static ae=t=>{if(this.Hi[t]=this.Yi++,this.Gi[t])return this.Gi[t];let i;if(this.Wi>0&&this.Pi)i=this.Pi[--this.Wi],this.Pi[this.Wi]=null;else{let t=0,e=-1;for(let i=0;i>>3)&16316671,i[n+8192]=r-(r>>>2)&16316671,i[n+12288]=r-(r>>>2)-(r>>>3)&16316671}}else{if(64===e.width)for(let t=0;t<128;t++)for(let n=0;n<128;n++)i[n+(t<<7)]=s[e.ft[(n>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)i[t]=s[e.ft[t]];this.Xi[t]=!1;for(let e=0;e<16384;e++){i[e]&=16316671;const s=i[e];0===s&&(this.Xi[t]=!0),i[e+16384]=s-(s>>>3)&16316671,i[e+32768]=s-(s>>>2)&16316671,i[e+49152]=s-(s>>>2)-(s>>>3)&16316671}}return i}}const F=['F11','F12'],B={'Backspace':{code:8,ch:8},'Enter':{code:10,ch:10},'Shift':{code:16,ch:65535},'Escape':{code:27,ch:27},'Tab':{code:9,ch:9},'CapsLock':{code:20,ch:65535},' ':{code:32,ch:32},'Control':{code:17,ch:65535},'Alt':{code:18,ch:65535},'Meta':{code:524,ch:65535},'ArrowLeft':{code:37,ch:65535},'ArrowRight':{code:39,ch:65535},'ArrowUp':{code:38,ch:65535},'ArrowDown':{code:40,ch:65535},'Insert':{code:155,ch:65535},'Home':{code:36,ch:65535},'PageUp':{code:33,ch:65535},'Delete':{code:127,ch:127},'End':{code:35,ch:65535},'PageDown':{code:34,ch:65535},'`':{code:192,ch:96},'~':{code:192,ch:126},'!':{code:49,ch:33},'@':{code:50,ch:64},'#':{code:51,ch:35},'$':{code:52,ch:36},'%':{code:53,ch:37},'^':{code:54,ch:94},'&':{code:55,ch:38},'*':{code:56,ch:42},'(':{code:57,ch:40},')':{code:48,ch:41},'-':{code:45,ch:45},'_':{code:45,ch:95},'=':{code:61,ch:61},'+':{code:61,ch:43},'[':{code:91,ch:91},'{':{code:91,ch:123},']':{code:93,ch:93},'}':{code:93,ch:125},'\\':{code:92,ch:92},'|':{code:92,ch:124},';':{code:59,ch:59},':':{code:59,ch:58},"'":{code:222,ch:39},'"':{code:222,ch:34},',':{code:44,ch:44},'<':{code:44,ch:60},'.':{code:46,ch:46},'>':{code:46,ch:62},'/':{code:47,ch:47},'?':{code:47,ch:63},'F1':{code:112,ch:65535},'F2':{code:113,ch:65535},'F3':{code:114,ch:65535},'F4':{code:115,ch:65535},'F5':{code:116,ch:65535},'F6':{code:117,ch:65535},'F7':{code:118,ch:65535},'F8':{code:119,ch:65535},'F9':{code:120,ch:65535},'F10':{code:121,ch:65535},'F11':{code:122,ch:65535},'F12':{code:123,ch:65535},0:{code:48,ch:48},1:{code:49,ch:49},2:{code:50,ch:50},3:{code:51,ch:51},4:{code:52,ch:52},5:{code:53,ch:53},6:{code:54,ch:54},7:{code:55,ch:55},8:{code:56,ch:56},9:{code:57,ch:57},'a':{code:65,ch:97},'b':{code:66,ch:98},'c':{code:67,ch:99},'d':{code:68,ch:100},'e':{code:69,ch:101},'f':{code:70,ch:102},'g':{code:71,ch:103},'h':{code:72,ch:104},'i':{code:73,ch:105},'j':{code:74,ch:106},'k':{code:75,ch:107},'l':{code:76,ch:108},'m':{code:77,ch:109},'n':{code:78,ch:110},'o':{code:79,ch:111},'p':{code:80,ch:112},'q':{code:81,ch:113},'r':{code:82,ch:114},'s':{code:83,ch:115},'t':{code:84,ch:116},'u':{code:85,ch:117},'v':{code:86,ch:118},'w':{code:87,ch:119},'x':{code:88,ch:120},'y':{code:89,ch:121},'z':{code:90,ch:122},'A':{code:65,ch:65},'B':{code:66,ch:66},'C':{code:67,ch:67},'D':{code:68,ch:68},'E':{code:69,ch:69},'F':{code:70,ch:70},'G':{code:71,ch:71},'H':{code:72,ch:72},'I':{code:73,ch:73},'J':{code:74,ch:74},'K':{code:75,ch:75},'L':{code:76,ch:76},'M':{code:77,ch:77},'N':{code:78,ch:78},'O':{code:79,ch:79},'P':{code:80,ch:80},'Q':{code:81,ch:81},'R':{code:82,ch:82},'S':{code:83,ch:83},'T':{code:84,ch:84},'U':{code:85,ch:85},'V':{code:86,ch:86},'W':{code:87,ch:87},'X':{code:88,ch:88},'Y':{code:89,ch:89},'Z':{code:90,ch:90}};class U{static enabled=!1;static fe=null;static ue=null;static de=0;static we=0;static ye=0;static me=0;static Ae=0;static pe=()=>{this.fe=R.zt(1),this.ue=null,this.de=performance.now(),this.enabled=!0};static _e=()=>{this.enabled=!1,this.fe=null};static flush=()=>{let t=null;return this.ue&&this.enabled&&(t=this.ue),this.ue=null,t};static stop=()=>{let t=null;return this.fe&&this.fe.Xt>0&&this.enabled&&(t=this.fe),this._e(),t};static Ie=(t,i,e)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;this.we++;const s=performance.now();let n=(s-this.de)/10|0;n>250&&(n=250),this.de=s,this.ge(5),1===e?this.fe?.p1(1):this.fe?.p1(2),this.fe?.p1(n),this.fe?.p3(t+(i<<10))};static Ce=t=>{if(!this.enabled)return;this.we++;const i=performance.now();let e=(i-this.de)/10|0;e>250&&(e=250),this.de=i,this.ge(2),1===t?this.fe?.p1(3):this.fe?.p1(4),this.fe?.p1(e)};static Ee=(t,i)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;const e=performance.now();if(e-this.ye>=50){this.ye=e,this.we++;let s=(e-this.de)/10|0;s>250&&(s=250),this.de=e,t-this.me<8&&t-this.me>=-8&&i-this.Ae<8&&i-this.Ae>=-8?(this.ge(3),this.fe?.p1(5),this.fe?.p1(s),this.fe?.p1(t+(i-this.Ae+8<<4)+8-this.me)):t-this.me<128&&t-this.me>=-128&&i-this.Ae<128&&i-this.Ae>=-128?(this.ge(4),this.fe?.p1(6),this.fe?.p1(s),this.fe?.p1(t+128-this.me),this.fe?.p1(i+128-this.Ae)):(this.ge(5),this.fe?.p1(7),this.fe?.p1(s),this.fe?.p3(t+(i<<10))),this.me=t,this.Ae=i}};static Te=t=>{if(!this.enabled)return;this.we++;const i=performance.now();let e=(i-this.de)/10|0;e>250&&(e=250),this.de=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.ge(3),this.fe?.p1(8),this.fe?.p1(e),this.fe?.p1(t)};static be=t=>{if(!this.enabled)return;this.we++;const i=performance.now();let e=(i-this.de)/10|0;e>250&&(e=250),this.de=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.ge(3),this.fe?.p1(9),this.fe?.p1(e),this.fe?.p1(t)};static Re=()=>{if(!this.enabled)return;this.we++;const t=performance.now();let i=(t-this.de)/10|0;i>250&&(i=250),this.de=t,this.ge(2),this.fe?.p1(10),this.fe?.p1(i)};static Oe=()=>{if(!this.enabled)return;this.we++;const t=performance.now();let i=(t-this.de)/10|0;i>250&&(i=250),this.de=t,this.ge(2),this.fe?.p1(11),this.fe?.p1(i)};static ve=()=>{if(!this.enabled)return;this.we++;const t=performance.now();let i=(t-this.de)/10|0;i>250&&(i=250),this.de=t,this.ge(2),this.fe?.p1(12),this.fe?.p1(i)};static Le=()=>{if(!this.enabled)return;this.we++;const t=performance.now();let i=(t-this.de)/10|0;i>250&&(i=250),this.de=t,this.ge(2),this.fe?.p1(13),this.fe?.p1(i)};static ge=t=>{if(this.fe&&this.fe.Xt+t>=500){const t=this.fe;this.fe=R.zt(1),this.ue=t}}}class P{static getParameter(t){return new URLSearchParams(window.location.search).get(t)??''}static setParameter(t,i){const e=new URL(window.location.toString());e.searchParams.set(t,i),window.history.pushState(null,'',e.toString())}Se=0;xe=[];Me=0;ke=null;state=0;De=20;Ne=1;Fe=[];Be=0;Ue=0;Pe=[];Ge=!0;We=!1;Ye=50;hasFocus=!0;He=!1;Ve=0;Ke=0;Xe=0;je=0;ze=0;Ze=0;qe=0;Je=[];$e=[];Qe=0;ts=0;input=null;es=!1;ss=!1;ns=!1;time=-1;rs=0;hs=0;os=0;ls=0;cs=0;fs=0;constructor(t=!1){A.tabIndex=-1,p.fillStyle='black',p.fillRect(0,0,A.width,A.height),this.We=t,this.We?this.resize(window.innerWidth,window.innerHeight):this.resize(A.width,A.height)}get width(){return A.width}get height(){return A.height}resize=(t,i)=>{A.width=t,A.height=i,this.ke=new C(t,i),N.Zi()};us=async()=>{A.addEventListener('resize',(()=>{this.We&&this.resize(window.innerWidth,window.innerHeight)}),!1),A.onmousedown=this.onmousedown,A.onmouseup=this.onmouseup,A.onmouseenter=this.onmouseenter,A.onmouseleave=this.onmouseleave,A.onmousemove=this.onmousemove,window.onbeforeunload=this.zi,A.onfocus=this.onfocus,A.onblur=this.onblur,this.ds?(A.ontouchstart=this.ontouchstart,A.ontouchend=this.ontouchend,A.ontouchmove=this.ontouchmove):(A.onkeydown=this.onkeydown,A.onkeyup=this.onkeyup),A.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.ds&&'low'===P.getParameter('detail')&&(this.Ye=30),await this.ws(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.Fe[t]=performance.now();let t,i=0,e=256,s=1,n=0;for(;this.state>=0;){if(this.state>0&&(this.state--,0===this.state))return void this.ys();const r=e,h=s;e=300,s=1,t=performance.now();const o=this.Fe[i];if(0===o?(e=r,s=h):t>o&&(e=2560*this.De/(t-o)|0),e<25?e=25:e>256&&(e=256,s=this.De-(t-o)/10|0),this.Fe[i]=t,i=(i+1)%10,s>1)for(let t=0;t<10;t++)0!==this.Fe[t]&&(this.Fe[t]+=s);for(s0&&(this.Be=1e3*e/(256*this.De)|0);const l=performance.now();if(this.Ge&&this.refresh(),await this.draw(),this.Pe[this.Ue]=(performance.now()-l)/1e3,this.Ue=(this.Ue+1)%this.Pe.length,this.Ye<50){const i=1e3/this.Ye-(performance.now()-t);i>0&&await E(i)}}-1===this.state&&this.ys()};ys=()=>{this.state=-2,this.zi()};As=t=>{this.De=1e3/t|0};ps=t=>{this.Ye=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.De|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};zi=()=>{};draw=async()=>{};refresh=()=>{};async ws(t,i){const e=this.width,s=this.height;this.Ge&&(p.fillStyle='black',p.fillRect(0,0,e,s),this.Ge=!1);const n=s/2-18;p.fillStyle='rgb(140, 17, 17)',p.rect((e/2|0)-152,n,304,34),p.fillRect((e/2|0)-150,n+2,3*t,30),p.fillStyle='black',p.fillRect((e/2|0)-150+3*t,n+2,300-3*t,30),p.font='bold 13px helvetica, sans-serif',p.textAlign='center',p.fillStyle='white',p.fillText(i,e/2|0,n+22),await E(5)}_s=()=>{let t=-1;return this.ts!==this.Qe&&(t=this.$e[this.Qe],this.Qe=this.Qe+1&127),t};get ms(){const t=this.Pe.length;let i=0;for(let e=0;ethis.Se&&(this.Se=e),this.xe[this.Me]=e,this.Me=(this.Me+1)%250,e}get Is(){return this.xe.reduce(((t,i)=>t+i),0)/250}onkeydown=t=>{const i=t.key;this.Ve=0;const e=B[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;t.ctrlKey&&(n>='A'.charCodeAt(0)&&n<=']'.charCodeAt(0)||n=='_'.charCodeAt(0)?n-='A'.charCodeAt(0)-1:n>='a'.charCodeAt(0)&&n<='z'.charCodeAt(0)&&(n-='a'.charCodeAt(0)-1)),n<30&&(n=0),s===B.ArrowLeft.code?n=1:s===B.ArrowRight.code?n=2:s===B.ArrowUp.code?n=3:s===B.ArrowDown.code?n=4:s===B.Control.code?n=5:s===B.Shift.code?n=6:s===B.Alt.code?n=7:s===B.Backspace.code||s===B.Delete.code?n=8:s===B.Tab.code?n=9:s===B.Enter.code?n=10:s>=B.F1.code&&s<=B.F12.code?n=s+1008-B.F1.code:s===B.Home.code?n=1e3:s===B.End.code?n=1001:s===B.PageUp.code?n=1002:s===B.PageDown.code&&(n=1003),n>0&&n<128&&(this.Je[n]=1),n>4&&(this.$e[this.ts]=n,this.ts=this.ts+1&127),U.enabled&&U.Te(n),F.includes(i)||t.preventDefault()};onkeyup=t=>{const i=t.key;this.Ve=0;const e=B[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;n<30&&(n=0),s===B.ArrowLeft.code?n=1:s===B.ArrowRight.code?n=2:s===B.ArrowUp.code?n=3:s===B.ArrowDown.code?n=4:s===B.Control.code?n=5:s===B.Shift.code?n=6:s===B.Alt.code?n=7:s===B.Backspace.code||s===B.Delete.code?n=8:s===B.Tab.code?n=9:s===B.Enter.code?n=10:s>=B.F1.code&&s<=B.F12.code?n=s+1008-B.F1.code:s===B.Home.code?n=1e3:s===B.End.code?n=1001:s===B.PageUp.code?n=1002:s===B.PageDown.code&&(n=1003),n>0&&n<128&&(this.Je[n]=0),U.enabled&&U.be(n),F.includes(i)||t.preventDefault()};onmousedown=t=>{if(this.es=!1,(t.clientX>0||t.clientY>0)&&this.gs(t),this.Ve=0,this.Ze=this.Xe,this.qe=this.je,this.ds&&!this.Cs){if(this.Es()||this.Ts()||this.bs())return this.ze=1,void(this.Ke=1);t.timeStamp>=this.time+500?(this.ze=2,this.Ke=2):(this.ze=1,this.Ke=1)}else 2===t.button?(this.ze=2,this.Ke=2):(this.ze=1,this.Ke=1);U.enabled&&U.Ie(this.Ze,this.qe,t.buttons)};onmouseup=t=>{this.gs(t),this.Ve=0,this.Ke=0,U.enabled&&U.Ce(t.buttons)};onmouseenter=t=>{this.gs(t),U.enabled&&U.ve()};onmouseleave=t=>{this.gs(t),this.Ve=0,this.Xe=-1,this.je=-1,this.Ke=0,this.Ze=-1,this.qe=-1,U.enabled&&U.Le()};onmousemove=t=>{this.gs(t),this.Ve=0,U.enabled&&U.Ee(this.Xe,this.je)};onfocus=t=>{this.hasFocus=!0,this.Ge=!0,this.refresh(),U.enabled&&U.Re()};onblur=t=>{this.hasFocus=!1,U.enabled&&U.Oe()};ontouchstart=t=>{if(!this.ds)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.es=!0;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.rs=this.cs=this.os=0|i.screenX,this.hs=this.fs=this.ls=0|i.screenY,this.time=t.timeStamp,this.ss=this.Rs(),this.ns=this.Os()};ontouchend=t=>{if(!this.ds||!this.es)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;if(this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.cs=0|i.screenX,this.fs=0|i.screenY,this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.ss&&!this.Rs())return void(this.es=!1);if(this.ns&&!this.Os())return void(this.es=!1);if(this.Es()||this.vs()||this.Ts()||this.bs()){null!==this.input&&(this.input.parentNode?.contains(this.input)&&this.input.parentNode?.removeChild(this.input),this.input=null);const t=document.createElement('input');return this.Ts()?(t.setAttribute('id','username'),t.setAttribute('placeholder','Username')):this.bs()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.Es()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.vs()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this.Ls?t.setAttribute('type','password'):t.setAttribute('type',this.bs()?'password':'text'),t.setAttribute('autofocus','autofocus'),t.setAttribute('spellcheck','false'),t.setAttribute('autocomplete','off'),t.setAttribute('style',`position: fixed; left: ${e}px; top: ${s}px; width: 1px; height: 1px; opacity: 0;`),document.body.appendChild(t),t.focus(),t.click(),this.Ls&&(t.oninput=t=>{if(!(t instanceof InputEvent))return;const i=t,e=i.data;null!==e&&'insertText'===i.inputType&&this.onkeydown(new KeyboardEvent('keydown',{key:e,code:e}))}),t.onkeydown=t=>{this.Ls&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this.Ls&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeyup(new KeyboardEvent('keyup',{key:t.key,code:t.key}))},t.onfocus=t=>{this.input?.parentNode?.removeChild(this.input),this.input=null,this.onfocus(t)},this.input=t,void(this.es=!1)}const n=t.timeStamp>=this.time+500,r=Math.abs(this.rs-this.cs)>16||Math.abs(this.hs-this.fs)>16;n&&!r?(this.es=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.Ke=0,this.es=!1)};ontouchmove=t=>{if(!this.ds||!this.es)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.cs=0|i.screenX,this.fs=0|i.screenY,this.ss&&-1===this.Ss()?(this.os-this.cs>0?this.rotate(2):this.os-this.cs<0&&this.rotate(0),this.ls-this.fs>0?this.rotate(3):this.ls-this.fs<0&&this.rotate(1)):(this.ns||-1!==this.Ss())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this.os=this.cs,this.ls=this.fs};get ds(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get Ls(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get Cs(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}Rs=()=>this.He&&this.Xe>=8&&this.Xe<=520&&this.je>=11&&this.je<=345;Es=()=>this.He&&-1===this.xs()&&!this.Ms()&&!this.ks()&&this.Xe>=11&&this.Xe<=506&&this.je>=449&&this.je<=482;vs=()=>this.He&&(this.Ms()||this.ks())&&this.Xe>=11&&this.Xe<=506&&this.je>=383&&this.je<=482;Os=()=>this.He&&this.Xe>=562&&this.Xe<=752&&this.je>=231&&this.je<=492;Ts=()=>!this.He&&2===this.Ds()&&this.Xe>=301&&this.Xe<=562&&this.je>=262&&this.je<=279;bs=()=>!this.He&&2===this.Ds()&&this.Xe>=301&&this.Xe<=562&&this.je>=279&&this.je<=296;rotate=t=>{0===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowLeft',code:'ArrowLeft'}))):1===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowUp',code:'ArrowUp'}))):2===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowRight',code:'ArrowRight'}))):3===t&&(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowDown',code:'ArrowDown'})))};Ns=()=>null!==document.fullscreenElement;gs=t=>{if(this.Ns()){const i=t.target.getBoundingClientRect(),e=window.innerHeight/A.height,s=(window.innerWidth-A.width*e)/2;this.Xe=0|this.Fs(t.clientX-i.left-s,0,A.width*e,0,789),this.je=0|this.Fs(t.clientY-i.top,0,A.height*e,0,532)}else{const i=A.getBoundingClientRect(),e=A.width/i.width,s=A.height/i.height;this.Xe=(t.clientX-i.left)*e|0,this.je=(t.clientY-i.top)*s|0}this.Xe<0&&(this.Xe=0),this.je<0&&(this.je=0),this.Xe>789&&(this.Xe=789),this.je>532&&(this.je=532)};Fs=(t,i,e,s,n)=>(t-i)*(n-s)/(e-i)+s}class G{db;constructor(t){t.onerror=this.onerror,t.onclose=this.onclose,this.db=t}static openDatabase=async()=>await new Promise(((t,i)=>{const e=indexedDB.open('lostcity',1);e.onsuccess=i=>{const e=i.target;console.log('database success!'),t(e.result)},e.onupgradeneeded=t=>{t.target.result.createObjectStore('cache')},e.onerror=t=>{const e=t.target;console.error('database error!: ',e.error),i(e.result)}}));Bs=async t=>await new Promise((i=>{const e=this.db.transaction('cache','readonly').objectStore('cache').get(t);e.onsuccess=()=>{i(e.result)},e.onerror=t=>{i(void 0)}}));Us=async(t,i)=>await new Promise(((e,s)=>{const n=this.db.transaction('cache','readwrite').objectStore('cache').put(i,t);n.onsuccess=()=>{e()},n.onerror=t=>{s()}}));onclose=t=>{console.log('database close!')};onerror=t=>{console.log('database error!')};Ps=t=>{const i=t.trim();let e=0;for(let t=0;t='A'&&s<='Z'?e+=s.charCodeAt(0)+1-65:s>='a'&&s<='z'?e+=s.charCodeAt(0)+1-97:s>='0'&&s<='9'&&(e+=s.charCodeAt(0)+27-48)}return e}}class W{static Ps=t=>{let i=0;t=t.toUpperCase();for(let e=0;e=this.Ws)return null;if(this.Xs[t])return this.Xs[t];const e=this.Ks[t],s=e+this.Vs[t];if(this.Gs){const i=Uint8Array.from(this.buffer.subarray(e,e+s));return this.Xs[t]=i,i}{const e=Uint8Array.from(i.read(this.Hs[t],this.buffer,this.Vs[t],this.Ks[t]));return this.Xs[t]=e,e}}}class Y{static zs=new Uint8Array(520);Zs;qs;store;constructor(t,i,e){this.Zs=new R(t),this.qs=new R(i),this.store=e+1}get Ws(){return this.qs.length/6}read(t,i=!1){this.qs.Xt=6*t;const e=this.qs.Qt;let s=this.qs.Qt;if(s<=0||s>this.Zs.length/520)return null;const n=new Uint8Array(e);let r=0;for(let i=0;r512&&(h=512),this.Zs.ri(h+8,0,Y.zs);const o=(255&Y.zs[0])<<8|255&Y.zs[1],l=(255&Y.zs[2])<<8|255&Y.zs[3],a=(255&Y.zs[4])<<16|(255&Y.zs[5])<<8|255&Y.zs[6],c=255&Y.zs[7];if(o!==t||l!==i||c!==this.store)return null;if(a<0||a>this.Zs.length/520)return null;for(let t=0;t>>0;if(h.nt(e,a),4294967295===s){const t=h.$s(),i=h.Qs(),e=new Uint8Array(h.memory.buffer,t,i),s=(new TextDecoder).decode(e);throw new l(s)}const n=h.buffer()>>>0;return new Uint8Array(h.memory.buffer,n,s)}(n)}}class H{static tn=[];static en=t=>{const i=new R(t.read('base_head.dat')),e=new R(t.read('base_type.dat')),s=new R(t.read('base_label.dat')),n=i.Jt;i.Xt+=2;for(let t=0;t{const i=new R(t.read('frame_head.dat')),e=new R(t.read('frame_tran1.dat')),s=new R(t.read('frame_tran2.dat')),n=new R(t.read('frame_del.dat')),r=i.Jt;i.Xt+=2;const h=new Int32Array(500),o=new Int32Array(500),l=new Int32Array(500),a=new Int32Array(500);for(let t=0;t0){if(0!==f.types[t])for(let i=t-1;i>d;i--)if(0===f.types[i]){h[w]=i,o[w]=0,l[w]=0,a[w]=0,w++;break}h[w]=t;let e=0;3===f.types[h[w]]&&(e=128),o[w]=1&i?s.ei:e,l[w]=2&i?s.ei:e,a[w]=4&i?s.ei:e,d=t,w++}}r.length=w,r.nn=new Int32Array(w),r.x=new Int32Array(w),r.y=new Int32Array(w),r.z=new Int32Array(w);for(let t=0;t>7)<2?i=2:i>126&&(i=126),(65408&t)+i):(i<0?i=0:i>127&&(i=127),127-i)}static lr=(t,i,e)=>{const s=t.rn,n=t.hn,r=t.ln;let h,o,l,a,c;if(i){h=new Int32Array(s);for(let i=0;i{const n=t.rn,r=t.hn,h=t.ln;let o,l,a,c,f;if(s)o=t.Ar,l=t.ar,a=t.pr;else{o=new Int32Array(n),l=new Int32Array(n),a=new Int32Array(n);for(let i=0;i{const e=t.rn,s=t.hn,n=t.ln,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e);for(let i=0;i{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,l=0,a=-1;for(let c=0;c{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,l=0,a=-1;for(let c=0;c{let o=-1;const l=t.Ar[i],a=t.ar[i],c=t.pr[i];for(let t=0;t{if(!j.metadata)throw new Error('cant loading model metadata!!!!!');const i=j.metadata[t];if(!i)throw console.log(`Error model:${t} not found!`),new Error('cant loading model metadata!!!!!');if(!(j.head&&j.Cn&&j.En&&j.Tn&&j.bn&&j.Rn&&j.On&&j.vn&&j.Ln&&j.Sn&&j.xn&&j.Mn&&j.kn&&j.axis))throw new Error('cant loading model!!!!!');const e=i.rn,s=i.hn,n=i.ln,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e),l=new Int32Array(s),a=new Int32Array(s),c=new Int32Array(s),f=new Int32Array(n),u=new Int32Array(n),d=new Int32Array(n);let w=null;i.dn>=0&&(w=new Int32Array(e));let y=null;i.An>=0&&(y=new Int32Array(s));let m=null,A=0;i.pn>=0?m=new Int32Array(s):A=-i.pn-1;let p=null;i._n>=0&&(p=new Int32Array(s));let _=null;i.In>=0&&(_=new Int32Array(s));const I=new Int32Array(s);j.On.Xt=i.an,j.vn.Xt=i.cn,j.Ln.Xt=i.fn,j.Sn.Xt=i.un,j.xn.Xt=i.dn;let g,C,E,T=0,b=0,R=0;for(let t=0;t{if(!j.metadata||!j.metadata[i])throw new Error('No model metadata');const e=j.metadata[i];if(e.data=t,!e.data.length)throw new Error('No model data');const s=e.rn,n=e.hn,r=e.ln,h=new Int32Array(s),o=new Int32Array(s),l=new Int32Array(s),a=new Int32Array(n),c=new Int32Array(n),f=new Int32Array(n),u=new Int32Array(r),d=new Int32Array(r),w=new Int32Array(r);let y=null;e.dn>=0&&(y=new Int32Array(s));let m=null;e.An>=0&&(m=new Int32Array(n));let A=null,p=0;e.pn>=0?A=new Int32Array(n):p=-e.pn-1;let _=null;e._n>=0&&(_=new Int32Array(n));let I=null;e.In>=0&&(I=new Int32Array(n));const g=new Int32Array(n),C=new R(e.data);C.Xt=e.an;const E=new R(e.data);E.Xt=e.cn;const T=new R(e.data);T.Xt=e.fn;const b=new R(e.data);b.Xt=e.un;const O=new R(e.data);O.Xt=e.dn;let v,L,S,x=0,M=0,k=0;for(let t=0;tthis.Nr&&(this.Nr=-e),e>this.Dr&&(this.Dr=e);const n=i*i+s*s;n>this.kr&&(this.kr=n)}this.kr=Math.sqrt(this.kr)+.99|0,this.Br=Math.sqrt(this.kr*this.kr+this.Nr*this.Nr)+.99|0,this.Fr=this.Br+(Math.sqrt(this.kr*this.kr+this.Dr*this.Dr)+.99|0)}$r(){this.Nr=0,this.Dr=0;for(let t=0;tthis.Nr&&(this.Nr=-i),i>this.Dr&&(this.Dr=i)}this.Br=Math.sqrt(this.kr*this.kr+this.Nr*this.Nr)+.99|0,this.Fr=this.Br+(Math.sqrt(this.kr*this.kr+this.Dr*this.Dr)+.99|0)}Qr(){if(this.Pr){const t=new Int32Array(256);let i=0;for(let e=0;ei&&(i=s)}this.Yr=new v(i+1,null);for(let e=0;e<=i;e++)this.Yr[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;ei&&(i=s)}this.Hr=new v(i+1,null);for(let e=0;e<=i;e++)this.Hr[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;eo;)o=e[h++];r&&r.types&&s.x&&s.y&&s.z&&r.labels&&(i!==o||0===r.types[i])&&this.ih(s.x[t],s.y[t],s.z[t],r.labels[i],r.types[i])}j.$n=0,j.Qn=0,j.tr=0,h=0,o=e[h++];for(let t=0;to;)o=e[h++];r&&r.types&&n.x&&n.y&&n.z&&r.labels&&(i===o||0===r.types[i])&&this.ih(n.x[t],n.y[t],n.z[t],r.labels[i],r.types[i])}}else this.eh(t)}eh(t){if(!this.Yr||-1===t||!V.tn[t])return;const i=V.tn[t],e=i.sn;j.$n=0,j.Qn=0,j.tr=0;for(let t=0;t>16;this.pr[t]=this.ar[t]*i+this.pr[t]*e>>16,this.ar[t]=s}}translate(t,i,e){for(let s=0;s>8;if(this.cr&&this.ur&&this.dr||(this.cr=new Int32Array(this.hn),this.ur=new Int32Array(this.hn),this.dr=new Int32Array(this.hn)),!this.yr){this.yr=new v(this.rn,null);for(let t=0;t8192||m>8192||A>8192||y<-8192||m<-8192||A<-8192;)y>>=1,m>>=1,A>>=1;let p=0|Math.sqrt(y*y+m*m+A*A);if(p<=0&&(p=1),y=256*y/p|0,m=256*m/p|0,A=256*A/p|0,this.wr&&1&this.wr[i]){const r=t+((e*y+s*m+n*A)/(h+(h/2|0))|0);this.Tr&&(this.cr[i]=j.hr(this.Tr[i],r,this.wr[i]))}else{let t=this.yr[r];t&&(t.x+=y,t.y+=m,t.z+=A,t.w++),t=this.yr[o],t&&(t.x+=y,t.y+=m,t.z+=A,t.w++),t=this.yr[l],t&&(t.x+=y,t.y+=m,t.z+=A,t.w++)}}if(r)this.lh(t,h,e,s,n);else{this.mr=new v(this.rn,null);for(let t=0;t>16;for(let s=0;s>16,p=p*u-A*f>>16,A=m),0!==t&&(m=p*l-_*o>>16,_=p*o+_*l>>16,p=m),0!==i&&(m=_*a+A*c>>16,_=_*c-A*a>>16,A=m),A+=n,p+=r,_+=h,m=p*w-_*d>>16,_=p*d+_*w>>16,p=m,j.Fn&&j.Bn&&j.Un&&(j.Un[s]=_-y,j.Fn[s]=N.Ni+((A<<9)/_|0),j.Bn[s]=N.Fi+((p<<9)/_|0)),this.ln>0&&j.Pn&&j.Gn&&j.Wn&&(j.Pn[s]=A,j.Gn[s]=p,j.Wn[s]=_)}try{this.uh(!1,!1,0)}catch(t){}}draw(t,i,e,s,n,r,h,o,l){const a=o*n-r*s>>16,c=h*i+a*e>>16,f=this.kr*e>>16,u=c+f;if(u<=50||c>=3500)return;const d=o*s+r*n>>16;let w=d-this.kr<<9;if((w/u|0)>=m.yt)return;let y=d+this.kr<<9;if((y/u|0)<=-m.yt)return;const A=h*e-a*i>>16,p=this.kr*i>>16;let _=A+p<<9;if((_/u|0)<=-m.At)return;let I=A-(p+(this.Nr*e>>16))<<9;if((I/u|0)>=m.At)return;let g=c-(f+(this.Nr*i>>16))<=50,C=!1;if(l>0&&j.ir){let t=c-f;t<=50&&(t=50),d>0?(w=w/u|0,y=y/t|0):(y=y/u|0,w=w/t|0),A>0?(I=I/u|0,_=_/t|0):(_=_/u|0,I=I/t|0);const i=j.Xe-N.Ni,e=j.je-N.Fi;i>w&&iI&&e<_&&(this.Zr?j.sr[j.er++]=l:C=!0)}const E=N.Ni,T=N.Fi;let b=0,R=0;0!==t&&(b=N.sin[t],R=N.cos[t]);for(let l=0;l>16,d=d*R-f*b>>16,f=a),f+=r,u+=h,d+=o,a=d*s+f*n>>16,d=d*n-f*s>>16,f=a,a=u*e-d*i>>16,d=u*i+d*e>>16,u=a,j.Un&&(j.Un[l]=d-c),d>=50&&j.Fn&&j.Bn?(j.Fn[l]=E+((f<<9)/d|0),j.Bn[l]=T+((u<<9)/d|0)):j.Fn&&(j.Fn[l]=-5e3,g=!0),(g||this.ln>0)&&j.Pn&&j.Gn&&j.Wn&&(j.Pn[l]=f,j.Gn[l]=u,j.Wn[l]=d)}try{this.uh(g,C,l)}catch(t){}}uh(t,i,e,s=!1){j.nr&&(this.qr=-1,this.Jr=-1);for(let t=0;tm.wt||l>m.wt||a>m.wt),j.Hn&&j.Yn){const t=((d+w+y)/3|0)+this.Br;j.Hn[t][j.Yn[t]++]=s,j.nr&&this.dh(j.Xe,j.je,c,f,u,o,l,a)&&this.Jr=0;t--){const i=j.Yn[t];if(!(i<=0)&&j.Hn){const e=j.Hn[t];for(let t=0;t=0;t--){const i=j.Yn[t];if(i>0&&j.Hn){const e=j.Hn[t];for(let s=0;s0||j.Vn[2]>0)&&(n=(j.zn[1]+j.zn[2])/(j.Vn[1]+j.Vn[2])|0);let r=0;j.Vn&&j.zn&&(j.Vn[3]>0||j.Vn[4]>0)&&(r=(j.zn[3]+j.zn[4])/(j.Vn[3]+j.Vn[4])|0);let h=0;if(j.Vn&&j.zn&&(j.Vn[6]>0||j.Vn[8]>0)&&(h=(j.zn[6]+j.zn[8])/(j.Vn[6]+j.Vn[8])|0),j.Vn&&j.Kn){let t,i=0,e=j.Vn[10],o=j.Kn[10],l=j.Xn;i===e&&(i=0,e=j.Vn[11],o=j.Kn[11],l=j.jn),t=in;)this.wh(o[i++],s),i===e&&o!==j.Kn[11]&&(i=0,e=j.Vn[11],o=j.Kn[11],l=j.jn),t=ir;)this.wh(o[i++],s),i===e&&o!==j.Kn[11]&&(i=0,e=j.Vn[11],o=j.Kn[11],l=j.jn),t=ih;)this.wh(o[i++],s),i===e&&o!==j.Kn[11]&&(i=0,e=j.Vn[11],o=j.Kn[11],l=j.jn),t=i>2,r=this.br[i],h=this.Rr[i],o=this.Or[i];N.le(j.Fn[e],j.Fn[s],j.Fn[n],j.Bn[e],j.Bn[s],j.Bn[n],this.cr[t],this.ur[t],this.dr[t],j.Pn[r],j.Gn[r],j.Wn[r],j.Pn[h],j.Pn[o],j.Gn[h],j.Gn[o],j.Wn[h],j.Wn[o],this.Tr[t])}else if(3===r&&this.wr&&this.Tr&&this.cr&&j.Fn&&j.Bn&&j.Pn&&j.Gn&&j.Wn){const i=this.wr[t]>>2,r=this.br[i],h=this.Rr[i],o=this.Or[i];N.le(j.Fn[e],j.Fn[s],j.Fn[n],j.Bn[e],j.Bn[s],j.Bn[n],this.cr[t],this.cr[t],this.cr[t],j.Pn[r],j.Gn[r],j.Wn[r],j.Pn[h],j.Pn[o],j.Gn[h],j.Gn[o],j.Wn[h],j.Wn[o],this.Tr[t])}}yh(t,i=!1){let e=0;if(j.Wn){const i=N.Ni,s=N.Fi,n=this._r[t],r=this.Ir[t],h=this.gr[t],o=j.Wn[n],l=j.Wn[r],a=j.Wn[h];if(o>=50&&j.Fn&&j.Bn&&this.cr)j.Zn[e]=j.Fn[n],j.qn[e]=j.Bn[n],j.Jn[e++]=this.cr[t];else if(j.Pn&&j.Gn&&this.cr){const c=j.Pn[n],f=j.Gn[n],u=this.cr[t];if(a>=50&&this.dr){const n=(50-o)*N.xi[a-o];j.Zn[e]=i+((c+((j.Pn[h]-c)*n>>16)<<9)/50|0),j.qn[e]=s+((f+((j.Gn[h]-f)*n>>16)<<9)/50|0),j.Jn[e++]=u+((this.dr[t]-u)*n>>16)}if(l>=50&&this.ur){const n=(50-o)*N.xi[l-o];j.Zn[e]=i+((c+((j.Pn[r]-c)*n>>16)<<9)/50|0),j.qn[e]=s+((f+((j.Gn[r]-f)*n>>16)<<9)/50|0),j.Jn[e++]=u+((this.ur[t]-u)*n>>16)}}if(l>=50&&j.Fn&&j.Bn&&this.ur)j.Zn[e]=j.Fn[r],j.qn[e]=j.Bn[r],j.Jn[e++]=this.ur[t];else if(j.Pn&&j.Gn&&this.ur){const c=j.Pn[r],f=j.Gn[r],u=this.ur[t];if(o>=50&&this.cr){const r=(50-l)*N.xi[o-l];j.Zn[e]=i+((c+((j.Pn[n]-c)*r>>16)<<9)/50|0),j.qn[e]=s+((f+((j.Gn[n]-f)*r>>16)<<9)/50|0),j.Jn[e++]=u+((this.cr[t]-u)*r>>16)}if(a>=50&&this.dr){const n=(50-l)*N.xi[a-l];j.Zn[e]=i+((c+((j.Pn[h]-c)*n>>16)<<9)/50|0),j.qn[e]=s+((f+((j.Gn[h]-f)*n>>16)<<9)/50|0),j.Jn[e++]=u+((this.dr[t]-u)*n>>16)}}if(a>=50&&j.Fn&&j.Bn&&this.dr)j.Zn[e]=j.Fn[h],j.qn[e]=j.Bn[h],j.Jn[e++]=this.dr[t];else if(j.Pn&&j.Gn&&this.dr){const c=j.Pn[h],f=j.Gn[h],u=this.dr[t];if(l>=50&&this.ur){const n=(50-a)*N.xi[l-a];j.Zn[e]=i+((c+((j.Pn[r]-c)*n>>16)<<9)/50|0),j.qn[e]=s+((f+((j.Gn[r]-f)*n>>16)<<9)/50|0),j.Jn[e++]=u+((this.ur[t]-u)*n>>16)}if(o>=50&&this.cr){const r=(50-a)*N.xi[o-a];j.Zn[e]=i+((c+((j.Pn[n]-c)*r>>16)<<9)/50|0),j.qn[e]=s+((f+((j.Gn[n]-f)*r>>16)<<9)/50|0),j.Jn[e++]=u+((this.cr[t]-u)*r>>16)}}}const s=j.Zn[0],n=j.Zn[1],r=j.Zn[2],h=j.qn[0],o=j.qn[1],l=j.qn[2];if(!((s-n)*(l-o)-(h-o)*(r-n)<=0))if(N.Ui=!1,3===e){let e;if((s<0||n<0||r<0||s>m.wt||n>m.wt||r>m.wt)&&(N.Ui=!0),e=this.wr?3&this.wr[t]:0,i)N.Tt(s,n,h,o,j.Jn[0]),N.Tt(n,r,o,l,j.Jn[1]),N.Tt(r,s,l,h,j.Jn[2]);else if(0===e)N.ne(s,n,r,h,o,l,j.Jn[0],j.Jn[1],j.Jn[2]);else if(1===e&&this.cr)N.he(s,n,r,h,o,l,N.palette[this.cr[t]]);else if(2===e&&this.wr&&this.Tr&&j.Pn&&j.Gn&&j.Wn){const i=this.wr[t]>>2,e=this.br[i],a=this.Rr[i],c=this.Or[i];N.le(s,n,r,h,o,l,j.Jn[0],j.Jn[1],j.Jn[2],j.Pn[e],j.Gn[e],j.Wn[e],j.Pn[a],j.Pn[c],j.Gn[a],j.Gn[c],j.Wn[a],j.Wn[c],this.Tr[t])}else if(3===e&&this.wr&&this.Tr&&this.cr&&j.Pn&&j.Gn&&j.Wn){const i=this.wr[t]>>2,e=this.br[i],a=this.Rr[i],c=this.Or[i];N.le(s,n,r,h,o,l,this.cr[t],this.cr[t],this.cr[t],j.Pn[e],j.Gn[e],j.Wn[e],j.Pn[a],j.Pn[c],j.Gn[a],j.Gn[c],j.Wn[a],j.Wn[c],this.Tr[t])}}else if(4===e){let e;if((s<0||n<0||r<0||s>m.wt||n>m.wt||r>m.wt||j.Zn[3]<0||j.Zn[3]>m.wt)&&(N.Ui=!0),e=this.wr?3&this.wr[t]:0,i)N.Tt(s,n,h,o,j.Jn[0]),N.Tt(n,r,o,l,j.Jn[1]),N.Tt(r,j.Zn[3],l,j.qn[3],j.Jn[2]),N.Tt(j.Zn[3],s,j.qn[3],h,j.Jn[3]);else if(0===e)N.ne(s,n,r,h,o,l,j.Jn[0],j.Jn[1],j.Jn[2]),N.ne(s,r,j.Zn[3],h,l,j.qn[3],j.Jn[0],j.Jn[2],j.Jn[3]);else if(1===e){if(this.cr){const i=N.palette[this.cr[t]];N.he(s,n,r,h,o,l,i),N.he(s,r,j.Zn[3],h,l,j.qn[3],i)}}else if(2===e&&this.wr&&this.Tr&&j.Pn&&j.Gn&&j.Wn){const i=this.wr[t]>>2,e=this.br[i],a=this.Rr[i],c=this.Or[i];N.le(s,n,r,h,o,l,j.Jn[0],j.Jn[1],j.Jn[2],j.Pn[e],j.Gn[e],j.Wn[e],j.Pn[a],j.Pn[c],j.Gn[a],j.Gn[c],j.Wn[a],j.Wn[c],this.Tr[t]),N.le(s,r,j.Zn[3],h,l,j.qn[3],j.Jn[0],j.Jn[2],j.Jn[3],j.Pn[e],j.Gn[e],j.Wn[e],j.Pn[a],j.Pn[c],j.Gn[a],j.Gn[c],j.Wn[a],j.Wn[c],this.Tr[t])}else if(3===e&&this.wr&&this.Tr&&this.cr&&j.Pn&&j.Gn&&j.Wn){const i=this.wr[t]>>2,e=this.br[i],a=this.Rr[i],c=this.Or[i];N.le(s,n,r,h,o,l,this.cr[t],this.cr[t],this.cr[t],j.Pn[e],j.Gn[e],j.Wn[e],j.Pn[a],j.Pn[c],j.Gn[a],j.Gn[c],j.Wn[a],j.Wn[c],this.Tr[t]),N.le(s,r,j.Zn[3],h,l,j.qn[3],this.cr[t],this.cr[t],this.cr[t],j.Pn[e],j.Gn[e],j.Wn[e],j.Pn[a],j.Pn[c],j.Gn[a],j.Gn[c],j.Wn[a],j.Wn[c],this.Tr[t])}}}ih(t,i,e,s,n){if(!s)return;const r=s.length;if(0===n){let n=0;j.$n=0,j.Qn=0,j.tr=0;for(let t=0;t0?(j.$n=(j.$n/n|0)+t,j.Qn=(j.Qn/n|0)+i,j.tr=(j.tr/n|0)+e):(j.$n=t,j.Qn=i,j.tr=e)}else if(1===n)for(let n=0;n=this.Yr.length)continue;const h=this.Yr[r];if(h)for(let s=0;s=this.Yr.length)continue;const h=this.Yr[r];if(h)for(let s=0;s>16;this.ar[n]=this.ar[n]*c-this.Ar[n]*a>>16,this.Ar[n]=t}if(0!==r){a=N.sin[r],c=N.cos[r];const t=this.ar[n]*c-this.pr[n]*a>>16;this.pr[n]=this.ar[n]*a+this.pr[n]*c>>16,this.ar[n]=t}if(0!==o){a=N.sin[o],c=N.cos[o];const t=this.pr[n]*a+this.Ar[n]*c>>16;this.pr[n]=this.pr[n]*c-this.Ar[n]*a>>16,this.Ar[n]=t}this.Ar[n]+=j.$n,this.ar[n]+=j.Qn,this.pr[n]+=j.tr}}else if(3===n)for(let n=0;n=this.Yr.length)continue;const h=this.Yr[r];if(h)for(let s=0;s=this.Hr.length)continue;const n=this.Hr[e];if(n)for(let i=0;i255&&(this.Er[e]=255)}}}ah(){this.Nr=0,this.kr=0,this.Dr=0,this.vr=999999,this.Lr=-999999,this.Mr=-99999,this.Sr=99999;for(let t=0;tthis.Lr&&(this.Lr=i),sthis.Mr&&(this.Mr=s),-e>this.Nr&&(this.Nr=-e),e>this.Dr&&(this.Dr=e);const n=i*i+s*s;n>this.kr&&(this.kr=n)}this.kr=0|Math.sqrt(this.kr),this.Br=0|Math.sqrt(this.kr*this.kr+this.Nr*this.Nr),this.Fr=this.Br+(0|Math.sqrt(this.kr*this.kr+this.Dr*this.Dr))}dh(t,i,e,s,n,r,h,o){return!(ie&&i>s&&i>n)&&(!(t{const e=t.read(i+'.dat');if(!e)throw new Error(`${i} jpeg not found!`);const s=await(async t=>{255!==t[0]&&(t[0]=255),URL.revokeObjectURL(I.src),I.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>I.onload=()=>t())),g.clearRect(0,0,_.width,_.height);const i=I.naturalWidth,e=I.naturalHeight;return _.width=i,_.height=e,g.drawImage(I,0,0),g.getImageData(0,0,i,e)})(e),n=new J(s.width,s.height),r=new Uint32Array(s.data.buffer),h=n.ft;for(let t=0;t>24&255)<<24|(255&i)<<16|(i>>8&255)<<8|i>>16&255}return n};static Ci=(t,i,e=0)=>{const s=new R(t.read(i+'.dat')),n=new R(t.read('index.dat'));n.Xt=s.Jt;const r=n.Jt,h=n.Jt,o=[],l=n.Zt-1;for(let t=0;ts.length||n.Xt>n.length)throw new Error;const a=n.Zt,c=n.Zt,f=n.Jt,u=n.Jt,d=new J(f,u);d.pi=a,d._i=c,d.Ii=r,d.gi=h;const w=n.Zt;if(0===w){const t=d.width*d.height;for(let i=0;im.bottom&&(n-=i+n-m.bottom),tm.right){const i=t+r-m.right;r-=i,o+=i,h+=i}r>0&&n>0&&this.Ch(r,n,this.ft,s,o,m.ft,e,h)}Eh(t,i,e){i|=0,e|=0;let s=(i+=this.pi)+(e+=this._i)*m.ut,n=0,r=this.height,h=this.width,o=m.ut-h,l=0;if(em.bottom&&(r-=e+r-m.bottom),im.right){const t=i+h-m.right;h-=t,l+=t,o+=t}h>0&&r>0&&this.Th(h,r,this.ft,n,l,m.ft,s,o,t)}bh(t,i){t|=0,i|=0;let e=(t+=this.pi)+(i+=this._i)*m.ut,s=0,n=this.height,r=this.width,h=m.ut-r,o=0;if(im.bottom&&(n-=i+n-m.bottom),tm.right){const i=t+r-m.right;r-=i,o+=i,h+=i}r>0&&n>0&&this.Rh(r,n,this.ft,s,o,m.ft,e,h)}Ti(){const t=this.ft,i=this.width,e=this.height;for(let s=0;s>16&255;r+=t,r<1?r=1:r>255&&(r=255);let h=n>>8&255;h+=i,h<1?h=1:h>255&&(h=255);let o=255&n;o+=e,o<1?o=1:o>255&&(o=255),this.ft[s]=(r<<16)+(h<<8)+o}}}Oi(t,i,e,s){t|=0,i|=0,e|=0,s|=0;try{const n=this.width;let r=0,h=0;const o=this.Ii,l=this.gi,a=(o<<16)/e|0,c=(l<<16)/s|0;t+=(this.pi*e+o-1)/o|0,i+=(this._i*s+l-1)/l|0,this.pi*e%o!=0&&(r=(o-this.pi*e%o<<16)/e|0),this._i*s%l!=0&&(h=(l-this._i*s%l<<16)/s|0),e=e*(this.width-(r>>16))/o|0,s=s*(this.height-(h>>16))/l|0;let f=t+i*m.ut,u=m.ut-e;if(im.bottom&&(s-=i+s-m.bottom),tm.right){const i=t+e-m.right;e-=i,u+=i}this.scale(e,s,this.ft,r,h,m.ft,u,f,n,a,c)}catch(t){console.error('error in sprite clipping routine')}}Oh(t,i,e,s,n,r,h,o,l,a){t|=0,i|=0,e|=0,s|=0;try{const c=-e/2|0,f=-s/2|0,u=65536*Math.sin(l/326.11)|0,d=65536*Math.cos(l/326.11)|0,w=u*a>>8,y=d*a>>8;let A=(h<<16)+f*w+c*y,p=f*y-c*w+(o<<16),_=t+i*m.ut;for(let t=0;t>16)+(h>>16)*this.width],s+=y,h-=w;A+=w,p+=y,_+=m.ut}}catch(t){}}Lh(t,i,e){t|=0,i|=0;let s=(t+=this.pi)+(i+=this._i)*m.ut,n=0,r=this.height,h=this.width,o=m.ut-h,l=0;if(im.bottom&&(r-=i+r-m.bottom),tm.right){const i=t+h-m.right;h-=i,l+=i,o+=i}h>0&&r>0&&this.Sh(h,r,this.ft,l,n,m.ft,s,o,e.ft)}scale(t,i,e,s,n,r,h,o,l,a,c){try{const f=s;for(let u=-i;u<0;u++){const i=(n>>16)*l;for(let n=-t;n<0;n++){const t=e[(s>>16)+i];0===t?o++:r[o++]=t,s+=a}n+=c,s=f,o+=h}}catch(t){console.error('error in plot_scale')}}Rh(t,i,e,s,n,r,h,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++)r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++];for(let i=t;i<0;i++)r[h++]=e[s++];h+=o,s+=n}}Th(t,i,e,s,n,r,h,o,l){const a=256-l;for(let c=-i;c<0;c++){for(let i=-t;i<0;i++){const t=e[s++];if(0===t)h++;else{const i=r[h];r[h++]=((16711935&t)*l+(16711935&i)*a&4278255360)+((65280&t)*l+(65280&i)*a&16711680)>>8}}h+=o,s+=n}}Ch(t,i,e,s,n,r,h,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=e[s++];0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=t}h+=o,s+=n}}Sh(t,i,e,s,n,r,h,o,l){const a=-(t>>2);t=-(3&t);for(let c=-i;c<0;c++){for(let t=a;t<0;t++){let t=e[n++];0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++}for(let i=t;i<0;i++){const t=e[n++];0!==t&&0===l[h]?r[h++]=t:h++}h+=o,n+=s}}}class ${static xh=['_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9'];static Mh=t=>{t=t.trim();let i=0n;for(let e=0;e=65&&s<=90?i+=BigInt(s+1-65):s>=97&&s<=122?i+=BigInt(s+1-97):s>=48&&s<=57&&(i+=BigInt(s+27-48))}return i};static kh=t=>{if(t<0n||t>=6582952005840035281n)return'invalid_name';if(t%37n===0n)return'invalid_name';let i=0;const e=Array(12);for(;0n!==t;){const s=t;t/=37n,e[11-i++]=this.xh[Number(s-37n*t)]}return e.slice(12-i).join('')};static Dh=t=>{const i=[...t.toLowerCase()];let e=!0;for(let t=0;t='a'&&s<='z'&&(i[t]=s.toUpperCase(),e=!1),'.'!==s&&'!'!==s||(e=!0)}return i.join('')};static Nh=t=>{let i='';for(let e=0;e(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static Bh=t=>{if(0===t.length)return t;const i=[...t];for(let t=0;t='a'&&i[t+1]<='z'&&(i[t+1]=String.fromCharCode(i[t+1].charCodeAt(0)+'A'.charCodeAt(0)-97)));return i[0]>='a'&&i[0]<='z'&&(i[0]=String.fromCharCode(i[0].charCodeAt(0)+'A'.charCodeAt(0)-97)),i.join('')};static Uh=t=>{const i=t.toUpperCase();let e=0n;for(let t=0;t>56n)&0xffffffffffffffn;return e}}class Q{static tn=[];static Ph=null;static Gh=null;static Wh=0;static Yh=1;static Hh=2;static Vh=3;static Kh=4;static Xh=5;static jh=6;static zh=7;static Zh=1;static qh=2;static Jh=3;static $h=4;static Qh=5;static io=6;static eo=1;static so=100;static no=101;static ro=200;static ho=201;static oo=202;static lo=203;static ao=205;static co=300;static fo=301;static uo=302;static do=303;static wo=304;static yo=305;static mo=306;static Ao=307;static po=308;static _o=309;static Io=310;static Co=311;static Eo=312;static To=313;static bo=314;static Ro=315;static Oo=316;static vo=317;static Lo=318;static So=319;static xo=320;static Mo=321;static ko=322;static Do=323;static No=324;static Fo=325;static Bo=326;static Uo=327;static Po=401;static Go=500;static Wo=501;static Yo=502;static Ho=503;static Vo=600;static Ko=601;static Xo=602;static jo=603;static zo=604;static Zo=605;static qo=606;static Jo=607;static $o=608;static Qo=609;static tl=610;static il=611;static el=612;static sl=613;static nl=650;static rl=651;static hl=652;static ol=653;static ll=654;static al=655;static en=(t,i,e)=>{this.Ph=new q(5e4),this.Gh=new q(5e4);const s=new R(t.read('data'));let n=-1;for(s.Xt+=2;s.Xt0){r.wl=new Uint8Array(h),r.yl=new Uint16Array(h);for(let t=0;t0){r.scripts=new v(o,null);for(let t=0;t0){const s=e.lastIndexOf(',');r.Ol[t]=this.vl(i,e.substring(0,s),parseInt(e.substring(s+1),10))}}r.Ll=new v(5,null);for(let t=0;t<5;t++){const i=s.ni;r.Ll[t]=i,0===i.length&&(r.Ll[t]=null)}}if(r.type===Q.Vh&&(r.fill=1===s.Zt),r.type===Q.Kh||r.type===Q.Yh){r.Sl=1===s.Zt;const t=s.Zt;e&&(r.font=e[t]),r.xl=1===s.Zt}if(r.type===Q.Kh&&(r.text=s.ni,r.Ml=s.ni),r.type!==Q.Yh&&r.type!==Q.Vh&&r.type!==Q.Kh||(r.kl=s.ti),r.type!==Q.Vh&&r.type!==Q.Kh||(r.Dl=s.ti,r.Nl=s.ti),r.type===Q.Xh){const t=s.ni;if(t.length>0){const e=t.lastIndexOf(',');r.Fl=this.vl(i,t.substring(0,e),parseInt(t.substring(e+1),10))}const e=s.ni;if(e.length>0){const t=e.lastIndexOf(',');r.Bl=this.vl(i,e.substring(0,t),parseInt(e.substring(t+1),10))}}if(r.type===Q.jh){const t=s.Zt;0!==t&&(r.model=this.Ul((t-1<<8)+s.Zt));const i=s.Zt;0!==i&&(r.Pl=this.Ul((i-1<<8)+s.Zt)),r.Gl=s.Zt,0===r.Gl?r.Gl=-1:r.Gl=(r.Gl-1<<8)+s.Zt,r.Wl=s.Zt,0===r.Wl?r.Wl=-1:r.Wl=(r.Wl-1<<8)+s.Zt,r.zoom=s.Jt,r.Yl=s.Jt,r.Hl=s.Jt}if(r.type===Q.zh){r._l=new Int32Array(r.width*r.height),r.Il=new Int32Array(r.width*r.height),r.Sl=1===s.Zt;const t=s.Zt;e&&(r.font=e[t]),r.xl=1===s.Zt,r.kl=s.ti,r.El=s.$t,r.Tl=s.$t,r.gl=1===s.Zt,r.Ll=new v(5,null);for(let t=0;t<5;t++){const i=s.ni;r.Ll[t]=i,0===i.length&&(r.Ll[t]=null)}}r.fl!==Q.qh&&r.type!==Q.Hh||(r.Vl=s.ni,r.action=s.ni,r.Kl=s.Jt),r.fl!==Q.Zh&&r.fl!==Q.$h&&r.fl!==Q.Qh&&r.fl!==Q.io||(r.Xl=s.ni,0===r.Xl.length&&(r.fl===Q.Zh?r.Xl='Ok':r.fl===Q.$h||r.fl===Q.Qh?r.Xl='Select':r.fl===Q.io&&(r.Xl='Continue')))}this.Ph=null,this.Gh=null};static vl=(t,i,e)=>{const s=$.Uh(i)<<8n|BigInt(e);if(this.Ph){const t=this.Ph.get(s);if(t)return t}let n;try{n=J.Ci(t,i,e),this.Ph?.put(s,n)}catch(t){return null}return n};static Ul=t=>{if(this.Gh){const i=this.Gh.get(BigInt(t));if(i)return i}const i=j.model(t);return this.Gh?.put(BigInt(t),i),i};id=-1;cl=-1;type=-1;fl=-1;ul=0;width=0;height=0;dl=-1;wl=null;yl=null;scripts=null;scroll=0;hide=!1;draggable=!1;gl=!1;Cl=!1;El=0;Tl=0;bl=null;Rl=null;Ol=null;Ll=null;fill=!1;Sl=!1;font=null;xl=!1;text=null;Ml=null;kl=0;Dl=0;Nl=0;Fl=null;Bl=null;model=null;Pl=null;Gl=-1;Wl=-1;zoom=0;Yl=0;Hl=0;Vl=null;action=null;Kl=-1;Xl=null;ml=null;Al=null;pl=null;x=0;y=0;jl=0;_l=null;Il=null;zl=0;Zl=0;Ul(t,i,e){let s=this.model;if(e&&(s=this.Pl),!s)return null;if(-1===t&&-1===i&&!s.Tr)return s;const n=j.Ur(s,!0,!0,!1);return-1===t&&-1===i||n.Qr(),-1!==t&&n.eh(t),-1!==i&&n.eh(i),n.oh(64,768,-50,-10,-50,!0),n}ql(){if(this.cl===this.id)return this.x;let t=Q.tn[this.cl];if(!t.ml||!t.Al||!t.pl)return this.x;let i=t.ml.indexOf(this.id);if(-1===i)return this.x;let e=t.Al[i];for(;t.cl!==t.id;){const s=Q.tn[t.cl];s.ml&&s.Al&&s.pl&&(i=s.ml.indexOf(t.id),-1!==i&&(e+=s.Al[i])),t=s}return e}Jl(){if(this.cl===this.id)return this.y;let t=Q.tn[this.cl];if(!t.ml||!t.Al||!t.pl)return this.y;let i=t.ml.indexOf(this.id);if(-1===i)return this.y;let e=t.pl[i];for(;t.cl!==t.id;){const s=Q.tn[t.cl];s.ml&&s.Al&&s.pl&&(i=s.ml.indexOf(t.id),-1!==i&&(e+=s.pl[i])),t=s}return e}outline(t){const i=this.ql(),e=this.Jl();m.gt(i,e,this.width,this.height,t)}move(t,i){if(this.cl===this.id)return;this.x=0,this.y=0;const e=Q.tn[this.cl];if(e.ml&&e.Al&&e.pl){const s=e.ml.indexOf(this.id);-1!==s&&(e.Al[s]=t,e.pl[s]=i)}}delete(){if(this.cl===this.id)return;const t=Q.tn[this.cl];if(t.ml&&t.Al&&t.pl){const i=t.ml.indexOf(this.id);-1!==i&&(t.ml.splice(i,1),t.Al.splice(i,1),t.pl.splice(i,1))}}}var tt,it=(tt="file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/tinymidipcm.mjs",function(t){var i,s,n=void 0!==(t=t||{})?t:{};n.ready=new Promise((function(t,e){i=t,s=e})),["_tsf_load_memory","_tsf_set_output","_tsf_channel_set_bank_preset","_tsf_set_max_voices","_tsf_channel_set_presetnumber","_tsf_reset","_tsf_close","_tml_load_memory","_midi_render","_malloc","_realloc","_free","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(n.ready,t)||Object.defineProperty(n.ready,t,{get:()=>X('You are getting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),set:()=>X('You are setting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js')})}));var r=Object.assign({},n),h=[],o='object'==typeof window,l='function'==typeof importScripts,a='object'==typeof process&&'object'==typeof process.versions&&'string'==typeof process.versions.node,c=!o&&!a&&!l;if(n.ENVIRONMENT)throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');var f,u,d,w='';if(a){if('undefined'==typeof process||!process.release||'node'!==process.release.name)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');var y,m;w=l?require('path').$l(w)+'/':__dirname+'/';var A=()=>{m||(y=require('fs'),m=require('path'))};f=(t,i)=>(A(),t=m.normalize(t),y.Ql(t,i?void 0:'utf8')),d=t=>{var i=f(t,!0);return i.buffer||(i=new Uint8Array(i)),k(i.buffer),i},u=(t,i,e)=>{A(),t=m.normalize(t),y.ta(t,(function(t,s){t?e(t):i(s.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,'/'),h=process.argv.slice(2),process.on('uncaughtException',(function(t){if(!(t instanceof nt))throw t})),process.on('unhandledRejection',(function(t){throw t})),n.inspect=function(){return'[Emscripten Module object]'}}else if(c){if('object'==typeof process&&'function'==typeof require||'object'==typeof window||'function'==typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');'undefined'!=typeof read&&(f=function(t){return read(t)}),d=function(t){let i;return'function'==typeof readbuffer?new Uint8Array(readbuffer(t)):(i=read(t,'binary'),k('object'==typeof i),i)},u=function(t,i,e){setTimeout((()=>i(d(t))),0)},'undefined'!=typeof scriptArgs?h=scriptArgs:void 0!==arguments&&(h=arguments),'undefined'!=typeof print&&('undefined'==typeof console&&(console={}),console.log=print,console.warn=console.error='undefined'!=typeof printErr?printErr:print)}else{if(!o&&!l)throw new Error('environment detection error');if(l?w=self.location.href:'undefined'!=typeof document&&document.currentScript&&(w=document.currentScript.src),tt&&(w=tt),w=0!==w.indexOf('blob:')?w.substr(0,w.replace(/[?#].*/,"").lastIndexOf('/')+1):'','object'!=typeof window&&'function'!=typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');f=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.send(null),i.responseText},l&&(d=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.responseType='arraybuffer',i.send(null),new Uint8Array(i.response)}),u=(t,i,e)=>{var s=new XMLHttpRequest;s.open('GET',t,!0),s.responseType='arraybuffer',s.onload=()=>{200==s.status||0==s.status&&s.response?i(s.response):e()},s.onerror=e,s.send(null)}}n.print||console.log.bind(console);var p,_,I=n.printErr||console.warn.bind(console);function g(t,i){Object.getOwnPropertyDescriptor(n,t)||Object.defineProperty(n,t,{configurable:!0,get:function(){X('Module.'+t+' has been replaced with plain '+i+' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')}})}function C(t){return'FS_createPath'===t||'FS_createDataFile'===t||'FS_createPreloadedFile'===t||'FS_unlink'===t||'addRunDependency'===t||'FS_createLazyFile'===t||'FS_createDevice'===t||'removeRunDependency'===t}Object.assign(n,r),r=null,p='fetchSettings',Object.getOwnPropertyDescriptor(n,p)&&X('`Module.'+p+'` was supplied but `'+p+'` not included in INCOMING_MODULE_JS_API'),n.arguments&&(h=n.arguments),g('arguments','arguments_'),n.thisProgram&&n.thisProgram,g('thisProgram','thisProgram'),n.quit&&n.quit,g('quit','quit_'),k(void 0===n.memoryInitializerPrefixURL,'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'),k(void 0===n.pthreadMainPrefixURL,'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'),k(void 0===n.cdInitializerPrefixURL,'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'),k(void 0===n.filePackagePrefixURL,'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'),k(void 0===n.read,'Module.read option was removed (modify read_ in JS)'),k(void 0===n.readAsync,'Module.readAsync option was removed (modify readAsync in JS)'),k(void 0===n.readBinary,'Module.readBinary option was removed (modify readBinary in JS)'),k(void 0===n.setWindowTitle,'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'),k(void 0===n.TOTAL_MEMORY,'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'),g('read','read_'),g('readAsync','readAsync'),g('readBinary','readBinary'),g('setWindowTitle','setWindowTitle'),k(!c,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),n.wasmBinary&&(_=n.wasmBinary),g('wasmBinary','wasmBinary');var E;n.noExitRuntime;g('noExitRuntime','noExitRuntime'),'object'!=typeof WebAssembly&&X('no native wasm support detected');var T,b,R,O,v,L,S,x,M=!1;function k(t,i){t||X('Assertion failed'+(i?': '+i:''))}function D(t){T=t,n.HEAP8=b=new Int8Array(t),n.HEAP16=O=new Int16Array(t),n.HEAP32=v=new Int32Array(t),n.HEAPU8=R=new Uint8Array(t),n.HEAPU16=new Uint16Array(t),n.HEAPU32=L=new Uint32Array(t),n.HEAPF32=S=new Float32Array(t),n.HEAPF64=x=new Float64Array(t)}'undefined'!=typeof TextDecoder&&new TextDecoder('utf8');var N=5242880;n.TOTAL_STACK&&k(N===n.TOTAL_STACK,'the stack size can no longer be determined at runtime');var F=n.INITIAL_MEMORY||16777216;function B(){if(!M){var t=ft(),i=L[t>>2],e=L[t+4>>2];34821223==i&&2310721022==e||X('Stack overflow! Stack cookie has been overwritten at 0x'+t.toString(16)+', expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+e.toString(16)+' 0x'+i.toString(16)),1668509029!==L[0]&&X('Runtime error: The application has corrupted its heap memory area (address zero)!')}}g('INITIAL_MEMORY','INITIAL_MEMORY'),k(F>=N,'INITIAL_MEMORY should be larger than TOTAL_STACK, was '+F+'! (TOTAL_STACK='+N+')'),k('undefined'!=typeof Int32Array&&'undefined'!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,'JS engine does not provide full typed array support'),k(!n.wasmMemory,'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'),k(16777216==F,'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'),function(){var t=new Int16Array(1),i=new Int8Array(t.buffer);if(t[0]=25459,115!==i[0]||99!==i[1])throw'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'}();var U=[],P=[],G=[],W=!1;k(Math.imul,'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),k(Math.fround,'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),k(Math.clz32,'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),k(Math.trunc,'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');var Y=0,H=null,V=null,K={};function X(t){n.onAbort&&n.onAbort(t),I(t='Aborted('+t+')'),M=!0;var i=new WebAssembly.RuntimeError(t);throw s(i),i}var j={error:function(){X('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM')},init:function(){j.error()},ia:function(){j.error()},ea:function(){j.error()},sa:function(){j.error()},open:function(){j.error()},na:function(){j.error()},ra:function(){j.error()},ha:function(){j.error()},oa:function(){j.error()},la:function(){j.error()}};n.FS_createDataFile=j.ia,n.FS_createPreloadedFile=j.ea;var z,Z,q,J,$='data:application/octet-stream;base64,';function Q(t){return t.startsWith($)}function it(t){return t.startsWith('file://')}function et(t,i){return function(){var e=t,s=i;return i||(s=n.asm),k(W,'native function `'+e+'` called before runtime initialization'),s[t]||k(s[t],'exported native function `'+e+'` not found'),s[t].apply(null,arguments)}}function st(t){try{if(t==z&&_)return new Uint8Array(_);if(d)return d(t);throw"both async and sync fetching of the wasm failed"}catch(t){X(t)}}function nt(t){this.name='ExitStatus',this.message='Program terminated with exit('+t+')',this.status=t}function rt(t){for(;t.length>0;)t.shift()(n)}function ht(t){ht.aa||(ht.aa={}),ht.aa[t]||(ht.aa[t]=1,a&&(t='warning: '+t),I(t))}function ot(t){try{return E.ca(t-T.byteLength+65535>>>16),D(E.buffer),1}catch(i){I('emscripten_realloc_buffer: Attempted to grow heap from '+T.byteLength+' bytes to '+t+' bytes, but got error: '+i)}}n.locateFile?Q(z='tinymidipcm.wasm')||(Z=z,z=n.locateFile?n.locateFile(Z,w):w+Z):z=new URL(e(8227),e.b).toString();var lt,at={"emscripten_memcpy_big":function(t,i,e){R.copyWithin(t,i,i+e)},"emscripten_resize_heap":function(t){var i=R.length;k((t>>>=0)>i);var e,s,n=2147483648;if(t>n)return I('Cannot enlarge memory, asked to go up to '+t+' bytes, but the limit is '+n+' bytes!'),!1;for(var r=1;r<=4;r*=2){var h=i*(1+.2/r);h=Math.min(h,t+100663296);var o=Math.min(n,(e=Math.max(t,h))+((s=65536)-e%s)%s);if(ot(o))return!0}return I('Failed to grow the heap from '+i+' bytes to '+o+' bytes, not enough memory!'),!1}},ct=(function(){var t,i={'env':at,'wasi_snapshot_preview1':at};function e(t,i){var e,s=t.exports;n.asm=s,k(E=n.asm.memory,"memory not found in wasm exports"),D(E.buffer),k(n.asm.__indirect_function_table,"table not found in wasm exports"),e=n.asm.__wasm_call_ctors,P.unshift(e),function(t){if(Y--,n.monitorRunDependencies&&n.monitorRunDependencies(Y),t?(k(K[t]),delete K[t]):I('warning: run dependency removed without ID'),0==Y&&(null!==H&&(clearInterval(H),H=null),V)){var i=V;V=null,i()}}('wasm-instantiate')}t='wasm-instantiate',Y++,n.monitorRunDependencies&&n.monitorRunDependencies(Y),t?(k(!K[t]),K[t]=1,null===H&&'undefined'!=typeof setInterval&&(H=setInterval((function(){if(M)return clearInterval(H),void(H=null);var t=!1;for(var i in K)t||(t=!0,I('still waiting on run dependencies:')),I('dependency: '+i);t&&I('(end of list)')}),1e4))):I('warning: run dependency added without ID');var r=n;function h(t){k(n===r,'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'),r=null,e(t.instance)}function c(t){return function(){if(!_&&(o||l)){if('function'==typeof fetch&&!it(z))return fetch(z,{credentials:'same-origin'}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+z+"'";return t.arrayBuffer()})).catch((function(){return st(z)}));if(u)return new Promise((function(t,i){u(z,(function(i){t(new Uint8Array(i))}),i)}))}return Promise.resolve().then((function(){return st(z)}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){I('failed to asynchronously prepare wasm: '+t),it(z)&&I('warning: Loading from a file URI ('+z+') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing'),X(t)}))}if(n.instantiateWasm)try{return n.instantiateWasm(i,e)}catch(t){I('Module.instantiateWasm callback failed with error: '+t),s(t)}(_||'function'!=typeof WebAssembly.instantiateStreaming||Q(z)||it(z)||a||'function'!=typeof fetch?c(h):fetch(z,{credentials:'same-origin'}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(h,(function(t){return I('wasm streaming compile failed: '+t),I('falling back to ArrayBuffer instantiation'),c(h)}))}))).catch(s)}(),n.___wasm_call_ctors=et("__wasm_call_ctors"),n._malloc=et("malloc"),n._free=et("free"),n._tsf_load_memory=et("tsf_load_memory"),n._tsf_close=et("tsf_close"),n._tsf_reset=et("tsf_reset"),n._tsf_set_output=et("tsf_set_output"),n._tsf_set_max_voices=et("tsf_set_max_voices"),n._realloc=et("realloc"),n._tsf_channel_set_presetnumber=et("tsf_channel_set_presetnumber"),n._tsf_channel_set_bank_preset=et("tsf_channel_set_bank_preset"),n._tml_load_memory=et("tml_load_memory"),n._midi_render=et("midi_render"),n.___errno_location=et("__errno_location"),n._fflush=et("fflush"),n._emscripten_stack_init=function(){return(ct=n._emscripten_stack_init=n.asm.emscripten_stack_init).apply(null,arguments)}),ft=(n._emscripten_stack_get_free=function(){return(n._emscripten_stack_get_free=n.asm.emscripten_stack_get_free).apply(null,arguments)},n._emscripten_stack_get_base=function(){return(n._emscripten_stack_get_base=n.asm.emscripten_stack_get_base).apply(null,arguments)},n._emscripten_stack_get_end=function(){return(ft=n._emscripten_stack_get_end=n.asm.emscripten_stack_get_end).apply(null,arguments)});function ut(){var t;ct(),k(!(3&(t=ft()))),L[t>>2]=34821223,L[t+4>>2]=2310721022,L[0]=1668509029}function dt(t){function e(){lt||(lt=!0,n.calledRun=!0,M||(k(!W),W=!0,B(),rt(P),i(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),k(!n._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(B(),n.postRun)for('function'==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)t=n.postRun.shift(),G.unshift(t);var t;rt(G)}()))}t=t||h,Y>0||(ut(),function(){if(n.preRun)for('function'==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)t=n.preRun.shift(),U.unshift(t);var t;rt(U)}(),Y>0||(n.setStatus?(n.setStatus('Running...'),setTimeout((function(){setTimeout((function(){n.setStatus('')}),1),e()}),1)):e(),B()))}if(n.stackSave=et("stackSave"),n.stackRestore=et("stackRestore"),n.stackAlloc=et("stackAlloc"),n.setValue=function(t,i,e="i8"){switch(e.endsWith('*')&&(e='*'),e){case'i1':case'i8':b[0|t]=i;break;case'i16':O[t>>1]=i;break;case'i32':v[t>>2]=i;break;case'i64':J=[i>>>0,(q=i,+Math.abs(q)>=1?q>0?(0|Math.min(+Math.floor(q/4294967296),4294967295))>>>0:~~+Math.ceil((q-+(~~q>>>0))/4294967296)>>>0:0)],v[t>>2]=J[0],v[t+4>>2]=J[1];break;case'float':S[t>>2]=i;break;case'double':x[t>>3]=i;break;case'*':L[t>>2]=i;break;default:X('invalid type for setValue: '+e)}},n.getValue=function(t,i="i8"){switch(i.endsWith('*')&&(i='*'),i){case'i1':case'i8':return b[0|t];case'i16':return O[t>>1];case'i32':case'i64':return v[t>>2];case'float':return S[t>>2];case'double':return x[t>>3];case'*':return L[t>>2];default:X('invalid type for getValue: '+i)}return null},['run','UTF8ArrayToString','UTF8ToString','stringToUTF8Array','stringToUTF8','lengthBytesUTF8','addOnPreRun','addOnInit','addOnPreMain','addOnExit','addOnPostRun','addRunDependency','removeRunDependency','FS_createFolder','FS_createPath','FS_createDataFile','FS_createPreloadedFile','FS_createLazyFile','FS_createLink','FS_createDevice','FS_unlink','getLEB','getFunctionTables','alignFunctionTables','registerFunctions','prettyPrint','getCompilerSetting','print','printErr','callMain','abort','keepRuntimeAlive','wasmMemory','stackAlloc','stackSave','stackRestore','getTempRet0','setTempRet0','writeStackCookie','checkStackCookie','ptrToString','zeroMemory','stringToNewUTF8','exitJS','getHeapMax','emscripten_realloc_buffer','ENV','ERRNO_CODES','ERRNO_MESSAGES','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','DNS','getHostByName','Protocols','Sockets','getRandomDevice','warnOnce','traverseStack','UNWIND_CACHE','convertPCtoSourceLocation','readAsmConstArgsArray','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','handleException','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','freeTableIndexes','functionsInTableMap','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','PATH','PATH_FS','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16Decoder','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeArrayToMemory','writeAsciiToMemory','SYSCALLS','getSocketFromFD','getSocketAddress','JSEvents','registerKeyEventCallback','specialHTMLTargets','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','currentFullscreenStrategy','restoreOldWindowedStyle','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','demangle','demangleAll','jsStackTrace','stackTrace','ExitStatus','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','dlopenMissingError','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','uncaughtExceptionCount','exceptionLast','exceptionCaught','ExceptionInfo','exception_addRef','exception_decRef','Browser','setMainLoop','wget','FS','MEMFS','TTY','PIPEFS','SOCKFS','_setNetworkCallback','tempFixedLengthArray','miniTempWebGLFloatBuffers','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','GL','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','AL','SDL_unicode','SDL_ttfContext','SDL_audio','SDL','SDL_gfx','GLUT','EGL','GLFW_Window','GLFW','GLEW','IDBStore','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){Object.getOwnPropertyDescriptor(n,t)||Object.defineProperty(n,t,{configurable:!0,get:function(){var i="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";C(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),X(i)}})})),['ptrToString','zeroMemory','stringToNewUTF8','exitJS','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','getHostByName','getRandomDevice','traverseStack','convertPCtoSourceLocation','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeAsciiToMemory','getSocketFromFD','getSocketAddress','registerKeyEventCallback','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','ExceptionInfo','exception_addRef','exception_decRef','setMainLoop','_setNetworkCallback','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','SDL_unicode','SDL_ttfContext','SDL_audio','GLFW_Window','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){'undefined'==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var i='`'+t+'` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line';C(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),ht(i)}})})),V=function t(){lt||dt(),lt||(V=t)},n.preInit)for('function'==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return dt(),t.ready});const et=it;const st=class{constructor(t={}){this.fa=void 0,this.ua=0,this.da=0,this.wa=0,this.ya=t.ya||100,this.sampleRate=t.sampleRate||44100,this.ma=t.ma||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.Aa(1),this.pa=t.pa||(()=>{}),this._a=t._a||(()=>{}),this.Ia=void 0,this.test=0}async init(){if(!this.fa){if('undefined'!=typeof process){const{$l:t}=await import('path'),{ga:i}=await import('module');globalThis.__dirname=t("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js"),globalThis.require=i("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js")}this.fa=await et(),this.Ca=this.fa._malloc(this.bufferSize),this.Ea=this.fa._malloc(8)}}Aa(t){this.bufferSize=4*this.sampleRate*this.ma*t}Ta(){if(!this.fa)throw new Error(`${this.constructor.name} not initalized. call .init()`)}ba(t){this.Ta();const{_malloc:i,_free:e,_tsf_load_memory:s,_tsf_set_output:n,_tsf_channel_set_bank_preset:r,_tsf_set_max_voices:h,_tsf_channel_set_presetnumber:o}=this.fa;e(this.ua),this.ua=i(t.length),this.fa.HEAPU8.set(t,this.ua),this.da=s(this.ua,t.length),n(this.da,2===this.ma?0:2,this.sampleRate,this.gain)}Ra(){this.Ta();const t=new Uint8Array(this.bufferSize);return t.set(this.fa.HEAPU8.subarray(this.Ca,this.Ca+this.bufferSize)),t}Oa(t){const{_malloc:i,_free:e,_tml_load_memory:s}=this.fa;return e(this.wa),this.wa=i(t.length),this.fa.HEAPU8.set(t,this.wa),s(this.wa,t.length)}va(t){const{_midi_render:i}=this.fa;return i(this.da,t,this.ma,this.sampleRate,this.Ca,this.bufferSize,this.Ea)}La(t){if(this.Ta(),!this.da)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.Ia);const{setValue:i,getValue:e}=this.fa;i(this.Ea,0,'double'),this.fa._tsf_reset(this.da),this.fa._tsf_channel_set_bank_preset(this.da,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let s=this.Oa(t);const n=()=>{s=this.va(s);const t=this.Ra();this.pa(t),s?this.Ia=setTimeout(n,this.ya):this._a(e(this.Ea,'double'))};this.Ia=setTimeout(n,16)}};!function(){window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioContext&&(window.audioContext=new window.AudioContext);var t=function(i){if(window.audioContext){var e=window.audioContext.createBuffer(1,1,22050),s=window.audioContext.createBufferSource();s.buffer=e,s.connect(window.audioContext.destination),s.start?s.start(0):s.play?s.play(0):s.noteOn&&s.noteOn(0)}document.removeEventListener('touchstart',t),document.removeEventListener('touchend',t),document.removeEventListener('click',t)};document.addEventListener('touchstart',t),document.addEventListener('touchend',t),document.addEventListener('click',t)}(),(async()=>{let t=new Float32Array,i=window.audioContext.createGain();i.gain.value=.1,i.connect(window.audioContext.destination);let e=window.audioContext.currentTime,s=[];const n=new st({ya:30,pa:i=>{let e=new Float32Array(i.buffer),s=new Float32Array(t.length+e.length);s.set(t,0),s.set(e,t.length),t=s},_a:t=>{},bufferSize:102400});await n.init();const r=await fetch('./SCC1_Florestan.sf2'),h=new Uint8Array(await r.arrayBuffer());function o(){if(!window.audioContext||!t.length)return;let n=window.audioContext.createBufferSource();const r=t.length/2,h=window.audioContext.createBuffer(2,r,44100);for(let i=0;i<2;i++){const e=h.getChannelData(i);let s=i;for(let i=0;i{if(l&&clearInterval(l),t=new Float32Array,s.length){let t=i.gain.value;i.gain.value=0,s.forEach((t=>{t.stop(window.audioContext.currentTime)})),s=[],i.gain.value=t}},window._tinyMidiVolume=(t=1)=>{i.gain.value=t},window._tinyMidiPlay=async(t,i=1)=>{t&&(await window._tinyMidiStop(),-1!=i&&window._tinyMidiVolume(i),e=window.audioContext.currentTime,l=setInterval(o,250),n.La(t))}})();class nt{level;y;x;z;model;Sa;xa;Ma;ka;Da;Na;Fa;info;Ba=0;Yi=0;constructor(t,i,e,s,n,r,h,o,l,a,c,f,u){this.level=t,this.y=i,this.x=e,this.z=s,this.model=n,this.Sa=r,this.xa=h,this.Ma=o,this.ka=l,this.Da=a,this.Na=c,this.Fa=f,this.info=u}}class rt extends w{level;x;z;Ua;Pa;Ga;Wa=null;Ya=null;Ha=null;Va=null;Ka=null;Xa=null;ja=null;za=0;Za=0;qa=0;visible=!1;update=!1;Ja=!1;$a=0;Qa=0;tc=0;ic=0;constructor(t,i,e){super(),this.Ua=this.level=t,this.x=i,this.z=e,this.Pa=new v(5,null),this.Ga=new Int32Array(5)}}class ht{ec;sc;nc;rc;type;vr;Lr;Sr;Mr;Dr;Nr;mode=0;hc=0;oc=0;lc=0;ac=0;cc=0;fc=0;constructor(t,i,e,s,n,r,h,o,l,a,c){this.ec=t,this.sc=i,this.nc=e,this.rc=s,this.type=n,this.vr=r,this.Lr=h,this.Sr=o,this.Mr=l,this.Dr=a,this.Nr=c}}class ot{static OPEN=0;static uc=1;static dc=2;static wc=4;static yc=8;static mc=ot.uc<<4;static Ac=ot.dc<<4;static _c=ot.wc<<4;static Ic=ot.yc<<4;static gc=256;static Cc=512;static Ec=1024;static Tc=2048;static bc=4096;static Rc=ot.Cc<<4;static Oc=ot.Ec<<4;static vc=ot.Tc<<4;static Lc=ot.bc<<4;static Sc=ot.gc<<9;static xc=524288;static Mc=2097152;static kc=ot.Mc|ot.xc;static Dc=ot.gc|ot.kc;static Nc=ot.dc|ot.Dc;static Fc=ot.yc|ot.Dc;static Bc=ot.dc|ot.wc|ot.Fc;static Uc=ot.Ac|ot.Dc;static Pc=ot.yc|ot.mc|ot.Uc;static Gc=ot.Ic|ot.Dc;static Wc=ot.uc|ot.dc|ot.Gc;static Yc=ot.Ac|ot._c|ot.Gc;static Hc=16777215}class lt{static Vc=0;static Kc=1;static Xc=2;static jc=3}class at{static zc=0;static Zc=1;static qc=2;static Jc=3}class ct{static $c=new ct(0,at.zc);static Qc=new ct(1,at.zc);static tf=new ct(2,at.zc);static if=new ct(3,at.zc);static ef=new ct(4,at.Zc);static sf=new ct(5,at.Zc);static nf=new ct(6,at.Zc);static rf=new ct(7,at.Zc);static hf=new ct(8,at.Zc);static lf=new ct(9,at.qc);static af=new ct(10,at.qc);static cf=new ct(11,at.qc);static ff=new ct(12,at.qc);static uf=new ct(13,at.qc);static df=new ct(14,at.qc);static wf=new ct(15,at.qc);static yf=new ct(16,at.qc);static mf=new ct(17,at.qc);static Af=new ct(18,at.qc);static pf=new ct(19,at.qc);static _f=new ct(20,at.qc);static If=new ct(21,at.qc);static Jc=new ct(22,at.Jc);static values(){return[this.$c,this.Qc,this.mf,this.wf,this.tf,this.df,this.lf,this.if,this.Jc,this.ff,this.cf,this.nf,this._f,this.af,this.sf,this.uf,this.rf,this.ef,this.yf,this.hf,this.pf,this.If,this.Af]}static of(t){const i=this.values();for(let e=0;et*ut.Cf+i;offsetX;Ef;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.Ef=0,this.sizeX=ut.Cf,this.sizeZ=ut.Cf,this.flags=new Int32Array(this.sizeX*this.sizeZ),this.reset()}reset=()=>{for(let t=0;t{this.flags[ut.index(t-this.offsetX,i-this.Ef)]|=ot.Mc};bf=(t,i)=>{this.flags[ut.index(t-this.offsetX,i-this.Ef)]&=~ot.Mc};Rf=(t,i,e,s,n,r)=>{let h=ot.gc;r&&(h|=ot.Sc);const o=t-this.offsetX,l=i-this.Ef;if(n===lt.Kc||n===lt.jc){const t=e;e=s,s=t}for(let t=o;t=0&&t=0&&i{let h=ot.gc;r&&(h|=ot.Sc);const o=t-this.offsetX,l=i-this.Ef;if(n===lt.Kc||n===lt.jc){const t=e;e=s,s=t}for(let t=o;t=0&&t=0&&i{const r=t-this.offsetX,h=i-this.Ef,o=n?ot.Lc:ot.Ic,l=n?ot.bc:ot.yc,a=n?ot.Ec:ot.dc,c=n?ot.Oc:ot.Ac,f=n?ot.Cc:ot.uc,u=n?ot.Rc:ot.mc,d=n?ot.Tc:ot.wc,w=n?ot.vc:ot._c;e===ct.$c.id?s===lt.Vc?(this.add(r,h,o),this.add(r-1,h,l)):s===lt.Kc?(this.add(r,h,a),this.add(r,h+1,c)):s===lt.Xc?(this.add(r,h,l),this.add(r+1,h,o)):s===lt.jc&&(this.add(r,h,c),this.add(r,h-1,a)):e===ct.Qc.id||e===ct.if.id?s===lt.Vc?(this.add(r,h,f),this.add(r-1,h+1,u)):s===lt.Kc?(this.add(r,h,d),this.add(r+1,h+1,w)):s===lt.Xc?(this.add(r,h,u),this.add(r+1,h-1,f)):s===lt.jc&&(this.add(r,h,w),this.add(r-1,h-1,d)):e===ct.tf.id&&(s===lt.Vc?(this.add(r,h,a|o),this.add(r-1,h,l),this.add(r,h+1,c)):s===lt.Kc?(this.add(r,h,a|l),this.add(r,h+1,c),this.add(r+1,h,o)):s===lt.Xc?(this.add(r,h,c|l),this.add(r+1,h,o),this.add(r,h-1,a)):s===lt.jc&&(this.add(r,h,c|o),this.add(r,h-1,a),this.add(r-1,h,l))),n&&this.vf(t,i,e,s,!1)};Lf=(t,i,e,s,n)=>{const r=t-this.offsetX,h=i-this.Ef,o=n?ot.Lc:ot.Ic,l=n?ot.bc:ot.yc,a=n?ot.Ec:ot.dc,c=n?ot.Oc:ot.Ac,f=n?ot.Cc:ot.uc,u=n?ot.Rc:ot.mc,d=n?ot.Tc:ot.wc,w=n?ot.vc:ot._c;e===ct.$c.id?s===lt.Vc?(this.remove(r,h,o),this.remove(r-1,h,l)):s===lt.Kc?(this.remove(r,h,a),this.remove(r,h+1,c)):s===lt.Xc?(this.remove(r,h,l),this.remove(r+1,h,o)):s===lt.jc&&(this.remove(r,h,c),this.remove(r,h-1,a)):e===ct.Qc.id||e===ct.if.id?s===lt.Vc?(this.remove(r,h,f),this.remove(r-1,h+1,u)):s===lt.Kc?(this.remove(r,h,d),this.remove(r+1,h+1,w)):s===lt.Xc?(this.remove(r,h,u),this.remove(r+1,h-1,f)):s===lt.jc&&(this.remove(r,h,w),this.remove(r-1,h-1,d)):e===ct.tf.id&&(s===lt.Vc?(this.remove(r,h,a|o),this.remove(r-1,h,l),this.remove(r,h+1,c)):s===lt.Kc?(this.remove(r,h,a|l),this.remove(r,h+1,c),this.remove(r+1,h,o)):s===lt.Xc?(this.remove(r,h,c|l),this.remove(r+1,h,o),this.remove(r,h-1,a)):s===lt.jc&&(this.remove(r,h,c|o),this.remove(r,h-1,a),this.remove(r-1,h,l))),n&&this.Lf(t,i,e,s,!1)};Sf=(t,i,e,s,n,r)=>{if(t===e&&i===s)return!0;const h=t-this.offsetX,o=i-this.Ef,l=e-this.offsetX,a=s-this.Ef,c=ut.index(h,o);if(n===ct.$c.id){if(r===lt.Vc){if(h===l-1&&o===a)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.Uc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.Nc)===ot.OPEN)return!0}else if(r===lt.Kc){if(h===l&&o===a+1)return!0;if(h===l-1&&o===a&&(this.flags[c]&ot.Fc)===ot.OPEN)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.Gc)===ot.OPEN)return!0}else if(r===lt.Xc){if(h===l+1&&o===a)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.Uc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.Nc)===ot.OPEN)return!0}else if(r===lt.jc){if(h===l&&o===a-1)return!0;if(h===l-1&&o===a&&(this.flags[c]&ot.Fc)===ot.OPEN)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.Gc)===ot.OPEN)return!0}}else if(n===ct.tf.id){if(r===lt.Vc){if(h===l-1&&o===a)return!0;if(h===l&&o===a+1)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.Gc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.Nc)===ot.OPEN)return!0}else if(r===lt.Kc){if(h===l-1&&o===a&&(this.flags[c]&ot.Fc)===ot.OPEN)return!0;if(h===l&&o===a+1)return!0;if(h===l+1&&o===a)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.Nc)===ot.OPEN)return!0}else if(r===lt.Xc){if(h===l-1&&o===a&&(this.flags[c]&ot.Fc)===ot.OPEN)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.Uc)===ot.OPEN)return!0;if(h===l+1&&o===a)return!0;if(h===l&&o===a-1)return!0}else if(r===lt.jc){if(h===l-1&&o===a)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.Uc)===ot.OPEN)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.Gc)===ot.OPEN)return!0;if(h===l&&o===a-1)return!0}}else if(n===ct.lf.id){if(h===l&&o===a+1&&(this.flags[c]&ot.Ac)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.dc)===ot.OPEN)return!0;if(h===l-1&&o===a&&(this.flags[c]&ot.yc)===ot.OPEN)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.Ic)===ot.OPEN)return!0}return!1};xf=(t,i,e,s,n,r)=>{if(t===e&&i===s)return!0;const h=t-this.offsetX,o=i-this.Ef,l=e-this.offsetX,a=s-this.Ef,c=ut.index(h,o);if(n===ct.nf.id||n===ct.rf.id){if(n===ct.rf.id&&(r=r+2&3),r===lt.Vc){if(h===l+1&&o===a&&(this.flags[c]&ot.Ic)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.dc)===ot.OPEN)return!0}else if(r===lt.Kc){if(h===l-1&&o===a&&(this.flags[c]&ot.yc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.dc)===ot.OPEN)return!0}else if(r===lt.Xc){if(h===l-1&&o===a&&(this.flags[c]&ot.yc)===ot.OPEN)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.Ac)===ot.OPEN)return!0}else if(r===lt.jc){if(h===l+1&&o===a&&(this.flags[c]&ot.Ic)===ot.OPEN)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.Ac)===ot.OPEN)return!0}}else if(n===ct.hf.id){if(h===l&&o===a+1&&(this.flags[c]&ot.Ac)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.dc)===ot.OPEN)return!0;if(h===l-1&&o===a&&(this.flags[c]&ot.yc)===ot.OPEN)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.Ic)===ot.OPEN)return!0}return!1};Mf=(t,i,e,s,n,r,h)=>{const o=e+n-1,l=s+r-1,a=ut.index(t-this.offsetX,i-this.Ef);return t>=e&&t<=o&&i>=s&&i<=l||(t===e-1&&i>=s&&i<=l&&(this.flags[a]&ot.yc)===ot.OPEN&&(h&ft.Vc)===ot.OPEN||(t===o+1&&i>=s&&i<=l&&(this.flags[a]&ot.Ic)===ot.OPEN&&(h&ft.Xc)===ot.OPEN||(i===s-1&&t>=e&&t<=o&&(this.flags[a]&ot.dc)===ot.OPEN&&(h&ft.jc)===ot.OPEN||i===l+1&&t>=e&&t<=o&&(this.flags[a]&ot.Ac)===ot.OPEN&&(h&ft.Kc)===ot.OPEN)))};add=(t,i,e)=>{this.flags[ut.index(t,i)]|=e};remove=(t,i,e)=>{this.flags[ut.index(t,i)]&=ot.Hc-e}}class dt{y;x;z;model;Fa;info;constructor(t,i,e,s,n,r){this.y=t,this.x=i,this.z=e,this.model=s,this.Fa=n,this.info=r}}class wt{y;x;z;kf;Df;Nf;Ff;Fa;info;constructor(t,i,e,s,n,r,h,o,l){this.y=t,this.x=i,this.z=e,this.kf=s,this.Df=n,this.Nf=r,this.Ff=h,this.Fa=o,this.info=l}}class yt{y;x;z;type;angle;model;Fa;info;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.type=s,this.angle=n,this.model=r,this.Fa=h,this.info=o}}class mt{y;x;z;Bf;Uf;Pf;Fa;offset;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.Bf=s,this.Uf=n,this.Pf=r,this.Fa=h,this.offset=o}}class At{Gf;Wf;Yf;Hf;Vf;color;flat;constructor(t,i,e,s,n,r,h){this.Gf=t,this.Wf=i,this.Yf=e,this.Hf=s,this.Vf=n,this.color=r,this.flat=h}}class pt{static Kf=new Int32Array(6);static Xf=new Int32Array(6);static jf=new Int32Array(6);static zf=new Int32Array(6);static Zf=new Int32Array(6);static qf=[Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,2,6),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,13,14)];static Jf=[Int8Array.of(0,1,2,3,0,0,1,3),Int8Array.of(1,1,2,3,1,0,1,3),Int8Array.of(0,1,2,3,1,0,1,3),Int8Array.of(0,0,1,2,0,0,2,4,1,0,4,3),Int8Array.of(0,0,1,4,0,0,4,3,1,1,2,4),Int8Array.of(0,0,4,3,1,0,1,2,1,0,2,4),Int8Array.of(0,1,2,4,1,0,1,4,1,0,4,3),Int8Array.of(0,4,1,2,0,4,2,5,1,0,4,5,1,0,5,3),Int8Array.of(0,4,1,2,0,4,2,3,0,4,3,5,1,0,4,5),Int8Array.of(0,0,4,5,1,4,1,2,1,4,2,3,1,4,3,5),Int8Array.of(0,0,1,5,0,1,4,5,0,1,2,4,1,0,5,3,1,5,4,3,1,4,2,3),Int8Array.of(1,0,1,5,1,1,4,5,1,1,2,4,0,0,5,3,0,5,4,3,0,4,2,3),Int8Array.of(1,0,5,4,1,0,1,5,0,0,4,3,0,4,5,3,0,5,2,3,0,1,2,5)];static $f=128;static Qf=this.$f/2|0;static tu=this.$f/4|0;static iu=3*this.$f/4|0;Ar;ar;pr;eu;su;nu;ru;hu;ou;lu;flat;shape;angle;au;cu;constructor(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w,y,m,A,p){this.flat=!(m!==s||m!==d||m!==o),this.shape=i,this.angle=r,this.au=u,this.cu=l;const _=pt.qf[i],I=_.length;this.Ar=new Int32Array(I),this.ar=new Int32Array(I),this.pr=new Int32Array(I);const g=new Int32Array(I),C=new Int32Array(I),E=t*pt.$f,T=A*pt.$f;for(let t=0;t8&&I<=12&&(I=9+(I-r-9&3)),I>12&&I<=16&&(I=13+(I-r-13&3)),1===I?(i=E,l=T,c=m,u=h,A=a):2===I?(i=E+pt.Qf,l=T,c=m+s>>1,u=h+p>>1,A=a+e>>1):3===I?(i=E+pt.$f,l=T,c=s,u=p,A=e):4===I?(i=E+pt.$f,l=T+pt.Qf,c=s+d>>1,u=p+n>>1,A=e+w>>1):5===I?(i=E+pt.$f,l=T+pt.$f,c=d,u=n,A=w):6===I?(i=E+pt.Qf,l=T+pt.$f,c=d+o>>1,u=n+y>>1,A=w+f>>1):7===I?(i=E,l=T+pt.$f,c=o,u=y,A=f):8===I?(i=E,l=T+pt.Qf,c=o+m>>1,u=y+h>>1,A=f+a>>1):9===I?(i=E+pt.Qf,l=T+pt.tu,c=m+s>>1,u=h+p>>1,A=a+e>>1):10===I?(i=E+pt.iu,l=T+pt.Qf,c=s+d>>1,u=p+n>>1,A=e+w>>1):11===I?(i=E+pt.Qf,l=T+pt.iu,c=d+o>>1,u=n+y>>1,A=w+f>>1):12===I?(i=E+pt.tu,l=T+pt.Qf,c=o+m>>1,u=y+h>>1,A=f+a>>1):13===I?(i=E+pt.tu,l=T+pt.tu,c=m,u=h,A=a):14===I?(i=E+pt.iu,l=T+pt.tu,c=s,u=p,A=e):15===I?(i=E+pt.iu,l=T+pt.iu,c=d,u=n,A=w):(i=E+pt.tu,l=T+pt.iu,c=o,u=y,A=f),this.Ar[t]=i,this.ar[t]=c,this.pr[t]=l,g[t]=u,C[t]=A}const b=pt.Jf[i],R=b.length/4|0;this.ru=new Int32Array(R),this.hu=new Int32Array(R),this.ou=new Int32Array(R),this.eu=new Int32Array(R),this.su=new Int32Array(R),this.nu=new Int32Array(R),this.lu=-1!==c?new Int32Array(R):null;let O=0;for(let t=0;t{this.Ru=0,this.Ou=0,this.vu=t,this.Lu=i,this.Su=t/2|0,this.xu=i/2|0;const r=new x(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let i=0;i<2048;i+=64){this.Mu=N.sin[t],this.ku=N.cos[t],this.Du=N.sin[i],this.Nu=N.cos[i];const h=(t-128)/32|0,o=i/64|0;for(let t=-26;t<=26;t++)for(let i=-26;i<=26;i++){const l=128*t,a=128*i;let c=!1;for(let t=-e;t<=s;t+=128)if(this.wd(l,a,n[h]+t)){c=!0;break}r[h][o][t+25+1][i+25+1]=c}}for(let t=0;t<8;t++)for(let i=0;i<32;i++)for(let e=-25;e<25;e++)for(let s=-25;s<25;s++){let n=!1;t:for(let h=-1;h<=1;h++)for(let o=-1;o<=1;o++){if(r[t][i][e+h+25+1][s+o+25+1]){n=!0;break t}if(r[t][(i+1)%31][e+h+25+1][s+o+25+1]){n=!0;break t}if(r[t+1][i][e+h+25+1][s+o+25+1]){n=!0;break t}if(r[t+1][(i+1)%31][e+h+25+1][s+o+25+1]){n=!0;break t}}this.Iu[t][i][e+25][s+25]=n}};static zi=()=>{this.gu=null,this.Cu=null,this.Eu=null,this.bu=null,this.Iu=null,this.Tu=null,this.zu=null,console.log('World3D unloaded!')};static yd=(t,i,e,s,n,r,h,o)=>{It.Eu[t][It.Cu[t]++]=new ht(e/128|0,r/128|0,n/128|0,o/128|0,i,e,r,n,o,s,h)};static wd=(t,i,e)=>{const s=i*this.Du+t*this.Nu>>16,n=i*this.Nu-t*this.Du>>16,r=e*this.Mu+n*this.ku>>16,h=e*this.ku-n*this.Mu>>16;if(r<50||r>3500)return!1;const o=this.Su+((s<<9)/r|0),l=this.xu+((h<<9)/r|0);return o>=this.Ru&&o<=this.vu&&l>=this.Ou&&l<=this.Lu};md;sc;rc;Ad;pd;_d;Id;gd;Cd;Ed=0;Td=0;bd=0;constructor(t,i,e,s){this.md=e,this.sc=s,this.rc=i,this.pd=new S(e,s,i,null),this.Id=new D(e,s+1,i+1),this.Ad=t,this._d=new v(5e3,null),this.gd=new Int32Array(1e4),this.Cd=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this.Td=t;for(let i=0;i{const e=this.pd[0][t][i];for(let e=0;e<3;e++){this.pd[e][t][i]=this.pd[e+1][t][i];const s=this.pd[e][t][i];s&&s.level--}this.pd[0][t][i]||(this.pd[0][t][i]=new rt(0,t,i));const s=this.pd[0][t][i];s&&(s.ja=e),this.pd[3][t][i]=null};vd=(t,i,e,s)=>{const n=this.pd[t][i][e];n&&(n.qa=s)};Ld=(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w,y,m,A,p,_)=>{if(s===_t.fu){for(let s=t;s>=0;s--)this.pd[s][i][e]||(this.pd[s][i][e]=new rt(s,i,e));const s=this.pd[t][i][e];s&&(s.Wa=new At(c,f,u,d,-1,p,!1))}else if(s===_t.uu){for(let s=t;s>=0;s--)this.pd[s][i][e]||(this.pd[s][i][e]=new rt(s,i,e));const s=this.pd[t][i][e];s&&(s.Wa=new At(w,y,m,A,r,_,h===o&&h===l&&h===a))}else{for(let s=t;s>=0;s--)this.pd[s][i][e]||(this.pd[s][i][e]=new rt(s,i,e));const I=this.pd[t][i][e];I&&(I.Ya=new pt(i,s,y,o,u,n,c,a,_,w,r,A,p,l,m,d,h,e,f))}};Sd=(t,i,e,s,n,r,h)=>{this.pd[i][e][s]||(this.pd[i][e][s]=new rt(i,e,s));const o=this.pd[i][e][s];o&&(o.Ka=new dt(n,128*e+64,128*s+64,t,r,h))};xd=(t,i,e)=>{const s=this.pd[t][i][e];s&&(s.Ka=null)};Md=(t,i,e,s,n,r,h,o)=>{let l=0;const a=this.pd[s][t][i];if(a)for(let t=0;tl&&(l=e)}else this.pd[s][t][i]=new rt(s,t,i);const c=this.pd[s][t][i];c&&(c.Xa=new mt(e,128*t+64,128*i+64,r,h,o,n,l))};kd=(t,i,e)=>{const s=this.pd[t][i][e];s&&(s.Xa=null)};vf=(t,i,e,s,n,r,h,o,l,a)=>{if(!h&&!o)return;for(let s=t;s>=0;s--)this.pd[s][i][e]||(this.pd[s][i][e]=new rt(s,i,e));const c=this.pd[t][i][e];c&&(c.Ha=new wt(s,128*i+64,128*e+64,n,r,h,o,l,a))};Lf=(t,i,e,s)=>{const n=this.pd[t][i][e];1===s&&n&&(n.Ha=null)};Dd=(t,i,e,s,n,r,h,o,l,a,c)=>{if(!o)return;for(let s=t;s>=0;s--)this.pd[s][i][e]||(this.pd[s][i][e]=new rt(s,i,e));const f=this.pd[t][i][e];f&&(f.Va=new yt(s,128*i+n+64,128*e+r+64,c,a,o,h,l))};Nd=(t,i,e)=>{const s=this.pd[t][i][e];s&&(s.Va=null)};Fd=(t,i,e,s)=>{const n=this.pd[t][i][e];if(!n)return;const r=n.Va;if(!r)return;const h=128*i+64,o=128*e+64;r.x=h+((r.x-h)*s/16|0),r.z=o+((r.z-o)*s/16|0)};Bd=(t,i,e,s)=>{if(!s)return;const n=this.pd[t][i][e];if(!n)return;const r=n.Va;r&&(r.model=s)};Ud=(t,i,e,s)=>{if(!s)return;const n=this.pd[t][i][e];if(!n)return;const r=n.Ka;r&&(r.model=s)};Pd=(t,i,e,s)=>{if(!s)return;const n=this.pd[t][i][e];if(!n)return;const r=n.Ha;r&&(r.Nf=s)};Gd=(t,i,e,s,n)=>{if(!s)return;const r=this.pd[e][t][i];if(!r)return;const h=r.Ha;h&&(h.Nf=s,h.Ff=n)};Rf=(t,i,e,s,n,r,h,o,l,a,c)=>{if(!n&&!r)return!0;const f=128*i+64*l,u=128*e+64*a;return this.Wd(f,u,s,t,i,e,l,a,n,r,h,o,c,!1)};Yd=(t,i,e,s,n,r,h,o,l,a)=>{if(!n&&!r)return!0;let c=i-l,f=s-l,u=i+l,d=s+l;return a&&(o>640&&o<1408&&(d+=128),o>1152&&o<1920&&(u+=128),(o>1664||o<384)&&(f-=128),o>128&&o<896&&(c-=128)),c=c/128|0,f=f/128|0,u=u/128|0,d=d/128|0,this.Wd(i,s,e,t,c,f,u+1-c,d-f+1,n,r,h,0,o,!0)};Hd=(t,i,e,s,n,r,h,o,l,a,c,f)=>!l&&!a||this.Wd(i,s,e,t,n,r,h+1-n,o-r+1,l,a,c,0,f,!0);Of=(t,i,e)=>{const s=this.pd[t][i][e];if(s)for(let t=0;t>29&3)&&n.Ma===i&&n.Da===e)return void this.Vd(n)}};Kd=(t,i,e,s)=>{if(!s)return;const n=this.pd[t][i][e];if(n)for(let t=0;t>29&3))return void(i.model=s)}};Xd=()=>{for(let t=0;t{const s=this.pd[t][i][e];return s&&s.Ha?s.Ha.Fa:0};zd=(t,i,e)=>{const s=this.pd[t][e][i];return s&&s.Va?s.Va.Fa:0};Zd=(t,i,e)=>{const s=this.pd[t][i][e];if(!s)return 0;for(let t=0;t>29&3)&&n.Ma===i&&n.Da===e)return n.Fa}return 0};qd=(t,i,e)=>{const s=this.pd[t][i][e];return s&&s.Ka?s.Ka.Fa:0};Jd=(t,i,e,s)=>{const n=this.pd[t][i][e];if(n){if(n.Ha&&n.Ha.Fa===s)return 255&n.Ha.info;if(n.Va&&n.Va.Fa===s)return 255&n.Va.info;if(n.Ka&&n.Ka.Fa===s)return 255&n.Ka.info;for(let t=0;t{const r=i*(0|Math.sqrt(e*e+s*s+n*n))>>8;for(let i=0;i{if(i0){const n=this.pd[t][i+1][e-1];n&&n.Ka&&n.Ka.model&&n.Ka.model.yr&&this.tw(s,n.Ka.model,128,0,-128,!0)}};Qd=(t,i,e,s,n,r)=>{let h=!0,o=i;const l=i+s,a=e-1,c=e+n;for(let f=t;f<=t+1;f++)if(f!==this.md){for(let u=o;u<=l;u++)if(!(u<0||u>=this.sc))for(let o=a;o<=c;o++){if(o<0||o>=this.rc||h&&u=e||u===i))continue;const a=this.pd[f][u][o];if(!a)continue;const d=128*(u-i)+64*(1-s),w=128*(o-e)+64*(1-n),y=((this.Ad[f][u][o]+this.Ad[f][u+1][o]+this.Ad[f][u][o+1]+this.Ad[f][u+1][o+1])/4|0)-((this.Ad[t][i][e]+this.Ad[t][i+1][e]+this.Ad[t][i][e+1]+this.Ad[t][i+1][e+1])/4|0),m=a.Ha;m&&m.Nf&&m.Nf.yr&&this.tw(r,m.Nf,d,y,w,h),m&&m.Ff&&m.Ff.yr&&this.tw(r,m.Ff,d,y,w,h);for(let t=0;t{this.bd++;let h=0;const o=i.Ar,l=i.rn;if(t.yr&&t.mr)for(let r=0;ri.Dr)continue;const u=t.Ar[r]-e;if(ui.Lr)continue;const d=t.pr[r]-n;if(di.Mr)continue;if(i.yr&&i.mr)for(let t=0;t{const h=this.pd[t][i][e];if(!h)return;const o=h.Wa;if(o){const t=o.color;if(0!==t)for(let i=0;i<4;i++)s[n]=t,s[n+1]=t,s[n+2]=t,s[n+3]=t,n+=r;return}const l=h.Ya;if(!l)return;const a=l.shape,c=l.angle,f=l.au,u=l.cu,d=It.od[a],w=It.ld[c];let y=0;if(0===f)for(let t=0;t<4;t++)0!==d[w[y++]]&&(s[n]=u),0!==d[w[y++]]&&(s[n+1]=u),0!==d[w[y++]]&&(s[n+2]=u),0!==d[w[y++]]&&(s[n+3]=u),n+=r;else for(let t=0;t<4;t++)s[n]=0===d[w[y++]]?f:u,s[n+1]=0===d[w[y++]]?f:u,s[n+2]=0===d[w[y++]]?f:u,s[n+3]=0===d[w[y++]]?f:u,n+=r};click=(t,i)=>{It.ju=!0,It.Xe=t,It.je=i,It.ud=-1,It.dd=-1};draw=(t,i,e,s,n,r,h)=>{t<0?t=0:t>=128*this.sc&&(t=128*this.sc-1),e<0?e=0:e>=128*this.rc&&(e=128*this.rc-1),It.Yi++,It.Mu=N.sin[r],It.ku=N.cos[r],It.Du=N.sin[n],It.Nu=N.cos[n],It.zu=It.Iu[(r-128)/32|0][n/64|0],It.Fu=t,It.Bu=i,It.Uu=e,It.Pu=t/128|0,It.Gu=e/128|0,It.Ku=s,It.Wu=It.Pu-25,It.Wu<0&&(It.Wu=0),It.Hu=It.Gu-25,It.Hu<0&&(It.Hu=0),It.Yu=It.Pu+25,It.Yu>this.sc&&(It.Yu=this.sc),It.Vu=It.Gu+25,It.Vu>this.rc&&(It.Vu=this.rc),this.sw(),It.Xu=0;for(let t=this.Td;t=2e3)?(h.visible=!0,h.update=!0,h.Ja=h.za>0,It.Xu++):(h.visible=!1,h.update=!1,h.$a=0))}}for(let t=this.Td;t=It.Yu))for(let t=-25;t<=0;t++){const n=It.Gu+t,r=It.Gu-t;let o;if(e>=It.Wu&&(n>=It.Hu&&(o=i[e][n],o&&o.visible&&this.nw(o,!0,h)),r=It.Hu&&(o=i[s][n],o&&o.visible&&this.nw(o,!0,h)),r=It.Yu))for(let t=-25;t<=0;t++){const n=It.Gu+t,r=It.Gu-t;let o;if(e>=It.Wu&&(n>=It.Hu&&(o=i[e][n],o&&o.visible&&this.nw(o,!1,h)),r=It.Hu&&(o=i[s][n],o&&o.visible&&this.nw(o,!1,h)),r{if(!l&&!a)return!1;for(let t=n;t=this.sc||i>=this.rc)return!1;const e=this.pd[s][t][i];if(e&&e.za>=5)return!1}const w=new nt(s,e,t,i,l,a,u,n,n+h-1,r,r+o-1,c,f);for(let t=n;tn&&(e|=1),tr&&(e+=8),i=0;e--)this.pd[e][t][i]||(this.pd[e][t][i]=new rt(e,t,i));const l=this.pd[s][t][i];l&&(l.Pa[l.za]=w,l.Ga[l.za]=e,l.Za|=e,l.za++)}return d&&(this._d[this.Ed++]=w),!0};Vd=t=>{for(let i=t.Ma;i<=t.ka;i++)for(let e=t.Da;e<=t.Na;e++){const s=this.pd[t.level][i][e];if(s){for(let i=0;i{const t=It.Cu[It.Ku],i=It.Eu[It.Ku];It.fd=0;for(let e=0;e=0&&s<=50){n=t.nc+25-It.Gu,n<0&&(n=0),r=t.rc+25-It.Gu,r>50&&(r=50);let i=!1;for(;n<=r;)if(It.zu&&It.zu[s][n++]){i=!0;break}if(i){if(h=It.Fu-t.vr,h>32)t.mode=1;else{if(h>=-32)continue;t.mode=2,h=-h}t.lc=(t.Sr-It.Uu<<8)/h|0,t.ac=(t.Mr-It.Uu<<8)/h|0,t.cc=(t.Dr-It.Bu<<8)/h|0,t.fc=(t.Nr-It.Bu<<8)/h|0,It.Tu[It.fd++]=t}}}else if(2===t.type){if(s=t.nc+25-It.Gu,s>=0&&s<=50){n=t.ec+25-It.Pu,n<0&&(n=0),r=t.sc+25-It.Pu,r>50&&(r=50);let i=!1;for(;n<=r;)if(It.zu&&It.zu[n++][s]){i=!0;break}if(i){if(h=It.Uu-t.Sr,h>32)t.mode=3;else{if(h>=-32)continue;t.mode=4,h=-h}t.hc=(t.vr-It.Fu<<8)/h|0,t.oc=(t.Lr-It.Fu<<8)/h|0,t.cc=(t.Dr-It.Bu<<8)/h|0,t.fc=(t.Nr-It.Bu<<8)/h|0,It.Tu[It.fd++]=t}}}else if(4===t.type&&(s=t.Dr-It.Bu,s>128&&(n=t.nc+25-It.Gu,n<0&&(n=0),r=t.rc+25-It.Gu,r>50&&(r=50),n<=r))){let i=t.ec+25-It.Pu;i<0&&(i=0),h=t.sc+25-It.Pu,h>50&&(h=50);let e=!1;t:for(let t=i;t<=h;t++)for(let i=n;i<=r;i++)if(It.zu&&It.zu[t][i]){e=!0;break t}e&&(t.mode=5,t.hc=(t.vr-It.Fu<<8)/s|0,t.oc=(t.Lr-It.Fu<<8)/s|0,t.lc=(t.Sr-It.Uu<<8)/s|0,t.ac=(t.Mr-It.Uu<<8)/s|0,It.Tu[It.fd++]=t)}}};nw=(t,i,e)=>{for(It.bu.Mt(t);;){let t;do{if(t=It.bu.Dt(),!t)return}while(!t.update);const s=t.x,n=t.z,r=t.level,h=t.Ua,o=this.pd[r];if(t.visible){if(i){if(r>0){const t=this.pd[r-1][s][n];if(t&&t.update)continue}if(s<=It.Pu&&s>It.Wu){const i=o[s-1][n];if(i&&i.update&&(i.visible||!(1&t.Za)))continue}if(s>=It.Pu&&sIt.Hu){const i=o[s][n-1];if(i&&i.update&&(i.visible||!(8&t.Za)))continue}if(n>=It.Gu&&nn&&(a+=6),c=It.Zu[a],t.ic=It.Ju[a]),f&&(f.kf&It.qu[a]?16===f.kf?(t.$a=3,t.Qa=It.$u[a],t.tc=3-t.Qa):32===f.kf?(t.$a=6,t.Qa=It.Qu[a],t.tc=6-t.Qa):64===f.kf?(t.$a=12,t.Qa=It.td[a],t.tc=12-t.Qa):(t.$a=9,t.Qa=It.ed[a],t.tc=9-t.Qa):t.$a=0,f.kf&c&&!this.lw(h,s,n,f.kf)&&f.Nf?.draw(0,It.Mu,It.ku,It.Du,It.Nu,f.x-It.Fu,f.y-It.Bu,f.z-It.Uu,f.Fa),f.Df&c&&!this.lw(h,s,n,f.Df)&&f.Ff?.draw(0,It.Mu,It.ku,It.Du,It.Nu,f.x-It.Fu,f.y-It.Bu,f.z-It.Uu,f.Fa)),u&&!this.visible(h,s,n,u.model.Nr))if(u.type&c)u.model.draw(u.angle,It.Mu,It.ku,It.Du,It.Nu,u.x-It.Fu,u.y-It.Bu,u.z-It.Uu,u.Fa);else if(768&u.type){const t=u.x-It.Fu,i=u.y-It.Bu,e=u.z-It.Uu,s=u.angle;let n,r;if(n=s===lt.Kc||s===lt.Xc?-t:t,r=s===lt.Xc||s===lt.jc?-e:e,256&u.type&&rn){const n=t+It.rd[s],r=e+It.hd[s];u.model.draw(512*s+1280&2047,It.Mu,It.ku,It.Du,It.Nu,n,i,r,u.Fa)}}if(l){const i=t.Ka;i&&i.model?.draw(0,It.Mu,It.ku,It.Du,It.Nu,i.x-It.Fu,i.y-It.Bu,i.z-It.Uu,i.Fa);const e=t.Xa;e&&0===e.offset&&(e.Pf&&e.Pf.draw(0,It.Mu,It.ku,It.Du,It.Nu,e.x-It.Fu,e.y-It.Bu,e.z-It.Uu,e.Fa),e.Uf&&e.Uf.draw(0,It.Mu,It.ku,It.Du,It.Nu,e.x-It.Fu,e.y-It.Bu,e.z-It.Uu,e.Fa),e.Bf&&e.Bf.draw(0,It.Mu,It.ku,It.Du,It.Nu,e.x-It.Fu,e.y-It.Bu,e.z-It.Uu,e.Fa))}const d=t.Za;if(0!==d){if(sIt.Pu&&1&d){const t=o[s-1][n];t&&t.update&&It.bu.Mt(t)}if(n>It.Gu&&8&d){const t=o[s][n-1];t&&t.update&&It.bu.Mt(t)}}}if(0!==t.$a){let i=!0;for(let e=0;ei.Ma&&(r+=1),ei.Da&&(r+=8),ss&&(s=n);const h=It.Gu-i.Da,l=i.Na-It.Gu;i.Ba=l>h?s+l:s+h}for(;;){let t=-50,i=-1;for(let e=0;et&&(t=s.Ba,i=e))}if(-1===i)break;const l=It.gu[i];if(l){l.Yi=It.Yi;let t=l.model;t||(t=l.Sa?.draw(e)??null),t&&!this.aw(h,l.Ma,l.ka,l.Da,l.Na,t.Nr)&&t.draw(l.xa,It.Mu,It.ku,It.Du,It.Nu,l.x-It.Fu,l.y-It.Bu,l.z-It.Uu,l.Fa);for(let t=l.Ma;t<=l.ka;t++)for(let i=l.Da;i<=l.Na;i++){const e=o[t][i];e&&(0!==e.$a?It.bu.Mt(e):t===s&&i===n||!e.update||It.bu.Mt(e))}}}if(t.Ja)continue}if(!t.update||0!==t.$a)continue;if(s<=It.Pu&&s>It.Wu){const t=o[s-1][n];if(t&&t.update)continue}if(s>=It.Pu&&sIt.Hu){const t=o[s][n-1];if(t&&t.update)continue}if(n>=It.Gu&&n=r){const r=t+It.sd[n],h=s+It.nd[n];i.model.draw(512*n+256,It.Mu,It.ku,It.Du,It.Nu,r,e,h,i.Fa)}if(512&i.type&&h<=r){const r=t+It.rd[n],h=s+It.hd[n];i.model.draw(512*n+1280&2047,It.Mu,It.ku,It.Du,It.Nu,r,e,h,i.Fa)}}const e=t.Ha;e&&(e.Df&t.ic&&!this.lw(h,s,n,e.Df)&&e.Ff?.draw(0,It.Mu,It.ku,It.Du,It.Nu,e.x-It.Fu,e.y-It.Bu,e.z-It.Uu,e.Fa),e.kf&t.ic&&!this.lw(h,s,n,e.kf)&&e.Nf?.draw(0,It.Mu,It.ku,It.Du,It.Nu,e.x-It.Fu,e.y-It.Bu,e.z-It.Uu,e.Fa))}if(rIt.Pu){const t=o[s-1][n];t&&t.update&&It.bu.Mt(t)}if(n>It.Gu){const t=o[s][n-1];t&&t.update&&It.bu.Mt(t)}}};hw=(t,i,e,s,n,r,h,o)=>{let l,a,c,f,u=l=(e<<7)-It.Fu,d=a=(s<<7)-It.Uu,w=c=u+128,y=f=d+128,A=this.Ad[i][e][s]-It.Bu,p=this.Ad[i][e+1][s]-It.Bu,_=this.Ad[i][e+1][s+1]-It.Bu,I=this.Ad[i][e][s+1]-It.Bu,g=d*h+u*o>>16;if(d=d*o-u*h>>16,u=g,g=A*r-d*n>>16,d=A*n+d*r>>16,A=g,d<50)return;if(g=a*h+w*o>>16,a=a*o-w*h>>16,w=g,g=p*r-a*n>>16,a=p*n+a*r>>16,p=g,a<50)return;if(g=y*h+c*o>>16,y=y*o-c*h>>16,c=g,g=_*r-y*n>>16,y=_*n+y*r>>16,_=g,y<50)return;if(g=f*h+l*o>>16,f=f*o-l*h>>16,l=g,g=I*r-f*n>>16,f=I*n+f*r>>16,I=g,f<50)return;const C=N.Ni+((u<<9)/d|0),E=N.Fi+((A<<9)/d|0),T=N.Ni+((w<<9)/a|0),b=N.Fi+((p<<9)/a|0),R=N.Ni+((c<<9)/y|0),O=N.Fi+((_<<9)/y|0),v=N.Ni+((l<<9)/f|0),L=N.Fi+((I<<9)/f|0);if(N.alpha=0,(R-v)*(b-L)-(O-L)*(T-v)>0)if(N.Ui=R<0||v<0||T<0||R>m.wt||v>m.wt||T>m.wt,It.ju&&this.cw(It.Xe,It.je,O,L,b,R,v,T)&&(It.ud=e,It.dd=s),-1===t.Vf)12345678!==t.Yf&&N.ne(R,v,T,O,L,b,t.Yf,t.Hf,t.Wf);else if(It.Li){const i=It.ad[t.Vf];N.ne(R,v,T,O,L,b,this.fw(i,t.Yf),this.fw(i,t.Hf),this.fw(i,t.Wf))}else t.flat?N.le(R,v,T,O,L,b,t.Yf,t.Hf,t.Wf,u,A,d,w,l,p,I,a,f,t.Vf):N.le(R,v,T,O,L,b,t.Yf,t.Hf,t.Wf,c,_,y,l,w,I,p,f,a,t.Vf);if(!((C-T)*(L-b)-(E-b)*(v-T)<=0))if(N.Ui=C<0||T<0||v<0||C>m.wt||T>m.wt||v>m.wt,It.ju&&this.cw(It.Xe,It.je,E,b,L,C,T,v)&&(It.ud=e,It.dd=s),-1!==t.Vf){if(!It.Li)return void N.le(C,T,v,E,b,L,t.Gf,t.Wf,t.Hf,u,A,d,w,l,p,I,a,f,t.Vf);const i=It.ad[t.Vf];N.ne(C,T,v,E,b,L,this.fw(i,t.Gf),this.fw(i,t.Wf),this.fw(i,t.Hf))}else 12345678!==t.Gf&&N.ne(C,T,v,E,b,L,t.Gf,t.Wf,t.Hf)};ow=(t,i,e,s,n,r,h)=>{let o=e.Ar.length;for(let t=0;t>16;if(l=l*h-i*r>>16,i=a,a=o*n-l*s>>16,l=o*s+l*n>>16,o=a,l<50)return;e.lu&&(pt.jf[t]=i,pt.zf[t]=o,pt.Zf[t]=l),pt.Kf[t]=N.Ni+((i<<9)/l|0),pt.Xf[t]=N.Fi+((o<<9)/l|0)}N.alpha=0,o=e.ru.length;for(let s=0;s0)if(N.Ui=o<0||l<0||a<0||o>m.wt||l>m.wt||a>m.wt,It.ju&&this.cw(It.Xe,It.je,c,f,u,o,l,a)&&(It.ud=t,It.dd=i),e.lu&&-1!==e.lu[s])if(It.Li){const t=It.ad[e.lu[s]];N.ne(o,l,a,c,f,u,this.fw(t,e.eu[s]),this.fw(t,e.su[s]),this.fw(t,e.nu[s]))}else e.flat?N.le(o,l,a,c,f,u,e.eu[s],e.su[s],e.nu[s],pt.jf[0],pt.zf[0],pt.Zf[0],pt.jf[1],pt.jf[3],pt.zf[1],pt.zf[3],pt.Zf[1],pt.Zf[3],e.lu[s]):N.le(o,l,a,c,f,u,e.eu[s],e.su[s],e.nu[s],pt.jf[n],pt.zf[n],pt.Zf[n],pt.jf[r],pt.jf[h],pt.zf[r],pt.zf[h],pt.Zf[r],pt.Zf[h],e.lu[s]);else 12345678!==e.eu[s]&&N.ne(o,l,a,c,f,u,e.eu[s],e.su[s],e.nu[s])}};rw=(t,i,e)=>{const s=this.Id[t][i][e];if(s===-It.Yi)return!1;if(s===It.Yi)return!0;{const s=i<<7,n=e<<7;return this.uw(s+1,this.Ad[t][i][e],n+1)&&this.uw(s+128-1,this.Ad[t][i+1][e],n+1)&&this.uw(s+128-1,this.Ad[t][i+1][e+1],n+128-1)&&this.uw(s+1,this.Ad[t][i][e+1],n+128-1)?(this.Id[t][i][e]=It.Yi,!0):(this.Id[t][i][e]=-It.Yi,!1)}};lw=(t,i,e,s)=>{if(!this.rw(t,i,e))return!1;const n=i<<7,r=e<<7,h=this.Ad[t][i][e]-1,o=h-120,l=h-230,a=h-238;if(s<16){if(1===s){if(n>It.Fu){if(!this.uw(n,h,r))return!1;if(!this.uw(n,h,r+128))return!1}if(t>0){if(!this.uw(n,o,r))return!1;if(!this.uw(n,o,r+128))return!1}return!!this.uw(n,l,r)&&this.uw(n,l,r+128)}if(2===s){if(r0){if(!this.uw(n,o,r+128))return!1;if(!this.uw(n+128,o,r+128))return!1}return!!this.uw(n,l,r+128)&&this.uw(n+128,l,r+128)}if(4===s){if(n0){if(!this.uw(n+128,o,r))return!1;if(!this.uw(n+128,o,r+128))return!1}return!!this.uw(n+128,l,r)&&this.uw(n+128,l,r+128)}if(8===s){if(r>It.Uu){if(!this.uw(n,h,r))return!1;if(!this.uw(n+128,h,r))return!1}if(t>0){if(!this.uw(n,o,r))return!1;if(!this.uw(n+128,o,r))return!1}return!!this.uw(n,l,r)&&this.uw(n+128,l,r)}}return!!this.uw(n+64,a,r+64)&&(16===s?this.uw(n,l,r+128):32===s?this.uw(n+128,l,r+128):64===s?this.uw(n+128,l,r):128===s?this.uw(n,l,r):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,i,e,s)=>{if(this.rw(t,i,e)){const n=i<<7,r=e<<7;return this.uw(n+1,this.Ad[t][i][e]-s,r+1)&&this.uw(n+128-1,this.Ad[t][i+1][e]-s,r+1)&&this.uw(n+128-1,this.Ad[t][i+1][e+1]-s,r+128-1)&&this.uw(n+1,this.Ad[t][i][e+1]-s,r+128-1)}return!1};aw=(t,i,e,s,n,r)=>{let h,o;if(i!==e||s!==n){for(h=i;h<=e;h++)for(o=s;o<=n;o++)if(this.Id[t][h][o]===-It.Yi)return!1;o=1+(i<<7);const l=2+(s<<7),a=this.Ad[t][i][s]-r;if(!this.uw(o,a,l))return!1;const c=(e<<7)-1;if(!this.uw(c,a,l))return!1;const f=(n<<7)-1;return!!this.uw(o,a,f)&&this.uw(c,a,f)}return!!this.rw(t,i,s)&&(h=i<<7,o=s<<7,this.uw(h+1,this.Ad[t][i][s]-r,o+1)&&this.uw(h+128-1,this.Ad[t][i+1][s]-r,o+1)&&this.uw(h+128-1,this.Ad[t][i+1][s+1]-r,o+128-1)&&this.uw(h+1,this.Ad[t][i][s+1]-r,o+128-1))};uw=(t,i,e)=>{for(let s=0;s0){const t=n.Sr+(n.lc*s>>8),r=n.Mr+(n.ac*s>>8),h=n.Dr+(n.cc*s>>8),o=n.Nr+(n.fc*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(2===n.mode){const s=t-n.vr;if(s>0){const t=n.Sr+(n.lc*s>>8),r=n.Mr+(n.ac*s>>8),h=n.Dr+(n.cc*s>>8),o=n.Nr+(n.fc*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(3===n.mode){const s=n.Sr-e;if(s>0){const e=n.vr+(n.hc*s>>8),r=n.Lr+(n.oc*s>>8),h=n.Dr+(n.cc*s>>8),o=n.Nr+(n.fc*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(4===n.mode){const s=e-n.Sr;if(s>0){const e=n.vr+(n.hc*s>>8),r=n.Lr+(n.oc*s>>8),h=n.Dr+(n.cc*s>>8),o=n.Nr+(n.fc*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(5===n.mode){const s=i-n.Dr;if(s>0){const i=n.vr+(n.hc*s>>8),r=n.Lr+(n.oc*s>>8),h=n.Sr+(n.lc*s>>8),o=n.Mr+(n.ac*s>>8);if(t>=i&&t<=r&&e>=h&&e<=o)return!0}}}return!1};cw=(t,i,e,s,n,r,h,o)=>{if(ie&&i>s&&i>n)return!1;if(tr&&t>h&&t>o)return!1;const l=(i-s)*(o-h)-(t-h)*(n-s);return((i-e)*(h-r)-(t-r)*(s-e))*l>0&&l*((i-n)*(r-o)-(t-o)*(e-n))>0};fw=(t,i)=>((i=(127-i)*(127&t)/160|0)<2?i=2:i>126&&(i=126),(65408&t)+i)}class gt{id;dw=null;constructor(t){this.id=t}ww(t){for(;;){const i=t.Zt;if(0===i)break;this.decode(i,t)}return this}}class Ct extends gt{static count=0;static tn=[];static en=t=>{const i=new R(t.read('flo.dat'));this.count=i.Jt;for(let t=0;t(e>179&&(i=i/2|0),e>192&&(i=i/2|0),e>217&&(i=i/2|0),e>243&&(i=i/2|0),(t/4<<10)+(i/32<<7)+(e/2|0));static mw=(t,i)=>-1===t?12345678:((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);static Aw=(t,i)=>-2===t?12345678:-1===t?(i<0?i=0:i>127&&(i=127),127-i):((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);pw=0;texture=-1;_w=!1;Iw=!0;gw=0;Cw=0;Ew=0;Tw=0;bw=0;Rw=0;decode(t,i){1===t?(this.pw=i.Qt,this.setColor(this.pw)):2===t?this.texture=i.Zt:3===t?this._w=!0:5===t?this.Iw=!1:6===t?this.dw=i.ni:console.log('Error unrecognised config code: ',t)}setColor(t){const i=(t>>16&255)/256,e=(t>>8&255)/256,s=(255&t)/256;let n=i;ei&&(r=e),s>r&&(r=s);let h=0,o=0;const l=(n+r)/2;n!==r&&(l<.5&&(o=(r-n)/(r+n)),l>=.5&&(o=(r-n)/(2-r-n)),i===r?h=(e-s)/(r-n):e===r?h=(s-i)/(r-n)+2:s===r&&(h=(i-e)/(r-n)+4)),h/=6,this.gw=256*h|0,this.Cw=256*o|0,this.Ew=256*l|0,this.Cw<0?this.Cw=0:this.Cw>255&&(this.Cw=255),this.Ew<0?this.Ew=0:this.Ew>255&&(this.Ew=255),this.Tw=l>.5?(1-l)*o*512|0:l*o*512|0,this.Tw<1&&(this.Tw=1),this.bw=h*this.Tw|0;let a=this.gw+(16*Math.random()|0)-8;a<0?a=0:a>255&&(a=255);let c=this.Cw+(48*Math.random()|0)-24;c<0?c=0:c>255&&(c=255);let f=this.Ew+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255),this.Rw=Ct.yw(a,c,f)}}class Et extends gt{static count=0;static cache=null;static Zs=null;static Ow=null;static Lw=0;static Sw=new q(500);static xw=new q(30);static en=t=>{this.Zs=new R(t.read('loc.dat'));const i=new R(t.read('loc.idx'));this.count=i.Jt,this.Ow=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.Ow||!this.Zs)throw new Error('LocType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Lw=(this.Lw+1)%10;const i=this.cache[this.Lw];return this.Zs.Xt=this.Ow[t],i.id=t,i.reset(),i.ww(this.Zs),i.Mw||(i.Mw=new Int32Array(1)),-1===i.kw&&i.Mw&&(i.active=i.Mw.length>0&&i.Mw[0]===ct.af.id,i.Dw&&(i.active=!0)),i};static zi=()=>{this.Sw=null,this.xw=null,this.Ow=null,this.cache=null,this.Zs=null};Nw=null;Mw=null;name=null;Fw=null;Bw=null;Uw=null;width=1;length=1;Pw=!0;Gw=!0;active=!1;kw=-1;Ww=!1;Yw=!1;Iw=!1;Gl=-1;Hw=!1;Vw=16;Kw=0;Xw=0;Dw=null;jw=-1;zw=-1;Zw=!1;qw=!0;Jw=128;$w=128;Qw=128;ty=0;iy=0;ey=0;sy=0;ny=!1;decode(t,i){if(1===t){const t=i.Zt;this.Nw=new Int32Array(t),this.Mw=new Int32Array(t);for(let e=0;e=30&&t<39)this.Dw||(this.Dw=new v(5,null)),this.Dw[t-30]=i.ni,'hidden'===this.Dw[t-30]?.toLowerCase()&&(this.Dw[t-30]=null);else if(40===t){const t=i.Zt;this.Bw=new Uint16Array(t),this.Uw=new Uint16Array(t);for(let e=0;e=this.Nw.length)return null;let c=this.Nw[o];if(-1===c)return null;const f=this.Zw!==i>3;f&&(c+=65536);let u=Et.Sw?.get(BigInt(c));u||(u=j.model(65535&c),f&&u.hh(),Et.Sw?.put(BigInt(c),u));const d=128!==this.Jw||128!==this.$w||128!==this.Qw,w=0!==this.iy||0!==this.ey||0!==this.sy;let y=j.Ur(u,!this.Bw,!this.Hw,i===lt.Vc&&-1===h&&!d&&!w);for(-1!==h&&(y.Qr(),y.eh(h),y.Hr=null,y.Yr=null);i-- >0;)y.sh();if(this.Bw&&this.Uw)for(let t=0;t{const i=new R(t.read('seq.dat'));this.count=i.Jt;for(let t=0;t{let e=this.lA(t+45365,i+91923,4)+(this.lA(t+10294,i+37821,2)-128>>1)+(this.lA(t,i,1)-128>>2)-128;return e=35+(.3*e|0),e<10?e=10:e>60&&(e=60),e};static lA=(t,i,e)=>{const s=t/e|0,n=t&e-1,r=i/e|0,h=i&e-1,o=this.aA(s,r),l=this.aA(s+1,r),a=this.aA(s,r+1),c=this.aA(s+1,r+1),f=this.cA(o,l,n,e),u=this.cA(a,c,n,e);return this.cA(f,u,h,e)};static cA=(t,i,e,s)=>{const n=65536-N.cos[1024*e/s|0]>>1;return(t*(65536-n)>>16)+(i*n>>16)};static aA=(t,i)=>((this.fA(t-1,i-1)+this.fA(t+1,i-1)+this.fA(t-1,i+1)+this.fA(t+1,i+1))/16|0)+((this.fA(t-1,i)+this.fA(t+1,i)+this.fA(t,i-1)+this.fA(t,i+1))/8|0)+(this.fA(t,i)/4|0);static fA=(t,i)=>{const e=t+57*i,s=BigInt(e<<13^e);return 255&Number((s*(s*s*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static Rf=(t,i,e,s,n,r,h,o,l,a,c)=>{const f=n[c][i][e],u=n[c][i+1][e],d=n[c][i+1][e+1],w=n[c][i][e+1],y=f+u+d+w>>2,m=Et.get(o);let A=i+(e<<7)+(o<<14)+1073741824|0;m.active||(A+=-2147483648),A|=0;const p=(a<<6)+l<<24>>24;if(l===ct.Jc.id)s?.Sd(m.Ul(ct.Jc.id,a,f,u,d,w,-1),t,i,e,y,A,p),m.Pw&&m.active&&h?.Tf(i,e),-1!==m.Gl&&r.Mt(new Tt(o,t,3,i,e,bt.tn[m.Gl],!0));else if(l===ct.af.id||l===ct.cf.id){const n=m.Ul(ct.af.id,a,f,u,d,w,-1);if(n){let r,h,o=0;l===ct.cf.id&&(o+=256),a===lt.Kc||a===lt.jc?(r=m.length,h=m.width):(r=m.width,h=m.length),s?.Rf(t,i,e,y,n,null,A,p,r,h,o)}m.Pw&&h?.Rf(i,e,m.width,m.length,a,m.Gw),-1!==m.Gl&&r.Mt(new Tt(o,t,2,i,e,bt.tn[m.Gl],!0))}else if(l>=ct.ff.id)s?.Rf(t,i,e,y,m.Ul(l,a,f,u,d,w,-1),null,A,p,1,1,0),m.Pw&&h?.Rf(i,e,m.width,m.length,a,m.Gw),-1!==m.Gl&&r.Mt(new Tt(o,t,2,i,e,bt.tn[m.Gl],!0));else if(l===ct.$c.id)s?.vf(t,i,e,y,Ot.Qm[a],0,m.Ul(ct.$c.id,a,f,u,d,w,-1),null,A,p),m.Pw&&h?.vf(i,e,l,a,m.Gw),-1!==m.Gl&&r.Mt(new Tt(o,t,0,i,e,bt.tn[m.Gl],!0));else if(l===ct.Qc.id)s?.vf(t,i,e,y,Ot.tA[a],0,m.Ul(ct.Qc.id,a,f,u,d,w,-1),null,A,p),m.Pw&&h?.vf(i,e,l,a,m.Gw),-1!==m.Gl&&r.Mt(new Tt(o,t,0,i,e,bt.tn[m.Gl],!0));else if(l===ct.tf.id){const n=a+1&3;s?.vf(t,i,e,y,Ot.Qm[a],Ot.Qm[n],m.Ul(ct.tf.id,a+4,f,u,d,w,-1),m.Ul(ct.tf.id,n,f,u,d,w,-1),A,p),m.Pw&&h?.vf(i,e,l,a,m.Gw),-1!==m.Gl&&r.Mt(new Tt(o,t,0,i,e,bt.tn[m.Gl],!0))}else if(l===ct.if.id)s?.vf(t,i,e,y,Ot.tA[a],0,m.Ul(ct.if.id,a,f,u,d,w,-1),null,A,p),m.Pw&&h?.vf(i,e,l,a,m.Gw),-1!==m.Gl&&r.Mt(new Tt(o,t,0,i,e,bt.tn[m.Gl],!0));else if(l===ct.lf.id)s?.Rf(t,i,e,y,m.Ul(l,a,f,u,d,w,-1),null,A,p,1,1,0),m.Pw&&h?.Rf(i,e,m.width,m.length,a,m.Gw),-1!==m.Gl&&r.Mt(new Tt(o,t,2,i,e,bt.tn[m.Gl],!0));else if(l===ct.ef.id)s?.Dd(t,i,e,y,0,0,A,m.Ul(ct.ef.id,lt.Vc,f,u,d,w,-1),p,512*a,Ot.Qm[a]),-1!==m.Gl&&r.Mt(new Tt(o,t,1,i,e,bt.tn[m.Gl],!0));else if(l===ct.sf.id){let n=16;if(s){const r=s.jd(t,i,e);r>0&&(n=Et.get(r>>14&32767).Vw)}s?.Dd(t,i,e,y,Ot.iA[a]*n,Ot.eA[a]*n,A,m.Ul(ct.ef.id,lt.Vc,f,u,d,w,-1),p,512*a,Ot.Qm[a]),-1!==m.Gl&&r.Mt(new Tt(o,t,1,i,e,bt.tn[m.Gl],!0))}else l===ct.nf.id?(s?.Dd(t,i,e,y,0,0,A,m.Ul(ct.ef.id,lt.Vc,f,u,d,w,-1),p,a,256),-1!==m.Gl&&r.Mt(new Tt(o,t,1,i,e,bt.tn[m.Gl],!0))):l===ct.rf.id?(s?.Dd(t,i,e,y,0,0,A,m.Ul(ct.ef.id,lt.Vc,f,u,d,w,-1),p,a,512),-1!==m.Gl&&r.Mt(new Tt(o,t,1,i,e,bt.tn[m.Gl],!0))):l===ct.hf.id&&(s?.Dd(t,i,e,y,0,0,A,m.Ul(ct.ef.id,lt.Vc,f,u,d,w,-1),p,a,768),-1!==m.Gl&&r.Mt(new Tt(o,t,1,i,e,bt.tn[m.Gl],!0)))};sc;rc;uA;dA;wA;yA;mA;AA;pA;_A;IA;gA;CA;EA;TA;bA;constructor(t,i,e,s){this.sc=t,this.rc=i,this.uA=e,this.dA=s,this.wA=new M(ut.gf,t,i),this.yA=new M(ut.gf,t,i),this.mA=new M(ut.gf,t,i),this.AA=new M(ut.gf,t,i),this.bA=new D(ut.gf,t+1,i+1),this.pA=new M(ut.gf,t+1,i+1),this._A=new k(t+1,i+1),this.IA=new Int32Array(i),this.gA=new Int32Array(i),this.CA=new Int32Array(i),this.EA=new Int32Array(i),this.TA=new Int32Array(i)}RA=(t,i)=>{for(let t=0;t=0&&i[n]?.Tf(e,s)}Ot.sA+=(5*Math.random()|0)-2,Ot.sA<-8?Ot.sA=-8:Ot.sA>8&&(Ot.sA=8),Ot.nA+=(5*Math.random()|0)-2,Ot.nA<-16?Ot.nA=-16:Ot.nA>16&&(Ot.nA=16);for(let i=0;i>8;for(let t=1;t>2)+(e[l+1][t]>>3)+(e[l][t-1]>>2)+(e[l][t+1]>>3)+(e[l][t]>>1);this._A[l][t]=u-d}for(let t=0;t=0&&s0){const i=Ct.tn[e-1];this.IA[t]+=i.bw,this.gA[t]+=i.Cw,this.CA[t]+=i.Ew,this.EA[t]+=i.Tw,n=this.TA[t]++}}const r=e-5;if(r>=0&&r0){const i=Ct.tn[e-1];this.IA[t]-=i.bw,this.gA[t]-=i.Cw,this.CA[t]-=i.Ew,this.EA[t]-=i.Tw,n=this.TA[t]--}}}if(e>=1&&e=0&&a=0&&c=1&&l0||c>0){const f=this.uA[i][e][l],u=this.uA[i][e+1][l],d=this.uA[i][e+1][l+1],w=this.uA[i][e][l+1],y=this._A[e][l],m=this._A[e+1][l],A=this._A[e+1][l+1],p=this._A[e][l+1];let _=-1,I=-1;if(a>0){const t=256*s/h|0,i=n/o|0;let e=r/o|0;_=Ct.yw(t,i,e);const l=t+Ot.sA&255;e+=Ot.nA,e<0?e=0:e>255&&(e=255),I=Ct.yw(l,i,e)}if(i>0){let t=0!==a||this.mA[i][e][l]===_t.fu;c>0&&!Ct.tn[c-1].Iw&&(t=!1),t&&f===u&&f===d&&f===w&&(this.bA[i][e][l]|=2340)}let g=0;if(-1!==_&&(g=N.palette[Ct.mw(I,96)]),0===c)t?.Ld(i,e,l,_t.fu,lt.Vc,-1,f,u,d,w,Ct.mw(_,y),Ct.mw(_,m),Ct.mw(_,A),Ct.mw(_,p),Rt.Oy,Rt.Oy,Rt.Oy,Rt.Oy,g,Rt.Oy);else{const s=this.mA[i][e][l]+1,n=this.AA[i][e][l],r=Ct.tn[c-1];let h,o,a=r.texture;a>=0?(o=N.Qi(a),h=-1):r.pw===Rt.by?(o=0,h=-2,a=-1):(h=Ct.yw(r.gw,r.Cw,r.Ew),o=N.palette[Ct.Aw(r.Rw,96)]),t?.Ld(i,e,l,s,n,a,f,u,d,w,Ct.mw(_,y),Ct.mw(_,m),Ct.mw(_,A),Ct.mw(_,p),Ct.Aw(h,y),Ct.Aw(h,m),Ct.Aw(h,A),Ct.Aw(h,p),g,o)}}}}}}for(let e=1;e0&&(t<<=3,i<<=3,e<<=3);for(let n=0;n<=s;n++)for(let r=0;r<=this.rc;r++)for(let h=0;h<=this.sc;h++){if(this.bA[n][h][r]&t){let i=r,e=r,o=n,l=n;for(;i>0&&this.bA[n][h][i-1]&t;)i--;for(;e0;){for(let s=i;s<=e;s++)if(!(this.bA[o-1][h][s]&t))break t;o--}t:for(;l=8){const n=this.uA[l][h][i]-240,r=this.uA[o][h][i];It.yd(s,1,128*h,n,128*i,128*h,r,128*e+128);for(let s=o;s<=l;s++)for(let n=i;n<=e;n++)this.bA[s][h][n]&=~t}}if(this.bA[n][h][r]&i){let t=h,e=h,o=n,l=n;for(;t>0&&this.bA[n][t-1][r]&i;)t--;for(;e0;){for(let s=t;s<=e;s++)if(!(this.bA[o-1][s][r]&i))break t;o--}t:for(;l=8){const n=this.uA[l][t][r]-240,h=this.uA[o][t][r];It.yd(s,2,128*t,n,128*r,128*e+128,h,128*r);for(let s=o;s<=l;s++)for(let n=t;n<=e;n++)this.bA[s][n][r]&=~i}}if(this.bA[n][h][r]&e){let t=h,i=h,o=r,l=r;for(;o>0&&this.bA[n][h][o-1]&e;)o--;for(;l0;){for(let i=o;i<=l;i++)if(!(this.bA[n][t-1][i]&e))break t;t--}t:for(;i=4){const r=this.uA[n][t][o];It.yd(s,4,128*t,r,128*o,128*i+128,r,128*l+128);for(let s=t;s<=i;s++)for(let t=o;t<=l;t++)this.bA[n][s][t]&=~e}}}}}};vA=(t,i,e,s)=>{let n=0;for(let t=0;t>24;break}for(let r=t;r=0&&t=0&&r{const r=new R(new Uint8Array(n));for(let n=0;n=0&&l=0&&a>24,this.AA[n][l][a]=(c-2&3)<<24>>24):c<=81?this.dA[n][l][a]=c-49<<24>>24:this.wA[n][l][a]=c-81<<24>>24}else for(;c=r.Zt,0!==c;){if(1===c){r.Zt;break}c<=49&&r.Zt}}};SA=(t,i,e,s,n,r)=>{const h=new R(new Uint8Array(s));let o=-1;for(;;){const s=h.si;if(0===s)return;o+=s;let l=0;for(;;){const s=h.si;if(0===s)break;l+=s-1;const a=63&l,c=l>>6&63,f=l>>12,u=h.Zt,d=u>>2,w=3&u,y=c+n,m=a+r;if(y>0&&m>0&&y=0&&(n=e[s]),this.Rf(f,y,m,t,i,n,o,d,w)}}}};Rf=(t,i,e,s,n,r,h,o,l)=>{if(Ot.Li){if(16&this.dA[t][i][e])return;if(this.OA(t,i,e)!==Ot.rA)return}const a=this.uA[t][i][e],c=this.uA[t][i+1][e],f=this.uA[t][i+1][e+1],u=this.uA[t][i][e+1],d=a+c+f+u>>2,w=Et.get(h);let y=i+(e<<7)+(h<<14)+1073741824|0;w.active||(y+=-2147483648),y|=0;const m=(l<<6)+o<<24>>24;if(o===ct.Jc.id)(!Ot.Li||w.active||w.ny)&&(s?.Sd(w.Ul(ct.Jc.id,l,a,c,f,u,-1),t,i,e,d,y,m),w.Pw&&w.active&&r?.Tf(i,e),-1!==w.Gl&&n.Mt(new Tt(h,t,3,i,e,bt.tn[w.Gl],!0)));else if(o===ct.af.id||o===ct.cf.id){const A=w.Ul(ct.af.id,l,a,c,f,u,-1);if(A){let n,r,h=0;if(o===ct.cf.id&&(h+=256),l===lt.Kc||l===lt.jc?(n=w.length,r=w.width):(n=w.width,r=w.length),s?.Rf(t,i,e,d,A,null,y,m,n,r,h)&&w.qw)for(let s=0;s<=n;s++)for(let n=0;n<=r;n++){let r=A.kr/4|0;r>30&&(r=30),r>this.pA[t][i+s][e+n]&&(this.pA[t][i+s][e+n]=r<<24>>24)}}w.Pw&&r?.Rf(i,e,w.width,w.length,l,w.Gw),-1!==w.Gl&&n.Mt(new Tt(h,t,2,i,e,bt.tn[w.Gl],!0))}else if(o>=ct.ff.id)s?.Rf(t,i,e,d,w.Ul(o,l,a,c,f,u,-1),null,y,m,1,1,0),o>=ct.ff.id&&o<=ct.mf.id&&o!==ct.uf.id&&t>0&&(this.bA[t][i][e]|=2340),w.Pw&&r?.Rf(i,e,w.width,w.length,l,w.Gw),-1!==w.Gl&&n.Mt(new Tt(h,t,2,i,e,bt.tn[w.Gl],!0));else if(o===ct.$c.id)s?.vf(t,i,e,d,Ot.Qm[l],0,w.Ul(ct.$c.id,l,a,c,f,u,-1),null,y,m),l===lt.Vc?(w.qw&&(this.pA[t][i][e]=50,this.pA[t][i][e+1]=50),w.Iw&&(this.bA[t][i][e]|=585)):l===lt.Kc?(w.qw&&(this.pA[t][i][e+1]=50,this.pA[t][i+1][e+1]=50),w.Iw&&(this.bA[t][i][e+1]|=1170)):l===lt.Xc?(w.qw&&(this.pA[t][i+1][e]=50,this.pA[t][i+1][e+1]=50),w.Iw&&(this.bA[t][i+1][e]|=585)):l===lt.jc&&(w.qw&&(this.pA[t][i][e]=50,this.pA[t][i+1][e]=50),w.Iw&&(this.bA[t][i][e]|=1170)),w.Pw&&r?.vf(i,e,o,l,w.Gw),-1!==w.Gl&&n.Mt(new Tt(h,t,0,i,e,bt.tn[w.Gl],!0)),16!==w.Vw&&s?.Fd(t,i,e,w.Vw);else if(o===ct.Qc.id)s?.vf(t,i,e,d,Ot.tA[l],0,w.Ul(ct.Qc.id,l,a,c,f,u,-1),null,y,m),w.qw&&(l===lt.Vc?this.pA[t][i][e+1]=50:l===lt.Kc?this.pA[t][i+1][e+1]=50:l===lt.Xc?this.pA[t][i+1][e]=50:l===lt.jc&&(this.pA[t][i][e]=50)),w.Pw&&r?.vf(i,e,o,l,w.Gw),-1!==w.Gl&&n.Mt(new Tt(h,t,0,i,e,bt.tn[w.Gl],!0));else if(o===ct.tf.id){const A=l+1&3;s?.vf(t,i,e,d,Ot.Qm[l],Ot.Qm[A],w.Ul(ct.tf.id,l+4,a,c,f,u,-1),w.Ul(ct.tf.id,A,a,c,f,u,-1),y,m),w.Iw&&(l===lt.Vc?(this.bA[t][i][e]|=265,this.bA[t][i][e+1]|=1170):l===lt.Kc?(this.bA[t][i][e+1]|=1170,this.bA[t][i+1][e]|=585):l===lt.Xc?(this.bA[t][i+1][e]|=585,this.bA[t][i][e]|=1170):l===lt.jc&&(this.bA[t][i][e]|=1170,this.bA[t][i][e]|=585)),w.Pw&&r?.vf(i,e,o,l,w.Gw),-1!==w.Gl&&n.Mt(new Tt(h,t,0,i,e,bt.tn[w.Gl],!0)),16!==w.Vw&&s?.Fd(t,i,e,w.Vw)}else if(o===ct.if.id)s?.vf(t,i,e,d,Ot.tA[l],0,w.Ul(ct.if.id,l,a,c,f,u,-1),null,y,m),w.qw&&(l===lt.Vc?this.pA[t][i][e+1]=50:l===lt.Kc?this.pA[t][i+1][e+1]=50:l===lt.Xc?this.pA[t][i+1][e]=50:l===lt.jc&&(this.pA[t][i][e]=50)),w.Pw&&r?.vf(i,e,o,l,w.Gw),-1!==w.Gl&&n.Mt(new Tt(h,t,0,i,e,bt.tn[w.Gl],!0));else if(o===ct.lf.id)s?.Rf(t,i,e,d,w.Ul(o,l,a,c,f,u,-1),null,y,m,1,1,0),w.Pw&&r?.Rf(i,e,w.width,w.length,l,w.Gw),-1!==w.Gl&&n.Mt(new Tt(h,t,2,i,e,bt.tn[w.Gl],!0));else if(o===ct.ef.id)s?.Dd(t,i,e,d,0,0,y,w.Ul(ct.ef.id,lt.Vc,a,c,f,u,-1),m,512*l,Ot.Qm[l]),-1!==w.Gl&&n.Mt(new Tt(h,t,1,i,e,bt.tn[w.Gl],!0));else if(o===ct.sf.id){let r=16;if(s){const n=s.jd(t,i,e);n>0&&(r=Et.get(n>>14&32767).Vw)}s?.Dd(t,i,e,d,Ot.iA[l]*r,Ot.eA[l]*r,y,w.Ul(ct.ef.id,lt.Vc,a,c,f,u,-1),m,512*l,Ot.Qm[l]),-1!==w.Gl&&n.Mt(new Tt(h,t,1,i,e,bt.tn[w.Gl],!0))}else o===ct.nf.id?(s?.Dd(t,i,e,d,0,0,y,w.Ul(ct.ef.id,lt.Vc,a,c,f,u,-1),m,l,256),-1!==w.Gl&&n.Mt(new Tt(h,t,1,i,e,bt.tn[w.Gl],!0))):o===ct.rf.id?(s?.Dd(t,i,e,d,0,0,y,w.Ul(ct.ef.id,lt.Vc,a,c,f,u,-1),m,l,512),-1!==w.Gl&&n.Mt(new Tt(h,t,1,i,e,bt.tn[w.Gl],!0))):o===ct.hf.id&&(s?.Dd(t,i,e,d,0,0,y,w.Ul(ct.ef.id,lt.Vc,a,c,f,u,-1),m,l,768),-1!==w.Gl&&n.Mt(new Tt(h,t,1,i,e,bt.tn[w.Gl],!0)))};OA=(t,i,e)=>8&this.dA[t][i][e]?0:t<=0||!(2&this.dA[1][i][e])?t:t-1}class vt extends w{}class Lt extends vt{x=0;z=0;xa=0;xA=!1;size=1;MA=-1;kA=-1;DA=-1;NA=-1;FA=-1;BA=-1;UA=-1;PA=null;GA=100;WA=0;YA=0;HA=0;VA=0;KA=-1e3;XA=0;jA=0;zA=-1;ZA=0;qA=0;JA=-1;$A=0;QA=0;tp=-1;ip=0;ep=0;sp=0;np=0;rp=-1;hp=0;op=0;lp=0;ap=0;cp=0;fp=0;up=0;dp=0;wp=0;yp=0;mp=0;Yi=0;height=0;Ap=0;pathLength=0;pp=new Int32Array(10);_p=new Int32Array(10);Ip=new v(10,!1);gp=0;Cp=-1;Ep=-1;Tp=-1;bp=-1;move(t,i,e){if(-1!==this.tp&&bt.tn[this.tp].priority<=1&&(this.tp=-1),!t){const t=i-this.pp[0],s=e-this._p[0];if(t>=-8&&t<=8&&s>=-8&&s<=8){this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.pp[t]=this.pp[t-1],this._p[t]=this._p[t-1],this.Ip[t]=this.Ip[t-1];return this.pp[0]=i,this._p[0]=e,void(this.Ip[0]=!1)}}this.pathLength=0,this.gp=0,this.pp[0]=i,this._p[0]=e,this.x=128*this.pp[0]+64*this.size,this.z=128*this._p[0]+64*this.size}step(t,i){let e=this.pp[0],s=this._p[0];0===i?(e--,s++):1===i?s++:2===i?(e++,s++):3===i?e--:4===i?e++:5===i?(e--,s--):6===i?s--:7===i&&(e++,s--),-1!==this.tp&&bt.tn[this.tp].priority<=1&&(this.tp=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.pp[t]=this.pp[t-1],this._p[t]=this._p[t-1],this.Ip[t]=this.Ip[t-1];this.pp[0]=e,this._p[0]=s,this.Ip[0]=t}}class St extends gt{static count=0;static tn=[];static Gh=new q(30);static en=t=>{const i=new R(t.read('spotanim.dat'));this.count=i.Jt;for(let t=0;t=40&&t<50)this.Bw[t-40]=i.Jt;else{if(!(t>=50&&t<60))throw new Error(`Unrecognized spotanim config code: ${t}`);this.Uw[t-50]=i.Jt}}Ul(){let t=St.Gh?.get(BigInt(this.id));if(t)return t;t=j.model(this.model);for(let i=0;i<6;i++)0!==this.Bw[0]&&t.rh(this.Bw[i],this.Uw[i]);return St.Gh?.put(BigInt(this.id),t),t}}class xt extends gt{static count=0;static tn=[];static en=t=>{const i=new R(t.read('idk.dat'));this.count=i.Jt;for(let t=0;t=40&&t<50)this.Bw[t-40]=i.Jt;else if(t>=50&&t<60)this.Uw[t-50]=i.Jt;else{if(!(t>=60&&t<70))throw new Error(`Unrecognized idk config code: ${t}`);this.vp[t-60]=i.Jt}}Ul(){if(!this.Nw)return null;const t=new v(this.Nw.length,null);for(let i=0;i{this.Sp=i,this.Zs=new R(t.read('obj.dat'));const e=new R(t.read('obj.idx'));this.count=e.Jt,this.Ow=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.Ow||!this.Zs)throw new Error('ObjType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Lw=(this.Lw+1)%10;const i=this.cache[this.Lw];return this.Zs.Xt=this.Ow[t],i.id=t,i.reset(),i.ww(this.Zs),-1!==i.Mp&&i.kp(),!this.Sp&&i.members&&(i.name='Members Object',i.Fw="Login to a members' server to use this object.",i.Dw=null,i.Dp=null),i};static zi=()=>{this.Gh=null,this.xp=null,this.Ow=null,this.cache=null,this.Zs=null};static Np=(t,i)=>{if(Mt.xp){let e=Mt.xp.get(BigInt(t));if(e&&e.gi!==i&&-1!==e.gi&&(e.ht(),e=null),e)return e}let e=Mt.get(t);if(e.Fp||(i=-1),e.Fp&&e.Bp&&i>1){let t=-1;for(let s=0;s<10;s++)i>=e.Bp[s]&&0!==e.Bp[s]&&(t=e.Fp[s]);-1!==t&&(e=Mt.get(t))}const s=new J(32,32),n=N.Ni,r=N.Fi,h=N.Di,o=m.ft,l=m.ut,a=m.dt,c=m.left,f=m.right,u=m.top,d=m.bottom;N.Bi=!1,m.bind(s.ft,32,32),m.fillRect(0,0,32,32,Rt.Oy),N.Zi();const w=e.Up(1),y=N.sin[e.Pp]*e.Gp>>16,A=N.cos[e.Pp]*e.Gp>>16;w.fh(0,e.Wp,e.Yp,e.Pp,e.Hp,y+(w.Nr/2|0)+e.Vp,A+e.Vp);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.ft[t+32*i]&&(t>0&&s.ft[t+32*i-1]>1||i>0&&s.ft[t+32*(i-1)]>1||t<31&&s.ft[t+32*i+1]>1||i<31&&s.ft[t+32*(i+1)]>1)&&(s.ft[t+32*i]=1);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.ft[t+32*i]&&t>0&&i>0&&s.ft[t+32*(i-1)-1]>0&&(s.ft[t+32*i]=3153952);if(-1!==e.Mp){const t=this.Np(e.Kp,10),i=t.Ii,s=t.gi;t.Ii=32,t.gi=32,t.Oi(5,5,22,22),t.Ii=i,t.gi=s}return Mt.xp?.put(BigInt(t),s),m.bind(o,l,a),m._t(c,u,f,d),N.Ni=n,N.Fi=r,N.Di=h,N.Bi=!0,e.Xp?s.Ii=33:s.Ii=32,s.gi=i,s};model=0;name=null;Fw=null;Bw=null;Uw=null;Gp=2e3;Pp=0;Wp=0;Yp=0;Hp=0;Vp=0;jp=!1;zp=-1;Xp=!1;Zp=1;members=!1;Dw=null;Dp=null;qp=-1;Jp=-1;$p=0;Qp=-1;t_=-1;i_=0;e_=-1;s_=-1;n_=-1;r_=-1;h_=-1;o_=-1;Fp=null;Bp=null;Kp=-1;Mp=-1;decode(t,i){if(1===t)this.model=i.Jt;else if(2===t)this.name=i.ni;else if(3===t)this.Fw=i.ni;else if(4===t)this.Gp=i.Jt;else if(5===t)this.Pp=i.Jt;else if(6===t)this.Wp=i.Jt;else if(7===t)this.Hp=i.$t,this.Hp>32767&&(this.Hp-=65536);else if(8===t)this.Vp=i.$t,this.Vp>32767&&(this.Vp-=65536);else if(9===t)this.jp=!0;else if(10===t)this.zp=i.Jt;else if(11===t)this.Xp=!0;else if(12===t)this.Zp=i.ti;else if(16===t)this.members=!0;else if(23===t)this.qp=i.Jt,this.$p=i.qt;else if(24===t)this.Jp=i.Jt;else if(25===t)this.Qp=i.Jt,this.i_=i.qt;else if(26===t)this.t_=i.Jt;else if(t>=30&&t<35)this.Dw||(this.Dw=new v(5,null)),this.Dw[t-30]=i.ni,'hidden'===this.Dw[t-30]?.toLowerCase()&&(this.Dw[t-30]=null);else if(t>=35&&t<40)this.Dp||(this.Dp=new v(5,null)),this.Dp[t-35]=i.ni;else if(40===t){const t=i.Zt;this.Bw=new Uint16Array(t),this.Uw=new Uint16Array(t);for(let e=0;e=100&&t<110&&(this.Fp&&this.Bp||(this.Fp=new Uint16Array(10),this.Bp=new Uint16Array(10)),this.Fp[t-100]=i.Jt,this.Bp[t-100]=i.Jt)}l_(t){let i=this.qp;if(1===t&&(i=this.Qp),-1===i)return null;let e=this.Jp,s=this.e_;1===t&&(e=this.t_,s=this.s_);let n=j.model(i);if(-1!==e){const t=j.model(e);if(-1===s){const i=[n,t];n=j.Xr(i,2)}else{const i=[n,t,j.model(s)];n=j.Xr(i,3)}}if(0===t&&0!==this.$p&&n.translate(this.$p,0,0),1===t&&0!==this.i_&&n.translate(this.i_,0,0),this.Bw&&this.Uw)for(let t=0;t1){let i=-1;for(let e=0;e<10;e++)t>=this.Bp[e]&&0!==this.Bp[e]&&(i=this.Fp[e]);if(-1!==i)return Mt.get(i).Up(1)}if(Mt.Gh){const t=Mt.Gh.get(BigInt(this.id));if(t)return t}const i=j.model(this.model);if(this.Bw&&this.Uw)for(let t=0;t=this.v_&&(this.M_=null),t>=this.O_&&t=kt.I_[i].length)&&(e=0),this.T_[i]=e}this.MA=t.Jt,65535===this.MA&&(this.MA=-1),this.kA=t.Jt,65535===this.kA&&(this.kA=-1),this.DA=t.Jt,65535===this.DA&&(this.DA=-1),this.NA=t.Jt,65535===this.NA&&(this.NA=-1),this.FA=t.Jt,65535===this.FA&&(this.FA=-1),this.BA=t.Jt,65535===this.BA&&(this.BA=-1),this.UA=t.Jt,65535===this.UA&&(this.UA=-1),this.name=$.Bh($.kh(t.ii)),this.b_=t.Zt,this.visible=!0,this.R_=0n;for(let t=0;t<12;t++)this.R_<<=0x4n,this.E_[t]>=256&&(this.R_+=BigInt(this.E_[t])-256n);this.E_[0]>=256&&(this.R_+=BigInt(this.E_[0])-256n>>4n),this.E_[1]>=256&&(this.R_+=BigInt(this.E_[1])-256n>>8n);for(let t=0;t<5;t++)this.R_<<=0x3n,this.R_+=BigInt(this.T_[t]);this.R_<<=0x1n,this.R_+=BigInt(this.g_)}Lp(){if(!this.visible)return null;const t=new v(12,null);let i=0;for(let e=0;e<12;e++){const s=this.E_[e];if(s>=256&&s<512&&(t[i++]=xt.tn[s-256].Lp()),s>=512){const e=Mt.get(s-512).Lp(this.g_);e&&(t[i++]=e)}}const e=j.Xr(t,i);for(let t=0;t<5;t++)0!==this.T_[t]&&(e.rh(kt.I_[t][0],kt.I_[t][this.T_[t]]),1===t&&e.rh(kt.__[0],kt.__[this.T_[t]]));return e}k_(){let t=this.R_,i=-1,e=-1,s=-1,n=-1;if(this.tp>=0&&0===this.sp){const r=bt.tn[this.tp];if(r.frames&&(i=r.frames[this.ip]),this.JA>=0&&this.JA!==this.MA){const t=bt.tn[this.JA].frames;t&&(e=t[this.$A])}r.Iy>=0&&(s=r.Iy,t+=BigInt(s-this.E_[5])<<8n),r.gy>=0&&(n=r.gy,t+=BigInt(n-this.E_[3])<<16n)}else if(this.JA>=0){const t=bt.tn[this.JA].frames;t&&(i=t[this.$A])}let r=kt.Gh?.get(t);if(!r){const i=new v(12,null);let e=0;for(let t=0;t<12;t++){let r=this.E_[t];if(n>=0&&3===t&&(r=n),s>=0&&5===t&&(r=s),r>=256&&r<512){const t=xt.tn[r-256].Ul();t&&(i[e++]=t)}if(r>=512){const t=Mt.get(r-512).l_(this.g_);t&&(i[e++]=t)}}r=j.Xr(i,e);for(let t=0;t<5;t++)0!==this.T_[t]&&(r.rh(kt.I_[t][0],kt.I_[t][this.T_[t]]),1===t&&r.rh(kt.__[0],kt.__[this.T_[t]]));r.Qr(),r.oh(64,850,-30,-50,-30,!0),kt.Gh?.put(t,r)}if(this.Li)return r;const h=j.Wr(r,!0);return-1!==i&&-1!==e?h.th(i,e,bt.tn[this.tp].py):-1!==i&&h.eh(i),h.Kr(),h.Hr=null,h.Yr=null,h}}class Dt extends gt{static count=0;static cache=null;static Zs=null;static Ow=null;static Lw=0;static Gh=new q(30);static en=t=>{this.Zs=new R(t.read('npc.dat'));const i=new R(t.read('npc.idx'));this.count=i.Jt,this.Ow=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.Ow||!this.Zs)throw new Error('NpcType not loaded!!!');for(let i=0;i<20;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Lw=(this.Lw+1)%20;const i=this.cache[this.Lw]=new Dt(t);return this.Zs.Xt=this.Ow[t],i.ww(this.Zs),i};static zi=()=>{this.Gh=null,this.Ow=null,this.cache=null,this.Zs=null};name=null;Fw=null;size=1;Nw=null;vp=null;Hw=!1;D_=-1;N_=-1;F_=-1;B_=-1;U_=-1;Bw=null;Uw=null;Dw=null;Jw=-1;$w=-1;Qw=-1;P_=!0;G_=-1;Rp=128;Op=128;decode(t,i){if(1===t){const t=i.Zt;this.Nw=new Uint16Array(t);for(let e=0;e=30&&t<40)this.Dw||(this.Dw=new v(5,null)),this.Dw[t-30]=i.ni,'hidden'===this.Dw[t-30]?.toLowerCase()&&(this.Dw[t-30]=null);else if(40===t){const t=i.Zt;this.Bw=new Uint16Array(t),this.Uw=new Uint16Array(t);for(let e=0;e{const i=new R(t.read('varp.dat'));this.count=i.Jt;for(let t=0;t{It.Li=!1,N.Li=!1,Ft.Li=!1,Ot.Li=!1};static II=()=>{It.Li=!0,N.Li=!0,Ft.Li=!0,Ot.Li=!0};gI=2048;CI=2047;EI=!1;TI=!1;bI=!1;RI=!1;db=null;OI=0;vI=[];stream=null;in=R.zt(1);LI=R.zt(1);SI=R.zt(1);xI=0n;MI=0;kI=0;DI=0;NI=null;FI=0;packetSize=0;BI=0;UI=0;GI=0;WI=null;YI=!0;HI=0;VI=0;KI=null;XI=null;jI=null;zI=null;ZI=null;qI=null;JI=null;$I=null;QI=null;tg=null;ig=null;eg='';sg='';username='';password='';ng=null;rg=null;hg=null;og=null;lg=[];ag=!1;cg=null;fg=null;ug=null;dg=null;wg=null;yg=null;mg=null;Ag=null;pg=null;_g=null;Ig=new Int32Array(256);gg=0;Cg=0;Eg=0;Tg=null;bg=null;Rg=null;Og=null;vg=null;Lg=null;Sg=null;xg=null;Mg=null;kg=null;Dg=null;Ng=null;Fg=null;Bg=null;Ug=null;Pg=null;Gg=null;Wg=null;Yg=null;Hg=null;Vg=null;Kg=new Int32Array(33);Xg=new Int32Array(33);jg=new Int32Array(151);zg=new Int32Array(151);Zg=null;qg=null;Jg=null;$g=null;Qg=null;tC=null;iC=new v(13,null);eC=null;sC=null;nC=new v(50,null);rC=new v(50,null);hC=new v(20,null);oC=new v(20,null);lC=null;aC=new v(8,null);cC=null;fC=null;uC=null;dC=null;wC=null;yC=null;mC=null;AC=null;pC=null;_C=null;IC=null;gC=null;CC=null;EC=null;TC=null;bC=null;RC=null;OC=null;vC=new v(1e3,null);LC=!1;SC=!1;xC=!1;MC=!1;kC=-1;DC=0;NC=0;FC=0;BC=0;UC=0;PC=0;GC=!1;WC=0;YC=0;HC=0;VC=0;KC=0;XC=0;jC=[];zC=-1;ZC=-1;qC=new Q;JC=78;$C=0;QC=0;tE=[];iE=0;eE=0;sE=0;nE=0;rE=0;hE=0;oE=0;lE=0;aE=[];cE=[];fE=[];uE=[];dE=null;wE=-1;yE=3;mE=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];AE=0;pE=0;_E=0;IE=!1;gE=0;CE=!1;EE='';TE='';bE=0;RE='';OE=!1;vE=-1;LE=new v(100,null);SE=new v(100,null);messageType=new Int32Array(100);xE=new Int32Array(100);ME=0;kE=0;DE=0;NE='';FE=0;BE=0;UE=0;PE=0;GE=0;WE=0;YE=0;HE=0;VE=0;KE=!1;XE=0;jE=0;zE=0;ZE=0;qE=null;JE=0;$E=0;QE=0;tT=0;iT=!1;eT=[];sT=[];nT=0;rT=0;hT=0;oT=null;lT=0;aT=new Int32Array(500);cT=new Int32Array(500);fT=new Int32Array(500);uT=new Int32Array(500);dT=0;wT=0;yT=0;mT='';AT=!1;pT=-1;_T=0;IT=0;gT=0;CT=0;ET=0;TT=new Int32Array(1e3);bT=new Int32Array(1e3);RT=null;OT=0;vT=0;LT=0;ST=0;xT=0;MT=!1;kT=0;DT=0;NT=0;FT=0;BT=2;UT=2;PT=1;GT=new Int32Array(5);WT=new v(5,!1);YT=new Int32Array(5);HT=new Int32Array(5);VT=new Int32Array(5);KT=0;XT=0;jT=0;zT=0;ZT=0;qT=0;JT=0;$T=0;QT=0;tb=1;ib=2;eb=-1;$n=0;tr=0;sb=0;nb=0;rb=0;hb=0;ob=null;lb=null;ab=null;cb=0;fb=0;ub=new Int8Array(16384);wb=new v(ut.gf,null);yb=0;mb=0;Ab=128;pb=0;_b=0;Ib=0;gb=0;Cb=0;uA=null;dA=null;Eb=new k(ut.Cf,ut.Cf);Tb=0;bb=0;Rb=0;Ob=0;vb=0;Lb=0;Sb=0;xb=0;Mb=0;kb=0;Db=0;Nb=0;Fb=new v(this.gI,null);Bb=0;Ub=new Int32Array(this.gI);Pb=0;Gb=0;Wb=new Int32Array(this.gI);Yb=new Int32Array(1e3);Hb=new v(this.gI,null);Vb=new v(8192,null);Kb=0;Xb=new Int32Array(8192);jb=new b;zb=new b;Zb=new b;_d=new b;qb=new S(ut.gf,ut.Cf,ut.Cf,null);Jb=new b;$b=new Int32Array(4e3);Qb=new Int32Array(4e3);tR=new Int32Array(ut.Cf*ut.Cf);iR=new Int32Array(ut.Cf*ut.Cf);eR=0;sR=null;nR=0;rR=0;hR=-1;oR=0;lR=0;aR=0;cR=0;fR=!1;uR=!0;dR=!1;wR=new Int32Array(7);yR=new Int32Array(5);mR=0;AR=0;static pR=50;_R=new Int32Array(Ft.pR);IR=new Int32Array(Ft.pR);gR=new Int32Array(Ft.pR);CR=new Int32Array(Ft.pR);ER=new Int32Array(Ft.pR);TR=new Int32Array(Ft.pR);bR=new Int32Array(Ft.pR);RR=new v(Ft.pR,null);OR=new v(100,null);vR=new BigInt64Array(100);LR=new Int32Array(100);SR=null;xR=0;MR=!0;kR=new Int32Array(50);DR=new Int32Array(50);NR=new Int32Array(50);FR=192;BR=-1;UR=-1;PR=0;GR=0;WR=0;YR=!0;HR=null;VR=0;KR=0;XR=192;jR=new v(16,null);zR=0;ZR=!1;zi=()=>{try{this.stream&&this.stream.close()}catch(t){}this.stream=null,window._tinyMidiStop&&window._tinyMidiStop(),this.LI=null,this.SI=null,this.in=null,this.ab=null,this.ob=null,this.lb=null,this.uA=null,this.dA=null,this.RT=null,this.wb=null,this.tR=null,this.iR=null,this.$b=null,this.Qb=null,this.ub=null,this.bg=null,this.Rg=null,this.Og=null,this.vg=null,this.Lg=null,this.Sg=null,this.xg=null,this.Mg=null,this.kg=null,this.Dg=null,this.Ng=null,this.Fg=null,this.Bg=null,this.Ug=null,this.Pg=null,this.Gg=null,this.Wg=null,this.Zg=null,this.Jg=null,this.qg=null,this.$g=null,this.Qg=null,this.tC=null,this.iC=null,this.mC=null,this.AC=null,this.pC=null,this._C=null,this.IC=null,this.gC=null,this.CC=null,this.EC=null,this.TC=null,this.bC=null,this.sC=null,this.hC=null,this.oC=null,this.aC=null,this.cC=null,this.fC=null,this.uC=null,this.dC=null,this.nC=null,this.rC=null,this.Eb=null,this.Fb=null,this.Ub=null,this.Wb=null,this.Hb=null,this.Yb=null,this.Vb=null,this.Xb=null,this.qb=null,this.Jb=null,this._d=null,this.jb=null,this.zb=null,this.Zb=null,this.fT=null,this.uT=null,this.aT=null,this.cT=null,this.jC=null,this.eT=null,this.TT=null,this.bT=null,this.vC=null,this.eC=null,this.OR=null,this.vR=null,this.LR=null,this.zI=null,this.ZI=null,this.KI=null,this.XI=null,this.jI=null,this.qI=null,this.JI=null,this.$I=null,this.QI=null,this.qR(),Et.zi(),Dt.zi(),Mt.zi(),Ct.tn=null,xt.tn=null,Q.tn=null,bt.tn=null,St.tn=null,St.Gh=null,Nt.tn=null,this.ke=null,kt.Gh=null,N.zi(),It.zi(),j.zi(),H.tn=[],V.tn=[]};Ds(){return this.HI}Ms(){return this.OE}ks(){return this.CE}xs(){return this.ZC}Ss(){return this.kC}qR=()=>{this.ag=!1,this.Tg&&(clearInterval(this.Tg),this.Tg=null),this.tg=null,this.ig=null,this.lg=[],this.mg=null,this.Ag=null,this.pg=null,this._g=null,this.dg=null,this.ug=null,this.wg=null,this.yg=null,this.cg=null,this.fg=null};JR=async(t,i,e,s)=>{let n=5,r=await(this.db?.Bs(t));if(r&&R.Kt(r)!==e&&(r=void 0),r)return new W(r);for(;!r;){await this.ws(s,`Requesting ${i}`);try{r=await T(`${Ft.J_}/${t}${e}`)}catch(t){r=void 0;for(let t=n;t>0;t--)await this.ws(s,`Error loading - Will retry in ${t} secs.`),await E(1e3);n*=2,n>60&&(n=60)}}return await(this.db?.Us(t,r)),new W(r)};$R=async(t,e,s)=>{let n=await(this.db?.Bs(t+'.mid'));if(n&&12345678!==e&&R.Kt(n)!==e&&(n=void 0),!n)try{n=await T(`${Ft.J_}/${t}_${e}.mid`),s!==n.length&&(n=n.slice(0,s))}catch(t){}if(!n)return;await(this.db?.Us(t+'.mid',n));const r=new R(Uint8Array.from(n)).ti;!function(t,i){window._tinyMidiPlay&&window._tinyMidiPlay(t,i/256)}(i.read(r,n,s,4),this.XR)};QR=()=>{if(p.fillStyle='black',p.fillRect(0,0,this.width,this.height),this.As(1),this.bI){this.ag=!1,p.font='bold 16px helvetica, sans-serif',p.textAlign='left',p.fillStyle='yellow';let t=35;p.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,p.fillStyle='white',p.fillText('To fix this try the following (in order):',30,t),t+=50,p.font='bold 12px helvetica, sans-serif',p.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,p.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,p.fillText('3: Try using a different game-world',30,t),t+=30,p.fillText('4: Try rebooting your computer',30,t),t+=30,p.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.RI&&(this.ag=!1,p.font='bold 20px helvetica, sans-serif',p.textAlign='left',p.fillStyle='white',p.fillText('Error - unable to load game!',50,50),p.fillText('To play RuneScape make sure you play from',50,100),p.fillText('https://2004scape.org',50,150)),this.TI){this.ag=!1,p.font='bold 13px helvetica, sans-serif',p.textAlign='left',p.fillStyle='yellow';let t=35;p.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,p.fillStyle='white',p.fillText('To fix this try the following (in order):',30,t),t+=50,p.font='bold 12px helvetica, sans-serif',p.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,p.fillText('2: Try rebooting your computer, and reloading',30,t)}};tO=t=>{if(!t.wl)return!1;for(let i=0;i=s)return!1}else if(3===t.wl[i]){if(e<=s)return!1}else if(4===t.wl[i]){if(e===s)return!1}else if(e!==s)return!1}return!0};eO=(t,i,e,s,n)=>{this.wC?.draw(t,i),this.yC?.draw(t,i+n-16),m.fillRect(t,i+16,16,n-32,Rt.Py);let r=(n-32)*n/s|0;r<8&&(r=8);const h=(n-r-32)*e/(s-n)|0;m.fillRect(t,i+h+16,16,r,Rt.Gy),m.Et(t,i+h+16,Rt.Wy,r),m.Et(t+1,i+h+16,Rt.Wy,r),m.Ct(t,i+h+16,Rt.Wy,16),m.Ct(t,i+h+17,Rt.Wy,16),m.Et(t+15,i+h+16,Rt.Yy,r),m.Et(t+14,i+h+17,Rt.Yy,r-1),m.Ct(t,i+h+r+15,Rt.Yy,16),m.Ct(t+1,i+h+r+14,Rt.Yy,15)};sO=(t,i)=>{let e=!1;const s=Q.tn[t];if(!s.ml)return!1;for(let t=0;ts.delay[n.zl];)n.Zl-=s.delay[n.zl]+1,n.zl++,n.zl>=s.my&&(n.zl-=s.yy,(n.zl<0||n.zl>=s.my)&&(n.zl=0)),e=!0}}}return e};nO=(t,i,e,s,n=!1)=>{if(0!==t.type||!t.ml||t.hide&&this.FE!==t.id&&this.BE!==t.id&&this.UE!==t.id)return;const r=m.left,h=m.top,o=m.right,l=m.bottom;m._t(i,e,i+t.width,e+t.height);const a=t.ml.length;for(let r=0;r0&&this.rO(l),l.type===Q.Wh)l.jl>l.scroll-l.height&&(l.jl=l.scroll-l.height),l.jl<0&&(l.jl=0),this.nO(l,h,o,l.jl,n),l.scroll>l.height&&this.eO(h+l.width,o,l.jl,l.scroll,l.height);else if(l.type===Q.Hh){let t=0;for(let i=0;i0){let i=0,e=0;const r=l._l[t]-1;if(s>=-32&&s<=512&&n>=-32&&n<=334||0!==this.WE&&this.GE===t){const h=Mt.Np(r,l.Il[t]);if(0!==this.WE&&this.GE===t&&this.PE===l.id?(i=this.Xe-this.YE,e=this.je-this.HE,i<5&&i>-5&&(i=0),e<5&&e>-5&&(e=0),this.VE<5&&(i=0,e=0),h.Eh(128,s+i,n+e)):0!==this.JE&&this.$E===t&&this.QE===l.id?h.Eh(128,s,n):h.draw(s,n),33===h.Ii||1!==l.Il[t]){const r=l.Il[t];this.ng?.hO(s+i+1,n+10+e,this.oO(r),Rt.Oy),this.ng?.hO(s+i,n+9+e,this.oO(r),Rt.Ey)}}}else if(l.Ol&&t<20){const i=l.Ol[t];i?.draw(s,n)}t++}}else if(l.type===Q.Vh)l.fill?m.fillRect(h,o,l.width,l.height,l.kl):m.gt(h,o,l.width,l.height,l.kl);else if(l.type===Q.Kh){const t=l.font;let i=l.kl,e=l.text;if(this.UE!==l.id&&this.BE!==l.id&&this.FE!==l.id||0===l.Nl||(i=l.Nl),this.tO(l)&&(i=l.Dl,l.Ml&&l.Ml.length>0&&(e=l.Ml)),l.fl===Q.io&&this.iT&&(e='Please wait...',i=l.kl),!t||!e)continue;for(let s=o+t.height;e.length>0;s+=t.height){if(-1!==e.indexOf('%')){for(;;){const t=e.indexOf('%1');if(-1===t)break;e=e.substring(0,t)+this.lO(this.iO(l,0))+e.substring(t+2)}for(;;){const t=e.indexOf('%2');if(-1===t)break;e=e.substring(0,t)+this.lO(this.iO(l,1))+e.substring(t+2)}for(;;){const t=e.indexOf('%3');if(-1===t)break;e=e.substring(0,t)+this.lO(this.iO(l,2))+e.substring(t+2)}for(;;){const t=e.indexOf('%4');if(-1===t)break;e=e.substring(0,t)+this.lO(this.iO(l,3))+e.substring(t+2)}for(;;){const t=e.indexOf('%5');if(-1===t)break;e=e.substring(0,t)+this.lO(this.iO(l,4))+e.substring(t+2)}}const n=e.indexOf('\\n');let r;-1!==n?(r=e.substring(0,n),e=e.substring(n+2)):(r=e,e=''),l.Sl?t.aO(h+(l.width/2|0),s,r,i,l.xl):t.cO(h,s,r,i,l.xl)}}else if(l.type===Q.Xh){let t;t=this.tO(l)?l.Bl:l.Fl,t?.draw(h,o)}else if(l.type===Q.jh){const t=N.Ni,i=N.Fi;N.Ni=h+(l.width/2|0),N.Fi=o+(l.height/2|0);const e=N.sin[l.Yl]*l.zoom>>16,s=N.cos[l.Yl]*l.zoom>>16,n=this.tO(l);let r;r=n?l.Wl:l.Gl;let a=null;if(-1===r)a=l.Ul(-1,-1,n);else{const t=bt.tn[r];t.frames&&t.Ay&&(a=l.Ul(t.frames[l.zl],t.Ay[l.zl],n))}a&&a.fh(0,l.Hl,0,l.Yl,0,e,s),N.Ni=t,N.Fi=i}else if(l.type===Q.zh){const t=l.font;if(!t||!l._l||!l.Il)continue;let i=0;for(let e=0;e0){const n=Mt.get(l._l[i]-1);let r=n.name;if((n.Xp||1!==l.Il[i])&&(r=r+' x'+this.fO(l.Il[i])),!r)continue;const a=h+s*(l.El+115),c=o+e*(l.Tl+12);l.Sl?t.aO(a+(l.width/2|0),c,r,l.kl,l.xl):t.cO(a,c,r,l.kl,l.xl)}i++}}}m._t(r,h,o,l)};rO=t=>{let i=t.ul;if(i>=Q.eo&&i<=Q.so)i--,i>=this.mR?(t.text='',t.fl=0):(t.text=this.OR[i],t.fl=1);else if(i>=Q.no&&i<=Q.ro)i-=Q.no,i>=this.mR?(t.text='',t.fl=0):(0===this.LR[i]?t.text='@red@Offline':this.LR[i]===Ft.Z_?t.text='@gre@World-'+(this.LR[i]-9):t.text='@yel@World-'+(this.LR[i]-9),t.fl=1);else if(i===Q.lo)t.scroll=15*this.mR+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i>=Q.Po&&i<=Q.Go)i-=Q.Po,i>=this.QC?(t.text='',t.fl=0):(t.text=$.Bh($.kh(this.tE[i])),t.fl=1);else if(i===Q.Ho)t.scroll=15*this.QC+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i===Q.Uo){if(t.Yl=150,t.Hl=256*Math.sin(this.OI/40)&2047,this.dR){this.dR=!1;const i=new v(7,null);let e=0;for(let t=0;t<7;t++){const s=this.wR[t];s>=0&&(i[e++]=xt.tn[s].Ul())}const s=j.Xr(i,e);for(let t=0;t<5;t++)0!==this.yR[t]&&(s.rh(kt.I_[t][0],kt.I_[t][this.yR[t]]),1===t&&s.rh(kt.__[0],kt.__[this.yR[t]]));if(this.sR){const i=bt.tn[this.sR.MA].frames;i&&(s.Qr(),s.eh(i[0]),s.oh(64,850,-30,-50,-30,!0),t.model=s)}}}else if(i===Q.No)this.RC||(this.RC=t.Fl,this.OC=t.Bl),this.uR?t.Fl=this.OC:t.Fl=this.RC;else if(i===Q.Fo)this.RC||(this.RC=t.Fl,this.OC=t.Bl),this.uR?t.Fl=this.RC:t.Fl=this.OC;else if(i===Q.Vo)t.text=this.mT,this.OI%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(i===Q.sl)this.fR?this.AT?(t.kl=Rt.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.kl=Rt.Ry,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(i===Q.nl||i===Q.al)if(0===this._T)t.text='';else{let i;i=0===this.IT?'earlier today':1===this.IT?'yesterday':this.IT+' days ago',t.text='You last logged in '+i+' from: '+$.Fh(this._T)}else if(i===Q.rl)0===this.CT&&(t.text='0 unread messages',t.kl=Rt.Ey),1===this.CT&&(t.text='1 unread message',t.kl=Rt.GREEN),this.CT>1&&(t.text=this.CT+' unread messages',t.kl=Rt.GREEN);else if(i===Q.hl)if(201===this.gT)t.text='';else if(200===this.gT)t.text='You have not yet set any password recovery questions.';else{let i;i=0===this.gT?'Earlier today':1===this.gT?'Yesterday':this.gT+' days ago',t.text=i+' you changed your recovery questions'}else i===Q.ol?201===this.gT?t.text='':200===this.gT?t.text='We strongly recommend you do so now to secure your account.':t.text='If you do not remember making this change then cancel it immediately':i===Q.ll&&(201===this.gT?t.text='':(this.gT,t.text="Do this from the 'account management' area on our front webpage"))};iO=(t,i)=>{if(!t.scripts||i>=t.scripts.length)return-2;try{const e=t.scripts[i];if(!e)return-1;let s=0,n=0;for(;;){const t=e[n++];if(0===t)return s;if(1===t)s+=this.cE[e[n++]];else if(2===t)s+=this.fE[e[n++]];else if(3===t)s+=this.aE[e[n++]];else if(4===t){const t=Q.tn[e[n++]],i=e[n++]+1;if(t._l&&t.Il)for(let e=0;et<999999999?String(t):'*';fO=t=>{let i=String(t);for(let t=i.length-3;t>0;t-=3)i=i.substring(0,t)+','+i.substring(t);return i.length>8?i='@gre@'+i.substring(0,i.length-8)+' million @whi@('+i+')':i.length>4&&(i='@cya@'+i.substring(0,i.length-4)+'K @whi@('+i+')'),' '+i};oO=t=>t<1e5?String(t):t<1e7?(t/1e3|0)+'K':(t/1e6|0)+'M'}(new class extends Ft{EI=!1;TI=!1;bI=!1;RI=!1;uO=null;dO=null;wO=null;yO=null;mO=null;AO=null;Fu=0;Bu=0;Uu=0;pO=0;_O=0;IO=2;model={id:parseInt(P.getParameter('model'))||0,gO:null,x:0,y:0,z:420,xa:0};constructor(){super(!0)}load=async()=>{if(this.EI)this.TI=!0;else{this.EI=!0;try{await async function(t){if(o||h)return;o=!0;const i=await r(t);h||(h=i)}(),await i.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new G(await G.openDatabase()),this.ke?.bind(),N.Zi(),this.uO=document.getElementById('rightPanel');const t=document.getElementById('mainPanel');t&&(t.ondragover=t=>{t.preventDefault(),t.stopPropagation()},t.ondrop=async t=>{if(t.preventDefault(),t.stopPropagation(),!t.dataTransfer||!t.dataTransfer.files.length)return;const i=['main_file_cache.dat','main_file_cache.idx0','main_file_cache.idx1','main_file_cache.idx2','main_file_cache.idx3','main_file_cache.idx4'],e=[];for(let s=0;s{this.TI||this.bI||this.RI||(this.CO(),this.EO())};draw=async()=>{this.TI||this.bI||this.RI?this.QR():(m.clear(),m.fillRect(0,0,this.width,this.height,Rt.Oy),null!==this.model.gO&&this.model.gO.draw(this.model.xa,N.sin[this.pO],N.cos[this.pO],N.sin[this._O],N.cos[this._O],this.model.x-this.Fu,this.model.y-this.Bu,this.model.z-this.Uu,0),this.ke?.draw(0,0))};init=async()=>{const t=await(this.db?.Bs('main_file_cache.dat'));if(!t){return document.getElementById('helpme').style.display='block',void(A.style.display='none')}const i=await(this.db?.Bs('main_file_cache.idx0')),e=await(this.db?.Bs('main_file_cache.idx1')),s=await(this.db?.Bs('main_file_cache.idx2')),n=await(this.db?.Bs('main_file_cache.idx3')),r=await(this.db?.Bs('main_file_cache.idx4'));if(!(i&&e&&s&&n&&r)){return document.getElementById('helpme').style.display='block',void(A.style.display='none')}document.getElementById('helpme').style.display='none',A.style.display='block',this.dO=new Y(t,i,0),this.wO=new Y(t,e,1),this.yO=new Y(t,s,2),this.mO=new Y(t,n,3),this.AO=new Y(t,r,4),await this.ws(10,'Unpacking textures');const h=this.dO.read(6);N.$i(h),N.ie(.8),N.se(20),await this.ws(20,'Loading models...');for(let t=0;t{this.model.id=i,this.TO(i)},t.appendChild(e)}}};TO(t){if(null===this.wO)return;const i=this.wO.read(t);null!==i?(this.model.gO=j.jr(i,t),this.model.gO.oh(64,850,-30,-50,-30,!0),document.title=`Model ${t} | 2004Scape Tools`):document.title=`Missing model ${t} | 2004Scape Tools`}CO(){for(;;){const t=this._s();if(-1===t)break;t==='r'.charCodeAt(0)?(this.IO=2,this.Fu=0,this.Bu=0,this.Uu=0,this.pO=0,this._O=0,this.model.x=0,this.model.y=0,this.model.z=420,this.model.xa=0):t==='1'.charCodeAt(0)?(this.model.id--,j.metadata&&this.model.id<0&&(this.model.id=j.metadata.length-1),this.TO(this.model.id)):t==='2'.charCodeAt(0)&&(this.model.id++,j.metadata&&this.model.id>=j.metadata.length&&(this.model.id=0),this.TO(this.model.id))}}EO(){this.Je['['.charCodeAt(0)]?this.IO--:this.Je[']'.charCodeAt(0)]&&this.IO++,this.Je[1]?this.model.xa+=this.IO:this.Je[2]&&(this.model.xa-=this.IO),this.Je['w'.charCodeAt(0)]?this.model.z-=this.IO:this.Je['s'.charCodeAt(0)]&&(this.model.z+=this.IO),this.Je['a'.charCodeAt(0)]?this.model.x-=this.IO:this.Je['d'.charCodeAt(0)]&&(this.model.x+=this.IO),this.Je['q'.charCodeAt(0)]?this.model.y-=this.IO:this.Je['e'.charCodeAt(0)]&&(this.model.y+=this.IO),this.pO=2047&this.pO,this._O=2047&this._O,this.model.xa=2047&this.model.xa}}).us().then((()=>{}))})()})(); \ No newline at end of file