From 4c29cc159f23862525c2c9cc038cfa56071fd4a6 Mon Sep 17 00:00:00 2001 From: lesleyrs <19632758+lesleyrs@users.noreply.github.com> Date: Wed, 7 Aug 2024 14:12:58 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20lesleyrs?= =?UTF-8?q?/Client2@0a0885ce3f746b9c202748e3f6a1b58301200379=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mapview.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mapview.js b/mapview.js index 293f58b4..e27a4abd 100644 --- a/mapview.js +++ b/mapview.js @@ -1 +1 @@ -(()=>{"use strict";var t,i,e,s,n={6200:(t,i,e)=>{e.d(i,{K:()=>N});var s=e(1120),n=e(4583),r=e(2901),h=e(1069),o=e(8370),l=(e(8902),e(6666)),a=e(198),c=e(818),f=e(670),u=e(8268),d=e(3867),w=e(7854),y=e(8950),p=e(1302),A=e(9298),m=e(8665),g=e(1312),I=e(3819),_=e(8317),C=e(9234),E=e(4702),v=e(123),b=e(5637),T=e(6948),O=e(2164),R=e(8738),S=e(3764),L=e(8534),x=e(6730);function M(t,i){var e;(e=document.createElement('a')).href=t,e.download=i,document.body.appendChild(e),e.style='display: none',e.click(),e.remove()}class k{tt=new Map;it;et=self.isSecureContext?self.crypto.randomUUID():'0';constructor(t){this.it=t}async st(){const t=new RTCPeerConnection({iceServers:[{urls:'stun:stun.l.google.com:19302'}]}),i=t.createDataChannel('channel'),e=crypto.randomUUID();this.tt.set(e,i),await t.setLocalDescription(await t.createOffer()),t.onicegatheringstatechange=async()=>{if('complete'===t.iceGatheringState){let i;self.isSecureContext?await navigator.clipboard.writeText(JSON.stringify(t.localDescription)):console.log(JSON.stringify(t.localDescription));try{for(;null===(i=prompt('Offer copied to clipboard, paste answer here')););t.setRemoteDescription(new RTCSessionDescription(JSON.parse(i)))}catch(t){console.error(t)}}},i.onopen=()=>{i.send(JSON.stringify({type:'id',id:e})),console.log('Connected to peer!')},i.onerror=t=>{console.error(t)},i.onmessage=t=>{const i=JSON.parse(t.data);i.data&&(i.data=Object.values(i.data)),this.it&&this.it.postMessage(i)}}postMessage(t){const i=this.tt.get(t.data.id),e=t.data;e.data&&(e.data=Array.from(t.data.data)),i&&'open'===i.readyState&&i.send(JSON.stringify(e))}}class D{pc;nt=void 0;et;constructor(t){this.pc=new RTCPeerConnection({iceServers:[{urls:'stun:stun.l.google.com:19302'}]}),this.pc.ondatachannel=i=>{this.nt=i.channel,this.nt.onopen=()=>{console.log('Connected to host!')},this.nt.onerror=t=>{console.error(t)},this.nt.onmessage=i=>{if(!this.et){const t=JSON.parse(i.data);if('id'===t.type)return void(this.et=t.id)}t.onmessage&&t.onmessage(i)}},this.pc.onicegatheringstatechange=async()=>{'complete'===this.pc.iceGatheringState&&(self.isSecureContext?await navigator.clipboard.writeText(JSON.stringify(this.pc.localDescription)):console.log(JSON.stringify(this.pc.localDescription)))}}async rt(t){await this.pc.setRemoteDescription(new RTCSessionDescription(JSON.parse(t))),await this.pc.setLocalDescription(await this.pc.createAnswer())}}class N extends o.A{static ht=225;static ot=10;static portOffset=0;static members=!0;static lt=!1;static ct='';static ft='';static ut=!1;static dt=2;static wt=!1;static yt='https://raw.githubusercontent.com/2004scape/Server/main';static exponent=58778699976184461502525193738213253649000149147835990136706041084440742975821n;static At=7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789n;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 Ot=0;static Rt=0;static St=0;static Lt=0;static xt=0;static Mt=0;static kt=0;static Dt=()=>{a.A.lt=!1,n.A.lt=!1,N.lt=!1,c.A.lt=!1};static Nt=()=>{a.A.lt=!0,n.A.lt=!0,N.lt=!0,c.A.lt=!0};Ft=2048;Bt=2047;Pt=!1;Ut=!1;Wt=!1;Gt=!1;db=null;Yt=0;Ht=[];stream=null;in=h.A.Vt(1);Kt=h.A.Vt(1);Xt=h.A.Vt(1);jt=0n;zt=0;Zt=0;qt=0;Jt=null;$t=0;packetSize=0;Qt=0;ti=0;ii=0;ei=null;si=!0;ni=0;ri=0;hi=null;oi=null;li=null;ai=null;ci=null;fi=null;ui=null;di=null;wi=null;yi=null;pi=null;Ai='';mi='';username='';password='';gi=null;Ii=null;_i=null;Ci=null;Ei=[];vi=!1;bi=null;Ti=null;Oi=null;Ri=null;Si=null;Li=null;xi=null;Mi=null;ki=null;Di=null;Ni=new Int32Array(256);Fi=0;Bi=0;Pi=0;Ui=null;Wi=null;Gi=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=null;ie=null;ee=null;se=null;ne=null;re=null;he=new Int32Array(33);oe=new Int32Array(33);le=new Int32Array(151);ae=new Int32Array(151);ce=null;fe=null;ue=null;de=null;we=null;ye=null;pe=new d.Ae(13,null);me=null;ge=null;Ie=new d.Ae(50,null);_e=new d.Ae(50,null);Ce=new d.Ae(20,null);Ee=new d.Ae(20,null);ve=null;be=new d.Ae(8,null);Te=null;Oe=null;Re=null;Se=null;Le=null;xe=null;Me=null;ke=null;De=null;Ne=null;Fe=null;Be=null;Pe=null;Ue=null;We=null;Ge=null;Ye=null;He=null;Ve=new d.Ae(1e3,null);Ke=!1;Xe=!1;je=!1;ze=!1;Ze=-1;qe=0;Je=0;$e=0;Qe=0;ts=0;es=0;ss=!1;ns=0;rs=0;hs=0;os=0;ls=0;cs=0;fs=[];us=-1;ds=-1;ws=new s.A;ys=78;ps=0;As=0;gs=[];Is=0;_s=0;Cs=0;Es=0;vs=0;bs=0;Ts=0;Os=0;Rs=[];Ss=[];Ls=[];xs=[];Ms=null;ks=-1;Ds=3;Ns=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];Fs=0;Bs=0;Ps=0;Us=!1;Ws=0;Gs=!1;Ys='';Hs='';Vs=0;Ks='';Xs=!1;js=-1;zs=new d.Ae(100,null);Zs=new d.Ae(100,null);messageType=new Int32Array(100);qs=new Int32Array(100);Js=0;$s=0;Qs=0;tn='';en=0;sn=0;nn=0;rn=0;hn=0;ln=0;an=0;cn=0;fn=0;un=!1;dn=0;wn=0;yn=0;pn=0;An=null;mn=0;gn=0;In=0;_n=0;Cn=!1;En=[];vn=[];bn=0;Tn=0;On=0;Rn=null;Sn=0;Ln=new Int32Array(500);xn=new Int32Array(500);Mn=new Int32Array(500);kn=new Int32Array(500);Dn=0;Nn=0;Fn=0;Bn='';Pn=!1;Un=-1;Wn=0;Gn=0;Yn=0;Hn=0;Vn=0;Kn=new Int32Array(1e3);Xn=new Int32Array(1e3);jn=null;zn=0;Zn=0;qn=0;Jn=0;$n=0;Qn=!1;tr=0;ir=0;er=0;sr=0;nr=2;rr=2;hr=1;lr=new Int32Array(5);ar=new d.Ae(5,!1);cr=new Int32Array(5);ur=new Int32Array(5);dr=new Int32Array(5);wr=0;yr=0;pr=0;Ar=0;mr=0;gr=0;Ir=0;_r=0;Cr=0;Er=1;vr=2;br=-1;Tr=0;Or=0;Rr=0;Sr=0;Lr=0;Mr=0;kr=null;Dr=null;Nr=null;Fr=0;Br=0;Pr=new Int8Array(16384);Ur=new d.Ae(f.A.Wr,null);Gr=0;Yr=0;Hr=128;Vr=0;Kr=0;Xr=0;jr=0;zr=0;Zr=null;qr=null;Jr=new d.$r(f.A.Qr,f.A.Qr);th=0;ih=0;eh=0;sh=0;nh=0;rh=0;hh=0;oh=0;lh=0;ah=0;fh=0;uh=0;dh=new d.Ae(this.Ft,null);wh=0;yh=new Int32Array(this.Ft);ph=0;Ah=0;mh=new Int32Array(this.Ft);gh=new Int32Array(1e3);Ih=new d.Ae(this.Ft,null);_h=new d.Ae(8192,null);Ch=0;Eh=new Int32Array(8192);bh=new l.A;Th=new l.A;Oh=new l.A;Rh=new l.A;Sh=new d.Lh(f.A.Wr,f.A.Qr,f.A.Qr,null);xh=new l.A;Mh=new Int32Array(4e3);kh=new Int32Array(4e3);Dh=new Int32Array(f.A.Qr*f.A.Qr);Nh=new Int32Array(f.A.Qr*f.A.Qr);Fh=0;Bh=null;Ph=0;Uh=0;Wh=-1;Gh=0;Yh=0;Hh=0;Vh=0;Kh=!1;Xh=!0;jh=!1;zh=new Int32Array(7);Zh=new Int32Array(5);qh=0;Jh=0;static $h=50;Qh=new Int32Array(N.$h);io=new Int32Array(N.$h);eo=new Int32Array(N.$h);so=new Int32Array(N.$h);no=new Int32Array(N.$h);ro=new Int32Array(N.$h);ho=new Int32Array(N.$h);oo=new d.Ae(N.$h,null);lo=new d.Ae(100,null);ao=new BigInt64Array(100);co=new Int32Array(100);fo=null;uo=0;do=!0;wo=new Int32Array(50);yo=new Int32Array(50);po=new Int32Array(50);Ao=192;mo=-1;Io=-1;_o=0;Co=0;Eo=0;vo=!0;bo=null;To=0;Oo=0;Ro=192;it=void 0;So=!1;host=null;Lo=null;xo=new d.Ae(16,null);Mo=0;ko=!1;Do=()=>{try{this.stream&&this.stream.close()}catch(t){}this.Lo&&'998'===N.getParameter('world')&&this.Lo.nt?.send(JSON.stringify({type:'close',id:this.Lo.et})),this.stream=null,(0,v.No)(!1),this.Kt=null,this.Xt=null,this.in=null,this.Nr=null,this.kr=null,this.Dr=null,this.Zr=null,this.qr=null,this.jn=null,this.Ur=null,this.Dh=null,this.Nh=null,this.Mh=null,this.kh=null,this.Pr=null,this.Wi=null,this.Gi=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.Ji=null,this.$i=null,this.Qi=null,this.te=null,this.ie=null,this.ee=null,this.ce=null,this.ue=null,this.fe=null,this.de=null,this.we=null,this.ye=null,this.pe=null,this.Me=null,this.ke=null,this.De=null,this.Ne=null,this.Fe=null,this.Be=null,this.Pe=null,this.Ue=null,this.We=null,this.Ge=null,this.ge=null,this.Ce=null,this.Ee=null,this.be=null,this.Te=null,this.Oe=null,this.Re=null,this.Se=null,this.Ie=null,this._e=null,this.Jr=null,this.dh=null,this.yh=null,this.mh=null,this.Ih=null,this.gh=null,this._h=null,this.Eh=null,this.Sh=null,this.xh=null,this.Rh=null,this.bh=null,this.Th=null,this.Oh=null,this.Mn=null,this.kn=null,this.Ln=null,this.xn=null,this.fs=null,this.En=null,this.Kn=null,this.Xn=null,this.Ve=null,this.me=null,this.lo=null,this.ao=null,this.co=null,this.ai=null,this.ci=null,this.hi=null,this.oi=null,this.li=null,this.fi=null,this.ui=null,this.di=null,this.wi=null,this.Fo(),b.A.Do(),T.A.Do(),p.A.Do(),O.A.Bo=null,_.A.Bo=null,s.A.Bo=null,g.A.Bo=null,R.A.Bo=null,R.A.Po=null,S.A.Bo=null,this.Uo=null,u.A.Po=null,n.A.Do(),a.A.Do(),m.A.Do(),L.A.Bo=[],x.A.Bo=[]};Wo(){return this.ni}Go(){return this.Xs}Yo(){return this.Gs}Ho(){return this.ds}Vo(){return this.Ze}Fo=()=>{this.vi=!1,this.Ui&&(clearInterval(this.Ui),this.Ui=null),this.yi=null,this.pi=null,this.Ei=[],this.xi=null,this.Mi=null,this.ki=null,this.Di=null,this.Ri=null,this.Oi=null,this.Si=null,this.Li=null,this.bi=null,this.Ti=null};Ko=()=>{'999'===N.getParameter('world')?(this.it=new Worker('worker.js',{type:'module'}),this.it.onmessage=this.onmessage,this.host=new k(this.it)):'998'===N.getParameter('world')&&(this.it={onmessage:t=>{this.stream.Xo.onmessage(t)},postMessage:t=>{this.Lo&&this.Lo.nt&&'open'===this.Lo.nt.readyState&&this.Lo.nt.send(JSON.stringify(t))},onerror:null,onmessageerror:null,terminate:()=>{throw new Error},addEventListener:()=>{throw new Error},removeEventListener:()=>{throw new Error},dispatchEvent:()=>{throw new Error}},this.Lo=new D(this.it))};onmessage=t=>{switch(t.data.type){case'ready':return void(this.So=!0);case'save':return M(t.data.value,t.data.path.split('/').pop().split('\\').pop()),void URL.revokeObjectURL(t.data.value);case'close':return void this.it?.postMessage({type:'close',id:t.data.id})}this.host?.et===t.data.id?this.stream.Xo.onmessage(t.data):this.host?.postMessage(t)};jo=async()=>{if(999==+N.getParameter('world'))this.host&&await this.host.st();else if(998==+N.getParameter('world')&&this.Lo){if(this.Lo.nt)return void console.log('You are already connected.');const t=prompt('Paste offer here, answer will be copied to clipboard');if(t)try{await this.Lo.rt(t)}catch(t){console.error(t)}}};zo=async(t,i,e,s)=>{let n=5,o=await(this.db?.Zo(t));if(o&&h.A.qo(o)!==e&&(o=void 0),o)return new r.A(o);for(;!o;){await this.Jo(s,`Requesting ${i}`);try{o=+N.getParameter('world')<998?await(0,C.$o)(`${N.ft}/${t}${e}`):await(0,C.$o)(`${N.ft}/${t}`)}catch(t){o=void 0;for(let t=n;t>0;t--)await this.Jo(s,`Error loading - Will retry in ${t} secs.`),await(0,C.Qo)(1e3);n*=2,n>60&&(n=60)}}return await(this.db?.tl(t,o)),new r.A(o)};il=async(t,i,e,s)=>{let n=await(this.db?.Zo(t+'.mid'));if(n&&12345678!==i&&h.A.qo(n)!==i&&(n=void 0),!n)try{n=+N.getParameter('world')<998?await(0,C.$o)(`${N.ft}/${t}_${i}.mid`):await(0,C.$o)(`${N.ft}/songs/${t}.mid`),e!==n.length&&(n=n.slice(0,e))}catch(t){}if(!n)return;await(this.db?.tl(t+'.mid',n));const r=new h.A(Uint8Array.from(n)).el,o=E.A.read(r,n,e,4);(0,v.sl)(o,this.Ro,s)};nl=()=>{if(w.rl.fillStyle='black',w.rl.fillRect(0,0,this.width,this.height),this.hl(1),this.Wt){this.vi=!1,w.rl.font='bold 16px helvetica, sans-serif',w.rl.textAlign='left',w.rl.fillStyle='yellow';let t=35;w.rl.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,w.rl.fillStyle='white',w.rl.fillText('To fix this try the following (in order):',30,t),t+=50,w.rl.font='bold 12px helvetica, sans-serif',w.rl.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.rl.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,w.rl.fillText('3: Try using a different game-world',30,t),t+=30,w.rl.fillText('4: Try rebooting your computer',30,t),t+=30,w.rl.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.Gt&&(this.vi=!1,w.rl.font='bold 20px helvetica, sans-serif',w.rl.textAlign='left',w.rl.fillStyle='white',w.rl.fillText('Error - unable to load game!',50,50),w.rl.fillText('To play RuneScape make sure you play from',50,100),w.rl.fillText('https://2004scape.org',50,150)),this.Ut){this.vi=!1,w.rl.font='bold 13px helvetica, sans-serif',w.rl.textAlign='left',w.rl.fillStyle='yellow';let t=35;w.rl.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,w.rl.fillStyle='white',w.rl.fillText('To fix this try the following (in order):',30,t),t+=50,w.rl.font='bold 12px helvetica, sans-serif',w.rl.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.rl.fillText('2: Try rebooting your computer, and reloading',30,t)}};ol=t=>{if(!t.ll)return!1;for(let i=0;i=s)return!1}else if(3===t.ll[i]){if(e<=s)return!1}else if(4===t.ll[i]){if(e===s)return!1}else if(e!==s)return!1}return!0};fl=(t,i,e,s,n)=>{this.Le?.draw(t,i),this.xe?.draw(t,i+n-16),y.A.fillRect(t,i+16,16,n-32,A.A.ul);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.dl),y.A.wl(t,i+h+16,A.A.yl,r),y.A.wl(t+1,i+h+16,A.A.yl,r),y.A.pl(t,i+h+16,A.A.yl,16),y.A.pl(t,i+h+17,A.A.yl,16),y.A.wl(t+15,i+h+16,A.A.Al,r),y.A.wl(t+14,i+h+17,A.A.Al,r-1),y.A.pl(t,i+h+r+15,A.A.Al,16),y.A.pl(t+1,i+h+r+14,A.A.Al,15)};ml=(t,i)=>{let e=!1;const n=s.A.Bo[t];if(!n.gl)return!1;for(let t=0;ts.delay[r.El];)r.Cl-=s.delay[r.El]+1,r.El++,r.El>=s.vl&&(r.El-=s.bl,(r.El<0||r.El>=s.vl)&&(r.El=0)),e=!0}}}return e};Tl=(t,i,e,r,h=!1)=>{if(0!==t.type||!t.gl||t.hide&&this.en!==t.id&&this.sn!==t.id&&this.nn!==t.id)return;const o=y.A.left,l=y.A.top,a=y.A.right,c=y.A.bottom;y.A.Ol(i,e,i+t.width,e+t.height);const f=t.gl.length;for(let o=0;o0&&this.kl(c),c.type===s.A.Dl)c.Nl>c.scroll-c.height&&(c.Nl=c.scroll-c.height),c.Nl<0&&(c.Nl=0),this.Tl(c,l,a,c.Nl,h),c.scroll>c.height&&this.fl(l+c.width,a,c.Nl,c.scroll,c.height);else if(c.type===s.A.Fl){let t=0;for(let i=0;i0){let i=0,e=0;const r=c.Ul[t]-1;if(s>=-32&&s<=512&&n>=-32&&n<=334||0!==this.ln&&this.hn===t){const h=p.A.Hl(r,c.Wl[t]);if(0!==this.ln&&this.hn===t&&this.rn===c.id?(i=this.Vl-this.an,e=this.Kl-this.cn,i<5&&i>-5&&(i=0),e<5&&e>-5&&(e=0),this.fn<5&&(i=0,e=0),h.Xl(128,s+i,n+e)):0!==this.mn&&this.gn===t&&this.In===c.id?h.Xl(128,s,n):h.draw(s,n),33===h.jl||1!==c.Wl[t]){const r=c.Wl[t];this.gi?.zl(s+i+1,n+10+e,this.Zl(r),A.A.ql),this.gi?.zl(s+i,n+9+e,this.Zl(r),A.A.Jl)}}}else if(c.$l&&t<20){const i=c.$l[t];i?.draw(s,n)}t++}}else if(c.type===s.A.Ql)c.fill?y.A.fillRect(l,a,c.width,c.height,c.ta):y.A.Ll(l,a,c.width,c.height,c.ta);else if(c.type===s.A.ia){const t=c.font;let i=c.ta,e=c.text;if(this.nn!==c.id&&this.sn!==c.id&&this.en!==c.id||0===c.ea||(i=c.ea),this.ol(c)&&(i=c.sa,c.na&&c.na.length>0&&(e=c.na)),c.ra===s.A.ha&&this.Cn&&(e='Please wait...',i=c.ta),!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.oa(this.al(c,0))+e.substring(t+2)}for(;;){const t=e.indexOf('%2');if(-1===t)break;e=e.substring(0,t)+this.oa(this.al(c,1))+e.substring(t+2)}for(;;){const t=e.indexOf('%3');if(-1===t)break;e=e.substring(0,t)+this.oa(this.al(c,2))+e.substring(t+2)}for(;;){const t=e.indexOf('%4');if(-1===t)break;e=e.substring(0,t)+this.oa(this.al(c,3))+e.substring(t+2)}for(;;){const t=e.indexOf('%5');if(-1===t)break;e=e.substring(0,t)+this.oa(this.al(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.la?t.aa(l+(c.width/2|0),s,r,i,c.ca):t.fa(l,s,r,i,c.ca)}}else if(c.type===s.A.ua){let t;t=this.ol(c)?c.da:c.wa,t?.draw(l,a)}else if(c.type===s.A.ya){const t=n.A.pa,i=n.A.Aa;n.A.pa=l+(c.width/2|0),n.A.Aa=a+(c.height/2|0);const e=n.A.sin[c.ma]*c.zoom>>16,s=n.A.cos[c.ma]*c.zoom>>16,r=this.ol(c);let h;h=r?c._l:c.Il;let o=null;if(-1===h)o=c.ga(-1,-1,r);else{const t=g.A.Bo[h];t.frames&&t.Ia&&(o=c.ga(t.frames[c.El],t.Ia[c.El],r))}o&&o._a(0,c.Ca,0,c.ma,0,e,s),n.A.pa=t,n.A.Aa=i}else if(c.type===s.A.Ea){const t=c.font;if(!t||!c.Ul||!c.Wl)continue;let i=0;for(let e=0;e0){const n=p.A.get(c.Ul[i]-1);let r=n.name;if((n.va||1!==c.Wl[i])&&(r=r+' x'+this.ba(c.Wl[i])),!r)continue;const h=l+s*(c.Gl+115),o=a+e*(c.Yl+12);c.la?t.aa(h+(c.width/2|0),o,r,c.ta,c.ca):t.fa(h,o,r,c.ta,c.ca)}i++}}}y.A.Ol(o,l,a,c)};kl=t=>{let i=t.Ml;if(i>=s.A.Ta&&i<=s.A.Oa)i--,i>=this.qh?(t.text='',t.ra=0):(t.text=this.lo[i],t.ra=1);else if(i>=s.A.Ra&&i<=s.A.Sa)i-=s.A.Ra,i>=this.qh?(t.text='',t.ra=0):(0===this.co[i]?t.text='@red@Offline':this.co[i]===N.ot?t.text='@gre@World-'+(this.co[i]-9):t.text='@yel@World-'+(this.co[i]-9),t.ra=1);else if(i===s.A.La)t.scroll=15*this.qh+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i>=s.A.xa&&i<=s.A.Ma)i-=s.A.xa,i>=this.As?(t.text='',t.ra=0):(t.text=I.A.ka(I.A.Da(this.gs[i])),t.ra=1);else if(i===s.A.Na)t.scroll=15*this.As+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i===s.A.Fa){if(t.ma=150,t.Ca=256*Math.sin(this.Yt/40)&2047,this.jh){this.jh=!1;const i=new d.Ae(7,null);let e=0;for(let t=0;t<7;t++){const s=this.zh[t];s>=0&&(i[e++]=_.A.Bo[s].ga())}const s=m.A.Ba(i,e);for(let t=0;t<5;t++)0!==this.Zh[t]&&(s.Pa(u.A.Ua[t][0],u.A.Ua[t][this.Zh[t]]),1===t&&s.Pa(u.A.Wa[0],u.A.Wa[this.Zh[t]]));if(this.Bh){const i=g.A.Bo[this.Bh.Ga].frames;i&&(s.Ya(),s.Ha(i[0]),s.Va(64,850,-30,-50,-30,!0),t.model=s)}}}else if(i===s.A.Ka)this.Ye||(this.Ye=t.wa,this.He=t.da),this.Xh?t.wa=this.He:t.wa=this.Ye;else if(i===s.A.Xa)this.Ye||(this.Ye=t.wa,this.He=t.da),this.Xh?t.wa=this.Ye:t.wa=this.He;else if(i===s.A.ja)t.text=this.Bn,this.Yt%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(i===s.A.za)this.Kh?this.Pn?(t.ta=A.A.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.ta=A.A.xl,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(i===s.A.Za||i===s.A.qa)if(0===this.Wn)t.text='';else{let i;i=0===this.Gn?'earlier today':1===this.Gn?'yesterday':this.Gn+' days ago',t.text='You last logged in '+i+' from: '+I.A.Ja(this.Wn)}else if(i===s.A.$a)0===this.Hn&&(t.text='0 unread messages',t.ta=A.A.Jl),1===this.Hn&&(t.text='1 unread message',t.ta=A.A.GREEN),this.Hn>1&&(t.text=this.Hn+' unread messages',t.ta=A.A.GREEN);else if(i===s.A.Qa)if(201===this.Yn)t.text='';else if(200===this.Yn)t.text='You have not yet set any password recovery questions.';else{let i;i=0===this.Yn?'Earlier today':1===this.Yn?'Yesterday':this.Yn+' days ago',t.text=i+' you changed your recovery questions'}else i===s.A.tc?201===this.Yn?t.text='':200===this.Yn?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.ic&&(201===this.Yn?t.text='':(this.Yn,t.text="Do this from the 'account management' area on our front webpage"))};al=(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.Ss[e[r++]];else if(2===t)n+=this.Ls[e[r++]];else if(3===t)n+=this.Rs[e[r++]];else if(4===t){const t=s.A.Bo[e[r++]],i=e[r++]+1;if(t.Ul&&t.Wl)for(let e=0;et<999999999?String(t):'*';ba=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};Zl=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(8370),n=e(6200),r=e(9234);async function h(){await async function(){0===s.A.getParameter('world').length&&s.A.setParameter('world','1');['0','998','999'].includes(s.A.getParameter('world'))?function(){if(+s.A.getParameter('world')>=998)return void(n.K.ft='data/pack/client');n.K.ct='http://localhost',n.K.ft='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.ot=10+i.id-1,n.K.ct=`${e.protocol}//${e.hostname}`,n.K.ft=`${e.protocol}//${e.hostname}:${e.port}`,t||(n.K.ct=n.K.ct.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.Nt():n.K.Dt()}(),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.sc)(`${s}//2004scape.org/api/v1/worldlist`))}catch(s){return await(0,r.Qo)(1e3),o(t,i,++e)}n.push({id:0,region:'Local Development',address:'http://localhost',portOffset:0,members:!0,dh:0});const h=n.find((t=>t.id===i));return h||o(t,i,10)}},8370:(t,i,e)=>{e.d(i,{A:()=>c});var s=e(1183),n=e(4583),r=e(9234);const h=['F11','F12'],o={'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}};var l=e(2595),a=e(7854);class c{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())}nc=0;rc=[];hc=0;Uo=null;state=0;oc=20;lc=1;ac=[];cc=0;fc=0;uc=[];dc=!0;wc=!1;yc=50;hasFocus=!0;Ac=!1;mc=Date.now();gc=0;Vl=0;Kl=0;Ic=0;_c=0;Cc=0;Ec=[];vc=[];bc=0;Tc=0;input=null;Oc=!1;Rc=!1;Sc=!1;time=-1;Lc=0;xc=0;Mc=0;kc=0;Dc=0;Nc=0;constructor(t=!1){a.Fc.tabIndex=-1,a.rl.fillStyle='black',a.rl.fillRect(0,0,a.Fc.width,a.Fc.height),this.wc=t,this.wc?this.resize(window.innerWidth,window.innerHeight):this.resize(a.Fc.width,a.Fc.height)}get width(){return a.Fc.width}get height(){return a.Fc.height}resize=(t,i)=>{a.Fc.width=t,a.Fc.height=i,this.Uo=new s.A(t,i),n.A.Bc()};run=async()=>{a.Fc.addEventListener('resize',(()=>{this.wc&&this.resize(window.innerWidth,window.innerHeight)}),!1),a.Fc.onmousedown=this.onmousedown,a.Fc.onmouseup=this.onmouseup,a.Fc.onmouseenter=this.onmouseenter,a.Fc.onmouseleave=this.onmouseleave,a.Fc.onmousemove=this.onmousemove,window.onbeforeunload=this.Do,a.Fc.onfocus=this.onfocus,a.Fc.onblur=this.onblur,this.Pc?(a.Fc.ontouchstart=this.ontouchstart,a.Fc.ontouchend=this.ontouchend,a.Fc.ontouchmove=this.ontouchmove):(a.Fc.onkeydown=this.onkeydown,a.Fc.onkeyup=this.onkeyup),a.Fc.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.Pc&&'low'===c.getParameter('detail')&&(this.yc=30),await this.Jo(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.ac[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.Uc();const h=e,o=s;e=300,s=1,t=performance.now();const l=this.ac[i];if(0===l?(e=h,s=o):t>l&&(e=2560*this.oc/(t-l)|0),e<25?e=25:e>256&&(e=256,s=this.oc-(t-l)/10|0),this.ac[i]=t,i=(i+1)%10,s>1)for(let t=0;t<10;t++)0!==this.ac[t]&&(this.ac[t]+=s);for(s0&&(this.cc=1e3*e/(256*this.oc)|0);const a=performance.now();if(this.dc&&this.refresh(),await this.draw(),this.uc[this.fc]=(performance.now()-a)/1e3,this.fc=(this.fc+1)%this.uc.length,this.yc<50){const i=1e3/this.yc-(performance.now()-t);i>0&&await(0,r.Qo)(i)}}-1===this.state&&this.Uc()};Uc=()=>{this.state=-2,this.Do()};hl=t=>{this.oc=1e3/t|0};Wc=t=>{this.yc=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.oc|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};Do=()=>{};draw=async()=>{};refresh=()=>{};async Jo(t,i){const e=this.width,s=this.height;this.dc&&(a.rl.fillStyle='black',a.rl.fillRect(0,0,e,s),this.dc=!1);const n=s/2-18;a.rl.fillStyle='rgb(140, 17, 17)',a.rl.rect((e/2|0)-152,n,304,34),a.rl.fillRect((e/2|0)-150,n+2,3*t,30),a.rl.fillStyle='black',a.rl.fillRect((e/2|0)-150+3*t,n+2,300-3*t,30),a.rl.font='bold 13px helvetica, sans-serif',a.rl.textAlign='center',a.rl.fillStyle='white',a.rl.fillText(i,e/2|0,n+22),await(0,r.Qo)(5)}Gc=()=>{let t=-1;return this.Tc!==this.bc&&(t=this.vc[this.bc],this.bc=this.bc+1&127),t};get ms(){const t=this.uc.length;let i=0;for(let e=0;ethis.nc&&(this.nc=e),this.rc[this.hc]=e,this.hc=(this.hc+1)%250,e}get Yc(){return this.rc.reduce(((t,i)=>t+i),0)/250}onkeydown=t=>{const i=t.key;this.mc=Date.now();const e=o[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===o.ArrowLeft.code?n=1:s===o.ArrowRight.code?n=2:s===o.ArrowUp.code?n=3:s===o.ArrowDown.code?n=4:s===o.Control.code?n=5:s===o.Shift.code?n=6:s===o.Alt.code?n=7:s===o.Backspace.code||s===o.Delete.code?n=8:s===o.Tab.code?n=9:s===o.Enter.code?n=10:s>=o.F1.code&&s<=o.F12.code?n=s+1008-o.F1.code:s===o.Home.code?n=1e3:s===o.End.code?n=1001:s===o.PageUp.code?n=1002:s===o.PageDown.code&&(n=1003),n>0&&n<128&&(this.Ec[n]=1),n>4&&(this.vc[this.Tc]=n,this.Tc=this.Tc+1&127),l.A.enabled&&l.A.Hc(n),h.includes(i)||t.preventDefault()};onkeyup=t=>{const i=t.key;this.mc=Date.now();const e=o[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===o.ArrowLeft.code?n=1:s===o.ArrowRight.code?n=2:s===o.ArrowUp.code?n=3:s===o.ArrowDown.code?n=4:s===o.Control.code?n=5:s===o.Shift.code?n=6:s===o.Alt.code?n=7:s===o.Backspace.code||s===o.Delete.code?n=8:s===o.Tab.code?n=9:s===o.Enter.code?n=10:s>=o.F1.code&&s<=o.F12.code?n=s+1008-o.F1.code:s===o.Home.code?n=1e3:s===o.End.code?n=1001:s===o.PageUp.code?n=1002:s===o.PageDown.code&&(n=1003),n>0&&n<128&&(this.Ec[n]=0),l.A.enabled&&l.A.Vc(n),h.includes(i)||t.preventDefault()};onmousedown=t=>{if(this.Oc=!1,(t.clientX>0||t.clientY>0)&&this.Kc(t),this.mc=Date.now(),this._c=this.Vl,this.Cc=this.Kl,this.Pc&&!this.Xc){if(this.jc()||this.zc()||this.Zc())return this.Ic=1,void(this.gc=1);t.timeStamp>=this.time+500?(this.Ic=2,this.gc=2):(this.Ic=1,this.gc=1)}else 2===t.button?(this.Ic=2,this.gc=2):(this.Ic=1,this.gc=1);l.A.enabled&&l.A.qc(this._c,this.Cc,t.buttons)};onmouseup=t=>{this.Kc(t),this.mc=Date.now(),this.gc=0,l.A.enabled&&l.A.Jc(t.buttons)};onmouseenter=t=>{this.Kc(t),l.A.enabled&&l.A.$c()};onmouseleave=t=>{this.Kc(t),this.mc=Date.now(),this.Vl=-1,this.Kl=-1,this.gc=0,this._c=-1,this.Cc=-1,l.A.enabled&&l.A.Qc()};onmousemove=t=>{this.Kc(t),this.mc=Date.now(),l.A.enabled&&l.A.tf(this.Vl,this.Kl)};onfocus=t=>{this.hasFocus=!0,this.dc=!0,this.refresh(),l.A.enabled&&l.A.if()};onblur=t=>{this.hasFocus=!1,l.A.enabled&&l.A.ef()};ontouchstart=t=>{if(!this.Pc)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.Oc=!0;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.Lc=this.Dc=this.Mc=0|i.screenX,this.xc=this.Nc=this.kc=0|i.screenY,this.time=t.timeStamp,this.Rc=this.sf(),this.Sc=this.nf()};ontouchend=t=>{if(!this.Pc||!this.Oc)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.Dc=0|i.screenX,this.Nc=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.Rc&&!this.sf())return void(this.Oc=!1);if(this.Sc&&!this.nf())return void(this.Oc=!1);if(this.jc()||this.rf()||this.zc()||this.Zc()){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.Zc()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.jc()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.rf()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this.hf?t.setAttribute('type','password'):t.setAttribute('type',this.Zc()?'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.hf&&(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.hf&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this.hf&&'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.Oc=!1)}const n=t.timeStamp>=this.time+500,r=Math.abs(this.Lc-this.Dc)>16||Math.abs(this.xc-this.Nc)>16;n&&!r?(this.Oc=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.gc=0,this.Oc=!1)};ontouchmove=t=>{if(!this.Pc||!this.Oc)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.Dc=0|i.screenX,this.Nc=0|i.screenY,this.Rc&&-1===this.Vo()?(this.Mc-this.Dc>0?this.rotate(2):this.Mc-this.Dc<0&&this.rotate(0),this.kc-this.Nc>0?this.rotate(3):this.kc-this.Nc<0&&this.rotate(1)):(this.Sc||-1!==this.Vo())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this.Mc=this.Dc,this.kc=this.Nc};get Pc(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get hf(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get Xc(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}sf=()=>this.Ac&&this.Vl>=8&&this.Vl<=520&&this.Kl>=11&&this.Kl<=345;jc=()=>this.Ac&&-1===this.Ho()&&!this.Go()&&!this.Yo()&&this.Vl>=11&&this.Vl<=506&&this.Kl>=449&&this.Kl<=482;rf=()=>this.Ac&&(this.Go()||this.Yo())&&this.Vl>=11&&this.Vl<=506&&this.Kl>=383&&this.Kl<=482;nf=()=>this.Ac&&this.Vl>=562&&this.Vl<=752&&this.Kl>=231&&this.Kl<=492;zc=()=>!this.Ac&&2===this.Wo()&&this.Vl>=301&&this.Vl<=562&&this.Kl>=262&&this.Kl<=279;Zc=()=>!this.Ac&&2===this.Wo()&&this.Vl>=301&&this.Vl<=562&&this.Kl>=279&&this.Kl<=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'})))};lf=()=>null!==document.fullscreenElement;Kc=t=>{if(this.lf()){const i=t.target.getBoundingClientRect(),e=window.innerHeight/a.Fc.height,s=(window.innerWidth-a.Fc.width*e)/2;this.Vl=0|this.af(t.clientX-i.left-s,0,a.Fc.width*e,0,789),this.Kl=0|this.af(t.clientY-i.top,0,a.Fc.height*e,0,532)}else{const i=a.Fc.getBoundingClientRect(),e=a.Fc.width/i.width,s=a.Fc.height/i.height;this.Vl=(t.clientX-i.left)*e|0,this.Kl=(t.clientY-i.top)*s|0}this.Vl<0&&(this.Vl=0),this.Kl<0&&(this.Kl=0),this.Vl>789&&(this.Vl=789),this.Kl>532&&(this.Kl=532)};af=(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 cf=null;static ff=null;static uf=0;static df=0;static wf=0;static yf=0;static pf=0;static Af=()=>{this.cf=s.A.Vt(1),this.ff=null,this.uf=performance.now(),this.enabled=!0};static mf=()=>{this.enabled=!1,this.cf=null};static flush=()=>{let t=null;return this.ff&&this.enabled&&(t=this.ff),this.ff=null,t};static stop=()=>{let t=null;return this.cf&&this.cf.gf>0&&this.enabled&&(t=this.cf),this.mf(),t};static qc=(t,i,e)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;this.df++;const s=performance.now();let n=(s-this.uf)/10|0;n>250&&(n=250),this.uf=s,this.If(5),1===e?this.cf?.p1(1):this.cf?.p1(2),this.cf?.p1(n),this.cf?.p3(t+(i<<10))};static Jc=t=>{if(!this.enabled)return;this.df++;const i=performance.now();let e=(i-this.uf)/10|0;e>250&&(e=250),this.uf=i,this.If(2),1===t?this.cf?.p1(3):this.cf?.p1(4),this.cf?.p1(e)};static tf=(t,i)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;const e=performance.now();if(e-this.wf>=50){this.wf=e,this.df++;let s=(e-this.uf)/10|0;s>250&&(s=250),this.uf=e,t-this.yf<8&&t-this.yf>=-8&&i-this.pf<8&&i-this.pf>=-8?(this.If(3),this.cf?.p1(5),this.cf?.p1(s),this.cf?.p1(t+(i-this.pf+8<<4)+8-this.yf)):t-this.yf<128&&t-this.yf>=-128&&i-this.pf<128&&i-this.pf>=-128?(this.If(4),this.cf?.p1(6),this.cf?.p1(s),this.cf?.p1(t+128-this.yf),this.cf?.p1(i+128-this.pf)):(this.If(5),this.cf?.p1(7),this.cf?.p1(s),this.cf?.p3(t+(i<<10))),this.yf=t,this.pf=i}};static Hc=t=>{if(!this.enabled)return;this.df++;const i=performance.now();let e=(i-this.uf)/10|0;e>250&&(e=250),this.uf=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.cf?.p1(8),this.cf?.p1(e),this.cf?.p1(t)};static Vc=t=>{if(!this.enabled)return;this.df++;const i=performance.now();let e=(i-this.uf)/10|0;e>250&&(e=250),this.uf=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.cf?.p1(9),this.cf?.p1(e),this.cf?.p1(t)};static if=()=>{if(!this.enabled)return;this.df++;const t=performance.now();let i=(t-this.uf)/10|0;i>250&&(i=250),this.uf=t,this.If(2),this.cf?.p1(10),this.cf?.p1(i)};static ef=()=>{if(!this.enabled)return;this.df++;const t=performance.now();let i=(t-this.uf)/10|0;i>250&&(i=250),this.uf=t,this.If(2),this.cf?.p1(11),this.cf?.p1(i)};static $c=()=>{if(!this.enabled)return;this.df++;const t=performance.now();let i=(t-this.uf)/10|0;i>250&&(i=250),this.uf=t,this.If(2),this.cf?.p1(12),this.cf?.p1(i)};static Qc=()=>{if(!this.enabled)return;this.df++;const t=performance.now();let i=(t-this.uf)/10|0;i>250&&(i=250),this.uf=t,this.If(2),this.cf?.p1(13),this.cf?.p1(i)};static If=t=>{if(this.cf&&this.cf.gf+t>=500){const t=this.cf;this.cf=s.A.Vt(1),this.ff=t}}}},1120:(t,i,e)=>{e.d(i,{A:()=>c});var s=e(1069),n=e(8665),r=e(2031),h=e(1122),o=e(3819),l=e(3867),a=e(8950);class c{static Bo=[];static _f=null;static Po=null;static Dl=0;static Cf=1;static Fl=2;static Ql=3;static ia=4;static ua=5;static ya=6;static Ea=7;static Ef=1;static vf=2;static bf=3;static Tf=4;static Of=5;static ha=6;static Ta=1;static Oa=100;static Ra=101;static Sa=200;static Rf=201;static Sf=202;static La=203;static Lf=205;static xf=300;static Mf=301;static kf=302;static Df=303;static Nf=304;static Ff=305;static Bf=306;static Pf=307;static Uf=308;static Wf=309;static Gf=310;static Yf=311;static Hf=312;static Vf=313;static Kf=314;static Xf=315;static jf=316;static zf=317;static Zf=318;static qf=319;static Jf=320;static $f=321;static Qf=322;static tu=323;static Ka=324;static Xa=325;static iu=326;static Fa=327;static xa=401;static Ma=500;static eu=501;static su=502;static Na=503;static ja=600;static nu=601;static ru=602;static hu=603;static ou=604;static lu=605;static au=606;static cu=607;static fu=608;static uu=609;static du=610;static wu=611;static yu=612;static za=613;static Za=650;static $a=651;static Qa=652;static tc=653;static ic=654;static qa=655;static pu=(t,i,e)=>{this._f=new r.A(5e4),this.Po=new r.A(5e4);const n=new s.A(t.read('data'));let h=-1;for(n.gf+=2;n.gf0){s.ll=new Uint8Array(r),s.cl=new Uint16Array(r);for(let t=0;t0){s.scripts=new l.Ae(o,null);for(let t=0;t0){const n=e.lastIndexOf(',');s.$l[t]=this.bu(i,e.substring(0,n),parseInt(e.substring(n+1),10))}}s.Tu=new l.Ae(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.Ql&&(s.fill=1===n.gu),s.type===c.ia||s.type===c.Cf){s.la=1===n.gu;const t=n.gu;e&&(s.font=e[t]),s.ca=1===n.gu}if(s.type===c.ia&&(s.text=n.vu,s.na=n.vu),s.type!==c.Cf&&s.type!==c.Ql&&s.type!==c.ia||(s.ta=n.el),s.type!==c.Ql&&s.type!==c.ia||(s.sa=n.el,s.ea=n.el),s.type===c.ua){const t=n.vu;if(t.length>0){const e=t.lastIndexOf(',');s.wa=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.da=this.bu(i,e.substring(0,t),parseInt(e.substring(t+1),10))}}if(s.type===c.ya){const t=n.gu;0!==t&&(s.model=this.ga((t-1<<8)+n.gu));const i=n.gu;0!==i&&(s.Ou=this.ga((i-1<<8)+n.gu)),s.Il=n.gu,0===s.Il?s.Il=-1:s.Il=(s.Il-1<<8)+n.gu,s._l=n.gu,0===s._l?s._l=-1:s._l=(s._l-1<<8)+n.gu,s.zoom=n.Au,s.ma=n.Au,s.Ca=n.Au}if(s.type===c.Ea){s.Ul=new Int32Array(s.width*s.height),s.Wl=new Int32Array(s.width*s.height),s.la=1===n.gu;const t=n.gu;e&&(s.font=e[t]),s.ca=1===n.gu,s.ta=n.el,s.Gl=n._u,s.Yl=n._u,s.Cu=1===n.gu,s.Tu=new l.Ae(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.ra!==c.vf&&s.type!==c.Fl||(s.Ru=n.vu,s.action=n.vu,s.Su=n.Au),s.ra!==c.Ef&&s.ra!==c.Tf&&s.ra!==c.Of&&s.ra!==c.ha||(s.Lu=n.vu,0===s.Lu.length&&(s.ra===c.Ef?s.Lu='Ok':s.ra===c.Tf||s.ra===c.Of?s.Lu='Select':s.ra===c.ha&&(s.Lu='Continue')))}this._f=null,this.Po=null};static bu=(t,i,e)=>{const s=o.A.xu(i)<<8n|BigInt(e);if(this._f){const t=this._f.get(s);if(t)return t}let n;try{n=h.A.Mu(t,i,e),this._f?.put(s,n)}catch(t){return null}return n};static ga=t=>{if(this.Po){const i=this.Po.get(BigInt(t));if(i)return i}const i=n.A.model(t);return this.Po?.put(BigInt(t),i),i};id=-1;mu=-1;type=-1;ra=-1;Ml=0;width=0;height=0;Iu=-1;ll=null;cl=null;scripts=null;scroll=0;hide=!1;draggable=!1;Cu=!1;Eu=!1;Gl=0;Yl=0;Bl=null;Pl=null;$l=null;Tu=null;fill=!1;la=!1;font=null;ca=!1;text=null;na=null;ta=0;sa=0;ea=0;wa=null;da=null;model=null;Ou=null;Il=-1;_l=-1;zoom=0;ma=0;Ca=0;Ru=null;action=null;Su=-1;Lu=null;gl=null;Rl=null;Sl=null;x=0;y=0;Nl=0;Ul=null;Wl=null;El=0;Cl=0;ga(t,i,e){let s=this.model;if(e&&(s=this.Ou),!s)return null;if(-1===t&&-1===i&&!s.ku)return s;const r=n.A.Du(s,!0,!0,!1);return-1===t&&-1===i||r.Ya(),-1!==t&&r.Ha(t),-1!==i&&r.Ha(i),r.Va(64,768,-50,-10,-50,!0),r}Nu(){if(this.mu===this.id)return this.x;let t=c.Bo[this.mu];if(!t.gl||!t.Rl||!t.Sl)return this.x;let i=t.gl.indexOf(this.id);if(-1===i)return this.x;let e=t.Rl[i];for(;t.mu!==t.id;){const s=c.Bo[t.mu];s.gl&&s.Rl&&s.Sl&&(i=s.gl.indexOf(t.id),-1!==i&&(e+=s.Rl[i])),t=s}return e}Fu(){if(this.mu===this.id)return this.y;let t=c.Bo[this.mu];if(!t.gl||!t.Rl||!t.Sl)return this.y;let i=t.gl.indexOf(this.id);if(-1===i)return this.y;let e=t.Sl[i];for(;t.mu!==t.id;){const s=c.Bo[t.mu];s.gl&&s.Rl&&s.Sl&&(i=s.gl.indexOf(t.id),-1!==i&&(e+=s.Sl[i])),t=s}return e}outline(t){const i=this.Nu(),e=this.Fu();a.A.Ll(i,e,this.width,this.height,t)}move(t,i){if(this.mu===this.id)return;this.x=0,this.y=0;const e=c.Bo[this.mu];if(e.gl&&e.Rl&&e.Sl){const s=e.gl.indexOf(this.id);-1!==s&&(e.Rl[s]=t,e.Sl[s]=i)}}delete(){if(this.mu===this.id)return;const t=c.Bo[this.mu];if(t.gl&&t.Rl&&t.Sl){const i=t.gl.indexOf(this.id);-1!==i&&(t.gl.splice(i,1),t.Rl.splice(i,1),t.Sl.splice(i,1))}}}},6333:(t,i,e)=>{e.d(i,{$:()=>s});class s{id;Bu=null;constructor(t){this.id=t}Pu(t){for(;;){const i=t.gu;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 Bo=[];static pu=t=>{const i=new s.A(t.read('flo.dat'));this.count=i.Au;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 Wu=(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);Yu=0;texture=-1;Hu=!1;Vu=!0;Ku=0;Xu=0;ju=0;zu=0;Zu=0;qu=0;decode(t,i){1===t?(this.Yu=i.Ju,this.setColor(this.Yu)):2===t?this.texture=i.gu:3===t?this.Hu=!0:5===t?this.Vu=!1:6===t?this.Bu=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.Ku=256*o|0,this.Xu=256*l|0,this.ju=256*a|0,this.Xu<0?this.Xu=0:this.Xu>255&&(this.Xu=255),this.ju<0?this.ju=0:this.ju>255&&(this.ju=255),this.zu=a>.5?(1-a)*l*512|0:a*l*512|0,this.zu<1&&(this.zu=1),this.Zu=o*this.zu|0;let c=this.Ku+(16*Math.random()|0)-8;c<0?c=0:c>255&&(c=255);let f=this.Xu+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255);let u=this.ju+(48*Math.random()|0)-24;u<0?u=0:u>255&&(u=255),this.qu=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 Bo=[];static pu=t=>{const i=new s.A(t.read('idk.dat'));this.count=i.Au;for(let t=0;t=40&&t<50?this.td[t-40]=i.Au:t>=50&&t<60?this.ed[t-50]=i.Au:t>=60&&t<70?this.Qu[t-60]=i.Au:console.log('Error unrecognised config code: ',t)}ga(){if(!this.$u)return null;const t=new h.Ae(this.$u.length,null);for(let i=0;i{e.d(i,{A:()=>c});var s=e(6333),n=e(1069),r=e(2031),h=e(8665),o=e(1023),l=e(6169),a=e(3867);class c extends s.${static count=0;static cache=null;static nd=null;static rd=null;static hd=0;static od=new r.A(500);static ld=new r.A(30);static pu=t=>{this.nd=new n.A(t.read('loc.dat'));const i=new n.A(t.read('loc.idx'));this.count=i.Au,this.rd=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.rd||!this.nd)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.hd=(this.hd+1)%10;const i=this.cache[this.hd];return this.nd.gf=this.rd[t],i.id=t,i.reset(),i.Pu(this.nd),i.ad||(i.ad=new Int32Array(1)),-1===i.fd&&i.ad&&(i.active=i.ad.length>0&&i.ad[0]===o.A.ud.id,i.dd&&(i.active=!0)),i};static Do=()=>{this.od=null,this.ld=null,this.rd=null,this.cache=null,this.nd=null};$u=null;ad=null;name=null;wd=null;td=null;ed=null;width=1;length=1;yd=!0;pd=!0;active=!1;fd=-1;Ad=!1;md=!1;Vu=!1;Il=-1;gd=!1;Id=16;_d=0;Cd=0;dd=null;Ed=-1;vd=-1;bd=!1;Td=!0;Od=128;Rd=128;Sd=128;Ld=0;xd=0;Md=0;kd=0;Dd=!1;decode(t,i){if(1===t){const t=i.gu;this.$u=new Int32Array(t),this.ad=new Int32Array(t);for(let e=0;e=30&&t<39)this.dd||(this.dd=new a.Ae(5,null)),this.dd[t-30]=i.vu,'hidden'===this.dd[t-30]?.toLowerCase()&&(this.dd[t-30]=null);else if(40===t){const t=i.gu;this.td=new Uint16Array(t),this.ed=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.bd!==i>3;w&&(d+=65536);let y=c.od?.get(BigInt(d));y||(y=h.A.model(65535&d),w&&y.Yd(),c.od?.put(BigInt(d),y));const p=128!==this.Od||128!==this.Rd||128!==this.Sd,A=0!==this.xd||0!==this.Md||0!==this.kd;let m=h.A.Du(y,!this.td,!this.gd,i===l.A.Hd&&-1===o&&!p&&!A);for(-1!==o&&(m.Ya(),m.Ha(o),m.Vd=null,m.Kd=null);i-- >0;)m.Xd();if(this.td&&this.ed)for(let t=0;t{e.d(i,{A:()=>l});var s=e(6333),n=e(1069),r=e(2031),h=e(8665),o=e(3867);class l extends s.${static count=0;static cache=null;static nd=null;static rd=null;static hd=0;static Po=new r.A(30);static pu=t=>{this.nd=new n.A(t.read('npc.dat'));const i=new n.A(t.read('npc.idx'));this.count=i.Au,this.rd=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.rd||!this.nd)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.hd=(this.hd+1)%20;const i=this.cache[this.hd]=new l(t);return this.nd.gf=this.rd[t],i.Pu(this.nd),i};static Do=()=>{this.Po=null,this.rd=null,this.cache=null,this.nd=null};name=null;wd=null;size=1;$u=null;Qu=null;gd=!1;Zd=-1;qd=-1;Jd=-1;$d=-1;Qd=-1;td=null;ed=null;dd=null;Od=-1;Rd=-1;Sd=-1;tw=!0;iw=-1;ew=128;sw=128;decode(t,i){if(1===t){const t=i.gu;this.$u=new Uint16Array(t);for(let e=0;e=30&&t<40)this.dd||(this.dd=new o.Ae(5,null)),this.dd[t-30]=i.vu,'hidden'===this.dd[t-30]?.toLowerCase()&&(this.dd[t-30]=null);else if(40===t){const t=i.gu;this.td=new Uint16Array(t),this.ed=new Uint16Array(t);for(let e=0;e{e.d(i,{A:()=>u});var s=e(6333),n=e(1069),r=e(1122),h=e(2031),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 nd=null;static rd=null;static hd=0;static aw=!0;static Po=new h.A(50);static cw=new h.A(200);static pu=(t,i)=>{this.aw=i,this.nd=new n.A(t.read('obj.dat'));const e=new n.A(t.read('obj.idx'));this.count=e.Au,this.rd=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.rd||!this.nd)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.hd=(this.hd+1)%10;const i=this.cache[this.hd];return this.nd.gf=this.rd[t],i.id=t,i.reset(),i.Pu(this.nd),-1!==i.fw&&i.uw(),!this.aw&&i.members&&(i.name='Members Object',i.wd="Login to a members' server to use this object.",i.dd=null,i.dw=null),i};static Do=()=>{this.Po=null,this.cw=null,this.rd=null,this.cache=null,this.nd=null};static Hl=(t,i)=>{if(u.cw){let e=u.cw.get(BigInt(t));if(e&&e.ww!==i&&-1!==e.ww&&(e.yw(),e=null),e)return e}let e=u.get(t);if(e.pw||(i=-1),e.pw&&e.Aw&&i>1){let t=-1;for(let s=0;s<10;s++)i>=e.Aw[s]&&0!==e.Aw[s]&&(t=e.pw[s]);-1!==t&&(e=u.get(t))}const s=new r.A(32,32),n=l.A.pa,h=l.A.Aa,o=l.A.mw,f=a.A.gw,d=a.A.Iw,w=a.A._w,y=a.A.left,p=a.A.right,A=a.A.top,m=a.A.bottom;l.A.Cw=!1,a.A.bind(s.gw,32,32),a.A.fillRect(0,0,32,32,c.A.ql),l.A.Bc();const g=e.Ew(1),I=l.A.sin[e.bw]*e.Tw>>16,_=l.A.cos[e.bw]*e.Tw>>16;g._a(0,e.Ow,e.Rw,e.bw,e.Sw,I+(g.zd/2|0)+e.Lw,_+e.Lw);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.gw[t+32*i]&&(t>0&&s.gw[t+32*i-1]>1||i>0&&s.gw[t+32*(i-1)]>1||t<31&&s.gw[t+32*i+1]>1||i<31&&s.gw[t+32*(i+1)]>1)&&(s.gw[t+32*i]=1);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.gw[t+32*i]&&t>0&&i>0&&s.gw[t+32*(i-1)-1]>0&&(s.gw[t+32*i]=3153952);if(-1!==e.fw){const t=this.Hl(e.xw,10),i=t.jl,s=t.ww;t.jl=32,t.ww=32,t.Mw(5,5,22,22),t.jl=i,t.ww=s}return u.cw?.put(BigInt(t),s),a.A.bind(f,d,w),a.A.Ol(y,A,p,m),l.A.pa=n,l.A.Aa=h,l.A.mw=o,l.A.Cw=!0,e.va?s.jl=33:s.jl=32,s.ww=i,s};model=0;name=null;wd=null;td=null;ed=null;Tw=2e3;bw=0;Ow=0;Rw=0;Sw=0;Lw=0;kw=!1;Dw=-1;va=!1;Nw=1;members=!1;dd=null;dw=null;Fw=-1;Bw=-1;Pw=0;Uw=-1;Ww=-1;Gw=0;Yw=-1;Hw=-1;Vw=-1;Kw=-1;Xw=-1;jw=-1;pw=null;Aw=null;xw=-1;fw=-1;decode(t,i){if(1===t)this.model=i.Au;else if(2===t)this.name=i.vu;else if(3===t)this.wd=i.vu;else if(4===t)this.Tw=i.Au;else if(5===t)this.bw=i.Au;else if(6===t)this.Ow=i.Au;else if(7===t)this.Sw=i._u,this.Sw>32767&&(this.Sw-=65536);else if(8===t)this.Lw=i._u,this.Lw>32767&&(this.Lw-=65536);else if(9===t)this.kw=!0;else if(10===t)this.Dw=i.Au;else if(11===t)this.va=!0;else if(12===t)this.Nw=i.el;else if(16===t)this.members=!0;else if(23===t)this.Fw=i.Au,this.Pw=i.Nd;else if(24===t)this.Bw=i.Au;else if(25===t)this.Uw=i.Au,this.Gw=i.Nd;else if(26===t)this.Ww=i.Au;else if(t>=30&&t<35)this.dd||(this.dd=new f.Ae(5,null)),this.dd[t-30]=i.vu,'hidden'===this.dd[t-30]?.toLowerCase()&&(this.dd[t-30]=null);else if(t>=35&&t<40)this.dw||(this.dw=new f.Ae(5,null)),this.dw[t-35]=i.vu;else if(40===t){const t=i.gu;this.td=new Uint16Array(t),this.ed=new Uint16Array(t);for(let e=0;e=100&&t<110&&(this.pw&&this.Aw||(this.pw=new Uint16Array(10),this.Aw=new Uint16Array(10)),this.pw[t-100]=i.Au,this.Aw[t-100]=i.Au)}zw(t){let i=this.Fw;if(1===t&&(i=this.Uw),-1===i)return null;let e=this.Bw,s=this.Yw;1===t&&(e=this.Ww,s=this.Hw);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.Ba(i,2)}else{const i=[n,t,o.A.model(s)];n=o.A.Ba(i,3)}}if(0===t&&0!==this.Pw&&n.translate(this.Pw,0,0),1===t&&0!==this.Gw&&n.translate(this.Gw,0,0),this.td&&this.ed)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.pw[e]);if(-1!==i)return u.get(i).Ew(1)}if(u.Po){const t=u.Po.get(BigInt(this.id));if(t)return t}const i=o.A.model(this.model);if(this.td&&this.ed)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 Bo=[];static pu=t=>{const i=new n.A(t.read('seq.dat'));this.count=i.Au;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(2031);class l extends s.${static count=0;static Bo=[];static Po=new o.A(30);static pu=t=>{const i=new n.A(t.read('spotanim.dat'));this.count=i.Au;for(let t=0;t=40&&t<50?this.td[t-40]=i.Au:t>=50&&t<60?this.ed[t-50]=i.Au:console.log('Error unrecognised spotanim config code: ',t)}ga(){let t=l.Po?.get(BigInt(this.id));if(t)return t;t=h.A.model(this.model);for(let i=0;i<6;i++)0!==this.td[0]&&t.Pa(this.td[i],this.ed[i]);return l.Po?.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 Bo=[];static iy=[];static ey=0;static pu=t=>{const i=new n.A(t.read('varp.dat'));this.count=i.Au;for(let t=0;t{e.d(i,{A:()=>s});class s{static OPEN=0;static uy=1;static wy=2;static yy=4;static py=8;static Ay=s.uy<<4;static my=s.wy<<4;static gy=s.yy<<4;static Iy=s.py<<4;static _y=256;static Cy=512;static Ey=1024;static vy=2048;static by=4096;static Ty=s.Cy<<4;static Oy=s.Ey<<4;static Ry=s.vy<<4;static Sy=s.by<<4;static Ly=s._y<<9;static xy=524288;static My=2097152;static ky=s.My|s.xy;static Dy=s._y|s.ky;static Ny=s.wy|s.Dy;static Fy=s.py|s.Dy;static By=s.wy|s.yy|s.Fy;static Py=s.my|s.Dy;static Uy=s.py|s.Ay|s.Py;static Wy=s.Iy|s.Dy;static Gy=s.uy|s.wy|s.Wy;static Yy=s.my|s.gy|s.Wy;static Hy=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 Wr=4;static Qr=104;static index=(t,i)=>t*o.Qr+i;offsetX;Vy;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.Vy=0,this.sizeX=o.Qr,this.sizeZ=o.Qr,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.Vy)]|=s.A.My};Xy=(t,i)=>{this.flags[o.index(t-this.offsetX,i-this.Vy)]&=~s.A.My};jy=(t,i,e,r,h,o)=>{let l=s.A._y;o&&(l|=s.A.Ly);const a=t-this.offsetX,c=i-this.Vy;if(h===n.A.zy||h===n.A.Zy){const t=e;e=r,r=t}for(let t=a;t=0&&t=0&&i{let l=s.A._y;o&&(l|=s.A.Ly);const a=t-this.offsetX,c=i-this.Vy;if(h===n.A.zy||h===n.A.Zy){const t=e;e=r,r=t}for(let t=a;t=0&&t=0&&i{const l=t-this.offsetX,a=i-this.Vy,c=o?s.A.Sy:s.A.Iy,f=o?s.A.by:s.A.py,u=o?s.A.Ey:s.A.wy,d=o?s.A.Oy:s.A.my,w=o?s.A.Cy:s.A.uy,y=o?s.A.Ty:s.A.Ay,p=o?s.A.vy:s.A.yy,A=o?s.A.Ry:s.A.gy;e===r.A.$y.id?h===n.A.Hd?(this.add(l,a,c),this.add(l-1,a,f)):h===n.A.zy?(this.add(l,a,u),this.add(l,a+1,d)):h===n.A.Qy?(this.add(l,a,f),this.add(l+1,a,c)):h===n.A.Zy&&(this.add(l,a,d),this.add(l,a-1,u)):e===r.A.tp.id||e===r.A.ip.id?h===n.A.Hd?(this.add(l,a,w),this.add(l-1,a+1,y)):h===n.A.zy?(this.add(l,a,p),this.add(l+1,a+1,A)):h===n.A.Qy?(this.add(l,a,y),this.add(l+1,a-1,w)):h===n.A.Zy&&(this.add(l,a,A),this.add(l-1,a-1,p)):e===r.A.ep.id&&(h===n.A.Hd?(this.add(l,a,u|c),this.add(l-1,a,f),this.add(l,a+1,d)):h===n.A.zy?(this.add(l,a,u|f),this.add(l,a+1,d),this.add(l+1,a,c)):h===n.A.Qy?(this.add(l,a,d|f),this.add(l+1,a,c),this.add(l,a-1,u)):h===n.A.Zy&&(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)};sp=(t,i,e,h,o)=>{const l=t-this.offsetX,a=i-this.Vy,c=o?s.A.Sy:s.A.Iy,f=o?s.A.by:s.A.py,u=o?s.A.Ey:s.A.wy,d=o?s.A.Oy:s.A.my,w=o?s.A.Cy:s.A.uy,y=o?s.A.Ty:s.A.Ay,p=o?s.A.vy:s.A.yy,A=o?s.A.Ry:s.A.gy;e===r.A.$y.id?h===n.A.Hd?(this.remove(l,a,c),this.remove(l-1,a,f)):h===n.A.zy?(this.remove(l,a,u),this.remove(l,a+1,d)):h===n.A.Qy?(this.remove(l,a,f),this.remove(l+1,a,c)):h===n.A.Zy&&(this.remove(l,a,d),this.remove(l,a-1,u)):e===r.A.tp.id||e===r.A.ip.id?h===n.A.Hd?(this.remove(l,a,w),this.remove(l-1,a+1,y)):h===n.A.zy?(this.remove(l,a,p),this.remove(l+1,a+1,A)):h===n.A.Qy?(this.remove(l,a,y),this.remove(l+1,a-1,w)):h===n.A.Zy&&(this.remove(l,a,A),this.remove(l-1,a-1,p)):e===r.A.ep.id&&(h===n.A.Hd?(this.remove(l,a,u|c),this.remove(l-1,a,f),this.remove(l,a+1,d)):h===n.A.zy?(this.remove(l,a,u|f),this.remove(l,a+1,d),this.remove(l+1,a,c)):h===n.A.Qy?(this.remove(l,a,d|f),this.remove(l+1,a,c),this.remove(l,a-1,u)):h===n.A.Zy&&(this.remove(l,a,d|c),this.remove(l,a-1,u),this.remove(l-1,a,f))),o&&this.sp(t,i,e,h,!1)};np=(t,i,e,h,l,a)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.Vy,u=e-this.offsetX,d=h-this.Vy,w=o.index(c,f);if(l===r.A.$y.id){if(a===n.A.Hd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Py)===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===n.A.zy){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+1&&f===d&&(this.flags[w]&s.A.Wy)===s.A.OPEN)return!0}else if(a===n.A.Qy){if(c===u+1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Py)===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===n.A.Zy){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+1&&f===d&&(this.flags[w]&s.A.Wy)===s.A.OPEN)return!0}}else if(l===r.A.ep.id){if(a===n.A.Hd){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.Wy)===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===n.A.zy){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;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Ny)===s.A.OPEN)return!0}else if(a===n.A.Qy){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.Py)===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.Zy){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Py)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Wy)===s.A.OPEN)return!0;if(c===u&&f===d-1)return!0}}else if(l===r.A.rp.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.my)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.wy)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.py)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Iy)===s.A.OPEN)return!0}return!1};hp=(t,i,e,h,l,a)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.Vy,u=e-this.offsetX,d=h-this.Vy,w=o.index(c,f);if(l===r.A.op.id||l===r.A.lp.id){if(l===r.A.lp.id&&(a=a+2&3),a===n.A.Hd){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.wy)===s.A.OPEN)return!0}else if(a===n.A.zy){if(c===u-1&&f===d&&(this.flags[w]&s.A.py)===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.Qy){if(c===u-1&&f===d&&(this.flags[w]&s.A.py)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.my)===s.A.OPEN)return!0}else if(a===n.A.Zy){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.my)===s.A.OPEN)return!0}}else if(l===r.A.ap.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.my)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.wy)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.py)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Iy)===s.A.OPEN)return!0}return!1};cp=(t,i,e,n,r,l,a)=>{const c=e+r-1,f=n+l-1,u=o.index(t-this.offsetX,i-this.Vy);return t>=e&&t<=c&&i>=n&&i<=f||(t===e-1&&i>=n&&i<=f&&(this.flags[u]&s.A.py)===s.A.OPEN&&(a&h.A.Hd)===s.A.OPEN||(t===c+1&&i>=n&&i<=f&&(this.flags[u]&s.A.Iy)===s.A.OPEN&&(a&h.A.Qy)===s.A.OPEN||(i===n-1&&t>=e&&t<=c&&(this.flags[u]&s.A.wy)===s.A.OPEN&&(a&h.A.Zy)===s.A.OPEN||i===f+1&&t>=e&&t<=c&&(this.flags[u]&s.A.my)===s.A.OPEN&&(a&h.A.zy)===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.Hy-e}}},4909:(t,i,e)=>{e.d(i,{A:()=>s});class s{static zy=1;static Qy=2;static Zy=4;static Hd=8}},6169:(t,i,e)=>{e.d(i,{A:()=>s});class s{static Hd=0;static zy=1;static Qy=2;static Zy=3}},5599:(t,i,e)=>{e.d(i,{A:()=>s});class s{static fp=0;static up=1;static dp=2;static wp=3}},1023:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5599);class n{static $y=new n(0,s.A.fp);static tp=new n(1,s.A.fp);static ep=new n(2,s.A.fp);static ip=new n(3,s.A.fp);static yp=new n(4,s.A.up);static pp=new n(5,s.A.up);static op=new n(6,s.A.up);static lp=new n(7,s.A.up);static ap=new n(8,s.A.up);static rp=new n(9,s.A.dp);static ud=new n(10,s.A.dp);static Ap=new n(11,s.A.dp);static mp=new n(12,s.A.dp);static gp=new n(13,s.A.dp);static Ip=new n(14,s.A.dp);static _p=new n(15,s.A.dp);static Cp=new n(16,s.A.dp);static Ep=new n(17,s.A.dp);static vp=new n(18,s.A.dp);static bp=new n(19,s.A.dp);static Tp=new n(20,s.A.dp);static Op=new n(21,s.A.dp);static wp=new n(22,s.A.wp);static values(){return[this.$y,this.tp,this.Ep,this._p,this.ep,this.Ip,this.rp,this.ip,this.wp,this.mp,this.Ap,this.op,this.Tp,this.ud,this.pp,this.gp,this.lp,this.yp,this.Cp,this.ap,this.bp,this.Op,this.vp]}static of(t){const i=this.values();for(let e=0;e{e.d(i,{A:()=>p});var s=e(670),n=e(2164),r=e(1069),h=e(4583),o=e(198),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 p{static Rp=Int8Array.of(1,2,4,8);static Sp=Uint8Array.of(16,32,64,128);static Lp=Int8Array.of(1,0,-1,0);static xp=Int8Array.of(0,-1,0,1);static Mp=(17*Math.random()|0)-8;static kp=(33*Math.random()|0)-16;static lt=!0;static Dp=0;static Np=!1;static Fp=(t,i)=>{let e=this.Bp(t+45365,i+91923,4)+(this.Bp(t+10294,i+37821,2)-128>>1)+(this.Bp(t,i,1)-128>>2)-128;return e=35+(.3*e|0),e<10?e=10:e>60&&(e=60),e};static Bp=(t,i,e)=>{const s=t/e|0,n=t&e-1,r=i/e|0,h=i&e-1,o=this.Pp(s,r),l=this.Pp(s+1,r),a=this.Pp(s,r+1),c=this.Pp(s+1,r+1),f=this.Up(o,l,n,e),u=this.Up(a,c,n,e);return this.Up(f,u,h,e)};static Up=(t,i,e,s)=>{const n=65536-h.A.cos[1024*e/s|0]>>1;return(t*(65536-n)>>16)+(i*n>>16)};static Pp=(t,i)=>((this.Wp(t-1,i-1)+this.Wp(t+1,i-1)+this.Wp(t-1,i+1)+this.Wp(t+1,i+1))/16|0)+((this.Wp(t-1,i)+this.Wp(t+1,i)+this.Wp(t,i-1)+this.Wp(t,i+1))/8|0)+(this.Wp(t,i)/4|0);static Wp=(t,i)=>{const e=t+57*i,s=BigInt(e<<13^e);return 255&Number((s*(s*s*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static jy=(t,i,e,s,n,r,h,o,d,w,y)=>{const A=n[y][i][e],m=n[y][i+1][e],g=n[y][i+1][e+1],I=n[y][i][e+1],_=A+m+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.wp.id)s?.Gp(C.ga(f.A.wp.id,w,A,m,g,I,-1),t,i,e,_,E,v),C.yd&&C.active&&h?.Ky(i,e),-1!==C.Il&&r.Yp(new a.A(o,t,3,i,e,c.A.Bo[C.Il],!0));else if(d===f.A.ud.id||d===f.A.Ap.id){const n=C.ga(f.A.ud.id,w,A,m,g,I,-1);if(n){let r,h,o=0;d===f.A.Ap.id&&(o+=256),w===u.A.zy||w===u.A.Zy?(r=C.length,h=C.width):(r=C.width,h=C.length),s?.jy(t,i,e,_,n,null,E,v,r,h,o)}C.yd&&h?.jy(i,e,C.width,C.length,w,C.pd),-1!==C.Il&&r.Yp(new a.A(o,t,2,i,e,c.A.Bo[C.Il],!0))}else if(d>=f.A.mp.id)s?.jy(t,i,e,_,C.ga(d,w,A,m,g,I,-1),null,E,v,1,1,0),C.yd&&h?.jy(i,e,C.width,C.length,w,C.pd),-1!==C.Il&&r.Yp(new a.A(o,t,2,i,e,c.A.Bo[C.Il],!0));else if(d===f.A.$y.id)s?.Jy(t,i,e,_,p.Rp[w],0,C.ga(f.A.$y.id,w,A,m,g,I,-1),null,E,v),C.yd&&h?.Jy(i,e,d,w,C.pd),-1!==C.Il&&r.Yp(new a.A(o,t,0,i,e,c.A.Bo[C.Il],!0));else if(d===f.A.tp.id)s?.Jy(t,i,e,_,p.Sp[w],0,C.ga(f.A.tp.id,w,A,m,g,I,-1),null,E,v),C.yd&&h?.Jy(i,e,d,w,C.pd),-1!==C.Il&&r.Yp(new a.A(o,t,0,i,e,c.A.Bo[C.Il],!0));else if(d===f.A.ep.id){const n=w+1&3;s?.Jy(t,i,e,_,p.Rp[w],p.Rp[n],C.ga(f.A.ep.id,w+4,A,m,g,I,-1),C.ga(f.A.ep.id,n,A,m,g,I,-1),E,v),C.yd&&h?.Jy(i,e,d,w,C.pd),-1!==C.Il&&r.Yp(new a.A(o,t,0,i,e,c.A.Bo[C.Il],!0))}else if(d===f.A.ip.id)s?.Jy(t,i,e,_,p.Sp[w],0,C.ga(f.A.ip.id,w,A,m,g,I,-1),null,E,v),C.yd&&h?.Jy(i,e,d,w,C.pd),-1!==C.Il&&r.Yp(new a.A(o,t,0,i,e,c.A.Bo[C.Il],!0));else if(d===f.A.rp.id)s?.jy(t,i,e,_,C.ga(d,w,A,m,g,I,-1),null,E,v,1,1,0),C.yd&&h?.jy(i,e,C.width,C.length,w,C.pd),-1!==C.Il&&r.Yp(new a.A(o,t,2,i,e,c.A.Bo[C.Il],!0));else if(d===f.A.yp.id)s?.Hp(t,i,e,_,0,0,E,C.ga(f.A.yp.id,u.A.Hd,A,m,g,I,-1),v,512*w,p.Rp[w]),-1!==C.Il&&r.Yp(new a.A(o,t,1,i,e,c.A.Bo[C.Il],!0));else if(d===f.A.pp.id){let n=16;if(s){const r=s.Vp(t,i,e);r>0&&(n=l.A.get(r>>14&32767).Id)}s?.Hp(t,i,e,_,p.Lp[w]*n,p.xp[w]*n,E,C.ga(f.A.yp.id,u.A.Hd,A,m,g,I,-1),v,512*w,p.Rp[w]),-1!==C.Il&&r.Yp(new a.A(o,t,1,i,e,c.A.Bo[C.Il],!0))}else d===f.A.op.id?(s?.Hp(t,i,e,_,0,0,E,C.ga(f.A.yp.id,u.A.Hd,A,m,g,I,-1),v,w,256),-1!==C.Il&&r.Yp(new a.A(o,t,1,i,e,c.A.Bo[C.Il],!0))):d===f.A.lp.id?(s?.Hp(t,i,e,_,0,0,E,C.ga(f.A.yp.id,u.A.Hd,A,m,g,I,-1),v,w,512),-1!==C.Il&&r.Yp(new a.A(o,t,1,i,e,c.A.Bo[C.Il],!0))):d===f.A.ap.id&&(s?.Hp(t,i,e,_,0,0,E,C.ga(f.A.yp.id,u.A.Hd,A,m,g,I,-1),v,w,768),-1!==C.Il&&r.Yp(new a.A(o,t,1,i,e,c.A.Bo[C.Il],!0)))};Kp;Xp;Zr;qr;jp;zp;Zp;qp;Jp;$p;Qp;tA;iA;eA;sA;nA;constructor(t,i,e,n){this.Kp=t,this.Xp=i,this.Zr=e,this.qr=n,this.jp=new y.rA(s.A.Wr,t,i),this.zp=new y.rA(s.A.Wr,t,i),this.Zp=new y.rA(s.A.Wr,t,i),this.qp=new y.rA(s.A.Wr,t,i),this.nA=new y.hA(s.A.Wr,t+1,i+1),this.Jp=new y.rA(s.A.Wr,t+1,i+1),this.$p=new y.$r(t+1,i+1),this.Qp=new Int32Array(i),this.tA=new Int32Array(i),this.iA=new Int32Array(i),this.eA=new Int32Array(i),this.sA=new Int32Array(i)}oA=(t,i)=>{for(let t=0;t=0&&i[s]?.Ky(e,n)}p.Mp+=(5*Math.random()|0)-2,p.Mp<-8?p.Mp=-8:p.Mp>8&&(p.Mp=8),p.kp+=(5*Math.random()|0)-2,p.kp<-16?p.kp=-16:p.kp>16&&(p.kp=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.$p[n][t]=u-d}for(let t=0;t=0&&s0){const i=n.A.Bo[e-1];this.Qp[t]+=i.Zu,this.tA[t]+=i.Xu,this.iA[t]+=i.ju,this.eA[t]+=i.zu,r=this.sA[t]++}}const h=e-5;if(h>=0&&h0){const i=n.A.Bo[e-1];this.Qp[t]-=i.Zu,this.tA[t]-=i.Xu,this.iA[t]-=i.ju,this.eA[t]-=i.zu,r=this.sA[t]--}}}if(e>=1&&e=0&&f=0&&y=1&&c0||y>0){const A=this.Zr[i][e][c],m=this.Zr[i][e+1][c],g=this.Zr[i][e+1][c+1],I=this.Zr[i][e][c+1],_=this.$p[e][c],C=this.$p[e+1][c],E=this.$p[e+1][c+1],v=this.$p[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+p.Mp&255;e+=p.kp,e<0?e=0:e>255&&(e=255),T=n.A.Uu(h,i,e)}if(i>0){let t=0!==f||this.Zp[i][e][c]===w.A.aA;y>0&&!n.A.Bo[y-1].Vu&&(t=!1),t&&A===m&&A===g&&A===I&&(this.nA[i][e][c]|=2340)}let O=0;if(-1!==b&&(O=h.A.palette[n.A.Wu(T,96)]),0===y)t?.cA(i,e,c,w.A.aA,u.A.Hd,-1,A,m,g,I,n.A.Wu(b,_),n.A.Wu(b,C),n.A.Wu(b,E),n.A.Wu(b,v),d.A.ql,d.A.ql,d.A.ql,d.A.ql,O,d.A.ql);else{const s=this.Zp[i][e][c]+1,r=this.qp[i][e][c],o=n.A.Bo[y-1];let l,a,f=o.texture;f>=0?(a=h.A.fA(f),l=-1):o.Yu===d.A.uA?(a=0,l=-2,f=-1):(l=n.A.Uu(o.Ku,o.Xu,o.ju),a=h.A.palette[n.A.Gu(o.qu,96)]),t?.cA(i,e,c,s,r,f,A,m,g,I,n.A.Wu(b,_),n.A.Wu(b,C),n.A.Wu(b,E),n.A.Wu(b,v),n.A.Gu(l,_),n.A.Gu(l,C),n.A.Gu(l,E),n.A.Gu(l,v),O,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.Xp;r++)for(let h=0;h<=this.Kp;h++){if(this.nA[s][h][r]&t){let i=r,e=r,l=s,a=s;for(;i>0&&this.nA[s][h][i-1]&t;)i--;for(;e0;){for(let s=i;s<=e;s++)if(!(this.nA[l-1][h][s]&t))break t;l--}t:for(;a=8){const s=this.Zr[a][h][i]-240,r=this.Zr[l][h][i];o.A.pA(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.nA[s][h][n]&=~t}}if(this.nA[s][h][r]&i){let t=h,e=h,l=s,a=s;for(;t>0&&this.nA[s][t-1][r]&i;)t--;for(;e0;){for(let s=t;s<=e;s++)if(!(this.nA[l-1][s][r]&i))break t;l--}t:for(;a=8){const s=this.Zr[a][t][r]-240,h=this.Zr[l][t][r];o.A.pA(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.nA[s][n][r]&=~i}}if(this.nA[s][h][r]&e){let t=h,i=h,l=r,a=r;for(;l>0&&this.nA[s][h][l-1]&e;)l--;for(;a0;){for(let i=l;i<=a;i++)if(!(this.nA[s][t-1][i]&e))break t;t--}t:for(;i=4){const r=this.Zr[s][t][l];o.A.pA(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.nA[s][n][t]&=~e}}}}}};AA=(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.qp[r][a][c]=(f-2&3)<<24>>24):f<=81?this.qr[r][a][c]=f-49<<24>>24:this.jp[r][a][c]=f-81<<24>>24}else for(;f=o.gu,0!==f;){if(1===f){o.gu;break}f<=49&&o.gu}}};gA=(t,i,e,n,h,o)=>{const l=new r.A(new Uint8Array(n));let a=-1;for(;;){const n=l.IA;if(0===n)return;a+=n;let r=0;for(;;){const n=l.IA;if(0===n)break;r+=n-1;const c=63&r,f=r>>6&63,u=r>>12,d=l.gu,w=d>>2,y=3&d,p=f+h,A=c+o;if(p>0&&A>0&&p=0&&(n=e[s]),this.jy(u,p,A,t,i,n,a,w,y)}}}};jy=(t,i,e,s,n,r,h,o,d)=>{if(p.lt){if(16&this.qr[t][i][e])return;if(this.lA(t,i,e)!==p.Dp)return}const w=this.Zr[t][i][e],y=this.Zr[t][i+1][e],A=this.Zr[t][i+1][e+1],m=this.Zr[t][i][e+1],g=w+y+A+m>>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.wp.id)(!p.lt||I.active||I.Dd)&&(s?.Gp(I.ga(f.A.wp.id,d,w,y,A,m,-1),t,i,e,g,_,C),I.yd&&I.active&&r?.Ky(i,e),-1!==I.Il&&n.Yp(new a.A(h,t,3,i,e,c.A.Bo[I.Il],!0)));else if(o===f.A.ud.id||o===f.A.Ap.id){const l=I.ga(f.A.ud.id,d,w,y,A,m,-1);if(l){let n,r,h=0;if(o===f.A.Ap.id&&(h+=256),d===u.A.zy||d===u.A.Zy?(n=I.length,r=I.width):(n=I.width,r=I.length),s?.jy(t,i,e,g,l,null,_,C,n,r,h)&&I.Td)for(let s=0;s<=n;s++)for(let n=0;n<=r;n++){let r=l._A/4|0;r>30&&(r=30),r>this.Jp[t][i+s][e+n]&&(this.Jp[t][i+s][e+n]=r<<24>>24)}}I.yd&&r?.jy(i,e,I.width,I.length,d,I.pd),-1!==I.Il&&n.Yp(new a.A(h,t,2,i,e,c.A.Bo[I.Il],!0))}else if(o>=f.A.mp.id)s?.jy(t,i,e,g,I.ga(o,d,w,y,A,m,-1),null,_,C,1,1,0),o>=f.A.mp.id&&o<=f.A.Ep.id&&o!==f.A.gp.id&&t>0&&(this.nA[t][i][e]|=2340),I.yd&&r?.jy(i,e,I.width,I.length,d,I.pd),-1!==I.Il&&n.Yp(new a.A(h,t,2,i,e,c.A.Bo[I.Il],!0));else if(o===f.A.$y.id)s?.Jy(t,i,e,g,p.Rp[d],0,I.ga(f.A.$y.id,d,w,y,A,m,-1),null,_,C),d===u.A.Hd?(I.Td&&(this.Jp[t][i][e]=50,this.Jp[t][i][e+1]=50),I.Vu&&(this.nA[t][i][e]|=585)):d===u.A.zy?(I.Td&&(this.Jp[t][i][e+1]=50,this.Jp[t][i+1][e+1]=50),I.Vu&&(this.nA[t][i][e+1]|=1170)):d===u.A.Qy?(I.Td&&(this.Jp[t][i+1][e]=50,this.Jp[t][i+1][e+1]=50),I.Vu&&(this.nA[t][i+1][e]|=585)):d===u.A.Zy&&(I.Td&&(this.Jp[t][i][e]=50,this.Jp[t][i+1][e]=50),I.Vu&&(this.nA[t][i][e]|=1170)),I.yd&&r?.Jy(i,e,o,d,I.pd),-1!==I.Il&&n.Yp(new a.A(h,t,0,i,e,c.A.Bo[I.Il],!0)),16!==I.Id&&s?.CA(t,i,e,I.Id);else if(o===f.A.tp.id)s?.Jy(t,i,e,g,p.Sp[d],0,I.ga(f.A.tp.id,d,w,y,A,m,-1),null,_,C),I.Td&&(d===u.A.Hd?this.Jp[t][i][e+1]=50:d===u.A.zy?this.Jp[t][i+1][e+1]=50:d===u.A.Qy?this.Jp[t][i+1][e]=50:d===u.A.Zy&&(this.Jp[t][i][e]=50)),I.yd&&r?.Jy(i,e,o,d,I.pd),-1!==I.Il&&n.Yp(new a.A(h,t,0,i,e,c.A.Bo[I.Il],!0));else if(o===f.A.ep.id){const l=d+1&3;s?.Jy(t,i,e,g,p.Rp[d],p.Rp[l],I.ga(f.A.ep.id,d+4,w,y,A,m,-1),I.ga(f.A.ep.id,l,w,y,A,m,-1),_,C),I.Vu&&(d===u.A.Hd?(this.nA[t][i][e]|=265,this.nA[t][i][e+1]|=1170):d===u.A.zy?(this.nA[t][i][e+1]|=1170,this.nA[t][i+1][e]|=585):d===u.A.Qy?(this.nA[t][i+1][e]|=585,this.nA[t][i][e]|=1170):d===u.A.Zy&&(this.nA[t][i][e]|=1170,this.nA[t][i][e]|=585)),I.yd&&r?.Jy(i,e,o,d,I.pd),-1!==I.Il&&n.Yp(new a.A(h,t,0,i,e,c.A.Bo[I.Il],!0)),16!==I.Id&&s?.CA(t,i,e,I.Id)}else if(o===f.A.ip.id)s?.Jy(t,i,e,g,p.Sp[d],0,I.ga(f.A.ip.id,d,w,y,A,m,-1),null,_,C),I.Td&&(d===u.A.Hd?this.Jp[t][i][e+1]=50:d===u.A.zy?this.Jp[t][i+1][e+1]=50:d===u.A.Qy?this.Jp[t][i+1][e]=50:d===u.A.Zy&&(this.Jp[t][i][e]=50)),I.yd&&r?.Jy(i,e,o,d,I.pd),-1!==I.Il&&n.Yp(new a.A(h,t,0,i,e,c.A.Bo[I.Il],!0));else if(o===f.A.rp.id)s?.jy(t,i,e,g,I.ga(o,d,w,y,A,m,-1),null,_,C,1,1,0),I.yd&&r?.jy(i,e,I.width,I.length,d,I.pd),-1!==I.Il&&n.Yp(new a.A(h,t,2,i,e,c.A.Bo[I.Il],!0));else if(o===f.A.yp.id)s?.Hp(t,i,e,g,0,0,_,I.ga(f.A.yp.id,u.A.Hd,w,y,A,m,-1),C,512*d,p.Rp[d]),-1!==I.Il&&n.Yp(new a.A(h,t,1,i,e,c.A.Bo[I.Il],!0));else if(o===f.A.pp.id){let r=16;if(s){const n=s.Vp(t,i,e);n>0&&(r=l.A.get(n>>14&32767).Id)}s?.Hp(t,i,e,g,p.Lp[d]*r,p.xp[d]*r,_,I.ga(f.A.yp.id,u.A.Hd,w,y,A,m,-1),C,512*d,p.Rp[d]),-1!==I.Il&&n.Yp(new a.A(h,t,1,i,e,c.A.Bo[I.Il],!0))}else o===f.A.op.id?(s?.Hp(t,i,e,g,0,0,_,I.ga(f.A.yp.id,u.A.Hd,w,y,A,m,-1),C,d,256),-1!==I.Il&&n.Yp(new a.A(h,t,1,i,e,c.A.Bo[I.Il],!0))):o===f.A.lp.id?(s?.Hp(t,i,e,g,0,0,_,I.ga(f.A.yp.id,u.A.Hd,w,y,A,m,-1),C,d,512),-1!==I.Il&&n.Yp(new a.A(h,t,1,i,e,c.A.Bo[I.Il],!0))):o===f.A.ap.id&&(s?.Hp(t,i,e,g,0,0,_,I.ga(f.A.yp.id,u.A.Hd,w,y,A,m,-1),C,d,768),-1!==I.Il&&n.Yp(new a.A(h,t,1,i,e,c.A.Bo[I.Il],!0)))};lA=(t,i,e)=>8&this.qr[t][i][e]?0:t<=0||!(2&this.qr[1][i][e])?t:t-1}},198:(t,i,e)=>{e.d(i,{A:()=>g});var s=e(4583);class n{level;y;x;z;model;EA;vA;bA;TA;OA;RA;SA;info;LA=0;xA=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.EA=r,this.vA=h,this.bA=o,this.TA=l,this.OA=a,this.RA=c,this.SA=f,this.info=u}}var r=e(3795);class h{MA;Kp;kA;Xp;type;DA;NA;FA;BA;PA;zd;mode=0;UA=0;WA=0;GA=0;YA=0;HA=0;VA=0;constructor(t,i,e,s,n,r,h,o,l,a,c){this.MA=t,this.Kp=i,this.kA=e,this.Xp=s,this.type=n,this.DA=r,this.NA=h,this.FA=o,this.BA=l,this.PA=a,this.zd=c}}var o=e(670);class l{y;x;z;model;SA;info;constructor(t,i,e,s,n,r){this.y=t,this.x=i,this.z=e,this.model=s,this.SA=n,this.info=r}}class a{y;x;z;KA;XA;jA;zA;SA;info;constructor(t,i,e,s,n,r,h,o,l){this.y=t,this.x=i,this.z=e,this.KA=s,this.XA=n,this.jA=r,this.zA=h,this.SA=o,this.info=l}}class c{y;x;z;type;angle;model;SA;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.SA=h,this.info=o}}var f=e(6666);class u{y;x;z;ZA;qA;JA;SA;offset;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.ZA=s,this.qA=n,this.JA=r,this.SA=h,this.offset=o}}class d{$A;QA;tm;im;sm;color;flat;constructor(t,i,e,s,n,r,h){this.$A=t,this.QA=i,this.tm=e,this.im=s,this.sm=n,this.color=r,this.flat=h}}var w=e(8950);class y{static nm=new Int32Array(6);static rm=new Int32Array(6);static hm=new Int32Array(6);static om=new Int32Array(6);static lm=new Int32Array(6);static am=[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 fm=[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 um=128;static dm=this.um/2|0;static wm=this.um/4|0;static ym=3*this.um/4|0;Pd;Wd;Ud;pm;Am;gm;Im;_m;Cm;Em;flat;shape;angle;vm;bm;constructor(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w,p,A,m,g){this.flat=!(A!==s||A!==d||A!==o),this.shape=i,this.angle=r,this.vm=u,this.bm=l;const I=y.am[i],_=I.length;this.Pd=new Int32Array(_),this.Wd=new Int32Array(_),this.Ud=new Int32Array(_);const C=new Int32Array(_),E=new Int32Array(_),v=t*y.um,b=m*y.um;for(let t=0;t<_;t++){let i,l,c,u,m,_=I[t];!(1&_)&&_<=8&&(_=1+(_-r-r-1&7)),_>8&&_<=12&&(_=9+(_-r-9&3)),_>12&&_<=16&&(_=13+(_-r-13&3)),1===_?(i=v,l=b,c=A,u=h,m=a):2===_?(i=v+y.dm,l=b,c=A+s>>1,u=h+g>>1,m=a+e>>1):3===_?(i=v+y.um,l=b,c=s,u=g,m=e):4===_?(i=v+y.um,l=b+y.dm,c=s+d>>1,u=g+n>>1,m=e+w>>1):5===_?(i=v+y.um,l=b+y.um,c=d,u=n,m=w):6===_?(i=v+y.dm,l=b+y.um,c=d+o>>1,u=n+p>>1,m=w+f>>1):7===_?(i=v,l=b+y.um,c=o,u=p,m=f):8===_?(i=v,l=b+y.dm,c=o+A>>1,u=p+h>>1,m=f+a>>1):9===_?(i=v+y.dm,l=b+y.wm,c=A+s>>1,u=h+g>>1,m=a+e>>1):10===_?(i=v+y.ym,l=b+y.dm,c=s+d>>1,u=g+n>>1,m=e+w>>1):11===_?(i=v+y.dm,l=b+y.ym,c=d+o>>1,u=n+p>>1,m=w+f>>1):12===_?(i=v+y.wm,l=b+y.dm,c=o+A>>1,u=p+h>>1,m=f+a>>1):13===_?(i=v+y.wm,l=b+y.wm,c=A,u=h,m=a):14===_?(i=v+y.ym,l=b+y.wm,c=s,u=g,m=e):15===_?(i=v+y.ym,l=b+y.ym,c=d,u=n,m=w):(i=v+y.wm,l=b+y.ym,c=o,u=p,m=f),this.Pd[t]=i,this.Wd[t]=c,this.Ud[t]=l,C[t]=u,E[t]=m}const T=y.fm[i],O=T.length/4|0;this.Im=new Int32Array(O),this._m=new Int32Array(O),this.Cm=new Int32Array(O),this.pm=new Int32Array(O),this.Am=new Int32Array(O),this.gm=new Int32Array(O),this.Em=-1!==c?new Int32Array(O):null;let R=0;for(let t=0;t{this.Dm=0,this.Nm=0,this.Fm=t,this.Bm=i,this.Pm=t/2|0,this.Um=i/2|0;const h=new m.Om(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let i=0;i<2048;i+=64){this.Wm=s.A.sin[t],this.Gm=s.A.cos[t],this.Ym=s.A.sin[i],this.Hm=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.Ig(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.Tm[t][i][e+25][s+25]=n}};static Do=()=>{this.Rm=null,this.Sm=null,this.Lm=null,this.km=null,this.Tm=null,this.Mm=null,this.eg=null,console.log('World3D unloaded!')};static pA=(t,i,e,s,n,r,o,l)=>{g.Lm[t][g.Sm[t]++]=new h(e/128|0,r/128|0,n/128|0,l/128|0,i,e,r,n,l,s,o)};static Ig=(t,i,e)=>{const s=i*this.Ym+t*this.Hm>>16,n=i*this.Hm-t*this.Ym>>16,r=e*this.Wm+n*this.Gm>>16,h=e*this.Gm-n*this.Wm>>16;if(r<50||r>3500)return!1;const o=this.Pm+((s<<9)/r|0),l=this.Um+((h<<9)/r|0);return o>=this.Dm&&o<=this.Fm&&l>=this.Nm&&l<=this.Bm};_g;Kp;Xp;Cg;Eg;Rh;vg;bg;Tg;Og=0;Rg=0;Sg=0;constructor(t,i,e,s){this._g=e,this.Kp=s,this.Xp=i,this.Eg=new m.Lh(e,s,i,null),this.vg=new m.hA(e,s+1,i+1),this.Cg=t,this.Rh=new m.Ae(5e3,null),this.bg=new Int32Array(1e4),this.Tg=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this.Rg=t;for(let i=0;i{const e=this.Eg[0][t][i];for(let e=0;e<3;e++){this.Eg[e][t][i]=this.Eg[e+1][t][i];const s=this.Eg[e][t][i];s&&s.level--}this.Eg[0][t][i]||(this.Eg[0][t][i]=new r.A(0,t,i));const s=this.Eg[0][t][i];s&&(s.xg=e),this.Eg[3][t][i]=null};dA=(t,i,e,s)=>{const n=this.Eg[t][i][e];n&&(n.Mg=s)};cA=(t,i,e,s,n,h,o,l,a,c,f,u,w,A,m,g,I,_,C,E)=>{if(s===p.A.aA){for(let s=t;s>=0;s--)this.Eg[s][i][e]||(this.Eg[s][i][e]=new r.A(s,i,e));const s=this.Eg[t][i][e];s&&(s.kg=new d(f,u,w,A,-1,C,!1))}else if(s===p.A.Dg){for(let s=t;s>=0;s--)this.Eg[s][i][e]||(this.Eg[s][i][e]=new r.A(s,i,e));const s=this.Eg[t][i][e];s&&(s.kg=new d(m,g,I,_,h,E,o===l&&o===a&&o===c))}else{for(let s=t;s>=0;s--)this.Eg[s][i][e]||(this.Eg[s][i][e]=new r.A(s,i,e));const d=this.Eg[t][i][e];d&&(d.Ng=new y(i,s,g,l,w,n,f,c,E,m,h,_,C,a,I,A,o,e,u))}};Gp=(t,i,e,s,n,h,o)=>{this.Eg[i][e][s]||(this.Eg[i][e][s]=new r.A(i,e,s));const a=this.Eg[i][e][s];a&&(a.Fg=new l(n,128*e+64,128*s+64,t,h,o))};Bg=(t,i,e)=>{const s=this.Eg[t][i][e];s&&(s.Fg=null)};Pg=(t,i,e,s,n,h,o,l)=>{let a=0;const c=this.Eg[s][t][i];if(c)for(let t=0;ta&&(a=e)}else this.Eg[s][t][i]=new r.A(s,t,i);const f=this.Eg[s][t][i];f&&(f.Gg=new u(e,128*t+64,128*i+64,h,o,l,n,a))};Yg=(t,i,e)=>{const s=this.Eg[t][i][e];s&&(s.Gg=null)};Jy=(t,i,e,s,n,h,o,l,c,f)=>{if(!o&&!l)return;for(let s=t;s>=0;s--)this.Eg[s][i][e]||(this.Eg[s][i][e]=new r.A(s,i,e));const u=this.Eg[t][i][e];u&&(u.Hg=new a(s,128*i+64,128*e+64,n,h,o,l,c,f))};sp=(t,i,e,s)=>{const n=this.Eg[t][i][e];1===s&&n&&(n.Hg=null)};Hp=(t,i,e,s,n,h,o,l,a,f,u)=>{if(!l)return;for(let s=t;s>=0;s--)this.Eg[s][i][e]||(this.Eg[s][i][e]=new r.A(s,i,e));const d=this.Eg[t][i][e];d&&(d.Vg=new c(s,128*i+n+64,128*e+h+64,u,f,l,o,a))};Kg=(t,i,e)=>{const s=this.Eg[t][i][e];s&&(s.Vg=null)};CA=(t,i,e,s)=>{const n=this.Eg[t][i][e];if(!n)return;const r=n.Vg;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)};Xg=(t,i,e,s)=>{if(!s)return;const n=this.Eg[t][i][e];if(!n)return;const r=n.Vg;r&&(r.model=s)};jg=(t,i,e,s)=>{if(!s)return;const n=this.Eg[t][i][e];if(!n)return;const r=n.Fg;r&&(r.model=s)};zg=(t,i,e,s)=>{if(!s)return;const n=this.Eg[t][i][e];if(!n)return;const r=n.Hg;r&&(r.jA=s)};Zg=(t,i,e,s,n)=>{if(!s)return;const r=this.Eg[e][t][i];if(!r)return;const h=r.Hg;h&&(h.jA=s,h.zA=n)};jy=(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.qg(f,u,s,t,i,e,l,a,n,r,h,o,c,!1)};Jg=(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.qg(i,s,e,t,c,f,u+1-c,d-f+1,n,r,h,0,o,!0)};$g=(t,i,e,s,n,r,h,o,l,a,c,f)=>!l&&!a||this.qg(i,s,e,t,n,r,h+1-n,o-r+1,l,a,c,0,f,!0);qy=(t,i,e)=>{const s=this.Eg[t][i][e];if(s)for(let t=0;t>29&3)&&n.bA===i&&n.OA===e)return void this.Qg(n)}};tI=(t,i,e,s)=>{if(!s)return;const n=this.Eg[t][i][e];if(n)for(let t=0;t>29&3))return void(i.model=s)}};iI=()=>{for(let t=0;t{const s=this.Eg[t][i][e];return s&&s.Hg?s.Hg.SA:0};eI=(t,i,e)=>{const s=this.Eg[t][e][i];return s&&s.Vg?s.Vg.SA:0};sI=(t,i,e)=>{const s=this.Eg[t][i][e];if(!s)return 0;for(let t=0;t>29&3)&&n.bA===i&&n.OA===e)return n.SA}return 0};nI=(t,i,e)=>{const s=this.Eg[t][i][e];return s&&s.Fg?s.Fg.SA:0};rI=(t,i,e,s)=>{const n=this.Eg[t][i][e];if(n){if(n.Hg&&n.Hg.SA===s)return 255&n.Hg.info;if(n.Vg&&n.Vg.SA===s)return 255&n.Vg.info;if(n.Fg&&n.Fg.SA===s)return 255&n.Fg.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.Eg[t][i+1][e-1];n&&n.Fg&&n.Fg.model&&n.Fg.model.hI&&this.lI(s,n.Fg.model,128,0,-128,!0)}};oI=(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._g){for(let u=o;u<=l;u++)if(!(u<0||u>=this.Kp))for(let o=a;o<=c;o++){if(o<0||o>=this.Xp||h&&u=e||u===i))continue;const a=this.Eg[f][u][o];if(!a)continue;const d=128*(u-i)+64*(1-s),w=128*(o-e)+64*(1-n),y=((this.Cg[f][u][o]+this.Cg[f][u+1][o]+this.Cg[f][u][o+1]+this.Cg[f][u+1][o+1])/4|0)-((this.Cg[t][i][e]+this.Cg[t][i+1][e]+this.Cg[t][i][e+1]+this.Cg[t][i+1][e+1])/4|0),p=a.Hg;p&&p.jA&&p.jA.hI&&this.lI(r,p.jA,d,y,w,h),p&&p.zA&&p.zA.hI&&this.lI(r,p.zA,d,y,w,h);for(let t=0;t{this.Sg++;let h=0;const o=i.Pd,l=i.Bd;if(t.hI&&t.fI)for(let r=0;ri.PA)continue;const u=t.Pd[r]-e;if(ui.NA)continue;const d=t.Ud[r]-n;if(di.BA)continue;if(i.hI&&i.fI)for(let t=0;t{const h=this.Eg[t][i][e];if(!h)return;const o=h.kg;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.Ng;if(!l)return;const a=l.shape,c=l.angle,f=l.vm,u=l.bm,d=g.wg[a],w=g.yg[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.ig=!0,g.Vl=t,g.Kl=i,g.mg=-1,g.gg=-1};draw=(t,i,e,n,r,h,o)=>{t<0?t=0:t>=128*this.Kp&&(t=128*this.Kp-1),e<0?e=0:e>=128*this.Xp&&(e=128*this.Xp-1),g.xA++,g.Wm=s.A.sin[h],g.Gm=s.A.cos[h],g.Ym=s.A.sin[r],g.Hm=s.A.cos[r],g.eg=g.Tm[(h-128)/32|0][r/64|0],g.Vm=t,g.Km=i,g.Xm=e,g.jm=t/128|0,g.zm=e/128|0,g.Qm=n,g.Zm=g.jm-25,g.Zm<0&&(g.Zm=0),g.Jm=g.zm-25,g.Jm<0&&(g.Jm=0),g.qm=g.jm+25,g.qm>this.Kp&&(g.qm=this.Kp),g.$m=g.zm+25,g.$m>this.Xp&&(g.$m=this.Xp),this.mI(),g.tg=0;for(let t=this.Rg;t=2e3)?(h.visible=!0,h.update=!0,h.gI=h.Ug>0,g.tg++):(h.visible=!1,h.update=!1,h.II=0))}}for(let t=this.Rg;t=g.qm))for(let t=-25;t<=0;t++){const n=g.zm+t,r=g.zm-t;let h;if(e>=g.Zm&&(n>=g.Jm&&(h=i[e][n],h&&h.visible&&this._I(h,!0,o)),r=g.Jm&&(h=i[s][n],h&&h.visible&&this._I(h,!0,o)),r=g.qm))for(let t=-25;t<=0;t++){const n=g.zm+t,r=g.zm-t;let h;if(e>=g.Zm&&(n>=g.Jm&&(h=i[e][n],h&&h.visible&&this._I(h,!1,o)),r=g.Jm&&(h=i[s][n],h&&h.visible&&this._I(h,!1,o)),r{if(!c&&!f)return!1;for(let t=h;t=this.Kp||i>=this.Xp)return!1;const e=this.Eg[s][t][i];if(e&&e.Ug>=5)return!1}const p=new n(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.Eg[e][t][i]||(this.Eg[e][t][i]=new r.A(e,t,i));const n=this.Eg[s][t][i];n&&(n.Wg[n.Ug]=p,n.CI[n.Ug]=e,n.EI|=e,n.Ug++)}return y&&(this.Rh[this.Og++]=p),!0};Qg=t=>{for(let i=t.bA;i<=t.TA;i++)for(let e=t.OA;e<=t.RA;e++){const s=this.Eg[t.level][i][e];if(s){for(let i=0;i{const t=g.Sm[g.Qm],i=g.Lm[g.Qm];g.Ag=0;for(let e=0;e=0&&s<=50){n=t.kA+25-g.zm,n<0&&(n=0),r=t.Xp+25-g.zm,r>50&&(r=50);let i=!1;for(;n<=r;)if(g.eg&&g.eg[s][n++]){i=!0;break}if(i){if(h=g.Vm-t.DA,h>32)t.mode=1;else{if(h>=-32)continue;t.mode=2,h=-h}t.GA=(t.FA-g.Xm<<8)/h|0,t.YA=(t.BA-g.Xm<<8)/h|0,t.HA=(t.PA-g.Km<<8)/h|0,t.VA=(t.zd-g.Km<<8)/h|0,g.Mm[g.Ag++]=t}}}else if(2===t.type){if(s=t.kA+25-g.zm,s>=0&&s<=50){n=t.MA+25-g.jm,n<0&&(n=0),r=t.Kp+25-g.jm,r>50&&(r=50);let i=!1;for(;n<=r;)if(g.eg&&g.eg[n++][s]){i=!0;break}if(i){if(h=g.Xm-t.FA,h>32)t.mode=3;else{if(h>=-32)continue;t.mode=4,h=-h}t.UA=(t.DA-g.Vm<<8)/h|0,t.WA=(t.NA-g.Vm<<8)/h|0,t.HA=(t.PA-g.Km<<8)/h|0,t.VA=(t.zd-g.Km<<8)/h|0,g.Mm[g.Ag++]=t}}}else if(4===t.type&&(s=t.PA-g.Km,s>128&&(n=t.kA+25-g.zm,n<0&&(n=0),r=t.Xp+25-g.zm,r>50&&(r=50),n<=r))){let i=t.MA+25-g.jm;i<0&&(i=0),h=t.Kp+25-g.jm,h>50&&(h=50);let e=!1;t:for(let t=i;t<=h;t++)for(let i=n;i<=r;i++)if(g.eg&&g.eg[t][i]){e=!0;break t}e&&(t.mode=5,t.UA=(t.DA-g.Vm<<8)/s|0,t.WA=(t.NA-g.Vm<<8)/s|0,t.GA=(t.FA-g.Xm<<8)/s|0,t.YA=(t.BA-g.Xm<<8)/s|0,g.Mm[g.Ag++]=t)}}};_I=(t,i,e)=>{for(g.km.Yp(t);;){let t;do{if(t=g.km.vI(),!t)return}while(!t.update);const s=t.x,n=t.z,r=t.level,h=t.bI,o=this.Eg[r];if(t.visible){if(i){if(r>0){const t=this.Eg[r-1][s][n];if(t&&t.update)continue}if(s<=g.jm&&s>g.Zm){const i=o[s-1][n];if(i&&i.update&&(i.visible||!(1&t.EI)))continue}if(s>=g.jm&&sg.Jm){const i=o[s][n-1];if(i&&i.update&&(i.visible||!(8&t.EI)))continue}if(n>=g.zm&&nn&&(a+=6),c=g.sg[a],t.SI=g.rg[a]),f&&(f.KA&g.ng[a]?16===f.KA?(t.II=3,t.LI=g.hg[a],t.xI=3-t.LI):32===f.KA?(t.II=6,t.LI=g.og[a],t.xI=6-t.LI):64===f.KA?(t.II=12,t.LI=g.lg[a],t.xI=12-t.LI):(t.II=9,t.LI=g.ag[a],t.xI=9-t.LI):t.II=0,f.KA&c&&!this.MI(h,s,n,f.KA)&&f.jA?.draw(0,g.Wm,g.Gm,g.Ym,g.Hm,f.x-g.Vm,f.y-g.Km,f.z-g.Xm,f.SA),f.XA&c&&!this.MI(h,s,n,f.XA)&&f.zA?.draw(0,g.Wm,g.Gm,g.Ym,g.Hm,f.x-g.Vm,f.y-g.Km,f.z-g.Xm,f.SA)),u&&!this.visible(h,s,n,u.model.zd))if(u.type&c)u.model.draw(u.angle,g.Wm,g.Gm,g.Ym,g.Hm,u.x-g.Vm,u.y-g.Km,u.z-g.Xm,u.SA);else if(768&u.type){const t=u.x-g.Vm,i=u.y-g.Km,e=u.z-g.Xm,s=u.angle;let n,r;if(n=s===A.A.zy||s===A.A.Qy?-t:t,r=s===A.A.Qy||s===A.A.Zy?-e:e,256&u.type&&rn){const n=t+g.ug[s],r=e+g.dg[s];u.model.draw(512*s+1280&2047,g.Wm,g.Gm,g.Ym,g.Hm,n,i,r,u.SA)}}if(l){const i=t.Fg;i&&i.model?.draw(0,g.Wm,g.Gm,g.Ym,g.Hm,i.x-g.Vm,i.y-g.Km,i.z-g.Xm,i.SA);const e=t.Gg;e&&0===e.offset&&(e.JA&&e.JA.draw(0,g.Wm,g.Gm,g.Ym,g.Hm,e.x-g.Vm,e.y-g.Km,e.z-g.Xm,e.SA),e.qA&&e.qA.draw(0,g.Wm,g.Gm,g.Ym,g.Hm,e.x-g.Vm,e.y-g.Km,e.z-g.Xm,e.SA),e.ZA&&e.ZA.draw(0,g.Wm,g.Gm,g.Ym,g.Hm,e.x-g.Vm,e.y-g.Km,e.z-g.Xm,e.SA))}const d=t.EI;if(0!==d){if(sg.jm&&1&d){const t=o[s-1][n];t&&t.update&&g.km.Yp(t)}if(n>g.zm&&8&d){const t=o[s][n-1];t&&t.update&&g.km.Yp(t)}}}if(0!==t.II){let i=!0;for(let e=0;ei.bA&&(r+=1),ei.OA&&(r+=8),ss&&(s=n);const h=g.zm-i.OA,l=i.RA-g.zm;i.LA=l>h?s+l:s+h}for(;;){let t=-50,i=-1;for(let e=0;et&&(t=s.LA,i=e))}if(-1===i)break;const l=g.Rm[i];if(l){l.xA=g.xA;let t=l.model;t||(t=l.EA?.draw(e)??null),t&&!this.kI(h,l.bA,l.TA,l.OA,l.RA,t.zd)&&t.draw(l.vA,g.Wm,g.Gm,g.Ym,g.Hm,l.x-g.Vm,l.y-g.Km,l.z-g.Xm,l.SA);for(let t=l.bA;t<=l.TA;t++)for(let i=l.OA;i<=l.RA;i++){const e=o[t][i];e&&(0!==e.II?g.km.Yp(e):t===s&&i===n||!e.update||g.km.Yp(e))}}}if(t.gI)continue}if(!t.update||0!==t.II)continue;if(s<=g.jm&&s>g.Zm){const t=o[s-1][n];if(t&&t.update)continue}if(s>=g.jm&&sg.Jm){const t=o[s][n-1];if(t&&t.update)continue}if(n>=g.zm&&n=r){const r=t+g.cg[n],h=s+g.fg[n];i.model.draw(512*n+256,g.Wm,g.Gm,g.Ym,g.Hm,r,e,h,i.SA)}if(512&i.type&&h<=r){const r=t+g.ug[n],h=s+g.dg[n];i.model.draw(512*n+1280&2047,g.Wm,g.Gm,g.Ym,g.Hm,r,e,h,i.SA)}}const e=t.Hg;e&&(e.XA&t.SI&&!this.MI(h,s,n,e.XA)&&e.zA?.draw(0,g.Wm,g.Gm,g.Ym,g.Hm,e.x-g.Vm,e.y-g.Km,e.z-g.Xm,e.SA),e.KA&t.SI&&!this.MI(h,s,n,e.KA)&&e.jA?.draw(0,g.Wm,g.Gm,g.Ym,g.Hm,e.x-g.Vm,e.y-g.Km,e.z-g.Xm,e.SA))}if(rg.jm){const t=o[s-1][n];t&&t.update&&g.km.Yp(t)}if(n>g.zm){const t=o[s][n-1];t&&t.update&&g.km.Yp(t)}}};OI=(t,i,e,n,r,h,o,l)=>{let a,c,f,u,d=a=(e<<7)-g.Vm,y=c=(n<<7)-g.Xm,p=f=d+128,A=u=y+128,m=this.Cg[i][e][n]-g.Km,I=this.Cg[i][e+1][n]-g.Km,_=this.Cg[i][e+1][n+1]-g.Km,C=this.Cg[i][e][n+1]-g.Km,E=y*o+d*l>>16;if(y=y*l-d*o>>16,d=E,E=m*h-y*r>>16,y=m*r+y*h>>16,m=E,y<50)return;if(E=c*o+p*l>>16,c=c*l-p*o>>16,p=E,E=I*h-c*r>>16,c=I*r+c*h>>16,I=E,c<50)return;if(E=A*o+f*l>>16,A=A*l-f*o>>16,f=E,E=_*h-A*r>>16,A=_*r+A*h>>16,_=E,A<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.pa+((d<<9)/y|0),b=s.A.Aa+((m<<9)/y|0),T=s.A.pa+((p<<9)/c|0),O=s.A.Aa+((I<<9)/c|0),R=s.A.pa+((f<<9)/A|0),S=s.A.Aa+((_<<9)/A|0),L=s.A.pa+((a<<9)/u|0),x=s.A.Aa+((C<<9)/u|0);if(s.A.alpha=0,(R-L)*(O-x)-(S-x)*(T-L)>0)if(s.A.DI=R<0||L<0||T<0||R>w.A.NI||L>w.A.NI||T>w.A.NI,g.ig&&this.FI(g.Vl,g.Kl,S,x,O,R,L,T)&&(g.mg=e,g.gg=n),-1===t.sm)12345678!==t.tm&&s.A.BI(R,L,T,S,x,O,t.tm,t.im,t.QA);else if(g.lt){const i=g.pg[t.sm];s.A.BI(R,L,T,S,x,O,this.UI(i,t.tm),this.UI(i,t.im),this.UI(i,t.QA))}else t.flat?s.A.WI(R,L,T,S,x,O,t.tm,t.im,t.QA,d,m,y,p,a,I,C,c,u,t.sm):s.A.WI(R,L,T,S,x,O,t.tm,t.im,t.QA,f,_,A,a,p,C,I,u,c,t.sm);if(!((v-T)*(x-O)-(b-O)*(L-T)<=0))if(s.A.DI=v<0||T<0||L<0||v>w.A.NI||T>w.A.NI||L>w.A.NI,g.ig&&this.FI(g.Vl,g.Kl,b,O,x,v,T,L)&&(g.mg=e,g.gg=n),-1!==t.sm){if(!g.lt)return void s.A.WI(v,T,L,b,O,x,t.$A,t.QA,t.im,d,m,y,p,a,I,C,c,u,t.sm);const i=g.pg[t.sm];s.A.BI(v,T,L,b,O,x,this.UI(i,t.$A),this.UI(i,t.QA),this.UI(i,t.im))}else 12345678!==t.$A&&s.A.BI(v,T,L,b,O,x,t.$A,t.QA,t.im)};RI=(t,i,e,n,r,h,o)=>{let l=e.Pd.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.Em&&(y.hm[t]=i,y.om[t]=l,y.lm[t]=a),y.nm[t]=s.A.pa+((i<<9)/a|0),y.rm[t]=s.A.Aa+((l<<9)/a|0)}s.A.alpha=0,l=e.Im.length;for(let n=0;n0)if(s.A.DI=l<0||a<0||c<0||l>w.A.NI||a>w.A.NI||c>w.A.NI,g.ig&&this.FI(g.Vl,g.Kl,f,u,d,l,a,c)&&(g.mg=t,g.gg=i),e.Em&&-1!==e.Em[n])if(g.lt){const t=g.pg[e.Em[n]];s.A.BI(l,a,c,f,u,d,this.UI(t,e.pm[n]),this.UI(t,e.Am[n]),this.UI(t,e.gm[n]))}else e.flat?s.A.WI(l,a,c,f,u,d,e.pm[n],e.Am[n],e.gm[n],y.hm[0],y.om[0],y.lm[0],y.hm[1],y.hm[3],y.om[1],y.om[3],y.lm[1],y.lm[3],e.Em[n]):s.A.WI(l,a,c,f,u,d,e.pm[n],e.Am[n],e.gm[n],y.hm[r],y.om[r],y.lm[r],y.hm[h],y.hm[o],y.om[h],y.om[o],y.lm[h],y.lm[o],e.Em[n]);else 12345678!==e.pm[n]&&s.A.BI(l,a,c,f,u,d,e.pm[n],e.Am[n],e.gm[n])}};TI=(t,i,e)=>{const s=this.vg[t][i][e];if(s===-g.xA)return!1;if(s===g.xA)return!0;{const s=i<<7,n=e<<7;return this.GI(s+1,this.Cg[t][i][e],n+1)&&this.GI(s+128-1,this.Cg[t][i+1][e],n+1)&&this.GI(s+128-1,this.Cg[t][i+1][e+1],n+128-1)&&this.GI(s+1,this.Cg[t][i][e+1],n+128-1)?(this.vg[t][i][e]=g.xA,!0):(this.vg[t][i][e]=-g.xA,!1)}};MI=(t,i,e,s)=>{if(!this.TI(t,i,e))return!1;const n=i<<7,r=e<<7,h=this.Cg[t][i][e]-1,o=h-120,l=h-230,a=h-238;if(s<16){if(1===s){if(n>g.Vm){if(!this.GI(n,h,r))return!1;if(!this.GI(n,h,r+128))return!1}if(t>0){if(!this.GI(n,o,r))return!1;if(!this.GI(n,o,r+128))return!1}return!!this.GI(n,l,r)&&this.GI(n,l,r+128)}if(2===s){if(r0){if(!this.GI(n,o,r+128))return!1;if(!this.GI(n+128,o,r+128))return!1}return!!this.GI(n,l,r+128)&&this.GI(n+128,l,r+128)}if(4===s){if(n0){if(!this.GI(n+128,o,r))return!1;if(!this.GI(n+128,o,r+128))return!1}return!!this.GI(n+128,l,r)&&this.GI(n+128,l,r+128)}if(8===s){if(r>g.Xm){if(!this.GI(n,h,r))return!1;if(!this.GI(n+128,h,r))return!1}if(t>0){if(!this.GI(n,o,r))return!1;if(!this.GI(n+128,o,r))return!1}return!!this.GI(n,l,r)&&this.GI(n+128,l,r)}}return!!this.GI(n+64,a,r+64)&&(16===s?this.GI(n,l,r+128):32===s?this.GI(n+128,l,r+128):64===s?this.GI(n+128,l,r):128===s?this.GI(n,l,r):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,i,e,s)=>{if(this.TI(t,i,e)){const n=i<<7,r=e<<7;return this.GI(n+1,this.Cg[t][i][e]-s,r+1)&&this.GI(n+128-1,this.Cg[t][i+1][e]-s,r+1)&&this.GI(n+128-1,this.Cg[t][i+1][e+1]-s,r+128-1)&&this.GI(n+1,this.Cg[t][i][e+1]-s,r+128-1)}return!1};kI=(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.vg[t][h][o]===-g.xA)return!1;o=1+(i<<7);const l=2+(s<<7),a=this.Cg[t][i][s]-r;if(!this.GI(o,a,l))return!1;const c=(e<<7)-1;if(!this.GI(c,a,l))return!1;const f=(n<<7)-1;return!!this.GI(o,a,f)&&this.GI(c,a,f)}return!!this.TI(t,i,s)&&(h=i<<7,o=s<<7,this.GI(h+1,this.Cg[t][i][s]-r,o+1)&&this.GI(h+128-1,this.Cg[t][i+1][s]-r,o+1)&&this.GI(h+128-1,this.Cg[t][i+1][s+1]-r,o+128-1)&&this.GI(h+1,this.Cg[t][i][s+1]-r,o+128-1))};GI=(t,i,e)=>{for(let s=0;s0){const t=n.FA+(n.GA*s>>8),r=n.BA+(n.YA*s>>8),h=n.PA+(n.HA*s>>8),o=n.zd+(n.VA*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(2===n.mode){const s=t-n.DA;if(s>0){const t=n.FA+(n.GA*s>>8),r=n.BA+(n.YA*s>>8),h=n.PA+(n.HA*s>>8),o=n.zd+(n.VA*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(3===n.mode){const s=n.FA-e;if(s>0){const e=n.DA+(n.UA*s>>8),r=n.NA+(n.WA*s>>8),h=n.PA+(n.HA*s>>8),o=n.zd+(n.VA*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(4===n.mode){const s=e-n.FA;if(s>0){const e=n.DA+(n.UA*s>>8),r=n.NA+(n.WA*s>>8),h=n.PA+(n.HA*s>>8),o=n.zd+(n.VA*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(5===n.mode){const s=i-n.PA;if(s>0){const i=n.DA+(n.UA*s>>8),r=n.NA+(n.WA*s>>8),h=n.FA+(n.GA*s>>8),o=n.BA+(n.YA*s>>8);if(t>=i&&t<=r&&e>=h&&e<=o)return!0}}}return!1};FI=(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};UI=(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{YI;HI;VI;KI;index;ty;El;Cl;constructor(t,i,e,s,n,r,h){super(),this.YI=i,this.HI=e,this.VI=s,this.KI=n,this.index=t,this.ty=r,h&&-1!==r.bl&&this.ty.delay?(this.El=Math.random()*this.ty.vl|0,this.Cl=Math.random()*this.ty.delay[this.El]|0):(this.El=-1,this.Cl=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;vA=0;XI=!1;size=1;Ga=-1;jI=-1;zI=-1;ZI=-1;qI=-1;JI=-1;$I=-1;QI=null;t_=100;i_=0;e_=0;s_=0;n_=0;r_=-1e3;h_=0;o_=0;l_=-1;a_=0;c_=0;f_=-1;u_=0;d_=0;w_=-1;y_=0;p_=0;A_=0;m_=0;g_=-1;I_=0;__=0;C_=0;E_=0;v_=0;b_=0;T_=0;O_=0;R_=0;S_=0;L_=0;xA=0;height=0;x_=0;pathLength=0;M_=new Int32Array(10);k_=new Int32Array(10);D_=new r.Ae(10,!1);N_=0;F_=-1;B_=-1;P_=-1;U_=-1;move(t,i,e){if(-1!==this.w_&&n.A.Bo[this.w_].priority<=1&&(this.w_=-1),!t){const t=i-this.M_[0],s=e-this.k_[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.k_[t]=this.k_[t-1],this.D_[t]=this.D_[t-1];return this.M_[0]=i,this.k_[0]=e,void(this.D_[0]=!1)}}this.pathLength=0,this.N_=0,this.M_[0]=i,this.k_[0]=e,this.x=128*this.M_[0]+64*this.size,this.z=128*this.k_[0]+64*this.size}step(t,i){let e=this.M_[0],s=this.k_[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.w_&&n.A.Bo[this.w_].priority<=1&&(this.w_=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.M_[t]=this.M_[t-1],this.k_[t]=this.k_[t-1],this.D_[t]=this.D_[t-1];this.M_[0]=e,this.k_[0]=s,this.D_[0]=t}}},8268:(t,i,e)=>{e.d(i,{A:()=>d});var s=e(9418),n=e(8665),r=e(2031),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 G_=2;static Y_=4;static H_=8;static V_=16;static K_=32;static X_=64;static j_=128;static z_=256;static Z_=512;static Wa=[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.lC,u.A.aC,u.A.cC,u.A.fC,u.A.uC];static Ua=[[u.A.dC,u.A.wC,u.A.yC,u.A.pC,u.A.AC,u.A.mC,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.OC,u.A.RC,u.A.SC,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.PC,u.A.UC,u.A.WC],[u.A.WC-1,u.A.bC+1,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.NC,u.A.FC,u.A.BC,u.A.PC,u.A.UC],[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]];static Po=new r.A(200);name=null;visible=!1;iE=0;eE=0;sE=new Uint16Array(12);nE=new Uint16Array(5);ec=0;rE=0n;y=0;hE=0;oE=0;lE=0;aE=0;cE=0;fE=null;MA=0;kA=0;Kp=0;Xp=0;lt=!1;draw(t){if(!this.visible)return null;let i=this.nw();if(this.height=i.zd,i.lw=!0,this.lt)return i;if(-1!==this.g_&&-1!==this.I_){const t=h.A.Bo[this.g_],e=n.A.Du(t.ga(),!0,!t.gd,!1);e.translate(-this.E_,0,0),e.Ya(),t.ty&&t.ty.frames&&e.Ha(t.ty.frames[this.I_]),e.Vd=null,e.Kd=null,128===t.ew&&128===t.sw||e.scale(t.ew,t.sw,t.ew),e.Va(t._d+64,t.Cd+850,-30,-50,-30,!0);const s=[i,e];i=n.A.uE(s,2)}if(this.fE&&(t>=this.oE&&(this.fE=null),t>=this.hE&&t=d.Ua[i].length)&&(e=0),this.nE[i]=e}this.Ga=t.Au,65535===this.Ga&&(this.Ga=-1),this.jI=t.Au,65535===this.jI&&(this.jI=-1),this.zI=t.Au,65535===this.zI&&(this.zI=-1),this.ZI=t.Au,65535===this.ZI&&(this.ZI=-1),this.qI=t.Au,65535===this.qI&&(this.qI=-1),this.JI=t.Au,65535===this.JI&&(this.JI=-1),this.$I=t.Au,65535===this.$I&&(this.$I=-1),this.name=c.A.ka(c.A.Da(t.dE)),this.ec=t.gu,this.visible=!0,this.rE=0n;for(let t=0;t<12;t++)this.rE<<=0x4n,this.sE[t]>=256&&(this.rE+=BigInt(this.sE[t])-256n);this.sE[0]>=256&&(this.rE+=BigInt(this.sE[0])-256n>>4n),this.sE[1]>=256&&(this.rE+=BigInt(this.sE[1])-256n>>8n);for(let t=0;t<5;t++)this.rE<<=0x3n,this.rE+=BigInt(this.nE[t]);this.rE<<=0x1n,this.rE+=BigInt(this.iE)}sd(){if(!this.visible)return null;const t=new f.Ae(12,null);let i=0;for(let e=0;e<12;e++){const s=this.sE[e];if(s>=256&&s<512&&(t[i++]=l.A.Bo[s-256].sd()),s>=512){const e=a.A.get(s-512).sd(this.iE);e&&(t[i++]=e)}}const e=n.A.Ba(t,i);for(let t=0;t<5;t++)0!==this.nE[t]&&(e.Pa(d.Ua[t][0],d.Ua[t][this.nE[t]]),1===t&&e.Pa(d.Wa[0],d.Wa[this.nE[t]]));return e}nw(){let t=this.rE,i=-1,e=-1,s=-1,r=-1;if(this.w_>=0&&0===this.A_){const n=o.A.Bo[this.w_];if(n.frames&&(i=n.frames[this.y_]),this.f_>=0&&this.f_!==this.Ga){const t=o.A.Bo[this.f_].frames;t&&(e=t[this.u_])}n.Jw>=0&&(s=n.Jw,t+=BigInt(s-this.sE[5])<<8n),n.$w>=0&&(r=n.$w,t+=BigInt(r-this.sE[3])<<16n)}else if(this.f_>=0){const t=o.A.Bo[this.f_].frames;t&&(i=t[this.u_])}let h=d.Po?.get(t);if(!h){const i=new f.Ae(12,null);let e=0;for(let t=0;t<12;t++){let n=this.sE[t];if(r>=0&&3===t&&(n=r),s>=0&&5===t&&(n=s),n>=256&&n<512){const t=l.A.Bo[n-256].ga();t&&(i[e++]=t)}if(n>=512){const t=a.A.get(n-512).zw(this.iE);t&&(i[e++]=t)}}h=n.A.Ba(i,e);for(let t=0;t<5;t++)0!==this.nE[t]&&(h.Pa(d.Ua[t][0],d.Ua[t][this.nE[t]]),1===t&&h.Pa(d.Wa[0],d.Wa[this.nE[t]]));h.Ya(),h.Va(64,850,-30,-50,-30,!0),d.Po?.put(t,h)}if(this.lt)return h;const c=n.A.rw(h,!0);return-1!==i&&-1!==e?c.hw(i,e,o.A.Bo[this.w_].Zw):-1!==i&&c.Ha(i),c.ow(),c.Vd=null,c.Kd=null,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;bI;Wg;CI;kg=null;Ng=null;Hg=null;Vg=null;Fg=null;Gg=null;xg=null;Ug=0;EI=0;Mg=0;visible=!1;update=!1;gI=!1;II=0;LI=0;xI=0;SI=0;constructor(t,i,e){super(),this.bI=this.level=t,this.x=i,this.z=e,this.Wg=new n.Ae(5,null),this.CI=new Int32Array(5)}}},5518:(t,i,e)=>{e.d(i,{A:()=>s});class s{static aA=0;static Dg=1;static wE=2;static yE=3;static pE=4;static AE=5;static dm=6;static wm=7;static ym=8;static mE=9;static gE=10;static IE=11}},4474:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{_E;CE;constructor(){super(),this._E=this,this.CE=this}EE(){this.CE&&this._E&&(this.CE._E=this._E,this._E.CE=this.CE,this._E=null,this.CE=null)}}},3819:(t,i,e)=>{e.d(i,{A:()=>s});class s{static vE=['_','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 bE=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 Da=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.vE[Number(s-37n*t)]}return e.slice(12-i).join('')};static TE=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 OE=t=>{let i='';for(let e=0;e(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static ka=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.SE=t,this.RE=t}Yp(t){t.SE&&t.yw(),t.SE=this.RE.SE,t.next=this.RE,t.SE&&(t.SE.next=t),t.next.SE=t}LE(t){t.SE&&t.yw(),t.SE=this.RE,t.next=this.RE.next,t.SE.next=t,t.next&&(t.next.SE=t)}vI(){const t=this.RE.next;return t===this.RE?null:(t?.yw(),t)}head(){const t=this.RE.next;return t===this.RE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}xE(){const t=this.RE.SE;return t===this.RE?(this.cursor=null,null):(this.cursor=t?.SE||null,t)}next(){const t=this.cursor;return t===this.RE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}SE(){const t=this.cursor;return t===this.RE?(this.cursor=null,null):(this.cursor=t?.SE||null,t)}clear(){for(;;){const t=this.RE.next;if(t===this.RE)return;t?.yw()}}}},1982:(t,i,e)=>{e.d(i,{A:()=>s});class s{key;next;SE;constructor(){this.key=0n,this.next=this,this.SE=this}yw(){this.SE&&this.next&&(this.SE.next=this.next,this.next.SE=this.SE,this.next=null,this.SE=null)}}},2031:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(4474);class n{head;constructor(){this.head=new s.A}push(t){t.CE&&t.EE(),t.CE=this.head.CE,t._E=this.head,t.CE&&(t.CE._E=t),t._E.CE=t}pop(){const t=this.head._E;return t===this.head?null:(t?.EE(),t)}}var r=e(1982);class h{ME;kE;constructor(t){this.kE=[],this.ME=t;for(let i=0;i{e.d(i,{A:()=>r});var s=e(1069),n=e(3867);class r{static Bo=[];static pu=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.Au;i.gf+=2;for(let t=0;t{e.d(i,{A:()=>r});var s=e(8534),n=e(1069);class r{static Bo=[];static pu=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.Au;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[p]=i,c[p]=0,f[p]=0,u[p]=0,p++;break}a[p]=t;let e=0;3===d.types[a[p]]&&(e=128),c[p]=1&i?h.BE:e,f[p]=2&i?h.BE:e,u[p]=4&i?h.BE:e,y=t,p++}}n.length=p,n.PE=new Int32Array(p),n.x=new Int32Array(p),n.y=new Int32Array(p),n.z=new Int32Array(p);for(let t=0;t{e.d(i,{Fc:()=>s,rl:()=>n,UE:()=>o,WE:()=>h,GE:()=>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 Jl=16776960;static YE=65535;static uA=16711935;static xl=16777215;static ql=0;static HE=16748608;static VE=8388608;static KE=128;static XE=16756736;static jE=16740352;static zE=16723968;static ZE=12648192;static qE=8453888;static JE=4259584;static $E=9179409;static QE=6116423;static ul=2301979;static dl=5063219;static yl=7759444;static Al=3353893;static tv=8388736;static iv=13350793;static ev=Int32Array.of(s.Jl,s.RED,s.GREEN,s.YE,s.uA,s.xl);static dC=6798;static wC=107;static yC=10283;static pC=16;static AC=4797;static mC=7744;static gC=5799;static IC=4634;static _C=33697;static CC=22433;static EC=2983;static vC=54193;static bC=8741;static TC=12;static OC=64030;static RC=43162;static SC=7735;static LC=8404;static xC=1701;static MC=38430;static kC=24094;static DC=10153;static NC=56621;static FC=4783;static BC=1341;static PC=16578;static UC=35003;static WC=25239;static q_=9104;static J_=10275;static Q_=7595;static tC=3610;static iC=7975;static eC=8526;static sC=918;static nC=38802;static rC=24466;static hC=10145;static oC=58654;static lC=5027;static aC=1457;static cC=16565;static fC=34991;static uC=25486;static GC=4626;static YC=11146;static HC=6439;static VC=12;static KC=4758;static XC=10270;static tE=4574;static jC=4550;static zC=4537;static ZC=5681;static qC=5673;static JC=5790;static $C=6806;static QC=8076}},8950:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n extends s.A{static gw=new Int32Array;static Iw=0;static _w=0;static top=0;static bottom=0;static left=0;static right=0;static NI=0;static sv=0;static nv=0;static bind=(t,i,e)=>{this.gw=t,this.Iw=i,this._w=e,this.Ol(0,0,i,e)};static rv=()=>{this.left=0,this.top=0,this.right=this.Iw,this.bottom=this._w,this.NI=this.right-1,this.sv=this.right/2|0};static Ol=(t,i,e,s)=>{t<0&&(t=0),i<0&&(i=0),e>this.Iw&&(e=this.Iw),s>this._w&&(s=this._w),this.top=i,this.bottom=s,this.left=t,this.right=e,this.NI=this.right-1,this.sv=this.right/2|0,this.nv=this.bottom/2|0};static clear=()=>{const t=this.Iw*this._w;for(let i=0;i{this.pl(t,i,n,e),this.pl(t,i+s-1,n,e),this.wl(t,i,n,s),this.wl(t+e-1,i,n,s)};static pl=(t,i,e,s)=>{if(i=this.bottom)return;tthis.right&&(s=this.right-t);const n=t+i*this.Iw;for(let t=0;t{if(t=this.right)return;ithis.bottom&&(s=this.bottom-i);const n=t+i*this.Iw;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.Iw-e;let h=t+i*this.Iw;for(let t=-s;t<0;t++){for(let t=-e;t<0;t++)this.gw[h++]=n;h+=r}};static ov(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.Iw-e;let f=t+i*this.Iw;for(let t=0;t>16&255)*h>>8<<16)+(l+(this.gw[f]>>8&255)*h>>8<<8)+(a+(255&this.gw[f])*h>>8);this.gw[f++]=t}f+=c}}static lv(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._w&&(c=this._w-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.Iw&&(f=this.Iw-1);let u=c+s*this.Iw;for(let t=c;t<=f;t++){const t=(h+(this.gw[u]>>16&255)*r>>8<<16)+(o+(this.gw[u]>>8&255)*r>>8<<8)+(l+(255&this.gw[u])*r>>8);this.gw[u++]=t}}}static av=(t,i,e)=>{t=this.right||i=this.bottom||(this.gw[t+i*this.Iw]=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 lt=!1;static cv=new Int32Array(512);static fv=new Int32Array(2048);static sin=new Int32Array(2048);static cos=new Int32Array(2048);static palette=new Int32Array(65536);static uv=new r.Ae(50,null);static dv=0;static mw=new Int32Array;static pa=0;static Aa=0;static Cw=!0;static DI=!1;static alpha=0;static wv=null;static yv=new r.Ae(50,null);static pv=0;static xA=0;static Av=new Int32Array(50);static mv=new r.Ae(50,null);static gv=!1;static Iv=new r.Ae(50,!1);static _v=new Int32Array(50);static{for(let t=1;t<512;t++)this.cv[t]=32768/t|0;for(let t=1;t<2048;t++)this.fv[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 Do=()=>{this.cv=null,this.cv=null,this.sin=null,this.cos=null,this.mw=null,this.uv=null,this.Iv=null,this._v=null,this.wv=null,this.yv=null,this.Av=null,this.palette=null,this.mv=null,console.log('Draw3D unloaded!')};static Bc=()=>{this.mw=new Int32Array(s.A._w);for(let t=0;t{this.mw=new Int32Array(i);for(let e=0;e{this.wv=null,this.yv.fill(null)};static vv=t=>{this.dv=0;for(let i=0;i<50;i++)try{this.uv[i]=n.A.Mu(t,i.toString()),this.lt&&128===this.uv[i]?.jl?this.uv[i]?.bv():this.uv[i]?.Mw(),this.dv++}catch(t){}};static fA=t=>{if(0!==this._v[t])return this._v[t];const i=this.mv[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.Tv(h,1.4),0===h&&(h=1),this._v[t]=h,h};static Ov=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.Tv(a,i)}}for(let t=0;t<50;t++){const e=this.uv[t];if(!e)continue;const s=e.palette;this.mv[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 Sv=t=>{this.wv||(this.pv=t,this.lt?this.wv=new r.$r(t,16384):this.wv=new r.$r(t,65536),this.yv.fill(null))};static BI=(t,i,e,n,r,o,l,a,c)=>{let f=0,u=0;r!==n&&(f=(i-t<<16)/(r-n)|0,u=(a-l<<15)/(r-n)|0);let d=0,w=0;o!==r&&(d=(e-i<<16)/(o-r)|0,w=(c-a<<15)/(o-r)|0);let y=0,p=0;if(o!==n&&(y=(t-e<<16)/(n-o)|0,p=(l-c<<15)/(n-o)|0),n<=r&&n<=o){if(ns.A.bottom&&(r=s.A.bottom),o>s.A.bottom&&(o=s.A.bottom),rd)for(o-=r,r-=n,n=h.mw[n];;){if(--r<0)for(;;){if(--o<0)return;this.Lv(e>>16,i>>16,c>>7,a>>7,s.A.gw,n,0),e+=y,i+=d,c+=p,a+=w,n+=s.A.Iw}this.Lv(e>>16,t>>16,c>>7,l>>7,s.A.gw,n,0),e+=y,t+=f,c+=p,l+=u,n+=s.A.Iw}else for(o-=r,r-=n,n=h.mw[n];;){if(--r<0)for(;;){if(--o<0)return;this.Lv(i>>16,e>>16,a>>7,c>>7,s.A.gw,n,0),e+=y,i+=d,c+=p,a+=w,n+=s.A.Iw}this.Lv(t>>16,e>>16,l>>7,c>>7,s.A.gw,n,0),e+=y,t+=f,c+=p,l+=u,n+=s.A.Iw}else if(i=t<<=16,a=l<<=15,n<0&&(i-=y*n,t-=f*n,a-=p*n,l-=u*n,n=0),e<<=16,c<<=15,o<0&&(e-=d*o,c-=w*o,o=0),n!==o&&yf)for(r-=o,o-=n,n=h.mw[n];;){if(--o<0)for(;;){if(--r<0)return;this.Lv(e>>16,t>>16,c>>7,l>>7,s.A.gw,n,0),e+=d,t+=f,c+=w,l+=u,n+=s.A.Iw}this.Lv(i>>16,t>>16,a>>7,l>>7,s.A.gw,n,0),i+=y,t+=f,a+=p,l+=u,n+=s.A.Iw}else for(r-=o,o-=n,n=h.mw[n];;){if(--o<0)for(;;){if(--r<0)return;this.Lv(t>>16,e>>16,l>>7,c>>7,s.A.gw,n,0),e+=d,t+=f,c+=w,l+=u,n+=s.A.Iw}this.Lv(t>>16,i>>16,l>>7,a>>7,s.A.gw,n,0),i+=y,t+=f,a+=p,l+=u,n+=s.A.Iw}}else if(r<=o){if(rs.A.bottom&&(o=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),oy)for(n-=o,o-=r,r=h.mw[r];;){if(--o<0)for(;;){if(--n<0)return;this.Lv(t>>16,e>>16,l>>7,c>>7,s.A.gw,r,0),t+=f,e+=y,l+=u,c+=p,r+=s.A.Iw}this.Lv(t>>16,i>>16,l>>7,a>>7,s.A.gw,r,0),t+=f,i+=d,l+=u,a+=w,r+=s.A.Iw}else for(n-=o,o-=r,r=h.mw[r];;){if(--o<0)for(;;){if(--n<0)return;this.Lv(e>>16,t>>16,c>>7,l>>7,s.A.gw,r,0),t+=f,e+=y,l+=u,c+=p,r+=s.A.Iw}this.Lv(i>>16,t>>16,a>>7,l>>7,s.A.gw,r,0),t+=f,i+=d,l+=u,a+=w,r+=s.A.Iw}else if(e=i<<=16,c=a<<=15,r<0&&(e-=f*r,i-=d*r,c-=u*r,a-=w*r,r=0),t<<=16,l<<=15,n<0&&(t-=y*n,l-=p*n,n=0),o-=n,n-=r,r=h.mw[r],f>16,i>>16,l>>7,a>>7,s.A.gw,r,0),t+=y,i+=d,l+=p,a+=w,r+=s.A.Iw}this.Lv(e>>16,i>>16,c>>7,a>>7,s.A.gw,r,0),e+=f,i+=d,c+=u,a+=w,r+=s.A.Iw}else for(;;){if(--n<0)for(;;){if(--o<0)return;this.Lv(i>>16,t>>16,a>>7,l>>7,s.A.gw,r,0),t+=y,i+=d,l+=p,a+=w,r+=s.A.Iw}this.Lv(i>>16,e>>16,a>>7,c>>7,s.A.gw,r,0),e+=f,i+=d,c+=u,a+=w,r+=s.A.Iw}}else if(os.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,a>>7,l>>7,s.A.gw,o,0),i+=d,t+=f,a+=w,l+=u,o+=s.A.Iw}this.Lv(i>>16,e>>16,a>>7,c>>7,s.A.gw,o,0),i+=d,e+=y,a+=w,c+=p,o+=s.A.Iw}else for(;;){if(--n<0)for(;;){if(--r<0)return;this.Lv(t>>16,i>>16,l>>7,a>>7,s.A.gw,o,0),i+=d,t+=f,a+=w,l+=u,o+=s.A.Iw}this.Lv(e>>16,i>>16,c>>7,a>>7,s.A.gw,o,0),i+=d,e+=y,a+=w,c+=p,o+=s.A.Iw}else if(t=e<<=16,l=c<<=15,o<0&&(t-=d*o,e-=y*o,l-=w*o,c-=p*o,o=0),i<<=16,a<<=15,r<0&&(i-=f*r,a-=u*r,r=0),n-=r,r-=o,o=h.mw[o],d>16,e>>16,a>>7,c>>7,s.A.gw,o,0),i+=f,e+=y,a+=u,c+=p,o+=s.A.Iw}this.Lv(t>>16,e>>16,l>>7,c>>7,s.A.gw,o,0),t+=d,e+=y,l+=w,c+=p,o+=s.A.Iw}else for(;;){if(--r<0)for(;;){if(--n<0)return;this.Lv(e>>16,i>>16,c>>7,a>>7,s.A.gw,o,0),i+=f,e+=y,a+=u,c+=p,o+=s.A.Iw}this.Lv(e>>16,t>>16,c>>7,l>>7,s.A.gw,o,0),t+=d,e+=y,l+=w,c+=p,o+=s.A.Iw}};static Lv=(t,i,e,n,r,o,l)=>{let a;if(h.Cw){let c;if(h.DI){if(c=i-t>3?(n-e)/(i-t)|0:0,i>s.A.NI&&(i=s.A.NI),t<0&&(e-=t*c,t=0),t>=i)return;o+=t,l=i-t>>2,c<<=2}else{if(!(t>2)>0?(n-e)*h.cv[l]>>15:0}if(0===h.alpha)for(;;){if(--l<0){if((l=i-t&3)>0){a=h.palette[e>>8];do{r[o++]=a,l--}while(l>0);return}break}a=h.palette[e>>8],e+=c,r[o++]=a,r[o++]=a,r[o++]=a,r[o++]=a}else{const s=h.alpha,n=256-h.alpha;for(;;){if(--l<0){if((l=i-t&3)>0){a=h.palette[e>>8],a=((16711935&a)*n>>8&16711935)+((65280&a)*n>>8&65280);do{r[o++]=a+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),l--}while(l>0)}break}a=h.palette[e>>8],e+=c,a=((16711935&a)*n>>8&16711935)+((65280&a)*n>>8&65280),r[o++]=a+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=a+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=a+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=a+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280)}}}else if(ts.A.NI&&(i=s.A.NI),t<0&&(e-=t*c,t=0),t>=i))return;if(o+=t,l=i-t,0===h.alpha)do{r[o++]=h.palette[e>>8],e+=c,l--}while(l>0);else{const t=h.alpha,i=256-h.alpha;do{a=h.palette[e>>8],e+=c,a=((16711935&a)*i>>8&16711935)+((65280&a)*i>>8&65280),r[o++]=a+((16711935&r[o])*t>>8&16711935)+((65280&r[o])*t>>8&65280),l--}while(l>0)}}};static xv=(t,i,e,n,r,h,o)=>{let l=0;r!==n&&(l=(i-t<<16)/(r-n)|0);let a=0;h!==r&&(a=(e-i<<16)/(h-r)|0);let c=0;if(h!==n&&(c=(t-e<<16)/(n-h)|0),n<=r&&n<=h){if(ns.A.bottom&&(r=s.A.bottom),h>s.A.bottom&&(h=s.A.bottom),ra)for(h-=r,r-=n,n=this.mw[n];;){if(--r<0)for(;;){if(--h<0)return;this.Mv(e>>16,i>>16,s.A.gw,n,o),e+=c,i+=a,n+=s.A.Iw}this.Mv(e>>16,t>>16,s.A.gw,n,o),e+=c,t+=l,n+=s.A.Iw}else for(h-=r,r-=n,n=this.mw[n];;){if(--r<0)for(;;){if(--h<0)return;this.Mv(i>>16,e>>16,s.A.gw,n,o),e+=c,i+=a,n+=s.A.Iw}this.Mv(t>>16,e>>16,s.A.gw,n,o),e+=c,t+=l,n+=s.A.Iw}else if(i=t<<=16,n<0&&(i-=c*n,t-=l*n,n=0),e<<=16,h<0&&(e-=a*h,h=0),n!==h&&cl)for(r-=h,h-=n,n=this.mw[n];;){if(--h<0)for(;;){if(--r<0)return;this.Mv(e>>16,t>>16,s.A.gw,n,o),e+=a,t+=l,n+=s.A.Iw}this.Mv(i>>16,t>>16,s.A.gw,n,o),i+=c,t+=l,n+=s.A.Iw}else for(r-=h,h-=n,n=this.mw[n];;){if(--h<0)for(;;){if(--r<0)return;this.Mv(t>>16,e>>16,s.A.gw,n,o),e+=a,t+=l,n+=s.A.Iw}this.Mv(t>>16,i>>16,s.A.gw,n,o),i+=c,t+=l,n+=s.A.Iw}}else if(r<=h){if(rs.A.bottom&&(h=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),hc)for(n-=h,h-=r,r=this.mw[r];;){if(--h<0)for(;;){if(--n<0)return;this.Mv(t>>16,e>>16,s.A.gw,r,o),t+=l,e+=c,r+=s.A.Iw}this.Mv(t>>16,i>>16,s.A.gw,r,o),t+=l,i+=a,r+=s.A.Iw}else for(n-=h,h-=r,r=this.mw[r];;){if(--h<0)for(;;){if(--n<0)return;this.Mv(e>>16,t>>16,s.A.gw,r,o),t+=l,e+=c,r+=s.A.Iw}this.Mv(i>>16,t>>16,s.A.gw,r,o),t+=l,i+=a,r+=s.A.Iw}else if(e=i<<=16,r<0&&(e-=l*r,i-=a*r,r=0),t<<=16,n<0&&(t-=c*n,n=0),l>16,i>>16,s.A.gw,r,o),t+=c,i+=a,r+=s.A.Iw}this.Mv(e>>16,i>>16,s.A.gw,r,o),e+=l,i+=a,r+=s.A.Iw}else for(h-=n,n-=r,r=this.mw[r];;){if(--n<0)for(;;){if(--h<0)return;this.Mv(i>>16,t>>16,s.A.gw,r,o),t+=c,i+=a,r+=s.A.Iw}this.Mv(i>>16,e>>16,s.A.gw,r,o),e+=l,i+=a,r+=s.A.Iw}}else if(hs.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,s.A.gw,h,o),i+=a,t+=l,h+=s.A.Iw}this.Mv(i>>16,e>>16,s.A.gw,h,o),i+=a,e+=c,h+=s.A.Iw}else for(r-=n,n-=h,h=this.mw[h];;){if(--n<0)for(;;){if(--r<0)return;this.Mv(t>>16,i>>16,s.A.gw,h,o),i+=a,t+=l,h+=s.A.Iw}this.Mv(e>>16,i>>16,s.A.gw,h,o),i+=a,e+=c,h+=s.A.Iw}else if(t=e<<=16,h<0&&(t-=a*h,e-=c*h,h=0),i<<=16,r<0&&(i-=l*r,r=0),a>16,e>>16,s.A.gw,h,o),i+=l,e+=c,h+=s.A.Iw}this.Mv(t>>16,e>>16,s.A.gw,h,o),t+=a,e+=c,h+=s.A.Iw}else for(n-=r,r-=h,h=this.mw[h];;){if(--r<0)for(;;){if(--n<0)return;this.Mv(e>>16,i>>16,s.A.gw,h,o),i+=l,e+=c,h+=s.A.Iw}this.Mv(e>>16,t>>16,s.A.gw,h,o),t+=a,e+=c,h+=s.A.Iw}};static WI=(t,i,e,n,r,h,o,l,a,c,f,u,d,w,y,p,A,m,g)=>{const I=this.kv(g);this.gv=!this.Iv[g];const _=c-d,C=f-y,E=u-A,v=w-c,b=p-f,T=m-u;let O=v*f-b*c<<14;const R=b*u-T*f<<8,S=T*c-v*u<<5;let L=_*f-C*c<<14;const x=C*u-E*f<<8,M=E*c-_*u<<5;let k=C*v-_*b<<14;const D=E*b-C*T<<8,N=_*T-E*v<<5;let F=0,B=0;r!==n&&(F=(i-t<<16)/(r-n)|0,B=(l-o<<16)/(r-n)|0);let P=0,U=0;h!==r&&(P=(e-i<<16)/(h-r)|0,U=(a-l<<16)/(h-r)|0);let W=0,G=0;if(h!==n&&(W=(t-e<<16)/(n-h)|0,G=(o-a<<16)/(n-h)|0),n<=r&&n<=h){if(ns.A.bottom&&(r=s.A.bottom),h>s.A.bottom&&(h=s.A.bottom),rP)for(h-=r,r-=n,n=this.mw[n];;){if(--r<0)for(;;){if(--h<0)return;this.Dv(e>>16,i>>16,s.A.gw,n,I,0,0,O,L,k,R,x,D,a>>8,l>>8),e+=W,i+=P,a+=G,l+=U,n+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.Dv(e>>16,t>>16,s.A.gw,n,I,0,0,O,L,k,R,x,D,a>>8,o>>8),e+=W,t+=F,a+=G,o+=B,n+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}else for(h-=r,r-=n,n=this.mw[n];;){if(--r<0)for(;;){if(--h<0)return;this.Dv(i>>16,e>>16,s.A.gw,n,I,0,0,O,L,k,R,x,D,l>>8,a>>8),e+=W,i+=P,a+=G,l+=U,n+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.Dv(t>>16,e>>16,s.A.gw,n,I,0,0,O,L,k,R,x,D,o>>8,a>>8),e+=W,t+=F,a+=G,o+=B,n+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}}else{i=t<<=16,l=o<<=16,n<0&&(i-=W*n,t-=F*n,l-=G*n,o-=B*n,n=0),e<<=16,a<<=16,h<0&&(e-=P*h,a-=U*h,h=0);const c=n-this.Aa;if(O+=S*c,L+=M*c,k+=N*c,O|=0,L|=0,k|=0,(n===h||W>=F)&&(n!==h||P<=F))for(r-=h,h-=n,n=this.mw[n];;){if(--h<0)for(;;){if(--r<0)return;this.Dv(t>>16,e>>16,s.A.gw,n,I,0,0,O,L,k,R,x,D,o>>8,a>>8),e+=P,t+=F,a+=U,o+=B,n+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.Dv(t>>16,i>>16,s.A.gw,n,I,0,0,O,L,k,R,x,D,o>>8,l>>8),i+=W,t+=F,l+=G,o+=B,n+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}else for(r-=h,h-=n,n=this.mw[n];;){if(--h<0)for(;;){if(--r<0)return;this.Dv(e>>16,t>>16,s.A.gw,n,I,0,0,O,L,k,R,x,D,a>>8,o>>8),e+=P,t+=F,a+=U,o+=B,n+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.Dv(i>>16,t>>16,s.A.gw,n,I,0,0,O,L,k,R,x,D,l>>8,o>>8),i+=W,t+=F,l+=G,o+=B,n+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}}}else if(r<=h){if(rs.A.bottom&&(h=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),hW)for(n-=h,h-=r,r=this.mw[r];;){if(--h<0)for(;;){if(--n<0)return;this.Dv(t>>16,e>>16,s.A.gw,r,I,0,0,O,L,k,R,x,D,o>>8,a>>8),t+=F,e+=W,o+=B,a+=G,r+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.Dv(t>>16,i>>16,s.A.gw,r,I,0,0,O,L,k,R,x,D,o>>8,l>>8),t+=F,i+=P,o+=B,l+=U,r+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}else for(n-=h,h-=r,r=this.mw[r];;){if(--h<0)for(;;){if(--n<0)return;this.Dv(e>>16,t>>16,s.A.gw,r,I,0,0,O,L,k,R,x,D,a>>8,o>>8),t+=F,e+=W,o+=B,a+=G,r+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.Dv(i>>16,t>>16,s.A.gw,r,I,0,0,O,L,k,R,x,D,l>>8,o>>8),t+=F,i+=P,o+=B,l+=U,r+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}}else{e=i<<=16,a=l<<=16,r<0&&(e-=F*r,i-=P*r,a-=B*r,l-=U*r,r=0),t<<=16,o<<=16,n<0&&(t-=W*n,o-=G*n,n=0);const c=r-this.Aa;if(O+=S*c,L+=M*c,k+=N*c,O|=0,L|=0,k|=0,h-=n,n-=r,r=this.mw[r],F>16,i>>16,s.A.gw,r,I,0,0,O,L,k,R,x,D,o>>8,l>>8),t+=W,i+=P,o+=G,l+=U,r+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.Dv(e>>16,i>>16,s.A.gw,r,I,0,0,O,L,k,R,x,D,a>>8,l>>8),e+=F,i+=P,a+=B,l+=U,r+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}else for(;;){if(--n<0)for(;;){if(--h<0)return;this.Dv(i>>16,t>>16,s.A.gw,r,I,0,0,O,L,k,R,x,D,l>>8,o>>8),t+=W,i+=P,o+=G,l+=U,r+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.Dv(i>>16,e>>16,s.A.gw,r,I,0,0,O,L,k,R,x,D,l>>8,a>>8),e+=F,i+=P,a+=B,l+=U,r+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}}}else if(hs.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,s.A.gw,h,I,0,0,O,L,k,R,x,D,l>>8,o>>8),i+=P,t+=F,l+=U,o+=B,h+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.Dv(i>>16,e>>16,s.A.gw,h,I,0,0,O,L,k,R,x,D,l>>8,a>>8),i+=P,e+=W,l+=U,a+=G,h+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}else for(;;){if(--n<0)for(;;){if(--r<0)return;this.Dv(t>>16,i>>16,s.A.gw,h,I,0,0,O,L,k,R,x,D,o>>8,l>>8),i+=P,t+=F,l+=U,o+=B,h+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.Dv(e>>16,i>>16,s.A.gw,h,I,0,0,O,L,k,R,x,D,a>>8,l>>8),i+=P,e+=W,l+=U,a+=G,h+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}}else{t=e<<=16,o=a<<=16,h<0&&(t-=P*h,e-=W*h,o-=U*h,a-=G*h,h=0),i<<=16,l<<=16,r<0&&(i-=F*r,l-=B*r,r=0);const c=h-this.Aa;if(O+=S*c,L+=M*c,k+=N*c,O|=0,L|=0,k|=0,n-=r,r-=h,h=this.mw[h],P>16,e>>16,s.A.gw,h,I,0,0,O,L,k,R,x,D,l>>8,a>>8),i+=F,e+=W,l+=B,a+=G,h+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.Dv(t>>16,e>>16,s.A.gw,h,I,0,0,O,L,k,R,x,D,o>>8,a>>8),t+=P,e+=W,o+=U,a+=G,h+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}else for(;;){if(--r<0)for(;;){if(--n<0)return;this.Dv(e>>16,i>>16,s.A.gw,h,I,0,0,O,L,k,R,x,D,a>>8,l>>8),i+=F,e+=W,l+=B,a+=G,h+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.Dv(e>>16,t>>16,s.A.gw,h,I,0,0,O,L,k,R,x,D,a>>8,o>>8),t+=P,e+=W,o+=U,a+=G,h+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}}};static Dv=(t,i,e,n,r,h,o,l,a,c,f,u,d,w,y)=>{if(t>=i)return;let p,A,m,g,I,_,C,E,v;if(this.DI){if(p=(y-w)/(i-t)|0,i>s.A.NI&&(i=s.A.NI),t<0&&(w-=t*p,t=0),t>=i)return;A=i-t>>3,p<<=12}else i-t>7?(A=i-t>>3,p=(y-w)*this.cv[A]>>6):(A=0,p=0);if(w<<=9,n+=t,this.lt&&r)if(m=0,g=0,_=t-this.pa,l+=(f>>3)*_,a+=(u>>3)*_,c+=(d>>3)*_,l|=0,a|=0,I=(c|=0)>>12,0!==I&&(o=a/I|0,(h=l/I|0)<0?h=0:h>4032&&(h=4032)),l+=f,a+=u,c+=d,l|=0,a|=0,I=(c|=0)>>12,0!==I&&(m=l/I|0,g=a/I|0,m<7?m=7:m>4032&&(m=4032)),C=m-h>>3,E=g-o>>3,h+=w>>3&786432,v=w>>23,this.gv){for(;A-- >0;)e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h=m,o=g,l+=f,a+=u,I=(c+=d)>>12,0!==I&&(m=l/I|0,g=a/I|0,m<7?m=7:m>4032&&(m=4032)),C=m-h>>3,E=g-o>>3,h+=(w+=p)>>3&786432,v=w>>23;for(A=i-t&7;A-- >0;)e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E}else{for(;A-- >0;){let t;0!=(t=r[(4032&o)+(h>>6)]>>>v)&&(e[n]=t),n+=1,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n+=1,h=m,o=g,l+=f,a+=u,c+=d,l|=0,a|=0,I=(c|=0)>>12,0!==I&&(m=l/I|0,g=a/I|0,m<7?m=7:m>4032&&(m=4032)),C=m-h>>3,E=g-o>>3,h+=(w+=p)>>3&786432,v=w>>23}for(A=i-t&7;A-- >0;){let t;0!=(t=r[(4032&o)+(h>>6)]>>>v)&&(e[n]=t),n++,h+=C,o+=E}}else if(m=0,g=0,_=t-this.pa,l+=(f>>3)*_,a+=(u>>3)*_,c+=(d>>3)*_,l|=0,a|=0,I=(c|=0)>>14,0!==I&&(o=a/I|0,(h=l/I|0)<0?h=0:h>16256&&(h=16256)),l+=f,a+=u,c+=d,l|=0,a|=0,I=(c|=0)>>14,0!==I&&(m=l/I|0,g=a/I|0,m<7?m=7:m>16256&&(m=16256)),C=m-h>>3,E=g-o>>3,h+=6291456&w,v=w>>23,this.gv&&r){for(;A-- >0;)e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h=m,o=g,l+=f,a+=u,c+=d,l|=0,a|=0,I=(c|=0)>>14,0!==I&&(m=l/I|0,g=a/I|0,m<7?m=7:m>16256&&(m=16256)),C=m-h>>3,E=g-o>>3,h+=6291456&(w+=p),v=w>>23;for(A=i-t&7;A-- >0;)e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E}else{for(;A-- >0&&r;){let t;0!=(t=r[(16256&o)+(h>>7)]>>>v)&&(e[n]=t),n+=1,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,h=m,o=g,l+=f,a+=u,c+=d,l|=0,a|=0,I=(c|=0)>>14,0!==I&&(m=l/I|0,g=a/I|0,m<7?m=7:m>16256&&(m=16256)),C=m-h>>3,E=g-o>>3,h+=6291456&(w+=p),v=w>>23}for(A=i-t&7;A-- >0&&r;){let t;0!=(t=r[(16256&o)+(h>>7)]>>>v)&&(e[n]=t),n++,h+=C,o+=E}}};static Mv=(t,i,e,n,r)=>{if(this.DI&&(i>s.A.NI&&(i=s.A.NI),t<0&&(t=0)),t>=i)return;n+=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;e[n++]=r}e[n++]=r,e[n++]=r,e[n++]=r,e[n++]=r}const o=this.alpha,l=256-this.alpha;for(r=((16711935&r)*l>>8&16711935)+((65280&r)*l>>8&65280);;){if(h--,h<0)for(h=i-t&3;;){if(h--,h<0)return;e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280)}e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280),e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280),e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280),e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280)}};static Rv=t=>{this.yv[t]&&this.wv&&(this.wv[this.pv++]=this.yv[t],this.yv[t]=null)};static kv=t=>{if(this.Av[t]=this.xA++,this.yv[t])return this.yv[t];let i;if(this.pv>0&&this.wv)i=this.wv[--this.pv],this.wv[this.pv]=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.gw[(n>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)i[t]=s[e.gw[t]];this.Iv[t]=!1;for(let e=0;e<16384;e++){i[e]&=16316671;const s=i[e];0===s&&(this.Iv[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}}},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{Bd=0;dI=0;Nv=0;Fv=-1;Bv=-1;Pv=-1;Uv=-1;Wv=-1;Gv=-1;Yv=-1;Hv=-1;Vv=-1;Kv=0;Xv=-1;jv=-1;zv=-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 Zv=null;static qv=null;static Jv=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 axis=null;static ob=new l.Ae(4096,!1);static lb=new l.Ae(4096,!1);static ab=new Int32Array(4096);static cb=new Int32Array(4096);static fb=new Int32Array(4096);static ub=new Int32Array(4096);static wb=new Int32Array(4096);static yb=new Int32Array(4096);static pb=new Int32Array(1500);static Ab=new l.$r(1500,512);static mb=new Int32Array(12);static gb=new l.$r(12,2e3);static Ib=new Int32Array(2e3);static _b=new Int32Array(2e3);static Cb=new Int32Array(12);static Eb=new Int32Array(10);static vb=new Int32Array(10);static bb=new Int32Array(10);static Tr=0;static Tb=0;static Or=0;static Ob=!1;static Vl=0;static Kl=0;static Rb=0;static Sb=new Int32Array(1e3);static Lb=!1;static pu(t){try{f.head=new s.A(t.read('ob_head.dat')),f.Zv=new s.A(t.read('ob_face1.dat')),f.qv=new s.A(t.read('ob_face2.dat')),f.Jv=new s.A(t.read('ob_face3.dat')),f.$v=new s.A(t.read('ob_face4.dat')),f.Qv=new s.A(t.read('ob_face5.dat')),f.tb=new s.A(t.read('ob_point1.dat')),f.ib=new s.A(t.read('ob_point2.dat')),f.eb=new s.A(t.read('ob_point3.dat')),f.sb=new s.A(t.read('ob_point4.dat')),f.nb=new s.A(t.read('ob_point5.dat')),f.rb=new s.A(t.read('ob_vertex1.dat')),f.hb=new s.A(t.read('ob_vertex2.dat')),f.axis=new s.A(t.read('ob_axis.dat')),f.head.gf=0,f.tb.gf=0,f.ib.gf=0,f.eb.gf=0,f.sb.gf=0,f.rb.gf=0,f.hb.gf=0;const i=f.head.Au;f.metadata=new l.Ae(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.Bd,n=t.dI,r=t.Nv;let h,o,a,u,d;if(i){h=new Int32Array(s);for(let i=0;i{const n=t.Bd,r=t.dI,h=t.Nv;let o,l,a,c,u;if(s)o=t.Pd,l=t.Wd,a=t.Ud;else{o=new Int32Array(n),l=new Int32Array(n),a=new Int32Array(n);for(let i=0;i{const e=t.Bd,s=t.dI,n=t.Nv,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.Pd[i],a=t.Wd[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.Zv&&f.qv&&f.Jv&&f.$v&&f.Qv&&f.tb&&f.ib&&f.eb&&f.sb&&f.nb&&f.rb&&f.hb&&f.axis))throw new Error('cant loading model!!!!!');const e=i.Bd,s=i.dI,n=i.Nv,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.Wv>=0&&(y=new Int32Array(e));let p=null;i.Vv>=0&&(p=new Int32Array(s));let A=null,m=0;i.Kv>=0?A=new Int32Array(s):m=-i.Kv-1;let g=null;i.Xv>=0&&(g=new Int32Array(s));let I=null;i.jv>=0&&(I=new Int32Array(s));const _=new Int32Array(s);f.tb.gf=i.Fv,f.ib.gf=i.Bv,f.eb.gf=i.Pv,f.sb.gf=i.Uv,f.nb.gf=i.Wv;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 e=f.metadata[i];if(e.data=t,!e.data.length)throw new Error('No model data');const n=e.Bd,r=e.dI,h=e.Nv,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),p=new Int32Array(h);let A=null;e.Wv>=0&&(A=new Int32Array(n));let m=null;e.Vv>=0&&(m=new Int32Array(r));let g=null,I=0;e.Kv>=0?g=new Int32Array(r):I=-e.Kv-1;let _=null;e.Xv>=0&&(_=new Int32Array(r));let C=null;e.jv>=0&&(C=new Int32Array(r));const E=new Int32Array(r),v=new s.A(e.data);v.gf=e.Fv;const b=new s.A(e.data);b.gf=e.Bv;const T=new s.A(e.data);T.gf=e.Pv;const O=new s.A(e.data);O.gf=e.Uv;const R=new s.A(e.data);R.gf=e.Wv;let S,L,x,M=0,k=0,D=0;for(let t=0;tthis.zd&&(this.zd=-e),e>this.PA&&(this.PA=e);const n=i*i+s*s;n>this._A&&(this._A=n)}this._A=Math.sqrt(this._A)+.99|0,this.Yb=Math.sqrt(this._A*this._A+this.zd*this.zd)+.99|0,this.Gb=this.Yb+(Math.sqrt(this._A*this._A+this.PA*this.PA)+.99|0)}Gd(){this.zd=0,this.PA=0;for(let t=0;tthis.zd&&(this.zd=-i),i>this.PA&&(this.PA=i)}this.Yb=Math.sqrt(this._A*this._A+this.zd*this.zd)+.99|0,this.Gb=this.Yb+(Math.sqrt(this._A*this._A+this.PA*this.PA)+.99|0)}Ya(){if(this.Hb){const t=new Int32Array(256);let i=0;for(let e=0;ei&&(i=s)}this.Kd=new l.Ae(i+1,null);for(let e=0;e<=i;e++)this.Kd[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;ei&&(i=s)}this.Vd=new l.Ae(i+1,null);for(let e=0;e<=i;e++)this.Vd[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.zb(s.x[t],s.y[t],s.z[t],r.labels[i],r.types[i])}f.Tr=0,f.Tb=0,f.Or=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.zb(n.x[t],n.y[t],n.z[t],r.labels[i],r.types[i])}}else this.Ha(t)}Ha(t){if(!this.Kd||-1===t||!h.A.Bo[t])return;const i=h.A.Bo[t],e=i.FE;f.Tr=0,f.Tb=0,f.Or=0;for(let t=0;t>16;this.Ud[t]=this.Wd[t]*i+this.Ud[t]*e>>16,this.Wd[t]=s}}translate(t,i,e){for(let s=0;s>8;if(this.kb&&this.Db&&this.Nb||(this.kb=new Int32Array(this.dI),this.Db=new Int32Array(this.dI),this.Nb=new Int32Array(this.dI)),!this.hI){this.hI=new l.Ae(this.Bd,null);for(let t=0;t8192||A>8192||m>8192||p<-8192||A<-8192||m<-8192;)p>>=1,A>>=1,m>>=1;let g=0|Math.sqrt(p*p+A*A+m*m);if(g<=0&&(g=1),p=256*p/g|0,A=256*A/g|0,m=256*m/g|0,this.uI&&1&this.uI[i]){const r=t+((e*p+s*A+n*m)/(h+(h/2|0))|0);this.ku&&(this.kb[i]=f.Mb(this.ku[i],r,this.uI[i]))}else{let t=this.hI[r];t&&(t.x+=p,t.y+=A,t.z+=m,t.w++),t=this.hI[o],t&&(t.x+=p,t.y+=A,t.z+=m,t.w++),t=this.hI[l],t&&(t.x+=p,t.y+=A,t.z+=m,t.w++)}}if(r)this.aI(t,h,e,s,n);else{this.fI=new l.Ae(this.Bd,null);for(let t=0;t>16;for(let s=0;s>16,I=I*w-g*d>>16,g=m),0!==t&&(m=I*a-_*l>>16,_=I*l+_*a>>16,I=m),0!==i&&(m=_*c+g*u>>16,_=_*u-g*c>>16,g=m),g+=n,I+=h,_+=o,m=I*p-_*y>>16,_=I*y+_*p>>16,I=m,f.ab&&f.cb&&f.fb&&(f.fb[s]=_-A,f.ab[s]=r.A.pa+((g<<9)/_|0),f.cb[s]=r.A.Aa+((I<<9)/_|0)),this.Nv>0&&f.ub&&f.wb&&f.yb&&(f.ub[s]=g,f.wb[s]=I,f.yb[s]=_)}try{this.Jb(!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._A*e>>16,y=d+w;if(y<=50||d>=3500)return;const p=a*s+o*h>>16;let A=p-this._A<<9;if((A/y|0)>=n.A.sv)return;let m=p+this._A<<9;if((m/y|0)<=-n.A.sv)return;const g=l*e-u*i>>16,I=this._A*i>>16;let _=g+I<<9;if((_/y|0)<=-n.A.nv)return;let C=g-(I+(this.zd*e>>16))<<9;if((C/y|0)>=n.A.nv)return;let E=d-(w+(this.zd*i>>16))<=50,v=!1;if(c>0&&f.Ob){let t=d-w;t<=50&&(t=50),p>0?(A=A/y|0,m=m/t|0):(m=m/y|0,A=A/t|0),g>0?(C=C/y|0,_=_/t|0):(_=_/y|0,C=C/t|0);const i=f.Vl-r.A.pa,e=f.Kl-r.A.Aa;i>A&&iC&&e<_&&(this.lw?f.Sb[f.Rb++]=c:v=!0)}const b=r.A.pa,T=r.A.Aa;let O=0,R=0;0!==t&&(O=r.A.sin[t],R=r.A.cos[t]);for(let n=0;n>16,w=w*R-c*O>>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.fb&&(f.fb[n]=w-d),w>=50&&f.ab&&f.cb?(f.ab[n]=b+((c<<9)/w|0),f.cb[n]=T+((u<<9)/w|0)):f.ab&&(f.ab[n]=-5e3,E=!0),(E||this.Nv>0)&&f.ub&&f.wb&&f.yb&&(f.ub[n]=c,f.wb[n]=u,f.yb[n]=w)}try{this.Jb(E,v,c)}catch(t){}}Jb(t,i,e,s=!1){f.Lb&&(this.Xb=-1,this.jb=-1);for(let t=0;tn.A.NI||a>n.A.NI||c>n.A.NI),f.Ab&&f.pb){const t=((y+p+A)/3|0)+this.Yb;f.Ab[t][f.pb[t]++]=s,f.Lb&&this.$b(f.Vl,f.Kl,u,d,w,l,a,c)&&this.jb=0;t--){const i=f.pb[t];if(!(i<=0)&&f.Ab){const e=f.Ab[t];for(let t=0;t=0;t--){const i=f.pb[t];if(i>0&&f.Ab){const e=f.Ab[t];for(let s=0;s0||f.mb[2]>0)&&(r=(f.Cb[1]+f.Cb[2])/(f.mb[1]+f.mb[2])|0);let h=0;f.mb&&f.Cb&&(f.mb[3]>0||f.mb[4]>0)&&(h=(f.Cb[3]+f.Cb[4])/(f.mb[3]+f.mb[4])|0);let o=0;if(f.mb&&f.Cb&&(f.mb[6]>0||f.mb[8]>0)&&(o=(f.Cb[6]+f.Cb[8])/(f.mb[6]+f.mb[8])|0),f.mb&&f.gb){let t,i=0,e=f.mb[10],n=f.gb[10],l=f.Ib;i===e&&(i=0,e=f.mb[11],n=f.gb[11],l=f._b),t=ir;)try{this.Qb(n[i++],s),i===e&&n!==f.gb[11]&&(i=0,e=f.mb[11],n=f.gb[11],l=f._b),t=ih;)try{this.Qb(n[i++],s),i===e&&n!==f.gb[11]&&(i=0,e=f.mb[11],n=f.gb[11],l=f._b),t=io;)try{this.Qb(n[i++],s),i===e&&n!==f.gb[11]&&(i=0,e=f.mb[11],n=f.gb[11],l=f._b),t=i>2,h=this.Pb[i],o=this.Ub[i],l=this.Wb[i];r.A.WI(f.ab[e],f.ab[s],f.ab[n],f.cb[e],f.cb[s],f.cb[n],this.kb[t],this.Db[t],this.Nb[t],f.ub[h],f.wb[h],f.yb[h],f.ub[o],f.ub[l],f.wb[o],f.wb[l],f.yb[o],f.yb[l],this.ku[t])}else if(3===h&&this.uI&&this.ku&&this.kb&&f.ab&&f.cb&&f.ub&&f.wb&&f.yb){const i=this.uI[t]>>2,h=this.Pb[i],o=this.Ub[i],l=this.Wb[i];r.A.WI(f.ab[e],f.ab[s],f.ab[n],f.cb[e],f.cb[s],f.cb[n],this.kb[t],this.kb[t],this.kb[t],f.ub[h],f.wb[h],f.yb[h],f.ub[o],f.ub[l],f.wb[o],f.wb[l],f.yb[o],f.yb[l],this.ku[t])}}tT(t,i=!1){let e=0;if(f.yb){const i=r.A.pa,s=r.A.Aa,n=this.wI[t],h=this.yI[t],o=this.pI[t],l=f.yb[n],a=f.yb[h],c=f.yb[o];if(l>=50&&f.ab&&f.cb&&this.kb)f.Eb[e]=f.ab[n],f.vb[e]=f.cb[n],f.bb[e++]=this.kb[t];else if(f.ub&&f.wb&&this.kb){const u=f.ub[n],d=f.wb[n],w=this.kb[t];if(c>=50&&this.Nb){const n=(50-l)*r.A.fv[c-l];f.Eb[e]=i+((u+((f.ub[o]-u)*n>>16)<<9)/50|0),f.vb[e]=s+((d+((f.wb[o]-d)*n>>16)<<9)/50|0),f.bb[e++]=w+((this.Nb[t]-w)*n>>16)}if(a>=50&&this.Db){const n=(50-l)*r.A.fv[a-l];f.Eb[e]=i+((u+((f.ub[h]-u)*n>>16)<<9)/50|0),f.vb[e]=s+((d+((f.wb[h]-d)*n>>16)<<9)/50|0),f.bb[e++]=w+((this.Db[t]-w)*n>>16)}}if(a>=50&&f.ab&&f.cb&&this.Db)f.Eb[e]=f.ab[h],f.vb[e]=f.cb[h],f.bb[e++]=this.Db[t];else if(f.ub&&f.wb&&this.Db){const u=f.ub[h],d=f.wb[h],w=this.Db[t];if(l>=50&&this.kb){const h=(50-a)*r.A.fv[l-a];f.Eb[e]=i+((u+((f.ub[n]-u)*h>>16)<<9)/50|0),f.vb[e]=s+((d+((f.wb[n]-d)*h>>16)<<9)/50|0),f.bb[e++]=w+((this.kb[t]-w)*h>>16)}if(c>=50&&this.Nb){const n=(50-a)*r.A.fv[c-a];f.Eb[e]=i+((u+((f.ub[o]-u)*n>>16)<<9)/50|0),f.vb[e]=s+((d+((f.wb[o]-d)*n>>16)<<9)/50|0),f.bb[e++]=w+((this.Nb[t]-w)*n>>16)}}if(c>=50&&f.ab&&f.cb&&this.Nb)f.Eb[e]=f.ab[o],f.vb[e]=f.cb[o],f.bb[e++]=this.Nb[t];else if(f.ub&&f.wb&&this.Nb){const u=f.ub[o],d=f.wb[o],w=this.Nb[t];if(a>=50&&this.Db){const n=(50-c)*r.A.fv[a-c];f.Eb[e]=i+((u+((f.ub[h]-u)*n>>16)<<9)/50|0),f.vb[e]=s+((d+((f.wb[h]-d)*n>>16)<<9)/50|0),f.bb[e++]=w+((this.Db[t]-w)*n>>16)}if(l>=50&&this.kb){const h=(50-c)*r.A.fv[l-c];f.Eb[e]=i+((u+((f.ub[n]-u)*h>>16)<<9)/50|0),f.vb[e]=s+((d+((f.wb[n]-d)*h>>16)<<9)/50|0),f.bb[e++]=w+((this.kb[t]-w)*h>>16)}}}const s=f.Eb[0],h=f.Eb[1],o=f.Eb[2],l=f.vb[0],a=f.vb[1],c=f.vb[2];if(!((s-h)*(c-a)-(l-a)*(o-h)<=0))if(r.A.DI=!1,3===e){let e;if((s<0||h<0||o<0||s>n.A.NI||h>n.A.NI||o>n.A.NI)&&(r.A.DI=!0),e=this.uI?3&this.uI[t]:0,i)r.A.hv(s,h,l,a,f.bb[0]),r.A.hv(h,o,a,c,f.bb[1]),r.A.hv(o,s,c,l,f.bb[2]);else if(0===e)r.A.BI(s,h,o,l,a,c,f.bb[0],f.bb[1],f.bb[2]);else if(1===e&&this.kb)r.A.xv(s,h,o,l,a,c,r.A.palette[this.kb[t]]);else if(2===e&&this.uI&&this.ku&&f.ub&&f.wb&&f.yb){const i=this.uI[t]>>2,e=this.Pb[i],n=this.Ub[i],u=this.Wb[i];r.A.WI(s,h,o,l,a,c,f.bb[0],f.bb[1],f.bb[2],f.ub[e],f.wb[e],f.yb[e],f.ub[n],f.ub[u],f.wb[n],f.wb[u],f.yb[n],f.yb[u],this.ku[t])}else if(3===e&&this.uI&&this.ku&&this.kb&&f.ub&&f.wb&&f.yb){const i=this.uI[t]>>2,e=this.Pb[i],n=this.Ub[i],u=this.Wb[i];r.A.WI(s,h,o,l,a,c,this.kb[t],this.kb[t],this.kb[t],f.ub[e],f.wb[e],f.yb[e],f.ub[n],f.ub[u],f.wb[n],f.wb[u],f.yb[n],f.yb[u],this.ku[t])}}else if(4===e){let e;if((s<0||h<0||o<0||s>n.A.NI||h>n.A.NI||o>n.A.NI||f.Eb[3]<0||f.Eb[3]>n.A.NI)&&(r.A.DI=!0),e=this.uI?3&this.uI[t]:0,i)r.A.hv(s,h,l,a,f.bb[0]),r.A.hv(h,o,a,c,f.bb[1]),r.A.hv(o,f.Eb[3],c,f.vb[3],f.bb[2]),r.A.hv(f.Eb[3],s,f.vb[3],l,f.bb[3]);else if(0===e)r.A.BI(s,h,o,l,a,c,f.bb[0],f.bb[1],f.bb[2]),r.A.BI(s,o,f.Eb[3],l,c,f.vb[3],f.bb[0],f.bb[2],f.bb[3]);else if(1===e){if(this.kb){const i=r.A.palette[this.kb[t]];r.A.xv(s,h,o,l,a,c,i),r.A.xv(s,o,f.Eb[3],l,c,f.vb[3],i)}}else if(2===e&&this.uI&&this.ku&&f.ub&&f.wb&&f.yb){const i=this.uI[t]>>2,e=this.Pb[i],n=this.Ub[i],u=this.Wb[i];r.A.WI(s,h,o,l,a,c,f.bb[0],f.bb[1],f.bb[2],f.ub[e],f.wb[e],f.yb[e],f.ub[n],f.ub[u],f.wb[n],f.wb[u],f.yb[n],f.yb[u],this.ku[t]),r.A.WI(s,o,f.Eb[3],l,c,f.vb[3],f.bb[0],f.bb[2],f.bb[3],f.ub[e],f.wb[e],f.yb[e],f.ub[n],f.ub[u],f.wb[n],f.wb[u],f.yb[n],f.yb[u],this.ku[t])}else if(3===e&&this.uI&&this.ku&&this.kb&&f.ub&&f.wb&&f.yb){const i=this.uI[t]>>2,e=this.Pb[i],n=this.Ub[i],u=this.Wb[i];r.A.WI(s,h,o,l,a,c,this.kb[t],this.kb[t],this.kb[t],f.ub[e],f.wb[e],f.yb[e],f.ub[n],f.ub[u],f.wb[n],f.wb[u],f.yb[n],f.yb[u],this.ku[t]),r.A.WI(s,o,f.Eb[3],l,c,f.vb[3],this.kb[t],this.kb[t],this.kb[t],f.ub[e],f.wb[e],f.yb[e],f.ub[n],f.ub[u],f.wb[n],f.wb[u],f.yb[n],f.yb[u],this.ku[t])}}}zb(t,i,e,s,n){if(!s)return;const h=s.length;if(0===n){let n=0;f.Tr=0,f.Tb=0,f.Or=0;for(let t=0;t0?(f.Tr=(f.Tr/n|0)+t,f.Tb=(f.Tb/n|0)+i,f.Or=(f.Or/n|0)+e):(f.Tr=t,f.Tb=i,f.Or=e)}else if(1===n)for(let n=0;n=this.Kd.length)continue;const h=this.Kd[r];if(h)for(let s=0;s=this.Kd.length)continue;const o=this.Kd[h];if(o)for(let s=0;s>16;this.Wd[n]=this.Wd[n]*u-this.Pd[n]*c>>16,this.Pd[n]=t}if(0!==h){c=r.A.sin[h],u=r.A.cos[h];const t=this.Wd[n]*u-this.Ud[n]*c>>16;this.Ud[n]=this.Wd[n]*c+this.Ud[n]*u>>16,this.Wd[n]=t}if(0!==l){c=r.A.sin[l],u=r.A.cos[l];const t=this.Ud[n]*c+this.Pd[n]*u>>16;this.Ud[n]=this.Ud[n]*u-this.Pd[n]*c>>16,this.Pd[n]=t}this.Pd[n]+=f.Tr,this.Wd[n]+=f.Tb,this.Ud[n]+=f.Or}}else if(3===n)for(let n=0;n=this.Kd.length)continue;const h=this.Kd[r];if(h)for(let s=0;s=this.Vd.length)continue;const n=this.Vd[e];if(n)for(let i=0;i255&&(this.Bb[e]=255)}}}qb(){this.zd=0,this._A=0,this.PA=0,this.DA=999999,this.NA=-999999,this.BA=-99999,this.FA=99999;for(let t=0;tthis.NA&&(this.NA=i),sthis.BA&&(this.BA=s),-e>this.zd&&(this.zd=-e),e>this.PA&&(this.PA=e);const n=i*i+s*s;n>this._A&&(this._A=n)}this._A=0|Math.sqrt(this._A),this.Yb=0|Math.sqrt(this._A*this._A+this.zd*this.zd),this.Gb=this.Yb+(0|Math.sqrt(this._A*this._A+this.PA*this.PA))}$b(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(7854);class o extends r.A{gw;width;height;eT;sT;jl;ww;constructor(t,i){super(),this.gw=new Int32Array(t*i),this.width=this.jl=t,this.height=this.ww=i,this.eT=this.sT=0}static nT=async(t,i)=>{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(h.WE.src),h.WE.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>h.WE.onload=()=>t())),h.UE.clearRect(0,0,h.GE.width,h.GE.height);const i=h.WE.naturalWidth,e=h.WE.naturalHeight;return h.GE.width=i,h.GE.height=e,h.UE.drawImage(h.WE,0,0),h.UE.getImageData(0,0,i,e)})(e),n=new o(s.width,s.height),r=new Uint32Array(s.data.buffer),l=n.gw;for(let t=0;t>24&255)<<24|(255&i)<<16|(i>>8&255)<<8|i>>16&255}return n};static Mu=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.gf=s.Au;const h=r.Au,l=r.Au,a=[],c=r.gu-1;for(let t=0;ts.length||r.gf>r.length)throw new Error;const f=r.gu,u=r.gu,d=r.Au,w=r.Au,y=new o(d,w);y.eT=f,y.sT=u,y.jl=h,y.ww=l;const p=r.gu;if(0===p){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.rT(h,r,this.gw,n,l,s.A.gw,e,o)}Xl(t,i,e){i|=0,e|=0;let n=(i+=this.eT)+(e+=this.sT)*s.A.Iw,r=0,h=this.height,o=this.width,l=s.A.Iw-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.hT(o,h,this.gw,r,a,s.A.gw,n,l,t)}oT(t,i){t|=0,i|=0;let e=(t+=this.eT)+(i+=this.sT)*s.A.Iw,n=0,r=this.height,h=this.width,o=s.A.Iw-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.lT(h,r,this.gw,n,l,s.A.gw,e,o)}aT(){const t=this.gw,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.gw[s]=(r<<16)+(h<<8)+o}}}Mw(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.jl,a=this.ww,c=(l<<16)/e|0,f=(a<<16)/n|0;t+=(this.eT*e+l-1)/l|0,i+=(this.sT*n+a-1)/a|0,this.eT*e%l!=0&&(h=(l-this.eT*e%l<<16)/e|0),this.sT*n%a!=0&&(o=(a-this.sT*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.Iw,d=s.A.Iw-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.gw,h,o,s.A.gw,d,u,r,c,f)}catch(t){console.error('error in sprite clipping routine')}}fT(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,p=w*c>>8;let A=(o<<16)+u*y+f*p,m=u*p-f*y+(l<<16),g=t+i*s.A.Iw;for(let t=0;t>16)+(o>>16)*this.width],n+=p,o-=y;A+=y,m+=p,g+=s.A.Iw}}catch(t){}}uT(t,i,e){t|=0,i|=0;let n=(t+=this.eT)+(i+=this.sT)*s.A.Iw,r=0,h=this.height,o=this.width,l=s.A.Iw-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.dT(o,h,this.gw,a,r,s.A.gw,n,l,e.gw)}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')}}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++)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}}hT(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}}rT(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}}dT(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{gw;width;height;eT;sT;jl;ww;palette;constructor(t,i,e){super(),this.gw=new Int8Array(t*i),this.width=this.jl=t,this.height=this.ww=i,this.eT=this.sT=0,this.palette=e}static Mu=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.gf=s.Au;const o=r.Au,l=r.Au,a=r.gu,c=new Int32Array(a);for(let t=1;ts.length||r.gf>r.length)throw new Error;const f=r.gu,u=r.gu,d=r.Au,w=r.Au,y=new h(d,w,c);y.eT=f,y.sT=u,y.jl=o,y.ww=l;const p=y.gw,A=r.gu;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.wT(h,r,this.gw,n,l,s.A.gw,e,o)}aT(){const t=this.gw,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}}bv(){this.jl|=0,this.ww|=0,this.jl/=2,this.ww/=2,this.jl|=0,this.ww|=0;const t=new Int8Array(this.jl*this.ww);let i=0;for(let e=0;e>1)+(e+this.sT>>1)*this.jl]=this.gw[i++];this.gw=t,this.width=this.jl,this.height=this.ww,this.eT=0,this.sT=0}Mw(){if(this.width===this.jl&&this.height===this.ww)return;const t=new Int8Array(this.jl*this.ww);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.jl,a=this.ww,c=(l<<16)/e|0,f=(a<<16)/n|0;t=t+(this.eT*e+l-1)/l|0,i=i+(this.sT*n+a-1)/a|0,this.eT*e%l!=0&&(h=(l-this.eT*e%l<<16)/e|0),this.sT*n%a!=0&&(o=(a-this.sT*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.Iw,w=s.A.Iw-e;is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right&&(u=t+e-s.A.right,e-=u,w+=u),this.yT(s.A.gw,this.gw,this.palette,h,o,d,w,e,n,c,f,r)}catch(t){console.log('error in sprite clipping routine')}}yT(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}pT(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 l extends r.A{static mT='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!"£$%^&*()-_=+[{]};:\'@#~,<.>/?\\| ';static gT=[];static{const t=navigator.userAgent.includes('Capacitor');for(let i=0;i<256;i++){let e=l.mT.indexOf(String.fromCharCode(i));t&&e>=63&&e--,-1===e&&(e=74),l.gT[i]=e}}IT=[];_T=new Int32Array(94);CT=new Int32Array(94);ET=new Int32Array(94);vT=new Int32Array(94);bT=new Int32Array(95);TT=new Int32Array(256);random=new h(BigInt(Date.now()));height=0;static Mu=(t,i)=>{const e=new n.A(t.read(i+'.dat')),s=new n.A(t.read('index.dat'));s.gf=e.Au+4;const r=s.gu;r>0&&(s.gf+=3*(r-1));const h=new l;for(let t=0;t<94;t++){h.ET[t]=s.gu,h.vT[t]=s.gu;const i=h._T[t]=s.Au,n=h.CT[t]=s.Au,r=s.gu,o=i*n;if(h.IT[t]=new Int8Array(o),0===r)for(let s=0;sh.height&&(h.height=n),h.ET[t]=1,h.bT[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.NT(n,r,t,c,a,s.A.gw,o,l,h)}MT(t,i,e,n,r,h,o){e|=0,n|=0;let l=(t|=0)+(i|=0)*s.A.Iw,a=s.A.Iw-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.FT(e,n,s.A.gw,l,a,o,f,c,r,h)}NT(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}}FT(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}}RT(t){return'red'===t?o.A.RED:'gre'===t?o.A.GREEN:'blu'===t?o.A.BLUE:'yel'===t?o.A.Jl:'cya'===t?o.A.YE:'mag'===t?o.A.uA:'whi'===t?o.A.xl:'bla'===t?o.A.ql:'lre'===t?o.A.HE:'dre'===t?o.A.VE:'dbl'===t?o.A.KE:'or1'===t?o.A.XE:'or2'===t?o.A.jE:'or3'===t?o.A.zE:'gr1'===t?o.A.ZE:'gr2'===t?o.A.qE:'gr3'===t?o.A.JE:o.A.ql}split(t,i){if(0===t.length)return[t];const e=[];for(;t.length>0;){if(this.ST(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{BT;width;height;PT;UT;gw;constructor(t,i,e=n.rl){this.PT=e,this.BT=this.PT.getImageData(0,0,t,i),this.UT=new Uint32Array(this.BT.data.buffer),this.gw=new Int32Array(t*i),this.width=t,this.height=i,this.bind()}clear(){this.gw.fill(0)}bind(){s.A.bind(this.gw,this.width,this.height)}draw(t,i){this.#t(),this.PT.putImageData(this.BT,t,i)}#t(){const t=this.gw.length,i=this.gw,e=this.UT;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)}}));Zo=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)}}));tl=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!')};WT=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(4702);class r{static WT=t=>{let i=0;t=t.toUpperCase();for(let e=0;e=this.YT)return null;if(this.jT[t])return this.jT[t];const i=this.XT[t],e=i+this.KT[t];if(this.GT){const s=Uint8Array.from(this.buffer.subarray(i,i+e));return this.jT[t]=s,s}{const i=Uint8Array.from(n.A.read(this.VT[t],this.buffer,this.KT[t],this.XT[t]));return this.jT[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 ZT=3988292384;static qT=new Int32Array(256);static JT=new Uint32Array(33);static $T=new n.A;static QT=new n.A;static tO=new n.A;static iO=0;static eO=0;static sO=0;static{for(let t=0;t<32;t++)h.JT[t]=(1<>>=1:i=i>>>1^h.ZT;h.qT[t]=i}}static qo=t=>{let i=4294967295;for(let e=0;e>>8^h.qT[255&(i^t[e])];return~i};view;data;gf=0;nO=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 Vt=t=>{let i=null;return 0===t&&h.iO>0?(h.iO--,i=h.$T.vI()):1===t&&h.eO>0?(h.eO--,i=h.QT.vI()):2===t&&h.sO>0&&(h.sO--,i=h.tO.vI()),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.iO<1e3?(h.$T.Yp(this),h.iO++):5e3===this.view.byteLength&&h.eO<250?(h.QT.Yp(this),h.eO++):3e4===this.view.byteLength&&h.sO<50&&(h.tO.Yp(this),h.sO++)}get gu(){return this.view.getUint8(this.gf++)}get Nd(){return this.view.getInt8(this.gf++)}get Au(){const t=this.view.getUint16(this.gf);return this.gf+=2,t}get _u(){const t=this.view.getInt16(this.gf);return this.gf+=2,t}get Ju(){const t=this.view.getUint8(this.gf++)<<16|this.view.getUint16(this.gf);return this.gf+=2,t}get el(){const t=this.view.getInt32(this.gf);return this.gf+=4,t}get dE(){const t=this.view.getBigInt64(this.gf);return this.gf+=8,t}get BE(){return this.view.getUint8(this.gf)<128?this.gu-64:this.Au-49152}get IA(){return this.view.getUint8(this.gf)<128?this.gu:this.Au-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}lO(t){this.view.setInt32(this.gf,t,!0),this.gf+=4}aO(t){this.view.setBigInt64(this.gf,t),this.gf+=8}cO(t){const i=this.view,e=t.length;for(let s=0;s>>3}yO(t){let i=this.nO>>>3,e=8-(7&this.nO),s=0;for(this.nO+=t;t>e;e=8)s+=(this.view.getUint8(i++)&h.JT[e])<>>e-t&h.JT[t],s}pO(t,i){const e=this.gf;this.gf=0;const n=new Uint8Array(e);this.rO(e,0,n);const r=(0,s.AO)(n),h=(0,s.mO)(r,i,t),o=(0,s.gO)(h);this.gf=0,this.p1(o.length),this.fO(o,o.length,0)}}},3867:(t,i,e)=>{e.d(i,{hA:()=>a,rA:()=>o,Ae:()=>s,xm:()=>n,Lh:()=>r,Om:()=>h,$r:()=>l});class s extends Array{constructor(t,i){super(t);for(let e=0;e{e.d(i,{gO:()=>o,$o:()=>n,AO:()=>h,Qo:()=>s,sc:()=>r,mO:()=>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}},9073:(t,i,e)=>{e.a(t,(async(t,i)=>{try{var s=e(4702),n=e(2901),r=e(9234),h=e(1069),o=e(7604),l=e(8370),a=e(3867),c=e(1673),f=e(1122),u=e(2682),d=e(8950),w=e(4544),y=e(6200);class t extends l.A{static IO=!1;static _O=!0;db=null;CO=3200;EO=3200;sizeX=1280;sizeZ=1344;vO=2240;bO=2752;TO=1e3;OO=0;RO=[];SO=[];LO=[];xO=[];MO=[0];kO=[0];DO=[];NO=[];FO=[];BO=[];PO=[];UO=[];WO=[];GO=[];Ie=[];_e=[];Te=null;Oe=null;Re=null;Se=null;YO=null;HO=[];VO=!0;KO=0;XO=-1;jO=-1;zO=-1;ZO=-1;qO=!1;JO=['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'];$O=5;QO=13;tR=140;iR=470;eR=!1;sR=0;nR=0;rR=-1;hR=0;oR=0;lR=0;aR=new Int32Array(2e3);cR=new Int32Array(2e3);fR=new Int32Array(2e3);Kn=new Int32Array(2e3);Xn=new Int32Array(2e3);Ve=new Int32Array(2e3);Vn=0;uR=null;dR=200;wR=this.dR*this.sizeX/this.sizeZ|0;yR=635-this.wR-5;pR=503-this.dR-20;AR=!1;mR=8943445;gR=7824964;IR=6706483;_R=11141120;CR=10027008;ER=8912896;zoom=4;vR=4;offsetX=this.CO-this.vO;Vy=this.bO+this.sizeZ-this.EO;load=async()=>{await s.A.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new w.A(await w.A.openDatabase());const t=await this.bR();await this.Jo(100,'Please wait... Rendering Map');const i=new h.A(t.read('labels.dat'));this.OO=i.Au;for(let t=0;t{if(this.VO){this.VO=!1,this.KO=0,d.A.clear();const t=this.offsetX-(635/this.zoom|0),i=this.Vy-(503/this.zoom|0),e=this.offsetX+(635/this.zoom|0),s=this.Vy+(503/this.zoom|0);if(this.kR(t,i,e,s,0,0,635,503),this.AR&&(this.uR?.oT(this.yR,this.pR),d.A.ov(this.yR+this.wR*t/this.sizeX|0,this.pR+this.dR*i/this.sizeZ|0,(e-t)*this.wR/this.sizeX|0,(s-i)*this.dR/this.sizeZ|0,16711680,128),d.A.Ll(this.yR+this.wR*t/this.sizeX|0,this.pR+this.dR*i/this.sizeZ|0,(e-t)*this.wR/this.sizeX|0,(s-i)*this.dR/this.sizeZ|0,16711680),this.lR>0&&this.lR%10<5))for(let t=0;t0&&this.lR%10<5&&this.oR==i+this.nR&&(e=16776960),this.YO?.zl(this.$O+20,t+13,this.JO[i+this.nR],e)}t+=17}}this.zl(this.yR,this.pR+this.dR,this.wR,18,this.mR,this.gR,this.IR,'Overview'),this.zl(this.$O,this.QO+this.iR,this.tR,18,this.mR,this.gR,this.IR,'Key'),3==this.vR?this.zl(170,471,50,30,this._R,this.CR,this.ER,'37%'):this.zl(170,471,50,30,this.mR,this.gR,this.IR,'37%'),4==this.vR?this.zl(230,471,50,30,this._R,this.CR,this.ER,'50%'):this.zl(230,471,50,30,this.mR,this.gR,this.IR,'50%'),6==this.vR?this.zl(290,471,50,30,this._R,this.CR,this.ER,'75%'):this.zl(290,471,50,30,this.mR,this.gR,this.IR,'75%'),8==this.vR?this.zl(350,471,50,30,this._R,this.CR,this.ER,'100%'):this.zl(350,471,50,30,this.mR,this.gR,this.IR,'100%')}this.KO--,this.KO<=0&&(this.Uo?.draw(0,0),this.KO=50)};refresh=async()=>{this.KO=0};update=async()=>{1==this.Ec[1]&&(this.offsetX=this.offsetX-16/this.zoom|0,this.VO=!0),1==this.Ec[2]&&(this.offsetX=this.offsetX+16/this.zoom|0,this.VO=!0),1==this.Ec[3]&&(this.Vy=this.Vy-16/this.zoom|0,this.VO=!0),1==this.Ec[4]&&(this.Vy=this.Vy+16/this.zoom|0,this.VO=!0);let t=1;for(;t>0;)t=this.Gc(),49==t?(this.vR=3,this.VO=!0):50==t?(this.vR=4,this.VO=!0):51==t?(this.vR=6,this.VO=!0):52==t?(this.vR=8,this.VO=!0):107==t||75==t?(this.eR=!this.eR,this.VO=!0):111!=t&&79!=t||(this.AR=!this.AR,this.VO=!0);if(1==this.Ic&&(this.XO=this._c,this.jO=this.Cc,this.zO=this.offsetX,this.ZO=this.Vy,this._c>170&&this._c<220&&this.Cc>471&&this.Cc<503?(this.vR=3,this.XO=-1):this._c>230&&this._c<280&&this.Cc>471&&this.Cc<503?(this.vR=4,this.XO=-1):this._c>290&&this._c<340&&this.Cc>471&&this.Cc<503?(this.vR=6,this.XO=-1):this._c>350&&this._c<400&&this.Cc>471&&this.Cc<503?(this.vR=8,this.XO=-1):this._c>this.$O&&this.Cc>this.QO+this.iR&&this._cthis.yR&&this.Cc>this.pR+this.dR&&this._cthis.$O&&this.Cc>this.QO&&this._cthis.$O&&this.Cc>this.QO&&this._cthis.$O&&this.Cc>this.QO+this.iR-18&&this._cthis.$O&&this.Vl=t&&this.Klthis.yR&&i>this.pR&&tthis.vR&&(this.zoom=this.vR)),this.zoom>this.vR&&(this.VO=!0,this.zoom-=this.zoom/30,this.zoomthis.sR&&(this.VO=!0,this.nR--),this.lR>0&&(this.VO=!0,this.lR--);const i=this.offsetX-(635/this.zoom|0),e=this.Vy-(503/this.zoom|0),s=this.offsetX+(635/this.zoom|0),n=this.Vy+(503/this.zoom|0);i<48&&(this.offsetX=48+(635/this.zoom|0)),e<48&&(this.Vy=48+(503/this.zoom|0)),s>this.sizeX-48&&(this.offsetX=this.sizeX-48-(635/this.zoom|0)),n>this.sizeZ-48&&(this.Vy=this.sizeZ-48-(503/this.zoom|0))};async bR(){let t=await(this.db?.Zo('worldmap.dat'));if(t)return new n.A(t);let i=5;for(;!t;){await this.Jo(0,'Requesting map');try{console.log(`${y.K.ft}/worldmap.jag`),t=await(0,r.$o)(`${y.K.ft}/worldmap.jag`)}catch(e){t=void 0;for(let t=i;t>0;t--)await this.Jo(0,`Error loading - Will retry in ${t} secs.`),await(0,r.Qo)(1e3);i*=2,i>60&&(i=60)}}return await(this.db?.tl('worldmap.dat',t)),new n.A(t)}zl(t,i,e,s,n,r,h,o){t=Math.trunc(t),i=Math.trunc(i),e=Math.trunc(e),s=Math.trunc(s),d.A.Ll(t,i,e,s,0);const l=t+1,a=i+1,c=e-2,f=s-2;d.A.fillRect(l,a,c,f,r),d.A.pl(l,a,n,c),d.A.wl(l,a,n,f),d.A.pl(l,a+f-1,h,c),d.A.wl(l+c-1,a,h,f),this.YO?.LT(l+c/2+1,a+f/2+1+4,o,0),this.YO?.LT(l+c/2,a+f/2+4,o,16777215)}MR(){for(let t=0;t10&&s>20)-(o>>20),n+=(i>>10&1023)-(o>>10&1023),r+=(1023&i)-(1023&o),r>0&&(this.HO[s][h]=this.DR(t/8533,n/8533,r/8533))}}}}TR(t){for(;t.available>0;){const i=64*t.gu-this.vO,e=64*t.gu-this.bO;if(i>0&&e>0&&i+640;){const i=64*t.gu-this.vO,e=64*t.gu-this.bO;if(i>0&&e>0&&i+640;){const i=64*t.gu-this.vO,e=64*t.gu-this.bO;if(i>0&&e>0&&i+640;){const i=64*t.gu-this.vO,e=64*t.gu-this.bO;if(i>0&&e>0&&i+640;){const i=64*t.gu-this.vO,e=64*t.gu-this.bO;if(i>0&&e>0&&i+641&&l--;let a=t-.3333333333333333;a<0&&a++,s=6*l<1?o+6*(h-o)*l:2*l<1?h:3*l<2?o+(h-o)*(.6666666666666666-l)*6:o,n=6*t<1?o+6*(h-o)*t:2*t<1?h:3*t<2?o+(h-o)*(.6666666666666666-t)*6:o,r=6*a<1?o+6*(h-o)*a:2*a<1?h:3*a<2?o+(h-o)*(.6666666666666666-a)*6:o}return((256*s|0)<<16)+((256*n|0)<<8)+(256*r|0)}kR(i,e,s,n,r,h,o,l){const a=s-i,c=n-e,f=(o-r<<16)/a|0,u=(l-h<<16)/c|0;for(let t=0;t>16,n=f*(t+1)>>16;const o=n-s;if(!(o<=0)){s+=r,n+=r;for(let r=0;r>16,a=u*(r+1)>>16;const c=a-l;if(c<=0)continue;l+=h,a+=h;const f=this.NO[t+i][r+e];if(0===f)d.A.fillRect(s,l,n-s,a-l,this.HO[t+i][r+e]);else{const n=this.FO[t+i][r+e],h=252&n;0==h||o<=1||c<=1?d.A.fillRect(s,l,o,c,f):this.NR(d.A.gw,l*d.A.Iw+s,this.HO[t+i][r+e],f,o,c,h>>2,3&n)}}}}if(s-i>o-r)return;let w=0;for(let t=0;t>16,n=f*(t+1)>>16;const o=n-s;if(!(o<=0)){s+=r,n+=r;for(let r=0;r>16,a=u*(r+1)>>16;const c=a-l;if(c<=0)continue;l+=h,a+=h;let f=255&this.BO[t+i][r+e];if(0!=f){let t,i;t=1==o?s:n-1,i=1==c?l:a-1;let e=13421772;if((f>=5&&f<=8||f>=13&&f<=16||f>=21&&f<=24)&&(e=13369344,f-=4),27!=f&&28!=f||(e=13369344,f-=2),1==f)d.A.wl(s,l,e,c);else if(2==f)d.A.pl(s,l,e,o);else if(3==f)d.A.wl(t,l,e,c);else if(4==f)d.A.pl(s,i,e,o);else if(9==f)d.A.wl(s,l,16777215,c),d.A.pl(s,l,e,o);else if(10==f)d.A.wl(t,l,16777215,c),d.A.pl(s,l,e,o);else if(11==f)d.A.wl(t,l,16777215,c),d.A.pl(s,i,e,o);else if(12==f)d.A.wl(s,l,16777215,c),d.A.pl(s,i,e,o);else if(17==f)d.A.pl(s,l,e,1);else if(18==f)d.A.pl(t,l,e,1);else if(19==f)d.A.pl(t,i,e,1);else if(20==f)d.A.pl(s,i,e,1);else if(25==f)for(let t=0;t>16,n=f*(t+1)>>16;if(!(n-s<=0)){s+=r,n+=r;for(let n=0;n>16,o=u*(n+1)>>16;o-r<=0||(r+=h,o+=h,this.WO[t+i][n+e]&&this.Te?.draw(s,r))}}}for(let t=0;t>16,n=f*(t+1)>>16;if(!(n-s<=0)){s+=r,n+=r;for(let n=0;n>16,o=u*(n+1)>>16;o-r<=0||(r+=h,o+=h,this.GO[t+i][n+e]&&this.Oe?.draw(s,r))}}}for(let t=0;t0)for(let t=0;t=71&&a<=73?this.YO?.LT((y+u)/2,(p+w)/2,'u_pass',16711680):t>=32&&t<=34&&a>=70&&a<=74&&this.YO?.LT((y+u)/2,(p+w)/2,'u_pass',16776960)}}NR(t,i,e,s,n,r,h,o){const l=d.A.Iw-n;if(9==h?(h=1,o=o+1&3):10==h?(h=1,o=o+3&3):11==h&&(h=8,o=o+3&3),1==h){if(0==o)for(let h=0;h=0;h--){for(let r=0;r=h?s:e;i+=l}else if(3==o)for(let h=r-1;h>=0;h--){for(let r=0;r=h?s:e;i+=l}}else if(2==h){if(0==o)for(let h=r-1;h>=0;h--){for(let r=0;r>1?s:e;i+=l}else if(1==o)for(let h=0;h=h<<1?s:e;i+=l}else if(2==o)for(let h=0;h=0;r--)t[i++]=r<=h>>1?s:e;i+=l}else if(3==o)for(let h=r-1;h>=0;h--){for(let r=n-1;r>=0;r--)t[i++]=r>=h<<1?s:e;i+=l}}else if(3==h){if(0==o)for(let h=r-1;h>=0;h--){for(let r=n-1;r>=0;r--)t[i++]=r<=h>>1?s:e;i+=l}else if(1==o)for(let h=r-1;h>=0;h--){for(let r=0;r=h<<1?s:e;i+=l}else if(2==o)for(let h=0;h>1?s:e;i+=l}else if(3==o)for(let h=0;h=0;r--)t[i++]=r>=h<<1?s:e;i+=l}}else if(4==h){if(0==o)for(let h=r-1;h>=0;h--){for(let r=0;r=h>>1?s:e;i+=l}else if(1==o)for(let h=0;h=0;r--)t[i++]=r>=h>>1?s:e;i+=l}else if(3==o)for(let h=r-1;h>=0;h--){for(let r=n-1;r>=0;r--)t[i++]=r<=h<<1?s:e;i+=l}}else if(5==h){if(0==o)for(let h=r-1;h>=0;h--){for(let r=n-1;r>=0;r--)t[i++]=r>=h>>1?s:e;i+=l}else if(1==o)for(let h=r-1;h>=0;h--){for(let r=0;r=h>>1?s:e;i+=l}else if(3==o)for(let h=0;h=0;r--)t[i++]=r<=h<<1?s:e;i+=l}}else if(6==h){if(0==o)for(let h=0;h=n/2?s:e;i+=l}else if(3==o)for(let h=0;h=r/2?s:e;i+=l}}else if(7==h){if(0==o)for(let h=0;h=0;h--){for(let o=0;o=0;h--){for(let o=n-1;o>=0;o--)t[i++]=o<=h-r/2?s:e;i+=l}else if(3==o)for(let h=0;h=0;o--)t[i++]=o<=h-r/2?s:e;i+=l}}else if(8==h)if(0==o)for(let h=0;h=h-r/2?s:e;i+=l}else if(1==o)for(let h=r-1;h>=0;h--){for(let o=0;o=h-r/2?s:e;i+=l}else if(2==o)for(let h=r-1;h>=0;h--){for(let o=n-1;o>=0;o--)t[i++]=o>=h-r/2?s:e;i+=l}else if(3==o)for(let h=0;h=0;o--)t[i++]=o>=h-r/2?s:e;i+=l}}Wo(){return 0}Go(){return!1}Yo(){return!1}Ho(){return-1}Vo(){return-1}}await(0,o.w)(),(new t).run().then((()=>{})),window.onkeydown=function(t){return!(' '===t.key&&t.target===document.body)},i()}catch(t){i(t)}}),1)},4702:(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,{A:()=>n});class n{static FR=null;static load=async t=>{this.FR=await s(new WebAssembly.Module(t),{env:void 0})};static read=(t,i,e,s)=>{if(!this.FR)throw new Error('bz2 not found!!');return Int8Array.from(this.FR.read(t,i,e,s))}}},123:(t,i,e)=>{function s(t,i,e){window._tinyMidiPlay&&window._tinyMidiPlay(t,i/256,e)}function n(t){window._tinyMidiStop&&window._tinyMidiStop(t)}e.d(i,{sl:()=>s,No:()=>n})},8902:(t,i,e)=>{var s;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 p,A;y=a?require('path').BR(y)+'/':__dirname+'/';var m=()=>{A||(p=require('fs'),A=require('path'))};u=(t,i)=>(m(),t=A.normalize(t),p.PR(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)=>{m(),t=A.normalize(t),p.UR(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,O,R,S,L,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=R=new Int16Array(t),r.HEAP32=S=new Int32Array(t),r.HEAPU8=O=new Uint8Array(t),r.HEAPU16=new Uint16Array(t),r.HEAPU32=L=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 P(){if(!k){var t=ft(),i=L[t>>2],e=L[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!==L[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 U=[],W=[],G=[],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+')'),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()},WR:function(){z.error()},GR:function(){z.error()},YR:function(){z.error()},open:function(){z.error()},HR:function(){z.error()},VR:function(){z.error()},KR:function(){z.error()},XR:function(){z.error()},jR:function(){z.error()}};r.FS_createDataFile=z.WR,r.FS_createPreloadedFile=z.GR;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.zR||(ht.zR={}),ht.zR[t]||(ht.zR[t]=1,c&&(t='warning: '+t),_(t))}function ot(t){try{return v.grow(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){O.copyWithin(t,i,i+e)},"emscripten_resize_heap":function(t){var i=O.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,W.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(k)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()))),L[t>>2]=34821223,L[t+4>>2]=2310721022,L[0]=1668509029}function dt(t){function e(){lt||(lt=!0,r.calledRun=!0,k||(D(!Y),Y=!0,P(),rt(W),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(P(),r.postRun)for('function'==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)t=r.postRun.shift(),G.unshift(t);var t;rt(G)}()))}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(),U.unshift(t);var t;rt(U)}(),H>0||(r.setStatus?(r.setStatus('Running...'),setTimeout((function(){setTimeout((function(){r.setStatus('')}),1),e()}),1)):e(),P()))}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':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: '+e)}},r.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(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});const r=class{constructor(t={}){this.ZR=void 0,this.qR=0,this.JR=0,this.$R=0,this.QR=t.QR||100,this.sampleRate=t.sampleRate||44100,this.tS=t.tS||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.iS(1),this.eS=t.eS||(()=>{}),this.sS=t.sS||(()=>{}),this.nS=void 0,this.test=0}async init(){if(!this.ZR){if('undefined'!=typeof process){const{BR:t}=await import('path'),{rS: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.ZR=await n(),this.hS=this.ZR._malloc(this.bufferSize),this.oS=this.ZR._malloc(8)}}iS(t){this.bufferSize=4*this.sampleRate*this.tS*t}lS(){if(!this.ZR)throw new Error(`${this.constructor.name} not initalized. call .init()`)}aS(t){this.lS();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.ZR;e(this.qR),this.qR=i(t.length),this.ZR.HEAPU8.set(t,this.qR),this.JR=s(this.qR,t.length),n(this.JR,2===this.tS?0:2,this.sampleRate,this.gain)}cS(){this.lS();const t=new Uint8Array(this.bufferSize);return t.set(this.ZR.HEAPU8.subarray(this.hS,this.hS+this.bufferSize)),t}fS(t){const{_malloc:i,_free:e,_tml_load_memory:s}=this.ZR;return e(this.$R),this.$R=i(t.length),this.ZR.HEAPU8.set(t,this.$R),s(this.$R,t.length)}uS(t){const{_midi_render:i}=this.ZR;return i(this.JR,t,this.tS,this.sampleRate,this.hS,this.bufferSize,this.oS)}dS(t){if(this.lS(),!this.JR)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.nS);const{setValue:i,getValue:e}=this.ZR;i(this.oS,0,'double'),this.ZR._tsf_reset(this.JR),this.ZR._tsf_channel_set_bank_preset(this.JR,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let s=this.fS(t);const n=()=>{s=this.uS(s);const t=this.cS();this.eS(t),s?this.nS=setTimeout(n,this.QR):this.sS(e(this.oS,'double'))};this.nS=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()=>{const t=2,i=44100;let e=new Float32Array,s=window.audioContext.createGain();s.gain.setValueAtTime(.1,window.audioContext.currentTime),s.connect(window.audioContext.destination);let n=window.audioContext.currentTime,h=[];const o=new r({QR:30,eS:t=>{let i=new Float32Array(t.buffer),s=new Float32Array(e.length+i.length);s.set(e,0),s.set(i,e.length),e=s},sS:t=>{},bufferSize:102400});await o.init();const l=await fetch('./SCC1_Florestan.sf2'),a=new Uint8Array(await l.arrayBuffer());function c(){if(!window.audioContext||!e.length)return;let r=window.audioContext.createBufferSource();const o=e.length/t,l=window.audioContext.createBuffer(t,o,i);for(let i=0;i{t.stop(window.audioContext.currentTime)})),h=[],s.gain.setValueAtTime(t,window.audioContext.currentTime)}}function d(t,i){-1!==t&&window._tinyMidiVolume(t),n=window.audioContext.currentTime,f=setInterval(c,250),o.dS(i)}o.aS(a),window._tinyMidiStop=async t=>{t?function(t){const i=window.audioContext.currentTime;s.gain.cancelScheduledValues(i),s.gain.setTargetAtTime(0,i,.5),setTimeout(t,2e3)}((()=>{u()})):u()},window._tinyMidiVolume=(t=1)=>{s.gain.setValueAtTime(t,window.audioContext.currentTime)},window._tinyMidiPlay=async(t,i,e)=>{t&&(await window._tinyMidiStop(e),e?setTimeout((()=>{d(i,t)}),2e3):d(i,t))}})()},8227:(t,i,e)=>{t.exports=e.p+"9f86b5397894e28b5ae2.wasm"}},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(9073)})(); \ No newline at end of file +(()=>{"use strict";var t,i,e,s,n={6200:(t,i,e)=>{e.d(i,{K:()=>N});var s=e(1120),n=e(4583),r=e(2901),h=e(1069),o=e(8370),l=(e(8902),e(6666)),a=e(198),c=e(818),f=e(670),u=e(8268),d=e(3867),w=e(7854),y=e(8950),p=e(1302),A=e(9298),m=e(8665),g=e(1312),I=e(3819),_=e(8317),C=e(9234),E=e(4702),v=e(123),b=e(5637),T=e(6948),O=e(2164),R=e(8738),S=e(3764),L=e(8534),x=e(6730);function M(t,i){var e;(e=document.createElement('a')).href=t,e.download=i,document.body.appendChild(e),e.style='display: none',e.click(),e.remove()}class k{tt=new Map;it;et=self.isSecureContext?self.crypto.randomUUID():'0';constructor(t){this.it=t}async st(){const t=new RTCPeerConnection({iceServers:[{urls:'stun:stun.l.google.com:19302'}]}),i=t.createDataChannel('channel'),e=crypto.randomUUID();this.tt.set(e,i),await t.setLocalDescription(await t.createOffer()),t.onicegatheringstatechange=async()=>{if('complete'===t.iceGatheringState){let i;self.isSecureContext?await navigator.clipboard.writeText(JSON.stringify(t.localDescription)):console.log(JSON.stringify(t.localDescription));try{for(;null===(i=prompt('Offer copied to clipboard, paste answer here')););t.setRemoteDescription(new RTCSessionDescription(JSON.parse(i)))}catch(t){console.error(t)}}},i.onopen=()=>{i.send(JSON.stringify({type:'id',id:e})),console.log('Connected to peer!')},i.onerror=t=>{console.error(t)},i.onmessage=t=>{const i=JSON.parse(t.data);i.data&&(i.data=Object.values(i.data)),this.it&&this.it.postMessage(i)}}postMessage(t){const i=this.tt.get(t.data.id),e=t.data;e.data&&(e.data=Array.from(t.data.data)),i&&'open'===i.readyState&&i.send(JSON.stringify(e))}}class D{pc;nt=void 0;et;constructor(t){this.pc=new RTCPeerConnection({iceServers:[{urls:'stun:stun.l.google.com:19302'}]}),this.pc.ondatachannel=i=>{this.nt=i.channel,this.nt.onopen=()=>{console.log('Connected to host!')},this.nt.onerror=t=>{console.error(t)},this.nt.onmessage=i=>{if(!this.et){const t=JSON.parse(i.data);if('id'===t.type)return void(this.et=t.id)}t.onmessage&&t.onmessage(i)}},this.pc.onicegatheringstatechange=async()=>{'complete'===this.pc.iceGatheringState&&(self.isSecureContext?await navigator.clipboard.writeText(JSON.stringify(this.pc.localDescription)):console.log(JSON.stringify(this.pc.localDescription)))}}async rt(t){await this.pc.setRemoteDescription(new RTCSessionDescription(JSON.parse(t))),await this.pc.setLocalDescription(await this.pc.createAnswer())}}class N extends o.A{static ht=225;static ot=10;static portOffset=0;static members=!0;static lt=!1;static ct='';static ft='';static ut=!1;static dt=2;static wt=!1;static yt='https://raw.githubusercontent.com/2004scape/Server/main';static exponent=58778699976184461502525193738213253649000149147835990136706041084440742975821n;static At=7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789n;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 Ot=0;static Rt=0;static St=0;static Lt=0;static xt=0;static Mt=0;static kt=0;static Dt=()=>{a.A.lt=!1,n.A.lt=!1,N.lt=!1,c.A.lt=!1};static Nt=()=>{a.A.lt=!0,n.A.lt=!0,N.lt=!0,c.A.lt=!0};Ft=2048;Bt=2047;Pt=!1;Ut=!1;Wt=!1;Gt=!1;db=null;Yt=0;Ht=[];stream=null;in=h.A.Vt(1);Kt=h.A.Vt(1);Xt=h.A.Vt(1);jt=0n;zt=0;Zt=0;qt=0;Jt=null;$t=0;packetSize=0;Qt=0;ti=0;ii=0;ei=null;si=!0;ni=0;ri=0;hi=null;oi=null;li=null;ai=null;ci=null;fi=null;ui=null;di=null;wi=null;yi=null;pi=null;Ai='';mi='';username='';password='';gi=null;Ii=null;_i=null;Ci=null;Ei=[];vi=!1;bi=null;Ti=null;Oi=null;Ri=null;Si=null;Li=null;xi=null;Mi=null;ki=null;Di=null;Ni=new Int32Array(256);Fi=0;Bi=0;Pi=0;Ui=null;Wi=null;Gi=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=null;ie=null;ee=null;se=null;ne=null;re=null;he=new Int32Array(33);oe=new Int32Array(33);le=new Int32Array(151);ae=new Int32Array(151);ce=null;fe=null;ue=null;de=null;we=null;ye=null;pe=new d.Ae(13,null);me=null;ge=null;Ie=new d.Ae(50,null);_e=new d.Ae(50,null);Ce=new d.Ae(20,null);Ee=new d.Ae(20,null);ve=null;be=new d.Ae(8,null);Te=null;Oe=null;Re=null;Se=null;Le=null;xe=null;Me=null;ke=null;De=null;Ne=null;Fe=null;Be=null;Pe=null;Ue=null;We=null;Ge=null;Ye=null;He=null;Ve=new d.Ae(1e3,null);Ke=!1;Xe=!1;je=!1;ze=!1;Ze=-1;qe=0;Je=0;$e=0;Qe=0;ts=0;es=0;ss=!1;ns=0;rs=0;hs=0;os=0;ls=0;cs=0;fs=[];us=-1;ds=-1;ws=new s.A;ys=78;ps=0;As=0;gs=[];Is=0;_s=0;Cs=0;Es=0;vs=0;bs=0;Ts=0;Os=0;Rs=[];Ss=[];Ls=[];xs=[];Ms=null;ks=-1;Ds=3;Ns=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];Fs=0;Bs=0;Ps=0;Us=!1;Ws=0;Gs=!1;Ys='';Hs='';Vs=0;Ks='';Xs=!1;js=-1;zs=new d.Ae(100,null);Zs=new d.Ae(100,null);messageType=new Int32Array(100);qs=new Int32Array(100);Js=0;$s=0;Qs=0;tn='';en=0;sn=0;nn=0;rn=0;hn=0;ln=0;an=0;cn=0;fn=0;un=!1;dn=0;wn=0;yn=0;pn=0;An=null;mn=0;gn=0;In=0;_n=0;Cn=!1;En=[];vn=[];bn=0;Tn=0;On=0;Rn=null;Sn=0;Ln=new Int32Array(500);xn=new Int32Array(500);Mn=new Int32Array(500);kn=new Int32Array(500);Dn=0;Nn=0;Fn=0;Bn='';Pn=!1;Un=-1;Wn=0;Gn=0;Yn=0;Hn=0;Vn=0;Kn=new Int32Array(1e3);Xn=new Int32Array(1e3);jn=null;zn=0;Zn=0;qn=0;Jn=0;$n=0;Qn=!1;tr=0;ir=0;er=0;sr=0;nr=2;rr=2;hr=1;lr=new Int32Array(5);ar=new d.Ae(5,!1);cr=new Int32Array(5);ur=new Int32Array(5);dr=new Int32Array(5);wr=0;yr=0;pr=0;Ar=0;mr=0;gr=0;Ir=0;_r=0;Cr=0;Er=1;vr=2;br=-1;Tr=0;Or=0;Rr=0;Sr=0;Lr=0;Mr=0;kr=null;Dr=null;Nr=null;Fr=0;Br=0;Pr=new Int8Array(16384);Ur=new d.Ae(f.A.Wr,null);Gr=0;Yr=0;Hr=128;Vr=0;Kr=0;Xr=0;jr=0;zr=0;Zr=null;qr=null;Jr=new d.$r(f.A.Qr,f.A.Qr);th=0;ih=0;eh=0;sh=0;nh=0;rh=0;hh=0;oh=0;lh=0;ah=0;fh=0;uh=0;dh=new d.Ae(this.Ft,null);wh=0;yh=new Int32Array(this.Ft);ph=0;Ah=0;mh=new Int32Array(this.Ft);gh=new Int32Array(1e3);Ih=new d.Ae(this.Ft,null);_h=new d.Ae(8192,null);Ch=0;Eh=new Int32Array(8192);bh=new l.A;Th=new l.A;Oh=new l.A;Rh=new l.A;Sh=new d.Lh(f.A.Wr,f.A.Qr,f.A.Qr,null);xh=new l.A;Mh=new Int32Array(4e3);kh=new Int32Array(4e3);Dh=new Int32Array(f.A.Qr*f.A.Qr);Nh=new Int32Array(f.A.Qr*f.A.Qr);Fh=0;Bh=null;Ph=0;Uh=0;Wh=-1;Gh=0;Yh=0;Hh=0;Vh=0;Kh=!1;Xh=!0;jh=!1;zh=new Int32Array(7);Zh=new Int32Array(5);qh=0;Jh=0;static $h=50;Qh=new Int32Array(N.$h);io=new Int32Array(N.$h);eo=new Int32Array(N.$h);so=new Int32Array(N.$h);no=new Int32Array(N.$h);ro=new Int32Array(N.$h);ho=new Int32Array(N.$h);oo=new d.Ae(N.$h,null);lo=new d.Ae(100,null);ao=new BigInt64Array(100);co=new Int32Array(100);fo=null;uo=0;do=!0;wo=new Int32Array(50);yo=new Int32Array(50);po=new Int32Array(50);Ao=192;mo=-1;Io=-1;_o=0;Co=0;Eo=0;vo=!0;bo=null;To=0;Oo=0;Ro=192;it=void 0;So=!1;host=null;Lo=null;xo=new d.Ae(16,null);Mo=0;ko=!1;Do=()=>{try{this.stream&&this.stream.close()}catch(t){}this.Lo&&'998'===N.getParameter('world')&&this.Lo.nt?.send(JSON.stringify({type:'close',id:this.Lo.et})),this.stream=null,(0,v.No)(!1),this.Kt=null,this.Xt=null,this.in=null,this.Nr=null,this.kr=null,this.Dr=null,this.Zr=null,this.qr=null,this.jn=null,this.Ur=null,this.Dh=null,this.Nh=null,this.Mh=null,this.kh=null,this.Pr=null,this.Wi=null,this.Gi=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.Ji=null,this.$i=null,this.Qi=null,this.te=null,this.ie=null,this.ee=null,this.ce=null,this.ue=null,this.fe=null,this.de=null,this.we=null,this.ye=null,this.pe=null,this.Me=null,this.ke=null,this.De=null,this.Ne=null,this.Fe=null,this.Be=null,this.Pe=null,this.Ue=null,this.We=null,this.Ge=null,this.ge=null,this.Ce=null,this.Ee=null,this.be=null,this.Te=null,this.Oe=null,this.Re=null,this.Se=null,this.Ie=null,this._e=null,this.Jr=null,this.dh=null,this.yh=null,this.mh=null,this.Ih=null,this.gh=null,this._h=null,this.Eh=null,this.Sh=null,this.xh=null,this.Rh=null,this.bh=null,this.Th=null,this.Oh=null,this.Mn=null,this.kn=null,this.Ln=null,this.xn=null,this.fs=null,this.En=null,this.Kn=null,this.Xn=null,this.Ve=null,this.me=null,this.lo=null,this.ao=null,this.co=null,this.ai=null,this.ci=null,this.hi=null,this.oi=null,this.li=null,this.fi=null,this.ui=null,this.di=null,this.wi=null,this.Fo(),b.A.Do(),T.A.Do(),p.A.Do(),O.A.Bo=null,_.A.Bo=null,s.A.Bo=null,g.A.Bo=null,R.A.Bo=null,R.A.Po=null,S.A.Bo=null,this.Uo=null,u.A.Po=null,n.A.Do(),a.A.Do(),m.A.Do(),L.A.Bo=[],x.A.Bo=[]};Wo(){return this.ni}Go(){return this.Xs}Yo(){return this.Gs}Ho(){return this.ds}Vo(){return this.Ze}Fo=()=>{this.vi=!1,this.Ui&&(clearInterval(this.Ui),this.Ui=null),this.yi=null,this.pi=null,this.Ei=[],this.xi=null,this.Mi=null,this.ki=null,this.Di=null,this.Ri=null,this.Oi=null,this.Si=null,this.Li=null,this.bi=null,this.Ti=null};Ko=()=>{'999'===N.getParameter('world')?(this.it=new Worker('worker.js',{type:'module'}),this.it.onmessage=this.onmessage,this.host=new k(this.it)):'998'===N.getParameter('world')&&(this.it={onmessage:t=>{this.stream.Xo.onmessage(t)},postMessage:t=>{this.Lo&&this.Lo.nt&&'open'===this.Lo.nt.readyState&&this.Lo.nt.send(JSON.stringify(t))},onerror:null,onmessageerror:null,terminate:()=>{throw new Error},addEventListener:()=>{throw new Error},removeEventListener:()=>{throw new Error},dispatchEvent:()=>{throw new Error}},this.Lo=new D(this.it))};onmessage=t=>{switch(t.data.type){case'ready':return void(this.So=!0);case'save':return M(t.data.value,t.data.path.split('/').pop().split('\\').pop()),void URL.revokeObjectURL(t.data.value);case'close':return void this.it?.postMessage({type:'close',id:t.data.id})}this.host?.et===t.data.id?this.stream.Xo.onmessage(t.data):this.host?.postMessage(t)};jo=async()=>{if(999==+N.getParameter('world'))this.host&&await this.host.st();else if(998==+N.getParameter('world')&&this.Lo){if(this.Lo.nt)return void console.log('You are already connected.');const t=prompt('Paste offer here, answer will be copied to clipboard');if(t)try{await this.Lo.rt(t)}catch(t){console.error(t)}}};zo=async(t,i,e,s)=>{let n=5,o=await(this.db?.Zo(t));if(o&&h.A.qo(o)!==e&&(o=void 0),o)return new r.A(o);for(;!o;){await this.Jo(s,`Requesting ${i}`);try{o=+N.getParameter('world')<998?await(0,C.$o)(`${N.ft}/${t}${e}`):await(0,C.$o)(`${N.ft}/${t}`)}catch(t){o=void 0;for(let t=n;t>0;t--)await this.Jo(s,`Error loading - Will retry in ${t} secs.`),await(0,C.Qo)(1e3);n*=2,n>60&&(n=60)}}return await(this.db?.tl(t,o)),new r.A(o)};il=async(t,i,e,s)=>{let n=await(this.db?.Zo(t+'.mid'));if(n&&12345678!==i&&h.A.qo(n)!==i&&(n=void 0),!n)try{n=+N.getParameter('world')<998?await(0,C.$o)(`${N.ft}/${t}_${i}.mid`):await(0,C.$o)(`${N.ft}/songs/${t}.mid`),e!==n.length&&(n=n.slice(0,e))}catch(t){}if(!n)return;await(this.db?.tl(t+'.mid',n));const r=new h.A(Uint8Array.from(n)).el,o=E.A.read(r,n,e,4);(0,v.sl)(o,this.Ro,s)};nl=()=>{if(w.rl.fillStyle='black',w.rl.fillRect(0,0,this.width,this.height),this.hl(1),this.Wt){this.vi=!1,w.rl.font='bold 16px helvetica, sans-serif',w.rl.textAlign='left',w.rl.fillStyle='yellow';let t=35;w.rl.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,w.rl.fillStyle='white',w.rl.fillText('To fix this try the following (in order):',30,t),t+=50,w.rl.font='bold 12px helvetica, sans-serif',w.rl.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.rl.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,w.rl.fillText('3: Try using a different game-world',30,t),t+=30,w.rl.fillText('4: Try rebooting your computer',30,t),t+=30,w.rl.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.Gt&&(this.vi=!1,w.rl.font='bold 20px helvetica, sans-serif',w.rl.textAlign='left',w.rl.fillStyle='white',w.rl.fillText('Error - unable to load game!',50,50),w.rl.fillText('To play RuneScape make sure you play from',50,100),w.rl.fillText('https://2004scape.org',50,150)),this.Ut){this.vi=!1,w.rl.font='bold 13px helvetica, sans-serif',w.rl.textAlign='left',w.rl.fillStyle='yellow';let t=35;w.rl.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,w.rl.fillStyle='white',w.rl.fillText('To fix this try the following (in order):',30,t),t+=50,w.rl.font='bold 12px helvetica, sans-serif',w.rl.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.rl.fillText('2: Try rebooting your computer, and reloading',30,t)}};ol=t=>{if(!t.ll)return!1;for(let i=0;i=s)return!1}else if(3===t.ll[i]){if(e<=s)return!1}else if(4===t.ll[i]){if(e===s)return!1}else if(e!==s)return!1}return!0};fl=(t,i,e,s,n)=>{this.Le?.draw(t,i),this.xe?.draw(t,i+n-16),y.A.fillRect(t,i+16,16,n-32,A.A.ul);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.dl),y.A.wl(t,i+h+16,A.A.yl,r),y.A.wl(t+1,i+h+16,A.A.yl,r),y.A.pl(t,i+h+16,A.A.yl,16),y.A.pl(t,i+h+17,A.A.yl,16),y.A.wl(t+15,i+h+16,A.A.Al,r),y.A.wl(t+14,i+h+17,A.A.Al,r-1),y.A.pl(t,i+h+r+15,A.A.Al,16),y.A.pl(t+1,i+h+r+14,A.A.Al,15)};ml=(t,i)=>{let e=!1;const n=s.A.Bo[t];if(!n.gl)return!1;for(let t=0;ts.delay[r.El];)r.Cl-=s.delay[r.El]+1,r.El++,r.El>=s.vl&&(r.El-=s.bl,(r.El<0||r.El>=s.vl)&&(r.El=0)),e=!0}}}return e};Tl=(t,i,e,r,h=!1)=>{if(0!==t.type||!t.gl||t.hide&&this.en!==t.id&&this.sn!==t.id&&this.nn!==t.id)return;const o=y.A.left,l=y.A.top,a=y.A.right,c=y.A.bottom;y.A.Ol(i,e,i+t.width,e+t.height);const f=t.gl.length;for(let o=0;o0&&this.kl(c),c.type===s.A.Dl)c.Nl>c.scroll-c.height&&(c.Nl=c.scroll-c.height),c.Nl<0&&(c.Nl=0),this.Tl(c,l,a,c.Nl,h),c.scroll>c.height&&this.fl(l+c.width,a,c.Nl,c.scroll,c.height);else if(c.type===s.A.Fl){let t=0;for(let i=0;i0){let i=0,e=0;const r=c.Ul[t]-1;if(s>=-32&&s<=512&&n>=-32&&n<=334||0!==this.ln&&this.hn===t){const h=p.A.Hl(r,c.Wl[t]);if(0!==this.ln&&this.hn===t&&this.rn===c.id?(i=this.Vl-this.an,e=this.Kl-this.cn,i<5&&i>-5&&(i=0),e<5&&e>-5&&(e=0),this.fn<5&&(i=0,e=0),h.Xl(128,s+i,n+e)):0!==this.mn&&this.gn===t&&this.In===c.id?h.Xl(128,s,n):h.draw(s,n),33===h.jl||1!==c.Wl[t]){const r=c.Wl[t];this.gi?.zl(s+i+1,n+10+e,this.Zl(r),A.A.ql),this.gi?.zl(s+i,n+9+e,this.Zl(r),A.A.Jl)}}}else if(c.$l&&t<20){const i=c.$l[t];i?.draw(s,n)}t++}}else if(c.type===s.A.Ql)c.fill?y.A.fillRect(l,a,c.width,c.height,c.ta):y.A.Ll(l,a,c.width,c.height,c.ta);else if(c.type===s.A.ia){const t=c.font;let i=c.ta,e=c.text;if(this.nn!==c.id&&this.sn!==c.id&&this.en!==c.id||0===c.ea||(i=c.ea),this.ol(c)&&(i=c.sa,c.na&&c.na.length>0&&(e=c.na)),c.ra===s.A.ha&&this.Cn&&(e='Please wait...',i=c.ta),!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.oa(this.al(c,0))+e.substring(t+2)}for(;;){const t=e.indexOf('%2');if(-1===t)break;e=e.substring(0,t)+this.oa(this.al(c,1))+e.substring(t+2)}for(;;){const t=e.indexOf('%3');if(-1===t)break;e=e.substring(0,t)+this.oa(this.al(c,2))+e.substring(t+2)}for(;;){const t=e.indexOf('%4');if(-1===t)break;e=e.substring(0,t)+this.oa(this.al(c,3))+e.substring(t+2)}for(;;){const t=e.indexOf('%5');if(-1===t)break;e=e.substring(0,t)+this.oa(this.al(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.la?t.aa(l+(c.width/2|0),s,r,i,c.ca):t.fa(l,s,r,i,c.ca)}}else if(c.type===s.A.ua){let t;t=this.ol(c)?c.da:c.wa,t?.draw(l,a)}else if(c.type===s.A.ya){const t=n.A.pa,i=n.A.Aa;n.A.pa=l+(c.width/2|0),n.A.Aa=a+(c.height/2|0);const e=n.A.sin[c.ma]*c.zoom>>16,s=n.A.cos[c.ma]*c.zoom>>16,r=this.ol(c);let h;h=r?c._l:c.Il;let o=null;if(-1===h)o=c.ga(-1,-1,r);else{const t=g.A.Bo[h];t.frames&&t.Ia&&(o=c.ga(t.frames[c.El],t.Ia[c.El],r))}o&&o._a(0,c.Ca,0,c.ma,0,e,s),n.A.pa=t,n.A.Aa=i}else if(c.type===s.A.Ea){const t=c.font;if(!t||!c.Ul||!c.Wl)continue;let i=0;for(let e=0;e0){const n=p.A.get(c.Ul[i]-1);let r=n.name;if((n.va||1!==c.Wl[i])&&(r=r+' x'+this.ba(c.Wl[i])),!r)continue;const h=l+s*(c.Gl+115),o=a+e*(c.Yl+12);c.la?t.aa(h+(c.width/2|0),o,r,c.ta,c.ca):t.fa(h,o,r,c.ta,c.ca)}i++}}}y.A.Ol(o,l,a,c)};kl=t=>{let i=t.Ml;if(i>=s.A.Ta&&i<=s.A.Oa)i--,i>=this.qh?(t.text='',t.ra=0):(t.text=this.lo[i],t.ra=1);else if(i>=s.A.Ra&&i<=s.A.Sa)i-=s.A.Ra,i>=this.qh?(t.text='',t.ra=0):(0===this.co[i]?t.text='@red@Offline':this.co[i]===N.ot?t.text='@gre@World-'+(this.co[i]-9):t.text='@yel@World-'+(this.co[i]-9),t.ra=1);else if(i===s.A.La)t.scroll=15*this.qh+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i>=s.A.xa&&i<=s.A.Ma)i-=s.A.xa,i>=this.As?(t.text='',t.ra=0):(t.text=I.A.ka(I.A.Da(this.gs[i])),t.ra=1);else if(i===s.A.Na)t.scroll=15*this.As+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i===s.A.Fa){if(t.ma=150,t.Ca=256*Math.sin(this.Yt/40)&2047,this.jh){this.jh=!1;const i=new d.Ae(7,null);let e=0;for(let t=0;t<7;t++){const s=this.zh[t];s>=0&&(i[e++]=_.A.Bo[s].ga())}const s=m.A.Ba(i,e);for(let t=0;t<5;t++)0!==this.Zh[t]&&(s.Pa(u.A.Ua[t][0],u.A.Ua[t][this.Zh[t]]),1===t&&s.Pa(u.A.Wa[0],u.A.Wa[this.Zh[t]]));if(this.Bh){const i=g.A.Bo[this.Bh.Ga].frames;i&&(s.Ya(),s.Ha(i[0]),s.Va(64,850,-30,-50,-30,!0),t.model=s)}}}else if(i===s.A.Ka)this.Ye||(this.Ye=t.wa,this.He=t.da),this.Xh?t.wa=this.He:t.wa=this.Ye;else if(i===s.A.Xa)this.Ye||(this.Ye=t.wa,this.He=t.da),this.Xh?t.wa=this.Ye:t.wa=this.He;else if(i===s.A.ja)t.text=this.Bn,this.Yt%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(i===s.A.za)this.Kh?this.Pn?(t.ta=A.A.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.ta=A.A.xl,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(i===s.A.Za||i===s.A.qa)if(0===this.Wn)t.text='';else{let i;i=0===this.Gn?'earlier today':1===this.Gn?'yesterday':this.Gn+' days ago',t.text='You last logged in '+i+' from: '+I.A.Ja(this.Wn)}else if(i===s.A.$a)0===this.Hn&&(t.text='0 unread messages',t.ta=A.A.Jl),1===this.Hn&&(t.text='1 unread message',t.ta=A.A.GREEN),this.Hn>1&&(t.text=this.Hn+' unread messages',t.ta=A.A.GREEN);else if(i===s.A.Qa)if(201===this.Yn)t.text='';else if(200===this.Yn)t.text='You have not yet set any password recovery questions.';else{let i;i=0===this.Yn?'Earlier today':1===this.Yn?'Yesterday':this.Yn+' days ago',t.text=i+' you changed your recovery questions'}else i===s.A.tc?201===this.Yn?t.text='':200===this.Yn?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.ic&&(201===this.Yn?t.text='':(this.Yn,t.text="Do this from the 'account management' area on our front webpage"))};al=(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.Ss[e[r++]];else if(2===t)n+=this.Ls[e[r++]];else if(3===t)n+=this.Rs[e[r++]];else if(4===t){const t=s.A.Bo[e[r++]],i=e[r++]+1;if(t.Ul&&t.Wl)for(let e=0;et<999999999?String(t):'*';ba=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};Zl=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(8370),n=e(6200),r=e(9234);async function h(){await async function(){0===s.A.getParameter('world').length&&s.A.setParameter('world','1');['0','998','999'].includes(s.A.getParameter('world'))?function(){if(+s.A.getParameter('world')>=998)return void(n.K.ft='data/pack/client');n.K.ct='http://localhost',n.K.ft='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.ot=10+i.id-1,n.K.ct=`${e.protocol}//${e.hostname}`,n.K.ft=`${e.protocol}//${e.hostname}:${e.port}`,t||(n.K.ct=n.K.ct.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.Nt():n.K.Dt()}(),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.sc)(`${s}//2004scape.org/api/v1/worldlist`))}catch(s){return await(0,r.Qo)(1e3),o(t,i,++e)}n.push({id:0,region:'Local Development',address:'http://localhost',portOffset:0,members:!0,dh:0});const h=n.find((t=>t.id===i));return h||o(t,i,10)}},8370:(t,i,e)=>{e.d(i,{A:()=>c});var s=e(1183),n=e(4583),r=e(9234);const h=['F11','F12'],o={'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}};var l=e(2595),a=e(7854);class c{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())}nc=0;rc=[];hc=0;Uo=null;state=0;oc=20;lc=1;ac=[];cc=0;fc=0;uc=[];dc=!0;wc=!1;yc=50;hasFocus=!0;Ac=!1;mc=Date.now();gc=0;Vl=0;Kl=0;Ic=0;_c=0;Cc=0;Ec=[];vc=[];bc=0;Tc=0;input=null;Oc=!1;Rc=!1;Sc=!1;time=-1;Lc=0;xc=0;Mc=0;kc=0;Dc=0;Nc=0;constructor(t=!1){a.Fc.tabIndex=-1,a.rl.fillStyle='black',a.rl.fillRect(0,0,a.Fc.width,a.Fc.height),this.wc=t,this.wc?this.resize(window.innerWidth,window.innerHeight):this.resize(a.Fc.width,a.Fc.height)}get width(){return a.Fc.width}get height(){return a.Fc.height}resize=(t,i)=>{a.Fc.width=t,a.Fc.height=i,this.Uo=new s.A(t,i),n.A.Bc()};run=async()=>{a.Fc.addEventListener('resize',(()=>{this.wc&&this.resize(window.innerWidth,window.innerHeight)}),!1),a.Fc.onmousedown=this.onmousedown,a.Fc.onmouseup=this.onmouseup,a.Fc.onmouseenter=this.onmouseenter,a.Fc.onmouseleave=this.onmouseleave,a.Fc.onmousemove=this.onmousemove,window.onbeforeunload=this.Do,a.Fc.onfocus=this.onfocus,a.Fc.onblur=this.onblur,this.Pc?(a.Fc.ontouchstart=this.ontouchstart,a.Fc.ontouchend=this.ontouchend,a.Fc.ontouchmove=this.ontouchmove):(a.Fc.onkeydown=this.onkeydown,a.Fc.onkeyup=this.onkeyup),a.Fc.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.Pc&&'low'===c.getParameter('detail')&&(this.yc=30),await this.Jo(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.ac[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.Uc();const h=e,o=s;e=300,s=1,t=performance.now();const l=this.ac[i];if(0===l?(e=h,s=o):t>l&&(e=2560*this.oc/(t-l)|0),e<25?e=25:e>256&&(e=256,s=this.oc-(t-l)/10|0),this.ac[i]=t,i=(i+1)%10,s>1)for(let t=0;t<10;t++)0!==this.ac[t]&&(this.ac[t]+=s);for(s0&&(this.cc=1e3*e/(256*this.oc)|0);const a=performance.now();if(this.dc&&this.refresh(),await this.draw(),this.uc[this.fc]=(performance.now()-a)/1e3,this.fc=(this.fc+1)%this.uc.length,this.yc<50){const i=1e3/this.yc-(performance.now()-t);i>0&&await(0,r.Qo)(i)}}-1===this.state&&this.Uc()};Uc=()=>{this.state=-2,this.Do()};hl=t=>{this.oc=1e3/t|0};Wc=t=>{this.yc=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.oc|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};Do=()=>{};draw=async()=>{};refresh=()=>{};async Jo(t,i){const e=this.width,s=this.height;this.dc&&(a.rl.fillStyle='black',a.rl.fillRect(0,0,e,s),this.dc=!1);const n=s/2-18;a.rl.fillStyle='rgb(140, 17, 17)',a.rl.rect((e/2|0)-152,n,304,34),a.rl.fillRect((e/2|0)-150,n+2,3*t,30),a.rl.fillStyle='black',a.rl.fillRect((e/2|0)-150+3*t,n+2,300-3*t,30),a.rl.font='bold 13px helvetica, sans-serif',a.rl.textAlign='center',a.rl.fillStyle='white',a.rl.fillText(i,e/2|0,n+22),await(0,r.Qo)(5)}Gc=()=>{let t=-1;return this.Tc!==this.bc&&(t=this.vc[this.bc],this.bc=this.bc+1&127),t};get ms(){const t=this.uc.length;let i=0;for(let e=0;ethis.nc&&(this.nc=e),this.rc[this.hc]=e,this.hc=(this.hc+1)%250,e}get Yc(){return this.rc.reduce(((t,i)=>t+i),0)/250}onkeydown=t=>{const i=t.key;this.mc=Date.now();const e=o[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===o.ArrowLeft.code?n=1:s===o.ArrowRight.code?n=2:s===o.ArrowUp.code?n=3:s===o.ArrowDown.code?n=4:s===o.Control.code?n=5:s===o.Shift.code?n=6:s===o.Alt.code?n=7:s===o.Backspace.code||s===o.Delete.code?n=8:s===o.Tab.code?n=9:s===o.Enter.code?n=10:s>=o.F1.code&&s<=o.F12.code?n=s+1008-o.F1.code:s===o.Home.code?n=1e3:s===o.End.code?n=1001:s===o.PageUp.code?n=1002:s===o.PageDown.code&&(n=1003),n>0&&n<128&&(this.Ec[n]=1),n>4&&(this.vc[this.Tc]=n,this.Tc=this.Tc+1&127),l.A.enabled&&l.A.Hc(n),h.includes(i)||t.preventDefault()};onkeyup=t=>{const i=t.key;this.mc=Date.now();const e=o[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===o.ArrowLeft.code?n=1:s===o.ArrowRight.code?n=2:s===o.ArrowUp.code?n=3:s===o.ArrowDown.code?n=4:s===o.Control.code?n=5:s===o.Shift.code?n=6:s===o.Alt.code?n=7:s===o.Backspace.code||s===o.Delete.code?n=8:s===o.Tab.code?n=9:s===o.Enter.code?n=10:s>=o.F1.code&&s<=o.F12.code?n=s+1008-o.F1.code:s===o.Home.code?n=1e3:s===o.End.code?n=1001:s===o.PageUp.code?n=1002:s===o.PageDown.code&&(n=1003),n>0&&n<128&&(this.Ec[n]=0),l.A.enabled&&l.A.Vc(n),h.includes(i)||t.preventDefault()};onmousedown=t=>{if(this.Oc=!1,(t.clientX>0||t.clientY>0)&&this.Kc(t),this.mc=Date.now(),this._c=this.Vl,this.Cc=this.Kl,this.Pc&&!this.Xc){if(this.jc()||this.zc()||this.Zc())return this.Ic=1,void(this.gc=1);t.timeStamp>=this.time+500?(this.Ic=2,this.gc=2):(this.Ic=1,this.gc=1)}else 2===t.button?(this.Ic=2,this.gc=2):(this.Ic=1,this.gc=1);l.A.enabled&&l.A.qc(this._c,this.Cc,t.buttons)};onmouseup=t=>{this.Kc(t),this.mc=Date.now(),this.gc=0,l.A.enabled&&l.A.Jc(t.buttons)};onmouseenter=t=>{this.Kc(t),l.A.enabled&&l.A.$c()};onmouseleave=t=>{this.Kc(t),this.mc=Date.now(),this.Vl=-1,this.Kl=-1,this.gc=0,this._c=-1,this.Cc=-1,l.A.enabled&&l.A.Qc()};onmousemove=t=>{this.Kc(t),this.mc=Date.now(),l.A.enabled&&l.A.tf(this.Vl,this.Kl)};onfocus=t=>{this.hasFocus=!0,this.dc=!0,this.refresh(),l.A.enabled&&l.A.if()};onblur=t=>{this.hasFocus=!1,l.A.enabled&&l.A.ef()};ontouchstart=t=>{if(!this.Pc)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.Oc=!0;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.Lc=this.Dc=this.Mc=0|i.screenX,this.xc=this.Nc=this.kc=0|i.screenY,this.time=t.timeStamp,this.Rc=this.sf(),this.Sc=this.nf()};ontouchend=t=>{if(!this.Pc||!this.Oc)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.Dc=0|i.screenX,this.Nc=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.Rc&&!this.sf())return void(this.Oc=!1);if(this.Sc&&!this.nf())return void(this.Oc=!1);if(this.jc()||this.rf()||this.zc()||this.Zc()){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.Zc()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.jc()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.rf()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this.hf?t.setAttribute('type','password'):t.setAttribute('type',this.Zc()?'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.hf&&(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.hf&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this.hf&&'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.Oc=!1)}const n=t.timeStamp>=this.time+500,r=Math.abs(this.Lc-this.Dc)>16||Math.abs(this.xc-this.Nc)>16;n&&!r?(this.Oc=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.gc=0,this.Oc=!1)};ontouchmove=t=>{if(!this.Pc||!this.Oc)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.Dc=0|i.screenX,this.Nc=0|i.screenY,this.Rc&&-1===this.Vo()?(this.Mc-this.Dc>0?this.rotate(2):this.Mc-this.Dc<0&&this.rotate(0),this.kc-this.Nc>0?this.rotate(3):this.kc-this.Nc<0&&this.rotate(1)):(this.Sc||-1!==this.Vo())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this.Mc=this.Dc,this.kc=this.Nc};get Pc(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get hf(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get Xc(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}sf=()=>this.Ac&&this.Vl>=8&&this.Vl<=520&&this.Kl>=11&&this.Kl<=345;jc=()=>this.Ac&&-1===this.Ho()&&!this.Go()&&!this.Yo()&&this.Vl>=11&&this.Vl<=506&&this.Kl>=449&&this.Kl<=482;rf=()=>this.Ac&&(this.Go()||this.Yo())&&this.Vl>=11&&this.Vl<=506&&this.Kl>=383&&this.Kl<=482;nf=()=>this.Ac&&this.Vl>=562&&this.Vl<=752&&this.Kl>=231&&this.Kl<=492;zc=()=>!this.Ac&&2===this.Wo()&&this.Vl>=301&&this.Vl<=562&&this.Kl>=262&&this.Kl<=279;Zc=()=>!this.Ac&&2===this.Wo()&&this.Vl>=301&&this.Vl<=562&&this.Kl>=279&&this.Kl<=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'})))};lf=()=>null!==document.fullscreenElement;Kc=t=>{if(this.lf()){const i=t.target.getBoundingClientRect(),e=window.innerHeight/a.Fc.height,s=(window.innerWidth-a.Fc.width*e)/2;this.Vl=0|this.af(t.clientX-i.left-s,0,a.Fc.width*e,0,789),this.Kl=0|this.af(t.clientY-i.top,0,a.Fc.height*e,0,532)}else{const i=a.Fc.getBoundingClientRect(),e=a.Fc.width/i.width,s=a.Fc.height/i.height;this.Vl=(t.clientX-i.left)*e|0,this.Kl=(t.clientY-i.top)*s|0}this.Vl<0&&(this.Vl=0),this.Kl<0&&(this.Kl=0),this.Vl>789&&(this.Vl=789),this.Kl>532&&(this.Kl=532)};af=(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 cf=null;static ff=null;static uf=0;static df=0;static wf=0;static yf=0;static pf=0;static Af=()=>{this.cf=s.A.Vt(1),this.ff=null,this.uf=performance.now(),this.enabled=!0};static mf=()=>{this.enabled=!1,this.cf=null};static flush=()=>{let t=null;return this.ff&&this.enabled&&(t=this.ff),this.ff=null,t};static stop=()=>{let t=null;return this.cf&&this.cf.gf>0&&this.enabled&&(t=this.cf),this.mf(),t};static qc=(t,i,e)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;this.df++;const s=performance.now();let n=(s-this.uf)/10|0;n>250&&(n=250),this.uf=s,this.If(5),1===e?this.cf?.p1(1):this.cf?.p1(2),this.cf?.p1(n),this.cf?.p3(t+(i<<10))};static Jc=t=>{if(!this.enabled)return;this.df++;const i=performance.now();let e=(i-this.uf)/10|0;e>250&&(e=250),this.uf=i,this.If(2),1===t?this.cf?.p1(3):this.cf?.p1(4),this.cf?.p1(e)};static tf=(t,i)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;const e=performance.now();if(e-this.wf>=50){this.wf=e,this.df++;let s=(e-this.uf)/10|0;s>250&&(s=250),this.uf=e,t-this.yf<8&&t-this.yf>=-8&&i-this.pf<8&&i-this.pf>=-8?(this.If(3),this.cf?.p1(5),this.cf?.p1(s),this.cf?.p1(t+(i-this.pf+8<<4)+8-this.yf)):t-this.yf<128&&t-this.yf>=-128&&i-this.pf<128&&i-this.pf>=-128?(this.If(4),this.cf?.p1(6),this.cf?.p1(s),this.cf?.p1(t+128-this.yf),this.cf?.p1(i+128-this.pf)):(this.If(5),this.cf?.p1(7),this.cf?.p1(s),this.cf?.p3(t+(i<<10))),this.yf=t,this.pf=i}};static Hc=t=>{if(!this.enabled)return;this.df++;const i=performance.now();let e=(i-this.uf)/10|0;e>250&&(e=250),this.uf=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.cf?.p1(8),this.cf?.p1(e),this.cf?.p1(t)};static Vc=t=>{if(!this.enabled)return;this.df++;const i=performance.now();let e=(i-this.uf)/10|0;e>250&&(e=250),this.uf=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.cf?.p1(9),this.cf?.p1(e),this.cf?.p1(t)};static if=()=>{if(!this.enabled)return;this.df++;const t=performance.now();let i=(t-this.uf)/10|0;i>250&&(i=250),this.uf=t,this.If(2),this.cf?.p1(10),this.cf?.p1(i)};static ef=()=>{if(!this.enabled)return;this.df++;const t=performance.now();let i=(t-this.uf)/10|0;i>250&&(i=250),this.uf=t,this.If(2),this.cf?.p1(11),this.cf?.p1(i)};static $c=()=>{if(!this.enabled)return;this.df++;const t=performance.now();let i=(t-this.uf)/10|0;i>250&&(i=250),this.uf=t,this.If(2),this.cf?.p1(12),this.cf?.p1(i)};static Qc=()=>{if(!this.enabled)return;this.df++;const t=performance.now();let i=(t-this.uf)/10|0;i>250&&(i=250),this.uf=t,this.If(2),this.cf?.p1(13),this.cf?.p1(i)};static If=t=>{if(this.cf&&this.cf.gf+t>=500){const t=this.cf;this.cf=s.A.Vt(1),this.ff=t}}}},1120:(t,i,e)=>{e.d(i,{A:()=>c});var s=e(1069),n=e(8665),r=e(2031),h=e(1122),o=e(3819),l=e(3867),a=e(8950);class c{static Bo=[];static _f=null;static Po=null;static Dl=0;static Cf=1;static Fl=2;static Ql=3;static ia=4;static ua=5;static ya=6;static Ea=7;static Ef=1;static vf=2;static bf=3;static Tf=4;static Of=5;static ha=6;static Ta=1;static Oa=100;static Ra=101;static Sa=200;static Rf=201;static Sf=202;static La=203;static Lf=205;static xf=300;static Mf=301;static kf=302;static Df=303;static Nf=304;static Ff=305;static Bf=306;static Pf=307;static Uf=308;static Wf=309;static Gf=310;static Yf=311;static Hf=312;static Vf=313;static Kf=314;static Xf=315;static jf=316;static zf=317;static Zf=318;static qf=319;static Jf=320;static $f=321;static Qf=322;static tu=323;static Ka=324;static Xa=325;static iu=326;static Fa=327;static xa=401;static Ma=500;static eu=501;static su=502;static Na=503;static ja=600;static nu=601;static ru=602;static hu=603;static ou=604;static lu=605;static au=606;static cu=607;static fu=608;static uu=609;static du=610;static wu=611;static yu=612;static za=613;static Za=650;static $a=651;static Qa=652;static tc=653;static ic=654;static qa=655;static pu=(t,i,e)=>{this._f=new r.A(5e4),this.Po=new r.A(5e4);const n=new s.A(t.read('data'));let h=-1;for(n.gf+=2;n.gf0){s.ll=new Uint8Array(r),s.cl=new Uint16Array(r);for(let t=0;t0){s.scripts=new l.Ae(o,null);for(let t=0;t0){const n=e.lastIndexOf(',');s.$l[t]=this.bu(i,e.substring(0,n),parseInt(e.substring(n+1),10))}}s.Tu=new l.Ae(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.Ql&&(s.fill=1===n.gu),s.type===c.ia||s.type===c.Cf){s.la=1===n.gu;const t=n.gu;e&&(s.font=e[t]),s.ca=1===n.gu}if(s.type===c.ia&&(s.text=n.vu,s.na=n.vu),s.type!==c.Cf&&s.type!==c.Ql&&s.type!==c.ia||(s.ta=n.el),s.type!==c.Ql&&s.type!==c.ia||(s.sa=n.el,s.ea=n.el),s.type===c.ua){const t=n.vu;if(t.length>0){const e=t.lastIndexOf(',');s.wa=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.da=this.bu(i,e.substring(0,t),parseInt(e.substring(t+1),10))}}if(s.type===c.ya){const t=n.gu;0!==t&&(s.model=this.ga((t-1<<8)+n.gu));const i=n.gu;0!==i&&(s.Ou=this.ga((i-1<<8)+n.gu)),s.Il=n.gu,0===s.Il?s.Il=-1:s.Il=(s.Il-1<<8)+n.gu,s._l=n.gu,0===s._l?s._l=-1:s._l=(s._l-1<<8)+n.gu,s.zoom=n.Au,s.ma=n.Au,s.Ca=n.Au}if(s.type===c.Ea){s.Ul=new Int32Array(s.width*s.height),s.Wl=new Int32Array(s.width*s.height),s.la=1===n.gu;const t=n.gu;e&&(s.font=e[t]),s.ca=1===n.gu,s.ta=n.el,s.Gl=n._u,s.Yl=n._u,s.Cu=1===n.gu,s.Tu=new l.Ae(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.ra!==c.vf&&s.type!==c.Fl||(s.Ru=n.vu,s.action=n.vu,s.Su=n.Au),s.ra!==c.Ef&&s.ra!==c.Tf&&s.ra!==c.Of&&s.ra!==c.ha||(s.Lu=n.vu,0===s.Lu.length&&(s.ra===c.Ef?s.Lu='Ok':s.ra===c.Tf||s.ra===c.Of?s.Lu='Select':s.ra===c.ha&&(s.Lu='Continue')))}this._f=null,this.Po=null};static bu=(t,i,e)=>{const s=o.A.xu(i)<<8n|BigInt(e);if(this._f){const t=this._f.get(s);if(t)return t}let n;try{n=h.A.Mu(t,i,e),this._f?.put(s,n)}catch(t){return null}return n};static ga=t=>{if(this.Po){const i=this.Po.get(BigInt(t));if(i)return i}const i=n.A.model(t);return this.Po?.put(BigInt(t),i),i};id=-1;mu=-1;type=-1;ra=-1;Ml=0;width=0;height=0;Iu=-1;ll=null;cl=null;scripts=null;scroll=0;hide=!1;draggable=!1;Cu=!1;Eu=!1;Gl=0;Yl=0;Bl=null;Pl=null;$l=null;Tu=null;fill=!1;la=!1;font=null;ca=!1;text=null;na=null;ta=0;sa=0;ea=0;wa=null;da=null;model=null;Ou=null;Il=-1;_l=-1;zoom=0;ma=0;Ca=0;Ru=null;action=null;Su=-1;Lu=null;gl=null;Rl=null;Sl=null;x=0;y=0;Nl=0;Ul=null;Wl=null;El=0;Cl=0;ga(t,i,e){let s=this.model;if(e&&(s=this.Ou),!s)return null;if(-1===t&&-1===i&&!s.ku)return s;const r=n.A.Du(s,!0,!0,!1);return-1===t&&-1===i||r.Ya(),-1!==t&&r.Ha(t),-1!==i&&r.Ha(i),r.Va(64,768,-50,-10,-50,!0),r}Nu(){if(this.mu===this.id)return this.x;let t=c.Bo[this.mu];if(!t.gl||!t.Rl||!t.Sl)return this.x;let i=t.gl.indexOf(this.id);if(-1===i)return this.x;let e=t.Rl[i];for(;t.mu!==t.id;){const s=c.Bo[t.mu];s.gl&&s.Rl&&s.Sl&&(i=s.gl.indexOf(t.id),-1!==i&&(e+=s.Rl[i])),t=s}return e}Fu(){if(this.mu===this.id)return this.y;let t=c.Bo[this.mu];if(!t.gl||!t.Rl||!t.Sl)return this.y;let i=t.gl.indexOf(this.id);if(-1===i)return this.y;let e=t.Sl[i];for(;t.mu!==t.id;){const s=c.Bo[t.mu];s.gl&&s.Rl&&s.Sl&&(i=s.gl.indexOf(t.id),-1!==i&&(e+=s.Sl[i])),t=s}return e}outline(t){const i=this.Nu(),e=this.Fu();a.A.Ll(i,e,this.width,this.height,t)}move(t,i){if(this.mu===this.id)return;this.x=0,this.y=0;const e=c.Bo[this.mu];if(e.gl&&e.Rl&&e.Sl){const s=e.gl.indexOf(this.id);-1!==s&&(e.Rl[s]=t,e.Sl[s]=i)}}delete(){if(this.mu===this.id)return;const t=c.Bo[this.mu];if(t.gl&&t.Rl&&t.Sl){const i=t.gl.indexOf(this.id);-1!==i&&(t.gl.splice(i,1),t.Rl.splice(i,1),t.Sl.splice(i,1))}}}},6333:(t,i,e)=>{e.d(i,{$:()=>s});class s{id;Bu=null;constructor(t){this.id=t}Pu(t){for(;;){const i=t.gu;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 Bo=[];static pu=t=>{const i=new s.A(t.read('flo.dat'));this.count=i.Au;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 Wu=(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);Yu=0;texture=-1;Hu=!1;Vu=!0;Ku=0;Xu=0;ju=0;zu=0;Zu=0;qu=0;decode(t,i){1===t?(this.Yu=i.Ju,this.setColor(this.Yu)):2===t?this.texture=i.gu:3===t?this.Hu=!0:5===t?this.Vu=!1:6===t?this.Bu=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.Ku=256*o|0,this.Xu=256*l|0,this.ju=256*a|0,this.Xu<0?this.Xu=0:this.Xu>255&&(this.Xu=255),this.ju<0?this.ju=0:this.ju>255&&(this.ju=255),this.zu=a>.5?(1-a)*l*512|0:a*l*512|0,this.zu<1&&(this.zu=1),this.Zu=o*this.zu|0;let c=this.Ku+(16*Math.random()|0)-8;c<0?c=0:c>255&&(c=255);let f=this.Xu+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255);let u=this.ju+(48*Math.random()|0)-24;u<0?u=0:u>255&&(u=255),this.qu=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 Bo=[];static pu=t=>{const i=new s.A(t.read('idk.dat'));this.count=i.Au;for(let t=0;t=40&&t<50?this.td[t-40]=i.Au:t>=50&&t<60?this.ed[t-50]=i.Au:t>=60&&t<70?this.Qu[t-60]=i.Au:console.log('Error unrecognised config code: ',t)}ga(){if(!this.$u)return null;const t=new h.Ae(this.$u.length,null);for(let i=0;i{e.d(i,{A:()=>c});var s=e(6333),n=e(1069),r=e(2031),h=e(8665),o=e(1023),l=e(6169),a=e(3867);class c extends s.${static count=0;static cache=null;static nd=null;static rd=null;static hd=0;static od=new r.A(500);static ld=new r.A(30);static pu=t=>{this.nd=new n.A(t.read('loc.dat'));const i=new n.A(t.read('loc.idx'));this.count=i.Au,this.rd=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.rd||!this.nd)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.hd=(this.hd+1)%10;const i=this.cache[this.hd];return this.nd.gf=this.rd[t],i.id=t,i.reset(),i.Pu(this.nd),i.ad||(i.ad=new Int32Array(1)),-1===i.fd&&i.ad&&(i.active=i.ad.length>0&&i.ad[0]===o.A.ud.id,i.dd&&(i.active=!0)),i};static Do=()=>{this.od=null,this.ld=null,this.rd=null,this.cache=null,this.nd=null};$u=null;ad=null;name=null;wd=null;td=null;ed=null;width=1;length=1;yd=!0;pd=!0;active=!1;fd=-1;Ad=!1;md=!1;Vu=!1;Il=-1;gd=!1;Id=16;_d=0;Cd=0;dd=null;Ed=-1;vd=-1;bd=!1;Td=!0;Od=128;Rd=128;Sd=128;Ld=0;xd=0;Md=0;kd=0;Dd=!1;decode(t,i){if(1===t){const t=i.gu;this.$u=new Int32Array(t),this.ad=new Int32Array(t);for(let e=0;e=30&&t<39)this.dd||(this.dd=new a.Ae(5,null)),this.dd[t-30]=i.vu,'hidden'===this.dd[t-30]?.toLowerCase()&&(this.dd[t-30]=null);else if(40===t){const t=i.gu;this.td=new Uint16Array(t),this.ed=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.bd!==i>3;w&&(d+=65536);let y=c.od?.get(BigInt(d));y||(y=h.A.model(65535&d),w&&y.Yd(),c.od?.put(BigInt(d),y));const p=128!==this.Od||128!==this.Rd||128!==this.Sd,A=0!==this.xd||0!==this.Md||0!==this.kd;let m=h.A.Du(y,!this.td,!this.gd,i===l.A.Hd&&-1===o&&!p&&!A);for(-1!==o&&(m.Ya(),m.Ha(o),m.Vd=null,m.Kd=null);i-- >0;)m.Xd();if(this.td&&this.ed)for(let t=0;t{e.d(i,{A:()=>l});var s=e(6333),n=e(1069),r=e(2031),h=e(8665),o=e(3867);class l extends s.${static count=0;static cache=null;static nd=null;static rd=null;static hd=0;static Po=new r.A(30);static pu=t=>{this.nd=new n.A(t.read('npc.dat'));const i=new n.A(t.read('npc.idx'));this.count=i.Au,this.rd=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.rd||!this.nd)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.hd=(this.hd+1)%20;const i=this.cache[this.hd]=new l(t);return this.nd.gf=this.rd[t],i.Pu(this.nd),i};static Do=()=>{this.Po=null,this.rd=null,this.cache=null,this.nd=null};name=null;wd=null;size=1;$u=null;Qu=null;gd=!1;Zd=-1;qd=-1;Jd=-1;$d=-1;Qd=-1;td=null;ed=null;dd=null;Od=-1;Rd=-1;Sd=-1;tw=!0;iw=-1;ew=128;sw=128;decode(t,i){if(1===t){const t=i.gu;this.$u=new Uint16Array(t);for(let e=0;e=30&&t<40)this.dd||(this.dd=new o.Ae(5,null)),this.dd[t-30]=i.vu,'hidden'===this.dd[t-30]?.toLowerCase()&&(this.dd[t-30]=null);else if(40===t){const t=i.gu;this.td=new Uint16Array(t),this.ed=new Uint16Array(t);for(let e=0;e{e.d(i,{A:()=>u});var s=e(6333),n=e(1069),r=e(1122),h=e(2031),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 nd=null;static rd=null;static hd=0;static aw=!0;static Po=new h.A(50);static cw=new h.A(200);static pu=(t,i)=>{this.aw=i,this.nd=new n.A(t.read('obj.dat'));const e=new n.A(t.read('obj.idx'));this.count=e.Au,this.rd=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.rd||!this.nd)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.hd=(this.hd+1)%10;const i=this.cache[this.hd];return this.nd.gf=this.rd[t],i.id=t,i.reset(),i.Pu(this.nd),-1!==i.fw&&i.uw(),!this.aw&&i.members&&(i.name='Members Object',i.wd="Login to a members' server to use this object.",i.dd=null,i.dw=null),i};static Do=()=>{this.Po=null,this.cw=null,this.rd=null,this.cache=null,this.nd=null};static Hl=(t,i)=>{if(u.cw){let e=u.cw.get(BigInt(t));if(e&&e.ww!==i&&-1!==e.ww&&(e.yw(),e=null),e)return e}let e=u.get(t);if(e.pw||(i=-1),e.pw&&e.Aw&&i>1){let t=-1;for(let s=0;s<10;s++)i>=e.Aw[s]&&0!==e.Aw[s]&&(t=e.pw[s]);-1!==t&&(e=u.get(t))}const s=new r.A(32,32),n=l.A.pa,h=l.A.Aa,o=l.A.mw,f=a.A.gw,d=a.A.Iw,w=a.A._w,y=a.A.left,p=a.A.right,A=a.A.top,m=a.A.bottom;l.A.Cw=!1,a.A.bind(s.gw,32,32),a.A.fillRect(0,0,32,32,c.A.ql),l.A.Bc();const g=e.Ew(1),I=l.A.sin[e.bw]*e.Tw>>16,_=l.A.cos[e.bw]*e.Tw>>16;g._a(0,e.Ow,e.Rw,e.bw,e.Sw,I+(g.zd/2|0)+e.Lw,_+e.Lw);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.gw[t+32*i]&&(t>0&&s.gw[t+32*i-1]>1||i>0&&s.gw[t+32*(i-1)]>1||t<31&&s.gw[t+32*i+1]>1||i<31&&s.gw[t+32*(i+1)]>1)&&(s.gw[t+32*i]=1);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.gw[t+32*i]&&t>0&&i>0&&s.gw[t+32*(i-1)-1]>0&&(s.gw[t+32*i]=3153952);if(-1!==e.fw){const t=this.Hl(e.xw,10),i=t.jl,s=t.ww;t.jl=32,t.ww=32,t.Mw(5,5,22,22),t.jl=i,t.ww=s}return u.cw?.put(BigInt(t),s),a.A.bind(f,d,w),a.A.Ol(y,A,p,m),l.A.pa=n,l.A.Aa=h,l.A.mw=o,l.A.Cw=!0,e.va?s.jl=33:s.jl=32,s.ww=i,s};model=0;name=null;wd=null;td=null;ed=null;Tw=2e3;bw=0;Ow=0;Rw=0;Sw=0;Lw=0;kw=!1;Dw=-1;va=!1;Nw=1;members=!1;dd=null;dw=null;Fw=-1;Bw=-1;Pw=0;Uw=-1;Ww=-1;Gw=0;Yw=-1;Hw=-1;Vw=-1;Kw=-1;Xw=-1;jw=-1;pw=null;Aw=null;xw=-1;fw=-1;decode(t,i){if(1===t)this.model=i.Au;else if(2===t)this.name=i.vu;else if(3===t)this.wd=i.vu;else if(4===t)this.Tw=i.Au;else if(5===t)this.bw=i.Au;else if(6===t)this.Ow=i.Au;else if(7===t)this.Sw=i._u,this.Sw>32767&&(this.Sw-=65536);else if(8===t)this.Lw=i._u,this.Lw>32767&&(this.Lw-=65536);else if(9===t)this.kw=!0;else if(10===t)this.Dw=i.Au;else if(11===t)this.va=!0;else if(12===t)this.Nw=i.el;else if(16===t)this.members=!0;else if(23===t)this.Fw=i.Au,this.Pw=i.Nd;else if(24===t)this.Bw=i.Au;else if(25===t)this.Uw=i.Au,this.Gw=i.Nd;else if(26===t)this.Ww=i.Au;else if(t>=30&&t<35)this.dd||(this.dd=new f.Ae(5,null)),this.dd[t-30]=i.vu,'hidden'===this.dd[t-30]?.toLowerCase()&&(this.dd[t-30]=null);else if(t>=35&&t<40)this.dw||(this.dw=new f.Ae(5,null)),this.dw[t-35]=i.vu;else if(40===t){const t=i.gu;this.td=new Uint16Array(t),this.ed=new Uint16Array(t);for(let e=0;e=100&&t<110&&(this.pw&&this.Aw||(this.pw=new Uint16Array(10),this.Aw=new Uint16Array(10)),this.pw[t-100]=i.Au,this.Aw[t-100]=i.Au)}zw(t){let i=this.Fw;if(1===t&&(i=this.Uw),-1===i)return null;let e=this.Bw,s=this.Yw;1===t&&(e=this.Ww,s=this.Hw);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.Ba(i,2)}else{const i=[n,t,o.A.model(s)];n=o.A.Ba(i,3)}}if(0===t&&0!==this.Pw&&n.translate(this.Pw,0,0),1===t&&0!==this.Gw&&n.translate(this.Gw,0,0),this.td&&this.ed)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.pw[e]);if(-1!==i)return u.get(i).Ew(1)}if(u.Po){const t=u.Po.get(BigInt(this.id));if(t)return t}const i=o.A.model(this.model);if(this.td&&this.ed)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 Bo=[];static pu=t=>{const i=new n.A(t.read('seq.dat'));this.count=i.Au;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(2031);class l extends s.${static count=0;static Bo=[];static Po=new o.A(30);static pu=t=>{const i=new n.A(t.read('spotanim.dat'));this.count=i.Au;for(let t=0;t=40&&t<50?this.td[t-40]=i.Au:t>=50&&t<60?this.ed[t-50]=i.Au:console.log('Error unrecognised spotanim config code: ',t)}ga(){let t=l.Po?.get(BigInt(this.id));if(t)return t;t=h.A.model(this.model);for(let i=0;i<6;i++)0!==this.td[0]&&t.Pa(this.td[i],this.ed[i]);return l.Po?.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 Bo=[];static iy=[];static ey=0;static pu=t=>{const i=new n.A(t.read('varp.dat'));this.count=i.Au;for(let t=0;t{e.d(i,{A:()=>s});class s{static OPEN=0;static uy=1;static wy=2;static yy=4;static py=8;static Ay=s.uy<<4;static my=s.wy<<4;static gy=s.yy<<4;static Iy=s.py<<4;static _y=256;static Cy=512;static Ey=1024;static vy=2048;static by=4096;static Ty=s.Cy<<4;static Oy=s.Ey<<4;static Ry=s.vy<<4;static Sy=s.by<<4;static Ly=s._y<<9;static xy=524288;static My=2097152;static ky=s.My|s.xy;static Dy=s._y|s.ky;static Ny=s.wy|s.Dy;static Fy=s.py|s.Dy;static By=s.wy|s.yy|s.Fy;static Py=s.my|s.Dy;static Uy=s.py|s.Ay|s.Py;static Wy=s.Iy|s.Dy;static Gy=s.uy|s.wy|s.Wy;static Yy=s.my|s.gy|s.Wy;static Hy=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 Wr=4;static Qr=104;static index=(t,i)=>t*o.Qr+i;offsetX;Vy;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.Vy=0,this.sizeX=o.Qr,this.sizeZ=o.Qr,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.Vy)]|=s.A.My};Xy=(t,i)=>{this.flags[o.index(t-this.offsetX,i-this.Vy)]&=~s.A.My};jy=(t,i,e,r,h,o)=>{let l=s.A._y;o&&(l|=s.A.Ly);const a=t-this.offsetX,c=i-this.Vy;if(h===n.A.zy||h===n.A.Zy){const t=e;e=r,r=t}for(let t=a;t=0&&t=0&&i{let l=s.A._y;o&&(l|=s.A.Ly);const a=t-this.offsetX,c=i-this.Vy;if(h===n.A.zy||h===n.A.Zy){const t=e;e=r,r=t}for(let t=a;t=0&&t=0&&i{const l=t-this.offsetX,a=i-this.Vy,c=o?s.A.Sy:s.A.Iy,f=o?s.A.by:s.A.py,u=o?s.A.Ey:s.A.wy,d=o?s.A.Oy:s.A.my,w=o?s.A.Cy:s.A.uy,y=o?s.A.Ty:s.A.Ay,p=o?s.A.vy:s.A.yy,A=o?s.A.Ry:s.A.gy;e===r.A.$y.id?h===n.A.Hd?(this.add(l,a,c),this.add(l-1,a,f)):h===n.A.zy?(this.add(l,a,u),this.add(l,a+1,d)):h===n.A.Qy?(this.add(l,a,f),this.add(l+1,a,c)):h===n.A.Zy&&(this.add(l,a,d),this.add(l,a-1,u)):e===r.A.tp.id||e===r.A.ip.id?h===n.A.Hd?(this.add(l,a,w),this.add(l-1,a+1,y)):h===n.A.zy?(this.add(l,a,p),this.add(l+1,a+1,A)):h===n.A.Qy?(this.add(l,a,y),this.add(l+1,a-1,w)):h===n.A.Zy&&(this.add(l,a,A),this.add(l-1,a-1,p)):e===r.A.ep.id&&(h===n.A.Hd?(this.add(l,a,u|c),this.add(l-1,a,f),this.add(l,a+1,d)):h===n.A.zy?(this.add(l,a,u|f),this.add(l,a+1,d),this.add(l+1,a,c)):h===n.A.Qy?(this.add(l,a,d|f),this.add(l+1,a,c),this.add(l,a-1,u)):h===n.A.Zy&&(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)};sp=(t,i,e,h,o)=>{const l=t-this.offsetX,a=i-this.Vy,c=o?s.A.Sy:s.A.Iy,f=o?s.A.by:s.A.py,u=o?s.A.Ey:s.A.wy,d=o?s.A.Oy:s.A.my,w=o?s.A.Cy:s.A.uy,y=o?s.A.Ty:s.A.Ay,p=o?s.A.vy:s.A.yy,A=o?s.A.Ry:s.A.gy;e===r.A.$y.id?h===n.A.Hd?(this.remove(l,a,c),this.remove(l-1,a,f)):h===n.A.zy?(this.remove(l,a,u),this.remove(l,a+1,d)):h===n.A.Qy?(this.remove(l,a,f),this.remove(l+1,a,c)):h===n.A.Zy&&(this.remove(l,a,d),this.remove(l,a-1,u)):e===r.A.tp.id||e===r.A.ip.id?h===n.A.Hd?(this.remove(l,a,w),this.remove(l-1,a+1,y)):h===n.A.zy?(this.remove(l,a,p),this.remove(l+1,a+1,A)):h===n.A.Qy?(this.remove(l,a,y),this.remove(l+1,a-1,w)):h===n.A.Zy&&(this.remove(l,a,A),this.remove(l-1,a-1,p)):e===r.A.ep.id&&(h===n.A.Hd?(this.remove(l,a,u|c),this.remove(l-1,a,f),this.remove(l,a+1,d)):h===n.A.zy?(this.remove(l,a,u|f),this.remove(l,a+1,d),this.remove(l+1,a,c)):h===n.A.Qy?(this.remove(l,a,d|f),this.remove(l+1,a,c),this.remove(l,a-1,u)):h===n.A.Zy&&(this.remove(l,a,d|c),this.remove(l,a-1,u),this.remove(l-1,a,f))),o&&this.sp(t,i,e,h,!1)};np=(t,i,e,h,l,a)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.Vy,u=e-this.offsetX,d=h-this.Vy,w=o.index(c,f);if(l===r.A.$y.id){if(a===n.A.Hd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Py)===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===n.A.zy){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+1&&f===d&&(this.flags[w]&s.A.Wy)===s.A.OPEN)return!0}else if(a===n.A.Qy){if(c===u+1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Py)===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===n.A.Zy){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+1&&f===d&&(this.flags[w]&s.A.Wy)===s.A.OPEN)return!0}}else if(l===r.A.ep.id){if(a===n.A.Hd){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.Wy)===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===n.A.zy){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;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Ny)===s.A.OPEN)return!0}else if(a===n.A.Qy){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.Py)===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.Zy){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Py)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Wy)===s.A.OPEN)return!0;if(c===u&&f===d-1)return!0}}else if(l===r.A.rp.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.my)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.wy)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.py)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Iy)===s.A.OPEN)return!0}return!1};hp=(t,i,e,h,l,a)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.Vy,u=e-this.offsetX,d=h-this.Vy,w=o.index(c,f);if(l===r.A.op.id||l===r.A.lp.id){if(l===r.A.lp.id&&(a=a+2&3),a===n.A.Hd){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.wy)===s.A.OPEN)return!0}else if(a===n.A.zy){if(c===u-1&&f===d&&(this.flags[w]&s.A.py)===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.Qy){if(c===u-1&&f===d&&(this.flags[w]&s.A.py)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.my)===s.A.OPEN)return!0}else if(a===n.A.Zy){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.my)===s.A.OPEN)return!0}}else if(l===r.A.ap.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.my)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.wy)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.py)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Iy)===s.A.OPEN)return!0}return!1};cp=(t,i,e,n,r,l,a)=>{const c=e+r-1,f=n+l-1,u=o.index(t-this.offsetX,i-this.Vy);return t>=e&&t<=c&&i>=n&&i<=f||(t===e-1&&i>=n&&i<=f&&(this.flags[u]&s.A.py)===s.A.OPEN&&(a&h.A.Hd)===s.A.OPEN||(t===c+1&&i>=n&&i<=f&&(this.flags[u]&s.A.Iy)===s.A.OPEN&&(a&h.A.Qy)===s.A.OPEN||(i===n-1&&t>=e&&t<=c&&(this.flags[u]&s.A.wy)===s.A.OPEN&&(a&h.A.Zy)===s.A.OPEN||i===f+1&&t>=e&&t<=c&&(this.flags[u]&s.A.my)===s.A.OPEN&&(a&h.A.zy)===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.Hy-e}}},4909:(t,i,e)=>{e.d(i,{A:()=>s});class s{static zy=1;static Qy=2;static Zy=4;static Hd=8}},6169:(t,i,e)=>{e.d(i,{A:()=>s});class s{static Hd=0;static zy=1;static Qy=2;static Zy=3}},5599:(t,i,e)=>{e.d(i,{A:()=>s});class s{static fp=0;static up=1;static dp=2;static wp=3}},1023:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5599);class n{static $y=new n(0,s.A.fp);static tp=new n(1,s.A.fp);static ep=new n(2,s.A.fp);static ip=new n(3,s.A.fp);static yp=new n(4,s.A.up);static pp=new n(5,s.A.up);static op=new n(6,s.A.up);static lp=new n(7,s.A.up);static ap=new n(8,s.A.up);static rp=new n(9,s.A.dp);static ud=new n(10,s.A.dp);static Ap=new n(11,s.A.dp);static mp=new n(12,s.A.dp);static gp=new n(13,s.A.dp);static Ip=new n(14,s.A.dp);static _p=new n(15,s.A.dp);static Cp=new n(16,s.A.dp);static Ep=new n(17,s.A.dp);static vp=new n(18,s.A.dp);static bp=new n(19,s.A.dp);static Tp=new n(20,s.A.dp);static Op=new n(21,s.A.dp);static wp=new n(22,s.A.wp);static values(){return[this.$y,this.tp,this.Ep,this._p,this.ep,this.Ip,this.rp,this.ip,this.wp,this.mp,this.Ap,this.op,this.Tp,this.ud,this.pp,this.gp,this.lp,this.yp,this.Cp,this.ap,this.bp,this.Op,this.vp]}static of(t){const i=this.values();for(let e=0;e{e.d(i,{A:()=>p});var s=e(670),n=e(2164),r=e(1069),h=e(4583),o=e(198),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 p{static Rp=Int8Array.of(1,2,4,8);static Sp=Uint8Array.of(16,32,64,128);static Lp=Int8Array.of(1,0,-1,0);static xp=Int8Array.of(0,-1,0,1);static Mp=(17*Math.random()|0)-8;static kp=(33*Math.random()|0)-16;static lt=!0;static Dp=0;static Np=!1;static Fp=(t,i)=>{let e=this.Bp(t+45365,i+91923,4)+(this.Bp(t+10294,i+37821,2)-128>>1)+(this.Bp(t,i,1)-128>>2)-128;return e=35+(.3*e|0),e<10?e=10:e>60&&(e=60),e};static Bp=(t,i,e)=>{const s=t/e|0,n=t&e-1,r=i/e|0,h=i&e-1,o=this.Pp(s,r),l=this.Pp(s+1,r),a=this.Pp(s,r+1),c=this.Pp(s+1,r+1),f=this.Up(o,l,n,e),u=this.Up(a,c,n,e);return this.Up(f,u,h,e)};static Up=(t,i,e,s)=>{const n=65536-h.A.cos[1024*e/s|0]>>1;return(t*(65536-n)>>16)+(i*n>>16)};static Pp=(t,i)=>((this.Wp(t-1,i-1)+this.Wp(t+1,i-1)+this.Wp(t-1,i+1)+this.Wp(t+1,i+1))/16|0)+((this.Wp(t-1,i)+this.Wp(t+1,i)+this.Wp(t,i-1)+this.Wp(t,i+1))/8|0)+(this.Wp(t,i)/4|0);static Wp=(t,i)=>{const e=t+57*i,s=BigInt(e<<13^e);return 255&Number((s*(s*s*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static jy=(t,i,e,s,n,r,h,o,d,w,y)=>{const A=n[y][i][e],m=n[y][i+1][e],g=n[y][i+1][e+1],I=n[y][i][e+1],_=A+m+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.wp.id)s?.Gp(C.ga(f.A.wp.id,w,A,m,g,I,-1),t,i,e,_,E,v),C.yd&&C.active&&h?.Ky(i,e),-1!==C.Il&&r.Yp(new a.A(o,t,3,i,e,c.A.Bo[C.Il],!0));else if(d===f.A.ud.id||d===f.A.Ap.id){const n=C.ga(f.A.ud.id,w,A,m,g,I,-1);if(n){let r,h,o=0;d===f.A.Ap.id&&(o+=256),w===u.A.zy||w===u.A.Zy?(r=C.length,h=C.width):(r=C.width,h=C.length),s?.jy(t,i,e,_,n,null,E,v,r,h,o)}C.yd&&h?.jy(i,e,C.width,C.length,w,C.pd),-1!==C.Il&&r.Yp(new a.A(o,t,2,i,e,c.A.Bo[C.Il],!0))}else if(d>=f.A.mp.id)s?.jy(t,i,e,_,C.ga(d,w,A,m,g,I,-1),null,E,v,1,1,0),C.yd&&h?.jy(i,e,C.width,C.length,w,C.pd),-1!==C.Il&&r.Yp(new a.A(o,t,2,i,e,c.A.Bo[C.Il],!0));else if(d===f.A.$y.id)s?.Jy(t,i,e,_,p.Rp[w],0,C.ga(f.A.$y.id,w,A,m,g,I,-1),null,E,v),C.yd&&h?.Jy(i,e,d,w,C.pd),-1!==C.Il&&r.Yp(new a.A(o,t,0,i,e,c.A.Bo[C.Il],!0));else if(d===f.A.tp.id)s?.Jy(t,i,e,_,p.Sp[w],0,C.ga(f.A.tp.id,w,A,m,g,I,-1),null,E,v),C.yd&&h?.Jy(i,e,d,w,C.pd),-1!==C.Il&&r.Yp(new a.A(o,t,0,i,e,c.A.Bo[C.Il],!0));else if(d===f.A.ep.id){const n=w+1&3;s?.Jy(t,i,e,_,p.Rp[w],p.Rp[n],C.ga(f.A.ep.id,w+4,A,m,g,I,-1),C.ga(f.A.ep.id,n,A,m,g,I,-1),E,v),C.yd&&h?.Jy(i,e,d,w,C.pd),-1!==C.Il&&r.Yp(new a.A(o,t,0,i,e,c.A.Bo[C.Il],!0))}else if(d===f.A.ip.id)s?.Jy(t,i,e,_,p.Sp[w],0,C.ga(f.A.ip.id,w,A,m,g,I,-1),null,E,v),C.yd&&h?.Jy(i,e,d,w,C.pd),-1!==C.Il&&r.Yp(new a.A(o,t,0,i,e,c.A.Bo[C.Il],!0));else if(d===f.A.rp.id)s?.jy(t,i,e,_,C.ga(d,w,A,m,g,I,-1),null,E,v,1,1,0),C.yd&&h?.jy(i,e,C.width,C.length,w,C.pd),-1!==C.Il&&r.Yp(new a.A(o,t,2,i,e,c.A.Bo[C.Il],!0));else if(d===f.A.yp.id)s?.Hp(t,i,e,_,0,0,E,C.ga(f.A.yp.id,u.A.Hd,A,m,g,I,-1),v,512*w,p.Rp[w]),-1!==C.Il&&r.Yp(new a.A(o,t,1,i,e,c.A.Bo[C.Il],!0));else if(d===f.A.pp.id){let n=16;if(s){const r=s.Vp(t,i,e);r>0&&(n=l.A.get(r>>14&32767).Id)}s?.Hp(t,i,e,_,p.Lp[w]*n,p.xp[w]*n,E,C.ga(f.A.yp.id,u.A.Hd,A,m,g,I,-1),v,512*w,p.Rp[w]),-1!==C.Il&&r.Yp(new a.A(o,t,1,i,e,c.A.Bo[C.Il],!0))}else d===f.A.op.id?(s?.Hp(t,i,e,_,0,0,E,C.ga(f.A.yp.id,u.A.Hd,A,m,g,I,-1),v,w,256),-1!==C.Il&&r.Yp(new a.A(o,t,1,i,e,c.A.Bo[C.Il],!0))):d===f.A.lp.id?(s?.Hp(t,i,e,_,0,0,E,C.ga(f.A.yp.id,u.A.Hd,A,m,g,I,-1),v,w,512),-1!==C.Il&&r.Yp(new a.A(o,t,1,i,e,c.A.Bo[C.Il],!0))):d===f.A.ap.id&&(s?.Hp(t,i,e,_,0,0,E,C.ga(f.A.yp.id,u.A.Hd,A,m,g,I,-1),v,w,768),-1!==C.Il&&r.Yp(new a.A(o,t,1,i,e,c.A.Bo[C.Il],!0)))};Kp;Xp;Zr;qr;jp;zp;Zp;qp;Jp;$p;Qp;tA;iA;eA;sA;nA;constructor(t,i,e,n){this.Kp=t,this.Xp=i,this.Zr=e,this.qr=n,this.jp=new y.rA(s.A.Wr,t,i),this.zp=new y.rA(s.A.Wr,t,i),this.Zp=new y.rA(s.A.Wr,t,i),this.qp=new y.rA(s.A.Wr,t,i),this.nA=new y.hA(s.A.Wr,t+1,i+1),this.Jp=new y.rA(s.A.Wr,t+1,i+1),this.$p=new y.$r(t+1,i+1),this.Qp=new Int32Array(i),this.tA=new Int32Array(i),this.iA=new Int32Array(i),this.eA=new Int32Array(i),this.sA=new Int32Array(i)}oA=(t,i)=>{for(let t=0;t=0&&i[s]?.Ky(e,n)}p.Mp+=(5*Math.random()|0)-2,p.Mp<-8?p.Mp=-8:p.Mp>8&&(p.Mp=8),p.kp+=(5*Math.random()|0)-2,p.kp<-16?p.kp=-16:p.kp>16&&(p.kp=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.$p[n][t]=u-d}for(let t=0;t=0&&s0){const i=n.A.Bo[e-1];this.Qp[t]+=i.Zu,this.tA[t]+=i.Xu,this.iA[t]+=i.ju,this.eA[t]+=i.zu,r=this.sA[t]++}}const h=e-5;if(h>=0&&h0){const i=n.A.Bo[e-1];this.Qp[t]-=i.Zu,this.tA[t]-=i.Xu,this.iA[t]-=i.ju,this.eA[t]-=i.zu,r=this.sA[t]--}}}if(e>=1&&e=0&&f=0&&y=1&&c0||y>0){const A=this.Zr[i][e][c],m=this.Zr[i][e+1][c],g=this.Zr[i][e+1][c+1],I=this.Zr[i][e][c+1],_=this.$p[e][c],C=this.$p[e+1][c],E=this.$p[e+1][c+1],v=this.$p[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+p.Mp&255;e+=p.kp,e<0?e=0:e>255&&(e=255),T=n.A.Uu(h,i,e)}if(i>0){let t=0!==f||this.Zp[i][e][c]===w.A.aA;y>0&&!n.A.Bo[y-1].Vu&&(t=!1),t&&A===m&&A===g&&A===I&&(this.nA[i][e][c]|=2340)}let O=0;if(-1!==b&&(O=h.A.palette[n.A.Wu(T,96)]),0===y)t?.cA(i,e,c,w.A.aA,u.A.Hd,-1,A,m,g,I,n.A.Wu(b,_),n.A.Wu(b,C),n.A.Wu(b,E),n.A.Wu(b,v),d.A.ql,d.A.ql,d.A.ql,d.A.ql,O,d.A.ql);else{const s=this.Zp[i][e][c]+1,r=this.qp[i][e][c],o=n.A.Bo[y-1];let l,a,f=o.texture;f>=0?(a=h.A.fA(f),l=-1):o.Yu===d.A.uA?(a=0,l=-2,f=-1):(l=n.A.Uu(o.Ku,o.Xu,o.ju),a=h.A.palette[n.A.Gu(o.qu,96)]),t?.cA(i,e,c,s,r,f,A,m,g,I,n.A.Wu(b,_),n.A.Wu(b,C),n.A.Wu(b,E),n.A.Wu(b,v),n.A.Gu(l,_),n.A.Gu(l,C),n.A.Gu(l,E),n.A.Gu(l,v),O,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.Xp;r++)for(let h=0;h<=this.Kp;h++){if(this.nA[s][h][r]&t){let i=r,e=r,l=s,a=s;for(;i>0&&this.nA[s][h][i-1]&t;)i--;for(;e0;){for(let s=i;s<=e;s++)if(!(this.nA[l-1][h][s]&t))break t;l--}t:for(;a=8){const s=this.Zr[a][h][i]-240,r=this.Zr[l][h][i];o.A.pA(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.nA[s][h][n]&=~t}}if(this.nA[s][h][r]&i){let t=h,e=h,l=s,a=s;for(;t>0&&this.nA[s][t-1][r]&i;)t--;for(;e0;){for(let s=t;s<=e;s++)if(!(this.nA[l-1][s][r]&i))break t;l--}t:for(;a=8){const s=this.Zr[a][t][r]-240,h=this.Zr[l][t][r];o.A.pA(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.nA[s][n][r]&=~i}}if(this.nA[s][h][r]&e){let t=h,i=h,l=r,a=r;for(;l>0&&this.nA[s][h][l-1]&e;)l--;for(;a0;){for(let i=l;i<=a;i++)if(!(this.nA[s][t-1][i]&e))break t;t--}t:for(;i=4){const r=this.Zr[s][t][l];o.A.pA(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.nA[s][n][t]&=~e}}}}}};AA=(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.qp[r][a][c]=(f-2&3)<<24>>24):f<=81?this.qr[r][a][c]=f-49<<24>>24:this.jp[r][a][c]=f-81<<24>>24}else for(;f=o.gu,0!==f;){if(1===f){o.gu;break}f<=49&&o.gu}}};gA=(t,i,e,n,h,o)=>{const l=new r.A(new Uint8Array(n));let a=-1;for(;;){const n=l.IA;if(0===n)return;a+=n;let r=0;for(;;){const n=l.IA;if(0===n)break;r+=n-1;const c=63&r,f=r>>6&63,u=r>>12,d=l.gu,w=d>>2,y=3&d,p=f+h,A=c+o;if(p>0&&A>0&&p=0&&(n=e[s]),this.jy(u,p,A,t,i,n,a,w,y)}}}};jy=(t,i,e,s,n,r,h,o,d)=>{if(p.lt){if(16&this.qr[t][i][e])return;if(this.lA(t,i,e)!==p.Dp)return}const w=this.Zr[t][i][e],y=this.Zr[t][i+1][e],A=this.Zr[t][i+1][e+1],m=this.Zr[t][i][e+1],g=w+y+A+m>>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.wp.id)(!p.lt||I.active||I.Dd)&&(s?.Gp(I.ga(f.A.wp.id,d,w,y,A,m,-1),t,i,e,g,_,C),I.yd&&I.active&&r?.Ky(i,e),-1!==I.Il&&n.Yp(new a.A(h,t,3,i,e,c.A.Bo[I.Il],!0)));else if(o===f.A.ud.id||o===f.A.Ap.id){const l=I.ga(f.A.ud.id,d,w,y,A,m,-1);if(l){let n,r,h=0;if(o===f.A.Ap.id&&(h+=256),d===u.A.zy||d===u.A.Zy?(n=I.length,r=I.width):(n=I.width,r=I.length),s?.jy(t,i,e,g,l,null,_,C,n,r,h)&&I.Td)for(let s=0;s<=n;s++)for(let n=0;n<=r;n++){let r=l._A/4|0;r>30&&(r=30),r>this.Jp[t][i+s][e+n]&&(this.Jp[t][i+s][e+n]=r<<24>>24)}}I.yd&&r?.jy(i,e,I.width,I.length,d,I.pd),-1!==I.Il&&n.Yp(new a.A(h,t,2,i,e,c.A.Bo[I.Il],!0))}else if(o>=f.A.mp.id)s?.jy(t,i,e,g,I.ga(o,d,w,y,A,m,-1),null,_,C,1,1,0),o>=f.A.mp.id&&o<=f.A.Ep.id&&o!==f.A.gp.id&&t>0&&(this.nA[t][i][e]|=2340),I.yd&&r?.jy(i,e,I.width,I.length,d,I.pd),-1!==I.Il&&n.Yp(new a.A(h,t,2,i,e,c.A.Bo[I.Il],!0));else if(o===f.A.$y.id)s?.Jy(t,i,e,g,p.Rp[d],0,I.ga(f.A.$y.id,d,w,y,A,m,-1),null,_,C),d===u.A.Hd?(I.Td&&(this.Jp[t][i][e]=50,this.Jp[t][i][e+1]=50),I.Vu&&(this.nA[t][i][e]|=585)):d===u.A.zy?(I.Td&&(this.Jp[t][i][e+1]=50,this.Jp[t][i+1][e+1]=50),I.Vu&&(this.nA[t][i][e+1]|=1170)):d===u.A.Qy?(I.Td&&(this.Jp[t][i+1][e]=50,this.Jp[t][i+1][e+1]=50),I.Vu&&(this.nA[t][i+1][e]|=585)):d===u.A.Zy&&(I.Td&&(this.Jp[t][i][e]=50,this.Jp[t][i+1][e]=50),I.Vu&&(this.nA[t][i][e]|=1170)),I.yd&&r?.Jy(i,e,o,d,I.pd),-1!==I.Il&&n.Yp(new a.A(h,t,0,i,e,c.A.Bo[I.Il],!0)),16!==I.Id&&s?.CA(t,i,e,I.Id);else if(o===f.A.tp.id)s?.Jy(t,i,e,g,p.Sp[d],0,I.ga(f.A.tp.id,d,w,y,A,m,-1),null,_,C),I.Td&&(d===u.A.Hd?this.Jp[t][i][e+1]=50:d===u.A.zy?this.Jp[t][i+1][e+1]=50:d===u.A.Qy?this.Jp[t][i+1][e]=50:d===u.A.Zy&&(this.Jp[t][i][e]=50)),I.yd&&r?.Jy(i,e,o,d,I.pd),-1!==I.Il&&n.Yp(new a.A(h,t,0,i,e,c.A.Bo[I.Il],!0));else if(o===f.A.ep.id){const l=d+1&3;s?.Jy(t,i,e,g,p.Rp[d],p.Rp[l],I.ga(f.A.ep.id,d+4,w,y,A,m,-1),I.ga(f.A.ep.id,l,w,y,A,m,-1),_,C),I.Vu&&(d===u.A.Hd?(this.nA[t][i][e]|=265,this.nA[t][i][e+1]|=1170):d===u.A.zy?(this.nA[t][i][e+1]|=1170,this.nA[t][i+1][e]|=585):d===u.A.Qy?(this.nA[t][i+1][e]|=585,this.nA[t][i][e]|=1170):d===u.A.Zy&&(this.nA[t][i][e]|=1170,this.nA[t][i][e]|=585)),I.yd&&r?.Jy(i,e,o,d,I.pd),-1!==I.Il&&n.Yp(new a.A(h,t,0,i,e,c.A.Bo[I.Il],!0)),16!==I.Id&&s?.CA(t,i,e,I.Id)}else if(o===f.A.ip.id)s?.Jy(t,i,e,g,p.Sp[d],0,I.ga(f.A.ip.id,d,w,y,A,m,-1),null,_,C),I.Td&&(d===u.A.Hd?this.Jp[t][i][e+1]=50:d===u.A.zy?this.Jp[t][i+1][e+1]=50:d===u.A.Qy?this.Jp[t][i+1][e]=50:d===u.A.Zy&&(this.Jp[t][i][e]=50)),I.yd&&r?.Jy(i,e,o,d,I.pd),-1!==I.Il&&n.Yp(new a.A(h,t,0,i,e,c.A.Bo[I.Il],!0));else if(o===f.A.rp.id)s?.jy(t,i,e,g,I.ga(o,d,w,y,A,m,-1),null,_,C,1,1,0),I.yd&&r?.jy(i,e,I.width,I.length,d,I.pd),-1!==I.Il&&n.Yp(new a.A(h,t,2,i,e,c.A.Bo[I.Il],!0));else if(o===f.A.yp.id)s?.Hp(t,i,e,g,0,0,_,I.ga(f.A.yp.id,u.A.Hd,w,y,A,m,-1),C,512*d,p.Rp[d]),-1!==I.Il&&n.Yp(new a.A(h,t,1,i,e,c.A.Bo[I.Il],!0));else if(o===f.A.pp.id){let r=16;if(s){const n=s.Vp(t,i,e);n>0&&(r=l.A.get(n>>14&32767).Id)}s?.Hp(t,i,e,g,p.Lp[d]*r,p.xp[d]*r,_,I.ga(f.A.yp.id,u.A.Hd,w,y,A,m,-1),C,512*d,p.Rp[d]),-1!==I.Il&&n.Yp(new a.A(h,t,1,i,e,c.A.Bo[I.Il],!0))}else o===f.A.op.id?(s?.Hp(t,i,e,g,0,0,_,I.ga(f.A.yp.id,u.A.Hd,w,y,A,m,-1),C,d,256),-1!==I.Il&&n.Yp(new a.A(h,t,1,i,e,c.A.Bo[I.Il],!0))):o===f.A.lp.id?(s?.Hp(t,i,e,g,0,0,_,I.ga(f.A.yp.id,u.A.Hd,w,y,A,m,-1),C,d,512),-1!==I.Il&&n.Yp(new a.A(h,t,1,i,e,c.A.Bo[I.Il],!0))):o===f.A.ap.id&&(s?.Hp(t,i,e,g,0,0,_,I.ga(f.A.yp.id,u.A.Hd,w,y,A,m,-1),C,d,768),-1!==I.Il&&n.Yp(new a.A(h,t,1,i,e,c.A.Bo[I.Il],!0)))};lA=(t,i,e)=>8&this.qr[t][i][e]?0:t<=0||!(2&this.qr[1][i][e])?t:t-1}},198:(t,i,e)=>{e.d(i,{A:()=>g});var s=e(4583);class n{level;y;x;z;model;EA;vA;bA;TA;OA;RA;SA;info;LA=0;xA=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.EA=r,this.vA=h,this.bA=o,this.TA=l,this.OA=a,this.RA=c,this.SA=f,this.info=u}}var r=e(3795);class h{MA;Kp;kA;Xp;type;DA;NA;FA;BA;PA;zd;mode=0;UA=0;WA=0;GA=0;YA=0;HA=0;VA=0;constructor(t,i,e,s,n,r,h,o,l,a,c){this.MA=t,this.Kp=i,this.kA=e,this.Xp=s,this.type=n,this.DA=r,this.NA=h,this.FA=o,this.BA=l,this.PA=a,this.zd=c}}var o=e(670);class l{y;x;z;model;SA;info;constructor(t,i,e,s,n,r){this.y=t,this.x=i,this.z=e,this.model=s,this.SA=n,this.info=r}}class a{y;x;z;KA;XA;jA;zA;SA;info;constructor(t,i,e,s,n,r,h,o,l){this.y=t,this.x=i,this.z=e,this.KA=s,this.XA=n,this.jA=r,this.zA=h,this.SA=o,this.info=l}}class c{y;x;z;type;angle;model;SA;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.SA=h,this.info=o}}var f=e(6666);class u{y;x;z;ZA;qA;JA;SA;offset;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.ZA=s,this.qA=n,this.JA=r,this.SA=h,this.offset=o}}class d{$A;QA;tm;im;sm;color;flat;constructor(t,i,e,s,n,r,h){this.$A=t,this.QA=i,this.tm=e,this.im=s,this.sm=n,this.color=r,this.flat=h}}var w=e(8950);class y{static nm=new Int32Array(6);static rm=new Int32Array(6);static hm=new Int32Array(6);static om=new Int32Array(6);static lm=new Int32Array(6);static am=[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 fm=[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 um=128;static dm=this.um/2|0;static wm=this.um/4|0;static ym=3*this.um/4|0;Pd;Wd;Ud;pm;Am;gm;Im;_m;Cm;Em;flat;shape;angle;vm;bm;constructor(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w,p,A,m,g){this.flat=!(A!==s||A!==d||A!==o),this.shape=i,this.angle=r,this.vm=u,this.bm=l;const I=y.am[i],_=I.length;this.Pd=new Int32Array(_),this.Wd=new Int32Array(_),this.Ud=new Int32Array(_);const C=new Int32Array(_),E=new Int32Array(_),v=t*y.um,b=m*y.um;for(let t=0;t<_;t++){let i,l,c,u,m,_=I[t];!(1&_)&&_<=8&&(_=1+(_-r-r-1&7)),_>8&&_<=12&&(_=9+(_-r-9&3)),_>12&&_<=16&&(_=13+(_-r-13&3)),1===_?(i=v,l=b,c=A,u=h,m=a):2===_?(i=v+y.dm,l=b,c=A+s>>1,u=h+g>>1,m=a+e>>1):3===_?(i=v+y.um,l=b,c=s,u=g,m=e):4===_?(i=v+y.um,l=b+y.dm,c=s+d>>1,u=g+n>>1,m=e+w>>1):5===_?(i=v+y.um,l=b+y.um,c=d,u=n,m=w):6===_?(i=v+y.dm,l=b+y.um,c=d+o>>1,u=n+p>>1,m=w+f>>1):7===_?(i=v,l=b+y.um,c=o,u=p,m=f):8===_?(i=v,l=b+y.dm,c=o+A>>1,u=p+h>>1,m=f+a>>1):9===_?(i=v+y.dm,l=b+y.wm,c=A+s>>1,u=h+g>>1,m=a+e>>1):10===_?(i=v+y.ym,l=b+y.dm,c=s+d>>1,u=g+n>>1,m=e+w>>1):11===_?(i=v+y.dm,l=b+y.ym,c=d+o>>1,u=n+p>>1,m=w+f>>1):12===_?(i=v+y.wm,l=b+y.dm,c=o+A>>1,u=p+h>>1,m=f+a>>1):13===_?(i=v+y.wm,l=b+y.wm,c=A,u=h,m=a):14===_?(i=v+y.ym,l=b+y.wm,c=s,u=g,m=e):15===_?(i=v+y.ym,l=b+y.ym,c=d,u=n,m=w):(i=v+y.wm,l=b+y.ym,c=o,u=p,m=f),this.Pd[t]=i,this.Wd[t]=c,this.Ud[t]=l,C[t]=u,E[t]=m}const T=y.fm[i],O=T.length/4|0;this.Im=new Int32Array(O),this._m=new Int32Array(O),this.Cm=new Int32Array(O),this.pm=new Int32Array(O),this.Am=new Int32Array(O),this.gm=new Int32Array(O),this.Em=-1!==c?new Int32Array(O):null;let R=0;for(let t=0;t{this.Dm=0,this.Nm=0,this.Fm=t,this.Bm=i,this.Pm=t/2|0,this.Um=i/2|0;const h=new m.Om(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let i=0;i<2048;i+=64){this.Wm=s.A.sin[t],this.Gm=s.A.cos[t],this.Ym=s.A.sin[i],this.Hm=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.Ig(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.Tm[t][i][e+25][s+25]=n}};static Do=()=>{this.Rm=null,this.Sm=null,this.Lm=null,this.km=null,this.Tm=null,this.Mm=null,this.eg=null,console.log('World3D unloaded!')};static pA=(t,i,e,s,n,r,o,l)=>{g.Lm[t][g.Sm[t]++]=new h(e/128|0,r/128|0,n/128|0,l/128|0,i,e,r,n,l,s,o)};static Ig=(t,i,e)=>{const s=i*this.Ym+t*this.Hm>>16,n=i*this.Hm-t*this.Ym>>16,r=e*this.Wm+n*this.Gm>>16,h=e*this.Gm-n*this.Wm>>16;if(r<50||r>3500)return!1;const o=this.Pm+((s<<9)/r|0),l=this.Um+((h<<9)/r|0);return o>=this.Dm&&o<=this.Fm&&l>=this.Nm&&l<=this.Bm};_g;Kp;Xp;Cg;Eg;Rh;vg;bg;Tg;Og=0;Rg=0;Sg=0;constructor(t,i,e,s){this._g=e,this.Kp=s,this.Xp=i,this.Eg=new m.Lh(e,s,i,null),this.vg=new m.hA(e,s+1,i+1),this.Cg=t,this.Rh=new m.Ae(5e3,null),this.bg=new Int32Array(1e4),this.Tg=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this.Rg=t;for(let i=0;i{const e=this.Eg[0][t][i];for(let e=0;e<3;e++){this.Eg[e][t][i]=this.Eg[e+1][t][i];const s=this.Eg[e][t][i];s&&s.level--}this.Eg[0][t][i]||(this.Eg[0][t][i]=new r.A(0,t,i));const s=this.Eg[0][t][i];s&&(s.xg=e),this.Eg[3][t][i]=null};dA=(t,i,e,s)=>{const n=this.Eg[t][i][e];n&&(n.Mg=s)};cA=(t,i,e,s,n,h,o,l,a,c,f,u,w,A,m,g,I,_,C,E)=>{if(s===p.A.aA){for(let s=t;s>=0;s--)this.Eg[s][i][e]||(this.Eg[s][i][e]=new r.A(s,i,e));const s=this.Eg[t][i][e];s&&(s.kg=new d(f,u,w,A,-1,C,!1))}else if(s===p.A.Dg){for(let s=t;s>=0;s--)this.Eg[s][i][e]||(this.Eg[s][i][e]=new r.A(s,i,e));const s=this.Eg[t][i][e];s&&(s.kg=new d(m,g,I,_,h,E,o===l&&o===a&&o===c))}else{for(let s=t;s>=0;s--)this.Eg[s][i][e]||(this.Eg[s][i][e]=new r.A(s,i,e));const d=this.Eg[t][i][e];d&&(d.Ng=new y(i,s,g,l,w,n,f,c,E,m,h,_,C,a,I,A,o,e,u))}};Gp=(t,i,e,s,n,h,o)=>{this.Eg[i][e][s]||(this.Eg[i][e][s]=new r.A(i,e,s));const a=this.Eg[i][e][s];a&&(a.Fg=new l(n,128*e+64,128*s+64,t,h,o))};Bg=(t,i,e)=>{const s=this.Eg[t][i][e];s&&(s.Fg=null)};Pg=(t,i,e,s,n,h,o,l)=>{let a=0;const c=this.Eg[s][t][i];if(c)for(let t=0;ta&&(a=e)}else this.Eg[s][t][i]=new r.A(s,t,i);const f=this.Eg[s][t][i];f&&(f.Gg=new u(e,128*t+64,128*i+64,h,o,l,n,a))};Yg=(t,i,e)=>{const s=this.Eg[t][i][e];s&&(s.Gg=null)};Jy=(t,i,e,s,n,h,o,l,c,f)=>{if(!o&&!l)return;for(let s=t;s>=0;s--)this.Eg[s][i][e]||(this.Eg[s][i][e]=new r.A(s,i,e));const u=this.Eg[t][i][e];u&&(u.Hg=new a(s,128*i+64,128*e+64,n,h,o,l,c,f))};sp=(t,i,e,s)=>{const n=this.Eg[t][i][e];1===s&&n&&(n.Hg=null)};Hp=(t,i,e,s,n,h,o,l,a,f,u)=>{if(!l)return;for(let s=t;s>=0;s--)this.Eg[s][i][e]||(this.Eg[s][i][e]=new r.A(s,i,e));const d=this.Eg[t][i][e];d&&(d.Vg=new c(s,128*i+n+64,128*e+h+64,u,f,l,o,a))};Kg=(t,i,e)=>{const s=this.Eg[t][i][e];s&&(s.Vg=null)};CA=(t,i,e,s)=>{const n=this.Eg[t][i][e];if(!n)return;const r=n.Vg;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)};Xg=(t,i,e,s)=>{if(!s)return;const n=this.Eg[t][i][e];if(!n)return;const r=n.Vg;r&&(r.model=s)};jg=(t,i,e,s)=>{if(!s)return;const n=this.Eg[t][i][e];if(!n)return;const r=n.Fg;r&&(r.model=s)};zg=(t,i,e,s)=>{if(!s)return;const n=this.Eg[t][i][e];if(!n)return;const r=n.Hg;r&&(r.jA=s)};Zg=(t,i,e,s,n)=>{if(!s)return;const r=this.Eg[e][t][i];if(!r)return;const h=r.Hg;h&&(h.jA=s,h.zA=n)};jy=(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.qg(f,u,s,t,i,e,l,a,n,r,h,o,c,!1)};Jg=(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.qg(i,s,e,t,c,f,u+1-c,d-f+1,n,r,h,0,o,!0)};$g=(t,i,e,s,n,r,h,o,l,a,c,f)=>!l&&!a||this.qg(i,s,e,t,n,r,h+1-n,o-r+1,l,a,c,0,f,!0);qy=(t,i,e)=>{const s=this.Eg[t][i][e];if(s)for(let t=0;t>29&3)&&n.bA===i&&n.OA===e)return void this.Qg(n)}};tI=(t,i,e,s)=>{if(!s)return;const n=this.Eg[t][i][e];if(n)for(let t=0;t>29&3))return void(i.model=s)}};iI=()=>{for(let t=0;t{const s=this.Eg[t][i][e];return s&&s.Hg?s.Hg.SA:0};eI=(t,i,e)=>{const s=this.Eg[t][e][i];return s&&s.Vg?s.Vg.SA:0};sI=(t,i,e)=>{const s=this.Eg[t][i][e];if(!s)return 0;for(let t=0;t>29&3)&&n.bA===i&&n.OA===e)return n.SA}return 0};nI=(t,i,e)=>{const s=this.Eg[t][i][e];return s&&s.Fg?s.Fg.SA:0};rI=(t,i,e,s)=>{const n=this.Eg[t][i][e];if(n){if(n.Hg&&n.Hg.SA===s)return 255&n.Hg.info;if(n.Vg&&n.Vg.SA===s)return 255&n.Vg.info;if(n.Fg&&n.Fg.SA===s)return 255&n.Fg.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.Eg[t][i+1][e-1];n&&n.Fg&&n.Fg.model&&n.Fg.model.hI&&this.lI(s,n.Fg.model,128,0,-128,!0)}};oI=(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._g){for(let u=o;u<=l;u++)if(!(u<0||u>=this.Kp))for(let o=a;o<=c;o++){if(o<0||o>=this.Xp||h&&u=e||u===i))continue;const a=this.Eg[f][u][o];if(!a)continue;const d=128*(u-i)+64*(1-s),w=128*(o-e)+64*(1-n),y=((this.Cg[f][u][o]+this.Cg[f][u+1][o]+this.Cg[f][u][o+1]+this.Cg[f][u+1][o+1])/4|0)-((this.Cg[t][i][e]+this.Cg[t][i+1][e]+this.Cg[t][i][e+1]+this.Cg[t][i+1][e+1])/4|0),p=a.Hg;p&&p.jA&&p.jA.hI&&this.lI(r,p.jA,d,y,w,h),p&&p.zA&&p.zA.hI&&this.lI(r,p.zA,d,y,w,h);for(let t=0;t{this.Sg++;let h=0;const o=i.Pd,l=i.Bd;if(t.hI&&t.fI)for(let r=0;ri.PA)continue;const u=t.Pd[r]-e;if(ui.NA)continue;const d=t.Ud[r]-n;if(di.BA)continue;if(i.hI&&i.fI)for(let t=0;t{const h=this.Eg[t][i][e];if(!h)return;const o=h.kg;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.Ng;if(!l)return;const a=l.shape,c=l.angle,f=l.vm,u=l.bm,d=g.wg[a],w=g.yg[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.ig=!0,g.Vl=t,g.Kl=i,g.mg=-1,g.gg=-1};draw=(t,i,e,n,r,h,o)=>{t<0?t=0:t>=128*this.Kp&&(t=128*this.Kp-1),e<0?e=0:e>=128*this.Xp&&(e=128*this.Xp-1),g.xA++,g.Wm=s.A.sin[h],g.Gm=s.A.cos[h],g.Ym=s.A.sin[r],g.Hm=s.A.cos[r],g.eg=g.Tm[(h-128)/32|0][r/64|0],g.Vm=t,g.Km=i,g.Xm=e,g.jm=t/128|0,g.zm=e/128|0,g.Qm=n,g.Zm=g.jm-25,g.Zm<0&&(g.Zm=0),g.Jm=g.zm-25,g.Jm<0&&(g.Jm=0),g.qm=g.jm+25,g.qm>this.Kp&&(g.qm=this.Kp),g.$m=g.zm+25,g.$m>this.Xp&&(g.$m=this.Xp),this.mI(),g.tg=0;for(let t=this.Rg;t=2e3)?(h.visible=!0,h.update=!0,h.gI=h.Ug>0,g.tg++):(h.visible=!1,h.update=!1,h.II=0))}}for(let t=this.Rg;t=g.qm))for(let t=-25;t<=0;t++){const n=g.zm+t,r=g.zm-t;let h;if(e>=g.Zm&&(n>=g.Jm&&(h=i[e][n],h&&h.visible&&this._I(h,!0,o)),r=g.Jm&&(h=i[s][n],h&&h.visible&&this._I(h,!0,o)),r=g.qm))for(let t=-25;t<=0;t++){const n=g.zm+t,r=g.zm-t;let h;if(e>=g.Zm&&(n>=g.Jm&&(h=i[e][n],h&&h.visible&&this._I(h,!1,o)),r=g.Jm&&(h=i[s][n],h&&h.visible&&this._I(h,!1,o)),r{if(!c&&!f)return!1;for(let t=h;t=this.Kp||i>=this.Xp)return!1;const e=this.Eg[s][t][i];if(e&&e.Ug>=5)return!1}const p=new n(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.Eg[e][t][i]||(this.Eg[e][t][i]=new r.A(e,t,i));const n=this.Eg[s][t][i];n&&(n.Wg[n.Ug]=p,n.CI[n.Ug]=e,n.EI|=e,n.Ug++)}return y&&(this.Rh[this.Og++]=p),!0};Qg=t=>{for(let i=t.bA;i<=t.TA;i++)for(let e=t.OA;e<=t.RA;e++){const s=this.Eg[t.level][i][e];if(s){for(let i=0;i{const t=g.Sm[g.Qm],i=g.Lm[g.Qm];g.Ag=0;for(let e=0;e=0&&s<=50){n=t.kA+25-g.zm,n<0&&(n=0),r=t.Xp+25-g.zm,r>50&&(r=50);let i=!1;for(;n<=r;)if(g.eg&&g.eg[s][n++]){i=!0;break}if(i){if(h=g.Vm-t.DA,h>32)t.mode=1;else{if(h>=-32)continue;t.mode=2,h=-h}t.GA=(t.FA-g.Xm<<8)/h|0,t.YA=(t.BA-g.Xm<<8)/h|0,t.HA=(t.PA-g.Km<<8)/h|0,t.VA=(t.zd-g.Km<<8)/h|0,g.Mm[g.Ag++]=t}}}else if(2===t.type){if(s=t.kA+25-g.zm,s>=0&&s<=50){n=t.MA+25-g.jm,n<0&&(n=0),r=t.Kp+25-g.jm,r>50&&(r=50);let i=!1;for(;n<=r;)if(g.eg&&g.eg[n++][s]){i=!0;break}if(i){if(h=g.Xm-t.FA,h>32)t.mode=3;else{if(h>=-32)continue;t.mode=4,h=-h}t.UA=(t.DA-g.Vm<<8)/h|0,t.WA=(t.NA-g.Vm<<8)/h|0,t.HA=(t.PA-g.Km<<8)/h|0,t.VA=(t.zd-g.Km<<8)/h|0,g.Mm[g.Ag++]=t}}}else if(4===t.type&&(s=t.PA-g.Km,s>128&&(n=t.kA+25-g.zm,n<0&&(n=0),r=t.Xp+25-g.zm,r>50&&(r=50),n<=r))){let i=t.MA+25-g.jm;i<0&&(i=0),h=t.Kp+25-g.jm,h>50&&(h=50);let e=!1;t:for(let t=i;t<=h;t++)for(let i=n;i<=r;i++)if(g.eg&&g.eg[t][i]){e=!0;break t}e&&(t.mode=5,t.UA=(t.DA-g.Vm<<8)/s|0,t.WA=(t.NA-g.Vm<<8)/s|0,t.GA=(t.FA-g.Xm<<8)/s|0,t.YA=(t.BA-g.Xm<<8)/s|0,g.Mm[g.Ag++]=t)}}};_I=(t,i,e)=>{for(g.km.Yp(t);;){let t;do{if(t=g.km.vI(),!t)return}while(!t.update);const s=t.x,n=t.z,r=t.level,h=t.bI,o=this.Eg[r];if(t.visible){if(i){if(r>0){const t=this.Eg[r-1][s][n];if(t&&t.update)continue}if(s<=g.jm&&s>g.Zm){const i=o[s-1][n];if(i&&i.update&&(i.visible||!(1&t.EI)))continue}if(s>=g.jm&&sg.Jm){const i=o[s][n-1];if(i&&i.update&&(i.visible||!(8&t.EI)))continue}if(n>=g.zm&&nn&&(a+=6),c=g.sg[a],t.SI=g.rg[a]),f&&(f.KA&g.ng[a]?16===f.KA?(t.II=3,t.LI=g.hg[a],t.xI=3-t.LI):32===f.KA?(t.II=6,t.LI=g.og[a],t.xI=6-t.LI):64===f.KA?(t.II=12,t.LI=g.lg[a],t.xI=12-t.LI):(t.II=9,t.LI=g.ag[a],t.xI=9-t.LI):t.II=0,f.KA&c&&!this.MI(h,s,n,f.KA)&&f.jA?.draw(0,g.Wm,g.Gm,g.Ym,g.Hm,f.x-g.Vm,f.y-g.Km,f.z-g.Xm,f.SA),f.XA&c&&!this.MI(h,s,n,f.XA)&&f.zA?.draw(0,g.Wm,g.Gm,g.Ym,g.Hm,f.x-g.Vm,f.y-g.Km,f.z-g.Xm,f.SA)),u&&!this.visible(h,s,n,u.model.zd))if(u.type&c)u.model.draw(u.angle,g.Wm,g.Gm,g.Ym,g.Hm,u.x-g.Vm,u.y-g.Km,u.z-g.Xm,u.SA);else if(768&u.type){const t=u.x-g.Vm,i=u.y-g.Km,e=u.z-g.Xm,s=u.angle;let n,r;if(n=s===A.A.zy||s===A.A.Qy?-t:t,r=s===A.A.Qy||s===A.A.Zy?-e:e,256&u.type&&rn){const n=t+g.ug[s],r=e+g.dg[s];u.model.draw(512*s+1280&2047,g.Wm,g.Gm,g.Ym,g.Hm,n,i,r,u.SA)}}if(l){const i=t.Fg;i&&i.model?.draw(0,g.Wm,g.Gm,g.Ym,g.Hm,i.x-g.Vm,i.y-g.Km,i.z-g.Xm,i.SA);const e=t.Gg;e&&0===e.offset&&(e.JA&&e.JA.draw(0,g.Wm,g.Gm,g.Ym,g.Hm,e.x-g.Vm,e.y-g.Km,e.z-g.Xm,e.SA),e.qA&&e.qA.draw(0,g.Wm,g.Gm,g.Ym,g.Hm,e.x-g.Vm,e.y-g.Km,e.z-g.Xm,e.SA),e.ZA&&e.ZA.draw(0,g.Wm,g.Gm,g.Ym,g.Hm,e.x-g.Vm,e.y-g.Km,e.z-g.Xm,e.SA))}const d=t.EI;if(0!==d){if(sg.jm&&1&d){const t=o[s-1][n];t&&t.update&&g.km.Yp(t)}if(n>g.zm&&8&d){const t=o[s][n-1];t&&t.update&&g.km.Yp(t)}}}if(0!==t.II){let i=!0;for(let e=0;ei.bA&&(r+=1),ei.OA&&(r+=8),ss&&(s=n);const h=g.zm-i.OA,l=i.RA-g.zm;i.LA=l>h?s+l:s+h}for(;;){let t=-50,i=-1;for(let e=0;et&&(t=s.LA,i=e))}if(-1===i)break;const l=g.Rm[i];if(l){l.xA=g.xA;let t=l.model;t||(t=l.EA?.draw(e)??null),t&&!this.kI(h,l.bA,l.TA,l.OA,l.RA,t.zd)&&t.draw(l.vA,g.Wm,g.Gm,g.Ym,g.Hm,l.x-g.Vm,l.y-g.Km,l.z-g.Xm,l.SA);for(let t=l.bA;t<=l.TA;t++)for(let i=l.OA;i<=l.RA;i++){const e=o[t][i];e&&(0!==e.II?g.km.Yp(e):t===s&&i===n||!e.update||g.km.Yp(e))}}}if(t.gI)continue}if(!t.update||0!==t.II)continue;if(s<=g.jm&&s>g.Zm){const t=o[s-1][n];if(t&&t.update)continue}if(s>=g.jm&&sg.Jm){const t=o[s][n-1];if(t&&t.update)continue}if(n>=g.zm&&n=r){const r=t+g.cg[n],h=s+g.fg[n];i.model.draw(512*n+256,g.Wm,g.Gm,g.Ym,g.Hm,r,e,h,i.SA)}if(512&i.type&&h<=r){const r=t+g.ug[n],h=s+g.dg[n];i.model.draw(512*n+1280&2047,g.Wm,g.Gm,g.Ym,g.Hm,r,e,h,i.SA)}}const e=t.Hg;e&&(e.XA&t.SI&&!this.MI(h,s,n,e.XA)&&e.zA?.draw(0,g.Wm,g.Gm,g.Ym,g.Hm,e.x-g.Vm,e.y-g.Km,e.z-g.Xm,e.SA),e.KA&t.SI&&!this.MI(h,s,n,e.KA)&&e.jA?.draw(0,g.Wm,g.Gm,g.Ym,g.Hm,e.x-g.Vm,e.y-g.Km,e.z-g.Xm,e.SA))}if(rg.jm){const t=o[s-1][n];t&&t.update&&g.km.Yp(t)}if(n>g.zm){const t=o[s][n-1];t&&t.update&&g.km.Yp(t)}}};OI=(t,i,e,n,r,h,o,l)=>{let a,c,f,u,d=a=(e<<7)-g.Vm,y=c=(n<<7)-g.Xm,p=f=d+128,A=u=y+128,m=this.Cg[i][e][n]-g.Km,I=this.Cg[i][e+1][n]-g.Km,_=this.Cg[i][e+1][n+1]-g.Km,C=this.Cg[i][e][n+1]-g.Km,E=y*o+d*l>>16;if(y=y*l-d*o>>16,d=E,E=m*h-y*r>>16,y=m*r+y*h>>16,m=E,y<50)return;if(E=c*o+p*l>>16,c=c*l-p*o>>16,p=E,E=I*h-c*r>>16,c=I*r+c*h>>16,I=E,c<50)return;if(E=A*o+f*l>>16,A=A*l-f*o>>16,f=E,E=_*h-A*r>>16,A=_*r+A*h>>16,_=E,A<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.pa+((d<<9)/y|0),b=s.A.Aa+((m<<9)/y|0),T=s.A.pa+((p<<9)/c|0),O=s.A.Aa+((I<<9)/c|0),R=s.A.pa+((f<<9)/A|0),S=s.A.Aa+((_<<9)/A|0),L=s.A.pa+((a<<9)/u|0),x=s.A.Aa+((C<<9)/u|0);if(s.A.alpha=0,(R-L)*(O-x)-(S-x)*(T-L)>0)if(s.A.DI=R<0||L<0||T<0||R>w.A.NI||L>w.A.NI||T>w.A.NI,g.ig&&this.FI(g.Vl,g.Kl,S,x,O,R,L,T)&&(g.mg=e,g.gg=n),-1===t.sm)12345678!==t.tm&&s.A.BI(R,L,T,S,x,O,t.tm,t.im,t.QA);else if(g.lt){const i=g.pg[t.sm];s.A.BI(R,L,T,S,x,O,this.UI(i,t.tm),this.UI(i,t.im),this.UI(i,t.QA))}else t.flat?s.A.WI(R,L,T,S,x,O,t.tm,t.im,t.QA,d,m,y,p,a,I,C,c,u,t.sm):s.A.WI(R,L,T,S,x,O,t.tm,t.im,t.QA,f,_,A,a,p,C,I,u,c,t.sm);if(!((v-T)*(x-O)-(b-O)*(L-T)<=0))if(s.A.DI=v<0||T<0||L<0||v>w.A.NI||T>w.A.NI||L>w.A.NI,g.ig&&this.FI(g.Vl,g.Kl,b,O,x,v,T,L)&&(g.mg=e,g.gg=n),-1!==t.sm){if(!g.lt)return void s.A.WI(v,T,L,b,O,x,t.$A,t.QA,t.im,d,m,y,p,a,I,C,c,u,t.sm);const i=g.pg[t.sm];s.A.BI(v,T,L,b,O,x,this.UI(i,t.$A),this.UI(i,t.QA),this.UI(i,t.im))}else 12345678!==t.$A&&s.A.BI(v,T,L,b,O,x,t.$A,t.QA,t.im)};RI=(t,i,e,n,r,h,o)=>{let l=e.Pd.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.Em&&(y.hm[t]=i,y.om[t]=l,y.lm[t]=a),y.nm[t]=s.A.pa+((i<<9)/a|0),y.rm[t]=s.A.Aa+((l<<9)/a|0)}s.A.alpha=0,l=e.Im.length;for(let n=0;n0)if(s.A.DI=l<0||a<0||c<0||l>w.A.NI||a>w.A.NI||c>w.A.NI,g.ig&&this.FI(g.Vl,g.Kl,f,u,d,l,a,c)&&(g.mg=t,g.gg=i),e.Em&&-1!==e.Em[n])if(g.lt){const t=g.pg[e.Em[n]];s.A.BI(l,a,c,f,u,d,this.UI(t,e.pm[n]),this.UI(t,e.Am[n]),this.UI(t,e.gm[n]))}else e.flat?s.A.WI(l,a,c,f,u,d,e.pm[n],e.Am[n],e.gm[n],y.hm[0],y.om[0],y.lm[0],y.hm[1],y.hm[3],y.om[1],y.om[3],y.lm[1],y.lm[3],e.Em[n]):s.A.WI(l,a,c,f,u,d,e.pm[n],e.Am[n],e.gm[n],y.hm[r],y.om[r],y.lm[r],y.hm[h],y.hm[o],y.om[h],y.om[o],y.lm[h],y.lm[o],e.Em[n]);else 12345678!==e.pm[n]&&s.A.BI(l,a,c,f,u,d,e.pm[n],e.Am[n],e.gm[n])}};TI=(t,i,e)=>{const s=this.vg[t][i][e];if(s===-g.xA)return!1;if(s===g.xA)return!0;{const s=i<<7,n=e<<7;return this.GI(s+1,this.Cg[t][i][e],n+1)&&this.GI(s+128-1,this.Cg[t][i+1][e],n+1)&&this.GI(s+128-1,this.Cg[t][i+1][e+1],n+128-1)&&this.GI(s+1,this.Cg[t][i][e+1],n+128-1)?(this.vg[t][i][e]=g.xA,!0):(this.vg[t][i][e]=-g.xA,!1)}};MI=(t,i,e,s)=>{if(!this.TI(t,i,e))return!1;const n=i<<7,r=e<<7,h=this.Cg[t][i][e]-1,o=h-120,l=h-230,a=h-238;if(s<16){if(1===s){if(n>g.Vm){if(!this.GI(n,h,r))return!1;if(!this.GI(n,h,r+128))return!1}if(t>0){if(!this.GI(n,o,r))return!1;if(!this.GI(n,o,r+128))return!1}return!!this.GI(n,l,r)&&this.GI(n,l,r+128)}if(2===s){if(r0){if(!this.GI(n,o,r+128))return!1;if(!this.GI(n+128,o,r+128))return!1}return!!this.GI(n,l,r+128)&&this.GI(n+128,l,r+128)}if(4===s){if(n0){if(!this.GI(n+128,o,r))return!1;if(!this.GI(n+128,o,r+128))return!1}return!!this.GI(n+128,l,r)&&this.GI(n+128,l,r+128)}if(8===s){if(r>g.Xm){if(!this.GI(n,h,r))return!1;if(!this.GI(n+128,h,r))return!1}if(t>0){if(!this.GI(n,o,r))return!1;if(!this.GI(n+128,o,r))return!1}return!!this.GI(n,l,r)&&this.GI(n+128,l,r)}}return!!this.GI(n+64,a,r+64)&&(16===s?this.GI(n,l,r+128):32===s?this.GI(n+128,l,r+128):64===s?this.GI(n+128,l,r):128===s?this.GI(n,l,r):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,i,e,s)=>{if(this.TI(t,i,e)){const n=i<<7,r=e<<7;return this.GI(n+1,this.Cg[t][i][e]-s,r+1)&&this.GI(n+128-1,this.Cg[t][i+1][e]-s,r+1)&&this.GI(n+128-1,this.Cg[t][i+1][e+1]-s,r+128-1)&&this.GI(n+1,this.Cg[t][i][e+1]-s,r+128-1)}return!1};kI=(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.vg[t][h][o]===-g.xA)return!1;o=1+(i<<7);const l=2+(s<<7),a=this.Cg[t][i][s]-r;if(!this.GI(o,a,l))return!1;const c=(e<<7)-1;if(!this.GI(c,a,l))return!1;const f=(n<<7)-1;return!!this.GI(o,a,f)&&this.GI(c,a,f)}return!!this.TI(t,i,s)&&(h=i<<7,o=s<<7,this.GI(h+1,this.Cg[t][i][s]-r,o+1)&&this.GI(h+128-1,this.Cg[t][i+1][s]-r,o+1)&&this.GI(h+128-1,this.Cg[t][i+1][s+1]-r,o+128-1)&&this.GI(h+1,this.Cg[t][i][s+1]-r,o+128-1))};GI=(t,i,e)=>{for(let s=0;s0){const t=n.FA+(n.GA*s>>8),r=n.BA+(n.YA*s>>8),h=n.PA+(n.HA*s>>8),o=n.zd+(n.VA*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(2===n.mode){const s=t-n.DA;if(s>0){const t=n.FA+(n.GA*s>>8),r=n.BA+(n.YA*s>>8),h=n.PA+(n.HA*s>>8),o=n.zd+(n.VA*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(3===n.mode){const s=n.FA-e;if(s>0){const e=n.DA+(n.UA*s>>8),r=n.NA+(n.WA*s>>8),h=n.PA+(n.HA*s>>8),o=n.zd+(n.VA*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(4===n.mode){const s=e-n.FA;if(s>0){const e=n.DA+(n.UA*s>>8),r=n.NA+(n.WA*s>>8),h=n.PA+(n.HA*s>>8),o=n.zd+(n.VA*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(5===n.mode){const s=i-n.PA;if(s>0){const i=n.DA+(n.UA*s>>8),r=n.NA+(n.WA*s>>8),h=n.FA+(n.GA*s>>8),o=n.BA+(n.YA*s>>8);if(t>=i&&t<=r&&e>=h&&e<=o)return!0}}}return!1};FI=(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};UI=(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{YI;HI;VI;KI;index;ty;El;Cl;constructor(t,i,e,s,n,r,h){super(),this.YI=i,this.HI=e,this.VI=s,this.KI=n,this.index=t,this.ty=r,h&&-1!==r.bl&&this.ty.delay?(this.El=Math.random()*this.ty.vl|0,this.Cl=Math.random()*this.ty.delay[this.El]|0):(this.El=-1,this.Cl=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;vA=0;XI=!1;size=1;Ga=-1;jI=-1;zI=-1;ZI=-1;qI=-1;JI=-1;$I=-1;QI=null;t_=100;i_=0;e_=0;s_=0;n_=0;r_=-1e3;h_=0;o_=0;l_=-1;a_=0;c_=0;f_=-1;u_=0;d_=0;w_=-1;y_=0;p_=0;A_=0;m_=0;g_=-1;I_=0;__=0;C_=0;E_=0;v_=0;b_=0;T_=0;O_=0;R_=0;S_=0;L_=0;xA=0;height=0;x_=0;pathLength=0;M_=new Int32Array(10);k_=new Int32Array(10);D_=new r.Ae(10,!1);N_=0;F_=-1;B_=-1;P_=-1;U_=-1;move(t,i,e){if(-1!==this.w_&&n.A.Bo[this.w_].priority<=1&&(this.w_=-1),!t){const t=i-this.M_[0],s=e-this.k_[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.k_[t]=this.k_[t-1],this.D_[t]=this.D_[t-1];return this.M_[0]=i,this.k_[0]=e,void(this.D_[0]=!1)}}this.pathLength=0,this.N_=0,this.M_[0]=i,this.k_[0]=e,this.x=128*this.M_[0]+64*this.size,this.z=128*this.k_[0]+64*this.size}step(t,i){let e=this.M_[0],s=this.k_[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.w_&&n.A.Bo[this.w_].priority<=1&&(this.w_=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.M_[t]=this.M_[t-1],this.k_[t]=this.k_[t-1],this.D_[t]=this.D_[t-1];this.M_[0]=e,this.k_[0]=s,this.D_[0]=t}}},8268:(t,i,e)=>{e.d(i,{A:()=>d});var s=e(9418),n=e(8665),r=e(2031),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 G_=2;static Y_=4;static H_=8;static V_=16;static K_=32;static X_=64;static j_=128;static z_=256;static Z_=512;static Wa=[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.lC,u.A.aC,u.A.cC,u.A.fC,u.A.uC];static Ua=[[u.A.dC,u.A.wC,u.A.yC,u.A.pC,u.A.AC,u.A.mC,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.OC,u.A.RC,u.A.SC,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.PC,u.A.UC,u.A.WC],[u.A.WC-1,u.A.bC+1,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.NC,u.A.FC,u.A.BC,u.A.PC,u.A.UC],[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]];static Po=new r.A(200);name=null;visible=!1;iE=0;eE=0;sE=new Uint16Array(12);nE=new Uint16Array(5);ec=0;rE=0n;y=0;hE=0;oE=0;lE=0;aE=0;cE=0;fE=null;MA=0;kA=0;Kp=0;Xp=0;lt=!1;draw(t){if(!this.visible)return null;let i=this.nw();if(this.height=i.zd,i.lw=!0,this.lt)return i;if(-1!==this.g_&&-1!==this.I_){const t=h.A.Bo[this.g_],e=n.A.Du(t.ga(),!0,!t.gd,!1);e.translate(-this.E_,0,0),e.Ya(),t.ty&&t.ty.frames&&e.Ha(t.ty.frames[this.I_]),e.Vd=null,e.Kd=null,128===t.ew&&128===t.sw||e.scale(t.ew,t.sw,t.ew),e.Va(t._d+64,t.Cd+850,-30,-50,-30,!0);const s=[i,e];i=n.A.uE(s,2)}if(this.fE&&(t>=this.oE&&(this.fE=null),t>=this.hE&&t=d.Ua[i].length)&&(e=0),this.nE[i]=e}this.Ga=t.Au,65535===this.Ga&&(this.Ga=-1),this.jI=t.Au,65535===this.jI&&(this.jI=-1),this.zI=t.Au,65535===this.zI&&(this.zI=-1),this.ZI=t.Au,65535===this.ZI&&(this.ZI=-1),this.qI=t.Au,65535===this.qI&&(this.qI=-1),this.JI=t.Au,65535===this.JI&&(this.JI=-1),this.$I=t.Au,65535===this.$I&&(this.$I=-1),this.name=c.A.ka(c.A.Da(t.dE)),this.ec=t.gu,this.visible=!0,this.rE=0n;for(let t=0;t<12;t++)this.rE<<=0x4n,this.sE[t]>=256&&(this.rE+=BigInt(this.sE[t])-256n);this.sE[0]>=256&&(this.rE+=BigInt(this.sE[0])-256n>>4n),this.sE[1]>=256&&(this.rE+=BigInt(this.sE[1])-256n>>8n);for(let t=0;t<5;t++)this.rE<<=0x3n,this.rE+=BigInt(this.nE[t]);this.rE<<=0x1n,this.rE+=BigInt(this.iE)}sd(){if(!this.visible)return null;const t=new f.Ae(12,null);let i=0;for(let e=0;e<12;e++){const s=this.sE[e];if(s>=256&&s<512&&(t[i++]=l.A.Bo[s-256].sd()),s>=512){const e=a.A.get(s-512).sd(this.iE);e&&(t[i++]=e)}}const e=n.A.Ba(t,i);for(let t=0;t<5;t++)0!==this.nE[t]&&(e.Pa(d.Ua[t][0],d.Ua[t][this.nE[t]]),1===t&&e.Pa(d.Wa[0],d.Wa[this.nE[t]]));return e}nw(){let t=this.rE,i=-1,e=-1,s=-1,r=-1;if(this.w_>=0&&0===this.A_){const n=o.A.Bo[this.w_];if(n.frames&&(i=n.frames[this.y_]),this.f_>=0&&this.f_!==this.Ga){const t=o.A.Bo[this.f_].frames;t&&(e=t[this.u_])}n.Jw>=0&&(s=n.Jw,t+=BigInt(s-this.sE[5])<<8n),n.$w>=0&&(r=n.$w,t+=BigInt(r-this.sE[3])<<16n)}else if(this.f_>=0){const t=o.A.Bo[this.f_].frames;t&&(i=t[this.u_])}let h=d.Po?.get(t);if(!h){const i=new f.Ae(12,null);let e=0;for(let t=0;t<12;t++){let n=this.sE[t];if(r>=0&&3===t&&(n=r),s>=0&&5===t&&(n=s),n>=256&&n<512){const t=l.A.Bo[n-256].ga();t&&(i[e++]=t)}if(n>=512){const t=a.A.get(n-512).zw(this.iE);t&&(i[e++]=t)}}h=n.A.Ba(i,e);for(let t=0;t<5;t++)0!==this.nE[t]&&(h.Pa(d.Ua[t][0],d.Ua[t][this.nE[t]]),1===t&&h.Pa(d.Wa[0],d.Wa[this.nE[t]]));h.Ya(),h.Va(64,850,-30,-50,-30,!0),d.Po?.put(t,h)}if(this.lt)return h;const c=n.A.rw(h,!0);return-1!==i&&-1!==e?c.hw(i,e,o.A.Bo[this.w_].Zw):-1!==i&&c.Ha(i),c.ow(),c.Vd=null,c.Kd=null,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;bI;Wg;CI;kg=null;Ng=null;Hg=null;Vg=null;Fg=null;Gg=null;xg=null;Ug=0;EI=0;Mg=0;visible=!1;update=!1;gI=!1;II=0;LI=0;xI=0;SI=0;constructor(t,i,e){super(),this.bI=this.level=t,this.x=i,this.z=e,this.Wg=new n.Ae(5,null),this.CI=new Int32Array(5)}}},5518:(t,i,e)=>{e.d(i,{A:()=>s});class s{static aA=0;static Dg=1;static wE=2;static yE=3;static pE=4;static AE=5;static dm=6;static wm=7;static ym=8;static mE=9;static gE=10;static IE=11}},4474:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{_E;CE;constructor(){super(),this._E=this,this.CE=this}EE(){this.CE&&this._E&&(this.CE._E=this._E,this._E.CE=this.CE,this._E=null,this.CE=null)}}},3819:(t,i,e)=>{e.d(i,{A:()=>s});class s{static vE=['_','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 bE=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 Da=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.vE[Number(s-37n*t)]}return e.slice(12-i).join('')};static TE=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 OE=t=>{let i='';for(let e=0;e(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static ka=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.SE=t,this.RE=t}Yp(t){t.SE&&t.yw(),t.SE=this.RE.SE,t.next=this.RE,t.SE&&(t.SE.next=t),t.next.SE=t}LE(t){t.SE&&t.yw(),t.SE=this.RE,t.next=this.RE.next,t.SE.next=t,t.next&&(t.next.SE=t)}vI(){const t=this.RE.next;return t===this.RE?null:(t?.yw(),t)}head(){const t=this.RE.next;return t===this.RE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}xE(){const t=this.RE.SE;return t===this.RE?(this.cursor=null,null):(this.cursor=t?.SE||null,t)}next(){const t=this.cursor;return t===this.RE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}SE(){const t=this.cursor;return t===this.RE?(this.cursor=null,null):(this.cursor=t?.SE||null,t)}clear(){for(;;){const t=this.RE.next;if(t===this.RE)return;t?.yw()}}}},1982:(t,i,e)=>{e.d(i,{A:()=>s});class s{key;next;SE;constructor(){this.key=0n,this.next=this,this.SE=this}yw(){this.SE&&this.next&&(this.SE.next=this.next,this.next.SE=this.SE,this.next=null,this.SE=null)}}},2031:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(4474);class n{head;constructor(){this.head=new s.A}push(t){t.CE&&t.EE(),t.CE=this.head.CE,t._E=this.head,t.CE&&(t.CE._E=t),t._E.CE=t}pop(){const t=this.head._E;return t===this.head?null:(t?.EE(),t)}}var r=e(1982);class h{ME;kE;constructor(t){this.kE=[],this.ME=t;for(let i=0;i{e.d(i,{A:()=>r});var s=e(1069),n=e(3867);class r{static Bo=[];static pu=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.Au;i.gf+=2;for(let t=0;t{e.d(i,{A:()=>r});var s=e(8534),n=e(1069);class r{static Bo=[];static pu=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.Au;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[p]=i,c[p]=0,f[p]=0,u[p]=0,p++;break}a[p]=t;let e=0;3===d.types[a[p]]&&(e=128),c[p]=1&i?h.BE:e,f[p]=2&i?h.BE:e,u[p]=4&i?h.BE:e,y=t,p++}}n.length=p,n.PE=new Int32Array(p),n.x=new Int32Array(p),n.y=new Int32Array(p),n.z=new Int32Array(p);for(let t=0;t{e.d(i,{Fc:()=>s,rl:()=>n,UE:()=>o,WE:()=>h,GE:()=>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 Jl=16776960;static YE=65535;static uA=16711935;static xl=16777215;static ql=0;static HE=16748608;static VE=8388608;static KE=128;static XE=16756736;static jE=16740352;static zE=16723968;static ZE=12648192;static qE=8453888;static JE=4259584;static $E=9179409;static QE=6116423;static ul=2301979;static dl=5063219;static yl=7759444;static Al=3353893;static tv=8388736;static iv=13350793;static ev=Int32Array.of(s.Jl,s.RED,s.GREEN,s.YE,s.uA,s.xl);static dC=6798;static wC=107;static yC=10283;static pC=16;static AC=4797;static mC=7744;static gC=5799;static IC=4634;static _C=33697;static CC=22433;static EC=2983;static vC=54193;static bC=8741;static TC=12;static OC=64030;static RC=43162;static SC=7735;static LC=8404;static xC=1701;static MC=38430;static kC=24094;static DC=10153;static NC=56621;static FC=4783;static BC=1341;static PC=16578;static UC=35003;static WC=25239;static q_=9104;static J_=10275;static Q_=7595;static tC=3610;static iC=7975;static eC=8526;static sC=918;static nC=38802;static rC=24466;static hC=10145;static oC=58654;static lC=5027;static aC=1457;static cC=16565;static fC=34991;static uC=25486;static GC=4626;static YC=11146;static HC=6439;static VC=12;static KC=4758;static XC=10270;static tE=4574;static jC=4550;static zC=4537;static ZC=5681;static qC=5673;static JC=5790;static $C=6806;static QC=8076}},8950:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n extends s.A{static gw=new Int32Array;static Iw=0;static _w=0;static top=0;static bottom=0;static left=0;static right=0;static NI=0;static sv=0;static nv=0;static bind=(t,i,e)=>{this.gw=t,this.Iw=i,this._w=e,this.Ol(0,0,i,e)};static rv=()=>{this.left=0,this.top=0,this.right=this.Iw,this.bottom=this._w,this.NI=this.right-1,this.sv=this.right/2|0};static Ol=(t,i,e,s)=>{t<0&&(t=0),i<0&&(i=0),e>this.Iw&&(e=this.Iw),s>this._w&&(s=this._w),this.top=i,this.bottom=s,this.left=t,this.right=e,this.NI=this.right-1,this.sv=this.right/2|0,this.nv=this.bottom/2|0};static clear=()=>{const t=this.Iw*this._w;for(let i=0;i{this.pl(t,i,n,e),this.pl(t,i+s-1,n,e),this.wl(t,i,n,s),this.wl(t+e-1,i,n,s)};static pl=(t,i,e,s)=>{if(i=this.bottom)return;tthis.right&&(s=this.right-t);const n=t+i*this.Iw;for(let t=0;t{if(t=this.right)return;ithis.bottom&&(s=this.bottom-i);const n=t+i*this.Iw;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.Iw-e;let h=t+i*this.Iw;for(let t=-s;t<0;t++){for(let t=-e;t<0;t++)this.gw[h++]=n;h+=r}};static ov(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.Iw-e;let f=t+i*this.Iw;for(let t=0;t>16&255)*h>>8<<16)+(l+(this.gw[f]>>8&255)*h>>8<<8)+(a+(255&this.gw[f])*h>>8);this.gw[f++]=t}f+=c}}static lv(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._w&&(c=this._w-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.Iw&&(f=this.Iw-1);let u=c+s*this.Iw;for(let t=c;t<=f;t++){const t=(h+(this.gw[u]>>16&255)*r>>8<<16)+(o+(this.gw[u]>>8&255)*r>>8<<8)+(l+(255&this.gw[u])*r>>8);this.gw[u++]=t}}}static av=(t,i,e)=>{t=this.right||i=this.bottom||(this.gw[t+i*this.Iw]=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 lt=!1;static cv=new Int32Array(512);static fv=new Int32Array(2048);static sin=new Int32Array(2048);static cos=new Int32Array(2048);static palette=new Int32Array(65536);static uv=new r.Ae(50,null);static dv=0;static mw=new Int32Array;static pa=0;static Aa=0;static Cw=!0;static DI=!1;static alpha=0;static wv=null;static yv=new r.Ae(50,null);static pv=0;static xA=0;static Av=new Int32Array(50);static mv=new r.Ae(50,null);static gv=!1;static Iv=new r.Ae(50,!1);static _v=new Int32Array(50);static{for(let t=1;t<512;t++)this.cv[t]=32768/t|0;for(let t=1;t<2048;t++)this.fv[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 Do=()=>{this.cv=null,this.cv=null,this.sin=null,this.cos=null,this.mw=null,this.uv=null,this.Iv=null,this._v=null,this.wv=null,this.yv=null,this.Av=null,this.palette=null,this.mv=null,console.log('Draw3D unloaded!')};static Bc=()=>{this.mw=new Int32Array(s.A._w);for(let t=0;t{this.mw=new Int32Array(i);for(let e=0;e{this.wv=null,this.yv.fill(null)};static vv=t=>{this.dv=0;for(let i=0;i<50;i++)try{this.uv[i]=n.A.Mu(t,i.toString()),this.lt&&128===this.uv[i]?.jl?this.uv[i]?.bv():this.uv[i]?.Mw(),this.dv++}catch(t){}};static fA=t=>{if(0!==this._v[t])return this._v[t];const i=this.mv[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.Tv(h,1.4),0===h&&(h=1),this._v[t]=h,h};static Ov=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.Tv(a,i)}}for(let t=0;t<50;t++){const e=this.uv[t];if(!e)continue;const s=e.palette;this.mv[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 Sv=t=>{this.wv||(this.pv=t,this.lt?this.wv=new r.$r(t,16384):this.wv=new r.$r(t,65536),this.yv.fill(null))};static BI=(t,i,e,n,r,o,l,a,c)=>{let f=0,u=0;r!==n&&(f=(i-t<<16)/(r-n)|0,u=(a-l<<15)/(r-n)|0);let d=0,w=0;o!==r&&(d=(e-i<<16)/(o-r)|0,w=(c-a<<15)/(o-r)|0);let y=0,p=0;if(o!==n&&(y=(t-e<<16)/(n-o)|0,p=(l-c<<15)/(n-o)|0),n<=r&&n<=o){if(ns.A.bottom&&(r=s.A.bottom),o>s.A.bottom&&(o=s.A.bottom),rd)for(o-=r,r-=n,n=h.mw[n];;){if(--r<0)for(;;){if(--o<0)return;this.Lv(e>>16,i>>16,c>>7,a>>7,s.A.gw,n,0),e+=y,i+=d,c+=p,a+=w,n+=s.A.Iw}this.Lv(e>>16,t>>16,c>>7,l>>7,s.A.gw,n,0),e+=y,t+=f,c+=p,l+=u,n+=s.A.Iw}else for(o-=r,r-=n,n=h.mw[n];;){if(--r<0)for(;;){if(--o<0)return;this.Lv(i>>16,e>>16,a>>7,c>>7,s.A.gw,n,0),e+=y,i+=d,c+=p,a+=w,n+=s.A.Iw}this.Lv(t>>16,e>>16,l>>7,c>>7,s.A.gw,n,0),e+=y,t+=f,c+=p,l+=u,n+=s.A.Iw}else if(i=t<<=16,a=l<<=15,n<0&&(i-=y*n,t-=f*n,a-=p*n,l-=u*n,n=0),e<<=16,c<<=15,o<0&&(e-=d*o,c-=w*o,o=0),n!==o&&yf)for(r-=o,o-=n,n=h.mw[n];;){if(--o<0)for(;;){if(--r<0)return;this.Lv(e>>16,t>>16,c>>7,l>>7,s.A.gw,n,0),e+=d,t+=f,c+=w,l+=u,n+=s.A.Iw}this.Lv(i>>16,t>>16,a>>7,l>>7,s.A.gw,n,0),i+=y,t+=f,a+=p,l+=u,n+=s.A.Iw}else for(r-=o,o-=n,n=h.mw[n];;){if(--o<0)for(;;){if(--r<0)return;this.Lv(t>>16,e>>16,l>>7,c>>7,s.A.gw,n,0),e+=d,t+=f,c+=w,l+=u,n+=s.A.Iw}this.Lv(t>>16,i>>16,l>>7,a>>7,s.A.gw,n,0),i+=y,t+=f,a+=p,l+=u,n+=s.A.Iw}}else if(r<=o){if(rs.A.bottom&&(o=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),oy)for(n-=o,o-=r,r=h.mw[r];;){if(--o<0)for(;;){if(--n<0)return;this.Lv(t>>16,e>>16,l>>7,c>>7,s.A.gw,r,0),t+=f,e+=y,l+=u,c+=p,r+=s.A.Iw}this.Lv(t>>16,i>>16,l>>7,a>>7,s.A.gw,r,0),t+=f,i+=d,l+=u,a+=w,r+=s.A.Iw}else for(n-=o,o-=r,r=h.mw[r];;){if(--o<0)for(;;){if(--n<0)return;this.Lv(e>>16,t>>16,c>>7,l>>7,s.A.gw,r,0),t+=f,e+=y,l+=u,c+=p,r+=s.A.Iw}this.Lv(i>>16,t>>16,a>>7,l>>7,s.A.gw,r,0),t+=f,i+=d,l+=u,a+=w,r+=s.A.Iw}else if(e=i<<=16,c=a<<=15,r<0&&(e-=f*r,i-=d*r,c-=u*r,a-=w*r,r=0),t<<=16,l<<=15,n<0&&(t-=y*n,l-=p*n,n=0),o-=n,n-=r,r=h.mw[r],f>16,i>>16,l>>7,a>>7,s.A.gw,r,0),t+=y,i+=d,l+=p,a+=w,r+=s.A.Iw}this.Lv(e>>16,i>>16,c>>7,a>>7,s.A.gw,r,0),e+=f,i+=d,c+=u,a+=w,r+=s.A.Iw}else for(;;){if(--n<0)for(;;){if(--o<0)return;this.Lv(i>>16,t>>16,a>>7,l>>7,s.A.gw,r,0),t+=y,i+=d,l+=p,a+=w,r+=s.A.Iw}this.Lv(i>>16,e>>16,a>>7,c>>7,s.A.gw,r,0),e+=f,i+=d,c+=u,a+=w,r+=s.A.Iw}}else if(os.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,a>>7,l>>7,s.A.gw,o,0),i+=d,t+=f,a+=w,l+=u,o+=s.A.Iw}this.Lv(i>>16,e>>16,a>>7,c>>7,s.A.gw,o,0),i+=d,e+=y,a+=w,c+=p,o+=s.A.Iw}else for(;;){if(--n<0)for(;;){if(--r<0)return;this.Lv(t>>16,i>>16,l>>7,a>>7,s.A.gw,o,0),i+=d,t+=f,a+=w,l+=u,o+=s.A.Iw}this.Lv(e>>16,i>>16,c>>7,a>>7,s.A.gw,o,0),i+=d,e+=y,a+=w,c+=p,o+=s.A.Iw}else if(t=e<<=16,l=c<<=15,o<0&&(t-=d*o,e-=y*o,l-=w*o,c-=p*o,o=0),i<<=16,a<<=15,r<0&&(i-=f*r,a-=u*r,r=0),n-=r,r-=o,o=h.mw[o],d>16,e>>16,a>>7,c>>7,s.A.gw,o,0),i+=f,e+=y,a+=u,c+=p,o+=s.A.Iw}this.Lv(t>>16,e>>16,l>>7,c>>7,s.A.gw,o,0),t+=d,e+=y,l+=w,c+=p,o+=s.A.Iw}else for(;;){if(--r<0)for(;;){if(--n<0)return;this.Lv(e>>16,i>>16,c>>7,a>>7,s.A.gw,o,0),i+=f,e+=y,a+=u,c+=p,o+=s.A.Iw}this.Lv(e>>16,t>>16,c>>7,l>>7,s.A.gw,o,0),t+=d,e+=y,l+=w,c+=p,o+=s.A.Iw}};static Lv=(t,i,e,n,r,o,l)=>{let a;if(h.Cw){let c;if(h.DI){if(c=i-t>3?(n-e)/(i-t)|0:0,i>s.A.NI&&(i=s.A.NI),t<0&&(e-=t*c,t=0),t>=i)return;o+=t,l=i-t>>2,c<<=2}else{if(!(t>2)>0?(n-e)*h.cv[l]>>15:0}if(0===h.alpha)for(;;){if(--l<0){if((l=i-t&3)>0){a=h.palette[e>>8];do{r[o++]=a,l--}while(l>0);return}break}a=h.palette[e>>8],e+=c,r[o++]=a,r[o++]=a,r[o++]=a,r[o++]=a}else{const s=h.alpha,n=256-h.alpha;for(;;){if(--l<0){if((l=i-t&3)>0){a=h.palette[e>>8],a=((16711935&a)*n>>8&16711935)+((65280&a)*n>>8&65280);do{r[o++]=a+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),l--}while(l>0)}break}a=h.palette[e>>8],e+=c,a=((16711935&a)*n>>8&16711935)+((65280&a)*n>>8&65280),r[o++]=a+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=a+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=a+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=a+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280)}}}else if(ts.A.NI&&(i=s.A.NI),t<0&&(e-=t*c,t=0),t>=i))return;if(o+=t,l=i-t,0===h.alpha)do{r[o++]=h.palette[e>>8],e+=c,l--}while(l>0);else{const t=h.alpha,i=256-h.alpha;do{a=h.palette[e>>8],e+=c,a=((16711935&a)*i>>8&16711935)+((65280&a)*i>>8&65280),r[o++]=a+((16711935&r[o])*t>>8&16711935)+((65280&r[o])*t>>8&65280),l--}while(l>0)}}};static xv=(t,i,e,n,r,h,o)=>{let l=0;r!==n&&(l=(i-t<<16)/(r-n)|0);let a=0;h!==r&&(a=(e-i<<16)/(h-r)|0);let c=0;if(h!==n&&(c=(t-e<<16)/(n-h)|0),n<=r&&n<=h){if(ns.A.bottom&&(r=s.A.bottom),h>s.A.bottom&&(h=s.A.bottom),ra)for(h-=r,r-=n,n=this.mw[n];;){if(--r<0)for(;;){if(--h<0)return;this.Mv(e>>16,i>>16,s.A.gw,n,o),e+=c,i+=a,n+=s.A.Iw}this.Mv(e>>16,t>>16,s.A.gw,n,o),e+=c,t+=l,n+=s.A.Iw}else for(h-=r,r-=n,n=this.mw[n];;){if(--r<0)for(;;){if(--h<0)return;this.Mv(i>>16,e>>16,s.A.gw,n,o),e+=c,i+=a,n+=s.A.Iw}this.Mv(t>>16,e>>16,s.A.gw,n,o),e+=c,t+=l,n+=s.A.Iw}else if(i=t<<=16,n<0&&(i-=c*n,t-=l*n,n=0),e<<=16,h<0&&(e-=a*h,h=0),n!==h&&cl)for(r-=h,h-=n,n=this.mw[n];;){if(--h<0)for(;;){if(--r<0)return;this.Mv(e>>16,t>>16,s.A.gw,n,o),e+=a,t+=l,n+=s.A.Iw}this.Mv(i>>16,t>>16,s.A.gw,n,o),i+=c,t+=l,n+=s.A.Iw}else for(r-=h,h-=n,n=this.mw[n];;){if(--h<0)for(;;){if(--r<0)return;this.Mv(t>>16,e>>16,s.A.gw,n,o),e+=a,t+=l,n+=s.A.Iw}this.Mv(t>>16,i>>16,s.A.gw,n,o),i+=c,t+=l,n+=s.A.Iw}}else if(r<=h){if(rs.A.bottom&&(h=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),hc)for(n-=h,h-=r,r=this.mw[r];;){if(--h<0)for(;;){if(--n<0)return;this.Mv(t>>16,e>>16,s.A.gw,r,o),t+=l,e+=c,r+=s.A.Iw}this.Mv(t>>16,i>>16,s.A.gw,r,o),t+=l,i+=a,r+=s.A.Iw}else for(n-=h,h-=r,r=this.mw[r];;){if(--h<0)for(;;){if(--n<0)return;this.Mv(e>>16,t>>16,s.A.gw,r,o),t+=l,e+=c,r+=s.A.Iw}this.Mv(i>>16,t>>16,s.A.gw,r,o),t+=l,i+=a,r+=s.A.Iw}else if(e=i<<=16,r<0&&(e-=l*r,i-=a*r,r=0),t<<=16,n<0&&(t-=c*n,n=0),l>16,i>>16,s.A.gw,r,o),t+=c,i+=a,r+=s.A.Iw}this.Mv(e>>16,i>>16,s.A.gw,r,o),e+=l,i+=a,r+=s.A.Iw}else for(h-=n,n-=r,r=this.mw[r];;){if(--n<0)for(;;){if(--h<0)return;this.Mv(i>>16,t>>16,s.A.gw,r,o),t+=c,i+=a,r+=s.A.Iw}this.Mv(i>>16,e>>16,s.A.gw,r,o),e+=l,i+=a,r+=s.A.Iw}}else if(hs.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,s.A.gw,h,o),i+=a,t+=l,h+=s.A.Iw}this.Mv(i>>16,e>>16,s.A.gw,h,o),i+=a,e+=c,h+=s.A.Iw}else for(r-=n,n-=h,h=this.mw[h];;){if(--n<0)for(;;){if(--r<0)return;this.Mv(t>>16,i>>16,s.A.gw,h,o),i+=a,t+=l,h+=s.A.Iw}this.Mv(e>>16,i>>16,s.A.gw,h,o),i+=a,e+=c,h+=s.A.Iw}else if(t=e<<=16,h<0&&(t-=a*h,e-=c*h,h=0),i<<=16,r<0&&(i-=l*r,r=0),a>16,e>>16,s.A.gw,h,o),i+=l,e+=c,h+=s.A.Iw}this.Mv(t>>16,e>>16,s.A.gw,h,o),t+=a,e+=c,h+=s.A.Iw}else for(n-=r,r-=h,h=this.mw[h];;){if(--r<0)for(;;){if(--n<0)return;this.Mv(e>>16,i>>16,s.A.gw,h,o),i+=l,e+=c,h+=s.A.Iw}this.Mv(e>>16,t>>16,s.A.gw,h,o),t+=a,e+=c,h+=s.A.Iw}};static WI=(t,i,e,n,r,h,o,l,a,c,f,u,d,w,y,p,A,m,g)=>{const I=this.kv(g);this.gv=!this.Iv[g];const _=c-d,C=f-y,E=u-A,v=w-c,b=p-f,T=m-u;let O=v*f-b*c<<14;const R=b*u-T*f<<8,S=T*c-v*u<<5;let L=_*f-C*c<<14;const x=C*u-E*f<<8,M=E*c-_*u<<5;let k=C*v-_*b<<14;const D=E*b-C*T<<8,N=_*T-E*v<<5;let F=0,B=0;r!==n&&(F=(i-t<<16)/(r-n)|0,B=(l-o<<16)/(r-n)|0);let P=0,U=0;h!==r&&(P=(e-i<<16)/(h-r)|0,U=(a-l<<16)/(h-r)|0);let W=0,G=0;if(h!==n&&(W=(t-e<<16)/(n-h)|0,G=(o-a<<16)/(n-h)|0),n<=r&&n<=h){if(ns.A.bottom&&(r=s.A.bottom),h>s.A.bottom&&(h=s.A.bottom),rP)for(h-=r,r-=n,n=this.mw[n];;){if(--r<0)for(;;){if(--h<0)return;this.Dv(e>>16,i>>16,s.A.gw,n,I,0,0,O,L,k,R,x,D,a>>8,l>>8),e+=W,i+=P,a+=G,l+=U,n+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.Dv(e>>16,t>>16,s.A.gw,n,I,0,0,O,L,k,R,x,D,a>>8,o>>8),e+=W,t+=F,a+=G,o+=B,n+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}else for(h-=r,r-=n,n=this.mw[n];;){if(--r<0)for(;;){if(--h<0)return;this.Dv(i>>16,e>>16,s.A.gw,n,I,0,0,O,L,k,R,x,D,l>>8,a>>8),e+=W,i+=P,a+=G,l+=U,n+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.Dv(t>>16,e>>16,s.A.gw,n,I,0,0,O,L,k,R,x,D,o>>8,a>>8),e+=W,t+=F,a+=G,o+=B,n+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}}else{i=t<<=16,l=o<<=16,n<0&&(i-=W*n,t-=F*n,l-=G*n,o-=B*n,n=0),e<<=16,a<<=16,h<0&&(e-=P*h,a-=U*h,h=0);const c=n-this.Aa;if(O+=S*c,L+=M*c,k+=N*c,O|=0,L|=0,k|=0,(n===h||W>=F)&&(n!==h||P<=F))for(r-=h,h-=n,n=this.mw[n];;){if(--h<0)for(;;){if(--r<0)return;this.Dv(t>>16,e>>16,s.A.gw,n,I,0,0,O,L,k,R,x,D,o>>8,a>>8),e+=P,t+=F,a+=U,o+=B,n+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.Dv(t>>16,i>>16,s.A.gw,n,I,0,0,O,L,k,R,x,D,o>>8,l>>8),i+=W,t+=F,l+=G,o+=B,n+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}else for(r-=h,h-=n,n=this.mw[n];;){if(--h<0)for(;;){if(--r<0)return;this.Dv(e>>16,t>>16,s.A.gw,n,I,0,0,O,L,k,R,x,D,a>>8,o>>8),e+=P,t+=F,a+=U,o+=B,n+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.Dv(i>>16,t>>16,s.A.gw,n,I,0,0,O,L,k,R,x,D,l>>8,o>>8),i+=W,t+=F,l+=G,o+=B,n+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}}}else if(r<=h){if(rs.A.bottom&&(h=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),hW)for(n-=h,h-=r,r=this.mw[r];;){if(--h<0)for(;;){if(--n<0)return;this.Dv(t>>16,e>>16,s.A.gw,r,I,0,0,O,L,k,R,x,D,o>>8,a>>8),t+=F,e+=W,o+=B,a+=G,r+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.Dv(t>>16,i>>16,s.A.gw,r,I,0,0,O,L,k,R,x,D,o>>8,l>>8),t+=F,i+=P,o+=B,l+=U,r+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}else for(n-=h,h-=r,r=this.mw[r];;){if(--h<0)for(;;){if(--n<0)return;this.Dv(e>>16,t>>16,s.A.gw,r,I,0,0,O,L,k,R,x,D,a>>8,o>>8),t+=F,e+=W,o+=B,a+=G,r+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.Dv(i>>16,t>>16,s.A.gw,r,I,0,0,O,L,k,R,x,D,l>>8,o>>8),t+=F,i+=P,o+=B,l+=U,r+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}}else{e=i<<=16,a=l<<=16,r<0&&(e-=F*r,i-=P*r,a-=B*r,l-=U*r,r=0),t<<=16,o<<=16,n<0&&(t-=W*n,o-=G*n,n=0);const c=r-this.Aa;if(O+=S*c,L+=M*c,k+=N*c,O|=0,L|=0,k|=0,h-=n,n-=r,r=this.mw[r],F>16,i>>16,s.A.gw,r,I,0,0,O,L,k,R,x,D,o>>8,l>>8),t+=W,i+=P,o+=G,l+=U,r+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.Dv(e>>16,i>>16,s.A.gw,r,I,0,0,O,L,k,R,x,D,a>>8,l>>8),e+=F,i+=P,a+=B,l+=U,r+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}else for(;;){if(--n<0)for(;;){if(--h<0)return;this.Dv(i>>16,t>>16,s.A.gw,r,I,0,0,O,L,k,R,x,D,l>>8,o>>8),t+=W,i+=P,o+=G,l+=U,r+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.Dv(i>>16,e>>16,s.A.gw,r,I,0,0,O,L,k,R,x,D,l>>8,a>>8),e+=F,i+=P,a+=B,l+=U,r+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}}}else if(hs.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,s.A.gw,h,I,0,0,O,L,k,R,x,D,l>>8,o>>8),i+=P,t+=F,l+=U,o+=B,h+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.Dv(i>>16,e>>16,s.A.gw,h,I,0,0,O,L,k,R,x,D,l>>8,a>>8),i+=P,e+=W,l+=U,a+=G,h+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}else for(;;){if(--n<0)for(;;){if(--r<0)return;this.Dv(t>>16,i>>16,s.A.gw,h,I,0,0,O,L,k,R,x,D,o>>8,l>>8),i+=P,t+=F,l+=U,o+=B,h+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.Dv(e>>16,i>>16,s.A.gw,h,I,0,0,O,L,k,R,x,D,a>>8,l>>8),i+=P,e+=W,l+=U,a+=G,h+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}}else{t=e<<=16,o=a<<=16,h<0&&(t-=P*h,e-=W*h,o-=U*h,a-=G*h,h=0),i<<=16,l<<=16,r<0&&(i-=F*r,l-=B*r,r=0);const c=h-this.Aa;if(O+=S*c,L+=M*c,k+=N*c,O|=0,L|=0,k|=0,n-=r,r-=h,h=this.mw[h],P>16,e>>16,s.A.gw,h,I,0,0,O,L,k,R,x,D,l>>8,a>>8),i+=F,e+=W,l+=B,a+=G,h+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.Dv(t>>16,e>>16,s.A.gw,h,I,0,0,O,L,k,R,x,D,o>>8,a>>8),t+=P,e+=W,o+=U,a+=G,h+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}else for(;;){if(--r<0)for(;;){if(--n<0)return;this.Dv(e>>16,i>>16,s.A.gw,h,I,0,0,O,L,k,R,x,D,a>>8,l>>8),i+=F,e+=W,l+=B,a+=G,h+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.Dv(e>>16,t>>16,s.A.gw,h,I,0,0,O,L,k,R,x,D,a>>8,o>>8),t+=P,e+=W,o+=U,a+=G,h+=s.A.Iw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}}};static Dv=(t,i,e,n,r,h,o,l,a,c,f,u,d,w,y)=>{if(t>=i)return;let p,A,m,g,I,_,C,E,v;if(this.DI){if(p=(y-w)/(i-t)|0,i>s.A.NI&&(i=s.A.NI),t<0&&(w-=t*p,t=0),t>=i)return;A=i-t>>3,p<<=12}else i-t>7?(A=i-t>>3,p=(y-w)*this.cv[A]>>6):(A=0,p=0);if(w<<=9,n+=t,this.lt&&r)if(m=0,g=0,_=t-this.pa,l+=(f>>3)*_,a+=(u>>3)*_,c+=(d>>3)*_,l|=0,a|=0,I=(c|=0)>>12,0!==I&&(o=a/I|0,(h=l/I|0)<0?h=0:h>4032&&(h=4032)),l+=f,a+=u,c+=d,l|=0,a|=0,I=(c|=0)>>12,0!==I&&(m=l/I|0,g=a/I|0,m<7?m=7:m>4032&&(m=4032)),C=m-h>>3,E=g-o>>3,h+=w>>3&786432,v=w>>23,this.gv){for(;A-- >0;)e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h=m,o=g,l+=f,a+=u,I=(c+=d)>>12,0!==I&&(m=l/I|0,g=a/I|0,m<7?m=7:m>4032&&(m=4032)),C=m-h>>3,E=g-o>>3,h+=(w+=p)>>3&786432,v=w>>23;for(A=i-t&7;A-- >0;)e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E}else{for(;A-- >0;){let t;0!=(t=r[(4032&o)+(h>>6)]>>>v)&&(e[n]=t),n+=1,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n+=1,h=m,o=g,l+=f,a+=u,c+=d,l|=0,a|=0,I=(c|=0)>>12,0!==I&&(m=l/I|0,g=a/I|0,m<7?m=7:m>4032&&(m=4032)),C=m-h>>3,E=g-o>>3,h+=(w+=p)>>3&786432,v=w>>23}for(A=i-t&7;A-- >0;){let t;0!=(t=r[(4032&o)+(h>>6)]>>>v)&&(e[n]=t),n++,h+=C,o+=E}}else if(m=0,g=0,_=t-this.pa,l+=(f>>3)*_,a+=(u>>3)*_,c+=(d>>3)*_,l|=0,a|=0,I=(c|=0)>>14,0!==I&&(o=a/I|0,(h=l/I|0)<0?h=0:h>16256&&(h=16256)),l+=f,a+=u,c+=d,l|=0,a|=0,I=(c|=0)>>14,0!==I&&(m=l/I|0,g=a/I|0,m<7?m=7:m>16256&&(m=16256)),C=m-h>>3,E=g-o>>3,h+=6291456&w,v=w>>23,this.gv&&r){for(;A-- >0;)e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h=m,o=g,l+=f,a+=u,c+=d,l|=0,a|=0,I=(c|=0)>>14,0!==I&&(m=l/I|0,g=a/I|0,m<7?m=7:m>16256&&(m=16256)),C=m-h>>3,E=g-o>>3,h+=6291456&(w+=p),v=w>>23;for(A=i-t&7;A-- >0;)e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E}else{for(;A-- >0&&r;){let t;0!=(t=r[(16256&o)+(h>>7)]>>>v)&&(e[n]=t),n+=1,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,h=m,o=g,l+=f,a+=u,c+=d,l|=0,a|=0,I=(c|=0)>>14,0!==I&&(m=l/I|0,g=a/I|0,m<7?m=7:m>16256&&(m=16256)),C=m-h>>3,E=g-o>>3,h+=6291456&(w+=p),v=w>>23}for(A=i-t&7;A-- >0&&r;){let t;0!=(t=r[(16256&o)+(h>>7)]>>>v)&&(e[n]=t),n++,h+=C,o+=E}}};static Mv=(t,i,e,n,r)=>{if(this.DI&&(i>s.A.NI&&(i=s.A.NI),t<0&&(t=0)),t>=i)return;n+=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;e[n++]=r}e[n++]=r,e[n++]=r,e[n++]=r,e[n++]=r}const o=this.alpha,l=256-this.alpha;for(r=((16711935&r)*l>>8&16711935)+((65280&r)*l>>8&65280);;){if(h--,h<0)for(h=i-t&3;;){if(h--,h<0)return;e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280)}e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280),e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280),e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280),e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280)}};static Rv=t=>{this.yv[t]&&this.wv&&(this.wv[this.pv++]=this.yv[t],this.yv[t]=null)};static kv=t=>{if(this.Av[t]=this.xA++,this.yv[t])return this.yv[t];let i;if(this.pv>0&&this.wv)i=this.wv[--this.pv],this.wv[this.pv]=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.gw[(n>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)i[t]=s[e.gw[t]];this.Iv[t]=!1;for(let e=0;e<16384;e++){i[e]&=16316671;const s=i[e];0===s&&(this.Iv[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}}},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{Bd=0;dI=0;Nv=0;Fv=-1;Bv=-1;Pv=-1;Uv=-1;Wv=-1;Gv=-1;Yv=-1;Hv=-1;Vv=-1;Kv=0;Xv=-1;jv=-1;zv=-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 Zv=null;static qv=null;static Jv=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 axis=null;static ob=new l.Ae(4096,!1);static lb=new l.Ae(4096,!1);static ab=new Int32Array(4096);static cb=new Int32Array(4096);static fb=new Int32Array(4096);static ub=new Int32Array(4096);static wb=new Int32Array(4096);static yb=new Int32Array(4096);static pb=new Int32Array(1500);static Ab=new l.$r(1500,512);static mb=new Int32Array(12);static gb=new l.$r(12,2e3);static Ib=new Int32Array(2e3);static _b=new Int32Array(2e3);static Cb=new Int32Array(12);static Eb=new Int32Array(10);static vb=new Int32Array(10);static bb=new Int32Array(10);static Tr=0;static Tb=0;static Or=0;static Ob=!1;static Vl=0;static Kl=0;static Rb=0;static Sb=new Int32Array(1e3);static Lb=!1;static pu(t){try{f.head=new s.A(t.read('ob_head.dat')),f.Zv=new s.A(t.read('ob_face1.dat')),f.qv=new s.A(t.read('ob_face2.dat')),f.Jv=new s.A(t.read('ob_face3.dat')),f.$v=new s.A(t.read('ob_face4.dat')),f.Qv=new s.A(t.read('ob_face5.dat')),f.tb=new s.A(t.read('ob_point1.dat')),f.ib=new s.A(t.read('ob_point2.dat')),f.eb=new s.A(t.read('ob_point3.dat')),f.sb=new s.A(t.read('ob_point4.dat')),f.nb=new s.A(t.read('ob_point5.dat')),f.rb=new s.A(t.read('ob_vertex1.dat')),f.hb=new s.A(t.read('ob_vertex2.dat')),f.axis=new s.A(t.read('ob_axis.dat')),f.head.gf=0,f.tb.gf=0,f.ib.gf=0,f.eb.gf=0,f.sb.gf=0,f.rb.gf=0,f.hb.gf=0;const i=f.head.Au;f.metadata=new l.Ae(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.Bd,n=t.dI,r=t.Nv;let h,o,a,u,d;if(i){h=new Int32Array(s);for(let i=0;i{const n=t.Bd,r=t.dI,h=t.Nv;let o,l,a,c,u;if(s)o=t.Pd,l=t.Wd,a=t.Ud;else{o=new Int32Array(n),l=new Int32Array(n),a=new Int32Array(n);for(let i=0;i{const e=t.Bd,s=t.dI,n=t.Nv,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.Pd[i],a=t.Wd[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.Zv&&f.qv&&f.Jv&&f.$v&&f.Qv&&f.tb&&f.ib&&f.eb&&f.sb&&f.nb&&f.rb&&f.hb&&f.axis))throw new Error('cant loading model!!!!!');const e=i.Bd,s=i.dI,n=i.Nv,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.Wv>=0&&(y=new Int32Array(e));let p=null;i.Vv>=0&&(p=new Int32Array(s));let A=null,m=0;i.Kv>=0?A=new Int32Array(s):m=-i.Kv-1;let g=null;i.Xv>=0&&(g=new Int32Array(s));let I=null;i.jv>=0&&(I=new Int32Array(s));const _=new Int32Array(s);f.tb.gf=i.Fv,f.ib.gf=i.Bv,f.eb.gf=i.Pv,f.sb.gf=i.Uv,f.nb.gf=i.Wv;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 e=f.metadata[i];if(e.data=t,!e.data.length)throw new Error('No model data');const n=e.Bd,r=e.dI,h=e.Nv,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),p=new Int32Array(h);let A=null;e.Wv>=0&&(A=new Int32Array(n));let m=null;e.Vv>=0&&(m=new Int32Array(r));let g=null,I=0;e.Kv>=0?g=new Int32Array(r):I=-e.Kv-1;let _=null;e.Xv>=0&&(_=new Int32Array(r));let C=null;e.jv>=0&&(C=new Int32Array(r));const E=new Int32Array(r),v=new s.A(e.data);v.gf=e.Fv;const b=new s.A(e.data);b.gf=e.Bv;const T=new s.A(e.data);T.gf=e.Pv;const O=new s.A(e.data);O.gf=e.Uv;const R=new s.A(e.data);R.gf=e.Wv;let S,L,x,M=0,k=0,D=0;for(let t=0;tthis.zd&&(this.zd=-e),e>this.PA&&(this.PA=e);const n=i*i+s*s;n>this._A&&(this._A=n)}this._A=Math.sqrt(this._A)+.99|0,this.Yb=Math.sqrt(this._A*this._A+this.zd*this.zd)+.99|0,this.Gb=this.Yb+(Math.sqrt(this._A*this._A+this.PA*this.PA)+.99|0)}Gd(){this.zd=0,this.PA=0;for(let t=0;tthis.zd&&(this.zd=-i),i>this.PA&&(this.PA=i)}this.Yb=Math.sqrt(this._A*this._A+this.zd*this.zd)+.99|0,this.Gb=this.Yb+(Math.sqrt(this._A*this._A+this.PA*this.PA)+.99|0)}Ya(){if(this.Hb){const t=new Int32Array(256);let i=0;for(let e=0;ei&&(i=s)}this.Kd=new l.Ae(i+1,null);for(let e=0;e<=i;e++)this.Kd[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;ei&&(i=s)}this.Vd=new l.Ae(i+1,null);for(let e=0;e<=i;e++)this.Vd[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.zb(s.x[t],s.y[t],s.z[t],r.labels[i],r.types[i])}f.Tr=0,f.Tb=0,f.Or=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.zb(n.x[t],n.y[t],n.z[t],r.labels[i],r.types[i])}}else this.Ha(t)}Ha(t){if(!this.Kd||-1===t||!h.A.Bo[t])return;const i=h.A.Bo[t],e=i.FE;f.Tr=0,f.Tb=0,f.Or=0;for(let t=0;t>16;this.Ud[t]=this.Wd[t]*i+this.Ud[t]*e>>16,this.Wd[t]=s}}translate(t,i,e){for(let s=0;s>8;if(this.kb&&this.Db&&this.Nb||(this.kb=new Int32Array(this.dI),this.Db=new Int32Array(this.dI),this.Nb=new Int32Array(this.dI)),!this.hI){this.hI=new l.Ae(this.Bd,null);for(let t=0;t8192||A>8192||m>8192||p<-8192||A<-8192||m<-8192;)p>>=1,A>>=1,m>>=1;let g=0|Math.sqrt(p*p+A*A+m*m);if(g<=0&&(g=1),p=256*p/g|0,A=256*A/g|0,m=256*m/g|0,this.uI&&1&this.uI[i]){const r=t+((e*p+s*A+n*m)/(h+(h/2|0))|0);this.ku&&(this.kb[i]=f.Mb(this.ku[i],r,this.uI[i]))}else{let t=this.hI[r];t&&(t.x+=p,t.y+=A,t.z+=m,t.w++),t=this.hI[o],t&&(t.x+=p,t.y+=A,t.z+=m,t.w++),t=this.hI[l],t&&(t.x+=p,t.y+=A,t.z+=m,t.w++)}}if(r)this.aI(t,h,e,s,n);else{this.fI=new l.Ae(this.Bd,null);for(let t=0;t>16;for(let s=0;s>16,I=I*w-g*d>>16,g=m),0!==t&&(m=I*a-_*l>>16,_=I*l+_*a>>16,I=m),0!==i&&(m=_*c+g*u>>16,_=_*u-g*c>>16,g=m),g+=n,I+=h,_+=o,m=I*p-_*y>>16,_=I*y+_*p>>16,I=m,f.ab&&f.cb&&f.fb&&(f.fb[s]=_-A,f.ab[s]=r.A.pa+((g<<9)/_|0),f.cb[s]=r.A.Aa+((I<<9)/_|0)),this.Nv>0&&f.ub&&f.wb&&f.yb&&(f.ub[s]=g,f.wb[s]=I,f.yb[s]=_)}try{this.Jb(!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._A*e>>16,y=d+w;if(y<=50||d>=3500)return;const p=a*s+o*h>>16;let A=p-this._A<<9;if((A/y|0)>=n.A.sv)return;let m=p+this._A<<9;if((m/y|0)<=-n.A.sv)return;const g=l*e-u*i>>16,I=this._A*i>>16;let _=g+I<<9;if((_/y|0)<=-n.A.nv)return;let C=g-(I+(this.zd*e>>16))<<9;if((C/y|0)>=n.A.nv)return;let E=d-(w+(this.zd*i>>16))<=50,v=!1;if(c>0&&f.Ob){let t=d-w;t<=50&&(t=50),p>0?(A=A/y|0,m=m/t|0):(m=m/y|0,A=A/t|0),g>0?(C=C/y|0,_=_/t|0):(_=_/y|0,C=C/t|0);const i=f.Vl-r.A.pa,e=f.Kl-r.A.Aa;i>A&&iC&&e<_&&(this.lw?f.Sb[f.Rb++]=c:v=!0)}const b=r.A.pa,T=r.A.Aa;let O=0,R=0;0!==t&&(O=r.A.sin[t],R=r.A.cos[t]);for(let n=0;n>16,w=w*R-c*O>>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.fb&&(f.fb[n]=w-d),w>=50&&f.ab&&f.cb?(f.ab[n]=b+((c<<9)/w|0),f.cb[n]=T+((u<<9)/w|0)):f.ab&&(f.ab[n]=-5e3,E=!0),(E||this.Nv>0)&&f.ub&&f.wb&&f.yb&&(f.ub[n]=c,f.wb[n]=u,f.yb[n]=w)}try{this.Jb(E,v,c)}catch(t){}}Jb(t,i,e,s=!1){f.Lb&&(this.Xb=-1,this.jb=-1);for(let t=0;tn.A.NI||a>n.A.NI||c>n.A.NI),f.Ab&&f.pb){const t=((y+p+A)/3|0)+this.Yb;f.Ab[t][f.pb[t]++]=s,f.Lb&&this.$b(f.Vl,f.Kl,u,d,w,l,a,c)&&this.jb=0;t--){const i=f.pb[t];if(!(i<=0)&&f.Ab){const e=f.Ab[t];for(let t=0;t=0;t--){const i=f.pb[t];if(i>0&&f.Ab){const e=f.Ab[t];for(let s=0;s0||f.mb[2]>0)&&(r=(f.Cb[1]+f.Cb[2])/(f.mb[1]+f.mb[2])|0);let h=0;f.mb&&f.Cb&&(f.mb[3]>0||f.mb[4]>0)&&(h=(f.Cb[3]+f.Cb[4])/(f.mb[3]+f.mb[4])|0);let o=0;if(f.mb&&f.Cb&&(f.mb[6]>0||f.mb[8]>0)&&(o=(f.Cb[6]+f.Cb[8])/(f.mb[6]+f.mb[8])|0),f.mb&&f.gb){let t,i=0,e=f.mb[10],n=f.gb[10],l=f.Ib;i===e&&(i=0,e=f.mb[11],n=f.gb[11],l=f._b),t=ir;)try{this.Qb(n[i++],s),i===e&&n!==f.gb[11]&&(i=0,e=f.mb[11],n=f.gb[11],l=f._b),t=ih;)try{this.Qb(n[i++],s),i===e&&n!==f.gb[11]&&(i=0,e=f.mb[11],n=f.gb[11],l=f._b),t=io;)try{this.Qb(n[i++],s),i===e&&n!==f.gb[11]&&(i=0,e=f.mb[11],n=f.gb[11],l=f._b),t=i>2,h=this.Pb[i],o=this.Ub[i],l=this.Wb[i];r.A.WI(f.ab[e],f.ab[s],f.ab[n],f.cb[e],f.cb[s],f.cb[n],this.kb[t],this.Db[t],this.Nb[t],f.ub[h],f.wb[h],f.yb[h],f.ub[o],f.ub[l],f.wb[o],f.wb[l],f.yb[o],f.yb[l],this.ku[t])}else if(3===h&&this.uI&&this.ku&&this.kb&&f.ab&&f.cb&&f.ub&&f.wb&&f.yb){const i=this.uI[t]>>2,h=this.Pb[i],o=this.Ub[i],l=this.Wb[i];r.A.WI(f.ab[e],f.ab[s],f.ab[n],f.cb[e],f.cb[s],f.cb[n],this.kb[t],this.kb[t],this.kb[t],f.ub[h],f.wb[h],f.yb[h],f.ub[o],f.ub[l],f.wb[o],f.wb[l],f.yb[o],f.yb[l],this.ku[t])}}tT(t,i=!1){let e=0;if(f.yb){const i=r.A.pa,s=r.A.Aa,n=this.wI[t],h=this.yI[t],o=this.pI[t],l=f.yb[n],a=f.yb[h],c=f.yb[o];if(l>=50&&f.ab&&f.cb&&this.kb)f.Eb[e]=f.ab[n],f.vb[e]=f.cb[n],f.bb[e++]=this.kb[t];else if(f.ub&&f.wb&&this.kb){const u=f.ub[n],d=f.wb[n],w=this.kb[t];if(c>=50&&this.Nb){const n=(50-l)*r.A.fv[c-l];f.Eb[e]=i+((u+((f.ub[o]-u)*n>>16)<<9)/50|0),f.vb[e]=s+((d+((f.wb[o]-d)*n>>16)<<9)/50|0),f.bb[e++]=w+((this.Nb[t]-w)*n>>16)}if(a>=50&&this.Db){const n=(50-l)*r.A.fv[a-l];f.Eb[e]=i+((u+((f.ub[h]-u)*n>>16)<<9)/50|0),f.vb[e]=s+((d+((f.wb[h]-d)*n>>16)<<9)/50|0),f.bb[e++]=w+((this.Db[t]-w)*n>>16)}}if(a>=50&&f.ab&&f.cb&&this.Db)f.Eb[e]=f.ab[h],f.vb[e]=f.cb[h],f.bb[e++]=this.Db[t];else if(f.ub&&f.wb&&this.Db){const u=f.ub[h],d=f.wb[h],w=this.Db[t];if(l>=50&&this.kb){const h=(50-a)*r.A.fv[l-a];f.Eb[e]=i+((u+((f.ub[n]-u)*h>>16)<<9)/50|0),f.vb[e]=s+((d+((f.wb[n]-d)*h>>16)<<9)/50|0),f.bb[e++]=w+((this.kb[t]-w)*h>>16)}if(c>=50&&this.Nb){const n=(50-a)*r.A.fv[c-a];f.Eb[e]=i+((u+((f.ub[o]-u)*n>>16)<<9)/50|0),f.vb[e]=s+((d+((f.wb[o]-d)*n>>16)<<9)/50|0),f.bb[e++]=w+((this.Nb[t]-w)*n>>16)}}if(c>=50&&f.ab&&f.cb&&this.Nb)f.Eb[e]=f.ab[o],f.vb[e]=f.cb[o],f.bb[e++]=this.Nb[t];else if(f.ub&&f.wb&&this.Nb){const u=f.ub[o],d=f.wb[o],w=this.Nb[t];if(a>=50&&this.Db){const n=(50-c)*r.A.fv[a-c];f.Eb[e]=i+((u+((f.ub[h]-u)*n>>16)<<9)/50|0),f.vb[e]=s+((d+((f.wb[h]-d)*n>>16)<<9)/50|0),f.bb[e++]=w+((this.Db[t]-w)*n>>16)}if(l>=50&&this.kb){const h=(50-c)*r.A.fv[l-c];f.Eb[e]=i+((u+((f.ub[n]-u)*h>>16)<<9)/50|0),f.vb[e]=s+((d+((f.wb[n]-d)*h>>16)<<9)/50|0),f.bb[e++]=w+((this.kb[t]-w)*h>>16)}}}const s=f.Eb[0],h=f.Eb[1],o=f.Eb[2],l=f.vb[0],a=f.vb[1],c=f.vb[2];if(!((s-h)*(c-a)-(l-a)*(o-h)<=0))if(r.A.DI=!1,3===e){let e;if((s<0||h<0||o<0||s>n.A.NI||h>n.A.NI||o>n.A.NI)&&(r.A.DI=!0),e=this.uI?3&this.uI[t]:0,i)r.A.hv(s,h,l,a,f.bb[0]),r.A.hv(h,o,a,c,f.bb[1]),r.A.hv(o,s,c,l,f.bb[2]);else if(0===e)r.A.BI(s,h,o,l,a,c,f.bb[0],f.bb[1],f.bb[2]);else if(1===e&&this.kb)r.A.xv(s,h,o,l,a,c,r.A.palette[this.kb[t]]);else if(2===e&&this.uI&&this.ku&&f.ub&&f.wb&&f.yb){const i=this.uI[t]>>2,e=this.Pb[i],n=this.Ub[i],u=this.Wb[i];r.A.WI(s,h,o,l,a,c,f.bb[0],f.bb[1],f.bb[2],f.ub[e],f.wb[e],f.yb[e],f.ub[n],f.ub[u],f.wb[n],f.wb[u],f.yb[n],f.yb[u],this.ku[t])}else if(3===e&&this.uI&&this.ku&&this.kb&&f.ub&&f.wb&&f.yb){const i=this.uI[t]>>2,e=this.Pb[i],n=this.Ub[i],u=this.Wb[i];r.A.WI(s,h,o,l,a,c,this.kb[t],this.kb[t],this.kb[t],f.ub[e],f.wb[e],f.yb[e],f.ub[n],f.ub[u],f.wb[n],f.wb[u],f.yb[n],f.yb[u],this.ku[t])}}else if(4===e){let e;if((s<0||h<0||o<0||s>n.A.NI||h>n.A.NI||o>n.A.NI||f.Eb[3]<0||f.Eb[3]>n.A.NI)&&(r.A.DI=!0),e=this.uI?3&this.uI[t]:0,i)r.A.hv(s,h,l,a,f.bb[0]),r.A.hv(h,o,a,c,f.bb[1]),r.A.hv(o,f.Eb[3],c,f.vb[3],f.bb[2]),r.A.hv(f.Eb[3],s,f.vb[3],l,f.bb[3]);else if(0===e)r.A.BI(s,h,o,l,a,c,f.bb[0],f.bb[1],f.bb[2]),r.A.BI(s,o,f.Eb[3],l,c,f.vb[3],f.bb[0],f.bb[2],f.bb[3]);else if(1===e){if(this.kb){const i=r.A.palette[this.kb[t]];r.A.xv(s,h,o,l,a,c,i),r.A.xv(s,o,f.Eb[3],l,c,f.vb[3],i)}}else if(2===e&&this.uI&&this.ku&&f.ub&&f.wb&&f.yb){const i=this.uI[t]>>2,e=this.Pb[i],n=this.Ub[i],u=this.Wb[i];r.A.WI(s,h,o,l,a,c,f.bb[0],f.bb[1],f.bb[2],f.ub[e],f.wb[e],f.yb[e],f.ub[n],f.ub[u],f.wb[n],f.wb[u],f.yb[n],f.yb[u],this.ku[t]),r.A.WI(s,o,f.Eb[3],l,c,f.vb[3],f.bb[0],f.bb[2],f.bb[3],f.ub[e],f.wb[e],f.yb[e],f.ub[n],f.ub[u],f.wb[n],f.wb[u],f.yb[n],f.yb[u],this.ku[t])}else if(3===e&&this.uI&&this.ku&&this.kb&&f.ub&&f.wb&&f.yb){const i=this.uI[t]>>2,e=this.Pb[i],n=this.Ub[i],u=this.Wb[i];r.A.WI(s,h,o,l,a,c,this.kb[t],this.kb[t],this.kb[t],f.ub[e],f.wb[e],f.yb[e],f.ub[n],f.ub[u],f.wb[n],f.wb[u],f.yb[n],f.yb[u],this.ku[t]),r.A.WI(s,o,f.Eb[3],l,c,f.vb[3],this.kb[t],this.kb[t],this.kb[t],f.ub[e],f.wb[e],f.yb[e],f.ub[n],f.ub[u],f.wb[n],f.wb[u],f.yb[n],f.yb[u],this.ku[t])}}}zb(t,i,e,s,n){if(!s)return;const h=s.length;if(0===n){let n=0;f.Tr=0,f.Tb=0,f.Or=0;for(let t=0;t0?(f.Tr=(f.Tr/n|0)+t,f.Tb=(f.Tb/n|0)+i,f.Or=(f.Or/n|0)+e):(f.Tr=t,f.Tb=i,f.Or=e)}else if(1===n)for(let n=0;n=this.Kd.length)continue;const h=this.Kd[r];if(h)for(let s=0;s=this.Kd.length)continue;const o=this.Kd[h];if(o)for(let s=0;s>16;this.Wd[n]=this.Wd[n]*u-this.Pd[n]*c>>16,this.Pd[n]=t}if(0!==h){c=r.A.sin[h],u=r.A.cos[h];const t=this.Wd[n]*u-this.Ud[n]*c>>16;this.Ud[n]=this.Wd[n]*c+this.Ud[n]*u>>16,this.Wd[n]=t}if(0!==l){c=r.A.sin[l],u=r.A.cos[l];const t=this.Ud[n]*c+this.Pd[n]*u>>16;this.Ud[n]=this.Ud[n]*u-this.Pd[n]*c>>16,this.Pd[n]=t}this.Pd[n]+=f.Tr,this.Wd[n]+=f.Tb,this.Ud[n]+=f.Or}}else if(3===n)for(let n=0;n=this.Kd.length)continue;const h=this.Kd[r];if(h)for(let s=0;s=this.Vd.length)continue;const n=this.Vd[e];if(n)for(let i=0;i255&&(this.Bb[e]=255)}}}qb(){this.zd=0,this._A=0,this.PA=0,this.DA=999999,this.NA=-999999,this.BA=-99999,this.FA=99999;for(let t=0;tthis.NA&&(this.NA=i),sthis.BA&&(this.BA=s),-e>this.zd&&(this.zd=-e),e>this.PA&&(this.PA=e);const n=i*i+s*s;n>this._A&&(this._A=n)}this._A=0|Math.sqrt(this._A),this.Yb=0|Math.sqrt(this._A*this._A+this.zd*this.zd),this.Gb=this.Yb+(0|Math.sqrt(this._A*this._A+this.PA*this.PA))}$b(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(7854);class o extends r.A{gw;width;height;eT;sT;jl;ww;constructor(t,i){super(),this.gw=new Int32Array(t*i),this.width=this.jl=t,this.height=this.ww=i,this.eT=this.sT=0}static nT=async(t,i)=>{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(h.WE.src),h.WE.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>h.WE.onload=()=>t())),h.UE.clearRect(0,0,h.GE.width,h.GE.height);const i=h.WE.naturalWidth,e=h.WE.naturalHeight;return h.GE.width=i,h.GE.height=e,h.UE.drawImage(h.WE,0,0),h.UE.getImageData(0,0,i,e)})(e),n=new o(s.width,s.height),r=new Uint32Array(s.data.buffer),l=n.gw;for(let t=0;t>24&255)<<24|(255&i)<<16|(i>>8&255)<<8|i>>16&255}return n};static Mu=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.gf=s.Au;const h=r.Au,l=r.Au,a=[],c=r.gu-1;for(let t=0;ts.length||r.gf>r.length)throw new Error;const f=r.gu,u=r.gu,d=r.Au,w=r.Au,y=new o(d,w);y.eT=f,y.sT=u,y.jl=h,y.ww=l;const p=r.gu;if(0===p){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.rT(h,r,this.gw,n,l,s.A.gw,e,o)}Xl(t,i,e){i|=0,e|=0;let n=(i+=this.eT)+(e+=this.sT)*s.A.Iw,r=0,h=this.height,o=this.width,l=s.A.Iw-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.hT(o,h,this.gw,r,a,s.A.gw,n,l,t)}oT(t,i){t|=0,i|=0;let e=(t+=this.eT)+(i+=this.sT)*s.A.Iw,n=0,r=this.height,h=this.width,o=s.A.Iw-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.lT(h,r,this.gw,n,l,s.A.gw,e,o)}aT(){const t=this.gw,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.gw[s]=(r<<16)+(h<<8)+o}}}Mw(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.jl,a=this.ww,c=(l<<16)/e|0,f=(a<<16)/n|0;t+=(this.eT*e+l-1)/l|0,i+=(this.sT*n+a-1)/a|0,this.eT*e%l!=0&&(h=(l-this.eT*e%l<<16)/e|0),this.sT*n%a!=0&&(o=(a-this.sT*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.Iw,d=s.A.Iw-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.gw,h,o,s.A.gw,d,u,r,c,f)}catch(t){console.error('error in sprite clipping routine')}}fT(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,p=w*c>>8;let A=(o<<16)+u*y+f*p,m=u*p-f*y+(l<<16),g=t+i*s.A.Iw;for(let t=0;t>16)+(o>>16)*this.width],n+=p,o-=y;A+=y,m+=p,g+=s.A.Iw}}catch(t){}}uT(t,i,e){t|=0,i|=0;let n=(t+=this.eT)+(i+=this.sT)*s.A.Iw,r=0,h=this.height,o=this.width,l=s.A.Iw-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.dT(o,h,this.gw,a,r,s.A.gw,n,l,e.gw)}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')}}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++)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}}hT(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}}rT(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}}dT(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{gw;width;height;eT;sT;jl;ww;palette;constructor(t,i,e){super(),this.gw=new Int8Array(t*i),this.width=this.jl=t,this.height=this.ww=i,this.eT=this.sT=0,this.palette=e}static Mu=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.gf=s.Au;const o=r.Au,l=r.Au,a=r.gu,c=new Int32Array(a);for(let t=1;ts.length||r.gf>r.length)throw new Error;const f=r.gu,u=r.gu,d=r.Au,w=r.Au,y=new h(d,w,c);y.eT=f,y.sT=u,y.jl=o,y.ww=l;const p=y.gw,A=r.gu;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.wT(h,r,this.gw,n,l,s.A.gw,e,o)}aT(){const t=this.gw,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}}bv(){this.jl|=0,this.ww|=0,this.jl/=2,this.ww/=2,this.jl|=0,this.ww|=0;const t=new Int8Array(this.jl*this.ww);let i=0;for(let e=0;e>1)+(e+this.sT>>1)*this.jl]=this.gw[i++];this.gw=t,this.width=this.jl,this.height=this.ww,this.eT=0,this.sT=0}Mw(){if(this.width===this.jl&&this.height===this.ww)return;const t=new Int8Array(this.jl*this.ww);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.jl,a=this.ww,c=(l<<16)/e|0,f=(a<<16)/n|0;t=t+(this.eT*e+l-1)/l|0,i=i+(this.sT*n+a-1)/a|0,this.eT*e%l!=0&&(h=(l-this.eT*e%l<<16)/e|0),this.sT*n%a!=0&&(o=(a-this.sT*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.Iw,w=s.A.Iw-e;is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right&&(u=t+e-s.A.right,e-=u,w+=u),this.yT(s.A.gw,this.gw,this.palette,h,o,d,w,e,n,c,f,r)}catch(t){console.log('error in sprite clipping routine')}}yT(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}pT(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 l extends r.A{static mT='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!"£$%^&*()-_=+[{]};:\'@#~,<.>/?\\| ';static gT=[];static{const t=navigator.userAgent.includes('Capacitor');for(let i=0;i<256;i++){let e=l.mT.indexOf(String.fromCharCode(i));t&&e>=63&&e--,-1===e&&(e=74),l.gT[i]=e}}IT=[];_T=new Int32Array(94);CT=new Int32Array(94);ET=new Int32Array(94);vT=new Int32Array(94);bT=new Int32Array(95);TT=new Int32Array(256);random=new h(BigInt(Date.now()));height=0;static Mu=(t,i)=>{const e=new n.A(t.read(i+'.dat')),s=new n.A(t.read('index.dat'));s.gf=e.Au+4;const r=s.gu;r>0&&(s.gf+=3*(r-1));const h=new l;for(let t=0;t<94;t++){h.ET[t]=s.gu,h.vT[t]=s.gu;const i=h._T[t]=s.Au,n=h.CT[t]=s.Au,r=s.gu,o=i*n;if(h.IT[t]=new Int8Array(o),0===r)for(let s=0;sh.height&&(h.height=n),h.ET[t]=1,h.bT[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.NT(n,r,t,c,a,s.A.gw,o,l,h)}MT(t,i,e,n,r,h,o){e|=0,n|=0;let l=(t|=0)+(i|=0)*s.A.Iw,a=s.A.Iw-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.FT(e,n,s.A.gw,l,a,o,f,c,r,h)}NT(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}}FT(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}}RT(t){return'red'===t?o.A.RED:'gre'===t?o.A.GREEN:'blu'===t?o.A.BLUE:'yel'===t?o.A.Jl:'cya'===t?o.A.YE:'mag'===t?o.A.uA:'whi'===t?o.A.xl:'bla'===t?o.A.ql:'lre'===t?o.A.HE:'dre'===t?o.A.VE:'dbl'===t?o.A.KE:'or1'===t?o.A.XE:'or2'===t?o.A.jE:'or3'===t?o.A.zE:'gr1'===t?o.A.ZE:'gr2'===t?o.A.qE:'gr3'===t?o.A.JE:o.A.ql}split(t,i){if(0===t.length)return[t];const e=[];for(;t.length>0;){if(this.ST(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{BT;width;height;PT;UT;gw;constructor(t,i,e=n.rl){this.PT=e,this.BT=this.PT.getImageData(0,0,t,i),this.UT=new Uint32Array(this.BT.data.buffer),this.gw=new Int32Array(t*i),this.width=t,this.height=i,this.bind()}clear(){this.gw.fill(0)}bind(){s.A.bind(this.gw,this.width,this.height)}draw(t,i){this.#t(),this.PT.putImageData(this.BT,t,i)}#t(){const t=this.gw.length,i=this.gw,e=this.UT;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)}}));Zo=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)}}));tl=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!')};WT=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(4702);class r{static WT=t=>{let i=0;t=t.toUpperCase();for(let e=0;e=this.YT)return null;if(this.jT[t])return this.jT[t];const i=this.XT[t],e=i+this.KT[t];if(this.GT){const s=Uint8Array.from(this.buffer.subarray(i,i+e));return this.jT[t]=s,s}{const i=Uint8Array.from(n.A.read(this.VT[t],this.buffer,this.KT[t],this.XT[t]));return this.jT[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 ZT=3988292384;static qT=new Int32Array(256);static JT=new Uint32Array(33);static $T=new n.A;static QT=new n.A;static tO=new n.A;static iO=0;static eO=0;static sO=0;static{for(let t=0;t<32;t++)h.JT[t]=(1<>>=1:i=i>>>1^h.ZT;h.qT[t]=i}}static qo=t=>{let i=4294967295;for(let e=0;e>>8^h.qT[255&(i^t[e])];return~i};view;data;gf=0;nO=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 Vt=t=>{let i=null;return 0===t&&h.iO>0?(h.iO--,i=h.$T.vI()):1===t&&h.eO>0?(h.eO--,i=h.QT.vI()):2===t&&h.sO>0&&(h.sO--,i=h.tO.vI()),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.iO<1e3?(h.$T.Yp(this),h.iO++):5e3===this.view.byteLength&&h.eO<250?(h.QT.Yp(this),h.eO++):3e4===this.view.byteLength&&h.sO<50&&(h.tO.Yp(this),h.sO++)}get gu(){return this.view.getUint8(this.gf++)}get Nd(){return this.view.getInt8(this.gf++)}get Au(){const t=this.view.getUint16(this.gf);return this.gf+=2,t}get _u(){const t=this.view.getInt16(this.gf);return this.gf+=2,t}get Ju(){const t=this.view.getUint8(this.gf++)<<16|this.view.getUint16(this.gf);return this.gf+=2,t}get el(){const t=this.view.getInt32(this.gf);return this.gf+=4,t}get dE(){const t=this.view.getBigInt64(this.gf);return this.gf+=8,t}get BE(){return this.view.getUint8(this.gf)<128?this.gu-64:this.Au-49152}get IA(){return this.view.getUint8(this.gf)<128?this.gu:this.Au-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}lO(t){this.view.setInt32(this.gf,t,!0),this.gf+=4}aO(t){this.view.setBigInt64(this.gf,t),this.gf+=8}cO(t){const i=this.view,e=t.length;for(let s=0;s>>3}yO(t){let i=this.nO>>>3,e=8-(7&this.nO),s=0;for(this.nO+=t;t>e;e=8)s+=(this.view.getUint8(i++)&h.JT[e])<>>e-t&h.JT[t],s}pO(t,i){const e=this.gf;this.gf=0;const n=new Uint8Array(e);this.rO(e,0,n);const r=(0,s.AO)(n),h=(0,s.mO)(r,i,t),o=(0,s.gO)(h);this.gf=0,this.p1(o.length),this.fO(o,o.length,0)}}},3867:(t,i,e)=>{e.d(i,{hA:()=>a,rA:()=>o,Ae:()=>s,xm:()=>n,Lh:()=>r,Om:()=>h,$r:()=>l});class s extends Array{constructor(t,i){super(t);for(let e=0;e{e.d(i,{gO:()=>o,$o:()=>n,AO:()=>h,Qo:()=>s,sc:()=>r,mO:()=>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}},9073:(t,i,e)=>{e.a(t,(async(t,i)=>{try{var s=e(4702),n=e(2901),r=e(9234),h=e(1069),o=e(7604),l=e(8370),a=e(3867),c=e(1673),f=e(1122),u=e(2682),d=e(8950),w=e(4544),y=e(6200);class t extends l.A{static IO=!1;static _O=!0;db=null;CO=3200;EO=3200;sizeX=1280;sizeZ=1344;vO=2240;bO=2752;TO=1e3;OO=0;RO=[];SO=[];LO=[];xO=[];MO=[0];kO=[0];DO=[];NO=[];FO=[];BO=[];PO=[];UO=[];WO=[];GO=[];Ie=[];_e=[];Te=null;Oe=null;Re=null;Se=null;YO=null;HO=[];VO=!0;KO=0;XO=-1;jO=-1;zO=-1;ZO=-1;qO=!1;JO=['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'];$O=5;QO=13;tR=140;iR=470;eR=!1;sR=0;nR=0;rR=-1;hR=0;oR=0;lR=0;aR=new Int32Array(2e3);cR=new Int32Array(2e3);fR=new Int32Array(2e3);Kn=new Int32Array(2e3);Xn=new Int32Array(2e3);Ve=new Int32Array(2e3);Vn=0;uR=null;dR=200;wR=this.dR*this.sizeX/this.sizeZ|0;yR=635-this.wR-5;pR=503-this.dR-20;AR=!1;mR=8943445;gR=7824964;IR=6706483;_R=11141120;CR=10027008;ER=8912896;zoom=4;vR=4;offsetX=this.CO-this.vO;Vy=this.bO+this.sizeZ-this.EO;load=async()=>{await s.A.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new w.A(await w.A.openDatabase());const t=await this.bR();await this.Jo(100,'Please wait... Rendering Map');const i=new h.A(t.read('labels.dat'));this.OO=i.Au;for(let t=0;t{if(this.VO){this.VO=!1,this.KO=0,d.A.clear();const t=this.offsetX-(635/this.zoom|0),i=this.Vy-(503/this.zoom|0),e=this.offsetX+(635/this.zoom|0),s=this.Vy+(503/this.zoom|0);if(this.kR(t,i,e,s,0,0,635,503),this.AR&&(this.uR?.oT(this.yR,this.pR),d.A.ov(this.yR+this.wR*t/this.sizeX|0,this.pR+this.dR*i/this.sizeZ|0,(e-t)*this.wR/this.sizeX|0,(s-i)*this.dR/this.sizeZ|0,16711680,128),d.A.Ll(this.yR+this.wR*t/this.sizeX|0,this.pR+this.dR*i/this.sizeZ|0,(e-t)*this.wR/this.sizeX|0,(s-i)*this.dR/this.sizeZ|0,16711680),this.lR>0&&this.lR%10<5))for(let t=0;t0&&this.lR%10<5&&this.oR==i+this.nR&&(e=16776960),this.YO?.zl(this.$O+20,t+13,this.JO[i+this.nR],e)}t+=17}}this.zl(this.yR,this.pR+this.dR,this.wR,18,this.mR,this.gR,this.IR,'Overview'),this.zl(this.$O,this.QO+this.iR,this.tR,18,this.mR,this.gR,this.IR,'Key'),3==this.vR?this.zl(170,471,50,30,this._R,this.CR,this.ER,'37%'):this.zl(170,471,50,30,this.mR,this.gR,this.IR,'37%'),4==this.vR?this.zl(230,471,50,30,this._R,this.CR,this.ER,'50%'):this.zl(230,471,50,30,this.mR,this.gR,this.IR,'50%'),6==this.vR?this.zl(290,471,50,30,this._R,this.CR,this.ER,'75%'):this.zl(290,471,50,30,this.mR,this.gR,this.IR,'75%'),8==this.vR?this.zl(350,471,50,30,this._R,this.CR,this.ER,'100%'):this.zl(350,471,50,30,this.mR,this.gR,this.IR,'100%')}this.KO--,this.KO<=0&&(this.Uo?.draw(0,0),this.KO=50)};refresh=async()=>{this.KO=0};update=async()=>{1==this.Ec[1]&&(this.offsetX=this.offsetX-16/this.zoom|0,this.VO=!0),1==this.Ec[2]&&(this.offsetX=this.offsetX+16/this.zoom|0,this.VO=!0),1==this.Ec[3]&&(this.Vy=this.Vy-16/this.zoom|0,this.VO=!0),1==this.Ec[4]&&(this.Vy=this.Vy+16/this.zoom|0,this.VO=!0);let t=1;for(;t>0;)t=this.Gc(),49==t?(this.vR=3,this.VO=!0):50==t?(this.vR=4,this.VO=!0):51==t?(this.vR=6,this.VO=!0):52==t?(this.vR=8,this.VO=!0):107==t||75==t?(this.eR=!this.eR,this.VO=!0):111!=t&&79!=t||(this.AR=!this.AR,this.VO=!0);if(1==this.Ic&&(this.XO=this._c,this.jO=this.Cc,this.zO=this.offsetX,this.ZO=this.Vy,this._c>170&&this._c<220&&this.Cc>471&&this.Cc<503?(this.vR=3,this.XO=-1):this._c>230&&this._c<280&&this.Cc>471&&this.Cc<503?(this.vR=4,this.XO=-1):this._c>290&&this._c<340&&this.Cc>471&&this.Cc<503?(this.vR=6,this.XO=-1):this._c>350&&this._c<400&&this.Cc>471&&this.Cc<503?(this.vR=8,this.XO=-1):this._c>this.$O&&this.Cc>this.QO+this.iR&&this._cthis.yR&&this.Cc>this.pR+this.dR&&this._cthis.$O&&this.Cc>this.QO&&this._cthis.$O&&this.Cc>this.QO&&this._cthis.$O&&this.Cc>this.QO+this.iR-18&&this._cthis.$O&&this.Vl=t&&this.Klthis.yR&&i>this.pR&&tthis.vR&&(this.zoom=this.vR)),this.zoom>this.vR&&(this.VO=!0,this.zoom-=this.zoom/30,this.zoomthis.sR&&(this.VO=!0,this.nR--),this.lR>0&&(this.VO=!0,this.lR--);const i=this.offsetX-(635/this.zoom|0),e=this.Vy-(503/this.zoom|0),s=this.offsetX+(635/this.zoom|0),n=this.Vy+(503/this.zoom|0);i<48&&(this.offsetX=48+(635/this.zoom|0)),e<48&&(this.Vy=48+(503/this.zoom|0)),s>this.sizeX-48&&(this.offsetX=this.sizeX-48-(635/this.zoom|0)),n>this.sizeZ-48&&(this.Vy=this.sizeZ-48-(503/this.zoom|0))};async bR(){let t=await(this.db?.Zo('worldmap.dat'));if(t)return new n.A(t);let i=5;for(;!t;){await this.Jo(0,'Requesting map');try{console.log(`${y.K.ft}/worldmap.jag`),+y.K.getParameter('world')>=998&&(y.K.ft=`${y.K.ft}/..`),t=await(0,r.$o)(`${y.K.ft}/worldmap.jag`)}catch(e){t=void 0;for(let t=i;t>0;t--)await this.Jo(0,`Error loading - Will retry in ${t} secs.`),await(0,r.Qo)(1e3);i*=2,i>60&&(i=60)}}return await(this.db?.tl('worldmap.dat',t)),new n.A(t)}zl(t,i,e,s,n,r,h,o){t=Math.trunc(t),i=Math.trunc(i),e=Math.trunc(e),s=Math.trunc(s),d.A.Ll(t,i,e,s,0);const l=t+1,a=i+1,c=e-2,f=s-2;d.A.fillRect(l,a,c,f,r),d.A.pl(l,a,n,c),d.A.wl(l,a,n,f),d.A.pl(l,a+f-1,h,c),d.A.wl(l+c-1,a,h,f),this.YO?.LT(l+c/2+1,a+f/2+1+4,o,0),this.YO?.LT(l+c/2,a+f/2+4,o,16777215)}MR(){for(let t=0;t10&&s>20)-(o>>20),n+=(i>>10&1023)-(o>>10&1023),r+=(1023&i)-(1023&o),r>0&&(this.HO[s][h]=this.DR(t/8533,n/8533,r/8533))}}}}TR(t){for(;t.available>0;){const i=64*t.gu-this.vO,e=64*t.gu-this.bO;if(i>0&&e>0&&i+640;){const i=64*t.gu-this.vO,e=64*t.gu-this.bO;if(i>0&&e>0&&i+640;){const i=64*t.gu-this.vO,e=64*t.gu-this.bO;if(i>0&&e>0&&i+640;){const i=64*t.gu-this.vO,e=64*t.gu-this.bO;if(i>0&&e>0&&i+640;){const i=64*t.gu-this.vO,e=64*t.gu-this.bO;if(i>0&&e>0&&i+641&&l--;let a=t-.3333333333333333;a<0&&a++,s=6*l<1?o+6*(h-o)*l:2*l<1?h:3*l<2?o+(h-o)*(.6666666666666666-l)*6:o,n=6*t<1?o+6*(h-o)*t:2*t<1?h:3*t<2?o+(h-o)*(.6666666666666666-t)*6:o,r=6*a<1?o+6*(h-o)*a:2*a<1?h:3*a<2?o+(h-o)*(.6666666666666666-a)*6:o}return((256*s|0)<<16)+((256*n|0)<<8)+(256*r|0)}kR(i,e,s,n,r,h,o,l){const a=s-i,c=n-e,f=(o-r<<16)/a|0,u=(l-h<<16)/c|0;for(let t=0;t>16,n=f*(t+1)>>16;const o=n-s;if(!(o<=0)){s+=r,n+=r;for(let r=0;r>16,a=u*(r+1)>>16;const c=a-l;if(c<=0)continue;l+=h,a+=h;const f=this.NO[t+i][r+e];if(0===f)d.A.fillRect(s,l,n-s,a-l,this.HO[t+i][r+e]);else{const n=this.FO[t+i][r+e],h=252&n;0==h||o<=1||c<=1?d.A.fillRect(s,l,o,c,f):this.NR(d.A.gw,l*d.A.Iw+s,this.HO[t+i][r+e],f,o,c,h>>2,3&n)}}}}if(s-i>o-r)return;let w=0;for(let t=0;t>16,n=f*(t+1)>>16;const o=n-s;if(!(o<=0)){s+=r,n+=r;for(let r=0;r>16,a=u*(r+1)>>16;const c=a-l;if(c<=0)continue;l+=h,a+=h;let f=255&this.BO[t+i][r+e];if(0!=f){let t,i;t=1==o?s:n-1,i=1==c?l:a-1;let e=13421772;if((f>=5&&f<=8||f>=13&&f<=16||f>=21&&f<=24)&&(e=13369344,f-=4),27!=f&&28!=f||(e=13369344,f-=2),1==f)d.A.wl(s,l,e,c);else if(2==f)d.A.pl(s,l,e,o);else if(3==f)d.A.wl(t,l,e,c);else if(4==f)d.A.pl(s,i,e,o);else if(9==f)d.A.wl(s,l,16777215,c),d.A.pl(s,l,e,o);else if(10==f)d.A.wl(t,l,16777215,c),d.A.pl(s,l,e,o);else if(11==f)d.A.wl(t,l,16777215,c),d.A.pl(s,i,e,o);else if(12==f)d.A.wl(s,l,16777215,c),d.A.pl(s,i,e,o);else if(17==f)d.A.pl(s,l,e,1);else if(18==f)d.A.pl(t,l,e,1);else if(19==f)d.A.pl(t,i,e,1);else if(20==f)d.A.pl(s,i,e,1);else if(25==f)for(let t=0;t>16,n=f*(t+1)>>16;if(!(n-s<=0)){s+=r,n+=r;for(let n=0;n>16,o=u*(n+1)>>16;o-r<=0||(r+=h,o+=h,this.WO[t+i][n+e]&&this.Te?.draw(s,r))}}}for(let t=0;t>16,n=f*(t+1)>>16;if(!(n-s<=0)){s+=r,n+=r;for(let n=0;n>16,o=u*(n+1)>>16;o-r<=0||(r+=h,o+=h,this.GO[t+i][n+e]&&this.Oe?.draw(s,r))}}}for(let t=0;t0)for(let t=0;t=71&&a<=73?this.YO?.LT((y+u)/2,(p+w)/2,'u_pass',16711680):t>=32&&t<=34&&a>=70&&a<=74&&this.YO?.LT((y+u)/2,(p+w)/2,'u_pass',16776960)}}NR(t,i,e,s,n,r,h,o){const l=d.A.Iw-n;if(9==h?(h=1,o=o+1&3):10==h?(h=1,o=o+3&3):11==h&&(h=8,o=o+3&3),1==h){if(0==o)for(let h=0;h=0;h--){for(let r=0;r=h?s:e;i+=l}else if(3==o)for(let h=r-1;h>=0;h--){for(let r=0;r=h?s:e;i+=l}}else if(2==h){if(0==o)for(let h=r-1;h>=0;h--){for(let r=0;r>1?s:e;i+=l}else if(1==o)for(let h=0;h=h<<1?s:e;i+=l}else if(2==o)for(let h=0;h=0;r--)t[i++]=r<=h>>1?s:e;i+=l}else if(3==o)for(let h=r-1;h>=0;h--){for(let r=n-1;r>=0;r--)t[i++]=r>=h<<1?s:e;i+=l}}else if(3==h){if(0==o)for(let h=r-1;h>=0;h--){for(let r=n-1;r>=0;r--)t[i++]=r<=h>>1?s:e;i+=l}else if(1==o)for(let h=r-1;h>=0;h--){for(let r=0;r=h<<1?s:e;i+=l}else if(2==o)for(let h=0;h>1?s:e;i+=l}else if(3==o)for(let h=0;h=0;r--)t[i++]=r>=h<<1?s:e;i+=l}}else if(4==h){if(0==o)for(let h=r-1;h>=0;h--){for(let r=0;r=h>>1?s:e;i+=l}else if(1==o)for(let h=0;h=0;r--)t[i++]=r>=h>>1?s:e;i+=l}else if(3==o)for(let h=r-1;h>=0;h--){for(let r=n-1;r>=0;r--)t[i++]=r<=h<<1?s:e;i+=l}}else if(5==h){if(0==o)for(let h=r-1;h>=0;h--){for(let r=n-1;r>=0;r--)t[i++]=r>=h>>1?s:e;i+=l}else if(1==o)for(let h=r-1;h>=0;h--){for(let r=0;r=h>>1?s:e;i+=l}else if(3==o)for(let h=0;h=0;r--)t[i++]=r<=h<<1?s:e;i+=l}}else if(6==h){if(0==o)for(let h=0;h=n/2?s:e;i+=l}else if(3==o)for(let h=0;h=r/2?s:e;i+=l}}else if(7==h){if(0==o)for(let h=0;h=0;h--){for(let o=0;o=0;h--){for(let o=n-1;o>=0;o--)t[i++]=o<=h-r/2?s:e;i+=l}else if(3==o)for(let h=0;h=0;o--)t[i++]=o<=h-r/2?s:e;i+=l}}else if(8==h)if(0==o)for(let h=0;h=h-r/2?s:e;i+=l}else if(1==o)for(let h=r-1;h>=0;h--){for(let o=0;o=h-r/2?s:e;i+=l}else if(2==o)for(let h=r-1;h>=0;h--){for(let o=n-1;o>=0;o--)t[i++]=o>=h-r/2?s:e;i+=l}else if(3==o)for(let h=0;h=0;o--)t[i++]=o>=h-r/2?s:e;i+=l}}Wo(){return 0}Go(){return!1}Yo(){return!1}Ho(){return-1}Vo(){return-1}}await(0,o.w)(),(new t).run().then((()=>{})),window.onkeydown=function(t){return!(' '===t.key&&t.target===document.body)},i()}catch(t){i(t)}}),1)},4702:(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,{A:()=>n});class n{static FR=null;static load=async t=>{this.FR=await s(new WebAssembly.Module(t),{env:void 0})};static read=(t,i,e,s)=>{if(!this.FR)throw new Error('bz2 not found!!');return Int8Array.from(this.FR.read(t,i,e,s))}}},123:(t,i,e)=>{function s(t,i,e){window._tinyMidiPlay&&window._tinyMidiPlay(t,i/256,e)}function n(t){window._tinyMidiStop&&window._tinyMidiStop(t)}e.d(i,{sl:()=>s,No:()=>n})},8902:(t,i,e)=>{var s;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 p,A;y=a?require('path').BR(y)+'/':__dirname+'/';var m=()=>{A||(p=require('fs'),A=require('path'))};u=(t,i)=>(m(),t=A.normalize(t),p.PR(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)=>{m(),t=A.normalize(t),p.UR(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,O,R,S,L,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=R=new Int16Array(t),r.HEAP32=S=new Int32Array(t),r.HEAPU8=O=new Uint8Array(t),r.HEAPU16=new Uint16Array(t),r.HEAPU32=L=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 P(){if(!k){var t=ft(),i=L[t>>2],e=L[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!==L[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 U=[],W=[],G=[],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+')'),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()},WR:function(){z.error()},GR:function(){z.error()},YR:function(){z.error()},open:function(){z.error()},HR:function(){z.error()},VR:function(){z.error()},KR:function(){z.error()},XR:function(){z.error()},jR:function(){z.error()}};r.FS_createDataFile=z.WR,r.FS_createPreloadedFile=z.GR;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.zR||(ht.zR={}),ht.zR[t]||(ht.zR[t]=1,c&&(t='warning: '+t),_(t))}function ot(t){try{return v.grow(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){O.copyWithin(t,i,i+e)},"emscripten_resize_heap":function(t){var i=O.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,W.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(k)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()))),L[t>>2]=34821223,L[t+4>>2]=2310721022,L[0]=1668509029}function dt(t){function e(){lt||(lt=!0,r.calledRun=!0,k||(D(!Y),Y=!0,P(),rt(W),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(P(),r.postRun)for('function'==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)t=r.postRun.shift(),G.unshift(t);var t;rt(G)}()))}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(),U.unshift(t);var t;rt(U)}(),H>0||(r.setStatus?(r.setStatus('Running...'),setTimeout((function(){setTimeout((function(){r.setStatus('')}),1),e()}),1)):e(),P()))}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':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: '+e)}},r.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(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});const r=class{constructor(t={}){this.ZR=void 0,this.qR=0,this.JR=0,this.$R=0,this.QR=t.QR||100,this.sampleRate=t.sampleRate||44100,this.tS=t.tS||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.iS(1),this.eS=t.eS||(()=>{}),this.sS=t.sS||(()=>{}),this.nS=void 0,this.test=0}async init(){if(!this.ZR){if('undefined'!=typeof process){const{BR:t}=await import('path'),{rS: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.ZR=await n(),this.hS=this.ZR._malloc(this.bufferSize),this.oS=this.ZR._malloc(8)}}iS(t){this.bufferSize=4*this.sampleRate*this.tS*t}lS(){if(!this.ZR)throw new Error(`${this.constructor.name} not initalized. call .init()`)}aS(t){this.lS();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.ZR;e(this.qR),this.qR=i(t.length),this.ZR.HEAPU8.set(t,this.qR),this.JR=s(this.qR,t.length),n(this.JR,2===this.tS?0:2,this.sampleRate,this.gain)}cS(){this.lS();const t=new Uint8Array(this.bufferSize);return t.set(this.ZR.HEAPU8.subarray(this.hS,this.hS+this.bufferSize)),t}fS(t){const{_malloc:i,_free:e,_tml_load_memory:s}=this.ZR;return e(this.$R),this.$R=i(t.length),this.ZR.HEAPU8.set(t,this.$R),s(this.$R,t.length)}uS(t){const{_midi_render:i}=this.ZR;return i(this.JR,t,this.tS,this.sampleRate,this.hS,this.bufferSize,this.oS)}dS(t){if(this.lS(),!this.JR)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.nS);const{setValue:i,getValue:e}=this.ZR;i(this.oS,0,'double'),this.ZR._tsf_reset(this.JR),this.ZR._tsf_channel_set_bank_preset(this.JR,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let s=this.fS(t);const n=()=>{s=this.uS(s);const t=this.cS();this.eS(t),s?this.nS=setTimeout(n,this.QR):this.sS(e(this.oS,'double'))};this.nS=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()=>{const t=2,i=44100;let e=new Float32Array,s=window.audioContext.createGain();s.gain.setValueAtTime(.1,window.audioContext.currentTime),s.connect(window.audioContext.destination);let n=window.audioContext.currentTime,h=[];const o=new r({QR:30,eS:t=>{let i=new Float32Array(t.buffer),s=new Float32Array(e.length+i.length);s.set(e,0),s.set(i,e.length),e=s},sS:t=>{},bufferSize:102400});await o.init();const l=await fetch('./SCC1_Florestan.sf2'),a=new Uint8Array(await l.arrayBuffer());function c(){if(!window.audioContext||!e.length)return;let r=window.audioContext.createBufferSource();const o=e.length/t,l=window.audioContext.createBuffer(t,o,i);for(let i=0;i{t.stop(window.audioContext.currentTime)})),h=[],s.gain.setValueAtTime(t,window.audioContext.currentTime)}}function d(t,i){-1!==t&&window._tinyMidiVolume(t),n=window.audioContext.currentTime,f=setInterval(c,250),o.dS(i)}o.aS(a),window._tinyMidiStop=async t=>{t?function(t){const i=window.audioContext.currentTime;s.gain.cancelScheduledValues(i),s.gain.setTargetAtTime(0,i,.5),setTimeout(t,2e3)}((()=>{u()})):u()},window._tinyMidiVolume=(t=1)=>{s.gain.setValueAtTime(t,window.audioContext.currentTime)},window._tinyMidiPlay=async(t,i,e)=>{t&&(await window._tinyMidiStop(e),e?setTimeout((()=>{d(i,t)}),2e3):d(i,t))}})()},8227:(t,i,e)=>{t.exports=e.p+"9f86b5397894e28b5ae2.wasm"}},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(9073)})(); \ No newline at end of file