diff --git a/index.js b/index.js index a5fc547b..577d1f76 100644 --- a/index.js +++ b/index.js @@ -1 +1 @@ -(()=>{"use strict";var t,i,s,h,e={8793:(t,i,s)=>{s.d(i,{K:()=>N});var h=s(1120),e=s(4583),n=s(1069),r=s(4702);class o{static tt=t=>{let i=0;t=t.toUpperCase();for(let s=0;s=this.st)return null;if(this.ot[t])return this.ot[t];const i=this.rt[t],s=i+this.nt[t];if(this.it){const h=Uint8Array.from(this.buffer.subarray(i,i+s));return this.ot[t]=h,h}{const i=Uint8Array.from(r.A.read(this.et[t],this.buffer,this.nt[t],this.rt[t]));return this.ot[t]=i,i}}}var l=s(8370),a=(s(8902),s(6666)),c=s(198),f=s(818),u=s(670),d=s(8268),w=s(3867),y=s(7854),A=s(8950),p=s(1302),m=s(9298),I=s(8665),E=s(1312),g=s(3819),_=s(8317),C=s(9234),T=s(123),O=s(5637),v=s(6948),b=s(2164),L=s(8738),R=s(3764),S=s(8534),M=s(6730);function k(t,i){var s;(s=document.createElement('a')).href=t,s.download=i,document.body.appendChild(s),s.style='display: none',s.click(),s.remove()}class x{wt=new Map;yt;At=self.isSecureContext?self.crypto.randomUUID():'0';constructor(t){this.yt=t}async It(){const t=new RTCPeerConnection({Et:[{gt:'stun:stun.l.google.com:19302'}]}),i=t.createDataChannel('channel'),s=crypto.randomUUID();this.wt.set(s,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:s})),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.yt&&this.yt.postMessage(i)}}postMessage(t){const i=this.wt.get(t.data.id),s=t.data;s.data&&(s.data=Array.from(t.data.data)),i&&'open'===i.readyState&&i.send(JSON.stringify(s))}}class D{pc;_t=void 0;At;constructor(t){this.pc=new RTCPeerConnection({Et:[{gt:'stun:stun.l.google.com:19302'}]}),this.pc.ondatachannel=i=>{this._t=i.channel,this._t.onopen=()=>{console.log('Connected to host!')},this._t.onerror=t=>{console.error(t)},this._t.onmessage=i=>{if(!this.At){const t=JSON.parse(i.data);if('id'===t.type)return void(this.At=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 Ct(t){await this.pc.setRemoteDescription(new RTCSessionDescription(JSON.parse(t))),await this.pc.setLocalDescription(await this.pc.createAnswer())}}class N extends l.A{static Tt=225;static Ot=10;static portOffset=0;static members=!0;static vt=!1;static bt='';static Lt='';static Rt=!1;static St=2;static Mt=!1;static kt='https://raw.githubusercontent.com/2004scape/Server/main';static exponent=58778699976184461502525193738213253649000149147835990136706041084440742975821n;static xt=7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789n;static Dt=0;static Nt=0;static Pt=0;static Ft=0;static Ut=0;static Bt=0;static Gt=0;static Ht=0;static Wt=0;static Yt=0;static Vt=0;static Kt=0;static Xt=0;static zt=0;static jt=0;static Zt=()=>{c.A.vt=!1,e.A.vt=!1,N.vt=!1,f.A.vt=!1};static qt=()=>{c.A.vt=!0,e.A.vt=!0,N.vt=!0,f.A.vt=!0};$t=2048;Jt=2047;Qt=!1;ti=!1;ii=!1;si=!1;db=null;hi=0;ei=[];stream=null;in=n.A.ni(1);ri=n.A.ni(1);oi=n.A.ni(1);li=0n;ai=0;ci=0;fi=0;ui=null;di=0;packetSize=0;wi=0;yi=0;Ai=0;pi=null;mi=!0;Ii=0;Ei=0;gi=null;_i=null;Ci=null;Ti=null;Oi=null;vi=null;bi=null;Li=null;Ri=null;Si=null;Mi=null;ki='';xi='';username='';password='';Di=null;Ni=null;Pi=null;Fi=null;Ui=[];Bi=!1;Gi=null;Hi=null;Wi=null;Yi=null;Vi=null;Ki=null;Xi=null;zi=null;ji=null;Zi=null;qi=new Int32Array(256);$i=0;Ji=0;Qi=0;ts=null;ss=null;hs=null;es=null;ns=null;rs=null;os=null;ls=null;cs=null;fs=null;us=null;ds=null;ws=null;ys=null;As=null;ps=null;Is=null;Es=null;gs=null;_s=null;Cs=null;Ts=new Int32Array(33);Os=new Int32Array(33);vs=new Int32Array(151);bs=new Int32Array(151);Ls=null;Rs=null;Ss=null;Ms=null;ks=null;xs=null;Ds=new w.Ns(13,null);Ps=null;Fs=null;Us=new w.Ns(50,null);Bs=new w.Ns(50,null);Gs=new w.Ns(20,null);Hs=new w.Ns(20,null);Ws=null;Ys=new w.Ns(8,null);Vs=null;Ks=null;Xs=null;zs=null;js=null;Zs=null;qs=null;$s=null;Js=null;Qs=null;th=null;ih=null;sh=null;hh=null;eh=null;nh=null;rh=null;oh=null;lh=new w.Ns(1e3,null);ah=!1;fh=!1;uh=!1;dh=!1;wh=-1;yh=0;Ah=0;ph=0;mh=0;Ih=0;Eh=0;gh=!1;_h=0;Ch=0;Th=0;Oh=0;bh=0;Lh=0;Rh=[];Sh=-1;Mh=-1;kh=new h.A;xh=78;Dh=0;Nh=0;Ph=[];Fh=0;Uh=0;Bh=0;Gh=0;Hh=0;Wh=0;Yh=0;Vh=0;Kh=[];Xh=[];zh=[];jh=[];Zh=null;qh=-1;$h=3;Jh=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];Qh=0;te=0;ie=0;se=!1;he=0;ee=!1;ne='';re='';oe=0;le='';ae=!1;ce=-1;fe=new w.Ns(100,null);ue=new w.Ns(100,null);messageType=new Int32Array(100);de=new Int32Array(100);we=0;ye=0;Ae=0;pe='';me=0;Ie=0;Ee=0;ge=0;_e=0;Ce=0;Te=0;Oe=0;ve=0;be=!1;Le=0;Re=0;Se=0;Me=0;ke=null;xe=0;De=0;Ne=0;Pe=0;Fe=!1;Ue=[];Be=[];Ge=0;He=0;We=0;Ye=null;Ve=0;Ke=new Int32Array(500);Xe=new Int32Array(500);ze=new Int32Array(500);je=new Int32Array(500);Ze=0;qe=0;$e=0;Je='';Qe=!1;tn=-1;sn=0;hn=0;en=0;nn=0;rn=0;ln=new Int32Array(1e3);an=new Int32Array(1e3);cn=null;fn=0;un=0;dn=0;wn=0;yn=0;An=!1;pn=0;mn=0;In=0;En=0;gn=2;_n=2;Cn=1;Tn=new Int32Array(5);On=new w.Ns(5,!1);vn=new Int32Array(5);bn=new Int32Array(5);Ln=new Int32Array(5);Rn=0;Sn=0;Mn=0;kn=0;xn=0;Dn=0;Nn=0;Pn=0;Fn=0;Un=1;Bn=2;Gn=-1;Hn=0;Wn=0;Yn=0;Vn=0;Kn=0;Xn=0;zn=null;jn=null;Zn=null;qn=0;$n=0;Jn=new Int8Array(16384);Qn=new w.Ns(u.A.tr,null);ir=0;sr=0;hr=128;er=0;nr=0;rr=0;lr=0;ar=0;cr=null;ur=null;dr=new w.wr(u.A.yr,u.A.yr);Ar=0;pr=0;mr=0;Ir=0;Er=0;gr=0;_r=0;Cr=0;Tr=0;Or=0;vr=0;br=0;Lr=new w.Ns(this.$t,null);Rr=0;Sr=new Int32Array(this.$t);Mr=0;kr=0;Dr=new Int32Array(this.$t);Nr=new Int32Array(1e3);Pr=new w.Ns(this.$t,null);Fr=new w.Ns(8192,null);Ur=0;Br=new Int32Array(8192);Gr=new a.A;Hr=new a.A;Wr=new a.A;Yr=new a.A;Vr=new w.Kr(u.A.tr,u.A.yr,u.A.yr,null);Xr=new a.A;zr=new Int32Array(4e3);jr=new Int32Array(4e3);Zr=new Int32Array(u.A.yr*u.A.yr);qr=new Int32Array(u.A.yr*u.A.yr);$r=0;Jr=null;Qr=0;io=0;so=-1;ho=0;eo=0;no=0;ro=0;oo=!1;lo=!0;ao=!1;co=new Int32Array(7);fo=new Int32Array(5);uo=0;do=0;static wo=50;yo=new Int32Array(N.wo);Ao=new Int32Array(N.wo);po=new Int32Array(N.wo);mo=new Int32Array(N.wo);Io=new Int32Array(N.wo);Eo=new Int32Array(N.wo);_o=new Int32Array(N.wo);Co=new w.Ns(N.wo,null);To=new w.Ns(100,null);Oo=new BigInt64Array(100);vo=new Int32Array(100);bo=null;Lo=0;Ro=!0;So=new Int32Array(50);Mo=new Int32Array(50);ko=new Int32Array(50);xo=192;Do=-1;No=-1;Po=0;Fo=0;Uo=0;Bo=!0;Go=null;Ho=0;Wo=0;Yo=192;yt=void 0;Vo=!1;host=null;Ko=null;Xo=new w.Ns(16,null);zo=0;jo=!1;Zo=()=>{try{this.stream&&this.stream.close()}catch(t){}this.Ko&&'998'===N.getParameter('world')&&this.Ko._t?.send(JSON.stringify({type:'close',id:this.Ko.At})),this.stream=null,(0,T.qo)(!1),this.ri=null,this.oi=null,this.in=null,this.Zn=null,this.zn=null,this.jn=null,this.cr=null,this.ur=null,this.cn=null,this.Qn=null,this.Zr=null,this.qr=null,this.zr=null,this.jr=null,this.Jn=null,this.ss=null,this.hs=null,this.es=null,this.ns=null,this.rs=null,this.os=null,this.ls=null,this.cs=null,this.fs=null,this.us=null,this.ds=null,this.ws=null,this.ys=null,this.As=null,this.ps=null,this.Is=null,this.Es=null,this.Ls=null,this.Ss=null,this.Rs=null,this.Ms=null,this.ks=null,this.xs=null,this.Ds=null,this.qs=null,this.$s=null,this.Js=null,this.Qs=null,this.th=null,this.ih=null,this.sh=null,this.hh=null,this.eh=null,this.nh=null,this.Fs=null,this.Gs=null,this.Hs=null,this.Ys=null,this.Vs=null,this.Ks=null,this.Xs=null,this.zs=null,this.Us=null,this.Bs=null,this.dr=null,this.Lr=null,this.Sr=null,this.Dr=null,this.Pr=null,this.Nr=null,this.Fr=null,this.Br=null,this.Vr=null,this.Xr=null,this.Yr=null,this.Gr=null,this.Hr=null,this.Wr=null,this.ze=null,this.je=null,this.Ke=null,this.Xe=null,this.Rh=null,this.Ue=null,this.ln=null,this.an=null,this.lh=null,this.Ps=null,this.To=null,this.Oo=null,this.vo=null,this.Ti=null,this.Oi=null,this.gi=null,this._i=null,this.Ci=null,this.vi=null,this.bi=null,this.Li=null,this.Ri=null,this.$o(),O.A.Zo(),v.A.Zo(),p.A.Zo(),b.A.Jo=null,_.A.Jo=null,h.A.Jo=null,E.A.Jo=null,L.A.Jo=null,L.A.Qo=null,R.A.Jo=null,this.tl=null,d.A.Qo=null,e.A.Zo(),c.A.Zo(),I.A.Zo(),S.A.Jo=[],M.A.Jo=[]};il(){return this.Ii}sl(){return this.ae}hl(){return this.ee}el(){return this.Mh}nl(){return this.wh}$o=()=>{this.Bi=!1,this.ts&&(clearInterval(this.ts),this.ts=null),this.Si=null,this.Mi=null,this.Ui=[],this.Xi=null,this.zi=null,this.ji=null,this.Zi=null,this.Yi=null,this.Wi=null,this.Vi=null,this.Ki=null,this.Gi=null,this.Hi=null};rl=()=>{'999'===N.getParameter('world')?(this.yt=new Worker('worker.js',{type:'module'}),this.yt.onmessage=this.onmessage,this.host=new x(this.yt)):'998'===N.getParameter('world')&&(this.yt={onmessage:t=>{this.stream.ol.onmessage(t)},postMessage:t=>{this.Ko&&this.Ko._t&&'open'===this.Ko._t.readyState&&this.Ko._t.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.Ko=new D(this.yt))};onmessage=t=>{switch(t.data.type){case'ready':return void(this.Vo=!0);case'save':return k(t.data.value,t.data.path.split('/').pop().split('\\').pop()),void URL.revokeObjectURL(t.data.value);case'close':return void this.yt?.postMessage({type:'close',id:t.data.id})}this.host?.At===t.data.id?this.stream.ol.onmessage(t.data):this.host?.postMessage(t)};ll=async()=>{if(999==+N.getParameter('world'))this.host&&await this.host.It();else if(998==+N.getParameter('world')&&this.Ko){if(this.Ko._t)return void console.log('You are already connected.');let t;try{for(;null===(t=prompt('Paste offer here, answer will be copied to clipboard')););await this.Ko.Ct(t)}catch(t){console.error(t)}}};al=async(t,i,s,h)=>{let e=5,r=await(this.db?.cl(t));if(r&&n.A.fl(r)!==s&&(r=void 0),r)return new o(r);for(;!r;){await this.ul(h,`Requesting ${i}`);try{r=+N.getParameter('world')<998?await(0,C.dl)(`${N.Lt}/${t}${s}`):await(0,C.dl)(`${N.Lt}/${t}`)}catch(t){r=void 0;for(let t=e;t>0;t--)await this.ul(h,`Error loading - Will retry in ${t} secs.`),await(0,C.wl)(1e3);e*=2,e>60&&(e=60)}}return await(this.db?.yl(t,r)),new o(r)};Al=async(t,i,s,h)=>{let e=await(this.db?.cl(t+'.mid'));if(e&&12345678!==i&&n.A.fl(e)!==i&&(e=void 0),!e)try{e=+N.getParameter('world')<998?await(0,C.dl)(`${N.Lt}/${t}_${i}.mid`):await(0,C.dl)(`${N.Lt}/songs/${t}.mid`),s!==e.length&&(e=e.slice(0,s))}catch(t){}if(!e)return;await(this.db?.yl(t+'.mid',e));const o=new n.A(Uint8Array.from(e)).ut,l=r.A.read(o,e,s,4);(0,T.pl)(l,this.Yo,h)};ml=()=>{if(y.Il.fillStyle='black',y.Il.fillRect(0,0,this.width,this.height),this.El(1),this.ii){this.Bi=!1,y.Il.font='bold 16px helvetica, sans-serif',y.Il.textAlign='left',y.Il.fillStyle='yellow';let t=35;y.Il.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,y.Il.fillStyle='white',y.Il.fillText('To fix this try the following (in order):',30,t),t+=50,y.Il.font='bold 12px helvetica, sans-serif',y.Il.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,y.Il.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,y.Il.fillText('3: Try using a different game-world',30,t),t+=30,y.Il.fillText('4: Try rebooting your computer',30,t),t+=30,y.Il.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.si&&(this.Bi=!1,y.Il.font='bold 20px helvetica, sans-serif',y.Il.textAlign='left',y.Il.fillStyle='white',y.Il.fillText('Error - unable to load game!',50,50),y.Il.fillText('To play RuneScape make sure you play from',50,100),y.Il.fillText('https://2004scape.org',50,150)),this.ti){this.Bi=!1,y.Il.font='bold 13px helvetica, sans-serif',y.Il.textAlign='left',y.Il.fillStyle='yellow';let t=35;y.Il.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,y.Il.fillStyle='white',y.Il.fillText('To fix this try the following (in order):',30,t),t+=50,y.Il.font='bold 12px helvetica, sans-serif',y.Il.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,y.Il.fillText('2: Try rebooting your computer, and reloading',30,t)}};gl=t=>{if(!t._l)return!1;for(let i=0;i=h)return!1}else if(3===t._l[i]){if(s<=h)return!1}else if(4===t._l[i]){if(s===h)return!1}else if(s!==h)return!1}return!0};Ol=(t,i,s,h,e)=>{this.js?.draw(t,i),this.Zs?.draw(t,i+e-16),A.A.fillRect(t,i+16,16,e-32,m.A.vl);let n=(e-32)*e/h|0;n<8&&(n=8);const r=(e-n-32)*s/(h-e)|0;A.A.fillRect(t,i+r+16,16,n,m.A.bl),A.A.Ll(t,i+r+16,m.A.Rl,n),A.A.Ll(t+1,i+r+16,m.A.Rl,n),A.A.Sl(t,i+r+16,m.A.Rl,16),A.A.Sl(t,i+r+17,m.A.Rl,16),A.A.Ll(t+15,i+r+16,m.A.Ml,n),A.A.Ll(t+14,i+r+17,m.A.Ml,n-1),A.A.Sl(t,i+r+n+15,m.A.Ml,16),A.A.Sl(t+1,i+r+n+14,m.A.Ml,15)};kl=(t,i)=>{let s=!1;const e=h.A.Jo[t];if(!e.xl)return!1;for(let t=0;th.delay[n.Fl];)n.Pl-=h.delay[n.Fl]+1,n.Fl++,n.Fl>=h.Ul&&(n.Fl-=h.Bl,(n.Fl<0||n.Fl>=h.Ul)&&(n.Fl=0)),s=!0}}}return s};Gl=(t,i,s,n,r=!1)=>{if(0!==t.type||!t.xl||t.hide&&this.me!==t.id&&this.Ie!==t.id&&this.Ee!==t.id)return;const o=A.A.left,l=A.A.top,a=A.A.right,c=A.A.bottom;A.A.Hl(i,s,i+t.width,s+t.height);const f=t.xl.length;for(let o=0;o0&&this.zl(c),c.type===h.A.jl)c.Zl>c.scroll-c.height&&(c.Zl=c.scroll-c.height),c.Zl<0&&(c.Zl=0),this.Gl(c,l,a,c.Zl,r),c.scroll>c.height&&this.Ol(l+c.width,a,c.Zl,c.scroll,c.height);else if(c.type===h.A.ql){let t=0;for(let i=0;i0){let i=0,s=0;const n=c.Ql[t]-1;if(h>=-32&&h<=512&&e>=-32&&e<=334||0!==this.Ce&&this._e===t){const r=p.A.ha(n,c.ta[t]);if(0!==this.Ce&&this._e===t&&this.ge===c.id?(i=this.ea-this.Te,s=this.na-this.Oe,i<5&&i>-5&&(i=0),s<5&&s>-5&&(s=0),this.ve<5&&(i=0,s=0),r.ra(128,h+i,e+s)):0!==this.xe&&this.De===t&&this.Ne===c.id?r.ra(128,h,e):r.draw(h,e),33===r.oa||1!==c.ta[t]){const n=c.ta[t];this.Di?.la(h+i+1,e+10+s,this.aa(n),m.A.ca),this.Di?.la(h+i,e+9+s,this.aa(n),m.A.fa)}}}else if(c.ua&&t<20){const i=c.ua[t];i?.draw(h,e)}t++}}else if(c.type===h.A.da)c.fill?A.A.fillRect(l,a,c.width,c.height,c.wa):A.A.Vl(l,a,c.width,c.height,c.wa);else if(c.type===h.A.ya){const t=c.font;let i=c.wa,s=c.text;if(this.Ee!==c.id&&this.Ie!==c.id&&this.me!==c.id||0===c.Aa||(i=c.Aa),this.gl(c)&&(i=c.pa,c.ma&&c.ma.length>0&&(s=c.ma)),c.Ia===h.A.Ea&&this.Fe&&(s='Please wait...',i=c.wa),!t||!s)continue;for(let h=a+t.height;s.length>0;h+=t.height){if(-1!==s.indexOf('%')){for(;;){const t=s.indexOf('%1');if(-1===t)break;s=s.substring(0,t)+this.ga(this.Cl(c,0))+s.substring(t+2)}for(;;){const t=s.indexOf('%2');if(-1===t)break;s=s.substring(0,t)+this.ga(this.Cl(c,1))+s.substring(t+2)}for(;;){const t=s.indexOf('%3');if(-1===t)break;s=s.substring(0,t)+this.ga(this.Cl(c,2))+s.substring(t+2)}for(;;){const t=s.indexOf('%4');if(-1===t)break;s=s.substring(0,t)+this.ga(this.Cl(c,3))+s.substring(t+2)}for(;;){const t=s.indexOf('%5');if(-1===t)break;s=s.substring(0,t)+this.ga(this.Cl(c,4))+s.substring(t+2)}}const e=s.indexOf('\\n');let n;-1!==e?(n=s.substring(0,e),s=s.substring(e+2)):(n=s,s=''),c._a?t.Ca(l+(c.width/2|0),h,n,i,c.Ta):t.Oa(l,h,n,i,c.Ta)}}else if(c.type===h.A.va){let t;t=this.gl(c)?c.ba:c.La,t?.draw(l,a)}else if(c.type===h.A.Ra){const t=e.A.Sa,i=e.A.Ma;e.A.Sa=l+(c.width/2|0),e.A.Ma=a+(c.height/2|0);const s=e.A.sin[c.ka]*c.zoom>>16,h=e.A.cos[c.ka]*c.zoom>>16,n=this.gl(c);let r;r=n?c.Nl:c.Dl;let o=null;if(-1===r)o=c.xa(-1,-1,n);else{const t=E.A.Jo[r];t.frames&&t.Da&&(o=c.xa(t.frames[c.Fl],t.Da[c.Fl],n))}o&&o.Na(0,c.Pa,0,c.ka,0,s,h),e.A.Sa=t,e.A.Ma=i}else if(c.type===h.A.Fa){const t=c.font;if(!t||!c.Ql||!c.ta)continue;let i=0;for(let s=0;s0){const e=p.A.get(c.Ql[i]-1);let n=e.name;if((e.Ua||1!==c.ta[i])&&(n=n+' x'+this.Ba(c.ta[i])),!n)continue;const r=l+h*(c.ia+115),o=a+s*(c.sa+12);c._a?t.Ca(r+(c.width/2|0),o,n,c.wa,c.Ta):t.Oa(r,o,n,c.wa,c.Ta)}i++}}}A.A.Hl(o,l,a,c)};zl=t=>{let i=t.Xl;if(i>=h.A.Ga&&i<=h.A.Ha)i--,i>=this.uo?(t.text='',t.Ia=0):(t.text=this.To[i],t.Ia=1);else if(i>=h.A.Wa&&i<=h.A.Ya)i-=h.A.Wa,i>=this.uo?(t.text='',t.Ia=0):(0===this.vo[i]?t.text='@red@Offline':this.vo[i]===N.Ot?t.text='@gre@World-'+(this.vo[i]-9):t.text='@yel@World-'+(this.vo[i]-9),t.Ia=1);else if(i===h.A.Va)t.scroll=15*this.uo+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i>=h.A.Ka&&i<=h.A.Xa)i-=h.A.Ka,i>=this.Nh?(t.text='',t.Ia=0):(t.text=g.A.za(g.A.ja(this.Ph[i])),t.Ia=1);else if(i===h.A.Za)t.scroll=15*this.Nh+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i===h.A.qa){if(t.ka=150,t.Pa=256*Math.sin(this.hi/40)&2047,this.ao){this.ao=!1;const i=new w.Ns(7,null);let s=0;for(let t=0;t<7;t++){const h=this.co[t];h>=0&&(i[s++]=_.A.Jo[h].xa())}const h=I.A.$a(i,s);for(let t=0;t<5;t++)0!==this.fo[t]&&(h.Ja(d.A.Qa[t][0],d.A.Qa[t][this.fo[t]]),1===t&&h.Ja(d.A.tc[0],d.A.tc[this.fo[t]]));if(this.Jr){const i=E.A.Jo[this.Jr.ic].frames;i&&(h.sc(),h.hc(i[0]),h.ec(64,850,-30,-50,-30,!0),t.model=h)}}}else if(i===h.A.nc)this.rh||(this.rh=t.La,this.oh=t.ba),this.lo?t.La=this.oh:t.La=this.rh;else if(i===h.A.rc)this.rh||(this.rh=t.La,this.oh=t.ba),this.lo?t.La=this.rh:t.La=this.oh;else if(i===h.A.oc)t.text=this.Je,this.hi%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(i===h.A.lc)this.oo?this.Qe?(t.wa=m.A.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.wa=m.A.Kl,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(i===h.A.ac||i===h.A.cc)if(0===this.sn)t.text='';else{let i;i=0===this.hn?'earlier today':1===this.hn?'yesterday':this.hn+' days ago',t.text='You last logged in '+i+' from: '+g.A.fc(this.sn)}else if(i===h.A.uc)0===this.nn&&(t.text='0 unread messages',t.wa=m.A.fa),1===this.nn&&(t.text='1 unread message',t.wa=m.A.GREEN),this.nn>1&&(t.text=this.nn+' unread messages',t.wa=m.A.GREEN);else if(i===h.A.dc)if(201===this.en)t.text='';else if(200===this.en)t.text='You have not yet set any password recovery questions.';else{let i;i=0===this.en?'Earlier today':1===this.en?'Yesterday':this.en+' days ago',t.text=i+' you changed your recovery questions'}else i===h.A.wc?201===this.en?t.text='':200===this.en?t.text='We strongly recommend you do so now to secure your account.':t.text='If you do not remember making this change then cancel it immediately':i===h.A.yc&&(201===this.en?t.text='':(this.en,t.text="Do this from the 'account management' area on our front webpage"))};Cl=(t,i)=>{if(!t.scripts||i>=t.scripts.length)return-2;try{const s=t.scripts[i];if(!s)return-1;let e=0,n=0;for(;;){const t=s[n++];if(0===t)return e;if(1===t)e+=this.Xh[s[n++]];else if(2===t)e+=this.zh[s[n++]];else if(3===t)e+=this.Kh[s[n++]];else if(4===t){const t=h.A.Jo[s[n++]],i=s[n++]+1;if(t.Ql&&t.ta)for(let s=0;st<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};aa=t=>t<1e5?String(t):t<1e7?(t/1e3|0)+'K':(t/1e6|0)+'M'}},7604:(t,i,s)=>{s.d(i,{w:()=>r});var h=s(8370),e=s(8793),n=s(9234);async function r(){await async function(){0===h.A.getParameter('world').length&&h.A.setParameter('world','1');['0','998','999'].includes(h.A.getParameter('world'))?function(){if(+h.A.getParameter('world')>=998)return void(e.K.Lt='data/pack/client');e.K.bt='http://localhost',e.K.Lt='http://localhost',e.K.portOffset=0}():await async function(t){const i=await o(t,parseInt(h.A.getParameter('world'),10)),s=new URL(i.address);e.K.Ot=10+i.id-1,e.K.bt=`${s.protocol}//${s.hostname}`,e.K.Lt=`${s.protocol}//${s.hostname}:${s.port}`,t||(e.K.bt=e.K.bt.replace('https:','http:'));e.K.portOffset=i.portOffset,e.K.members=!0===i?.members,h.A.setParameter('world',i.id.toString(10))}(window.location.protocol.startsWith('https'))}(),function(){0===h.A.getParameter('detail').length&&h.A.setParameter('detail','high');'low'===h.A.getParameter('detail')?e.K.qt():e.K.Zt()}(),0===h.A.getParameter('method').length&&h.A.setParameter('method','0')}async function o(t,i,s=0){if(s>=10)throw new Error('could not find world to connect!');const h=t?'https:':'http:';let e;try{e=JSON.parse(await(0,n.mc)(`${h}//2004scape.org/api/v1/worldlist`))}catch(h){return await(0,n.wl)(1e3),o(t,i,++s)}e.push({id:0,region:'Local Development',address:'http://localhost',portOffset:0,members:!0,Lr:0});const r=e.find((t=>t.id===i));return r||o(t,i,10)}},7906:(t,i,s)=>{s.a(t,(async(t,i)=>{try{var h=s(1312),e=s(5637),n=s(1302),r=s(6948),o=s(8317),l=s(8738),a=s(3764),c=s(1120),f=s(1183),u=s(8950),d=s(4583),w=s(1673),y=s(1122),A=s(2682),p=s(8665),m=s(9298),I=s(1069),E=s(3554),g=s(353),_=s(2634),C=s(4544),T=s(2215),O=s(3955),v=s(7953),b=s(2646),L=s(3937),R=(s(8902),s(4702)),S=s(6666),M=s(3819),k=s(2595),x=s(198),D=s(818),N=s(5599),P=s(1023),F=s(6169),U=s(2630),B=s(5327),G=s(670),H=s(9456),W=s(8268),Y=s(8412),V=s(3606),K=s(4197),X=s(254),z=s(7628),j=s(123),Z=s(9234),q=s(3867),$=s(8793),J=s(8534),Q=s(6730),tt=s(2164),it=s(7604),st=s(3795),ht=s(4909),et=s(296);class t extends $.K{load=async()=>{if(this.Qt)this.ti=!0;else{this.Qt=!0;try{this.rl(),await this.ul(10,'Connecting to fileserver'),await R.A.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new C.A(await C.A.openDatabase());const t=new I.A(new Uint8Array(await(0,Z.dl)(`${$.K.Lt}/crc`)));for(let i=0;i<9;i++)this.ei[i]=t.ut;$.K.vt||await this.Al('scape_main',12345678,4e4,!1);const i=await this.al('title','title screen',this.ei[1],10);this.pi=i,this.Di=A.A.Ic(i,'p11'),this.Ni=A.A.Ic(i,'p12'),this.Pi=A.A.Ic(i,'b12'),this.Fi=A.A.Ic(i,'q8'),await this.Ec(),this.gc();const s=await this.al('config','config',this.ei[2],15),u=await this.al('interface','interface',this.ei[3],20),m=await this.al('media','2d graphics',this.ei[4],30),E=await this.al('models','3d graphics',this.ei[5],40),g=await this.al('textures','textures',this.ei[6],60),_=await this.al('wordenc','chat system',this.ei[7],65),T=await this.al('sounds','sound effects',this.ei[8],70);this.ur=new q._c(G.A.tr,G.A.yr,G.A.yr),this.cr=new q.Cc(G.A.tr,G.A.yr+1,G.A.yr+1),this.cr&&(this.cn=new x.A(this.cr,G.A.yr,G.A.tr,G.A.yr));for(let t=0;t34||t>34))999===i&&(i=h);else if(999!==i){s=h;break}this.vs[t-9]=i-21,this.bs[t-9]=s-i}d.A.kc(479,96),this.gs=d.A.xc,d.A.kc(190,261),this._s=d.A.xc,d.A.kc(512,334),this.Cs=d.A.xc;const V=new Int32Array(9);for(let t=0;t<9;t++){const i=32*t+128+15,s=3*i+600,h=d.A.sin[i];V[t]=s*h>>16}x.A.init(512,334,500,800,V),v.A.Sc(_),this.Dc()}catch(t){console.error(t),this.ii=!0}}};update=async()=>{this.ti||this.ii||this.si||(this.hi++,this.Nc?await this.Pc():await this.Fc())};draw=async()=>{this.ti||this.ii||this.si?this.ml():(this.Nc?this.Uc():await this.Bc(),this.yh=0)};refresh=()=>{this.mi=!0};ul=async(t,i)=>{if(console.log(`${t}%: ${i}`),await this.Gc(),!this.pi)return void await super.ul(t,i);this.Ci?.bind();this.Pi?.Hc(180,54,'RuneScape is loading - please wait...',m.A.Kl);u.A.Vl(28,62,304,34,m.A.Wc),u.A.Vl(29,63,302,32,m.A.ca),u.A.fillRect(30,64,3*t,30,m.A.Wc),u.A.fillRect(30+3*t,64,300-3*t,30,m.A.ca),this.Pi?.Hc(180,85,i,m.A.Kl),this.Ci?.draw(214,186),this.mi&&(this.mi=!1,this.Bi||(this.Ti?.draw(0,0),this.Oi?.draw(661,0)),this.gi?.draw(128,0),this._i?.draw(214,386),this.vi?.draw(0,265),this.bi?.draw(574,265),this.Li?.draw(128,186),this.Ri?.draw(574,186)),await(0,Z.wl)(5)};Yc=()=>{this.Bi&&(this.Vc(),this.Vc(),this.Kc())};Gc=async()=>{this.gi||(this.tl=null,this.ns=null,this.hs=null,this.ss=null,this.es=null,this.rs=null,this.os=null,this.ls=null,this.Ti=new f.A(128,265),u.A.clear(),this.Oi=new f.A(128,265),u.A.clear(),this.gi=new f.A(533,186),u.A.clear(),this._i=new f.A(360,146),u.A.clear(),this.Ci=new f.A(360,200),u.A.clear(),this.vi=new f.A(214,267),u.A.clear(),this.bi=new f.A(215,267),u.A.clear(),this.Li=new f.A(86,79),u.A.clear(),this.Ri=new f.A(87,79),u.A.clear(),this.pi&&(await this.Ec(),this.gc()),this.mi=!0)};Ec=async()=>{if(!this.pi)return;const t=await y.A.Xc(this.pi,'title');this.Ti?.bind(),t.vc(0,0),this.Oi?.bind(),t.vc(-661,0),this.gi?.bind(),t.vc(-128,0),this._i?.bind(),t.vc(-214,-386),this.Ci?.bind(),t.vc(-214,-186),this.vi?.bind(),t.vc(0,-265),this.bi?.bind(),t.vc(-128,-186),this.Li?.bind(),t.vc(-128,-186),this.Ri?.bind(),t.vc(-574,-186),t.Tc(),this.Ti?.bind(),t.vc(394,0),this.Oi?.bind(),t.vc(-267,0),this.gi?.bind(),t.vc(266,0),this._i?.bind(),t.vc(180,-386),this.Ci?.bind(),t.vc(180,-186),this.vi?.bind(),t.vc(394,-265),this.bi?.bind(),t.vc(-180,-265),this.Li?.bind(),t.vc(212,-186),this.Ri?.bind(),t.vc(-180,-186);const i=y.A.Ic(this.pi,'logo');this.gi?.bind(),i.draw((this.width/2|0)-(i.width/2|0)-128,18)};zc=t=>{if(!this.Yi||!this.Wi)return;this.Yi.fill(0);for(let t=0;t<5e3;t++){const t=128*Math.random()*256|0;this.Yi[t]=256*Math.random()|0}for(let t=0;t<20;t++){for(let t=1;t<255;t++)for(let i=1;i<127;i++){const s=i+(t<<7);this.Wi[s]=(this.Yi[s-1]+this.Yi[s+1]+this.Yi[s-128]+this.Yi[s+128])/4|0}const t=this.Yi;this.Yi=this.Wi,this.Wi=t}if(t){let i=0;for(let s=0;s{if(this.pi){this.Si=w.A.Ic(this.pi,'titlebox'),this.Mi=w.A.Ic(this.pi,'titlebutton');for(let t=0;t<12;t++)this.Ui[t]=w.A.Ic(this.pi,'runes',t);this.Gi=new y.A(128,265),this.Hi=new y.A(128,265),this.Ti&&(0,Z.qc)(this.Ti.Mc,0,this.Gi.Mc,0,33920),this.Oi&&(0,Z.qc)(this.Oi.Mc,0,this.Hi.Mc,0,33920),this.zi=new Int32Array(256);for(let t=0;t<64;t++)this.zi[t]=262144*t;for(let t=0;t<64;t++)this.zi[t+64]=1024*t+m.A.RED;for(let t=0;t<64;t++)this.zi[t+128]=4*t+m.A.fa;for(let t=0;t<64;t++)this.zi[t+192]=m.A.Kl;this.ji=new Int32Array(256);for(let t=0;t<64;t++)this.ji[t]=1024*t;for(let t=0;t<64;t++)this.ji[t+64]=4*t+m.A.GREEN;for(let t=0;t<64;t++)this.ji[t+128]=262144*t+m.A.$c;for(let t=0;t<64;t++)this.ji[t+192]=m.A.Kl;this.Zi=new Int32Array(256);for(let t=0;t<64;t++)this.Zi[t]=4*t;for(let t=0;t<64;t++)this.Zi[t+64]=262144*t+m.A.BLUE;for(let t=0;t<64;t++)this.Zi[t+128]=1024*t+m.A.Jc;for(let t=0;t<64;t++)this.Zi[t+192]=m.A.Kl;this.Xi=new Int32Array(256),this.Yi=new Int32Array(32768),this.Wi=new Int32Array(32768),this.zc(null),this.Vi=new Int32Array(32768),this.Ki=new Int32Array(32768),this.ul(10,'Connecting to fileserver').then((()=>{this.Bi||(this.Bi=!0,this.ts=setInterval(this.Yc,35))}))}};Fc=async()=>{if(0===this.Ii){let t=(this.width/2|0)-80,i=20+(this.height/2|0);if(i+=20,1===this.Qc&&this.tf>=t-75&&this.tf<=t+75&&this.if>=i-20&&this.if<=i+20){if(+$.K.getParameter('world')>=998)return void this.ll();this.Ii=3,this.Ei=0}t=80+(this.width/2|0),1===this.Qc&&this.tf>=t-75&&this.tf<=t+75&&this.if>=i-20&&this.if<=i+20&&(this.ki='',this.xi='Enter your username & password.',this.Ii=2,this.Ei=0)}else if(2===this.Ii){let t=(this.height/2|0)-40;t+=30,t+=25,1===this.Qc&&this.if>=t-15&&this.if=t-15&&this.if=i-75&&this.tf<=i+75&&this.if>=s-20&&this.if<=s+20&&await this.sf(this.username,this.password,!1),i=80+(this.width/2|0),1===this.Qc&&this.tf>=i-75&&this.tf<=i+75&&this.if>=s-20&&this.if<=s+20&&(this.Ii=0,this.username='',this.password='');;){const t=this.hf();if(-1===t)return;let i=!1;for(let s=0;s0&&(this.username=this.username.substring(0,this.username.length-1)),9!==t&&10!==t&&13!==t||(this.Ei=1),i&&(this.username=this.username+String.fromCharCode(t)),this.username.length>12&&(this.username=this.username.substring(0,12))):1===this.Ei&&(8===t&&this.password.length>0&&(this.password=this.password.substring(0,this.password.length-1)),9!==t&&10!==t&&13!==t||(this.Ei=0),i&&(this.password=this.password+String.fromCharCode(t)),this.password.length>20&&(this.password=this.password.substring(0,20)))}}else if(3===this.Ii){const t=this.width/2|0;let i=50+(this.height/2|0);i+=20,1===this.Qc&&this.tf>=t-75&&this.tf<=t+75&&this.if>=i-20&&this.if<=i+20&&(this.Ii=0)}};Bc=async()=>{await this.Gc(),this.Ci?.bind(),this.Si?.draw(0,0);if(0===this.Ii){let t=180,i=80;this.Pi?.Ca(t,i,'Welcome to RuneScape',m.A.fa,!0),t=100,i=120,this.Mi?.draw(t-73,i-20),this.Pi?.Ca(t,i+5,'New user',m.A.Kl,!0),t=260,this.Mi?.draw(t-73,i-20),this.Pi?.Ca(t,i+5,'Existing User',m.A.Kl,!0)}else if(2===this.Ii){let t=100,i=60;this.ki.length>0?(this.Pi?.Ca(180,i-15,this.ki,m.A.fa,!0),this.Pi?.Ca(180,i,this.xi,m.A.fa,!0),i+=30):(this.Pi?.Ca(180,i-7,this.xi,m.A.fa,!0),i+=30),this.Pi?.Oa(90,i,`Username: ${this.username}${0===this.Ei&&this.hi%40<20?'@yel@|':''}`,m.A.Kl,!0),i+=15,this.Pi?.Oa(92,i,`Password: ${M.A.nf(this.password)}${1===this.Ei&&this.hi%40<20?'@yel@|':''}`,m.A.Kl,!0),i=150,this.Mi?.draw(t-73,i-20),this.Pi?.Ca(t,i+5,'Login',m.A.Kl,!0),t=260,this.Mi?.draw(t-73,i-20),this.Pi?.Ca(t,i+5,'Cancel',m.A.Kl,!0)}else if(3===this.Ii){this.Pi?.Ca(180,40,'Create a free account',m.A.fa,!0);const t=180;let i=65;this.Pi?.Ca(180,i,'To create a new account you need to',m.A.Kl,!0),i+=15,this.Pi?.Ca(180,i,'go back to the main RuneScape webpage',m.A.Kl,!0),i+=15,this.Pi?.Ca(180,i,"and choose the red 'create account'",m.A.Kl,!0),i+=15,this.Pi?.Ca(180,i,'button at the top right of that page.',m.A.Kl,!0),i=150,this.Mi?.draw(t-73,i-20),this.Pi?.Ca(t,i+5,'Cancel',m.A.Kl,!0)}this.Ci?.draw(214,186),this.mi&&(this.mi=!1,this.gi?.draw(128,0),this._i?.draw(214,386),this.vi?.draw(0,265),this.bi?.draw(574,265),this.Li?.draw(128,186),this.Ri?.draw(574,186))};sf=async(i,s,h)=>{try{if(h||(this.ki='',this.xi='Connecting to server...',await this.Bc()),'998'===t.getParameter('world')){if(this.Ko&&'complete'!==this.Ko.pc.iceGatheringState)return this.ki='You are not connected to a host.',void(this.xi='Please try using world 999.');this.stream=new et.A(this.yt,this.Ko.At)}else if('999'===t.getParameter('world')){if(!this.Vo)return this.ki='The server is starting up.',void(this.xi='Please try again in a moment.');this.stream=new et.A(this.yt,this.host.At)}else this.stream=new E.A(await E.A.rf({host:$.K.bt,port:43594+$.K.portOffset}));await this.stream.lf(this.in.data,0,8),this.in.ft=0,this.li=this.in.af;const e=new Int32Array([Math.floor(99999999*Math.random()),Math.floor(99999999*Math.random()),Number(this.li>>32n),Number(this.li&BigInt(4294967295))]);this.ri.ft=0,this.ri.p1(10),this.ri.p4(e[0]),this.ri.p4(e[1]),this.ri.p4(e[2]),this.ri.p4(e[3]),this.ri.p4(0),this.ri.cf(i),this.ri.cf(s),this.ri.ff($.K.xt,$.K.exponent),this.oi.ft=0,h?this.oi.p1(18):this.oi.p1(16),this.oi.p1(this.ri.ft+36+1+1),this.oi.p1($.K.Tt),this.oi.p1($.K.vt?1:0);for(let t=0;t<9;t++)this.oi.p4(this.ei[t]);this.oi.uf(this.ri.data,this.ri.ft,0),this.ri.random=new _.A(e);for(let t=0;t<4;t++)e[t]+=50;this.ui=new _.A(e),this.stream?.write(this.oi.data,this.oi.ft);const n=await this.stream.read();if(1===n)return await(0,Z.wl)(2e3),void await this.sf(i,s,h);if(2===n||18===n){this.oo=18===n,k.A.df(),this.Nc=!0,this.ri.ft=0,this.in.ft=0,this.di=-1,this.wi=-1,this.yi=-1,this.Ai=-1,this.packetSize=0,this.ai=0,this.fi=0,this.ci=0,this.Fh=0,this.Lh=0,this.gh=!1,this.wf=0;for(let t=0;t<100;t++)this.fe[t]=null;this.Le=0,this.Ge=0,this.fn=0,this.Lo=0,this.mn=(100*Math.random()|0)-50,this.In=(110*Math.random()|0)-55,this.En=(80*Math.random()|0)-40,this.Pn=(120*Math.random()|0)-60,this.Fn=(30*Math.random()|0)-20,this.er=(20*Math.random()|0)-10&2047,this.Gn=-1,this.wn=0,this.yn=0,this.Rr=0,this.Ur=0;for(let t=0;t{if(null!==this.Lr){this.fi>1&&this.fi--,this.ci>0&&this.ci--;for(let t=0;t<5&&await this.read();t++);if(this.Nc){for(let t=0;tthis.Fo+(this.Po/22|0)&&(this.Po=i.ft,this.Fo=Date.now(),this.Do=this.So[t],this.No=this.Mo[t],await(0,j.mf)(i.data.slice(0,i.ft),this.xo))}catch(t){console.error(t)}this.Lo--;for(let i=t;i0&&(this.Uo-=20,this.Uo<0&&(this.Uo=0),0===this.Uo&&this.Bo&&!$.K.vt&&this.Go&&await this.Al(this.Go,this.Ho,this.Wo,!1));const t=k.A.flush();if(t&&(this.ri.If(O.A.Ef),this.ri.p2(t.ft),this.ri.uf(t.data,t.ft,0),t.release()),this.ai++,this.ai>750&&await this.gf(),this._f(),this.Cf(),this.Tf(),this.Of(),(1===this.vf[1]||1===this.vf[2]||1===this.vf[3]||1===this.vf[4])&&this.sr++>5&&(this.sr=0,this.ri.If(O.A.bf),this.ri.p2(this.hr),this.ri.p2(this.er),this.ri.p1(this.Pn),this.ri.p1(this.Fn)),this.un++,0!==this.Ah&&(this.ph+=20,this.ph>=400&&(this.Ah=0)),0!==this.xe&&(this.Pe++,this.Pe>=15&&(2===this.xe&&(this.ah=!0),3===this.xe&&(this.fh=!0),this.xe=0)),0!==this.Ce&&(this.ve++,(this.ea>this.Te+5||this.eathis.Oe+5||this.na=5){if(this.Ze=-1,this.Rf(),this.Ze===this.ge&&this.qe!==this._e){const t=c.A.Jo[this.ge];if(t.Ql){const i=t.Ql[this.qe];t.Ql[this.qe]=t.Ql[this._e],t.Ql[this._e]=i}if(t.ta){const i=t.ta[this.qe];t.ta[this.qe]=t.ta[this._e],t.ta[this._e]=i}this.ri.If(O.A.Sf),this.ri.p2(this.ge),this.ri.p2(this._e),this.ri.p2(this.qe)}}else(1===this.Ve||this.Mf(this.Lh-1))&&this.Lh>2?this.kf():this.Lh>0&&await this.xf(this.Lh-1);this.Pe=10,this.Qc=0}if($.K.Pt++,$.K.Pt>127&&($.K.Pt=0,this.ri.If(O.A.Df),this.ri.p3(4991788)),-1!==x.A.Nf&&this.Jr){const t=x.A.Nf,i=x.A.Pf,s=this.Ff(this.Jr.Uf[0],this.Jr.Bf[0],t,i,0,0,0,0,0,0,!0);x.A.Nf=-1,s&&(this.mh=this.tf,this.Ih=this.if,this.Ah=1,this.ph=0)}1===this.Qc&&this.Zh&&(this.Zh=null,this.fh=!0,this.Qc=0),await this.Gf(),this.Hf(),this.Wf(),this.Yf(),1!==this.Lf&&1!==this.Qc||this.yh++,2===this.fn&&($.K.Mt?this.Vf():this.Kf()),2===this.fn&&this.An&&this.Xf();for(let t=0;t<5;t++)this.Tn[t]++;if(await this.zf(),this.wf++,this.wf>4500&&(this.ci=250,this.wf-=500,this.ri.If(O.A.jf)),this.pn++,this.pn>500){this.pn=0;const t=8*Math.random()|0;1&~t||(this.mn+=this.gn),2&~t||(this.In+=this._n),4&~t||(this.En+=this.Cn)}if(this.mn<-50&&(this.gn=2),this.mn>50&&(this.gn=-2),this.In<-55&&(this._n=2),this.In>55&&(this._n=-2),this.En<-40&&(this.Cn=1),this.En>40&&(this.Cn=-1),this.Nn++,this.Nn>500){this.Nn=0;const t=8*Math.random()|0;1&~t||(this.Pn+=this.Bn),2&~t||(this.Fn+=this.Un)}this.Pn<-60&&(this.Bn=2),this.Pn>60&&(this.Bn=-2),this.Fn<-20&&(this.Un=1),this.Fn>10&&(this.Un=-1),$.K.Ft++,$.K.Ft>110&&($.K.Ft=0,this.ri.If(O.A.Zf),this.ri.p4(0)),this.eo++,this.eo>50&&this.ri.If(O.A.qf);try{this.stream&&this.ri.ft>0&&(this.stream.write(this.ri.data,this.ri.ft),this.ri.ft=0,this.eo=0)}catch(t){console.log(t),await this.gf()}}}};Uc=()=>{if(null===this.Lr)return;this.mi&&(this.mi=!1,this.cs?.draw(0,11),this.fs?.draw(0,375),this.us?.draw(729,5),this.ds?.draw(752,231),this.ws?.draw(0,0),this.ys?.draw(561,0),this.As?.draw(520,11),this.ps?.draw(520,231),this.Is?.draw(501,375),this.Es?.draw(0,345),this.ah=!0,this.fh=!0,this.uh=!0,this.dh=!0,2!==this.fn&&(this.es?.draw(8,11),this.hs?.draw(561,5))),2===this.fn&&this.$f(),this.gh&&1===this._h&&(this.ah=!0);let t=!1;if(-1!==this.Sh&&(t=this.kl(this.Sh,this.un),t&&(this.ah=!0)),2===this.xe&&(this.ah=!0),2===this.Ce&&(this.ah=!0),this.ah&&(this.Jf(),this.ah=!1),-1===this.Mh){this.kh.Zl=this.xh-this.Dh-77,this.ea>453&&this.ea<565&&this.na>350&&this.Qf(this.ea-22,this.na-375,this.xh,77,!1,463,0,this.kh);let t=this.xh-this.kh.Zl-77;t<0&&(t=0),t>this.xh-77&&(t=this.xh-77),this.Dh!==t&&(this.Dh=t,this.fh=!0)}-1!==this.Mh&&(t=this.kl(this.Mh,this.un),t&&(this.fh=!0)),3===this.xe&&(this.fh=!0),3===this.Ce&&(this.fh=!0),this.Zh&&(this.fh=!0),this.gh&&2===this._h&&(this.fh=!0),this.fh&&(this.tu(),this.fh=!1),2===this.fn&&(this.iu(),this.hs?.draw(561,5)),-1!==this.qh&&(this.uh=!0),this.uh&&(-1!==this.qh&&this.qh===this.$h&&(this.qh=-1,this.ri.If(O.A.su),this.ri.p1(this.$h)),this.uh=!1,this.ls?.bind(),this.xs?.draw(0,0),-1===this.Sh&&(-1!==this.Jh[this.$h]&&(0===this.$h?this.qs?.draw(29,30):1===this.$h?this.$s?.draw(59,29):2===this.$h?this.$s?.draw(87,29):3===this.$h?this.Js?.draw(115,29):4===this.$h?this.th?.draw(156,29):5===this.$h?this.th?.draw(184,29):6===this.$h&&this.Qs?.draw(212,30)),-1!==this.Jh[0]&&(0!==this.qh||this.hi%20<10)&&this.Ds[0]?.draw(35,34),-1!==this.Jh[1]&&(1!==this.qh||this.hi%20<10)&&this.Ds[1]?.draw(59,32),-1!==this.Jh[2]&&(2!==this.qh||this.hi%20<10)&&this.Ds[2]?.draw(86,32),-1!==this.Jh[3]&&(3!==this.qh||this.hi%20<10)&&this.Ds[3]?.draw(121,33),-1!==this.Jh[4]&&(4!==this.qh||this.hi%20<10)&&this.Ds[4]?.draw(157,34),-1!==this.Jh[5]&&(5!==this.qh||this.hi%20<10)&&this.Ds[5]?.draw(185,32),-1!==this.Jh[6]&&(6!==this.qh||this.hi%20<10)&&this.Ds[6]?.draw(212,34)),this.ls?.draw(520,165),this.os?.bind(),this.ks?.draw(0,0),-1===this.Sh&&(-1!==this.Jh[this.$h]&&(7===this.$h?this.ih?.draw(49,0):8===this.$h?this.sh?.draw(81,0):9===this.$h?this.sh?.draw(108,0):10===this.$h?this.hh?.draw(136,1):11===this.$h?this.nh?.draw(178,0):12===this.$h?this.nh?.draw(205,0):13===this.$h&&this.eh?.draw(233,0)),-1!==this.Jh[8]&&(8!==this.qh||this.hi%20<10)&&this.Ds[7]?.draw(80,2),-1!==this.Jh[9]&&(9!==this.qh||this.hi%20<10)&&this.Ds[8]?.draw(107,3),-1!==this.Jh[10]&&(10!==this.qh||this.hi%20<10)&&this.Ds[9]?.draw(142,4),-1!==this.Jh[11]&&(11!==this.qh||this.hi%20<10)&&this.Ds[10]?.draw(179,2),-1!==this.Jh[12]&&(12!==this.qh||this.hi%20<10)&&this.Ds[11]?.draw(206,2),-1!==this.Jh[13]&&(13!==this.qh||this.hi%20<10)&&this.Ds[12]?.draw(230,2)),this.os?.draw(501,492),this.es?.bind()),this.dh&&(this.dh=!1,this.rs?.bind(),this.Ms?.draw(0,0),this.Ni?.Ca(57,33,'Public chat',m.A.Kl,!0),0===this.Qh&&this.Ni?.Ca(57,46,'On',m.A.GREEN,!0),1===this.Qh&&this.Ni?.Ca(57,46,'Friends',m.A.fa,!0),2===this.Qh&&this.Ni?.Ca(57,46,'Off',m.A.RED,!0),3===this.Qh&&this.Ni?.Ca(57,46,'Hide',m.A.$c,!0),this.Ni?.Ca(186,33,'Private chat',m.A.Kl,!0),0===this.te&&this.Ni?.Ca(186,46,'On',m.A.GREEN,!0),1===this.te&&this.Ni?.Ca(186,46,'Friends',m.A.fa,!0),2===this.te&&this.Ni?.Ca(186,46,'Off',m.A.RED,!0),this.Ni?.Ca(326,33,'Trade/duel',m.A.Kl,!0),0===this.ie&&this.Ni?.Ca(326,46,'On',m.A.GREEN,!0),1===this.ie&&this.Ni?.Ca(326,46,'Friends',m.A.fa,!0),2===this.ie&&this.Ni?.Ca(326,46,'Off',m.A.RED,!0),this.Ni?.Ca(462,38,'Report abuse',m.A.Kl,!0),this.rs?.draw(0,471),this.es?.bind()),this.un=0};$f=()=>{if(this.dn++,this.hu(),this.eu(),this.nu(),this.ru(),this.ou(),!this.An){let t=this.hr;(this.Dn/256|0)>t&&(t=this.Dn/256|0),this.On[4]&&this.bn[4]+128>t&&(t=this.bn[4]+128);const i=this.er+this.En&2047;if(this.Jr&&this.lu(this.lr,this.au(this.ir,this.Jr.x,this.Jr.z)-50,this.ar,i,t,3*t+600),$.K.Nt++,$.K.Nt>1802){$.K.Nt=0,this.ri.If(O.A.cu),this.ri.p1(0);const t=this.ri.ft;this.ri.p2(29711),this.ri.p1(70),this.ri.p1(256*Math.random()|0),this.ri.p1(242),this.ri.p1(186),this.ri.p1(39),this.ri.p1(61),2*Math.random()|0||this.ri.p1(13),2*Math.random()|0||this.ri.p2(57856),this.ri.p2(65536*Math.random()|0),this.ri.fu(this.ri.ft-t)}}let t;t=this.An?this.uu():this.du();const i=this.Rn,s=this.Sn,h=this.Mn,e=this.kn,n=this.xn;let r;for(let t=0;t<5;t++)this.On[t]&&(r=Math.random()*(2*this.vn[t]+1)-this.vn[t]+Math.sin(this.Tn[t]*(this.Ln[t]/100))*this.bn[t]|0,0===t&&(this.Rn+=r),1===t&&(this.Sn+=r),2===t&&(this.Mn+=r),3===t&&(this.xn=this.xn+r&2047),4===t&&(this.kn+=r,this.kn<128&&(this.kn=128),this.kn>383&&(this.kn=383)));r=d.A.wu,p.A.yu=!0,p.A.Au=0,p.A.ea=this.ea-8,p.A.na=this.na-11,u.A.clear(),this.cn?.draw(this.Rn,this.Sn,this.Mn,t,this.xn,this.kn,this.hi),this.cn?.pu(),this.mu(),this.Iu(),$.K.Rt&&this.Eu(),this.gu(r),this._u(),this.es?.draw(8,11),this.Rn=i,this.Sn=s,this.Mn=h,this.kn=e,this.xn=n};Cu=()=>{e.A.Tu?.clear(),e.A.Ou?.clear(),r.A.Qo?.clear(),n.A.Qo?.clear(),n.A.vu?.clear(),W.A.Qo?.clear(),l.A.Qo?.clear()};bu=(t,i)=>{this.Lu(t.x,i,t.z)};Lu=(t,i,s)=>{if(t<128||s<128||t>13056||s>13056)return this.Ar=-1,void(this.pr=-1);const h=this.au(this.ir,t,s)-i;this.Ru(t,h,s)};Ru=(t,i,s)=>{let h=t-this.Rn,e=i-this.Sn,n=s-this.Mn;const r=d.A.sin[this.kn],o=d.A.cos[this.kn],l=d.A.sin[this.xn],a=d.A.cos[this.xn];let c=n*l+h*a>>16;n=n*a-h*l>>16,h=c,c=e*o-n*r>>16,n=e*r+n*o>>16,e=c,n>=50?(this.Ar=d.A.Sa+((h<<9)/n|0),this.pr=d.A.Ma+((e<<9)/n|0)):(this.Ar=-1,this.pr=-1)};mu=()=>{this.do=0;for(let t=-1;t-1))for(let t=0;t<8;t++)h.Su&1<=0&&10===this.Fh&&this.Hh===this.Sr[t]&&(this.bu(i,i.height+15),this.Ar>-1&&this.Hs[7]?.draw(this.Ar-12,this.pr-s))}else 1===this.Fh&&this.Uh===this.Br[t-this.Rr]&&this.hi%20<10&&(this.bu(i,i.height+15),this.Ar>-1&&this.Hs[2]?.draw(this.Ar-12,this.pr-28));if(i.Mu&&(t>=this.Rr||0===this.Qh||3===this.Qh||1===this.Qh&&this.ku(i.name))&&(this.bu(i,i.height),this.Ar>-1&&this.do<$.K.wo&&this.Pi&&(this.mo[this.do]=this.Pi.xu(i.Mu)/2|0,this.po[this.do]=this.Pi.height,this.yo[this.do]=this.Ar,this.Ao[this.do]=this.pr,this.Io[this.do]=i.Du,this.Eo[this.do]=i.Nu,this._o[this.do]=i.Pu,this.Co[this.do++]=i.Mu,0===this.Ae&&1===i.Nu&&(this.po[this.do]+=10,this.Ao[this.do]+=5),0===this.Ae&&2===i.Nu&&(this.mo[this.do]=60))),i.Fu>this.hi+100&&(this.bu(i,i.height+15),this.Ar>-1)){let t=30*i.Uu/i.Bu|0;t>30&&(t=30),u.A.fillRect(this.Ar-15,this.pr-3,t,5,m.A.GREEN),u.A.fillRect(this.Ar-15+t,this.pr-3,30-t,5,m.A.RED)}if(i.Fu>this.hi+330&&(this.bu(i,i.height/2|0),this.Ar>-1&&(this.Gs[i.Gu]?.draw(this.Ar-12,this.pr-12),this.Di?.Hc(this.Ar,this.pr+4,i.Hu.toString(),m.A.ca),this.Di?.Hc(this.Ar-1,this.pr+3,i.Hu.toString(),m.A.Kl))),$.K.Rt){if(i.pathLength>0||i.Wu>=this.hi||i.Yu>this.hi){const t=64*i.size;this.Vu(128*i.Uf[0]+t,128*i.Bf[0]+t,this.ir,i.size,65535,!1)}this.Vu(i.x,i.z,this.ir,i.size,6710886,!1);let s=0;if(this.bu(i,i.height+30),t32767&&(i-=32768),this.Di?.Hc(this.Ar,this.pr+s,'Face Entity: '+i,m.A.Kl),s-=15}(t.Ku&W.A.Ju)===W.A.Ju&&(this.Di?.Hc(this.Ar,this.pr+s,'Say',m.A.Kl),s-=15),(t.Ku&W.A.Qu)===W.A.Qu&&(this.Di?.Hc(this.Ar,this.pr+s,'Hit: Type '+t.Gu+' Amount '+t.Hu+' HP '+t.Uu+'/'+t.Bu,m.A.Kl),s-=15),(t.Ku&W.A.td)===W.A.td&&(this.Di?.Hc(this.Ar,this.pr+s,'Face Coord: '+t.sd/2+' '+t.hd/2,m.A.Kl),s-=15),(t.Ku&W.A.ed)===W.A.ed&&(this.Di?.Hc(this.Ar,this.pr+s,'Chat',m.A.Kl),s-=15),(t.Ku&W.A.nd)===W.A.nd&&(this.Di?.Hc(this.Ar,this.pr+s,'Play Spotanim: '+t.rd,m.A.Kl),s-=15),(t.Ku&W.A.od)===W.A.od&&(this.Di?.Hc(this.Ar,this.pr+s,'Exact Move',m.A.Kl),s-=15)}}else{const t=i;let s=0;if(this.bu(i,i.height+30),this.Di?.Hc(this.Ar,this.pr+s,t.type?.name??null,m.A.Kl),s-=15,-1!==t.Ku&&this.hi-t.Xu<30){if((t.Ku&Y.A.ju)===Y.A.ju&&(this.Di?.Hc(this.Ar,this.pr+s,'Play Seq: '+t.Zu,m.A.Kl),s-=15),(t.Ku&Y.A.qu)===Y.A.qu){let i=t.$u;i>32767&&(i-=32768),this.Di?.Hc(this.Ar,this.pr+s,'Face Entity: '+i,m.A.Kl),s-=15}(t.Ku&Y.A.Ju)===Y.A.Ju&&(this.Di?.Hc(this.Ar,this.pr+s,'Say',m.A.Kl),s-=15),(t.Ku&Y.A.Qu)===Y.A.Qu&&(this.Di?.Hc(this.Ar,this.pr+s,'Hit: Type '+t.Gu+' Amount '+t.Hu+' HP '+t.Uu+'/'+t.Bu,m.A.Kl),s-=15),(t.Ku&Y.A.ld)===Y.A.ld&&(this.Di?.Hc(this.Ar,this.pr+s,'Change Type: '+t.type?.id??null,m.A.Kl),s-=15),(t.Ku&Y.A.nd)===Y.A.nd&&(this.Di?.Hc(this.Ar,this.pr+s,'Play Spotanim: '+t.rd,m.A.Kl),s-=15),(t.Ku&Y.A.td)===Y.A.td&&(this.Di?.Hc(this.Ar,this.pr+s,'Face Coord: '+t.sd/2+' '+t.hd/2,m.A.Kl),s-=15)}}}}}if($.K.Rt)for(let t=0;t=104||i.z>=104||this.Vu(128*i.x+64,128*i.z+64,i.level,1,16776960,!1)}for(let t=0;tthis.Ao[r]-this.po[r]&&s-ethis.yo[r]-this.mo[r]&&this.Ao[r]-this.po[r]{2===this.Fh&&this.Hs[2]&&(this.Lu((this.Wh-this.Kn<<7)+this.Bh,2*this.Vh,(this.Yh-this.Xn<<7)+this.Gh),this.Ar>-1&&this.hi%20<10&&this.Hs[2].draw(this.Ar-12,this.pr-28))};Eu=()=>{const t=507;let i=13;this.jo?this.Di?.dd(t,i,'tock',m.A.fa,!0):this.Pi?.dd(t,i,'tick',m.A.fa,!0),i+=13,this.Di?.dd(t,i,`Fps: ${this.wd}, ${this.yd} ms`,m.A.fa,!0),i+=13,this.Di?.dd(t,i,`Draw: ${this.ms.toFixed(1)}, Avg: ${this.Ad.toFixed(1)}, Slow: ${this.pd.toFixed(1)} ms`,m.A.fa,!0),i+=13,this.Di?.dd(t,i,`Occluders: ${x.A.md[x.A.Id]} Active: ${x.A.Ed}`,m.A.fa,!0),i+=13,this.Di?.dd(t,i,'Local Pos: '+(this.Jr?.x??-1)+', '+(this.Jr?.z??-1)+', '+(this.Jr?.y??-1),m.A.fa,!0),i+=13,this.Di?.dd(t,i,'Camera Pos: '+this.Rn+', '+this.Mn+', '+this.Sn,m.A.fa,!0),i+=13,this.Di?.dd(t,i,'Camera Angle: '+this.xn+', '+this.kn,m.A.fa,!0),i+=13,this.Di?.dd(t,i,'Cutscene Source: '+this.Cr+', '+this.Tr+' '+this.Or+'; '+this.vr+', '+this.br,m.A.fa,!0),i+=13,this.Di?.dd(t,i,'Cutscene Destination: '+this.mr+', '+this.Ir+' '+this.Er+'; '+this.gr+', '+this._r,m.A.fa,!0),$.K.Mt&&(i+=13,this.Di?.dd(t,i,'Instructions:',m.A.fa,!0),i+=13,this.Di?.dd(t,i,'- Arrows to move Camera',m.A.fa,!0),i+=13,this.Di?.dd(t,i,'- Shift to control Source or Dest',m.A.fa,!0),i+=13,this.Di?.dd(t,i,'- Alt to control Height',m.A.fa,!0),i+=13,this.Di?.dd(t,i,'- Ctrl to control Modifier',m.A.fa,!0))};Vu=(t,i,s,h,e,n)=>{const r=this.au(s,t,i),o=64*h;this.Ru(t-o,r,i-o);const l=this.Ar,a=this.pr;this.Ru(t+o,r,i-o);const c=this.Ar,f=this.pr;this.Ru(t-o,r,i+o);const d=this.Ar,w=this.pr;this.Ru(t+o,r,i+o);const y=this.Ar,A=this.pr;-1!==l&&-1!==c&&-1!==d&&-1!==y&&(n&&(u.A.gd(l,a,y,A,(16711422&e)>>1),u.A.gd(c,f,d,w,(16711422&e)>>1)),u.A.gd(l,a,c,f,e),u.A.gd(l,a,d,w,e),u.A.gd(c,f,y,A,e),u.A.gd(d,w,y,A,e))};Vf(){const t=1==this.vf[5]?2:1;1==this.vf[6]?(1==this.vf[1]?(this.mr-=t,this.mr<1&&(this.mr=1)):1==this.vf[2]&&(this.mr+=t,this.mr>102&&(this.mr=102)),1==this.vf[3]?1==this.vf[7]?this.Er+=2*t:(this.Ir+=1,this.Ir>102&&(this.Ir=102)):1==this.vf[4]&&(1==this.vf[7]?this.Er-=2*t:(this.Ir-=1,this.Ir<1&&(this.Ir=1)))):(1==this.vf[1]?(this.Cr-=t,this.Cr<1&&(this.Cr=1)):1==this.vf[2]&&(this.Cr+=t,this.Cr>102&&(this.Cr=102)),1==this.vf[3]?1==this.vf[7]?this.Or+=2*t:(this.Tr+=t,this.Tr>102&&(this.Tr=102)):1==this.vf[4]&&(1==this.vf[7]?this.Or-=2*t:(this.Tr-=t,this.Tr<1&&(this.Tr=1)))),this.Rn=128*this.Cr+64,this.Mn=128*this.Tr+64,this.Sn=this.au(this.ir,this.Cr,this.Tr)-this.Or;const i=128*this.mr+64,s=128*this.Ir+64,h=this.au(this.ir,this.mr,this.Ir)-this.Er,e=i-this.Rn,n=h-this.Sn,r=s-this.Mn,o=0|Math.sqrt(e*e+r*r);this.kn=325.949*Math.atan2(n,o)&2047,this.xn=-325.949*Math.atan2(e,r)&2047,this.kn<128&&(this.kn=128),this.kn>383&&(this.kn=383)}_u=()=>{if(this._d(),1===this.Ah&&this.Ys[this.ph/100|0]?.draw(this.mh-8-8,this.Ih-8-11),2===this.Ah&&this.Ys[4+(this.ph/100|0)]?.draw(this.mh-8-8,this.Ih-8-11),-1!==this.wh&&(this.kl(this.wh,this.un),this.Gl(c.A.Jo[this.wh],0,0,0)),this.Cd(),this.gh?0===this._h&&this.Td():(this.Rf(),this.Od()),1===this.io&&(this.no>0||1===this.ro?this.Hs[1]?.draw(472,258):this.Hs[1]?.draw(472,296)),this.no>0&&(this.Hs[0]?.draw(472,296),this.Ni?.Hc(484,329,'Level: '+this.no,m.A.fa)),1===this.ro&&(this.Hs[6]?.draw(472,296),this.Ni?.Hc(484,329,'Arena',m.A.fa)),0!==this.fi){let t=this.fi/50|0;const i=t/60|0;t%=60,t<10?this.Ni?.la(4,329,'System update in: '+i+':0'+t,m.A.fa):this.Ni?.la(4,329,'System update in: '+i+':'+t,m.A.fa)}};_d=()=>{if(0===this.ye)return;const t=this.Ni;let i=0;0!==this.fi&&(i=1);for(let s=0;s<100;s++){if(!this.fe[s])continue;const h=this.messageType[s];let e;if((3===h||7===h)&&(7===h||0===this.te||1===this.te&&this.ku(this.ue[s]))&&(e=329-13*i,t?.la(4,e,'From '+this.ue[s]+': '+this.fe[s],m.A.ca),t?.la(4,e-1,'From '+this.ue[s]+': '+this.fe[s],m.A.$c),i++,i>=5))return;if(5===h&&this.te<2&&(e=329-13*i,t?.la(4,e,this.fe[s],m.A.ca),t?.la(4,e-1,this.fe[s],m.A.$c),i++,i>=5))return;if(6===h&&this.te<2&&(e=329-13*i,t?.la(4,e,'To '+this.ue[s]+': '+this.fe[s],m.A.ca),t?.la(4,e-1,'To '+this.ue[s]+': '+this.fe[s],m.A.$c),i++,i>=5))return}};Cd=()=>{if(!this.Jr)return;const t=(this.Jr.x>>7)+this.Kn,i=(this.Jr.z>>7)+this.Xn;if(this.no=t>=2944&&t<3392&&i>=3520&&i<6400?1+((i-3520)/8|0):t>=2944&&t<3392&&i>=9920&&i<12800?1+((i-9920)/8|0):0,this.ro=0,t>=3328&&t<3392&&i>=3200&&i<3264){const s=63&t,h=63&i;(s>=4&&s<=29&&h>=44&&h<=58||s>=36&&s<=61&&h>=44&&h<=58||s>=4&&s<=29&&h>=25&&h<=39||s>=36&&s<=61&&h>=25&&h<=39||s>=4&&s<=29&&h>=6&&h<=20||s>=36&&s<=61&&h>=6&&h<=20)&&(this.ro=1)}0===this.ro&&t>=3328&&t<=3393&&i>=3203&&i<=3325&&(this.ro=2),this.Eh=0,(t>=3053&&t<=3156&&i>=3056&&i<=3136||t>=3072&&t<=3118&&i>=9492&&i<=9535)&&(this.Eh=1),1===this.Eh&&t>=3139&&t<=3199&&i>=3008&&i<=3062&&(this.Eh=0)};Jf=()=>{this.ss?.bind(),this._s&&(d.A.xc=this._s),this.Ls?.draw(0,0),-1!==this.Sh?this.Gl(c.A.Jo[this.Sh],0,0,0):-1!==this.Jh[this.$h]&&this.Gl(c.A.Jo[this.Jh[this.$h]],0,0,0),this.gh&&1===this._h&&this.Td(),this.ss?.draw(562,231),this.es?.bind(),this.Cs&&(d.A.xc=this.Cs)};tu=()=>{if(this.ns?.bind(),this.gs&&(d.A.xc=this.gs),this.Rs?.draw(0,0),this.ee)this.Pi?.Hc(239,40,this.ne,m.A.ca),this.Pi?.Hc(239,60,this.re+'*',m.A.vd);else if(this.ae)this.Pi?.Hc(239,40,'Enter amount:',m.A.ca),this.Pi?.Hc(239,60,this.le+'*',m.A.vd);else if(this.Zh)this.Pi?.Hc(239,40,this.Zh,m.A.ca),this.Pi?.Hc(239,60,'Click to continue',m.A.vd);else if(-1!==this.Mh)this.Gl(c.A.Jo[this.Mh],0,0,0);else if(-1===this.ce){let t=this.Ni;0===$.K.St&&(t=this.Fi);let i=0;u.A.Hl(0,0,463,77);for(let s=0;s<100;s++){const h=this.fe[s];if(!h)continue;const e=this.messageType[s],n=this.Dh+70-14*i;0===e&&(n>0&&n<110&&t?.la(4,n,h,m.A.ca),i++),1===e&&(n>0&&n<110&&(t?.la(4,n,this.ue[s]+':',m.A.Kl),t?.la(t.xu(this.ue[s])+12,n,h,m.A.BLUE)),i++),2===e&&(0===this.Qh||1===this.Qh&&this.ku(this.ue[s]))&&(n>0&&n<110&&(t?.la(4,n,this.ue[s]+':',m.A.ca),t?.la(t.xu(this.ue[s])+12,n,h,m.A.BLUE)),i++),3!==e&&7!==e||0!==this.ye||!(7===e||0===this.te||1===this.te&&this.ku(this.ue[s]))||(n>0&&n<110&&(t?.la(4,n,'From '+this.ue[s]+':',m.A.ca),t?.la(t.xu('From '+this.ue[s])+12,n,h,m.A.bd)),i++),4===e&&(0===this.ie||1===this.ie&&this.ku(this.ue[s]))&&(n>0&&n<110&&t?.la(4,n,this.ue[s]+' '+this.fe[s],m.A.Ld),i++),5===e&&0===this.ye&&this.te<2&&(n>0&&n<110&&t?.la(4,n,h,m.A.bd),i++),6===e&&0===this.ye&&this.te<2&&(n>0&&n<110&&(t?.la(4,n,'To '+this.ue[s]+':',m.A.ca),t?.la(t.xu('To '+this.ue[s])+12,n,h,m.A.bd)),i++),8===e&&(0===this.ie||1===this.ie&&this.ku(this.ue[s]))&&(n>0&&n<110&&t?.la(4,n,this.ue[s]+' '+this.fe[s],m.A.Rd),i++)}u.A.ud(),this.xh=14*i+7,this.xh<78&&(this.xh=78),this.Ol(463,0,this.xh-this.Dh-77,this.xh,77),0==$.K.St?t?.la(3,90,this.pe+'*',m.A.ca):1==$.K.St?t?.la(3,90,this.pe+'*',m.A.BLUE):(t?.la(4,90,M.A.za(this.username)+':',m.A.ca),t?.la(t.xu(this.username+': ')+6,90,this.pe+'*',m.A.BLUE)),u.A.Sl(0,77,m.A.ca,479)}else this.Gl(c.A.Jo[this.ce],0,0,0);this.gh&&2===this._h&&this.Td(),this.ns?.draw(22,375),this.es?.bind(),this.Cs&&(d.A.xc=this.Cs)};iu=()=>{if(this.hs?.bind(),!this.Jr)return;const t=this.er+this.Pn&2047;let i=48+(this.Jr.x/32|0),s=464-(this.Jr.z/32|0);this.Ps?.Sd(21,9,146,151,this.vs,this.bs,i,s,t,this.Fn+256),this.Fs?.Sd(0,0,33,33,this.Ts,this.Os,25,25,this.er,256);for(let t=0;t{if(!i)return;const h=this.er+this.Pn&2047,e=s*s+t*t;if(e>6400)return;let n=d.A.sin[h],r=d.A.cos[h];n=256*n/(this.Fn+256)|0,r=256*r/(this.Fn+256)|0;const o=t*n+s*r>>16,l=t*r-s*n>>16;e>2500&&this.Ss?i.Dd(o+94-(i.oa/2|0),83-l-(i.Nd/2|0),this.Ss):i.draw(o+94-(i.oa/2|0),83-l-(i.Nd/2|0))};Pd=t=>{if(!this.Ps)return;const i=this.Ps.Mc,s=i.length;for(let t=0;t>14&32767;const h=e.A.get(s).Gd;if(h<0)continue;let n=t,r=i;if(22!==h&&29!==h&&34!==h&&36!==h&&46!==h&&47!==h&&48!==h){const s=G.A.yr,h=G.A.yr,e=this.Qn[this.ir];if(e){const o=e.flags;for(let e=0;e<10;e++){const e=4*Math.random()|0;0===e&&n>0&&n>t-3&&(o[G.A.index(n-1,r)]&H.A.Hd)===H.A.OPEN&&n--,1===e&&n0&&r>i-3&&(o[G.A.index(n,r-1)]&H.A.Yd)===H.A.OPEN&&r--,3===e&&r{if(!this.cn||!this.Ps)return;let r=this.cn.Kd(s,t,i);if(0!==r){const o=this.cn.Xd(s,t,i,r),l=o>>6&3,a=31&o;let c=h;r>0&&(c=n);const f=this.Ps.Mc,u=4*t+512*(103-i)*4+24624,d=r>>14&32767,w=e.A.get(d);if(-1===w.zd)a!==P.A.jd.id&&a!==P.A.Zd.id||(l===F.A.qd?(f[u]=c,f[u+512]=c,f[u+1024]=c,f[u+1536]=c):l===F.A.$d?(f[u]=c,f[u+1]=c,f[u+2]=c,f[u+3]=c):l===F.A.Jd?(f[u+3]=c,f[u+3+512]=c,f[u+3+1024]=c,f[u+3+1536]=c):l===F.A.Qd&&(f[u+1536]=c,f[u+1536+1]=c,f[u+1536+2]=c,f[u+1536+3]=c)),a===P.A.tw.id&&(l===F.A.qd?f[u]=c:l===F.A.$d?f[u+3]=c:l===F.A.Jd?f[u+3+1536]=c:l===F.A.Qd&&(f[u+1536]=c)),a===P.A.Zd.id&&(l===F.A.Qd?(f[u]=c,f[u+512]=c,f[u+1024]=c,f[u+1536]=c):l===F.A.qd?(f[u]=c,f[u+1]=c,f[u+2]=c,f[u+3]=c):l===F.A.$d?(f[u+3]=c,f[u+3+512]=c,f[u+3+1024]=c,f[u+3+1536]=c):l===F.A.Jd&&(f[u+1536]=c,f[u+1536+1]=c,f[u+1536+2]=c,f[u+1536+3]=c));else{const s=this.Us[w.zd];if(s){const h=(4*w.width-s.width)/2|0,e=(4*w.length-s.height)/2|0;s.draw(4*t+48+h,4*(G.A.yr-i-w.length)+e+48)}}}if(r=this.cn.iw(s,t,i),0!==r){const h=this.cn.Xd(s,t,i,r),n=h>>6&3,o=31&h,l=r>>14&32767,a=e.A.get(l);if(-1!==a.zd){const s=this.Us[a.zd];if(s){const h=(4*a.width-s.width)/2|0,e=(4*a.length-s.height)/2|0;s.draw(4*t+48+h,4*(G.A.yr-i-a.length)+e+48)}}else if(o===P.A.sw.id){let s=15658734;r>0&&(s=15597568);const h=this.Ps.Mc,e=4*t+512*(G.A.yr-1-i)*4+24624;n===F.A.qd||n===F.A.Jd?(h[e+1536]=s,h[e+1024+1]=s,h[e+512+2]=s,h[e+3]=s):(h[e]=s,h[e+512+1]=s,h[e+1024+2]=s,h[e+1536+3]=s)}}if(r=this.cn.Bd(s,t,i),0!==r){const s=e.A.get(r>>14&32767);if(-1!==s.zd){const h=this.Us[s.zd];if(h){const e=(4*s.width-h.width)/2|0,n=(4*s.length-h.height)/2|0;h.draw(4*t+48+e,4*(G.A.yr-i-s.length)+n+48)}}}};Od=()=>{if(this.Lh<2&&0===this.Le&&0===this.Ge)return;let t;t=1===this.Le&&this.Lh<2?'Use '+this.ke+' with...':1===this.Ge&&this.Lh<2?this.Ye+'...':this.Rh[this.Lh-1],this.Lh>2&&(t=t+'@whi@ / '+(this.Lh-2)+' more options'),this.Pi?.hw(4,15,t,m.A.Kl,!0,this.hi/1e3|0)};Td=()=>{const t=this.Ch,i=this.Th,s=this.Oh,h=this.bh,e=m.A.ew;u.A.fillRect(t,i,s,h,e),u.A.fillRect(t+1,i+1,s-2,16,m.A.ca),u.A.Vl(t+1,i+18,s-2,h-19,m.A.ca),this.Pi?.la(t+3,i+14,'Choose Option',e);let n=this.ea,r=this.na;0===this._h&&(n-=8,r-=11),1===this._h&&(n-=562,r-=231),2===this._h&&(n-=22,r-=375);for(let h=0;ht&&ne-13&&r{if(0!==this.Ce)return;let t=this.Qc;if(1===this.Ge&&this.tf>=520&&this.if>=165&&this.tf<=788&&this.if<=230&&(t=0),this.gh){if(1!==t){let t=this.ea,i=this.na;0===this._h?(t-=8,i-=11):1===this._h?(t-=562,i-=231):2===this._h&&(t-=22,i-=375),(tthis.Ch+this.Oh+10||ithis.Th+this.bh+10)&&(this.gh=!1,1===this._h&&(this.ah=!0),2===this._h&&(this.fh=!0))}if(1===t){const t=this.Ch,i=this.Th,s=this.Oh;let h=this.tf,e=this.if;0===this._h?(h-=8,e-=11):1===this._h?(h-=562,e-=231):2===this._h&&(h-=22,e-=375);let n=-1;for(let r=0;rt&&ho-13&&e0){const t=this.Ke[this.Lh-1];if(602===t||596===t||22===t||892===t||415===t||405===t||38===t||422===t||478===t||347===t||188===t){const t=this.ze[this.Lh-1],i=this.je[this.Lh-1];if(c.A.Jo[i].draggable)return this.be=!1,this.ve=0,this.ge=i,this._e=t,this.Ce=2,this.Te=this.tf,this.Oe=this.if,c.A.Jo[i].nw===this.wh&&(this.Ce=1),void(c.A.Jo[i].nw===this.Mh&&(this.Ce=3))}}if(1===t&&(1===this.Ve||this.Mf(this.Lh-1))&&this.Lh>2&&(t=2),1===t&&this.Lh>0&&await this.xf(this.Lh-1),2!==t||this.Lh<=0)return;this.kf()}};Hf=()=>{if(1===this.Qc&&this.Jr){let t=this.tf-21-561,i=this.if-9-5;if(t>=0&&i>=0&&t<146&&i<151){t-=73,i-=75;const s=this.er+this.Pn&2047;let h=d.A.sin[s],e=d.A.cos[s];h=h*(this.Fn+256)>>8,e=e*(this.Fn+256)>>8;const n=i*h+t*e>>11,r=i*e-t*h>>11,o=this.Jr.x+n>>7,l=this.Jr.z-r>>7;this.Ff(this.Jr.Uf[0],this.Jr.Bf[0],o,l,1,0,0,0,0,0,!0)&&(this.ri.p1(t),this.ri.p1(i),this.ri.p2(this.er),this.ri.p1(57),this.ri.p1(this.Pn),this.ri.p1(this.Fn),this.ri.p1(89),this.ri.p2(this.Jr.x),this.ri.p2(this.Jr.z),this.ri.p1(this.$r),this.ri.p1(63))}}};Mf=t=>{if(t<0)return!1;let i=this.Ke[t];return i>=2e3&&(i-=2e3),406===i};xf=async t=>{if(t<0)return;this.ae&&(this.ae=!1,this.fh=!0);let i=this.Ke[t];const s=this.Xe[t],h=this.ze[t],r=this.je[t];if(i>=2e3&&(i-=2e3),903===i||363===i){let s=this.Rh[t];const h=s.indexOf('@whi@');if(-1!==h){s=s.substring(h+5).trim();const t=M.A.za(M.A.ja(M.A.xd(s)));let e=!1;for(let s=0;s=90&&this.ri.If(O.A.fw),this.ri.If(O.A.uw)):347===i?this.ri.If(O.A.dw):422===i?this.ri.If(O.A.ww):405===i?($.K.Wt+=s,$.K.Wt>=97&&(this.ri.If(O.A.yw),this.ri.p3(14953816)),this.ri.If(O.A.Aw)):38===i&&this.ri.If(O.A.pw),this.ri.p2(s),this.ri.p2(h),this.ri.p2(r),this.Pe=0,this.Ne=r,this.De=h,this.xe=2,c.A.Jo[r].nw===this.wh&&(this.xe=1),c.A.Jo[r].nw===this.Mh&&(this.xe=3);else if(728===i||542===i||6===i||963===i||245===i){const t=this.Fr[s];t&&this.Jr&&(this.Ff(this.Jr.Uf[0],this.Jr.Bf[0],t.Uf[0],t.Bf[0],2,1,1,0,0,0,!1),this.mh=this.tf,this.Ih=this.if,this.Ah=2,this.ph=0,542===i?this.ri.If(O.A.mw):6===i?(3&s||$.K.Ht++,$.K.Ht>=124&&(this.ri.If(O.A.Iw),this.ri.p4(0)),this.ri.If(O.A.Ew)):963===i?this.ri.If(O.A.gw):728===i?this.ri.If(O.A._w):245===i&&(3&s||$.K.Yt++,$.K.Yt>=85&&(this.ri.If(O.A.Cw),this.ri.p2(39596)),this.ri.If(O.A.Tw)),this.ri.p2(s))}else if(217===i){if(this.Jr){this.Ff(this.Jr.Uf[0],this.Jr.Bf[0],h,r,2,0,0,0,0,0,!1)||this.Ff(this.Jr.Uf[0],this.Jr.Bf[0],h,r,2,1,1,0,0,0,!1),this.mh=this.tf,this.Ih=this.if,this.Ah=2,this.ph=0,this.ri.If(O.A.Ow),this.ri.p2(h+this.Kn),this.ri.p2(r+this.Xn),this.ri.p2(s),this.ri.p2(this.Me),this.ri.p2(this.Re),this.ri.p2(this.Se)}}else if(1175===i){const t=s>>14&32767,i=e.A.get(t);let h;h=i.bw?i.bw:"It's a "+i.name+'.',this.lw(0,h,'')}else if(285===i)this.aw(O.A.Lw,h,r,s);else if(881===i)this.ri.If(O.A.Rw),this.ri.p2(s),this.ri.p2(h),this.ri.p2(r),this.ri.p2(this.Me),this.ri.p2(this.Re),this.ri.p2(this.Se),this.Pe=0,this.Ne=r,this.De=h,this.xe=2,c.A.Jo[r].nw===this.wh&&(this.xe=1),c.A.Jo[r].nw===this.Mh&&(this.xe=3);else if(391===i)this.ri.If(O.A.Sw),this.ri.p2(s),this.ri.p2(h),this.ri.p2(r),this.ri.p2(this.He),this.Pe=0,this.Ne=r,this.De=h,this.xe=2,c.A.Jo[r].nw===this.wh&&(this.xe=1),c.A.Jo[r].nw===this.Mh&&(this.xe=3);else if(660===i)this.gh?this.cn?.click(h-8,r-11):this.cn?.click(this.tf-8,this.if-11);else{if(188===i)return this.Le=1,this.Re=h,this.Se=r,this.Me=s,this.ke=n.A.get(s).name,void(this.Ge=0);if(44===i)this.Fe||(this.ri.If(O.A.Mw),this.ri.p2(r),this.Fe=!0);else if(1773===i){const t=n.A.get(s);let i;i=r>=1e5?r+' x '+t.name:t.bw?t.bw:"It's a "+t.name+'.',this.lw(0,i,'')}else if(900===i){const t=this.Fr[s];t&&this.Jr&&(this.Ff(this.Jr.Uf[0],this.Jr.Bf[0],t.Uf[0],t.Bf[0],2,1,1,0,0,0,!1),this.mh=this.tf,this.Ih=this.if,this.Ah=2,this.ph=0,this.ri.If(O.A.kw),this.ri.p2(s),this.ri.p2(this.Me),this.ri.p2(this.Re),this.ri.p2(this.Se))}else if(1373===i||1544===i||151===i||1101===i){const t=this.Lr[s];t&&this.Jr&&(this.Ff(this.Jr.Uf[0],this.Jr.Bf[0],t.Uf[0],t.Bf[0],2,1,1,0,0,0,!1),this.mh=this.tf,this.Ih=this.if,this.Ah=2,this.ph=0,1101===i?this.ri.If(O.A.ow):151===i?($.K.zt++,$.K.zt>=90&&(this.ri.If(O.A.xw),this.ri.p2(31114)),this.ri.If(O.A.Dw)):1373===i?this.ri.If(O.A.rw):1544===i&&this.ri.If(O.A.Nw),this.ri.p2(s))}else if(265===i){const t=this.Fr[s];t&&this.Jr&&(this.Ff(this.Jr.Uf[0],this.Jr.Bf[0],t.Uf[0],t.Bf[0],2,1,1,0,0,0,!1),this.mh=this.tf,this.Ih=this.if,this.Ah=2,this.ph=0,this.ri.If(O.A.Pw),this.ri.p2(s),this.ri.p2(this.He))}else if(679===i){const i=this.Rh[t],s=i.indexOf('@whi@');if(-1!==s){const t=M.A.xd(i.substring(s+5).trim());let h=-1;for(let i=0;i0&&(this.fh=!0,this.ae=!1,this.ee=!0,this.re='',this.oe=3,this.bo=this.Oo[h],this.ne='Enter message to send to '+this.To[h])}}else if(55===i)this.aw(O.A.Fw,h,r,s)&&this.ri.p2(this.He);else if(224===i||993===i||99===i||746===i||877===i){if(this.Jr){this.Ff(this.Jr.Uf[0],this.Jr.Bf[0],h,r,2,0,0,0,0,0,!1)||this.Ff(this.Jr.Uf[0],this.Jr.Bf[0],h,r,2,1,1,0,0,0,!1),this.mh=this.tf,this.Ih=this.if,this.Ah=2,this.ph=0,224===i?this.ri.If(O.A.Uw):746===i?this.ri.If(O.A.Bw):877===i?this.ri.If(O.A.Gw):99===i?this.ri.If(O.A.Hw):993===i&&this.ri.If(O.A.Ww),this.ri.p2(h+this.Kn),this.ri.p2(r+this.Xn),this.ri.p2(s)}}else if(1607===i){const t=this.Fr[s];if(t&&t.type){let i;i=t.type.bw?t.type.bw:"It's a "+t.type.name+'.',this.lw(0,i,'')}}else if(504===i)this.aw(O.A.Yw,h,r,s);else{if(930===i){const t=c.A.Jo[r];this.Ge=1,this.He=r,this.We=t.Vw,this.Le=0;let i=t.Kw;i&&-1!==i.indexOf(' ')&&(i=i.substring(0,i.indexOf(' ')));let s=t.Kw;return s&&-1!==s.indexOf(' ')&&(s=s.substring(s.indexOf(' ')+1)),this.Ye=i+' '+t.action+' '+s,void(16===this.We&&(this.ah=!0,this.$h=3,this.uh=!0))}if(951===i){const t=c.A.Jo[r];let i=!0;t.Xl>0&&(i=this.Xw(t)),i&&(this.ri.If(O.A.zw),this.ri.p2(r))}else if(602===i||596===i||22===i||892===i||415===i)22===i?this.ri.If(O.A.jw):415===i?(3&r||$.K.Xt++,$.K.Xt>=55&&(this.ri.If(O.A.Zw),this.ri.p4(0)),this.ri.If(O.A.qw)):602===i?this.ri.If(O.A.$w):892===i?(3&h||$.K.jt++,$.K.jt>=130&&(this.ri.If(O.A.Jw),this.ri.p1(177)),this.ri.If(O.A.Qw)):596===i&&this.ri.If(O.A.ty),this.ri.p2(s),this.ri.p2(h),this.ri.p2(r),this.Pe=0,this.Ne=r,this.De=h,this.xe=2,c.A.Jo[r].nw===this.wh&&(this.xe=1),c.A.Jo[r].nw===this.Mh&&(this.xe=3);else if(581===i)3&s||$.K.Gt++,$.K.Gt>=99&&(this.ri.If(O.A.iy),this.ri.p4(0)),this.aw(O.A.sy,h,r,s);else if(965===i){if(this.Jr){this.Ff(this.Jr.Uf[0],this.Jr.Bf[0],h,r,2,0,0,0,0,0,!1)||this.Ff(this.Jr.Uf[0],this.Jr.Bf[0],h,r,2,1,1,0,0,0,!1),this.mh=this.tf,this.Ih=this.if,this.Ah=2,this.ph=0,this.ri.If(O.A.hy),this.ri.p2(h+this.Kn),this.ri.p2(r+this.Xn),this.ri.p2(s),this.ri.p2(this.He)}}else if(1501===i)$.K.Kt+=this.Xn,$.K.Kt>=92&&(this.ri.If(O.A.ey),this.ri.p4(0)),this.aw(O.A.ny,h,r,s);else if(364===i)this.aw(O.A.oy,h,r,s);else if(1102===i){const t=n.A.get(s);let i;i=t.bw?t.bw:"It's a "+t.name+'.',this.lw(0,i,'')}else if(960===i){this.ri.If(O.A.zw),this.ri.p2(r);const t=c.A.Jo[r];if(t.scripts&&t.scripts[0]&&5===t.scripts[0][0]){const i=t.scripts[0][1];t.Tl&&this.Ue[i]!==t.Tl[0]&&(this.Ue[i]=t.Tl[0],await this.ly(i),this.ah=!0)}}else if(34===i){const i=this.Rh[t],s=i.indexOf('@whi@');if(-1!==s){this.uy(),this.Je=i.substring(s+5).trim(),this.Qe=!1;for(let t=0;t{const i=t.Xl;if(i===c.A.Ey&&(this.fh=!0,this.ae=!1,this.ee=!0,this.re='',this.oe=1,this.ne='Enter name of friend to add to list'),i===c.A.gy&&(this.fh=!0,this.ae=!1,this.ee=!0,this.re='',this.oe=2,this.ne='Enter name of friend to delete from list'),i===c.A._y)return this.ci=250,!0;if(i===c.A.Cy&&(this.fh=!0,this.ae=!1,this.ee=!0,this.re='',this.oe=4,this.ne='Enter name of player to add to list'),i===c.A.Ty&&(this.fh=!0,this.ae=!1,this.ee=!0,this.re='',this.oe=5,this.ne='Enter name of player to delete from list'),i>=c.A.Oy&&i<=c.A.vy){const t=(i-300)/2|0,s=1&i;let h=this.co[t];if(-1!==h)for(;;)if(0===s&&(h--,h<0&&(h=o.A.count-1)),1===s&&(h++,h>=o.A.count&&(h=0)),!o.A.Jo[h].disable&&o.A.Jo[h].type===t+(this.lo?0:7)){this.co[t]=h,this.ao=!0;break}}if(i>=c.A.by&&i<=c.A.Ly){const t=(i-314)/2|0,s=1&i;let h=this.fo[t];0===s&&(h--,h<0&&(h=W.A.Qa[t].length-1)),1===s&&(h++,h>=W.A.Qa[t].length&&(h=0)),this.fo[t]=h,this.ao=!0}if(i!==c.A.nc||this.lo||(this.lo=!0,this.yf()),i===c.A.rc&&this.lo&&(this.lo=!1,this.yf()),i===c.A.Ry){this.ri.If(O.A.Sy),this.ri.p1(this.lo?0:1);for(let t=0;t<7;t++)this.ri.p1(this.co[t]);for(let t=0;t<5;t++)this.ri.p1(this.fo[t]);return!0}return i===c.A.lc&&(this.Qe=!this.Qe),i>=c.A.My&&i<=c.A.ky&&(this.uy(),this.Je.length>0&&(this.ri.If(O.A.xy),this.ri.Dy(M.A.xd(this.Je)),this.ri.p1(i-601),this.ri.p1(this.Qe?1:0))),!1};yf=()=>{this.ao=!0;for(let t=0;t<7;t++){this.co[t]=-1;for(let i=0;i{if(!this.Jr||!this.cn)return!1;const n=h>>14&32767,r=this.cn.Xd(this.ir,i,s,h);if(-1===r)return!1;const o=31&r,l=r>>6&3;if(o===P.A.Ny.id||o===P.A.Py.id||o===P.A.Fy.id){const t=e.A.get(n);let h,r;l===F.A.qd||l===F.A.Jd?(h=t.width,r=t.length):(h=t.length,r=t.width);let o=t.Uy;0!==l&&(o=(o<>4-l)),this.Ff(this.Jr.Uf[0],this.Jr.Bf[0],i,s,2,h,r,0,0,o,!1)}else this.Ff(this.Jr.Uf[0],this.Jr.Bf[0],i,s,2,0,0,l,o+1,0,!1);return this.mh=this.tf,this.Ih=this.if,this.Ah=2,this.ph=0,this.ri.If(t),this.ri.p2(i+this.Kn),this.ri.p2(s+this.Xn),this.ri.p2(n),!0};Wf=()=>{1===this.Qc&&(this.tf>=549&&this.tf<=583&&this.if>=195&&this.if<231&&-1!==this.Jh[0]?(this.ah=!0,this.$h=0,this.uh=!0):this.tf>=579&&this.tf<=609&&this.if>=194&&this.if<231&&-1!==this.Jh[1]?(this.ah=!0,this.$h=1,this.uh=!0):this.tf>=607&&this.tf<=637&&this.if>=194&&this.if<231&&-1!==this.Jh[2]?(this.ah=!0,this.$h=2,this.uh=!0):this.tf>=635&&this.tf<=679&&this.if>=194&&this.if<229&&-1!==this.Jh[3]?(this.ah=!0,this.$h=3,this.uh=!0):this.tf>=676&&this.tf<=706&&this.if>=194&&this.if<231&&-1!==this.Jh[4]?(this.ah=!0,this.$h=4,this.uh=!0):this.tf>=704&&this.tf<=734&&this.if>=194&&this.if<231&&-1!==this.Jh[5]?(this.ah=!0,this.$h=5,this.uh=!0):this.tf>=732&&this.tf<=766&&this.if>=195&&this.if<231&&-1!==this.Jh[6]?(this.ah=!0,this.$h=6,this.uh=!0):this.tf>=550&&this.tf<=584&&this.if>=492&&this.if<528&&-1!==this.Jh[7]?(this.ah=!0,this.$h=7,this.uh=!0):this.tf>=582&&this.tf<=612&&this.if>=492&&this.if<529&&-1!==this.Jh[8]?(this.ah=!0,this.$h=8,this.uh=!0):this.tf>=609&&this.tf<=639&&this.if>=492&&this.if<529&&-1!==this.Jh[9]?(this.ah=!0,this.$h=9,this.uh=!0):this.tf>=637&&this.tf<=681&&this.if>=493&&this.if<528&&-1!==this.Jh[10]?(this.ah=!0,this.$h=10,this.uh=!0):this.tf>=679&&this.tf<=709&&this.if>=492&&this.if<529&&-1!==this.Jh[11]?(this.ah=!0,this.$h=11,this.uh=!0):this.tf>=706&&this.tf<=736&&this.if>=492&&this.if<529&&-1!==this.Jh[12]?(this.ah=!0,this.$h=12,this.uh=!0):this.tf>=734&&this.tf<=768&&this.if>=492&&this.if<528&&-1!==this.Jh[13]&&(this.ah=!0,this.$h=13,this.uh=!0),$.K.Dt++,$.K.Dt>150&&($.K.Dt=0,this.ri.If(O.A.By),this.ri.p1(43)))};zf=async()=>{for(;;){let t;do{for(;;){if(t=this.hf(),-1===t)return;if(-1!==this.wh&&this.wh===this.tn){8===t&&this.Je.length>0&&(this.Je=this.Je.substring(0,this.Je.length-1));break}if(this.ee){if(t>=32&&t<=122&&this.re.length<80&&(this.re=this.re+String.fromCharCode(t),this.fh=!0),8===t&&this.re.length>0&&(this.re=this.re.substring(0,this.re.length-1),this.fh=!0),13===t||10===t){let t;if(this.ee=!1,this.fh=!0,1===this.oe&&(t=M.A.xd(this.re),this.yy(t)),2===this.oe&&this.uo>0&&(t=M.A.xd(this.re),this.py(t)),3===this.oe&&this.re.length>0&&this.bo){this.ri.If(O.A.Gy),this.ri.p1(0);const t=this.ri.ft;this.ri.Dy(this.bo),b.A.Hy(this.ri,this.re),this.ri.fu(this.ri.ft-t),this.re=M.A.Wy(this.re),this.re=v.A.filter(this.re),this.lw(6,this.re,M.A.za(M.A.ja(this.bo))),2===this.te&&(this.te=1,this.dh=!0,this.ri.If(O.A.Yy),this.ri.p1(this.Qh),this.ri.p1(this.te),this.ri.p1(this.ie))}4===this.oe&&this.Nh<100&&(t=M.A.xd(this.re),this.Ay(t)),5===this.oe&&this.Nh>0&&(t=M.A.xd(this.re),this.my(t))}}else if(this.ae){if(t>=48&&t<=57&&this.le.length<10&&(this.le=this.le+String.fromCharCode(t),this.fh=!0),8===t&&this.le.length>0&&(this.le=this.le.substring(0,this.le.length-1),this.fh=!0),13===t||10===t){if(this.le.length>0){let t=0;try{t=parseInt(this.le,10)}catch(t){}this.ri.If(O.A.Vy),this.ri.p4(t)}this.ae=!1,this.fh=!0}}else if(-1===this.Mh&&(t>=32&&t<=122&&this.pe.length<80&&(this.pe=this.pe+String.fromCharCode(t),this.fh=!0),8===t&&this.pe.length>0&&(this.pe=this.pe.substring(0,this.pe.length-1),this.fh=!0),(13===t||10===t)&&this.pe.length>0)){if('::clientdrop'===this.pe)await this.gf();else if(this.oo&&'::noclip'===this.pe)for(let t=0;t122)&&(t<65||t>90)&&(t<48||t>57)&&32!==t);this.Je.length<12&&(this.Je=this.Je+String.fromCharCode(t))}};Yf=()=>{if(1===this.Qc)if(this.tf>=8&&this.tf<=108&&this.if>=490&&this.if<=522)this.Qh=(this.Qh+1)%4,this.dh=!0,this.fh=!0,this.ri.If(O.A.Yy),this.ri.p1(this.Qh),this.ri.p1(this.te),this.ri.p1(this.ie);else if(this.tf>=137&&this.tf<=237&&this.if>=490&&this.if<=522)this.te=(this.te+1)%3,this.dh=!0,this.fh=!0,this.ri.If(O.A.Yy),this.ri.p1(this.Qh),this.ri.p1(this.te),this.ri.p1(this.ie);else if(this.tf>=275&&this.tf<=375&&this.if>=490&&this.if<=522)this.ie=(this.ie+1)%3,this.dh=!0,this.fh=!0,this.ri.If(O.A.Yy),this.ri.p1(this.Qh),this.ri.p1(this.te),this.ri.p1(this.ie);else if(this.tf>=416&&this.tf<=516&&this.if>=490&&this.if<=522){this.uy(),this.Je='',this.Qe=!1;for(let t=0;t{if(this.se?this.he=32:this.he=0,this.se=!1,t>=n&&t=r&&i=n&&t=r+h-16&&i=n-this.he&&t=r+16&&i0){let t=(h-32)*h/s|0;t<8&&(t=8);const n=i-r-(t/2|0)-16,l=h-t-32;o.Zl=(s-h)*n/l|0,e&&(this.ah=!0),this.se=!0}};Af=()=>{this.ns||(this.$o(),this.tl=null,this.gi=null,this._i=null,this.Ci=null,this.Ti=null,this.Oi=null,this.vi=null,this.bi=null,this.Li=null,this.Ri=null,this.ns=new f.A(479,96),this.hs=new f.A(168,160),u.A.clear(),this.Ss?.draw(0,0),this.ss=new f.A(190,261),this.es=new f.A(512,334),u.A.clear(),this.rs=new f.A(501,61),this.os=new f.A(288,40),this.ls=new f.A(269,66),this.mi=!0)};ku=t=>{if(!t)return!1;for(let i=0;i{if(0n===t)return;if(this.uo>=100)return void this.lw(0,'Your friends list is full. Max of 100 hit','');const i=M.A.za(M.A.ja(t));for(let s=0;s{if(0n!==t)for(let i=0;i{if(0n===t)return;if(this.Nh>=100)return void this.lw(0,'Your ignore list is full. Max of 100 hit','');const i=M.A.za(M.A.ja(t));for(let s=0;s{if(0n!==t)for(let i=0;i{const s=this.Vr[this.ir][t][i];if(!s)return void this.cn?.Qy(this.ir,t,i);let h=-99999999,e=null;for(let t=s.head();t;t=s.next()){const i=n.A.get(t.index);let s=i.tA;i.Ua&&(s*=t.count+1),s>h&&(h=s,e=t)}if(!e)return;s.iA(e);let r=-1,o=-1,l=0,a=0;for(let t=s.head();t;t=s.next())t.index!==e.index&&-1===r&&(r=t.index,l=t.count),t.index!==e.index&&t.index!==r&&-1===o&&(o=t.index,a=t.count);let c=null;-1!==r&&(c=n.A.get(r).sA(l));let f=null;-1!==o&&(f=n.A.get(o).sA(a));const u=t+(i<<7)+1610612736|0,d=n.A.get(e.index);this.cn?.hA(t,i,this.au(this.ir,128*t+64,128*i+64),this.ir,u,d.sA(e.count),f,c)};eA=(t,i,s,h,n,r,o)=>{if(i<1||s<1||i>102||s>102)return;if($.K.vt&&t!==this.ir)return;if(!this.cn)return;let l=0;if(o===N.A.nA&&(l=this.cn.Kd(t,i,s)),o===N.A.rA&&(l=this.cn.oA(t,s,i)),o===N.A.lA&&(l=this.cn.iw(t,i,s)),o===N.A.Fy&&(l=this.cn.Bd(t,i,s)),0!==l){const h=this.cn.Xd(t,i,s,l),n=l>>14&32767,r=31&h,a=h>>6;if(o===N.A.nA){this.cn?.aA(t,i,s,1);const h=e.A.get(n);h.cA&&this.Qn[t]?.aA(i,s,r,a,h.fA)}if(o===N.A.rA&&this.cn?.uA(t,i,s),o===N.A.lA){this.cn.dA(t,i,s);const h=e.A.get(n);if(i+h.width>G.A.yr-1||s+h.width>G.A.yr-1||i+h.length>G.A.yr-1||s+h.length>G.A.yr-1)return;h.cA&&this.Qn[t]?.dA(i,s,h.width,h.length,a,h.fA)}if(o===N.A.Fy){this.cn?.wA(t,i,s);const h=e.A.get(n);h.cA&&h.active&&this.Qn[t]?.yA(i,s)}}if(h>=0){let e=t;this.ur&&t<3&&!(2&~this.ur[1][i][s])&&(e=t+1),this.cr&&D.A.eA(t,i,s,this.cn,this.cr,this.Wr,this.Qn[t],h,r,n,e)}};uy=()=>{this.ri.If(O.A.AA),-1!==this.Sh&&(this.Sh=-1,this.ah=!0,this.Fe=!1,this.uh=!0),-1!==this.Mh&&(this.Mh=-1,this.fh=!0,this.Fe=!1),this.wh=-1};gf=async()=>{this.ci>0?await this.pA():(this.es?.bind(),this.Ni?.Hc(257,144,'Connection lost',m.A.ca),this.Ni?.Hc(256,143,'Connection lost',m.A.Kl),this.Ni?.Hc(257,159,'Please wait - attempting to reestablish',m.A.ca),this.Ni?.Hc(256,158,'Please wait - attempting to reestablish',m.A.Kl),this.es?.draw(8,11),this.wn=0,this.stream?.close(),this.Nc=!1,await this.sf(this.username,this.password,!0),this.Nc||await this.pA())};pA=async()=>{this.stream&&this.stream.close(),this.stream=null,this.Nc=!1,this.Ii=0,this.username='',this.password='',k.A.df(),this.Cu(),this.cn?.reset();for(let t=0;t{if(!this.stream)return!1;try{let t=this.stream.available;if(0===t)return!1;if(-1===this.di&&(await this.stream.lf(this.in.data,0,1),this.di=255&this.in.data[0],this.ui&&(this.di=this.di-this.ui.mA&255),this.packetSize=g.A.IA[this.di],t--),-1===this.packetSize){if(t<=0)return!1;await this.stream.lf(this.in.data,0,1),this.packetSize=255&this.in.data[0],t--}if(-2===this.packetSize){if(t<=1)return!1;await this.stream.lf(this.in.data,0,2),this.in.ft=0,this.packetSize=this.in.ct,t-=2}if(t0&&this.lw(5,s+' has logged in.',''),0===i&&this.lw(5,s+' has logged out.','')),s=null;break}s&&this.uo<100&&(this.Oo[this.uo]=t,this.To[this.uo]=s,this.vo[this.uo]=i,this.uo++,this.ah=!0);let h=!1;for(;!h;){h=!0;for(let t=0;t=0&&h>=0&&s=G.A.yr||t.z>=G.A.yr)&&t.SA();return 0!==this.wn&&(this.wn-=e,this.yn-=n),this.An=!1,this.di=-1,!0}if(this.di===T.A.MA)return c.A.Jo[this.in.ct].model=this.Jr?.kA()||null,this.di=-1,!0;if(this.di===T.A.xA)return this.Fh=this.in.CA,1===this.Fh&&(this.Uh=this.in.ct),this.Fh>=2&&this.Fh<=6&&(2===this.Fh&&(this.Bh=64,this.Gh=64),3===this.Fh&&(this.Bh=0,this.Gh=64),4===this.Fh&&(this.Bh=128,this.Gh=64),5===this.Fh&&(this.Bh=64,this.Gh=0),6===this.Fh&&(this.Bh=64,this.Gh=128),this.Fh=2,this.Wh=this.in.ct,this.Yh=this.in.ct,this.Vh=this.in.CA),10===this.Fh&&(this.Hh=this.in.ct),this.di=-1,!0;if(this.di===T.A.DA){const t=this.in.NA,i=this.in.ut,s=this.in.ut;return t!==this.Go&&this.Bo&&!$.K.vt&&await this.Al(t,i,s,!0),this.Go=t,this.Ho=i,this.Wo=s,this.Uo=0,this.di=-1,!0}if(this.di===T.A.PA)return await this.pA(),this.di=-1,!1;if(this.di===T.A.FA){const t=this.in.CA,i=this.in.CA;let s=-1;if(this.Zn)for(let h=0;h=100&&(this.Rn=128*this.Cr+64,this.Mn=128*this.Tr+64,this.Sn=this.au(this.ir,this.Cr,this.Tr)-this.Or),this.di=-1,!0;if(this.di===T.A.Op){this.Hn=this.in.CA,this.Wn=this.in.CA;for(let t=this.Hn;t=this.Hn&&t.x=this.Wn&&t.z1?this.lw(7,e,M.A.za(M.A.ja(t))):this.lw(3,e,M.A.za(M.A.ja(t)))}catch(t){}return this.di=-1,!0}if(this.di===T.A.Mp){for(let t=0;t=100){const t=128*this.mr+64,i=128*this.Ir+64,s=this.au(this.ir,this.mr,this.Ir)-this.Er,h=t-this.Rn,e=s-this.Sn,n=i-this.Mn,r=0|Math.sqrt(h*h+n*n);this.kn=325.949*Math.atan2(e,r)&2047,this.xn=-325.949*Math.atan2(h,n)&2047,this.kn<128&&(this.kn=128),this.kn>383&&(this.kn=383)}return this.di=-1,!0}if(this.di===T.A.Pp)return this.$h=this.in.CA,this.ah=!0,this.uh=!0,this.di=-1,!0;if(this.di===T.A.Fp){const t=this.in.NA;let i;if(t.endsWith(':tradereq:')){const s=t.substring(0,t.indexOf(':'));i=M.A.xd(s);let h=!1;for(let t=0;t>10&31,h=i>>5&31,e=31&i;return c.A.Jo[t].wa=(s<<19)+(h<<11)+(e<<3),this.di=-1,!0}if(this.di===T.A.Vp){for(let t=0;t=this.jh[s]&&(this.zh[t]=s+2);return this.di=-1,!0}if(this.di===T.A.$p){for(this.Hn=this.in.CA,this.Wn=this.in.CA;this.in.ft=0&&t{try{this.Gn=-1,this.Yr.clear(),this.Wr.clear(),this.Hr.clear(),this.Gr.clear(),d.A.rm(),this.Cu(),this.cn?.reset();for(let t=0;t>8,s=255&this.Zn[t];if(33===i&&s>=71&&s<=73){D.A.vt=!1;break}}if($.K.vt?this.cn?.om(this.ir):this.cn?.om(0),this.Zn&&this.zn){this.ri.If(O.A.qf);for(let s=0;s>8)-this.Kn,h=64*(255&this.Zn[s])-this.Xn,e=this.zn[s];if(e){const s=new I.A(new Uint8Array(e)).ut,n=R.A.read(s,e,e.length-4,4);t.lm(8*(this.Yn-6),8*(this.Vn-6),i,h,n)}else this.Vn<800&&t.am(h,i,64,64)}}if(this.Zn&&this.jn){this.ri.If(O.A.qf);for(let s=0;s>8)-this.Kn,r=64*(255&this.Zn[s])-this.Xn;t.fm(this.cn,this.Wr,this.Qn,e,n,r)}}}this.ri.If(O.A.qf),t.um(this.cn,this.Qn),this.es?.bind(),this.ri.If(O.A.qf);for(let t=this.Wr.head();t;t=this.Wr.next())2===(this.ur&&2&this.ur[1][t.dm][t.wm])&&(t.ym--,t.ym<0&&t.SA());for(let t=0;t{const i=c.A.Jo[t];if(i.xl)for(let t=0;t{let t=0;for(let i=0;i<99;i++){const s=i+1;t+=s+300*Math.pow(2,s/7)|0,this.jh[i]=t/4|0}};lw=(t,i,s)=>{0===t&&-1!==this.ce&&(this.Zh=i,this.Qc=0),-1===this.Mh&&(this.fh=!0);for(let t=99;t>0;t--)this.messageType[t]=this.messageType[t-1],this.ue[t]=this.ue[t-1],this.fe[t]=this.fe[t-1];$.K.Rt&&0===t&&(i='['+(this.hi/30|0)+']: '+i),this.messageType[0]=t,this.ue[0]=s,this.fe[0]=i};ly=async t=>{const i=a.A.Jo[t].pm;if(0!==i){const s=this.Ue[t];if(1===i&&(1===s&&d.A.Lc(.9),2===s&&d.A.Lc(.8),3===s&&d.A.Lc(.7),4===s&&d.A.Lc(.6),n.A.vu?.clear(),this.mi=!0),3===i){const t=this.Bo;0===s&&(this.Yo=256,(0,j.Im)(256),this.Bo=!0),1===s&&(this.Yo=192,(0,j.Im)(192),this.Bo=!0),2===s&&(this.Yo=128,(0,j.Im)(128),this.Bo=!0),3===s&&(this.Yo=64,(0,j.Im)(64),this.Bo=!0),4===s&&(this.Bo=!1),this.Bo!==t&&(this.Bo&&this.Go?await this.Al(this.Go,this.Ho,this.Wo,!1):(0,j.qo)(!1),this.Uo=0)}4===i&&(0===s&&(this.xo=256,(0,j.Em)(256),this.Ro=!0),1===s&&(this.xo=192,(0,j.Em)(192),this.Ro=!0),2===s&&(this.xo=128,(0,j.Em)(128),this.Ro=!0),3===s&&(this.xo=64,(0,j.Em)(64),this.Ro=!0),4===s&&(this.Ro=!1)),5===i&&(this.Ve=s),6===i&&(this.Ae=s),8===i&&(this.ye=s,this.fh=!0)}};gm=(t,i)=>{let s=0;for(let t=0;t<100;t++){if(!this.fe[t])continue;const h=this.messageType[t],e=this.Dh+70+4-14*s;if(e<-20)break;0===h&&s++,1!==h&&2!==h||!(1===h||0===this.Qh||1===this.Qh&&this.ku(this.ue[t]))||(i>e-14&&i<=e&&this.Jr&&this.ue[t]!==this.Jr.name&&(this.oo&&(this.Rh[this.Lh]='Report abuse @whi@'+this.ue[t],this.Ke[this.Lh]=34,this.Lh++),this.Rh[this.Lh]='Add ignore @whi@'+this.ue[t],this.Ke[this.Lh]=436,this.Lh++,this.Rh[this.Lh]='Add friend @whi@'+this.ue[t],this.Ke[this.Lh]=406,this.Lh++),s++),3!==h&&7!==h||0!==this.ye||!(7===h||0===this.te||1===this.te&&this.ku(this.ue[t]))||(i>e-14&&i<=e&&(this.oo&&(this.Rh[this.Lh]='Report abuse @whi@'+this.ue[t],this.Ke[this.Lh]=34,this.Lh++),this.Rh[this.Lh]='Add ignore @whi@'+this.ue[t],this.Ke[this.Lh]=436,this.Lh++,this.Rh[this.Lh]='Add friend @whi@'+this.ue[t],this.Ke[this.Lh]=406,this.Lh++),s++),4===h&&(0===this.ie||1===this.ie&&this.ku(this.ue[t]))&&(i>e-14&&i<=e&&(this.Rh[this.Lh]='Accept trade @whi@'+this.ue[t],this.Ke[this.Lh]=903,this.Lh++),s++),(5===h||6===h)&&0===this.ye&&this.te<2&&s++,8===h&&(0===this.ie||1===this.ie&&this.ku(this.ue[t]))&&(i>e-14&&i<=e&&(this.Rh[this.Lh]='Accept duel @whi@'+this.ue[t],this.Ke[this.Lh]=363,this.Lh++),s++)}};_m=t=>{if(0===this.ye)return;let i=0;0!==this.fi&&(i=1);for(let s=0;s<100;s++)if(null!==this.fe[s]){const h=this.messageType[s];if((3===h||7===h)&&(7===h||0===this.te||1===this.te&&this.ku(this.ue[s]))){const h=329-13*i;if(this.ea>8&&this.ea<520&&t-11>h-10&&t-11<=h+3&&(this.oo&&(this.Rh[this.Lh]='Report abuse @whi@'+this.ue[s],this.Ke[this.Lh]=2034,this.Lh++),this.Rh[this.Lh]='Add ignore @whi@'+this.ue[s],this.Ke[this.Lh]=2436,this.Lh++,this.Rh[this.Lh]='Add friend @whi@'+this.ue[s],this.Ke[this.Lh]=2406,this.Lh++),i++,i>=5)return}if((5===h||6===h)&&this.te<2&&(i++,i>=5))return}};Cm=(t,i,s,h,e,r)=>{if(0!==t.type||!t.xl||t.hide||ih+t.width||s>e+t.height||!t.Wl||!t.Yl)return;const o=t.xl.length;for(let l=0;l=0||0!==f.Aa)&&i>=o&&s>=a&&i=0?this.$e=f.Tm:this.$e=f.id),0===f.type)this.Cm(f,i,s,o,a,f.Zl),f.scroll>f.height&&this.Qf(i,s,f.scroll,f.height,!0,o+f.width,a,f);else if(2===f.type){let t=0;for(let h=0;h=r+32||s>=l+32){t++;continue}if(this.qe=t,this.Ze=f.id,!f.Ql||f.Ql[t]<=0){t++;continue}const c=n.A.get(f.Ql[t]-1);if(1===this.Le&&f.Om)f.id===this.Se&&t===this.Re||(this.Rh[this.Lh]='Use '+this.ke+' with @lre@'+c.name,this.Ke[this.Lh]=881,this.Xe[this.Lh]=c.id,this.ze[this.Lh]=t,this.je[this.Lh]=f.id,this.Lh++);else if(1===this.Ge&&f.Om)16&~this.We||(this.Rh[this.Lh]=this.Ye+' @lre@'+c.name,this.Ke[this.Lh]=391,this.Xe[this.Lh]=c.id,this.ze[this.Lh]=t,this.je[this.Lh]=f.id,this.Lh++);else{if(f.Om)for(let i=4;i>=3;i--)c.vm&&c.vm[i]?(this.Rh[this.Lh]=c.vm[i]+' @lre@'+c.name,3===i?this.Ke[this.Lh]=478:4===i&&(this.Ke[this.Lh]=347),this.Xe[this.Lh]=c.id,this.ze[this.Lh]=t,this.je[this.Lh]=f.id,this.Lh++):4===i&&(this.Rh[this.Lh]='Drop @lre@'+c.name,this.Ke[this.Lh]=347,this.Xe[this.Lh]=c.id,this.ze[this.Lh]=t,this.je[this.Lh]=f.id,this.Lh++);if(f.bm&&(this.Rh[this.Lh]='Use @lre@'+c.name,this.Ke[this.Lh]=188,this.Xe[this.Lh]=c.id,this.ze[this.Lh]=t,this.je[this.Lh]=f.id,this.Lh++),f.Om&&c.vm)for(let i=2;i>=0;i--)c.vm[i]&&(this.Rh[this.Lh]=c.vm[i]+' @lre@'+c.name,0===i?this.Ke[this.Lh]=405:1===i?this.Ke[this.Lh]=38:2===i&&(this.Ke[this.Lh]=422),this.Xe[this.Lh]=c.id,this.ze[this.Lh]=t,this.je[this.Lh]=f.id,this.Lh++);if(f.Lm)for(let i=4;i>=0;i--)f.Lm[i]&&(this.Rh[this.Lh]=f.Lm[i]+' @lre@'+c.name,0===i?this.Ke[this.Lh]=602:1===i?this.Ke[this.Lh]=596:2===i?this.Ke[this.Lh]=22:3===i?this.Ke[this.Lh]=892:4===i&&(this.Ke[this.Lh]=415),this.Xe[this.Lh]=c.id,this.ze[this.Lh]=t,this.je[this.Lh]=f.id,this.Lh++);this.Rh[this.Lh]='Examine @lre@'+c.name,$.K.Rt&&(this.Rh[this.Lh]+='@whi@ ('+c.id+')'),this.Ke[this.Lh]=1773,this.Xe[this.Lh]=c.id,f.ta&&(this.je[this.Lh]=f.ta[t]),this.Lh++}t++}}else if(i>=o&&s>=a&&i{let i=t.Xl;return i>=c.A.Ga&&i<=c.A.Ya?(i>=c.A.Wa?i-=c.A.Wa:i--,this.Rh[this.Lh]='Remove @whi@'+this.To[i],this.Ke[this.Lh]=557,this.Lh++,this.Rh[this.Lh]='Message @whi@'+this.To[i],this.Ke[this.Lh]=679,this.Lh++,!0):i>=c.A.Ka&&i<=c.A.Xa&&(this.Rh[this.Lh]='Remove @whi@'+t.text,this.Ke[this.Lh]=556,this.Lh++,!0)};Pm=()=>{0===this.Le&&0===this.Ge&&(this.Rh[this.Lh]='Walk here',this.Ke[this.Lh]=660,this.ze[this.Lh]=this.ea,this.je[this.Lh]=this.na,this.Lh++);let t=-1;for(let i=0;i>7&127,o=s>>29&3,l=s>>14&32767;if(s!==t){if(t=s,2===o&&this.cn&&this.cn.Xd(this.ir,h,r,s)>=0){const t=e.A.get(l);if(1===this.Le)this.Rh[this.Lh]='Use '+this.ke+' with @cya@'+t.name,this.Ke[this.Lh]=450,this.Xe[this.Lh]=s,this.ze[this.Lh]=h,this.je[this.Lh]=r,this.Lh++;else if(1!==this.Ge){if(t.Um)for(let i=4;i>=0;i--)t.Um[i]&&(this.Rh[this.Lh]=t.Um[i]+' @cya@'+t.name,0===i&&(this.Ke[this.Lh]=285),1===i&&(this.Ke[this.Lh]=504),2===i&&(this.Ke[this.Lh]=364),3===i&&(this.Ke[this.Lh]=581),4===i&&(this.Ke[this.Lh]=1501),this.Xe[this.Lh]=s,this.ze[this.Lh]=h,this.je[this.Lh]=r,this.Lh++);this.Rh[this.Lh]='Examine @cya@'+t.name,$.K.Rt&&(this.Rh[this.Lh]+='@whi@ ('+t.id+')'),this.Ke[this.Lh]=1175,this.Xe[this.Lh]=s,this.ze[this.Lh]=h,this.je[this.Lh]=r,this.Lh++}else 4&~this.We||(this.Rh[this.Lh]=this.Ye+' @cya@'+t.name,this.Ke[this.Lh]=55,this.Xe[this.Lh]=s,this.ze[this.Lh]=h,this.je[this.Lh]=r,this.Lh++)}if(1===o){const t=this.Fr[l];if(t&&t.type&&1===t.type.size&&64==(127&t.x)&&64==(127&t.z))for(let i=0;i=0;s--)t.Um&&t.Um[s]?(this.Rh[this.Lh]=t.Um[s]+' @lre@'+t.name,0===s&&(this.Ke[this.Lh]=224),1===s&&(this.Ke[this.Lh]=993),2===s&&(this.Ke[this.Lh]=99),3===s&&(this.Ke[this.Lh]=746),4===s&&(this.Ke[this.Lh]=877),this.Xe[this.Lh]=i.index,this.ze[this.Lh]=h,this.je[this.Lh]=r,this.Lh++):2===s&&(this.Rh[this.Lh]='Take @lre@'+t.name,this.Ke[this.Lh]=99,this.Xe[this.Lh]=i.index,this.ze[this.Lh]=h,this.je[this.Lh]=r,this.Lh++);this.Rh[this.Lh]='Examine @lre@'+t.name,$.K.Rt&&(this.Rh[this.Lh]+='@whi@ ('+i.index+')'),this.Ke[this.Lh]=1102,this.Xe[this.Lh]=i.index,this.ze[this.Lh]=h,this.je[this.Lh]=r,this.Lh++}else 1&~this.We||(this.Rh[this.Lh]=this.Ye+' @lre@'+t.name,this.Ke[this.Lh]=965,this.Xe[this.Lh]=i.index,this.ze[this.Lh]=h,this.je[this.Lh]=r,this.Lh++)}}}}};Bm=(t,i,s,h)=>{if(this.Lh>=400)return;let e=t.name;if(0!==t.Ym&&this.Jr&&(e=e+this.Vm(this.Jr.Ac,t.Ym)+' (level-'+t.Ym+')'),1===this.Le)this.Rh[this.Lh]='Use '+this.ke+' with @yel@'+e,this.Ke[this.Lh]=900,this.Xe[this.Lh]=i,this.ze[this.Lh]=s,this.je[this.Lh]=h,this.Lh++;else if(1!==this.Ge){let n;if(t.Um)for(n=4;n>=0;n--)t.Um[n]&&'attack'!==t.Um[n]?.toLowerCase()&&(this.Rh[this.Lh]=t.Um[n]+' @yel@'+e,0===n?this.Ke[this.Lh]=728:1===n?this.Ke[this.Lh]=542:2===n?this.Ke[this.Lh]=6:3===n?this.Ke[this.Lh]=963:4===n&&(this.Ke[this.Lh]=245),this.Xe[this.Lh]=i,this.ze[this.Lh]=s,this.je[this.Lh]=h,this.Lh++);if(t.Um)for(n=4;n>=0;n--)if(t.Um[n]&&'attack'===t.Um[n]?.toLowerCase()){let r=0;this.Jr&&t.Ym>this.Jr.Ac&&(r=2e3),this.Rh[this.Lh]=t.Um[n]+' @yel@'+e,0===n?this.Ke[this.Lh]=r+728:1===n?this.Ke[this.Lh]=r+542:2===n?this.Ke[this.Lh]=r+6:3===n?this.Ke[this.Lh]=r+963:4===n&&(this.Ke[this.Lh]=r+245),this.Xe[this.Lh]=i,this.ze[this.Lh]=s,this.je[this.Lh]=h,this.Lh++}this.Rh[this.Lh]='Examine @yel@'+e,$.K.Rt&&(this.Rh[this.Lh]+='@whi@ ('+t.id+')'),this.Ke[this.Lh]=1607,this.Xe[this.Lh]=i,this.ze[this.Lh]=s,this.je[this.Lh]=h,this.Lh++}else 2&~this.We||(this.Rh[this.Lh]=this.Ye+' @yel@'+e,this.Ke[this.Lh]=265,this.Xe[this.Lh]=i,this.ze[this.Lh]=s,this.je[this.Lh]=h,this.Lh++)};Gm=(t,i,s,h)=>{if(t===this.Jr||this.Lh>=400)return;let e=null;this.Jr&&(e=t.name+this.Vm(this.Jr.Ac,t.Ac)+' (level-'+t.Ac+')'),1===this.Le?(this.Rh[this.Lh]='Use '+this.ke+' with @whi@'+e,this.Ke[this.Lh]=367,this.Xe[this.Lh]=i,this.ze[this.Lh]=s,this.je[this.Lh]=h,this.Lh++):1!==this.Ge?(this.Rh[this.Lh]='Follow @whi@'+e,this.Ke[this.Lh]=1544,this.Xe[this.Lh]=i,this.ze[this.Lh]=s,this.je[this.Lh]=h,this.Lh++,0===this.Eh&&(this.Rh[this.Lh]='Trade with @whi@'+e,this.Ke[this.Lh]=1373,this.Xe[this.Lh]=i,this.ze[this.Lh]=s,this.je[this.Lh]=h,this.Lh++),this.no>0&&(this.Rh[this.Lh]='Attack @whi@'+e,this.Jr&&this.Jr.Ac>=t.Ac?this.Ke[this.Lh]=151:this.Ke[this.Lh]=2151,this.Xe[this.Lh]=i,this.ze[this.Lh]=s,this.je[this.Lh]=h,this.Lh++),1===this.ro&&(this.Rh[this.Lh]='Fight @whi@'+e,this.Ke[this.Lh]=151,this.Xe[this.Lh]=i,this.ze[this.Lh]=s,this.je[this.Lh]=h,this.Lh++),2===this.ro&&(this.Rh[this.Lh]='Duel-with @whi@'+e,this.Ke[this.Lh]=1101,this.Xe[this.Lh]=i,this.ze[this.Lh]=s,this.je[this.Lh]=h,this.Lh++)):8&~this.We||(this.Rh[this.Lh]=this.Ye+' @whi@'+e,this.Ke[this.Lh]=651,this.Xe[this.Lh]=i,this.ze[this.Lh]=s,this.je[this.Lh]=h,this.Lh++);for(let t=0;t{const s=t-i;return s<-9?'@red@':s<-6?'@or3@':s<-3?'@or2@':s<0?'@or1@':s>9?'@gre@':s>6?'@gr3@':s>3?'@gr2@':s>0?'@gr1@':'@yel@'};Rf=()=>{if(0===this.Ce){this.Rh[0]='Cancel',this.Ke[0]=1252,this.Lh=1,this._m(this.na),this.$e=0,this.ea>8&&this.na>11&&this.ea<520&&this.na<345&&(-1===this.wh?this.Pm():this.Cm(c.A.Jo[this.wh],this.ea,this.na,8,11,0)),this.$e!==this.me&&(this.me=this.$e),this.$e=0,this.ea>562&&this.na>231&&this.ea<752&&this.na<492&&(-1!==this.Sh?this.Cm(c.A.Jo[this.Sh],this.ea,this.na,562,231,0):-1!==this.Jh[this.$h]&&this.Cm(c.A.Jo[this.Jh[this.$h]],this.ea,this.na,562,231,0)),this.$e!==this.Ie&&(this.ah=!0,this.Ie=this.$e),this.$e=0,this.ea>22&&this.na>375&&this.ea<431&&this.na<471&&(-1===this.Mh?this.gm(this.ea-22,this.na-375):this.Cm(c.A.Jo[this.Mh],this.ea,this.na,22,375,0)),-1!==this.Mh&&this.$e!==this.Ee&&(this.fh=!0,this.Ee=this.$e);let t=!1;for(;!t;){t=!0;for(let i=0;i1e3){const s=this.Rh[i];this.Rh[i]=this.Rh[i+1],this.Rh[i+1]=s;const h=this.Ke[i];this.Ke[i]=this.Ke[i+1],this.Ke[i+1]=h;const e=this.ze[i];this.ze[i]=this.ze[i+1],this.ze[i+1]=e;const n=this.je[i];this.je[i]=this.je[i+1],this.je[i+1]=n;const r=this.Xe[i];this.Xe[i]=this.Xe[i+1],this.Xe[i+1]=r,t=!1}}}};kf=()=>{let t=0;if(this.Pi){let i;t=this.Pi.xu('Choose Option');for(let s=0;st&&(t=i)}t+=8;const i=15*this.Lh+21;let s,h;this.tf>8&&this.if>11&&this.tf<520&&this.if<345&&(s=this.tf-(t/2|0)-8,s+t>512?s=512-t:s<0&&(s=0),h=this.if-11,h+i>334?h=334-i:h<0&&(h=0),this.gh=!0,this._h=0,this.Ch=s,this.Th=h,this.Oh=t,this.bh=15*this.Lh+22),this.tf>562&&this.if>231&&this.tf<752&&this.if<492&&(s=this.tf-(t/2|0)-562,s<0?s=0:s+t>190&&(s=190-t),h=this.if-231,h<0?h=0:h+i>261&&(h=261-i),this.gh=!0,this._h=1,this.Ch=s,this.Th=h,this.Oh=t,this.bh=15*this.Lh+22),this.tf>22&&this.if>375&&this.tf<501&&this.if<471&&(s=this.tf-(t/2|0)-22,s<0?s=0:s+t>479&&(s=479-t),h=this.if-375,h<0?h=0:h+i>96&&(h=96-i),this.gh=!0,this._h=2,this.Ch=s,this.Th=h,this.Oh=t,this.bh=15*this.Lh+22)};Ff=(t,i,s,h,e,n,r,o,l,a,c)=>{const f=this.Qn[this.ir];if(!f)return!1;const u=G.A.yr,d=G.A.yr;for(let t=0;t0&&0===this.Zr[i]&&(g[i]&H.A.Hd)===H.A.OPEN&&(this.zr[p]=w-1,this.jr[p]=y,p=(p+1)%E,this.Zr[i]=2,this.qr[i]=t),i=G.A.index(w+1,y),w0&&0===this.Zr[i]&&(g[i]&H.A.Yd)===H.A.OPEN&&(this.zr[p]=w,this.jr[p]=y-1,p=(p+1)%E,this.Zr[i]=1,this.qr[i]=t),i=G.A.index(w,y+1),y0&&y>0&&0===this.Zr[i]&&!(g[i]&H.A.Zm)&&(g[G.A.index(w-1,y)]&H.A.Hd)===H.A.OPEN&&(g[G.A.index(w,y-1)]&H.A.Yd)===H.A.OPEN&&(this.zr[p]=w-1,this.jr[p]=y-1,p=(p+1)%E,this.Zr[i]=3,this.qr[i]=t),i=G.A.index(w+1,y-1),w0&&0===this.Zr[i]&&!(g[i]&H.A.qm)&&(g[G.A.index(w+1,y)]&H.A.Wd)===H.A.OPEN&&(g[G.A.index(w,y-1)]&H.A.Yd)===H.A.OPEN&&(this.zr[p]=w+1,this.jr[p]=y-1,p=(p+1)%E,this.Zr[i]=9,this.qr[i]=t),i=G.A.index(w-1,y+1),w>0&&y=0&&s>=0&&e0){E=Math.min(m,25),m--;const t=this.zr[m],i=this.jr[m];if($.K.Rt&&1===this.vf[6]&&1===this.vf[7]){for(let t=0;t{this.kr=0,this.Mr=0,this.sI(t),this.hI(t),this.eI(t,i),this.nI(t);for(let t=0;t{t.rI();if(0!==t.oI(1)){const i=t.oI(2);if(0===i)this.Dr[this.Mr++]=this.Jt;else if(1===i){const i=t.oI(3);this.Jr?.step(!1,i);1===t.oI(1)&&(this.Dr[this.Mr++]=this.Jt)}else if(2===i){const i=t.oI(3);this.Jr?.step(!0,i);const s=t.oI(3);this.Jr?.step(!0,s);1===t.oI(1)&&(this.Dr[this.Mr++]=this.Jt)}else if(3===i){this.ir=t.oI(2);const i=t.oI(7),s=t.oI(7),h=t.oI(1);this.Jr?.move(1===h,i,s);1===t.oI(1)&&(this.Dr[this.Mr++]=this.Jt)}}};hI=t=>{const i=t.oI(8);if(ithis.Rr)throw new Error(`eek! ${this.username} Too many players`);this.Rr=0;for(let s=0;s{let s;for(;t.lI+10<8*i&&(s=t.oI(11),2047!==s);){if(!this.Lr[s]){this.Lr[s]=new W.A;const t=this.Pr[s];t&&this.Lr[s]?.read(t)}this.Sr[this.Rr++]=s;const i=this.Lr[s];i&&(i.wu=this.hi);let h=t.oI(5);h>15&&(h-=32);let e=t.oI(5);e>15&&(e-=32);const n=t.oI(1);this.Jr&&i?.move(1===n,this.Jr.Uf[0]+h,this.Jr.Bf[0]+e);1===t.oI(1)&&(this.Dr[this.Mr++]=s)}t.aI()};nI=t=>{for(let i=0;i{if(t.Ku=s,t.Xu=this.hi,(s&W.A.zu)===W.A.zu){const s=e.CA,h=new Uint8Array(s),n=new I.A(h);e.sp(s,0,h),this.Pr[i]=n,t.read(n)}if((s&W.A.ju)===W.A.ju){let i=e.ct;65535===i&&(i=-1),i===t.Zu&&(t.uI=0);const s=e.CA;(-1===i||-1===t.Zu||h.A.Jo[i].priority>h.A.Jo[t.Zu].priority||0===h.A.Jo[t.Zu].priority)&&(t.Zu=i,t.dI=0,t.wI=0,t.yI=s,t.uI=0)}if((s&W.A.qu)===W.A.qu&&(t.$u=e.ct,65535===t.$u&&(t.$u=-1)),(s&W.A.Ju)===W.A.Ju&&(t.Mu=e.NA,t.Du=0,t.Nu=0,t.Pu=150,t.name&&this.lw(2,t.Mu,t.name)),(s&W.A.Qu)===W.A.Qu&&(t.Hu=e.CA,t.Gu=e.CA,t.Fu=this.hi+400,t.Uu=e.CA,t.Bu=e.CA),(s&W.A.td)===W.A.td&&(t.AI=e.ct,t.pI=e.ct,t.sd=t.AI,t.hd=t.pI),(s&W.A.ed)===W.A.ed){const i=e.ct,s=e.CA,h=e.CA,n=e.ft;if(t.name){const n=M.A.xd(t.name);let r=!1;if(s<=1)for(let t=0;t>8,t.Nu=255&i,t.Pu=150,s>1?this.lw(1,r,t.name):this.lw(2,r,t.name)}catch(t){}}e.ft=n+h}if((s&W.A.nd)===W.A.nd){t.rd=e.ct;const i=e.ut;t.mI=i>>16,t.II=this.hi+(65535&i),t.EI=0,t.gI=0,t.II>this.hi&&(t.EI=-1),65535===t.rd&&(t.rd=-1)}(s&W.A.od)===W.A.od&&(t._I=e.CA,t.CI=e.CA,t.TI=e.CA,t.OI=e.CA,t.Wu=e.ct+this.hi,t.Yu=e.ct+this.hi,t.vI=e.CA,t.pathLength=0,t.Uf[0]=t.TI,t.Bf[0]=t.OI)};bA=(t,i)=>{this.kr=0,this.Mr=0,this.bI(t),this.LI(t,i),this.RI(t);for(let t=0;t{t.rI();const i=t.oI(8);if(ithis.Ur)throw new Error(`eek! ${this.username} Too many npcs`);this.Ur=0;for(let s=0;s{for(;t.lI+21<8*i;){const i=t.oI(13);if(8191===i)break;this.Fr[i]||(this.Fr[i]=new Y.A);const s=this.Fr[i];this.Br[this.Ur++]=i,s?(s.wu=this.hi,s.type=r.A.get(t.oI(11)),s.size=s.type.size,s.SI=s.type.MI,s.kI=s.type.xI,s.DI=s.type.NI,s.FI=s.type.UI,s.ic=s.type.BI):t.oI(11);let h=t.oI(5);h>15&&(h-=32);let e=t.oI(5);e>15&&(e-=32),this.Jr&&s?.move(!1,this.Jr.Uf[0]+h,this.Jr.Bf[0]+e);1===t.oI(1)&&(this.Dr[this.Mr++]=i)}t.aI()};RI=t=>{for(let i=0;ih.A.Jo[e.Zu].priority||0===h.A.Jo[e.Zu].priority)&&(e.Zu=i,e.dI=0,e.wI=0,e.yI=s,e.uI=0)}if((n&Y.A.qu)===Y.A.qu&&(e.$u=t.ct,65535===e.$u&&(e.$u=-1)),(n&Y.A.Ju)===Y.A.Ju&&(e.Mu=t.NA,e.Pu=100),(n&Y.A.Qu)===Y.A.Qu&&(e.Hu=t.CA,e.Gu=t.CA,e.Fu=this.hi+400,e.Uu=t.CA,e.Bu=t.CA),(n&Y.A.ld)===Y.A.ld&&(e.type=r.A.get(t.ct),e.SI=e.type.MI,e.kI=e.type.xI,e.DI=e.type.NI,e.FI=e.type.UI,e.ic=e.type.BI),(n&Y.A.nd)===Y.A.nd){e.rd=t.ct;const i=t.ut;e.mI=i>>16,e.II=this.hi+(65535&i),e.EI=0,e.gI=0,e.II>this.hi&&(e.EI=-1),65535===e.rd&&(e.rd=-1)}(n&Y.A.td)===Y.A.td&&(e.AI=t.ct,e.pI=t.ct,e.sd=e.AI,e.hd=e.pI)}};_f=()=>{for(let t=-1;t1406){$.K.Bt=0,this.ri.If(O.A.HI),this.ri.p1(0);const t=this.ri.ft;this.ri.p1(162),this.ri.p1(22),2*Math.random()|0||this.ri.p1(84),this.ri.p2(31824),this.ri.p2(13490),2*Math.random()|0||this.ri.p1(123),2*Math.random()|0||this.ri.p1(134),this.ri.p1(100),this.ri.p1(94),this.ri.p2(35521),this.ri.fu(this.ri.ft-t)}};GI=t=>{(t.x<128||t.z<128||t.x>=13184||t.z>=13184)&&(t.Zu=-1,t.rd=-1,t.Wu=0,t.Yu=0,t.x=128*t.Uf[0]+64*t.size,t.z=128*t.Bf[0]+64*t.size,t.pathLength=0),t===this.Jr&&(t.x<1536||t.z<1536||t.x>=11776||t.z>=11776)&&(t.Zu=-1,t.rd=-1,t.Wu=0,t.Yu=0,t.x=128*t.Uf[0]+64*t.size,t.z=128*t.Bf[0]+64*t.size,t.pathLength=0),t.Wu>this.hi?this.WI(t):t.Yu>=this.hi?this.YI(t):this.VI(t),this.KI(t),this.XI(t)};hu=()=>{if(this.Jr){this.Jr.x>>7===this.wn&&this.Jr.z>>7===this.yn&&(this.wn=0);for(let t=-1;t50||this.Rr>200)&&-1!==t&&i.zI===i.ic;const h=i.x>>7,e=i.z>>7;if(!(h<0||h>=G.A.yr||e<0||e>=G.A.yr))if(!i.jI||this.hi=i.qI){if(64==(127&i.x)&&64==(127&i.z)){if(this.dr[h][e]===this.dn)continue;this.dr[h][e]=this.dn}i.y=this.au(this.ir,i.x,i.z),this.cn?.$I(this.ir,i.x,i.y,i.z,null,i,s,i.JI,60,i.QI)}else i.vt=!1,i.y=this.au(this.ir,i.x,i.z),this.cn?.tE(this.ir,i.x,i.y,i.z,i.iE,i.sE,i.hE,i.eE,null,i,s,i.JI)}}};Cf=()=>{for(let t=0;t{for(let t=0;t>7,e=i.z>>7;if(!(h<0||h>=G.A.yr||e<0||e>=G.A.yr)){if(1===i.size&&64==(127&i.x)&&64==(127&i.z)){if(this.dr[h][e]===this.dn)continue;this.dr[h][e]=this.dn}this.cn?.$I(this.ir,i.x,this.au(this.ir,i.x,i.z),i.z,null,i,s,i.JI,64*(i.size-1)+60,i.QI)}}};nu=()=>{for(let t=this.Gr.head();t;t=this.Gr.next())if(t.level!==this.ir||this.hi>t.nE)t.SA();else if(this.hi>=t.rE){if(t.target>0){const i=this.Fr[t.target-1];i&&t.oE(i.x,this.au(t.level,i.x,i.z)-t.offsetY,i.z,this.hi)}if(t.target<0){const i=-t.target-1;let s;s=i===this.so?this.Jr:this.Lr[i],s&&t.oE(s.x,this.au(t.level,s.x,s.z)-t.offsetY,s.z,this.hi)}t.update(this.un),this.cn?.$I(this.ir,0|t.x,0|t.y,0|t.z,null,t,-1,t.JI,60,!1)}};ru=()=>{for(let t=this.Hr.head();t;t=this.Hr.next())t.level!==this.ir||t.lE?t.SA():this.hi>=t.rE&&(t.update(this.un),t.lE?t.SA():this.cn?.$I(t.level,t.x,t.y,t.z,null,t,-1,0,60,!1))};ou=()=>{for(let t=this.Wr.head();t;t=this.Wr.next()){let i=!1;if(t.Pl+=this.un,-1===t.Fl&&(t.Fl=0,i=!0),t.aE.delay)for(;t.Pl>t.aE.delay[t.Fl];)if(t.Pl-=t.aE.delay[t.Fl]+1,t.Fl++,i=!0,t.Fl>=t.aE.Ul&&(t.Fl-=t.aE.Bl,t.Fl<0||t.Fl>=t.aE.Ul)){t.SA(),i=!1;break}if(i&&this.cn){const i=t.ym,s=t.dm,h=t.wm;let n=0;if(0===t.cE?n=this.cn.Kd(i,s,h):1===t.cE?n=this.cn.oA(i,h,s):2===t.cE?n=this.cn.iw(i,s,h):3===t.cE&&(n=this.cn.Bd(i,s,h)),this.cr&&0!==n&&(n>>14&32767)===t.index){const r=this.cr[i][s][h],o=this.cr[i][s+1][h],l=this.cr[i][s+1][h+1],a=this.cr[i][s][h+1],c=e.A.get(t.index);let f=-1;if(-1!==t.Fl&&t.aE.frames&&(f=t.aE.frames[t.Fl]),2===t.cE){const t=this.cn.Xd(i,s,h,n);let e=31&t;const u=t>>6;e===P.A.Py.id&&(e=P.A.Ny.id),this.cn?.fE(i,s,h,c.xa(e,u,r,o,l,a,f))}else if(1===t.cE)this.cn?.uE(i,s,h,c.xa(P.A.dE.id,0,r,o,l,a,f));else if(0===t.cE){const t=this.cn.Xd(i,s,h,n),e=31&t,u=t>>6;if(e===P.A.Zd.id){const t=u+1&3;this.cn?.wE(s,h,i,c.xa(P.A.Zd.id,u+4,r,o,l,a,f),c.xa(P.A.Zd.id,t,r,o,l,a,f))}else this.cn?.yE(i,s,h,c.xa(e,u,r,o,l,a,f))}else if(3===t.cE){const t=this.cn.Xd(i,s,h,n)>>6;this.cn?.AE(i,s,h,c.xa(P.A.Fy.id,t,r,o,l,a,f))}}else t.SA()}}};Tf=()=>{for(let t=-1;t0&&(s.Pu--,0===s.Pu&&(s.Mu=null))}for(let t=0;t0&&(s.Pu--,0===s.Pu&&(s.Mu=null))}};Of=()=>{if(2===this.fn){for(let t=this.Yr.head();t;t=this.Yr.next())this.hi>=t.nE&&(this.eA(t.vp,t.x,t.z,t.Am,t.angle,t.shape,t.nw),t.SA());$.K.Ut++,$.K.Ut>85&&($.K.Ut=0,this.ri.If(O.A.pE))}};WI=t=>{const i=t.Wu-this.hi,s=128*t._I+64*t.size,h=128*t.CI+64*t.size;t.x+=(s-t.x)/i|0,t.z+=(h-t.z)/i|0,t.mE=0,0===t.vI&&(t.IE=1024),1===t.vI&&(t.IE=1536),2===t.vI&&(t.IE=0),3===t.vI&&(t.IE=512)};YI=t=>{if(t.Yu===this.hi||-1===t.Zu||0!==t.yI||t.wI+1>h.A.Jo[t.Zu].delay[t.dI]){const i=t.Yu-t.Wu,s=this.hi-t.Wu,h=128*t._I+64*t.size,e=128*t.CI+64*t.size,n=128*t.TI+64*t.size,r=128*t.OI+64*t.size;t.x=(h*(i-s)+n*s)/i|0,t.z=(e*(i-s)+r*s)/i|0}t.mE=0,0===t.vI&&(t.IE=1024),1===t.vI&&(t.IE=1536),2===t.vI&&(t.IE=0),3===t.vI&&(t.IE=512),t.JI=t.IE};KI=t=>{if(-1!==t.$u&&t.$u<32768){const i=this.Fr[t.$u];if(i){const s=t.x-i.x,h=t.z-i.z;0===s&&0===h||(t.IE=325.949*Math.atan2(s,h)&2047)}}if(t.$u>=32768){let i=t.$u-32768;i===this.so&&(i=this.Jt);const s=this.Lr[i];if(s){const i=t.x-s.x,h=t.z-s.z;0===i&&0===h||(t.IE=325.949*Math.atan2(i,h)&2047)}}if((0!==t.AI||0!==t.pI)&&(0===t.pathLength||t.mE>0)){const i=t.x-64*(t.AI-this.Kn-this.Kn),s=t.z-64*(t.pI-this.Xn-this.Xn);0===i&&0===s||(t.IE=325.949*Math.atan2(i,s)&2047),t.AI=0,t.pI=0}const i=t.IE-t.JI&2047;if(0!==i&&(i<32||i>2016?t.JI=t.IE:i>1024?t.JI-=32:t.JI+=32,t.JI&=2047,t.zI===t.ic&&t.JI!==t.IE)){if(-1!==t.EE)return void(t.zI=t.EE);t.zI=t.SI}};XI=t=>{let i;if(t.QI=!1,-1!==t.zI&&(i=h.A.Jo[t.zI],t.gE++,i.delay&&t._Ei.delay[t._E]&&(t.gE=0,t._E++),t._E>=i.Ul&&(t.gE=0,t._E=0)),-1!==t.Zu&&0===t.yI){for(i=h.A.Jo[t.Zu],t.wI++;i.delay&&t.dIi.delay[t.dI];)t.wI-=i.delay[t.dI],t.dI++;t.dI>=i.Ul&&(t.dI-=i.Bl,t.uI++,t.uI>=i.CE&&(t.Zu=-1),(t.dI<0||t.dI>=i.Ul)&&(t.Zu=-1)),t.QI=i.TE}if(t.yI>0&&t.yI--,-1!==t.rd&&this.hi>=t.II){for(t.EI<0&&(t.EI=0),i=l.A.Jo[t.rd].aE,t.gI++;i&&i.delay&&t.EIi.delay[t.EI];)t.gI-=i.delay[t.EI],t.EI++;i&&t.EI>=i.Ul&&(t.EI<0||t.EI>=i.Ul)&&(t.rd=-1)}};VI=t=>{if(t.zI=t.ic,0===t.pathLength)return void(t.mE=0);if(-1!==t.Zu&&0===t.yI){if(!h.A.Jo[t.Zu].OE)return void t.mE++}const i=t.x,s=t.z,e=128*t.Uf[t.pathLength-1]+64*t.size,n=128*t.Bf[t.pathLength-1]+64*t.size;if(e-i<=256&&e-i>=-256&&n-s<=256&&n-s>=-256){t.IE=in?1792:1536:i>e?sn?256:512:s1024&&(h-=2048);let r=t.kI;h>=-256&&h<=256?r=t.SI:h>=256&&h<768?r=t.FI:h>=-768&&h<=-256&&(r=t.DI),-1===r&&(r=t.SI),t.zI=r;let o=4;t.JI!==t.IE&&-1===t.$u&&(o=2),t.pathLength>2&&(o=6),t.pathLength>3&&(o=8),t.mE>0&&t.pathLength>1&&(o=8,t.mE--),t.vE[t.pathLength-1]&&(o<<=1),o>=8&&t.zI===t.SI&&-1!==t.bE&&(t.zI=t.bE),ie&&(t.x=e)):i>e&&(t.x-=o,t.xn&&(t.z=n)):s>n&&(t.z-=o,t.z{let t=3;if(this.kn<310&&this.Jr){let i=this.Rn>>7,s=this.Mn>>7;const h=this.Jr.x>>7,e=this.Jr.z>>7;let n,r,o,l;if(this.ur&&4&this.ur[this.ir][i][s]&&(t=this.ir),n=h>i?h-i:i-h,r=e>s?e-s:s-e,n>r)for(o=65536*r/n|0,l=32768;i!==h;)ih&&i--,this.ur&&4&this.ur[this.ir][i][s]&&(t=this.ir),l+=o,l>=65536&&(l-=65536,se&&s--,this.ur&&4&this.ur[this.ir][i][s]&&(t=this.ir));else for(o=65536*n/r|0,l=32768;s!==e;)se&&s--,this.ur&&4&this.ur[this.ir][i][s]&&(t=this.ir),l+=o,l>=65536&&(l-=65536,ih&&i--,this.ur&&4&this.ur[this.ir][i][s]&&(t=this.ir))}return this.Jr&&this.ur&&4&this.ur[this.ir][this.Jr.x>>7][this.Jr.z>>7]&&(t=this.ir),t};uu=()=>{if(!this.ur)return 0;return this.au(this.ir,this.Rn,this.Mn)-this.Sn>=800||!(4&this.ur[this.ir][this.Rn>>7][this.Mn>>7])?3:this.ir};au=(t,i,s)=>{if(!this.cr)return 0;const h=Math.min(i>>7,G.A.yr-1),e=Math.min(s>>7,G.A.yr-1);let n=t;t<3&&this.ur&&!(2&~this.ur[1][h][e])&&(n=t+1);const r=127&i,o=127&s;return(this.cr[n][h][e]*(128-r)+this.cr[n][h+1][e]*r>>7)*(128-o)+(this.cr[n][h][e+1]*(128-r)+this.cr[n][h+1][e+1]*r>>7)*o>>7};lu=(t,i,s,h,e,n)=>{const r=2048-e&2047,o=2048-h&2047;let l,a,c,f=0,u=0,w=n;0!==r&&(l=d.A.sin[r],a=d.A.cos[r],c=u*a-n*l>>16,w=u*l+n*a>>16,u=c),0!==o&&(l=d.A.sin[o],a=d.A.cos[o],c=w*l+f*a>>16,w=w*a-f*l>>16,f=c),this.Rn=t-f,this.Sn=i-u,this.Mn=s-w,this.kn=e,this.xn=h};Kf=()=>{if(!this.Jr)return;const t=this.Jr.x+this.mn,i=this.Jr.z+this.In;(this.lr-t<-500||this.lr-t>500||this.ar-i<-500||this.ar-i>500)&&(this.lr=t,this.ar=i),this.lr!==t&&(this.lr+=(t-this.lr)/16|0),this.ar!==i&&(this.ar+=(i-this.ar)/16|0),1===this.vf[1]?this.nr+=(-this.nr-24)/2|0:1===this.vf[2]?this.nr+=(24-this.nr)/2|0:this.nr=this.nr/2|0,1===this.vf[3]?this.rr+=(12-this.rr)/2|0:1===this.vf[4]?this.rr+=(-this.rr-12)/2|0:this.rr=this.rr/2|0,this.er=this.er+this.nr/2&2047,this.hr+=this.rr/2|0,this.hr<128&&(this.hr=128),this.hr>383&&(this.hr=383);const s=this.lr>>7,h=this.ar>>7,e=this.au(this.ir,this.lr,this.ar);let n=0;if(this.cr&&s>3&&h>3&&s<100&&h<100)for(let t=s-4;t<=s+4;t++)for(let i=h-4;i<=h+4;i++){let s=this.ir;s<3&&this.ur&&!(2&~this.ur[1][t][i])&&s++;const h=e-this.cr[s][t][i];h>n&&(n=h)}let r=192*n;r>98048&&(r=98048),r<32768&&(r=32768),r>this.Dn?this.Dn+=(r-this.Dn)/24|0:r{let t=128*this.Cr+64,i=128*this.Tr+64,s=this.au(this.ir,this.Cr,this.Tr)-this.Or;this.Rnt&&(this.Rn=t)),this.Rn>t&&(this.Rn-=this.vr+((this.Rn-t)*this.br/1e3|0),this.Rns&&(this.Sn=s)),this.Sn>s&&(this.Sn-=this.vr+((this.Sn-s)*this.br/1e3|0),this.Sni&&(this.Mn=i)),this.Mn>i&&(this.Mn-=this.vr+((this.Mn-i)*this.br/1e3|0),this.Mn383&&(o=383),this.kno&&(this.kn=o)),this.kn>o&&(this.kn-=this.gr+((this.kn-o)*this._r/1e3|0),this.kn1024&&(a-=2048),a<-1024&&(a+=2048),a>0&&(this.xn+=this.gr+(a*this._r/1e3|0),this.xn&=2047),a<0&&(this.xn-=this.gr+(-a*this._r/1e3|0),this.xn&=2047);let c=l-this.xn;c>1024&&(c-=2048),c<-1024&&(c+=2048),(c<0&&a>0||c>0&&a<0)&&(this.xn=l)};qA=(t,i)=>{const s=t.CA;let n=this.Hn+(s>>4&7),r=this.Wn+(7&s);if(i===T.A.ZA||i===T.A.jA){const s=t.CA,h=s>>2,e=3&s,o=P.A.of(h).nw;let l;if(l=i===T.A.jA?-1:t.ct,n>=0&&r>=0&&n>14&32767,h=31&t,e=t>>6}t=new U.A(this.ir,o,n,r,0,F.A.qd,P.A.jd.id,s,e,h),this.Xr.LE(t)}t&&(t.Am=l,t.shape=h,t.angle=e),this.eA(this.ir,n,r,l,e,h,o)}}else if(i===T.A.zA){const i=t.CA>>2,s=P.A.of(i).nw,e=t.ct;if(n>=0&&r>=0&&n>14&32767,this.ir,s,n,r,h.A.Jo[e],!1);this.Wr.LE(i)}}}else if(i===T.A.XA){const i=t.ct,s=t.ct;if(n>=0&&r>=0&&n=0&&r>=0&&n=0&&r>=0&&n=0&&s>=0&&i=0&&r>=0&&n=0&&r>=0&&n>2,h=3&i,o=P.A.of(s).nw,l=t.ct,a=t.ct,c=t.ct,f=t.ct;let u,d=t.gA,w=t.gA,y=t.gA,A=t.gA;if(u=f===this.so?this.Jr:this.Lr[f],u&&this.cr){const t=new B.A(this.ir,o,n,r,-1,h,s,a+this.hi);this.Yr.LE(t);const i=new B.A(this.ir,o,n,r,l,h,s,c+this.hi);this.Yr.LE(i);const f=this.cr[this.ir][n][r],p=this.cr[this.ir][n+1][r],m=this.cr[this.ir][n+1][r+1],I=this.cr[this.ir][n][r+1],E=e.A.get(l);u.ZI=a+this.hi,u.qI=c+this.hi,u.jI=E.xa(s,h,f,p,m,I,-1);let g,_=E.width,C=E.length;h!==F.A.$d&&h!==F.A.Qd||(_=E.length,C=E.width),u.RE=128*n+64*_,u.SE=128*r+64*C,u.ME=this.au(this.ir,u.RE,u.SE),d>y&&(g=d,d=y,y=g),w>A&&(g=w,w=A,A=g),u.iE=n+d,u.hE=n+y,u.sE=r+w,u.eE=r+A}}else if(i===T.A.GA){const i=t.ct,s=t.ct,h=t.ct;if(n>=0&&r>=0&&n{if(!$.K.vt){if(d.A.kE[17]>=t){const t=d.A.xE[17];if(!t)return;const i=t.width*t.height-1,s=t.width*this.un*2,h=t.Mc,e=this.Jn;for(let t=0;t<=i;t++)e[t]=h[t-s&i];t.Mc=e,this.Jn=h,d.A.DE(17)}if(d.A.kE[24]>=t){const t=d.A.xE[24];if(!t)return;const i=t.width*t.height-1,s=t.width*this.un*2,h=t.Mc,e=this.Jn;for(let t=0;t<=i;t++)e[t]=h[t-s&i];t.Mc=e,this.Jn=h,d.A.DE(24)}}};Vc=()=>{if(!(this.Vi&&this.Ki&&this.Yi&&this.qi))return;for(let t=10;t<117;t++){(100*Math.random()|0)<50&&(this.Vi[t+32512]=255)}for(let t=0;t<100;t++){const t=2+(124*Math.random()|0)+(128+(128*Math.random()|0)<<7);this.Vi[t]=192}for(let t=1;t<255;t++)for(let i=1;i<127;i++){const s=i+(t<<7);this.Ki[s]=(this.Vi[s-1]+this.Vi[s+1]+this.Vi[s-128]+this.Vi[s+128])/4|0}this.$i+=128,this.$i>this.Yi.length&&(this.$i-=this.Yi.length,this.zc(this.Ui[12*Math.random()|0]));for(let t=1;t<255;t++)for(let i=1;i<127;i++){const s=i+(t<<7);let h=this.Ki[s+128]-(this.Yi[s+this.$i&this.Yi.length-1]/5|0);h<0&&(h=0),this.Vi[s]=h}for(let t=0;t<255;t++)this.qi[t]=this.qi[t+1];if(this.qi[255]=16*Math.sin(this.hi/14)+14*Math.sin(this.hi/15)+12*Math.sin(this.hi/16)|0,this.Ji>0&&(this.Ji-=4),this.Qi>0&&(this.Qi-=4),0===this.Ji&&0===this.Qi){const t=2e3*Math.random()|0;0===t?this.Ji=1024:1===t&&(this.Qi=1024)}};NE=(t,i,s)=>{const h=256-i;return((16711935&t)*h+(16711935&s)*i&4278255360)+((65280&t)*h+(65280&s)*i&16711680)>>8};Kc=()=>{if(!(this.Xi&&this.zi&&this.ji&&this.Zi&&this.qi&&this.Vi))return;const t=256;if(this.Ji>0)for(let t=0;t<256;t++)this.Ji>768?this.Xi[t]=this.NE(this.zi[t],1024-this.Ji,this.ji[t]):this.Ji>256?this.Xi[t]=this.ji[t]:this.Xi[t]=this.NE(this.ji[t],256-this.Ji,this.zi[t]);else if(this.Qi>0)for(let t=0;t<256;t++)this.Qi>768?this.Xi[t]=this.NE(this.zi[t],1024-this.Qi,this.Zi[t]):this.Qi>256?this.Xi[t]=this.Zi[t]:this.Xi[t]=this.NE(this.Zi[t],256-this.Qi,this.zi[t]);else for(let t=0;t<256;t++)this.Xi[t]=this.zi[t];for(let t=0;t<33920;t++)this.Ti&&this.Gi&&(this.Ti.Mc[t]=this.Gi.Mc[t]);let i=0,s=1152;for(let h=1;h<255;h++){let e=(this.qi[h]*(t-h)/t|0)+22;e<0&&(e=0),i+=e;for(let t=e;t<128;t++){let t=this.Vi[i++];if(0===t)s++;else{const i=t,h=256-t;if(t=this.Xi[t],this.Ti){const e=this.Ti.Mc[s];this.Ti.Mc[s++]=((16711935&t)*i+(16711935&e)*h&4278255360)+((65280&t)*i+(65280&e)*h&16711680)>>8}}}s+=e}this.Ti?.draw(0,0);for(let t=0;t<33920;t++)this.Oi&&this.Hi&&(this.Oi.Mc[t]=this.Hi.Mc[t]);i=0,s=1176;for(let h=1;h<255;h++){const e=this.qi[h]*(t-h)/t|0,n=103-e;s+=e;for(let t=0;t>8}}}i+=128-n,s+=128-n-e}this.Oi?.draw(661,0)}}console.log(`RS2 user client - release #${$.K.Tt}`),await(0,it.w)(),(new t).run().then((()=>{})),i()}catch(t){i(t)}}),1)},8370:(t,i,s)=>{s.d(i,{A:()=>c});var h=s(1183),e=s(4583),n=s(9234);const r=['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=s(2595),a=s(7854);class c{static getParameter(t){return new URLSearchParams(window.location.search).get(t)??''}static setParameter(t,i){const s=new URL(window.location.toString());s.searchParams.set(t,i),window.history.pushState(null,'',s.toString())}pd=0;PE=[];FE=0;tl=null;state=0;yd=20;UE=1;BE=[];wd=0;GE=0;HE=[];WE=!0;YE=!1;VE=50;hasFocus=!0;Nc=!1;wf=0;Lf=0;ea=0;na=0;Qc=0;tf=0;if=0;vf=[];KE=[];XE=0;zE=0;input=null;jE=!1;ZE=!1;qE=!1;time=-1;$E=0;JE=0;QE=0;tg=0;ig=0;sg=0;constructor(t=!1){a.hg.tabIndex=-1,a.Il.fillStyle='black',a.Il.fillRect(0,0,a.hg.width,a.hg.height),this.YE=t,this.YE?this.resize(window.innerWidth,window.innerHeight):this.resize(a.hg.width,a.hg.height)}get width(){return a.hg.width}get height(){return a.hg.height}resize=(t,i)=>{a.hg.width=t,a.hg.height=i,this.tl=new h.A(t,i),e.A.eg()};run=async()=>{a.hg.addEventListener('resize',(()=>{this.YE&&this.resize(window.innerWidth,window.innerHeight)}),!1),a.hg.onmousedown=this.onmousedown,a.hg.onmouseup=this.onmouseup,a.hg.onmouseenter=this.onmouseenter,a.hg.onmouseleave=this.onmouseleave,a.hg.onmousemove=this.onmousemove,window.onbeforeunload=this.Zo,a.hg.onfocus=this.onfocus,a.hg.onblur=this.onblur,this.ng?(a.hg.ontouchstart=this.ontouchstart,a.hg.ontouchend=this.ontouchend,a.hg.ontouchmove=this.ontouchmove):(a.hg.onkeydown=this.onkeydown,a.hg.onkeyup=this.onkeyup),a.hg.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.ng&&'low'===c.getParameter('detail')&&(this.VE=30),await this.ul(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.BE[t]=performance.now();let t,i=0,s=256,h=1,e=0;for(;this.state>=0;){if(this.state>0&&(this.state--,0===this.state))return void this.rg();const r=s,o=h;s=300,h=1,t=performance.now();const l=this.BE[i];if(0===l?(s=r,h=o):t>l&&(s=2560*this.yd/(t-l)|0),s<25?s=25:s>256&&(s=256,h=this.yd-(t-l)/10|0),this.BE[i]=t,i=(i+1)%10,h>1)for(let t=0;t<10;t++)0!==this.BE[t]&&(this.BE[t]+=h);for(h0&&(this.wd=1e3*s/(256*this.yd)|0);const a=performance.now();if(this.WE&&this.refresh(),await this.draw(),this.HE[this.GE]=(performance.now()-a)/1e3,this.GE=(this.GE+1)%this.HE.length,this.VE<50){const i=1e3/this.VE-(performance.now()-t);i>0&&await(0,n.wl)(i)}}-1===this.state&&this.rg()};rg=()=>{this.state=-2,this.Zo()};El=t=>{this.yd=1e3/t|0};Ky=t=>{this.VE=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.yd|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};Zo=()=>{};draw=async()=>{};refresh=()=>{};async ul(t,i){const s=this.width,h=this.height;this.WE&&(a.Il.fillStyle='black',a.Il.fillRect(0,0,s,h),this.WE=!1);const e=h/2-18;a.Il.fillStyle='rgb(140, 17, 17)',a.Il.rect((s/2|0)-152,e,304,34),a.Il.fillRect((s/2|0)-150,e+2,3*t,30),a.Il.fillStyle='black',a.Il.fillRect((s/2|0)-150+3*t,e+2,300-3*t,30),a.Il.font='bold 13px helvetica, sans-serif',a.Il.textAlign='center',a.Il.fillStyle='white',a.Il.fillText(i,s/2|0,e+22),await(0,n.wl)(5)}hf=()=>{let t=-1;return this.zE!==this.XE&&(t=this.KE[this.XE],this.XE=this.XE+1&127),t};get ms(){const t=this.HE.length;let i=0;for(let s=0;sthis.pd&&(this.pd=s),this.PE[this.FE]=s,this.FE=(this.FE+1)%250,s}get Ad(){return this.PE.reduce(((t,i)=>t+i),0)/250}onkeydown=t=>{const i=t.key;this.wf=0;const s=o[i];if(!s||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const h=s.code;let e=s.ch;t.ctrlKey&&(e>='A'.charCodeAt(0)&&e<=']'.charCodeAt(0)||e=='_'.charCodeAt(0)?e-='A'.charCodeAt(0)-1:e>='a'.charCodeAt(0)&&e<='z'.charCodeAt(0)&&(e-='a'.charCodeAt(0)-1)),e<30&&(e=0),h===o.ArrowLeft.code?e=1:h===o.ArrowRight.code?e=2:h===o.ArrowUp.code?e=3:h===o.ArrowDown.code?e=4:h===o.Control.code?e=5:h===o.Shift.code?e=6:h===o.Alt.code?e=7:h===o.Backspace.code||h===o.Delete.code?e=8:h===o.Tab.code?e=9:h===o.Enter.code?e=10:h>=o.F1.code&&h<=o.F12.code?e=h+1008-o.F1.code:h===o.Home.code?e=1e3:h===o.End.code?e=1001:h===o.PageUp.code?e=1002:h===o.PageDown.code&&(e=1003),e>0&&e<128&&(this.vf[e]=1),e>4&&(this.KE[this.zE]=e,this.zE=this.zE+1&127),l.A.enabled&&l.A.og(e),r.includes(i)||t.preventDefault()};onkeyup=t=>{const i=t.key;this.wf=0;const s=o[i];if(!s||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const h=s.code;let e=s.ch;e<30&&(e=0),h===o.ArrowLeft.code?e=1:h===o.ArrowRight.code?e=2:h===o.ArrowUp.code?e=3:h===o.ArrowDown.code?e=4:h===o.Control.code?e=5:h===o.Shift.code?e=6:h===o.Alt.code?e=7:h===o.Backspace.code||h===o.Delete.code?e=8:h===o.Tab.code?e=9:h===o.Enter.code?e=10:h>=o.F1.code&&h<=o.F12.code?e=h+1008-o.F1.code:h===o.Home.code?e=1e3:h===o.End.code?e=1001:h===o.PageUp.code?e=1002:h===o.PageDown.code&&(e=1003),e>0&&e<128&&(this.vf[e]=0),l.A.enabled&&l.A.lg(e),r.includes(i)||t.preventDefault()};onmousedown=t=>{if(this.jE=!1,(t.clientX>0||t.clientY>0)&&this.ag(t),this.wf=0,this.tf=this.ea,this.if=this.na,this.ng&&!this.cg){if(this.fg()||this.ug()||this.dg())return this.Qc=1,void(this.Lf=1);t.timeStamp>=this.time+500?(this.Qc=2,this.Lf=2):(this.Qc=1,this.Lf=1)}else 2===t.button?(this.Qc=2,this.Lf=2):(this.Qc=1,this.Lf=1);l.A.enabled&&l.A.wg(this.tf,this.if,t.buttons)};onmouseup=t=>{this.ag(t),this.wf=0,this.Lf=0,l.A.enabled&&l.A.yg(t.buttons)};onmouseenter=t=>{this.ag(t),l.A.enabled&&l.A.Ag()};onmouseleave=t=>{this.ag(t),this.wf=0,this.ea=-1,this.na=-1,this.Lf=0,this.tf=-1,this.if=-1,l.A.enabled&&l.A.pg()};onmousemove=t=>{this.ag(t),this.wf=0,l.A.enabled&&l.A.mg(this.ea,this.na)};onfocus=t=>{this.hasFocus=!0,this.WE=!0,this.refresh(),l.A.enabled&&l.A.Ig()};onblur=t=>{this.hasFocus=!1,l.A.enabled&&l.A.Eg()};ontouchstart=t=>{if(!this.ng)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.jE=!0;const i=t.changedTouches[0],s=0|i.clientX,h=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:s,clientY:h})),this.$E=this.ig=this.QE=0|i.screenX,this.JE=this.sg=this.tg=0|i.screenY,this.time=t.timeStamp,this.ZE=this.gg(),this.qE=this._g()};ontouchend=t=>{if(!this.ng||!this.jE)return;const i=t.changedTouches[0],s=0|i.clientX,h=0|i.clientY;if(this.onmousemove(new MouseEvent('mousemove',{clientX:s,clientY:h})),this.ig=0|i.screenX,this.sg=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.ZE&&!this.gg())return void(this.jE=!1);if(this.qE&&!this._g())return void(this.jE=!1);if(this.fg()||this.Cg()||this.ug()||this.dg()){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.ug()?(t.setAttribute('id','username'),t.setAttribute('placeholder','Username')):this.dg()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.fg()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.Cg()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this.Tg?t.setAttribute('type','password'):t.setAttribute('type',this.dg()?'password':'text'),t.setAttribute('autofocus','autofocus'),t.setAttribute('spellcheck','false'),t.setAttribute('autocomplete','off'),t.setAttribute('style',`position: fixed; left: ${s}px; top: ${h}px; width: 1px; height: 1px; opacity: 0;`),document.body.appendChild(t),t.focus(),t.click(),this.Tg&&(t.oninput=t=>{if(!(t instanceof InputEvent))return;const i=t,s=i.data;null!==s&&'insertText'===i.inputType&&this.onkeydown(new KeyboardEvent('keydown',{key:s,code:s}))}),t.onkeydown=t=>{this.Tg&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this.Tg&&'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.jE=!1)}const e=t.timeStamp>=this.time+500,n=Math.abs(this.$E-this.ig)>16||Math.abs(this.JE-this.sg)>16;e&&!n?(this.jE=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.Lf=0,this.jE=!1)};ontouchmove=t=>{if(!this.ng||!this.jE)return;const i=t.changedTouches[0],s=0|i.clientX,h=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:s,clientY:h})),this.ig=0|i.screenX,this.sg=0|i.screenY,this.ZE&&-1===this.nl()?(this.QE-this.ig>0?this.rotate(2):this.QE-this.ig<0&&this.rotate(0),this.tg-this.sg>0?this.rotate(3):this.tg-this.sg<0&&this.rotate(1)):(this.qE||-1!==this.nl())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this.QE=this.ig,this.tg=this.sg};get ng(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get Tg(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get cg(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}gg=()=>this.Nc&&this.ea>=8&&this.ea<=520&&this.na>=11&&this.na<=345;fg=()=>this.Nc&&-1===this.el()&&!this.sl()&&!this.hl()&&this.ea>=11&&this.ea<=506&&this.na>=449&&this.na<=482;Cg=()=>this.Nc&&(this.sl()||this.hl())&&this.ea>=11&&this.ea<=506&&this.na>=383&&this.na<=482;_g=()=>this.Nc&&this.ea>=562&&this.ea<=752&&this.na>=231&&this.na<=492;ug=()=>!this.Nc&&2===this.il()&&this.ea>=301&&this.ea<=562&&this.na>=262&&this.na<=279;dg=()=>!this.Nc&&2===this.il()&&this.ea>=301&&this.ea<=562&&this.na>=279&&this.na<=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'})))};Og=()=>null!==document.fullscreenElement;ag=t=>{if(this.Og()){const i=t.target.getBoundingClientRect(),s=window.innerHeight/a.hg.height,h=(window.innerWidth-a.hg.width*s)/2;this.ea=0|this.vg(t.clientX-i.left-h,0,a.hg.width*s,0,789),this.na=0|this.vg(t.clientY-i.top,0,a.hg.height*s,0,532)}else{const i=a.hg.getBoundingClientRect(),s=a.hg.width/i.width,h=a.hg.height/i.height;this.ea=(t.clientX-i.left)*s|0,this.na=(t.clientY-i.top)*h|0}this.ea<0&&(this.ea=0),this.na<0&&(this.na=0),this.ea>789&&(this.ea=789),this.na>532&&(this.na=532)};vg=(t,i,s,h,e)=>(t-i)*(e-h)/(s-i)+h}},2595:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1069);class e{static enabled=!1;static bg=null;static Lg=null;static Rg=0;static Sg=0;static Mg=0;static kg=0;static xg=0;static rp=()=>{this.bg=h.A.ni(1),this.Lg=null,this.Rg=performance.now(),this.enabled=!0};static df=()=>{this.enabled=!1,this.bg=null};static flush=()=>{let t=null;return this.Lg&&this.enabled&&(t=this.Lg),this.Lg=null,t};static stop=()=>{let t=null;return this.bg&&this.bg.ft>0&&this.enabled&&(t=this.bg),this.df(),t};static wg=(t,i,s)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;this.Sg++;const h=performance.now();let e=(h-this.Rg)/10|0;e>250&&(e=250),this.Rg=h,this.Dg(5),1===s?this.bg?.p1(1):this.bg?.p1(2),this.bg?.p1(e),this.bg?.p3(t+(i<<10))};static yg=t=>{if(!this.enabled)return;this.Sg++;const i=performance.now();let s=(i-this.Rg)/10|0;s>250&&(s=250),this.Rg=i,this.Dg(2),1===t?this.bg?.p1(3):this.bg?.p1(4),this.bg?.p1(s)};static mg=(t,i)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;const s=performance.now();if(s-this.Mg>=50){this.Mg=s,this.Sg++;let h=(s-this.Rg)/10|0;h>250&&(h=250),this.Rg=s,t-this.kg<8&&t-this.kg>=-8&&i-this.xg<8&&i-this.xg>=-8?(this.Dg(3),this.bg?.p1(5),this.bg?.p1(h),this.bg?.p1(t+(i-this.xg+8<<4)+8-this.kg)):t-this.kg<128&&t-this.kg>=-128&&i-this.xg<128&&i-this.xg>=-128?(this.Dg(4),this.bg?.p1(6),this.bg?.p1(h),this.bg?.p1(t+128-this.kg),this.bg?.p1(i+128-this.xg)):(this.Dg(5),this.bg?.p1(7),this.bg?.p1(h),this.bg?.p3(t+(i<<10))),this.kg=t,this.xg=i}};static og=t=>{if(!this.enabled)return;this.Sg++;const i=performance.now();let s=(i-this.Rg)/10|0;s>250&&(s=250),this.Rg=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.Dg(3),this.bg?.p1(8),this.bg?.p1(s),this.bg?.p1(t)};static lg=t=>{if(!this.enabled)return;this.Sg++;const i=performance.now();let s=(i-this.Rg)/10|0;s>250&&(s=250),this.Rg=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.Dg(3),this.bg?.p1(9),this.bg?.p1(s),this.bg?.p1(t)};static Ig=()=>{if(!this.enabled)return;this.Sg++;const t=performance.now();let i=(t-this.Rg)/10|0;i>250&&(i=250),this.Rg=t,this.Dg(2),this.bg?.p1(10),this.bg?.p1(i)};static Eg=()=>{if(!this.enabled)return;this.Sg++;const t=performance.now();let i=(t-this.Rg)/10|0;i>250&&(i=250),this.Rg=t,this.Dg(2),this.bg?.p1(11),this.bg?.p1(i)};static Ag=()=>{if(!this.enabled)return;this.Sg++;const t=performance.now();let i=(t-this.Rg)/10|0;i>250&&(i=250),this.Rg=t,this.Dg(2),this.bg?.p1(12),this.bg?.p1(i)};static pg=()=>{if(!this.enabled)return;this.Sg++;const t=performance.now();let i=(t-this.Rg)/10|0;i>250&&(i=250),this.Rg=t,this.Dg(2),this.bg?.p1(13),this.bg?.p1(i)};static Dg=t=>{if(this.bg&&this.bg.ft+t>=500){const t=this.bg;this.bg=h.A.ni(1),this.Lg=t}}}},1120:(t,i,s)=>{s.d(i,{A:()=>c});var h=s(1069),e=s(8665),n=s(2031),r=s(1122),o=s(3819),l=s(3867),a=s(8950);class c{static Jo=[];static Ng=null;static Qo=null;static jl=0;static Pg=1;static ql=2;static da=3;static ya=4;static va=5;static Ra=6;static Fa=7;static Rm=1;static km=2;static xm=3;static Dm=4;static Nm=5;static Ea=6;static Ga=1;static Ha=100;static Wa=101;static Ya=200;static Ey=201;static gy=202;static Va=203;static _y=205;static Oy=300;static Fg=301;static Ug=302;static Bg=303;static Gg=304;static Hg=305;static Wg=306;static Yg=307;static Vg=308;static Kg=309;static Xg=310;static zg=311;static jg=312;static vy=313;static by=314;static Zg=315;static qg=316;static $g=317;static Jg=318;static Qg=319;static t_=320;static i_=321;static s_=322;static Ly=323;static nc=324;static rc=325;static Ry=326;static qa=327;static Ka=401;static Xa=500;static Cy=501;static Ty=502;static Za=503;static oc=600;static My=601;static h_=602;static e_=603;static n_=604;static r_=605;static o_=606;static l_=607;static a_=608;static c_=609;static f_=610;static u_=611;static ky=612;static lc=613;static ac=650;static uc=651;static dc=652;static wc=653;static yc=654;static cc=655;static Sc=(t,i,s)=>{this.Ng=new n.A(5e4),this.Qo=new n.A(5e4);const e=new h.A(t.read('data'));let r=-1;for(e.ft+=2;e.ft0){h._l=new Uint8Array(n),h.Tl=new Uint16Array(n);for(let t=0;t0){h.scripts=new l.Ns(o,null);for(let t=0;t0){const e=s.lastIndexOf(',');h.ua[t]=this.d_(i,s.substring(0,e),parseInt(s.substring(e+1),10))}}h.Lm=new l.Ns(5,null);for(let t=0;t<5;t++){const i=e.NA;h.Lm[t]=i,0===i.length&&(h.Lm[t]=null)}}if(h.type===c.da&&(h.fill=1===e.CA),h.type===c.ya||h.type===c.Pg){h._a=1===e.CA;const t=e.CA;s&&(h.font=s[t]),h.Ta=1===e.CA}if(h.type===c.ya&&(h.text=e.NA,h.ma=e.NA),h.type!==c.Pg&&h.type!==c.da&&h.type!==c.ya||(h.wa=e.ut),h.type!==c.da&&h.type!==c.ya||(h.pa=e.ut,h.Aa=e.ut),h.type===c.va){const t=e.NA;if(t.length>0){const s=t.lastIndexOf(',');h.La=this.d_(i,t.substring(0,s),parseInt(t.substring(s+1),10))}const s=e.NA;if(s.length>0){const t=s.lastIndexOf(',');h.ba=this.d_(i,s.substring(0,t),parseInt(s.substring(t+1),10))}}if(h.type===c.Ra){const t=e.CA;0!==t&&(h.model=this.xa((t-1<<8)+e.CA));const i=e.CA;0!==i&&(h.w_=this.xa((i-1<<8)+e.CA)),h.Dl=e.CA,0===h.Dl?h.Dl=-1:h.Dl=(h.Dl-1<<8)+e.CA,h.Nl=e.CA,0===h.Nl?h.Nl=-1:h.Nl=(h.Nl-1<<8)+e.CA,h.zoom=e.ct,h.ka=e.ct,h.Pa=e.ct}if(h.type===c.Fa){h.Ql=new Int32Array(h.width*h.height),h.ta=new Int32Array(h.width*h.height),h._a=1===e.CA;const t=e.CA;s&&(h.font=s[t]),h.Ta=1===e.CA,h.wa=e.ut,h.ia=e.Cp,h.sa=e.Cp,h.Om=1===e.CA,h.Lm=new l.Ns(5,null);for(let t=0;t<5;t++){const i=e.NA;h.Lm[t]=i,0===i.length&&(h.Lm[t]=null)}}h.Ia!==c.km&&h.type!==c.ql||(h.Kw=e.NA,h.action=e.NA,h.Vw=e.ct),h.Ia!==c.Rm&&h.Ia!==c.Dm&&h.Ia!==c.Nm&&h.Ia!==c.Ea||(h.Mm=e.NA,0===h.Mm.length&&(h.Ia===c.Rm?h.Mm='Ok':h.Ia===c.Dm||h.Ia===c.Nm?h.Mm='Select':h.Ia===c.Ea&&(h.Mm='Continue')))}this.Ng=null,this.Qo=null};static d_=(t,i,s)=>{const h=o.A.y_(i)<<8n|BigInt(s);if(this.Ng){const t=this.Ng.get(h);if(t)return t}let e;try{e=r.A.Ic(t,i,s),this.Ng?.put(h,e)}catch(t){return null}return e};static xa=t=>{if(this.Qo){const i=this.Qo.get(BigInt(t));if(i)return i}const i=e.A.model(t);return this.Qo?.put(BigInt(t),i),i};id=-1;nw=-1;type=-1;Ia=-1;Xl=0;width=0;height=0;Tm=-1;_l=null;Tl=null;scripts=null;scroll=0;hide=!1;draggable=!1;Om=!1;bm=!1;ia=0;sa=0;$l=null;Jl=null;ua=null;Lm=null;fill=!1;_a=!1;font=null;Ta=!1;text=null;ma=null;wa=0;pa=0;Aa=0;La=null;ba=null;model=null;w_=null;Dl=-1;Nl=-1;zoom=0;ka=0;Pa=0;Kw=null;action=null;Vw=-1;Mm=null;xl=null;Wl=null;Yl=null;x=0;y=0;Zl=0;Ql=null;ta=null;Fl=0;Pl=0;xa(t,i,s){let h=this.model;if(s&&(h=this.w_),!h)return null;if(-1===t&&-1===i&&!h.A_)return h;const n=e.A.p_(h,!0,!0,!1);return-1===t&&-1===i||n.sc(),-1!==t&&n.hc(t),-1!==i&&n.hc(i),n.ec(64,768,-50,-10,-50,!0),n}m_(){if(this.nw===this.id)return this.x;let t=c.Jo[this.nw];if(!t.xl||!t.Wl||!t.Yl)return this.x;let i=t.xl.indexOf(this.id);if(-1===i)return this.x;let s=t.Wl[i];for(;t.nw!==t.id;){const h=c.Jo[t.nw];h.xl&&h.Wl&&h.Yl&&(i=h.xl.indexOf(t.id),-1!==i&&(s+=h.Wl[i])),t=h}return s}I_(){if(this.nw===this.id)return this.y;let t=c.Jo[this.nw];if(!t.xl||!t.Wl||!t.Yl)return this.y;let i=t.xl.indexOf(this.id);if(-1===i)return this.y;let s=t.Yl[i];for(;t.nw!==t.id;){const h=c.Jo[t.nw];h.xl&&h.Wl&&h.Yl&&(i=h.xl.indexOf(t.id),-1!==i&&(s+=h.Yl[i])),t=h}return s}outline(t){const i=this.m_(),s=this.I_();a.A.Vl(i,s,this.width,this.height,t)}move(t,i){if(this.nw===this.id)return;this.x=0,this.y=0;const s=c.Jo[this.nw];if(s.xl&&s.Wl&&s.Yl){const h=s.xl.indexOf(this.id);-1!==h&&(s.Wl[h]=t,s.Yl[h]=i)}}delete(){if(this.nw===this.id)return;const t=c.Jo[this.nw];if(t.xl&&t.Wl&&t.Yl){const i=t.xl.indexOf(this.id);-1!==i&&(t.xl.splice(i,1),t.Wl.splice(i,1),t.Yl.splice(i,1))}}}},6333:(t,i,s)=>{s.d(i,{$:()=>h});class h{id;E_=null;constructor(t){this.id=t}g_(t){for(;;){const i=t.CA;if(0===i)break;this.decode(i,t)}return this}}},2164:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(1069),e=s(6333);class n extends e.${static count=0;static Jo=[];static Sc=t=>{const i=new h.A(t.read('flo.dat'));this.count=i.ct;for(let t=0;t(s>179&&(i=i/2|0),s>192&&(i=i/2|0),s>217&&(i=i/2|0),s>243&&(i=i/2|0),(t/4<<10)+(i/32<<7)+(s/2|0));static C_=(t,i)=>-1===t?12345678:((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);static T_=(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);O_=0;texture=-1;v_=!1;b_=!0;L_=0;R_=0;S_=0;M_=0;k_=0;x_=0;decode(t,i){1===t?(this.O_=i.lt,this.setColor(this.O_)):2===t?this.texture=i.CA:3===t?this.v_=!0:5===t?this.b_=!1:6===t?this.E_=i.NA:console.log('Error unrecognised config code: ',t)}setColor(t){const i=(t>>16&255)/256,s=(t>>8&255)/256,h=(255&t)/256;let e=i;si&&(r=s),h>r&&(r=h);let o=0,l=0;const a=(e+r)/2;e!==r&&(a<.5&&(l=(r-e)/(r+e)),a>=.5&&(l=(r-e)/(2-r-e)),i===r?o=(s-h)/(r-e):s===r?o=(h-i)/(r-e)+2:h===r&&(o=(i-s)/(r-e)+4)),o/=6,this.L_=256*o|0,this.R_=256*l|0,this.S_=256*a|0,this.R_<0?this.R_=0:this.R_>255&&(this.R_=255),this.S_<0?this.S_=0:this.S_>255&&(this.S_=255),this.M_=a>.5?(1-a)*l*512|0:a*l*512|0,this.M_<1&&(this.M_=1),this.k_=o*this.M_|0;let c=this.L_+(16*Math.random()|0)-8;c<0?c=0:c>255&&(c=255);let f=this.R_+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255);let u=this.S_+(48*Math.random()|0)-24;u<0?u=0:u>255&&(u=255),this.x_=n.__(c,f,u)}}},8317:(t,i,s)=>{s.d(i,{A:()=>o});var h=s(1069),e=s(6333),n=s(8665),r=s(3867);class o extends e.${static count=0;static Jo=[];static Sc=t=>{const i=new h.A(t.read('idk.dat'));this.count=i.ct;for(let t=0;t=40&&t<50)this.P_[t-40]=i.ct;else if(t>=50&&t<60)this.F_[t-50]=i.ct;else{if(!(t>=60&&t<70))throw new Error(`Unrecognized idk config code: ${t}`);this.N_[t-60]=i.ct}}xa(){if(!this.D_)return null;const t=new r.Ns(this.D_.length,null);for(let i=0;i{s.d(i,{A:()=>c});var h=s(6333),e=s(1069),n=s(2031),r=s(8665),o=s(1023),l=s(6169),a=s(3867);class c extends h.${static count=0;static cache=null;static U_=null;static B_=null;static G_=0;static Tu=new n.A(500);static Ou=new n.A(30);static Sc=t=>{this.U_=new e.A(t.read('loc.dat'));const i=new e.A(t.read('loc.idx'));this.count=i.ct,this.B_=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.B_||!this.U_)throw new Error('LocType not loaded!!!');for(let i=0;i<10;i++){const s=this.cache[i];if(s&&s.id===t)return s}this.G_=(this.G_+1)%10;const i=this.cache[this.G_];return this.U_.ft=this.B_[t],i.id=t,i.reset(),i.g_(this.U_),i.H_||(i.H_=new Int32Array(1)),-1===i.W_&&i.H_&&(i.active=i.H_.length>0&&i.H_[0]===o.A.Ny.id,i.Um&&(i.active=!0)),i};static Zo=()=>{this.Tu=null,this.Ou=null,this.B_=null,this.cache=null,this.U_=null};D_=null;H_=null;name=null;bw=null;P_=null;F_=null;width=1;length=1;cA=!0;fA=!0;active=!1;W_=-1;Y_=!1;V_=!1;b_=!1;Dl=-1;K_=!1;X_=16;z_=0;j_=0;Um=null;Gd=-1;zd=-1;Z_=!1;q_=!0;J_=128;Q_=128;tC=128;Uy=0;iC=0;sC=0;hC=0;eC=!1;decode(t,i){if(1===t){const t=i.CA;this.D_=new Int32Array(t),this.H_=new Int32Array(t);for(let s=0;s=30&&t<39)this.Um||(this.Um=new a.Ns(5,null)),this.Um[t-30]=i.NA,'hidden'===this.Um[t-30]?.toLowerCase()&&(this.Um[t-30]=null);else if(40===t){const t=i.CA;this.P_=new Uint16Array(t),this.F_=new Uint16Array(t);for(let s=0;s=this.D_.length)return null;let d=this.D_[a];if(-1===d)return null;const w=this.Z_!==i>3;w&&(d+=65536);let y=c.Tu?.get(BigInt(d));y||(y=r.A.model(65535&d),w&&y.fC(),c.Tu?.put(BigInt(d),y));const A=128!==this.J_||128!==this.Q_||128!==this.tC,p=0!==this.iC||0!==this.sC||0!==this.hC;let m=r.A.p_(y,!this.P_,!this.K_,i===l.A.qd&&-1===o&&!A&&!p);for(-1!==o&&(m.sc(),m.hc(o),m.uC=null,m.dC=null);i-- >0;)m.wC();if(this.P_&&this.F_)for(let t=0;t{s.d(i,{A:()=>l});var h=s(6333),e=s(1069),n=s(2031),r=s(8665),o=s(3867);class l extends h.${static count=0;static cache=null;static U_=null;static B_=null;static G_=0;static Qo=new n.A(30);static Sc=t=>{this.U_=new e.A(t.read('npc.dat'));const i=new e.A(t.read('npc.idx'));this.count=i.ct,this.B_=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.B_||!this.U_)throw new Error('NpcType not loaded!!!');for(let i=0;i<20;i++){const s=this.cache[i];if(s&&s.id===t)return s}this.G_=(this.G_+1)%20;const i=this.cache[this.G_]=new l(t);return this.U_.ft=this.B_[t],i.g_(this.U_),i};static Zo=()=>{this.Qo=null,this.B_=null,this.cache=null,this.U_=null};name=null;bw=null;size=1;D_=null;N_=null;K_=!1;BI=-1;MI=-1;xI=-1;NI=-1;UI=-1;P_=null;F_=null;Um=null;J_=-1;Q_=-1;tC=-1;kd=!0;Ym=-1;pC=128;mC=128;decode(t,i){if(1===t){const t=i.CA;this.D_=new Uint16Array(t);for(let s=0;s=30&&t<40)this.Um||(this.Um=new o.Ns(5,null)),this.Um[t-30]=i.NA,'hidden'===this.Um[t-30]?.toLowerCase()&&(this.Um[t-30]=null);else if(40===t){const t=i.CA;this.P_=new Uint16Array(t),this.F_=new Uint16Array(t);for(let s=0;s{s.d(i,{A:()=>u});var h=s(6333),e=s(1069),n=s(1122),r=s(2031),o=s(8665),l=s(4583),a=s(8950),c=s(9298),f=s(3867);class u extends h.${static count=0;static cache=null;static U_=null;static B_=null;static G_=0;static TC=!0;static Qo=new r.A(50);static vu=new r.A(200);static Sc=(t,i)=>{this.TC=i,this.U_=new e.A(t.read('obj.dat'));const s=new e.A(t.read('obj.idx'));this.count=s.ct,this.B_=new Int32Array(this.count);let h=2;for(let t=0;t{if(!this.cache||!this.B_||!this.U_)throw new Error('ObjType not loaded!!!');for(let i=0;i<10;i++){const s=this.cache[i];if(s&&s.id===t)return s}this.G_=(this.G_+1)%10;const i=this.cache[this.G_];return this.U_.ft=this.B_[t],i.id=t,i.reset(),i.g_(this.U_),-1!==i.OC&&i.vC(),!this.TC&&i.members&&(i.name='Members Object',i.bw="Login to a members' server to use this object.",i.Um=null,i.vm=null),i};static Zo=()=>{this.Qo=null,this.vu=null,this.B_=null,this.cache=null,this.U_=null};static ha=(t,i)=>{if(u.vu){let s=u.vu.get(BigInt(t));if(s&&s.Nd!==i&&-1!==s.Nd&&(s.SA(),s=null),s)return s}let s=u.get(t);if(s.bC||(i=-1),s.bC&&s.LC&&i>1){let t=-1;for(let h=0;h<10;h++)i>=s.LC[h]&&0!==s.LC[h]&&(t=s.bC[h]);-1!==t&&(s=u.get(t))}const h=new n.A(32,32),e=l.A.Sa,r=l.A.Ma,o=l.A.xc,f=a.A.Mc,d=a.A.RC,w=a.A.SC,y=a.A.left,A=a.A.right,p=a.A.top,m=a.A.bottom;l.A.MC=!1,a.A.bind(h.Mc,32,32),a.A.fillRect(0,0,32,32,c.A.ca),l.A.eg();const I=s.sA(1),E=l.A.sin[s.Bp]*s.Hp>>16,g=l.A.cos[s.Bp]*s.Hp>>16;I.Na(0,s.Gp,s.kC,s.Bp,s.xC,E+(I.AC/2|0)+s.DC,g+s.DC);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===h.Mc[t+32*i]&&(t>0&&h.Mc[t+32*i-1]>1||i>0&&h.Mc[t+32*(i-1)]>1||t<31&&h.Mc[t+32*i+1]>1||i<31&&h.Mc[t+32*(i+1)]>1)&&(h.Mc[t+32*i]=1);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===h.Mc[t+32*i]&&t>0&&i>0&&h.Mc[t+32*(i-1)-1]>0&&(h.Mc[t+32*i]=3153952);if(-1!==s.OC){const t=this.ha(s.NC,10),i=t.oa,h=t.Nd;t.oa=32,t.Nd=32,t.PC(5,5,22,22),t.oa=i,t.Nd=h}return u.vu?.put(BigInt(t),h),a.A.bind(f,d,w),a.A.Hl(y,p,A,m),l.A.Sa=e,l.A.Ma=r,l.A.xc=o,l.A.MC=!0,s.Ua?h.oa=33:h.oa=32,h.Nd=i,h};model=0;name=null;bw=null;P_=null;F_=null;Hp=2e3;Bp=0;Gp=0;kC=0;xC=0;DC=0;FC=!1;UC=-1;Ua=!1;tA=1;members=!1;Um=null;vm=null;BC=-1;GC=-1;HC=0;WC=-1;YC=-1;VC=0;KC=-1;XC=-1;zC=-1;jC=-1;ZC=-1;qC=-1;bC=null;LC=null;NC=-1;OC=-1;decode(t,i){if(1===t)this.model=i.ct;else if(2===t)this.name=i.NA;else if(3===t)this.bw=i.NA;else if(4===t)this.Hp=i.ct;else if(5===t)this.Bp=i.ct;else if(6===t)this.Gp=i.ct;else if(7===t)this.xC=i.Cp,this.xC>32767&&(this.xC-=65536);else if(8===t)this.DC=i.Cp,this.DC>32767&&(this.DC-=65536);else if(9===t)this.FC=!0;else if(10===t)this.UC=i.ct;else if(11===t)this.Ua=!0;else if(12===t)this.tA=i.ut;else if(16===t)this.members=!0;else if(23===t)this.BC=i.ct,this.HC=i.gA;else if(24===t)this.GC=i.ct;else if(25===t)this.WC=i.ct,this.VC=i.gA;else if(26===t)this.YC=i.ct;else if(t>=30&&t<35)this.Um||(this.Um=new f.Ns(5,null)),this.Um[t-30]=i.NA,'hidden'===this.Um[t-30]?.toLowerCase()&&(this.Um[t-30]=null);else if(t>=35&&t<40)this.vm||(this.vm=new f.Ns(5,null)),this.vm[t-35]=i.NA;else if(40===t){const t=i.CA;this.P_=new Uint16Array(t),this.F_=new Uint16Array(t);for(let s=0;s=100&&t<110&&(this.bC&&this.LC||(this.bC=new Uint16Array(10),this.LC=new Uint16Array(10)),this.bC[t-100]=i.ct,this.LC[t-100]=i.ct)}$C(t){let i=this.BC;if(1===t&&(i=this.WC),-1===i)return null;let s=this.GC,h=this.KC;1===t&&(s=this.YC,h=this.XC);let e=o.A.model(i);if(-1!==s){const t=o.A.model(s);if(-1===h){const i=[e,t];e=o.A.$a(i,2)}else{const i=[e,t,o.A.model(h)];e=o.A.$a(i,3)}}if(0===t&&0!==this.HC&&e.translate(this.HC,0,0),1===t&&0!==this.VC&&e.translate(this.VC,0,0),this.P_&&this.F_)for(let t=0;t1){let i=-1;for(let s=0;s<10;s++)t>=this.LC[s]&&0!==this.LC[s]&&(i=this.bC[s]);if(-1!==i)return u.get(i).sA(1)}if(u.Qo){const t=u.Qo.get(BigInt(this.id));if(t)return t}const i=o.A.model(this.model);if(this.P_&&this.F_)for(let t=0;t{s.d(i,{A:()=>r});var h=s(6333),e=s(1069),n=s(6730);class r extends h.${static count=0;static Jo=[];static Sc=t=>{const i=new e.A(t.read('seq.dat'));this.count=i.ct;for(let t=0;t{s.d(i,{A:()=>l});var h=s(6333),e=s(1069),n=s(1312),r=s(8665),o=s(2031);class l extends h.${static count=0;static Jo=[];static Qo=new o.A(30);static Sc=t=>{const i=new e.A(t.read('spotanim.dat'));this.count=i.ct;for(let t=0;t=40&&t<50)this.P_[t-40]=i.ct;else{if(!(t>=50&&t<60))throw new Error(`Unrecognized spotanim config code: ${t}`);this.F_[t-50]=i.ct}}xa(){let t=l.Qo?.get(BigInt(this.id));if(t)return t;t=r.A.model(this.model);for(let i=0;i<6;i++)0!==this.P_[0]&&t.Ja(this.P_[i],this.F_[i]);return l.Qo?.put(BigInt(this.id),t),t}}},3764:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(6333),e=s(1069);class n extends h.${static count=0;static Jo=[];static tT=[];static iT=0;static Sc=t=>{const i=new e.A(t.read('varp.dat'));this.count=i.ct;for(let t=0;t{s.d(i,{A:()=>h});class h{static OPEN=0;static rT=1;static oT=2;static lT=4;static aT=8;static cT=h.rT<<4;static fT=h.oT<<4;static uT=h.lT<<4;static dT=h.aT<<4;static wT=256;static yT=512;static AT=1024;static pT=2048;static mT=4096;static IT=h.yT<<4;static ET=h.AT<<4;static gT=h.pT<<4;static _T=h.mT<<4;static CT=h.wT<<9;static TT=524288;static OT=2097152;static vT=h.OT|h.TT;static bT=h.wT|h.vT;static Yd=h.oT|h.bT;static Hd=h.aT|h.bT;static Zm=h.oT|h.lT|h.Hd;static Vd=h.fT|h.bT;static $m=h.aT|h.cT|h.Vd;static Wd=h.dT|h.bT;static qm=h.rT|h.oT|h.Wd;static Jm=h.fT|h.uT|h.Wd;static LT=16777215}},670:(t,i,s)=>{s.d(i,{A:()=>o});var h=s(9456),e=s(6169),n=s(1023),r=s(4909);class o{static tr=4;static yr=104;static index=(t,i)=>t*o.yr+i;offsetX;RT;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.RT=0,this.sizeX=o.yr,this.sizeZ=o.yr,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.RT)]|=h.A.OT};yA=(t,i)=>{this.flags[o.index(t-this.offsetX,i-this.RT)]&=~h.A.OT};eA=(t,i,s,n,r,o)=>{let l=h.A.wT;o&&(l|=h.A.CT);const a=t-this.offsetX,c=i-this.RT;if(r===e.A.$d||r===e.A.Qd){const t=s;s=n,n=t}for(let t=a;t=0&&t=0&&i{let l=h.A.wT;o&&(l|=h.A.CT);const a=t-this.offsetX,c=i-this.RT;if(r===e.A.$d||r===e.A.Qd){const t=s;s=n,n=t}for(let t=a;t=0&&t=0&&i{const l=t-this.offsetX,a=i-this.RT,c=o?h.A._T:h.A.dT,f=o?h.A.mT:h.A.aT,u=o?h.A.AT:h.A.oT,d=o?h.A.ET:h.A.fT,w=o?h.A.yT:h.A.rT,y=o?h.A.IT:h.A.cT,A=o?h.A.pT:h.A.lT,p=o?h.A.gT:h.A.uT;s===n.A.jd.id?r===e.A.qd?(this.add(l,a,c),this.add(l-1,a,f)):r===e.A.$d?(this.add(l,a,u),this.add(l,a+1,d)):r===e.A.Jd?(this.add(l,a,f),this.add(l+1,a,c)):r===e.A.Qd&&(this.add(l,a,d),this.add(l,a-1,u)):s===n.A.kT.id||s===n.A.tw.id?r===e.A.qd?(this.add(l,a,w),this.add(l-1,a+1,y)):r===e.A.$d?(this.add(l,a,A),this.add(l+1,a+1,p)):r===e.A.Jd?(this.add(l,a,y),this.add(l+1,a-1,w)):r===e.A.Qd&&(this.add(l,a,p),this.add(l-1,a-1,A)):s===n.A.Zd.id&&(r===e.A.qd?(this.add(l,a,u|c),this.add(l-1,a,f),this.add(l,a+1,d)):r===e.A.$d?(this.add(l,a,u|f),this.add(l,a+1,d),this.add(l+1,a,c)):r===e.A.Jd?(this.add(l,a,d|f),this.add(l+1,a,c),this.add(l,a-1,u)):r===e.A.Qd&&(this.add(l,a,d|c),this.add(l,a-1,u),this.add(l-1,a,f))),o&&this.MT(t,i,s,r,!1)};aA=(t,i,s,r,o)=>{const l=t-this.offsetX,a=i-this.RT,c=o?h.A._T:h.A.dT,f=o?h.A.mT:h.A.aT,u=o?h.A.AT:h.A.oT,d=o?h.A.ET:h.A.fT,w=o?h.A.yT:h.A.rT,y=o?h.A.IT:h.A.cT,A=o?h.A.pT:h.A.lT,p=o?h.A.gT:h.A.uT;s===n.A.jd.id?r===e.A.qd?(this.remove(l,a,c),this.remove(l-1,a,f)):r===e.A.$d?(this.remove(l,a,u),this.remove(l,a+1,d)):r===e.A.Jd?(this.remove(l,a,f),this.remove(l+1,a,c)):r===e.A.Qd&&(this.remove(l,a,d),this.remove(l,a-1,u)):s===n.A.kT.id||s===n.A.tw.id?r===e.A.qd?(this.remove(l,a,w),this.remove(l-1,a+1,y)):r===e.A.$d?(this.remove(l,a,A),this.remove(l+1,a+1,p)):r===e.A.Jd?(this.remove(l,a,y),this.remove(l+1,a-1,w)):r===e.A.Qd&&(this.remove(l,a,p),this.remove(l-1,a-1,A)):s===n.A.Zd.id&&(r===e.A.qd?(this.remove(l,a,u|c),this.remove(l-1,a,f),this.remove(l,a+1,d)):r===e.A.$d?(this.remove(l,a,u|f),this.remove(l,a+1,d),this.remove(l+1,a,c)):r===e.A.Jd?(this.remove(l,a,d|f),this.remove(l+1,a,c),this.remove(l,a-1,u)):r===e.A.Qd&&(this.remove(l,a,d|c),this.remove(l,a-1,u),this.remove(l-1,a,f))),o&&this.aA(t,i,s,r,!1)};Xm=(t,i,s,r,l,a)=>{if(t===s&&i===r)return!0;const c=t-this.offsetX,f=i-this.RT,u=s-this.offsetX,d=r-this.RT,w=o.index(c,f);if(l===n.A.jd.id){if(a===e.A.qd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A.Vd)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.Yd)===h.A.OPEN)return!0}else if(a===e.A.$d){if(c===u&&f===d+1)return!0;if(c===u-1&&f===d&&(this.flags[w]&h.A.Hd)===h.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.Wd)===h.A.OPEN)return!0}else if(a===e.A.Jd){if(c===u+1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A.Vd)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.Yd)===h.A.OPEN)return!0}else if(a===e.A.Qd){if(c===u&&f===d-1)return!0;if(c===u-1&&f===d&&(this.flags[w]&h.A.Hd)===h.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.Wd)===h.A.OPEN)return!0}}else if(l===n.A.Zd.id){if(a===e.A.qd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.Wd)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.Yd)===h.A.OPEN)return!0}else if(a===e.A.$d){if(c===u-1&&f===d&&(this.flags[w]&h.A.Hd)===h.A.OPEN)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.Yd)===h.A.OPEN)return!0}else if(a===e.A.Jd){if(c===u-1&&f===d&&(this.flags[w]&h.A.Hd)===h.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A.Vd)===h.A.OPEN)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1)return!0}else if(a===e.A.Qd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A.Vd)===h.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.Wd)===h.A.OPEN)return!0;if(c===u&&f===d-1)return!0}}else if(l===n.A.sw.id){if(c===u&&f===d+1&&(this.flags[w]&h.A.fT)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.oT)===h.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&h.A.aT)===h.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.dT)===h.A.OPEN)return!0}return!1};zm=(t,i,s,r,l,a)=>{if(t===s&&i===r)return!0;const c=t-this.offsetX,f=i-this.RT,u=s-this.offsetX,d=r-this.RT,w=o.index(c,f);if(l===n.A.xT.id||l===n.A.DT.id){if(l===n.A.DT.id&&(a=a+2&3),a===e.A.qd){if(c===u+1&&f===d&&(this.flags[w]&h.A.dT)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.oT)===h.A.OPEN)return!0}else if(a===e.A.$d){if(c===u-1&&f===d&&(this.flags[w]&h.A.aT)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.oT)===h.A.OPEN)return!0}else if(a===e.A.Jd){if(c===u-1&&f===d&&(this.flags[w]&h.A.aT)===h.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A.fT)===h.A.OPEN)return!0}else if(a===e.A.Qd){if(c===u+1&&f===d&&(this.flags[w]&h.A.dT)===h.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A.fT)===h.A.OPEN)return!0}}else if(l===n.A.NT.id){if(c===u&&f===d+1&&(this.flags[w]&h.A.fT)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.oT)===h.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&h.A.aT)===h.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.dT)===h.A.OPEN)return!0}return!1};jm=(t,i,s,e,n,l,a)=>{const c=s+n-1,f=e+l-1,u=o.index(t-this.offsetX,i-this.RT);return t>=s&&t<=c&&i>=e&&i<=f||(t===s-1&&i>=e&&i<=f&&(this.flags[u]&h.A.aT)===h.A.OPEN&&(a&r.A.qd)===h.A.OPEN||(t===c+1&&i>=e&&i<=f&&(this.flags[u]&h.A.dT)===h.A.OPEN&&(a&r.A.Jd)===h.A.OPEN||(i===e-1&&t>=s&&t<=c&&(this.flags[u]&h.A.oT)===h.A.OPEN&&(a&r.A.Qd)===h.A.OPEN||i===f+1&&t>=s&&t<=c&&(this.flags[u]&h.A.fT)===h.A.OPEN&&(a&r.A.$d)===h.A.OPEN)))};add=(t,i,s)=>{this.flags[o.index(t,i)]|=s};remove=(t,i,s)=>{this.flags[o.index(t,i)]&=h.A.LT-s}}},4909:(t,i,s)=>{s.d(i,{A:()=>h});class h{static $d=1;static Jd=2;static Qd=4;static qd=8}},6169:(t,i,s)=>{s.d(i,{A:()=>h});class h{static qd=0;static $d=1;static Jd=2;static Qd=3}},5599:(t,i,s)=>{s.d(i,{A:()=>h});class h{static nA=0;static rA=1;static lA=2;static Fy=3}},1023:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(5599);class e{static jd=new e(0,h.A.nA);static kT=new e(1,h.A.nA);static Zd=new e(2,h.A.nA);static tw=new e(3,h.A.nA);static dE=new e(4,h.A.rA);static Km=new e(5,h.A.rA);static xT=new e(6,h.A.rA);static DT=new e(7,h.A.rA);static NT=new e(8,h.A.rA);static sw=new e(9,h.A.lA);static Ny=new e(10,h.A.lA);static Py=new e(11,h.A.lA);static PT=new e(12,h.A.lA);static FT=new e(13,h.A.lA);static UT=new e(14,h.A.lA);static BT=new e(15,h.A.lA);static GT=new e(16,h.A.lA);static HT=new e(17,h.A.lA);static WT=new e(18,h.A.lA);static YT=new e(19,h.A.lA);static VT=new e(20,h.A.lA);static KT=new e(21,h.A.lA);static Fy=new e(22,h.A.Fy);static values(){return[this.jd,this.kT,this.HT,this.BT,this.Zd,this.UT,this.sw,this.tw,this.Fy,this.PT,this.Py,this.xT,this.VT,this.Ny,this.Km,this.FT,this.DT,this.dE,this.GT,this.NT,this.YT,this.KT,this.WT]}static of(t){const i=this.values();for(let s=0;s{s.d(i,{A:()=>A});var h=s(670),e=s(2164),n=s(1069),r=s(4583),o=s(198),l=s(5637),a=s(4197),c=s(1312),f=s(1023),u=s(6169),d=s(9298),w=s(5518),y=s(3867);class A{static XT=Int8Array.of(1,2,4,8);static zT=Uint8Array.of(16,32,64,128);static jT=Int8Array.of(1,0,-1,0);static ZT=Int8Array.of(0,-1,0,1);static qT=(17*Math.random()|0)-8;static $T=(33*Math.random()|0)-16;static vt=!0;static hm=0;static JT=!1;static QT=(t,i)=>{let s=this.tO(t+45365,i+91923,4)+(this.tO(t+10294,i+37821,2)-128>>1)+(this.tO(t,i,1)-128>>2)-128;return s=35+(.3*s|0),s<10?s=10:s>60&&(s=60),s};static tO=(t,i,s)=>{const h=t/s|0,e=t&s-1,n=i/s|0,r=i&s-1,o=this.iO(h,n),l=this.iO(h+1,n),a=this.iO(h,n+1),c=this.iO(h+1,n+1),f=this.sO(o,l,e,s),u=this.sO(a,c,e,s);return this.sO(f,u,r,s)};static sO=(t,i,s,h)=>{const e=65536-r.A.cos[1024*s/h|0]>>1;return(t*(65536-e)>>16)+(i*e>>16)};static iO=(t,i)=>((this.hO(t-1,i-1)+this.hO(t+1,i-1)+this.hO(t-1,i+1)+this.hO(t+1,i+1))/16|0)+((this.hO(t-1,i)+this.hO(t+1,i)+this.hO(t,i-1)+this.hO(t,i+1))/8|0)+(this.hO(t,i)/4|0);static hO=(t,i)=>{const s=t+57*i,h=BigInt(s<<13^s);return 255&Number((h*(h*h*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static eA=(t,i,s,h,e,n,r,o,d,w,y)=>{const p=e[y][i][s],m=e[y][i+1][s],I=e[y][i+1][s+1],E=e[y][i][s+1],g=p+m+I+E>>2,_=l.A.get(o);let C=i+(s<<7)+(o<<14)+1073741824|0;_.active||(C+=-2147483648),C|=0;const T=(w<<6)+d<<24>>24;if(d===f.A.Fy.id)h?.eO(_.xa(f.A.Fy.id,w,p,m,I,E,-1),t,i,s,g,C,T),_.cA&&_.active&&r?.ST(i,s),-1!==_.Dl&&n.LE(new a.A(o,t,3,i,s,c.A.Jo[_.Dl],!0));else if(d===f.A.Ny.id||d===f.A.Py.id){const e=_.xa(f.A.Ny.id,w,p,m,I,E,-1);if(e){let n,r,o=0;d===f.A.Py.id&&(o+=256),w===u.A.$d||w===u.A.Qd?(n=_.length,r=_.width):(n=_.width,r=_.length),h?.eA(t,i,s,g,e,null,C,T,n,r,o)}_.cA&&r?.eA(i,s,_.width,_.length,w,_.fA),-1!==_.Dl&&n.LE(new a.A(o,t,2,i,s,c.A.Jo[_.Dl],!0))}else if(d>=f.A.PT.id)h?.eA(t,i,s,g,_.xa(d,w,p,m,I,E,-1),null,C,T,1,1,0),_.cA&&r?.eA(i,s,_.width,_.length,w,_.fA),-1!==_.Dl&&n.LE(new a.A(o,t,2,i,s,c.A.Jo[_.Dl],!0));else if(d===f.A.jd.id)h?.MT(t,i,s,g,A.XT[w],0,_.xa(f.A.jd.id,w,p,m,I,E,-1),null,C,T),_.cA&&r?.MT(i,s,d,w,_.fA),-1!==_.Dl&&n.LE(new a.A(o,t,0,i,s,c.A.Jo[_.Dl],!0));else if(d===f.A.kT.id)h?.MT(t,i,s,g,A.zT[w],0,_.xa(f.A.kT.id,w,p,m,I,E,-1),null,C,T),_.cA&&r?.MT(i,s,d,w,_.fA),-1!==_.Dl&&n.LE(new a.A(o,t,0,i,s,c.A.Jo[_.Dl],!0));else if(d===f.A.Zd.id){const e=w+1&3;h?.MT(t,i,s,g,A.XT[w],A.XT[e],_.xa(f.A.Zd.id,w+4,p,m,I,E,-1),_.xa(f.A.Zd.id,e,p,m,I,E,-1),C,T),_.cA&&r?.MT(i,s,d,w,_.fA),-1!==_.Dl&&n.LE(new a.A(o,t,0,i,s,c.A.Jo[_.Dl],!0))}else if(d===f.A.tw.id)h?.MT(t,i,s,g,A.zT[w],0,_.xa(f.A.tw.id,w,p,m,I,E,-1),null,C,T),_.cA&&r?.MT(i,s,d,w,_.fA),-1!==_.Dl&&n.LE(new a.A(o,t,0,i,s,c.A.Jo[_.Dl],!0));else if(d===f.A.sw.id)h?.eA(t,i,s,g,_.xa(d,w,p,m,I,E,-1),null,C,T,1,1,0),_.cA&&r?.eA(i,s,_.width,_.length,w,_.fA),-1!==_.Dl&&n.LE(new a.A(o,t,2,i,s,c.A.Jo[_.Dl],!0));else if(d===f.A.dE.id)h?.nO(t,i,s,g,0,0,C,_.xa(f.A.dE.id,u.A.qd,p,m,I,E,-1),T,512*w,A.XT[w]),-1!==_.Dl&&n.LE(new a.A(o,t,1,i,s,c.A.Jo[_.Dl],!0));else if(d===f.A.Km.id){let e=16;if(h){const n=h.Kd(t,i,s);n>0&&(e=l.A.get(n>>14&32767).X_)}h?.nO(t,i,s,g,A.jT[w]*e,A.ZT[w]*e,C,_.xa(f.A.dE.id,u.A.qd,p,m,I,E,-1),T,512*w,A.XT[w]),-1!==_.Dl&&n.LE(new a.A(o,t,1,i,s,c.A.Jo[_.Dl],!0))}else d===f.A.xT.id?(h?.nO(t,i,s,g,0,0,C,_.xa(f.A.dE.id,u.A.qd,p,m,I,E,-1),T,w,256),-1!==_.Dl&&n.LE(new a.A(o,t,1,i,s,c.A.Jo[_.Dl],!0))):d===f.A.DT.id?(h?.nO(t,i,s,g,0,0,C,_.xa(f.A.dE.id,u.A.qd,p,m,I,E,-1),T,w,512),-1!==_.Dl&&n.LE(new a.A(o,t,1,i,s,c.A.Jo[_.Dl],!0))):d===f.A.NT.id&&(h?.nO(t,i,s,g,0,0,C,_.xa(f.A.dE.id,u.A.qd,p,m,I,E,-1),T,w,768),-1!==_.Dl&&n.LE(new a.A(o,t,1,i,s,c.A.Jo[_.Dl],!0)))};hE;eE;cr;ur;rO;oO;lO;aO;cO;fO;uO;dO;wO;yO;AO;pO;constructor(t,i,s,e){this.hE=t,this.eE=i,this.cr=s,this.ur=e,this.rO=new y._c(h.A.tr,t,i),this.oO=new y._c(h.A.tr,t,i),this.lO=new y._c(h.A.tr,t,i),this.aO=new y._c(h.A.tr,t,i),this.pO=new y.Cc(h.A.tr,t+1,i+1),this.cO=new y._c(h.A.tr,t+1,i+1),this.fO=new y.wr(t+1,i+1),this.uO=new Int32Array(i),this.dO=new Int32Array(i),this.wO=new Int32Array(i),this.yO=new Int32Array(i),this.AO=new Int32Array(i)}um=(t,i)=>{for(let t=0;t=0&&i[h]?.ST(s,e)}A.qT+=(5*Math.random()|0)-2,A.qT<-8?A.qT=-8:A.qT>8&&(A.qT=8),A.$T+=(5*Math.random()|0)-2,A.$T<-16?A.$T=-16:A.$T>16&&(A.$T=16);for(let i=0;i>8;for(let t=1;t>2)+(s[e+1][t]>>3)+(s[e][t-1]>>2)+(s[e][t+1]>>3)+(s[e][t]>>1);this.fO[e][t]=u-d}for(let t=0;t=0&&h0){const i=e.A.Jo[s-1];this.uO[t]+=i.k_,this.dO[t]+=i.R_,this.wO[t]+=i.S_,this.yO[t]+=i.M_,n=this.AO[t]++}}const r=s-5;if(r>=0&&r0){const i=e.A.Jo[s-1];this.uO[t]-=i.k_,this.dO[t]-=i.R_,this.wO[t]-=i.S_,this.yO[t]-=i.M_,n=this.AO[t]--}}}if(s>=1&&s=0&&f=0&&y=1&&c0||y>0){const p=this.cr[i][s][c],m=this.cr[i][s+1][c],I=this.cr[i][s+1][c+1],E=this.cr[i][s][c+1],g=this.fO[s][c],_=this.fO[s+1][c],C=this.fO[s+1][c+1],T=this.fO[s][c+1];let O=-1,v=-1;if(f>0){const t=256*h/l|0,i=n/a|0;let s=o/a|0;O=e.A.__(t,i,s);const r=t+A.qT&255;s+=A.$T,s<0?s=0:s>255&&(s=255),v=e.A.__(r,i,s)}if(i>0){let t=0!==f||this.lO[i][s][c]===w.A.IO;y>0&&!e.A.Jo[y-1].b_&&(t=!1),t&&p===m&&p===I&&p===E&&(this.pO[i][s][c]|=2340)}let b=0;if(-1!==O&&(b=r.A.palette[e.A.C_(v,96)]),0===y)t?.EO(i,s,c,w.A.IO,u.A.qd,-1,p,m,I,E,e.A.C_(O,g),e.A.C_(O,_),e.A.C_(O,C),e.A.C_(O,T),d.A.ca,d.A.ca,d.A.ca,d.A.ca,b,d.A.ca);else{const h=this.lO[i][s][c]+1,n=this.aO[i][s][c],o=e.A.Jo[y-1];let l,a,f=o.texture;f>=0?(a=r.A.gO(f),l=-1):o.O_===d.A.Jc?(a=0,l=-2,f=-1):(l=e.A.__(o.L_,o.R_,o.S_),a=r.A.palette[e.A.T_(o.x_,96)]),t?.EO(i,s,c,h,n,f,p,m,I,E,e.A.C_(O,g),e.A.C_(O,_),e.A.C_(O,C),e.A.C_(O,T),e.A.T_(l,g),e.A.T_(l,_),e.A.T_(l,C),e.A.T_(l,T),b,a)}}}}}}for(let s=1;s0&&(t<<=3,i<<=3,s<<=3);for(let h=0;h<=e;h++)for(let n=0;n<=this.eE;n++)for(let r=0;r<=this.hE;r++){if(this.pO[h][r][n]&t){let i=n,s=n,l=h,a=h;for(;i>0&&this.pO[h][r][i-1]&t;)i--;for(;s0;){for(let h=i;h<=s;h++)if(!(this.pO[l-1][r][h]&t))break t;l--}t:for(;a=8){const h=this.cr[a][r][i]-240,n=this.cr[l][r][i];o.A.OO(e,1,128*r,h,128*i,128*r,n,128*s+128);for(let h=l;h<=a;h++)for(let e=i;e<=s;e++)this.pO[h][r][e]&=~t}}if(this.pO[h][r][n]&i){let t=r,s=r,l=h,a=h;for(;t>0&&this.pO[h][t-1][n]&i;)t--;for(;s0;){for(let h=t;h<=s;h++)if(!(this.pO[l-1][h][n]&i))break t;l--}t:for(;a=8){const h=this.cr[a][t][n]-240,r=this.cr[l][t][n];o.A.OO(e,2,128*t,h,128*n,128*s+128,r,128*n);for(let h=l;h<=a;h++)for(let e=t;e<=s;e++)this.pO[h][e][n]&=~i}}if(this.pO[h][r][n]&s){let t=r,i=r,l=n,a=n;for(;l>0&&this.pO[h][r][l-1]&s;)l--;for(;a0;){for(let i=l;i<=a;i++)if(!(this.pO[h][t-1][i]&s))break t;t--}t:for(;i=4){const n=this.cr[h][t][l];o.A.OO(e,4,128*t,n,128*l,128*i+128,n,128*a+128);for(let e=t;e<=i;e++)for(let t=l;t<=a;t++)this.pO[h][e][t]&=~s}}}}}};am=(t,i,s,n)=>{let r=0;for(let t=0;t>24;break}for(let e=t;e=0&&t=0&&e{const o=new n.A(new Uint8Array(r));for(let n=0;n=0&&a=0&&c>24,this.aO[n][a][c]=(f-2&3)<<24>>24):f<=81?this.ur[n][a][c]=f-49<<24>>24:this.rO[n][a][c]=f-81<<24>>24}else for(;f=o.CA,0!==f;){if(1===f){o.CA;break}f<=49&&o.CA}}};fm=(t,i,s,e,r,o)=>{const l=new n.A(new Uint8Array(e));let a=-1;for(;;){const e=l.vO;if(0===e)return;a+=e;let n=0;for(;;){const e=l.vO;if(0===e)break;n+=e-1;const c=63&n,f=n>>6&63,u=n>>12,d=l.CA,w=d>>2,y=3&d,A=f+r,p=c+o;if(A>0&&p>0&&A=0&&(e=s[h]),this.eA(u,A,p,t,i,e,a,w,y)}}}};eA=(t,i,s,h,e,n,r,o,d)=>{if(A.vt){if(16&this.ur[t][i][s])return;if(this.mO(t,i,s)!==A.hm)return}const w=this.cr[t][i][s],y=this.cr[t][i+1][s],p=this.cr[t][i+1][s+1],m=this.cr[t][i][s+1],I=w+y+p+m>>2,E=l.A.get(r);let g=i+(s<<7)+(r<<14)+1073741824|0;E.active||(g+=-2147483648),g|=0;const _=(d<<6)+o<<24>>24;if(o===f.A.Fy.id)(!A.vt||E.active||E.eC)&&(h?.eO(E.xa(f.A.Fy.id,d,w,y,p,m,-1),t,i,s,I,g,_),E.cA&&E.active&&n?.ST(i,s),-1!==E.Dl&&e.LE(new a.A(r,t,3,i,s,c.A.Jo[E.Dl],!0)));else if(o===f.A.Ny.id||o===f.A.Py.id){const l=E.xa(f.A.Ny.id,d,w,y,p,m,-1);if(l){let e,n,r=0;if(o===f.A.Py.id&&(r+=256),d===u.A.$d||d===u.A.Qd?(e=E.length,n=E.width):(e=E.width,n=E.length),h?.eA(t,i,s,I,l,null,g,_,e,n,r)&&E.q_)for(let h=0;h<=e;h++)for(let e=0;e<=n;e++){let n=l.bO/4|0;n>30&&(n=30),n>this.cO[t][i+h][s+e]&&(this.cO[t][i+h][s+e]=n<<24>>24)}}E.cA&&n?.eA(i,s,E.width,E.length,d,E.fA),-1!==E.Dl&&e.LE(new a.A(r,t,2,i,s,c.A.Jo[E.Dl],!0))}else if(o>=f.A.PT.id)h?.eA(t,i,s,I,E.xa(o,d,w,y,p,m,-1),null,g,_,1,1,0),o>=f.A.PT.id&&o<=f.A.HT.id&&o!==f.A.FT.id&&t>0&&(this.pO[t][i][s]|=2340),E.cA&&n?.eA(i,s,E.width,E.length,d,E.fA),-1!==E.Dl&&e.LE(new a.A(r,t,2,i,s,c.A.Jo[E.Dl],!0));else if(o===f.A.jd.id)h?.MT(t,i,s,I,A.XT[d],0,E.xa(f.A.jd.id,d,w,y,p,m,-1),null,g,_),d===u.A.qd?(E.q_&&(this.cO[t][i][s]=50,this.cO[t][i][s+1]=50),E.b_&&(this.pO[t][i][s]|=585)):d===u.A.$d?(E.q_&&(this.cO[t][i][s+1]=50,this.cO[t][i+1][s+1]=50),E.b_&&(this.pO[t][i][s+1]|=1170)):d===u.A.Jd?(E.q_&&(this.cO[t][i+1][s]=50,this.cO[t][i+1][s+1]=50),E.b_&&(this.pO[t][i+1][s]|=585)):d===u.A.Qd&&(E.q_&&(this.cO[t][i][s]=50,this.cO[t][i+1][s]=50),E.b_&&(this.pO[t][i][s]|=1170)),E.cA&&n?.MT(i,s,o,d,E.fA),-1!==E.Dl&&e.LE(new a.A(r,t,0,i,s,c.A.Jo[E.Dl],!0)),16!==E.X_&&h?.LO(t,i,s,E.X_);else if(o===f.A.kT.id)h?.MT(t,i,s,I,A.zT[d],0,E.xa(f.A.kT.id,d,w,y,p,m,-1),null,g,_),E.q_&&(d===u.A.qd?this.cO[t][i][s+1]=50:d===u.A.$d?this.cO[t][i+1][s+1]=50:d===u.A.Jd?this.cO[t][i+1][s]=50:d===u.A.Qd&&(this.cO[t][i][s]=50)),E.cA&&n?.MT(i,s,o,d,E.fA),-1!==E.Dl&&e.LE(new a.A(r,t,0,i,s,c.A.Jo[E.Dl],!0));else if(o===f.A.Zd.id){const l=d+1&3;h?.MT(t,i,s,I,A.XT[d],A.XT[l],E.xa(f.A.Zd.id,d+4,w,y,p,m,-1),E.xa(f.A.Zd.id,l,w,y,p,m,-1),g,_),E.b_&&(d===u.A.qd?(this.pO[t][i][s]|=265,this.pO[t][i][s+1]|=1170):d===u.A.$d?(this.pO[t][i][s+1]|=1170,this.pO[t][i+1][s]|=585):d===u.A.Jd?(this.pO[t][i+1][s]|=585,this.pO[t][i][s]|=1170):d===u.A.Qd&&(this.pO[t][i][s]|=1170,this.pO[t][i][s]|=585)),E.cA&&n?.MT(i,s,o,d,E.fA),-1!==E.Dl&&e.LE(new a.A(r,t,0,i,s,c.A.Jo[E.Dl],!0)),16!==E.X_&&h?.LO(t,i,s,E.X_)}else if(o===f.A.tw.id)h?.MT(t,i,s,I,A.zT[d],0,E.xa(f.A.tw.id,d,w,y,p,m,-1),null,g,_),E.q_&&(d===u.A.qd?this.cO[t][i][s+1]=50:d===u.A.$d?this.cO[t][i+1][s+1]=50:d===u.A.Jd?this.cO[t][i+1][s]=50:d===u.A.Qd&&(this.cO[t][i][s]=50)),E.cA&&n?.MT(i,s,o,d,E.fA),-1!==E.Dl&&e.LE(new a.A(r,t,0,i,s,c.A.Jo[E.Dl],!0));else if(o===f.A.sw.id)h?.eA(t,i,s,I,E.xa(o,d,w,y,p,m,-1),null,g,_,1,1,0),E.cA&&n?.eA(i,s,E.width,E.length,d,E.fA),-1!==E.Dl&&e.LE(new a.A(r,t,2,i,s,c.A.Jo[E.Dl],!0));else if(o===f.A.dE.id)h?.nO(t,i,s,I,0,0,g,E.xa(f.A.dE.id,u.A.qd,w,y,p,m,-1),_,512*d,A.XT[d]),-1!==E.Dl&&e.LE(new a.A(r,t,1,i,s,c.A.Jo[E.Dl],!0));else if(o===f.A.Km.id){let n=16;if(h){const e=h.Kd(t,i,s);e>0&&(n=l.A.get(e>>14&32767).X_)}h?.nO(t,i,s,I,A.jT[d]*n,A.ZT[d]*n,g,E.xa(f.A.dE.id,u.A.qd,w,y,p,m,-1),_,512*d,A.XT[d]),-1!==E.Dl&&e.LE(new a.A(r,t,1,i,s,c.A.Jo[E.Dl],!0))}else o===f.A.xT.id?(h?.nO(t,i,s,I,0,0,g,E.xa(f.A.dE.id,u.A.qd,w,y,p,m,-1),_,d,256),-1!==E.Dl&&e.LE(new a.A(r,t,1,i,s,c.A.Jo[E.Dl],!0))):o===f.A.DT.id?(h?.nO(t,i,s,I,0,0,g,E.xa(f.A.dE.id,u.A.qd,w,y,p,m,-1),_,d,512),-1!==E.Dl&&e.LE(new a.A(r,t,1,i,s,c.A.Jo[E.Dl],!0))):o===f.A.NT.id&&(h?.nO(t,i,s,I,0,0,g,E.xa(f.A.dE.id,u.A.qd,w,y,p,m,-1),_,d,768),-1!==E.Dl&&e.LE(new a.A(r,t,1,i,s,c.A.Jo[E.Dl],!0)))};mO=(t,i,s)=>8&this.ur[t][i][s]?0:t<=0||!(2&this.ur[1][i][s])?t:t-1}},198:(t,i,s)=>{s.d(i,{A:()=>I});var h=s(4583);class e{level;y;x;z;model;RO;JI;SO;MO;kO;xO;DO;info;NO=0;wu=0;constructor(t,i,s,h,e,n,r,o,l,a,c,f,u){this.level=t,this.y=i,this.x=s,this.z=h,this.model=e,this.RO=n,this.JI=r,this.SO=o,this.MO=l,this.kO=a,this.xO=c,this.DO=f,this.info=u}}var n=s(3795);class r{iE;hE;sE;eE;type;PO;FO;UO;BO;GO;AC;mode=0;HO=0;WO=0;YO=0;VO=0;KO=0;XO=0;constructor(t,i,s,h,e,n,r,o,l,a,c){this.iE=t,this.hE=i,this.sE=s,this.eE=h,this.type=e,this.PO=n,this.FO=r,this.UO=o,this.BO=l,this.GO=a,this.AC=c}}var o=s(670);class l{y;x;z;model;DO;info;constructor(t,i,s,h,e,n){this.y=t,this.x=i,this.z=s,this.model=h,this.DO=e,this.info=n}}class a{y;x;z;zO;jO;ZO;qO;DO;info;constructor(t,i,s,h,e,n,r,o,l){this.y=t,this.x=i,this.z=s,this.zO=h,this.jO=e,this.ZO=n,this.qO=r,this.DO=o,this.info=l}}class c{y;x;z;type;angle;model;DO;info;constructor(t,i,s,h,e,n,r,o){this.y=t,this.x=i,this.z=s,this.type=h,this.angle=e,this.model=n,this.DO=r,this.info=o}}var f=s(6666);class u{y;x;z;$O;JO;QO;DO;offset;constructor(t,i,s,h,e,n,r,o){this.y=t,this.x=i,this.z=s,this.$O=h,this.JO=e,this.QO=n,this.DO=r,this.offset=o}}class d{tv;iv;sv;hv;ev;color;flat;constructor(t,i,s,h,e,n,r){this.tv=t,this.iv=i,this.sv=s,this.hv=h,this.ev=e,this.color=n,this.flat=r}}var w=s(8950);class y{static nv=new Int32Array(6);static rv=new Int32Array(6);static ov=new Int32Array(6);static lv=new Int32Array(6);static av=new Int32Array(6);static cv=[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 fv=[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 uv=128;static dv=this.uv/2|0;static wv=this.uv/4|0;static yv=3*this.uv/4|0;oC;aC;lC;Av;pv;mv;Iv;Ev;gv;_v;flat;shape;angle;Cv;Tv;constructor(t,i,s,h,e,n,r,o,l,a,c,f,u,d,w,A,p,m,I){this.flat=!(p!==h||p!==d||p!==o),this.shape=i,this.angle=n,this.Cv=u,this.Tv=l;const E=y.cv[i],g=E.length;this.oC=new Int32Array(g),this.aC=new Int32Array(g),this.lC=new Int32Array(g);const _=new Int32Array(g),C=new Int32Array(g),T=t*y.uv,O=m*y.uv;for(let t=0;t8&&g<=12&&(g=9+(g-n-9&3)),g>12&&g<=16&&(g=13+(g-n-13&3)),1===g?(i=T,l=O,c=p,u=r,m=a):2===g?(i=T+y.dv,l=O,c=p+h>>1,u=r+I>>1,m=a+s>>1):3===g?(i=T+y.uv,l=O,c=h,u=I,m=s):4===g?(i=T+y.uv,l=O+y.dv,c=h+d>>1,u=I+e>>1,m=s+w>>1):5===g?(i=T+y.uv,l=O+y.uv,c=d,u=e,m=w):6===g?(i=T+y.dv,l=O+y.uv,c=d+o>>1,u=e+A>>1,m=w+f>>1):7===g?(i=T,l=O+y.uv,c=o,u=A,m=f):8===g?(i=T,l=O+y.dv,c=o+p>>1,u=A+r>>1,m=f+a>>1):9===g?(i=T+y.dv,l=O+y.wv,c=p+h>>1,u=r+I>>1,m=a+s>>1):10===g?(i=T+y.yv,l=O+y.dv,c=h+d>>1,u=I+e>>1,m=s+w>>1):11===g?(i=T+y.dv,l=O+y.yv,c=d+o>>1,u=e+A>>1,m=w+f>>1):12===g?(i=T+y.wv,l=O+y.dv,c=o+p>>1,u=A+r>>1,m=f+a>>1):13===g?(i=T+y.wv,l=O+y.wv,c=p,u=r,m=a):14===g?(i=T+y.yv,l=O+y.wv,c=h,u=I,m=s):15===g?(i=T+y.yv,l=O+y.yv,c=d,u=e,m=w):(i=T+y.wv,l=O+y.yv,c=o,u=A,m=f),this.oC[t]=i,this.aC[t]=c,this.lC[t]=l,_[t]=u,C[t]=m}const v=y.fv[i],b=v.length/4|0;this.Iv=new Int32Array(b),this.Ev=new Int32Array(b),this.gv=new Int32Array(b),this.Av=new Int32Array(b),this.pv=new Int32Array(b),this.mv=new Int32Array(b),this._v=-1!==c?new Int32Array(b):null;let L=0;for(let t=0;t{this.kv=0,this.xv=0,this.Dv=t,this.Nv=i,this.Pv=t/2|0,this.Fv=i/2|0;const r=new m.vv(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let i=0;i<2048;i+=64){this.Uv=h.A.sin[t],this.Bv=h.A.cos[t],this.Gv=h.A.sin[i],this.Hv=h.A.cos[i];const o=(t-128)/32|0,l=i/64|0;for(let t=-26;t<=26;t++)for(let i=-26;i<=26;i++){const h=128*t,a=128*i;let c=!1;for(let t=-s;t<=e;t+=128)if(this.yb(h,a,n[o]+t)){c=!0;break}r[o][l][t+25+1][i+25+1]=c}}for(let t=0;t<8;t++)for(let i=0;i<32;i++)for(let s=-25;s<25;s++)for(let h=-25;h<25;h++){let e=!1;t:for(let n=-1;n<=1;n++)for(let o=-1;o<=1;o++){if(r[t][i][s+n+25+1][h+o+25+1]){e=!0;break t}if(r[t][(i+1)%31][s+n+25+1][h+o+25+1]){e=!0;break t}if(r[t+1][i][s+n+25+1][h+o+25+1]){e=!0;break t}if(r[t+1][(i+1)%31][s+n+25+1][h+o+25+1]){e=!0;break t}}this.Ov[t][i][s+25][h+25]=e}};static Zo=()=>{this.bv=null,this.md=null,this.Lv=null,this.Mv=null,this.Ov=null,this.Sv=null,this.Qv=null,console.log('World3D unloaded!')};static OO=(t,i,s,h,e,n,o,l)=>{I.Lv[t][I.md[t]++]=new r(s/128|0,n/128|0,e/128|0,l/128|0,i,s,n,e,l,h,o)};static yb=(t,i,s)=>{const h=i*this.Gv+t*this.Hv>>16,e=i*this.Hv-t*this.Gv>>16,n=s*this.Uv+e*this.Bv>>16,r=s*this.Bv-e*this.Uv>>16;if(n<50||n>3500)return!1;const o=this.Pv+((h<<9)/n|0),l=this.Fv+((r<<9)/n|0);return o>=this.kv&&o<=this.Dv&&l>=this.xv&&l<=this.Nv};Ab;hE;eE;pb;mb;Yr;Ib;Eb;gb;_b=0;Cb=0;Tb=0;constructor(t,i,s,h){this.Ab=s,this.hE=h,this.eE=i,this.mb=new m.Kr(s,h,i,null),this.Ib=new m.Cc(s,h+1,i+1),this.pb=t,this.Yr=new m.Ns(5e3,null),this.Eb=new Int32Array(1e4),this.gb=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this.Cb=t;for(let i=0;i{const s=this.mb[0][t][i];for(let s=0;s<3;s++){this.mb[s][t][i]=this.mb[s+1][t][i];const h=this.mb[s][t][i];h&&h.level--}this.mb[0][t][i]||(this.mb[0][t][i]=new n.A(0,t,i));const h=this.mb[0][t][i];h&&(h.Ob=s),this.mb[3][t][i]=null};_O=(t,i,s,h)=>{const e=this.mb[t][i][s];e&&(e.vb=h)};EO=(t,i,s,h,e,r,o,l,a,c,f,u,w,p,m,I,E,g,_,C)=>{if(h===A.A.IO){for(let h=t;h>=0;h--)this.mb[h][i][s]||(this.mb[h][i][s]=new n.A(h,i,s));const h=this.mb[t][i][s];h&&(h.bb=new d(f,u,w,p,-1,_,!1))}else if(h===A.A.Lb){for(let h=t;h>=0;h--)this.mb[h][i][s]||(this.mb[h][i][s]=new n.A(h,i,s));const h=this.mb[t][i][s];h&&(h.bb=new d(m,I,E,g,r,C,o===l&&o===a&&o===c))}else{for(let h=t;h>=0;h--)this.mb[h][i][s]||(this.mb[h][i][s]=new n.A(h,i,s));const d=this.mb[t][i][s];d&&(d.Rb=new y(i,h,I,l,w,e,f,c,C,m,r,g,_,a,E,p,o,s,u))}};eO=(t,i,s,h,e,r,o)=>{this.mb[i][s][h]||(this.mb[i][s][h]=new n.A(i,s,h));const a=this.mb[i][s][h];a&&(a.Sb=new l(e,128*s+64,128*h+64,t,r,o))};wA=(t,i,s)=>{const h=this.mb[t][i][s];h&&(h.Sb=null)};hA=(t,i,s,h,e,r,o,l)=>{let a=0;const c=this.mb[h][t][i];if(c)for(let t=0;ta&&(a=s)}else this.mb[h][t][i]=new n.A(h,t,i);const f=this.mb[h][t][i];f&&(f.xb=new u(s,128*t+64,128*i+64,r,o,l,e,a))};Qy=(t,i,s)=>{const h=this.mb[t][i][s];h&&(h.xb=null)};MT=(t,i,s,h,e,r,o,l,c,f)=>{if(!o&&!l)return;for(let h=t;h>=0;h--)this.mb[h][i][s]||(this.mb[h][i][s]=new n.A(h,i,s));const u=this.mb[t][i][s];u&&(u.Db=new a(h,128*i+64,128*s+64,e,r,o,l,c,f))};aA=(t,i,s,h)=>{const e=this.mb[t][i][s];1===h&&e&&(e.Db=null)};nO=(t,i,s,h,e,r,o,l,a,f,u)=>{if(!l)return;for(let h=t;h>=0;h--)this.mb[h][i][s]||(this.mb[h][i][s]=new n.A(h,i,s));const d=this.mb[t][i][s];d&&(d.Nb=new c(h,128*i+e+64,128*s+r+64,u,f,l,o,a))};uA=(t,i,s)=>{const h=this.mb[t][i][s];h&&(h.Nb=null)};LO=(t,i,s,h)=>{const e=this.mb[t][i][s];if(!e)return;const n=e.Nb;if(!n)return;const r=128*i+64,o=128*s+64;n.x=r+((n.x-r)*h/16|0),n.z=o+((n.z-o)*h/16|0)};uE=(t,i,s,h)=>{if(!h)return;const e=this.mb[t][i][s];if(!e)return;const n=e.Nb;n&&(n.model=h)};AE=(t,i,s,h)=>{if(!h)return;const e=this.mb[t][i][s];if(!e)return;const n=e.Sb;n&&(n.model=h)};yE=(t,i,s,h)=>{if(!h)return;const e=this.mb[t][i][s];if(!e)return;const n=e.Db;n&&(n.ZO=h)};wE=(t,i,s,h,e)=>{if(!h)return;const n=this.mb[s][t][i];if(!n)return;const r=n.Db;r&&(r.ZO=h,r.qO=e)};eA=(t,i,s,h,e,n,r,o,l,a,c)=>{if(!e&&!n)return!0;const f=128*i+64*l,u=128*s+64*a;return this.Pb(f,u,h,t,i,s,l,a,e,n,r,o,c,!1)};$I=(t,i,s,h,e,n,r,o,l,a)=>{if(!e&&!n)return!0;let c=i-l,f=h-l,u=i+l,d=h+l;return a&&(o>640&&o<1408&&(d+=128),o>1152&&o<1920&&(u+=128),(o>1664||o<384)&&(f-=128),o>128&&o<896&&(c-=128)),c=c/128|0,f=f/128|0,u=u/128|0,d=d/128|0,this.Pb(i,h,s,t,c,f,u+1-c,d-f+1,e,n,r,0,o,!0)};tE=(t,i,s,h,e,n,r,o,l,a,c,f)=>!l&&!a||this.Pb(i,h,s,t,e,n,r+1-e,o-n+1,l,a,c,0,f,!0);dA=(t,i,s)=>{const h=this.mb[t][i][s];if(h)for(let t=0;t>29&3)&&e.SO===i&&e.kO===s)return void this.Fb(e)}};fE=(t,i,s,h)=>{if(!h)return;const e=this.mb[t][i][s];if(e)for(let t=0;t>29&3))return void(i.model=h)}};pu=()=>{for(let t=0;t{const h=this.mb[t][i][s];return h&&h.Db?h.Db.DO:0};oA=(t,i,s)=>{const h=this.mb[t][s][i];return h&&h.Nb?h.Nb.DO:0};iw=(t,i,s)=>{const h=this.mb[t][i][s];if(!h)return 0;for(let t=0;t>29&3)&&e.SO===i&&e.kO===s)return e.DO}return 0};Bd=(t,i,s)=>{const h=this.mb[t][i][s];return h&&h.Sb?h.Sb.DO:0};Xd=(t,i,s,h)=>{const e=this.mb[t][i][s];if(e){if(e.Db&&e.Db.DO===h)return 255&e.Db.info;if(e.Nb&&e.Nb.DO===h)return 255&e.Nb.info;if(e.Sb&&e.Sb.DO===h)return 255&e.Sb.info;for(let t=0;t{const n=i*(0|Math.sqrt(s*s+h*h+e*e))>>8;for(let i=0;i{if(i0){const e=this.mb[t][i+1][s-1];e&&e.Sb&&e.Sb.model&&e.Sb.model.Ub&&this.Gb(h,e.Sb.model,128,0,-128,!0)}};Bb=(t,i,s,h,e,n)=>{let r=!0,o=i;const l=i+h,a=s-1,c=s+e;for(let f=t;f<=t+1;f++)if(f!==this.Ab){for(let u=o;u<=l;u++)if(!(u<0||u>=this.hE))for(let o=a;o<=c;o++){if(o<0||o>=this.eE||r&&u=s||u===i))continue;const a=this.mb[f][u][o];if(!a)continue;const d=128*(u-i)+64*(1-h),w=128*(o-s)+64*(1-e),y=((this.pb[f][u][o]+this.pb[f][u+1][o]+this.pb[f][u][o+1]+this.pb[f][u+1][o+1])/4|0)-((this.pb[t][i][s]+this.pb[t][i+1][s]+this.pb[t][i][s+1]+this.pb[t][i+1][s+1])/4|0),A=a.Db;A&&A.ZO&&A.ZO.Ub&&this.Gb(n,A.ZO,d,y,w,r),A&&A.qO&&A.qO.Ub&&this.Gb(n,A.qO,d,y,w,r);for(let t=0;t{this.Tb++;let r=0;const o=i.oC,l=i.rC;if(t.Ub&&t.Yb)for(let n=0;ni.GO)continue;const u=t.oC[n]-s;if(ui.FO)continue;const d=t.lC[n]-e;if(di.BO)continue;if(i.Ub&&i.Yb)for(let t=0;t{const r=this.mb[t][i][s];if(!r)return;const o=r.bb;if(o){const t=o.color;if(0!==t)for(let i=0;i<4;i++)h[e]=t,h[e+1]=t,h[e+2]=t,h[e+3]=t,e+=n;return}const l=r.Rb;if(!l)return;const a=l.shape,c=l.angle,f=l.Cv,u=l.Tv,d=I.fb[a],w=I.ub[c];let y=0;if(0===f)for(let t=0;t<4;t++)0!==d[w[y++]]&&(h[e]=u),0!==d[w[y++]]&&(h[e+1]=u),0!==d[w[y++]]&&(h[e+2]=u),0!==d[w[y++]]&&(h[e+3]=u),e+=n;else for(let t=0;t<4;t++)h[e]=0===d[w[y++]]?f:u,h[e+1]=0===d[w[y++]]?f:u,h[e+2]=0===d[w[y++]]?f:u,h[e+3]=0===d[w[y++]]?f:u,e+=n};click=(t,i)=>{I.Jv=!0,I.ea=t,I.na=i,I.Nf=-1,I.Pf=-1};draw=(t,i,s,e,n,r,o)=>{t<0?t=0:t>=128*this.hE&&(t=128*this.hE-1),s<0?s=0:s>=128*this.eE&&(s=128*this.eE-1),I.wu++,I.Uv=h.A.sin[r],I.Bv=h.A.cos[r],I.Gv=h.A.sin[n],I.Hv=h.A.cos[n],I.Qv=I.Ov[(r-128)/32|0][n/64|0],I.Wv=t,I.Yv=i,I.Vv=s,I.Kv=t/128|0,I.Xv=s/128|0,I.Id=e,I.zv=I.Kv-25,I.zv<0&&(I.zv=0),I.Zv=I.Xv-25,I.Zv<0&&(I.Zv=0),I.jv=I.Kv+25,I.jv>this.hE&&(I.jv=this.hE),I.qv=I.Xv+25,I.qv>this.eE&&(I.qv=this.eE),this.Zb(),I.$v=0;for(let t=this.Cb;t=2e3)?(r.visible=!0,r.update=!0,r.qb=r.Mb>0,I.$v++):(r.visible=!1,r.update=!1,r.$b=0))}}for(let t=this.Cb;t=I.jv))for(let t=-25;t<=0;t++){const e=I.Xv+t,n=I.Xv-t;let r;if(s>=I.zv&&(e>=I.Zv&&(r=i[s][e],r&&r.visible&&this.Jb(r,!0,o)),n=I.Zv&&(r=i[h][e],r&&r.visible&&this.Jb(r,!0,o)),n=I.jv))for(let t=-25;t<=0;t++){const e=I.Xv+t,n=I.Xv-t;let r;if(s>=I.zv&&(e>=I.Zv&&(r=i[s][e],r&&r.visible&&this.Jb(r,!1,o)),n=I.Zv&&(r=i[h][e],r&&r.visible&&this.Jb(r,!1,o)),n{if(!c&&!f)return!1;for(let t=r;t=this.hE||i>=this.eE)return!1;const s=this.mb[h][t][i];if(s&&s.Mb>=5)return!1}const A=new e(h,s,t,i,c,f,w,r,r+l-1,o,o+a-1,u,d);for(let t=r;tr&&(s|=1),to&&(s+=8),i=0;s--)this.mb[s][t][i]||(this.mb[s][t][i]=new n.A(s,t,i));const e=this.mb[h][t][i];e&&(e.kb[e.Mb]=A,e.Qb[e.Mb]=s,e.tL|=s,e.Mb++)}return y&&(this.Yr[this._b++]=A),!0};Fb=t=>{for(let i=t.SO;i<=t.MO;i++)for(let s=t.kO;s<=t.xO;s++){const h=this.mb[t.level][i][s];if(h){for(let i=0;i{const t=I.md[I.Id],i=I.Lv[I.Id];I.Ed=0;for(let s=0;s=0&&h<=50){e=t.sE+25-I.Xv,e<0&&(e=0),n=t.eE+25-I.Xv,n>50&&(n=50);let i=!1;for(;e<=n;)if(I.Qv&&I.Qv[h][e++]){i=!0;break}if(i){if(r=I.Wv-t.PO,r>32)t.mode=1;else{if(r>=-32)continue;t.mode=2,r=-r}t.YO=(t.UO-I.Vv<<8)/r|0,t.VO=(t.BO-I.Vv<<8)/r|0,t.KO=(t.GO-I.Yv<<8)/r|0,t.XO=(t.AC-I.Yv<<8)/r|0,I.Sv[I.Ed++]=t}}}else if(2===t.type){if(h=t.sE+25-I.Xv,h>=0&&h<=50){e=t.iE+25-I.Kv,e<0&&(e=0),n=t.hE+25-I.Kv,n>50&&(n=50);let i=!1;for(;e<=n;)if(I.Qv&&I.Qv[e++][h]){i=!0;break}if(i){if(r=I.Vv-t.UO,r>32)t.mode=3;else{if(r>=-32)continue;t.mode=4,r=-r}t.HO=(t.PO-I.Wv<<8)/r|0,t.WO=(t.FO-I.Wv<<8)/r|0,t.KO=(t.GO-I.Yv<<8)/r|0,t.XO=(t.AC-I.Yv<<8)/r|0,I.Sv[I.Ed++]=t}}}else if(4===t.type&&(h=t.GO-I.Yv,h>128&&(e=t.sE+25-I.Xv,e<0&&(e=0),n=t.eE+25-I.Xv,n>50&&(n=50),e<=n))){let i=t.iE+25-I.Kv;i<0&&(i=0),r=t.hE+25-I.Kv,r>50&&(r=50);let s=!1;t:for(let t=i;t<=r;t++)for(let i=e;i<=n;i++)if(I.Qv&&I.Qv[t][i]){s=!0;break t}s&&(t.mode=5,t.HO=(t.PO-I.Wv<<8)/h|0,t.WO=(t.FO-I.Wv<<8)/h|0,t.YO=(t.UO-I.Vv<<8)/h|0,t.VO=(t.BO-I.Vv<<8)/h|0,I.Sv[I.Ed++]=t)}}};Jb=(t,i,s)=>{for(I.Mv.LE(t);;){let t;do{if(t=I.Mv.iL(),!t)return}while(!t.update);const h=t.x,e=t.z,n=t.level,r=t.sL,o=this.mb[n];if(t.visible){if(i){if(n>0){const t=this.mb[n-1][h][e];if(t&&t.update)continue}if(h<=I.Kv&&h>I.zv){const i=o[h-1][e];if(i&&i.update&&(i.visible||!(1&t.tL)))continue}if(h>=I.Kv&&hI.Zv){const i=o[h][e-1];if(i&&i.update&&(i.visible||!(8&t.tL)))continue}if(e>=I.Xv&&ee&&(a+=6),c=I.tb[a],t.rL=I.sb[a]),f&&(f.zO&I.ib[a]?16===f.zO?(t.$b=3,t.oL=I.hb[a],t.lL=3-t.oL):32===f.zO?(t.$b=6,t.oL=I.eb[a],t.lL=6-t.oL):64===f.zO?(t.$b=12,t.oL=I.nb[a],t.lL=12-t.oL):(t.$b=9,t.oL=I.rb[a],t.lL=9-t.oL):t.$b=0,f.zO&c&&!this.aL(r,h,e,f.zO)&&f.ZO?.draw(0,I.Uv,I.Bv,I.Gv,I.Hv,f.x-I.Wv,f.y-I.Yv,f.z-I.Vv,f.DO),f.jO&c&&!this.aL(r,h,e,f.jO)&&f.qO?.draw(0,I.Uv,I.Bv,I.Gv,I.Hv,f.x-I.Wv,f.y-I.Yv,f.z-I.Vv,f.DO)),u&&!this.visible(r,h,e,u.model.AC))if(u.type&c)u.model.draw(u.angle,I.Uv,I.Bv,I.Gv,I.Hv,u.x-I.Wv,u.y-I.Yv,u.z-I.Vv,u.DO);else if(768&u.type){const t=u.x-I.Wv,i=u.y-I.Yv,s=u.z-I.Vv,h=u.angle;let e,n;if(e=h===p.A.$d||h===p.A.Jd?-t:t,n=h===p.A.Jd||h===p.A.Qd?-s:s,256&u.type&&ne){const e=t+I.ab[h],n=s+I.cb[h];u.model.draw(512*h+1280&2047,I.Uv,I.Bv,I.Gv,I.Hv,e,i,n,u.DO)}}if(l){const i=t.Sb;i&&i.model?.draw(0,I.Uv,I.Bv,I.Gv,I.Hv,i.x-I.Wv,i.y-I.Yv,i.z-I.Vv,i.DO);const s=t.xb;s&&0===s.offset&&(s.QO&&s.QO.draw(0,I.Uv,I.Bv,I.Gv,I.Hv,s.x-I.Wv,s.y-I.Yv,s.z-I.Vv,s.DO),s.JO&&s.JO.draw(0,I.Uv,I.Bv,I.Gv,I.Hv,s.x-I.Wv,s.y-I.Yv,s.z-I.Vv,s.DO),s.$O&&s.$O.draw(0,I.Uv,I.Bv,I.Gv,I.Hv,s.x-I.Wv,s.y-I.Yv,s.z-I.Vv,s.DO))}const d=t.tL;if(0!==d){if(hI.Kv&&1&d){const t=o[h-1][e];t&&t.update&&I.Mv.LE(t)}if(e>I.Xv&&8&d){const t=o[h][e-1];t&&t.update&&I.Mv.LE(t)}}}if(0!==t.$b){let i=!0;for(let s=0;si.SO&&(n+=1),si.kO&&(n+=8),hh&&(h=e);const r=I.Xv-i.kO,l=i.xO-I.Xv;i.NO=l>r?h+l:h+r}for(;;){let t=-50,i=-1;for(let s=0;st&&(t=h.NO,i=s))}if(-1===i)break;const l=I.bv[i];if(l){l.wu=I.wu;let t=l.model;t||(t=l.RO?.draw(s)??null),t&&!this.cL(r,l.SO,l.MO,l.kO,l.xO,t.AC)&&t.draw(l.JI,I.Uv,I.Bv,I.Gv,I.Hv,l.x-I.Wv,l.y-I.Yv,l.z-I.Vv,l.DO);for(let t=l.SO;t<=l.MO;t++)for(let i=l.kO;i<=l.xO;i++){const s=o[t][i];s&&(0!==s.$b?I.Mv.LE(s):t===h&&i===e||!s.update||I.Mv.LE(s))}}}if(t.qb)continue}if(!t.update||0!==t.$b)continue;if(h<=I.Kv&&h>I.zv){const t=o[h-1][e];if(t&&t.update)continue}if(h>=I.Kv&&hI.Zv){const t=o[h][e-1];if(t&&t.update)continue}if(e>=I.Xv&&e=n){const n=t+I.ob[e],r=h+I.lb[e];i.model.draw(512*e+256,I.Uv,I.Bv,I.Gv,I.Hv,n,s,r,i.DO)}if(512&i.type&&r<=n){const n=t+I.ab[e],r=h+I.cb[e];i.model.draw(512*e+1280&2047,I.Uv,I.Bv,I.Gv,I.Hv,n,s,r,i.DO)}}const s=t.Db;s&&(s.jO&t.rL&&!this.aL(r,h,e,s.jO)&&s.qO?.draw(0,I.Uv,I.Bv,I.Gv,I.Hv,s.x-I.Wv,s.y-I.Yv,s.z-I.Vv,s.DO),s.zO&t.rL&&!this.aL(r,h,e,s.zO)&&s.ZO?.draw(0,I.Uv,I.Bv,I.Gv,I.Hv,s.x-I.Wv,s.y-I.Yv,s.z-I.Vv,s.DO))}if(nI.Kv){const t=o[h-1][e];t&&t.update&&I.Mv.LE(t)}if(e>I.Xv){const t=o[h][e-1];t&&t.update&&I.Mv.LE(t)}}};eL=(t,i,s,e,n,r,o,l)=>{let a,c,f,u,d=a=(s<<7)-I.Wv,y=c=(e<<7)-I.Vv,A=f=d+128,p=u=y+128,m=this.pb[i][s][e]-I.Yv,E=this.pb[i][s+1][e]-I.Yv,g=this.pb[i][s+1][e+1]-I.Yv,_=this.pb[i][s][e+1]-I.Yv,C=y*o+d*l>>16;if(y=y*l-d*o>>16,d=C,C=m*r-y*n>>16,y=m*n+y*r>>16,m=C,y<50)return;if(C=c*o+A*l>>16,c=c*l-A*o>>16,A=C,C=E*r-c*n>>16,c=E*n+c*r>>16,E=C,c<50)return;if(C=p*o+f*l>>16,p=p*l-f*o>>16,f=C,C=g*r-p*n>>16,p=g*n+p*r>>16,g=C,p<50)return;if(C=u*o+a*l>>16,u=u*l-a*o>>16,a=C,C=_*r-u*n>>16,u=_*n+u*r>>16,_=C,u<50)return;const T=h.A.Sa+((d<<9)/y|0),O=h.A.Ma+((m<<9)/y|0),v=h.A.Sa+((A<<9)/c|0),b=h.A.Ma+((E<<9)/c|0),L=h.A.Sa+((f<<9)/p|0),R=h.A.Ma+((g<<9)/p|0),S=h.A.Sa+((a<<9)/u|0),M=h.A.Ma+((_<<9)/u|0);if(h.A.alpha=0,(L-S)*(b-M)-(R-M)*(v-S)>0)if(h.A.fL=L<0||S<0||v<0||L>w.A.uL||S>w.A.uL||v>w.A.uL,I.Jv&&this.dL(I.ea,I.na,R,M,b,L,S,v)&&(I.Nf=s,I.Pf=e),-1===t.ev)12345678!==t.sv&&h.A.wL(L,S,v,R,M,b,t.sv,t.hv,t.iv);else if(I.vt){const i=I.wb[t.ev];h.A.wL(L,S,v,R,M,b,this.yL(i,t.sv),this.yL(i,t.hv),this.yL(i,t.iv))}else t.flat?h.A.pL(L,S,v,R,M,b,t.sv,t.hv,t.iv,d,m,y,A,a,E,_,c,u,t.ev):h.A.pL(L,S,v,R,M,b,t.sv,t.hv,t.iv,f,g,p,a,A,_,E,u,c,t.ev);if(!((T-v)*(M-b)-(O-b)*(S-v)<=0))if(h.A.fL=T<0||v<0||S<0||T>w.A.uL||v>w.A.uL||S>w.A.uL,I.Jv&&this.dL(I.ea,I.na,O,b,M,T,v,S)&&(I.Nf=s,I.Pf=e),-1!==t.ev){if(!I.vt)return void h.A.pL(T,v,S,O,b,M,t.tv,t.iv,t.hv,d,m,y,A,a,E,_,c,u,t.ev);const i=I.wb[t.ev];h.A.wL(T,v,S,O,b,M,this.yL(i,t.tv),this.yL(i,t.iv),this.yL(i,t.hv))}else 12345678!==t.tv&&h.A.wL(T,v,S,O,b,M,t.tv,t.iv,t.hv)};nL=(t,i,s,e,n,r,o)=>{let l=s.oC.length;for(let t=0;t>16;if(a=a*o-i*r>>16,i=c,c=l*n-a*e>>16,a=l*e+a*n>>16,l=c,a<50)return;s._v&&(y.ov[t]=i,y.lv[t]=l,y.av[t]=a),y.nv[t]=h.A.Sa+((i<<9)/a|0),y.rv[t]=h.A.Ma+((l<<9)/a|0)}h.A.alpha=0,l=s.Iv.length;for(let e=0;e0)if(h.A.fL=l<0||a<0||c<0||l>w.A.uL||a>w.A.uL||c>w.A.uL,I.Jv&&this.dL(I.ea,I.na,f,u,d,l,a,c)&&(I.Nf=t,I.Pf=i),s._v&&-1!==s._v[e])if(I.vt){const t=I.wb[s._v[e]];h.A.wL(l,a,c,f,u,d,this.yL(t,s.Av[e]),this.yL(t,s.pv[e]),this.yL(t,s.mv[e]))}else s.flat?h.A.pL(l,a,c,f,u,d,s.Av[e],s.pv[e],s.mv[e],y.ov[0],y.lv[0],y.av[0],y.ov[1],y.ov[3],y.lv[1],y.lv[3],y.av[1],y.av[3],s._v[e]):h.A.pL(l,a,c,f,u,d,s.Av[e],s.pv[e],s.mv[e],y.ov[n],y.lv[n],y.av[n],y.ov[r],y.ov[o],y.lv[r],y.lv[o],y.av[r],y.av[o],s._v[e]);else 12345678!==s.Av[e]&&h.A.wL(l,a,c,f,u,d,s.Av[e],s.pv[e],s.mv[e])}};hL=(t,i,s)=>{const h=this.Ib[t][i][s];if(h===-I.wu)return!1;if(h===I.wu)return!0;{const h=i<<7,e=s<<7;return this.mL(h+1,this.pb[t][i][s],e+1)&&this.mL(h+128-1,this.pb[t][i+1][s],e+1)&&this.mL(h+128-1,this.pb[t][i+1][s+1],e+128-1)&&this.mL(h+1,this.pb[t][i][s+1],e+128-1)?(this.Ib[t][i][s]=I.wu,!0):(this.Ib[t][i][s]=-I.wu,!1)}};aL=(t,i,s,h)=>{if(!this.hL(t,i,s))return!1;const e=i<<7,n=s<<7,r=this.pb[t][i][s]-1,o=r-120,l=r-230,a=r-238;if(h<16){if(1===h){if(e>I.Wv){if(!this.mL(e,r,n))return!1;if(!this.mL(e,r,n+128))return!1}if(t>0){if(!this.mL(e,o,n))return!1;if(!this.mL(e,o,n+128))return!1}return!!this.mL(e,l,n)&&this.mL(e,l,n+128)}if(2===h){if(n0){if(!this.mL(e,o,n+128))return!1;if(!this.mL(e+128,o,n+128))return!1}return!!this.mL(e,l,n+128)&&this.mL(e+128,l,n+128)}if(4===h){if(e0){if(!this.mL(e+128,o,n))return!1;if(!this.mL(e+128,o,n+128))return!1}return!!this.mL(e+128,l,n)&&this.mL(e+128,l,n+128)}if(8===h){if(n>I.Vv){if(!this.mL(e,r,n))return!1;if(!this.mL(e+128,r,n))return!1}if(t>0){if(!this.mL(e,o,n))return!1;if(!this.mL(e+128,o,n))return!1}return!!this.mL(e,l,n)&&this.mL(e+128,l,n)}}return!!this.mL(e+64,a,n+64)&&(16===h?this.mL(e,l,n+128):32===h?this.mL(e+128,l,n+128):64===h?this.mL(e+128,l,n):128===h?this.mL(e,l,n):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,i,s,h)=>{if(this.hL(t,i,s)){const e=i<<7,n=s<<7;return this.mL(e+1,this.pb[t][i][s]-h,n+1)&&this.mL(e+128-1,this.pb[t][i+1][s]-h,n+1)&&this.mL(e+128-1,this.pb[t][i+1][s+1]-h,n+128-1)&&this.mL(e+1,this.pb[t][i][s+1]-h,n+128-1)}return!1};cL=(t,i,s,h,e,n)=>{let r,o;if(i!==s||h!==e){for(r=i;r<=s;r++)for(o=h;o<=e;o++)if(this.Ib[t][r][o]===-I.wu)return!1;o=1+(i<<7);const l=2+(h<<7),a=this.pb[t][i][h]-n;if(!this.mL(o,a,l))return!1;const c=(s<<7)-1;if(!this.mL(c,a,l))return!1;const f=(e<<7)-1;return!!this.mL(o,a,f)&&this.mL(c,a,f)}return!!this.hL(t,i,h)&&(r=i<<7,o=h<<7,this.mL(r+1,this.pb[t][i][h]-n,o+1)&&this.mL(r+128-1,this.pb[t][i+1][h]-n,o+1)&&this.mL(r+128-1,this.pb[t][i+1][h+1]-n,o+128-1)&&this.mL(r+1,this.pb[t][i][h+1]-n,o+128-1))};mL=(t,i,s)=>{for(let h=0;h0){const t=e.UO+(e.YO*h>>8),n=e.BO+(e.VO*h>>8),r=e.GO+(e.KO*h>>8),o=e.AC+(e.XO*h>>8);if(s>=t&&s<=n&&i>=r&&i<=o)return!0}}else if(2===e.mode){const h=t-e.PO;if(h>0){const t=e.UO+(e.YO*h>>8),n=e.BO+(e.VO*h>>8),r=e.GO+(e.KO*h>>8),o=e.AC+(e.XO*h>>8);if(s>=t&&s<=n&&i>=r&&i<=o)return!0}}else if(3===e.mode){const h=e.UO-s;if(h>0){const s=e.PO+(e.HO*h>>8),n=e.FO+(e.WO*h>>8),r=e.GO+(e.KO*h>>8),o=e.AC+(e.XO*h>>8);if(t>=s&&t<=n&&i>=r&&i<=o)return!0}}else if(4===e.mode){const h=s-e.UO;if(h>0){const s=e.PO+(e.HO*h>>8),n=e.FO+(e.WO*h>>8),r=e.GO+(e.KO*h>>8),o=e.AC+(e.XO*h>>8);if(t>=s&&t<=n&&i>=r&&i<=o)return!0}}else if(5===e.mode){const h=i-e.GO;if(h>0){const i=e.PO+(e.HO*h>>8),n=e.FO+(e.WO*h>>8),r=e.UO+(e.YO*h>>8),o=e.BO+(e.VO*h>>8);if(t>=i&&t<=n&&s>=r&&s<=o)return!0}}}return!1};dL=(t,i,s,h,e,n,r,o)=>{if(is&&i>h&&i>e)return!1;if(tn&&t>r&&t>o)return!1;const l=(i-h)*(o-r)-(t-r)*(e-h);return((i-s)*(r-n)-(t-n)*(h-s))*l>0&&l*((i-e)*(n-o)-(t-o)*(s-e))>0};yL=(t,i)=>((i=(127-i)*(127&t)/160|0)<2?i=2:i>126&&(i=126),(65408&t)+i)}},7121:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{}},4197:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{ym;cE;dm;wm;index;aE;Fl;Pl;constructor(t,i,s,h,e,n,r){super(),this.ym=i,this.cE=s,this.dm=h,this.wm=e,this.index=t,this.aE=n,r&&-1!==n.Bl&&this.aE.delay?(this.Fl=Math.random()*this.aE.Ul|0,this.Pl=Math.random()*this.aE.delay[this.Fl]|0):(this.Fl=-1,this.Pl=0)}}},8412:(t,i,s)=>{s.d(i,{A:()=>o});var h=s(9418),e=s(8665),n=s(8738),r=s(1312);class o extends h.A{static ju=2;static qu=4;static Ju=8;static Qu=16;static ld=32;static nd=64;static td=128;type=null;draw(t){if(!this.type)return null;if(-1===this.rd||-1===this.EI)return this.IC();const i=this.IC();if(!i)return null;const s=n.A.Jo[this.rd],h=e.A.p_(s.xa(),!0,!s.K_,!1);h.translate(-this.mI,0,0),h.sc(),s.aE&&s.aE.frames&&h.hc(s.aE.frames[this.EI]),h.uC=null,h.dC=null,128===s.pC&&128===s.mC||h.scale(s.pC,s.mC,s.pC),h.ec(64+s.z_,850+s.j_,-30,-50,-30,!0);const r=[i,h],o=e.A.IL(r,2);return 1===this.type.size&&(o.CC=!0),o}isVisible(){return null!==this.type}IC(){if(!this.type)return null;if(this.Zu>=0&&0===this.yI){const t=r.A.Jo[this.Zu].frames;if(t){const i=t[this.dI];let s=-1;if(this.zI>=0&&this.zI!==this.ic){const t=r.A.Jo[this.zI].frames;t&&(s=t[this._E])}return this.type.IC(i,s,r.A.Jo[this.Zu].OE)}}let t=-1;if(this.zI>=0){const i=r.A.Jo[this.zI].frames;i&&(t=i[this._E])}const i=this.type.IC(t,-1,null);return i?(this.height=i.AC,i):null}}},3606:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{index;count;constructor(t,i){super(),this.index=t,this.count=i}}},9418:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(7121),e=s(1312),n=s(3867);class r extends h.A{x=0;z=0;JI=0;QI=!1;size=1;ic=-1;EE=-1;SI=-1;kI=-1;DI=-1;FI=-1;bE=-1;Mu=null;Pu=100;Du=0;Nu=0;Hu=0;Gu=0;Fu=-1e3;Uu=0;Bu=0;$u=-1;AI=0;pI=0;zI=-1;_E=0;gE=0;Zu=-1;dI=0;wI=0;yI=0;uI=0;rd=-1;EI=0;gI=0;II=0;mI=0;_I=0;TI=0;CI=0;OI=0;Wu=0;Yu=0;vI=0;wu=0;height=0;IE=0;pathLength=0;Uf=new Int32Array(10);Bf=new Int32Array(10);vE=new n.Ns(10,!1);mE=0;Ku=-1;Xu=-1;sd=-1;hd=-1;move(t,i,s){if(-1!==this.Zu&&e.A.Jo[this.Zu].priority<=1&&(this.Zu=-1),!t){const t=i-this.Uf[0],h=s-this.Bf[0];if(t>=-8&&t<=8&&h>=-8&&h<=8){this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.Uf[t]=this.Uf[t-1],this.Bf[t]=this.Bf[t-1],this.vE[t]=this.vE[t-1];return this.Uf[0]=i,this.Bf[0]=s,void(this.vE[0]=!1)}}this.pathLength=0,this.mE=0,this.Uf[0]=i,this.Bf[0]=s,this.x=128*this.Uf[0]+64*this.size,this.z=128*this.Bf[0]+64*this.size}step(t,i){let s=this.Uf[0],h=this.Bf[0];0===i?(s--,h++):1===i?h++:2===i?(s++,h++):3===i?s--:4===i?s++:5===i?(s--,h--):6===i?h--:7===i&&(s++,h--),-1!==this.Zu&&e.A.Jo[this.Zu].priority<=1&&(this.Zu=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.Uf[t]=this.Uf[t-1],this.Bf[t]=this.Bf[t-1],this.vE[t]=this.vE[t-1];this.Uf[0]=s,this.Bf[0]=h,this.vE[0]=t}}},8268:(t,i,s)=>{s.d(i,{A:()=>d});var h=s(9418),e=s(8665),n=s(2031),r=s(8738),o=s(1312),l=s(8317),a=s(1302),c=s(3819),f=s(3867),u=s(9298);class d extends h.A{static zu=1;static ju=2;static qu=4;static Ju=8;static Qu=16;static td=32;static ed=64;static cI=128;static nd=256;static od=512;static tc=[u.A.EL,u.A.gL,u.A._L,u.A.CL,u.A.TL,u.A.OL,u.A.vL,u.A.bL,u.A.LL,u.A.RL,u.A.SL,u.A.ML,u.A.kL,u.A.xL,u.A.DL,u.A.NL];static Qa=[[u.A.PL,u.A.FL,u.A.UL,u.A.BL,u.A.HL,u.A.WL,u.A.YL,u.A.VL,u.A.KL,u.A.XL,u.A.zL,u.A.jL],[u.A.ZL,u.A.qL,u.A.$L,u.A.JL,u.A.QL,u.A.tR,u.A.iR,u.A.sR,u.A.hR,u.A.eR,u.A.nR,u.A.rR,u.A.oR,u.A.lR,u.A.aR,u.A.cR],[u.A.cR-1,u.A.ZL+1,u.A.qL,u.A.$L,u.A.JL,u.A.QL,u.A.tR,u.A.iR,u.A.sR,u.A.hR,u.A.eR,u.A.nR,u.A.rR,u.A.oR,u.A.lR,u.A.aR],[u.A.fR,u.A.uR,u.A.dR,u.A.wR,u.A.yR,u.A.AR],[u.A.pR,u.A.mR,u.A.IR,u.A.ER,u.A.gR,u.A._R,u.A.CR,u.A.TR]];static Qo=new n.A(200);name=null;visible=!1;OR=0;Su=0;vR=new Uint16Array(12);bR=new Uint16Array(5);Ac=0;LR=0n;y=0;ZI=0;qI=0;RE=0;ME=0;SE=0;jI=null;iE=0;sE=0;hE=0;eE=0;vt=!1;draw(t){if(!this.visible)return null;let i=this.IC();if(this.height=i.AC,i.CC=!0,this.vt)return i;if(-1!==this.rd&&-1!==this.EI){const t=r.A.Jo[this.rd],s=e.A.p_(t.xa(),!0,!t.K_,!1);s.translate(-this.mI,0,0),s.sc(),t.aE&&t.aE.frames&&s.hc(t.aE.frames[this.EI]),s.uC=null,s.dC=null,128===t.pC&&128===t.mC||s.scale(t.pC,t.mC,t.pC),s.ec(t.z_+64,t.j_+850,-30,-50,-30,!0);const h=[i,s];i=e.A.IL(h,2)}if(this.jI&&(t>=this.qI&&(this.jI=null),t>=this.ZI&&t=d.Qa[i].length)&&(s=0),this.bR[i]=s}this.ic=t.ct,65535===this.ic&&(this.ic=-1),this.EE=t.ct,65535===this.EE&&(this.EE=-1),this.SI=t.ct,65535===this.SI&&(this.SI=-1),this.kI=t.ct,65535===this.kI&&(this.kI=-1),this.DI=t.ct,65535===this.DI&&(this.DI=-1),this.FI=t.ct,65535===this.FI&&(this.FI=-1),this.bE=t.ct,65535===this.bE&&(this.bE=-1),this.name=c.A.za(c.A.ja(t.af)),this.Ac=t.CA,this.visible=!0,this.LR=0n;for(let t=0;t<12;t++)this.LR<<=0x4n,this.vR[t]>=256&&(this.LR+=BigInt(this.vR[t])-256n);this.vR[0]>=256&&(this.LR+=BigInt(this.vR[0])-256n>>4n),this.vR[1]>=256&&(this.LR+=BigInt(this.vR[1])-256n>>8n);for(let t=0;t<5;t++)this.LR<<=0x3n,this.LR+=BigInt(this.bR[t]);this.LR<<=0x1n,this.LR+=BigInt(this.OR)}kA(){if(!this.visible)return null;const t=new f.Ns(12,null);let i=0;for(let s=0;s<12;s++){const h=this.vR[s];if(h>=256&&h<512&&(t[i++]=l.A.Jo[h-256].kA()),h>=512){const s=a.A.get(h-512).kA(this.OR);s&&(t[i++]=s)}}const s=e.A.$a(t,i);for(let t=0;t<5;t++)0!==this.bR[t]&&(s.Ja(d.Qa[t][0],d.Qa[t][this.bR[t]]),1===t&&s.Ja(d.tc[0],d.tc[this.bR[t]]));return s}IC(){let t=this.LR,i=-1,s=-1,h=-1,n=-1;if(this.Zu>=0&&0===this.yI){const e=o.A.Jo[this.Zu];if(e.frames&&(i=e.frames[this.dI]),this.zI>=0&&this.zI!==this.ic){const t=o.A.Jo[this.zI].frames;t&&(s=t[this._E])}e.JC>=0&&(h=e.JC,t+=BigInt(h-this.vR[5])<<8n),e.QC>=0&&(n=e.QC,t+=BigInt(n-this.vR[3])<<16n)}else if(this.zI>=0){const t=o.A.Jo[this.zI].frames;t&&(i=t[this._E])}let r=d.Qo?.get(t);if(!r){const i=new f.Ns(12,null);let s=0;for(let t=0;t<12;t++){let e=this.vR[t];if(n>=0&&3===t&&(e=n),h>=0&&5===t&&(e=h),e>=256&&e<512){const t=l.A.Jo[e-256].xa();t&&(i[s++]=t)}if(e>=512){const t=a.A.get(e-512).$C(this.OR);t&&(i[s++]=t)}}r=e.A.$a(i,s);for(let t=0;t<5;t++)0!==this.bR[t]&&(r.Ja(d.Qa[t][0],d.Qa[t][this.bR[t]]),1===t&&r.Ja(d.tc[0],d.tc[this.bR[t]]));r.sc(),r.ec(64,850,-30,-50,-30,!0),d.Qo?.put(t,r)}if(this.vt)return r;const c=e.A.EC(r,!0);return-1!==i&&-1!==s?c.gC(i,s,o.A.Jo[this.Zu].OE):-1!==i&&c.hc(i),c._C(),c.uC=null,c.dC=null,c}}},254:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(8738),e=s(7121),n=s(8665);class r extends e.A{RR;level;SR;MR;kR;offsetY;rE;nE;xR;arc;target;mobile=!1;x=0;z=0;y=0;velocityX=0;DR=0;NR=0;velocityY=0;PR=0;JI=0;pitch=0;Fl=0;Pl=0;constructor(t,i,s,e,n,r,o,l,a,c,f){super(),this.RR=h.A.Jo[t],this.level=i,this.SR=s,this.MR=n,this.kR=e,this.rE=r,this.nE=o,this.xR=l,this.arc=a,this.target=c,this.offsetY=f}oE(t,i,s,h){if(!this.mobile){const i=t-this.SR,h=s-this.MR,e=Math.sqrt(i*i+h*h);this.x=this.SR+i*this.arc/e,this.z=this.MR+h*this.arc/e,this.y=this.kR}const e=this.nE+1-h;this.velocityX=(t-this.x)/e,this.DR=(s-this.z)/e,this.NR=Math.sqrt(this.velocityX*this.velocityX+this.DR*this.DR),this.mobile||(this.velocityY=-this.NR*Math.tan(.02454369*this.xR)),this.PR=2*(i-this.y-this.velocityY*e)/(e*e)}update(t){if(this.mobile=!0,this.x+=this.velocityX*t,this.z+=this.DR*t,this.y+=this.velocityY*t+.5*this.PR*t*t,this.velocityY+=this.PR*t,this.JI=325.949*Math.atan2(this.velocityX,this.DR)+1024&2047,this.pitch=325.949*Math.atan2(this.velocityY,this.NR)&2047,this.RR.aE&&this.RR.aE.delay)for(this.Pl+=t;this.Pl>this.RR.aE.delay[this.Fl];)this.Pl-=this.RR.aE.delay[this.Fl]+1,this.Fl++,this.Fl>=this.RR.aE.Ul&&(this.Fl=0)}draw(){const t=this.RR.xa(),i=n.A.p_(t,!0,!this.RR.K_,!1);return this.RR.aE&&this.RR.aE.frames&&(i.sc(),i.hc(this.RR.aE.frames[this.Fl]),i.uC=null,i.dC=null),128===this.RR.pC&&128===this.RR.mC||i.scale(this.RR.pC,this.RR.mC,this.RR.pC),i.FR(this.pitch),i.ec(64+this.RR.z_,850+this.RR.j_,-30,-50,-30,!0),i}}},7628:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(7121),e=s(8738),n=s(8665);class r extends h.A{type;level;x;z;y;rE;lE=!1;Fl=0;Pl=0;constructor(t,i,s,h,n,r,o){super(),this.type=e.A.Jo[t],this.level=i,this.x=s,this.z=h,this.y=n,this.rE=r+o}update(t){if(this.type.aE&&this.type.aE.delay)for(this.Pl+=t;this.Pl>this.type.aE.delay[this.Fl];)this.Pl-=this.type.aE.delay[this.Fl]+1,this.Fl++,this.Fl>=this.type.aE.Ul&&(this.Fl=0,this.lE=!0)}draw(){const t=this.type.xa(),i=n.A.p_(t,!0,!this.type.K_,!1);return!this.lE&&this.type.aE&&this.type.aE.frames&&(i.sc(),i.hc(this.type.aE.frames[this.Fl]),i.uC=null,i.dC=null),128===this.type.pC&&128===this.type.mC||i.scale(this.type.pC,this.type.mC,this.type.pC),0!==this.type.orientation&&(90===this.type.orientation?i.wC():180===this.type.orientation?(i.wC(),i.wC()):270===this.type.orientation&&(i.wC(),i.wC(),i.wC())),i.ec(64+this.type.z_,850+this.type.j_,-30,-50,-30,!0),i}}},5327:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{vp;nw;x;z;Am;angle;shape;nE;constructor(t,i,s,h,e,n,r,o){super(),this.vp=t,this.nw=i,this.x=s,this.z=h,this.Am=e,this.angle=n,this.shape=r,this.nE=o}}},2630:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{vp;nw;x;z;Am;angle;shape;bp;Lp;Rp;constructor(t,i,s,h,e,n,r,o,l,a){super(),this.vp=t,this.nw=i,this.x=s,this.z=h,this.Am=e,this.angle=n,this.shape=r,this.bp=o,this.Lp=l,this.Rp=a}}},3795:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(1982),e=s(3867);class n extends h.A{level;x;z;sL;kb;Qb;bb=null;Rb=null;Db=null;Nb=null;Sb=null;xb=null;Ob=null;Mb=0;tL=0;vb=0;visible=!1;update=!1;qb=!1;$b=0;oL=0;lL=0;rL=0;constructor(t,i,s){super(),this.sL=this.level=t,this.x=i,this.z=s,this.kb=new e.Ns(5,null),this.Qb=new Int32Array(5)}}},5518:(t,i,s)=>{s.d(i,{A:()=>h});class h{static IO=0;static Lb=1;static UR=2;static BR=3;static GR=4;static HR=5;static dv=6;static wv=7;static yv=8;static WR=9;static YR=10;static VR=11}},4474:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{KR;XR;constructor(){super(),this.KR=this,this.XR=this}zR(){this.XR&&this.KR&&(this.XR.KR=this.KR,this.KR.XR=this.XR,this.KR=null,this.XR=null)}}},3819:(t,i,s)=>{s.d(i,{A:()=>h});class h{static jR=['_','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 xd=t=>{t=t.trim();let i=0n;for(let s=0;s=65&&h<=90?i+=BigInt(h+1-65):h>=97&&h<=122?i+=BigInt(h+1-97):h>=48&&h<=57&&(i+=BigInt(h+27-48))}return i};static ja=t=>{if(t<0n||t>=6582952005840035281n)return'invalid_name';if(t%37n===0n)return'invalid_name';let i=0;const s=Array(12);for(;0n!==t;){const h=t;t/=37n,s[11-i++]=this.jR[Number(h-37n*t)]}return s.slice(12-i).join('')};static Wy=t=>{const i=[...t.toLowerCase()];let s=!0;for(let t=0;t='a'&&h<='z'&&(i[t]=h.toUpperCase(),s=!1),'.'!==h&&'!'!==h||(s=!0)}return i.join('')};static nf=t=>{let i='';for(let s=0;s(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static za=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 y_=t=>{const i=t.toUpperCase();let s=0n;for(let t=0;t>56n)&0xffffffffffffffn;return s}}},6666:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e{ZR;cursor=null;constructor(){const t=new h.A;t.next=t,t.Wm=t,this.ZR=t}LE(t){t.Wm&&t.SA(),t.Wm=this.ZR.Wm,t.next=this.ZR,t.Wm&&(t.Wm.next=t),t.next.Wm=t}iA(t){t.Wm&&t.SA(),t.Wm=this.ZR,t.next=this.ZR.next,t.Wm.next=t,t.next&&(t.next.Wm=t)}iL(){const t=this.ZR.next;return t===this.ZR?null:(t?.SA(),t)}head(){const t=this.ZR.next;return t===this.ZR?(this.cursor=null,null):(this.cursor=t?.next||null,t)}Hm(){const t=this.ZR.Wm;return t===this.ZR?(this.cursor=null,null):(this.cursor=t?.Wm||null,t)}next(){const t=this.cursor;return t===this.ZR?(this.cursor=null,null):(this.cursor=t?.next||null,t)}Wm(){const t=this.cursor;return t===this.ZR?(this.cursor=null,null):(this.cursor=t?.Wm||null,t)}clear(){for(;;){const t=this.ZR.next;if(t===this.ZR)return;t?.SA()}}}},1982:(t,i,s)=>{s.d(i,{A:()=>h});class h{key;next;Wm;constructor(){this.key=0n,this.next=this,this.Wm=this}SA(){this.Wm&&this.next&&(this.Wm.next=this.next,this.next.Wm=this.Wm,this.next=null,this.Wm=null)}}},2031:(t,i,s)=>{s.d(i,{A:()=>o});var h=s(4474);class e{head;constructor(){this.head=new h.A}push(t){t.XR&&t.zR(),t.XR=this.head.XR,t.KR=this.head,t.XR&&(t.XR.KR=t),t.KR.XR=t}pop(){const t=this.head.KR;return t===this.head?null:(t?.zR(),t)}}var n=s(1982);class r{qR;$R;constructor(t){this.$R=[],this.qR=t;for(let i=0;i{s.d(i,{A:()=>n});var h=s(1069),e=s(3867);class n{static Jo=[];static Sc=t=>{const i=new h.A(t.read('base_head.dat')),s=new h.A(t.read('base_type.dat')),r=new h.A(t.read('base_label.dat')),o=i.ct;i.ft+=2;for(let t=0;t{s.d(i,{A:()=>n});var h=s(8534),e=s(1069);class n{static Jo=[];static Sc=t=>{const i=new e.A(t.read('frame_head.dat')),s=new e.A(t.read('frame_tran1.dat')),r=new e.A(t.read('frame_tran2.dat')),o=new e.A(t.read('frame_del.dat')),l=i.ct;i.ft+=2;const a=new Int32Array(500),c=new Int32Array(500),f=new Int32Array(500),u=new Int32Array(500);for(let t=0;t0){if(0!==d.types[t])for(let i=t-1;i>y;i--)if(0===d.types[i]){a[A]=i,c[A]=0,f[A]=0,u[A]=0,A++;break}a[A]=t;let s=0;3===d.types[a[A]]&&(s=128),c[A]=1&i?r.iS:s,f[A]=2&i?r.iS:s,u[A]=4&i?r.iS:s,y=t,A++}}e.length=A,e.sS=new Int32Array(A),e.x=new Int32Array(A),e.y=new Int32Array(A),e.z=new Int32Array(A);for(let t=0;t{s.d(i,{hg:()=>h,Il:()=>e,hS:()=>o,eS:()=>r,nS:()=>n});const h=document.getElementById('canvas'),e=h.getContext('2d',{willReadFrequently:!0}),n=document.createElement('canvas'),r=document.createElement('img'),o=n.getContext('2d',{willReadFrequently:!0})},9298:(t,i,s)=>{s.d(i,{A:()=>h});class h{static RED=16711680;static GREEN=65280;static BLUE=255;static fa=16776960;static $c=65535;static Jc=16711935;static Kl=16777215;static ca=0;static rS=16748608;static bd=8388608;static vd=128;static oS=16756736;static lS=16740352;static aS=16723968;static cS=12648192;static fS=8453888;static uS=4259584;static Wc=9179409;static ew=6116423;static vl=2301979;static bl=5063219;static Rl=7759444;static Ml=3353893;static Ld=8388736;static Rd=13350793;static ad=Int32Array.of(h.fa,h.RED,h.GREEN,h.$c,h.Jc,h.Kl);static PL=6798;static FL=107;static UL=10283;static BL=16;static HL=4797;static WL=7744;static YL=5799;static VL=4634;static KL=33697;static XL=22433;static zL=2983;static jL=54193;static ZL=8741;static qL=12;static $L=64030;static JL=43162;static QL=7735;static tR=8404;static iR=1701;static sR=38430;static hR=24094;static eR=10153;static nR=56621;static rR=4783;static oR=1341;static lR=16578;static aR=35003;static cR=25239;static EL=9104;static gL=10275;static _L=7595;static CL=3610;static TL=7975;static OL=8526;static vL=918;static bL=38802;static LL=24466;static RL=10145;static SL=58654;static ML=5027;static kL=1457;static xL=16565;static DL=34991;static NL=25486;static fR=4626;static uR=11146;static dR=6439;static wR=12;static yR=4758;static AR=10270;static TR=4574;static pR=4550;static mR=4537;static IR=5681;static ER=5673;static gR=5790;static _R=6806;static CR=8076}},8950:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(4474);class e extends h.A{static Mc=new Int32Array;static RC=0;static SC=0;static top=0;static bottom=0;static left=0;static right=0;static uL=0;static dS=0;static wS=0;static bind=(t,i,s)=>{this.Mc=t,this.RC=i,this.SC=s,this.Hl(0,0,i,s)};static ud=()=>{this.left=0,this.top=0,this.right=this.RC,this.bottom=this.SC,this.uL=this.right-1,this.dS=this.right/2|0};static Hl=(t,i,s,h)=>{t<0&&(t=0),i<0&&(i=0),s>this.RC&&(s=this.RC),h>this.SC&&(h=this.SC),this.top=i,this.bottom=h,this.left=t,this.right=s,this.uL=this.right-1,this.dS=this.right/2|0,this.wS=this.bottom/2|0};static clear=()=>{const t=this.RC*this.SC;for(let i=0;i{this.Sl(t,i,e,s),this.Sl(t,i+h-1,e,s),this.Ll(t,i,e,h),this.Ll(t+s-1,i,e,h)};static Sl=(t,i,s,h)=>{if(i=this.bottom)return;tthis.right&&(h=this.right-t);const e=t+i*this.RC;for(let t=0;t{if(t=this.right)return;ithis.bottom&&(h=this.bottom-i);const e=t+i*this.RC;for(let t=0;t{const n=Math.abs(s-t),r=Math.abs(h-i),o=t=this.left&&t=this.top&&i-r&&(a-=r,t+=o),s{tthis.right&&(s=this.right-t),i+h>this.bottom&&(h=this.bottom-i);const n=this.RC-s;let r=t+i*this.RC;for(let t=-h;t<0;t++){for(let t=-s;t<0;t++)this.Mc[r++]=e;r+=n}};static yS(t,i,s,h,e,n){tthis.right&&(s=this.right-t),i+h>this.bottom&&(h=this.bottom-i);const r=256-n,o=(e>>16&255)*n,l=(e>>8&255)*n,a=(255&e)*n,c=this.RC-s;let f=t+i*this.RC;for(let t=0;t>16&255)*r>>8<<16)+(l+(this.Mc[f]>>8&255)*r>>8<<8)+(a+(255&this.Mc[f])*r>>8);this.Mc[f++]=t}f+=c}}static AS(t,i,s,h,e){const n=256-e,r=(h>>16&255)*e,o=(h>>8&255)*e,l=(255&h)*e;let a=i-s;a<0&&(a=0);let c=i+s;c>=this.SC&&(c=this.SC-1);for(let h=a;h<=c;h++){const e=h-i,a=0|Math.sqrt(s*s-e*e);let c=t-a;c<0&&(c=0);let f=t+a;f>=this.RC&&(f=this.RC-1);let u=c+h*this.RC;for(let t=c;t<=f;t++){const t=(r+(this.Mc[u]>>16&255)*n>>8<<16)+(o+(this.Mc[u]>>8&255)*n>>8<<8)+(l+(255&this.Mc[u])*n>>8);this.Mc[u++]=t}}}static pS=(t,i,s)=>{t=this.right||i=this.bottom||(this.Mc[t+i*this.RC]=s)}}},4583:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(8950),e=s(1673),n=s(3867);class r extends h.A{static vt=!1;static mS=new Int32Array(512);static IS=new Int32Array(2048);static sin=new Int32Array(2048);static cos=new Int32Array(2048);static palette=new Int32Array(65536);static xE=new n.Ns(50,null);static ES=0;static xc=new Int32Array;static Sa=0;static Ma=0;static MC=!0;static fL=!1;static alpha=0;static gS=null;static _S=new n.Ns(50,null);static CS=0;static wu=0;static kE=new Int32Array(50);static TS=new n.Ns(50,null);static OS=!1;static vS=new n.Ns(50,!1);static bS=new Int32Array(50);static{for(let t=1;t<512;t++)this.mS[t]=32768/t|0;for(let t=1;t<2048;t++)this.IS[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 Zo=()=>{this.mS=null,this.mS=null,this.sin=null,this.cos=null,this.xc=null,this.xE=null,this.vS=null,this.bS=null,this.gS=null,this._S=null,this.kE=null,this.palette=null,this.TS=null,console.log('Draw3D unloaded!')};static eg=()=>{this.xc=new Int32Array(h.A.SC);for(let t=0;t{this.xc=new Int32Array(i);for(let s=0;s{this.gS=null,this._S.fill(null)};static bc=t=>{this.ES=0;for(let i=0;i<50;i++)try{this.xE[i]=e.A.Ic(t,i.toString()),this.vt&&128===this.xE[i]?.oa?this.xE[i]?.LS():this.xE[i]?.PC(),this.ES++}catch(t){}};static gO=t=>{if(0!==this.bS[t])return this.bS[t];const i=this.TS[t];if(!i)return 0;let s=0,h=0,e=0;const n=i.length;for(let t=0;t>16&255,h+=i[t]>>8&255,e+=255&i[t];let r=(s/n<<16)+(h/n<<8)+(e/n|0);return r=this.RS(r,1.4),0===r&&(r=1),this.bS[t]=r,r};static Lc=t=>{const i=t+.03*Math.random()-.015;let s=0;for(let t=0;t<512;t++){const h=(t/8|0)/64+.0078125,e=(7&t)/8+.0625;for(let t=0;t<128;t++){const n=t/128;let r=n,o=n,l=n;if(0!==e){let t;t=n<.5?n*(e+1):n+e-n*e;const i=2*n-t;let s=h+.3333333333333333;s>1&&s--;let a=h-.3333333333333333;a<0&&a++,r=6*s<1?i+6*(t-i)*s:2*s<1?t:3*s<2?i+(t-i)*(.6666666666666666-s)*6:i,o=6*h<1?i+6*(t-i)*h:2*h<1?t:3*h<2?i+(t-i)*(.6666666666666666-h)*6:i,l=6*a<1?i+6*(t-i)*a:2*a<1?t:3*a<2?i+(t-i)*(.6666666666666666-a)*6:i}const a=((256*r|0)<<16)+((256*o|0)<<8)+(256*l|0);this.palette[s++]=this.RS(a,i)}}for(let t=0;t<50;t++){const s=this.xE[t];if(!s)continue;const h=s.palette;this.TS[t]=new Int32Array(h.length);for(let s=0;s{const s=(t>>16)/256,h=(t>>8&255)/256,e=(255&t)/256;return((256*Math.pow(s,i)|0)<<16)+((256*Math.pow(h,i)|0)<<8)+(256*Math.pow(e,i)|0)};static Rc=t=>{this.gS||(this.CS=t,this.vt?this.gS=new n.wr(t,16384):this.gS=new n.wr(t,65536),this._S.fill(null))};static wL=(t,i,s,e,n,o,l,a,c)=>{let f=0,u=0;n!==e&&(f=(i-t<<16)/(n-e)|0,u=(a-l<<15)/(n-e)|0);let d=0,w=0;o!==n&&(d=(s-i<<16)/(o-n)|0,w=(c-a<<15)/(o-n)|0);let y=0,A=0;if(o!==e&&(y=(t-s<<16)/(e-o)|0,A=(l-c<<15)/(e-o)|0),e<=n&&e<=o){if(eh.A.bottom&&(n=h.A.bottom),o>h.A.bottom&&(o=h.A.bottom),nd)for(o-=n,n-=e,e=r.xc[e];;){if(--n<0)for(;;){if(--o<0)return;this.SS(s>>16,i>>16,c>>7,a>>7,h.A.Mc,e,0),s+=y,i+=d,c+=A,a+=w,e+=h.A.RC}this.SS(s>>16,t>>16,c>>7,l>>7,h.A.Mc,e,0),s+=y,t+=f,c+=A,l+=u,e+=h.A.RC}else for(o-=n,n-=e,e=r.xc[e];;){if(--n<0)for(;;){if(--o<0)return;this.SS(i>>16,s>>16,a>>7,c>>7,h.A.Mc,e,0),s+=y,i+=d,c+=A,a+=w,e+=h.A.RC}this.SS(t>>16,s>>16,l>>7,c>>7,h.A.Mc,e,0),s+=y,t+=f,c+=A,l+=u,e+=h.A.RC}else if(i=t<<=16,a=l<<=15,e<0&&(i-=y*e,t-=f*e,a-=A*e,l-=u*e,e=0),s<<=16,c<<=15,o<0&&(s-=d*o,c-=w*o,o=0),e!==o&&yf)for(n-=o,o-=e,e=r.xc[e];;){if(--o<0)for(;;){if(--n<0)return;this.SS(s>>16,t>>16,c>>7,l>>7,h.A.Mc,e,0),s+=d,t+=f,c+=w,l+=u,e+=h.A.RC}this.SS(i>>16,t>>16,a>>7,l>>7,h.A.Mc,e,0),i+=y,t+=f,a+=A,l+=u,e+=h.A.RC}else for(n-=o,o-=e,e=r.xc[e];;){if(--o<0)for(;;){if(--n<0)return;this.SS(t>>16,s>>16,l>>7,c>>7,h.A.Mc,e,0),s+=d,t+=f,c+=w,l+=u,e+=h.A.RC}this.SS(t>>16,i>>16,l>>7,a>>7,h.A.Mc,e,0),i+=y,t+=f,a+=A,l+=u,e+=h.A.RC}}else if(n<=o){if(nh.A.bottom&&(o=h.A.bottom),e>h.A.bottom&&(e=h.A.bottom),oy)for(e-=o,o-=n,n=r.xc[n];;){if(--o<0)for(;;){if(--e<0)return;this.SS(t>>16,s>>16,l>>7,c>>7,h.A.Mc,n,0),t+=f,s+=y,l+=u,c+=A,n+=h.A.RC}this.SS(t>>16,i>>16,l>>7,a>>7,h.A.Mc,n,0),t+=f,i+=d,l+=u,a+=w,n+=h.A.RC}else for(e-=o,o-=n,n=r.xc[n];;){if(--o<0)for(;;){if(--e<0)return;this.SS(s>>16,t>>16,c>>7,l>>7,h.A.Mc,n,0),t+=f,s+=y,l+=u,c+=A,n+=h.A.RC}this.SS(i>>16,t>>16,a>>7,l>>7,h.A.Mc,n,0),t+=f,i+=d,l+=u,a+=w,n+=h.A.RC}else if(s=i<<=16,c=a<<=15,n<0&&(s-=f*n,i-=d*n,c-=u*n,a-=w*n,n=0),t<<=16,l<<=15,e<0&&(t-=y*e,l-=A*e,e=0),o-=e,e-=n,n=r.xc[n],f>16,i>>16,l>>7,a>>7,h.A.Mc,n,0),t+=y,i+=d,l+=A,a+=w,n+=h.A.RC}this.SS(s>>16,i>>16,c>>7,a>>7,h.A.Mc,n,0),s+=f,i+=d,c+=u,a+=w,n+=h.A.RC}else for(;;){if(--e<0)for(;;){if(--o<0)return;this.SS(i>>16,t>>16,a>>7,l>>7,h.A.Mc,n,0),t+=y,i+=d,l+=A,a+=w,n+=h.A.RC}this.SS(i>>16,s>>16,a>>7,c>>7,h.A.Mc,n,0),s+=f,i+=d,c+=u,a+=w,n+=h.A.RC}}else if(oh.A.bottom&&(e=h.A.bottom),n>h.A.bottom&&(n=h.A.bottom),e>16,t>>16,a>>7,l>>7,h.A.Mc,o,0),i+=d,t+=f,a+=w,l+=u,o+=h.A.RC}this.SS(i>>16,s>>16,a>>7,c>>7,h.A.Mc,o,0),i+=d,s+=y,a+=w,c+=A,o+=h.A.RC}else for(;;){if(--e<0)for(;;){if(--n<0)return;this.SS(t>>16,i>>16,l>>7,a>>7,h.A.Mc,o,0),i+=d,t+=f,a+=w,l+=u,o+=h.A.RC}this.SS(s>>16,i>>16,c>>7,a>>7,h.A.Mc,o,0),i+=d,s+=y,a+=w,c+=A,o+=h.A.RC}else if(t=s<<=16,l=c<<=15,o<0&&(t-=d*o,s-=y*o,l-=w*o,c-=A*o,o=0),i<<=16,a<<=15,n<0&&(i-=f*n,a-=u*n,n=0),e-=n,n-=o,o=r.xc[o],d>16,s>>16,a>>7,c>>7,h.A.Mc,o,0),i+=f,s+=y,a+=u,c+=A,o+=h.A.RC}this.SS(t>>16,s>>16,l>>7,c>>7,h.A.Mc,o,0),t+=d,s+=y,l+=w,c+=A,o+=h.A.RC}else for(;;){if(--n<0)for(;;){if(--e<0)return;this.SS(s>>16,i>>16,c>>7,a>>7,h.A.Mc,o,0),i+=f,s+=y,a+=u,c+=A,o+=h.A.RC}this.SS(s>>16,t>>16,c>>7,l>>7,h.A.Mc,o,0),t+=d,s+=y,l+=w,c+=A,o+=h.A.RC}};static SS=(t,i,s,e,n,o,l)=>{let a;if(r.MC){let c;if(r.fL){if(c=i-t>3?(e-s)/(i-t)|0:0,i>h.A.uL&&(i=h.A.uL),t<0&&(s-=t*c,t=0),t>=i)return;o+=t,l=i-t>>2,c<<=2}else{if(!(t>2)>0?(e-s)*r.mS[l]>>15:0}if(0===r.alpha)for(;;){if(--l<0){if((l=i-t&3)>0){a=r.palette[s>>8];do{n[o++]=a,l--}while(l>0);return}break}a=r.palette[s>>8],s+=c,n[o++]=a,n[o++]=a,n[o++]=a,n[o++]=a}else{const h=r.alpha,e=256-r.alpha;for(;;){if(--l<0){if((l=i-t&3)>0){a=r.palette[s>>8],a=((16711935&a)*e>>8&16711935)+((65280&a)*e>>8&65280);do{n[o++]=a+((16711935&n[o])*h>>8&16711935)+((65280&n[o])*h>>8&65280),l--}while(l>0)}break}a=r.palette[s>>8],s+=c,a=((16711935&a)*e>>8&16711935)+((65280&a)*e>>8&65280),n[o++]=a+((16711935&n[o])*h>>8&16711935)+((65280&n[o])*h>>8&65280),n[o++]=a+((16711935&n[o])*h>>8&16711935)+((65280&n[o])*h>>8&65280),n[o++]=a+((16711935&n[o])*h>>8&16711935)+((65280&n[o])*h>>8&65280),n[o++]=a+((16711935&n[o])*h>>8&16711935)+((65280&n[o])*h>>8&65280)}}}else if(th.A.uL&&(i=h.A.uL),t<0&&(s-=t*c,t=0),t>=i))return;if(o+=t,l=i-t,0===r.alpha)do{n[o++]=r.palette[s>>8],s+=c,l--}while(l>0);else{const t=r.alpha,i=256-r.alpha;do{a=r.palette[s>>8],s+=c,a=((16711935&a)*i>>8&16711935)+((65280&a)*i>>8&65280),n[o++]=a+((16711935&n[o])*t>>8&16711935)+((65280&n[o])*t>>8&65280),l--}while(l>0)}}};static MS=(t,i,s,e,n,r,o)=>{let l=0;n!==e&&(l=(i-t<<16)/(n-e)|0);let a=0;r!==n&&(a=(s-i<<16)/(r-n)|0);let c=0;if(r!==e&&(c=(t-s<<16)/(e-r)|0),e<=n&&e<=r){if(eh.A.bottom&&(n=h.A.bottom),r>h.A.bottom&&(r=h.A.bottom),na)for(r-=n,n-=e,e=this.xc[e];;){if(--n<0)for(;;){if(--r<0)return;this.kS(s>>16,i>>16,h.A.Mc,e,o),s+=c,i+=a,e+=h.A.RC}this.kS(s>>16,t>>16,h.A.Mc,e,o),s+=c,t+=l,e+=h.A.RC}else for(r-=n,n-=e,e=this.xc[e];;){if(--n<0)for(;;){if(--r<0)return;this.kS(i>>16,s>>16,h.A.Mc,e,o),s+=c,i+=a,e+=h.A.RC}this.kS(t>>16,s>>16,h.A.Mc,e,o),s+=c,t+=l,e+=h.A.RC}else if(i=t<<=16,e<0&&(i-=c*e,t-=l*e,e=0),s<<=16,r<0&&(s-=a*r,r=0),e!==r&&cl)for(n-=r,r-=e,e=this.xc[e];;){if(--r<0)for(;;){if(--n<0)return;this.kS(s>>16,t>>16,h.A.Mc,e,o),s+=a,t+=l,e+=h.A.RC}this.kS(i>>16,t>>16,h.A.Mc,e,o),i+=c,t+=l,e+=h.A.RC}else for(n-=r,r-=e,e=this.xc[e];;){if(--r<0)for(;;){if(--n<0)return;this.kS(t>>16,s>>16,h.A.Mc,e,o),s+=a,t+=l,e+=h.A.RC}this.kS(t>>16,i>>16,h.A.Mc,e,o),i+=c,t+=l,e+=h.A.RC}}else if(n<=r){if(nh.A.bottom&&(r=h.A.bottom),e>h.A.bottom&&(e=h.A.bottom),rc)for(e-=r,r-=n,n=this.xc[n];;){if(--r<0)for(;;){if(--e<0)return;this.kS(t>>16,s>>16,h.A.Mc,n,o),t+=l,s+=c,n+=h.A.RC}this.kS(t>>16,i>>16,h.A.Mc,n,o),t+=l,i+=a,n+=h.A.RC}else for(e-=r,r-=n,n=this.xc[n];;){if(--r<0)for(;;){if(--e<0)return;this.kS(s>>16,t>>16,h.A.Mc,n,o),t+=l,s+=c,n+=h.A.RC}this.kS(i>>16,t>>16,h.A.Mc,n,o),t+=l,i+=a,n+=h.A.RC}else if(s=i<<=16,n<0&&(s-=l*n,i-=a*n,n=0),t<<=16,e<0&&(t-=c*e,e=0),l>16,i>>16,h.A.Mc,n,o),t+=c,i+=a,n+=h.A.RC}this.kS(s>>16,i>>16,h.A.Mc,n,o),s+=l,i+=a,n+=h.A.RC}else for(r-=e,e-=n,n=this.xc[n];;){if(--e<0)for(;;){if(--r<0)return;this.kS(i>>16,t>>16,h.A.Mc,n,o),t+=c,i+=a,n+=h.A.RC}this.kS(i>>16,s>>16,h.A.Mc,n,o),s+=l,i+=a,n+=h.A.RC}}else if(rh.A.bottom&&(e=h.A.bottom),n>h.A.bottom&&(n=h.A.bottom),e>16,t>>16,h.A.Mc,r,o),i+=a,t+=l,r+=h.A.RC}this.kS(i>>16,s>>16,h.A.Mc,r,o),i+=a,s+=c,r+=h.A.RC}else for(n-=e,e-=r,r=this.xc[r];;){if(--e<0)for(;;){if(--n<0)return;this.kS(t>>16,i>>16,h.A.Mc,r,o),i+=a,t+=l,r+=h.A.RC}this.kS(s>>16,i>>16,h.A.Mc,r,o),i+=a,s+=c,r+=h.A.RC}else if(t=s<<=16,r<0&&(t-=a*r,s-=c*r,r=0),i<<=16,n<0&&(i-=l*n,n=0),a>16,s>>16,h.A.Mc,r,o),i+=l,s+=c,r+=h.A.RC}this.kS(t>>16,s>>16,h.A.Mc,r,o),t+=a,s+=c,r+=h.A.RC}else for(e-=n,n-=r,r=this.xc[r];;){if(--n<0)for(;;){if(--e<0)return;this.kS(s>>16,i>>16,h.A.Mc,r,o),i+=l,s+=c,r+=h.A.RC}this.kS(s>>16,t>>16,h.A.Mc,r,o),t+=a,s+=c,r+=h.A.RC}};static pL=(t,i,s,e,n,r,o,l,a,c,f,u,d,w,y,A,p,m,I)=>{const E=this.xS(I);this.OS=!this.vS[I];const g=c-d,_=f-y,C=u-p,T=w-c,O=A-f,v=m-u;let b=T*f-O*c<<14;const L=O*u-v*f<<8,R=v*c-T*u<<5;let S=g*f-_*c<<14;const M=_*u-C*f<<8,k=C*c-g*u<<5;let x=_*T-g*O<<14;const D=C*O-_*v<<8,N=g*v-C*T<<5;let P=0,F=0;n!==e&&(P=(i-t<<16)/(n-e)|0,F=(l-o<<16)/(n-e)|0);let U=0,B=0;r!==n&&(U=(s-i<<16)/(r-n)|0,B=(a-l<<16)/(r-n)|0);let G=0,H=0;if(r!==e&&(G=(t-s<<16)/(e-r)|0,H=(o-a<<16)/(e-r)|0),e<=n&&e<=r){if(eh.A.bottom&&(n=h.A.bottom),r>h.A.bottom&&(r=h.A.bottom),nU)for(r-=n,n-=e,e=this.xc[e];;){if(--n<0)for(;;){if(--r<0)return;this.DS(s>>16,i>>16,h.A.Mc,e,E,0,0,b,S,x,L,M,D,a>>8,l>>8),s+=G,i+=U,a+=H,l+=B,e+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this.DS(s>>16,t>>16,h.A.Mc,e,E,0,0,b,S,x,L,M,D,a>>8,o>>8),s+=G,t+=P,a+=H,o+=F,e+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}else for(r-=n,n-=e,e=this.xc[e];;){if(--n<0)for(;;){if(--r<0)return;this.DS(i>>16,s>>16,h.A.Mc,e,E,0,0,b,S,x,L,M,D,l>>8,a>>8),s+=G,i+=U,a+=H,l+=B,e+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this.DS(t>>16,s>>16,h.A.Mc,e,E,0,0,b,S,x,L,M,D,o>>8,a>>8),s+=G,t+=P,a+=H,o+=F,e+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}}else{i=t<<=16,l=o<<=16,e<0&&(i-=G*e,t-=P*e,l-=H*e,o-=F*e,e=0),s<<=16,a<<=16,r<0&&(s-=U*r,a-=B*r,r=0);const c=e-this.Ma;if(b+=R*c,S+=k*c,x+=N*c,b|=0,S|=0,x|=0,(e===r||G>=P)&&(e!==r||U<=P))for(n-=r,r-=e,e=this.xc[e];;){if(--r<0)for(;;){if(--n<0)return;this.DS(t>>16,s>>16,h.A.Mc,e,E,0,0,b,S,x,L,M,D,o>>8,a>>8),s+=U,t+=P,a+=B,o+=F,e+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this.DS(t>>16,i>>16,h.A.Mc,e,E,0,0,b,S,x,L,M,D,o>>8,l>>8),i+=G,t+=P,l+=H,o+=F,e+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}else for(n-=r,r-=e,e=this.xc[e];;){if(--r<0)for(;;){if(--n<0)return;this.DS(s>>16,t>>16,h.A.Mc,e,E,0,0,b,S,x,L,M,D,a>>8,o>>8),s+=U,t+=P,a+=B,o+=F,e+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this.DS(i>>16,t>>16,h.A.Mc,e,E,0,0,b,S,x,L,M,D,l>>8,o>>8),i+=G,t+=P,l+=H,o+=F,e+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}}}else if(n<=r){if(nh.A.bottom&&(r=h.A.bottom),e>h.A.bottom&&(e=h.A.bottom),rG)for(e-=r,r-=n,n=this.xc[n];;){if(--r<0)for(;;){if(--e<0)return;this.DS(t>>16,s>>16,h.A.Mc,n,E,0,0,b,S,x,L,M,D,o>>8,a>>8),t+=P,s+=G,o+=F,a+=H,n+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this.DS(t>>16,i>>16,h.A.Mc,n,E,0,0,b,S,x,L,M,D,o>>8,l>>8),t+=P,i+=U,o+=F,l+=B,n+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}else for(e-=r,r-=n,n=this.xc[n];;){if(--r<0)for(;;){if(--e<0)return;this.DS(s>>16,t>>16,h.A.Mc,n,E,0,0,b,S,x,L,M,D,a>>8,o>>8),t+=P,s+=G,o+=F,a+=H,n+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this.DS(i>>16,t>>16,h.A.Mc,n,E,0,0,b,S,x,L,M,D,l>>8,o>>8),t+=P,i+=U,o+=F,l+=B,n+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}}else{s=i<<=16,a=l<<=16,n<0&&(s-=P*n,i-=U*n,a-=F*n,l-=B*n,n=0),t<<=16,o<<=16,e<0&&(t-=G*e,o-=H*e,e=0);const c=n-this.Ma;if(b+=R*c,S+=k*c,x+=N*c,b|=0,S|=0,x|=0,r-=e,e-=n,n=this.xc[n],P>16,i>>16,h.A.Mc,n,E,0,0,b,S,x,L,M,D,o>>8,l>>8),t+=G,i+=U,o+=H,l+=B,n+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this.DS(s>>16,i>>16,h.A.Mc,n,E,0,0,b,S,x,L,M,D,a>>8,l>>8),s+=P,i+=U,a+=F,l+=B,n+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}else for(;;){if(--e<0)for(;;){if(--r<0)return;this.DS(i>>16,t>>16,h.A.Mc,n,E,0,0,b,S,x,L,M,D,l>>8,o>>8),t+=G,i+=U,o+=H,l+=B,n+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this.DS(i>>16,s>>16,h.A.Mc,n,E,0,0,b,S,x,L,M,D,l>>8,a>>8),s+=P,i+=U,a+=F,l+=B,n+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}}}else if(rh.A.bottom&&(e=h.A.bottom),n>h.A.bottom&&(n=h.A.bottom),e>16,t>>16,h.A.Mc,r,E,0,0,b,S,x,L,M,D,l>>8,o>>8),i+=U,t+=P,l+=B,o+=F,r+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this.DS(i>>16,s>>16,h.A.Mc,r,E,0,0,b,S,x,L,M,D,l>>8,a>>8),i+=U,s+=G,l+=B,a+=H,r+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}else for(;;){if(--e<0)for(;;){if(--n<0)return;this.DS(t>>16,i>>16,h.A.Mc,r,E,0,0,b,S,x,L,M,D,o>>8,l>>8),i+=U,t+=P,l+=B,o+=F,r+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this.DS(s>>16,i>>16,h.A.Mc,r,E,0,0,b,S,x,L,M,D,a>>8,l>>8),i+=U,s+=G,l+=B,a+=H,r+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}}else{t=s<<=16,o=a<<=16,r<0&&(t-=U*r,s-=G*r,o-=B*r,a-=H*r,r=0),i<<=16,l<<=16,n<0&&(i-=P*n,l-=F*n,n=0);const c=r-this.Ma;if(b+=R*c,S+=k*c,x+=N*c,b|=0,S|=0,x|=0,e-=n,n-=r,r=this.xc[r],U>16,s>>16,h.A.Mc,r,E,0,0,b,S,x,L,M,D,l>>8,a>>8),i+=P,s+=G,l+=F,a+=H,r+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this.DS(t>>16,s>>16,h.A.Mc,r,E,0,0,b,S,x,L,M,D,o>>8,a>>8),t+=U,s+=G,o+=B,a+=H,r+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}else for(;;){if(--n<0)for(;;){if(--e<0)return;this.DS(s>>16,i>>16,h.A.Mc,r,E,0,0,b,S,x,L,M,D,a>>8,l>>8),i+=P,s+=G,l+=F,a+=H,r+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this.DS(s>>16,t>>16,h.A.Mc,r,E,0,0,b,S,x,L,M,D,a>>8,o>>8),t+=U,s+=G,o+=B,a+=H,r+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}}};static DS=(t,i,s,e,n,r,o,l,a,c,f,u,d,w,y)=>{if(t>=i)return;let A,p,m,I,E,g,_,C,T;if(this.fL){if(A=(y-w)/(i-t)|0,i>h.A.uL&&(i=h.A.uL),t<0&&(w-=t*A,t=0),t>=i)return;p=i-t>>3,A<<=12}else i-t>7?(p=i-t>>3,A=(y-w)*this.mS[p]>>6):(p=0,A=0);if(w<<=9,e+=t,this.vt&&n)if(m=0,I=0,g=t-this.Sa,l+=(f>>3)*g,a+=(u>>3)*g,c+=(d>>3)*g,l|=0,a|=0,E=(c|=0)>>12,0!==E&&(o=a/E|0,(r=l/E|0)<0?r=0:r>4032&&(r=4032)),l+=f,a+=u,c+=d,l|=0,a|=0,E=(c|=0)>>12,0!==E&&(m=l/E|0,I=a/E|0,m<7?m=7:m>4032&&(m=4032)),_=m-r>>3,C=I-o>>3,r+=w>>3&786432,T=w>>23,this.OS){for(;p-- >0;)s[e++]=n[(4032&o)+(r>>6)]>>>T,r+=_,o+=C,s[e++]=n[(4032&o)+(r>>6)]>>>T,r+=_,o+=C,s[e++]=n[(4032&o)+(r>>6)]>>>T,r+=_,o+=C,s[e++]=n[(4032&o)+(r>>6)]>>>T,r+=_,o+=C,s[e++]=n[(4032&o)+(r>>6)]>>>T,r+=_,o+=C,s[e++]=n[(4032&o)+(r>>6)]>>>T,r+=_,o+=C,s[e++]=n[(4032&o)+(r>>6)]>>>T,r+=_,o+=C,s[e++]=n[(4032&o)+(r>>6)]>>>T,r=m,o=I,l+=f,a+=u,E=(c+=d)>>12,0!==E&&(m=l/E|0,I=a/E|0,m<7?m=7:m>4032&&(m=4032)),_=m-r>>3,C=I-o>>3,r+=(w+=A)>>3&786432,T=w>>23;for(p=i-t&7;p-- >0;)s[e++]=n[(4032&o)+(r>>6)]>>>T,r+=_,o+=C}else{for(;p-- >0;){let t;0!=(t=n[(4032&o)+(r>>6)]>>>T)&&(s[e]=t),e+=1,0!=(t=n[(4032&(o+=C))+((r+=_)>>6)]>>>T)&&(s[e]=t),e++,0!=(t=n[(4032&(o+=C))+((r+=_)>>6)]>>>T)&&(s[e]=t),e++,0!=(t=n[(4032&(o+=C))+((r+=_)>>6)]>>>T)&&(s[e]=t),e++,0!=(t=n[(4032&(o+=C))+((r+=_)>>6)]>>>T)&&(s[e]=t),e++,0!=(t=n[(4032&(o+=C))+((r+=_)>>6)]>>>T)&&(s[e]=t),e++,0!=(t=n[(4032&(o+=C))+((r+=_)>>6)]>>>T)&&(s[e]=t),e++,0!=(t=n[(4032&(o+=C))+((r+=_)>>6)]>>>T)&&(s[e]=t),e+=1,r=m,o=I,l+=f,a+=u,c+=d,l|=0,a|=0,E=(c|=0)>>12,0!==E&&(m=l/E|0,I=a/E|0,m<7?m=7:m>4032&&(m=4032)),_=m-r>>3,C=I-o>>3,r+=(w+=A)>>3&786432,T=w>>23}for(p=i-t&7;p-- >0;){let t;0!=(t=n[(4032&o)+(r>>6)]>>>T)&&(s[e]=t),e++,r+=_,o+=C}}else if(m=0,I=0,g=t-this.Sa,l+=(f>>3)*g,a+=(u>>3)*g,c+=(d>>3)*g,l|=0,a|=0,E=(c|=0)>>14,0!==E&&(o=a/E|0,(r=l/E|0)<0?r=0:r>16256&&(r=16256)),l+=f,a+=u,c+=d,l|=0,a|=0,E=(c|=0)>>14,0!==E&&(m=l/E|0,I=a/E|0,m<7?m=7:m>16256&&(m=16256)),_=m-r>>3,C=I-o>>3,r+=6291456&w,T=w>>23,this.OS&&n){for(;p-- >0;)s[e++]=n[(16256&o)+(r>>7)]>>>T,r+=_,o+=C,s[e++]=n[(16256&o)+(r>>7)]>>>T,r+=_,o+=C,s[e++]=n[(16256&o)+(r>>7)]>>>T,r+=_,o+=C,s[e++]=n[(16256&o)+(r>>7)]>>>T,r+=_,o+=C,s[e++]=n[(16256&o)+(r>>7)]>>>T,r+=_,o+=C,s[e++]=n[(16256&o)+(r>>7)]>>>T,r+=_,o+=C,s[e++]=n[(16256&o)+(r>>7)]>>>T,r+=_,o+=C,s[e++]=n[(16256&o)+(r>>7)]>>>T,r=m,o=I,l+=f,a+=u,c+=d,l|=0,a|=0,E=(c|=0)>>14,0!==E&&(m=l/E|0,I=a/E|0,m<7?m=7:m>16256&&(m=16256)),_=m-r>>3,C=I-o>>3,r+=6291456&(w+=A),T=w>>23;for(p=i-t&7;p-- >0;)s[e++]=n[(16256&o)+(r>>7)]>>>T,r+=_,o+=C}else{for(;p-- >0&&n;){let t;0!=(t=n[(16256&o)+(r>>7)]>>>T)&&(s[e]=t),e+=1,0!=(t=n[(16256&(o+=C))+((r+=_)>>7)]>>>T)&&(s[e]=t),e++,0!=(t=n[(16256&(o+=C))+((r+=_)>>7)]>>>T)&&(s[e]=t),e++,0!=(t=n[(16256&(o+=C))+((r+=_)>>7)]>>>T)&&(s[e]=t),e++,0!=(t=n[(16256&(o+=C))+((r+=_)>>7)]>>>T)&&(s[e]=t),e++,0!=(t=n[(16256&(o+=C))+((r+=_)>>7)]>>>T)&&(s[e]=t),e++,0!=(t=n[(16256&(o+=C))+((r+=_)>>7)]>>>T)&&(s[e]=t),e++,0!=(t=n[(16256&(o+=C))+((r+=_)>>7)]>>>T)&&(s[e]=t),e++,r=m,o=I,l+=f,a+=u,c+=d,l|=0,a|=0,E=(c|=0)>>14,0!==E&&(m=l/E|0,I=a/E|0,m<7?m=7:m>16256&&(m=16256)),_=m-r>>3,C=I-o>>3,r+=6291456&(w+=A),T=w>>23}for(p=i-t&7;p-- >0&&n;){let t;0!=(t=n[(16256&o)+(r>>7)]>>>T)&&(s[e]=t),e++,r+=_,o+=C}}};static kS=(t,i,s,e,n)=>{if(this.fL&&(i>h.A.uL&&(i=h.A.uL),t<0&&(t=0)),t>=i)return;e+=t;let r=i-t>>2;if(0===this.alpha)for(;;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;s[e++]=n}s[e++]=n,s[e++]=n,s[e++]=n,s[e++]=n}const o=this.alpha,l=256-this.alpha;for(n=((16711935&n)*l>>8&16711935)+((65280&n)*l>>8&65280);;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;s[e++]=n+((16711935&s[e])*o>>8&16711935)+((65280&s[e])*o>>8&65280)}s[e++]=n+((16711935&s[e])*o>>8&16711935)+((65280&s[e])*o>>8&65280),s[e++]=n+((16711935&s[e])*o>>8&16711935)+((65280&s[e])*o>>8&65280),s[e++]=n+((16711935&s[e])*o>>8&16711935)+((65280&s[e])*o>>8&65280),s[e++]=n+((16711935&s[e])*o>>8&16711935)+((65280&s[e])*o>>8&65280)}};static DE=t=>{this._S[t]&&this.gS&&(this.gS[this.CS++]=this._S[t],this._S[t]=null)};static xS=t=>{if(this.kE[t]=this.wu++,this._S[t])return this._S[t];let i;if(this.CS>0&&this.gS)i=this.gS[--this.CS],this.gS[this.CS]=null;else{let t=0,s=-1;for(let i=0;i>>3)&16316671,i[e+8192]=n-(n>>>2)&16316671,i[e+12288]=n-(n>>>2)-(n>>>3)&16316671}}else{if(64===s.width)for(let t=0;t<128;t++)for(let e=0;e<128;e++)i[e+(t<<7)]=h[s.Mc[(e>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)i[t]=h[s.Mc[t]];this.vS[t]=!1;for(let s=0;s<16384;s++){i[s]&=16316671;const h=i[s];0===h&&(this.vS[t]=!0),i[s+16384]=h-(h>>>3)&16316671,i[s+32768]=h-(h>>>2)&16316671,i[s+49152]=h-(h>>>2)-(h>>>3)&16316671}}return i}}},8665:(t,i,s)=>{s.d(i,{A:()=>f});var h=s(1069),e=s(8950),n=s(4583),r=s(6730),o=s(4474),l=s(3867);class a{rC=0;Kb=0;NS=0;PS=-1;US=-1;BS=-1;GS=-1;HS=-1;WS=-1;YS=-1;VS=-1;KS=-1;XS=0;zS=-1;jS=-1;ZS=-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 qS=null;static $S=null;static JS=null;static QS=null;static tM=null;static iM=null;static sM=null;static hM=null;static eM=null;static nM=null;static rM=null;static oM=null;static axis=null;static lM=new l.Ns(4096,!1);static aM=new l.Ns(4096,!1);static cM=new Int32Array(4096);static fM=new Int32Array(4096);static uM=new Int32Array(4096);static dM=new Int32Array(4096);static wM=new Int32Array(4096);static yM=new Int32Array(4096);static AM=new Int32Array(1500);static pM=new l.wr(1500,512);static mM=new Int32Array(12);static IM=new l.wr(12,2e3);static EM=new Int32Array(2e3);static gM=new Int32Array(2e3);static _M=new Int32Array(12);static CM=new Int32Array(10);static TM=new Int32Array(10);static OM=new Int32Array(10);static Hn=0;static vM=0;static Wn=0;static yu=!1;static ea=0;static na=0;static Au=0;static Fm=new Int32Array(1e3);static bM=!1;static Sc(t){try{f.head=new h.A(t.read('ob_head.dat')),f.qS=new h.A(t.read('ob_face1.dat')),f.$S=new h.A(t.read('ob_face2.dat')),f.JS=new h.A(t.read('ob_face3.dat')),f.QS=new h.A(t.read('ob_face4.dat')),f.tM=new h.A(t.read('ob_face5.dat')),f.iM=new h.A(t.read('ob_point1.dat')),f.sM=new h.A(t.read('ob_point2.dat')),f.hM=new h.A(t.read('ob_point3.dat')),f.eM=new h.A(t.read('ob_point4.dat')),f.nM=new h.A(t.read('ob_point5.dat')),f.rM=new h.A(t.read('ob_vertex1.dat')),f.oM=new h.A(t.read('ob_vertex2.dat')),f.axis=new h.A(t.read('ob_axis.dat')),f.head.ft=0,f.iM.ft=0,f.sM.ft=0,f.hM.ft=0,f.eM.ft=0,f.rM.ft=0,f.oM.ft=0;const i=f.head.ct;f.metadata=new l.Ns(i+100,null);let s=0,e=0,n=0,r=0,o=0,c=0,u=0;for(let t=0;t>7)<2?i=2:i>126&&(i=126),(65408&t)+i):(i<0?i=0:i>127&&(i=127),127-i)}static nC=(t,i,s)=>{const h=t.rC,e=t.Kb,n=t.NS;let r,o,a,u,d;if(i){r=new Int32Array(h);for(let i=0;i{const e=t.rC,n=t.Kb,r=t.NS;let o,l,a,c,u;if(h)o=t.oC,l=t.aC,a=t.lC;else{o=new Int32Array(e),l=new Int32Array(e),a=new Int32Array(e);for(let i=0;i{const s=t.rC,h=t.Kb,e=t.NS,n=new Int32Array(s),r=new Int32Array(s),o=new Int32Array(s);for(let i=0;i{let s=!1,h=!1,e=!1,n=!1,r=0,o=0,l=0,a=-1;for(let c=0;c{let s=!1,h=!1,e=!1,n=!1,r=0,o=0,l=0,a=-1;for(let c=0;c{let o=-1;const l=t.oC[i],a=t.aC[i],c=t.lC[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.qS&&f.$S&&f.JS&&f.QS&&f.tM&&f.iM&&f.sM&&f.hM&&f.eM&&f.nM&&f.rM&&f.oM&&f.axis))throw new Error('cant loading model!!!!!');const s=i.rC,h=i.Kb,e=i.NS,n=new Int32Array(s),r=new Int32Array(s),o=new Int32Array(s),l=new Int32Array(h),a=new Int32Array(h),c=new Int32Array(h),u=new Int32Array(e),d=new Int32Array(e),w=new Int32Array(e);let y=null;i.HS>=0&&(y=new Int32Array(s));let A=null;i.KS>=0&&(A=new Int32Array(h));let p=null,m=0;i.XS>=0?p=new Int32Array(h):m=-i.XS-1;let I=null;i.zS>=0&&(I=new Int32Array(h));let E=null;i.jS>=0&&(E=new Int32Array(h));const g=new Int32Array(h);f.iM.ft=i.PS,f.sM.ft=i.US,f.hM.ft=i.BS,f.eM.ft=i.GS,f.nM.ft=i.HS;let _,C,T,O=0,v=0,b=0;for(let t=0;t{if(!f.metadata||!f.metadata[i])throw new Error('No model metadata');const s=f.metadata[i];if(s.data=t,!s.data.length)throw new Error('No model data');const e=s.rC,n=s.Kb,r=s.NS,o=new Int32Array(e),l=new Int32Array(e),a=new Int32Array(e),c=new Int32Array(n),u=new Int32Array(n),d=new Int32Array(n),w=new Int32Array(r),y=new Int32Array(r),A=new Int32Array(r);let p=null;s.HS>=0&&(p=new Int32Array(e));let m=null;s.KS>=0&&(m=new Int32Array(n));let I=null,E=0;s.XS>=0?I=new Int32Array(n):E=-s.XS-1;let g=null;s.zS>=0&&(g=new Int32Array(n));let _=null;s.jS>=0&&(_=new Int32Array(n));const C=new Int32Array(n),T=new h.A(s.data);T.ft=s.PS;const O=new h.A(s.data);O.ft=s.US;const v=new h.A(s.data);v.ft=s.BS;const b=new h.A(s.data);b.ft=s.GS;const L=new h.A(s.data);L.ft=s.HS;let R,S,M,k=0,x=0,D=0;for(let t=0;tthis.AC&&(this.AC=-s),s>this.GO&&(this.GO=s);const e=i*i+h*h;e>this.bO&&(this.bO=e)}this.bO=Math.sqrt(this.bO)+.99|0,this.BM=Math.sqrt(this.bO*this.bO+this.AC*this.AC)+.99|0,this.UM=this.BM+(Math.sqrt(this.bO*this.bO+this.GO*this.GO)+.99|0)}cC(){this.AC=0,this.GO=0;for(let t=0;tthis.AC&&(this.AC=-i),i>this.GO&&(this.GO=i)}this.BM=Math.sqrt(this.bO*this.bO+this.AC*this.AC)+.99|0,this.UM=this.BM+(Math.sqrt(this.bO*this.bO+this.GO*this.GO)+.99|0)}sc(){if(this.GM){const t=new Int32Array(256);let i=0;for(let s=0;si&&(i=h)}this.dC=new l.Ns(i+1,null);for(let s=0;s<=i;s++)this.dC[s]=new Int32Array(t[s]),t[s]=0;let s=0;for(;si&&(i=h)}this.uC=new l.Ns(i+1,null);for(let s=0;s<=i;s++)this.uC[s]=new Int32Array(t[s]),t[s]=0;let s=0;for(;sl;)l=s[o++];n&&n.types&&h.x&&h.y&&h.z&&n.labels&&(i!==l||0===n.types[i])&&this.KM(h.x[t],h.y[t],h.z[t],n.labels[i],n.types[i])}f.Hn=0,f.vM=0,f.Wn=0,o=0,l=s[o++];for(let t=0;tl;)l=s[o++];n&&n.types&&e.x&&e.y&&e.z&&n.labels&&(i===l||0===n.types[i])&&this.KM(e.x[t],e.y[t],e.z[t],n.labels[i],n.types[i])}}else this.hc(t)}hc(t){if(!this.dC||-1===t||!r.A.Jo[t])return;const i=r.A.Jo[t],s=i.tS;f.Hn=0,f.vM=0,f.Wn=0;for(let t=0;t>16;this.lC[t]=this.aC[t]*i+this.lC[t]*s>>16,this.aC[t]=h}}translate(t,i,s){for(let h=0;h>8;if(this.SM&&this.MM&&this.kM||(this.SM=new Int32Array(this.Kb),this.MM=new Int32Array(this.Kb),this.kM=new Int32Array(this.Kb)),!this.Ub){this.Ub=new l.Ns(this.rC,null);for(let t=0;t8192||p>8192||m>8192||A<-8192||p<-8192||m<-8192;)A>>=1,p>>=1,m>>=1;let I=0|Math.sqrt(A*A+p*p+m*m);if(I<=0&&(I=1),A=256*A/I|0,p=256*p/I|0,m=256*m/I|0,this.Vb&&1&this.Vb[i]){const n=t+((s*A+h*p+e*m)/(r+(r/2|0))|0);this.A_&&(this.SM[i]=f.RM(this.A_[i],n,this.Vb[i]))}else{let t=this.Ub[n];t&&(t.x+=A,t.y+=p,t.z+=m,t.w++),t=this.Ub[o],t&&(t.x+=A,t.y+=p,t.z+=m,t.w++),t=this.Ub[l],t&&(t.x+=A,t.y+=p,t.z+=m,t.w++)}}if(n)this.Hb(t,r,s,h,e);else{this.Yb=new l.Ns(this.rC,null);for(let t=0;t>16;for(let h=0;h>16,E=E*w-I*d>>16,I=m),0!==t&&(m=E*a-g*l>>16,g=E*l+g*a>>16,E=m),0!==i&&(m=g*c+I*u>>16,g=g*u-I*c>>16,I=m),I+=e,E+=r,g+=o,m=E*A-g*y>>16,g=E*y+g*A>>16,E=m,f.cM&&f.fM&&f.uM&&(f.uM[h]=g-p,f.cM[h]=n.A.Sa+((I<<9)/g|0),f.fM[h]=n.A.Ma+((E<<9)/g|0)),this.NS>0&&f.dM&&f.wM&&f.yM&&(f.dM[h]=I,f.wM[h]=E,f.yM[h]=g)}try{this.zM(!1,!1,0)}catch(t){}}draw(t,i,s,h,r,o,l,a,c){const u=a*r-o*h>>16,d=l*i+u*s>>16,w=this.bO*s>>16,y=d+w;if(y<=50||d>=3500)return;const A=a*h+o*r>>16;let p=A-this.bO<<9;if((p/y|0)>=e.A.dS)return;let m=A+this.bO<<9;if((m/y|0)<=-e.A.dS)return;const I=l*s-u*i>>16,E=this.bO*i>>16;let g=I+E<<9;if((g/y|0)<=-e.A.wS)return;let _=I-(E+(this.AC*s>>16))<<9;if((_/y|0)>=e.A.wS)return;let C=d-(w+(this.AC*i>>16))<=50,T=!1;if(c>0&&f.yu){let t=d-w;t<=50&&(t=50),A>0?(p=p/y|0,m=m/t|0):(m=m/y|0,p=p/t|0),I>0?(_=_/y|0,g=g/t|0):(g=g/y|0,_=_/t|0);const i=f.ea-n.A.Sa,s=f.na-n.A.Ma;i>p&&i_&&s>16,w=w*L-c*b>>16,c=n),c+=o,u+=l,w+=a,n=w*h+c*r>>16,w=w*r-c*h>>16,c=n,n=u*s-w*i>>16,w=u*i+w*s>>16,u=n,f.uM&&(f.uM[e]=w-d),w>=50&&f.cM&&f.fM?(f.cM[e]=O+((c<<9)/w|0),f.fM[e]=v+((u<<9)/w|0)):f.cM&&(f.cM[e]=-5e3,C=!0),(C||this.NS>0)&&f.dM&&f.wM&&f.yM&&(f.dM[e]=c,f.wM[e]=u,f.yM[e]=w)}try{this.zM(C,T,c)}catch(t){}}zM(t,i,s,h=!1){f.bM&&(this.YM=-1,this.VM=-1);for(let t=0;te.A.uL||a>e.A.uL||c>e.A.uL),f.pM&&f.AM){const t=((y+A+p)/3|0)+this.BM;f.pM[t][f.AM[t]++]=h,f.bM&&this.jM(f.ea,f.na,u,d,w,l,a,c)&&this.VM=0;t--){const i=f.AM[t];if(!(i<=0)&&f.pM){const s=f.pM[t];for(let t=0;t=0;t--){const i=f.AM[t];if(i>0&&f.pM){const s=f.pM[t];for(let h=0;h0||f.mM[2]>0)&&(n=(f._M[1]+f._M[2])/(f.mM[1]+f.mM[2])|0);let r=0;f.mM&&f._M&&(f.mM[3]>0||f.mM[4]>0)&&(r=(f._M[3]+f._M[4])/(f.mM[3]+f.mM[4])|0);let o=0;if(f.mM&&f._M&&(f.mM[6]>0||f.mM[8]>0)&&(o=(f._M[6]+f._M[8])/(f.mM[6]+f.mM[8])|0),f.mM&&f.IM){let t,i=0,s=f.mM[10],e=f.IM[10],l=f.EM;i===s&&(i=0,s=f.mM[11],e=f.IM[11],l=f.gM),t=in;)try{this.ZM(e[i++],h),i===s&&e!==f.IM[11]&&(i=0,s=f.mM[11],e=f.IM[11],l=f.gM),t=ir;)try{this.ZM(e[i++],h),i===s&&e!==f.IM[11]&&(i=0,s=f.mM[11],e=f.IM[11],l=f.gM),t=io;)try{this.ZM(e[i++],h),i===s&&e!==f.IM[11]&&(i=0,s=f.mM[11],e=f.IM[11],l=f.gM),t=i>2,r=this.NM[i],o=this.PM[i],l=this.FM[i];n.A.pL(f.cM[s],f.cM[h],f.cM[e],f.fM[s],f.fM[h],f.fM[e],this.SM[t],this.MM[t],this.kM[t],f.dM[r],f.wM[r],f.yM[r],f.dM[o],f.dM[l],f.wM[o],f.wM[l],f.yM[o],f.yM[l],this.A_[t])}else if(3===r&&this.Vb&&this.A_&&this.SM&&f.cM&&f.fM&&f.dM&&f.wM&&f.yM){const i=this.Vb[t]>>2,r=this.NM[i],o=this.PM[i],l=this.FM[i];n.A.pL(f.cM[s],f.cM[h],f.cM[e],f.fM[s],f.fM[h],f.fM[e],this.SM[t],this.SM[t],this.SM[t],f.dM[r],f.wM[r],f.yM[r],f.dM[o],f.dM[l],f.wM[o],f.wM[l],f.yM[o],f.yM[l],this.A_[t])}}qM(t,i=!1){let s=0;if(f.yM){const i=n.A.Sa,h=n.A.Ma,e=this.Xb[t],r=this.zb[t],o=this.jb[t],l=f.yM[e],a=f.yM[r],c=f.yM[o];if(l>=50&&f.cM&&f.fM&&this.SM)f.CM[s]=f.cM[e],f.TM[s]=f.fM[e],f.OM[s++]=this.SM[t];else if(f.dM&&f.wM&&this.SM){const u=f.dM[e],d=f.wM[e],w=this.SM[t];if(c>=50&&this.kM){const e=(50-l)*n.A.IS[c-l];f.CM[s]=i+((u+((f.dM[o]-u)*e>>16)<<9)/50|0),f.TM[s]=h+((d+((f.wM[o]-d)*e>>16)<<9)/50|0),f.OM[s++]=w+((this.kM[t]-w)*e>>16)}if(a>=50&&this.MM){const e=(50-l)*n.A.IS[a-l];f.CM[s]=i+((u+((f.dM[r]-u)*e>>16)<<9)/50|0),f.TM[s]=h+((d+((f.wM[r]-d)*e>>16)<<9)/50|0),f.OM[s++]=w+((this.MM[t]-w)*e>>16)}}if(a>=50&&f.cM&&f.fM&&this.MM)f.CM[s]=f.cM[r],f.TM[s]=f.fM[r],f.OM[s++]=this.MM[t];else if(f.dM&&f.wM&&this.MM){const u=f.dM[r],d=f.wM[r],w=this.MM[t];if(l>=50&&this.SM){const r=(50-a)*n.A.IS[l-a];f.CM[s]=i+((u+((f.dM[e]-u)*r>>16)<<9)/50|0),f.TM[s]=h+((d+((f.wM[e]-d)*r>>16)<<9)/50|0),f.OM[s++]=w+((this.SM[t]-w)*r>>16)}if(c>=50&&this.kM){const e=(50-a)*n.A.IS[c-a];f.CM[s]=i+((u+((f.dM[o]-u)*e>>16)<<9)/50|0),f.TM[s]=h+((d+((f.wM[o]-d)*e>>16)<<9)/50|0),f.OM[s++]=w+((this.kM[t]-w)*e>>16)}}if(c>=50&&f.cM&&f.fM&&this.kM)f.CM[s]=f.cM[o],f.TM[s]=f.fM[o],f.OM[s++]=this.kM[t];else if(f.dM&&f.wM&&this.kM){const u=f.dM[o],d=f.wM[o],w=this.kM[t];if(a>=50&&this.MM){const e=(50-c)*n.A.IS[a-c];f.CM[s]=i+((u+((f.dM[r]-u)*e>>16)<<9)/50|0),f.TM[s]=h+((d+((f.wM[r]-d)*e>>16)<<9)/50|0),f.OM[s++]=w+((this.MM[t]-w)*e>>16)}if(l>=50&&this.SM){const r=(50-c)*n.A.IS[l-c];f.CM[s]=i+((u+((f.dM[e]-u)*r>>16)<<9)/50|0),f.TM[s]=h+((d+((f.wM[e]-d)*r>>16)<<9)/50|0),f.OM[s++]=w+((this.SM[t]-w)*r>>16)}}}const h=f.CM[0],r=f.CM[1],o=f.CM[2],l=f.TM[0],a=f.TM[1],c=f.TM[2];if(!((h-r)*(c-a)-(l-a)*(o-r)<=0))if(n.A.fL=!1,3===s){let s;if((h<0||r<0||o<0||h>e.A.uL||r>e.A.uL||o>e.A.uL)&&(n.A.fL=!0),s=this.Vb?3&this.Vb[t]:0,i)n.A.gd(h,r,l,a,f.OM[0]),n.A.gd(r,o,a,c,f.OM[1]),n.A.gd(o,h,c,l,f.OM[2]);else if(0===s)n.A.wL(h,r,o,l,a,c,f.OM[0],f.OM[1],f.OM[2]);else if(1===s&&this.SM)n.A.MS(h,r,o,l,a,c,n.A.palette[this.SM[t]]);else if(2===s&&this.Vb&&this.A_&&f.dM&&f.wM&&f.yM){const i=this.Vb[t]>>2,s=this.NM[i],e=this.PM[i],u=this.FM[i];n.A.pL(h,r,o,l,a,c,f.OM[0],f.OM[1],f.OM[2],f.dM[s],f.wM[s],f.yM[s],f.dM[e],f.dM[u],f.wM[e],f.wM[u],f.yM[e],f.yM[u],this.A_[t])}else if(3===s&&this.Vb&&this.A_&&this.SM&&f.dM&&f.wM&&f.yM){const i=this.Vb[t]>>2,s=this.NM[i],e=this.PM[i],u=this.FM[i];n.A.pL(h,r,o,l,a,c,this.SM[t],this.SM[t],this.SM[t],f.dM[s],f.wM[s],f.yM[s],f.dM[e],f.dM[u],f.wM[e],f.wM[u],f.yM[e],f.yM[u],this.A_[t])}}else if(4===s){let s;if((h<0||r<0||o<0||h>e.A.uL||r>e.A.uL||o>e.A.uL||f.CM[3]<0||f.CM[3]>e.A.uL)&&(n.A.fL=!0),s=this.Vb?3&this.Vb[t]:0,i)n.A.gd(h,r,l,a,f.OM[0]),n.A.gd(r,o,a,c,f.OM[1]),n.A.gd(o,f.CM[3],c,f.TM[3],f.OM[2]),n.A.gd(f.CM[3],h,f.TM[3],l,f.OM[3]);else if(0===s)n.A.wL(h,r,o,l,a,c,f.OM[0],f.OM[1],f.OM[2]),n.A.wL(h,o,f.CM[3],l,c,f.TM[3],f.OM[0],f.OM[2],f.OM[3]);else if(1===s){if(this.SM){const i=n.A.palette[this.SM[t]];n.A.MS(h,r,o,l,a,c,i),n.A.MS(h,o,f.CM[3],l,c,f.TM[3],i)}}else if(2===s&&this.Vb&&this.A_&&f.dM&&f.wM&&f.yM){const i=this.Vb[t]>>2,s=this.NM[i],e=this.PM[i],u=this.FM[i];n.A.pL(h,r,o,l,a,c,f.OM[0],f.OM[1],f.OM[2],f.dM[s],f.wM[s],f.yM[s],f.dM[e],f.dM[u],f.wM[e],f.wM[u],f.yM[e],f.yM[u],this.A_[t]),n.A.pL(h,o,f.CM[3],l,c,f.TM[3],f.OM[0],f.OM[2],f.OM[3],f.dM[s],f.wM[s],f.yM[s],f.dM[e],f.dM[u],f.wM[e],f.wM[u],f.yM[e],f.yM[u],this.A_[t])}else if(3===s&&this.Vb&&this.A_&&this.SM&&f.dM&&f.wM&&f.yM){const i=this.Vb[t]>>2,s=this.NM[i],e=this.PM[i],u=this.FM[i];n.A.pL(h,r,o,l,a,c,this.SM[t],this.SM[t],this.SM[t],f.dM[s],f.wM[s],f.yM[s],f.dM[e],f.dM[u],f.wM[e],f.wM[u],f.yM[e],f.yM[u],this.A_[t]),n.A.pL(h,o,f.CM[3],l,c,f.TM[3],this.SM[t],this.SM[t],this.SM[t],f.dM[s],f.wM[s],f.yM[s],f.dM[e],f.dM[u],f.wM[e],f.wM[u],f.yM[e],f.yM[u],this.A_[t])}}}KM(t,i,s,h,e){if(!h)return;const r=h.length;if(0===e){let e=0;f.Hn=0,f.vM=0,f.Wn=0;for(let t=0;t0?(f.Hn=(f.Hn/e|0)+t,f.vM=(f.vM/e|0)+i,f.Wn=(f.Wn/e|0)+s):(f.Hn=t,f.vM=i,f.Wn=s)}else if(1===e)for(let e=0;e=this.dC.length)continue;const r=this.dC[n];if(r)for(let h=0;h=this.dC.length)continue;const o=this.dC[r];if(o)for(let h=0;h>16;this.aC[e]=this.aC[e]*u-this.oC[e]*c>>16,this.oC[e]=t}if(0!==r){c=n.A.sin[r],u=n.A.cos[r];const t=this.aC[e]*u-this.lC[e]*c>>16;this.lC[e]=this.aC[e]*c+this.lC[e]*u>>16,this.aC[e]=t}if(0!==l){c=n.A.sin[l],u=n.A.cos[l];const t=this.lC[e]*c+this.oC[e]*u>>16;this.lC[e]=this.lC[e]*u-this.oC[e]*c>>16,this.oC[e]=t}this.oC[e]+=f.Hn,this.aC[e]+=f.vM,this.lC[e]+=f.Wn}}else if(3===e)for(let e=0;e=this.dC.length)continue;const r=this.dC[n];if(r)for(let h=0;h=this.uC.length)continue;const e=this.uC[s];if(e)for(let i=0;i255&&(this.DM[s]=255)}}}XM(){this.AC=0,this.bO=0,this.GO=0,this.PO=999999,this.FO=-999999,this.BO=-99999,this.UO=99999;for(let t=0;tthis.FO&&(this.FO=i),hthis.BO&&(this.BO=h),-s>this.AC&&(this.AC=-s),s>this.GO&&(this.GO=s);const e=i*i+h*h;e>this.bO&&(this.bO=e)}this.bO=0|Math.sqrt(this.bO),this.BM=0|Math.sqrt(this.bO*this.bO+this.AC*this.AC),this.UM=this.BM+(0|Math.sqrt(this.bO*this.bO+this.GO*this.GO))}jM(t,i,s,h,e,n,r,o){return!(is&&i>h&&i>e)&&(!(t{s.d(i,{A:()=>o});var h=s(8950),e=s(1069),n=s(4474),r=s(7854);class o extends n.A{Mc;width;height;jc;Zc;oa;Nd;constructor(t,i){super(),this.Mc=new Int32Array(t*i),this.width=this.oa=t,this.height=this.Nd=i,this.jc=this.Zc=0}static Xc=async(t,i)=>{const s=t.read(i+'.dat');if(!s)throw new Error(`${i} jpeg not found!`);const h=await(async t=>{255!==t[0]&&(t[0]=255),URL.revokeObjectURL(r.eS.src),r.eS.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>r.eS.onload=()=>t())),r.hS.clearRect(0,0,r.nS.width,r.nS.height);const i=r.eS.naturalWidth,s=r.eS.naturalHeight;return r.nS.width=i,r.nS.height=s,r.hS.drawImage(r.eS,0,0),r.hS.getImageData(0,0,i,s)})(s),e=new o(h.width,h.height),n=new Uint32Array(h.data.buffer),l=e.Mc;for(let t=0;t>24&255)<<24|(255&i)<<16|(i>>8&255)<<8|i>>16&255}return e};static Ic=(t,i,s=0)=>{const h=new e.A(t.read(i+'.dat')),n=new e.A(t.read('index.dat'));n.ft=h.ct;const r=n.ct,l=n.ct,a=[],c=n.CA-1;for(let t=0;th.length||n.ft>n.length)throw new Error;const f=n.CA,u=n.CA,d=n.ct,w=n.ct,y=new o(d,w);y.jc=f,y.Zc=u,y.oa=r,y.Nd=l;const A=n.CA;if(0===A){const t=y.width*y.height;for(let i=0;ih.A.bottom&&(n-=i+n-h.A.bottom),th.A.right){const i=t+r-h.A.right;r-=i,l+=i,o+=i}r>0&&n>0&&this.JM(r,n,this.Mc,e,l,h.A.Mc,s,o)}ra(t,i,s){i|=0,s|=0;let e=(i+=this.jc)+(s+=this.Zc)*h.A.RC,n=0,r=this.height,o=this.width,l=h.A.RC-o,a=0;if(sh.A.bottom&&(r-=s+r-h.A.bottom),ih.A.right){const t=i+o-h.A.right;o-=t,a+=t,l+=t}o>0&&r>0&&this.QM(o,r,this.Mc,n,a,h.A.Mc,e,l,t)}vc(t,i){t|=0,i|=0;let s=(t+=this.jc)+(i+=this.Zc)*h.A.RC,e=0,n=this.height,r=this.width,o=h.A.RC-r,l=0;if(ih.A.bottom&&(n-=i+n-h.A.bottom),th.A.right){const i=t+r-h.A.right;r-=i,l+=i,o+=i}r>0&&n>0&&this.tk(r,n,this.Mc,e,l,h.A.Mc,s,o)}Tc(){const t=this.Mc,i=this.width,s=this.height;for(let h=0;h>16&255;n+=t,n<1?n=1:n>255&&(n=255);let r=e>>8&255;r+=i,r<1?r=1:r>255&&(r=255);let o=255&e;o+=s,o<1?o=1:o>255&&(o=255),this.Mc[h]=(n<<16)+(r<<8)+o}}}PC(t,i,s,e){t|=0,i|=0,s|=0,e|=0;try{const n=this.width;let r=0,o=0;const l=this.oa,a=this.Nd,c=(l<<16)/s|0,f=(a<<16)/e|0;t+=(this.jc*s+l-1)/l|0,i+=(this.Zc*e+a-1)/a|0,this.jc*s%l!=0&&(r=(l-this.jc*s%l<<16)/s|0),this.Zc*e%a!=0&&(o=(a-this.Zc*e%a<<16)/e|0),s=s*(this.width-(r>>16))/l|0,e=e*(this.height-(o>>16))/a|0;let u=t+i*h.A.RC,d=h.A.RC-s;if(ih.A.bottom&&(e-=i+e-h.A.bottom),th.A.right){const i=t+s-h.A.right;s-=i,d+=i}this.scale(s,e,this.Mc,r,o,h.A.Mc,d,u,n,c,f)}catch(t){console.error('error in sprite clipping routine')}}Sd(t,i,s,e,n,r,o,l,a,c){t|=0,i|=0,s|=0,e|=0;try{const f=-s/2|0,u=-e/2|0,d=65536*Math.sin(a/326.11)|0,w=65536*Math.cos(a/326.11)|0,y=d*c>>8,A=w*c>>8;let p=(o<<16)+u*y+f*A,m=u*A-f*y+(l<<16),I=t+i*h.A.RC;for(let t=0;t>16)+(o>>16)*this.width],e+=A,o-=y;p+=y,m+=A,I+=h.A.RC}}catch(t){}}Dd(t,i,s){t|=0,i|=0;let e=(t+=this.jc)+(i+=this.Zc)*h.A.RC,n=0,r=this.height,o=this.width,l=h.A.RC-o,a=0;if(ih.A.bottom&&(r-=i+r-h.A.bottom),th.A.right){const i=t+o-h.A.right;o-=i,a+=i,l+=i}o>0&&r>0&&this.ik(o,r,this.Mc,a,n,h.A.Mc,e,l,s.Mc)}scale(t,i,s,h,e,n,r,o,l,a,c){try{const f=h;for(let u=-i;u<0;u++){const i=(e>>16)*l;for(let e=-t;e<0;e++){const t=s[(h>>16)+i];0===t?o++:n[o++]=t,h+=a}e+=c,h=f,o+=r}}catch(t){console.error('error in plot_scale')}}tk(t,i,s,h,e,n,r,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++)n[r++]=s[h++],n[r++]=s[h++],n[r++]=s[h++],n[r++]=s[h++];for(let i=t;i<0;i++)n[r++]=s[h++];r+=o,h+=e}}QM(t,i,s,h,e,n,r,o,l){const a=256-l;for(let c=-i;c<0;c++){for(let i=-t;i<0;i++){const t=s[h++];if(0===t)r++;else{const i=n[r];n[r++]=((16711935&t)*l+(16711935&i)*a&4278255360)+((65280&t)*l+(65280&i)*a&16711680)>>8}}r+=o,h+=e}}JM(t,i,s,h,e,n,r,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=s[h++];0===t?r++:n[r++]=t,t=s[h++],0===t?r++:n[r++]=t,t=s[h++],0===t?r++:n[r++]=t,t=s[h++],0===t?r++:n[r++]=t}for(let i=t;i<0;i++){const t=s[h++];0===t?r++:n[r++]=t}r+=o,h+=e}}ik(t,i,s,h,e,n,r,o,l){const a=-(t>>2);t=-(3&t);for(let c=-i;c<0;c++){for(let t=a;t<0;t++){let t=s[e++];0!==t&&0===l[r]?n[r++]=t:r++,t=s[e++],0!==t&&0===l[r]?n[r++]=t:r++,t=s[e++],0!==t&&0===l[r]?n[r++]=t:r++,t=s[e++],0!==t&&0===l[r]?n[r++]=t:r++}for(let i=t;i<0;i++){const t=s[e++];0!==t&&0===l[r]?n[r++]=t:r++}r+=o,e+=h}}}},1673:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(8950),e=s(1069),n=s(4474);class r extends n.A{Mc;width;height;jc;Zc;oa;Nd;palette;constructor(t,i,s){super(),this.Mc=new Int8Array(t*i),this.width=this.oa=t,this.height=this.Nd=i,this.jc=this.Zc=0,this.palette=s}static Ic=(t,i,s=0)=>{const h=new e.A(t.read(i+'.dat')),n=new e.A(t.read('index.dat'));n.ft=h.ct;const o=n.ct,l=n.ct,a=n.CA,c=new Int32Array(a);for(let t=1;th.length||n.ft>n.length)throw new Error;const f=n.CA,u=n.CA,d=n.ct,w=n.ct,y=new r(d,w,c);y.jc=f,y.Zc=u,y.oa=o,y.Nd=l;const A=y.Mc,p=n.CA;if(0===p){const t=y.width*y.height;for(let i=0;ih.A.bottom&&(n-=i+n-h.A.bottom),th.A.right){const i=t+r-h.A.right;r-=i,l+=i,o+=i}r>0&&n>0&&this.sk(r,n,this.Mc,e,l,h.A.Mc,s,o)}Tc(){const t=this.Mc,i=this.width,s=this.height;for(let h=0;h>16&255;e+=t,e<0?e=0:e>255&&(e=255);let n=this.palette[h]>>8&255;n+=i,n<0?n=0:n>255&&(n=255);let r=255&this.palette[h];r+=s,r<0?r=0:r>255&&(r=255),this.palette[h]=(e<<16)+(n<<8)+r}}LS(){this.oa|=0,this.Nd|=0,this.oa/=2,this.Nd/=2,this.oa|=0,this.Nd|=0;const t=new Int8Array(this.oa*this.Nd);let i=0;for(let s=0;s>1)+(s+this.Zc>>1)*this.oa]=this.Mc[i++];this.Mc=t,this.width=this.oa,this.height=this.Nd,this.jc=0,this.Zc=0}PC(){if(this.width===this.oa&&this.height===this.Nd)return;const t=new Int8Array(this.oa*this.Nd);let i=0;for(let s=0;s>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=s[h++];0===t?r++:n[r++]=this.palette[255&t],t=s[h++],0===t?r++:n[r++]=this.palette[255&t],t=s[h++],0===t?r++:n[r++]=this.palette[255&t],t=s[h++],0===t?r++:n[r++]=this.palette[255&t]}for(let i=t;i<0;i++){const t=s[h++];0===t?r++:n[r++]=this.palette[255&t]}r+=o,h+=e}}clip(t,i,s,e){try{const n=this.width;this.height;let r=0,o=0;const l=this.oa,a=this.Nd,c=(l<<16)/s|0,f=(a<<16)/e|0;t=t+(this.jc*s+l-1)/l|0,i=i+(this.Zc*e+a-1)/a|0,this.jc*s%l!=0&&(r=(l-this.jc*s%l<<16)/s|0),this.Zc*e%a!=0&&(o=(a-this.Zc*e%a<<16)/e|0),s=s*(this.width-(r>>16))/l|0,e=e*(this.height-(o>>16))/a|0;let u,d=t+i*h.A.RC,w=h.A.RC-s;ih.A.bottom&&(e-=i+e-h.A.bottom),th.A.right&&(u=t+s-h.A.right,s-=u,w+=u),this.hk(h.A.Mc,this.Mc,this.palette,r,o,d,w,s,e,c,f,n)}catch(t){console.log('error in sprite clipping routine')}}hk(t,i,s,h,e,n,r,o,l,a,c,f){try{const u=h;for(let d=-l;d<0;d++){const l=(e>>16)*f;for(let e=-o;e<0;e++){const e=i[(h>>16)+l];0==e?n++:t[n++]=s[255&e],h+=a}e+=c,h=u,n+=r}}catch(t){console.log('error in plot_scale')}}}},2682:(t,i,s)=>{s.d(i,{A:()=>l});var h=s(8950),e=s(1069),n=s(4474);class r{seed;constructor(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}ek(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}mA(){return this.next(32)}next(t){return this.seed=0x5deece66dn*this.seed+0xbn&(1n<<48n)-1n,Number(this.seed)>>>48-t}}var o=s(9298);class l extends n.A{static ef='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!"£$%^&*()-_=+[{]};:\'@#~,<.>/?\\| ';static nk=[];static{const t=navigator.userAgent.includes('Capacitor');for(let i=0;i<256;i++){let s=l.ef.indexOf(String.fromCharCode(i));t&&s>=63&&s--,-1===s&&(s=74),l.nk[i]=s}}rk=[];lk=new Int32Array(94);ak=new Int32Array(94);ck=new Int32Array(94);fk=new Int32Array(94);uk=new Int32Array(95);dk=new Int32Array(256);random=new r(BigInt(Date.now()));height=0;static Ic=(t,i)=>{const s=new e.A(t.read(i+'.dat')),h=new e.A(t.read('index.dat'));h.ft=s.ct+4;const n=h.CA;n>0&&(h.ft+=3*(n-1));const r=new l;for(let t=0;t<94;t++){r.ck[t]=h.CA,r.fk[t]=h.CA;const i=r.lk[t]=h.ct,e=r.ak[t]=h.ct,n=h.CA,o=i*e;if(r.rk[t]=new Int8Array(o),0===n)for(let h=0;hr.height&&(r.height=e),r.ck[t]=1,r.uk[t]=i+2;{let s=0;for(let h=e/7|0;h=h.A.bottom&&(n-=s+n+1-h.A.bottom),i=h.A.right){const t=i+e+1-h.A.right;e-=t,a+=t,l+=t}e>0&&n>0&&this.pk(e,n,t,c,a,h.A.Mc,o,l,r)}Ak(t,i,s,e,n,r,o){s|=0,e|=0;let l=(t|=0)+(i|=0)*h.A.RC,a=h.A.RC-s,c=0,f=0;if(i=h.A.bottom&&(e-=i+e+1-h.A.bottom),t=h.A.right){const i=t+s+1-h.A.right;s-=i,c+=i,a+=i}s>0&&e>0&&this.mk(s,e,h.A.Mc,l,a,o,f,c,n,r)}pk(t,i,s,h,e,n,r,o,l){const a=-((t|=0)>>2);t=-(3&t);for(let c=-(i|=0);c<0;c++){for(let t=a;t<0;t++)0===s[h++]?r++:n[r++]=l,0===s[h++]?r++:n[r++]=l,0===s[h++]?r++:n[r++]=l,0===s[h++]?r++:n[r++]=l;for(let i=t;i<0;i++)0===s[h++]?r++:n[r++]=l;r+=o,h+=e}}mk(t,i,s,h,e,n,r,o,l,a){t|=0;const c=((16711935&l)*a&4278255360)+((65280&l)*a&16711680)>>8,f=256-a;for(let l=-(i|=0);l<0;l++){for(let i=-t;i<0;i++)if(0===n[r++])h++;else{const t=s[h];s[h++]=(((16711935&t)*f&4278255360)+((65280&t)*f&16711680)>>8)+c}h+=e,r+=o}}yk(t){return'red'===t?o.A.RED:'gre'===t?o.A.GREEN:'blu'===t?o.A.BLUE:'yel'===t?o.A.fa:'cya'===t?o.A.$c:'mag'===t?o.A.Jc:'whi'===t?o.A.Kl:'bla'===t?o.A.ca:'lre'===t?o.A.rS:'dre'===t?o.A.bd:'dbl'===t?o.A.vd:'or1'===t?o.A.oS:'or2'===t?o.A.lS:'or3'===t?o.A.aS:'gr1'===t?o.A.cS:'gr2'===t?o.A.fS:'gr3'===t?o.A.uS:o.A.ca}split(t,i){if(0===t.length)return[t];const s=[];for(;t.length>0;){if(this.xu(t)<=i&&-1===t.indexOf('|')){s.push(t);break}let h=t.length;for(let s=0;si)break;h=s}else if('|'===t[s]){h=s;break}s.push(t.substring(0,h)),t=t.substring(h+1)}return s}}},1183:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(8950),e=s(7854);class n{Ik;width;height;Ek;gk;Mc;constructor(t,i,s=e.Il){this.Ek=s,this.Ik=this.Ek.getImageData(0,0,t,i),this.gk=new Uint32Array(this.Ik.data.buffer),this.Mc=new Int32Array(t*i),this.width=t,this.height=i,this.bind()}clear(){this.Mc.fill(0)}bind(){h.A.bind(this.Mc,this.width,this.height)}draw(t,i){this.#t(),this.Ek.putImageData(this.Ik,t,i)}#t(){const t=this.Mc.length,i=this.Mc,s=this.gk;for(let h=0;h>16&255|(t>>8&255)<<8|(255&t)<<16|4278190080}}}},3955:(t,i,s)=>{s.d(i,{A:()=>h});class h{static RA=150;static qf=108;static jf=70;static Ef=81;static bf=189;static iy=7;static Iw=88;static yw=30;static Cw=176;static fw=220;static ey=66;static Zw=17;static xw=2;static Jw=238;static By=233;static cu=146;static Df=215;static Zf=236;static pE=85;static HI=219;static Uw=140;static Ww=40;static Hw=200;static Bw=178;static Gw=247;static hy=138;static Ow=239;static _w=194;static mw=8;static Ew=27;static gw=113;static Tw=100;static Pw=134;static kw=202;static Lw=245;static Yw=172;static oy=96;static sy=97;static ny=116;static Fw=9;static cw=75;static ow=164;static Dw=53;static Nw=185;static rw=206;static Iy=177;static wy=248;static Aw=195;static pw=71;static ww=133;static uw=157;static dw=211;static Sw=48;static Rw=130;static $w=31;static ty=59;static jw=212;static Qw=38;static qw=6;static zw=155;static Mw=235;static AA=231;static Vy=237;static su=175;static iI=93;static xy=190;static tI=165;static Sf=159;static $y=171;static qy=79;static Sy=52;static Yy=244;static Gy=148;static Zy=11;static jy=118;static Xy=4;static zy=158;static Qm=181}},3554:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(6666),e=s(1982),n=s(9234);class r{_k;Ck;Tk;closed=!1;Ok=!1;static rf=async t=>await new Promise(((i,s)=>{const h=t.host.startsWith('https'),e=h?'wss':'ws',n=t.host.substring(t.host.indexOf('//')+2),r=h?t.port+2:t.port+1,o=new WebSocket(`${e}://${n}:${r}`,'binary');o.addEventListener('open',(()=>{console.log('connection open!'),i(o)})),o.addEventListener('error',(()=>{console.log('connection error!'),s(o)}))}));constructor(t){t.onclose=this.onclose,t.onerror=this.onerror,this.Ck=new a(t,5e3),this.Tk=new o(t,5e3),this._k=t}get host(){return this._k.url.split('/')[2]}get port(){return parseInt(this._k.url.split(':')[2],10)}get available(){return this.closed?0:this.Ck.available}write(t,i){this.Tk.write(t,i)}async read(){return this.closed?0:this.Ck.vk()??await this.Ck.bk()}async lf(t,i,s){if(!this.closed)for(;s>0;){const h=this.Ck.Lk(t,i,s)??await this.Ck.Rk(t,i,s);if(h.length<=0)throw new Error('EOF');i+=h.length,s-=h.length}}close(){this.closed=!0,this._k.close(),this.Ck.close(),this.Tk.close(),console.log('connection close!'),this.Ok&&console.log('connection error!')}onclose=t=>{this.closed||this.close()};onerror=t=>{this.closed||(this.Ok=!0,this.close())}}class o{_k;Sk;closed=!1;Ok=!1;constructor(t,i){this._k=t,this.Sk=i}write(t,i){if(!this.closed){if(this.Ok)throw this.Ok=!1,new Error('Error in writer thread');if(i>this.Sk||t.length>this.Sk)throw new Error('buffer overflow');try{this._k.send(t.subarray(0,i))}catch(t){this.Ok=!0}}}close(){this.closed=!0}}class l extends e.A{aI;position;constructor(t){super(),this.aI=t,this.position=0}get available(){return this.aI.length-this.position}get read(){return this.aI[this.position++]}get Mk(){return this.aI.length}}class a{Sk;queue=new h.A;event=null;kk=null;total=0;closed=!1;constructor(t,i){this.Sk=i,t.binaryType='arraybuffer',t.onmessage=this.onmessage}get available(){return this.total}onmessage=t=>{if(this.closed)throw new Error('WebSocketReader is closed!');const i=new l(new Uint8Array(t.data));if(this.event?this.queue.LE(i):this.event=i,this.total+=i.Mk,this.kk&&(this.kk(this.event),this.kk=null,this.total>this.Sk))throw new Error('buffer overflow')};xk(){return this.event&&this.event.available>0?this.event.read:null}async Dk(t){for(this.event=this.queue.iL();this.totalthis.kk=t)),(0,n.wl)(2e3).then((()=>{if(this.closed)throw new Error('WebSocketReader closed while reading.')}))]);return this.event?this.event.read:this.Dk(t)}Lk(t,i,s){if(this.closed)throw new Error('WebSocketReader is closed!');if(!(this.event&&this.event.available>=s))return null;for(;s>0;){const h=this.xk();if(null===h)throw new Error('EOF - tried to read a fast byte when there was not enough immediate bytes.');t[i++]=h,this.total--,s--}return t}async Rk(t,i,s){if(this.closed)throw new Error('WebSocketReader is closed!');for(;s>0;)t[i++]=this.xk()??await this.Dk(s),this.total--,s--;return t}vk(){if(this.closed)throw new Error('WebSocketReader is closed!');const t=this.xk();return null===t?null:(this.total--,t)}async bk(){if(this.closed)throw new Error('WebSocketReader is closed!');const t=await this.Dk(1);return this.total--,t}close(){this.closed=!0,this.kk=null,this.total=0,this.event=null,this.queue.clear()}}},296:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(6666),e=s(1982),n=s(9234);class r{yt;ol;Nk;closed=!1;Ok=!1;constructor(t,i){this.yt=t,this.yt.onerror=this.onerror,this.yt.onmessageerror=this.onmessageerror,this.ol=new a(5e3),this.Nk=new o(this.yt,5e3,i),this.yt.postMessage({type:'connection',id:i})}get available(){return this.closed?0:this.ol.available}write(t,i){this.Nk.write(t,i)}async read(){return this.closed?0:this.ol.vk()??await this.ol.bk()}async lf(t,i,s){if(!this.closed)for(;s>0;){const h=this.ol.Lk(t,i,s)??await this.ol.Rk(t,i,s);if(h.length<=0)throw new Error('EOF');i+=h.length,s-=h.length}}close(){this.closed=!0,this.ol.close(),this.Nk.close(),console.log('connection close!'),this.Ok&&console.log('connection error!')}onerror=t=>{this.closed||(this.Ok=!0,this.close())};onmessageerror=t=>{this.closed||(this.Ok=!0,this.close())}}class o{yt;Sk;At;closed=!1;Ok=!1;constructor(t,i,s){this.yt=t,this.Sk=i,this.At=s}write(t,i){if(!this.closed){if(this.Ok)throw this.Ok=!1,new Error('Error in writer thread');if(i>this.Sk||t.length>this.Sk)throw new Error('buffer overflow');try{this.yt.postMessage({type:'data',data:t.subarray(0,i),id:this.At})}catch(t){this.Ok=!0}}}close(){this.closed=!0}}class l extends e.A{aI;position;constructor(t){super(),this.aI=t,this.position=0}get available(){return this.aI.length-this.position}get read(){return this.aI[this.position++]}get Mk(){return this.aI.length}}class a{Sk;queue=new h.A;event=null;kk=null;total=0;closed=!1;constructor(t){this.Sk=t}get available(){return this.total}onmessage=t=>{const i='string'==typeof t.data?JSON.parse(t.data):t;if('data'!==i.type)return void console.error('Unexpected message type: ',i.type);if(this.closed)throw new Error('WorkerReader is closed!');const s=new l(new Uint8Array(i.data));if(this.event?this.queue.LE(s):this.event=s,this.total+=s.Mk,this.kk&&(this.kk(this.event),this.kk=null,this.total>this.Sk))throw new Error('buffer overflow')};xk(){return this.event&&this.event.available>0?this.event.read:null}async Dk(t){for(this.event=this.queue.iL();this.totalthis.kk=t)),(0,n.wl)(2e3).then((()=>{if(this.closed)throw new Error('WorkerReader closed while reading.')}))]);return this.event?this.event.read:this.Dk(t)}Lk(t,i,s){if(this.closed)throw new Error('WorkerReader is closed!');if(!(this.event&&this.event.available>=s))return null;for(;s>0;){const h=this.xk();if(null===h)throw new Error('EOF - tried to read a fast byte when there was not enough immediate bytes.');t[i++]=h,this.total--,s--}return t}async Rk(t,i,s){if(this.closed)throw new Error('WorkerReader is closed!');for(;s>0;)t[i++]=this.xk()??await this.Dk(s),this.total--,s--;return t}vk(){if(this.closed)throw new Error('WorkerReader is closed!');const t=this.xk();return null===t?null:(this.total--,t)}async bk(){if(this.closed)throw new Error('WorkerReader is closed!');const t=await this.Dk(1);return this.total--,t}close(){this.closed=!0,this.kk=null,this.total=0,this.event=null,this.queue.clear()}}},4544:(t,i,s)=>{s.d(i,{A:()=>h});class h{db;constructor(t){t.onerror=this.onerror,t.onclose=this.onclose,this.db=t}static openDatabase=async()=>await new Promise(((t,i)=>{const s=indexedDB.open('lostcity',1);s.onsuccess=i=>{const s=i.target;console.log('database success!'),t(s.result)},s.onupgradeneeded=t=>{t.target.result.createObjectStore('cache')},s.onerror=t=>{const s=t.target;console.error('database error!: ',s.error),i(s.result)}}));cl=async t=>await new Promise((i=>{const s=this.db.transaction('cache','readonly').objectStore('cache').get(t);s.onsuccess=()=>{i(s.result)},s.onerror=t=>{i(void 0)}}));yl=async(t,i)=>await new Promise(((s,h)=>{const e=this.db.transaction('cache','readwrite').objectStore('cache').put(i,t);e.onsuccess=()=>{s()},e.onerror=t=>{h()}}));onclose=t=>{console.log('database close!')};onerror=t=>{console.log('database error!')};tt=t=>{const i=t.trim();let s=0;for(let t=0;t='A'&&h<='Z'?s+=h.charCodeAt(0)+1-65:h>='a'&&h<='z'?s+=h.charCodeAt(0)+1-97:h>='0'&&h<='9'&&(s+=h.charCodeAt(0)+27-48)}return s}}},2634:(t,i,s)=>{s.d(i,{A:()=>h});class h{count=0;Pk=new Int32Array(256);Fk=new Int32Array(256);a=0;b=0;c=0;constructor(t){for(let i=0;i>>2,e+=i,s+=h,s^=h<<8,n+=s,h+=e,h^=e>>>16,r+=h,e+=n,e^=n<<10,o+=e,n+=r,n^=r>>>4,t+=n,r+=o,r^=o<<8,i+=r,o+=t,o^=t>>>9,s+=o,t+=i;for(let l=0;l<256;l+=8)t+=this.Pk[l],i+=this.Pk[l+1],s+=this.Pk[l+2],h+=this.Pk[l+3],e+=this.Pk[l+4],n+=this.Pk[l+5],r+=this.Pk[l+6],o+=this.Pk[l+7],t^=i<<11,h+=t,i+=s,i^=s>>>2,e+=i,s+=h,s^=h<<8,n+=s,h+=e,h^=e>>>16,r+=h,e+=n,e^=n<<10,o+=e,n+=r,n^=r>>>4,t+=n,r+=o,r^=o<<8,i+=r,o+=t,o^=t>>>9,s+=o,t+=i,this.Fk[l]=t,this.Fk[l+1]=i,this.Fk[l+2]=s,this.Fk[l+3]=h,this.Fk[l+4]=e,this.Fk[l+5]=n,this.Fk[l+6]=r,this.Fk[l+7]=o;for(let l=0;l<256;l+=8)t+=this.Fk[l],i+=this.Fk[l+1],s+=this.Fk[l+2],h+=this.Fk[l+3],e+=this.Fk[l+4],n+=this.Fk[l+5],r+=this.Fk[l+6],o+=this.Fk[l+7],t^=i<<11,h+=t,i+=s,i^=s>>>2,e+=i,s+=h,s^=h<<8,n+=s,h+=e,h^=e>>>16,r+=h,e+=n,e^=n<<10,o+=e,n+=r,n^=r>>>4,t+=n,r+=o,r^=o<<8,i+=r,o+=t,o^=t>>>9,s+=o,t+=i,this.Fk[l]=t,this.Fk[l+1]=i,this.Fk[l+2]=s,this.Fk[l+3]=h,this.Fk[l+4]=e,this.Fk[l+5]=n,this.Fk[l+6]=r,this.Fk[l+7]=o;this.Uk(),this.count=256}Uk(){this.c++,this.b+=this.c;for(let t=0;t<256;t++){const i=this.Fk[t],s=3&t;let h;0===s?this.a^=this.a<<13:1===s?this.a^=this.a>>>6:2===s?this.a^=this.a<<2:3===s&&(this.a^=this.a>>>16),this.a+=this.Fk[t+128&255],this.Fk[t]=h=this.Fk[i>>>2&255]+this.a+this.b,this.Pk[t]=this.b=this.Fk[h>>>8>>>2&255]+i}}}},1069:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(9234),e=s(6666),n=s(4474);class r extends n.A{static Bk=3988292384;static Gk=new Int32Array(256);static Hk=new Uint32Array(33);static Wk=new e.A;static Yk=new e.A;static Vk=new e.A;static Kk=0;static Xk=0;static zk=0;static{for(let t=0;t<32;t++)r.Hk[t]=(1<>>=1:i=i>>>1^r.Bk;r.Gk[t]=i}}static fl=t=>{let i=4294967295;for(let s=0;s>>8^r.Gk[255&(i^t[s])];return~i};view;data;ft=0;lI=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.ft}static ni=t=>{let i=null;return 0===t&&r.Kk>0?(r.Kk--,i=r.Wk.iL()):1===t&&r.Xk>0?(r.Xk--,i=r.Yk.iL()):2===t&&r.zk>0&&(r.zk--,i=r.Vk.iL()),i?(i.ft=0,i):new r(0===t?new Uint8Array(100):1===t?new Uint8Array(5e3):new Uint8Array(3e4))};release(){this.ft=0,100===this.view.byteLength&&r.Kk<1e3?(r.Wk.LE(this),r.Kk++):5e3===this.view.byteLength&&r.Xk<250?(r.Yk.LE(this),r.Xk++):3e4===this.view.byteLength&&r.zk<50&&(r.Vk.LE(this),r.zk++)}get CA(){return this.view.getUint8(this.ft++)}get gA(){return this.view.getInt8(this.ft++)}get ct(){const t=this.view.getUint16(this.ft);return this.ft+=2,t}get Cp(){const t=this.view.getInt16(this.ft);return this.ft+=2,t}get lt(){const t=this.view.getUint8(this.ft++)<<16|this.view.getUint16(this.ft);return this.ft+=2,t}get ut(){const t=this.view.getInt32(this.ft);return this.ft+=4,t}get af(){const t=this.view.getBigInt64(this.ft);return this.ft+=8,t}get iS(){return this.view.getUint8(this.ft)<128?this.CA-64:this.ct-49152}get vO(){return this.view.getUint8(this.ft)<128?this.CA:this.ct-32768}get NA(){const t=this.view,i=t.byteLength;let s,h='';for(;10!==(s=t.getUint8(this.ft++))&&this.ft>16),this.view.setUint16(this.ft,t),this.ft+=2}p4(t){this.view.setInt32(this.ft,t),this.ft+=4}Zk(t){this.view.setInt32(this.ft,t,!0),this.ft+=4}Dy(t){this.view.setBigInt64(this.ft,t),this.ft+=8}cf(t){const i=this.view,s=t.length;for(let h=0;h>>3}oI(t){let i=this.lI>>>3,s=8-(7&this.lI),h=0;for(this.lI+=t;t>s;s=8)h+=(this.view.getUint8(i++)&r.Hk[s])<>>s-t&r.Hk[t],h}ff(t,i){const s=this.ft;this.ft=0;const e=new Uint8Array(s);this.sp(s,0,e);const n=(0,h.qk)(e),r=(0,h.$k)(n,i,t),o=(0,h.Jk)(r);this.ft=0,this.p1(o.length),this.uf(o,o.length,0)}}},353:(t,i,s)=>{s.d(i,{A:()=>h});class h{static Qk=[95,218,67,50,253,222,194,60,101,128,8,251,92,111,24,33,223,66,232,59,227,113,153,105,126,98,167,102,177,238,62,190,147,23,150,151,156,144,193,155,81,0,198,22,137,210,179,16,168,170,32,181,248,141,58,87,208,106,180,191,221,241,40,176,196,154,65,145,230,78,30,161,188,41,14,129,18,199,47,247,225,34,51,10,159,75,12,56,61,31,39,91,46,242,134,5,122,123,209,228,104,195,21,3,11,44,107,172,6,186,110,215,205,103,27,185,124,77,252,117,86,115,127,207,52,79,43,97,219,116,169,7,118,162,108,36,20,233,88,135,80,19,42,237,57,152,71,9,250,17,4,119,234,130,26,200,189,163,254,245,197,171,220,235,140,244,184,94,211,231,99,246,121,212,112,204,63,148,83,178,1,255,131,13,183,142,236,45,55,35,243,136,37,85,100,160,38,224,146,174,82,48,109,132,125,90,143,138,240,173,165,164,192,175,29,74,28,114,213,73,64,206,76,139,96,2,229,15,93,25,239,202,49,70,214,201,72,203,68,89,69,157,216,217,249,120,226,84,149,187,54,53,158,166,182,133,0];static IA=[0,-2,4,6,-1,0,0,2,0,0,0,0,5,4,2,2,0,0,0,0,2,-2,2,14,0,6,3,0,4,0,0,0,3,0,0,0,0,0,0,0,0,-1,4,2,6,0,6,0,0,3,7,0,0,0,-1,0,0,0,0,4,0,0,0,0,0,0,0,0,1,15,0,0,0,0,6,0,2,0,0,0,2,0,0,0,1,0,0,4,0,0,0,0,0,0,0,0,0,0,-2,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,-2,0,0,2,0,0,0,2,9,0,0,0,0,0,4,0,0,0,3,7,9,0,0,0,0,0,0,0,0,0,-2,0,0,0,0,3,2,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,-2,2,0,0,0,0,0,6,0,0,0,2,0,2,0,0,0,-2,0,0,4,0,0,0,0,6,0,0,-2,-2,0,0,0,0,0,0,-2,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,-2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0]}},2215:(t,i,s)=>{s.d(i,{A:()=>h});class h{static gp=14;static $A=28;static jp=129;static tp=167;static Wp=168;static Ip=195;static Yp=2;static Kp=26;static Up=46;static Pp=84;static kp=87;static pp=103;static QA=146;static MA=197;static Zp=201;static yp=204;static _p=209;static cp=126;static xp=185;static lp=15;static ep=98;static tm=213;static Np=74;static Qp=13;static Tp=3;static zp=239;static vA=1;static im=184;static hp=133;static np=226;static Fp=4;static Xp=21;static mp=32;static Gy=41;static _A=152;static UA=19;static Jp=22;static xA=25;static TA=43;static qp=44;static Dp=68;static Vp=136;static BA=139;static ap=140;static PA=142;static op=243;static up=254;static FA=20;static OA=80;static Sp=132;static ip=220;static LA=237;static EA=150;static JA=175;static Mp=193;static dp=12;static DA=54;static fp=212;static Ap=7;static Op=135;static $p=162;static HA=23;static zA=42;static KA=49;static WA=50;static ZA=59;static VA=69;static jA=76;static GA=151;static YA=191;static XA=223}},3937:(t,i,s)=>{s.d(i,{A:()=>o});class h{start=0;end=0;form=0;length=0;tx=null;ix=null;threshold=0;position=0;delta=0;amplitude=0;sx=0;read(t){this.form=t.CA,this.start=t.ut,this.end=t.ut,this.length=t.CA,this.tx=new Int32Array(this.length),this.ix=new Int32Array(this.length);for(let i=0;i=this.threshold&&this.ix&&this.tx&&(this.amplitude=this.ix[this.position++]<<15,this.position>=this.length&&(this.position=this.length-1),this.threshold=this.tx[this.position]/65536*t|0,this.threshold>this.sx&&(this.delta=((this.ix[this.position]<<15)-this.amplitude)/(this.threshold-this.sx)|0)),this.amplitude+=this.delta,this.sx++,this.amplitude-this.delta>>15}}class e{static buffer=null;static hO=null;static sin=null;static hx=new Int32Array(5);static nx=new Int32Array(5);static ox=new Int32Array(5);static lx=new Int32Array(5);static ux=new Int32Array(5);wx=null;yx=null;Ax=null;mx=null;Ix=null;Ex=null;release=null;attack=null;gx=new Int32Array(5);_x=new Int32Array(5);Cx=new Int32Array(5);start=0;length=500;Tx=100;Ox=0;static init=()=>{this.hO=new Int32Array(32768);for(let t=0;t<32768;t++)Math.random()>.5?this.hO[t]=1:this.hO[t]=-1;this.sin=new Int32Array(32768);for(let t=0;t<32768;t++)this.sin[t]=16384*Math.sin(t/5215.1903)|0;this.buffer=new Int32Array(220500)};pf(t,i){for(let i=0;i>1,r+=(i*h>>16)+n}if(this.Ix&&this.Ex){const i=this.Ix.evaluate(t),s=this.Ex.evaluate(t);c=c*(32768+(this.vx(s,a,this.Ix.form)>>1))>>15,a+=(i*o>>16)+l}for(let h=0;h<5;h++)if(0!==this.gx[h]){const n=i+e.nx[h];n>15,e.hx[h],this.wx.form),e.hx[h]+=(s*e.lx[h]>>16)+e.ux[h])}}if(this.release&&this.attack){this.release.reset(),this.attack.reset();let i=0,s=!0;for(let h=0;h>8):this.release.start+((this.release.end-this.release.start)*r>>8),i+=256,i>=o&&(i=0,s=!s),s&&(e.buffer[h]=0)}}if(this.Ox>0&&this.Tx>0){const i=this.Ox*s;for(let s=i;s32767&&(e.buffer[i]=32767);return e.buffer}vx(t,i,s){return 1===s?(32767&i)<16384?t:-t:2===s?e.sin[32767&i]*t>>14:3===s?((32767&i)*t>>14)-t:4===s?e.hO[i/2607&32767]*t:0}read(t){this.wx=new h,this.wx.read(t),this.yx=new h,this.yx.read(t),0!==t.CA&&(t.ft--,this.Ax=new h,this.Ax.read(t),this.mx=new h,this.mx.read(t)),0!==t.CA&&(t.ft--,this.Ix=new h,this.Ix.read(t),this.Ex=new h,this.Ex.read(t)),0!==t.CA&&(t.ft--,this.release=new h,this.release.read(t),this.attack=new h,this.attack.read(t));for(let i=0;i<10;i++){const s=t.vO;if(0===s)break;this.gx[i]=s,this._x[i]=t.iS,this.Cx[i]=t.vO}this.Ox=t.vO,this.Tx=t.vO,this.length=t.ct,this.start=t.ct}}var n=s(1069),r=s(3867);class o{static wp=new Int32Array(1e3);static bx=null;static Lx=null;static Rx=new r.Ns(1e3,null);Sx=new r.Ns(10,null);Mx=0;loopEnd=0;static Sc=t=>{const i=new n.A(t.read('sounds.dat'));for(this.bx=new Uint8Array(441e3),this.Lx=new n.A(this.bx),e.init();;){const t=i.ct;if(65535===t)break;const s=new o;s.read(i),this.Rx[t]=s,this.wp[t]=s.trim()}};static pf=(t,i)=>{if(!this.Rx[t])return null;const s=this.Rx[t];return s?.kx(i)??null};read(t){for(let i=0;i<10;i++)0!==t.CA&&(t.ft--,this.Sx[i]=new e,this.Sx[i]?.read(t));this.Mx=t.ct,this.loopEnd=t.ct}trim(){let t=9999999;for(let i=0;i<10;i++)this.Sx[i]&&(this.Sx[i].start/20|0)i&&(i=this.Sx[t].length+this.Sx[t].start);if(0===i)return 0;let s=22050*i/1e3|0,h=22050*this.Mx/1e3|0,e=22050*this.loopEnd/1e3|0;(h<0||e<0||e>s||h>=e)&&(t=0);let n=s+(e-h)*(t-1);for(let t=44;t>8<<24>>24)}if(t>1){h+=44,e+=44,s+=44,n+=44;const i=n-s;for(let t=s-1;t>=e;t--)o.bx&&(o.bx[t+i]=o.bx[t]);for(let i=1;i{s.d(i,{Cc:()=>a,_c:()=>o,Ns:()=>h,Rv:()=>e,Kr:()=>n,vv:()=>r,wr:()=>l});class h extends Array{constructor(t,i){super(t);for(let s=0;s{s.d(i,{Jk:()=>l,dl:()=>e,qk:()=>o,wl:()=>h,mc:()=>n,qc:()=>r,$k:()=>a});const h=async t=>new Promise((i=>setTimeout(i,t))),e=async t=>new Int8Array(await(await fetch(t)).arrayBuffer()),n=async t=>(await fetch(t)).text();function r(t,i,s,h,e){for(;e--;)s[h++]=t[i++]}function o(t){let i=0n;for(let s=0;s0n;)i.unshift(Number(0xffn&t)),t>>=8n;return 128&i[0]&&i.unshift(0),new Uint8Array(i)}function a(t,i,s){let h=1n;for(;i>0n;)i%2n===1n&&(h=h*t%s),t=t*t%s,i>>=1n;return h}},7953:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1069);class e{static xx=new Uint16Array(['d','o','t'].join('').split('').map((t=>t.charCodeAt(0))));static Dx=new Uint16Array(['(','a',')'].join('').split('').map((t=>t.charCodeAt(0))));static Nx=new Uint16Array(['s','l','a','s','h'].join('').split('').map((t=>t.charCodeAt(0))));static Px=['cook',"cook's",'cooks','seeks','sheet'];static Fx=[];static Ux=[];static Bx=[];static Gx=[];static Hx=[];static Wx=[];static Sc=t=>{const i=new h.A(t.read('fragmentsenc.txt')),s=new h.A(t.read('badenc.txt')),e=new h.A(t.read('domainenc.txt')),n=new h.A(t.read('tldlist.txt'));this.read(s,e,i,n)};static filter=t=>{const i=[...t];this.format(i);const s=i.join('').trim(),h=s.toLowerCase(),e=[...h];this.Yx(e),this.Vx(e),this.Kx(e),this.Xx(e);for(let t=0;t{this.Zx(t),this.qx(i),this.$x(s),this.Jx(h)};static Jx=t=>{const i=t.ut;for(let s=0;st.CA))};static Zx=t=>{const i=t.ut;for(let s=0;st.CA));const i=new Array(t.CA).fill([]).map((()=>[t.gA,t.gA]));i.length>0&&(this.Gx[s]=i)}};static qx=t=>{const i=t.ut;for(let s=0;st.CA))};static $x=t=>{const i=t.ut;for(let s=0;s{const i=[...t],s=[...t];this.Qx(null,i,this.xx),this.Qx(null,s,this.Nx);for(let h=0;h{for(let i=0;i<2;i++)for(let i=this.Bx.length-1;i>=0;i--)this.Qx(this.Gx[i],t,this.Bx[i])};static Kx=t=>{const i=[...t],s=[...t];this.Qx(null,i,this.Dx),this.Qx(null,s,this.xx);for(let h=this.Hx.length-1;h>=0;h--)this.iD(s,i,this.Hx[h],t)};static Xx=t=>{for(let i=0;i=0&&e{if(this.lD(t))return!0;const i=this.aD(t),s=this.Wx,h=s.length;if(i===s[0]||i===s[h-1])return!0;let e=0,n=h-1;for(;e<=n;){const t=(e+n)/2|0;if(i===s[t])return!0;i{if(t.length>6)return 0;let i=0;for(let s=0;s{for(let s=i;s=0;s++)if(this.fD(t[s]))return s;return-1};static rD=(t,i)=>{for(let s=t;s=0;s++)if(!this.fD(i[s]))return s;return i.length};static uD=(t,i,s)=>i===s||'o'===i&&'0'===s?1:'o'===i&&'('===s&&')'===t?2:'c'!==i||'('!==s&&'<'!==s&&'['!==s?'e'===i&&'€'===s||'s'===i&&'$'===s||'l'===i&&'i'===s?1:0:1;static iD=(t,i,s,h)=>{const e=s.length,n=h.length;for(let r=0;r<=n-e;r++){const{dD:e,wD:n}=this.yD(r,s,h);if(!e)continue;const o=this.AD(r,h,3,i,['@']),l=this.pD(n-1,h,3,t,['.',',']);(o>2||l>2)&&this.nD(r,n,h)}};static yD=(t,i,s)=>{const h=i.length;let e=t,n=0;for(;e0)e+=l,n++;else{if(0===n)break;const s=this.uD(o,String.fromCharCode(i[n-1]),r);if(s>0)e+=s,1===n&&t++;else{if(n>=h||!this.hD(r))break;e++}}}return{dD:n>=h,wD:e}};static Qx=(t,i,s)=>{if(!(s.length>i.length))for(let h=0;h<=i.length-s.length;h++){let e=h;const{wD:n,mD:r,ID:o,ED:l,gD:a}=this._D(i,s,e);e=n;let c=i[e],f=e+1=s.length)||l&&a)continue;let u,d=!0;if(o){let t=!1,s=!1;if((h-1<0||this.hD(i[h-1])&&"'"!==i[h-1])&&(t=!0),(e>=i.length||this.hD(i[e])&&"'"!==i[e])&&(s=!0),!t||!s){let s=!1;for(u=h-2,t&&(u=h);!s&&u=0&&(!this.hD(i[u])||"'"===i[u])){const t=[];let h;for(h=0;h<3&&u+h=0&&(!this.hD(i[u-1])||"'"===i[u-1])&&(e=!1),e&&!this.oD(t)&&(s=!0)}u++}s||(d=!1)}}else{c=' ',h-1>=0&&(c=i[h-1]),f=' ',e{let h=s,e=0,n=0,r=!1,o=!1,l=!1;for(;h=t.length||o&&l);){const a=t[h],c=h+10)1===f&&this.fD(a)&&(o=!0),2===f&&(this.fD(a)||this.fD(c))&&(o=!0),h+=f,e++;else{if(0===e)break;let t;if((t=this.vD(c,String.fromCharCode(i[e-1]),a))>0)h+=t;else{if(e>=i.length||!this.eD(a))break;if(this.hD(a)&&"'"!==a&&(r=!0),this.fD(a)&&(l=!0),h++,n++,(100*n/(h-s)|0)>90)break}}}return{wD:h,mD:e,ID:r,ED:o,gD:l}};static vD=(t,i,s)=>{if(i===s)return 1;if(i>='a'&&i<='m'){if('a'===i)return'4'!==s&&'@'!==s&&'^'!==s?'/'===s&&'\\'===t?2:0:1;if('b'===i)return'6'!==s&&'8'!==s?'1'===s&&'3'===t?2:0:1;if('c'===i)return'('!==s&&'<'!==s&&'{'!==s&&'['!==s?0:1;if('d'===i)return'['===s&&')'===t?2:0;if('e'===i)return'3'!==s&&'€'!==s?0:1;if('f'===i)return'p'===s&&'h'===t?2:'£'===s?1:0;if('g'===i)return'9'!==s&&'6'!==s?0:1;if('h'===i)return'#'===s?1:0;if('i'===i)return'y'!==s&&'l'!==s&&'j'!==s&&'1'!==s&&'!'!==s&&':'!==s&&';'!==s&&'|'!==s?0:1;if('j'===i)return 0;if('k'===i)return 0;if('l'===i)return'1'!==s&&'|'!==s&&'i'!==s?0:1;if('m'===i)return 0}if(i>='n'&&i<='z'){if('n'===i)return 0;if('o'===i)return'0'!==s&&'*'!==s?'('===s&&')'===t||'['===s&&']'===t||'{'===s&&'}'===t||'<'===s&&'>'===t?2:0:1;if('p'===i)return 0;if('q'===i)return 0;if('r'===i)return 0;if('s'===i)return'5'!==s&&'z'!==s&&'$'!==s&&'2'!==s?0:1;if('t'===i)return'7'!==s&&'+'!==s?0:1;if('u'===i)return'v'===s?1:'\\'===s&&'/'===t||'\\'===s&&'|'===t||'|'===s&&'/'===t?2:0;if('v'===i)return'\\'===s&&'/'===t||'\\'===s&&'|'===t||'|'===s&&'/'===t?2:0;if('w'===i)return'v'===s&&'v'===t?2:0;if('x'===i)return')'===s&&'('===t||'}'===s&&'{'===t||']'===s&&'['===t||'>'===s&&'<'===t?2:0;if('y'===i)return 0;if('z'===i)return 0}return i>='0'&&i<='9'?'0'===i?'o'===s||'O'===s?1:'('===s&&')'===t||'{'===s&&'}'===t||'['===s&&']'===t?2:0:'1'===i&&'l'===s?1:0:','===i?'.'===s?1:0:'.'===i?','===s?1:0:'!'===i&&'i'===s?1:0};static TD=(t,i,s)=>{let h=0,e=i.length-1;for(;h<=e;){const n=(h+e)/2|0;if(i[n][0]===t&&i[n][1]===s)return!0;tthis.cD(t)?t.charCodeAt(0)+1-'a'.charCodeAt(0):"'"===t?28:this.fD(t)?t.charCodeAt(0)+29-'0'.charCodeAt(0):27;static tD=(t,i,s,h,e)=>{if(!(h.length>s.length))for(let n=0;n<=s.length-h.length;n++){const{wD:r,bD:o}=this.LD(s,h,n);if(o0&&c>0&&(l=!0),2===i&&(a>2&&c>0||a>0&&c>2)&&(l=!0),3===i&&a>0&&c>2&&(l=!0),!l)continue;let f,u=n,d=r-1,w=!1;if(a>2){if(4===a)for(w=!1,f=n-1;f>=0;f--)if(w){if('*'!==e[f])break;u=f}else'*'===e[f]&&(u=f,w=!0);for(w=!1,f=u-1;f>=0;f--)if(w){if(this.hD(s[f]))break;u=f}else this.hD(s[f])||(w=!0,u=f)}if(c>2){if(4===c)for(w=!1,f=d+1;f{let h=0;for(;s0)s+=r,h++;else{if(0===h)break;let t;if((t=this.uD(n,String.fromCharCode(i[h-1]),e))>0)s+=t;else{if(!this.hD(e))break;s++}}}return{wD:s,bD:h}};static hD=t=>!this.OD(t)&&!this.fD(t);static eD=t=>!this.cD(t)||('v'===t||'x'===t||'j'===t||'q'===t||'z'===t);static OD=t=>this.cD(t)||this.RD(t);static fD=t=>t>='0'&&t<='9';static cD=t=>t>='a'&&t<='z';static RD=t=>t>='A'&&t<='Z';static lD=t=>{for(let i=0;i{for(let h=t;h{let s=0;for(let h=i-1;h>=0&&this.hD(t[h]);h--)'*'===t[h]&&s++;return s};static MD=(t,i)=>{let s=0;for(let h=i+1;h(e?this.SD(i,s):this.MD(i,s))>=h?4:this.hD(e?t[s-1]:t[s+1])?1:0;static AD=(t,i,s,h,e)=>{if(0===t)return 2;for(let s=t-1;s>=0&&this.hD(i[s]);s--)if(e.includes(i[s]))return 3;return this.kD(i,h,t,s,!0)};static pD=(t,i,s,h,e)=>{if(t+1===i.length)return 2;for(let s=t+1;s{let i=0;for(let s=0;st>=' '&&t<=''||' '===t||'\n'===t||'\t'===t||'£'===t||'€'===t;static zx=(t,i)=>{for(let s=0;s{let i=!0;for(let s=0;s{s.d(i,{A:()=>h});class h{static DD=[' ','e','t','a','o','i','h','n','s','r','d','l','u','m','w','c','y','f','g','p','b','v','k','x','j','q','z','0','1','2','3','4','5','6','7','8','9',' ','!','?','.',',',':',';','(',')','-','&','*','\\','\'','@','#','+','=','£','$','%','"','[',']'];static ND=[];static Sc=(t,i)=>{let s,h=0,e=-1;for(let n=0;n>4&15,-1!==e?(this.ND[h++]=this.DD[(e<<4)+s-195],e=-1):s<13?this.ND[h++]=this.DD[s]:e=s,s=15&i,-1!==e?(this.ND[h++]=this.DD[(e<<4)+s-195],e=-1):s<13?this.ND[h++]=this.DD[s]:e=s}let n=!0;for(let t=0;t='a'&&i<='z'&&(this.ND[t]=i.toUpperCase(),n=!1),'.'!==i&&'!'!==i||(n=!0)}return this.ND.slice(0,h).join('')};static Hy=(t,i)=>{i.length>80&&(i=i.substring(0,80)),i=i.toLowerCase();let s=-1;for(let h=0;h12&&(n+=195),-1===s?n<13?s=n:t.p1(n):n<13?(t.p1((s<<4)+n),s=-1):(t.p1((s<<4)+(n>>4)),s=15&n)}-1!==s&&t.p1(s<<4)}}},4702:(t,i,s)=>{async function h(t,i={}){const s={env:Object.assign(Object.create(globalThis),i.env||{},{abort(t,i,s,h){t=r(t>>>0),i=r(i>>>0),s>>>=0,h>>>=0,(()=>{throw Error(`${t} in ${i}:${s}:${h}`)})()}})},{exports:h}=await WebAssembly.instantiate(t,s),e=h.memory||i.env.memory,n=Object.setPrototypeOf({read:(t,i,s,n)=>(i=function(t,i,s,n,r){if(null==n)return 0;const o=n.length,l=h.__pin(h.__new(o<>>0;if(r)new r(e.buffer,l,o).set(n);else for(let i=0;i>>0),n[i]);return h.__unpin(l),l}(l,6,0,i,Int8Array)||function(){throw TypeError("value must not be null")}(),function(t,i,s){if(!s)return null;const h=function(t){try{return o.getUint32(t,!0)}catch{return o=new DataView(e.buffer),o.getUint32(t,!0)}}(s-4)>>>i,n=new Array(h);for(let e=0;e>>0));return n}(a,0,h.read(t,i,s,n)>>>0))},h);function r(t){if(!t)return null;const i=t+new Uint32Array(e.buffer)[t-4>>>2]>>>1,s=new Uint16Array(e.buffer);let h=t>>>1,n="";for(;i-h>1024;)n+=String.fromCharCode(...s.subarray(h,h+=1024));return n+String.fromCharCode(...s.subarray(h,i))}let o=new DataView(e.buffer);function l(t,i){try{o.setUint8(t,i,!0)}catch{o=new DataView(e.buffer),o.setUint8(t,i,!0)}}function a(t){try{return o.getInt8(t,!0)}catch{return o=new DataView(e.buffer),o.getInt8(t,!0)}}return n}s.d(i,{A:()=>e});class e{static PD=null;static load=async t=>{this.PD=await h(new WebAssembly.Module(t),{env:void 0})};static read=(t,i,s,h)=>{if(!this.PD)throw new Error('bz2 not found!!');return Int8Array.from(this.PD.read(t,i,s,h))}}},123:(t,i,s)=>{let h;async function e(t,i){n(i);try{const i=await window.audioContext.decodeAudioData(Uint8Array.from(t).buffer);let s=window.audioContext.createBufferSource();s.buffer=i,s.connect(h),s.start()}catch(t){console.log(t)}}function n(t){h||(h=window.audioContext.createGain(),h.connect(window.audioContext.destination)),h.gain.value=t/256}function r(t,i,s){window._tinyMidiPlay&&window._tinyMidiPlay(t,i/256,s)}function o(t){window._tinyMidiVolume&&window._tinyMidiVolume(t/256)}function l(t){window._tinyMidiStop&&window._tinyMidiStop(t)}s.d(i,{mf:()=>e,pl:()=>r,Em:()=>n,qo:()=>l,Im:()=>o})},8902:(t,i,s)=>{var h;const e=(h="file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/tinymidipcm.mjs",function(t){var i,e,n=void 0!==(t=t||{})?t:{};n.ready=new Promise((function(t,s){i=t,e=s})),["_tsf_load_memory","_tsf_set_output","_tsf_channel_set_bank_preset","_tsf_set_max_voices","_tsf_channel_set_presetnumber","_tsf_reset","_tsf_close","_tml_load_memory","_midi_render","_malloc","_realloc","_free","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(n.ready,t)||Object.defineProperty(n.ready,t,{get:()=>z('You are getting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),set:()=>z('You are setting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js')})}));var r=Object.assign({},n),o=[],l='object'==typeof window,a='function'==typeof importScripts,c='object'==typeof process&&'object'==typeof process.versions&&'string'==typeof process.versions.node,f=!l&&!c&&!a;if(n.ENVIRONMENT)throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');var u,d,w,y='';if(c){if('undefined'==typeof process||!process.release||'node'!==process.release.name)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');var A,p;y=a?require('path').FD(y)+'/':__dirname+'/';var m=()=>{p||(A=require('fs'),p=require('path'))};u=(t,i)=>(m(),t=p.normalize(t),A.UD(t,i?void 0:'utf8')),w=t=>{var i=u(t,!0);return i.buffer||(i=new Uint8Array(i)),D(i.buffer),i},d=(t,i,s)=>{m(),t=p.normalize(t),A.BD(t,(function(t,h){t?s(t):i(h.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,'/'),o=process.argv.slice(2),process.on('uncaughtException',(function(t){if(!(t instanceof et))throw t})),process.on('unhandledRejection',(function(t){throw t})),n.inspect=function(){return'[Emscripten Module object]'}}else if(f){if('object'==typeof process&&'function'==typeof require||'object'==typeof window||'function'==typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');'undefined'!=typeof read&&(u=function(t){return read(t)}),w=function(t){let i;return'function'==typeof readbuffer?new Uint8Array(readbuffer(t)):(i=read(t,'binary'),D('object'==typeof i),i)},d=function(t,i,s){setTimeout((()=>i(w(t))),0)},'undefined'!=typeof scriptArgs?o=scriptArgs:void 0!==arguments&&(o=arguments),'undefined'!=typeof print&&('undefined'==typeof console&&(console={}),console.log=print,console.warn=console.error='undefined'!=typeof printErr?printErr:print)}else{if(!l&&!a)throw new Error('environment detection error');if(a?y=self.location.href:'undefined'!=typeof document&&document.currentScript&&(y=document.currentScript.src),h&&(y=h),y=0!==y.indexOf('blob:')?y.substr(0,y.replace(/[?#].*/,"").lastIndexOf('/')+1):'','object'!=typeof window&&'function'!=typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');u=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.send(null),i.responseText},a&&(w=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.responseType='arraybuffer',i.send(null),new Uint8Array(i.response)}),d=(t,i,s)=>{var h=new XMLHttpRequest;h.open('GET',t,!0),h.responseType='arraybuffer',h.onload=()=>{200==h.status||0==h.status&&h.response?i(h.response):s()},h.onerror=s,h.send(null)}}n.print||console.log.bind(console);var I,E,g=n.printErr||console.warn.bind(console);function _(t,i){Object.getOwnPropertyDescriptor(n,t)||Object.defineProperty(n,t,{configurable:!0,get:function(){z('Module.'+t+' has been replaced with plain '+i+' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')}})}function C(t){return'FS_createPath'===t||'FS_createDataFile'===t||'FS_createPreloadedFile'===t||'FS_unlink'===t||'addRunDependency'===t||'FS_createLazyFile'===t||'FS_createDevice'===t||'removeRunDependency'===t}Object.assign(n,r),r=null,I='fetchSettings',Object.getOwnPropertyDescriptor(n,I)&&z('`Module.'+I+'` was supplied but `'+I+'` not included in INCOMING_MODULE_JS_API'),n.arguments&&(o=n.arguments),_('arguments','arguments_'),n.thisProgram&&n.thisProgram,_('thisProgram','thisProgram'),n.quit&&n.quit,_('quit','quit_'),D(void 0===n.memoryInitializerPrefixURL,'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===n.pthreadMainPrefixURL,'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'),D(void 0===n.cdInitializerPrefixURL,'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===n.filePackagePrefixURL,'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'),D(void 0===n.read,'Module.read option was removed (modify read_ in JS)'),D(void 0===n.readAsync,'Module.readAsync option was removed (modify readAsync in JS)'),D(void 0===n.readBinary,'Module.readBinary option was removed (modify readBinary in JS)'),D(void 0===n.setWindowTitle,'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'),D(void 0===n.TOTAL_MEMORY,'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'),_('read','read_'),_('readAsync','readAsync'),_('readBinary','readBinary'),_('setWindowTitle','setWindowTitle'),D(!f,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),n.wasmBinary&&(E=n.wasmBinary),_('wasmBinary','wasmBinary');var T;n.noExitRuntime;_('noExitRuntime','noExitRuntime'),'object'!=typeof WebAssembly&&z('no native wasm support detected');var O,v,b,L,R,S,M,k,x=!1;function D(t,i){t||z('Assertion failed'+(i?': '+i:''))}function N(t){O=t,n.HEAP8=v=new Int8Array(t),n.HEAP16=L=new Int16Array(t),n.HEAP32=R=new Int32Array(t),n.HEAPU8=b=new Uint8Array(t),n.HEAPU16=new Uint16Array(t),n.HEAPU32=S=new Uint32Array(t),n.HEAPF32=M=new Float32Array(t),n.HEAPF64=k=new Float64Array(t)}'undefined'!=typeof TextDecoder&&new TextDecoder('utf8');var P=5242880;n.TOTAL_STACK&&D(P===n.TOTAL_STACK,'the stack size can no longer be determined at runtime');var F=n.INITIAL_MEMORY||16777216;function U(){if(!x){var t=ft(),i=S[t>>2],s=S[t+4>>2];34821223==i&&2310721022==s||z('Stack overflow! Stack cookie has been overwritten at 0x'+t.toString(16)+', expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+s.toString(16)+' 0x'+i.toString(16)),1668509029!==S[0]&&z('Runtime error: The application has corrupted its heap memory area (address zero)!')}}_('INITIAL_MEMORY','INITIAL_MEMORY'),D(F>=P,'INITIAL_MEMORY should be larger than TOTAL_STACK, was '+F+'! (TOTAL_STACK='+P+')'),D('undefined'!=typeof Int32Array&&'undefined'!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,'JS engine does not provide full typed array support'),D(!n.wasmMemory,'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'),D(16777216==F,'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'),function(){var t=new Int16Array(1),i=new Int8Array(t.buffer);if(t[0]=25459,115!==i[0]||99!==i[1])throw'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'}();var B=[],G=[],H=[],W=!1;D(Math.imul,'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.fround,'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.clz32,'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.trunc,'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');var Y=0,V=null,K=null,X={};function z(t){n.onAbort&&n.onAbort(t),g(t='Aborted('+t+')'),x=!0;var i=new WebAssembly.RuntimeError(t);throw e(i),i}var j={error:function(){z('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM')},init:function(){j.error()},GD:function(){j.error()},HD:function(){j.error()},WD:function(){j.error()},open:function(){j.error()},YD:function(){j.error()},VD:function(){j.error()},KD:function(){j.error()},XD:function(){j.error()},zD:function(){j.error()}};n.FS_createDataFile=j.GD,n.FS_createPreloadedFile=j.HD;var Z,q,$,J,Q='data:application/octet-stream;base64,';function tt(t){return t.startsWith(Q)}function it(t){return t.startsWith('file://')}function st(t,i){return function(){var s=t,h=i;return i||(h=n.asm),D(W,'native function `'+s+'` called before runtime initialization'),h[t]||D(h[t],'exported native function `'+s+'` not found'),h[t].apply(null,arguments)}}function ht(t){try{if(t==Z&&E)return new Uint8Array(E);if(w)return w(t);throw"both async and sync fetching of the wasm failed"}catch(t){z(t)}}function et(t){this.name='ExitStatus',this.message='Program terminated with exit('+t+')',this.status=t}function nt(t){for(;t.length>0;)t.shift()(n)}function rt(t){rt.jD||(rt.jD={}),rt.jD[t]||(rt.jD[t]=1,c&&(t='warning: '+t),g(t))}function ot(t){try{return T.grow(t-O.byteLength+65535>>>16),N(T.buffer),1}catch(i){g('emscripten_realloc_buffer: Attempted to grow heap from '+O.byteLength+' bytes to '+t+' bytes, but got error: '+i)}}n.locateFile?tt(Z='tinymidipcm.wasm')||(q=Z,Z=n.locateFile?n.locateFile(q,y):y+q):Z=new URL(s(8227),s.b).toString();var lt,at={"emscripten_memcpy_big":function(t,i,s){b.copyWithin(t,i,i+s)},"emscripten_resize_heap":function(t){var i=b.length;D((t>>>=0)>i);var s,h,e=2147483648;if(t>e)return g('Cannot enlarge memory, asked to go up to '+t+' bytes, but the limit is '+e+' bytes!'),!1;for(var n=1;n<=4;n*=2){var r=i*(1+.2/n);r=Math.min(r,t+100663296);var o=Math.min(e,(s=Math.max(t,r))+((h=65536)-s%h)%h);if(ot(o))return!0}return g('Failed to grow the heap from '+i+' bytes to '+o+' bytes, not enough memory!'),!1}},ct=(function(){var t,i={'env':at,'wasi_snapshot_preview1':at};function s(t,i){var s,h=t.exports;n.asm=h,D(T=n.asm.memory,"memory not found in wasm exports"),N(T.buffer),D(n.asm.__indirect_function_table,"table not found in wasm exports"),s=n.asm.__wasm_call_ctors,G.unshift(s),function(t){if(Y--,n.monitorRunDependencies&&n.monitorRunDependencies(Y),t?(D(X[t]),delete X[t]):g('warning: run dependency removed without ID'),0==Y&&(null!==V&&(clearInterval(V),V=null),K)){var i=K;K=null,i()}}('wasm-instantiate')}t='wasm-instantiate',Y++,n.monitorRunDependencies&&n.monitorRunDependencies(Y),t?(D(!X[t]),X[t]=1,null===V&&'undefined'!=typeof setInterval&&(V=setInterval((function(){if(x)return clearInterval(V),void(V=null);var t=!1;for(var i in X)t||(t=!0,g('still waiting on run dependencies:')),g('dependency: '+i);t&&g('(end of list)')}),1e4))):g('warning: run dependency added without ID');var h=n;function r(t){D(n===h,'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'),h=null,s(t.instance)}function o(t){return function(){if(!E&&(l||a)){if('function'==typeof fetch&&!it(Z))return fetch(Z,{credentials:'same-origin'}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+Z+"'";return t.arrayBuffer()})).catch((function(){return ht(Z)}));if(d)return new Promise((function(t,i){d(Z,(function(i){t(new Uint8Array(i))}),i)}))}return Promise.resolve().then((function(){return ht(Z)}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){g('failed to asynchronously prepare wasm: '+t),it(Z)&&g('warning: Loading from a file URI ('+Z+') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing'),z(t)}))}if(n.instantiateWasm)try{return n.instantiateWasm(i,s)}catch(t){g('Module.instantiateWasm callback failed with error: '+t),e(t)}(E||'function'!=typeof WebAssembly.instantiateStreaming||tt(Z)||it(Z)||c||'function'!=typeof fetch?o(r):fetch(Z,{credentials:'same-origin'}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(r,(function(t){return g('wasm streaming compile failed: '+t),g('falling back to ArrayBuffer instantiation'),o(r)}))}))).catch(e)}(),n.___wasm_call_ctors=st("__wasm_call_ctors"),n._malloc=st("malloc"),n._free=st("free"),n._tsf_load_memory=st("tsf_load_memory"),n._tsf_close=st("tsf_close"),n._tsf_reset=st("tsf_reset"),n._tsf_set_output=st("tsf_set_output"),n._tsf_set_max_voices=st("tsf_set_max_voices"),n._realloc=st("realloc"),n._tsf_channel_set_presetnumber=st("tsf_channel_set_presetnumber"),n._tsf_channel_set_bank_preset=st("tsf_channel_set_bank_preset"),n._tml_load_memory=st("tml_load_memory"),n._midi_render=st("midi_render"),n.___errno_location=st("__errno_location"),n._fflush=st("fflush"),n._emscripten_stack_init=function(){return(ct=n._emscripten_stack_init=n.asm.emscripten_stack_init).apply(null,arguments)}),ft=(n._emscripten_stack_get_free=function(){return(n._emscripten_stack_get_free=n.asm.emscripten_stack_get_free).apply(null,arguments)},n._emscripten_stack_get_base=function(){return(n._emscripten_stack_get_base=n.asm.emscripten_stack_get_base).apply(null,arguments)},n._emscripten_stack_get_end=function(){return(ft=n._emscripten_stack_get_end=n.asm.emscripten_stack_get_end).apply(null,arguments)});function ut(){var t;ct(),D(!(3&(t=ft()))),S[t>>2]=34821223,S[t+4>>2]=2310721022,S[0]=1668509029}function dt(t){function s(){lt||(lt=!0,n.calledRun=!0,x||(D(!W),W=!0,U(),nt(G),i(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),D(!n._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(U(),n.postRun)for('function'==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)t=n.postRun.shift(),H.unshift(t);var t;nt(H)}()))}t=t||o,Y>0||(ut(),function(){if(n.preRun)for('function'==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)t=n.preRun.shift(),B.unshift(t);var t;nt(B)}(),Y>0||(n.setStatus?(n.setStatus('Running...'),setTimeout((function(){setTimeout((function(){n.setStatus('')}),1),s()}),1)):s(),U()))}if(n.stackSave=st("stackSave"),n.stackRestore=st("stackRestore"),n.stackAlloc=st("stackAlloc"),n.setValue=function(t,i,s="i8"){switch(s.endsWith('*')&&(s='*'),s){case'i1':case'i8':v[0|t]=i;break;case'i16':L[t>>1]=i;break;case'i32':R[t>>2]=i;break;case'i64':J=[i>>>0,($=i,+Math.abs($)>=1?$>0?(0|Math.min(+Math.floor($/4294967296),4294967295))>>>0:~~+Math.ceil(($-+(~~$>>>0))/4294967296)>>>0:0)],R[t>>2]=J[0],R[t+4>>2]=J[1];break;case'float':M[t>>2]=i;break;case'double':k[t>>3]=i;break;case'*':S[t>>2]=i;break;default:z('invalid type for setValue: '+s)}},n.getValue=function(t,i="i8"){switch(i.endsWith('*')&&(i='*'),i){case'i1':case'i8':return v[0|t];case'i16':return L[t>>1];case'i32':case'i64':return R[t>>2];case'float':return M[t>>2];case'double':return k[t>>3];case'*':return S[t>>2];default:z('invalid type for getValue: '+i)}return null},['run','UTF8ArrayToString','UTF8ToString','stringToUTF8Array','stringToUTF8','lengthBytesUTF8','addOnPreRun','addOnInit','addOnPreMain','addOnExit','addOnPostRun','addRunDependency','removeRunDependency','FS_createFolder','FS_createPath','FS_createDataFile','FS_createPreloadedFile','FS_createLazyFile','FS_createLink','FS_createDevice','FS_unlink','getLEB','getFunctionTables','alignFunctionTables','registerFunctions','prettyPrint','getCompilerSetting','print','printErr','callMain','abort','keepRuntimeAlive','wasmMemory','stackAlloc','stackSave','stackRestore','getTempRet0','setTempRet0','writeStackCookie','checkStackCookie','ptrToString','zeroMemory','stringToNewUTF8','exitJS','getHeapMax','emscripten_realloc_buffer','ENV','ERRNO_CODES','ERRNO_MESSAGES','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','DNS','getHostByName','Protocols','Sockets','getRandomDevice','warnOnce','traverseStack','UNWIND_CACHE','convertPCtoSourceLocation','readAsmConstArgsArray','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','handleException','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','freeTableIndexes','functionsInTableMap','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','PATH','PATH_FS','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16Decoder','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeArrayToMemory','writeAsciiToMemory','SYSCALLS','getSocketFromFD','getSocketAddress','JSEvents','registerKeyEventCallback','specialHTMLTargets','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','currentFullscreenStrategy','restoreOldWindowedStyle','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','demangle','demangleAll','jsStackTrace','stackTrace','ExitStatus','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','dlopenMissingError','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','uncaughtExceptionCount','exceptionLast','exceptionCaught','ExceptionInfo','exception_addRef','exception_decRef','Browser','setMainLoop','wget','FS','MEMFS','TTY','PIPEFS','SOCKFS','_setNetworkCallback','tempFixedLengthArray','miniTempWebGLFloatBuffers','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','GL','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','AL','SDL_unicode','SDL_ttfContext','SDL_audio','SDL','SDL_gfx','GLUT','EGL','GLFW_Window','GLFW','GLEW','IDBStore','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){Object.getOwnPropertyDescriptor(n,t)||Object.defineProperty(n,t,{configurable:!0,get:function(){var i="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";C(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),z(i)}})})),['ptrToString','zeroMemory','stringToNewUTF8','exitJS','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','getHostByName','getRandomDevice','traverseStack','convertPCtoSourceLocation','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeAsciiToMemory','getSocketFromFD','getSocketAddress','registerKeyEventCallback','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','ExceptionInfo','exception_addRef','exception_decRef','setMainLoop','_setNetworkCallback','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','SDL_unicode','SDL_ttfContext','SDL_audio','GLFW_Window','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){'undefined'==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var i='`'+t+'` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line';C(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),rt(i)}})})),K=function t(){lt||dt(),lt||(K=t)},n.preInit)for('function'==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return dt(),t.ready});const n=class{constructor(t={}){this.ZD=void 0,this.qD=0,this.$D=0,this.JD=0,this.QD=t.QD||100,this.sampleRate=t.sampleRate||44100,this.tN=t.tN||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.iN(1),this.sN=t.sN||(()=>{}),this.hN=t.hN||(()=>{}),this.eN=void 0,this.test=0}async init(){if(!this.ZD){if('undefined'!=typeof process){const{FD:t}=await import('path'),{nN: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.ZD=await e(),this.rN=this.ZD._malloc(this.bufferSize),this.oN=this.ZD._malloc(8)}}iN(t){this.bufferSize=4*this.sampleRate*this.tN*t}lN(){if(!this.ZD)throw new Error(`${this.constructor.name} not initalized. call .init()`)}aN(t){this.lN();const{_malloc:i,_free:s,_tsf_load_memory:h,_tsf_set_output:e,_tsf_channel_set_bank_preset:n,_tsf_set_max_voices:r,_tsf_channel_set_presetnumber:o}=this.ZD;s(this.qD),this.qD=i(t.length),this.ZD.HEAPU8.set(t,this.qD),this.$D=h(this.qD,t.length),e(this.$D,2===this.tN?0:2,this.sampleRate,this.gain)}cN(){this.lN();const t=new Uint8Array(this.bufferSize);return t.set(this.ZD.HEAPU8.subarray(this.rN,this.rN+this.bufferSize)),t}fN(t){const{_malloc:i,_free:s,_tml_load_memory:h}=this.ZD;return s(this.JD),this.JD=i(t.length),this.ZD.HEAPU8.set(t,this.JD),h(this.JD,t.length)}uN(t){const{_midi_render:i}=this.ZD;return i(this.$D,t,this.tN,this.sampleRate,this.rN,this.bufferSize,this.oN)}dN(t){if(this.lN(),!this.$D)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.eN);const{setValue:i,getValue:s}=this.ZD;i(this.oN,0,'double'),this.ZD._tsf_reset(this.$D),this.ZD._tsf_channel_set_bank_preset(this.$D,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let h=this.fN(t);const e=()=>{h=this.uN(h);const t=this.cN();this.sN(t),h?this.eN=setTimeout(e,this.QD):this.hN(s(this.oN,'double'))};this.eN=setTimeout(e,16)}};!function(){window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioContext&&(window.audioContext=new window.AudioContext);var t=function(i){if(window.audioContext){var s=window.audioContext.createBuffer(1,1,22050),h=window.audioContext.createBufferSource();h.buffer=s,h.connect(window.audioContext.destination),h.start?h.start(0):h.play?h.play(0):h.noteOn&&h.noteOn(0)}document.removeEventListener('touchstart',t),document.removeEventListener('touchend',t),document.removeEventListener('click',t)};document.addEventListener('touchstart',t),document.addEventListener('touchend',t),document.addEventListener('click',t)}(),(async()=>{const t=2,i=44100;let s=new Float32Array,h=window.audioContext.createGain();h.gain.value=.1,h.connect(window.audioContext.destination);let e=window.audioContext.currentTime,r=[];const o=new n({QD:30,sN:t=>{let i=new Float32Array(t.buffer),h=new Float32Array(s.length+i.length);h.set(s,0),h.set(i,s.length),s=h},hN:t=>{},bufferSize:102400});await o.init();const l=await fetch('./SCC1_Florestan.sf2'),a=new Uint8Array(await l.arrayBuffer());function c(){if(!window.audioContext||!s.length)return;let n=window.audioContext.createBufferSource();const o=s.length/t,l=window.audioContext.createBuffer(t,o,i);for(let i=0;i{t.stop(window.audioContext.currentTime)})),r=[],h.gain.value=t}}function d(t,i){-1!==t&&window._tinyMidiVolume(t),e=window.audioContext.currentTime,f=setInterval(c,250),o.dN(i)}o.aN(a),window._tinyMidiStop=async t=>{t?function(t,i){const s=window.audioContext.currentTime;h.gain.cancelScheduledValues(s),h.gain.setValueAtTime(h.gain.value,s),h.gain.linearRampToValueAtTime(t,s+2),setTimeout(i,2e3)}(0,(()=>{u()})):u()},window._tinyMidiVolume=(t=1)=>{h.gain.value=t},window._tinyMidiPlay=async(t,i,s)=>{t&&(await window._tinyMidiStop(s),s?setTimeout((()=>{d(i,t)}),2e3):d(i,t))}})()},8227:(t,i,s)=>{t.exports=s.p+"9f86b5397894e28b5ae2.wasm"}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var s=n[t]={exports:{}};return e[t](s,s.exports,r),s.exports}r.m=e,t="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",i="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",s="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",h=t=>{t&&t.d<1&&(t.d=1,t.forEach((t=>t.r--)),t.forEach((t=>t.r--?t.r++:t())))},r.a=(e,n,r)=>{var o;r&&((o=[]).d=-1);var l,a,c,f=new Set,u=e.exports,d=new Promise(((t,i)=>{c=i,a=t}));d[i]=u,d[t]=t=>(o&&t(o),f.forEach(t),d.catch((t=>{}))),e.exports=d,n((e=>{var n;l=(e=>e.map((e=>{if(null!==e&&"object"==typeof e){if(e[t])return e;if(e.then){var n=[];n.d=0,e.then((t=>{r[i]=t,h(n)}),(t=>{r[s]=t,h(n)}));var r={};return r[t]=t=>t(n),r}}var o={};return o[t]=t=>{},o[i]=e,o})))(e);var r=()=>l.map((t=>{if(t[s])throw t[s];return t[i]})),a=new Promise((i=>{(n=()=>i(r)).r=0;var s=t=>t!==o&&!f.has(t)&&(f.add(t),t&&!t.d&&(n.r++,t.push(n)));l.map((i=>i[t](s)))}));return n.r?a:r()}),(t=>(t?c(d[s]=t):a(u),h(o)))),o&&o.d<0&&(o.d=0)},r.d=(t,i)=>{for(var s in i)r.o(i,s)&&!r.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:i[s]})},r.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),r.p="/Client2/",r.b=document.baseURI||self.location.href;r(7906)})(); \ No newline at end of file +(()=>{"use strict";var t,i,s,h,e={8793:(t,i,s)=>{s.d(i,{K:()=>N});var h=s(1120),e=s(4583),n=s(1069),r=s(4702);class o{static tt=t=>{let i=0;t=t.toUpperCase();for(let s=0;s=this.st)return null;if(this.ot[t])return this.ot[t];const i=this.rt[t],s=i+this.nt[t];if(this.it){const h=Uint8Array.from(this.buffer.subarray(i,i+s));return this.ot[t]=h,h}{const i=Uint8Array.from(r.A.read(this.et[t],this.buffer,this.nt[t],this.rt[t]));return this.ot[t]=i,i}}}var l=s(8370),a=(s(8902),s(6666)),c=s(198),f=s(818),u=s(670),d=s(8268),w=s(3867),y=s(7854),A=s(8950),p=s(1302),m=s(9298),I=s(8665),E=s(1312),g=s(3819),_=s(8317),C=s(9234),T=s(123),O=s(5637),v=s(6948),b=s(2164),L=s(8738),R=s(3764),S=s(8534),M=s(6730);function k(t,i){var s;(s=document.createElement('a')).href=t,s.download=i,document.body.appendChild(s),s.style='display: none',s.click(),s.remove()}class x{wt=new Map;yt;At=self.isSecureContext?self.crypto.randomUUID():'0';constructor(t){this.yt=t}async It(){const t=new RTCPeerConnection({Et:[{gt:'stun:stun.l.google.com:19302'}]}),i=t.createDataChannel('channel'),s=crypto.randomUUID();this.wt.set(s,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:s})),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.yt&&this.yt.postMessage(i)}}postMessage(t){const i=this.wt.get(t.data.id),s=t.data;s.data&&(s.data=Array.from(t.data.data)),i&&'open'===i.readyState&&i.send(JSON.stringify(s))}}class D{pc;_t=void 0;At;constructor(t){this.pc=new RTCPeerConnection({Et:[{gt:'stun:stun.l.google.com:19302'}]}),this.pc.ondatachannel=i=>{this._t=i.channel,this._t.onopen=()=>{console.log('Connected to host!')},this._t.onerror=t=>{console.error(t)},this._t.onmessage=i=>{if(!this.At){const t=JSON.parse(i.data);if('id'===t.type)return void(this.At=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 Ct(t){await this.pc.setRemoteDescription(new RTCSessionDescription(JSON.parse(t))),await this.pc.setLocalDescription(await this.pc.createAnswer())}}class N extends l.A{static Tt=225;static Ot=10;static portOffset=0;static members=!0;static vt=!1;static bt='';static Lt='';static Rt=!1;static St=2;static Mt=!1;static kt='https://raw.githubusercontent.com/2004scape/Server/main';static exponent=58778699976184461502525193738213253649000149147835990136706041084440742975821n;static xt=7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789n;static Dt=0;static Nt=0;static Pt=0;static Ft=0;static Ut=0;static Bt=0;static Gt=0;static Ht=0;static Wt=0;static Yt=0;static Vt=0;static Kt=0;static Xt=0;static zt=0;static jt=0;static Zt=()=>{c.A.vt=!1,e.A.vt=!1,N.vt=!1,f.A.vt=!1};static qt=()=>{c.A.vt=!0,e.A.vt=!0,N.vt=!0,f.A.vt=!0};$t=2048;Jt=2047;Qt=!1;ti=!1;ii=!1;si=!1;db=null;hi=0;ei=[];stream=null;in=n.A.ni(1);ri=n.A.ni(1);oi=n.A.ni(1);li=0n;ai=0;ci=0;fi=0;ui=null;di=0;packetSize=0;wi=0;yi=0;Ai=0;pi=null;mi=!0;Ii=0;Ei=0;gi=null;_i=null;Ci=null;Ti=null;Oi=null;vi=null;bi=null;Li=null;Ri=null;Si=null;Mi=null;ki='';xi='';username='';password='';Di=null;Ni=null;Pi=null;Fi=null;Ui=[];Bi=!1;Gi=null;Hi=null;Wi=null;Yi=null;Vi=null;Ki=null;Xi=null;zi=null;ji=null;Zi=null;qi=new Int32Array(256);$i=0;Ji=0;Qi=0;ts=null;ss=null;hs=null;es=null;ns=null;rs=null;os=null;ls=null;cs=null;fs=null;us=null;ds=null;ws=null;ys=null;As=null;ps=null;Is=null;Es=null;gs=null;_s=null;Cs=null;Ts=new Int32Array(33);Os=new Int32Array(33);vs=new Int32Array(151);bs=new Int32Array(151);Ls=null;Rs=null;Ss=null;Ms=null;ks=null;xs=null;Ds=new w.Ns(13,null);Ps=null;Fs=null;Us=new w.Ns(50,null);Bs=new w.Ns(50,null);Gs=new w.Ns(20,null);Hs=new w.Ns(20,null);Ws=null;Ys=new w.Ns(8,null);Vs=null;Ks=null;Xs=null;zs=null;js=null;Zs=null;qs=null;$s=null;Js=null;Qs=null;th=null;ih=null;sh=null;hh=null;eh=null;nh=null;rh=null;oh=null;lh=new w.Ns(1e3,null);ah=!1;fh=!1;uh=!1;dh=!1;wh=-1;yh=0;Ah=0;ph=0;mh=0;Ih=0;Eh=0;gh=!1;_h=0;Ch=0;Th=0;Oh=0;bh=0;Lh=0;Rh=[];Sh=-1;Mh=-1;kh=new h.A;xh=78;Dh=0;Nh=0;Ph=[];Fh=0;Uh=0;Bh=0;Gh=0;Hh=0;Wh=0;Yh=0;Vh=0;Kh=[];Xh=[];zh=[];jh=[];Zh=null;qh=-1;$h=3;Jh=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];Qh=0;te=0;ie=0;se=!1;he=0;ee=!1;ne='';re='';oe=0;le='';ae=!1;ce=-1;fe=new w.Ns(100,null);ue=new w.Ns(100,null);messageType=new Int32Array(100);de=new Int32Array(100);we=0;ye=0;Ae=0;pe='';me=0;Ie=0;Ee=0;ge=0;_e=0;Ce=0;Te=0;Oe=0;ve=0;be=!1;Le=0;Re=0;Se=0;Me=0;ke=null;xe=0;De=0;Ne=0;Pe=0;Fe=!1;Ue=[];Be=[];Ge=0;He=0;We=0;Ye=null;Ve=0;Ke=new Int32Array(500);Xe=new Int32Array(500);ze=new Int32Array(500);je=new Int32Array(500);Ze=0;qe=0;$e=0;Je='';Qe=!1;tn=-1;sn=0;hn=0;en=0;nn=0;rn=0;ln=new Int32Array(1e3);an=new Int32Array(1e3);cn=null;fn=0;un=0;dn=0;wn=0;yn=0;An=!1;pn=0;mn=0;In=0;En=0;gn=2;_n=2;Cn=1;Tn=new Int32Array(5);On=new w.Ns(5,!1);vn=new Int32Array(5);bn=new Int32Array(5);Ln=new Int32Array(5);Rn=0;Sn=0;Mn=0;kn=0;xn=0;Dn=0;Nn=0;Pn=0;Fn=0;Un=1;Bn=2;Gn=-1;Hn=0;Wn=0;Yn=0;Vn=0;Kn=0;Xn=0;zn=null;jn=null;Zn=null;qn=0;$n=0;Jn=new Int8Array(16384);Qn=new w.Ns(u.A.tr,null);ir=0;sr=0;hr=128;er=0;nr=0;rr=0;lr=0;ar=0;cr=null;ur=null;dr=new w.wr(u.A.yr,u.A.yr);Ar=0;pr=0;mr=0;Ir=0;Er=0;gr=0;_r=0;Cr=0;Tr=0;Or=0;vr=0;br=0;Lr=new w.Ns(this.$t,null);Rr=0;Sr=new Int32Array(this.$t);Mr=0;kr=0;Dr=new Int32Array(this.$t);Nr=new Int32Array(1e3);Pr=new w.Ns(this.$t,null);Fr=new w.Ns(8192,null);Ur=0;Br=new Int32Array(8192);Gr=new a.A;Hr=new a.A;Wr=new a.A;Yr=new a.A;Vr=new w.Kr(u.A.tr,u.A.yr,u.A.yr,null);Xr=new a.A;zr=new Int32Array(4e3);jr=new Int32Array(4e3);Zr=new Int32Array(u.A.yr*u.A.yr);qr=new Int32Array(u.A.yr*u.A.yr);$r=0;Jr=null;Qr=0;io=0;so=-1;ho=0;eo=0;no=0;ro=0;oo=!1;lo=!0;ao=!1;co=new Int32Array(7);fo=new Int32Array(5);uo=0;do=0;static wo=50;yo=new Int32Array(N.wo);Ao=new Int32Array(N.wo);po=new Int32Array(N.wo);mo=new Int32Array(N.wo);Io=new Int32Array(N.wo);Eo=new Int32Array(N.wo);_o=new Int32Array(N.wo);Co=new w.Ns(N.wo,null);To=new w.Ns(100,null);Oo=new BigInt64Array(100);vo=new Int32Array(100);bo=null;Lo=0;Ro=!0;So=new Int32Array(50);Mo=new Int32Array(50);ko=new Int32Array(50);xo=192;Do=-1;No=-1;Po=0;Fo=0;Uo=0;Bo=!0;Go=null;Ho=0;Wo=0;Yo=192;yt=void 0;Vo=!1;host=null;Ko=null;Xo=new w.Ns(16,null);zo=0;jo=!1;Zo=()=>{try{this.stream&&this.stream.close()}catch(t){}this.Ko&&'998'===N.getParameter('world')&&this.Ko._t?.send(JSON.stringify({type:'close',id:this.Ko.At})),this.stream=null,(0,T.qo)(!1),this.ri=null,this.oi=null,this.in=null,this.Zn=null,this.zn=null,this.jn=null,this.cr=null,this.ur=null,this.cn=null,this.Qn=null,this.Zr=null,this.qr=null,this.zr=null,this.jr=null,this.Jn=null,this.ss=null,this.hs=null,this.es=null,this.ns=null,this.rs=null,this.os=null,this.ls=null,this.cs=null,this.fs=null,this.us=null,this.ds=null,this.ws=null,this.ys=null,this.As=null,this.ps=null,this.Is=null,this.Es=null,this.Ls=null,this.Ss=null,this.Rs=null,this.Ms=null,this.ks=null,this.xs=null,this.Ds=null,this.qs=null,this.$s=null,this.Js=null,this.Qs=null,this.th=null,this.ih=null,this.sh=null,this.hh=null,this.eh=null,this.nh=null,this.Fs=null,this.Gs=null,this.Hs=null,this.Ys=null,this.Vs=null,this.Ks=null,this.Xs=null,this.zs=null,this.Us=null,this.Bs=null,this.dr=null,this.Lr=null,this.Sr=null,this.Dr=null,this.Pr=null,this.Nr=null,this.Fr=null,this.Br=null,this.Vr=null,this.Xr=null,this.Yr=null,this.Gr=null,this.Hr=null,this.Wr=null,this.ze=null,this.je=null,this.Ke=null,this.Xe=null,this.Rh=null,this.Ue=null,this.ln=null,this.an=null,this.lh=null,this.Ps=null,this.To=null,this.Oo=null,this.vo=null,this.Ti=null,this.Oi=null,this.gi=null,this._i=null,this.Ci=null,this.vi=null,this.bi=null,this.Li=null,this.Ri=null,this.$o(),O.A.Zo(),v.A.Zo(),p.A.Zo(),b.A.Jo=null,_.A.Jo=null,h.A.Jo=null,E.A.Jo=null,L.A.Jo=null,L.A.Qo=null,R.A.Jo=null,this.tl=null,d.A.Qo=null,e.A.Zo(),c.A.Zo(),I.A.Zo(),S.A.Jo=[],M.A.Jo=[]};il(){return this.Ii}sl(){return this.ae}hl(){return this.ee}el(){return this.Mh}nl(){return this.wh}$o=()=>{this.Bi=!1,this.ts&&(clearInterval(this.ts),this.ts=null),this.Si=null,this.Mi=null,this.Ui=[],this.Xi=null,this.zi=null,this.ji=null,this.Zi=null,this.Yi=null,this.Wi=null,this.Vi=null,this.Ki=null,this.Gi=null,this.Hi=null};rl=()=>{'999'===N.getParameter('world')?(this.yt=new Worker('worker.js',{type:'module'}),this.yt.onmessage=this.onmessage,this.host=new x(this.yt)):'998'===N.getParameter('world')&&(this.yt={onmessage:t=>{this.stream.ol.onmessage(t)},postMessage:t=>{this.Ko&&this.Ko._t&&'open'===this.Ko._t.readyState&&this.Ko._t.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.Ko=new D(this.yt))};onmessage=t=>{switch(t.data.type){case'ready':return void(this.Vo=!0);case'save':return k(t.data.value,t.data.path.split('/').pop().split('\\').pop()),void URL.revokeObjectURL(t.data.value);case'close':return void this.yt?.postMessage({type:'close',id:t.data.id})}this.host?.At===t.data.id?this.stream.ol.onmessage(t.data):this.host?.postMessage(t)};ll=async()=>{if(999==+N.getParameter('world'))this.host&&await this.host.It();else if(998==+N.getParameter('world')&&this.Ko){if(this.Ko._t)return void console.log('You are already connected.');let t;try{for(;null===(t=prompt('Paste offer here, answer will be copied to clipboard')););await this.Ko.Ct(t)}catch(t){console.error(t)}}};al=async(t,i,s,h)=>{let e=5,r=await(this.db?.cl(t));if(r&&n.A.fl(r)!==s&&(r=void 0),r)return new o(r);for(;!r;){await this.ul(h,`Requesting ${i}`);try{r=+N.getParameter('world')<998?await(0,C.dl)(`${N.Lt}/${t}${s}`):await(0,C.dl)(`${N.Lt}/${t}`)}catch(t){r=void 0;for(let t=e;t>0;t--)await this.ul(h,`Error loading - Will retry in ${t} secs.`),await(0,C.wl)(1e3);e*=2,e>60&&(e=60)}}return await(this.db?.yl(t,r)),new o(r)};Al=async(t,i,s,h)=>{let e=await(this.db?.cl(t+'.mid'));if(e&&12345678!==i&&n.A.fl(e)!==i&&(e=void 0),!e)try{e=+N.getParameter('world')<998?await(0,C.dl)(`${N.Lt}/${t}_${i}.mid`):await(0,C.dl)(`${N.Lt}/songs/${t}.mid`),s!==e.length&&(e=e.slice(0,s))}catch(t){}if(!e)return;await(this.db?.yl(t+'.mid',e));const o=new n.A(Uint8Array.from(e)).ut,l=r.A.read(o,e,s,4);(0,T.pl)(l,this.Yo,h)};ml=()=>{if(y.Il.fillStyle='black',y.Il.fillRect(0,0,this.width,this.height),this.El(1),this.ii){this.Bi=!1,y.Il.font='bold 16px helvetica, sans-serif',y.Il.textAlign='left',y.Il.fillStyle='yellow';let t=35;y.Il.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,y.Il.fillStyle='white',y.Il.fillText('To fix this try the following (in order):',30,t),t+=50,y.Il.font='bold 12px helvetica, sans-serif',y.Il.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,y.Il.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,y.Il.fillText('3: Try using a different game-world',30,t),t+=30,y.Il.fillText('4: Try rebooting your computer',30,t),t+=30,y.Il.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.si&&(this.Bi=!1,y.Il.font='bold 20px helvetica, sans-serif',y.Il.textAlign='left',y.Il.fillStyle='white',y.Il.fillText('Error - unable to load game!',50,50),y.Il.fillText('To play RuneScape make sure you play from',50,100),y.Il.fillText('https://2004scape.org',50,150)),this.ti){this.Bi=!1,y.Il.font='bold 13px helvetica, sans-serif',y.Il.textAlign='left',y.Il.fillStyle='yellow';let t=35;y.Il.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,y.Il.fillStyle='white',y.Il.fillText('To fix this try the following (in order):',30,t),t+=50,y.Il.font='bold 12px helvetica, sans-serif',y.Il.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,y.Il.fillText('2: Try rebooting your computer, and reloading',30,t)}};gl=t=>{if(!t._l)return!1;for(let i=0;i=h)return!1}else if(3===t._l[i]){if(s<=h)return!1}else if(4===t._l[i]){if(s===h)return!1}else if(s!==h)return!1}return!0};Ol=(t,i,s,h,e)=>{this.js?.draw(t,i),this.Zs?.draw(t,i+e-16),A.A.fillRect(t,i+16,16,e-32,m.A.vl);let n=(e-32)*e/h|0;n<8&&(n=8);const r=(e-n-32)*s/(h-e)|0;A.A.fillRect(t,i+r+16,16,n,m.A.bl),A.A.Ll(t,i+r+16,m.A.Rl,n),A.A.Ll(t+1,i+r+16,m.A.Rl,n),A.A.Sl(t,i+r+16,m.A.Rl,16),A.A.Sl(t,i+r+17,m.A.Rl,16),A.A.Ll(t+15,i+r+16,m.A.Ml,n),A.A.Ll(t+14,i+r+17,m.A.Ml,n-1),A.A.Sl(t,i+r+n+15,m.A.Ml,16),A.A.Sl(t+1,i+r+n+14,m.A.Ml,15)};kl=(t,i)=>{let s=!1;const e=h.A.Jo[t];if(!e.xl)return!1;for(let t=0;th.delay[n.Fl];)n.Pl-=h.delay[n.Fl]+1,n.Fl++,n.Fl>=h.Ul&&(n.Fl-=h.Bl,(n.Fl<0||n.Fl>=h.Ul)&&(n.Fl=0)),s=!0}}}return s};Gl=(t,i,s,n,r=!1)=>{if(0!==t.type||!t.xl||t.hide&&this.me!==t.id&&this.Ie!==t.id&&this.Ee!==t.id)return;const o=A.A.left,l=A.A.top,a=A.A.right,c=A.A.bottom;A.A.Hl(i,s,i+t.width,s+t.height);const f=t.xl.length;for(let o=0;o0&&this.zl(c),c.type===h.A.jl)c.Zl>c.scroll-c.height&&(c.Zl=c.scroll-c.height),c.Zl<0&&(c.Zl=0),this.Gl(c,l,a,c.Zl,r),c.scroll>c.height&&this.Ol(l+c.width,a,c.Zl,c.scroll,c.height);else if(c.type===h.A.ql){let t=0;for(let i=0;i0){let i=0,s=0;const n=c.Ql[t]-1;if(h>=-32&&h<=512&&e>=-32&&e<=334||0!==this.Ce&&this._e===t){const r=p.A.ha(n,c.ta[t]);if(0!==this.Ce&&this._e===t&&this.ge===c.id?(i=this.ea-this.Te,s=this.na-this.Oe,i<5&&i>-5&&(i=0),s<5&&s>-5&&(s=0),this.ve<5&&(i=0,s=0),r.ra(128,h+i,e+s)):0!==this.xe&&this.De===t&&this.Ne===c.id?r.ra(128,h,e):r.draw(h,e),33===r.oa||1!==c.ta[t]){const n=c.ta[t];this.Di?.la(h+i+1,e+10+s,this.aa(n),m.A.ca),this.Di?.la(h+i,e+9+s,this.aa(n),m.A.fa)}}}else if(c.ua&&t<20){const i=c.ua[t];i?.draw(h,e)}t++}}else if(c.type===h.A.da)c.fill?A.A.fillRect(l,a,c.width,c.height,c.wa):A.A.Vl(l,a,c.width,c.height,c.wa);else if(c.type===h.A.ya){const t=c.font;let i=c.wa,s=c.text;if(this.Ee!==c.id&&this.Ie!==c.id&&this.me!==c.id||0===c.Aa||(i=c.Aa),this.gl(c)&&(i=c.pa,c.ma&&c.ma.length>0&&(s=c.ma)),c.Ia===h.A.Ea&&this.Fe&&(s='Please wait...',i=c.wa),!t||!s)continue;for(let h=a+t.height;s.length>0;h+=t.height){if(-1!==s.indexOf('%')){for(;;){const t=s.indexOf('%1');if(-1===t)break;s=s.substring(0,t)+this.ga(this.Cl(c,0))+s.substring(t+2)}for(;;){const t=s.indexOf('%2');if(-1===t)break;s=s.substring(0,t)+this.ga(this.Cl(c,1))+s.substring(t+2)}for(;;){const t=s.indexOf('%3');if(-1===t)break;s=s.substring(0,t)+this.ga(this.Cl(c,2))+s.substring(t+2)}for(;;){const t=s.indexOf('%4');if(-1===t)break;s=s.substring(0,t)+this.ga(this.Cl(c,3))+s.substring(t+2)}for(;;){const t=s.indexOf('%5');if(-1===t)break;s=s.substring(0,t)+this.ga(this.Cl(c,4))+s.substring(t+2)}}const e=s.indexOf('\\n');let n;-1!==e?(n=s.substring(0,e),s=s.substring(e+2)):(n=s,s=''),c._a?t.Ca(l+(c.width/2|0),h,n,i,c.Ta):t.Oa(l,h,n,i,c.Ta)}}else if(c.type===h.A.va){let t;t=this.gl(c)?c.ba:c.La,t?.draw(l,a)}else if(c.type===h.A.Ra){const t=e.A.Sa,i=e.A.Ma;e.A.Sa=l+(c.width/2|0),e.A.Ma=a+(c.height/2|0);const s=e.A.sin[c.ka]*c.zoom>>16,h=e.A.cos[c.ka]*c.zoom>>16,n=this.gl(c);let r;r=n?c.Nl:c.Dl;let o=null;if(-1===r)o=c.xa(-1,-1,n);else{const t=E.A.Jo[r];t.frames&&t.Da&&(o=c.xa(t.frames[c.Fl],t.Da[c.Fl],n))}o&&o.Na(0,c.Pa,0,c.ka,0,s,h),e.A.Sa=t,e.A.Ma=i}else if(c.type===h.A.Fa){const t=c.font;if(!t||!c.Ql||!c.ta)continue;let i=0;for(let s=0;s0){const e=p.A.get(c.Ql[i]-1);let n=e.name;if((e.Ua||1!==c.ta[i])&&(n=n+' x'+this.Ba(c.ta[i])),!n)continue;const r=l+h*(c.ia+115),o=a+s*(c.sa+12);c._a?t.Ca(r+(c.width/2|0),o,n,c.wa,c.Ta):t.Oa(r,o,n,c.wa,c.Ta)}i++}}}A.A.Hl(o,l,a,c)};zl=t=>{let i=t.Xl;if(i>=h.A.Ga&&i<=h.A.Ha)i--,i>=this.uo?(t.text='',t.Ia=0):(t.text=this.To[i],t.Ia=1);else if(i>=h.A.Wa&&i<=h.A.Ya)i-=h.A.Wa,i>=this.uo?(t.text='',t.Ia=0):(0===this.vo[i]?t.text='@red@Offline':this.vo[i]===N.Ot?t.text='@gre@World-'+(this.vo[i]-9):t.text='@yel@World-'+(this.vo[i]-9),t.Ia=1);else if(i===h.A.Va)t.scroll=15*this.uo+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i>=h.A.Ka&&i<=h.A.Xa)i-=h.A.Ka,i>=this.Nh?(t.text='',t.Ia=0):(t.text=g.A.za(g.A.ja(this.Ph[i])),t.Ia=1);else if(i===h.A.Za)t.scroll=15*this.Nh+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i===h.A.qa){if(t.ka=150,t.Pa=256*Math.sin(this.hi/40)&2047,this.ao){this.ao=!1;const i=new w.Ns(7,null);let s=0;for(let t=0;t<7;t++){const h=this.co[t];h>=0&&(i[s++]=_.A.Jo[h].xa())}const h=I.A.$a(i,s);for(let t=0;t<5;t++)0!==this.fo[t]&&(h.Ja(d.A.Qa[t][0],d.A.Qa[t][this.fo[t]]),1===t&&h.Ja(d.A.tc[0],d.A.tc[this.fo[t]]));if(this.Jr){const i=E.A.Jo[this.Jr.ic].frames;i&&(h.sc(),h.hc(i[0]),h.ec(64,850,-30,-50,-30,!0),t.model=h)}}}else if(i===h.A.nc)this.rh||(this.rh=t.La,this.oh=t.ba),this.lo?t.La=this.oh:t.La=this.rh;else if(i===h.A.rc)this.rh||(this.rh=t.La,this.oh=t.ba),this.lo?t.La=this.rh:t.La=this.oh;else if(i===h.A.oc)t.text=this.Je,this.hi%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(i===h.A.lc)this.oo?this.Qe?(t.wa=m.A.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.wa=m.A.Kl,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(i===h.A.ac||i===h.A.cc)if(0===this.sn)t.text='';else{let i;i=0===this.hn?'earlier today':1===this.hn?'yesterday':this.hn+' days ago',t.text='You last logged in '+i+' from: '+g.A.fc(this.sn)}else if(i===h.A.uc)0===this.nn&&(t.text='0 unread messages',t.wa=m.A.fa),1===this.nn&&(t.text='1 unread message',t.wa=m.A.GREEN),this.nn>1&&(t.text=this.nn+' unread messages',t.wa=m.A.GREEN);else if(i===h.A.dc)if(201===this.en)t.text='';else if(200===this.en)t.text='You have not yet set any password recovery questions.';else{let i;i=0===this.en?'Earlier today':1===this.en?'Yesterday':this.en+' days ago',t.text=i+' you changed your recovery questions'}else i===h.A.wc?201===this.en?t.text='':200===this.en?t.text='We strongly recommend you do so now to secure your account.':t.text='If you do not remember making this change then cancel it immediately':i===h.A.yc&&(201===this.en?t.text='':(this.en,t.text="Do this from the 'account management' area on our front webpage"))};Cl=(t,i)=>{if(!t.scripts||i>=t.scripts.length)return-2;try{const s=t.scripts[i];if(!s)return-1;let e=0,n=0;for(;;){const t=s[n++];if(0===t)return e;if(1===t)e+=this.Xh[s[n++]];else if(2===t)e+=this.zh[s[n++]];else if(3===t)e+=this.Kh[s[n++]];else if(4===t){const t=h.A.Jo[s[n++]],i=s[n++]+1;if(t.Ql&&t.ta)for(let s=0;st<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};aa=t=>t<1e5?String(t):t<1e7?(t/1e3|0)+'K':(t/1e6|0)+'M'}},7604:(t,i,s)=>{s.d(i,{w:()=>r});var h=s(8370),e=s(8793),n=s(9234);async function r(){await async function(){0===h.A.getParameter('world').length&&h.A.setParameter('world','1');['0','998','999'].includes(h.A.getParameter('world'))?function(){if(+h.A.getParameter('world')>=998)return void(e.K.Lt='data/pack/client');e.K.bt='http://localhost',e.K.Lt='http://localhost',e.K.portOffset=0}():await async function(t){const i=await o(t,parseInt(h.A.getParameter('world'),10)),s=new URL(i.address);e.K.Ot=10+i.id-1,e.K.bt=`${s.protocol}//${s.hostname}`,e.K.Lt=`${s.protocol}//${s.hostname}:${s.port}`,t||(e.K.bt=e.K.bt.replace('https:','http:'));e.K.portOffset=i.portOffset,e.K.members=!0===i?.members,h.A.setParameter('world',i.id.toString(10))}(window.location.protocol.startsWith('https'))}(),function(){0===h.A.getParameter('detail').length&&h.A.setParameter('detail','high');'low'===h.A.getParameter('detail')?e.K.qt():e.K.Zt()}(),0===h.A.getParameter('method').length&&h.A.setParameter('method','0')}async function o(t,i,s=0){if(s>=10)throw new Error('could not find world to connect!');const h=t?'https:':'http:';let e;try{e=JSON.parse(await(0,n.mc)(`${h}//2004scape.org/api/v1/worldlist`))}catch(h){return await(0,n.wl)(1e3),o(t,i,++s)}e.push({id:0,region:'Local Development',address:'http://localhost',portOffset:0,members:!0,Lr:0});const r=e.find((t=>t.id===i));return r||o(t,i,10)}},7906:(t,i,s)=>{s.a(t,(async(t,i)=>{try{var h=s(1312),e=s(5637),n=s(1302),r=s(6948),o=s(8317),l=s(8738),a=s(3764),c=s(1120),f=s(1183),u=s(8950),d=s(4583),w=s(1673),y=s(1122),A=s(2682),p=s(8665),m=s(9298),I=s(1069),E=s(3554),g=s(353),_=s(2634),C=s(4544),T=s(2215),O=s(3955),v=s(7953),b=s(2646),L=s(3937),R=(s(8902),s(4702)),S=s(6666),M=s(3819),k=s(2595),x=s(198),D=s(818),N=s(5599),P=s(1023),F=s(6169),U=s(2630),B=s(5327),G=s(670),H=s(9456),W=s(8268),Y=s(8412),V=s(3606),K=s(4197),X=s(254),z=s(7628),j=s(123),Z=s(9234),q=s(3867),$=s(8793),J=s(8534),Q=s(6730),tt=s(2164),it=s(7604),st=s(3795),ht=s(4909),et=s(296);class t extends $.K{load=async()=>{if(this.Qt)this.ti=!0;else{this.Qt=!0;try{this.rl(),await this.ul(10,'Connecting to fileserver'),await R.A.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new C.A(await C.A.openDatabase());const t=new I.A(new Uint8Array(await(0,Z.dl)(`${$.K.Lt}/crc`)));for(let i=0;i<9;i++)this.ei[i]=t.ut;$.K.vt||await this.Al('scape_main',12345678,4e4,!1);const i=await this.al('title','title screen',this.ei[1],10);this.pi=i,this.Di=A.A.Ic(i,'p11'),this.Ni=A.A.Ic(i,'p12'),this.Pi=A.A.Ic(i,'b12'),this.Fi=A.A.Ic(i,'q8'),await this.Ec(),this.gc();const s=await this.al('config','config',this.ei[2],15),u=await this.al('interface','interface',this.ei[3],20),m=await this.al('media','2d graphics',this.ei[4],30),E=await this.al('models','3d graphics',this.ei[5],40),g=await this.al('textures','textures',this.ei[6],60),_=await this.al('wordenc','chat system',this.ei[7],65),T=await this.al('sounds','sound effects',this.ei[8],70);this.ur=new q._c(G.A.tr,G.A.yr,G.A.yr),this.cr=new q.Cc(G.A.tr,G.A.yr+1,G.A.yr+1),this.cr&&(this.cn=new x.A(this.cr,G.A.yr,G.A.tr,G.A.yr));for(let t=0;t34||t>34))999===i&&(i=h);else if(999!==i){s=h;break}this.vs[t-9]=i-21,this.bs[t-9]=s-i}d.A.kc(479,96),this.gs=d.A.xc,d.A.kc(190,261),this._s=d.A.xc,d.A.kc(512,334),this.Cs=d.A.xc;const V=new Int32Array(9);for(let t=0;t<9;t++){const i=32*t+128+15,s=3*i+600,h=d.A.sin[i];V[t]=s*h>>16}x.A.init(512,334,500,800,V),v.A.Sc(_),this.Dc()}catch(t){console.error(t),this.ii=!0}}};update=async()=>{this.ti||this.ii||this.si||(this.hi++,this.Nc?await this.Pc():await this.Fc())};draw=async()=>{this.ti||this.ii||this.si?this.ml():(this.Nc?this.Uc():await this.Bc(),this.yh=0)};refresh=()=>{this.mi=!0};ul=async(t,i)=>{if(console.log(`${t}%: ${i}`),await this.Gc(),!this.pi)return void await super.ul(t,i);this.Ci?.bind();this.Pi?.Hc(180,54,'RuneScape is loading - please wait...',m.A.Kl);u.A.Vl(28,62,304,34,m.A.Wc),u.A.Vl(29,63,302,32,m.A.ca),u.A.fillRect(30,64,3*t,30,m.A.Wc),u.A.fillRect(30+3*t,64,300-3*t,30,m.A.ca),this.Pi?.Hc(180,85,i,m.A.Kl),this.Ci?.draw(214,186),this.mi&&(this.mi=!1,this.Bi||(this.Ti?.draw(0,0),this.Oi?.draw(661,0)),this.gi?.draw(128,0),this._i?.draw(214,386),this.vi?.draw(0,265),this.bi?.draw(574,265),this.Li?.draw(128,186),this.Ri?.draw(574,186)),await(0,Z.wl)(5)};Yc=()=>{this.Bi&&(this.Vc(),this.Vc(),this.Kc())};Gc=async()=>{this.gi||(this.tl=null,this.ns=null,this.hs=null,this.ss=null,this.es=null,this.rs=null,this.os=null,this.ls=null,this.Ti=new f.A(128,265),u.A.clear(),this.Oi=new f.A(128,265),u.A.clear(),this.gi=new f.A(533,186),u.A.clear(),this._i=new f.A(360,146),u.A.clear(),this.Ci=new f.A(360,200),u.A.clear(),this.vi=new f.A(214,267),u.A.clear(),this.bi=new f.A(215,267),u.A.clear(),this.Li=new f.A(86,79),u.A.clear(),this.Ri=new f.A(87,79),u.A.clear(),this.pi&&(await this.Ec(),this.gc()),this.mi=!0)};Ec=async()=>{if(!this.pi)return;const t=await y.A.Xc(this.pi,'title');this.Ti?.bind(),t.vc(0,0),this.Oi?.bind(),t.vc(-661,0),this.gi?.bind(),t.vc(-128,0),this._i?.bind(),t.vc(-214,-386),this.Ci?.bind(),t.vc(-214,-186),this.vi?.bind(),t.vc(0,-265),this.bi?.bind(),t.vc(-128,-186),this.Li?.bind(),t.vc(-128,-186),this.Ri?.bind(),t.vc(-574,-186),t.Tc(),this.Ti?.bind(),t.vc(394,0),this.Oi?.bind(),t.vc(-267,0),this.gi?.bind(),t.vc(266,0),this._i?.bind(),t.vc(180,-386),this.Ci?.bind(),t.vc(180,-186),this.vi?.bind(),t.vc(394,-265),this.bi?.bind(),t.vc(-180,-265),this.Li?.bind(),t.vc(212,-186),this.Ri?.bind(),t.vc(-180,-186);const i=y.A.Ic(this.pi,'logo');this.gi?.bind(),i.draw((this.width/2|0)-(i.width/2|0)-128,18)};zc=t=>{if(!this.Yi||!this.Wi)return;this.Yi.fill(0);for(let t=0;t<5e3;t++){const t=128*Math.random()*256|0;this.Yi[t]=256*Math.random()|0}for(let t=0;t<20;t++){for(let t=1;t<255;t++)for(let i=1;i<127;i++){const s=i+(t<<7);this.Wi[s]=(this.Yi[s-1]+this.Yi[s+1]+this.Yi[s-128]+this.Yi[s+128])/4|0}const t=this.Yi;this.Yi=this.Wi,this.Wi=t}if(t){let i=0;for(let s=0;s{if(this.pi){this.Si=w.A.Ic(this.pi,'titlebox'),this.Mi=w.A.Ic(this.pi,'titlebutton');for(let t=0;t<12;t++)this.Ui[t]=w.A.Ic(this.pi,'runes',t);this.Gi=new y.A(128,265),this.Hi=new y.A(128,265),this.Ti&&(0,Z.qc)(this.Ti.Mc,0,this.Gi.Mc,0,33920),this.Oi&&(0,Z.qc)(this.Oi.Mc,0,this.Hi.Mc,0,33920),this.zi=new Int32Array(256);for(let t=0;t<64;t++)this.zi[t]=262144*t;for(let t=0;t<64;t++)this.zi[t+64]=1024*t+m.A.RED;for(let t=0;t<64;t++)this.zi[t+128]=4*t+m.A.fa;for(let t=0;t<64;t++)this.zi[t+192]=m.A.Kl;this.ji=new Int32Array(256);for(let t=0;t<64;t++)this.ji[t]=1024*t;for(let t=0;t<64;t++)this.ji[t+64]=4*t+m.A.GREEN;for(let t=0;t<64;t++)this.ji[t+128]=262144*t+m.A.$c;for(let t=0;t<64;t++)this.ji[t+192]=m.A.Kl;this.Zi=new Int32Array(256);for(let t=0;t<64;t++)this.Zi[t]=4*t;for(let t=0;t<64;t++)this.Zi[t+64]=262144*t+m.A.BLUE;for(let t=0;t<64;t++)this.Zi[t+128]=1024*t+m.A.Jc;for(let t=0;t<64;t++)this.Zi[t+192]=m.A.Kl;this.Xi=new Int32Array(256),this.Yi=new Int32Array(32768),this.Wi=new Int32Array(32768),this.zc(null),this.Vi=new Int32Array(32768),this.Ki=new Int32Array(32768),this.ul(10,'Connecting to fileserver').then((()=>{this.Bi||(this.Bi=!0,this.ts=setInterval(this.Yc,35))}))}};Fc=async()=>{if(0===this.Ii){let t=(this.width/2|0)-80,i=20+(this.height/2|0);if(i+=20,1===this.Qc&&this.tf>=t-75&&this.tf<=t+75&&this.if>=i-20&&this.if<=i+20){if(+$.K.getParameter('world')>=998)return void this.ll();this.Ii=3,this.Ei=0}t=80+(this.width/2|0),1===this.Qc&&this.tf>=t-75&&this.tf<=t+75&&this.if>=i-20&&this.if<=i+20&&(this.ki='',this.xi='Enter your username & password.',this.Ii=2,this.Ei=0)}else if(2===this.Ii){let t=(this.height/2|0)-40;t+=30,t+=25,1===this.Qc&&this.if>=t-15&&this.if=t-15&&this.if=i-75&&this.tf<=i+75&&this.if>=s-20&&this.if<=s+20&&await this.sf(this.username,this.password,!1),i=80+(this.width/2|0),1===this.Qc&&this.tf>=i-75&&this.tf<=i+75&&this.if>=s-20&&this.if<=s+20&&(this.Ii=0,this.username='',this.password='');;){const t=this.hf();if(-1===t)return;let i=!1;for(let s=0;s0&&(this.username=this.username.substring(0,this.username.length-1)),9!==t&&10!==t&&13!==t||(this.Ei=1),i&&(this.username=this.username+String.fromCharCode(t)),this.username.length>12&&(this.username=this.username.substring(0,12))):1===this.Ei&&(8===t&&this.password.length>0&&(this.password=this.password.substring(0,this.password.length-1)),9!==t&&10!==t&&13!==t||(this.Ei=0),i&&(this.password=this.password+String.fromCharCode(t)),this.password.length>20&&(this.password=this.password.substring(0,20)))}}else if(3===this.Ii){const t=this.width/2|0;let i=50+(this.height/2|0);i+=20,1===this.Qc&&this.tf>=t-75&&this.tf<=t+75&&this.if>=i-20&&this.if<=i+20&&(this.Ii=0)}};Bc=async()=>{await this.Gc(),this.Ci?.bind(),this.Si?.draw(0,0);if(0===this.Ii){let t=180,i=80;this.Pi?.Ca(t,i,'Welcome to RuneScape',m.A.fa,!0),t=100,i=120,this.Mi?.draw(t-73,i-20),this.Pi?.Ca(t,i+5,'New user',m.A.Kl,!0),t=260,this.Mi?.draw(t-73,i-20),this.Pi?.Ca(t,i+5,'Existing User',m.A.Kl,!0)}else if(2===this.Ii){let t=100,i=60;this.ki.length>0?(this.Pi?.Ca(180,i-15,this.ki,m.A.fa,!0),this.Pi?.Ca(180,i,this.xi,m.A.fa,!0),i+=30):(this.Pi?.Ca(180,i-7,this.xi,m.A.fa,!0),i+=30),this.Pi?.Oa(90,i,`Username: ${this.username}${0===this.Ei&&this.hi%40<20?'@yel@|':''}`,m.A.Kl,!0),i+=15,this.Pi?.Oa(92,i,`Password: ${M.A.nf(this.password)}${1===this.Ei&&this.hi%40<20?'@yel@|':''}`,m.A.Kl,!0),i=150,this.Mi?.draw(t-73,i-20),this.Pi?.Ca(t,i+5,'Login',m.A.Kl,!0),t=260,this.Mi?.draw(t-73,i-20),this.Pi?.Ca(t,i+5,'Cancel',m.A.Kl,!0)}else if(3===this.Ii){this.Pi?.Ca(180,40,'Create a free account',m.A.fa,!0);const t=180;let i=65;this.Pi?.Ca(180,i,'To create a new account you need to',m.A.Kl,!0),i+=15,this.Pi?.Ca(180,i,'go back to the main RuneScape webpage',m.A.Kl,!0),i+=15,this.Pi?.Ca(180,i,"and choose the red 'create account'",m.A.Kl,!0),i+=15,this.Pi?.Ca(180,i,'button at the top right of that page.',m.A.Kl,!0),i=150,this.Mi?.draw(t-73,i-20),this.Pi?.Ca(t,i+5,'Cancel',m.A.Kl,!0)}this.Ci?.draw(214,186),this.mi&&(this.mi=!1,this.gi?.draw(128,0),this._i?.draw(214,386),this.vi?.draw(0,265),this.bi?.draw(574,265),this.Li?.draw(128,186),this.Ri?.draw(574,186))};sf=async(i,s,h)=>{try{if(h||(this.ki='',this.xi='Connecting to server...',await this.Bc()),'998'===t.getParameter('world')){if(this.Ko&&!this.Ko._t)return this.ki='You are not connected to a host.',void(this.xi='Please try using world 999.');this.stream=new et.A(this.yt,this.Ko.At)}else if('999'===t.getParameter('world')){if(!this.Vo)return this.ki='The server is starting up.',void(this.xi='Please try again in a moment.');this.stream=new et.A(this.yt,this.host.At)}else this.stream=new E.A(await E.A.rf({host:$.K.bt,port:43594+$.K.portOffset}));await this.stream.lf(this.in.data,0,8),this.in.ft=0,this.li=this.in.af;const e=new Int32Array([Math.floor(99999999*Math.random()),Math.floor(99999999*Math.random()),Number(this.li>>32n),Number(this.li&BigInt(4294967295))]);this.ri.ft=0,this.ri.p1(10),this.ri.p4(e[0]),this.ri.p4(e[1]),this.ri.p4(e[2]),this.ri.p4(e[3]),this.ri.p4(0),this.ri.cf(i),this.ri.cf(s),this.ri.ff($.K.xt,$.K.exponent),this.oi.ft=0,h?this.oi.p1(18):this.oi.p1(16),this.oi.p1(this.ri.ft+36+1+1),this.oi.p1($.K.Tt),this.oi.p1($.K.vt?1:0);for(let t=0;t<9;t++)this.oi.p4(this.ei[t]);this.oi.uf(this.ri.data,this.ri.ft,0),this.ri.random=new _.A(e);for(let t=0;t<4;t++)e[t]+=50;this.ui=new _.A(e),this.stream?.write(this.oi.data,this.oi.ft);const n=await this.stream.read();if(1===n)return await(0,Z.wl)(2e3),void await this.sf(i,s,h);if(2===n||18===n){this.oo=18===n,k.A.df(),this.Nc=!0,this.ri.ft=0,this.in.ft=0,this.di=-1,this.wi=-1,this.yi=-1,this.Ai=-1,this.packetSize=0,this.ai=0,this.fi=0,this.ci=0,this.Fh=0,this.Lh=0,this.gh=!1,this.wf=0;for(let t=0;t<100;t++)this.fe[t]=null;this.Le=0,this.Ge=0,this.fn=0,this.Lo=0,this.mn=(100*Math.random()|0)-50,this.In=(110*Math.random()|0)-55,this.En=(80*Math.random()|0)-40,this.Pn=(120*Math.random()|0)-60,this.Fn=(30*Math.random()|0)-20,this.er=(20*Math.random()|0)-10&2047,this.Gn=-1,this.wn=0,this.yn=0,this.Rr=0,this.Ur=0;for(let t=0;t{if(null!==this.Lr){this.fi>1&&this.fi--,this.ci>0&&this.ci--;for(let t=0;t<5&&await this.read();t++);if(this.Nc){for(let t=0;tthis.Fo+(this.Po/22|0)&&(this.Po=i.ft,this.Fo=Date.now(),this.Do=this.So[t],this.No=this.Mo[t],await(0,j.mf)(i.data.slice(0,i.ft),this.xo))}catch(t){console.error(t)}this.Lo--;for(let i=t;i0&&(this.Uo-=20,this.Uo<0&&(this.Uo=0),0===this.Uo&&this.Bo&&!$.K.vt&&this.Go&&await this.Al(this.Go,this.Ho,this.Wo,!1));const t=k.A.flush();if(t&&(this.ri.If(O.A.Ef),this.ri.p2(t.ft),this.ri.uf(t.data,t.ft,0),t.release()),this.ai++,this.ai>750&&await this.gf(),this._f(),this.Cf(),this.Tf(),this.Of(),(1===this.vf[1]||1===this.vf[2]||1===this.vf[3]||1===this.vf[4])&&this.sr++>5&&(this.sr=0,this.ri.If(O.A.bf),this.ri.p2(this.hr),this.ri.p2(this.er),this.ri.p1(this.Pn),this.ri.p1(this.Fn)),this.un++,0!==this.Ah&&(this.ph+=20,this.ph>=400&&(this.Ah=0)),0!==this.xe&&(this.Pe++,this.Pe>=15&&(2===this.xe&&(this.ah=!0),3===this.xe&&(this.fh=!0),this.xe=0)),0!==this.Ce&&(this.ve++,(this.ea>this.Te+5||this.eathis.Oe+5||this.na=5){if(this.Ze=-1,this.Rf(),this.Ze===this.ge&&this.qe!==this._e){const t=c.A.Jo[this.ge];if(t.Ql){const i=t.Ql[this.qe];t.Ql[this.qe]=t.Ql[this._e],t.Ql[this._e]=i}if(t.ta){const i=t.ta[this.qe];t.ta[this.qe]=t.ta[this._e],t.ta[this._e]=i}this.ri.If(O.A.Sf),this.ri.p2(this.ge),this.ri.p2(this._e),this.ri.p2(this.qe)}}else(1===this.Ve||this.Mf(this.Lh-1))&&this.Lh>2?this.kf():this.Lh>0&&await this.xf(this.Lh-1);this.Pe=10,this.Qc=0}if($.K.Pt++,$.K.Pt>127&&($.K.Pt=0,this.ri.If(O.A.Df),this.ri.p3(4991788)),-1!==x.A.Nf&&this.Jr){const t=x.A.Nf,i=x.A.Pf,s=this.Ff(this.Jr.Uf[0],this.Jr.Bf[0],t,i,0,0,0,0,0,0,!0);x.A.Nf=-1,s&&(this.mh=this.tf,this.Ih=this.if,this.Ah=1,this.ph=0)}1===this.Qc&&this.Zh&&(this.Zh=null,this.fh=!0,this.Qc=0),await this.Gf(),this.Hf(),this.Wf(),this.Yf(),1!==this.Lf&&1!==this.Qc||this.yh++,2===this.fn&&($.K.Mt?this.Vf():this.Kf()),2===this.fn&&this.An&&this.Xf();for(let t=0;t<5;t++)this.Tn[t]++;if(await this.zf(),this.wf++,this.wf>4500&&(this.ci=250,this.wf-=500,this.ri.If(O.A.jf)),this.pn++,this.pn>500){this.pn=0;const t=8*Math.random()|0;1&~t||(this.mn+=this.gn),2&~t||(this.In+=this._n),4&~t||(this.En+=this.Cn)}if(this.mn<-50&&(this.gn=2),this.mn>50&&(this.gn=-2),this.In<-55&&(this._n=2),this.In>55&&(this._n=-2),this.En<-40&&(this.Cn=1),this.En>40&&(this.Cn=-1),this.Nn++,this.Nn>500){this.Nn=0;const t=8*Math.random()|0;1&~t||(this.Pn+=this.Bn),2&~t||(this.Fn+=this.Un)}this.Pn<-60&&(this.Bn=2),this.Pn>60&&(this.Bn=-2),this.Fn<-20&&(this.Un=1),this.Fn>10&&(this.Un=-1),$.K.Ft++,$.K.Ft>110&&($.K.Ft=0,this.ri.If(O.A.Zf),this.ri.p4(0)),this.eo++,this.eo>50&&this.ri.If(O.A.qf);try{this.stream&&this.ri.ft>0&&(this.stream.write(this.ri.data,this.ri.ft),this.ri.ft=0,this.eo=0)}catch(t){console.log(t),await this.gf()}}}};Uc=()=>{if(null===this.Lr)return;this.mi&&(this.mi=!1,this.cs?.draw(0,11),this.fs?.draw(0,375),this.us?.draw(729,5),this.ds?.draw(752,231),this.ws?.draw(0,0),this.ys?.draw(561,0),this.As?.draw(520,11),this.ps?.draw(520,231),this.Is?.draw(501,375),this.Es?.draw(0,345),this.ah=!0,this.fh=!0,this.uh=!0,this.dh=!0,2!==this.fn&&(this.es?.draw(8,11),this.hs?.draw(561,5))),2===this.fn&&this.$f(),this.gh&&1===this._h&&(this.ah=!0);let t=!1;if(-1!==this.Sh&&(t=this.kl(this.Sh,this.un),t&&(this.ah=!0)),2===this.xe&&(this.ah=!0),2===this.Ce&&(this.ah=!0),this.ah&&(this.Jf(),this.ah=!1),-1===this.Mh){this.kh.Zl=this.xh-this.Dh-77,this.ea>453&&this.ea<565&&this.na>350&&this.Qf(this.ea-22,this.na-375,this.xh,77,!1,463,0,this.kh);let t=this.xh-this.kh.Zl-77;t<0&&(t=0),t>this.xh-77&&(t=this.xh-77),this.Dh!==t&&(this.Dh=t,this.fh=!0)}-1!==this.Mh&&(t=this.kl(this.Mh,this.un),t&&(this.fh=!0)),3===this.xe&&(this.fh=!0),3===this.Ce&&(this.fh=!0),this.Zh&&(this.fh=!0),this.gh&&2===this._h&&(this.fh=!0),this.fh&&(this.tu(),this.fh=!1),2===this.fn&&(this.iu(),this.hs?.draw(561,5)),-1!==this.qh&&(this.uh=!0),this.uh&&(-1!==this.qh&&this.qh===this.$h&&(this.qh=-1,this.ri.If(O.A.su),this.ri.p1(this.$h)),this.uh=!1,this.ls?.bind(),this.xs?.draw(0,0),-1===this.Sh&&(-1!==this.Jh[this.$h]&&(0===this.$h?this.qs?.draw(29,30):1===this.$h?this.$s?.draw(59,29):2===this.$h?this.$s?.draw(87,29):3===this.$h?this.Js?.draw(115,29):4===this.$h?this.th?.draw(156,29):5===this.$h?this.th?.draw(184,29):6===this.$h&&this.Qs?.draw(212,30)),-1!==this.Jh[0]&&(0!==this.qh||this.hi%20<10)&&this.Ds[0]?.draw(35,34),-1!==this.Jh[1]&&(1!==this.qh||this.hi%20<10)&&this.Ds[1]?.draw(59,32),-1!==this.Jh[2]&&(2!==this.qh||this.hi%20<10)&&this.Ds[2]?.draw(86,32),-1!==this.Jh[3]&&(3!==this.qh||this.hi%20<10)&&this.Ds[3]?.draw(121,33),-1!==this.Jh[4]&&(4!==this.qh||this.hi%20<10)&&this.Ds[4]?.draw(157,34),-1!==this.Jh[5]&&(5!==this.qh||this.hi%20<10)&&this.Ds[5]?.draw(185,32),-1!==this.Jh[6]&&(6!==this.qh||this.hi%20<10)&&this.Ds[6]?.draw(212,34)),this.ls?.draw(520,165),this.os?.bind(),this.ks?.draw(0,0),-1===this.Sh&&(-1!==this.Jh[this.$h]&&(7===this.$h?this.ih?.draw(49,0):8===this.$h?this.sh?.draw(81,0):9===this.$h?this.sh?.draw(108,0):10===this.$h?this.hh?.draw(136,1):11===this.$h?this.nh?.draw(178,0):12===this.$h?this.nh?.draw(205,0):13===this.$h&&this.eh?.draw(233,0)),-1!==this.Jh[8]&&(8!==this.qh||this.hi%20<10)&&this.Ds[7]?.draw(80,2),-1!==this.Jh[9]&&(9!==this.qh||this.hi%20<10)&&this.Ds[8]?.draw(107,3),-1!==this.Jh[10]&&(10!==this.qh||this.hi%20<10)&&this.Ds[9]?.draw(142,4),-1!==this.Jh[11]&&(11!==this.qh||this.hi%20<10)&&this.Ds[10]?.draw(179,2),-1!==this.Jh[12]&&(12!==this.qh||this.hi%20<10)&&this.Ds[11]?.draw(206,2),-1!==this.Jh[13]&&(13!==this.qh||this.hi%20<10)&&this.Ds[12]?.draw(230,2)),this.os?.draw(501,492),this.es?.bind()),this.dh&&(this.dh=!1,this.rs?.bind(),this.Ms?.draw(0,0),this.Ni?.Ca(57,33,'Public chat',m.A.Kl,!0),0===this.Qh&&this.Ni?.Ca(57,46,'On',m.A.GREEN,!0),1===this.Qh&&this.Ni?.Ca(57,46,'Friends',m.A.fa,!0),2===this.Qh&&this.Ni?.Ca(57,46,'Off',m.A.RED,!0),3===this.Qh&&this.Ni?.Ca(57,46,'Hide',m.A.$c,!0),this.Ni?.Ca(186,33,'Private chat',m.A.Kl,!0),0===this.te&&this.Ni?.Ca(186,46,'On',m.A.GREEN,!0),1===this.te&&this.Ni?.Ca(186,46,'Friends',m.A.fa,!0),2===this.te&&this.Ni?.Ca(186,46,'Off',m.A.RED,!0),this.Ni?.Ca(326,33,'Trade/duel',m.A.Kl,!0),0===this.ie&&this.Ni?.Ca(326,46,'On',m.A.GREEN,!0),1===this.ie&&this.Ni?.Ca(326,46,'Friends',m.A.fa,!0),2===this.ie&&this.Ni?.Ca(326,46,'Off',m.A.RED,!0),this.Ni?.Ca(462,38,'Report abuse',m.A.Kl,!0),this.rs?.draw(0,471),this.es?.bind()),this.un=0};$f=()=>{if(this.dn++,this.hu(),this.eu(),this.nu(),this.ru(),this.ou(),!this.An){let t=this.hr;(this.Dn/256|0)>t&&(t=this.Dn/256|0),this.On[4]&&this.bn[4]+128>t&&(t=this.bn[4]+128);const i=this.er+this.En&2047;if(this.Jr&&this.lu(this.lr,this.au(this.ir,this.Jr.x,this.Jr.z)-50,this.ar,i,t,3*t+600),$.K.Nt++,$.K.Nt>1802){$.K.Nt=0,this.ri.If(O.A.cu),this.ri.p1(0);const t=this.ri.ft;this.ri.p2(29711),this.ri.p1(70),this.ri.p1(256*Math.random()|0),this.ri.p1(242),this.ri.p1(186),this.ri.p1(39),this.ri.p1(61),2*Math.random()|0||this.ri.p1(13),2*Math.random()|0||this.ri.p2(57856),this.ri.p2(65536*Math.random()|0),this.ri.fu(this.ri.ft-t)}}let t;t=this.An?this.uu():this.du();const i=this.Rn,s=this.Sn,h=this.Mn,e=this.kn,n=this.xn;let r;for(let t=0;t<5;t++)this.On[t]&&(r=Math.random()*(2*this.vn[t]+1)-this.vn[t]+Math.sin(this.Tn[t]*(this.Ln[t]/100))*this.bn[t]|0,0===t&&(this.Rn+=r),1===t&&(this.Sn+=r),2===t&&(this.Mn+=r),3===t&&(this.xn=this.xn+r&2047),4===t&&(this.kn+=r,this.kn<128&&(this.kn=128),this.kn>383&&(this.kn=383)));r=d.A.wu,p.A.yu=!0,p.A.Au=0,p.A.ea=this.ea-8,p.A.na=this.na-11,u.A.clear(),this.cn?.draw(this.Rn,this.Sn,this.Mn,t,this.xn,this.kn,this.hi),this.cn?.pu(),this.mu(),this.Iu(),$.K.Rt&&this.Eu(),this.gu(r),this._u(),this.es?.draw(8,11),this.Rn=i,this.Sn=s,this.Mn=h,this.kn=e,this.xn=n};Cu=()=>{e.A.Tu?.clear(),e.A.Ou?.clear(),r.A.Qo?.clear(),n.A.Qo?.clear(),n.A.vu?.clear(),W.A.Qo?.clear(),l.A.Qo?.clear()};bu=(t,i)=>{this.Lu(t.x,i,t.z)};Lu=(t,i,s)=>{if(t<128||s<128||t>13056||s>13056)return this.Ar=-1,void(this.pr=-1);const h=this.au(this.ir,t,s)-i;this.Ru(t,h,s)};Ru=(t,i,s)=>{let h=t-this.Rn,e=i-this.Sn,n=s-this.Mn;const r=d.A.sin[this.kn],o=d.A.cos[this.kn],l=d.A.sin[this.xn],a=d.A.cos[this.xn];let c=n*l+h*a>>16;n=n*a-h*l>>16,h=c,c=e*o-n*r>>16,n=e*r+n*o>>16,e=c,n>=50?(this.Ar=d.A.Sa+((h<<9)/n|0),this.pr=d.A.Ma+((e<<9)/n|0)):(this.Ar=-1,this.pr=-1)};mu=()=>{this.do=0;for(let t=-1;t-1))for(let t=0;t<8;t++)h.Su&1<=0&&10===this.Fh&&this.Hh===this.Sr[t]&&(this.bu(i,i.height+15),this.Ar>-1&&this.Hs[7]?.draw(this.Ar-12,this.pr-s))}else 1===this.Fh&&this.Uh===this.Br[t-this.Rr]&&this.hi%20<10&&(this.bu(i,i.height+15),this.Ar>-1&&this.Hs[2]?.draw(this.Ar-12,this.pr-28));if(i.Mu&&(t>=this.Rr||0===this.Qh||3===this.Qh||1===this.Qh&&this.ku(i.name))&&(this.bu(i,i.height),this.Ar>-1&&this.do<$.K.wo&&this.Pi&&(this.mo[this.do]=this.Pi.xu(i.Mu)/2|0,this.po[this.do]=this.Pi.height,this.yo[this.do]=this.Ar,this.Ao[this.do]=this.pr,this.Io[this.do]=i.Du,this.Eo[this.do]=i.Nu,this._o[this.do]=i.Pu,this.Co[this.do++]=i.Mu,0===this.Ae&&1===i.Nu&&(this.po[this.do]+=10,this.Ao[this.do]+=5),0===this.Ae&&2===i.Nu&&(this.mo[this.do]=60))),i.Fu>this.hi+100&&(this.bu(i,i.height+15),this.Ar>-1)){let t=30*i.Uu/i.Bu|0;t>30&&(t=30),u.A.fillRect(this.Ar-15,this.pr-3,t,5,m.A.GREEN),u.A.fillRect(this.Ar-15+t,this.pr-3,30-t,5,m.A.RED)}if(i.Fu>this.hi+330&&(this.bu(i,i.height/2|0),this.Ar>-1&&(this.Gs[i.Gu]?.draw(this.Ar-12,this.pr-12),this.Di?.Hc(this.Ar,this.pr+4,i.Hu.toString(),m.A.ca),this.Di?.Hc(this.Ar-1,this.pr+3,i.Hu.toString(),m.A.Kl))),$.K.Rt){if(i.pathLength>0||i.Wu>=this.hi||i.Yu>this.hi){const t=64*i.size;this.Vu(128*i.Uf[0]+t,128*i.Bf[0]+t,this.ir,i.size,65535,!1)}this.Vu(i.x,i.z,this.ir,i.size,6710886,!1);let s=0;if(this.bu(i,i.height+30),t32767&&(i-=32768),this.Di?.Hc(this.Ar,this.pr+s,'Face Entity: '+i,m.A.Kl),s-=15}(t.Ku&W.A.Ju)===W.A.Ju&&(this.Di?.Hc(this.Ar,this.pr+s,'Say',m.A.Kl),s-=15),(t.Ku&W.A.Qu)===W.A.Qu&&(this.Di?.Hc(this.Ar,this.pr+s,'Hit: Type '+t.Gu+' Amount '+t.Hu+' HP '+t.Uu+'/'+t.Bu,m.A.Kl),s-=15),(t.Ku&W.A.td)===W.A.td&&(this.Di?.Hc(this.Ar,this.pr+s,'Face Coord: '+t.sd/2+' '+t.hd/2,m.A.Kl),s-=15),(t.Ku&W.A.ed)===W.A.ed&&(this.Di?.Hc(this.Ar,this.pr+s,'Chat',m.A.Kl),s-=15),(t.Ku&W.A.nd)===W.A.nd&&(this.Di?.Hc(this.Ar,this.pr+s,'Play Spotanim: '+t.rd,m.A.Kl),s-=15),(t.Ku&W.A.od)===W.A.od&&(this.Di?.Hc(this.Ar,this.pr+s,'Exact Move',m.A.Kl),s-=15)}}else{const t=i;let s=0;if(this.bu(i,i.height+30),this.Di?.Hc(this.Ar,this.pr+s,t.type?.name??null,m.A.Kl),s-=15,-1!==t.Ku&&this.hi-t.Xu<30){if((t.Ku&Y.A.ju)===Y.A.ju&&(this.Di?.Hc(this.Ar,this.pr+s,'Play Seq: '+t.Zu,m.A.Kl),s-=15),(t.Ku&Y.A.qu)===Y.A.qu){let i=t.$u;i>32767&&(i-=32768),this.Di?.Hc(this.Ar,this.pr+s,'Face Entity: '+i,m.A.Kl),s-=15}(t.Ku&Y.A.Ju)===Y.A.Ju&&(this.Di?.Hc(this.Ar,this.pr+s,'Say',m.A.Kl),s-=15),(t.Ku&Y.A.Qu)===Y.A.Qu&&(this.Di?.Hc(this.Ar,this.pr+s,'Hit: Type '+t.Gu+' Amount '+t.Hu+' HP '+t.Uu+'/'+t.Bu,m.A.Kl),s-=15),(t.Ku&Y.A.ld)===Y.A.ld&&(this.Di?.Hc(this.Ar,this.pr+s,'Change Type: '+t.type?.id??null,m.A.Kl),s-=15),(t.Ku&Y.A.nd)===Y.A.nd&&(this.Di?.Hc(this.Ar,this.pr+s,'Play Spotanim: '+t.rd,m.A.Kl),s-=15),(t.Ku&Y.A.td)===Y.A.td&&(this.Di?.Hc(this.Ar,this.pr+s,'Face Coord: '+t.sd/2+' '+t.hd/2,m.A.Kl),s-=15)}}}}}if($.K.Rt)for(let t=0;t=104||i.z>=104||this.Vu(128*i.x+64,128*i.z+64,i.level,1,16776960,!1)}for(let t=0;tthis.Ao[r]-this.po[r]&&s-ethis.yo[r]-this.mo[r]&&this.Ao[r]-this.po[r]{2===this.Fh&&this.Hs[2]&&(this.Lu((this.Wh-this.Kn<<7)+this.Bh,2*this.Vh,(this.Yh-this.Xn<<7)+this.Gh),this.Ar>-1&&this.hi%20<10&&this.Hs[2].draw(this.Ar-12,this.pr-28))};Eu=()=>{const t=507;let i=13;this.jo?this.Di?.dd(t,i,'tock',m.A.fa,!0):this.Pi?.dd(t,i,'tick',m.A.fa,!0),i+=13,this.Di?.dd(t,i,`Fps: ${this.wd}, ${this.yd} ms`,m.A.fa,!0),i+=13,this.Di?.dd(t,i,`Draw: ${this.ms.toFixed(1)}, Avg: ${this.Ad.toFixed(1)}, Slow: ${this.pd.toFixed(1)} ms`,m.A.fa,!0),i+=13,this.Di?.dd(t,i,`Occluders: ${x.A.md[x.A.Id]} Active: ${x.A.Ed}`,m.A.fa,!0),i+=13,this.Di?.dd(t,i,'Local Pos: '+(this.Jr?.x??-1)+', '+(this.Jr?.z??-1)+', '+(this.Jr?.y??-1),m.A.fa,!0),i+=13,this.Di?.dd(t,i,'Camera Pos: '+this.Rn+', '+this.Mn+', '+this.Sn,m.A.fa,!0),i+=13,this.Di?.dd(t,i,'Camera Angle: '+this.xn+', '+this.kn,m.A.fa,!0),i+=13,this.Di?.dd(t,i,'Cutscene Source: '+this.Cr+', '+this.Tr+' '+this.Or+'; '+this.vr+', '+this.br,m.A.fa,!0),i+=13,this.Di?.dd(t,i,'Cutscene Destination: '+this.mr+', '+this.Ir+' '+this.Er+'; '+this.gr+', '+this._r,m.A.fa,!0),$.K.Mt&&(i+=13,this.Di?.dd(t,i,'Instructions:',m.A.fa,!0),i+=13,this.Di?.dd(t,i,'- Arrows to move Camera',m.A.fa,!0),i+=13,this.Di?.dd(t,i,'- Shift to control Source or Dest',m.A.fa,!0),i+=13,this.Di?.dd(t,i,'- Alt to control Height',m.A.fa,!0),i+=13,this.Di?.dd(t,i,'- Ctrl to control Modifier',m.A.fa,!0))};Vu=(t,i,s,h,e,n)=>{const r=this.au(s,t,i),o=64*h;this.Ru(t-o,r,i-o);const l=this.Ar,a=this.pr;this.Ru(t+o,r,i-o);const c=this.Ar,f=this.pr;this.Ru(t-o,r,i+o);const d=this.Ar,w=this.pr;this.Ru(t+o,r,i+o);const y=this.Ar,A=this.pr;-1!==l&&-1!==c&&-1!==d&&-1!==y&&(n&&(u.A.gd(l,a,y,A,(16711422&e)>>1),u.A.gd(c,f,d,w,(16711422&e)>>1)),u.A.gd(l,a,c,f,e),u.A.gd(l,a,d,w,e),u.A.gd(c,f,y,A,e),u.A.gd(d,w,y,A,e))};Vf(){const t=1==this.vf[5]?2:1;1==this.vf[6]?(1==this.vf[1]?(this.mr-=t,this.mr<1&&(this.mr=1)):1==this.vf[2]&&(this.mr+=t,this.mr>102&&(this.mr=102)),1==this.vf[3]?1==this.vf[7]?this.Er+=2*t:(this.Ir+=1,this.Ir>102&&(this.Ir=102)):1==this.vf[4]&&(1==this.vf[7]?this.Er-=2*t:(this.Ir-=1,this.Ir<1&&(this.Ir=1)))):(1==this.vf[1]?(this.Cr-=t,this.Cr<1&&(this.Cr=1)):1==this.vf[2]&&(this.Cr+=t,this.Cr>102&&(this.Cr=102)),1==this.vf[3]?1==this.vf[7]?this.Or+=2*t:(this.Tr+=t,this.Tr>102&&(this.Tr=102)):1==this.vf[4]&&(1==this.vf[7]?this.Or-=2*t:(this.Tr-=t,this.Tr<1&&(this.Tr=1)))),this.Rn=128*this.Cr+64,this.Mn=128*this.Tr+64,this.Sn=this.au(this.ir,this.Cr,this.Tr)-this.Or;const i=128*this.mr+64,s=128*this.Ir+64,h=this.au(this.ir,this.mr,this.Ir)-this.Er,e=i-this.Rn,n=h-this.Sn,r=s-this.Mn,o=0|Math.sqrt(e*e+r*r);this.kn=325.949*Math.atan2(n,o)&2047,this.xn=-325.949*Math.atan2(e,r)&2047,this.kn<128&&(this.kn=128),this.kn>383&&(this.kn=383)}_u=()=>{if(this._d(),1===this.Ah&&this.Ys[this.ph/100|0]?.draw(this.mh-8-8,this.Ih-8-11),2===this.Ah&&this.Ys[4+(this.ph/100|0)]?.draw(this.mh-8-8,this.Ih-8-11),-1!==this.wh&&(this.kl(this.wh,this.un),this.Gl(c.A.Jo[this.wh],0,0,0)),this.Cd(),this.gh?0===this._h&&this.Td():(this.Rf(),this.Od()),1===this.io&&(this.no>0||1===this.ro?this.Hs[1]?.draw(472,258):this.Hs[1]?.draw(472,296)),this.no>0&&(this.Hs[0]?.draw(472,296),this.Ni?.Hc(484,329,'Level: '+this.no,m.A.fa)),1===this.ro&&(this.Hs[6]?.draw(472,296),this.Ni?.Hc(484,329,'Arena',m.A.fa)),0!==this.fi){let t=this.fi/50|0;const i=t/60|0;t%=60,t<10?this.Ni?.la(4,329,'System update in: '+i+':0'+t,m.A.fa):this.Ni?.la(4,329,'System update in: '+i+':'+t,m.A.fa)}};_d=()=>{if(0===this.ye)return;const t=this.Ni;let i=0;0!==this.fi&&(i=1);for(let s=0;s<100;s++){if(!this.fe[s])continue;const h=this.messageType[s];let e;if((3===h||7===h)&&(7===h||0===this.te||1===this.te&&this.ku(this.ue[s]))&&(e=329-13*i,t?.la(4,e,'From '+this.ue[s]+': '+this.fe[s],m.A.ca),t?.la(4,e-1,'From '+this.ue[s]+': '+this.fe[s],m.A.$c),i++,i>=5))return;if(5===h&&this.te<2&&(e=329-13*i,t?.la(4,e,this.fe[s],m.A.ca),t?.la(4,e-1,this.fe[s],m.A.$c),i++,i>=5))return;if(6===h&&this.te<2&&(e=329-13*i,t?.la(4,e,'To '+this.ue[s]+': '+this.fe[s],m.A.ca),t?.la(4,e-1,'To '+this.ue[s]+': '+this.fe[s],m.A.$c),i++,i>=5))return}};Cd=()=>{if(!this.Jr)return;const t=(this.Jr.x>>7)+this.Kn,i=(this.Jr.z>>7)+this.Xn;if(this.no=t>=2944&&t<3392&&i>=3520&&i<6400?1+((i-3520)/8|0):t>=2944&&t<3392&&i>=9920&&i<12800?1+((i-9920)/8|0):0,this.ro=0,t>=3328&&t<3392&&i>=3200&&i<3264){const s=63&t,h=63&i;(s>=4&&s<=29&&h>=44&&h<=58||s>=36&&s<=61&&h>=44&&h<=58||s>=4&&s<=29&&h>=25&&h<=39||s>=36&&s<=61&&h>=25&&h<=39||s>=4&&s<=29&&h>=6&&h<=20||s>=36&&s<=61&&h>=6&&h<=20)&&(this.ro=1)}0===this.ro&&t>=3328&&t<=3393&&i>=3203&&i<=3325&&(this.ro=2),this.Eh=0,(t>=3053&&t<=3156&&i>=3056&&i<=3136||t>=3072&&t<=3118&&i>=9492&&i<=9535)&&(this.Eh=1),1===this.Eh&&t>=3139&&t<=3199&&i>=3008&&i<=3062&&(this.Eh=0)};Jf=()=>{this.ss?.bind(),this._s&&(d.A.xc=this._s),this.Ls?.draw(0,0),-1!==this.Sh?this.Gl(c.A.Jo[this.Sh],0,0,0):-1!==this.Jh[this.$h]&&this.Gl(c.A.Jo[this.Jh[this.$h]],0,0,0),this.gh&&1===this._h&&this.Td(),this.ss?.draw(562,231),this.es?.bind(),this.Cs&&(d.A.xc=this.Cs)};tu=()=>{if(this.ns?.bind(),this.gs&&(d.A.xc=this.gs),this.Rs?.draw(0,0),this.ee)this.Pi?.Hc(239,40,this.ne,m.A.ca),this.Pi?.Hc(239,60,this.re+'*',m.A.vd);else if(this.ae)this.Pi?.Hc(239,40,'Enter amount:',m.A.ca),this.Pi?.Hc(239,60,this.le+'*',m.A.vd);else if(this.Zh)this.Pi?.Hc(239,40,this.Zh,m.A.ca),this.Pi?.Hc(239,60,'Click to continue',m.A.vd);else if(-1!==this.Mh)this.Gl(c.A.Jo[this.Mh],0,0,0);else if(-1===this.ce){let t=this.Ni;0===$.K.St&&(t=this.Fi);let i=0;u.A.Hl(0,0,463,77);for(let s=0;s<100;s++){const h=this.fe[s];if(!h)continue;const e=this.messageType[s],n=this.Dh+70-14*i;0===e&&(n>0&&n<110&&t?.la(4,n,h,m.A.ca),i++),1===e&&(n>0&&n<110&&(t?.la(4,n,this.ue[s]+':',m.A.Kl),t?.la(t.xu(this.ue[s])+12,n,h,m.A.BLUE)),i++),2===e&&(0===this.Qh||1===this.Qh&&this.ku(this.ue[s]))&&(n>0&&n<110&&(t?.la(4,n,this.ue[s]+':',m.A.ca),t?.la(t.xu(this.ue[s])+12,n,h,m.A.BLUE)),i++),3!==e&&7!==e||0!==this.ye||!(7===e||0===this.te||1===this.te&&this.ku(this.ue[s]))||(n>0&&n<110&&(t?.la(4,n,'From '+this.ue[s]+':',m.A.ca),t?.la(t.xu('From '+this.ue[s])+12,n,h,m.A.bd)),i++),4===e&&(0===this.ie||1===this.ie&&this.ku(this.ue[s]))&&(n>0&&n<110&&t?.la(4,n,this.ue[s]+' '+this.fe[s],m.A.Ld),i++),5===e&&0===this.ye&&this.te<2&&(n>0&&n<110&&t?.la(4,n,h,m.A.bd),i++),6===e&&0===this.ye&&this.te<2&&(n>0&&n<110&&(t?.la(4,n,'To '+this.ue[s]+':',m.A.ca),t?.la(t.xu('To '+this.ue[s])+12,n,h,m.A.bd)),i++),8===e&&(0===this.ie||1===this.ie&&this.ku(this.ue[s]))&&(n>0&&n<110&&t?.la(4,n,this.ue[s]+' '+this.fe[s],m.A.Rd),i++)}u.A.ud(),this.xh=14*i+7,this.xh<78&&(this.xh=78),this.Ol(463,0,this.xh-this.Dh-77,this.xh,77),0==$.K.St?t?.la(3,90,this.pe+'*',m.A.ca):1==$.K.St?t?.la(3,90,this.pe+'*',m.A.BLUE):(t?.la(4,90,M.A.za(this.username)+':',m.A.ca),t?.la(t.xu(this.username+': ')+6,90,this.pe+'*',m.A.BLUE)),u.A.Sl(0,77,m.A.ca,479)}else this.Gl(c.A.Jo[this.ce],0,0,0);this.gh&&2===this._h&&this.Td(),this.ns?.draw(22,375),this.es?.bind(),this.Cs&&(d.A.xc=this.Cs)};iu=()=>{if(this.hs?.bind(),!this.Jr)return;const t=this.er+this.Pn&2047;let i=48+(this.Jr.x/32|0),s=464-(this.Jr.z/32|0);this.Ps?.Sd(21,9,146,151,this.vs,this.bs,i,s,t,this.Fn+256),this.Fs?.Sd(0,0,33,33,this.Ts,this.Os,25,25,this.er,256);for(let t=0;t{if(!i)return;const h=this.er+this.Pn&2047,e=s*s+t*t;if(e>6400)return;let n=d.A.sin[h],r=d.A.cos[h];n=256*n/(this.Fn+256)|0,r=256*r/(this.Fn+256)|0;const o=t*n+s*r>>16,l=t*r-s*n>>16;e>2500&&this.Ss?i.Dd(o+94-(i.oa/2|0),83-l-(i.Nd/2|0),this.Ss):i.draw(o+94-(i.oa/2|0),83-l-(i.Nd/2|0))};Pd=t=>{if(!this.Ps)return;const i=this.Ps.Mc,s=i.length;for(let t=0;t>14&32767;const h=e.A.get(s).Gd;if(h<0)continue;let n=t,r=i;if(22!==h&&29!==h&&34!==h&&36!==h&&46!==h&&47!==h&&48!==h){const s=G.A.yr,h=G.A.yr,e=this.Qn[this.ir];if(e){const o=e.flags;for(let e=0;e<10;e++){const e=4*Math.random()|0;0===e&&n>0&&n>t-3&&(o[G.A.index(n-1,r)]&H.A.Hd)===H.A.OPEN&&n--,1===e&&n0&&r>i-3&&(o[G.A.index(n,r-1)]&H.A.Yd)===H.A.OPEN&&r--,3===e&&r{if(!this.cn||!this.Ps)return;let r=this.cn.Kd(s,t,i);if(0!==r){const o=this.cn.Xd(s,t,i,r),l=o>>6&3,a=31&o;let c=h;r>0&&(c=n);const f=this.Ps.Mc,u=4*t+512*(103-i)*4+24624,d=r>>14&32767,w=e.A.get(d);if(-1===w.zd)a!==P.A.jd.id&&a!==P.A.Zd.id||(l===F.A.qd?(f[u]=c,f[u+512]=c,f[u+1024]=c,f[u+1536]=c):l===F.A.$d?(f[u]=c,f[u+1]=c,f[u+2]=c,f[u+3]=c):l===F.A.Jd?(f[u+3]=c,f[u+3+512]=c,f[u+3+1024]=c,f[u+3+1536]=c):l===F.A.Qd&&(f[u+1536]=c,f[u+1536+1]=c,f[u+1536+2]=c,f[u+1536+3]=c)),a===P.A.tw.id&&(l===F.A.qd?f[u]=c:l===F.A.$d?f[u+3]=c:l===F.A.Jd?f[u+3+1536]=c:l===F.A.Qd&&(f[u+1536]=c)),a===P.A.Zd.id&&(l===F.A.Qd?(f[u]=c,f[u+512]=c,f[u+1024]=c,f[u+1536]=c):l===F.A.qd?(f[u]=c,f[u+1]=c,f[u+2]=c,f[u+3]=c):l===F.A.$d?(f[u+3]=c,f[u+3+512]=c,f[u+3+1024]=c,f[u+3+1536]=c):l===F.A.Jd&&(f[u+1536]=c,f[u+1536+1]=c,f[u+1536+2]=c,f[u+1536+3]=c));else{const s=this.Us[w.zd];if(s){const h=(4*w.width-s.width)/2|0,e=(4*w.length-s.height)/2|0;s.draw(4*t+48+h,4*(G.A.yr-i-w.length)+e+48)}}}if(r=this.cn.iw(s,t,i),0!==r){const h=this.cn.Xd(s,t,i,r),n=h>>6&3,o=31&h,l=r>>14&32767,a=e.A.get(l);if(-1!==a.zd){const s=this.Us[a.zd];if(s){const h=(4*a.width-s.width)/2|0,e=(4*a.length-s.height)/2|0;s.draw(4*t+48+h,4*(G.A.yr-i-a.length)+e+48)}}else if(o===P.A.sw.id){let s=15658734;r>0&&(s=15597568);const h=this.Ps.Mc,e=4*t+512*(G.A.yr-1-i)*4+24624;n===F.A.qd||n===F.A.Jd?(h[e+1536]=s,h[e+1024+1]=s,h[e+512+2]=s,h[e+3]=s):(h[e]=s,h[e+512+1]=s,h[e+1024+2]=s,h[e+1536+3]=s)}}if(r=this.cn.Bd(s,t,i),0!==r){const s=e.A.get(r>>14&32767);if(-1!==s.zd){const h=this.Us[s.zd];if(h){const e=(4*s.width-h.width)/2|0,n=(4*s.length-h.height)/2|0;h.draw(4*t+48+e,4*(G.A.yr-i-s.length)+n+48)}}}};Od=()=>{if(this.Lh<2&&0===this.Le&&0===this.Ge)return;let t;t=1===this.Le&&this.Lh<2?'Use '+this.ke+' with...':1===this.Ge&&this.Lh<2?this.Ye+'...':this.Rh[this.Lh-1],this.Lh>2&&(t=t+'@whi@ / '+(this.Lh-2)+' more options'),this.Pi?.hw(4,15,t,m.A.Kl,!0,this.hi/1e3|0)};Td=()=>{const t=this.Ch,i=this.Th,s=this.Oh,h=this.bh,e=m.A.ew;u.A.fillRect(t,i,s,h,e),u.A.fillRect(t+1,i+1,s-2,16,m.A.ca),u.A.Vl(t+1,i+18,s-2,h-19,m.A.ca),this.Pi?.la(t+3,i+14,'Choose Option',e);let n=this.ea,r=this.na;0===this._h&&(n-=8,r-=11),1===this._h&&(n-=562,r-=231),2===this._h&&(n-=22,r-=375);for(let h=0;ht&&ne-13&&r{if(0!==this.Ce)return;let t=this.Qc;if(1===this.Ge&&this.tf>=520&&this.if>=165&&this.tf<=788&&this.if<=230&&(t=0),this.gh){if(1!==t){let t=this.ea,i=this.na;0===this._h?(t-=8,i-=11):1===this._h?(t-=562,i-=231):2===this._h&&(t-=22,i-=375),(tthis.Ch+this.Oh+10||ithis.Th+this.bh+10)&&(this.gh=!1,1===this._h&&(this.ah=!0),2===this._h&&(this.fh=!0))}if(1===t){const t=this.Ch,i=this.Th,s=this.Oh;let h=this.tf,e=this.if;0===this._h?(h-=8,e-=11):1===this._h?(h-=562,e-=231):2===this._h&&(h-=22,e-=375);let n=-1;for(let r=0;rt&&ho-13&&e0){const t=this.Ke[this.Lh-1];if(602===t||596===t||22===t||892===t||415===t||405===t||38===t||422===t||478===t||347===t||188===t){const t=this.ze[this.Lh-1],i=this.je[this.Lh-1];if(c.A.Jo[i].draggable)return this.be=!1,this.ve=0,this.ge=i,this._e=t,this.Ce=2,this.Te=this.tf,this.Oe=this.if,c.A.Jo[i].nw===this.wh&&(this.Ce=1),void(c.A.Jo[i].nw===this.Mh&&(this.Ce=3))}}if(1===t&&(1===this.Ve||this.Mf(this.Lh-1))&&this.Lh>2&&(t=2),1===t&&this.Lh>0&&await this.xf(this.Lh-1),2!==t||this.Lh<=0)return;this.kf()}};Hf=()=>{if(1===this.Qc&&this.Jr){let t=this.tf-21-561,i=this.if-9-5;if(t>=0&&i>=0&&t<146&&i<151){t-=73,i-=75;const s=this.er+this.Pn&2047;let h=d.A.sin[s],e=d.A.cos[s];h=h*(this.Fn+256)>>8,e=e*(this.Fn+256)>>8;const n=i*h+t*e>>11,r=i*e-t*h>>11,o=this.Jr.x+n>>7,l=this.Jr.z-r>>7;this.Ff(this.Jr.Uf[0],this.Jr.Bf[0],o,l,1,0,0,0,0,0,!0)&&(this.ri.p1(t),this.ri.p1(i),this.ri.p2(this.er),this.ri.p1(57),this.ri.p1(this.Pn),this.ri.p1(this.Fn),this.ri.p1(89),this.ri.p2(this.Jr.x),this.ri.p2(this.Jr.z),this.ri.p1(this.$r),this.ri.p1(63))}}};Mf=t=>{if(t<0)return!1;let i=this.Ke[t];return i>=2e3&&(i-=2e3),406===i};xf=async t=>{if(t<0)return;this.ae&&(this.ae=!1,this.fh=!0);let i=this.Ke[t];const s=this.Xe[t],h=this.ze[t],r=this.je[t];if(i>=2e3&&(i-=2e3),903===i||363===i){let s=this.Rh[t];const h=s.indexOf('@whi@');if(-1!==h){s=s.substring(h+5).trim();const t=M.A.za(M.A.ja(M.A.xd(s)));let e=!1;for(let s=0;s=90&&this.ri.If(O.A.fw),this.ri.If(O.A.uw)):347===i?this.ri.If(O.A.dw):422===i?this.ri.If(O.A.ww):405===i?($.K.Wt+=s,$.K.Wt>=97&&(this.ri.If(O.A.yw),this.ri.p3(14953816)),this.ri.If(O.A.Aw)):38===i&&this.ri.If(O.A.pw),this.ri.p2(s),this.ri.p2(h),this.ri.p2(r),this.Pe=0,this.Ne=r,this.De=h,this.xe=2,c.A.Jo[r].nw===this.wh&&(this.xe=1),c.A.Jo[r].nw===this.Mh&&(this.xe=3);else if(728===i||542===i||6===i||963===i||245===i){const t=this.Fr[s];t&&this.Jr&&(this.Ff(this.Jr.Uf[0],this.Jr.Bf[0],t.Uf[0],t.Bf[0],2,1,1,0,0,0,!1),this.mh=this.tf,this.Ih=this.if,this.Ah=2,this.ph=0,542===i?this.ri.If(O.A.mw):6===i?(3&s||$.K.Ht++,$.K.Ht>=124&&(this.ri.If(O.A.Iw),this.ri.p4(0)),this.ri.If(O.A.Ew)):963===i?this.ri.If(O.A.gw):728===i?this.ri.If(O.A._w):245===i&&(3&s||$.K.Yt++,$.K.Yt>=85&&(this.ri.If(O.A.Cw),this.ri.p2(39596)),this.ri.If(O.A.Tw)),this.ri.p2(s))}else if(217===i){if(this.Jr){this.Ff(this.Jr.Uf[0],this.Jr.Bf[0],h,r,2,0,0,0,0,0,!1)||this.Ff(this.Jr.Uf[0],this.Jr.Bf[0],h,r,2,1,1,0,0,0,!1),this.mh=this.tf,this.Ih=this.if,this.Ah=2,this.ph=0,this.ri.If(O.A.Ow),this.ri.p2(h+this.Kn),this.ri.p2(r+this.Xn),this.ri.p2(s),this.ri.p2(this.Me),this.ri.p2(this.Re),this.ri.p2(this.Se)}}else if(1175===i){const t=s>>14&32767,i=e.A.get(t);let h;h=i.bw?i.bw:"It's a "+i.name+'.',this.lw(0,h,'')}else if(285===i)this.aw(O.A.Lw,h,r,s);else if(881===i)this.ri.If(O.A.Rw),this.ri.p2(s),this.ri.p2(h),this.ri.p2(r),this.ri.p2(this.Me),this.ri.p2(this.Re),this.ri.p2(this.Se),this.Pe=0,this.Ne=r,this.De=h,this.xe=2,c.A.Jo[r].nw===this.wh&&(this.xe=1),c.A.Jo[r].nw===this.Mh&&(this.xe=3);else if(391===i)this.ri.If(O.A.Sw),this.ri.p2(s),this.ri.p2(h),this.ri.p2(r),this.ri.p2(this.He),this.Pe=0,this.Ne=r,this.De=h,this.xe=2,c.A.Jo[r].nw===this.wh&&(this.xe=1),c.A.Jo[r].nw===this.Mh&&(this.xe=3);else if(660===i)this.gh?this.cn?.click(h-8,r-11):this.cn?.click(this.tf-8,this.if-11);else{if(188===i)return this.Le=1,this.Re=h,this.Se=r,this.Me=s,this.ke=n.A.get(s).name,void(this.Ge=0);if(44===i)this.Fe||(this.ri.If(O.A.Mw),this.ri.p2(r),this.Fe=!0);else if(1773===i){const t=n.A.get(s);let i;i=r>=1e5?r+' x '+t.name:t.bw?t.bw:"It's a "+t.name+'.',this.lw(0,i,'')}else if(900===i){const t=this.Fr[s];t&&this.Jr&&(this.Ff(this.Jr.Uf[0],this.Jr.Bf[0],t.Uf[0],t.Bf[0],2,1,1,0,0,0,!1),this.mh=this.tf,this.Ih=this.if,this.Ah=2,this.ph=0,this.ri.If(O.A.kw),this.ri.p2(s),this.ri.p2(this.Me),this.ri.p2(this.Re),this.ri.p2(this.Se))}else if(1373===i||1544===i||151===i||1101===i){const t=this.Lr[s];t&&this.Jr&&(this.Ff(this.Jr.Uf[0],this.Jr.Bf[0],t.Uf[0],t.Bf[0],2,1,1,0,0,0,!1),this.mh=this.tf,this.Ih=this.if,this.Ah=2,this.ph=0,1101===i?this.ri.If(O.A.ow):151===i?($.K.zt++,$.K.zt>=90&&(this.ri.If(O.A.xw),this.ri.p2(31114)),this.ri.If(O.A.Dw)):1373===i?this.ri.If(O.A.rw):1544===i&&this.ri.If(O.A.Nw),this.ri.p2(s))}else if(265===i){const t=this.Fr[s];t&&this.Jr&&(this.Ff(this.Jr.Uf[0],this.Jr.Bf[0],t.Uf[0],t.Bf[0],2,1,1,0,0,0,!1),this.mh=this.tf,this.Ih=this.if,this.Ah=2,this.ph=0,this.ri.If(O.A.Pw),this.ri.p2(s),this.ri.p2(this.He))}else if(679===i){const i=this.Rh[t],s=i.indexOf('@whi@');if(-1!==s){const t=M.A.xd(i.substring(s+5).trim());let h=-1;for(let i=0;i0&&(this.fh=!0,this.ae=!1,this.ee=!0,this.re='',this.oe=3,this.bo=this.Oo[h],this.ne='Enter message to send to '+this.To[h])}}else if(55===i)this.aw(O.A.Fw,h,r,s)&&this.ri.p2(this.He);else if(224===i||993===i||99===i||746===i||877===i){if(this.Jr){this.Ff(this.Jr.Uf[0],this.Jr.Bf[0],h,r,2,0,0,0,0,0,!1)||this.Ff(this.Jr.Uf[0],this.Jr.Bf[0],h,r,2,1,1,0,0,0,!1),this.mh=this.tf,this.Ih=this.if,this.Ah=2,this.ph=0,224===i?this.ri.If(O.A.Uw):746===i?this.ri.If(O.A.Bw):877===i?this.ri.If(O.A.Gw):99===i?this.ri.If(O.A.Hw):993===i&&this.ri.If(O.A.Ww),this.ri.p2(h+this.Kn),this.ri.p2(r+this.Xn),this.ri.p2(s)}}else if(1607===i){const t=this.Fr[s];if(t&&t.type){let i;i=t.type.bw?t.type.bw:"It's a "+t.type.name+'.',this.lw(0,i,'')}}else if(504===i)this.aw(O.A.Yw,h,r,s);else{if(930===i){const t=c.A.Jo[r];this.Ge=1,this.He=r,this.We=t.Vw,this.Le=0;let i=t.Kw;i&&-1!==i.indexOf(' ')&&(i=i.substring(0,i.indexOf(' ')));let s=t.Kw;return s&&-1!==s.indexOf(' ')&&(s=s.substring(s.indexOf(' ')+1)),this.Ye=i+' '+t.action+' '+s,void(16===this.We&&(this.ah=!0,this.$h=3,this.uh=!0))}if(951===i){const t=c.A.Jo[r];let i=!0;t.Xl>0&&(i=this.Xw(t)),i&&(this.ri.If(O.A.zw),this.ri.p2(r))}else if(602===i||596===i||22===i||892===i||415===i)22===i?this.ri.If(O.A.jw):415===i?(3&r||$.K.Xt++,$.K.Xt>=55&&(this.ri.If(O.A.Zw),this.ri.p4(0)),this.ri.If(O.A.qw)):602===i?this.ri.If(O.A.$w):892===i?(3&h||$.K.jt++,$.K.jt>=130&&(this.ri.If(O.A.Jw),this.ri.p1(177)),this.ri.If(O.A.Qw)):596===i&&this.ri.If(O.A.ty),this.ri.p2(s),this.ri.p2(h),this.ri.p2(r),this.Pe=0,this.Ne=r,this.De=h,this.xe=2,c.A.Jo[r].nw===this.wh&&(this.xe=1),c.A.Jo[r].nw===this.Mh&&(this.xe=3);else if(581===i)3&s||$.K.Gt++,$.K.Gt>=99&&(this.ri.If(O.A.iy),this.ri.p4(0)),this.aw(O.A.sy,h,r,s);else if(965===i){if(this.Jr){this.Ff(this.Jr.Uf[0],this.Jr.Bf[0],h,r,2,0,0,0,0,0,!1)||this.Ff(this.Jr.Uf[0],this.Jr.Bf[0],h,r,2,1,1,0,0,0,!1),this.mh=this.tf,this.Ih=this.if,this.Ah=2,this.ph=0,this.ri.If(O.A.hy),this.ri.p2(h+this.Kn),this.ri.p2(r+this.Xn),this.ri.p2(s),this.ri.p2(this.He)}}else if(1501===i)$.K.Kt+=this.Xn,$.K.Kt>=92&&(this.ri.If(O.A.ey),this.ri.p4(0)),this.aw(O.A.ny,h,r,s);else if(364===i)this.aw(O.A.oy,h,r,s);else if(1102===i){const t=n.A.get(s);let i;i=t.bw?t.bw:"It's a "+t.name+'.',this.lw(0,i,'')}else if(960===i){this.ri.If(O.A.zw),this.ri.p2(r);const t=c.A.Jo[r];if(t.scripts&&t.scripts[0]&&5===t.scripts[0][0]){const i=t.scripts[0][1];t.Tl&&this.Ue[i]!==t.Tl[0]&&(this.Ue[i]=t.Tl[0],await this.ly(i),this.ah=!0)}}else if(34===i){const i=this.Rh[t],s=i.indexOf('@whi@');if(-1!==s){this.uy(),this.Je=i.substring(s+5).trim(),this.Qe=!1;for(let t=0;t{const i=t.Xl;if(i===c.A.Ey&&(this.fh=!0,this.ae=!1,this.ee=!0,this.re='',this.oe=1,this.ne='Enter name of friend to add to list'),i===c.A.gy&&(this.fh=!0,this.ae=!1,this.ee=!0,this.re='',this.oe=2,this.ne='Enter name of friend to delete from list'),i===c.A._y)return this.ci=250,!0;if(i===c.A.Cy&&(this.fh=!0,this.ae=!1,this.ee=!0,this.re='',this.oe=4,this.ne='Enter name of player to add to list'),i===c.A.Ty&&(this.fh=!0,this.ae=!1,this.ee=!0,this.re='',this.oe=5,this.ne='Enter name of player to delete from list'),i>=c.A.Oy&&i<=c.A.vy){const t=(i-300)/2|0,s=1&i;let h=this.co[t];if(-1!==h)for(;;)if(0===s&&(h--,h<0&&(h=o.A.count-1)),1===s&&(h++,h>=o.A.count&&(h=0)),!o.A.Jo[h].disable&&o.A.Jo[h].type===t+(this.lo?0:7)){this.co[t]=h,this.ao=!0;break}}if(i>=c.A.by&&i<=c.A.Ly){const t=(i-314)/2|0,s=1&i;let h=this.fo[t];0===s&&(h--,h<0&&(h=W.A.Qa[t].length-1)),1===s&&(h++,h>=W.A.Qa[t].length&&(h=0)),this.fo[t]=h,this.ao=!0}if(i!==c.A.nc||this.lo||(this.lo=!0,this.yf()),i===c.A.rc&&this.lo&&(this.lo=!1,this.yf()),i===c.A.Ry){this.ri.If(O.A.Sy),this.ri.p1(this.lo?0:1);for(let t=0;t<7;t++)this.ri.p1(this.co[t]);for(let t=0;t<5;t++)this.ri.p1(this.fo[t]);return!0}return i===c.A.lc&&(this.Qe=!this.Qe),i>=c.A.My&&i<=c.A.ky&&(this.uy(),this.Je.length>0&&(this.ri.If(O.A.xy),this.ri.Dy(M.A.xd(this.Je)),this.ri.p1(i-601),this.ri.p1(this.Qe?1:0))),!1};yf=()=>{this.ao=!0;for(let t=0;t<7;t++){this.co[t]=-1;for(let i=0;i{if(!this.Jr||!this.cn)return!1;const n=h>>14&32767,r=this.cn.Xd(this.ir,i,s,h);if(-1===r)return!1;const o=31&r,l=r>>6&3;if(o===P.A.Ny.id||o===P.A.Py.id||o===P.A.Fy.id){const t=e.A.get(n);let h,r;l===F.A.qd||l===F.A.Jd?(h=t.width,r=t.length):(h=t.length,r=t.width);let o=t.Uy;0!==l&&(o=(o<>4-l)),this.Ff(this.Jr.Uf[0],this.Jr.Bf[0],i,s,2,h,r,0,0,o,!1)}else this.Ff(this.Jr.Uf[0],this.Jr.Bf[0],i,s,2,0,0,l,o+1,0,!1);return this.mh=this.tf,this.Ih=this.if,this.Ah=2,this.ph=0,this.ri.If(t),this.ri.p2(i+this.Kn),this.ri.p2(s+this.Xn),this.ri.p2(n),!0};Wf=()=>{1===this.Qc&&(this.tf>=549&&this.tf<=583&&this.if>=195&&this.if<231&&-1!==this.Jh[0]?(this.ah=!0,this.$h=0,this.uh=!0):this.tf>=579&&this.tf<=609&&this.if>=194&&this.if<231&&-1!==this.Jh[1]?(this.ah=!0,this.$h=1,this.uh=!0):this.tf>=607&&this.tf<=637&&this.if>=194&&this.if<231&&-1!==this.Jh[2]?(this.ah=!0,this.$h=2,this.uh=!0):this.tf>=635&&this.tf<=679&&this.if>=194&&this.if<229&&-1!==this.Jh[3]?(this.ah=!0,this.$h=3,this.uh=!0):this.tf>=676&&this.tf<=706&&this.if>=194&&this.if<231&&-1!==this.Jh[4]?(this.ah=!0,this.$h=4,this.uh=!0):this.tf>=704&&this.tf<=734&&this.if>=194&&this.if<231&&-1!==this.Jh[5]?(this.ah=!0,this.$h=5,this.uh=!0):this.tf>=732&&this.tf<=766&&this.if>=195&&this.if<231&&-1!==this.Jh[6]?(this.ah=!0,this.$h=6,this.uh=!0):this.tf>=550&&this.tf<=584&&this.if>=492&&this.if<528&&-1!==this.Jh[7]?(this.ah=!0,this.$h=7,this.uh=!0):this.tf>=582&&this.tf<=612&&this.if>=492&&this.if<529&&-1!==this.Jh[8]?(this.ah=!0,this.$h=8,this.uh=!0):this.tf>=609&&this.tf<=639&&this.if>=492&&this.if<529&&-1!==this.Jh[9]?(this.ah=!0,this.$h=9,this.uh=!0):this.tf>=637&&this.tf<=681&&this.if>=493&&this.if<528&&-1!==this.Jh[10]?(this.ah=!0,this.$h=10,this.uh=!0):this.tf>=679&&this.tf<=709&&this.if>=492&&this.if<529&&-1!==this.Jh[11]?(this.ah=!0,this.$h=11,this.uh=!0):this.tf>=706&&this.tf<=736&&this.if>=492&&this.if<529&&-1!==this.Jh[12]?(this.ah=!0,this.$h=12,this.uh=!0):this.tf>=734&&this.tf<=768&&this.if>=492&&this.if<528&&-1!==this.Jh[13]&&(this.ah=!0,this.$h=13,this.uh=!0),$.K.Dt++,$.K.Dt>150&&($.K.Dt=0,this.ri.If(O.A.By),this.ri.p1(43)))};zf=async()=>{for(;;){let t;do{for(;;){if(t=this.hf(),-1===t)return;if(-1!==this.wh&&this.wh===this.tn){8===t&&this.Je.length>0&&(this.Je=this.Je.substring(0,this.Je.length-1));break}if(this.ee){if(t>=32&&t<=122&&this.re.length<80&&(this.re=this.re+String.fromCharCode(t),this.fh=!0),8===t&&this.re.length>0&&(this.re=this.re.substring(0,this.re.length-1),this.fh=!0),13===t||10===t){let t;if(this.ee=!1,this.fh=!0,1===this.oe&&(t=M.A.xd(this.re),this.yy(t)),2===this.oe&&this.uo>0&&(t=M.A.xd(this.re),this.py(t)),3===this.oe&&this.re.length>0&&this.bo){this.ri.If(O.A.Gy),this.ri.p1(0);const t=this.ri.ft;this.ri.Dy(this.bo),b.A.Hy(this.ri,this.re),this.ri.fu(this.ri.ft-t),this.re=M.A.Wy(this.re),this.re=v.A.filter(this.re),this.lw(6,this.re,M.A.za(M.A.ja(this.bo))),2===this.te&&(this.te=1,this.dh=!0,this.ri.If(O.A.Yy),this.ri.p1(this.Qh),this.ri.p1(this.te),this.ri.p1(this.ie))}4===this.oe&&this.Nh<100&&(t=M.A.xd(this.re),this.Ay(t)),5===this.oe&&this.Nh>0&&(t=M.A.xd(this.re),this.my(t))}}else if(this.ae){if(t>=48&&t<=57&&this.le.length<10&&(this.le=this.le+String.fromCharCode(t),this.fh=!0),8===t&&this.le.length>0&&(this.le=this.le.substring(0,this.le.length-1),this.fh=!0),13===t||10===t){if(this.le.length>0){let t=0;try{t=parseInt(this.le,10)}catch(t){}this.ri.If(O.A.Vy),this.ri.p4(t)}this.ae=!1,this.fh=!0}}else if(-1===this.Mh&&(t>=32&&t<=122&&this.pe.length<80&&(this.pe=this.pe+String.fromCharCode(t),this.fh=!0),8===t&&this.pe.length>0&&(this.pe=this.pe.substring(0,this.pe.length-1),this.fh=!0),(13===t||10===t)&&this.pe.length>0)){if('::clientdrop'===this.pe)await this.gf();else if(this.oo&&'::noclip'===this.pe)for(let t=0;t122)&&(t<65||t>90)&&(t<48||t>57)&&32!==t);this.Je.length<12&&(this.Je=this.Je+String.fromCharCode(t))}};Yf=()=>{if(1===this.Qc)if(this.tf>=8&&this.tf<=108&&this.if>=490&&this.if<=522)this.Qh=(this.Qh+1)%4,this.dh=!0,this.fh=!0,this.ri.If(O.A.Yy),this.ri.p1(this.Qh),this.ri.p1(this.te),this.ri.p1(this.ie);else if(this.tf>=137&&this.tf<=237&&this.if>=490&&this.if<=522)this.te=(this.te+1)%3,this.dh=!0,this.fh=!0,this.ri.If(O.A.Yy),this.ri.p1(this.Qh),this.ri.p1(this.te),this.ri.p1(this.ie);else if(this.tf>=275&&this.tf<=375&&this.if>=490&&this.if<=522)this.ie=(this.ie+1)%3,this.dh=!0,this.fh=!0,this.ri.If(O.A.Yy),this.ri.p1(this.Qh),this.ri.p1(this.te),this.ri.p1(this.ie);else if(this.tf>=416&&this.tf<=516&&this.if>=490&&this.if<=522){this.uy(),this.Je='',this.Qe=!1;for(let t=0;t{if(this.se?this.he=32:this.he=0,this.se=!1,t>=n&&t=r&&i=n&&t=r+h-16&&i=n-this.he&&t=r+16&&i0){let t=(h-32)*h/s|0;t<8&&(t=8);const n=i-r-(t/2|0)-16,l=h-t-32;o.Zl=(s-h)*n/l|0,e&&(this.ah=!0),this.se=!0}};Af=()=>{this.ns||(this.$o(),this.tl=null,this.gi=null,this._i=null,this.Ci=null,this.Ti=null,this.Oi=null,this.vi=null,this.bi=null,this.Li=null,this.Ri=null,this.ns=new f.A(479,96),this.hs=new f.A(168,160),u.A.clear(),this.Ss?.draw(0,0),this.ss=new f.A(190,261),this.es=new f.A(512,334),u.A.clear(),this.rs=new f.A(501,61),this.os=new f.A(288,40),this.ls=new f.A(269,66),this.mi=!0)};ku=t=>{if(!t)return!1;for(let i=0;i{if(0n===t)return;if(this.uo>=100)return void this.lw(0,'Your friends list is full. Max of 100 hit','');const i=M.A.za(M.A.ja(t));for(let s=0;s{if(0n!==t)for(let i=0;i{if(0n===t)return;if(this.Nh>=100)return void this.lw(0,'Your ignore list is full. Max of 100 hit','');const i=M.A.za(M.A.ja(t));for(let s=0;s{if(0n!==t)for(let i=0;i{const s=this.Vr[this.ir][t][i];if(!s)return void this.cn?.Qy(this.ir,t,i);let h=-99999999,e=null;for(let t=s.head();t;t=s.next()){const i=n.A.get(t.index);let s=i.tA;i.Ua&&(s*=t.count+1),s>h&&(h=s,e=t)}if(!e)return;s.iA(e);let r=-1,o=-1,l=0,a=0;for(let t=s.head();t;t=s.next())t.index!==e.index&&-1===r&&(r=t.index,l=t.count),t.index!==e.index&&t.index!==r&&-1===o&&(o=t.index,a=t.count);let c=null;-1!==r&&(c=n.A.get(r).sA(l));let f=null;-1!==o&&(f=n.A.get(o).sA(a));const u=t+(i<<7)+1610612736|0,d=n.A.get(e.index);this.cn?.hA(t,i,this.au(this.ir,128*t+64,128*i+64),this.ir,u,d.sA(e.count),f,c)};eA=(t,i,s,h,n,r,o)=>{if(i<1||s<1||i>102||s>102)return;if($.K.vt&&t!==this.ir)return;if(!this.cn)return;let l=0;if(o===N.A.nA&&(l=this.cn.Kd(t,i,s)),o===N.A.rA&&(l=this.cn.oA(t,s,i)),o===N.A.lA&&(l=this.cn.iw(t,i,s)),o===N.A.Fy&&(l=this.cn.Bd(t,i,s)),0!==l){const h=this.cn.Xd(t,i,s,l),n=l>>14&32767,r=31&h,a=h>>6;if(o===N.A.nA){this.cn?.aA(t,i,s,1);const h=e.A.get(n);h.cA&&this.Qn[t]?.aA(i,s,r,a,h.fA)}if(o===N.A.rA&&this.cn?.uA(t,i,s),o===N.A.lA){this.cn.dA(t,i,s);const h=e.A.get(n);if(i+h.width>G.A.yr-1||s+h.width>G.A.yr-1||i+h.length>G.A.yr-1||s+h.length>G.A.yr-1)return;h.cA&&this.Qn[t]?.dA(i,s,h.width,h.length,a,h.fA)}if(o===N.A.Fy){this.cn?.wA(t,i,s);const h=e.A.get(n);h.cA&&h.active&&this.Qn[t]?.yA(i,s)}}if(h>=0){let e=t;this.ur&&t<3&&!(2&~this.ur[1][i][s])&&(e=t+1),this.cr&&D.A.eA(t,i,s,this.cn,this.cr,this.Wr,this.Qn[t],h,r,n,e)}};uy=()=>{this.ri.If(O.A.AA),-1!==this.Sh&&(this.Sh=-1,this.ah=!0,this.Fe=!1,this.uh=!0),-1!==this.Mh&&(this.Mh=-1,this.fh=!0,this.Fe=!1),this.wh=-1};gf=async()=>{this.ci>0?await this.pA():(this.es?.bind(),this.Ni?.Hc(257,144,'Connection lost',m.A.ca),this.Ni?.Hc(256,143,'Connection lost',m.A.Kl),this.Ni?.Hc(257,159,'Please wait - attempting to reestablish',m.A.ca),this.Ni?.Hc(256,158,'Please wait - attempting to reestablish',m.A.Kl),this.es?.draw(8,11),this.wn=0,this.stream?.close(),this.Nc=!1,await this.sf(this.username,this.password,!0),this.Nc||await this.pA())};pA=async()=>{this.stream&&this.stream.close(),this.stream=null,this.Nc=!1,this.Ii=0,this.username='',this.password='',k.A.df(),this.Cu(),this.cn?.reset();for(let t=0;t{if(!this.stream)return!1;try{let t=this.stream.available;if(0===t)return!1;if(-1===this.di&&(await this.stream.lf(this.in.data,0,1),this.di=255&this.in.data[0],this.ui&&(this.di=this.di-this.ui.mA&255),this.packetSize=g.A.IA[this.di],t--),-1===this.packetSize){if(t<=0)return!1;await this.stream.lf(this.in.data,0,1),this.packetSize=255&this.in.data[0],t--}if(-2===this.packetSize){if(t<=1)return!1;await this.stream.lf(this.in.data,0,2),this.in.ft=0,this.packetSize=this.in.ct,t-=2}if(t0&&this.lw(5,s+' has logged in.',''),0===i&&this.lw(5,s+' has logged out.','')),s=null;break}s&&this.uo<100&&(this.Oo[this.uo]=t,this.To[this.uo]=s,this.vo[this.uo]=i,this.uo++,this.ah=!0);let h=!1;for(;!h;){h=!0;for(let t=0;t=0&&h>=0&&s=G.A.yr||t.z>=G.A.yr)&&t.SA();return 0!==this.wn&&(this.wn-=e,this.yn-=n),this.An=!1,this.di=-1,!0}if(this.di===T.A.MA)return c.A.Jo[this.in.ct].model=this.Jr?.kA()||null,this.di=-1,!0;if(this.di===T.A.xA)return this.Fh=this.in.CA,1===this.Fh&&(this.Uh=this.in.ct),this.Fh>=2&&this.Fh<=6&&(2===this.Fh&&(this.Bh=64,this.Gh=64),3===this.Fh&&(this.Bh=0,this.Gh=64),4===this.Fh&&(this.Bh=128,this.Gh=64),5===this.Fh&&(this.Bh=64,this.Gh=0),6===this.Fh&&(this.Bh=64,this.Gh=128),this.Fh=2,this.Wh=this.in.ct,this.Yh=this.in.ct,this.Vh=this.in.CA),10===this.Fh&&(this.Hh=this.in.ct),this.di=-1,!0;if(this.di===T.A.DA){const t=this.in.NA,i=this.in.ut,s=this.in.ut;return t!==this.Go&&this.Bo&&!$.K.vt&&await this.Al(t,i,s,!0),this.Go=t,this.Ho=i,this.Wo=s,this.Uo=0,this.di=-1,!0}if(this.di===T.A.PA)return await this.pA(),this.di=-1,!1;if(this.di===T.A.FA){const t=this.in.CA,i=this.in.CA;let s=-1;if(this.Zn)for(let h=0;h=100&&(this.Rn=128*this.Cr+64,this.Mn=128*this.Tr+64,this.Sn=this.au(this.ir,this.Cr,this.Tr)-this.Or),this.di=-1,!0;if(this.di===T.A.Op){this.Hn=this.in.CA,this.Wn=this.in.CA;for(let t=this.Hn;t=this.Hn&&t.x=this.Wn&&t.z1?this.lw(7,e,M.A.za(M.A.ja(t))):this.lw(3,e,M.A.za(M.A.ja(t)))}catch(t){}return this.di=-1,!0}if(this.di===T.A.Mp){for(let t=0;t=100){const t=128*this.mr+64,i=128*this.Ir+64,s=this.au(this.ir,this.mr,this.Ir)-this.Er,h=t-this.Rn,e=s-this.Sn,n=i-this.Mn,r=0|Math.sqrt(h*h+n*n);this.kn=325.949*Math.atan2(e,r)&2047,this.xn=-325.949*Math.atan2(h,n)&2047,this.kn<128&&(this.kn=128),this.kn>383&&(this.kn=383)}return this.di=-1,!0}if(this.di===T.A.Pp)return this.$h=this.in.CA,this.ah=!0,this.uh=!0,this.di=-1,!0;if(this.di===T.A.Fp){const t=this.in.NA;let i;if(t.endsWith(':tradereq:')){const s=t.substring(0,t.indexOf(':'));i=M.A.xd(s);let h=!1;for(let t=0;t>10&31,h=i>>5&31,e=31&i;return c.A.Jo[t].wa=(s<<19)+(h<<11)+(e<<3),this.di=-1,!0}if(this.di===T.A.Vp){for(let t=0;t=this.jh[s]&&(this.zh[t]=s+2);return this.di=-1,!0}if(this.di===T.A.$p){for(this.Hn=this.in.CA,this.Wn=this.in.CA;this.in.ft=0&&t{try{this.Gn=-1,this.Yr.clear(),this.Wr.clear(),this.Hr.clear(),this.Gr.clear(),d.A.rm(),this.Cu(),this.cn?.reset();for(let t=0;t>8,s=255&this.Zn[t];if(33===i&&s>=71&&s<=73){D.A.vt=!1;break}}if($.K.vt?this.cn?.om(this.ir):this.cn?.om(0),this.Zn&&this.zn){this.ri.If(O.A.qf);for(let s=0;s>8)-this.Kn,h=64*(255&this.Zn[s])-this.Xn,e=this.zn[s];if(e){const s=new I.A(new Uint8Array(e)).ut,n=R.A.read(s,e,e.length-4,4);t.lm(8*(this.Yn-6),8*(this.Vn-6),i,h,n)}else this.Vn<800&&t.am(h,i,64,64)}}if(this.Zn&&this.jn){this.ri.If(O.A.qf);for(let s=0;s>8)-this.Kn,r=64*(255&this.Zn[s])-this.Xn;t.fm(this.cn,this.Wr,this.Qn,e,n,r)}}}this.ri.If(O.A.qf),t.um(this.cn,this.Qn),this.es?.bind(),this.ri.If(O.A.qf);for(let t=this.Wr.head();t;t=this.Wr.next())2===(this.ur&&2&this.ur[1][t.dm][t.wm])&&(t.ym--,t.ym<0&&t.SA());for(let t=0;t{const i=c.A.Jo[t];if(i.xl)for(let t=0;t{let t=0;for(let i=0;i<99;i++){const s=i+1;t+=s+300*Math.pow(2,s/7)|0,this.jh[i]=t/4|0}};lw=(t,i,s)=>{0===t&&-1!==this.ce&&(this.Zh=i,this.Qc=0),-1===this.Mh&&(this.fh=!0);for(let t=99;t>0;t--)this.messageType[t]=this.messageType[t-1],this.ue[t]=this.ue[t-1],this.fe[t]=this.fe[t-1];$.K.Rt&&0===t&&(i='['+(this.hi/30|0)+']: '+i),this.messageType[0]=t,this.ue[0]=s,this.fe[0]=i};ly=async t=>{const i=a.A.Jo[t].pm;if(0!==i){const s=this.Ue[t];if(1===i&&(1===s&&d.A.Lc(.9),2===s&&d.A.Lc(.8),3===s&&d.A.Lc(.7),4===s&&d.A.Lc(.6),n.A.vu?.clear(),this.mi=!0),3===i){const t=this.Bo;0===s&&(this.Yo=256,(0,j.Im)(256),this.Bo=!0),1===s&&(this.Yo=192,(0,j.Im)(192),this.Bo=!0),2===s&&(this.Yo=128,(0,j.Im)(128),this.Bo=!0),3===s&&(this.Yo=64,(0,j.Im)(64),this.Bo=!0),4===s&&(this.Bo=!1),this.Bo!==t&&(this.Bo&&this.Go?await this.Al(this.Go,this.Ho,this.Wo,!1):(0,j.qo)(!1),this.Uo=0)}4===i&&(0===s&&(this.xo=256,(0,j.Em)(256),this.Ro=!0),1===s&&(this.xo=192,(0,j.Em)(192),this.Ro=!0),2===s&&(this.xo=128,(0,j.Em)(128),this.Ro=!0),3===s&&(this.xo=64,(0,j.Em)(64),this.Ro=!0),4===s&&(this.Ro=!1)),5===i&&(this.Ve=s),6===i&&(this.Ae=s),8===i&&(this.ye=s,this.fh=!0)}};gm=(t,i)=>{let s=0;for(let t=0;t<100;t++){if(!this.fe[t])continue;const h=this.messageType[t],e=this.Dh+70+4-14*s;if(e<-20)break;0===h&&s++,1!==h&&2!==h||!(1===h||0===this.Qh||1===this.Qh&&this.ku(this.ue[t]))||(i>e-14&&i<=e&&this.Jr&&this.ue[t]!==this.Jr.name&&(this.oo&&(this.Rh[this.Lh]='Report abuse @whi@'+this.ue[t],this.Ke[this.Lh]=34,this.Lh++),this.Rh[this.Lh]='Add ignore @whi@'+this.ue[t],this.Ke[this.Lh]=436,this.Lh++,this.Rh[this.Lh]='Add friend @whi@'+this.ue[t],this.Ke[this.Lh]=406,this.Lh++),s++),3!==h&&7!==h||0!==this.ye||!(7===h||0===this.te||1===this.te&&this.ku(this.ue[t]))||(i>e-14&&i<=e&&(this.oo&&(this.Rh[this.Lh]='Report abuse @whi@'+this.ue[t],this.Ke[this.Lh]=34,this.Lh++),this.Rh[this.Lh]='Add ignore @whi@'+this.ue[t],this.Ke[this.Lh]=436,this.Lh++,this.Rh[this.Lh]='Add friend @whi@'+this.ue[t],this.Ke[this.Lh]=406,this.Lh++),s++),4===h&&(0===this.ie||1===this.ie&&this.ku(this.ue[t]))&&(i>e-14&&i<=e&&(this.Rh[this.Lh]='Accept trade @whi@'+this.ue[t],this.Ke[this.Lh]=903,this.Lh++),s++),(5===h||6===h)&&0===this.ye&&this.te<2&&s++,8===h&&(0===this.ie||1===this.ie&&this.ku(this.ue[t]))&&(i>e-14&&i<=e&&(this.Rh[this.Lh]='Accept duel @whi@'+this.ue[t],this.Ke[this.Lh]=363,this.Lh++),s++)}};_m=t=>{if(0===this.ye)return;let i=0;0!==this.fi&&(i=1);for(let s=0;s<100;s++)if(null!==this.fe[s]){const h=this.messageType[s];if((3===h||7===h)&&(7===h||0===this.te||1===this.te&&this.ku(this.ue[s]))){const h=329-13*i;if(this.ea>8&&this.ea<520&&t-11>h-10&&t-11<=h+3&&(this.oo&&(this.Rh[this.Lh]='Report abuse @whi@'+this.ue[s],this.Ke[this.Lh]=2034,this.Lh++),this.Rh[this.Lh]='Add ignore @whi@'+this.ue[s],this.Ke[this.Lh]=2436,this.Lh++,this.Rh[this.Lh]='Add friend @whi@'+this.ue[s],this.Ke[this.Lh]=2406,this.Lh++),i++,i>=5)return}if((5===h||6===h)&&this.te<2&&(i++,i>=5))return}};Cm=(t,i,s,h,e,r)=>{if(0!==t.type||!t.xl||t.hide||ih+t.width||s>e+t.height||!t.Wl||!t.Yl)return;const o=t.xl.length;for(let l=0;l=0||0!==f.Aa)&&i>=o&&s>=a&&i=0?this.$e=f.Tm:this.$e=f.id),0===f.type)this.Cm(f,i,s,o,a,f.Zl),f.scroll>f.height&&this.Qf(i,s,f.scroll,f.height,!0,o+f.width,a,f);else if(2===f.type){let t=0;for(let h=0;h=r+32||s>=l+32){t++;continue}if(this.qe=t,this.Ze=f.id,!f.Ql||f.Ql[t]<=0){t++;continue}const c=n.A.get(f.Ql[t]-1);if(1===this.Le&&f.Om)f.id===this.Se&&t===this.Re||(this.Rh[this.Lh]='Use '+this.ke+' with @lre@'+c.name,this.Ke[this.Lh]=881,this.Xe[this.Lh]=c.id,this.ze[this.Lh]=t,this.je[this.Lh]=f.id,this.Lh++);else if(1===this.Ge&&f.Om)16&~this.We||(this.Rh[this.Lh]=this.Ye+' @lre@'+c.name,this.Ke[this.Lh]=391,this.Xe[this.Lh]=c.id,this.ze[this.Lh]=t,this.je[this.Lh]=f.id,this.Lh++);else{if(f.Om)for(let i=4;i>=3;i--)c.vm&&c.vm[i]?(this.Rh[this.Lh]=c.vm[i]+' @lre@'+c.name,3===i?this.Ke[this.Lh]=478:4===i&&(this.Ke[this.Lh]=347),this.Xe[this.Lh]=c.id,this.ze[this.Lh]=t,this.je[this.Lh]=f.id,this.Lh++):4===i&&(this.Rh[this.Lh]='Drop @lre@'+c.name,this.Ke[this.Lh]=347,this.Xe[this.Lh]=c.id,this.ze[this.Lh]=t,this.je[this.Lh]=f.id,this.Lh++);if(f.bm&&(this.Rh[this.Lh]='Use @lre@'+c.name,this.Ke[this.Lh]=188,this.Xe[this.Lh]=c.id,this.ze[this.Lh]=t,this.je[this.Lh]=f.id,this.Lh++),f.Om&&c.vm)for(let i=2;i>=0;i--)c.vm[i]&&(this.Rh[this.Lh]=c.vm[i]+' @lre@'+c.name,0===i?this.Ke[this.Lh]=405:1===i?this.Ke[this.Lh]=38:2===i&&(this.Ke[this.Lh]=422),this.Xe[this.Lh]=c.id,this.ze[this.Lh]=t,this.je[this.Lh]=f.id,this.Lh++);if(f.Lm)for(let i=4;i>=0;i--)f.Lm[i]&&(this.Rh[this.Lh]=f.Lm[i]+' @lre@'+c.name,0===i?this.Ke[this.Lh]=602:1===i?this.Ke[this.Lh]=596:2===i?this.Ke[this.Lh]=22:3===i?this.Ke[this.Lh]=892:4===i&&(this.Ke[this.Lh]=415),this.Xe[this.Lh]=c.id,this.ze[this.Lh]=t,this.je[this.Lh]=f.id,this.Lh++);this.Rh[this.Lh]='Examine @lre@'+c.name,$.K.Rt&&(this.Rh[this.Lh]+='@whi@ ('+c.id+')'),this.Ke[this.Lh]=1773,this.Xe[this.Lh]=c.id,f.ta&&(this.je[this.Lh]=f.ta[t]),this.Lh++}t++}}else if(i>=o&&s>=a&&i{let i=t.Xl;return i>=c.A.Ga&&i<=c.A.Ya?(i>=c.A.Wa?i-=c.A.Wa:i--,this.Rh[this.Lh]='Remove @whi@'+this.To[i],this.Ke[this.Lh]=557,this.Lh++,this.Rh[this.Lh]='Message @whi@'+this.To[i],this.Ke[this.Lh]=679,this.Lh++,!0):i>=c.A.Ka&&i<=c.A.Xa&&(this.Rh[this.Lh]='Remove @whi@'+t.text,this.Ke[this.Lh]=556,this.Lh++,!0)};Pm=()=>{0===this.Le&&0===this.Ge&&(this.Rh[this.Lh]='Walk here',this.Ke[this.Lh]=660,this.ze[this.Lh]=this.ea,this.je[this.Lh]=this.na,this.Lh++);let t=-1;for(let i=0;i>7&127,o=s>>29&3,l=s>>14&32767;if(s!==t){if(t=s,2===o&&this.cn&&this.cn.Xd(this.ir,h,r,s)>=0){const t=e.A.get(l);if(1===this.Le)this.Rh[this.Lh]='Use '+this.ke+' with @cya@'+t.name,this.Ke[this.Lh]=450,this.Xe[this.Lh]=s,this.ze[this.Lh]=h,this.je[this.Lh]=r,this.Lh++;else if(1!==this.Ge){if(t.Um)for(let i=4;i>=0;i--)t.Um[i]&&(this.Rh[this.Lh]=t.Um[i]+' @cya@'+t.name,0===i&&(this.Ke[this.Lh]=285),1===i&&(this.Ke[this.Lh]=504),2===i&&(this.Ke[this.Lh]=364),3===i&&(this.Ke[this.Lh]=581),4===i&&(this.Ke[this.Lh]=1501),this.Xe[this.Lh]=s,this.ze[this.Lh]=h,this.je[this.Lh]=r,this.Lh++);this.Rh[this.Lh]='Examine @cya@'+t.name,$.K.Rt&&(this.Rh[this.Lh]+='@whi@ ('+t.id+')'),this.Ke[this.Lh]=1175,this.Xe[this.Lh]=s,this.ze[this.Lh]=h,this.je[this.Lh]=r,this.Lh++}else 4&~this.We||(this.Rh[this.Lh]=this.Ye+' @cya@'+t.name,this.Ke[this.Lh]=55,this.Xe[this.Lh]=s,this.ze[this.Lh]=h,this.je[this.Lh]=r,this.Lh++)}if(1===o){const t=this.Fr[l];if(t&&t.type&&1===t.type.size&&64==(127&t.x)&&64==(127&t.z))for(let i=0;i=0;s--)t.Um&&t.Um[s]?(this.Rh[this.Lh]=t.Um[s]+' @lre@'+t.name,0===s&&(this.Ke[this.Lh]=224),1===s&&(this.Ke[this.Lh]=993),2===s&&(this.Ke[this.Lh]=99),3===s&&(this.Ke[this.Lh]=746),4===s&&(this.Ke[this.Lh]=877),this.Xe[this.Lh]=i.index,this.ze[this.Lh]=h,this.je[this.Lh]=r,this.Lh++):2===s&&(this.Rh[this.Lh]='Take @lre@'+t.name,this.Ke[this.Lh]=99,this.Xe[this.Lh]=i.index,this.ze[this.Lh]=h,this.je[this.Lh]=r,this.Lh++);this.Rh[this.Lh]='Examine @lre@'+t.name,$.K.Rt&&(this.Rh[this.Lh]+='@whi@ ('+i.index+')'),this.Ke[this.Lh]=1102,this.Xe[this.Lh]=i.index,this.ze[this.Lh]=h,this.je[this.Lh]=r,this.Lh++}else 1&~this.We||(this.Rh[this.Lh]=this.Ye+' @lre@'+t.name,this.Ke[this.Lh]=965,this.Xe[this.Lh]=i.index,this.ze[this.Lh]=h,this.je[this.Lh]=r,this.Lh++)}}}}};Bm=(t,i,s,h)=>{if(this.Lh>=400)return;let e=t.name;if(0!==t.Ym&&this.Jr&&(e=e+this.Vm(this.Jr.Ac,t.Ym)+' (level-'+t.Ym+')'),1===this.Le)this.Rh[this.Lh]='Use '+this.ke+' with @yel@'+e,this.Ke[this.Lh]=900,this.Xe[this.Lh]=i,this.ze[this.Lh]=s,this.je[this.Lh]=h,this.Lh++;else if(1!==this.Ge){let n;if(t.Um)for(n=4;n>=0;n--)t.Um[n]&&'attack'!==t.Um[n]?.toLowerCase()&&(this.Rh[this.Lh]=t.Um[n]+' @yel@'+e,0===n?this.Ke[this.Lh]=728:1===n?this.Ke[this.Lh]=542:2===n?this.Ke[this.Lh]=6:3===n?this.Ke[this.Lh]=963:4===n&&(this.Ke[this.Lh]=245),this.Xe[this.Lh]=i,this.ze[this.Lh]=s,this.je[this.Lh]=h,this.Lh++);if(t.Um)for(n=4;n>=0;n--)if(t.Um[n]&&'attack'===t.Um[n]?.toLowerCase()){let r=0;this.Jr&&t.Ym>this.Jr.Ac&&(r=2e3),this.Rh[this.Lh]=t.Um[n]+' @yel@'+e,0===n?this.Ke[this.Lh]=r+728:1===n?this.Ke[this.Lh]=r+542:2===n?this.Ke[this.Lh]=r+6:3===n?this.Ke[this.Lh]=r+963:4===n&&(this.Ke[this.Lh]=r+245),this.Xe[this.Lh]=i,this.ze[this.Lh]=s,this.je[this.Lh]=h,this.Lh++}this.Rh[this.Lh]='Examine @yel@'+e,$.K.Rt&&(this.Rh[this.Lh]+='@whi@ ('+t.id+')'),this.Ke[this.Lh]=1607,this.Xe[this.Lh]=i,this.ze[this.Lh]=s,this.je[this.Lh]=h,this.Lh++}else 2&~this.We||(this.Rh[this.Lh]=this.Ye+' @yel@'+e,this.Ke[this.Lh]=265,this.Xe[this.Lh]=i,this.ze[this.Lh]=s,this.je[this.Lh]=h,this.Lh++)};Gm=(t,i,s,h)=>{if(t===this.Jr||this.Lh>=400)return;let e=null;this.Jr&&(e=t.name+this.Vm(this.Jr.Ac,t.Ac)+' (level-'+t.Ac+')'),1===this.Le?(this.Rh[this.Lh]='Use '+this.ke+' with @whi@'+e,this.Ke[this.Lh]=367,this.Xe[this.Lh]=i,this.ze[this.Lh]=s,this.je[this.Lh]=h,this.Lh++):1!==this.Ge?(this.Rh[this.Lh]='Follow @whi@'+e,this.Ke[this.Lh]=1544,this.Xe[this.Lh]=i,this.ze[this.Lh]=s,this.je[this.Lh]=h,this.Lh++,0===this.Eh&&(this.Rh[this.Lh]='Trade with @whi@'+e,this.Ke[this.Lh]=1373,this.Xe[this.Lh]=i,this.ze[this.Lh]=s,this.je[this.Lh]=h,this.Lh++),this.no>0&&(this.Rh[this.Lh]='Attack @whi@'+e,this.Jr&&this.Jr.Ac>=t.Ac?this.Ke[this.Lh]=151:this.Ke[this.Lh]=2151,this.Xe[this.Lh]=i,this.ze[this.Lh]=s,this.je[this.Lh]=h,this.Lh++),1===this.ro&&(this.Rh[this.Lh]='Fight @whi@'+e,this.Ke[this.Lh]=151,this.Xe[this.Lh]=i,this.ze[this.Lh]=s,this.je[this.Lh]=h,this.Lh++),2===this.ro&&(this.Rh[this.Lh]='Duel-with @whi@'+e,this.Ke[this.Lh]=1101,this.Xe[this.Lh]=i,this.ze[this.Lh]=s,this.je[this.Lh]=h,this.Lh++)):8&~this.We||(this.Rh[this.Lh]=this.Ye+' @whi@'+e,this.Ke[this.Lh]=651,this.Xe[this.Lh]=i,this.ze[this.Lh]=s,this.je[this.Lh]=h,this.Lh++);for(let t=0;t{const s=t-i;return s<-9?'@red@':s<-6?'@or3@':s<-3?'@or2@':s<0?'@or1@':s>9?'@gre@':s>6?'@gr3@':s>3?'@gr2@':s>0?'@gr1@':'@yel@'};Rf=()=>{if(0===this.Ce){this.Rh[0]='Cancel',this.Ke[0]=1252,this.Lh=1,this._m(this.na),this.$e=0,this.ea>8&&this.na>11&&this.ea<520&&this.na<345&&(-1===this.wh?this.Pm():this.Cm(c.A.Jo[this.wh],this.ea,this.na,8,11,0)),this.$e!==this.me&&(this.me=this.$e),this.$e=0,this.ea>562&&this.na>231&&this.ea<752&&this.na<492&&(-1!==this.Sh?this.Cm(c.A.Jo[this.Sh],this.ea,this.na,562,231,0):-1!==this.Jh[this.$h]&&this.Cm(c.A.Jo[this.Jh[this.$h]],this.ea,this.na,562,231,0)),this.$e!==this.Ie&&(this.ah=!0,this.Ie=this.$e),this.$e=0,this.ea>22&&this.na>375&&this.ea<431&&this.na<471&&(-1===this.Mh?this.gm(this.ea-22,this.na-375):this.Cm(c.A.Jo[this.Mh],this.ea,this.na,22,375,0)),-1!==this.Mh&&this.$e!==this.Ee&&(this.fh=!0,this.Ee=this.$e);let t=!1;for(;!t;){t=!0;for(let i=0;i1e3){const s=this.Rh[i];this.Rh[i]=this.Rh[i+1],this.Rh[i+1]=s;const h=this.Ke[i];this.Ke[i]=this.Ke[i+1],this.Ke[i+1]=h;const e=this.ze[i];this.ze[i]=this.ze[i+1],this.ze[i+1]=e;const n=this.je[i];this.je[i]=this.je[i+1],this.je[i+1]=n;const r=this.Xe[i];this.Xe[i]=this.Xe[i+1],this.Xe[i+1]=r,t=!1}}}};kf=()=>{let t=0;if(this.Pi){let i;t=this.Pi.xu('Choose Option');for(let s=0;st&&(t=i)}t+=8;const i=15*this.Lh+21;let s,h;this.tf>8&&this.if>11&&this.tf<520&&this.if<345&&(s=this.tf-(t/2|0)-8,s+t>512?s=512-t:s<0&&(s=0),h=this.if-11,h+i>334?h=334-i:h<0&&(h=0),this.gh=!0,this._h=0,this.Ch=s,this.Th=h,this.Oh=t,this.bh=15*this.Lh+22),this.tf>562&&this.if>231&&this.tf<752&&this.if<492&&(s=this.tf-(t/2|0)-562,s<0?s=0:s+t>190&&(s=190-t),h=this.if-231,h<0?h=0:h+i>261&&(h=261-i),this.gh=!0,this._h=1,this.Ch=s,this.Th=h,this.Oh=t,this.bh=15*this.Lh+22),this.tf>22&&this.if>375&&this.tf<501&&this.if<471&&(s=this.tf-(t/2|0)-22,s<0?s=0:s+t>479&&(s=479-t),h=this.if-375,h<0?h=0:h+i>96&&(h=96-i),this.gh=!0,this._h=2,this.Ch=s,this.Th=h,this.Oh=t,this.bh=15*this.Lh+22)};Ff=(t,i,s,h,e,n,r,o,l,a,c)=>{const f=this.Qn[this.ir];if(!f)return!1;const u=G.A.yr,d=G.A.yr;for(let t=0;t0&&0===this.Zr[i]&&(g[i]&H.A.Hd)===H.A.OPEN&&(this.zr[p]=w-1,this.jr[p]=y,p=(p+1)%E,this.Zr[i]=2,this.qr[i]=t),i=G.A.index(w+1,y),w0&&0===this.Zr[i]&&(g[i]&H.A.Yd)===H.A.OPEN&&(this.zr[p]=w,this.jr[p]=y-1,p=(p+1)%E,this.Zr[i]=1,this.qr[i]=t),i=G.A.index(w,y+1),y0&&y>0&&0===this.Zr[i]&&!(g[i]&H.A.Zm)&&(g[G.A.index(w-1,y)]&H.A.Hd)===H.A.OPEN&&(g[G.A.index(w,y-1)]&H.A.Yd)===H.A.OPEN&&(this.zr[p]=w-1,this.jr[p]=y-1,p=(p+1)%E,this.Zr[i]=3,this.qr[i]=t),i=G.A.index(w+1,y-1),w0&&0===this.Zr[i]&&!(g[i]&H.A.qm)&&(g[G.A.index(w+1,y)]&H.A.Wd)===H.A.OPEN&&(g[G.A.index(w,y-1)]&H.A.Yd)===H.A.OPEN&&(this.zr[p]=w+1,this.jr[p]=y-1,p=(p+1)%E,this.Zr[i]=9,this.qr[i]=t),i=G.A.index(w-1,y+1),w>0&&y=0&&s>=0&&e0){E=Math.min(m,25),m--;const t=this.zr[m],i=this.jr[m];if($.K.Rt&&1===this.vf[6]&&1===this.vf[7]){for(let t=0;t{this.kr=0,this.Mr=0,this.sI(t),this.hI(t),this.eI(t,i),this.nI(t);for(let t=0;t{t.rI();if(0!==t.oI(1)){const i=t.oI(2);if(0===i)this.Dr[this.Mr++]=this.Jt;else if(1===i){const i=t.oI(3);this.Jr?.step(!1,i);1===t.oI(1)&&(this.Dr[this.Mr++]=this.Jt)}else if(2===i){const i=t.oI(3);this.Jr?.step(!0,i);const s=t.oI(3);this.Jr?.step(!0,s);1===t.oI(1)&&(this.Dr[this.Mr++]=this.Jt)}else if(3===i){this.ir=t.oI(2);const i=t.oI(7),s=t.oI(7),h=t.oI(1);this.Jr?.move(1===h,i,s);1===t.oI(1)&&(this.Dr[this.Mr++]=this.Jt)}}};hI=t=>{const i=t.oI(8);if(ithis.Rr)throw new Error(`eek! ${this.username} Too many players`);this.Rr=0;for(let s=0;s{let s;for(;t.lI+10<8*i&&(s=t.oI(11),2047!==s);){if(!this.Lr[s]){this.Lr[s]=new W.A;const t=this.Pr[s];t&&this.Lr[s]?.read(t)}this.Sr[this.Rr++]=s;const i=this.Lr[s];i&&(i.wu=this.hi);let h=t.oI(5);h>15&&(h-=32);let e=t.oI(5);e>15&&(e-=32);const n=t.oI(1);this.Jr&&i?.move(1===n,this.Jr.Uf[0]+h,this.Jr.Bf[0]+e);1===t.oI(1)&&(this.Dr[this.Mr++]=s)}t.aI()};nI=t=>{for(let i=0;i{if(t.Ku=s,t.Xu=this.hi,(s&W.A.zu)===W.A.zu){const s=e.CA,h=new Uint8Array(s),n=new I.A(h);e.sp(s,0,h),this.Pr[i]=n,t.read(n)}if((s&W.A.ju)===W.A.ju){let i=e.ct;65535===i&&(i=-1),i===t.Zu&&(t.uI=0);const s=e.CA;(-1===i||-1===t.Zu||h.A.Jo[i].priority>h.A.Jo[t.Zu].priority||0===h.A.Jo[t.Zu].priority)&&(t.Zu=i,t.dI=0,t.wI=0,t.yI=s,t.uI=0)}if((s&W.A.qu)===W.A.qu&&(t.$u=e.ct,65535===t.$u&&(t.$u=-1)),(s&W.A.Ju)===W.A.Ju&&(t.Mu=e.NA,t.Du=0,t.Nu=0,t.Pu=150,t.name&&this.lw(2,t.Mu,t.name)),(s&W.A.Qu)===W.A.Qu&&(t.Hu=e.CA,t.Gu=e.CA,t.Fu=this.hi+400,t.Uu=e.CA,t.Bu=e.CA),(s&W.A.td)===W.A.td&&(t.AI=e.ct,t.pI=e.ct,t.sd=t.AI,t.hd=t.pI),(s&W.A.ed)===W.A.ed){const i=e.ct,s=e.CA,h=e.CA,n=e.ft;if(t.name){const n=M.A.xd(t.name);let r=!1;if(s<=1)for(let t=0;t>8,t.Nu=255&i,t.Pu=150,s>1?this.lw(1,r,t.name):this.lw(2,r,t.name)}catch(t){}}e.ft=n+h}if((s&W.A.nd)===W.A.nd){t.rd=e.ct;const i=e.ut;t.mI=i>>16,t.II=this.hi+(65535&i),t.EI=0,t.gI=0,t.II>this.hi&&(t.EI=-1),65535===t.rd&&(t.rd=-1)}(s&W.A.od)===W.A.od&&(t._I=e.CA,t.CI=e.CA,t.TI=e.CA,t.OI=e.CA,t.Wu=e.ct+this.hi,t.Yu=e.ct+this.hi,t.vI=e.CA,t.pathLength=0,t.Uf[0]=t.TI,t.Bf[0]=t.OI)};bA=(t,i)=>{this.kr=0,this.Mr=0,this.bI(t),this.LI(t,i),this.RI(t);for(let t=0;t{t.rI();const i=t.oI(8);if(ithis.Ur)throw new Error(`eek! ${this.username} Too many npcs`);this.Ur=0;for(let s=0;s{for(;t.lI+21<8*i;){const i=t.oI(13);if(8191===i)break;this.Fr[i]||(this.Fr[i]=new Y.A);const s=this.Fr[i];this.Br[this.Ur++]=i,s?(s.wu=this.hi,s.type=r.A.get(t.oI(11)),s.size=s.type.size,s.SI=s.type.MI,s.kI=s.type.xI,s.DI=s.type.NI,s.FI=s.type.UI,s.ic=s.type.BI):t.oI(11);let h=t.oI(5);h>15&&(h-=32);let e=t.oI(5);e>15&&(e-=32),this.Jr&&s?.move(!1,this.Jr.Uf[0]+h,this.Jr.Bf[0]+e);1===t.oI(1)&&(this.Dr[this.Mr++]=i)}t.aI()};RI=t=>{for(let i=0;ih.A.Jo[e.Zu].priority||0===h.A.Jo[e.Zu].priority)&&(e.Zu=i,e.dI=0,e.wI=0,e.yI=s,e.uI=0)}if((n&Y.A.qu)===Y.A.qu&&(e.$u=t.ct,65535===e.$u&&(e.$u=-1)),(n&Y.A.Ju)===Y.A.Ju&&(e.Mu=t.NA,e.Pu=100),(n&Y.A.Qu)===Y.A.Qu&&(e.Hu=t.CA,e.Gu=t.CA,e.Fu=this.hi+400,e.Uu=t.CA,e.Bu=t.CA),(n&Y.A.ld)===Y.A.ld&&(e.type=r.A.get(t.ct),e.SI=e.type.MI,e.kI=e.type.xI,e.DI=e.type.NI,e.FI=e.type.UI,e.ic=e.type.BI),(n&Y.A.nd)===Y.A.nd){e.rd=t.ct;const i=t.ut;e.mI=i>>16,e.II=this.hi+(65535&i),e.EI=0,e.gI=0,e.II>this.hi&&(e.EI=-1),65535===e.rd&&(e.rd=-1)}(n&Y.A.td)===Y.A.td&&(e.AI=t.ct,e.pI=t.ct,e.sd=e.AI,e.hd=e.pI)}};_f=()=>{for(let t=-1;t1406){$.K.Bt=0,this.ri.If(O.A.HI),this.ri.p1(0);const t=this.ri.ft;this.ri.p1(162),this.ri.p1(22),2*Math.random()|0||this.ri.p1(84),this.ri.p2(31824),this.ri.p2(13490),2*Math.random()|0||this.ri.p1(123),2*Math.random()|0||this.ri.p1(134),this.ri.p1(100),this.ri.p1(94),this.ri.p2(35521),this.ri.fu(this.ri.ft-t)}};GI=t=>{(t.x<128||t.z<128||t.x>=13184||t.z>=13184)&&(t.Zu=-1,t.rd=-1,t.Wu=0,t.Yu=0,t.x=128*t.Uf[0]+64*t.size,t.z=128*t.Bf[0]+64*t.size,t.pathLength=0),t===this.Jr&&(t.x<1536||t.z<1536||t.x>=11776||t.z>=11776)&&(t.Zu=-1,t.rd=-1,t.Wu=0,t.Yu=0,t.x=128*t.Uf[0]+64*t.size,t.z=128*t.Bf[0]+64*t.size,t.pathLength=0),t.Wu>this.hi?this.WI(t):t.Yu>=this.hi?this.YI(t):this.VI(t),this.KI(t),this.XI(t)};hu=()=>{if(this.Jr){this.Jr.x>>7===this.wn&&this.Jr.z>>7===this.yn&&(this.wn=0);for(let t=-1;t50||this.Rr>200)&&-1!==t&&i.zI===i.ic;const h=i.x>>7,e=i.z>>7;if(!(h<0||h>=G.A.yr||e<0||e>=G.A.yr))if(!i.jI||this.hi=i.qI){if(64==(127&i.x)&&64==(127&i.z)){if(this.dr[h][e]===this.dn)continue;this.dr[h][e]=this.dn}i.y=this.au(this.ir,i.x,i.z),this.cn?.$I(this.ir,i.x,i.y,i.z,null,i,s,i.JI,60,i.QI)}else i.vt=!1,i.y=this.au(this.ir,i.x,i.z),this.cn?.tE(this.ir,i.x,i.y,i.z,i.iE,i.sE,i.hE,i.eE,null,i,s,i.JI)}}};Cf=()=>{for(let t=0;t{for(let t=0;t>7,e=i.z>>7;if(!(h<0||h>=G.A.yr||e<0||e>=G.A.yr)){if(1===i.size&&64==(127&i.x)&&64==(127&i.z)){if(this.dr[h][e]===this.dn)continue;this.dr[h][e]=this.dn}this.cn?.$I(this.ir,i.x,this.au(this.ir,i.x,i.z),i.z,null,i,s,i.JI,64*(i.size-1)+60,i.QI)}}};nu=()=>{for(let t=this.Gr.head();t;t=this.Gr.next())if(t.level!==this.ir||this.hi>t.nE)t.SA();else if(this.hi>=t.rE){if(t.target>0){const i=this.Fr[t.target-1];i&&t.oE(i.x,this.au(t.level,i.x,i.z)-t.offsetY,i.z,this.hi)}if(t.target<0){const i=-t.target-1;let s;s=i===this.so?this.Jr:this.Lr[i],s&&t.oE(s.x,this.au(t.level,s.x,s.z)-t.offsetY,s.z,this.hi)}t.update(this.un),this.cn?.$I(this.ir,0|t.x,0|t.y,0|t.z,null,t,-1,t.JI,60,!1)}};ru=()=>{for(let t=this.Hr.head();t;t=this.Hr.next())t.level!==this.ir||t.lE?t.SA():this.hi>=t.rE&&(t.update(this.un),t.lE?t.SA():this.cn?.$I(t.level,t.x,t.y,t.z,null,t,-1,0,60,!1))};ou=()=>{for(let t=this.Wr.head();t;t=this.Wr.next()){let i=!1;if(t.Pl+=this.un,-1===t.Fl&&(t.Fl=0,i=!0),t.aE.delay)for(;t.Pl>t.aE.delay[t.Fl];)if(t.Pl-=t.aE.delay[t.Fl]+1,t.Fl++,i=!0,t.Fl>=t.aE.Ul&&(t.Fl-=t.aE.Bl,t.Fl<0||t.Fl>=t.aE.Ul)){t.SA(),i=!1;break}if(i&&this.cn){const i=t.ym,s=t.dm,h=t.wm;let n=0;if(0===t.cE?n=this.cn.Kd(i,s,h):1===t.cE?n=this.cn.oA(i,h,s):2===t.cE?n=this.cn.iw(i,s,h):3===t.cE&&(n=this.cn.Bd(i,s,h)),this.cr&&0!==n&&(n>>14&32767)===t.index){const r=this.cr[i][s][h],o=this.cr[i][s+1][h],l=this.cr[i][s+1][h+1],a=this.cr[i][s][h+1],c=e.A.get(t.index);let f=-1;if(-1!==t.Fl&&t.aE.frames&&(f=t.aE.frames[t.Fl]),2===t.cE){const t=this.cn.Xd(i,s,h,n);let e=31&t;const u=t>>6;e===P.A.Py.id&&(e=P.A.Ny.id),this.cn?.fE(i,s,h,c.xa(e,u,r,o,l,a,f))}else if(1===t.cE)this.cn?.uE(i,s,h,c.xa(P.A.dE.id,0,r,o,l,a,f));else if(0===t.cE){const t=this.cn.Xd(i,s,h,n),e=31&t,u=t>>6;if(e===P.A.Zd.id){const t=u+1&3;this.cn?.wE(s,h,i,c.xa(P.A.Zd.id,u+4,r,o,l,a,f),c.xa(P.A.Zd.id,t,r,o,l,a,f))}else this.cn?.yE(i,s,h,c.xa(e,u,r,o,l,a,f))}else if(3===t.cE){const t=this.cn.Xd(i,s,h,n)>>6;this.cn?.AE(i,s,h,c.xa(P.A.Fy.id,t,r,o,l,a,f))}}else t.SA()}}};Tf=()=>{for(let t=-1;t0&&(s.Pu--,0===s.Pu&&(s.Mu=null))}for(let t=0;t0&&(s.Pu--,0===s.Pu&&(s.Mu=null))}};Of=()=>{if(2===this.fn){for(let t=this.Yr.head();t;t=this.Yr.next())this.hi>=t.nE&&(this.eA(t.vp,t.x,t.z,t.Am,t.angle,t.shape,t.nw),t.SA());$.K.Ut++,$.K.Ut>85&&($.K.Ut=0,this.ri.If(O.A.pE))}};WI=t=>{const i=t.Wu-this.hi,s=128*t._I+64*t.size,h=128*t.CI+64*t.size;t.x+=(s-t.x)/i|0,t.z+=(h-t.z)/i|0,t.mE=0,0===t.vI&&(t.IE=1024),1===t.vI&&(t.IE=1536),2===t.vI&&(t.IE=0),3===t.vI&&(t.IE=512)};YI=t=>{if(t.Yu===this.hi||-1===t.Zu||0!==t.yI||t.wI+1>h.A.Jo[t.Zu].delay[t.dI]){const i=t.Yu-t.Wu,s=this.hi-t.Wu,h=128*t._I+64*t.size,e=128*t.CI+64*t.size,n=128*t.TI+64*t.size,r=128*t.OI+64*t.size;t.x=(h*(i-s)+n*s)/i|0,t.z=(e*(i-s)+r*s)/i|0}t.mE=0,0===t.vI&&(t.IE=1024),1===t.vI&&(t.IE=1536),2===t.vI&&(t.IE=0),3===t.vI&&(t.IE=512),t.JI=t.IE};KI=t=>{if(-1!==t.$u&&t.$u<32768){const i=this.Fr[t.$u];if(i){const s=t.x-i.x,h=t.z-i.z;0===s&&0===h||(t.IE=325.949*Math.atan2(s,h)&2047)}}if(t.$u>=32768){let i=t.$u-32768;i===this.so&&(i=this.Jt);const s=this.Lr[i];if(s){const i=t.x-s.x,h=t.z-s.z;0===i&&0===h||(t.IE=325.949*Math.atan2(i,h)&2047)}}if((0!==t.AI||0!==t.pI)&&(0===t.pathLength||t.mE>0)){const i=t.x-64*(t.AI-this.Kn-this.Kn),s=t.z-64*(t.pI-this.Xn-this.Xn);0===i&&0===s||(t.IE=325.949*Math.atan2(i,s)&2047),t.AI=0,t.pI=0}const i=t.IE-t.JI&2047;if(0!==i&&(i<32||i>2016?t.JI=t.IE:i>1024?t.JI-=32:t.JI+=32,t.JI&=2047,t.zI===t.ic&&t.JI!==t.IE)){if(-1!==t.EE)return void(t.zI=t.EE);t.zI=t.SI}};XI=t=>{let i;if(t.QI=!1,-1!==t.zI&&(i=h.A.Jo[t.zI],t.gE++,i.delay&&t._Ei.delay[t._E]&&(t.gE=0,t._E++),t._E>=i.Ul&&(t.gE=0,t._E=0)),-1!==t.Zu&&0===t.yI){for(i=h.A.Jo[t.Zu],t.wI++;i.delay&&t.dIi.delay[t.dI];)t.wI-=i.delay[t.dI],t.dI++;t.dI>=i.Ul&&(t.dI-=i.Bl,t.uI++,t.uI>=i.CE&&(t.Zu=-1),(t.dI<0||t.dI>=i.Ul)&&(t.Zu=-1)),t.QI=i.TE}if(t.yI>0&&t.yI--,-1!==t.rd&&this.hi>=t.II){for(t.EI<0&&(t.EI=0),i=l.A.Jo[t.rd].aE,t.gI++;i&&i.delay&&t.EIi.delay[t.EI];)t.gI-=i.delay[t.EI],t.EI++;i&&t.EI>=i.Ul&&(t.EI<0||t.EI>=i.Ul)&&(t.rd=-1)}};VI=t=>{if(t.zI=t.ic,0===t.pathLength)return void(t.mE=0);if(-1!==t.Zu&&0===t.yI){if(!h.A.Jo[t.Zu].OE)return void t.mE++}const i=t.x,s=t.z,e=128*t.Uf[t.pathLength-1]+64*t.size,n=128*t.Bf[t.pathLength-1]+64*t.size;if(e-i<=256&&e-i>=-256&&n-s<=256&&n-s>=-256){t.IE=in?1792:1536:i>e?sn?256:512:s1024&&(h-=2048);let r=t.kI;h>=-256&&h<=256?r=t.SI:h>=256&&h<768?r=t.FI:h>=-768&&h<=-256&&(r=t.DI),-1===r&&(r=t.SI),t.zI=r;let o=4;t.JI!==t.IE&&-1===t.$u&&(o=2),t.pathLength>2&&(o=6),t.pathLength>3&&(o=8),t.mE>0&&t.pathLength>1&&(o=8,t.mE--),t.vE[t.pathLength-1]&&(o<<=1),o>=8&&t.zI===t.SI&&-1!==t.bE&&(t.zI=t.bE),ie&&(t.x=e)):i>e&&(t.x-=o,t.xn&&(t.z=n)):s>n&&(t.z-=o,t.z{let t=3;if(this.kn<310&&this.Jr){let i=this.Rn>>7,s=this.Mn>>7;const h=this.Jr.x>>7,e=this.Jr.z>>7;let n,r,o,l;if(this.ur&&4&this.ur[this.ir][i][s]&&(t=this.ir),n=h>i?h-i:i-h,r=e>s?e-s:s-e,n>r)for(o=65536*r/n|0,l=32768;i!==h;)ih&&i--,this.ur&&4&this.ur[this.ir][i][s]&&(t=this.ir),l+=o,l>=65536&&(l-=65536,se&&s--,this.ur&&4&this.ur[this.ir][i][s]&&(t=this.ir));else for(o=65536*n/r|0,l=32768;s!==e;)se&&s--,this.ur&&4&this.ur[this.ir][i][s]&&(t=this.ir),l+=o,l>=65536&&(l-=65536,ih&&i--,this.ur&&4&this.ur[this.ir][i][s]&&(t=this.ir))}return this.Jr&&this.ur&&4&this.ur[this.ir][this.Jr.x>>7][this.Jr.z>>7]&&(t=this.ir),t};uu=()=>{if(!this.ur)return 0;return this.au(this.ir,this.Rn,this.Mn)-this.Sn>=800||!(4&this.ur[this.ir][this.Rn>>7][this.Mn>>7])?3:this.ir};au=(t,i,s)=>{if(!this.cr)return 0;const h=Math.min(i>>7,G.A.yr-1),e=Math.min(s>>7,G.A.yr-1);let n=t;t<3&&this.ur&&!(2&~this.ur[1][h][e])&&(n=t+1);const r=127&i,o=127&s;return(this.cr[n][h][e]*(128-r)+this.cr[n][h+1][e]*r>>7)*(128-o)+(this.cr[n][h][e+1]*(128-r)+this.cr[n][h+1][e+1]*r>>7)*o>>7};lu=(t,i,s,h,e,n)=>{const r=2048-e&2047,o=2048-h&2047;let l,a,c,f=0,u=0,w=n;0!==r&&(l=d.A.sin[r],a=d.A.cos[r],c=u*a-n*l>>16,w=u*l+n*a>>16,u=c),0!==o&&(l=d.A.sin[o],a=d.A.cos[o],c=w*l+f*a>>16,w=w*a-f*l>>16,f=c),this.Rn=t-f,this.Sn=i-u,this.Mn=s-w,this.kn=e,this.xn=h};Kf=()=>{if(!this.Jr)return;const t=this.Jr.x+this.mn,i=this.Jr.z+this.In;(this.lr-t<-500||this.lr-t>500||this.ar-i<-500||this.ar-i>500)&&(this.lr=t,this.ar=i),this.lr!==t&&(this.lr+=(t-this.lr)/16|0),this.ar!==i&&(this.ar+=(i-this.ar)/16|0),1===this.vf[1]?this.nr+=(-this.nr-24)/2|0:1===this.vf[2]?this.nr+=(24-this.nr)/2|0:this.nr=this.nr/2|0,1===this.vf[3]?this.rr+=(12-this.rr)/2|0:1===this.vf[4]?this.rr+=(-this.rr-12)/2|0:this.rr=this.rr/2|0,this.er=this.er+this.nr/2&2047,this.hr+=this.rr/2|0,this.hr<128&&(this.hr=128),this.hr>383&&(this.hr=383);const s=this.lr>>7,h=this.ar>>7,e=this.au(this.ir,this.lr,this.ar);let n=0;if(this.cr&&s>3&&h>3&&s<100&&h<100)for(let t=s-4;t<=s+4;t++)for(let i=h-4;i<=h+4;i++){let s=this.ir;s<3&&this.ur&&!(2&~this.ur[1][t][i])&&s++;const h=e-this.cr[s][t][i];h>n&&(n=h)}let r=192*n;r>98048&&(r=98048),r<32768&&(r=32768),r>this.Dn?this.Dn+=(r-this.Dn)/24|0:r{let t=128*this.Cr+64,i=128*this.Tr+64,s=this.au(this.ir,this.Cr,this.Tr)-this.Or;this.Rnt&&(this.Rn=t)),this.Rn>t&&(this.Rn-=this.vr+((this.Rn-t)*this.br/1e3|0),this.Rns&&(this.Sn=s)),this.Sn>s&&(this.Sn-=this.vr+((this.Sn-s)*this.br/1e3|0),this.Sni&&(this.Mn=i)),this.Mn>i&&(this.Mn-=this.vr+((this.Mn-i)*this.br/1e3|0),this.Mn383&&(o=383),this.kno&&(this.kn=o)),this.kn>o&&(this.kn-=this.gr+((this.kn-o)*this._r/1e3|0),this.kn1024&&(a-=2048),a<-1024&&(a+=2048),a>0&&(this.xn+=this.gr+(a*this._r/1e3|0),this.xn&=2047),a<0&&(this.xn-=this.gr+(-a*this._r/1e3|0),this.xn&=2047);let c=l-this.xn;c>1024&&(c-=2048),c<-1024&&(c+=2048),(c<0&&a>0||c>0&&a<0)&&(this.xn=l)};qA=(t,i)=>{const s=t.CA;let n=this.Hn+(s>>4&7),r=this.Wn+(7&s);if(i===T.A.ZA||i===T.A.jA){const s=t.CA,h=s>>2,e=3&s,o=P.A.of(h).nw;let l;if(l=i===T.A.jA?-1:t.ct,n>=0&&r>=0&&n>14&32767,h=31&t,e=t>>6}t=new U.A(this.ir,o,n,r,0,F.A.qd,P.A.jd.id,s,e,h),this.Xr.LE(t)}t&&(t.Am=l,t.shape=h,t.angle=e),this.eA(this.ir,n,r,l,e,h,o)}}else if(i===T.A.zA){const i=t.CA>>2,s=P.A.of(i).nw,e=t.ct;if(n>=0&&r>=0&&n>14&32767,this.ir,s,n,r,h.A.Jo[e],!1);this.Wr.LE(i)}}}else if(i===T.A.XA){const i=t.ct,s=t.ct;if(n>=0&&r>=0&&n=0&&r>=0&&n=0&&r>=0&&n=0&&s>=0&&i=0&&r>=0&&n=0&&r>=0&&n>2,h=3&i,o=P.A.of(s).nw,l=t.ct,a=t.ct,c=t.ct,f=t.ct;let u,d=t.gA,w=t.gA,y=t.gA,A=t.gA;if(u=f===this.so?this.Jr:this.Lr[f],u&&this.cr){const t=new B.A(this.ir,o,n,r,-1,h,s,a+this.hi);this.Yr.LE(t);const i=new B.A(this.ir,o,n,r,l,h,s,c+this.hi);this.Yr.LE(i);const f=this.cr[this.ir][n][r],p=this.cr[this.ir][n+1][r],m=this.cr[this.ir][n+1][r+1],I=this.cr[this.ir][n][r+1],E=e.A.get(l);u.ZI=a+this.hi,u.qI=c+this.hi,u.jI=E.xa(s,h,f,p,m,I,-1);let g,_=E.width,C=E.length;h!==F.A.$d&&h!==F.A.Qd||(_=E.length,C=E.width),u.RE=128*n+64*_,u.SE=128*r+64*C,u.ME=this.au(this.ir,u.RE,u.SE),d>y&&(g=d,d=y,y=g),w>A&&(g=w,w=A,A=g),u.iE=n+d,u.hE=n+y,u.sE=r+w,u.eE=r+A}}else if(i===T.A.GA){const i=t.ct,s=t.ct,h=t.ct;if(n>=0&&r>=0&&n{if(!$.K.vt){if(d.A.kE[17]>=t){const t=d.A.xE[17];if(!t)return;const i=t.width*t.height-1,s=t.width*this.un*2,h=t.Mc,e=this.Jn;for(let t=0;t<=i;t++)e[t]=h[t-s&i];t.Mc=e,this.Jn=h,d.A.DE(17)}if(d.A.kE[24]>=t){const t=d.A.xE[24];if(!t)return;const i=t.width*t.height-1,s=t.width*this.un*2,h=t.Mc,e=this.Jn;for(let t=0;t<=i;t++)e[t]=h[t-s&i];t.Mc=e,this.Jn=h,d.A.DE(24)}}};Vc=()=>{if(!(this.Vi&&this.Ki&&this.Yi&&this.qi))return;for(let t=10;t<117;t++){(100*Math.random()|0)<50&&(this.Vi[t+32512]=255)}for(let t=0;t<100;t++){const t=2+(124*Math.random()|0)+(128+(128*Math.random()|0)<<7);this.Vi[t]=192}for(let t=1;t<255;t++)for(let i=1;i<127;i++){const s=i+(t<<7);this.Ki[s]=(this.Vi[s-1]+this.Vi[s+1]+this.Vi[s-128]+this.Vi[s+128])/4|0}this.$i+=128,this.$i>this.Yi.length&&(this.$i-=this.Yi.length,this.zc(this.Ui[12*Math.random()|0]));for(let t=1;t<255;t++)for(let i=1;i<127;i++){const s=i+(t<<7);let h=this.Ki[s+128]-(this.Yi[s+this.$i&this.Yi.length-1]/5|0);h<0&&(h=0),this.Vi[s]=h}for(let t=0;t<255;t++)this.qi[t]=this.qi[t+1];if(this.qi[255]=16*Math.sin(this.hi/14)+14*Math.sin(this.hi/15)+12*Math.sin(this.hi/16)|0,this.Ji>0&&(this.Ji-=4),this.Qi>0&&(this.Qi-=4),0===this.Ji&&0===this.Qi){const t=2e3*Math.random()|0;0===t?this.Ji=1024:1===t&&(this.Qi=1024)}};NE=(t,i,s)=>{const h=256-i;return((16711935&t)*h+(16711935&s)*i&4278255360)+((65280&t)*h+(65280&s)*i&16711680)>>8};Kc=()=>{if(!(this.Xi&&this.zi&&this.ji&&this.Zi&&this.qi&&this.Vi))return;const t=256;if(this.Ji>0)for(let t=0;t<256;t++)this.Ji>768?this.Xi[t]=this.NE(this.zi[t],1024-this.Ji,this.ji[t]):this.Ji>256?this.Xi[t]=this.ji[t]:this.Xi[t]=this.NE(this.ji[t],256-this.Ji,this.zi[t]);else if(this.Qi>0)for(let t=0;t<256;t++)this.Qi>768?this.Xi[t]=this.NE(this.zi[t],1024-this.Qi,this.Zi[t]):this.Qi>256?this.Xi[t]=this.Zi[t]:this.Xi[t]=this.NE(this.Zi[t],256-this.Qi,this.zi[t]);else for(let t=0;t<256;t++)this.Xi[t]=this.zi[t];for(let t=0;t<33920;t++)this.Ti&&this.Gi&&(this.Ti.Mc[t]=this.Gi.Mc[t]);let i=0,s=1152;for(let h=1;h<255;h++){let e=(this.qi[h]*(t-h)/t|0)+22;e<0&&(e=0),i+=e;for(let t=e;t<128;t++){let t=this.Vi[i++];if(0===t)s++;else{const i=t,h=256-t;if(t=this.Xi[t],this.Ti){const e=this.Ti.Mc[s];this.Ti.Mc[s++]=((16711935&t)*i+(16711935&e)*h&4278255360)+((65280&t)*i+(65280&e)*h&16711680)>>8}}}s+=e}this.Ti?.draw(0,0);for(let t=0;t<33920;t++)this.Oi&&this.Hi&&(this.Oi.Mc[t]=this.Hi.Mc[t]);i=0,s=1176;for(let h=1;h<255;h++){const e=this.qi[h]*(t-h)/t|0,n=103-e;s+=e;for(let t=0;t>8}}}i+=128-n,s+=128-n-e}this.Oi?.draw(661,0)}}console.log(`RS2 user client - release #${$.K.Tt}`),await(0,it.w)(),(new t).run().then((()=>{})),i()}catch(t){i(t)}}),1)},8370:(t,i,s)=>{s.d(i,{A:()=>c});var h=s(1183),e=s(4583),n=s(9234);const r=['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=s(2595),a=s(7854);class c{static getParameter(t){return new URLSearchParams(window.location.search).get(t)??''}static setParameter(t,i){const s=new URL(window.location.toString());s.searchParams.set(t,i),window.history.pushState(null,'',s.toString())}pd=0;PE=[];FE=0;tl=null;state=0;yd=20;UE=1;BE=[];wd=0;GE=0;HE=[];WE=!0;YE=!1;VE=50;hasFocus=!0;Nc=!1;wf=0;Lf=0;ea=0;na=0;Qc=0;tf=0;if=0;vf=[];KE=[];XE=0;zE=0;input=null;jE=!1;ZE=!1;qE=!1;time=-1;$E=0;JE=0;QE=0;tg=0;ig=0;sg=0;constructor(t=!1){a.hg.tabIndex=-1,a.Il.fillStyle='black',a.Il.fillRect(0,0,a.hg.width,a.hg.height),this.YE=t,this.YE?this.resize(window.innerWidth,window.innerHeight):this.resize(a.hg.width,a.hg.height)}get width(){return a.hg.width}get height(){return a.hg.height}resize=(t,i)=>{a.hg.width=t,a.hg.height=i,this.tl=new h.A(t,i),e.A.eg()};run=async()=>{a.hg.addEventListener('resize',(()=>{this.YE&&this.resize(window.innerWidth,window.innerHeight)}),!1),a.hg.onmousedown=this.onmousedown,a.hg.onmouseup=this.onmouseup,a.hg.onmouseenter=this.onmouseenter,a.hg.onmouseleave=this.onmouseleave,a.hg.onmousemove=this.onmousemove,window.onbeforeunload=this.Zo,a.hg.onfocus=this.onfocus,a.hg.onblur=this.onblur,this.ng?(a.hg.ontouchstart=this.ontouchstart,a.hg.ontouchend=this.ontouchend,a.hg.ontouchmove=this.ontouchmove):(a.hg.onkeydown=this.onkeydown,a.hg.onkeyup=this.onkeyup),a.hg.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.ng&&'low'===c.getParameter('detail')&&(this.VE=30),await this.ul(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.BE[t]=performance.now();let t,i=0,s=256,h=1,e=0;for(;this.state>=0;){if(this.state>0&&(this.state--,0===this.state))return void this.rg();const r=s,o=h;s=300,h=1,t=performance.now();const l=this.BE[i];if(0===l?(s=r,h=o):t>l&&(s=2560*this.yd/(t-l)|0),s<25?s=25:s>256&&(s=256,h=this.yd-(t-l)/10|0),this.BE[i]=t,i=(i+1)%10,h>1)for(let t=0;t<10;t++)0!==this.BE[t]&&(this.BE[t]+=h);for(h0&&(this.wd=1e3*s/(256*this.yd)|0);const a=performance.now();if(this.WE&&this.refresh(),await this.draw(),this.HE[this.GE]=(performance.now()-a)/1e3,this.GE=(this.GE+1)%this.HE.length,this.VE<50){const i=1e3/this.VE-(performance.now()-t);i>0&&await(0,n.wl)(i)}}-1===this.state&&this.rg()};rg=()=>{this.state=-2,this.Zo()};El=t=>{this.yd=1e3/t|0};Ky=t=>{this.VE=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.yd|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};Zo=()=>{};draw=async()=>{};refresh=()=>{};async ul(t,i){const s=this.width,h=this.height;this.WE&&(a.Il.fillStyle='black',a.Il.fillRect(0,0,s,h),this.WE=!1);const e=h/2-18;a.Il.fillStyle='rgb(140, 17, 17)',a.Il.rect((s/2|0)-152,e,304,34),a.Il.fillRect((s/2|0)-150,e+2,3*t,30),a.Il.fillStyle='black',a.Il.fillRect((s/2|0)-150+3*t,e+2,300-3*t,30),a.Il.font='bold 13px helvetica, sans-serif',a.Il.textAlign='center',a.Il.fillStyle='white',a.Il.fillText(i,s/2|0,e+22),await(0,n.wl)(5)}hf=()=>{let t=-1;return this.zE!==this.XE&&(t=this.KE[this.XE],this.XE=this.XE+1&127),t};get ms(){const t=this.HE.length;let i=0;for(let s=0;sthis.pd&&(this.pd=s),this.PE[this.FE]=s,this.FE=(this.FE+1)%250,s}get Ad(){return this.PE.reduce(((t,i)=>t+i),0)/250}onkeydown=t=>{const i=t.key;this.wf=0;const s=o[i];if(!s||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const h=s.code;let e=s.ch;t.ctrlKey&&(e>='A'.charCodeAt(0)&&e<=']'.charCodeAt(0)||e=='_'.charCodeAt(0)?e-='A'.charCodeAt(0)-1:e>='a'.charCodeAt(0)&&e<='z'.charCodeAt(0)&&(e-='a'.charCodeAt(0)-1)),e<30&&(e=0),h===o.ArrowLeft.code?e=1:h===o.ArrowRight.code?e=2:h===o.ArrowUp.code?e=3:h===o.ArrowDown.code?e=4:h===o.Control.code?e=5:h===o.Shift.code?e=6:h===o.Alt.code?e=7:h===o.Backspace.code||h===o.Delete.code?e=8:h===o.Tab.code?e=9:h===o.Enter.code?e=10:h>=o.F1.code&&h<=o.F12.code?e=h+1008-o.F1.code:h===o.Home.code?e=1e3:h===o.End.code?e=1001:h===o.PageUp.code?e=1002:h===o.PageDown.code&&(e=1003),e>0&&e<128&&(this.vf[e]=1),e>4&&(this.KE[this.zE]=e,this.zE=this.zE+1&127),l.A.enabled&&l.A.og(e),r.includes(i)||t.preventDefault()};onkeyup=t=>{const i=t.key;this.wf=0;const s=o[i];if(!s||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const h=s.code;let e=s.ch;e<30&&(e=0),h===o.ArrowLeft.code?e=1:h===o.ArrowRight.code?e=2:h===o.ArrowUp.code?e=3:h===o.ArrowDown.code?e=4:h===o.Control.code?e=5:h===o.Shift.code?e=6:h===o.Alt.code?e=7:h===o.Backspace.code||h===o.Delete.code?e=8:h===o.Tab.code?e=9:h===o.Enter.code?e=10:h>=o.F1.code&&h<=o.F12.code?e=h+1008-o.F1.code:h===o.Home.code?e=1e3:h===o.End.code?e=1001:h===o.PageUp.code?e=1002:h===o.PageDown.code&&(e=1003),e>0&&e<128&&(this.vf[e]=0),l.A.enabled&&l.A.lg(e),r.includes(i)||t.preventDefault()};onmousedown=t=>{if(this.jE=!1,(t.clientX>0||t.clientY>0)&&this.ag(t),this.wf=0,this.tf=this.ea,this.if=this.na,this.ng&&!this.cg){if(this.fg()||this.ug()||this.dg())return this.Qc=1,void(this.Lf=1);t.timeStamp>=this.time+500?(this.Qc=2,this.Lf=2):(this.Qc=1,this.Lf=1)}else 2===t.button?(this.Qc=2,this.Lf=2):(this.Qc=1,this.Lf=1);l.A.enabled&&l.A.wg(this.tf,this.if,t.buttons)};onmouseup=t=>{this.ag(t),this.wf=0,this.Lf=0,l.A.enabled&&l.A.yg(t.buttons)};onmouseenter=t=>{this.ag(t),l.A.enabled&&l.A.Ag()};onmouseleave=t=>{this.ag(t),this.wf=0,this.ea=-1,this.na=-1,this.Lf=0,this.tf=-1,this.if=-1,l.A.enabled&&l.A.pg()};onmousemove=t=>{this.ag(t),this.wf=0,l.A.enabled&&l.A.mg(this.ea,this.na)};onfocus=t=>{this.hasFocus=!0,this.WE=!0,this.refresh(),l.A.enabled&&l.A.Ig()};onblur=t=>{this.hasFocus=!1,l.A.enabled&&l.A.Eg()};ontouchstart=t=>{if(!this.ng)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.jE=!0;const i=t.changedTouches[0],s=0|i.clientX,h=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:s,clientY:h})),this.$E=this.ig=this.QE=0|i.screenX,this.JE=this.sg=this.tg=0|i.screenY,this.time=t.timeStamp,this.ZE=this.gg(),this.qE=this._g()};ontouchend=t=>{if(!this.ng||!this.jE)return;const i=t.changedTouches[0],s=0|i.clientX,h=0|i.clientY;if(this.onmousemove(new MouseEvent('mousemove',{clientX:s,clientY:h})),this.ig=0|i.screenX,this.sg=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.ZE&&!this.gg())return void(this.jE=!1);if(this.qE&&!this._g())return void(this.jE=!1);if(this.fg()||this.Cg()||this.ug()||this.dg()){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.ug()?(t.setAttribute('id','username'),t.setAttribute('placeholder','Username')):this.dg()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.fg()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.Cg()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this.Tg?t.setAttribute('type','password'):t.setAttribute('type',this.dg()?'password':'text'),t.setAttribute('autofocus','autofocus'),t.setAttribute('spellcheck','false'),t.setAttribute('autocomplete','off'),t.setAttribute('style',`position: fixed; left: ${s}px; top: ${h}px; width: 1px; height: 1px; opacity: 0;`),document.body.appendChild(t),t.focus(),t.click(),this.Tg&&(t.oninput=t=>{if(!(t instanceof InputEvent))return;const i=t,s=i.data;null!==s&&'insertText'===i.inputType&&this.onkeydown(new KeyboardEvent('keydown',{key:s,code:s}))}),t.onkeydown=t=>{this.Tg&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this.Tg&&'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.jE=!1)}const e=t.timeStamp>=this.time+500,n=Math.abs(this.$E-this.ig)>16||Math.abs(this.JE-this.sg)>16;e&&!n?(this.jE=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.Lf=0,this.jE=!1)};ontouchmove=t=>{if(!this.ng||!this.jE)return;const i=t.changedTouches[0],s=0|i.clientX,h=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:s,clientY:h})),this.ig=0|i.screenX,this.sg=0|i.screenY,this.ZE&&-1===this.nl()?(this.QE-this.ig>0?this.rotate(2):this.QE-this.ig<0&&this.rotate(0),this.tg-this.sg>0?this.rotate(3):this.tg-this.sg<0&&this.rotate(1)):(this.qE||-1!==this.nl())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this.QE=this.ig,this.tg=this.sg};get ng(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get Tg(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get cg(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}gg=()=>this.Nc&&this.ea>=8&&this.ea<=520&&this.na>=11&&this.na<=345;fg=()=>this.Nc&&-1===this.el()&&!this.sl()&&!this.hl()&&this.ea>=11&&this.ea<=506&&this.na>=449&&this.na<=482;Cg=()=>this.Nc&&(this.sl()||this.hl())&&this.ea>=11&&this.ea<=506&&this.na>=383&&this.na<=482;_g=()=>this.Nc&&this.ea>=562&&this.ea<=752&&this.na>=231&&this.na<=492;ug=()=>!this.Nc&&2===this.il()&&this.ea>=301&&this.ea<=562&&this.na>=262&&this.na<=279;dg=()=>!this.Nc&&2===this.il()&&this.ea>=301&&this.ea<=562&&this.na>=279&&this.na<=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'})))};Og=()=>null!==document.fullscreenElement;ag=t=>{if(this.Og()){const i=t.target.getBoundingClientRect(),s=window.innerHeight/a.hg.height,h=(window.innerWidth-a.hg.width*s)/2;this.ea=0|this.vg(t.clientX-i.left-h,0,a.hg.width*s,0,789),this.na=0|this.vg(t.clientY-i.top,0,a.hg.height*s,0,532)}else{const i=a.hg.getBoundingClientRect(),s=a.hg.width/i.width,h=a.hg.height/i.height;this.ea=(t.clientX-i.left)*s|0,this.na=(t.clientY-i.top)*h|0}this.ea<0&&(this.ea=0),this.na<0&&(this.na=0),this.ea>789&&(this.ea=789),this.na>532&&(this.na=532)};vg=(t,i,s,h,e)=>(t-i)*(e-h)/(s-i)+h}},2595:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1069);class e{static enabled=!1;static bg=null;static Lg=null;static Rg=0;static Sg=0;static Mg=0;static kg=0;static xg=0;static rp=()=>{this.bg=h.A.ni(1),this.Lg=null,this.Rg=performance.now(),this.enabled=!0};static df=()=>{this.enabled=!1,this.bg=null};static flush=()=>{let t=null;return this.Lg&&this.enabled&&(t=this.Lg),this.Lg=null,t};static stop=()=>{let t=null;return this.bg&&this.bg.ft>0&&this.enabled&&(t=this.bg),this.df(),t};static wg=(t,i,s)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;this.Sg++;const h=performance.now();let e=(h-this.Rg)/10|0;e>250&&(e=250),this.Rg=h,this.Dg(5),1===s?this.bg?.p1(1):this.bg?.p1(2),this.bg?.p1(e),this.bg?.p3(t+(i<<10))};static yg=t=>{if(!this.enabled)return;this.Sg++;const i=performance.now();let s=(i-this.Rg)/10|0;s>250&&(s=250),this.Rg=i,this.Dg(2),1===t?this.bg?.p1(3):this.bg?.p1(4),this.bg?.p1(s)};static mg=(t,i)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;const s=performance.now();if(s-this.Mg>=50){this.Mg=s,this.Sg++;let h=(s-this.Rg)/10|0;h>250&&(h=250),this.Rg=s,t-this.kg<8&&t-this.kg>=-8&&i-this.xg<8&&i-this.xg>=-8?(this.Dg(3),this.bg?.p1(5),this.bg?.p1(h),this.bg?.p1(t+(i-this.xg+8<<4)+8-this.kg)):t-this.kg<128&&t-this.kg>=-128&&i-this.xg<128&&i-this.xg>=-128?(this.Dg(4),this.bg?.p1(6),this.bg?.p1(h),this.bg?.p1(t+128-this.kg),this.bg?.p1(i+128-this.xg)):(this.Dg(5),this.bg?.p1(7),this.bg?.p1(h),this.bg?.p3(t+(i<<10))),this.kg=t,this.xg=i}};static og=t=>{if(!this.enabled)return;this.Sg++;const i=performance.now();let s=(i-this.Rg)/10|0;s>250&&(s=250),this.Rg=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.Dg(3),this.bg?.p1(8),this.bg?.p1(s),this.bg?.p1(t)};static lg=t=>{if(!this.enabled)return;this.Sg++;const i=performance.now();let s=(i-this.Rg)/10|0;s>250&&(s=250),this.Rg=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.Dg(3),this.bg?.p1(9),this.bg?.p1(s),this.bg?.p1(t)};static Ig=()=>{if(!this.enabled)return;this.Sg++;const t=performance.now();let i=(t-this.Rg)/10|0;i>250&&(i=250),this.Rg=t,this.Dg(2),this.bg?.p1(10),this.bg?.p1(i)};static Eg=()=>{if(!this.enabled)return;this.Sg++;const t=performance.now();let i=(t-this.Rg)/10|0;i>250&&(i=250),this.Rg=t,this.Dg(2),this.bg?.p1(11),this.bg?.p1(i)};static Ag=()=>{if(!this.enabled)return;this.Sg++;const t=performance.now();let i=(t-this.Rg)/10|0;i>250&&(i=250),this.Rg=t,this.Dg(2),this.bg?.p1(12),this.bg?.p1(i)};static pg=()=>{if(!this.enabled)return;this.Sg++;const t=performance.now();let i=(t-this.Rg)/10|0;i>250&&(i=250),this.Rg=t,this.Dg(2),this.bg?.p1(13),this.bg?.p1(i)};static Dg=t=>{if(this.bg&&this.bg.ft+t>=500){const t=this.bg;this.bg=h.A.ni(1),this.Lg=t}}}},1120:(t,i,s)=>{s.d(i,{A:()=>c});var h=s(1069),e=s(8665),n=s(2031),r=s(1122),o=s(3819),l=s(3867),a=s(8950);class c{static Jo=[];static Ng=null;static Qo=null;static jl=0;static Pg=1;static ql=2;static da=3;static ya=4;static va=5;static Ra=6;static Fa=7;static Rm=1;static km=2;static xm=3;static Dm=4;static Nm=5;static Ea=6;static Ga=1;static Ha=100;static Wa=101;static Ya=200;static Ey=201;static gy=202;static Va=203;static _y=205;static Oy=300;static Fg=301;static Ug=302;static Bg=303;static Gg=304;static Hg=305;static Wg=306;static Yg=307;static Vg=308;static Kg=309;static Xg=310;static zg=311;static jg=312;static vy=313;static by=314;static Zg=315;static qg=316;static $g=317;static Jg=318;static Qg=319;static t_=320;static i_=321;static s_=322;static Ly=323;static nc=324;static rc=325;static Ry=326;static qa=327;static Ka=401;static Xa=500;static Cy=501;static Ty=502;static Za=503;static oc=600;static My=601;static h_=602;static e_=603;static n_=604;static r_=605;static o_=606;static l_=607;static a_=608;static c_=609;static f_=610;static u_=611;static ky=612;static lc=613;static ac=650;static uc=651;static dc=652;static wc=653;static yc=654;static cc=655;static Sc=(t,i,s)=>{this.Ng=new n.A(5e4),this.Qo=new n.A(5e4);const e=new h.A(t.read('data'));let r=-1;for(e.ft+=2;e.ft0){h._l=new Uint8Array(n),h.Tl=new Uint16Array(n);for(let t=0;t0){h.scripts=new l.Ns(o,null);for(let t=0;t0){const e=s.lastIndexOf(',');h.ua[t]=this.d_(i,s.substring(0,e),parseInt(s.substring(e+1),10))}}h.Lm=new l.Ns(5,null);for(let t=0;t<5;t++){const i=e.NA;h.Lm[t]=i,0===i.length&&(h.Lm[t]=null)}}if(h.type===c.da&&(h.fill=1===e.CA),h.type===c.ya||h.type===c.Pg){h._a=1===e.CA;const t=e.CA;s&&(h.font=s[t]),h.Ta=1===e.CA}if(h.type===c.ya&&(h.text=e.NA,h.ma=e.NA),h.type!==c.Pg&&h.type!==c.da&&h.type!==c.ya||(h.wa=e.ut),h.type!==c.da&&h.type!==c.ya||(h.pa=e.ut,h.Aa=e.ut),h.type===c.va){const t=e.NA;if(t.length>0){const s=t.lastIndexOf(',');h.La=this.d_(i,t.substring(0,s),parseInt(t.substring(s+1),10))}const s=e.NA;if(s.length>0){const t=s.lastIndexOf(',');h.ba=this.d_(i,s.substring(0,t),parseInt(s.substring(t+1),10))}}if(h.type===c.Ra){const t=e.CA;0!==t&&(h.model=this.xa((t-1<<8)+e.CA));const i=e.CA;0!==i&&(h.w_=this.xa((i-1<<8)+e.CA)),h.Dl=e.CA,0===h.Dl?h.Dl=-1:h.Dl=(h.Dl-1<<8)+e.CA,h.Nl=e.CA,0===h.Nl?h.Nl=-1:h.Nl=(h.Nl-1<<8)+e.CA,h.zoom=e.ct,h.ka=e.ct,h.Pa=e.ct}if(h.type===c.Fa){h.Ql=new Int32Array(h.width*h.height),h.ta=new Int32Array(h.width*h.height),h._a=1===e.CA;const t=e.CA;s&&(h.font=s[t]),h.Ta=1===e.CA,h.wa=e.ut,h.ia=e.Cp,h.sa=e.Cp,h.Om=1===e.CA,h.Lm=new l.Ns(5,null);for(let t=0;t<5;t++){const i=e.NA;h.Lm[t]=i,0===i.length&&(h.Lm[t]=null)}}h.Ia!==c.km&&h.type!==c.ql||(h.Kw=e.NA,h.action=e.NA,h.Vw=e.ct),h.Ia!==c.Rm&&h.Ia!==c.Dm&&h.Ia!==c.Nm&&h.Ia!==c.Ea||(h.Mm=e.NA,0===h.Mm.length&&(h.Ia===c.Rm?h.Mm='Ok':h.Ia===c.Dm||h.Ia===c.Nm?h.Mm='Select':h.Ia===c.Ea&&(h.Mm='Continue')))}this.Ng=null,this.Qo=null};static d_=(t,i,s)=>{const h=o.A.y_(i)<<8n|BigInt(s);if(this.Ng){const t=this.Ng.get(h);if(t)return t}let e;try{e=r.A.Ic(t,i,s),this.Ng?.put(h,e)}catch(t){return null}return e};static xa=t=>{if(this.Qo){const i=this.Qo.get(BigInt(t));if(i)return i}const i=e.A.model(t);return this.Qo?.put(BigInt(t),i),i};id=-1;nw=-1;type=-1;Ia=-1;Xl=0;width=0;height=0;Tm=-1;_l=null;Tl=null;scripts=null;scroll=0;hide=!1;draggable=!1;Om=!1;bm=!1;ia=0;sa=0;$l=null;Jl=null;ua=null;Lm=null;fill=!1;_a=!1;font=null;Ta=!1;text=null;ma=null;wa=0;pa=0;Aa=0;La=null;ba=null;model=null;w_=null;Dl=-1;Nl=-1;zoom=0;ka=0;Pa=0;Kw=null;action=null;Vw=-1;Mm=null;xl=null;Wl=null;Yl=null;x=0;y=0;Zl=0;Ql=null;ta=null;Fl=0;Pl=0;xa(t,i,s){let h=this.model;if(s&&(h=this.w_),!h)return null;if(-1===t&&-1===i&&!h.A_)return h;const n=e.A.p_(h,!0,!0,!1);return-1===t&&-1===i||n.sc(),-1!==t&&n.hc(t),-1!==i&&n.hc(i),n.ec(64,768,-50,-10,-50,!0),n}m_(){if(this.nw===this.id)return this.x;let t=c.Jo[this.nw];if(!t.xl||!t.Wl||!t.Yl)return this.x;let i=t.xl.indexOf(this.id);if(-1===i)return this.x;let s=t.Wl[i];for(;t.nw!==t.id;){const h=c.Jo[t.nw];h.xl&&h.Wl&&h.Yl&&(i=h.xl.indexOf(t.id),-1!==i&&(s+=h.Wl[i])),t=h}return s}I_(){if(this.nw===this.id)return this.y;let t=c.Jo[this.nw];if(!t.xl||!t.Wl||!t.Yl)return this.y;let i=t.xl.indexOf(this.id);if(-1===i)return this.y;let s=t.Yl[i];for(;t.nw!==t.id;){const h=c.Jo[t.nw];h.xl&&h.Wl&&h.Yl&&(i=h.xl.indexOf(t.id),-1!==i&&(s+=h.Yl[i])),t=h}return s}outline(t){const i=this.m_(),s=this.I_();a.A.Vl(i,s,this.width,this.height,t)}move(t,i){if(this.nw===this.id)return;this.x=0,this.y=0;const s=c.Jo[this.nw];if(s.xl&&s.Wl&&s.Yl){const h=s.xl.indexOf(this.id);-1!==h&&(s.Wl[h]=t,s.Yl[h]=i)}}delete(){if(this.nw===this.id)return;const t=c.Jo[this.nw];if(t.xl&&t.Wl&&t.Yl){const i=t.xl.indexOf(this.id);-1!==i&&(t.xl.splice(i,1),t.Wl.splice(i,1),t.Yl.splice(i,1))}}}},6333:(t,i,s)=>{s.d(i,{$:()=>h});class h{id;E_=null;constructor(t){this.id=t}g_(t){for(;;){const i=t.CA;if(0===i)break;this.decode(i,t)}return this}}},2164:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(1069),e=s(6333);class n extends e.${static count=0;static Jo=[];static Sc=t=>{const i=new h.A(t.read('flo.dat'));this.count=i.ct;for(let t=0;t(s>179&&(i=i/2|0),s>192&&(i=i/2|0),s>217&&(i=i/2|0),s>243&&(i=i/2|0),(t/4<<10)+(i/32<<7)+(s/2|0));static C_=(t,i)=>-1===t?12345678:((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);static T_=(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);O_=0;texture=-1;v_=!1;b_=!0;L_=0;R_=0;S_=0;M_=0;k_=0;x_=0;decode(t,i){1===t?(this.O_=i.lt,this.setColor(this.O_)):2===t?this.texture=i.CA:3===t?this.v_=!0:5===t?this.b_=!1:6===t?this.E_=i.NA:console.log('Error unrecognised config code: ',t)}setColor(t){const i=(t>>16&255)/256,s=(t>>8&255)/256,h=(255&t)/256;let e=i;si&&(r=s),h>r&&(r=h);let o=0,l=0;const a=(e+r)/2;e!==r&&(a<.5&&(l=(r-e)/(r+e)),a>=.5&&(l=(r-e)/(2-r-e)),i===r?o=(s-h)/(r-e):s===r?o=(h-i)/(r-e)+2:h===r&&(o=(i-s)/(r-e)+4)),o/=6,this.L_=256*o|0,this.R_=256*l|0,this.S_=256*a|0,this.R_<0?this.R_=0:this.R_>255&&(this.R_=255),this.S_<0?this.S_=0:this.S_>255&&(this.S_=255),this.M_=a>.5?(1-a)*l*512|0:a*l*512|0,this.M_<1&&(this.M_=1),this.k_=o*this.M_|0;let c=this.L_+(16*Math.random()|0)-8;c<0?c=0:c>255&&(c=255);let f=this.R_+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255);let u=this.S_+(48*Math.random()|0)-24;u<0?u=0:u>255&&(u=255),this.x_=n.__(c,f,u)}}},8317:(t,i,s)=>{s.d(i,{A:()=>o});var h=s(1069),e=s(6333),n=s(8665),r=s(3867);class o extends e.${static count=0;static Jo=[];static Sc=t=>{const i=new h.A(t.read('idk.dat'));this.count=i.ct;for(let t=0;t=40&&t<50)this.P_[t-40]=i.ct;else if(t>=50&&t<60)this.F_[t-50]=i.ct;else{if(!(t>=60&&t<70))throw new Error(`Unrecognized idk config code: ${t}`);this.N_[t-60]=i.ct}}xa(){if(!this.D_)return null;const t=new r.Ns(this.D_.length,null);for(let i=0;i{s.d(i,{A:()=>c});var h=s(6333),e=s(1069),n=s(2031),r=s(8665),o=s(1023),l=s(6169),a=s(3867);class c extends h.${static count=0;static cache=null;static U_=null;static B_=null;static G_=0;static Tu=new n.A(500);static Ou=new n.A(30);static Sc=t=>{this.U_=new e.A(t.read('loc.dat'));const i=new e.A(t.read('loc.idx'));this.count=i.ct,this.B_=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.B_||!this.U_)throw new Error('LocType not loaded!!!');for(let i=0;i<10;i++){const s=this.cache[i];if(s&&s.id===t)return s}this.G_=(this.G_+1)%10;const i=this.cache[this.G_];return this.U_.ft=this.B_[t],i.id=t,i.reset(),i.g_(this.U_),i.H_||(i.H_=new Int32Array(1)),-1===i.W_&&i.H_&&(i.active=i.H_.length>0&&i.H_[0]===o.A.Ny.id,i.Um&&(i.active=!0)),i};static Zo=()=>{this.Tu=null,this.Ou=null,this.B_=null,this.cache=null,this.U_=null};D_=null;H_=null;name=null;bw=null;P_=null;F_=null;width=1;length=1;cA=!0;fA=!0;active=!1;W_=-1;Y_=!1;V_=!1;b_=!1;Dl=-1;K_=!1;X_=16;z_=0;j_=0;Um=null;Gd=-1;zd=-1;Z_=!1;q_=!0;J_=128;Q_=128;tC=128;Uy=0;iC=0;sC=0;hC=0;eC=!1;decode(t,i){if(1===t){const t=i.CA;this.D_=new Int32Array(t),this.H_=new Int32Array(t);for(let s=0;s=30&&t<39)this.Um||(this.Um=new a.Ns(5,null)),this.Um[t-30]=i.NA,'hidden'===this.Um[t-30]?.toLowerCase()&&(this.Um[t-30]=null);else if(40===t){const t=i.CA;this.P_=new Uint16Array(t),this.F_=new Uint16Array(t);for(let s=0;s=this.D_.length)return null;let d=this.D_[a];if(-1===d)return null;const w=this.Z_!==i>3;w&&(d+=65536);let y=c.Tu?.get(BigInt(d));y||(y=r.A.model(65535&d),w&&y.fC(),c.Tu?.put(BigInt(d),y));const A=128!==this.J_||128!==this.Q_||128!==this.tC,p=0!==this.iC||0!==this.sC||0!==this.hC;let m=r.A.p_(y,!this.P_,!this.K_,i===l.A.qd&&-1===o&&!A&&!p);for(-1!==o&&(m.sc(),m.hc(o),m.uC=null,m.dC=null);i-- >0;)m.wC();if(this.P_&&this.F_)for(let t=0;t{s.d(i,{A:()=>l});var h=s(6333),e=s(1069),n=s(2031),r=s(8665),o=s(3867);class l extends h.${static count=0;static cache=null;static U_=null;static B_=null;static G_=0;static Qo=new n.A(30);static Sc=t=>{this.U_=new e.A(t.read('npc.dat'));const i=new e.A(t.read('npc.idx'));this.count=i.ct,this.B_=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.B_||!this.U_)throw new Error('NpcType not loaded!!!');for(let i=0;i<20;i++){const s=this.cache[i];if(s&&s.id===t)return s}this.G_=(this.G_+1)%20;const i=this.cache[this.G_]=new l(t);return this.U_.ft=this.B_[t],i.g_(this.U_),i};static Zo=()=>{this.Qo=null,this.B_=null,this.cache=null,this.U_=null};name=null;bw=null;size=1;D_=null;N_=null;K_=!1;BI=-1;MI=-1;xI=-1;NI=-1;UI=-1;P_=null;F_=null;Um=null;J_=-1;Q_=-1;tC=-1;kd=!0;Ym=-1;pC=128;mC=128;decode(t,i){if(1===t){const t=i.CA;this.D_=new Uint16Array(t);for(let s=0;s=30&&t<40)this.Um||(this.Um=new o.Ns(5,null)),this.Um[t-30]=i.NA,'hidden'===this.Um[t-30]?.toLowerCase()&&(this.Um[t-30]=null);else if(40===t){const t=i.CA;this.P_=new Uint16Array(t),this.F_=new Uint16Array(t);for(let s=0;s{s.d(i,{A:()=>u});var h=s(6333),e=s(1069),n=s(1122),r=s(2031),o=s(8665),l=s(4583),a=s(8950),c=s(9298),f=s(3867);class u extends h.${static count=0;static cache=null;static U_=null;static B_=null;static G_=0;static TC=!0;static Qo=new r.A(50);static vu=new r.A(200);static Sc=(t,i)=>{this.TC=i,this.U_=new e.A(t.read('obj.dat'));const s=new e.A(t.read('obj.idx'));this.count=s.ct,this.B_=new Int32Array(this.count);let h=2;for(let t=0;t{if(!this.cache||!this.B_||!this.U_)throw new Error('ObjType not loaded!!!');for(let i=0;i<10;i++){const s=this.cache[i];if(s&&s.id===t)return s}this.G_=(this.G_+1)%10;const i=this.cache[this.G_];return this.U_.ft=this.B_[t],i.id=t,i.reset(),i.g_(this.U_),-1!==i.OC&&i.vC(),!this.TC&&i.members&&(i.name='Members Object',i.bw="Login to a members' server to use this object.",i.Um=null,i.vm=null),i};static Zo=()=>{this.Qo=null,this.vu=null,this.B_=null,this.cache=null,this.U_=null};static ha=(t,i)=>{if(u.vu){let s=u.vu.get(BigInt(t));if(s&&s.Nd!==i&&-1!==s.Nd&&(s.SA(),s=null),s)return s}let s=u.get(t);if(s.bC||(i=-1),s.bC&&s.LC&&i>1){let t=-1;for(let h=0;h<10;h++)i>=s.LC[h]&&0!==s.LC[h]&&(t=s.bC[h]);-1!==t&&(s=u.get(t))}const h=new n.A(32,32),e=l.A.Sa,r=l.A.Ma,o=l.A.xc,f=a.A.Mc,d=a.A.RC,w=a.A.SC,y=a.A.left,A=a.A.right,p=a.A.top,m=a.A.bottom;l.A.MC=!1,a.A.bind(h.Mc,32,32),a.A.fillRect(0,0,32,32,c.A.ca),l.A.eg();const I=s.sA(1),E=l.A.sin[s.Bp]*s.Hp>>16,g=l.A.cos[s.Bp]*s.Hp>>16;I.Na(0,s.Gp,s.kC,s.Bp,s.xC,E+(I.AC/2|0)+s.DC,g+s.DC);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===h.Mc[t+32*i]&&(t>0&&h.Mc[t+32*i-1]>1||i>0&&h.Mc[t+32*(i-1)]>1||t<31&&h.Mc[t+32*i+1]>1||i<31&&h.Mc[t+32*(i+1)]>1)&&(h.Mc[t+32*i]=1);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===h.Mc[t+32*i]&&t>0&&i>0&&h.Mc[t+32*(i-1)-1]>0&&(h.Mc[t+32*i]=3153952);if(-1!==s.OC){const t=this.ha(s.NC,10),i=t.oa,h=t.Nd;t.oa=32,t.Nd=32,t.PC(5,5,22,22),t.oa=i,t.Nd=h}return u.vu?.put(BigInt(t),h),a.A.bind(f,d,w),a.A.Hl(y,p,A,m),l.A.Sa=e,l.A.Ma=r,l.A.xc=o,l.A.MC=!0,s.Ua?h.oa=33:h.oa=32,h.Nd=i,h};model=0;name=null;bw=null;P_=null;F_=null;Hp=2e3;Bp=0;Gp=0;kC=0;xC=0;DC=0;FC=!1;UC=-1;Ua=!1;tA=1;members=!1;Um=null;vm=null;BC=-1;GC=-1;HC=0;WC=-1;YC=-1;VC=0;KC=-1;XC=-1;zC=-1;jC=-1;ZC=-1;qC=-1;bC=null;LC=null;NC=-1;OC=-1;decode(t,i){if(1===t)this.model=i.ct;else if(2===t)this.name=i.NA;else if(3===t)this.bw=i.NA;else if(4===t)this.Hp=i.ct;else if(5===t)this.Bp=i.ct;else if(6===t)this.Gp=i.ct;else if(7===t)this.xC=i.Cp,this.xC>32767&&(this.xC-=65536);else if(8===t)this.DC=i.Cp,this.DC>32767&&(this.DC-=65536);else if(9===t)this.FC=!0;else if(10===t)this.UC=i.ct;else if(11===t)this.Ua=!0;else if(12===t)this.tA=i.ut;else if(16===t)this.members=!0;else if(23===t)this.BC=i.ct,this.HC=i.gA;else if(24===t)this.GC=i.ct;else if(25===t)this.WC=i.ct,this.VC=i.gA;else if(26===t)this.YC=i.ct;else if(t>=30&&t<35)this.Um||(this.Um=new f.Ns(5,null)),this.Um[t-30]=i.NA,'hidden'===this.Um[t-30]?.toLowerCase()&&(this.Um[t-30]=null);else if(t>=35&&t<40)this.vm||(this.vm=new f.Ns(5,null)),this.vm[t-35]=i.NA;else if(40===t){const t=i.CA;this.P_=new Uint16Array(t),this.F_=new Uint16Array(t);for(let s=0;s=100&&t<110&&(this.bC&&this.LC||(this.bC=new Uint16Array(10),this.LC=new Uint16Array(10)),this.bC[t-100]=i.ct,this.LC[t-100]=i.ct)}$C(t){let i=this.BC;if(1===t&&(i=this.WC),-1===i)return null;let s=this.GC,h=this.KC;1===t&&(s=this.YC,h=this.XC);let e=o.A.model(i);if(-1!==s){const t=o.A.model(s);if(-1===h){const i=[e,t];e=o.A.$a(i,2)}else{const i=[e,t,o.A.model(h)];e=o.A.$a(i,3)}}if(0===t&&0!==this.HC&&e.translate(this.HC,0,0),1===t&&0!==this.VC&&e.translate(this.VC,0,0),this.P_&&this.F_)for(let t=0;t1){let i=-1;for(let s=0;s<10;s++)t>=this.LC[s]&&0!==this.LC[s]&&(i=this.bC[s]);if(-1!==i)return u.get(i).sA(1)}if(u.Qo){const t=u.Qo.get(BigInt(this.id));if(t)return t}const i=o.A.model(this.model);if(this.P_&&this.F_)for(let t=0;t{s.d(i,{A:()=>r});var h=s(6333),e=s(1069),n=s(6730);class r extends h.${static count=0;static Jo=[];static Sc=t=>{const i=new e.A(t.read('seq.dat'));this.count=i.ct;for(let t=0;t{s.d(i,{A:()=>l});var h=s(6333),e=s(1069),n=s(1312),r=s(8665),o=s(2031);class l extends h.${static count=0;static Jo=[];static Qo=new o.A(30);static Sc=t=>{const i=new e.A(t.read('spotanim.dat'));this.count=i.ct;for(let t=0;t=40&&t<50)this.P_[t-40]=i.ct;else{if(!(t>=50&&t<60))throw new Error(`Unrecognized spotanim config code: ${t}`);this.F_[t-50]=i.ct}}xa(){let t=l.Qo?.get(BigInt(this.id));if(t)return t;t=r.A.model(this.model);for(let i=0;i<6;i++)0!==this.P_[0]&&t.Ja(this.P_[i],this.F_[i]);return l.Qo?.put(BigInt(this.id),t),t}}},3764:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(6333),e=s(1069);class n extends h.${static count=0;static Jo=[];static tT=[];static iT=0;static Sc=t=>{const i=new e.A(t.read('varp.dat'));this.count=i.ct;for(let t=0;t{s.d(i,{A:()=>h});class h{static OPEN=0;static rT=1;static oT=2;static lT=4;static aT=8;static cT=h.rT<<4;static fT=h.oT<<4;static uT=h.lT<<4;static dT=h.aT<<4;static wT=256;static yT=512;static AT=1024;static pT=2048;static mT=4096;static IT=h.yT<<4;static ET=h.AT<<4;static gT=h.pT<<4;static _T=h.mT<<4;static CT=h.wT<<9;static TT=524288;static OT=2097152;static vT=h.OT|h.TT;static bT=h.wT|h.vT;static Yd=h.oT|h.bT;static Hd=h.aT|h.bT;static Zm=h.oT|h.lT|h.Hd;static Vd=h.fT|h.bT;static $m=h.aT|h.cT|h.Vd;static Wd=h.dT|h.bT;static qm=h.rT|h.oT|h.Wd;static Jm=h.fT|h.uT|h.Wd;static LT=16777215}},670:(t,i,s)=>{s.d(i,{A:()=>o});var h=s(9456),e=s(6169),n=s(1023),r=s(4909);class o{static tr=4;static yr=104;static index=(t,i)=>t*o.yr+i;offsetX;RT;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.RT=0,this.sizeX=o.yr,this.sizeZ=o.yr,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.RT)]|=h.A.OT};yA=(t,i)=>{this.flags[o.index(t-this.offsetX,i-this.RT)]&=~h.A.OT};eA=(t,i,s,n,r,o)=>{let l=h.A.wT;o&&(l|=h.A.CT);const a=t-this.offsetX,c=i-this.RT;if(r===e.A.$d||r===e.A.Qd){const t=s;s=n,n=t}for(let t=a;t=0&&t=0&&i{let l=h.A.wT;o&&(l|=h.A.CT);const a=t-this.offsetX,c=i-this.RT;if(r===e.A.$d||r===e.A.Qd){const t=s;s=n,n=t}for(let t=a;t=0&&t=0&&i{const l=t-this.offsetX,a=i-this.RT,c=o?h.A._T:h.A.dT,f=o?h.A.mT:h.A.aT,u=o?h.A.AT:h.A.oT,d=o?h.A.ET:h.A.fT,w=o?h.A.yT:h.A.rT,y=o?h.A.IT:h.A.cT,A=o?h.A.pT:h.A.lT,p=o?h.A.gT:h.A.uT;s===n.A.jd.id?r===e.A.qd?(this.add(l,a,c),this.add(l-1,a,f)):r===e.A.$d?(this.add(l,a,u),this.add(l,a+1,d)):r===e.A.Jd?(this.add(l,a,f),this.add(l+1,a,c)):r===e.A.Qd&&(this.add(l,a,d),this.add(l,a-1,u)):s===n.A.kT.id||s===n.A.tw.id?r===e.A.qd?(this.add(l,a,w),this.add(l-1,a+1,y)):r===e.A.$d?(this.add(l,a,A),this.add(l+1,a+1,p)):r===e.A.Jd?(this.add(l,a,y),this.add(l+1,a-1,w)):r===e.A.Qd&&(this.add(l,a,p),this.add(l-1,a-1,A)):s===n.A.Zd.id&&(r===e.A.qd?(this.add(l,a,u|c),this.add(l-1,a,f),this.add(l,a+1,d)):r===e.A.$d?(this.add(l,a,u|f),this.add(l,a+1,d),this.add(l+1,a,c)):r===e.A.Jd?(this.add(l,a,d|f),this.add(l+1,a,c),this.add(l,a-1,u)):r===e.A.Qd&&(this.add(l,a,d|c),this.add(l,a-1,u),this.add(l-1,a,f))),o&&this.MT(t,i,s,r,!1)};aA=(t,i,s,r,o)=>{const l=t-this.offsetX,a=i-this.RT,c=o?h.A._T:h.A.dT,f=o?h.A.mT:h.A.aT,u=o?h.A.AT:h.A.oT,d=o?h.A.ET:h.A.fT,w=o?h.A.yT:h.A.rT,y=o?h.A.IT:h.A.cT,A=o?h.A.pT:h.A.lT,p=o?h.A.gT:h.A.uT;s===n.A.jd.id?r===e.A.qd?(this.remove(l,a,c),this.remove(l-1,a,f)):r===e.A.$d?(this.remove(l,a,u),this.remove(l,a+1,d)):r===e.A.Jd?(this.remove(l,a,f),this.remove(l+1,a,c)):r===e.A.Qd&&(this.remove(l,a,d),this.remove(l,a-1,u)):s===n.A.kT.id||s===n.A.tw.id?r===e.A.qd?(this.remove(l,a,w),this.remove(l-1,a+1,y)):r===e.A.$d?(this.remove(l,a,A),this.remove(l+1,a+1,p)):r===e.A.Jd?(this.remove(l,a,y),this.remove(l+1,a-1,w)):r===e.A.Qd&&(this.remove(l,a,p),this.remove(l-1,a-1,A)):s===n.A.Zd.id&&(r===e.A.qd?(this.remove(l,a,u|c),this.remove(l-1,a,f),this.remove(l,a+1,d)):r===e.A.$d?(this.remove(l,a,u|f),this.remove(l,a+1,d),this.remove(l+1,a,c)):r===e.A.Jd?(this.remove(l,a,d|f),this.remove(l+1,a,c),this.remove(l,a-1,u)):r===e.A.Qd&&(this.remove(l,a,d|c),this.remove(l,a-1,u),this.remove(l-1,a,f))),o&&this.aA(t,i,s,r,!1)};Xm=(t,i,s,r,l,a)=>{if(t===s&&i===r)return!0;const c=t-this.offsetX,f=i-this.RT,u=s-this.offsetX,d=r-this.RT,w=o.index(c,f);if(l===n.A.jd.id){if(a===e.A.qd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A.Vd)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.Yd)===h.A.OPEN)return!0}else if(a===e.A.$d){if(c===u&&f===d+1)return!0;if(c===u-1&&f===d&&(this.flags[w]&h.A.Hd)===h.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.Wd)===h.A.OPEN)return!0}else if(a===e.A.Jd){if(c===u+1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A.Vd)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.Yd)===h.A.OPEN)return!0}else if(a===e.A.Qd){if(c===u&&f===d-1)return!0;if(c===u-1&&f===d&&(this.flags[w]&h.A.Hd)===h.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.Wd)===h.A.OPEN)return!0}}else if(l===n.A.Zd.id){if(a===e.A.qd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.Wd)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.Yd)===h.A.OPEN)return!0}else if(a===e.A.$d){if(c===u-1&&f===d&&(this.flags[w]&h.A.Hd)===h.A.OPEN)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.Yd)===h.A.OPEN)return!0}else if(a===e.A.Jd){if(c===u-1&&f===d&&(this.flags[w]&h.A.Hd)===h.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A.Vd)===h.A.OPEN)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1)return!0}else if(a===e.A.Qd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A.Vd)===h.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.Wd)===h.A.OPEN)return!0;if(c===u&&f===d-1)return!0}}else if(l===n.A.sw.id){if(c===u&&f===d+1&&(this.flags[w]&h.A.fT)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.oT)===h.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&h.A.aT)===h.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.dT)===h.A.OPEN)return!0}return!1};zm=(t,i,s,r,l,a)=>{if(t===s&&i===r)return!0;const c=t-this.offsetX,f=i-this.RT,u=s-this.offsetX,d=r-this.RT,w=o.index(c,f);if(l===n.A.xT.id||l===n.A.DT.id){if(l===n.A.DT.id&&(a=a+2&3),a===e.A.qd){if(c===u+1&&f===d&&(this.flags[w]&h.A.dT)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.oT)===h.A.OPEN)return!0}else if(a===e.A.$d){if(c===u-1&&f===d&&(this.flags[w]&h.A.aT)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.oT)===h.A.OPEN)return!0}else if(a===e.A.Jd){if(c===u-1&&f===d&&(this.flags[w]&h.A.aT)===h.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A.fT)===h.A.OPEN)return!0}else if(a===e.A.Qd){if(c===u+1&&f===d&&(this.flags[w]&h.A.dT)===h.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A.fT)===h.A.OPEN)return!0}}else if(l===n.A.NT.id){if(c===u&&f===d+1&&(this.flags[w]&h.A.fT)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.oT)===h.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&h.A.aT)===h.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.dT)===h.A.OPEN)return!0}return!1};jm=(t,i,s,e,n,l,a)=>{const c=s+n-1,f=e+l-1,u=o.index(t-this.offsetX,i-this.RT);return t>=s&&t<=c&&i>=e&&i<=f||(t===s-1&&i>=e&&i<=f&&(this.flags[u]&h.A.aT)===h.A.OPEN&&(a&r.A.qd)===h.A.OPEN||(t===c+1&&i>=e&&i<=f&&(this.flags[u]&h.A.dT)===h.A.OPEN&&(a&r.A.Jd)===h.A.OPEN||(i===e-1&&t>=s&&t<=c&&(this.flags[u]&h.A.oT)===h.A.OPEN&&(a&r.A.Qd)===h.A.OPEN||i===f+1&&t>=s&&t<=c&&(this.flags[u]&h.A.fT)===h.A.OPEN&&(a&r.A.$d)===h.A.OPEN)))};add=(t,i,s)=>{this.flags[o.index(t,i)]|=s};remove=(t,i,s)=>{this.flags[o.index(t,i)]&=h.A.LT-s}}},4909:(t,i,s)=>{s.d(i,{A:()=>h});class h{static $d=1;static Jd=2;static Qd=4;static qd=8}},6169:(t,i,s)=>{s.d(i,{A:()=>h});class h{static qd=0;static $d=1;static Jd=2;static Qd=3}},5599:(t,i,s)=>{s.d(i,{A:()=>h});class h{static nA=0;static rA=1;static lA=2;static Fy=3}},1023:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(5599);class e{static jd=new e(0,h.A.nA);static kT=new e(1,h.A.nA);static Zd=new e(2,h.A.nA);static tw=new e(3,h.A.nA);static dE=new e(4,h.A.rA);static Km=new e(5,h.A.rA);static xT=new e(6,h.A.rA);static DT=new e(7,h.A.rA);static NT=new e(8,h.A.rA);static sw=new e(9,h.A.lA);static Ny=new e(10,h.A.lA);static Py=new e(11,h.A.lA);static PT=new e(12,h.A.lA);static FT=new e(13,h.A.lA);static UT=new e(14,h.A.lA);static BT=new e(15,h.A.lA);static GT=new e(16,h.A.lA);static HT=new e(17,h.A.lA);static WT=new e(18,h.A.lA);static YT=new e(19,h.A.lA);static VT=new e(20,h.A.lA);static KT=new e(21,h.A.lA);static Fy=new e(22,h.A.Fy);static values(){return[this.jd,this.kT,this.HT,this.BT,this.Zd,this.UT,this.sw,this.tw,this.Fy,this.PT,this.Py,this.xT,this.VT,this.Ny,this.Km,this.FT,this.DT,this.dE,this.GT,this.NT,this.YT,this.KT,this.WT]}static of(t){const i=this.values();for(let s=0;s{s.d(i,{A:()=>A});var h=s(670),e=s(2164),n=s(1069),r=s(4583),o=s(198),l=s(5637),a=s(4197),c=s(1312),f=s(1023),u=s(6169),d=s(9298),w=s(5518),y=s(3867);class A{static XT=Int8Array.of(1,2,4,8);static zT=Uint8Array.of(16,32,64,128);static jT=Int8Array.of(1,0,-1,0);static ZT=Int8Array.of(0,-1,0,1);static qT=(17*Math.random()|0)-8;static $T=(33*Math.random()|0)-16;static vt=!0;static hm=0;static JT=!1;static QT=(t,i)=>{let s=this.tO(t+45365,i+91923,4)+(this.tO(t+10294,i+37821,2)-128>>1)+(this.tO(t,i,1)-128>>2)-128;return s=35+(.3*s|0),s<10?s=10:s>60&&(s=60),s};static tO=(t,i,s)=>{const h=t/s|0,e=t&s-1,n=i/s|0,r=i&s-1,o=this.iO(h,n),l=this.iO(h+1,n),a=this.iO(h,n+1),c=this.iO(h+1,n+1),f=this.sO(o,l,e,s),u=this.sO(a,c,e,s);return this.sO(f,u,r,s)};static sO=(t,i,s,h)=>{const e=65536-r.A.cos[1024*s/h|0]>>1;return(t*(65536-e)>>16)+(i*e>>16)};static iO=(t,i)=>((this.hO(t-1,i-1)+this.hO(t+1,i-1)+this.hO(t-1,i+1)+this.hO(t+1,i+1))/16|0)+((this.hO(t-1,i)+this.hO(t+1,i)+this.hO(t,i-1)+this.hO(t,i+1))/8|0)+(this.hO(t,i)/4|0);static hO=(t,i)=>{const s=t+57*i,h=BigInt(s<<13^s);return 255&Number((h*(h*h*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static eA=(t,i,s,h,e,n,r,o,d,w,y)=>{const p=e[y][i][s],m=e[y][i+1][s],I=e[y][i+1][s+1],E=e[y][i][s+1],g=p+m+I+E>>2,_=l.A.get(o);let C=i+(s<<7)+(o<<14)+1073741824|0;_.active||(C+=-2147483648),C|=0;const T=(w<<6)+d<<24>>24;if(d===f.A.Fy.id)h?.eO(_.xa(f.A.Fy.id,w,p,m,I,E,-1),t,i,s,g,C,T),_.cA&&_.active&&r?.ST(i,s),-1!==_.Dl&&n.LE(new a.A(o,t,3,i,s,c.A.Jo[_.Dl],!0));else if(d===f.A.Ny.id||d===f.A.Py.id){const e=_.xa(f.A.Ny.id,w,p,m,I,E,-1);if(e){let n,r,o=0;d===f.A.Py.id&&(o+=256),w===u.A.$d||w===u.A.Qd?(n=_.length,r=_.width):(n=_.width,r=_.length),h?.eA(t,i,s,g,e,null,C,T,n,r,o)}_.cA&&r?.eA(i,s,_.width,_.length,w,_.fA),-1!==_.Dl&&n.LE(new a.A(o,t,2,i,s,c.A.Jo[_.Dl],!0))}else if(d>=f.A.PT.id)h?.eA(t,i,s,g,_.xa(d,w,p,m,I,E,-1),null,C,T,1,1,0),_.cA&&r?.eA(i,s,_.width,_.length,w,_.fA),-1!==_.Dl&&n.LE(new a.A(o,t,2,i,s,c.A.Jo[_.Dl],!0));else if(d===f.A.jd.id)h?.MT(t,i,s,g,A.XT[w],0,_.xa(f.A.jd.id,w,p,m,I,E,-1),null,C,T),_.cA&&r?.MT(i,s,d,w,_.fA),-1!==_.Dl&&n.LE(new a.A(o,t,0,i,s,c.A.Jo[_.Dl],!0));else if(d===f.A.kT.id)h?.MT(t,i,s,g,A.zT[w],0,_.xa(f.A.kT.id,w,p,m,I,E,-1),null,C,T),_.cA&&r?.MT(i,s,d,w,_.fA),-1!==_.Dl&&n.LE(new a.A(o,t,0,i,s,c.A.Jo[_.Dl],!0));else if(d===f.A.Zd.id){const e=w+1&3;h?.MT(t,i,s,g,A.XT[w],A.XT[e],_.xa(f.A.Zd.id,w+4,p,m,I,E,-1),_.xa(f.A.Zd.id,e,p,m,I,E,-1),C,T),_.cA&&r?.MT(i,s,d,w,_.fA),-1!==_.Dl&&n.LE(new a.A(o,t,0,i,s,c.A.Jo[_.Dl],!0))}else if(d===f.A.tw.id)h?.MT(t,i,s,g,A.zT[w],0,_.xa(f.A.tw.id,w,p,m,I,E,-1),null,C,T),_.cA&&r?.MT(i,s,d,w,_.fA),-1!==_.Dl&&n.LE(new a.A(o,t,0,i,s,c.A.Jo[_.Dl],!0));else if(d===f.A.sw.id)h?.eA(t,i,s,g,_.xa(d,w,p,m,I,E,-1),null,C,T,1,1,0),_.cA&&r?.eA(i,s,_.width,_.length,w,_.fA),-1!==_.Dl&&n.LE(new a.A(o,t,2,i,s,c.A.Jo[_.Dl],!0));else if(d===f.A.dE.id)h?.nO(t,i,s,g,0,0,C,_.xa(f.A.dE.id,u.A.qd,p,m,I,E,-1),T,512*w,A.XT[w]),-1!==_.Dl&&n.LE(new a.A(o,t,1,i,s,c.A.Jo[_.Dl],!0));else if(d===f.A.Km.id){let e=16;if(h){const n=h.Kd(t,i,s);n>0&&(e=l.A.get(n>>14&32767).X_)}h?.nO(t,i,s,g,A.jT[w]*e,A.ZT[w]*e,C,_.xa(f.A.dE.id,u.A.qd,p,m,I,E,-1),T,512*w,A.XT[w]),-1!==_.Dl&&n.LE(new a.A(o,t,1,i,s,c.A.Jo[_.Dl],!0))}else d===f.A.xT.id?(h?.nO(t,i,s,g,0,0,C,_.xa(f.A.dE.id,u.A.qd,p,m,I,E,-1),T,w,256),-1!==_.Dl&&n.LE(new a.A(o,t,1,i,s,c.A.Jo[_.Dl],!0))):d===f.A.DT.id?(h?.nO(t,i,s,g,0,0,C,_.xa(f.A.dE.id,u.A.qd,p,m,I,E,-1),T,w,512),-1!==_.Dl&&n.LE(new a.A(o,t,1,i,s,c.A.Jo[_.Dl],!0))):d===f.A.NT.id&&(h?.nO(t,i,s,g,0,0,C,_.xa(f.A.dE.id,u.A.qd,p,m,I,E,-1),T,w,768),-1!==_.Dl&&n.LE(new a.A(o,t,1,i,s,c.A.Jo[_.Dl],!0)))};hE;eE;cr;ur;rO;oO;lO;aO;cO;fO;uO;dO;wO;yO;AO;pO;constructor(t,i,s,e){this.hE=t,this.eE=i,this.cr=s,this.ur=e,this.rO=new y._c(h.A.tr,t,i),this.oO=new y._c(h.A.tr,t,i),this.lO=new y._c(h.A.tr,t,i),this.aO=new y._c(h.A.tr,t,i),this.pO=new y.Cc(h.A.tr,t+1,i+1),this.cO=new y._c(h.A.tr,t+1,i+1),this.fO=new y.wr(t+1,i+1),this.uO=new Int32Array(i),this.dO=new Int32Array(i),this.wO=new Int32Array(i),this.yO=new Int32Array(i),this.AO=new Int32Array(i)}um=(t,i)=>{for(let t=0;t=0&&i[h]?.ST(s,e)}A.qT+=(5*Math.random()|0)-2,A.qT<-8?A.qT=-8:A.qT>8&&(A.qT=8),A.$T+=(5*Math.random()|0)-2,A.$T<-16?A.$T=-16:A.$T>16&&(A.$T=16);for(let i=0;i>8;for(let t=1;t>2)+(s[e+1][t]>>3)+(s[e][t-1]>>2)+(s[e][t+1]>>3)+(s[e][t]>>1);this.fO[e][t]=u-d}for(let t=0;t=0&&h0){const i=e.A.Jo[s-1];this.uO[t]+=i.k_,this.dO[t]+=i.R_,this.wO[t]+=i.S_,this.yO[t]+=i.M_,n=this.AO[t]++}}const r=s-5;if(r>=0&&r0){const i=e.A.Jo[s-1];this.uO[t]-=i.k_,this.dO[t]-=i.R_,this.wO[t]-=i.S_,this.yO[t]-=i.M_,n=this.AO[t]--}}}if(s>=1&&s=0&&f=0&&y=1&&c0||y>0){const p=this.cr[i][s][c],m=this.cr[i][s+1][c],I=this.cr[i][s+1][c+1],E=this.cr[i][s][c+1],g=this.fO[s][c],_=this.fO[s+1][c],C=this.fO[s+1][c+1],T=this.fO[s][c+1];let O=-1,v=-1;if(f>0){const t=256*h/l|0,i=n/a|0;let s=o/a|0;O=e.A.__(t,i,s);const r=t+A.qT&255;s+=A.$T,s<0?s=0:s>255&&(s=255),v=e.A.__(r,i,s)}if(i>0){let t=0!==f||this.lO[i][s][c]===w.A.IO;y>0&&!e.A.Jo[y-1].b_&&(t=!1),t&&p===m&&p===I&&p===E&&(this.pO[i][s][c]|=2340)}let b=0;if(-1!==O&&(b=r.A.palette[e.A.C_(v,96)]),0===y)t?.EO(i,s,c,w.A.IO,u.A.qd,-1,p,m,I,E,e.A.C_(O,g),e.A.C_(O,_),e.A.C_(O,C),e.A.C_(O,T),d.A.ca,d.A.ca,d.A.ca,d.A.ca,b,d.A.ca);else{const h=this.lO[i][s][c]+1,n=this.aO[i][s][c],o=e.A.Jo[y-1];let l,a,f=o.texture;f>=0?(a=r.A.gO(f),l=-1):o.O_===d.A.Jc?(a=0,l=-2,f=-1):(l=e.A.__(o.L_,o.R_,o.S_),a=r.A.palette[e.A.T_(o.x_,96)]),t?.EO(i,s,c,h,n,f,p,m,I,E,e.A.C_(O,g),e.A.C_(O,_),e.A.C_(O,C),e.A.C_(O,T),e.A.T_(l,g),e.A.T_(l,_),e.A.T_(l,C),e.A.T_(l,T),b,a)}}}}}}for(let s=1;s0&&(t<<=3,i<<=3,s<<=3);for(let h=0;h<=e;h++)for(let n=0;n<=this.eE;n++)for(let r=0;r<=this.hE;r++){if(this.pO[h][r][n]&t){let i=n,s=n,l=h,a=h;for(;i>0&&this.pO[h][r][i-1]&t;)i--;for(;s0;){for(let h=i;h<=s;h++)if(!(this.pO[l-1][r][h]&t))break t;l--}t:for(;a=8){const h=this.cr[a][r][i]-240,n=this.cr[l][r][i];o.A.OO(e,1,128*r,h,128*i,128*r,n,128*s+128);for(let h=l;h<=a;h++)for(let e=i;e<=s;e++)this.pO[h][r][e]&=~t}}if(this.pO[h][r][n]&i){let t=r,s=r,l=h,a=h;for(;t>0&&this.pO[h][t-1][n]&i;)t--;for(;s0;){for(let h=t;h<=s;h++)if(!(this.pO[l-1][h][n]&i))break t;l--}t:for(;a=8){const h=this.cr[a][t][n]-240,r=this.cr[l][t][n];o.A.OO(e,2,128*t,h,128*n,128*s+128,r,128*n);for(let h=l;h<=a;h++)for(let e=t;e<=s;e++)this.pO[h][e][n]&=~i}}if(this.pO[h][r][n]&s){let t=r,i=r,l=n,a=n;for(;l>0&&this.pO[h][r][l-1]&s;)l--;for(;a0;){for(let i=l;i<=a;i++)if(!(this.pO[h][t-1][i]&s))break t;t--}t:for(;i=4){const n=this.cr[h][t][l];o.A.OO(e,4,128*t,n,128*l,128*i+128,n,128*a+128);for(let e=t;e<=i;e++)for(let t=l;t<=a;t++)this.pO[h][e][t]&=~s}}}}}};am=(t,i,s,n)=>{let r=0;for(let t=0;t>24;break}for(let e=t;e=0&&t=0&&e{const o=new n.A(new Uint8Array(r));for(let n=0;n=0&&a=0&&c>24,this.aO[n][a][c]=(f-2&3)<<24>>24):f<=81?this.ur[n][a][c]=f-49<<24>>24:this.rO[n][a][c]=f-81<<24>>24}else for(;f=o.CA,0!==f;){if(1===f){o.CA;break}f<=49&&o.CA}}};fm=(t,i,s,e,r,o)=>{const l=new n.A(new Uint8Array(e));let a=-1;for(;;){const e=l.vO;if(0===e)return;a+=e;let n=0;for(;;){const e=l.vO;if(0===e)break;n+=e-1;const c=63&n,f=n>>6&63,u=n>>12,d=l.CA,w=d>>2,y=3&d,A=f+r,p=c+o;if(A>0&&p>0&&A=0&&(e=s[h]),this.eA(u,A,p,t,i,e,a,w,y)}}}};eA=(t,i,s,h,e,n,r,o,d)=>{if(A.vt){if(16&this.ur[t][i][s])return;if(this.mO(t,i,s)!==A.hm)return}const w=this.cr[t][i][s],y=this.cr[t][i+1][s],p=this.cr[t][i+1][s+1],m=this.cr[t][i][s+1],I=w+y+p+m>>2,E=l.A.get(r);let g=i+(s<<7)+(r<<14)+1073741824|0;E.active||(g+=-2147483648),g|=0;const _=(d<<6)+o<<24>>24;if(o===f.A.Fy.id)(!A.vt||E.active||E.eC)&&(h?.eO(E.xa(f.A.Fy.id,d,w,y,p,m,-1),t,i,s,I,g,_),E.cA&&E.active&&n?.ST(i,s),-1!==E.Dl&&e.LE(new a.A(r,t,3,i,s,c.A.Jo[E.Dl],!0)));else if(o===f.A.Ny.id||o===f.A.Py.id){const l=E.xa(f.A.Ny.id,d,w,y,p,m,-1);if(l){let e,n,r=0;if(o===f.A.Py.id&&(r+=256),d===u.A.$d||d===u.A.Qd?(e=E.length,n=E.width):(e=E.width,n=E.length),h?.eA(t,i,s,I,l,null,g,_,e,n,r)&&E.q_)for(let h=0;h<=e;h++)for(let e=0;e<=n;e++){let n=l.bO/4|0;n>30&&(n=30),n>this.cO[t][i+h][s+e]&&(this.cO[t][i+h][s+e]=n<<24>>24)}}E.cA&&n?.eA(i,s,E.width,E.length,d,E.fA),-1!==E.Dl&&e.LE(new a.A(r,t,2,i,s,c.A.Jo[E.Dl],!0))}else if(o>=f.A.PT.id)h?.eA(t,i,s,I,E.xa(o,d,w,y,p,m,-1),null,g,_,1,1,0),o>=f.A.PT.id&&o<=f.A.HT.id&&o!==f.A.FT.id&&t>0&&(this.pO[t][i][s]|=2340),E.cA&&n?.eA(i,s,E.width,E.length,d,E.fA),-1!==E.Dl&&e.LE(new a.A(r,t,2,i,s,c.A.Jo[E.Dl],!0));else if(o===f.A.jd.id)h?.MT(t,i,s,I,A.XT[d],0,E.xa(f.A.jd.id,d,w,y,p,m,-1),null,g,_),d===u.A.qd?(E.q_&&(this.cO[t][i][s]=50,this.cO[t][i][s+1]=50),E.b_&&(this.pO[t][i][s]|=585)):d===u.A.$d?(E.q_&&(this.cO[t][i][s+1]=50,this.cO[t][i+1][s+1]=50),E.b_&&(this.pO[t][i][s+1]|=1170)):d===u.A.Jd?(E.q_&&(this.cO[t][i+1][s]=50,this.cO[t][i+1][s+1]=50),E.b_&&(this.pO[t][i+1][s]|=585)):d===u.A.Qd&&(E.q_&&(this.cO[t][i][s]=50,this.cO[t][i+1][s]=50),E.b_&&(this.pO[t][i][s]|=1170)),E.cA&&n?.MT(i,s,o,d,E.fA),-1!==E.Dl&&e.LE(new a.A(r,t,0,i,s,c.A.Jo[E.Dl],!0)),16!==E.X_&&h?.LO(t,i,s,E.X_);else if(o===f.A.kT.id)h?.MT(t,i,s,I,A.zT[d],0,E.xa(f.A.kT.id,d,w,y,p,m,-1),null,g,_),E.q_&&(d===u.A.qd?this.cO[t][i][s+1]=50:d===u.A.$d?this.cO[t][i+1][s+1]=50:d===u.A.Jd?this.cO[t][i+1][s]=50:d===u.A.Qd&&(this.cO[t][i][s]=50)),E.cA&&n?.MT(i,s,o,d,E.fA),-1!==E.Dl&&e.LE(new a.A(r,t,0,i,s,c.A.Jo[E.Dl],!0));else if(o===f.A.Zd.id){const l=d+1&3;h?.MT(t,i,s,I,A.XT[d],A.XT[l],E.xa(f.A.Zd.id,d+4,w,y,p,m,-1),E.xa(f.A.Zd.id,l,w,y,p,m,-1),g,_),E.b_&&(d===u.A.qd?(this.pO[t][i][s]|=265,this.pO[t][i][s+1]|=1170):d===u.A.$d?(this.pO[t][i][s+1]|=1170,this.pO[t][i+1][s]|=585):d===u.A.Jd?(this.pO[t][i+1][s]|=585,this.pO[t][i][s]|=1170):d===u.A.Qd&&(this.pO[t][i][s]|=1170,this.pO[t][i][s]|=585)),E.cA&&n?.MT(i,s,o,d,E.fA),-1!==E.Dl&&e.LE(new a.A(r,t,0,i,s,c.A.Jo[E.Dl],!0)),16!==E.X_&&h?.LO(t,i,s,E.X_)}else if(o===f.A.tw.id)h?.MT(t,i,s,I,A.zT[d],0,E.xa(f.A.tw.id,d,w,y,p,m,-1),null,g,_),E.q_&&(d===u.A.qd?this.cO[t][i][s+1]=50:d===u.A.$d?this.cO[t][i+1][s+1]=50:d===u.A.Jd?this.cO[t][i+1][s]=50:d===u.A.Qd&&(this.cO[t][i][s]=50)),E.cA&&n?.MT(i,s,o,d,E.fA),-1!==E.Dl&&e.LE(new a.A(r,t,0,i,s,c.A.Jo[E.Dl],!0));else if(o===f.A.sw.id)h?.eA(t,i,s,I,E.xa(o,d,w,y,p,m,-1),null,g,_,1,1,0),E.cA&&n?.eA(i,s,E.width,E.length,d,E.fA),-1!==E.Dl&&e.LE(new a.A(r,t,2,i,s,c.A.Jo[E.Dl],!0));else if(o===f.A.dE.id)h?.nO(t,i,s,I,0,0,g,E.xa(f.A.dE.id,u.A.qd,w,y,p,m,-1),_,512*d,A.XT[d]),-1!==E.Dl&&e.LE(new a.A(r,t,1,i,s,c.A.Jo[E.Dl],!0));else if(o===f.A.Km.id){let n=16;if(h){const e=h.Kd(t,i,s);e>0&&(n=l.A.get(e>>14&32767).X_)}h?.nO(t,i,s,I,A.jT[d]*n,A.ZT[d]*n,g,E.xa(f.A.dE.id,u.A.qd,w,y,p,m,-1),_,512*d,A.XT[d]),-1!==E.Dl&&e.LE(new a.A(r,t,1,i,s,c.A.Jo[E.Dl],!0))}else o===f.A.xT.id?(h?.nO(t,i,s,I,0,0,g,E.xa(f.A.dE.id,u.A.qd,w,y,p,m,-1),_,d,256),-1!==E.Dl&&e.LE(new a.A(r,t,1,i,s,c.A.Jo[E.Dl],!0))):o===f.A.DT.id?(h?.nO(t,i,s,I,0,0,g,E.xa(f.A.dE.id,u.A.qd,w,y,p,m,-1),_,d,512),-1!==E.Dl&&e.LE(new a.A(r,t,1,i,s,c.A.Jo[E.Dl],!0))):o===f.A.NT.id&&(h?.nO(t,i,s,I,0,0,g,E.xa(f.A.dE.id,u.A.qd,w,y,p,m,-1),_,d,768),-1!==E.Dl&&e.LE(new a.A(r,t,1,i,s,c.A.Jo[E.Dl],!0)))};mO=(t,i,s)=>8&this.ur[t][i][s]?0:t<=0||!(2&this.ur[1][i][s])?t:t-1}},198:(t,i,s)=>{s.d(i,{A:()=>I});var h=s(4583);class e{level;y;x;z;model;RO;JI;SO;MO;kO;xO;DO;info;NO=0;wu=0;constructor(t,i,s,h,e,n,r,o,l,a,c,f,u){this.level=t,this.y=i,this.x=s,this.z=h,this.model=e,this.RO=n,this.JI=r,this.SO=o,this.MO=l,this.kO=a,this.xO=c,this.DO=f,this.info=u}}var n=s(3795);class r{iE;hE;sE;eE;type;PO;FO;UO;BO;GO;AC;mode=0;HO=0;WO=0;YO=0;VO=0;KO=0;XO=0;constructor(t,i,s,h,e,n,r,o,l,a,c){this.iE=t,this.hE=i,this.sE=s,this.eE=h,this.type=e,this.PO=n,this.FO=r,this.UO=o,this.BO=l,this.GO=a,this.AC=c}}var o=s(670);class l{y;x;z;model;DO;info;constructor(t,i,s,h,e,n){this.y=t,this.x=i,this.z=s,this.model=h,this.DO=e,this.info=n}}class a{y;x;z;zO;jO;ZO;qO;DO;info;constructor(t,i,s,h,e,n,r,o,l){this.y=t,this.x=i,this.z=s,this.zO=h,this.jO=e,this.ZO=n,this.qO=r,this.DO=o,this.info=l}}class c{y;x;z;type;angle;model;DO;info;constructor(t,i,s,h,e,n,r,o){this.y=t,this.x=i,this.z=s,this.type=h,this.angle=e,this.model=n,this.DO=r,this.info=o}}var f=s(6666);class u{y;x;z;$O;JO;QO;DO;offset;constructor(t,i,s,h,e,n,r,o){this.y=t,this.x=i,this.z=s,this.$O=h,this.JO=e,this.QO=n,this.DO=r,this.offset=o}}class d{tv;iv;sv;hv;ev;color;flat;constructor(t,i,s,h,e,n,r){this.tv=t,this.iv=i,this.sv=s,this.hv=h,this.ev=e,this.color=n,this.flat=r}}var w=s(8950);class y{static nv=new Int32Array(6);static rv=new Int32Array(6);static ov=new Int32Array(6);static lv=new Int32Array(6);static av=new Int32Array(6);static cv=[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 fv=[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 uv=128;static dv=this.uv/2|0;static wv=this.uv/4|0;static yv=3*this.uv/4|0;oC;aC;lC;Av;pv;mv;Iv;Ev;gv;_v;flat;shape;angle;Cv;Tv;constructor(t,i,s,h,e,n,r,o,l,a,c,f,u,d,w,A,p,m,I){this.flat=!(p!==h||p!==d||p!==o),this.shape=i,this.angle=n,this.Cv=u,this.Tv=l;const E=y.cv[i],g=E.length;this.oC=new Int32Array(g),this.aC=new Int32Array(g),this.lC=new Int32Array(g);const _=new Int32Array(g),C=new Int32Array(g),T=t*y.uv,O=m*y.uv;for(let t=0;t8&&g<=12&&(g=9+(g-n-9&3)),g>12&&g<=16&&(g=13+(g-n-13&3)),1===g?(i=T,l=O,c=p,u=r,m=a):2===g?(i=T+y.dv,l=O,c=p+h>>1,u=r+I>>1,m=a+s>>1):3===g?(i=T+y.uv,l=O,c=h,u=I,m=s):4===g?(i=T+y.uv,l=O+y.dv,c=h+d>>1,u=I+e>>1,m=s+w>>1):5===g?(i=T+y.uv,l=O+y.uv,c=d,u=e,m=w):6===g?(i=T+y.dv,l=O+y.uv,c=d+o>>1,u=e+A>>1,m=w+f>>1):7===g?(i=T,l=O+y.uv,c=o,u=A,m=f):8===g?(i=T,l=O+y.dv,c=o+p>>1,u=A+r>>1,m=f+a>>1):9===g?(i=T+y.dv,l=O+y.wv,c=p+h>>1,u=r+I>>1,m=a+s>>1):10===g?(i=T+y.yv,l=O+y.dv,c=h+d>>1,u=I+e>>1,m=s+w>>1):11===g?(i=T+y.dv,l=O+y.yv,c=d+o>>1,u=e+A>>1,m=w+f>>1):12===g?(i=T+y.wv,l=O+y.dv,c=o+p>>1,u=A+r>>1,m=f+a>>1):13===g?(i=T+y.wv,l=O+y.wv,c=p,u=r,m=a):14===g?(i=T+y.yv,l=O+y.wv,c=h,u=I,m=s):15===g?(i=T+y.yv,l=O+y.yv,c=d,u=e,m=w):(i=T+y.wv,l=O+y.yv,c=o,u=A,m=f),this.oC[t]=i,this.aC[t]=c,this.lC[t]=l,_[t]=u,C[t]=m}const v=y.fv[i],b=v.length/4|0;this.Iv=new Int32Array(b),this.Ev=new Int32Array(b),this.gv=new Int32Array(b),this.Av=new Int32Array(b),this.pv=new Int32Array(b),this.mv=new Int32Array(b),this._v=-1!==c?new Int32Array(b):null;let L=0;for(let t=0;t{this.kv=0,this.xv=0,this.Dv=t,this.Nv=i,this.Pv=t/2|0,this.Fv=i/2|0;const r=new m.vv(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let i=0;i<2048;i+=64){this.Uv=h.A.sin[t],this.Bv=h.A.cos[t],this.Gv=h.A.sin[i],this.Hv=h.A.cos[i];const o=(t-128)/32|0,l=i/64|0;for(let t=-26;t<=26;t++)for(let i=-26;i<=26;i++){const h=128*t,a=128*i;let c=!1;for(let t=-s;t<=e;t+=128)if(this.yb(h,a,n[o]+t)){c=!0;break}r[o][l][t+25+1][i+25+1]=c}}for(let t=0;t<8;t++)for(let i=0;i<32;i++)for(let s=-25;s<25;s++)for(let h=-25;h<25;h++){let e=!1;t:for(let n=-1;n<=1;n++)for(let o=-1;o<=1;o++){if(r[t][i][s+n+25+1][h+o+25+1]){e=!0;break t}if(r[t][(i+1)%31][s+n+25+1][h+o+25+1]){e=!0;break t}if(r[t+1][i][s+n+25+1][h+o+25+1]){e=!0;break t}if(r[t+1][(i+1)%31][s+n+25+1][h+o+25+1]){e=!0;break t}}this.Ov[t][i][s+25][h+25]=e}};static Zo=()=>{this.bv=null,this.md=null,this.Lv=null,this.Mv=null,this.Ov=null,this.Sv=null,this.Qv=null,console.log('World3D unloaded!')};static OO=(t,i,s,h,e,n,o,l)=>{I.Lv[t][I.md[t]++]=new r(s/128|0,n/128|0,e/128|0,l/128|0,i,s,n,e,l,h,o)};static yb=(t,i,s)=>{const h=i*this.Gv+t*this.Hv>>16,e=i*this.Hv-t*this.Gv>>16,n=s*this.Uv+e*this.Bv>>16,r=s*this.Bv-e*this.Uv>>16;if(n<50||n>3500)return!1;const o=this.Pv+((h<<9)/n|0),l=this.Fv+((r<<9)/n|0);return o>=this.kv&&o<=this.Dv&&l>=this.xv&&l<=this.Nv};Ab;hE;eE;pb;mb;Yr;Ib;Eb;gb;_b=0;Cb=0;Tb=0;constructor(t,i,s,h){this.Ab=s,this.hE=h,this.eE=i,this.mb=new m.Kr(s,h,i,null),this.Ib=new m.Cc(s,h+1,i+1),this.pb=t,this.Yr=new m.Ns(5e3,null),this.Eb=new Int32Array(1e4),this.gb=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this.Cb=t;for(let i=0;i{const s=this.mb[0][t][i];for(let s=0;s<3;s++){this.mb[s][t][i]=this.mb[s+1][t][i];const h=this.mb[s][t][i];h&&h.level--}this.mb[0][t][i]||(this.mb[0][t][i]=new n.A(0,t,i));const h=this.mb[0][t][i];h&&(h.Ob=s),this.mb[3][t][i]=null};_O=(t,i,s,h)=>{const e=this.mb[t][i][s];e&&(e.vb=h)};EO=(t,i,s,h,e,r,o,l,a,c,f,u,w,p,m,I,E,g,_,C)=>{if(h===A.A.IO){for(let h=t;h>=0;h--)this.mb[h][i][s]||(this.mb[h][i][s]=new n.A(h,i,s));const h=this.mb[t][i][s];h&&(h.bb=new d(f,u,w,p,-1,_,!1))}else if(h===A.A.Lb){for(let h=t;h>=0;h--)this.mb[h][i][s]||(this.mb[h][i][s]=new n.A(h,i,s));const h=this.mb[t][i][s];h&&(h.bb=new d(m,I,E,g,r,C,o===l&&o===a&&o===c))}else{for(let h=t;h>=0;h--)this.mb[h][i][s]||(this.mb[h][i][s]=new n.A(h,i,s));const d=this.mb[t][i][s];d&&(d.Rb=new y(i,h,I,l,w,e,f,c,C,m,r,g,_,a,E,p,o,s,u))}};eO=(t,i,s,h,e,r,o)=>{this.mb[i][s][h]||(this.mb[i][s][h]=new n.A(i,s,h));const a=this.mb[i][s][h];a&&(a.Sb=new l(e,128*s+64,128*h+64,t,r,o))};wA=(t,i,s)=>{const h=this.mb[t][i][s];h&&(h.Sb=null)};hA=(t,i,s,h,e,r,o,l)=>{let a=0;const c=this.mb[h][t][i];if(c)for(let t=0;ta&&(a=s)}else this.mb[h][t][i]=new n.A(h,t,i);const f=this.mb[h][t][i];f&&(f.xb=new u(s,128*t+64,128*i+64,r,o,l,e,a))};Qy=(t,i,s)=>{const h=this.mb[t][i][s];h&&(h.xb=null)};MT=(t,i,s,h,e,r,o,l,c,f)=>{if(!o&&!l)return;for(let h=t;h>=0;h--)this.mb[h][i][s]||(this.mb[h][i][s]=new n.A(h,i,s));const u=this.mb[t][i][s];u&&(u.Db=new a(h,128*i+64,128*s+64,e,r,o,l,c,f))};aA=(t,i,s,h)=>{const e=this.mb[t][i][s];1===h&&e&&(e.Db=null)};nO=(t,i,s,h,e,r,o,l,a,f,u)=>{if(!l)return;for(let h=t;h>=0;h--)this.mb[h][i][s]||(this.mb[h][i][s]=new n.A(h,i,s));const d=this.mb[t][i][s];d&&(d.Nb=new c(h,128*i+e+64,128*s+r+64,u,f,l,o,a))};uA=(t,i,s)=>{const h=this.mb[t][i][s];h&&(h.Nb=null)};LO=(t,i,s,h)=>{const e=this.mb[t][i][s];if(!e)return;const n=e.Nb;if(!n)return;const r=128*i+64,o=128*s+64;n.x=r+((n.x-r)*h/16|0),n.z=o+((n.z-o)*h/16|0)};uE=(t,i,s,h)=>{if(!h)return;const e=this.mb[t][i][s];if(!e)return;const n=e.Nb;n&&(n.model=h)};AE=(t,i,s,h)=>{if(!h)return;const e=this.mb[t][i][s];if(!e)return;const n=e.Sb;n&&(n.model=h)};yE=(t,i,s,h)=>{if(!h)return;const e=this.mb[t][i][s];if(!e)return;const n=e.Db;n&&(n.ZO=h)};wE=(t,i,s,h,e)=>{if(!h)return;const n=this.mb[s][t][i];if(!n)return;const r=n.Db;r&&(r.ZO=h,r.qO=e)};eA=(t,i,s,h,e,n,r,o,l,a,c)=>{if(!e&&!n)return!0;const f=128*i+64*l,u=128*s+64*a;return this.Pb(f,u,h,t,i,s,l,a,e,n,r,o,c,!1)};$I=(t,i,s,h,e,n,r,o,l,a)=>{if(!e&&!n)return!0;let c=i-l,f=h-l,u=i+l,d=h+l;return a&&(o>640&&o<1408&&(d+=128),o>1152&&o<1920&&(u+=128),(o>1664||o<384)&&(f-=128),o>128&&o<896&&(c-=128)),c=c/128|0,f=f/128|0,u=u/128|0,d=d/128|0,this.Pb(i,h,s,t,c,f,u+1-c,d-f+1,e,n,r,0,o,!0)};tE=(t,i,s,h,e,n,r,o,l,a,c,f)=>!l&&!a||this.Pb(i,h,s,t,e,n,r+1-e,o-n+1,l,a,c,0,f,!0);dA=(t,i,s)=>{const h=this.mb[t][i][s];if(h)for(let t=0;t>29&3)&&e.SO===i&&e.kO===s)return void this.Fb(e)}};fE=(t,i,s,h)=>{if(!h)return;const e=this.mb[t][i][s];if(e)for(let t=0;t>29&3))return void(i.model=h)}};pu=()=>{for(let t=0;t{const h=this.mb[t][i][s];return h&&h.Db?h.Db.DO:0};oA=(t,i,s)=>{const h=this.mb[t][s][i];return h&&h.Nb?h.Nb.DO:0};iw=(t,i,s)=>{const h=this.mb[t][i][s];if(!h)return 0;for(let t=0;t>29&3)&&e.SO===i&&e.kO===s)return e.DO}return 0};Bd=(t,i,s)=>{const h=this.mb[t][i][s];return h&&h.Sb?h.Sb.DO:0};Xd=(t,i,s,h)=>{const e=this.mb[t][i][s];if(e){if(e.Db&&e.Db.DO===h)return 255&e.Db.info;if(e.Nb&&e.Nb.DO===h)return 255&e.Nb.info;if(e.Sb&&e.Sb.DO===h)return 255&e.Sb.info;for(let t=0;t{const n=i*(0|Math.sqrt(s*s+h*h+e*e))>>8;for(let i=0;i{if(i0){const e=this.mb[t][i+1][s-1];e&&e.Sb&&e.Sb.model&&e.Sb.model.Ub&&this.Gb(h,e.Sb.model,128,0,-128,!0)}};Bb=(t,i,s,h,e,n)=>{let r=!0,o=i;const l=i+h,a=s-1,c=s+e;for(let f=t;f<=t+1;f++)if(f!==this.Ab){for(let u=o;u<=l;u++)if(!(u<0||u>=this.hE))for(let o=a;o<=c;o++){if(o<0||o>=this.eE||r&&u=s||u===i))continue;const a=this.mb[f][u][o];if(!a)continue;const d=128*(u-i)+64*(1-h),w=128*(o-s)+64*(1-e),y=((this.pb[f][u][o]+this.pb[f][u+1][o]+this.pb[f][u][o+1]+this.pb[f][u+1][o+1])/4|0)-((this.pb[t][i][s]+this.pb[t][i+1][s]+this.pb[t][i][s+1]+this.pb[t][i+1][s+1])/4|0),A=a.Db;A&&A.ZO&&A.ZO.Ub&&this.Gb(n,A.ZO,d,y,w,r),A&&A.qO&&A.qO.Ub&&this.Gb(n,A.qO,d,y,w,r);for(let t=0;t{this.Tb++;let r=0;const o=i.oC,l=i.rC;if(t.Ub&&t.Yb)for(let n=0;ni.GO)continue;const u=t.oC[n]-s;if(ui.FO)continue;const d=t.lC[n]-e;if(di.BO)continue;if(i.Ub&&i.Yb)for(let t=0;t{const r=this.mb[t][i][s];if(!r)return;const o=r.bb;if(o){const t=o.color;if(0!==t)for(let i=0;i<4;i++)h[e]=t,h[e+1]=t,h[e+2]=t,h[e+3]=t,e+=n;return}const l=r.Rb;if(!l)return;const a=l.shape,c=l.angle,f=l.Cv,u=l.Tv,d=I.fb[a],w=I.ub[c];let y=0;if(0===f)for(let t=0;t<4;t++)0!==d[w[y++]]&&(h[e]=u),0!==d[w[y++]]&&(h[e+1]=u),0!==d[w[y++]]&&(h[e+2]=u),0!==d[w[y++]]&&(h[e+3]=u),e+=n;else for(let t=0;t<4;t++)h[e]=0===d[w[y++]]?f:u,h[e+1]=0===d[w[y++]]?f:u,h[e+2]=0===d[w[y++]]?f:u,h[e+3]=0===d[w[y++]]?f:u,e+=n};click=(t,i)=>{I.Jv=!0,I.ea=t,I.na=i,I.Nf=-1,I.Pf=-1};draw=(t,i,s,e,n,r,o)=>{t<0?t=0:t>=128*this.hE&&(t=128*this.hE-1),s<0?s=0:s>=128*this.eE&&(s=128*this.eE-1),I.wu++,I.Uv=h.A.sin[r],I.Bv=h.A.cos[r],I.Gv=h.A.sin[n],I.Hv=h.A.cos[n],I.Qv=I.Ov[(r-128)/32|0][n/64|0],I.Wv=t,I.Yv=i,I.Vv=s,I.Kv=t/128|0,I.Xv=s/128|0,I.Id=e,I.zv=I.Kv-25,I.zv<0&&(I.zv=0),I.Zv=I.Xv-25,I.Zv<0&&(I.Zv=0),I.jv=I.Kv+25,I.jv>this.hE&&(I.jv=this.hE),I.qv=I.Xv+25,I.qv>this.eE&&(I.qv=this.eE),this.Zb(),I.$v=0;for(let t=this.Cb;t=2e3)?(r.visible=!0,r.update=!0,r.qb=r.Mb>0,I.$v++):(r.visible=!1,r.update=!1,r.$b=0))}}for(let t=this.Cb;t=I.jv))for(let t=-25;t<=0;t++){const e=I.Xv+t,n=I.Xv-t;let r;if(s>=I.zv&&(e>=I.Zv&&(r=i[s][e],r&&r.visible&&this.Jb(r,!0,o)),n=I.Zv&&(r=i[h][e],r&&r.visible&&this.Jb(r,!0,o)),n=I.jv))for(let t=-25;t<=0;t++){const e=I.Xv+t,n=I.Xv-t;let r;if(s>=I.zv&&(e>=I.Zv&&(r=i[s][e],r&&r.visible&&this.Jb(r,!1,o)),n=I.Zv&&(r=i[h][e],r&&r.visible&&this.Jb(r,!1,o)),n{if(!c&&!f)return!1;for(let t=r;t=this.hE||i>=this.eE)return!1;const s=this.mb[h][t][i];if(s&&s.Mb>=5)return!1}const A=new e(h,s,t,i,c,f,w,r,r+l-1,o,o+a-1,u,d);for(let t=r;tr&&(s|=1),to&&(s+=8),i=0;s--)this.mb[s][t][i]||(this.mb[s][t][i]=new n.A(s,t,i));const e=this.mb[h][t][i];e&&(e.kb[e.Mb]=A,e.Qb[e.Mb]=s,e.tL|=s,e.Mb++)}return y&&(this.Yr[this._b++]=A),!0};Fb=t=>{for(let i=t.SO;i<=t.MO;i++)for(let s=t.kO;s<=t.xO;s++){const h=this.mb[t.level][i][s];if(h){for(let i=0;i{const t=I.md[I.Id],i=I.Lv[I.Id];I.Ed=0;for(let s=0;s=0&&h<=50){e=t.sE+25-I.Xv,e<0&&(e=0),n=t.eE+25-I.Xv,n>50&&(n=50);let i=!1;for(;e<=n;)if(I.Qv&&I.Qv[h][e++]){i=!0;break}if(i){if(r=I.Wv-t.PO,r>32)t.mode=1;else{if(r>=-32)continue;t.mode=2,r=-r}t.YO=(t.UO-I.Vv<<8)/r|0,t.VO=(t.BO-I.Vv<<8)/r|0,t.KO=(t.GO-I.Yv<<8)/r|0,t.XO=(t.AC-I.Yv<<8)/r|0,I.Sv[I.Ed++]=t}}}else if(2===t.type){if(h=t.sE+25-I.Xv,h>=0&&h<=50){e=t.iE+25-I.Kv,e<0&&(e=0),n=t.hE+25-I.Kv,n>50&&(n=50);let i=!1;for(;e<=n;)if(I.Qv&&I.Qv[e++][h]){i=!0;break}if(i){if(r=I.Vv-t.UO,r>32)t.mode=3;else{if(r>=-32)continue;t.mode=4,r=-r}t.HO=(t.PO-I.Wv<<8)/r|0,t.WO=(t.FO-I.Wv<<8)/r|0,t.KO=(t.GO-I.Yv<<8)/r|0,t.XO=(t.AC-I.Yv<<8)/r|0,I.Sv[I.Ed++]=t}}}else if(4===t.type&&(h=t.GO-I.Yv,h>128&&(e=t.sE+25-I.Xv,e<0&&(e=0),n=t.eE+25-I.Xv,n>50&&(n=50),e<=n))){let i=t.iE+25-I.Kv;i<0&&(i=0),r=t.hE+25-I.Kv,r>50&&(r=50);let s=!1;t:for(let t=i;t<=r;t++)for(let i=e;i<=n;i++)if(I.Qv&&I.Qv[t][i]){s=!0;break t}s&&(t.mode=5,t.HO=(t.PO-I.Wv<<8)/h|0,t.WO=(t.FO-I.Wv<<8)/h|0,t.YO=(t.UO-I.Vv<<8)/h|0,t.VO=(t.BO-I.Vv<<8)/h|0,I.Sv[I.Ed++]=t)}}};Jb=(t,i,s)=>{for(I.Mv.LE(t);;){let t;do{if(t=I.Mv.iL(),!t)return}while(!t.update);const h=t.x,e=t.z,n=t.level,r=t.sL,o=this.mb[n];if(t.visible){if(i){if(n>0){const t=this.mb[n-1][h][e];if(t&&t.update)continue}if(h<=I.Kv&&h>I.zv){const i=o[h-1][e];if(i&&i.update&&(i.visible||!(1&t.tL)))continue}if(h>=I.Kv&&hI.Zv){const i=o[h][e-1];if(i&&i.update&&(i.visible||!(8&t.tL)))continue}if(e>=I.Xv&&ee&&(a+=6),c=I.tb[a],t.rL=I.sb[a]),f&&(f.zO&I.ib[a]?16===f.zO?(t.$b=3,t.oL=I.hb[a],t.lL=3-t.oL):32===f.zO?(t.$b=6,t.oL=I.eb[a],t.lL=6-t.oL):64===f.zO?(t.$b=12,t.oL=I.nb[a],t.lL=12-t.oL):(t.$b=9,t.oL=I.rb[a],t.lL=9-t.oL):t.$b=0,f.zO&c&&!this.aL(r,h,e,f.zO)&&f.ZO?.draw(0,I.Uv,I.Bv,I.Gv,I.Hv,f.x-I.Wv,f.y-I.Yv,f.z-I.Vv,f.DO),f.jO&c&&!this.aL(r,h,e,f.jO)&&f.qO?.draw(0,I.Uv,I.Bv,I.Gv,I.Hv,f.x-I.Wv,f.y-I.Yv,f.z-I.Vv,f.DO)),u&&!this.visible(r,h,e,u.model.AC))if(u.type&c)u.model.draw(u.angle,I.Uv,I.Bv,I.Gv,I.Hv,u.x-I.Wv,u.y-I.Yv,u.z-I.Vv,u.DO);else if(768&u.type){const t=u.x-I.Wv,i=u.y-I.Yv,s=u.z-I.Vv,h=u.angle;let e,n;if(e=h===p.A.$d||h===p.A.Jd?-t:t,n=h===p.A.Jd||h===p.A.Qd?-s:s,256&u.type&&ne){const e=t+I.ab[h],n=s+I.cb[h];u.model.draw(512*h+1280&2047,I.Uv,I.Bv,I.Gv,I.Hv,e,i,n,u.DO)}}if(l){const i=t.Sb;i&&i.model?.draw(0,I.Uv,I.Bv,I.Gv,I.Hv,i.x-I.Wv,i.y-I.Yv,i.z-I.Vv,i.DO);const s=t.xb;s&&0===s.offset&&(s.QO&&s.QO.draw(0,I.Uv,I.Bv,I.Gv,I.Hv,s.x-I.Wv,s.y-I.Yv,s.z-I.Vv,s.DO),s.JO&&s.JO.draw(0,I.Uv,I.Bv,I.Gv,I.Hv,s.x-I.Wv,s.y-I.Yv,s.z-I.Vv,s.DO),s.$O&&s.$O.draw(0,I.Uv,I.Bv,I.Gv,I.Hv,s.x-I.Wv,s.y-I.Yv,s.z-I.Vv,s.DO))}const d=t.tL;if(0!==d){if(hI.Kv&&1&d){const t=o[h-1][e];t&&t.update&&I.Mv.LE(t)}if(e>I.Xv&&8&d){const t=o[h][e-1];t&&t.update&&I.Mv.LE(t)}}}if(0!==t.$b){let i=!0;for(let s=0;si.SO&&(n+=1),si.kO&&(n+=8),hh&&(h=e);const r=I.Xv-i.kO,l=i.xO-I.Xv;i.NO=l>r?h+l:h+r}for(;;){let t=-50,i=-1;for(let s=0;st&&(t=h.NO,i=s))}if(-1===i)break;const l=I.bv[i];if(l){l.wu=I.wu;let t=l.model;t||(t=l.RO?.draw(s)??null),t&&!this.cL(r,l.SO,l.MO,l.kO,l.xO,t.AC)&&t.draw(l.JI,I.Uv,I.Bv,I.Gv,I.Hv,l.x-I.Wv,l.y-I.Yv,l.z-I.Vv,l.DO);for(let t=l.SO;t<=l.MO;t++)for(let i=l.kO;i<=l.xO;i++){const s=o[t][i];s&&(0!==s.$b?I.Mv.LE(s):t===h&&i===e||!s.update||I.Mv.LE(s))}}}if(t.qb)continue}if(!t.update||0!==t.$b)continue;if(h<=I.Kv&&h>I.zv){const t=o[h-1][e];if(t&&t.update)continue}if(h>=I.Kv&&hI.Zv){const t=o[h][e-1];if(t&&t.update)continue}if(e>=I.Xv&&e=n){const n=t+I.ob[e],r=h+I.lb[e];i.model.draw(512*e+256,I.Uv,I.Bv,I.Gv,I.Hv,n,s,r,i.DO)}if(512&i.type&&r<=n){const n=t+I.ab[e],r=h+I.cb[e];i.model.draw(512*e+1280&2047,I.Uv,I.Bv,I.Gv,I.Hv,n,s,r,i.DO)}}const s=t.Db;s&&(s.jO&t.rL&&!this.aL(r,h,e,s.jO)&&s.qO?.draw(0,I.Uv,I.Bv,I.Gv,I.Hv,s.x-I.Wv,s.y-I.Yv,s.z-I.Vv,s.DO),s.zO&t.rL&&!this.aL(r,h,e,s.zO)&&s.ZO?.draw(0,I.Uv,I.Bv,I.Gv,I.Hv,s.x-I.Wv,s.y-I.Yv,s.z-I.Vv,s.DO))}if(nI.Kv){const t=o[h-1][e];t&&t.update&&I.Mv.LE(t)}if(e>I.Xv){const t=o[h][e-1];t&&t.update&&I.Mv.LE(t)}}};eL=(t,i,s,e,n,r,o,l)=>{let a,c,f,u,d=a=(s<<7)-I.Wv,y=c=(e<<7)-I.Vv,A=f=d+128,p=u=y+128,m=this.pb[i][s][e]-I.Yv,E=this.pb[i][s+1][e]-I.Yv,g=this.pb[i][s+1][e+1]-I.Yv,_=this.pb[i][s][e+1]-I.Yv,C=y*o+d*l>>16;if(y=y*l-d*o>>16,d=C,C=m*r-y*n>>16,y=m*n+y*r>>16,m=C,y<50)return;if(C=c*o+A*l>>16,c=c*l-A*o>>16,A=C,C=E*r-c*n>>16,c=E*n+c*r>>16,E=C,c<50)return;if(C=p*o+f*l>>16,p=p*l-f*o>>16,f=C,C=g*r-p*n>>16,p=g*n+p*r>>16,g=C,p<50)return;if(C=u*o+a*l>>16,u=u*l-a*o>>16,a=C,C=_*r-u*n>>16,u=_*n+u*r>>16,_=C,u<50)return;const T=h.A.Sa+((d<<9)/y|0),O=h.A.Ma+((m<<9)/y|0),v=h.A.Sa+((A<<9)/c|0),b=h.A.Ma+((E<<9)/c|0),L=h.A.Sa+((f<<9)/p|0),R=h.A.Ma+((g<<9)/p|0),S=h.A.Sa+((a<<9)/u|0),M=h.A.Ma+((_<<9)/u|0);if(h.A.alpha=0,(L-S)*(b-M)-(R-M)*(v-S)>0)if(h.A.fL=L<0||S<0||v<0||L>w.A.uL||S>w.A.uL||v>w.A.uL,I.Jv&&this.dL(I.ea,I.na,R,M,b,L,S,v)&&(I.Nf=s,I.Pf=e),-1===t.ev)12345678!==t.sv&&h.A.wL(L,S,v,R,M,b,t.sv,t.hv,t.iv);else if(I.vt){const i=I.wb[t.ev];h.A.wL(L,S,v,R,M,b,this.yL(i,t.sv),this.yL(i,t.hv),this.yL(i,t.iv))}else t.flat?h.A.pL(L,S,v,R,M,b,t.sv,t.hv,t.iv,d,m,y,A,a,E,_,c,u,t.ev):h.A.pL(L,S,v,R,M,b,t.sv,t.hv,t.iv,f,g,p,a,A,_,E,u,c,t.ev);if(!((T-v)*(M-b)-(O-b)*(S-v)<=0))if(h.A.fL=T<0||v<0||S<0||T>w.A.uL||v>w.A.uL||S>w.A.uL,I.Jv&&this.dL(I.ea,I.na,O,b,M,T,v,S)&&(I.Nf=s,I.Pf=e),-1!==t.ev){if(!I.vt)return void h.A.pL(T,v,S,O,b,M,t.tv,t.iv,t.hv,d,m,y,A,a,E,_,c,u,t.ev);const i=I.wb[t.ev];h.A.wL(T,v,S,O,b,M,this.yL(i,t.tv),this.yL(i,t.iv),this.yL(i,t.hv))}else 12345678!==t.tv&&h.A.wL(T,v,S,O,b,M,t.tv,t.iv,t.hv)};nL=(t,i,s,e,n,r,o)=>{let l=s.oC.length;for(let t=0;t>16;if(a=a*o-i*r>>16,i=c,c=l*n-a*e>>16,a=l*e+a*n>>16,l=c,a<50)return;s._v&&(y.ov[t]=i,y.lv[t]=l,y.av[t]=a),y.nv[t]=h.A.Sa+((i<<9)/a|0),y.rv[t]=h.A.Ma+((l<<9)/a|0)}h.A.alpha=0,l=s.Iv.length;for(let e=0;e0)if(h.A.fL=l<0||a<0||c<0||l>w.A.uL||a>w.A.uL||c>w.A.uL,I.Jv&&this.dL(I.ea,I.na,f,u,d,l,a,c)&&(I.Nf=t,I.Pf=i),s._v&&-1!==s._v[e])if(I.vt){const t=I.wb[s._v[e]];h.A.wL(l,a,c,f,u,d,this.yL(t,s.Av[e]),this.yL(t,s.pv[e]),this.yL(t,s.mv[e]))}else s.flat?h.A.pL(l,a,c,f,u,d,s.Av[e],s.pv[e],s.mv[e],y.ov[0],y.lv[0],y.av[0],y.ov[1],y.ov[3],y.lv[1],y.lv[3],y.av[1],y.av[3],s._v[e]):h.A.pL(l,a,c,f,u,d,s.Av[e],s.pv[e],s.mv[e],y.ov[n],y.lv[n],y.av[n],y.ov[r],y.ov[o],y.lv[r],y.lv[o],y.av[r],y.av[o],s._v[e]);else 12345678!==s.Av[e]&&h.A.wL(l,a,c,f,u,d,s.Av[e],s.pv[e],s.mv[e])}};hL=(t,i,s)=>{const h=this.Ib[t][i][s];if(h===-I.wu)return!1;if(h===I.wu)return!0;{const h=i<<7,e=s<<7;return this.mL(h+1,this.pb[t][i][s],e+1)&&this.mL(h+128-1,this.pb[t][i+1][s],e+1)&&this.mL(h+128-1,this.pb[t][i+1][s+1],e+128-1)&&this.mL(h+1,this.pb[t][i][s+1],e+128-1)?(this.Ib[t][i][s]=I.wu,!0):(this.Ib[t][i][s]=-I.wu,!1)}};aL=(t,i,s,h)=>{if(!this.hL(t,i,s))return!1;const e=i<<7,n=s<<7,r=this.pb[t][i][s]-1,o=r-120,l=r-230,a=r-238;if(h<16){if(1===h){if(e>I.Wv){if(!this.mL(e,r,n))return!1;if(!this.mL(e,r,n+128))return!1}if(t>0){if(!this.mL(e,o,n))return!1;if(!this.mL(e,o,n+128))return!1}return!!this.mL(e,l,n)&&this.mL(e,l,n+128)}if(2===h){if(n0){if(!this.mL(e,o,n+128))return!1;if(!this.mL(e+128,o,n+128))return!1}return!!this.mL(e,l,n+128)&&this.mL(e+128,l,n+128)}if(4===h){if(e0){if(!this.mL(e+128,o,n))return!1;if(!this.mL(e+128,o,n+128))return!1}return!!this.mL(e+128,l,n)&&this.mL(e+128,l,n+128)}if(8===h){if(n>I.Vv){if(!this.mL(e,r,n))return!1;if(!this.mL(e+128,r,n))return!1}if(t>0){if(!this.mL(e,o,n))return!1;if(!this.mL(e+128,o,n))return!1}return!!this.mL(e,l,n)&&this.mL(e+128,l,n)}}return!!this.mL(e+64,a,n+64)&&(16===h?this.mL(e,l,n+128):32===h?this.mL(e+128,l,n+128):64===h?this.mL(e+128,l,n):128===h?this.mL(e,l,n):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,i,s,h)=>{if(this.hL(t,i,s)){const e=i<<7,n=s<<7;return this.mL(e+1,this.pb[t][i][s]-h,n+1)&&this.mL(e+128-1,this.pb[t][i+1][s]-h,n+1)&&this.mL(e+128-1,this.pb[t][i+1][s+1]-h,n+128-1)&&this.mL(e+1,this.pb[t][i][s+1]-h,n+128-1)}return!1};cL=(t,i,s,h,e,n)=>{let r,o;if(i!==s||h!==e){for(r=i;r<=s;r++)for(o=h;o<=e;o++)if(this.Ib[t][r][o]===-I.wu)return!1;o=1+(i<<7);const l=2+(h<<7),a=this.pb[t][i][h]-n;if(!this.mL(o,a,l))return!1;const c=(s<<7)-1;if(!this.mL(c,a,l))return!1;const f=(e<<7)-1;return!!this.mL(o,a,f)&&this.mL(c,a,f)}return!!this.hL(t,i,h)&&(r=i<<7,o=h<<7,this.mL(r+1,this.pb[t][i][h]-n,o+1)&&this.mL(r+128-1,this.pb[t][i+1][h]-n,o+1)&&this.mL(r+128-1,this.pb[t][i+1][h+1]-n,o+128-1)&&this.mL(r+1,this.pb[t][i][h+1]-n,o+128-1))};mL=(t,i,s)=>{for(let h=0;h0){const t=e.UO+(e.YO*h>>8),n=e.BO+(e.VO*h>>8),r=e.GO+(e.KO*h>>8),o=e.AC+(e.XO*h>>8);if(s>=t&&s<=n&&i>=r&&i<=o)return!0}}else if(2===e.mode){const h=t-e.PO;if(h>0){const t=e.UO+(e.YO*h>>8),n=e.BO+(e.VO*h>>8),r=e.GO+(e.KO*h>>8),o=e.AC+(e.XO*h>>8);if(s>=t&&s<=n&&i>=r&&i<=o)return!0}}else if(3===e.mode){const h=e.UO-s;if(h>0){const s=e.PO+(e.HO*h>>8),n=e.FO+(e.WO*h>>8),r=e.GO+(e.KO*h>>8),o=e.AC+(e.XO*h>>8);if(t>=s&&t<=n&&i>=r&&i<=o)return!0}}else if(4===e.mode){const h=s-e.UO;if(h>0){const s=e.PO+(e.HO*h>>8),n=e.FO+(e.WO*h>>8),r=e.GO+(e.KO*h>>8),o=e.AC+(e.XO*h>>8);if(t>=s&&t<=n&&i>=r&&i<=o)return!0}}else if(5===e.mode){const h=i-e.GO;if(h>0){const i=e.PO+(e.HO*h>>8),n=e.FO+(e.WO*h>>8),r=e.UO+(e.YO*h>>8),o=e.BO+(e.VO*h>>8);if(t>=i&&t<=n&&s>=r&&s<=o)return!0}}}return!1};dL=(t,i,s,h,e,n,r,o)=>{if(is&&i>h&&i>e)return!1;if(tn&&t>r&&t>o)return!1;const l=(i-h)*(o-r)-(t-r)*(e-h);return((i-s)*(r-n)-(t-n)*(h-s))*l>0&&l*((i-e)*(n-o)-(t-o)*(s-e))>0};yL=(t,i)=>((i=(127-i)*(127&t)/160|0)<2?i=2:i>126&&(i=126),(65408&t)+i)}},7121:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{}},4197:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{ym;cE;dm;wm;index;aE;Fl;Pl;constructor(t,i,s,h,e,n,r){super(),this.ym=i,this.cE=s,this.dm=h,this.wm=e,this.index=t,this.aE=n,r&&-1!==n.Bl&&this.aE.delay?(this.Fl=Math.random()*this.aE.Ul|0,this.Pl=Math.random()*this.aE.delay[this.Fl]|0):(this.Fl=-1,this.Pl=0)}}},8412:(t,i,s)=>{s.d(i,{A:()=>o});var h=s(9418),e=s(8665),n=s(8738),r=s(1312);class o extends h.A{static ju=2;static qu=4;static Ju=8;static Qu=16;static ld=32;static nd=64;static td=128;type=null;draw(t){if(!this.type)return null;if(-1===this.rd||-1===this.EI)return this.IC();const i=this.IC();if(!i)return null;const s=n.A.Jo[this.rd],h=e.A.p_(s.xa(),!0,!s.K_,!1);h.translate(-this.mI,0,0),h.sc(),s.aE&&s.aE.frames&&h.hc(s.aE.frames[this.EI]),h.uC=null,h.dC=null,128===s.pC&&128===s.mC||h.scale(s.pC,s.mC,s.pC),h.ec(64+s.z_,850+s.j_,-30,-50,-30,!0);const r=[i,h],o=e.A.IL(r,2);return 1===this.type.size&&(o.CC=!0),o}isVisible(){return null!==this.type}IC(){if(!this.type)return null;if(this.Zu>=0&&0===this.yI){const t=r.A.Jo[this.Zu].frames;if(t){const i=t[this.dI];let s=-1;if(this.zI>=0&&this.zI!==this.ic){const t=r.A.Jo[this.zI].frames;t&&(s=t[this._E])}return this.type.IC(i,s,r.A.Jo[this.Zu].OE)}}let t=-1;if(this.zI>=0){const i=r.A.Jo[this.zI].frames;i&&(t=i[this._E])}const i=this.type.IC(t,-1,null);return i?(this.height=i.AC,i):null}}},3606:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{index;count;constructor(t,i){super(),this.index=t,this.count=i}}},9418:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(7121),e=s(1312),n=s(3867);class r extends h.A{x=0;z=0;JI=0;QI=!1;size=1;ic=-1;EE=-1;SI=-1;kI=-1;DI=-1;FI=-1;bE=-1;Mu=null;Pu=100;Du=0;Nu=0;Hu=0;Gu=0;Fu=-1e3;Uu=0;Bu=0;$u=-1;AI=0;pI=0;zI=-1;_E=0;gE=0;Zu=-1;dI=0;wI=0;yI=0;uI=0;rd=-1;EI=0;gI=0;II=0;mI=0;_I=0;TI=0;CI=0;OI=0;Wu=0;Yu=0;vI=0;wu=0;height=0;IE=0;pathLength=0;Uf=new Int32Array(10);Bf=new Int32Array(10);vE=new n.Ns(10,!1);mE=0;Ku=-1;Xu=-1;sd=-1;hd=-1;move(t,i,s){if(-1!==this.Zu&&e.A.Jo[this.Zu].priority<=1&&(this.Zu=-1),!t){const t=i-this.Uf[0],h=s-this.Bf[0];if(t>=-8&&t<=8&&h>=-8&&h<=8){this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.Uf[t]=this.Uf[t-1],this.Bf[t]=this.Bf[t-1],this.vE[t]=this.vE[t-1];return this.Uf[0]=i,this.Bf[0]=s,void(this.vE[0]=!1)}}this.pathLength=0,this.mE=0,this.Uf[0]=i,this.Bf[0]=s,this.x=128*this.Uf[0]+64*this.size,this.z=128*this.Bf[0]+64*this.size}step(t,i){let s=this.Uf[0],h=this.Bf[0];0===i?(s--,h++):1===i?h++:2===i?(s++,h++):3===i?s--:4===i?s++:5===i?(s--,h--):6===i?h--:7===i&&(s++,h--),-1!==this.Zu&&e.A.Jo[this.Zu].priority<=1&&(this.Zu=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.Uf[t]=this.Uf[t-1],this.Bf[t]=this.Bf[t-1],this.vE[t]=this.vE[t-1];this.Uf[0]=s,this.Bf[0]=h,this.vE[0]=t}}},8268:(t,i,s)=>{s.d(i,{A:()=>d});var h=s(9418),e=s(8665),n=s(2031),r=s(8738),o=s(1312),l=s(8317),a=s(1302),c=s(3819),f=s(3867),u=s(9298);class d extends h.A{static zu=1;static ju=2;static qu=4;static Ju=8;static Qu=16;static td=32;static ed=64;static cI=128;static nd=256;static od=512;static tc=[u.A.EL,u.A.gL,u.A._L,u.A.CL,u.A.TL,u.A.OL,u.A.vL,u.A.bL,u.A.LL,u.A.RL,u.A.SL,u.A.ML,u.A.kL,u.A.xL,u.A.DL,u.A.NL];static Qa=[[u.A.PL,u.A.FL,u.A.UL,u.A.BL,u.A.HL,u.A.WL,u.A.YL,u.A.VL,u.A.KL,u.A.XL,u.A.zL,u.A.jL],[u.A.ZL,u.A.qL,u.A.$L,u.A.JL,u.A.QL,u.A.tR,u.A.iR,u.A.sR,u.A.hR,u.A.eR,u.A.nR,u.A.rR,u.A.oR,u.A.lR,u.A.aR,u.A.cR],[u.A.cR-1,u.A.ZL+1,u.A.qL,u.A.$L,u.A.JL,u.A.QL,u.A.tR,u.A.iR,u.A.sR,u.A.hR,u.A.eR,u.A.nR,u.A.rR,u.A.oR,u.A.lR,u.A.aR],[u.A.fR,u.A.uR,u.A.dR,u.A.wR,u.A.yR,u.A.AR],[u.A.pR,u.A.mR,u.A.IR,u.A.ER,u.A.gR,u.A._R,u.A.CR,u.A.TR]];static Qo=new n.A(200);name=null;visible=!1;OR=0;Su=0;vR=new Uint16Array(12);bR=new Uint16Array(5);Ac=0;LR=0n;y=0;ZI=0;qI=0;RE=0;ME=0;SE=0;jI=null;iE=0;sE=0;hE=0;eE=0;vt=!1;draw(t){if(!this.visible)return null;let i=this.IC();if(this.height=i.AC,i.CC=!0,this.vt)return i;if(-1!==this.rd&&-1!==this.EI){const t=r.A.Jo[this.rd],s=e.A.p_(t.xa(),!0,!t.K_,!1);s.translate(-this.mI,0,0),s.sc(),t.aE&&t.aE.frames&&s.hc(t.aE.frames[this.EI]),s.uC=null,s.dC=null,128===t.pC&&128===t.mC||s.scale(t.pC,t.mC,t.pC),s.ec(t.z_+64,t.j_+850,-30,-50,-30,!0);const h=[i,s];i=e.A.IL(h,2)}if(this.jI&&(t>=this.qI&&(this.jI=null),t>=this.ZI&&t=d.Qa[i].length)&&(s=0),this.bR[i]=s}this.ic=t.ct,65535===this.ic&&(this.ic=-1),this.EE=t.ct,65535===this.EE&&(this.EE=-1),this.SI=t.ct,65535===this.SI&&(this.SI=-1),this.kI=t.ct,65535===this.kI&&(this.kI=-1),this.DI=t.ct,65535===this.DI&&(this.DI=-1),this.FI=t.ct,65535===this.FI&&(this.FI=-1),this.bE=t.ct,65535===this.bE&&(this.bE=-1),this.name=c.A.za(c.A.ja(t.af)),this.Ac=t.CA,this.visible=!0,this.LR=0n;for(let t=0;t<12;t++)this.LR<<=0x4n,this.vR[t]>=256&&(this.LR+=BigInt(this.vR[t])-256n);this.vR[0]>=256&&(this.LR+=BigInt(this.vR[0])-256n>>4n),this.vR[1]>=256&&(this.LR+=BigInt(this.vR[1])-256n>>8n);for(let t=0;t<5;t++)this.LR<<=0x3n,this.LR+=BigInt(this.bR[t]);this.LR<<=0x1n,this.LR+=BigInt(this.OR)}kA(){if(!this.visible)return null;const t=new f.Ns(12,null);let i=0;for(let s=0;s<12;s++){const h=this.vR[s];if(h>=256&&h<512&&(t[i++]=l.A.Jo[h-256].kA()),h>=512){const s=a.A.get(h-512).kA(this.OR);s&&(t[i++]=s)}}const s=e.A.$a(t,i);for(let t=0;t<5;t++)0!==this.bR[t]&&(s.Ja(d.Qa[t][0],d.Qa[t][this.bR[t]]),1===t&&s.Ja(d.tc[0],d.tc[this.bR[t]]));return s}IC(){let t=this.LR,i=-1,s=-1,h=-1,n=-1;if(this.Zu>=0&&0===this.yI){const e=o.A.Jo[this.Zu];if(e.frames&&(i=e.frames[this.dI]),this.zI>=0&&this.zI!==this.ic){const t=o.A.Jo[this.zI].frames;t&&(s=t[this._E])}e.JC>=0&&(h=e.JC,t+=BigInt(h-this.vR[5])<<8n),e.QC>=0&&(n=e.QC,t+=BigInt(n-this.vR[3])<<16n)}else if(this.zI>=0){const t=o.A.Jo[this.zI].frames;t&&(i=t[this._E])}let r=d.Qo?.get(t);if(!r){const i=new f.Ns(12,null);let s=0;for(let t=0;t<12;t++){let e=this.vR[t];if(n>=0&&3===t&&(e=n),h>=0&&5===t&&(e=h),e>=256&&e<512){const t=l.A.Jo[e-256].xa();t&&(i[s++]=t)}if(e>=512){const t=a.A.get(e-512).$C(this.OR);t&&(i[s++]=t)}}r=e.A.$a(i,s);for(let t=0;t<5;t++)0!==this.bR[t]&&(r.Ja(d.Qa[t][0],d.Qa[t][this.bR[t]]),1===t&&r.Ja(d.tc[0],d.tc[this.bR[t]]));r.sc(),r.ec(64,850,-30,-50,-30,!0),d.Qo?.put(t,r)}if(this.vt)return r;const c=e.A.EC(r,!0);return-1!==i&&-1!==s?c.gC(i,s,o.A.Jo[this.Zu].OE):-1!==i&&c.hc(i),c._C(),c.uC=null,c.dC=null,c}}},254:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(8738),e=s(7121),n=s(8665);class r extends e.A{RR;level;SR;MR;kR;offsetY;rE;nE;xR;arc;target;mobile=!1;x=0;z=0;y=0;velocityX=0;DR=0;NR=0;velocityY=0;PR=0;JI=0;pitch=0;Fl=0;Pl=0;constructor(t,i,s,e,n,r,o,l,a,c,f){super(),this.RR=h.A.Jo[t],this.level=i,this.SR=s,this.MR=n,this.kR=e,this.rE=r,this.nE=o,this.xR=l,this.arc=a,this.target=c,this.offsetY=f}oE(t,i,s,h){if(!this.mobile){const i=t-this.SR,h=s-this.MR,e=Math.sqrt(i*i+h*h);this.x=this.SR+i*this.arc/e,this.z=this.MR+h*this.arc/e,this.y=this.kR}const e=this.nE+1-h;this.velocityX=(t-this.x)/e,this.DR=(s-this.z)/e,this.NR=Math.sqrt(this.velocityX*this.velocityX+this.DR*this.DR),this.mobile||(this.velocityY=-this.NR*Math.tan(.02454369*this.xR)),this.PR=2*(i-this.y-this.velocityY*e)/(e*e)}update(t){if(this.mobile=!0,this.x+=this.velocityX*t,this.z+=this.DR*t,this.y+=this.velocityY*t+.5*this.PR*t*t,this.velocityY+=this.PR*t,this.JI=325.949*Math.atan2(this.velocityX,this.DR)+1024&2047,this.pitch=325.949*Math.atan2(this.velocityY,this.NR)&2047,this.RR.aE&&this.RR.aE.delay)for(this.Pl+=t;this.Pl>this.RR.aE.delay[this.Fl];)this.Pl-=this.RR.aE.delay[this.Fl]+1,this.Fl++,this.Fl>=this.RR.aE.Ul&&(this.Fl=0)}draw(){const t=this.RR.xa(),i=n.A.p_(t,!0,!this.RR.K_,!1);return this.RR.aE&&this.RR.aE.frames&&(i.sc(),i.hc(this.RR.aE.frames[this.Fl]),i.uC=null,i.dC=null),128===this.RR.pC&&128===this.RR.mC||i.scale(this.RR.pC,this.RR.mC,this.RR.pC),i.FR(this.pitch),i.ec(64+this.RR.z_,850+this.RR.j_,-30,-50,-30,!0),i}}},7628:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(7121),e=s(8738),n=s(8665);class r extends h.A{type;level;x;z;y;rE;lE=!1;Fl=0;Pl=0;constructor(t,i,s,h,n,r,o){super(),this.type=e.A.Jo[t],this.level=i,this.x=s,this.z=h,this.y=n,this.rE=r+o}update(t){if(this.type.aE&&this.type.aE.delay)for(this.Pl+=t;this.Pl>this.type.aE.delay[this.Fl];)this.Pl-=this.type.aE.delay[this.Fl]+1,this.Fl++,this.Fl>=this.type.aE.Ul&&(this.Fl=0,this.lE=!0)}draw(){const t=this.type.xa(),i=n.A.p_(t,!0,!this.type.K_,!1);return!this.lE&&this.type.aE&&this.type.aE.frames&&(i.sc(),i.hc(this.type.aE.frames[this.Fl]),i.uC=null,i.dC=null),128===this.type.pC&&128===this.type.mC||i.scale(this.type.pC,this.type.mC,this.type.pC),0!==this.type.orientation&&(90===this.type.orientation?i.wC():180===this.type.orientation?(i.wC(),i.wC()):270===this.type.orientation&&(i.wC(),i.wC(),i.wC())),i.ec(64+this.type.z_,850+this.type.j_,-30,-50,-30,!0),i}}},5327:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{vp;nw;x;z;Am;angle;shape;nE;constructor(t,i,s,h,e,n,r,o){super(),this.vp=t,this.nw=i,this.x=s,this.z=h,this.Am=e,this.angle=n,this.shape=r,this.nE=o}}},2630:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{vp;nw;x;z;Am;angle;shape;bp;Lp;Rp;constructor(t,i,s,h,e,n,r,o,l,a){super(),this.vp=t,this.nw=i,this.x=s,this.z=h,this.Am=e,this.angle=n,this.shape=r,this.bp=o,this.Lp=l,this.Rp=a}}},3795:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(1982),e=s(3867);class n extends h.A{level;x;z;sL;kb;Qb;bb=null;Rb=null;Db=null;Nb=null;Sb=null;xb=null;Ob=null;Mb=0;tL=0;vb=0;visible=!1;update=!1;qb=!1;$b=0;oL=0;lL=0;rL=0;constructor(t,i,s){super(),this.sL=this.level=t,this.x=i,this.z=s,this.kb=new e.Ns(5,null),this.Qb=new Int32Array(5)}}},5518:(t,i,s)=>{s.d(i,{A:()=>h});class h{static IO=0;static Lb=1;static UR=2;static BR=3;static GR=4;static HR=5;static dv=6;static wv=7;static yv=8;static WR=9;static YR=10;static VR=11}},4474:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{KR;XR;constructor(){super(),this.KR=this,this.XR=this}zR(){this.XR&&this.KR&&(this.XR.KR=this.KR,this.KR.XR=this.XR,this.KR=null,this.XR=null)}}},3819:(t,i,s)=>{s.d(i,{A:()=>h});class h{static jR=['_','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 xd=t=>{t=t.trim();let i=0n;for(let s=0;s=65&&h<=90?i+=BigInt(h+1-65):h>=97&&h<=122?i+=BigInt(h+1-97):h>=48&&h<=57&&(i+=BigInt(h+27-48))}return i};static ja=t=>{if(t<0n||t>=6582952005840035281n)return'invalid_name';if(t%37n===0n)return'invalid_name';let i=0;const s=Array(12);for(;0n!==t;){const h=t;t/=37n,s[11-i++]=this.jR[Number(h-37n*t)]}return s.slice(12-i).join('')};static Wy=t=>{const i=[...t.toLowerCase()];let s=!0;for(let t=0;t='a'&&h<='z'&&(i[t]=h.toUpperCase(),s=!1),'.'!==h&&'!'!==h||(s=!0)}return i.join('')};static nf=t=>{let i='';for(let s=0;s(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static za=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 y_=t=>{const i=t.toUpperCase();let s=0n;for(let t=0;t>56n)&0xffffffffffffffn;return s}}},6666:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e{ZR;cursor=null;constructor(){const t=new h.A;t.next=t,t.Wm=t,this.ZR=t}LE(t){t.Wm&&t.SA(),t.Wm=this.ZR.Wm,t.next=this.ZR,t.Wm&&(t.Wm.next=t),t.next.Wm=t}iA(t){t.Wm&&t.SA(),t.Wm=this.ZR,t.next=this.ZR.next,t.Wm.next=t,t.next&&(t.next.Wm=t)}iL(){const t=this.ZR.next;return t===this.ZR?null:(t?.SA(),t)}head(){const t=this.ZR.next;return t===this.ZR?(this.cursor=null,null):(this.cursor=t?.next||null,t)}Hm(){const t=this.ZR.Wm;return t===this.ZR?(this.cursor=null,null):(this.cursor=t?.Wm||null,t)}next(){const t=this.cursor;return t===this.ZR?(this.cursor=null,null):(this.cursor=t?.next||null,t)}Wm(){const t=this.cursor;return t===this.ZR?(this.cursor=null,null):(this.cursor=t?.Wm||null,t)}clear(){for(;;){const t=this.ZR.next;if(t===this.ZR)return;t?.SA()}}}},1982:(t,i,s)=>{s.d(i,{A:()=>h});class h{key;next;Wm;constructor(){this.key=0n,this.next=this,this.Wm=this}SA(){this.Wm&&this.next&&(this.Wm.next=this.next,this.next.Wm=this.Wm,this.next=null,this.Wm=null)}}},2031:(t,i,s)=>{s.d(i,{A:()=>o});var h=s(4474);class e{head;constructor(){this.head=new h.A}push(t){t.XR&&t.zR(),t.XR=this.head.XR,t.KR=this.head,t.XR&&(t.XR.KR=t),t.KR.XR=t}pop(){const t=this.head.KR;return t===this.head?null:(t?.zR(),t)}}var n=s(1982);class r{qR;$R;constructor(t){this.$R=[],this.qR=t;for(let i=0;i{s.d(i,{A:()=>n});var h=s(1069),e=s(3867);class n{static Jo=[];static Sc=t=>{const i=new h.A(t.read('base_head.dat')),s=new h.A(t.read('base_type.dat')),r=new h.A(t.read('base_label.dat')),o=i.ct;i.ft+=2;for(let t=0;t{s.d(i,{A:()=>n});var h=s(8534),e=s(1069);class n{static Jo=[];static Sc=t=>{const i=new e.A(t.read('frame_head.dat')),s=new e.A(t.read('frame_tran1.dat')),r=new e.A(t.read('frame_tran2.dat')),o=new e.A(t.read('frame_del.dat')),l=i.ct;i.ft+=2;const a=new Int32Array(500),c=new Int32Array(500),f=new Int32Array(500),u=new Int32Array(500);for(let t=0;t0){if(0!==d.types[t])for(let i=t-1;i>y;i--)if(0===d.types[i]){a[A]=i,c[A]=0,f[A]=0,u[A]=0,A++;break}a[A]=t;let s=0;3===d.types[a[A]]&&(s=128),c[A]=1&i?r.iS:s,f[A]=2&i?r.iS:s,u[A]=4&i?r.iS:s,y=t,A++}}e.length=A,e.sS=new Int32Array(A),e.x=new Int32Array(A),e.y=new Int32Array(A),e.z=new Int32Array(A);for(let t=0;t{s.d(i,{hg:()=>h,Il:()=>e,hS:()=>o,eS:()=>r,nS:()=>n});const h=document.getElementById('canvas'),e=h.getContext('2d',{willReadFrequently:!0}),n=document.createElement('canvas'),r=document.createElement('img'),o=n.getContext('2d',{willReadFrequently:!0})},9298:(t,i,s)=>{s.d(i,{A:()=>h});class h{static RED=16711680;static GREEN=65280;static BLUE=255;static fa=16776960;static $c=65535;static Jc=16711935;static Kl=16777215;static ca=0;static rS=16748608;static bd=8388608;static vd=128;static oS=16756736;static lS=16740352;static aS=16723968;static cS=12648192;static fS=8453888;static uS=4259584;static Wc=9179409;static ew=6116423;static vl=2301979;static bl=5063219;static Rl=7759444;static Ml=3353893;static Ld=8388736;static Rd=13350793;static ad=Int32Array.of(h.fa,h.RED,h.GREEN,h.$c,h.Jc,h.Kl);static PL=6798;static FL=107;static UL=10283;static BL=16;static HL=4797;static WL=7744;static YL=5799;static VL=4634;static KL=33697;static XL=22433;static zL=2983;static jL=54193;static ZL=8741;static qL=12;static $L=64030;static JL=43162;static QL=7735;static tR=8404;static iR=1701;static sR=38430;static hR=24094;static eR=10153;static nR=56621;static rR=4783;static oR=1341;static lR=16578;static aR=35003;static cR=25239;static EL=9104;static gL=10275;static _L=7595;static CL=3610;static TL=7975;static OL=8526;static vL=918;static bL=38802;static LL=24466;static RL=10145;static SL=58654;static ML=5027;static kL=1457;static xL=16565;static DL=34991;static NL=25486;static fR=4626;static uR=11146;static dR=6439;static wR=12;static yR=4758;static AR=10270;static TR=4574;static pR=4550;static mR=4537;static IR=5681;static ER=5673;static gR=5790;static _R=6806;static CR=8076}},8950:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(4474);class e extends h.A{static Mc=new Int32Array;static RC=0;static SC=0;static top=0;static bottom=0;static left=0;static right=0;static uL=0;static dS=0;static wS=0;static bind=(t,i,s)=>{this.Mc=t,this.RC=i,this.SC=s,this.Hl(0,0,i,s)};static ud=()=>{this.left=0,this.top=0,this.right=this.RC,this.bottom=this.SC,this.uL=this.right-1,this.dS=this.right/2|0};static Hl=(t,i,s,h)=>{t<0&&(t=0),i<0&&(i=0),s>this.RC&&(s=this.RC),h>this.SC&&(h=this.SC),this.top=i,this.bottom=h,this.left=t,this.right=s,this.uL=this.right-1,this.dS=this.right/2|0,this.wS=this.bottom/2|0};static clear=()=>{const t=this.RC*this.SC;for(let i=0;i{this.Sl(t,i,e,s),this.Sl(t,i+h-1,e,s),this.Ll(t,i,e,h),this.Ll(t+s-1,i,e,h)};static Sl=(t,i,s,h)=>{if(i=this.bottom)return;tthis.right&&(h=this.right-t);const e=t+i*this.RC;for(let t=0;t{if(t=this.right)return;ithis.bottom&&(h=this.bottom-i);const e=t+i*this.RC;for(let t=0;t{const n=Math.abs(s-t),r=Math.abs(h-i),o=t=this.left&&t=this.top&&i-r&&(a-=r,t+=o),s{tthis.right&&(s=this.right-t),i+h>this.bottom&&(h=this.bottom-i);const n=this.RC-s;let r=t+i*this.RC;for(let t=-h;t<0;t++){for(let t=-s;t<0;t++)this.Mc[r++]=e;r+=n}};static yS(t,i,s,h,e,n){tthis.right&&(s=this.right-t),i+h>this.bottom&&(h=this.bottom-i);const r=256-n,o=(e>>16&255)*n,l=(e>>8&255)*n,a=(255&e)*n,c=this.RC-s;let f=t+i*this.RC;for(let t=0;t>16&255)*r>>8<<16)+(l+(this.Mc[f]>>8&255)*r>>8<<8)+(a+(255&this.Mc[f])*r>>8);this.Mc[f++]=t}f+=c}}static AS(t,i,s,h,e){const n=256-e,r=(h>>16&255)*e,o=(h>>8&255)*e,l=(255&h)*e;let a=i-s;a<0&&(a=0);let c=i+s;c>=this.SC&&(c=this.SC-1);for(let h=a;h<=c;h++){const e=h-i,a=0|Math.sqrt(s*s-e*e);let c=t-a;c<0&&(c=0);let f=t+a;f>=this.RC&&(f=this.RC-1);let u=c+h*this.RC;for(let t=c;t<=f;t++){const t=(r+(this.Mc[u]>>16&255)*n>>8<<16)+(o+(this.Mc[u]>>8&255)*n>>8<<8)+(l+(255&this.Mc[u])*n>>8);this.Mc[u++]=t}}}static pS=(t,i,s)=>{t=this.right||i=this.bottom||(this.Mc[t+i*this.RC]=s)}}},4583:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(8950),e=s(1673),n=s(3867);class r extends h.A{static vt=!1;static mS=new Int32Array(512);static IS=new Int32Array(2048);static sin=new Int32Array(2048);static cos=new Int32Array(2048);static palette=new Int32Array(65536);static xE=new n.Ns(50,null);static ES=0;static xc=new Int32Array;static Sa=0;static Ma=0;static MC=!0;static fL=!1;static alpha=0;static gS=null;static _S=new n.Ns(50,null);static CS=0;static wu=0;static kE=new Int32Array(50);static TS=new n.Ns(50,null);static OS=!1;static vS=new n.Ns(50,!1);static bS=new Int32Array(50);static{for(let t=1;t<512;t++)this.mS[t]=32768/t|0;for(let t=1;t<2048;t++)this.IS[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 Zo=()=>{this.mS=null,this.mS=null,this.sin=null,this.cos=null,this.xc=null,this.xE=null,this.vS=null,this.bS=null,this.gS=null,this._S=null,this.kE=null,this.palette=null,this.TS=null,console.log('Draw3D unloaded!')};static eg=()=>{this.xc=new Int32Array(h.A.SC);for(let t=0;t{this.xc=new Int32Array(i);for(let s=0;s{this.gS=null,this._S.fill(null)};static bc=t=>{this.ES=0;for(let i=0;i<50;i++)try{this.xE[i]=e.A.Ic(t,i.toString()),this.vt&&128===this.xE[i]?.oa?this.xE[i]?.LS():this.xE[i]?.PC(),this.ES++}catch(t){}};static gO=t=>{if(0!==this.bS[t])return this.bS[t];const i=this.TS[t];if(!i)return 0;let s=0,h=0,e=0;const n=i.length;for(let t=0;t>16&255,h+=i[t]>>8&255,e+=255&i[t];let r=(s/n<<16)+(h/n<<8)+(e/n|0);return r=this.RS(r,1.4),0===r&&(r=1),this.bS[t]=r,r};static Lc=t=>{const i=t+.03*Math.random()-.015;let s=0;for(let t=0;t<512;t++){const h=(t/8|0)/64+.0078125,e=(7&t)/8+.0625;for(let t=0;t<128;t++){const n=t/128;let r=n,o=n,l=n;if(0!==e){let t;t=n<.5?n*(e+1):n+e-n*e;const i=2*n-t;let s=h+.3333333333333333;s>1&&s--;let a=h-.3333333333333333;a<0&&a++,r=6*s<1?i+6*(t-i)*s:2*s<1?t:3*s<2?i+(t-i)*(.6666666666666666-s)*6:i,o=6*h<1?i+6*(t-i)*h:2*h<1?t:3*h<2?i+(t-i)*(.6666666666666666-h)*6:i,l=6*a<1?i+6*(t-i)*a:2*a<1?t:3*a<2?i+(t-i)*(.6666666666666666-a)*6:i}const a=((256*r|0)<<16)+((256*o|0)<<8)+(256*l|0);this.palette[s++]=this.RS(a,i)}}for(let t=0;t<50;t++){const s=this.xE[t];if(!s)continue;const h=s.palette;this.TS[t]=new Int32Array(h.length);for(let s=0;s{const s=(t>>16)/256,h=(t>>8&255)/256,e=(255&t)/256;return((256*Math.pow(s,i)|0)<<16)+((256*Math.pow(h,i)|0)<<8)+(256*Math.pow(e,i)|0)};static Rc=t=>{this.gS||(this.CS=t,this.vt?this.gS=new n.wr(t,16384):this.gS=new n.wr(t,65536),this._S.fill(null))};static wL=(t,i,s,e,n,o,l,a,c)=>{let f=0,u=0;n!==e&&(f=(i-t<<16)/(n-e)|0,u=(a-l<<15)/(n-e)|0);let d=0,w=0;o!==n&&(d=(s-i<<16)/(o-n)|0,w=(c-a<<15)/(o-n)|0);let y=0,A=0;if(o!==e&&(y=(t-s<<16)/(e-o)|0,A=(l-c<<15)/(e-o)|0),e<=n&&e<=o){if(eh.A.bottom&&(n=h.A.bottom),o>h.A.bottom&&(o=h.A.bottom),nd)for(o-=n,n-=e,e=r.xc[e];;){if(--n<0)for(;;){if(--o<0)return;this.SS(s>>16,i>>16,c>>7,a>>7,h.A.Mc,e,0),s+=y,i+=d,c+=A,a+=w,e+=h.A.RC}this.SS(s>>16,t>>16,c>>7,l>>7,h.A.Mc,e,0),s+=y,t+=f,c+=A,l+=u,e+=h.A.RC}else for(o-=n,n-=e,e=r.xc[e];;){if(--n<0)for(;;){if(--o<0)return;this.SS(i>>16,s>>16,a>>7,c>>7,h.A.Mc,e,0),s+=y,i+=d,c+=A,a+=w,e+=h.A.RC}this.SS(t>>16,s>>16,l>>7,c>>7,h.A.Mc,e,0),s+=y,t+=f,c+=A,l+=u,e+=h.A.RC}else if(i=t<<=16,a=l<<=15,e<0&&(i-=y*e,t-=f*e,a-=A*e,l-=u*e,e=0),s<<=16,c<<=15,o<0&&(s-=d*o,c-=w*o,o=0),e!==o&&yf)for(n-=o,o-=e,e=r.xc[e];;){if(--o<0)for(;;){if(--n<0)return;this.SS(s>>16,t>>16,c>>7,l>>7,h.A.Mc,e,0),s+=d,t+=f,c+=w,l+=u,e+=h.A.RC}this.SS(i>>16,t>>16,a>>7,l>>7,h.A.Mc,e,0),i+=y,t+=f,a+=A,l+=u,e+=h.A.RC}else for(n-=o,o-=e,e=r.xc[e];;){if(--o<0)for(;;){if(--n<0)return;this.SS(t>>16,s>>16,l>>7,c>>7,h.A.Mc,e,0),s+=d,t+=f,c+=w,l+=u,e+=h.A.RC}this.SS(t>>16,i>>16,l>>7,a>>7,h.A.Mc,e,0),i+=y,t+=f,a+=A,l+=u,e+=h.A.RC}}else if(n<=o){if(nh.A.bottom&&(o=h.A.bottom),e>h.A.bottom&&(e=h.A.bottom),oy)for(e-=o,o-=n,n=r.xc[n];;){if(--o<0)for(;;){if(--e<0)return;this.SS(t>>16,s>>16,l>>7,c>>7,h.A.Mc,n,0),t+=f,s+=y,l+=u,c+=A,n+=h.A.RC}this.SS(t>>16,i>>16,l>>7,a>>7,h.A.Mc,n,0),t+=f,i+=d,l+=u,a+=w,n+=h.A.RC}else for(e-=o,o-=n,n=r.xc[n];;){if(--o<0)for(;;){if(--e<0)return;this.SS(s>>16,t>>16,c>>7,l>>7,h.A.Mc,n,0),t+=f,s+=y,l+=u,c+=A,n+=h.A.RC}this.SS(i>>16,t>>16,a>>7,l>>7,h.A.Mc,n,0),t+=f,i+=d,l+=u,a+=w,n+=h.A.RC}else if(s=i<<=16,c=a<<=15,n<0&&(s-=f*n,i-=d*n,c-=u*n,a-=w*n,n=0),t<<=16,l<<=15,e<0&&(t-=y*e,l-=A*e,e=0),o-=e,e-=n,n=r.xc[n],f>16,i>>16,l>>7,a>>7,h.A.Mc,n,0),t+=y,i+=d,l+=A,a+=w,n+=h.A.RC}this.SS(s>>16,i>>16,c>>7,a>>7,h.A.Mc,n,0),s+=f,i+=d,c+=u,a+=w,n+=h.A.RC}else for(;;){if(--e<0)for(;;){if(--o<0)return;this.SS(i>>16,t>>16,a>>7,l>>7,h.A.Mc,n,0),t+=y,i+=d,l+=A,a+=w,n+=h.A.RC}this.SS(i>>16,s>>16,a>>7,c>>7,h.A.Mc,n,0),s+=f,i+=d,c+=u,a+=w,n+=h.A.RC}}else if(oh.A.bottom&&(e=h.A.bottom),n>h.A.bottom&&(n=h.A.bottom),e>16,t>>16,a>>7,l>>7,h.A.Mc,o,0),i+=d,t+=f,a+=w,l+=u,o+=h.A.RC}this.SS(i>>16,s>>16,a>>7,c>>7,h.A.Mc,o,0),i+=d,s+=y,a+=w,c+=A,o+=h.A.RC}else for(;;){if(--e<0)for(;;){if(--n<0)return;this.SS(t>>16,i>>16,l>>7,a>>7,h.A.Mc,o,0),i+=d,t+=f,a+=w,l+=u,o+=h.A.RC}this.SS(s>>16,i>>16,c>>7,a>>7,h.A.Mc,o,0),i+=d,s+=y,a+=w,c+=A,o+=h.A.RC}else if(t=s<<=16,l=c<<=15,o<0&&(t-=d*o,s-=y*o,l-=w*o,c-=A*o,o=0),i<<=16,a<<=15,n<0&&(i-=f*n,a-=u*n,n=0),e-=n,n-=o,o=r.xc[o],d>16,s>>16,a>>7,c>>7,h.A.Mc,o,0),i+=f,s+=y,a+=u,c+=A,o+=h.A.RC}this.SS(t>>16,s>>16,l>>7,c>>7,h.A.Mc,o,0),t+=d,s+=y,l+=w,c+=A,o+=h.A.RC}else for(;;){if(--n<0)for(;;){if(--e<0)return;this.SS(s>>16,i>>16,c>>7,a>>7,h.A.Mc,o,0),i+=f,s+=y,a+=u,c+=A,o+=h.A.RC}this.SS(s>>16,t>>16,c>>7,l>>7,h.A.Mc,o,0),t+=d,s+=y,l+=w,c+=A,o+=h.A.RC}};static SS=(t,i,s,e,n,o,l)=>{let a;if(r.MC){let c;if(r.fL){if(c=i-t>3?(e-s)/(i-t)|0:0,i>h.A.uL&&(i=h.A.uL),t<0&&(s-=t*c,t=0),t>=i)return;o+=t,l=i-t>>2,c<<=2}else{if(!(t>2)>0?(e-s)*r.mS[l]>>15:0}if(0===r.alpha)for(;;){if(--l<0){if((l=i-t&3)>0){a=r.palette[s>>8];do{n[o++]=a,l--}while(l>0);return}break}a=r.palette[s>>8],s+=c,n[o++]=a,n[o++]=a,n[o++]=a,n[o++]=a}else{const h=r.alpha,e=256-r.alpha;for(;;){if(--l<0){if((l=i-t&3)>0){a=r.palette[s>>8],a=((16711935&a)*e>>8&16711935)+((65280&a)*e>>8&65280);do{n[o++]=a+((16711935&n[o])*h>>8&16711935)+((65280&n[o])*h>>8&65280),l--}while(l>0)}break}a=r.palette[s>>8],s+=c,a=((16711935&a)*e>>8&16711935)+((65280&a)*e>>8&65280),n[o++]=a+((16711935&n[o])*h>>8&16711935)+((65280&n[o])*h>>8&65280),n[o++]=a+((16711935&n[o])*h>>8&16711935)+((65280&n[o])*h>>8&65280),n[o++]=a+((16711935&n[o])*h>>8&16711935)+((65280&n[o])*h>>8&65280),n[o++]=a+((16711935&n[o])*h>>8&16711935)+((65280&n[o])*h>>8&65280)}}}else if(th.A.uL&&(i=h.A.uL),t<0&&(s-=t*c,t=0),t>=i))return;if(o+=t,l=i-t,0===r.alpha)do{n[o++]=r.palette[s>>8],s+=c,l--}while(l>0);else{const t=r.alpha,i=256-r.alpha;do{a=r.palette[s>>8],s+=c,a=((16711935&a)*i>>8&16711935)+((65280&a)*i>>8&65280),n[o++]=a+((16711935&n[o])*t>>8&16711935)+((65280&n[o])*t>>8&65280),l--}while(l>0)}}};static MS=(t,i,s,e,n,r,o)=>{let l=0;n!==e&&(l=(i-t<<16)/(n-e)|0);let a=0;r!==n&&(a=(s-i<<16)/(r-n)|0);let c=0;if(r!==e&&(c=(t-s<<16)/(e-r)|0),e<=n&&e<=r){if(eh.A.bottom&&(n=h.A.bottom),r>h.A.bottom&&(r=h.A.bottom),na)for(r-=n,n-=e,e=this.xc[e];;){if(--n<0)for(;;){if(--r<0)return;this.kS(s>>16,i>>16,h.A.Mc,e,o),s+=c,i+=a,e+=h.A.RC}this.kS(s>>16,t>>16,h.A.Mc,e,o),s+=c,t+=l,e+=h.A.RC}else for(r-=n,n-=e,e=this.xc[e];;){if(--n<0)for(;;){if(--r<0)return;this.kS(i>>16,s>>16,h.A.Mc,e,o),s+=c,i+=a,e+=h.A.RC}this.kS(t>>16,s>>16,h.A.Mc,e,o),s+=c,t+=l,e+=h.A.RC}else if(i=t<<=16,e<0&&(i-=c*e,t-=l*e,e=0),s<<=16,r<0&&(s-=a*r,r=0),e!==r&&cl)for(n-=r,r-=e,e=this.xc[e];;){if(--r<0)for(;;){if(--n<0)return;this.kS(s>>16,t>>16,h.A.Mc,e,o),s+=a,t+=l,e+=h.A.RC}this.kS(i>>16,t>>16,h.A.Mc,e,o),i+=c,t+=l,e+=h.A.RC}else for(n-=r,r-=e,e=this.xc[e];;){if(--r<0)for(;;){if(--n<0)return;this.kS(t>>16,s>>16,h.A.Mc,e,o),s+=a,t+=l,e+=h.A.RC}this.kS(t>>16,i>>16,h.A.Mc,e,o),i+=c,t+=l,e+=h.A.RC}}else if(n<=r){if(nh.A.bottom&&(r=h.A.bottom),e>h.A.bottom&&(e=h.A.bottom),rc)for(e-=r,r-=n,n=this.xc[n];;){if(--r<0)for(;;){if(--e<0)return;this.kS(t>>16,s>>16,h.A.Mc,n,o),t+=l,s+=c,n+=h.A.RC}this.kS(t>>16,i>>16,h.A.Mc,n,o),t+=l,i+=a,n+=h.A.RC}else for(e-=r,r-=n,n=this.xc[n];;){if(--r<0)for(;;){if(--e<0)return;this.kS(s>>16,t>>16,h.A.Mc,n,o),t+=l,s+=c,n+=h.A.RC}this.kS(i>>16,t>>16,h.A.Mc,n,o),t+=l,i+=a,n+=h.A.RC}else if(s=i<<=16,n<0&&(s-=l*n,i-=a*n,n=0),t<<=16,e<0&&(t-=c*e,e=0),l>16,i>>16,h.A.Mc,n,o),t+=c,i+=a,n+=h.A.RC}this.kS(s>>16,i>>16,h.A.Mc,n,o),s+=l,i+=a,n+=h.A.RC}else for(r-=e,e-=n,n=this.xc[n];;){if(--e<0)for(;;){if(--r<0)return;this.kS(i>>16,t>>16,h.A.Mc,n,o),t+=c,i+=a,n+=h.A.RC}this.kS(i>>16,s>>16,h.A.Mc,n,o),s+=l,i+=a,n+=h.A.RC}}else if(rh.A.bottom&&(e=h.A.bottom),n>h.A.bottom&&(n=h.A.bottom),e>16,t>>16,h.A.Mc,r,o),i+=a,t+=l,r+=h.A.RC}this.kS(i>>16,s>>16,h.A.Mc,r,o),i+=a,s+=c,r+=h.A.RC}else for(n-=e,e-=r,r=this.xc[r];;){if(--e<0)for(;;){if(--n<0)return;this.kS(t>>16,i>>16,h.A.Mc,r,o),i+=a,t+=l,r+=h.A.RC}this.kS(s>>16,i>>16,h.A.Mc,r,o),i+=a,s+=c,r+=h.A.RC}else if(t=s<<=16,r<0&&(t-=a*r,s-=c*r,r=0),i<<=16,n<0&&(i-=l*n,n=0),a>16,s>>16,h.A.Mc,r,o),i+=l,s+=c,r+=h.A.RC}this.kS(t>>16,s>>16,h.A.Mc,r,o),t+=a,s+=c,r+=h.A.RC}else for(e-=n,n-=r,r=this.xc[r];;){if(--n<0)for(;;){if(--e<0)return;this.kS(s>>16,i>>16,h.A.Mc,r,o),i+=l,s+=c,r+=h.A.RC}this.kS(s>>16,t>>16,h.A.Mc,r,o),t+=a,s+=c,r+=h.A.RC}};static pL=(t,i,s,e,n,r,o,l,a,c,f,u,d,w,y,A,p,m,I)=>{const E=this.xS(I);this.OS=!this.vS[I];const g=c-d,_=f-y,C=u-p,T=w-c,O=A-f,v=m-u;let b=T*f-O*c<<14;const L=O*u-v*f<<8,R=v*c-T*u<<5;let S=g*f-_*c<<14;const M=_*u-C*f<<8,k=C*c-g*u<<5;let x=_*T-g*O<<14;const D=C*O-_*v<<8,N=g*v-C*T<<5;let P=0,F=0;n!==e&&(P=(i-t<<16)/(n-e)|0,F=(l-o<<16)/(n-e)|0);let U=0,B=0;r!==n&&(U=(s-i<<16)/(r-n)|0,B=(a-l<<16)/(r-n)|0);let G=0,H=0;if(r!==e&&(G=(t-s<<16)/(e-r)|0,H=(o-a<<16)/(e-r)|0),e<=n&&e<=r){if(eh.A.bottom&&(n=h.A.bottom),r>h.A.bottom&&(r=h.A.bottom),nU)for(r-=n,n-=e,e=this.xc[e];;){if(--n<0)for(;;){if(--r<0)return;this.DS(s>>16,i>>16,h.A.Mc,e,E,0,0,b,S,x,L,M,D,a>>8,l>>8),s+=G,i+=U,a+=H,l+=B,e+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this.DS(s>>16,t>>16,h.A.Mc,e,E,0,0,b,S,x,L,M,D,a>>8,o>>8),s+=G,t+=P,a+=H,o+=F,e+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}else for(r-=n,n-=e,e=this.xc[e];;){if(--n<0)for(;;){if(--r<0)return;this.DS(i>>16,s>>16,h.A.Mc,e,E,0,0,b,S,x,L,M,D,l>>8,a>>8),s+=G,i+=U,a+=H,l+=B,e+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this.DS(t>>16,s>>16,h.A.Mc,e,E,0,0,b,S,x,L,M,D,o>>8,a>>8),s+=G,t+=P,a+=H,o+=F,e+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}}else{i=t<<=16,l=o<<=16,e<0&&(i-=G*e,t-=P*e,l-=H*e,o-=F*e,e=0),s<<=16,a<<=16,r<0&&(s-=U*r,a-=B*r,r=0);const c=e-this.Ma;if(b+=R*c,S+=k*c,x+=N*c,b|=0,S|=0,x|=0,(e===r||G>=P)&&(e!==r||U<=P))for(n-=r,r-=e,e=this.xc[e];;){if(--r<0)for(;;){if(--n<0)return;this.DS(t>>16,s>>16,h.A.Mc,e,E,0,0,b,S,x,L,M,D,o>>8,a>>8),s+=U,t+=P,a+=B,o+=F,e+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this.DS(t>>16,i>>16,h.A.Mc,e,E,0,0,b,S,x,L,M,D,o>>8,l>>8),i+=G,t+=P,l+=H,o+=F,e+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}else for(n-=r,r-=e,e=this.xc[e];;){if(--r<0)for(;;){if(--n<0)return;this.DS(s>>16,t>>16,h.A.Mc,e,E,0,0,b,S,x,L,M,D,a>>8,o>>8),s+=U,t+=P,a+=B,o+=F,e+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this.DS(i>>16,t>>16,h.A.Mc,e,E,0,0,b,S,x,L,M,D,l>>8,o>>8),i+=G,t+=P,l+=H,o+=F,e+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}}}else if(n<=r){if(nh.A.bottom&&(r=h.A.bottom),e>h.A.bottom&&(e=h.A.bottom),rG)for(e-=r,r-=n,n=this.xc[n];;){if(--r<0)for(;;){if(--e<0)return;this.DS(t>>16,s>>16,h.A.Mc,n,E,0,0,b,S,x,L,M,D,o>>8,a>>8),t+=P,s+=G,o+=F,a+=H,n+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this.DS(t>>16,i>>16,h.A.Mc,n,E,0,0,b,S,x,L,M,D,o>>8,l>>8),t+=P,i+=U,o+=F,l+=B,n+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}else for(e-=r,r-=n,n=this.xc[n];;){if(--r<0)for(;;){if(--e<0)return;this.DS(s>>16,t>>16,h.A.Mc,n,E,0,0,b,S,x,L,M,D,a>>8,o>>8),t+=P,s+=G,o+=F,a+=H,n+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this.DS(i>>16,t>>16,h.A.Mc,n,E,0,0,b,S,x,L,M,D,l>>8,o>>8),t+=P,i+=U,o+=F,l+=B,n+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}}else{s=i<<=16,a=l<<=16,n<0&&(s-=P*n,i-=U*n,a-=F*n,l-=B*n,n=0),t<<=16,o<<=16,e<0&&(t-=G*e,o-=H*e,e=0);const c=n-this.Ma;if(b+=R*c,S+=k*c,x+=N*c,b|=0,S|=0,x|=0,r-=e,e-=n,n=this.xc[n],P>16,i>>16,h.A.Mc,n,E,0,0,b,S,x,L,M,D,o>>8,l>>8),t+=G,i+=U,o+=H,l+=B,n+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this.DS(s>>16,i>>16,h.A.Mc,n,E,0,0,b,S,x,L,M,D,a>>8,l>>8),s+=P,i+=U,a+=F,l+=B,n+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}else for(;;){if(--e<0)for(;;){if(--r<0)return;this.DS(i>>16,t>>16,h.A.Mc,n,E,0,0,b,S,x,L,M,D,l>>8,o>>8),t+=G,i+=U,o+=H,l+=B,n+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this.DS(i>>16,s>>16,h.A.Mc,n,E,0,0,b,S,x,L,M,D,l>>8,a>>8),s+=P,i+=U,a+=F,l+=B,n+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}}}else if(rh.A.bottom&&(e=h.A.bottom),n>h.A.bottom&&(n=h.A.bottom),e>16,t>>16,h.A.Mc,r,E,0,0,b,S,x,L,M,D,l>>8,o>>8),i+=U,t+=P,l+=B,o+=F,r+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this.DS(i>>16,s>>16,h.A.Mc,r,E,0,0,b,S,x,L,M,D,l>>8,a>>8),i+=U,s+=G,l+=B,a+=H,r+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}else for(;;){if(--e<0)for(;;){if(--n<0)return;this.DS(t>>16,i>>16,h.A.Mc,r,E,0,0,b,S,x,L,M,D,o>>8,l>>8),i+=U,t+=P,l+=B,o+=F,r+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this.DS(s>>16,i>>16,h.A.Mc,r,E,0,0,b,S,x,L,M,D,a>>8,l>>8),i+=U,s+=G,l+=B,a+=H,r+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}}else{t=s<<=16,o=a<<=16,r<0&&(t-=U*r,s-=G*r,o-=B*r,a-=H*r,r=0),i<<=16,l<<=16,n<0&&(i-=P*n,l-=F*n,n=0);const c=r-this.Ma;if(b+=R*c,S+=k*c,x+=N*c,b|=0,S|=0,x|=0,e-=n,n-=r,r=this.xc[r],U>16,s>>16,h.A.Mc,r,E,0,0,b,S,x,L,M,D,l>>8,a>>8),i+=P,s+=G,l+=F,a+=H,r+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this.DS(t>>16,s>>16,h.A.Mc,r,E,0,0,b,S,x,L,M,D,o>>8,a>>8),t+=U,s+=G,o+=B,a+=H,r+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}else for(;;){if(--n<0)for(;;){if(--e<0)return;this.DS(s>>16,i>>16,h.A.Mc,r,E,0,0,b,S,x,L,M,D,a>>8,l>>8),i+=P,s+=G,l+=F,a+=H,r+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this.DS(s>>16,t>>16,h.A.Mc,r,E,0,0,b,S,x,L,M,D,a>>8,o>>8),t+=U,s+=G,o+=B,a+=H,r+=h.A.RC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}}};static DS=(t,i,s,e,n,r,o,l,a,c,f,u,d,w,y)=>{if(t>=i)return;let A,p,m,I,E,g,_,C,T;if(this.fL){if(A=(y-w)/(i-t)|0,i>h.A.uL&&(i=h.A.uL),t<0&&(w-=t*A,t=0),t>=i)return;p=i-t>>3,A<<=12}else i-t>7?(p=i-t>>3,A=(y-w)*this.mS[p]>>6):(p=0,A=0);if(w<<=9,e+=t,this.vt&&n)if(m=0,I=0,g=t-this.Sa,l+=(f>>3)*g,a+=(u>>3)*g,c+=(d>>3)*g,l|=0,a|=0,E=(c|=0)>>12,0!==E&&(o=a/E|0,(r=l/E|0)<0?r=0:r>4032&&(r=4032)),l+=f,a+=u,c+=d,l|=0,a|=0,E=(c|=0)>>12,0!==E&&(m=l/E|0,I=a/E|0,m<7?m=7:m>4032&&(m=4032)),_=m-r>>3,C=I-o>>3,r+=w>>3&786432,T=w>>23,this.OS){for(;p-- >0;)s[e++]=n[(4032&o)+(r>>6)]>>>T,r+=_,o+=C,s[e++]=n[(4032&o)+(r>>6)]>>>T,r+=_,o+=C,s[e++]=n[(4032&o)+(r>>6)]>>>T,r+=_,o+=C,s[e++]=n[(4032&o)+(r>>6)]>>>T,r+=_,o+=C,s[e++]=n[(4032&o)+(r>>6)]>>>T,r+=_,o+=C,s[e++]=n[(4032&o)+(r>>6)]>>>T,r+=_,o+=C,s[e++]=n[(4032&o)+(r>>6)]>>>T,r+=_,o+=C,s[e++]=n[(4032&o)+(r>>6)]>>>T,r=m,o=I,l+=f,a+=u,E=(c+=d)>>12,0!==E&&(m=l/E|0,I=a/E|0,m<7?m=7:m>4032&&(m=4032)),_=m-r>>3,C=I-o>>3,r+=(w+=A)>>3&786432,T=w>>23;for(p=i-t&7;p-- >0;)s[e++]=n[(4032&o)+(r>>6)]>>>T,r+=_,o+=C}else{for(;p-- >0;){let t;0!=(t=n[(4032&o)+(r>>6)]>>>T)&&(s[e]=t),e+=1,0!=(t=n[(4032&(o+=C))+((r+=_)>>6)]>>>T)&&(s[e]=t),e++,0!=(t=n[(4032&(o+=C))+((r+=_)>>6)]>>>T)&&(s[e]=t),e++,0!=(t=n[(4032&(o+=C))+((r+=_)>>6)]>>>T)&&(s[e]=t),e++,0!=(t=n[(4032&(o+=C))+((r+=_)>>6)]>>>T)&&(s[e]=t),e++,0!=(t=n[(4032&(o+=C))+((r+=_)>>6)]>>>T)&&(s[e]=t),e++,0!=(t=n[(4032&(o+=C))+((r+=_)>>6)]>>>T)&&(s[e]=t),e++,0!=(t=n[(4032&(o+=C))+((r+=_)>>6)]>>>T)&&(s[e]=t),e+=1,r=m,o=I,l+=f,a+=u,c+=d,l|=0,a|=0,E=(c|=0)>>12,0!==E&&(m=l/E|0,I=a/E|0,m<7?m=7:m>4032&&(m=4032)),_=m-r>>3,C=I-o>>3,r+=(w+=A)>>3&786432,T=w>>23}for(p=i-t&7;p-- >0;){let t;0!=(t=n[(4032&o)+(r>>6)]>>>T)&&(s[e]=t),e++,r+=_,o+=C}}else if(m=0,I=0,g=t-this.Sa,l+=(f>>3)*g,a+=(u>>3)*g,c+=(d>>3)*g,l|=0,a|=0,E=(c|=0)>>14,0!==E&&(o=a/E|0,(r=l/E|0)<0?r=0:r>16256&&(r=16256)),l+=f,a+=u,c+=d,l|=0,a|=0,E=(c|=0)>>14,0!==E&&(m=l/E|0,I=a/E|0,m<7?m=7:m>16256&&(m=16256)),_=m-r>>3,C=I-o>>3,r+=6291456&w,T=w>>23,this.OS&&n){for(;p-- >0;)s[e++]=n[(16256&o)+(r>>7)]>>>T,r+=_,o+=C,s[e++]=n[(16256&o)+(r>>7)]>>>T,r+=_,o+=C,s[e++]=n[(16256&o)+(r>>7)]>>>T,r+=_,o+=C,s[e++]=n[(16256&o)+(r>>7)]>>>T,r+=_,o+=C,s[e++]=n[(16256&o)+(r>>7)]>>>T,r+=_,o+=C,s[e++]=n[(16256&o)+(r>>7)]>>>T,r+=_,o+=C,s[e++]=n[(16256&o)+(r>>7)]>>>T,r+=_,o+=C,s[e++]=n[(16256&o)+(r>>7)]>>>T,r=m,o=I,l+=f,a+=u,c+=d,l|=0,a|=0,E=(c|=0)>>14,0!==E&&(m=l/E|0,I=a/E|0,m<7?m=7:m>16256&&(m=16256)),_=m-r>>3,C=I-o>>3,r+=6291456&(w+=A),T=w>>23;for(p=i-t&7;p-- >0;)s[e++]=n[(16256&o)+(r>>7)]>>>T,r+=_,o+=C}else{for(;p-- >0&&n;){let t;0!=(t=n[(16256&o)+(r>>7)]>>>T)&&(s[e]=t),e+=1,0!=(t=n[(16256&(o+=C))+((r+=_)>>7)]>>>T)&&(s[e]=t),e++,0!=(t=n[(16256&(o+=C))+((r+=_)>>7)]>>>T)&&(s[e]=t),e++,0!=(t=n[(16256&(o+=C))+((r+=_)>>7)]>>>T)&&(s[e]=t),e++,0!=(t=n[(16256&(o+=C))+((r+=_)>>7)]>>>T)&&(s[e]=t),e++,0!=(t=n[(16256&(o+=C))+((r+=_)>>7)]>>>T)&&(s[e]=t),e++,0!=(t=n[(16256&(o+=C))+((r+=_)>>7)]>>>T)&&(s[e]=t),e++,0!=(t=n[(16256&(o+=C))+((r+=_)>>7)]>>>T)&&(s[e]=t),e++,r=m,o=I,l+=f,a+=u,c+=d,l|=0,a|=0,E=(c|=0)>>14,0!==E&&(m=l/E|0,I=a/E|0,m<7?m=7:m>16256&&(m=16256)),_=m-r>>3,C=I-o>>3,r+=6291456&(w+=A),T=w>>23}for(p=i-t&7;p-- >0&&n;){let t;0!=(t=n[(16256&o)+(r>>7)]>>>T)&&(s[e]=t),e++,r+=_,o+=C}}};static kS=(t,i,s,e,n)=>{if(this.fL&&(i>h.A.uL&&(i=h.A.uL),t<0&&(t=0)),t>=i)return;e+=t;let r=i-t>>2;if(0===this.alpha)for(;;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;s[e++]=n}s[e++]=n,s[e++]=n,s[e++]=n,s[e++]=n}const o=this.alpha,l=256-this.alpha;for(n=((16711935&n)*l>>8&16711935)+((65280&n)*l>>8&65280);;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;s[e++]=n+((16711935&s[e])*o>>8&16711935)+((65280&s[e])*o>>8&65280)}s[e++]=n+((16711935&s[e])*o>>8&16711935)+((65280&s[e])*o>>8&65280),s[e++]=n+((16711935&s[e])*o>>8&16711935)+((65280&s[e])*o>>8&65280),s[e++]=n+((16711935&s[e])*o>>8&16711935)+((65280&s[e])*o>>8&65280),s[e++]=n+((16711935&s[e])*o>>8&16711935)+((65280&s[e])*o>>8&65280)}};static DE=t=>{this._S[t]&&this.gS&&(this.gS[this.CS++]=this._S[t],this._S[t]=null)};static xS=t=>{if(this.kE[t]=this.wu++,this._S[t])return this._S[t];let i;if(this.CS>0&&this.gS)i=this.gS[--this.CS],this.gS[this.CS]=null;else{let t=0,s=-1;for(let i=0;i>>3)&16316671,i[e+8192]=n-(n>>>2)&16316671,i[e+12288]=n-(n>>>2)-(n>>>3)&16316671}}else{if(64===s.width)for(let t=0;t<128;t++)for(let e=0;e<128;e++)i[e+(t<<7)]=h[s.Mc[(e>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)i[t]=h[s.Mc[t]];this.vS[t]=!1;for(let s=0;s<16384;s++){i[s]&=16316671;const h=i[s];0===h&&(this.vS[t]=!0),i[s+16384]=h-(h>>>3)&16316671,i[s+32768]=h-(h>>>2)&16316671,i[s+49152]=h-(h>>>2)-(h>>>3)&16316671}}return i}}},8665:(t,i,s)=>{s.d(i,{A:()=>f});var h=s(1069),e=s(8950),n=s(4583),r=s(6730),o=s(4474),l=s(3867);class a{rC=0;Kb=0;NS=0;PS=-1;US=-1;BS=-1;GS=-1;HS=-1;WS=-1;YS=-1;VS=-1;KS=-1;XS=0;zS=-1;jS=-1;ZS=-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 qS=null;static $S=null;static JS=null;static QS=null;static tM=null;static iM=null;static sM=null;static hM=null;static eM=null;static nM=null;static rM=null;static oM=null;static axis=null;static lM=new l.Ns(4096,!1);static aM=new l.Ns(4096,!1);static cM=new Int32Array(4096);static fM=new Int32Array(4096);static uM=new Int32Array(4096);static dM=new Int32Array(4096);static wM=new Int32Array(4096);static yM=new Int32Array(4096);static AM=new Int32Array(1500);static pM=new l.wr(1500,512);static mM=new Int32Array(12);static IM=new l.wr(12,2e3);static EM=new Int32Array(2e3);static gM=new Int32Array(2e3);static _M=new Int32Array(12);static CM=new Int32Array(10);static TM=new Int32Array(10);static OM=new Int32Array(10);static Hn=0;static vM=0;static Wn=0;static yu=!1;static ea=0;static na=0;static Au=0;static Fm=new Int32Array(1e3);static bM=!1;static Sc(t){try{f.head=new h.A(t.read('ob_head.dat')),f.qS=new h.A(t.read('ob_face1.dat')),f.$S=new h.A(t.read('ob_face2.dat')),f.JS=new h.A(t.read('ob_face3.dat')),f.QS=new h.A(t.read('ob_face4.dat')),f.tM=new h.A(t.read('ob_face5.dat')),f.iM=new h.A(t.read('ob_point1.dat')),f.sM=new h.A(t.read('ob_point2.dat')),f.hM=new h.A(t.read('ob_point3.dat')),f.eM=new h.A(t.read('ob_point4.dat')),f.nM=new h.A(t.read('ob_point5.dat')),f.rM=new h.A(t.read('ob_vertex1.dat')),f.oM=new h.A(t.read('ob_vertex2.dat')),f.axis=new h.A(t.read('ob_axis.dat')),f.head.ft=0,f.iM.ft=0,f.sM.ft=0,f.hM.ft=0,f.eM.ft=0,f.rM.ft=0,f.oM.ft=0;const i=f.head.ct;f.metadata=new l.Ns(i+100,null);let s=0,e=0,n=0,r=0,o=0,c=0,u=0;for(let t=0;t>7)<2?i=2:i>126&&(i=126),(65408&t)+i):(i<0?i=0:i>127&&(i=127),127-i)}static nC=(t,i,s)=>{const h=t.rC,e=t.Kb,n=t.NS;let r,o,a,u,d;if(i){r=new Int32Array(h);for(let i=0;i{const e=t.rC,n=t.Kb,r=t.NS;let o,l,a,c,u;if(h)o=t.oC,l=t.aC,a=t.lC;else{o=new Int32Array(e),l=new Int32Array(e),a=new Int32Array(e);for(let i=0;i{const s=t.rC,h=t.Kb,e=t.NS,n=new Int32Array(s),r=new Int32Array(s),o=new Int32Array(s);for(let i=0;i{let s=!1,h=!1,e=!1,n=!1,r=0,o=0,l=0,a=-1;for(let c=0;c{let s=!1,h=!1,e=!1,n=!1,r=0,o=0,l=0,a=-1;for(let c=0;c{let o=-1;const l=t.oC[i],a=t.aC[i],c=t.lC[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.qS&&f.$S&&f.JS&&f.QS&&f.tM&&f.iM&&f.sM&&f.hM&&f.eM&&f.nM&&f.rM&&f.oM&&f.axis))throw new Error('cant loading model!!!!!');const s=i.rC,h=i.Kb,e=i.NS,n=new Int32Array(s),r=new Int32Array(s),o=new Int32Array(s),l=new Int32Array(h),a=new Int32Array(h),c=new Int32Array(h),u=new Int32Array(e),d=new Int32Array(e),w=new Int32Array(e);let y=null;i.HS>=0&&(y=new Int32Array(s));let A=null;i.KS>=0&&(A=new Int32Array(h));let p=null,m=0;i.XS>=0?p=new Int32Array(h):m=-i.XS-1;let I=null;i.zS>=0&&(I=new Int32Array(h));let E=null;i.jS>=0&&(E=new Int32Array(h));const g=new Int32Array(h);f.iM.ft=i.PS,f.sM.ft=i.US,f.hM.ft=i.BS,f.eM.ft=i.GS,f.nM.ft=i.HS;let _,C,T,O=0,v=0,b=0;for(let t=0;t{if(!f.metadata||!f.metadata[i])throw new Error('No model metadata');const s=f.metadata[i];if(s.data=t,!s.data.length)throw new Error('No model data');const e=s.rC,n=s.Kb,r=s.NS,o=new Int32Array(e),l=new Int32Array(e),a=new Int32Array(e),c=new Int32Array(n),u=new Int32Array(n),d=new Int32Array(n),w=new Int32Array(r),y=new Int32Array(r),A=new Int32Array(r);let p=null;s.HS>=0&&(p=new Int32Array(e));let m=null;s.KS>=0&&(m=new Int32Array(n));let I=null,E=0;s.XS>=0?I=new Int32Array(n):E=-s.XS-1;let g=null;s.zS>=0&&(g=new Int32Array(n));let _=null;s.jS>=0&&(_=new Int32Array(n));const C=new Int32Array(n),T=new h.A(s.data);T.ft=s.PS;const O=new h.A(s.data);O.ft=s.US;const v=new h.A(s.data);v.ft=s.BS;const b=new h.A(s.data);b.ft=s.GS;const L=new h.A(s.data);L.ft=s.HS;let R,S,M,k=0,x=0,D=0;for(let t=0;tthis.AC&&(this.AC=-s),s>this.GO&&(this.GO=s);const e=i*i+h*h;e>this.bO&&(this.bO=e)}this.bO=Math.sqrt(this.bO)+.99|0,this.BM=Math.sqrt(this.bO*this.bO+this.AC*this.AC)+.99|0,this.UM=this.BM+(Math.sqrt(this.bO*this.bO+this.GO*this.GO)+.99|0)}cC(){this.AC=0,this.GO=0;for(let t=0;tthis.AC&&(this.AC=-i),i>this.GO&&(this.GO=i)}this.BM=Math.sqrt(this.bO*this.bO+this.AC*this.AC)+.99|0,this.UM=this.BM+(Math.sqrt(this.bO*this.bO+this.GO*this.GO)+.99|0)}sc(){if(this.GM){const t=new Int32Array(256);let i=0;for(let s=0;si&&(i=h)}this.dC=new l.Ns(i+1,null);for(let s=0;s<=i;s++)this.dC[s]=new Int32Array(t[s]),t[s]=0;let s=0;for(;si&&(i=h)}this.uC=new l.Ns(i+1,null);for(let s=0;s<=i;s++)this.uC[s]=new Int32Array(t[s]),t[s]=0;let s=0;for(;sl;)l=s[o++];n&&n.types&&h.x&&h.y&&h.z&&n.labels&&(i!==l||0===n.types[i])&&this.KM(h.x[t],h.y[t],h.z[t],n.labels[i],n.types[i])}f.Hn=0,f.vM=0,f.Wn=0,o=0,l=s[o++];for(let t=0;tl;)l=s[o++];n&&n.types&&e.x&&e.y&&e.z&&n.labels&&(i===l||0===n.types[i])&&this.KM(e.x[t],e.y[t],e.z[t],n.labels[i],n.types[i])}}else this.hc(t)}hc(t){if(!this.dC||-1===t||!r.A.Jo[t])return;const i=r.A.Jo[t],s=i.tS;f.Hn=0,f.vM=0,f.Wn=0;for(let t=0;t>16;this.lC[t]=this.aC[t]*i+this.lC[t]*s>>16,this.aC[t]=h}}translate(t,i,s){for(let h=0;h>8;if(this.SM&&this.MM&&this.kM||(this.SM=new Int32Array(this.Kb),this.MM=new Int32Array(this.Kb),this.kM=new Int32Array(this.Kb)),!this.Ub){this.Ub=new l.Ns(this.rC,null);for(let t=0;t8192||p>8192||m>8192||A<-8192||p<-8192||m<-8192;)A>>=1,p>>=1,m>>=1;let I=0|Math.sqrt(A*A+p*p+m*m);if(I<=0&&(I=1),A=256*A/I|0,p=256*p/I|0,m=256*m/I|0,this.Vb&&1&this.Vb[i]){const n=t+((s*A+h*p+e*m)/(r+(r/2|0))|0);this.A_&&(this.SM[i]=f.RM(this.A_[i],n,this.Vb[i]))}else{let t=this.Ub[n];t&&(t.x+=A,t.y+=p,t.z+=m,t.w++),t=this.Ub[o],t&&(t.x+=A,t.y+=p,t.z+=m,t.w++),t=this.Ub[l],t&&(t.x+=A,t.y+=p,t.z+=m,t.w++)}}if(n)this.Hb(t,r,s,h,e);else{this.Yb=new l.Ns(this.rC,null);for(let t=0;t>16;for(let h=0;h>16,E=E*w-I*d>>16,I=m),0!==t&&(m=E*a-g*l>>16,g=E*l+g*a>>16,E=m),0!==i&&(m=g*c+I*u>>16,g=g*u-I*c>>16,I=m),I+=e,E+=r,g+=o,m=E*A-g*y>>16,g=E*y+g*A>>16,E=m,f.cM&&f.fM&&f.uM&&(f.uM[h]=g-p,f.cM[h]=n.A.Sa+((I<<9)/g|0),f.fM[h]=n.A.Ma+((E<<9)/g|0)),this.NS>0&&f.dM&&f.wM&&f.yM&&(f.dM[h]=I,f.wM[h]=E,f.yM[h]=g)}try{this.zM(!1,!1,0)}catch(t){}}draw(t,i,s,h,r,o,l,a,c){const u=a*r-o*h>>16,d=l*i+u*s>>16,w=this.bO*s>>16,y=d+w;if(y<=50||d>=3500)return;const A=a*h+o*r>>16;let p=A-this.bO<<9;if((p/y|0)>=e.A.dS)return;let m=A+this.bO<<9;if((m/y|0)<=-e.A.dS)return;const I=l*s-u*i>>16,E=this.bO*i>>16;let g=I+E<<9;if((g/y|0)<=-e.A.wS)return;let _=I-(E+(this.AC*s>>16))<<9;if((_/y|0)>=e.A.wS)return;let C=d-(w+(this.AC*i>>16))<=50,T=!1;if(c>0&&f.yu){let t=d-w;t<=50&&(t=50),A>0?(p=p/y|0,m=m/t|0):(m=m/y|0,p=p/t|0),I>0?(_=_/y|0,g=g/t|0):(g=g/y|0,_=_/t|0);const i=f.ea-n.A.Sa,s=f.na-n.A.Ma;i>p&&i_&&s>16,w=w*L-c*b>>16,c=n),c+=o,u+=l,w+=a,n=w*h+c*r>>16,w=w*r-c*h>>16,c=n,n=u*s-w*i>>16,w=u*i+w*s>>16,u=n,f.uM&&(f.uM[e]=w-d),w>=50&&f.cM&&f.fM?(f.cM[e]=O+((c<<9)/w|0),f.fM[e]=v+((u<<9)/w|0)):f.cM&&(f.cM[e]=-5e3,C=!0),(C||this.NS>0)&&f.dM&&f.wM&&f.yM&&(f.dM[e]=c,f.wM[e]=u,f.yM[e]=w)}try{this.zM(C,T,c)}catch(t){}}zM(t,i,s,h=!1){f.bM&&(this.YM=-1,this.VM=-1);for(let t=0;te.A.uL||a>e.A.uL||c>e.A.uL),f.pM&&f.AM){const t=((y+A+p)/3|0)+this.BM;f.pM[t][f.AM[t]++]=h,f.bM&&this.jM(f.ea,f.na,u,d,w,l,a,c)&&this.VM=0;t--){const i=f.AM[t];if(!(i<=0)&&f.pM){const s=f.pM[t];for(let t=0;t=0;t--){const i=f.AM[t];if(i>0&&f.pM){const s=f.pM[t];for(let h=0;h0||f.mM[2]>0)&&(n=(f._M[1]+f._M[2])/(f.mM[1]+f.mM[2])|0);let r=0;f.mM&&f._M&&(f.mM[3]>0||f.mM[4]>0)&&(r=(f._M[3]+f._M[4])/(f.mM[3]+f.mM[4])|0);let o=0;if(f.mM&&f._M&&(f.mM[6]>0||f.mM[8]>0)&&(o=(f._M[6]+f._M[8])/(f.mM[6]+f.mM[8])|0),f.mM&&f.IM){let t,i=0,s=f.mM[10],e=f.IM[10],l=f.EM;i===s&&(i=0,s=f.mM[11],e=f.IM[11],l=f.gM),t=in;)try{this.ZM(e[i++],h),i===s&&e!==f.IM[11]&&(i=0,s=f.mM[11],e=f.IM[11],l=f.gM),t=ir;)try{this.ZM(e[i++],h),i===s&&e!==f.IM[11]&&(i=0,s=f.mM[11],e=f.IM[11],l=f.gM),t=io;)try{this.ZM(e[i++],h),i===s&&e!==f.IM[11]&&(i=0,s=f.mM[11],e=f.IM[11],l=f.gM),t=i>2,r=this.NM[i],o=this.PM[i],l=this.FM[i];n.A.pL(f.cM[s],f.cM[h],f.cM[e],f.fM[s],f.fM[h],f.fM[e],this.SM[t],this.MM[t],this.kM[t],f.dM[r],f.wM[r],f.yM[r],f.dM[o],f.dM[l],f.wM[o],f.wM[l],f.yM[o],f.yM[l],this.A_[t])}else if(3===r&&this.Vb&&this.A_&&this.SM&&f.cM&&f.fM&&f.dM&&f.wM&&f.yM){const i=this.Vb[t]>>2,r=this.NM[i],o=this.PM[i],l=this.FM[i];n.A.pL(f.cM[s],f.cM[h],f.cM[e],f.fM[s],f.fM[h],f.fM[e],this.SM[t],this.SM[t],this.SM[t],f.dM[r],f.wM[r],f.yM[r],f.dM[o],f.dM[l],f.wM[o],f.wM[l],f.yM[o],f.yM[l],this.A_[t])}}qM(t,i=!1){let s=0;if(f.yM){const i=n.A.Sa,h=n.A.Ma,e=this.Xb[t],r=this.zb[t],o=this.jb[t],l=f.yM[e],a=f.yM[r],c=f.yM[o];if(l>=50&&f.cM&&f.fM&&this.SM)f.CM[s]=f.cM[e],f.TM[s]=f.fM[e],f.OM[s++]=this.SM[t];else if(f.dM&&f.wM&&this.SM){const u=f.dM[e],d=f.wM[e],w=this.SM[t];if(c>=50&&this.kM){const e=(50-l)*n.A.IS[c-l];f.CM[s]=i+((u+((f.dM[o]-u)*e>>16)<<9)/50|0),f.TM[s]=h+((d+((f.wM[o]-d)*e>>16)<<9)/50|0),f.OM[s++]=w+((this.kM[t]-w)*e>>16)}if(a>=50&&this.MM){const e=(50-l)*n.A.IS[a-l];f.CM[s]=i+((u+((f.dM[r]-u)*e>>16)<<9)/50|0),f.TM[s]=h+((d+((f.wM[r]-d)*e>>16)<<9)/50|0),f.OM[s++]=w+((this.MM[t]-w)*e>>16)}}if(a>=50&&f.cM&&f.fM&&this.MM)f.CM[s]=f.cM[r],f.TM[s]=f.fM[r],f.OM[s++]=this.MM[t];else if(f.dM&&f.wM&&this.MM){const u=f.dM[r],d=f.wM[r],w=this.MM[t];if(l>=50&&this.SM){const r=(50-a)*n.A.IS[l-a];f.CM[s]=i+((u+((f.dM[e]-u)*r>>16)<<9)/50|0),f.TM[s]=h+((d+((f.wM[e]-d)*r>>16)<<9)/50|0),f.OM[s++]=w+((this.SM[t]-w)*r>>16)}if(c>=50&&this.kM){const e=(50-a)*n.A.IS[c-a];f.CM[s]=i+((u+((f.dM[o]-u)*e>>16)<<9)/50|0),f.TM[s]=h+((d+((f.wM[o]-d)*e>>16)<<9)/50|0),f.OM[s++]=w+((this.kM[t]-w)*e>>16)}}if(c>=50&&f.cM&&f.fM&&this.kM)f.CM[s]=f.cM[o],f.TM[s]=f.fM[o],f.OM[s++]=this.kM[t];else if(f.dM&&f.wM&&this.kM){const u=f.dM[o],d=f.wM[o],w=this.kM[t];if(a>=50&&this.MM){const e=(50-c)*n.A.IS[a-c];f.CM[s]=i+((u+((f.dM[r]-u)*e>>16)<<9)/50|0),f.TM[s]=h+((d+((f.wM[r]-d)*e>>16)<<9)/50|0),f.OM[s++]=w+((this.MM[t]-w)*e>>16)}if(l>=50&&this.SM){const r=(50-c)*n.A.IS[l-c];f.CM[s]=i+((u+((f.dM[e]-u)*r>>16)<<9)/50|0),f.TM[s]=h+((d+((f.wM[e]-d)*r>>16)<<9)/50|0),f.OM[s++]=w+((this.SM[t]-w)*r>>16)}}}const h=f.CM[0],r=f.CM[1],o=f.CM[2],l=f.TM[0],a=f.TM[1],c=f.TM[2];if(!((h-r)*(c-a)-(l-a)*(o-r)<=0))if(n.A.fL=!1,3===s){let s;if((h<0||r<0||o<0||h>e.A.uL||r>e.A.uL||o>e.A.uL)&&(n.A.fL=!0),s=this.Vb?3&this.Vb[t]:0,i)n.A.gd(h,r,l,a,f.OM[0]),n.A.gd(r,o,a,c,f.OM[1]),n.A.gd(o,h,c,l,f.OM[2]);else if(0===s)n.A.wL(h,r,o,l,a,c,f.OM[0],f.OM[1],f.OM[2]);else if(1===s&&this.SM)n.A.MS(h,r,o,l,a,c,n.A.palette[this.SM[t]]);else if(2===s&&this.Vb&&this.A_&&f.dM&&f.wM&&f.yM){const i=this.Vb[t]>>2,s=this.NM[i],e=this.PM[i],u=this.FM[i];n.A.pL(h,r,o,l,a,c,f.OM[0],f.OM[1],f.OM[2],f.dM[s],f.wM[s],f.yM[s],f.dM[e],f.dM[u],f.wM[e],f.wM[u],f.yM[e],f.yM[u],this.A_[t])}else if(3===s&&this.Vb&&this.A_&&this.SM&&f.dM&&f.wM&&f.yM){const i=this.Vb[t]>>2,s=this.NM[i],e=this.PM[i],u=this.FM[i];n.A.pL(h,r,o,l,a,c,this.SM[t],this.SM[t],this.SM[t],f.dM[s],f.wM[s],f.yM[s],f.dM[e],f.dM[u],f.wM[e],f.wM[u],f.yM[e],f.yM[u],this.A_[t])}}else if(4===s){let s;if((h<0||r<0||o<0||h>e.A.uL||r>e.A.uL||o>e.A.uL||f.CM[3]<0||f.CM[3]>e.A.uL)&&(n.A.fL=!0),s=this.Vb?3&this.Vb[t]:0,i)n.A.gd(h,r,l,a,f.OM[0]),n.A.gd(r,o,a,c,f.OM[1]),n.A.gd(o,f.CM[3],c,f.TM[3],f.OM[2]),n.A.gd(f.CM[3],h,f.TM[3],l,f.OM[3]);else if(0===s)n.A.wL(h,r,o,l,a,c,f.OM[0],f.OM[1],f.OM[2]),n.A.wL(h,o,f.CM[3],l,c,f.TM[3],f.OM[0],f.OM[2],f.OM[3]);else if(1===s){if(this.SM){const i=n.A.palette[this.SM[t]];n.A.MS(h,r,o,l,a,c,i),n.A.MS(h,o,f.CM[3],l,c,f.TM[3],i)}}else if(2===s&&this.Vb&&this.A_&&f.dM&&f.wM&&f.yM){const i=this.Vb[t]>>2,s=this.NM[i],e=this.PM[i],u=this.FM[i];n.A.pL(h,r,o,l,a,c,f.OM[0],f.OM[1],f.OM[2],f.dM[s],f.wM[s],f.yM[s],f.dM[e],f.dM[u],f.wM[e],f.wM[u],f.yM[e],f.yM[u],this.A_[t]),n.A.pL(h,o,f.CM[3],l,c,f.TM[3],f.OM[0],f.OM[2],f.OM[3],f.dM[s],f.wM[s],f.yM[s],f.dM[e],f.dM[u],f.wM[e],f.wM[u],f.yM[e],f.yM[u],this.A_[t])}else if(3===s&&this.Vb&&this.A_&&this.SM&&f.dM&&f.wM&&f.yM){const i=this.Vb[t]>>2,s=this.NM[i],e=this.PM[i],u=this.FM[i];n.A.pL(h,r,o,l,a,c,this.SM[t],this.SM[t],this.SM[t],f.dM[s],f.wM[s],f.yM[s],f.dM[e],f.dM[u],f.wM[e],f.wM[u],f.yM[e],f.yM[u],this.A_[t]),n.A.pL(h,o,f.CM[3],l,c,f.TM[3],this.SM[t],this.SM[t],this.SM[t],f.dM[s],f.wM[s],f.yM[s],f.dM[e],f.dM[u],f.wM[e],f.wM[u],f.yM[e],f.yM[u],this.A_[t])}}}KM(t,i,s,h,e){if(!h)return;const r=h.length;if(0===e){let e=0;f.Hn=0,f.vM=0,f.Wn=0;for(let t=0;t0?(f.Hn=(f.Hn/e|0)+t,f.vM=(f.vM/e|0)+i,f.Wn=(f.Wn/e|0)+s):(f.Hn=t,f.vM=i,f.Wn=s)}else if(1===e)for(let e=0;e=this.dC.length)continue;const r=this.dC[n];if(r)for(let h=0;h=this.dC.length)continue;const o=this.dC[r];if(o)for(let h=0;h>16;this.aC[e]=this.aC[e]*u-this.oC[e]*c>>16,this.oC[e]=t}if(0!==r){c=n.A.sin[r],u=n.A.cos[r];const t=this.aC[e]*u-this.lC[e]*c>>16;this.lC[e]=this.aC[e]*c+this.lC[e]*u>>16,this.aC[e]=t}if(0!==l){c=n.A.sin[l],u=n.A.cos[l];const t=this.lC[e]*c+this.oC[e]*u>>16;this.lC[e]=this.lC[e]*u-this.oC[e]*c>>16,this.oC[e]=t}this.oC[e]+=f.Hn,this.aC[e]+=f.vM,this.lC[e]+=f.Wn}}else if(3===e)for(let e=0;e=this.dC.length)continue;const r=this.dC[n];if(r)for(let h=0;h=this.uC.length)continue;const e=this.uC[s];if(e)for(let i=0;i255&&(this.DM[s]=255)}}}XM(){this.AC=0,this.bO=0,this.GO=0,this.PO=999999,this.FO=-999999,this.BO=-99999,this.UO=99999;for(let t=0;tthis.FO&&(this.FO=i),hthis.BO&&(this.BO=h),-s>this.AC&&(this.AC=-s),s>this.GO&&(this.GO=s);const e=i*i+h*h;e>this.bO&&(this.bO=e)}this.bO=0|Math.sqrt(this.bO),this.BM=0|Math.sqrt(this.bO*this.bO+this.AC*this.AC),this.UM=this.BM+(0|Math.sqrt(this.bO*this.bO+this.GO*this.GO))}jM(t,i,s,h,e,n,r,o){return!(is&&i>h&&i>e)&&(!(t{s.d(i,{A:()=>o});var h=s(8950),e=s(1069),n=s(4474),r=s(7854);class o extends n.A{Mc;width;height;jc;Zc;oa;Nd;constructor(t,i){super(),this.Mc=new Int32Array(t*i),this.width=this.oa=t,this.height=this.Nd=i,this.jc=this.Zc=0}static Xc=async(t,i)=>{const s=t.read(i+'.dat');if(!s)throw new Error(`${i} jpeg not found!`);const h=await(async t=>{255!==t[0]&&(t[0]=255),URL.revokeObjectURL(r.eS.src),r.eS.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>r.eS.onload=()=>t())),r.hS.clearRect(0,0,r.nS.width,r.nS.height);const i=r.eS.naturalWidth,s=r.eS.naturalHeight;return r.nS.width=i,r.nS.height=s,r.hS.drawImage(r.eS,0,0),r.hS.getImageData(0,0,i,s)})(s),e=new o(h.width,h.height),n=new Uint32Array(h.data.buffer),l=e.Mc;for(let t=0;t>24&255)<<24|(255&i)<<16|(i>>8&255)<<8|i>>16&255}return e};static Ic=(t,i,s=0)=>{const h=new e.A(t.read(i+'.dat')),n=new e.A(t.read('index.dat'));n.ft=h.ct;const r=n.ct,l=n.ct,a=[],c=n.CA-1;for(let t=0;th.length||n.ft>n.length)throw new Error;const f=n.CA,u=n.CA,d=n.ct,w=n.ct,y=new o(d,w);y.jc=f,y.Zc=u,y.oa=r,y.Nd=l;const A=n.CA;if(0===A){const t=y.width*y.height;for(let i=0;ih.A.bottom&&(n-=i+n-h.A.bottom),th.A.right){const i=t+r-h.A.right;r-=i,l+=i,o+=i}r>0&&n>0&&this.JM(r,n,this.Mc,e,l,h.A.Mc,s,o)}ra(t,i,s){i|=0,s|=0;let e=(i+=this.jc)+(s+=this.Zc)*h.A.RC,n=0,r=this.height,o=this.width,l=h.A.RC-o,a=0;if(sh.A.bottom&&(r-=s+r-h.A.bottom),ih.A.right){const t=i+o-h.A.right;o-=t,a+=t,l+=t}o>0&&r>0&&this.QM(o,r,this.Mc,n,a,h.A.Mc,e,l,t)}vc(t,i){t|=0,i|=0;let s=(t+=this.jc)+(i+=this.Zc)*h.A.RC,e=0,n=this.height,r=this.width,o=h.A.RC-r,l=0;if(ih.A.bottom&&(n-=i+n-h.A.bottom),th.A.right){const i=t+r-h.A.right;r-=i,l+=i,o+=i}r>0&&n>0&&this.tk(r,n,this.Mc,e,l,h.A.Mc,s,o)}Tc(){const t=this.Mc,i=this.width,s=this.height;for(let h=0;h>16&255;n+=t,n<1?n=1:n>255&&(n=255);let r=e>>8&255;r+=i,r<1?r=1:r>255&&(r=255);let o=255&e;o+=s,o<1?o=1:o>255&&(o=255),this.Mc[h]=(n<<16)+(r<<8)+o}}}PC(t,i,s,e){t|=0,i|=0,s|=0,e|=0;try{const n=this.width;let r=0,o=0;const l=this.oa,a=this.Nd,c=(l<<16)/s|0,f=(a<<16)/e|0;t+=(this.jc*s+l-1)/l|0,i+=(this.Zc*e+a-1)/a|0,this.jc*s%l!=0&&(r=(l-this.jc*s%l<<16)/s|0),this.Zc*e%a!=0&&(o=(a-this.Zc*e%a<<16)/e|0),s=s*(this.width-(r>>16))/l|0,e=e*(this.height-(o>>16))/a|0;let u=t+i*h.A.RC,d=h.A.RC-s;if(ih.A.bottom&&(e-=i+e-h.A.bottom),th.A.right){const i=t+s-h.A.right;s-=i,d+=i}this.scale(s,e,this.Mc,r,o,h.A.Mc,d,u,n,c,f)}catch(t){console.error('error in sprite clipping routine')}}Sd(t,i,s,e,n,r,o,l,a,c){t|=0,i|=0,s|=0,e|=0;try{const f=-s/2|0,u=-e/2|0,d=65536*Math.sin(a/326.11)|0,w=65536*Math.cos(a/326.11)|0,y=d*c>>8,A=w*c>>8;let p=(o<<16)+u*y+f*A,m=u*A-f*y+(l<<16),I=t+i*h.A.RC;for(let t=0;t>16)+(o>>16)*this.width],e+=A,o-=y;p+=y,m+=A,I+=h.A.RC}}catch(t){}}Dd(t,i,s){t|=0,i|=0;let e=(t+=this.jc)+(i+=this.Zc)*h.A.RC,n=0,r=this.height,o=this.width,l=h.A.RC-o,a=0;if(ih.A.bottom&&(r-=i+r-h.A.bottom),th.A.right){const i=t+o-h.A.right;o-=i,a+=i,l+=i}o>0&&r>0&&this.ik(o,r,this.Mc,a,n,h.A.Mc,e,l,s.Mc)}scale(t,i,s,h,e,n,r,o,l,a,c){try{const f=h;for(let u=-i;u<0;u++){const i=(e>>16)*l;for(let e=-t;e<0;e++){const t=s[(h>>16)+i];0===t?o++:n[o++]=t,h+=a}e+=c,h=f,o+=r}}catch(t){console.error('error in plot_scale')}}tk(t,i,s,h,e,n,r,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++)n[r++]=s[h++],n[r++]=s[h++],n[r++]=s[h++],n[r++]=s[h++];for(let i=t;i<0;i++)n[r++]=s[h++];r+=o,h+=e}}QM(t,i,s,h,e,n,r,o,l){const a=256-l;for(let c=-i;c<0;c++){for(let i=-t;i<0;i++){const t=s[h++];if(0===t)r++;else{const i=n[r];n[r++]=((16711935&t)*l+(16711935&i)*a&4278255360)+((65280&t)*l+(65280&i)*a&16711680)>>8}}r+=o,h+=e}}JM(t,i,s,h,e,n,r,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=s[h++];0===t?r++:n[r++]=t,t=s[h++],0===t?r++:n[r++]=t,t=s[h++],0===t?r++:n[r++]=t,t=s[h++],0===t?r++:n[r++]=t}for(let i=t;i<0;i++){const t=s[h++];0===t?r++:n[r++]=t}r+=o,h+=e}}ik(t,i,s,h,e,n,r,o,l){const a=-(t>>2);t=-(3&t);for(let c=-i;c<0;c++){for(let t=a;t<0;t++){let t=s[e++];0!==t&&0===l[r]?n[r++]=t:r++,t=s[e++],0!==t&&0===l[r]?n[r++]=t:r++,t=s[e++],0!==t&&0===l[r]?n[r++]=t:r++,t=s[e++],0!==t&&0===l[r]?n[r++]=t:r++}for(let i=t;i<0;i++){const t=s[e++];0!==t&&0===l[r]?n[r++]=t:r++}r+=o,e+=h}}}},1673:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(8950),e=s(1069),n=s(4474);class r extends n.A{Mc;width;height;jc;Zc;oa;Nd;palette;constructor(t,i,s){super(),this.Mc=new Int8Array(t*i),this.width=this.oa=t,this.height=this.Nd=i,this.jc=this.Zc=0,this.palette=s}static Ic=(t,i,s=0)=>{const h=new e.A(t.read(i+'.dat')),n=new e.A(t.read('index.dat'));n.ft=h.ct;const o=n.ct,l=n.ct,a=n.CA,c=new Int32Array(a);for(let t=1;th.length||n.ft>n.length)throw new Error;const f=n.CA,u=n.CA,d=n.ct,w=n.ct,y=new r(d,w,c);y.jc=f,y.Zc=u,y.oa=o,y.Nd=l;const A=y.Mc,p=n.CA;if(0===p){const t=y.width*y.height;for(let i=0;ih.A.bottom&&(n-=i+n-h.A.bottom),th.A.right){const i=t+r-h.A.right;r-=i,l+=i,o+=i}r>0&&n>0&&this.sk(r,n,this.Mc,e,l,h.A.Mc,s,o)}Tc(){const t=this.Mc,i=this.width,s=this.height;for(let h=0;h>16&255;e+=t,e<0?e=0:e>255&&(e=255);let n=this.palette[h]>>8&255;n+=i,n<0?n=0:n>255&&(n=255);let r=255&this.palette[h];r+=s,r<0?r=0:r>255&&(r=255),this.palette[h]=(e<<16)+(n<<8)+r}}LS(){this.oa|=0,this.Nd|=0,this.oa/=2,this.Nd/=2,this.oa|=0,this.Nd|=0;const t=new Int8Array(this.oa*this.Nd);let i=0;for(let s=0;s>1)+(s+this.Zc>>1)*this.oa]=this.Mc[i++];this.Mc=t,this.width=this.oa,this.height=this.Nd,this.jc=0,this.Zc=0}PC(){if(this.width===this.oa&&this.height===this.Nd)return;const t=new Int8Array(this.oa*this.Nd);let i=0;for(let s=0;s>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=s[h++];0===t?r++:n[r++]=this.palette[255&t],t=s[h++],0===t?r++:n[r++]=this.palette[255&t],t=s[h++],0===t?r++:n[r++]=this.palette[255&t],t=s[h++],0===t?r++:n[r++]=this.palette[255&t]}for(let i=t;i<0;i++){const t=s[h++];0===t?r++:n[r++]=this.palette[255&t]}r+=o,h+=e}}clip(t,i,s,e){try{const n=this.width;this.height;let r=0,o=0;const l=this.oa,a=this.Nd,c=(l<<16)/s|0,f=(a<<16)/e|0;t=t+(this.jc*s+l-1)/l|0,i=i+(this.Zc*e+a-1)/a|0,this.jc*s%l!=0&&(r=(l-this.jc*s%l<<16)/s|0),this.Zc*e%a!=0&&(o=(a-this.Zc*e%a<<16)/e|0),s=s*(this.width-(r>>16))/l|0,e=e*(this.height-(o>>16))/a|0;let u,d=t+i*h.A.RC,w=h.A.RC-s;ih.A.bottom&&(e-=i+e-h.A.bottom),th.A.right&&(u=t+s-h.A.right,s-=u,w+=u),this.hk(h.A.Mc,this.Mc,this.palette,r,o,d,w,s,e,c,f,n)}catch(t){console.log('error in sprite clipping routine')}}hk(t,i,s,h,e,n,r,o,l,a,c,f){try{const u=h;for(let d=-l;d<0;d++){const l=(e>>16)*f;for(let e=-o;e<0;e++){const e=i[(h>>16)+l];0==e?n++:t[n++]=s[255&e],h+=a}e+=c,h=u,n+=r}}catch(t){console.log('error in plot_scale')}}}},2682:(t,i,s)=>{s.d(i,{A:()=>l});var h=s(8950),e=s(1069),n=s(4474);class r{seed;constructor(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}ek(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}mA(){return this.next(32)}next(t){return this.seed=0x5deece66dn*this.seed+0xbn&(1n<<48n)-1n,Number(this.seed)>>>48-t}}var o=s(9298);class l extends n.A{static ef='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!"£$%^&*()-_=+[{]};:\'@#~,<.>/?\\| ';static nk=[];static{const t=navigator.userAgent.includes('Capacitor');for(let i=0;i<256;i++){let s=l.ef.indexOf(String.fromCharCode(i));t&&s>=63&&s--,-1===s&&(s=74),l.nk[i]=s}}rk=[];lk=new Int32Array(94);ak=new Int32Array(94);ck=new Int32Array(94);fk=new Int32Array(94);uk=new Int32Array(95);dk=new Int32Array(256);random=new r(BigInt(Date.now()));height=0;static Ic=(t,i)=>{const s=new e.A(t.read(i+'.dat')),h=new e.A(t.read('index.dat'));h.ft=s.ct+4;const n=h.CA;n>0&&(h.ft+=3*(n-1));const r=new l;for(let t=0;t<94;t++){r.ck[t]=h.CA,r.fk[t]=h.CA;const i=r.lk[t]=h.ct,e=r.ak[t]=h.ct,n=h.CA,o=i*e;if(r.rk[t]=new Int8Array(o),0===n)for(let h=0;hr.height&&(r.height=e),r.ck[t]=1,r.uk[t]=i+2;{let s=0;for(let h=e/7|0;h=h.A.bottom&&(n-=s+n+1-h.A.bottom),i=h.A.right){const t=i+e+1-h.A.right;e-=t,a+=t,l+=t}e>0&&n>0&&this.pk(e,n,t,c,a,h.A.Mc,o,l,r)}Ak(t,i,s,e,n,r,o){s|=0,e|=0;let l=(t|=0)+(i|=0)*h.A.RC,a=h.A.RC-s,c=0,f=0;if(i=h.A.bottom&&(e-=i+e+1-h.A.bottom),t=h.A.right){const i=t+s+1-h.A.right;s-=i,c+=i,a+=i}s>0&&e>0&&this.mk(s,e,h.A.Mc,l,a,o,f,c,n,r)}pk(t,i,s,h,e,n,r,o,l){const a=-((t|=0)>>2);t=-(3&t);for(let c=-(i|=0);c<0;c++){for(let t=a;t<0;t++)0===s[h++]?r++:n[r++]=l,0===s[h++]?r++:n[r++]=l,0===s[h++]?r++:n[r++]=l,0===s[h++]?r++:n[r++]=l;for(let i=t;i<0;i++)0===s[h++]?r++:n[r++]=l;r+=o,h+=e}}mk(t,i,s,h,e,n,r,o,l,a){t|=0;const c=((16711935&l)*a&4278255360)+((65280&l)*a&16711680)>>8,f=256-a;for(let l=-(i|=0);l<0;l++){for(let i=-t;i<0;i++)if(0===n[r++])h++;else{const t=s[h];s[h++]=(((16711935&t)*f&4278255360)+((65280&t)*f&16711680)>>8)+c}h+=e,r+=o}}yk(t){return'red'===t?o.A.RED:'gre'===t?o.A.GREEN:'blu'===t?o.A.BLUE:'yel'===t?o.A.fa:'cya'===t?o.A.$c:'mag'===t?o.A.Jc:'whi'===t?o.A.Kl:'bla'===t?o.A.ca:'lre'===t?o.A.rS:'dre'===t?o.A.bd:'dbl'===t?o.A.vd:'or1'===t?o.A.oS:'or2'===t?o.A.lS:'or3'===t?o.A.aS:'gr1'===t?o.A.cS:'gr2'===t?o.A.fS:'gr3'===t?o.A.uS:o.A.ca}split(t,i){if(0===t.length)return[t];const s=[];for(;t.length>0;){if(this.xu(t)<=i&&-1===t.indexOf('|')){s.push(t);break}let h=t.length;for(let s=0;si)break;h=s}else if('|'===t[s]){h=s;break}s.push(t.substring(0,h)),t=t.substring(h+1)}return s}}},1183:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(8950),e=s(7854);class n{Ik;width;height;Ek;gk;Mc;constructor(t,i,s=e.Il){this.Ek=s,this.Ik=this.Ek.getImageData(0,0,t,i),this.gk=new Uint32Array(this.Ik.data.buffer),this.Mc=new Int32Array(t*i),this.width=t,this.height=i,this.bind()}clear(){this.Mc.fill(0)}bind(){h.A.bind(this.Mc,this.width,this.height)}draw(t,i){this.#t(),this.Ek.putImageData(this.Ik,t,i)}#t(){const t=this.Mc.length,i=this.Mc,s=this.gk;for(let h=0;h>16&255|(t>>8&255)<<8|(255&t)<<16|4278190080}}}},3955:(t,i,s)=>{s.d(i,{A:()=>h});class h{static RA=150;static qf=108;static jf=70;static Ef=81;static bf=189;static iy=7;static Iw=88;static yw=30;static Cw=176;static fw=220;static ey=66;static Zw=17;static xw=2;static Jw=238;static By=233;static cu=146;static Df=215;static Zf=236;static pE=85;static HI=219;static Uw=140;static Ww=40;static Hw=200;static Bw=178;static Gw=247;static hy=138;static Ow=239;static _w=194;static mw=8;static Ew=27;static gw=113;static Tw=100;static Pw=134;static kw=202;static Lw=245;static Yw=172;static oy=96;static sy=97;static ny=116;static Fw=9;static cw=75;static ow=164;static Dw=53;static Nw=185;static rw=206;static Iy=177;static wy=248;static Aw=195;static pw=71;static ww=133;static uw=157;static dw=211;static Sw=48;static Rw=130;static $w=31;static ty=59;static jw=212;static Qw=38;static qw=6;static zw=155;static Mw=235;static AA=231;static Vy=237;static su=175;static iI=93;static xy=190;static tI=165;static Sf=159;static $y=171;static qy=79;static Sy=52;static Yy=244;static Gy=148;static Zy=11;static jy=118;static Xy=4;static zy=158;static Qm=181}},3554:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(6666),e=s(1982),n=s(9234);class r{_k;Ck;Tk;closed=!1;Ok=!1;static rf=async t=>await new Promise(((i,s)=>{const h=t.host.startsWith('https'),e=h?'wss':'ws',n=t.host.substring(t.host.indexOf('//')+2),r=h?t.port+2:t.port+1,o=new WebSocket(`${e}://${n}:${r}`,'binary');o.addEventListener('open',(()=>{console.log('connection open!'),i(o)})),o.addEventListener('error',(()=>{console.log('connection error!'),s(o)}))}));constructor(t){t.onclose=this.onclose,t.onerror=this.onerror,this.Ck=new a(t,5e3),this.Tk=new o(t,5e3),this._k=t}get host(){return this._k.url.split('/')[2]}get port(){return parseInt(this._k.url.split(':')[2],10)}get available(){return this.closed?0:this.Ck.available}write(t,i){this.Tk.write(t,i)}async read(){return this.closed?0:this.Ck.vk()??await this.Ck.bk()}async lf(t,i,s){if(!this.closed)for(;s>0;){const h=this.Ck.Lk(t,i,s)??await this.Ck.Rk(t,i,s);if(h.length<=0)throw new Error('EOF');i+=h.length,s-=h.length}}close(){this.closed=!0,this._k.close(),this.Ck.close(),this.Tk.close(),console.log('connection close!'),this.Ok&&console.log('connection error!')}onclose=t=>{this.closed||this.close()};onerror=t=>{this.closed||(this.Ok=!0,this.close())}}class o{_k;Sk;closed=!1;Ok=!1;constructor(t,i){this._k=t,this.Sk=i}write(t,i){if(!this.closed){if(this.Ok)throw this.Ok=!1,new Error('Error in writer thread');if(i>this.Sk||t.length>this.Sk)throw new Error('buffer overflow');try{this._k.send(t.subarray(0,i))}catch(t){this.Ok=!0}}}close(){this.closed=!0}}class l extends e.A{aI;position;constructor(t){super(),this.aI=t,this.position=0}get available(){return this.aI.length-this.position}get read(){return this.aI[this.position++]}get Mk(){return this.aI.length}}class a{Sk;queue=new h.A;event=null;kk=null;total=0;closed=!1;constructor(t,i){this.Sk=i,t.binaryType='arraybuffer',t.onmessage=this.onmessage}get available(){return this.total}onmessage=t=>{if(this.closed)throw new Error('WebSocketReader is closed!');const i=new l(new Uint8Array(t.data));if(this.event?this.queue.LE(i):this.event=i,this.total+=i.Mk,this.kk&&(this.kk(this.event),this.kk=null,this.total>this.Sk))throw new Error('buffer overflow')};xk(){return this.event&&this.event.available>0?this.event.read:null}async Dk(t){for(this.event=this.queue.iL();this.totalthis.kk=t)),(0,n.wl)(2e3).then((()=>{if(this.closed)throw new Error('WebSocketReader closed while reading.')}))]);return this.event?this.event.read:this.Dk(t)}Lk(t,i,s){if(this.closed)throw new Error('WebSocketReader is closed!');if(!(this.event&&this.event.available>=s))return null;for(;s>0;){const h=this.xk();if(null===h)throw new Error('EOF - tried to read a fast byte when there was not enough immediate bytes.');t[i++]=h,this.total--,s--}return t}async Rk(t,i,s){if(this.closed)throw new Error('WebSocketReader is closed!');for(;s>0;)t[i++]=this.xk()??await this.Dk(s),this.total--,s--;return t}vk(){if(this.closed)throw new Error('WebSocketReader is closed!');const t=this.xk();return null===t?null:(this.total--,t)}async bk(){if(this.closed)throw new Error('WebSocketReader is closed!');const t=await this.Dk(1);return this.total--,t}close(){this.closed=!0,this.kk=null,this.total=0,this.event=null,this.queue.clear()}}},296:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(6666),e=s(1982),n=s(9234);class r{yt;ol;Nk;closed=!1;Ok=!1;constructor(t,i){this.yt=t,this.yt.onerror=this.onerror,this.yt.onmessageerror=this.onmessageerror,this.ol=new a(5e3),this.Nk=new o(this.yt,5e3,i),this.yt.postMessage({type:'connection',id:i})}get available(){return this.closed?0:this.ol.available}write(t,i){this.Nk.write(t,i)}async read(){return this.closed?0:this.ol.vk()??await this.ol.bk()}async lf(t,i,s){if(!this.closed)for(;s>0;){const h=this.ol.Lk(t,i,s)??await this.ol.Rk(t,i,s);if(h.length<=0)throw new Error('EOF');i+=h.length,s-=h.length}}close(){this.closed=!0,this.ol.close(),this.Nk.close(),console.log('connection close!'),this.Ok&&console.log('connection error!')}onerror=t=>{this.closed||(this.Ok=!0,this.close())};onmessageerror=t=>{this.closed||(this.Ok=!0,this.close())}}class o{yt;Sk;At;closed=!1;Ok=!1;constructor(t,i,s){this.yt=t,this.Sk=i,this.At=s}write(t,i){if(!this.closed){if(this.Ok)throw this.Ok=!1,new Error('Error in writer thread');if(i>this.Sk||t.length>this.Sk)throw new Error('buffer overflow');try{this.yt.postMessage({type:'data',data:t.subarray(0,i),id:this.At})}catch(t){this.Ok=!0}}}close(){this.closed=!0}}class l extends e.A{aI;position;constructor(t){super(),this.aI=t,this.position=0}get available(){return this.aI.length-this.position}get read(){return this.aI[this.position++]}get Mk(){return this.aI.length}}class a{Sk;queue=new h.A;event=null;kk=null;total=0;closed=!1;constructor(t){this.Sk=t}get available(){return this.total}onmessage=t=>{const i='string'==typeof t.data?JSON.parse(t.data):t;if('data'!==i.type)return void console.error('Unexpected message type: ',i.type);if(this.closed)throw new Error('WorkerReader is closed!');const s=new l(new Uint8Array(i.data));if(this.event?this.queue.LE(s):this.event=s,this.total+=s.Mk,this.kk&&(this.kk(this.event),this.kk=null,this.total>this.Sk))throw new Error('buffer overflow')};xk(){return this.event&&this.event.available>0?this.event.read:null}async Dk(t){for(this.event=this.queue.iL();this.totalthis.kk=t)),(0,n.wl)(2e3).then((()=>{if(this.closed)throw new Error('WorkerReader closed while reading.')}))]);return this.event?this.event.read:this.Dk(t)}Lk(t,i,s){if(this.closed)throw new Error('WorkerReader is closed!');if(!(this.event&&this.event.available>=s))return null;for(;s>0;){const h=this.xk();if(null===h)throw new Error('EOF - tried to read a fast byte when there was not enough immediate bytes.');t[i++]=h,this.total--,s--}return t}async Rk(t,i,s){if(this.closed)throw new Error('WorkerReader is closed!');for(;s>0;)t[i++]=this.xk()??await this.Dk(s),this.total--,s--;return t}vk(){if(this.closed)throw new Error('WorkerReader is closed!');const t=this.xk();return null===t?null:(this.total--,t)}async bk(){if(this.closed)throw new Error('WorkerReader is closed!');const t=await this.Dk(1);return this.total--,t}close(){this.closed=!0,this.kk=null,this.total=0,this.event=null,this.queue.clear()}}},4544:(t,i,s)=>{s.d(i,{A:()=>h});class h{db;constructor(t){t.onerror=this.onerror,t.onclose=this.onclose,this.db=t}static openDatabase=async()=>await new Promise(((t,i)=>{const s=indexedDB.open('lostcity',1);s.onsuccess=i=>{const s=i.target;console.log('database success!'),t(s.result)},s.onupgradeneeded=t=>{t.target.result.createObjectStore('cache')},s.onerror=t=>{const s=t.target;console.error('database error!: ',s.error),i(s.result)}}));cl=async t=>await new Promise((i=>{const s=this.db.transaction('cache','readonly').objectStore('cache').get(t);s.onsuccess=()=>{i(s.result)},s.onerror=t=>{i(void 0)}}));yl=async(t,i)=>await new Promise(((s,h)=>{const e=this.db.transaction('cache','readwrite').objectStore('cache').put(i,t);e.onsuccess=()=>{s()},e.onerror=t=>{h()}}));onclose=t=>{console.log('database close!')};onerror=t=>{console.log('database error!')};tt=t=>{const i=t.trim();let s=0;for(let t=0;t='A'&&h<='Z'?s+=h.charCodeAt(0)+1-65:h>='a'&&h<='z'?s+=h.charCodeAt(0)+1-97:h>='0'&&h<='9'&&(s+=h.charCodeAt(0)+27-48)}return s}}},2634:(t,i,s)=>{s.d(i,{A:()=>h});class h{count=0;Pk=new Int32Array(256);Fk=new Int32Array(256);a=0;b=0;c=0;constructor(t){for(let i=0;i>>2,e+=i,s+=h,s^=h<<8,n+=s,h+=e,h^=e>>>16,r+=h,e+=n,e^=n<<10,o+=e,n+=r,n^=r>>>4,t+=n,r+=o,r^=o<<8,i+=r,o+=t,o^=t>>>9,s+=o,t+=i;for(let l=0;l<256;l+=8)t+=this.Pk[l],i+=this.Pk[l+1],s+=this.Pk[l+2],h+=this.Pk[l+3],e+=this.Pk[l+4],n+=this.Pk[l+5],r+=this.Pk[l+6],o+=this.Pk[l+7],t^=i<<11,h+=t,i+=s,i^=s>>>2,e+=i,s+=h,s^=h<<8,n+=s,h+=e,h^=e>>>16,r+=h,e+=n,e^=n<<10,o+=e,n+=r,n^=r>>>4,t+=n,r+=o,r^=o<<8,i+=r,o+=t,o^=t>>>9,s+=o,t+=i,this.Fk[l]=t,this.Fk[l+1]=i,this.Fk[l+2]=s,this.Fk[l+3]=h,this.Fk[l+4]=e,this.Fk[l+5]=n,this.Fk[l+6]=r,this.Fk[l+7]=o;for(let l=0;l<256;l+=8)t+=this.Fk[l],i+=this.Fk[l+1],s+=this.Fk[l+2],h+=this.Fk[l+3],e+=this.Fk[l+4],n+=this.Fk[l+5],r+=this.Fk[l+6],o+=this.Fk[l+7],t^=i<<11,h+=t,i+=s,i^=s>>>2,e+=i,s+=h,s^=h<<8,n+=s,h+=e,h^=e>>>16,r+=h,e+=n,e^=n<<10,o+=e,n+=r,n^=r>>>4,t+=n,r+=o,r^=o<<8,i+=r,o+=t,o^=t>>>9,s+=o,t+=i,this.Fk[l]=t,this.Fk[l+1]=i,this.Fk[l+2]=s,this.Fk[l+3]=h,this.Fk[l+4]=e,this.Fk[l+5]=n,this.Fk[l+6]=r,this.Fk[l+7]=o;this.Uk(),this.count=256}Uk(){this.c++,this.b+=this.c;for(let t=0;t<256;t++){const i=this.Fk[t],s=3&t;let h;0===s?this.a^=this.a<<13:1===s?this.a^=this.a>>>6:2===s?this.a^=this.a<<2:3===s&&(this.a^=this.a>>>16),this.a+=this.Fk[t+128&255],this.Fk[t]=h=this.Fk[i>>>2&255]+this.a+this.b,this.Pk[t]=this.b=this.Fk[h>>>8>>>2&255]+i}}}},1069:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(9234),e=s(6666),n=s(4474);class r extends n.A{static Bk=3988292384;static Gk=new Int32Array(256);static Hk=new Uint32Array(33);static Wk=new e.A;static Yk=new e.A;static Vk=new e.A;static Kk=0;static Xk=0;static zk=0;static{for(let t=0;t<32;t++)r.Hk[t]=(1<>>=1:i=i>>>1^r.Bk;r.Gk[t]=i}}static fl=t=>{let i=4294967295;for(let s=0;s>>8^r.Gk[255&(i^t[s])];return~i};view;data;ft=0;lI=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.ft}static ni=t=>{let i=null;return 0===t&&r.Kk>0?(r.Kk--,i=r.Wk.iL()):1===t&&r.Xk>0?(r.Xk--,i=r.Yk.iL()):2===t&&r.zk>0&&(r.zk--,i=r.Vk.iL()),i?(i.ft=0,i):new r(0===t?new Uint8Array(100):1===t?new Uint8Array(5e3):new Uint8Array(3e4))};release(){this.ft=0,100===this.view.byteLength&&r.Kk<1e3?(r.Wk.LE(this),r.Kk++):5e3===this.view.byteLength&&r.Xk<250?(r.Yk.LE(this),r.Xk++):3e4===this.view.byteLength&&r.zk<50&&(r.Vk.LE(this),r.zk++)}get CA(){return this.view.getUint8(this.ft++)}get gA(){return this.view.getInt8(this.ft++)}get ct(){const t=this.view.getUint16(this.ft);return this.ft+=2,t}get Cp(){const t=this.view.getInt16(this.ft);return this.ft+=2,t}get lt(){const t=this.view.getUint8(this.ft++)<<16|this.view.getUint16(this.ft);return this.ft+=2,t}get ut(){const t=this.view.getInt32(this.ft);return this.ft+=4,t}get af(){const t=this.view.getBigInt64(this.ft);return this.ft+=8,t}get iS(){return this.view.getUint8(this.ft)<128?this.CA-64:this.ct-49152}get vO(){return this.view.getUint8(this.ft)<128?this.CA:this.ct-32768}get NA(){const t=this.view,i=t.byteLength;let s,h='';for(;10!==(s=t.getUint8(this.ft++))&&this.ft>16),this.view.setUint16(this.ft,t),this.ft+=2}p4(t){this.view.setInt32(this.ft,t),this.ft+=4}Zk(t){this.view.setInt32(this.ft,t,!0),this.ft+=4}Dy(t){this.view.setBigInt64(this.ft,t),this.ft+=8}cf(t){const i=this.view,s=t.length;for(let h=0;h>>3}oI(t){let i=this.lI>>>3,s=8-(7&this.lI),h=0;for(this.lI+=t;t>s;s=8)h+=(this.view.getUint8(i++)&r.Hk[s])<>>s-t&r.Hk[t],h}ff(t,i){const s=this.ft;this.ft=0;const e=new Uint8Array(s);this.sp(s,0,e);const n=(0,h.qk)(e),r=(0,h.$k)(n,i,t),o=(0,h.Jk)(r);this.ft=0,this.p1(o.length),this.uf(o,o.length,0)}}},353:(t,i,s)=>{s.d(i,{A:()=>h});class h{static Qk=[95,218,67,50,253,222,194,60,101,128,8,251,92,111,24,33,223,66,232,59,227,113,153,105,126,98,167,102,177,238,62,190,147,23,150,151,156,144,193,155,81,0,198,22,137,210,179,16,168,170,32,181,248,141,58,87,208,106,180,191,221,241,40,176,196,154,65,145,230,78,30,161,188,41,14,129,18,199,47,247,225,34,51,10,159,75,12,56,61,31,39,91,46,242,134,5,122,123,209,228,104,195,21,3,11,44,107,172,6,186,110,215,205,103,27,185,124,77,252,117,86,115,127,207,52,79,43,97,219,116,169,7,118,162,108,36,20,233,88,135,80,19,42,237,57,152,71,9,250,17,4,119,234,130,26,200,189,163,254,245,197,171,220,235,140,244,184,94,211,231,99,246,121,212,112,204,63,148,83,178,1,255,131,13,183,142,236,45,55,35,243,136,37,85,100,160,38,224,146,174,82,48,109,132,125,90,143,138,240,173,165,164,192,175,29,74,28,114,213,73,64,206,76,139,96,2,229,15,93,25,239,202,49,70,214,201,72,203,68,89,69,157,216,217,249,120,226,84,149,187,54,53,158,166,182,133,0];static IA=[0,-2,4,6,-1,0,0,2,0,0,0,0,5,4,2,2,0,0,0,0,2,-2,2,14,0,6,3,0,4,0,0,0,3,0,0,0,0,0,0,0,0,-1,4,2,6,0,6,0,0,3,7,0,0,0,-1,0,0,0,0,4,0,0,0,0,0,0,0,0,1,15,0,0,0,0,6,0,2,0,0,0,2,0,0,0,1,0,0,4,0,0,0,0,0,0,0,0,0,0,-2,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,-2,0,0,2,0,0,0,2,9,0,0,0,0,0,4,0,0,0,3,7,9,0,0,0,0,0,0,0,0,0,-2,0,0,0,0,3,2,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,-2,2,0,0,0,0,0,6,0,0,0,2,0,2,0,0,0,-2,0,0,4,0,0,0,0,6,0,0,-2,-2,0,0,0,0,0,0,-2,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,-2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0]}},2215:(t,i,s)=>{s.d(i,{A:()=>h});class h{static gp=14;static $A=28;static jp=129;static tp=167;static Wp=168;static Ip=195;static Yp=2;static Kp=26;static Up=46;static Pp=84;static kp=87;static pp=103;static QA=146;static MA=197;static Zp=201;static yp=204;static _p=209;static cp=126;static xp=185;static lp=15;static ep=98;static tm=213;static Np=74;static Qp=13;static Tp=3;static zp=239;static vA=1;static im=184;static hp=133;static np=226;static Fp=4;static Xp=21;static mp=32;static Gy=41;static _A=152;static UA=19;static Jp=22;static xA=25;static TA=43;static qp=44;static Dp=68;static Vp=136;static BA=139;static ap=140;static PA=142;static op=243;static up=254;static FA=20;static OA=80;static Sp=132;static ip=220;static LA=237;static EA=150;static JA=175;static Mp=193;static dp=12;static DA=54;static fp=212;static Ap=7;static Op=135;static $p=162;static HA=23;static zA=42;static KA=49;static WA=50;static ZA=59;static VA=69;static jA=76;static GA=151;static YA=191;static XA=223}},3937:(t,i,s)=>{s.d(i,{A:()=>o});class h{start=0;end=0;form=0;length=0;tx=null;ix=null;threshold=0;position=0;delta=0;amplitude=0;sx=0;read(t){this.form=t.CA,this.start=t.ut,this.end=t.ut,this.length=t.CA,this.tx=new Int32Array(this.length),this.ix=new Int32Array(this.length);for(let i=0;i=this.threshold&&this.ix&&this.tx&&(this.amplitude=this.ix[this.position++]<<15,this.position>=this.length&&(this.position=this.length-1),this.threshold=this.tx[this.position]/65536*t|0,this.threshold>this.sx&&(this.delta=((this.ix[this.position]<<15)-this.amplitude)/(this.threshold-this.sx)|0)),this.amplitude+=this.delta,this.sx++,this.amplitude-this.delta>>15}}class e{static buffer=null;static hO=null;static sin=null;static hx=new Int32Array(5);static nx=new Int32Array(5);static ox=new Int32Array(5);static lx=new Int32Array(5);static ux=new Int32Array(5);wx=null;yx=null;Ax=null;mx=null;Ix=null;Ex=null;release=null;attack=null;gx=new Int32Array(5);_x=new Int32Array(5);Cx=new Int32Array(5);start=0;length=500;Tx=100;Ox=0;static init=()=>{this.hO=new Int32Array(32768);for(let t=0;t<32768;t++)Math.random()>.5?this.hO[t]=1:this.hO[t]=-1;this.sin=new Int32Array(32768);for(let t=0;t<32768;t++)this.sin[t]=16384*Math.sin(t/5215.1903)|0;this.buffer=new Int32Array(220500)};pf(t,i){for(let i=0;i>1,r+=(i*h>>16)+n}if(this.Ix&&this.Ex){const i=this.Ix.evaluate(t),s=this.Ex.evaluate(t);c=c*(32768+(this.vx(s,a,this.Ix.form)>>1))>>15,a+=(i*o>>16)+l}for(let h=0;h<5;h++)if(0!==this.gx[h]){const n=i+e.nx[h];n>15,e.hx[h],this.wx.form),e.hx[h]+=(s*e.lx[h]>>16)+e.ux[h])}}if(this.release&&this.attack){this.release.reset(),this.attack.reset();let i=0,s=!0;for(let h=0;h>8):this.release.start+((this.release.end-this.release.start)*r>>8),i+=256,i>=o&&(i=0,s=!s),s&&(e.buffer[h]=0)}}if(this.Ox>0&&this.Tx>0){const i=this.Ox*s;for(let s=i;s32767&&(e.buffer[i]=32767);return e.buffer}vx(t,i,s){return 1===s?(32767&i)<16384?t:-t:2===s?e.sin[32767&i]*t>>14:3===s?((32767&i)*t>>14)-t:4===s?e.hO[i/2607&32767]*t:0}read(t){this.wx=new h,this.wx.read(t),this.yx=new h,this.yx.read(t),0!==t.CA&&(t.ft--,this.Ax=new h,this.Ax.read(t),this.mx=new h,this.mx.read(t)),0!==t.CA&&(t.ft--,this.Ix=new h,this.Ix.read(t),this.Ex=new h,this.Ex.read(t)),0!==t.CA&&(t.ft--,this.release=new h,this.release.read(t),this.attack=new h,this.attack.read(t));for(let i=0;i<10;i++){const s=t.vO;if(0===s)break;this.gx[i]=s,this._x[i]=t.iS,this.Cx[i]=t.vO}this.Ox=t.vO,this.Tx=t.vO,this.length=t.ct,this.start=t.ct}}var n=s(1069),r=s(3867);class o{static wp=new Int32Array(1e3);static bx=null;static Lx=null;static Rx=new r.Ns(1e3,null);Sx=new r.Ns(10,null);Mx=0;loopEnd=0;static Sc=t=>{const i=new n.A(t.read('sounds.dat'));for(this.bx=new Uint8Array(441e3),this.Lx=new n.A(this.bx),e.init();;){const t=i.ct;if(65535===t)break;const s=new o;s.read(i),this.Rx[t]=s,this.wp[t]=s.trim()}};static pf=(t,i)=>{if(!this.Rx[t])return null;const s=this.Rx[t];return s?.kx(i)??null};read(t){for(let i=0;i<10;i++)0!==t.CA&&(t.ft--,this.Sx[i]=new e,this.Sx[i]?.read(t));this.Mx=t.ct,this.loopEnd=t.ct}trim(){let t=9999999;for(let i=0;i<10;i++)this.Sx[i]&&(this.Sx[i].start/20|0)i&&(i=this.Sx[t].length+this.Sx[t].start);if(0===i)return 0;let s=22050*i/1e3|0,h=22050*this.Mx/1e3|0,e=22050*this.loopEnd/1e3|0;(h<0||e<0||e>s||h>=e)&&(t=0);let n=s+(e-h)*(t-1);for(let t=44;t>8<<24>>24)}if(t>1){h+=44,e+=44,s+=44,n+=44;const i=n-s;for(let t=s-1;t>=e;t--)o.bx&&(o.bx[t+i]=o.bx[t]);for(let i=1;i{s.d(i,{Cc:()=>a,_c:()=>o,Ns:()=>h,Rv:()=>e,Kr:()=>n,vv:()=>r,wr:()=>l});class h extends Array{constructor(t,i){super(t);for(let s=0;s{s.d(i,{Jk:()=>l,dl:()=>e,qk:()=>o,wl:()=>h,mc:()=>n,qc:()=>r,$k:()=>a});const h=async t=>new Promise((i=>setTimeout(i,t))),e=async t=>new Int8Array(await(await fetch(t)).arrayBuffer()),n=async t=>(await fetch(t)).text();function r(t,i,s,h,e){for(;e--;)s[h++]=t[i++]}function o(t){let i=0n;for(let s=0;s0n;)i.unshift(Number(0xffn&t)),t>>=8n;return 128&i[0]&&i.unshift(0),new Uint8Array(i)}function a(t,i,s){let h=1n;for(;i>0n;)i%2n===1n&&(h=h*t%s),t=t*t%s,i>>=1n;return h}},7953:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1069);class e{static xx=new Uint16Array(['d','o','t'].join('').split('').map((t=>t.charCodeAt(0))));static Dx=new Uint16Array(['(','a',')'].join('').split('').map((t=>t.charCodeAt(0))));static Nx=new Uint16Array(['s','l','a','s','h'].join('').split('').map((t=>t.charCodeAt(0))));static Px=['cook',"cook's",'cooks','seeks','sheet'];static Fx=[];static Ux=[];static Bx=[];static Gx=[];static Hx=[];static Wx=[];static Sc=t=>{const i=new h.A(t.read('fragmentsenc.txt')),s=new h.A(t.read('badenc.txt')),e=new h.A(t.read('domainenc.txt')),n=new h.A(t.read('tldlist.txt'));this.read(s,e,i,n)};static filter=t=>{const i=[...t];this.format(i);const s=i.join('').trim(),h=s.toLowerCase(),e=[...h];this.Yx(e),this.Vx(e),this.Kx(e),this.Xx(e);for(let t=0;t{this.Zx(t),this.qx(i),this.$x(s),this.Jx(h)};static Jx=t=>{const i=t.ut;for(let s=0;st.CA))};static Zx=t=>{const i=t.ut;for(let s=0;st.CA));const i=new Array(t.CA).fill([]).map((()=>[t.gA,t.gA]));i.length>0&&(this.Gx[s]=i)}};static qx=t=>{const i=t.ut;for(let s=0;st.CA))};static $x=t=>{const i=t.ut;for(let s=0;s{const i=[...t],s=[...t];this.Qx(null,i,this.xx),this.Qx(null,s,this.Nx);for(let h=0;h{for(let i=0;i<2;i++)for(let i=this.Bx.length-1;i>=0;i--)this.Qx(this.Gx[i],t,this.Bx[i])};static Kx=t=>{const i=[...t],s=[...t];this.Qx(null,i,this.Dx),this.Qx(null,s,this.xx);for(let h=this.Hx.length-1;h>=0;h--)this.iD(s,i,this.Hx[h],t)};static Xx=t=>{for(let i=0;i=0&&e{if(this.lD(t))return!0;const i=this.aD(t),s=this.Wx,h=s.length;if(i===s[0]||i===s[h-1])return!0;let e=0,n=h-1;for(;e<=n;){const t=(e+n)/2|0;if(i===s[t])return!0;i{if(t.length>6)return 0;let i=0;for(let s=0;s{for(let s=i;s=0;s++)if(this.fD(t[s]))return s;return-1};static rD=(t,i)=>{for(let s=t;s=0;s++)if(!this.fD(i[s]))return s;return i.length};static uD=(t,i,s)=>i===s||'o'===i&&'0'===s?1:'o'===i&&'('===s&&')'===t?2:'c'!==i||'('!==s&&'<'!==s&&'['!==s?'e'===i&&'€'===s||'s'===i&&'$'===s||'l'===i&&'i'===s?1:0:1;static iD=(t,i,s,h)=>{const e=s.length,n=h.length;for(let r=0;r<=n-e;r++){const{dD:e,wD:n}=this.yD(r,s,h);if(!e)continue;const o=this.AD(r,h,3,i,['@']),l=this.pD(n-1,h,3,t,['.',',']);(o>2||l>2)&&this.nD(r,n,h)}};static yD=(t,i,s)=>{const h=i.length;let e=t,n=0;for(;e0)e+=l,n++;else{if(0===n)break;const s=this.uD(o,String.fromCharCode(i[n-1]),r);if(s>0)e+=s,1===n&&t++;else{if(n>=h||!this.hD(r))break;e++}}}return{dD:n>=h,wD:e}};static Qx=(t,i,s)=>{if(!(s.length>i.length))for(let h=0;h<=i.length-s.length;h++){let e=h;const{wD:n,mD:r,ID:o,ED:l,gD:a}=this._D(i,s,e);e=n;let c=i[e],f=e+1=s.length)||l&&a)continue;let u,d=!0;if(o){let t=!1,s=!1;if((h-1<0||this.hD(i[h-1])&&"'"!==i[h-1])&&(t=!0),(e>=i.length||this.hD(i[e])&&"'"!==i[e])&&(s=!0),!t||!s){let s=!1;for(u=h-2,t&&(u=h);!s&&u=0&&(!this.hD(i[u])||"'"===i[u])){const t=[];let h;for(h=0;h<3&&u+h=0&&(!this.hD(i[u-1])||"'"===i[u-1])&&(e=!1),e&&!this.oD(t)&&(s=!0)}u++}s||(d=!1)}}else{c=' ',h-1>=0&&(c=i[h-1]),f=' ',e{let h=s,e=0,n=0,r=!1,o=!1,l=!1;for(;h=t.length||o&&l);){const a=t[h],c=h+10)1===f&&this.fD(a)&&(o=!0),2===f&&(this.fD(a)||this.fD(c))&&(o=!0),h+=f,e++;else{if(0===e)break;let t;if((t=this.vD(c,String.fromCharCode(i[e-1]),a))>0)h+=t;else{if(e>=i.length||!this.eD(a))break;if(this.hD(a)&&"'"!==a&&(r=!0),this.fD(a)&&(l=!0),h++,n++,(100*n/(h-s)|0)>90)break}}}return{wD:h,mD:e,ID:r,ED:o,gD:l}};static vD=(t,i,s)=>{if(i===s)return 1;if(i>='a'&&i<='m'){if('a'===i)return'4'!==s&&'@'!==s&&'^'!==s?'/'===s&&'\\'===t?2:0:1;if('b'===i)return'6'!==s&&'8'!==s?'1'===s&&'3'===t?2:0:1;if('c'===i)return'('!==s&&'<'!==s&&'{'!==s&&'['!==s?0:1;if('d'===i)return'['===s&&')'===t?2:0;if('e'===i)return'3'!==s&&'€'!==s?0:1;if('f'===i)return'p'===s&&'h'===t?2:'£'===s?1:0;if('g'===i)return'9'!==s&&'6'!==s?0:1;if('h'===i)return'#'===s?1:0;if('i'===i)return'y'!==s&&'l'!==s&&'j'!==s&&'1'!==s&&'!'!==s&&':'!==s&&';'!==s&&'|'!==s?0:1;if('j'===i)return 0;if('k'===i)return 0;if('l'===i)return'1'!==s&&'|'!==s&&'i'!==s?0:1;if('m'===i)return 0}if(i>='n'&&i<='z'){if('n'===i)return 0;if('o'===i)return'0'!==s&&'*'!==s?'('===s&&')'===t||'['===s&&']'===t||'{'===s&&'}'===t||'<'===s&&'>'===t?2:0:1;if('p'===i)return 0;if('q'===i)return 0;if('r'===i)return 0;if('s'===i)return'5'!==s&&'z'!==s&&'$'!==s&&'2'!==s?0:1;if('t'===i)return'7'!==s&&'+'!==s?0:1;if('u'===i)return'v'===s?1:'\\'===s&&'/'===t||'\\'===s&&'|'===t||'|'===s&&'/'===t?2:0;if('v'===i)return'\\'===s&&'/'===t||'\\'===s&&'|'===t||'|'===s&&'/'===t?2:0;if('w'===i)return'v'===s&&'v'===t?2:0;if('x'===i)return')'===s&&'('===t||'}'===s&&'{'===t||']'===s&&'['===t||'>'===s&&'<'===t?2:0;if('y'===i)return 0;if('z'===i)return 0}return i>='0'&&i<='9'?'0'===i?'o'===s||'O'===s?1:'('===s&&')'===t||'{'===s&&'}'===t||'['===s&&']'===t?2:0:'1'===i&&'l'===s?1:0:','===i?'.'===s?1:0:'.'===i?','===s?1:0:'!'===i&&'i'===s?1:0};static TD=(t,i,s)=>{let h=0,e=i.length-1;for(;h<=e;){const n=(h+e)/2|0;if(i[n][0]===t&&i[n][1]===s)return!0;tthis.cD(t)?t.charCodeAt(0)+1-'a'.charCodeAt(0):"'"===t?28:this.fD(t)?t.charCodeAt(0)+29-'0'.charCodeAt(0):27;static tD=(t,i,s,h,e)=>{if(!(h.length>s.length))for(let n=0;n<=s.length-h.length;n++){const{wD:r,bD:o}=this.LD(s,h,n);if(o0&&c>0&&(l=!0),2===i&&(a>2&&c>0||a>0&&c>2)&&(l=!0),3===i&&a>0&&c>2&&(l=!0),!l)continue;let f,u=n,d=r-1,w=!1;if(a>2){if(4===a)for(w=!1,f=n-1;f>=0;f--)if(w){if('*'!==e[f])break;u=f}else'*'===e[f]&&(u=f,w=!0);for(w=!1,f=u-1;f>=0;f--)if(w){if(this.hD(s[f]))break;u=f}else this.hD(s[f])||(w=!0,u=f)}if(c>2){if(4===c)for(w=!1,f=d+1;f{let h=0;for(;s0)s+=r,h++;else{if(0===h)break;let t;if((t=this.uD(n,String.fromCharCode(i[h-1]),e))>0)s+=t;else{if(!this.hD(e))break;s++}}}return{wD:s,bD:h}};static hD=t=>!this.OD(t)&&!this.fD(t);static eD=t=>!this.cD(t)||('v'===t||'x'===t||'j'===t||'q'===t||'z'===t);static OD=t=>this.cD(t)||this.RD(t);static fD=t=>t>='0'&&t<='9';static cD=t=>t>='a'&&t<='z';static RD=t=>t>='A'&&t<='Z';static lD=t=>{for(let i=0;i{for(let h=t;h{let s=0;for(let h=i-1;h>=0&&this.hD(t[h]);h--)'*'===t[h]&&s++;return s};static MD=(t,i)=>{let s=0;for(let h=i+1;h(e?this.SD(i,s):this.MD(i,s))>=h?4:this.hD(e?t[s-1]:t[s+1])?1:0;static AD=(t,i,s,h,e)=>{if(0===t)return 2;for(let s=t-1;s>=0&&this.hD(i[s]);s--)if(e.includes(i[s]))return 3;return this.kD(i,h,t,s,!0)};static pD=(t,i,s,h,e)=>{if(t+1===i.length)return 2;for(let s=t+1;s{let i=0;for(let s=0;st>=' '&&t<=''||' '===t||'\n'===t||'\t'===t||'£'===t||'€'===t;static zx=(t,i)=>{for(let s=0;s{let i=!0;for(let s=0;s{s.d(i,{A:()=>h});class h{static DD=[' ','e','t','a','o','i','h','n','s','r','d','l','u','m','w','c','y','f','g','p','b','v','k','x','j','q','z','0','1','2','3','4','5','6','7','8','9',' ','!','?','.',',',':',';','(',')','-','&','*','\\','\'','@','#','+','=','£','$','%','"','[',']'];static ND=[];static Sc=(t,i)=>{let s,h=0,e=-1;for(let n=0;n>4&15,-1!==e?(this.ND[h++]=this.DD[(e<<4)+s-195],e=-1):s<13?this.ND[h++]=this.DD[s]:e=s,s=15&i,-1!==e?(this.ND[h++]=this.DD[(e<<4)+s-195],e=-1):s<13?this.ND[h++]=this.DD[s]:e=s}let n=!0;for(let t=0;t='a'&&i<='z'&&(this.ND[t]=i.toUpperCase(),n=!1),'.'!==i&&'!'!==i||(n=!0)}return this.ND.slice(0,h).join('')};static Hy=(t,i)=>{i.length>80&&(i=i.substring(0,80)),i=i.toLowerCase();let s=-1;for(let h=0;h12&&(n+=195),-1===s?n<13?s=n:t.p1(n):n<13?(t.p1((s<<4)+n),s=-1):(t.p1((s<<4)+(n>>4)),s=15&n)}-1!==s&&t.p1(s<<4)}}},4702:(t,i,s)=>{async function h(t,i={}){const s={env:Object.assign(Object.create(globalThis),i.env||{},{abort(t,i,s,h){t=r(t>>>0),i=r(i>>>0),s>>>=0,h>>>=0,(()=>{throw Error(`${t} in ${i}:${s}:${h}`)})()}})},{exports:h}=await WebAssembly.instantiate(t,s),e=h.memory||i.env.memory,n=Object.setPrototypeOf({read:(t,i,s,n)=>(i=function(t,i,s,n,r){if(null==n)return 0;const o=n.length,l=h.__pin(h.__new(o<>>0;if(r)new r(e.buffer,l,o).set(n);else for(let i=0;i>>0),n[i]);return h.__unpin(l),l}(l,6,0,i,Int8Array)||function(){throw TypeError("value must not be null")}(),function(t,i,s){if(!s)return null;const h=function(t){try{return o.getUint32(t,!0)}catch{return o=new DataView(e.buffer),o.getUint32(t,!0)}}(s-4)>>>i,n=new Array(h);for(let e=0;e>>0));return n}(a,0,h.read(t,i,s,n)>>>0))},h);function r(t){if(!t)return null;const i=t+new Uint32Array(e.buffer)[t-4>>>2]>>>1,s=new Uint16Array(e.buffer);let h=t>>>1,n="";for(;i-h>1024;)n+=String.fromCharCode(...s.subarray(h,h+=1024));return n+String.fromCharCode(...s.subarray(h,i))}let o=new DataView(e.buffer);function l(t,i){try{o.setUint8(t,i,!0)}catch{o=new DataView(e.buffer),o.setUint8(t,i,!0)}}function a(t){try{return o.getInt8(t,!0)}catch{return o=new DataView(e.buffer),o.getInt8(t,!0)}}return n}s.d(i,{A:()=>e});class e{static PD=null;static load=async t=>{this.PD=await h(new WebAssembly.Module(t),{env:void 0})};static read=(t,i,s,h)=>{if(!this.PD)throw new Error('bz2 not found!!');return Int8Array.from(this.PD.read(t,i,s,h))}}},123:(t,i,s)=>{let h;async function e(t,i){n(i);try{const i=await window.audioContext.decodeAudioData(Uint8Array.from(t).buffer);let s=window.audioContext.createBufferSource();s.buffer=i,s.connect(h),s.start()}catch(t){console.log(t)}}function n(t){h||(h=window.audioContext.createGain(),h.connect(window.audioContext.destination)),h.gain.value=t/256}function r(t,i,s){window._tinyMidiPlay&&window._tinyMidiPlay(t,i/256,s)}function o(t){window._tinyMidiVolume&&window._tinyMidiVolume(t/256)}function l(t){window._tinyMidiStop&&window._tinyMidiStop(t)}s.d(i,{mf:()=>e,pl:()=>r,Em:()=>n,qo:()=>l,Im:()=>o})},8902:(t,i,s)=>{var h;const e=(h="file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/tinymidipcm.mjs",function(t){var i,e,n=void 0!==(t=t||{})?t:{};n.ready=new Promise((function(t,s){i=t,e=s})),["_tsf_load_memory","_tsf_set_output","_tsf_channel_set_bank_preset","_tsf_set_max_voices","_tsf_channel_set_presetnumber","_tsf_reset","_tsf_close","_tml_load_memory","_midi_render","_malloc","_realloc","_free","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(n.ready,t)||Object.defineProperty(n.ready,t,{get:()=>z('You are getting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),set:()=>z('You are setting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js')})}));var r=Object.assign({},n),o=[],l='object'==typeof window,a='function'==typeof importScripts,c='object'==typeof process&&'object'==typeof process.versions&&'string'==typeof process.versions.node,f=!l&&!c&&!a;if(n.ENVIRONMENT)throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');var u,d,w,y='';if(c){if('undefined'==typeof process||!process.release||'node'!==process.release.name)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');var A,p;y=a?require('path').FD(y)+'/':__dirname+'/';var m=()=>{p||(A=require('fs'),p=require('path'))};u=(t,i)=>(m(),t=p.normalize(t),A.UD(t,i?void 0:'utf8')),w=t=>{var i=u(t,!0);return i.buffer||(i=new Uint8Array(i)),D(i.buffer),i},d=(t,i,s)=>{m(),t=p.normalize(t),A.BD(t,(function(t,h){t?s(t):i(h.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,'/'),o=process.argv.slice(2),process.on('uncaughtException',(function(t){if(!(t instanceof et))throw t})),process.on('unhandledRejection',(function(t){throw t})),n.inspect=function(){return'[Emscripten Module object]'}}else if(f){if('object'==typeof process&&'function'==typeof require||'object'==typeof window||'function'==typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');'undefined'!=typeof read&&(u=function(t){return read(t)}),w=function(t){let i;return'function'==typeof readbuffer?new Uint8Array(readbuffer(t)):(i=read(t,'binary'),D('object'==typeof i),i)},d=function(t,i,s){setTimeout((()=>i(w(t))),0)},'undefined'!=typeof scriptArgs?o=scriptArgs:void 0!==arguments&&(o=arguments),'undefined'!=typeof print&&('undefined'==typeof console&&(console={}),console.log=print,console.warn=console.error='undefined'!=typeof printErr?printErr:print)}else{if(!l&&!a)throw new Error('environment detection error');if(a?y=self.location.href:'undefined'!=typeof document&&document.currentScript&&(y=document.currentScript.src),h&&(y=h),y=0!==y.indexOf('blob:')?y.substr(0,y.replace(/[?#].*/,"").lastIndexOf('/')+1):'','object'!=typeof window&&'function'!=typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');u=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.send(null),i.responseText},a&&(w=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.responseType='arraybuffer',i.send(null),new Uint8Array(i.response)}),d=(t,i,s)=>{var h=new XMLHttpRequest;h.open('GET',t,!0),h.responseType='arraybuffer',h.onload=()=>{200==h.status||0==h.status&&h.response?i(h.response):s()},h.onerror=s,h.send(null)}}n.print||console.log.bind(console);var I,E,g=n.printErr||console.warn.bind(console);function _(t,i){Object.getOwnPropertyDescriptor(n,t)||Object.defineProperty(n,t,{configurable:!0,get:function(){z('Module.'+t+' has been replaced with plain '+i+' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')}})}function C(t){return'FS_createPath'===t||'FS_createDataFile'===t||'FS_createPreloadedFile'===t||'FS_unlink'===t||'addRunDependency'===t||'FS_createLazyFile'===t||'FS_createDevice'===t||'removeRunDependency'===t}Object.assign(n,r),r=null,I='fetchSettings',Object.getOwnPropertyDescriptor(n,I)&&z('`Module.'+I+'` was supplied but `'+I+'` not included in INCOMING_MODULE_JS_API'),n.arguments&&(o=n.arguments),_('arguments','arguments_'),n.thisProgram&&n.thisProgram,_('thisProgram','thisProgram'),n.quit&&n.quit,_('quit','quit_'),D(void 0===n.memoryInitializerPrefixURL,'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===n.pthreadMainPrefixURL,'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'),D(void 0===n.cdInitializerPrefixURL,'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===n.filePackagePrefixURL,'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'),D(void 0===n.read,'Module.read option was removed (modify read_ in JS)'),D(void 0===n.readAsync,'Module.readAsync option was removed (modify readAsync in JS)'),D(void 0===n.readBinary,'Module.readBinary option was removed (modify readBinary in JS)'),D(void 0===n.setWindowTitle,'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'),D(void 0===n.TOTAL_MEMORY,'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'),_('read','read_'),_('readAsync','readAsync'),_('readBinary','readBinary'),_('setWindowTitle','setWindowTitle'),D(!f,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),n.wasmBinary&&(E=n.wasmBinary),_('wasmBinary','wasmBinary');var T;n.noExitRuntime;_('noExitRuntime','noExitRuntime'),'object'!=typeof WebAssembly&&z('no native wasm support detected');var O,v,b,L,R,S,M,k,x=!1;function D(t,i){t||z('Assertion failed'+(i?': '+i:''))}function N(t){O=t,n.HEAP8=v=new Int8Array(t),n.HEAP16=L=new Int16Array(t),n.HEAP32=R=new Int32Array(t),n.HEAPU8=b=new Uint8Array(t),n.HEAPU16=new Uint16Array(t),n.HEAPU32=S=new Uint32Array(t),n.HEAPF32=M=new Float32Array(t),n.HEAPF64=k=new Float64Array(t)}'undefined'!=typeof TextDecoder&&new TextDecoder('utf8');var P=5242880;n.TOTAL_STACK&&D(P===n.TOTAL_STACK,'the stack size can no longer be determined at runtime');var F=n.INITIAL_MEMORY||16777216;function U(){if(!x){var t=ft(),i=S[t>>2],s=S[t+4>>2];34821223==i&&2310721022==s||z('Stack overflow! Stack cookie has been overwritten at 0x'+t.toString(16)+', expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+s.toString(16)+' 0x'+i.toString(16)),1668509029!==S[0]&&z('Runtime error: The application has corrupted its heap memory area (address zero)!')}}_('INITIAL_MEMORY','INITIAL_MEMORY'),D(F>=P,'INITIAL_MEMORY should be larger than TOTAL_STACK, was '+F+'! (TOTAL_STACK='+P+')'),D('undefined'!=typeof Int32Array&&'undefined'!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,'JS engine does not provide full typed array support'),D(!n.wasmMemory,'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'),D(16777216==F,'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'),function(){var t=new Int16Array(1),i=new Int8Array(t.buffer);if(t[0]=25459,115!==i[0]||99!==i[1])throw'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'}();var B=[],G=[],H=[],W=!1;D(Math.imul,'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.fround,'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.clz32,'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.trunc,'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');var Y=0,V=null,K=null,X={};function z(t){n.onAbort&&n.onAbort(t),g(t='Aborted('+t+')'),x=!0;var i=new WebAssembly.RuntimeError(t);throw e(i),i}var j={error:function(){z('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM')},init:function(){j.error()},GD:function(){j.error()},HD:function(){j.error()},WD:function(){j.error()},open:function(){j.error()},YD:function(){j.error()},VD:function(){j.error()},KD:function(){j.error()},XD:function(){j.error()},zD:function(){j.error()}};n.FS_createDataFile=j.GD,n.FS_createPreloadedFile=j.HD;var Z,q,$,J,Q='data:application/octet-stream;base64,';function tt(t){return t.startsWith(Q)}function it(t){return t.startsWith('file://')}function st(t,i){return function(){var s=t,h=i;return i||(h=n.asm),D(W,'native function `'+s+'` called before runtime initialization'),h[t]||D(h[t],'exported native function `'+s+'` not found'),h[t].apply(null,arguments)}}function ht(t){try{if(t==Z&&E)return new Uint8Array(E);if(w)return w(t);throw"both async and sync fetching of the wasm failed"}catch(t){z(t)}}function et(t){this.name='ExitStatus',this.message='Program terminated with exit('+t+')',this.status=t}function nt(t){for(;t.length>0;)t.shift()(n)}function rt(t){rt.jD||(rt.jD={}),rt.jD[t]||(rt.jD[t]=1,c&&(t='warning: '+t),g(t))}function ot(t){try{return T.grow(t-O.byteLength+65535>>>16),N(T.buffer),1}catch(i){g('emscripten_realloc_buffer: Attempted to grow heap from '+O.byteLength+' bytes to '+t+' bytes, but got error: '+i)}}n.locateFile?tt(Z='tinymidipcm.wasm')||(q=Z,Z=n.locateFile?n.locateFile(q,y):y+q):Z=new URL(s(8227),s.b).toString();var lt,at={"emscripten_memcpy_big":function(t,i,s){b.copyWithin(t,i,i+s)},"emscripten_resize_heap":function(t){var i=b.length;D((t>>>=0)>i);var s,h,e=2147483648;if(t>e)return g('Cannot enlarge memory, asked to go up to '+t+' bytes, but the limit is '+e+' bytes!'),!1;for(var n=1;n<=4;n*=2){var r=i*(1+.2/n);r=Math.min(r,t+100663296);var o=Math.min(e,(s=Math.max(t,r))+((h=65536)-s%h)%h);if(ot(o))return!0}return g('Failed to grow the heap from '+i+' bytes to '+o+' bytes, not enough memory!'),!1}},ct=(function(){var t,i={'env':at,'wasi_snapshot_preview1':at};function s(t,i){var s,h=t.exports;n.asm=h,D(T=n.asm.memory,"memory not found in wasm exports"),N(T.buffer),D(n.asm.__indirect_function_table,"table not found in wasm exports"),s=n.asm.__wasm_call_ctors,G.unshift(s),function(t){if(Y--,n.monitorRunDependencies&&n.monitorRunDependencies(Y),t?(D(X[t]),delete X[t]):g('warning: run dependency removed without ID'),0==Y&&(null!==V&&(clearInterval(V),V=null),K)){var i=K;K=null,i()}}('wasm-instantiate')}t='wasm-instantiate',Y++,n.monitorRunDependencies&&n.monitorRunDependencies(Y),t?(D(!X[t]),X[t]=1,null===V&&'undefined'!=typeof setInterval&&(V=setInterval((function(){if(x)return clearInterval(V),void(V=null);var t=!1;for(var i in X)t||(t=!0,g('still waiting on run dependencies:')),g('dependency: '+i);t&&g('(end of list)')}),1e4))):g('warning: run dependency added without ID');var h=n;function r(t){D(n===h,'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'),h=null,s(t.instance)}function o(t){return function(){if(!E&&(l||a)){if('function'==typeof fetch&&!it(Z))return fetch(Z,{credentials:'same-origin'}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+Z+"'";return t.arrayBuffer()})).catch((function(){return ht(Z)}));if(d)return new Promise((function(t,i){d(Z,(function(i){t(new Uint8Array(i))}),i)}))}return Promise.resolve().then((function(){return ht(Z)}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){g('failed to asynchronously prepare wasm: '+t),it(Z)&&g('warning: Loading from a file URI ('+Z+') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing'),z(t)}))}if(n.instantiateWasm)try{return n.instantiateWasm(i,s)}catch(t){g('Module.instantiateWasm callback failed with error: '+t),e(t)}(E||'function'!=typeof WebAssembly.instantiateStreaming||tt(Z)||it(Z)||c||'function'!=typeof fetch?o(r):fetch(Z,{credentials:'same-origin'}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(r,(function(t){return g('wasm streaming compile failed: '+t),g('falling back to ArrayBuffer instantiation'),o(r)}))}))).catch(e)}(),n.___wasm_call_ctors=st("__wasm_call_ctors"),n._malloc=st("malloc"),n._free=st("free"),n._tsf_load_memory=st("tsf_load_memory"),n._tsf_close=st("tsf_close"),n._tsf_reset=st("tsf_reset"),n._tsf_set_output=st("tsf_set_output"),n._tsf_set_max_voices=st("tsf_set_max_voices"),n._realloc=st("realloc"),n._tsf_channel_set_presetnumber=st("tsf_channel_set_presetnumber"),n._tsf_channel_set_bank_preset=st("tsf_channel_set_bank_preset"),n._tml_load_memory=st("tml_load_memory"),n._midi_render=st("midi_render"),n.___errno_location=st("__errno_location"),n._fflush=st("fflush"),n._emscripten_stack_init=function(){return(ct=n._emscripten_stack_init=n.asm.emscripten_stack_init).apply(null,arguments)}),ft=(n._emscripten_stack_get_free=function(){return(n._emscripten_stack_get_free=n.asm.emscripten_stack_get_free).apply(null,arguments)},n._emscripten_stack_get_base=function(){return(n._emscripten_stack_get_base=n.asm.emscripten_stack_get_base).apply(null,arguments)},n._emscripten_stack_get_end=function(){return(ft=n._emscripten_stack_get_end=n.asm.emscripten_stack_get_end).apply(null,arguments)});function ut(){var t;ct(),D(!(3&(t=ft()))),S[t>>2]=34821223,S[t+4>>2]=2310721022,S[0]=1668509029}function dt(t){function s(){lt||(lt=!0,n.calledRun=!0,x||(D(!W),W=!0,U(),nt(G),i(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),D(!n._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(U(),n.postRun)for('function'==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)t=n.postRun.shift(),H.unshift(t);var t;nt(H)}()))}t=t||o,Y>0||(ut(),function(){if(n.preRun)for('function'==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)t=n.preRun.shift(),B.unshift(t);var t;nt(B)}(),Y>0||(n.setStatus?(n.setStatus('Running...'),setTimeout((function(){setTimeout((function(){n.setStatus('')}),1),s()}),1)):s(),U()))}if(n.stackSave=st("stackSave"),n.stackRestore=st("stackRestore"),n.stackAlloc=st("stackAlloc"),n.setValue=function(t,i,s="i8"){switch(s.endsWith('*')&&(s='*'),s){case'i1':case'i8':v[0|t]=i;break;case'i16':L[t>>1]=i;break;case'i32':R[t>>2]=i;break;case'i64':J=[i>>>0,($=i,+Math.abs($)>=1?$>0?(0|Math.min(+Math.floor($/4294967296),4294967295))>>>0:~~+Math.ceil(($-+(~~$>>>0))/4294967296)>>>0:0)],R[t>>2]=J[0],R[t+4>>2]=J[1];break;case'float':M[t>>2]=i;break;case'double':k[t>>3]=i;break;case'*':S[t>>2]=i;break;default:z('invalid type for setValue: '+s)}},n.getValue=function(t,i="i8"){switch(i.endsWith('*')&&(i='*'),i){case'i1':case'i8':return v[0|t];case'i16':return L[t>>1];case'i32':case'i64':return R[t>>2];case'float':return M[t>>2];case'double':return k[t>>3];case'*':return S[t>>2];default:z('invalid type for getValue: '+i)}return null},['run','UTF8ArrayToString','UTF8ToString','stringToUTF8Array','stringToUTF8','lengthBytesUTF8','addOnPreRun','addOnInit','addOnPreMain','addOnExit','addOnPostRun','addRunDependency','removeRunDependency','FS_createFolder','FS_createPath','FS_createDataFile','FS_createPreloadedFile','FS_createLazyFile','FS_createLink','FS_createDevice','FS_unlink','getLEB','getFunctionTables','alignFunctionTables','registerFunctions','prettyPrint','getCompilerSetting','print','printErr','callMain','abort','keepRuntimeAlive','wasmMemory','stackAlloc','stackSave','stackRestore','getTempRet0','setTempRet0','writeStackCookie','checkStackCookie','ptrToString','zeroMemory','stringToNewUTF8','exitJS','getHeapMax','emscripten_realloc_buffer','ENV','ERRNO_CODES','ERRNO_MESSAGES','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','DNS','getHostByName','Protocols','Sockets','getRandomDevice','warnOnce','traverseStack','UNWIND_CACHE','convertPCtoSourceLocation','readAsmConstArgsArray','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','handleException','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','freeTableIndexes','functionsInTableMap','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','PATH','PATH_FS','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16Decoder','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeArrayToMemory','writeAsciiToMemory','SYSCALLS','getSocketFromFD','getSocketAddress','JSEvents','registerKeyEventCallback','specialHTMLTargets','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','currentFullscreenStrategy','restoreOldWindowedStyle','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','demangle','demangleAll','jsStackTrace','stackTrace','ExitStatus','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','dlopenMissingError','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','uncaughtExceptionCount','exceptionLast','exceptionCaught','ExceptionInfo','exception_addRef','exception_decRef','Browser','setMainLoop','wget','FS','MEMFS','TTY','PIPEFS','SOCKFS','_setNetworkCallback','tempFixedLengthArray','miniTempWebGLFloatBuffers','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','GL','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','AL','SDL_unicode','SDL_ttfContext','SDL_audio','SDL','SDL_gfx','GLUT','EGL','GLFW_Window','GLFW','GLEW','IDBStore','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){Object.getOwnPropertyDescriptor(n,t)||Object.defineProperty(n,t,{configurable:!0,get:function(){var i="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";C(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),z(i)}})})),['ptrToString','zeroMemory','stringToNewUTF8','exitJS','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','getHostByName','getRandomDevice','traverseStack','convertPCtoSourceLocation','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeAsciiToMemory','getSocketFromFD','getSocketAddress','registerKeyEventCallback','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','ExceptionInfo','exception_addRef','exception_decRef','setMainLoop','_setNetworkCallback','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','SDL_unicode','SDL_ttfContext','SDL_audio','GLFW_Window','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){'undefined'==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var i='`'+t+'` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line';C(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),rt(i)}})})),K=function t(){lt||dt(),lt||(K=t)},n.preInit)for('function'==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return dt(),t.ready});const n=class{constructor(t={}){this.ZD=void 0,this.qD=0,this.$D=0,this.JD=0,this.QD=t.QD||100,this.sampleRate=t.sampleRate||44100,this.tN=t.tN||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.iN(1),this.sN=t.sN||(()=>{}),this.hN=t.hN||(()=>{}),this.eN=void 0,this.test=0}async init(){if(!this.ZD){if('undefined'!=typeof process){const{FD:t}=await import('path'),{nN: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.ZD=await e(),this.rN=this.ZD._malloc(this.bufferSize),this.oN=this.ZD._malloc(8)}}iN(t){this.bufferSize=4*this.sampleRate*this.tN*t}lN(){if(!this.ZD)throw new Error(`${this.constructor.name} not initalized. call .init()`)}aN(t){this.lN();const{_malloc:i,_free:s,_tsf_load_memory:h,_tsf_set_output:e,_tsf_channel_set_bank_preset:n,_tsf_set_max_voices:r,_tsf_channel_set_presetnumber:o}=this.ZD;s(this.qD),this.qD=i(t.length),this.ZD.HEAPU8.set(t,this.qD),this.$D=h(this.qD,t.length),e(this.$D,2===this.tN?0:2,this.sampleRate,this.gain)}cN(){this.lN();const t=new Uint8Array(this.bufferSize);return t.set(this.ZD.HEAPU8.subarray(this.rN,this.rN+this.bufferSize)),t}fN(t){const{_malloc:i,_free:s,_tml_load_memory:h}=this.ZD;return s(this.JD),this.JD=i(t.length),this.ZD.HEAPU8.set(t,this.JD),h(this.JD,t.length)}uN(t){const{_midi_render:i}=this.ZD;return i(this.$D,t,this.tN,this.sampleRate,this.rN,this.bufferSize,this.oN)}dN(t){if(this.lN(),!this.$D)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.eN);const{setValue:i,getValue:s}=this.ZD;i(this.oN,0,'double'),this.ZD._tsf_reset(this.$D),this.ZD._tsf_channel_set_bank_preset(this.$D,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let h=this.fN(t);const e=()=>{h=this.uN(h);const t=this.cN();this.sN(t),h?this.eN=setTimeout(e,this.QD):this.hN(s(this.oN,'double'))};this.eN=setTimeout(e,16)}};!function(){window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioContext&&(window.audioContext=new window.AudioContext);var t=function(i){if(window.audioContext){var s=window.audioContext.createBuffer(1,1,22050),h=window.audioContext.createBufferSource();h.buffer=s,h.connect(window.audioContext.destination),h.start?h.start(0):h.play?h.play(0):h.noteOn&&h.noteOn(0)}document.removeEventListener('touchstart',t),document.removeEventListener('touchend',t),document.removeEventListener('click',t)};document.addEventListener('touchstart',t),document.addEventListener('touchend',t),document.addEventListener('click',t)}(),(async()=>{const t=2,i=44100;let s=new Float32Array,h=window.audioContext.createGain();h.gain.value=.1,h.connect(window.audioContext.destination);let e=window.audioContext.currentTime,r=[];const o=new n({QD:30,sN:t=>{let i=new Float32Array(t.buffer),h=new Float32Array(s.length+i.length);h.set(s,0),h.set(i,s.length),s=h},hN:t=>{},bufferSize:102400});await o.init();const l=await fetch('./SCC1_Florestan.sf2'),a=new Uint8Array(await l.arrayBuffer());function c(){if(!window.audioContext||!s.length)return;let n=window.audioContext.createBufferSource();const o=s.length/t,l=window.audioContext.createBuffer(t,o,i);for(let i=0;i{t.stop(window.audioContext.currentTime)})),r=[],h.gain.value=t}}function d(t,i){-1!==t&&window._tinyMidiVolume(t),e=window.audioContext.currentTime,f=setInterval(c,250),o.dN(i)}o.aN(a),window._tinyMidiStop=async t=>{t?function(t,i){const s=window.audioContext.currentTime;h.gain.cancelScheduledValues(s),h.gain.setValueAtTime(h.gain.value,s),h.gain.linearRampToValueAtTime(t,s+2),setTimeout(i,2e3)}(0,(()=>{u()})):u()},window._tinyMidiVolume=(t=1)=>{h.gain.value=t},window._tinyMidiPlay=async(t,i,s)=>{t&&(await window._tinyMidiStop(s),s?setTimeout((()=>{d(i,t)}),2e3):d(i,t))}})()},8227:(t,i,s)=>{t.exports=s.p+"9f86b5397894e28b5ae2.wasm"}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var s=n[t]={exports:{}};return e[t](s,s.exports,r),s.exports}r.m=e,t="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",i="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",s="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",h=t=>{t&&t.d<1&&(t.d=1,t.forEach((t=>t.r--)),t.forEach((t=>t.r--?t.r++:t())))},r.a=(e,n,r)=>{var o;r&&((o=[]).d=-1);var l,a,c,f=new Set,u=e.exports,d=new Promise(((t,i)=>{c=i,a=t}));d[i]=u,d[t]=t=>(o&&t(o),f.forEach(t),d.catch((t=>{}))),e.exports=d,n((e=>{var n;l=(e=>e.map((e=>{if(null!==e&&"object"==typeof e){if(e[t])return e;if(e.then){var n=[];n.d=0,e.then((t=>{r[i]=t,h(n)}),(t=>{r[s]=t,h(n)}));var r={};return r[t]=t=>t(n),r}}var o={};return o[t]=t=>{},o[i]=e,o})))(e);var r=()=>l.map((t=>{if(t[s])throw t[s];return t[i]})),a=new Promise((i=>{(n=()=>i(r)).r=0;var s=t=>t!==o&&!f.has(t)&&(f.add(t),t&&!t.d&&(n.r++,t.push(n)));l.map((i=>i[t](s)))}));return n.r?a:r()}),(t=>(t?c(d[s]=t):a(u),h(o)))),o&&o.d<0&&(o.d=0)},r.d=(t,i)=>{for(var s in i)r.o(i,s)&&!r.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:i[s]})},r.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),r.p="/Client2/",r.b=document.baseURI||self.location.href;r(7906)})(); \ No newline at end of file