From 5fc15373dc0d6abb79fa19910316c371bfb4d529 Mon Sep 17 00:00:00 2001 From: ultraviolet-jordan Date: Wed, 12 Jun 2024 03:11:48 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=202004Scap?= =?UTF-8?q?e/Client2@afe38124407ed75a1c72bec8edbaa6c99c3fff94=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index d190ffe6..c7798f2f 100644 --- a/index.js +++ b/index.js @@ -1 +1 @@ -(()=>{"use strict";var t,i,s,h,e={1651:(t,i,s)=>{s.d(i,{K:()=>k});var h=s(1120),e=s(4583),n=s(2901),r=s(1069),o=s(7046),l=(s(9896),s(6666)),a=s(3045),c=s(818),f=s(670),u=s(8268),d=s(3867),w=s(7854),A=s(8950),y=s(1302),p=s(9298),m=s(8665),I=s(1312),_=s(3819),E=s(8317),g=s(9234),C=s(1908),T=s(123),O=s(5637),b=s(6948),v=s(2164),L=s(8738),R=s(3764),S=s(8534),M=s(6730);class k extends o.A{static tt=225;static it=10;static portOffset=0;static members=!0;static st=!1;static ht='';static et='';static nt=!1;static rt=2;static ot=!1;static lt='https://raw.githubusercontent.com/2004scape/Server/main';static exponent=58778699976184461502525193738213253649000149147835990136706041084440742975821n;static ct=7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789n;static ft=0;static ut=0;static dt=0;static wt=0;static At=0;static yt=0;static It=0;static _t=0;static Et=0;static gt=0;static Ct=0;static Tt=0;static Ot=0;static bt=0;static vt=0;static Lt=()=>{a.A.st=!1,e.A.st=!1,k.st=!1,c.A.st=!1};static Rt=()=>{a.A.st=!0,e.A.st=!0,k.st=!0,c.A.st=!0};St=2048;Mt=2047;kt=!1;xt=!1;Dt=!1;Nt=!1;db=null;Pt=0;Ft=[];stream=null;in=r.A.Ut(1);Bt=r.A.Ut(1);Gt=r.A.Ut(1);Ht=0n;Wt=0;Yt=0;Vt=0;Kt=null;Xt=0;packetSize=0;zt=0;jt=0;Zt=0;qt=null;$t=!0;Jt=0;Qt=0;ti=null;ii=null;si=null;hi=null;ei=null;ni=null;ri=null;oi=null;li=null;ai=null;ci=null;fi='';ui='';username='';password='';di=null;wi=null;Ai=null;yi=null;pi=[];mi=!1;Ii=null;_i=null;Ei=null;gi=null;Ci=null;Ti=null;Oi=null;bi=null;vi=null;Li=null;Ri=new Int32Array(256);Si=0;Mi=0;ki=0;xi=null;Di=null;Ni=null;Pi=null;Fi=null;Ui=null;Bi=null;Gi=null;Hi=null;Wi=null;Yi=null;Vi=null;Ki=null;Xi=null;zi=null;ji=null;Zi=null;qi=null;$i=null;Ji=null;Qi=null;ts=new Int32Array(33);ss=new Int32Array(33);hs=new Int32Array(151);es=new Int32Array(151);ns=null;rs=null;os=null;ls=null;cs=null;fs=null;us=new d.ds(13,null);ws=null;As=null;ys=new d.ds(50,null);ps=new d.ds(50,null);Is=new d.ds(20,null);_s=new d.ds(20,null);Es=null;gs=new d.ds(8,null);Cs=null;Ts=null;Os=null;bs=null;vs=null;Ls=null;Rs=null;Ss=null;Ms=null;ks=null;xs=null;Ds=null;Ns=null;Ps=null;Fs=null;Us=null;Bs=null;Gs=null;Hs=new d.ds(1e3,null);Ws=!1;Ys=!1;Vs=!1;Ks=!1;Xs=-1;zs=0;js=0;Zs=0;qs=0;$s=0;Js=0;Qs=!1;th=0;ih=0;sh=0;hh=0;eh=0;nh=0;rh=[];oh=-1;lh=-1;ah=new h.A;fh=78;uh=0;dh=0;wh=[];Ah=0;yh=0;ph=0;mh=0;Ih=0;_h=0;Eh=0;gh=0;Ch=[];Th=[];Oh=[];bh=[];Lh=null;Rh=-1;Sh=3;Mh=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];kh=0;xh=0;Dh=0;Nh=!1;Ph=0;Fh=!1;Uh='';Bh='';Gh=0;Hh='';Wh=!1;Yh=-1;Vh=new d.ds(100,null);Kh=new d.ds(100,null);messageType=new Int32Array(100);Xh=new Int32Array(100);zh=0;jh=0;Zh=0;qh='';$h=0;Jh=0;Qh=0;te=0;ie=0;se=0;he=0;ee=0;ne=0;re=!1;oe=0;le=0;ae=0;ce=0;fe=null;ue=0;de=0;we=0;Ae=0;ye=!1;pe=[];me=[];Ie=0;_e=0;Ee=0;ge=null;Ce=0;Te=new Int32Array(500);Oe=new Int32Array(500);be=new Int32Array(500);ve=new Int32Array(500);Le=0;Re=0;Se=0;Me='';ke=!1;xe=-1;De=0;Ne=0;Pe=0;Fe=0;Ue=0;Be=new Int32Array(1e3);Ge=new Int32Array(1e3);He=null;We=0;Ye=0;Ve=0;Ke=0;Xe=0;ze=!1;je=0;Ze=0;qe=0;$e=0;Je=2;Qe=2;tn=1;sn=new Int32Array(5);hn=new d.ds(5,!1);en=new Int32Array(5);nn=new Int32Array(5);rn=new Int32Array(5);ln=0;an=0;cn=0;fn=0;un=0;dn=0;wn=0;An=0;yn=0;pn=1;mn=2;In=-1;_n=0;En=0;gn=0;Cn=0;Tn=0;On=0;bn=null;vn=null;Ln=null;Rn=0;Sn=0;Mn=new Int8Array(16384);kn=new d.ds(f.A.xn,null);Dn=0;Nn=0;Pn=128;Fn=0;Un=0;Bn=0;Gn=0;Hn=0;Wn=null;Yn=null;Vn=new d.Kn(f.A.Xn,f.A.Xn);zn=0;jn=0;Zn=0;qn=0;$n=0;Jn=0;Qn=0;tr=0;ir=0;sr=0;hr=0;er=0;nr=new d.ds(this.St,null);rr=0;lr=new Int32Array(this.St);ar=0;cr=0;ur=new Int32Array(this.St);dr=new Int32Array(1e3);wr=new d.ds(this.St,null);Ar=new d.ds(8192,null);yr=0;pr=new Int32Array(8192);mr=new l.A;Ir=new l.A;_r=new l.A;Er=new l.A;gr=new d.Cr(f.A.xn,f.A.Xn,f.A.Xn,null);Tr=new l.A;Or=new Int32Array(4e3);br=new Int32Array(4e3);vr=new Int32Array(f.A.Xn*f.A.Xn);Lr=new Int32Array(f.A.Xn*f.A.Xn);Rr=0;Sr=null;Mr=0;kr=0;Dr=-1;Nr=0;Pr=0;Fr=0;Ur=0;Br=!1;Gr=!0;Hr=!1;Wr=new Int32Array(7);Yr=new Int32Array(5);Vr=0;Kr=0;static Xr=50;zr=new Int32Array(k.Xr);jr=new Int32Array(k.Xr);Zr=new Int32Array(k.Xr);qr=new Int32Array(k.Xr);$r=new Int32Array(k.Xr);Jr=new Int32Array(k.Xr);Qr=new Int32Array(k.Xr);io=new d.ds(k.Xr,null);so=new d.ds(100,null);ho=new BigInt64Array(100);eo=new Int32Array(100);no=null;ro=0;oo=!0;lo=new Int32Array(50);ao=new Int32Array(50);co=new Int32Array(50);fo=192;uo=-1;do=-1;wo=0;Ao=0;yo=0;po=!0;mo=null;Io=0;_o=0;Eo=192;Co=new d.ds(16,null);To=0;Oo=!1;bo=()=>{try{this.stream&&this.stream.close()}catch(t){}this.stream=null,(0,T.vo)(),this.Bt=null,this.Gt=null,this.in=null,this.Ln=null,this.bn=null,this.vn=null,this.Wn=null,this.Yn=null,this.He=null,this.kn=null,this.vr=null,this.Lr=null,this.Or=null,this.br=null,this.Mn=null,this.Di=null,this.Ni=null,this.Pi=null,this.Fi=null,this.Ui=null,this.Bi=null,this.Gi=null,this.Hi=null,this.Wi=null,this.Yi=null,this.Vi=null,this.Ki=null,this.Xi=null,this.zi=null,this.ji=null,this.Zi=null,this.qi=null,this.ns=null,this.os=null,this.rs=null,this.ls=null,this.cs=null,this.fs=null,this.us=null,this.Rs=null,this.Ss=null,this.Ms=null,this.ks=null,this.xs=null,this.Ds=null,this.Ns=null,this.Ps=null,this.Fs=null,this.Us=null,this.As=null,this.Is=null,this._s=null,this.gs=null,this.Cs=null,this.Ts=null,this.Os=null,this.bs=null,this.ys=null,this.ps=null,this.Vn=null,this.nr=null,this.lr=null,this.ur=null,this.wr=null,this.dr=null,this.Ar=null,this.pr=null,this.gr=null,this.Tr=null,this.Er=null,this.mr=null,this.Ir=null,this._r=null,this.be=null,this.ve=null,this.Te=null,this.Oe=null,this.rh=null,this.pe=null,this.Be=null,this.Ge=null,this.Hs=null,this.ws=null,this.so=null,this.ho=null,this.eo=null,this.hi=null,this.ei=null,this.ti=null,this.ii=null,this.si=null,this.ni=null,this.ri=null,this.oi=null,this.li=null,this.Lo(),O.A.bo(),b.A.bo(),y.A.bo(),v.A.Ro=null,E.A.Ro=null,h.A.Ro=null,I.A.Ro=null,L.A.Ro=null,L.A.So=null,R.A.Ro=null,this.Mo=null,u.A.So=null,e.A.bo(),a.A.bo(),m.A.bo(),S.A.Ro=[],M.A.Ro=[]};ko(){return this.Jt}xo(){return this.Wh}Do(){return this.Fh}No(){return this.lh}Po(){return this.Xs}Lo=()=>{this.mi=!1,this.xi&&(clearInterval(this.xi),this.xi=null),this.ai=null,this.ci=null,this.pi=[],this.Oi=null,this.bi=null,this.vi=null,this.Li=null,this.gi=null,this.Ei=null,this.Ci=null,this.Ti=null,this.Ii=null,this._i=null};Fo=async(t,i,s,h)=>{let e=5,o=await(this.db?.Uo(t));if(o&&r.A.Bo(o)!==s&&(o=void 0),o)return new n.A(o);for(;!o;){await this.Go(h,`Requesting ${i}`);try{o=await(0,g.Ho)(`${k.et}/${t}${s}`)}catch(t){o=void 0;for(let t=e;t>0;t--)await this.Go(h,`Error loading - Will retry in ${t} secs.`),await(0,g.Wo)(1e3);e*=2,e>60&&(e=60)}}return await(this.db?.Yo(t,o)),new n.A(o)};Vo=async(t,i,s)=>{let h=await(this.db?.Uo(t+'.mid'));if(h&&12345678!==i&&r.A.Bo(h)!==i&&(h=void 0),!h)try{h=await(0,g.Ho)(`${k.et}/${t}_${i}.mid`),s!==h.length&&(h=h.slice(0,s))}catch(t){}if(!h)return;await(this.db?.Yo(t+'.mid',h));const e=new r.A(Uint8Array.from(h)).Ko,n=C.A.read(e,h,s,4);(0,T.Xo)(n,this.Eo)};zo=()=>{if(w.jo.fillStyle='black',w.jo.fillRect(0,0,this.width,this.height),this.Zo(1),this.Dt){this.mi=!1,w.jo.font='bold 16px helvetica, sans-serif',w.jo.textAlign='left',w.jo.fillStyle='yellow';let t=35;w.jo.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,w.jo.fillStyle='white',w.jo.fillText('To fix this try the following (in order):',30,t),t+=50,w.jo.font='bold 12px helvetica, sans-serif',w.jo.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.jo.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,w.jo.fillText('3: Try using a different game-world',30,t),t+=30,w.jo.fillText('4: Try rebooting your computer',30,t),t+=30,w.jo.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.Nt&&(this.mi=!1,w.jo.font='bold 20px helvetica, sans-serif',w.jo.textAlign='left',w.jo.fillStyle='white',w.jo.fillText('Error - unable to load game!',50,50),w.jo.fillText('To play RuneScape make sure you play from',50,100),w.jo.fillText('https://2004scape.org',50,150)),this.xt){this.mi=!1,w.jo.font='bold 13px helvetica, sans-serif',w.jo.textAlign='left',w.jo.fillStyle='yellow';let t=35;w.jo.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,w.jo.fillStyle='white',w.jo.fillText('To fix this try the following (in order):',30,t),t+=50,w.jo.font='bold 12px helvetica, sans-serif',w.jo.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.jo.fillText('2: Try rebooting your computer, and reloading',30,t)}};qo=t=>{if(!t.$o)return!1;for(let i=0;i=h)return!1}else if(3===t.$o[i]){if(s<=h)return!1}else if(4===t.$o[i]){if(s===h)return!1}else if(s!==h)return!1}return!0};tl=(t,i,s,h,e)=>{this.vs?.draw(t,i),this.Ls?.draw(t,i+e-16),A.A.fillRect(t,i+16,16,e-32,p.A.il);let n=(e-32)*e/h|0;n<8&&(n=8);const r=(e-n-32)*s/(h-e)|0;A.A.fillRect(t,i+r+16,16,n,p.A.sl),A.A.hl(t,i+r+16,p.A.el,n),A.A.hl(t+1,i+r+16,p.A.el,n),A.A.nl(t,i+r+16,p.A.el,16),A.A.nl(t,i+r+17,p.A.el,16),A.A.hl(t+15,i+r+16,p.A.rl,n),A.A.hl(t+14,i+r+17,p.A.rl,n-1),A.A.nl(t,i+r+n+15,p.A.rl,16),A.A.nl(t+1,i+r+n+14,p.A.rl,15)};ol=(t,i)=>{let s=!1;const e=h.A.Ro[t];if(!e.ll)return!1;for(let t=0;th.delay[n.ul];)n.fl-=h.delay[n.ul]+1,n.ul++,n.ul>=h.dl&&(n.ul-=h.wl,(n.ul<0||n.ul>=h.dl)&&(n.ul=0)),s=!0}}}return s};Al=(t,i,s,n,r=!1)=>{if(0!==t.type||!t.ll||t.hide&&this.$h!==t.id&&this.Jh!==t.id&&this.Qh!==t.id)return;const o=A.A.left,l=A.A.top,a=A.A.right,c=A.A.bottom;A.A.yl(i,s,i+t.width,s+t.height);const f=t.ll.length;for(let o=0;o0&&this.gl(c),c.type===h.A.Cl)c.Tl>c.scroll-c.height&&(c.Tl=c.scroll-c.height),c.Tl<0&&(c.Tl=0),this.Al(c,l,a,c.Tl,r),c.scroll>c.height&&this.tl(l+c.width,a,c.Tl,c.scroll,c.height);else if(c.type===h.A.Ol){let t=0;for(let i=0;i0){let i=0,s=0;const n=c.Ll[t]-1;if(h>=-32&&h<=512&&e>=-32&&e<=334||0!==this.se&&this.ie===t){const r=y.A.kl(n,c.Rl[t]);if(0!==this.se&&this.ie===t&&this.te===c.id?(i=this.xl-this.he,s=this.Dl-this.ee,i<5&&i>-5&&(i=0),s<5&&s>-5&&(s=0),this.ne<5&&(i=0,s=0),r.Nl(128,h+i,e+s)):0!==this.ue&&this.de===t&&this.we===c.id?r.Nl(128,h,e):r.draw(h,e),33===r.Pl||1!==c.Rl[t]){const n=c.Rl[t];this.di?.Fl(h+i+1,e+10+s,this.Ul(n),p.A.Bl),this.di?.Fl(h+i,e+9+s,this.Ul(n),p.A.Gl)}}}else if(c.Hl&&t<20){const i=c.Hl[t];i?.draw(h,e)}t++}}else if(c.type===h.A.Wl)c.fill?A.A.fillRect(l,a,c.width,c.height,c.Yl):A.A.Il(l,a,c.width,c.height,c.Yl);else if(c.type===h.A.Vl){const t=c.font;let i=c.Yl,s=c.text;if(this.Qh!==c.id&&this.Jh!==c.id&&this.$h!==c.id||0===c.Kl||(i=c.Kl),this.qo(c)&&(i=c.Xl,c.zl&&c.zl.length>0&&(s=c.zl)),c.jl===h.A.Zl&&this.ye&&(s='Please wait...',i=c.Yl),!t||!s)continue;for(let h=a+t.height;s.length>0;h+=t.height){if(-1!==s.indexOf('%')){for(;;){const t=s.indexOf('%1');if(-1===t)break;s=s.substring(0,t)+this.ql(this.Jo(c,0))+s.substring(t+2)}for(;;){const t=s.indexOf('%2');if(-1===t)break;s=s.substring(0,t)+this.ql(this.Jo(c,1))+s.substring(t+2)}for(;;){const t=s.indexOf('%3');if(-1===t)break;s=s.substring(0,t)+this.ql(this.Jo(c,2))+s.substring(t+2)}for(;;){const t=s.indexOf('%4');if(-1===t)break;s=s.substring(0,t)+this.ql(this.Jo(c,3))+s.substring(t+2)}for(;;){const t=s.indexOf('%5');if(-1===t)break;s=s.substring(0,t)+this.ql(this.Jo(c,4))+s.substring(t+2)}}const e=s.indexOf('\\n');let n;-1!==e?(n=s.substring(0,e),s=s.substring(e+2)):(n=s,s=''),c.$l?t.Jl(l+(c.width/2|0),h,n,i,c.Ql):t.ta(l,h,n,i,c.Ql)}}else if(c.type===h.A.ia){let t;t=this.qo(c)?c.sa:c.ha,t?.draw(l,a)}else if(c.type===h.A.ea){const t=e.A.na,i=e.A.ra;e.A.na=l+(c.width/2|0),e.A.ra=a+(c.height/2|0);const s=e.A.sin[c.oa]*c.zoom>>16,h=e.A.cos[c.oa]*c.zoom>>16,n=this.qo(c);let r;r=n?c.cl:c.al;let o=null;if(-1===r)o=c.la(-1,-1,n);else{const t=I.A.Ro[r];t.frames&&t.aa&&(o=c.la(t.frames[c.ul],t.aa[c.ul],n))}o&&o.ca(0,c.fa,0,c.oa,0,s,h),e.A.na=t,e.A.ra=i}else if(c.type===h.A.ua){const t=c.font;if(!t||!c.Ll||!c.Rl)continue;let i=0;for(let s=0;s0){const e=y.A.get(c.Ll[i]-1);let n=e.name;if((e.da||1!==c.Rl[i])&&(n=n+' x'+this.wa(c.Rl[i])),!n)continue;const r=l+h*(c.Sl+115),o=a+s*(c.Ml+12);c.$l?t.Jl(r+(c.width/2|0),o,n,c.Yl,c.Ql):t.ta(r,o,n,c.Yl,c.Ql)}i++}}}A.A.yl(o,l,a,c)};gl=t=>{let i=t.El;if(i>=h.A.Aa&&i<=h.A.ya)i--,i>=this.Vr?(t.text='',t.jl=0):(t.text=this.so[i],t.jl=1);else if(i>=h.A.pa&&i<=h.A.ma)i-=h.A.pa,i>=this.Vr?(t.text='',t.jl=0):(0===this.eo[i]?t.text='@red@Offline':this.eo[i]===k.it?t.text='@gre@World-'+(this.eo[i]-9):t.text='@yel@World-'+(this.eo[i]-9),t.jl=1);else if(i===h.A.Ia)t.scroll=15*this.Vr+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i>=h.A._a&&i<=h.A.Ea)i-=h.A._a,i>=this.dh?(t.text='',t.jl=0):(t.text=_.A.ga(_.A.Ca(this.wh[i])),t.jl=1);else if(i===h.A.Ta)t.scroll=15*this.dh+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i===h.A.Oa){if(t.oa=150,t.fa=256*Math.sin(this.Pt/40)&2047,this.Hr){this.Hr=!1;const i=new d.ds(7,null);let s=0;for(let t=0;t<7;t++){const h=this.Wr[t];h>=0&&(i[s++]=E.A.Ro[h].la())}const h=m.A.ba(i,s);for(let t=0;t<5;t++)0!==this.Yr[t]&&(h.va(u.A.La[t][0],u.A.La[t][this.Yr[t]]),1===t&&h.va(u.A.Ra[0],u.A.Ra[this.Yr[t]]));if(this.Sr){const i=I.A.Ro[this.Sr.Sa].frames;i&&(h.Ma(),h.ka(i[0]),h.xa(64,850,-30,-50,-30,!0),t.model=h)}}}else if(i===h.A.Da)this.Bs||(this.Bs=t.ha,this.Gs=t.sa),this.Gr?t.ha=this.Gs:t.ha=this.Bs;else if(i===h.A.Na)this.Bs||(this.Bs=t.ha,this.Gs=t.sa),this.Gr?t.ha=this.Bs:t.ha=this.Gs;else if(i===h.A.Pa)t.text=this.Me,this.Pt%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(i===h.A.Fa)this.Br?this.ke?(t.Yl=p.A.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.Yl=p.A._l,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(i===h.A.Ua||i===h.A.Ba)if(0===this.De)t.text='';else{let i;i=0===this.Ne?'earlier today':1===this.Ne?'yesterday':this.Ne+' days ago',t.text='You last logged in '+i+' from: '+_.A.Ga(this.De)}else if(i===h.A.Ha)0===this.Fe&&(t.text='0 unread messages',t.Yl=p.A.Gl),1===this.Fe&&(t.text='1 unread message',t.Yl=p.A.GREEN),this.Fe>1&&(t.text=this.Fe+' unread messages',t.Yl=p.A.GREEN);else if(i===h.A.Wa)if(201===this.Pe)t.text='';else if(200===this.Pe)t.text='You have not yet set any password recovery questions.';else{let i;i=0===this.Pe?'Earlier today':1===this.Pe?'Yesterday':this.Pe+' days ago',t.text=i+' you changed your recovery questions'}else i===h.A.Ya?201===this.Pe?t.text='':200===this.Pe?t.text='We strongly recommend you do so now to secure your account.':t.text='If you do not remember making this change then cancel it immediately':i===h.A.Va&&(201===this.Pe?t.text='':(this.Pe,t.text="Do this from the 'account management' area on our front webpage"))};Jo=(t,i)=>{if(!t.scripts||i>=t.scripts.length)return-2;try{const s=t.scripts[i];if(!s)return-1;let e=0,n=0;for(;;){const t=s[n++];if(0===t)return e;if(1===t)e+=this.Th[s[n++]];else if(2===t)e+=this.Oh[s[n++]];else if(3===t)e+=this.Ch[s[n++]];else if(4===t){const t=h.A.Ro[s[n++]],i=s[n++]+1;if(t.Ll&&t.Rl)for(let s=0;st<999999999?String(t):'*';wa=t=>{let i=String(t);for(let t=i.length-3;t>0;t-=3)i=i.substring(0,t)+','+i.substring(t);return i.length>8?i='@gre@'+i.substring(0,i.length-8)+' million @whi@('+i+')':i.length>4&&(i='@cya@'+i.substring(0,i.length-4)+'K @whi@('+i+')'),' '+i};Ul=t=>t<1e5?String(t):t<1e7?(t/1e3|0)+'K':(t/1e6|0)+'M'}},7604:(t,i,s)=>{s.d(i,{w:()=>r});var h=s(7046),e=s(1651),n=s(9234);async function r(){await async function(){0===h.A.getParameter('world').length&&h.A.setParameter('world','1');'localhost'===window.location.hostname&&'0'===h.A.getParameter('world')?(e.K.ht='http://localhost',e.K.et='http://localhost',e.K.portOffset=0):await async function(t){const i=await o(t,parseInt(h.A.getParameter('world'),10)),s=new URL(i.address);e.K.it=10+i.id-1,e.K.ht=`${s.protocol}//${s.hostname}`,e.K.et=`${s.protocol}//${s.hostname}:${s.port}`,t||(e.K.ht=e.K.ht.replace('https:','http:'));e.K.portOffset=i.portOffset,e.K.members=!0===i?.members,h.A.setParameter('world',i.id.toString(10))}(window.location.protocol.startsWith('https'))}(),function(){0===h.A.getParameter('detail').length&&h.A.setParameter('detail','high');'low'===h.A.getParameter('detail')?e.K.Rt():e.K.Lt()}(),0===h.A.getParameter('method').length&&h.A.setParameter('method','0')}async function o(t,i,s=0){if(s>=10)throw new Error('could not find world to connect!');const h=t?'https:':'http:';let e;try{e=JSON.parse(await(0,n.Xa)(`${h}//2004scape.org/api/v1/worldlist`))}catch(h){return await(0,n.Wo)(1e3),o(t,i,++s)}e.push({id:0,region:'Local Development',address:'http://localhost',portOffset:0,members:!0,nr:0});const r=e.find((t=>t.id===i));return r||o(t,i,10)}},7906:(t,i,s)=>{s.a(t,(async(t,i)=>{try{var h=s(1312),e=s(5637),n=s(1302),r=s(6948),o=s(8317),l=s(8738),a=s(3764),c=s(1120),f=s(1183),u=s(8950),d=s(4583),w=s(1673),A=s(2511),y=s(2682),p=s(8665),m=s(9298),I=s(1069),_=s(3554),E=s(353),g=s(2634),C=s(4544),T=s(2215),O=s(3955),b=s(7953),v=s(2646),L=s(3937),R=(s(9896),s(1908)),S=s(6666),M=s(3819),k=s(2595),x=s(3045),D=s(818),N=s(5599),P=s(1023),F=s(6169),U=s(2630),B=s(5327),G=s(670),H=s(9456),W=s(8268),Y=s(8412),V=s(3606),K=s(4197),X=s(254),z=s(7628),j=s(123),Z=s(9234),q=s(3867),$=s(1651),J=s(8534),Q=s(6730),tt=s(2164),it=s(7604),st=s(3795),ht=s(4909);class t extends $.K{load=async()=>{if(this.kt)this.xt=!0;else{this.kt=!0;try{await this.Go(10,'Connecting to fileserver'),await R.A.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new C.A(await C.A.openDatabase());const t=new I.A(new Uint8Array(await(0,Z.Ho)(`${$.K.et}/crc`)));for(let i=0;i<9;i++)this.Ft[i]=t.Ko;$.K.st||await this.Vo('scape_main',12345678,4e4);const i=await this.Fo('title','title screen',this.Ft[1],10);this.qt=i,this.di=y.A.za(i,'p11'),this.wi=y.A.za(i,'p12'),this.Ai=y.A.za(i,'b12'),this.yi=y.A.za(i,'q8'),await this.ja(),this.Za();const s=await this.Fo('config','config',this.Ft[2],15),u=await this.Fo('interface','interface',this.Ft[3],20),m=await this.Fo('media','2d graphics',this.Ft[4],30),_=await this.Fo('models','3d graphics',this.Ft[5],40),E=await this.Fo('textures','textures',this.Ft[6],60),g=await this.Fo('wordenc','chat system',this.Ft[7],65),T=await this.Fo('sounds','sound effects',this.Ft[8],70);this.Yn=new q.qa(G.A.xn,G.A.Xn,G.A.Xn),this.Wn=new q.$a(G.A.xn,G.A.Xn+1,G.A.Xn+1),this.Wn&&(this.He=new x.A(this.Wn,G.A.Xn,G.A.xn,G.A.Xn));for(let t=0;t34||t>34))999===i&&(i=h);else if(999!==i){s=h;break}this.hs[t-9]=i-21,this.es[t-9]=s-i}d.A.rc(479,96),this.$i=d.A.oc,d.A.rc(190,261),this.Ji=d.A.oc,d.A.rc(512,334),this.Qi=d.A.oc;const V=new Int32Array(9);for(let t=0;t<9;t++){const i=32*t+128+15,s=3*i+600,h=d.A.sin[i];V[t]=s*h>>16}x.A.init(512,334,500,800,V),b.A.ec(g),this.lc()}catch(t){console.error(t),this.Dt=!0}}};update=async()=>{this.xt||this.Dt||this.Nt||(this.Pt++,this.ac?await this.cc():await this.fc())};draw=async()=>{this.xt||this.Dt||this.Nt?this.zo():(this.ac?this.uc():await this.dc(),this.zs=0)};refresh=()=>{this.$t=!0};Go=async(t,i)=>{if(console.log(`${t}%: ${i}`),await this.wc(),!this.qt)return void await super.Go(t,i);this.si?.bind();this.Ai?.Ac(180,54,'RuneScape is loading - please wait...',m.A._l);u.A.Il(28,62,304,34,m.A.yc),u.A.Il(29,63,302,32,m.A.Bl),u.A.fillRect(30,64,3*t,30,m.A.yc),u.A.fillRect(30+3*t,64,300-3*t,30,m.A.Bl),this.Ai?.Ac(180,85,i,m.A._l),this.si?.draw(214,186),this.$t&&(this.$t=!1,this.mi||(this.hi?.draw(0,0),this.ei?.draw(661,0)),this.ti?.draw(128,0),this.ii?.draw(214,386),this.ni?.draw(0,265),this.ri?.draw(574,265),this.oi?.draw(128,186),this.li?.draw(574,186)),await(0,Z.Wo)(5)};mc=()=>{this.mi&&(this.Ic(),this.Ic(),this._c())};wc=async()=>{this.ti||(this.Mo=null,this.Fi=null,this.Ni=null,this.Di=null,this.Pi=null,this.Ui=null,this.Bi=null,this.Gi=null,this.hi=new f.A(128,265),u.A.clear(),this.ei=new f.A(128,265),u.A.clear(),this.ti=new f.A(533,186),u.A.clear(),this.ii=new f.A(360,146),u.A.clear(),this.si=new f.A(360,200),u.A.clear(),this.ni=new f.A(214,267),u.A.clear(),this.ri=new f.A(215,267),u.A.clear(),this.oi=new f.A(86,79),u.A.clear(),this.li=new f.A(87,79),u.A.clear(),this.qt&&(await this.ja(),this.Za()),this.$t=!0)};ja=async()=>{if(!this.qt)return;const t=await A.A.Ec(this.qt,'title');this.hi?.bind(),t.tc(0,0),this.ei?.bind(),t.tc(-661,0),this.ti?.bind(),t.tc(-128,0),this.ii?.bind(),t.tc(-214,-386),this.si?.bind(),t.tc(-214,-186),this.ni?.bind(),t.tc(0,-265),this.ri?.bind(),t.tc(-128,-186),this.oi?.bind(),t.tc(-128,-186),this.li?.bind(),t.tc(-574,-186),t.Ja(),this.hi?.bind(),t.tc(394,0),this.ei?.bind(),t.tc(-267,0),this.ti?.bind(),t.tc(266,0),this.ii?.bind(),t.tc(180,-386),this.si?.bind(),t.tc(180,-186),this.ni?.bind(),t.tc(394,-265),this.ri?.bind(),t.tc(-180,-265),this.oi?.bind(),t.tc(212,-186),this.li?.bind(),t.tc(-180,-186);const i=A.A.za(this.qt,'logo');this.ti?.bind(),i.draw((this.width/2|0)-(i.width/2|0)-128,18)};gc=t=>{if(!this.gi||!this.Ei)return;this.gi.fill(0);for(let t=0;t<5e3;t++){const t=128*Math.random()*256|0;this.gi[t]=256*Math.random()|0}for(let t=0;t<20;t++){for(let t=1;t<255;t++)for(let i=1;i<127;i++){const s=i+(t<<7);this.Ei[s]=(this.gi[s-1]+this.gi[s+1]+this.gi[s-128]+this.gi[s+128])/4|0}const t=this.gi;this.gi=this.Ei,this.Ei=t}if(t){let i=0;for(let s=0;s{if(this.qt){this.ai=w.A.za(this.qt,'titlebox'),this.ci=w.A.za(this.qt,'titlebutton');for(let t=0;t<12;t++)this.pi[t]=w.A.za(this.qt,'runes',t);this.Ii=new A.A(128,265),this._i=new A.A(128,265),this.hi&&(0,Z.Oc)(this.hi.nc,0,this.Ii.nc,0,33920),this.ei&&(0,Z.Oc)(this.ei.nc,0,this._i.nc,0,33920),this.bi=new Int32Array(256);for(let t=0;t<64;t++)this.bi[t]=262144*t;for(let t=0;t<64;t++)this.bi[t+64]=1024*t+m.A.RED;for(let t=0;t<64;t++)this.bi[t+128]=4*t+m.A.Gl;for(let t=0;t<64;t++)this.bi[t+192]=m.A._l;this.vi=new Int32Array(256);for(let t=0;t<64;t++)this.vi[t]=1024*t;for(let t=0;t<64;t++)this.vi[t+64]=4*t+m.A.GREEN;for(let t=0;t<64;t++)this.vi[t+128]=262144*t+m.A.bc;for(let t=0;t<64;t++)this.vi[t+192]=m.A._l;this.Li=new Int32Array(256);for(let t=0;t<64;t++)this.Li[t]=4*t;for(let t=0;t<64;t++)this.Li[t+64]=262144*t+m.A.BLUE;for(let t=0;t<64;t++)this.Li[t+128]=1024*t+m.A.vc;for(let t=0;t<64;t++)this.Li[t+192]=m.A._l;this.Oi=new Int32Array(256),this.gi=new Int32Array(32768),this.Ei=new Int32Array(32768),this.gc(null),this.Ci=new Int32Array(32768),this.Ti=new Int32Array(32768),this.Go(10,'Connecting to fileserver').then((()=>{this.mi||(this.mi=!0,this.xi=setInterval(this.mc,35))}))}};fc=async()=>{if(0===this.Jt){let t=(this.width/2|0)-80,i=20+(this.height/2|0);i+=20,1===this.Lc&&this.Rc>=t-75&&this.Rc<=t+75&&this.Sc>=i-20&&this.Sc<=i+20&&(this.Jt=3,this.Qt=0),t=80+(this.width/2|0),1===this.Lc&&this.Rc>=t-75&&this.Rc<=t+75&&this.Sc>=i-20&&this.Sc<=i+20&&(this.fi='',this.ui='Enter your username & password.',this.Jt=2,this.Qt=0)}else if(2===this.Jt){let t=(this.height/2|0)-40;t+=30,t+=25,1===this.Lc&&this.Sc>=t-15&&this.Sc=t-15&&this.Sc=i-75&&this.Rc<=i+75&&this.Sc>=s-20&&this.Sc<=s+20&&await this.Mc(this.username,this.password,!1),i=80+(this.width/2|0),1===this.Lc&&this.Rc>=i-75&&this.Rc<=i+75&&this.Sc>=s-20&&this.Sc<=s+20&&(this.Jt=0,this.username='',this.password='');;){const t=this.kc();if(-1===t)return;let i=!1;for(let s=0;s0&&(this.username=this.username.substring(0,this.username.length-1)),9!==t&&10!==t&&13!==t||(this.Qt=1),i&&(this.username=this.username+String.fromCharCode(t)),this.username.length>12&&(this.username=this.username.substring(0,12))):1===this.Qt&&(8===t&&this.password.length>0&&(this.password=this.password.substring(0,this.password.length-1)),9!==t&&10!==t&&13!==t||(this.Qt=0),i&&(this.password=this.password+String.fromCharCode(t)),this.password.length>20&&(this.password=this.password.substring(0,20)))}}else if(3===this.Jt){const t=this.width/2|0;let i=50+(this.height/2|0);i+=20,1===this.Lc&&this.Rc>=t-75&&this.Rc<=t+75&&this.Sc>=i-20&&this.Sc<=i+20&&(this.Jt=0)}};dc=async()=>{await this.wc(),this.si?.bind(),this.ai?.draw(0,0);if(0===this.Jt){let t=180,i=80;this.Ai?.Jl(t,i,'Welcome to RuneScape',m.A.Gl,!0),t=100,i=120,this.ci?.draw(t-73,i-20),this.Ai?.Jl(t,i+5,'New user',m.A._l,!0),t=260,this.ci?.draw(t-73,i-20),this.Ai?.Jl(t,i+5,'Existing User',m.A._l,!0)}else if(2===this.Jt){let t=100,i=60;this.fi.length>0?(this.Ai?.Jl(180,i-15,this.fi,m.A.Gl,!0),this.Ai?.Jl(180,i,this.ui,m.A.Gl,!0),i+=30):(this.Ai?.Jl(180,i-7,this.ui,m.A.Gl,!0),i+=30),this.Ai?.ta(90,i,`Username: ${this.username}${0===this.Qt&&this.Pt%40<20?'@yel@|':''}`,m.A._l,!0),i+=15,this.Ai?.ta(92,i,`Password: ${M.A.Dc(this.password)}${1===this.Qt&&this.Pt%40<20?'@yel@|':''}`,m.A._l,!0),i=150,this.ci?.draw(t-73,i-20),this.Ai?.Jl(t,i+5,'Login',m.A._l,!0),t=260,this.ci?.draw(t-73,i-20),this.Ai?.Jl(t,i+5,'Cancel',m.A._l,!0)}else if(3===this.Jt){this.Ai?.Jl(180,40,'Create a free account',m.A.Gl,!0);const t=180;let i=65;this.Ai?.Jl(180,i,'To create a new account you need to',m.A._l,!0),i+=15,this.Ai?.Jl(180,i,'go back to the main RuneScape webpage',m.A._l,!0),i+=15,this.Ai?.Jl(180,i,"and choose the red 'create account'",m.A._l,!0),i+=15,this.Ai?.Jl(180,i,'button at the top right of that page.',m.A._l,!0),i=150,this.ci?.draw(t-73,i-20),this.Ai?.Jl(t,i+5,'Cancel',m.A._l,!0)}this.si?.draw(214,186),this.$t&&(this.$t=!1,this.ti?.draw(128,0),this.ii?.draw(214,386),this.ni?.draw(0,265),this.ri?.draw(574,265),this.oi?.draw(128,186),this.li?.draw(574,186))};Mc=async(t,i,s)=>{try{s||(this.fi='',this.ui='Connecting to server...',await this.dc()),this.stream=new _.A(await _.A.Nc({host:$.K.ht,port:43594+$.K.portOffset})),await(this.stream?.Pc(this.in.data,0,8)),this.in.Fc=0,this.Ht=this.in.Uc;const h=new Int32Array([Math.floor(99999999*Math.random()),Math.floor(99999999*Math.random()),Number(this.Ht>>32n),Number(this.Ht&BigInt(4294967295))]);this.Bt.Fc=0,this.Bt.p1(10),this.Bt.p4(h[0]),this.Bt.p4(h[1]),this.Bt.p4(h[2]),this.Bt.p4(h[3]),this.Bt.p4(0),this.Bt.Bc(t),this.Bt.Bc(i),this.Bt.Gc($.K.ct,$.K.exponent),this.Gt.Fc=0,s?this.Gt.p1(18):this.Gt.p1(16),this.Gt.p1(this.Bt.Fc+36+1+1),this.Gt.p1($.K.tt),this.Gt.p1($.K.st?1:0);for(let t=0;t<9;t++)this.Gt.p4(this.Ft[t]);this.Gt.Hc(this.Bt.data,this.Bt.Fc,0),this.Bt.random=new g.A(h);for(let t=0;t<4;t++)h[t]+=50;this.Kt=new g.A(h),this.stream?.write(this.Gt.data,this.Gt.Fc);const e=await this.stream.read();if(1===e)return await(0,Z.Wo)(2e3),void await this.Mc(t,i,s);if(2===e||18===e){this.Br=18===e,k.A.Wc(),this.ac=!0,this.Bt.Fc=0,this.in.Fc=0,this.Xt=-1,this.zt=-1,this.jt=-1,this.Zt=-1,this.packetSize=0,this.Wt=0,this.Vt=0,this.Yt=0,this.Ah=0,this.nh=0,this.Qs=!1,this.Yc=0;for(let t=0;t<100;t++)this.Vh[t]=null;this.oe=0,this.Ie=0,this.We=0,this.ro=0,this.Ze=(100*Math.random()|0)-50,this.qe=(110*Math.random()|0)-55,this.$e=(80*Math.random()|0)-40,this.An=(120*Math.random()|0)-60,this.yn=(30*Math.random()|0)-20,this.Fn=(20*Math.random()|0)-10&2047,this.In=-1,this.Ke=0,this.Xe=0,this.rr=0,this.yr=0;for(let t=0;t{if(null!==this.nr){this.Vt>1&&this.Vt--,this.Yt>0&&this.Yt--;for(let t=0;t<5&&await this.read();t++);if(this.ac){for(let t=0;tthis.Ao+(this.wo/22|0)&&(this.wo=i.Fc,this.Ao=Date.now(),this.uo=this.lo[t],this.do=this.ao[t],await(0,j.zc)(i.data.slice(0,i.Fc),this.fo))}catch(t){console.error(t)}this.ro--;for(let i=t;i0&&(this.yo-=20,this.yo<0&&(this.yo=0),0===this.yo&&this.po&&!$.K.st&&this.mo&&await this.Vo(this.mo,this.Io,this._o));const t=k.A.flush();if(t&&(this.Bt.jc(O.A.Zc),this.Bt.p2(t.Fc),this.Bt.Hc(t.data,t.Fc,0),t.release()),this.Wt++,this.Wt>750&&await this.qc(),this.$c(),this.Jc(),this.Qc(),this.tf(),(1===this.if[1]||1===this.if[2]||1===this.if[3]||1===this.if[4])&&this.Nn++>5&&(this.Nn=0,this.Bt.jc(O.A.sf),this.Bt.p2(this.Pn),this.Bt.p2(this.Fn),this.Bt.p1(this.An),this.Bt.p1(this.yn)),this.Ye++,0!==this.js&&(this.Zs+=20,this.Zs>=400&&(this.js=0)),0!==this.ue&&(this.Ae++,this.Ae>=15&&(2===this.ue&&(this.Ws=!0),3===this.ue&&(this.Ys=!0),this.ue=0)),0!==this.se&&(this.ne++,(this.xl>this.he+5||this.xlthis.ee+5||this.Dl=5){if(this.Le=-1,this.ef(),this.Le===this.te&&this.Re!==this.ie){const t=c.A.Ro[this.te];if(t.Ll){const i=t.Ll[this.Re];t.Ll[this.Re]=t.Ll[this.ie],t.Ll[this.ie]=i}if(t.Rl){const i=t.Rl[this.Re];t.Rl[this.Re]=t.Rl[this.ie],t.Rl[this.ie]=i}this.Bt.jc(O.A.nf),this.Bt.p2(this.te),this.Bt.p2(this.ie),this.Bt.p2(this.Re)}}else(1===this.Ce||this.rf(this.nh-1))&&this.nh>2?this.lf():this.nh>0&&await this.af(this.nh-1);this.Ae=10,this.Lc=0}if($.K.dt++,$.K.dt>127&&($.K.dt=0,this.Bt.jc(O.A.cf),this.Bt.p3(4991788)),-1!==x.A.ff&&this.Sr){const t=x.A.ff,i=x.A.uf,s=this.df(this.Sr.wf[0],this.Sr.Af[0],t,i,0,0,0,0,0,0,!0);x.A.ff=-1,s&&(this.qs=this.Rc,this.$s=this.Sc,this.js=1,this.Zs=0)}1===this.Lc&&this.Lh&&(this.Lh=null,this.Ys=!0,this.Lc=0),await this.yf(),this.pf(),this.mf(),this.If(),1!==this.hf&&1!==this.Lc||this.zs++,2===this.We&&($.K.ot?this._f():this.Ef()),2===this.We&&this.ze&&this.gf();for(let t=0;t<5;t++)this.sn[t]++;if(await this.Cf(),this.Yc++,this.Yc>4500&&(this.Yt=250,this.Yc-=500,this.Bt.jc(O.A.Tf)),this.je++,this.je>500){this.je=0;const t=8*Math.random()|0;1&~t||(this.Ze+=this.Je),2&~t||(this.qe+=this.Qe),4&~t||(this.$e+=this.tn)}if(this.Ze<-50&&(this.Je=2),this.Ze>50&&(this.Je=-2),this.qe<-55&&(this.Qe=2),this.qe>55&&(this.Qe=-2),this.$e<-40&&(this.tn=1),this.$e>40&&(this.tn=-1),this.wn++,this.wn>500){this.wn=0;const t=8*Math.random()|0;1&~t||(this.An+=this.mn),2&~t||(this.yn+=this.pn)}this.An<-60&&(this.mn=2),this.An>60&&(this.mn=-2),this.yn<-20&&(this.pn=1),this.yn>10&&(this.pn=-1),$.K.wt++,$.K.wt>110&&($.K.wt=0,this.Bt.jc(O.A.Of),this.Bt.p4(0)),this.Pr++,this.Pr>50&&this.Bt.jc(O.A.bf);try{this.stream&&this.Bt.Fc>0&&(this.stream.write(this.Bt.data,this.Bt.Fc),this.Bt.Fc=0,this.Pr=0)}catch(t){console.log(t),await this.qc()}}}};uc=()=>{if(null===this.nr)return;this.$t&&(this.$t=!1,this.Hi?.draw(0,11),this.Wi?.draw(0,375),this.Yi?.draw(729,5),this.Vi?.draw(752,231),this.Ki?.draw(0,0),this.Xi?.draw(561,0),this.zi?.draw(520,11),this.ji?.draw(520,231),this.Zi?.draw(501,375),this.qi?.draw(0,345),this.Ws=!0,this.Ys=!0,this.Vs=!0,this.Ks=!0,2!==this.We&&(this.Pi?.draw(8,11),this.Ni?.draw(561,5))),2===this.We&&this.vf(),this.Qs&&1===this.th&&(this.Ws=!0);let t=!1;if(-1!==this.oh&&(t=this.ol(this.oh,this.Ye),t&&(this.Ws=!0)),2===this.ue&&(this.Ws=!0),2===this.se&&(this.Ws=!0),this.Ws&&(this.Lf(),this.Ws=!1),-1===this.lh){this.ah.Tl=this.fh-this.uh-77,this.xl>453&&this.xl<565&&this.Dl>350&&this.Rf(this.xl-22,this.Dl-375,this.fh,77,!1,463,0,this.ah);let t=this.fh-this.ah.Tl-77;t<0&&(t=0),t>this.fh-77&&(t=this.fh-77),this.uh!==t&&(this.uh=t,this.Ys=!0)}-1!==this.lh&&(t=this.ol(this.lh,this.Ye),t&&(this.Ys=!0)),3===this.ue&&(this.Ys=!0),3===this.se&&(this.Ys=!0),this.Lh&&(this.Ys=!0),this.Qs&&2===this.th&&(this.Ys=!0),this.Ys&&(this.Sf(),this.Ys=!1),2===this.We&&(this.Mf(),this.Ni?.draw(561,5)),-1!==this.Rh&&(this.Vs=!0),this.Vs&&(-1!==this.Rh&&this.Rh===this.Sh&&(this.Rh=-1,this.Bt.jc(O.A.kf),this.Bt.p1(this.Sh)),this.Vs=!1,this.Gi?.bind(),this.fs?.draw(0,0),-1===this.oh&&(-1!==this.Mh[this.Sh]&&(0===this.Sh?this.Rs?.draw(29,30):1===this.Sh?this.Ss?.draw(59,29):2===this.Sh?this.Ss?.draw(87,29):3===this.Sh?this.Ms?.draw(115,29):4===this.Sh?this.xs?.draw(156,29):5===this.Sh?this.xs?.draw(184,29):6===this.Sh&&this.ks?.draw(212,30)),-1!==this.Mh[0]&&(0!==this.Rh||this.Pt%20<10)&&this.us[0]?.draw(35,34),-1!==this.Mh[1]&&(1!==this.Rh||this.Pt%20<10)&&this.us[1]?.draw(59,32),-1!==this.Mh[2]&&(2!==this.Rh||this.Pt%20<10)&&this.us[2]?.draw(86,32),-1!==this.Mh[3]&&(3!==this.Rh||this.Pt%20<10)&&this.us[3]?.draw(121,33),-1!==this.Mh[4]&&(4!==this.Rh||this.Pt%20<10)&&this.us[4]?.draw(157,34),-1!==this.Mh[5]&&(5!==this.Rh||this.Pt%20<10)&&this.us[5]?.draw(185,32),-1!==this.Mh[6]&&(6!==this.Rh||this.Pt%20<10)&&this.us[6]?.draw(212,34)),this.Gi?.draw(520,165),this.Bi?.bind(),this.cs?.draw(0,0),-1===this.oh&&(-1!==this.Mh[this.Sh]&&(7===this.Sh?this.Ds?.draw(49,0):8===this.Sh?this.Ns?.draw(81,0):9===this.Sh?this.Ns?.draw(108,0):10===this.Sh?this.Ps?.draw(136,1):11===this.Sh?this.Us?.draw(178,0):12===this.Sh?this.Us?.draw(205,0):13===this.Sh&&this.Fs?.draw(233,0)),-1!==this.Mh[8]&&(8!==this.Rh||this.Pt%20<10)&&this.us[7]?.draw(80,2),-1!==this.Mh[9]&&(9!==this.Rh||this.Pt%20<10)&&this.us[8]?.draw(107,3),-1!==this.Mh[10]&&(10!==this.Rh||this.Pt%20<10)&&this.us[9]?.draw(142,4),-1!==this.Mh[11]&&(11!==this.Rh||this.Pt%20<10)&&this.us[10]?.draw(179,2),-1!==this.Mh[12]&&(12!==this.Rh||this.Pt%20<10)&&this.us[11]?.draw(206,2),-1!==this.Mh[13]&&(13!==this.Rh||this.Pt%20<10)&&this.us[12]?.draw(230,2)),this.Bi?.draw(501,492),this.Pi?.bind()),this.Ks&&(this.Ks=!1,this.Ui?.bind(),this.ls?.draw(0,0),this.wi?.Jl(57,33,'Public chat',m.A._l,!0),0===this.kh&&this.wi?.Jl(57,46,'On',m.A.GREEN,!0),1===this.kh&&this.wi?.Jl(57,46,'Friends',m.A.Gl,!0),2===this.kh&&this.wi?.Jl(57,46,'Off',m.A.RED,!0),3===this.kh&&this.wi?.Jl(57,46,'Hide',m.A.bc,!0),this.wi?.Jl(186,33,'Private chat',m.A._l,!0),0===this.xh&&this.wi?.Jl(186,46,'On',m.A.GREEN,!0),1===this.xh&&this.wi?.Jl(186,46,'Friends',m.A.Gl,!0),2===this.xh&&this.wi?.Jl(186,46,'Off',m.A.RED,!0),this.wi?.Jl(326,33,'Trade/duel',m.A._l,!0),0===this.Dh&&this.wi?.Jl(326,46,'On',m.A.GREEN,!0),1===this.Dh&&this.wi?.Jl(326,46,'Friends',m.A.Gl,!0),2===this.Dh&&this.wi?.Jl(326,46,'Off',m.A.RED,!0),this.wi?.Jl(462,38,'Report abuse',m.A._l,!0),this.Ui?.draw(0,471),this.Pi?.bind()),this.Ye=0};vf=()=>{if(this.Ve++,this.xf(),this.Df(),this.Nf(),this.Pf(),this.Ff(),!this.ze){let t=this.Pn;(this.dn/256|0)>t&&(t=this.dn/256|0),this.hn[4]&&this.nn[4]+128>t&&(t=this.nn[4]+128);const i=this.Fn+this.$e&2047;if(this.Sr&&this.Uf(this.Gn,this.Bf(this.Dn,this.Sr.x,this.Sr.z)-50,this.Hn,i,t,3*t+600),$.K.ut++,$.K.ut>1802){$.K.ut=0,this.Bt.jc(O.A.Gf),this.Bt.p1(0);const t=this.Bt.Fc;this.Bt.p2(29711),this.Bt.p1(70),this.Bt.p1(256*Math.random()|0),this.Bt.p1(242),this.Bt.p1(186),this.Bt.p1(39),this.Bt.p1(61),2*Math.random()|0||this.Bt.p1(13),2*Math.random()|0||this.Bt.p2(57856),this.Bt.p2(65536*Math.random()|0),this.Bt.Hf(this.Bt.Fc-t)}}let t;t=this.ze?this.Wf():this.Yf();const i=this.ln,s=this.an,h=this.cn,e=this.fn,n=this.un;let r;for(let t=0;t<5;t++)this.hn[t]&&(r=Math.random()*(2*this.en[t]+1)-this.en[t]+Math.sin(this.sn[t]*(this.rn[t]/100))*this.nn[t]|0,0===t&&(this.ln+=r),1===t&&(this.an+=r),2===t&&(this.cn+=r),3===t&&(this.un=this.un+r&2047),4===t&&(this.fn+=r,this.fn<128&&(this.fn=128),this.fn>383&&(this.fn=383)));r=d.A.Vf,p.A.Kf=!0,p.A.Xf=0,p.A.xl=this.xl-8,p.A.Dl=this.Dl-11,u.A.clear(),this.He?.draw(this.ln,this.an,this.cn,t,this.un,this.fn,this.Pt),this.He?.zf(),this.jf(),this.Zf(),$.K.nt&&this.qf(),this.$f(r),this.Jf(),this.Pi?.draw(8,11),this.ln=i,this.an=s,this.cn=h,this.fn=e,this.un=n};Qf=()=>{e.A.tu?.clear(),e.A.iu?.clear(),r.A.So?.clear(),n.A.So?.clear(),n.A.su?.clear(),W.A.So?.clear(),l.A.So?.clear()};hu=(t,i)=>{this.eu(t.x,i,t.z)};eu=(t,i,s)=>{if(t<128||s<128||t>13056||s>13056)return this.zn=-1,void(this.jn=-1);const h=this.Bf(this.Dn,t,s)-i;this.nu(t,h,s)};nu=(t,i,s)=>{let h=t-this.ln,e=i-this.an,n=s-this.cn;const r=d.A.sin[this.fn],o=d.A.cos[this.fn],l=d.A.sin[this.un],a=d.A.cos[this.un];let c=n*l+h*a>>16;n=n*a-h*l>>16,h=c,c=e*o-n*r>>16,n=e*r+n*o>>16,e=c,n>=50?(this.zn=d.A.na+((h<<9)/n|0),this.jn=d.A.ra+((e<<9)/n|0)):(this.zn=-1,this.jn=-1)};jf=()=>{this.Kr=0;for(let t=-1;t-1))for(let t=0;t<8;t++)h.ru&1<=0&&10===this.Ah&&this.Ih===this.lr[t]&&(this.hu(i,i.height+15),this.zn>-1&&this._s[7]?.draw(this.zn-12,this.jn-s))}else 1===this.Ah&&this.yh===this.pr[t-this.rr]&&this.Pt%20<10&&(this.hu(i,i.height+15),this.zn>-1&&this._s[2]?.draw(this.zn-12,this.jn-28));if(i.ou&&(t>=this.rr||0===this.kh||3===this.kh||1===this.kh&&this.lu(i.name))&&(this.hu(i,i.height),this.zn>-1&&this.Kr<$.K.Xr&&this.Ai&&(this.qr[this.Kr]=this.Ai.au(i.ou)/2|0,this.Zr[this.Kr]=this.Ai.height,this.zr[this.Kr]=this.zn,this.jr[this.Kr]=this.jn,this.$r[this.Kr]=i.cu,this.Jr[this.Kr]=i.fu,this.Qr[this.Kr]=i.uu,this.io[this.Kr++]=i.ou,0===this.Zh&&1===i.fu&&(this.Zr[this.Kr]+=10,this.jr[this.Kr]+=5),0===this.Zh&&2===i.fu&&(this.qr[this.Kr]=60))),i.du>this.Pt+100&&(this.hu(i,i.height+15),this.zn>-1)){let t=30*i.wu/i.Au|0;t>30&&(t=30),u.A.fillRect(this.zn-15,this.jn-3,t,5,m.A.GREEN),u.A.fillRect(this.zn-15+t,this.jn-3,30-t,5,m.A.RED)}if(i.du>this.Pt+330&&(this.hu(i,i.height/2|0),this.zn>-1&&(this.Is[i.yu]?.draw(this.zn-12,this.jn-12),this.di?.Ac(this.zn,this.jn+4,i.pu.toString(),m.A.Bl),this.di?.Ac(this.zn-1,this.jn+3,i.pu.toString(),m.A._l))),$.K.nt){if(i.pathLength>0||i.mu>=this.Pt||i.Iu>this.Pt){const t=64*i.size;this._u(128*i.wf[0]+t,128*i.Af[0]+t,this.Dn,i.size,65535,!1)}this._u(i.x,i.z,this.Dn,i.size,6710886,!1);let s=0;if(this.hu(i,i.height+30),t32767&&(i-=32768),this.di?.Ac(this.zn,this.jn+s,'Face Entity: '+i,m.A._l),s-=15}(t.Eu&W.A.Lu)===W.A.Lu&&(this.di?.Ac(this.zn,this.jn+s,'Say',m.A._l),s-=15),(t.Eu&W.A.Ru)===W.A.Ru&&(this.di?.Ac(this.zn,this.jn+s,'Hit: Type '+t.yu+' Amount '+t.pu+' HP '+t.wu+'/'+t.Au,m.A._l),s-=15),(t.Eu&W.A.Su)===W.A.Su&&(this.di?.Ac(this.zn,this.jn+s,'Face Coord: '+t.Mu/2+' '+t.ku/2,m.A._l),s-=15),(t.Eu&W.A.xu)===W.A.xu&&(this.di?.Ac(this.zn,this.jn+s,'Chat',m.A._l),s-=15),(t.Eu&W.A.Du)===W.A.Du&&(this.di?.Ac(this.zn,this.jn+s,'Play Spotanim: '+t.Nu,m.A._l),s-=15),(t.Eu&W.A.Pu)===W.A.Pu&&(this.di?.Ac(this.zn,this.jn+s,'Exact Move',m.A._l),s-=15)}}else{const t=i;let s=0;if(this.hu(i,i.height+30),this.di?.Ac(this.zn,this.jn+s,t.type?.name??null,m.A._l),s-=15,-1!==t.Eu&&this.Pt-t.gu<30){if((t.Eu&Y.A.Tu)===Y.A.Tu&&(this.di?.Ac(this.zn,this.jn+s,'Play Seq: '+t.Ou,m.A._l),s-=15),(t.Eu&Y.A.bu)===Y.A.bu){let i=t.vu;i>32767&&(i-=32768),this.di?.Ac(this.zn,this.jn+s,'Face Entity: '+i,m.A._l),s-=15}(t.Eu&Y.A.Lu)===Y.A.Lu&&(this.di?.Ac(this.zn,this.jn+s,'Say',m.A._l),s-=15),(t.Eu&Y.A.Ru)===Y.A.Ru&&(this.di?.Ac(this.zn,this.jn+s,'Hit: Type '+t.yu+' Amount '+t.pu+' HP '+t.wu+'/'+t.Au,m.A._l),s-=15),(t.Eu&Y.A.Fu)===Y.A.Fu&&(this.di?.Ac(this.zn,this.jn+s,'Change Type: '+t.type?.id??null,m.A._l),s-=15),(t.Eu&Y.A.Du)===Y.A.Du&&(this.di?.Ac(this.zn,this.jn+s,'Play Spotanim: '+t.Nu,m.A._l),s-=15),(t.Eu&Y.A.Su)===Y.A.Su&&(this.di?.Ac(this.zn,this.jn+s,'Face Coord: '+t.Mu/2+' '+t.ku/2,m.A._l),s-=15)}}}}}if($.K.nt)for(let t=0;t=104||i.z>=104||this._u(128*i.x+64,128*i.z+64,i.level,1,16776960,!1)}for(let t=0;tthis.jr[r]-this.Zr[r]&&s-ethis.zr[r]-this.qr[r]&&this.jr[r]-this.Zr[r]{2===this.Ah&&this._s[2]&&(this.eu((this._h-this.Tn<<7)+this.ph,2*this.gh,(this.Eh-this.On<<7)+this.mh),this.zn>-1&&this.Pt%20<10&&this._s[2].draw(this.zn-12,this.jn-28))};qf=()=>{const t=507;let i=13;this.Oo?this.di?.Hu(t,i,'tock',m.A.Gl,!0):this.Ai?.Hu(t,i,'tick',m.A.Gl,!0),i+=13,this.di?.Hu(t,i,`Fps: ${this.Wu}, ${this.Yu} ms`,m.A.Gl,!0),i+=13,this.di?.Hu(t,i,`Draw: ${this.ms.toFixed(1)}, Avg: ${this.Vu.toFixed(1)}, Slow: ${this.Ku.toFixed(1)} ms`,m.A.Gl,!0),i+=13,this.di?.Hu(t,i,`Occluders: ${x.A.Xu[x.A.zu]} Active: ${x.A.ju}`,m.A.Gl,!0),i+=13,this.di?.Hu(t,i,'Local Pos: '+(this.Sr?.x??-1)+', '+(this.Sr?.z??-1)+', '+(this.Sr?.y??-1),m.A.Gl,!0),i+=13,this.di?.Hu(t,i,'Camera Pos: '+this.ln+', '+this.cn+', '+this.an,m.A.Gl,!0),i+=13,this.di?.Hu(t,i,'Camera Angle: '+this.un+', '+this.fn,m.A.Gl,!0),i+=13,this.di?.Hu(t,i,'Cutscene Source: '+this.tr+', '+this.ir+' '+this.sr+'; '+this.hr+', '+this.er,m.A.Gl,!0),i+=13,this.di?.Hu(t,i,'Cutscene Destination: '+this.Zn+', '+this.qn+' '+this.$n+'; '+this.Jn+', '+this.Qn,m.A.Gl,!0),$.K.ot&&(i+=13,this.di?.Hu(t,i,'Instructions:',m.A.Gl,!0),i+=13,this.di?.Hu(t,i,'- Arrows to move Camera',m.A.Gl,!0),i+=13,this.di?.Hu(t,i,'- Shift to control Source or Dest',m.A.Gl,!0),i+=13,this.di?.Hu(t,i,'- Alt to control Height',m.A.Gl,!0),i+=13,this.di?.Hu(t,i,'- Ctrl to control Modifier',m.A.Gl,!0))};_u=(t,i,s,h,e,n)=>{const r=this.Bf(s,t,i),o=64*h;this.nu(t-o,r,i-o);const l=this.zn,a=this.jn;this.nu(t+o,r,i-o);const c=this.zn,f=this.jn;this.nu(t-o,r,i+o);const d=this.zn,w=this.jn;this.nu(t+o,r,i+o);const A=this.zn,y=this.jn;-1!==l&&-1!==c&&-1!==d&&-1!==A&&(n&&(u.A.Zu(l,a,A,y,(16711422&e)>>1),u.A.Zu(c,f,d,w,(16711422&e)>>1)),u.A.Zu(l,a,c,f,e),u.A.Zu(l,a,d,w,e),u.A.Zu(c,f,A,y,e),u.A.Zu(d,w,A,y,e))};_f(){const t=1==this.if[5]?2:1;1==this.if[6]?(1==this.if[1]?(this.Zn-=t,this.Zn<1&&(this.Zn=1)):1==this.if[2]&&(this.Zn+=t,this.Zn>102&&(this.Zn=102)),1==this.if[3]?1==this.if[7]?this.$n+=2*t:(this.qn+=1,this.qn>102&&(this.qn=102)):1==this.if[4]&&(1==this.if[7]?this.$n-=2*t:(this.qn-=1,this.qn<1&&(this.qn=1)))):(1==this.if[1]?(this.tr-=t,this.tr<1&&(this.tr=1)):1==this.if[2]&&(this.tr+=t,this.tr>102&&(this.tr=102)),1==this.if[3]?1==this.if[7]?this.sr+=2*t:(this.ir+=t,this.ir>102&&(this.ir=102)):1==this.if[4]&&(1==this.if[7]?this.sr-=2*t:(this.ir-=t,this.ir<1&&(this.ir=1)))),this.ln=128*this.tr+64,this.cn=128*this.ir+64,this.an=this.Bf(this.Dn,this.tr,this.ir)-this.sr;const i=128*this.Zn+64,s=128*this.qn+64,h=this.Bf(this.Dn,this.Zn,this.qn)-this.$n,e=i-this.ln,n=h-this.an,r=s-this.cn,o=0|Math.sqrt(e*e+r*r);this.fn=325.949*Math.atan2(n,o)&2047,this.un=-325.949*Math.atan2(e,r)&2047,this.fn<128&&(this.fn=128),this.fn>383&&(this.fn=383)}Jf=()=>{if(this.qu(),1===this.js&&this.gs[this.Zs/100|0]?.draw(this.qs-8-8,this.$s-8-11),2===this.js&&this.gs[4+(this.Zs/100|0)]?.draw(this.qs-8-8,this.$s-8-11),-1!==this.Xs&&(this.ol(this.Xs,this.Ye),this.Al(c.A.Ro[this.Xs],0,0,0)),this.$u(),this.Qs?0===this.th&&this.Ju():(this.ef(),this.Qu()),1===this.kr&&(this.Fr>0||1===this.Ur?this._s[1]?.draw(472,258):this._s[1]?.draw(472,296)),this.Fr>0&&(this._s[0]?.draw(472,296),this.wi?.Ac(484,329,'Level: '+this.Fr,m.A.Gl)),1===this.Ur&&(this._s[6]?.draw(472,296),this.wi?.Ac(484,329,'Arena',m.A.Gl)),0!==this.Vt){let t=this.Vt/50|0;const i=t/60|0;t%=60,t<10?this.wi?.Fl(4,329,'System update in: '+i+':0'+t,m.A.Gl):this.wi?.Fl(4,329,'System update in: '+i+':'+t,m.A.Gl)}};qu=()=>{if(0===this.jh)return;const t=this.wi;let i=0;0!==this.Vt&&(i=1);for(let s=0;s<100;s++){if(!this.Vh[s])continue;const h=this.messageType[s];let e;if((3===h||7===h)&&(7===h||0===this.xh||1===this.xh&&this.lu(this.Kh[s]))&&(e=329-13*i,t?.Fl(4,e,'From '+this.Kh[s]+': '+this.Vh[s],m.A.Bl),t?.Fl(4,e-1,'From '+this.Kh[s]+': '+this.Vh[s],m.A.bc),i++,i>=5))return;if(5===h&&this.xh<2&&(e=329-13*i,t?.Fl(4,e,this.Vh[s],m.A.Bl),t?.Fl(4,e-1,this.Vh[s],m.A.bc),i++,i>=5))return;if(6===h&&this.xh<2&&(e=329-13*i,t?.Fl(4,e,'To '+this.Kh[s]+': '+this.Vh[s],m.A.Bl),t?.Fl(4,e-1,'To '+this.Kh[s]+': '+this.Vh[s],m.A.bc),i++,i>=5))return}};$u=()=>{if(!this.Sr)return;const t=(this.Sr.x>>7)+this.Tn,i=(this.Sr.z>>7)+this.On;if(this.Fr=t>=2944&&t<3392&&i>=3520&&i<6400?1+((i-3520)/8|0):t>=2944&&t<3392&&i>=9920&&i<12800?1+((i-9920)/8|0):0,this.Ur=0,t>=3328&&t<3392&&i>=3200&&i<3264){const s=63&t,h=63&i;(s>=4&&s<=29&&h>=44&&h<=58||s>=36&&s<=61&&h>=44&&h<=58||s>=4&&s<=29&&h>=25&&h<=39||s>=36&&s<=61&&h>=25&&h<=39||s>=4&&s<=29&&h>=6&&h<=20||s>=36&&s<=61&&h>=6&&h<=20)&&(this.Ur=1)}0===this.Ur&&t>=3328&&t<=3393&&i>=3203&&i<=3325&&(this.Ur=2),this.Js=0,(t>=3053&&t<=3156&&i>=3056&&i<=3136||t>=3072&&t<=3118&&i>=9492&&i<=9535)&&(this.Js=1),1===this.Js&&t>=3139&&t<=3199&&i>=3008&&i<=3062&&(this.Js=0)};Lf=()=>{this.Di?.bind(),this.Ji&&(d.A.oc=this.Ji),this.ns?.draw(0,0),-1!==this.oh?this.Al(c.A.Ro[this.oh],0,0,0):-1!==this.Mh[this.Sh]&&this.Al(c.A.Ro[this.Mh[this.Sh]],0,0,0),this.Qs&&1===this.th&&this.Ju(),this.Di?.draw(562,231),this.Pi?.bind(),this.Qi&&(d.A.oc=this.Qi)};Sf=()=>{if(this.Fi?.bind(),this.$i&&(d.A.oc=this.$i),this.rs?.draw(0,0),this.Fh)this.Ai?.Ac(239,40,this.Uh,m.A.Bl),this.Ai?.Ac(239,60,this.Bh+'*',m.A.td);else if(this.Wh)this.Ai?.Ac(239,40,'Enter amount:',m.A.Bl),this.Ai?.Ac(239,60,this.Hh+'*',m.A.td);else if(this.Lh)this.Ai?.Ac(239,40,this.Lh,m.A.Bl),this.Ai?.Ac(239,60,'Click to continue',m.A.td);else if(-1!==this.lh)this.Al(c.A.Ro[this.lh],0,0,0);else if(-1===this.Yh){let t=this.wi;0===$.K.rt&&(t=this.yi);let i=0;u.A.yl(0,0,463,77);for(let s=0;s<100;s++){const h=this.Vh[s];if(!h)continue;const e=this.messageType[s],n=this.uh+70-14*i;0===e&&(n>0&&n<110&&t?.Fl(4,n,h,m.A.Bl),i++),1===e&&(n>0&&n<110&&(t?.Fl(4,n,this.Kh[s]+':',m.A._l),t?.Fl(t.au(this.Kh[s])+12,n,h,m.A.BLUE)),i++),2===e&&(0===this.kh||1===this.kh&&this.lu(this.Kh[s]))&&(n>0&&n<110&&(t?.Fl(4,n,this.Kh[s]+':',m.A.Bl),t?.Fl(t.au(this.Kh[s])+12,n,h,m.A.BLUE)),i++),3!==e&&7!==e||0!==this.jh||!(7===e||0===this.xh||1===this.xh&&this.lu(this.Kh[s]))||(n>0&&n<110&&(t?.Fl(4,n,'From '+this.Kh[s]+':',m.A.Bl),t?.Fl(t.au('From '+this.Kh[s])+12,n,h,m.A.sd)),i++),4===e&&(0===this.Dh||1===this.Dh&&this.lu(this.Kh[s]))&&(n>0&&n<110&&t?.Fl(4,n,this.Kh[s]+' '+this.Vh[s],m.A.hd),i++),5===e&&0===this.jh&&this.xh<2&&(n>0&&n<110&&t?.Fl(4,n,h,m.A.sd),i++),6===e&&0===this.jh&&this.xh<2&&(n>0&&n<110&&(t?.Fl(4,n,'To '+this.Kh[s]+':',m.A.Bl),t?.Fl(t.au('To '+this.Kh[s])+12,n,h,m.A.sd)),i++),8===e&&(0===this.Dh||1===this.Dh&&this.lu(this.Kh[s]))&&(n>0&&n<110&&t?.Fl(4,n,this.Kh[s]+' '+this.Vh[s],m.A.ed),i++)}u.A.Gu(),this.fh=14*i+7,this.fh<78&&(this.fh=78),this.tl(463,0,this.fh-this.uh-77,this.fh,77),0==$.K.rt?t?.Fl(3,90,this.qh+'*',m.A.Bl):1==$.K.rt?t?.Fl(3,90,this.qh+'*',m.A.BLUE):(t?.Fl(4,90,M.A.ga(this.username)+':',m.A.Bl),t?.Fl(t.au(this.username+': ')+6,90,this.qh+'*',m.A.BLUE)),u.A.nl(0,77,m.A.Bl,479)}else this.Al(c.A.Ro[this.Yh],0,0,0);this.Qs&&2===this.th&&this.Ju(),this.Fi?.draw(22,375),this.Pi?.bind(),this.Qi&&(d.A.oc=this.Qi)};Mf=()=>{if(this.Ni?.bind(),!this.Sr)return;const t=this.Fn+this.An&2047;let i=48+(this.Sr.x/32|0),s=464-(this.Sr.z/32|0);this.ws?.nd(21,9,146,151,this.hs,this.es,i,s,t,this.yn+256),this.As?.nd(0,0,33,33,this.ts,this.ss,25,25,this.Fn,256);for(let t=0;t{if(!i)return;const h=this.Fn+this.An&2047,e=s*s+t*t;if(e>6400)return;let n=d.A.sin[h],r=d.A.cos[h];n=256*n/(this.yn+256)|0,r=256*r/(this.yn+256)|0;const o=t*n+s*r>>16,l=t*r-s*n>>16;e>2500&&this.os?i.ad(o+94-(i.Pl/2|0),83-l-(i.fd/2|0),this.os):i.draw(o+94-(i.Pl/2|0),83-l-(i.fd/2|0))};ud=t=>{if(!this.ws)return;const i=this.ws.nc,s=i.length;for(let t=0;t>14&32767;const h=e.A.get(s).yd;if(h<0)continue;let n=t,r=i;if(22!==h&&29!==h&&34!==h&&36!==h&&46!==h&&47!==h&&48!==h){const s=G.A.Xn,h=G.A.Xn,e=this.kn[this.Dn];if(e){const o=e.flags;for(let e=0;e<10;e++){const e=4*Math.random()|0;0===e&&n>0&&n>t-3&&(o[G.A.index(n-1,r)]&H.A.pd)===H.A.OPEN&&n--,1===e&&n0&&r>i-3&&(o[G.A.index(n,r-1)]&H.A.Id)===H.A.OPEN&&r--,3===e&&r{if(!this.He||!this.ws)return;let r=this.He.Ed(s,t,i);if(0!==r){const o=this.He.gd(s,t,i,r),l=o>>6&3,a=31&o;let c=h;r>0&&(c=n);const f=this.ws.nc,u=4*t+512*(103-i)*4+24624,d=r>>14&32767,w=e.A.get(d);if(-1===w.Cd)a!==P.A.Td.id&&a!==P.A.Od.id||(l===F.A.bd?(f[u]=c,f[u+512]=c,f[u+1024]=c,f[u+1536]=c):l===F.A.vd?(f[u]=c,f[u+1]=c,f[u+2]=c,f[u+3]=c):l===F.A.Ld?(f[u+3]=c,f[u+3+512]=c,f[u+3+1024]=c,f[u+3+1536]=c):l===F.A.Rd&&(f[u+1536]=c,f[u+1536+1]=c,f[u+1536+2]=c,f[u+1536+3]=c)),a===P.A.Sd.id&&(l===F.A.bd?f[u]=c:l===F.A.vd?f[u+3]=c:l===F.A.Ld?f[u+3+1536]=c:l===F.A.Rd&&(f[u+1536]=c)),a===P.A.Od.id&&(l===F.A.Rd?(f[u]=c,f[u+512]=c,f[u+1024]=c,f[u+1536]=c):l===F.A.bd?(f[u]=c,f[u+1]=c,f[u+2]=c,f[u+3]=c):l===F.A.vd?(f[u+3]=c,f[u+3+512]=c,f[u+3+1024]=c,f[u+3+1536]=c):l===F.A.Ld&&(f[u+1536]=c,f[u+1536+1]=c,f[u+1536+2]=c,f[u+1536+3]=c));else{const s=this.ys[w.Cd];if(s){const h=(4*w.width-s.width)/2|0,e=(4*w.length-s.height)/2|0;s.draw(4*t+48+h,4*(G.A.Xn-i-w.length)+e+48)}}}if(r=this.He.Md(s,t,i),0!==r){const h=this.He.gd(s,t,i,r),n=h>>6&3,o=31&h,l=r>>14&32767,a=e.A.get(l);if(-1!==a.Cd){const s=this.ys[a.Cd];if(s){const h=(4*a.width-s.width)/2|0,e=(4*a.length-s.height)/2|0;s.draw(4*t+48+h,4*(G.A.Xn-i-a.length)+e+48)}}else if(o===P.A.kd.id){let s=15658734;r>0&&(s=15597568);const h=this.ws.nc,e=4*t+512*(G.A.Xn-1-i)*4+24624;n===F.A.bd||n===F.A.Ld?(h[e+1536]=s,h[e+1024+1]=s,h[e+512+2]=s,h[e+3]=s):(h[e]=s,h[e+512+1]=s,h[e+1024+2]=s,h[e+1536+3]=s)}}if(r=this.He.Ad(s,t,i),0!==r){const s=e.A.get(r>>14&32767);if(-1!==s.Cd){const h=this.ys[s.Cd];if(h){const e=(4*s.width-h.width)/2|0,n=(4*s.length-h.height)/2|0;h.draw(4*t+48+e,4*(G.A.Xn-i-s.length)+n+48)}}}};Qu=()=>{if(this.nh<2&&0===this.oe&&0===this.Ie)return;let t;t=1===this.oe&&this.nh<2?'Use '+this.fe+' with...':1===this.Ie&&this.nh<2?this.ge+'...':this.rh[this.nh-1],this.nh>2&&(t=t+'@whi@ / '+(this.nh-2)+' more options'),this.Ai?.xd(4,15,t,m.A._l,!0,this.Pt/1e3|0)};Ju=()=>{const t=this.ih,i=this.sh,s=this.hh,h=this.eh,e=m.A.Dd;u.A.fillRect(t,i,s,h,e),u.A.fillRect(t+1,i+1,s-2,16,m.A.Bl),u.A.Il(t+1,i+18,s-2,h-19,m.A.Bl),this.Ai?.Fl(t+3,i+14,'Choose Option',e);let n=this.xl,r=this.Dl;0===this.th&&(n-=8,r-=11),1===this.th&&(n-=562,r-=231),2===this.th&&(n-=22,r-=375);for(let h=0;ht&&ne-13&&r{if(0!==this.se)return;let t=this.Lc;if(1===this.Ie&&this.Rc>=520&&this.Sc>=165&&this.Rc<=788&&this.Sc<=230&&(t=0),this.Qs){if(1!==t){let t=this.xl,i=this.Dl;0===this.th?(t-=8,i-=11):1===this.th?(t-=562,i-=231):2===this.th&&(t-=22,i-=375),(tthis.ih+this.hh+10||ithis.sh+this.eh+10)&&(this.Qs=!1,1===this.th&&(this.Ws=!0),2===this.th&&(this.Ys=!0))}if(1===t){const t=this.ih,i=this.sh,s=this.hh;let h=this.Rc,e=this.Sc;0===this.th?(h-=8,e-=11):1===this.th?(h-=562,e-=231):2===this.th&&(h-=22,e-=375);let n=-1;for(let r=0;rt&&ho-13&&e0){const t=this.Te[this.nh-1];if(602===t||596===t||22===t||892===t||415===t||405===t||38===t||422===t||478===t||347===t||188===t){const t=this.be[this.nh-1],i=this.ve[this.nh-1];if(c.A.Ro[i].draggable)return this.re=!1,this.ne=0,this.te=i,this.ie=t,this.se=2,this.he=this.Rc,this.ee=this.Sc,c.A.Ro[i].Nd===this.Xs&&(this.se=1),void(c.A.Ro[i].Nd===this.lh&&(this.se=3))}}if(1===t&&(1===this.Ce||this.rf(this.nh-1))&&this.nh>2&&(t=2),1===t&&this.nh>0&&await this.af(this.nh-1),2!==t||this.nh<=0)return;this.lf()}};pf=()=>{if(1===this.Lc&&this.Sr){let t=this.Rc-21-561,i=this.Sc-9-5;if(t>=0&&i>=0&&t<146&&i<151){t-=73,i-=75;const s=this.Fn+this.An&2047;let h=d.A.sin[s],e=d.A.cos[s];h=h*(this.yn+256)>>8,e=e*(this.yn+256)>>8;const n=i*h+t*e>>11,r=i*e-t*h>>11,o=this.Sr.x+n>>7,l=this.Sr.z-r>>7;this.df(this.Sr.wf[0],this.Sr.Af[0],o,l,1,0,0,0,0,0,!0)&&(this.Bt.p1(t),this.Bt.p1(i),this.Bt.p2(this.Fn),this.Bt.p1(57),this.Bt.p1(this.An),this.Bt.p1(this.yn),this.Bt.p1(89),this.Bt.p2(this.Sr.x),this.Bt.p2(this.Sr.z),this.Bt.p1(this.Rr),this.Bt.p1(63))}}};rf=t=>{if(t<0)return!1;let i=this.Te[t];return i>=2e3&&(i-=2e3),406===i};af=async t=>{if(t<0)return;this.Wh&&(this.Wh=!1,this.Ys=!0);let i=this.Te[t];const s=this.Oe[t],h=this.be[t],r=this.ve[t];if(i>=2e3&&(i-=2e3),903===i||363===i){let s=this.rh[t];const h=s.indexOf('@whi@');if(-1!==h){s=s.substring(h+5).trim();const t=M.A.ga(M.A.Ca(M.A.ld(s)));let e=!1;for(let s=0;s=90&&this.Bt.jc(O.A.Hd),this.Bt.jc(O.A.Wd)):347===i?this.Bt.jc(O.A.Yd):422===i?this.Bt.jc(O.A.Vd):405===i?($.K.Et+=s,$.K.Et>=97&&(this.Bt.jc(O.A.Kd),this.Bt.p3(14953816)),this.Bt.jc(O.A.Xd)):38===i&&this.Bt.jc(O.A.zd),this.Bt.p2(s),this.Bt.p2(h),this.Bt.p2(r),this.Ae=0,this.we=r,this.de=h,this.ue=2,c.A.Ro[r].Nd===this.Xs&&(this.ue=1),c.A.Ro[r].Nd===this.lh&&(this.ue=3);else if(728===i||542===i||6===i||963===i||245===i){const t=this.Ar[s];t&&this.Sr&&(this.df(this.Sr.wf[0],this.Sr.Af[0],t.wf[0],t.Af[0],2,1,1,0,0,0,!1),this.qs=this.Rc,this.$s=this.Sc,this.js=2,this.Zs=0,542===i?this.Bt.jc(O.A.jd):6===i?(3&s||$.K._t++,$.K._t>=124&&(this.Bt.jc(O.A.Zd),this.Bt.p4(0)),this.Bt.jc(O.A.qd)):963===i?this.Bt.jc(O.A.$d):728===i?this.Bt.jc(O.A.Jd):245===i&&(3&s||$.K.gt++,$.K.gt>=85&&(this.Bt.jc(O.A.Qd),this.Bt.p2(39596)),this.Bt.jc(O.A.tw)),this.Bt.p2(s))}else if(217===i){if(this.Sr){this.df(this.Sr.wf[0],this.Sr.Af[0],h,r,2,0,0,0,0,0,!1)||this.df(this.Sr.wf[0],this.Sr.Af[0],h,r,2,1,1,0,0,0,!1),this.qs=this.Rc,this.$s=this.Sc,this.js=2,this.Zs=0,this.Bt.jc(O.A.iw),this.Bt.p2(h+this.Tn),this.Bt.p2(r+this.On),this.Bt.p2(s),this.Bt.p2(this.ce),this.Bt.p2(this.le),this.Bt.p2(this.ae)}}else if(1175===i){const t=s>>14&32767,i=e.A.get(t);let h;h=i.sw?i.sw:"It's a "+i.name+'.',this.Ud(0,h,'')}else if(285===i)this.Bd(O.A.hw,h,r,s);else if(881===i)this.Bt.jc(O.A.ew),this.Bt.p2(s),this.Bt.p2(h),this.Bt.p2(r),this.Bt.p2(this.ce),this.Bt.p2(this.le),this.Bt.p2(this.ae),this.Ae=0,this.we=r,this.de=h,this.ue=2,c.A.Ro[r].Nd===this.Xs&&(this.ue=1),c.A.Ro[r].Nd===this.lh&&(this.ue=3);else if(391===i)this.Bt.jc(O.A.nw),this.Bt.p2(s),this.Bt.p2(h),this.Bt.p2(r),this.Bt.p2(this._e),this.Ae=0,this.we=r,this.de=h,this.ue=2,c.A.Ro[r].Nd===this.Xs&&(this.ue=1),c.A.Ro[r].Nd===this.lh&&(this.ue=3);else if(660===i)this.Qs?this.He?.click(h-8,r-11):this.He?.click(this.Rc-8,this.Sc-11);else{if(188===i)return this.oe=1,this.le=h,this.ae=r,this.ce=s,this.fe=n.A.get(s).name,void(this.Ie=0);if(44===i)this.ye||(this.Bt.jc(O.A.rw),this.Bt.p2(r),this.ye=!0);else if(1773===i){const t=n.A.get(s);let i;i=r>=1e5?r+' x '+t.name:t.sw?t.sw:"It's a "+t.name+'.',this.Ud(0,i,'')}else if(900===i){const t=this.Ar[s];t&&this.Sr&&(this.df(this.Sr.wf[0],this.Sr.Af[0],t.wf[0],t.Af[0],2,1,1,0,0,0,!1),this.qs=this.Rc,this.$s=this.Sc,this.js=2,this.Zs=0,this.Bt.jc(O.A.ow),this.Bt.p2(s),this.Bt.p2(this.ce),this.Bt.p2(this.le),this.Bt.p2(this.ae))}else if(1373===i||1544===i||151===i||1101===i){const t=this.nr[s];t&&this.Sr&&(this.df(this.Sr.wf[0],this.Sr.Af[0],t.wf[0],t.Af[0],2,1,1,0,0,0,!1),this.qs=this.Rc,this.$s=this.Sc,this.js=2,this.Zs=0,1101===i?this.Bt.jc(O.A.Fd):151===i?($.K.bt++,$.K.bt>=90&&(this.Bt.jc(O.A.lw),this.Bt.p2(31114)),this.Bt.jc(O.A.aw)):1373===i?this.Bt.jc(O.A.Pd):1544===i&&this.Bt.jc(O.A.cw),this.Bt.p2(s))}else if(265===i){const t=this.Ar[s];t&&this.Sr&&(this.df(this.Sr.wf[0],this.Sr.Af[0],t.wf[0],t.Af[0],2,1,1,0,0,0,!1),this.qs=this.Rc,this.$s=this.Sc,this.js=2,this.Zs=0,this.Bt.jc(O.A.fw),this.Bt.p2(s),this.Bt.p2(this._e))}else if(679===i){const i=this.rh[t],s=i.indexOf('@whi@');if(-1!==s){const t=M.A.ld(i.substring(s+5).trim());let h=-1;for(let i=0;i0&&(this.Ys=!0,this.Wh=!1,this.Fh=!0,this.Bh='',this.Gh=3,this.no=this.ho[h],this.Uh='Enter message to send to '+this.so[h])}}else if(55===i)this.Bd(O.A.uw,h,r,s)&&this.Bt.p2(this._e);else if(224===i||993===i||99===i||746===i||877===i){if(this.Sr){this.df(this.Sr.wf[0],this.Sr.Af[0],h,r,2,0,0,0,0,0,!1)||this.df(this.Sr.wf[0],this.Sr.Af[0],h,r,2,1,1,0,0,0,!1),this.qs=this.Rc,this.$s=this.Sc,this.js=2,this.Zs=0,224===i?this.Bt.jc(O.A.dw):746===i?this.Bt.jc(O.A.ww):877===i?this.Bt.jc(O.A.Aw):99===i?this.Bt.jc(O.A.yw):993===i&&this.Bt.jc(O.A.pw),this.Bt.p2(h+this.Tn),this.Bt.p2(r+this.On),this.Bt.p2(s)}}else if(1607===i){const t=this.Ar[s];if(t&&t.type){let i;i=t.type.sw?t.type.sw:"It's a "+t.type.name+'.',this.Ud(0,i,'')}}else if(504===i)this.Bd(O.A.mw,h,r,s);else{if(930===i){const t=c.A.Ro[r];this.Ie=1,this._e=r,this.Ee=t.Iw,this.oe=0;let i=t._w;i&&-1!==i.indexOf(' ')&&(i=i.substring(0,i.indexOf(' ')));let s=t._w;return s&&-1!==s.indexOf(' ')&&(s=s.substring(s.indexOf(' ')+1)),this.ge=i+' '+t.action+' '+s,void(16===this.Ee&&(this.Ws=!0,this.Sh=3,this.Vs=!0))}if(951===i){const t=c.A.Ro[r];let i=!0;t.El>0&&(i=this.Ew(t)),i&&(this.Bt.jc(O.A.gw),this.Bt.p2(r))}else if(602===i||596===i||22===i||892===i||415===i)22===i?this.Bt.jc(O.A.Cw):415===i?(3&r||$.K.Ot++,$.K.Ot>=55&&(this.Bt.jc(O.A.Tw),this.Bt.p4(0)),this.Bt.jc(O.A.Ow)):602===i?this.Bt.jc(O.A.bw):892===i?(3&h||$.K.vt++,$.K.vt>=130&&(this.Bt.jc(O.A.Lw),this.Bt.p1(177)),this.Bt.jc(O.A.Rw)):596===i&&this.Bt.jc(O.A.Sw),this.Bt.p2(s),this.Bt.p2(h),this.Bt.p2(r),this.Ae=0,this.we=r,this.de=h,this.ue=2,c.A.Ro[r].Nd===this.Xs&&(this.ue=1),c.A.Ro[r].Nd===this.lh&&(this.ue=3);else if(581===i)3&s||$.K.It++,$.K.It>=99&&(this.Bt.jc(O.A.Mw),this.Bt.p4(0)),this.Bd(O.A.kw,h,r,s);else if(965===i){if(this.Sr){this.df(this.Sr.wf[0],this.Sr.Af[0],h,r,2,0,0,0,0,0,!1)||this.df(this.Sr.wf[0],this.Sr.Af[0],h,r,2,1,1,0,0,0,!1),this.qs=this.Rc,this.$s=this.Sc,this.js=2,this.Zs=0,this.Bt.jc(O.A.xw),this.Bt.p2(h+this.Tn),this.Bt.p2(r+this.On),this.Bt.p2(s),this.Bt.p2(this._e)}}else if(1501===i)$.K.Tt+=this.On,$.K.Tt>=92&&(this.Bt.jc(O.A.Dw),this.Bt.p4(0)),this.Bd(O.A.Nw,h,r,s);else if(364===i)this.Bd(O.A.Pw,h,r,s);else if(1102===i){const t=n.A.get(s);let i;i=t.sw?t.sw:"It's a "+t.name+'.',this.Ud(0,i,'')}else if(960===i){this.Bt.jc(O.A.gw),this.Bt.p2(r);const t=c.A.Ro[r];if(t.scripts&&t.scripts[0]&&5===t.scripts[0][0]){const i=t.scripts[0][1];t.Qo&&this.pe[i]!==t.Qo[0]&&(this.pe[i]=t.Qo[0],await this.Fw(i),this.Ws=!0)}}else if(34===i){const i=this.rh[t],s=i.indexOf('@whi@');if(-1!==s){this.Uw(),this.Me=i.substring(s+5).trim(),this.ke=!1;for(let t=0;t{const i=t.El;if(i===c.A.Kw&&(this.Ys=!0,this.Wh=!1,this.Fh=!0,this.Bh='',this.Gh=1,this.Uh='Enter name of friend to add to list'),i===c.A.Xw&&(this.Ys=!0,this.Wh=!1,this.Fh=!0,this.Bh='',this.Gh=2,this.Uh='Enter name of friend to delete from list'),i===c.A.zw)return this.Yt=250,!0;if(i===c.A.jw&&(this.Ys=!0,this.Wh=!1,this.Fh=!0,this.Bh='',this.Gh=4,this.Uh='Enter name of player to add to list'),i===c.A.Zw&&(this.Ys=!0,this.Wh=!1,this.Fh=!0,this.Bh='',this.Gh=5,this.Uh='Enter name of player to delete from list'),i>=c.A.qw&&i<=c.A.$w){const t=(i-300)/2|0,s=1&i;let h=this.Wr[t];if(-1!==h)for(;;)if(0===s&&(h--,h<0&&(h=o.A.count-1)),1===s&&(h++,h>=o.A.count&&(h=0)),!o.A.Ro[h].disable&&o.A.Ro[h].type===t+(this.Gr?0:7)){this.Wr[t]=h,this.Hr=!0;break}}if(i>=c.A.Jw&&i<=c.A.Qw){const t=(i-314)/2|0,s=1&i;let h=this.Yr[t];0===s&&(h--,h<0&&(h=W.A.La[t].length-1)),1===s&&(h++,h>=W.A.La[t].length&&(h=0)),this.Yr[t]=h,this.Hr=!0}if(i!==c.A.Da||this.Gr||(this.Gr=!0,this.Vc()),i===c.A.Na&&this.Gr&&(this.Gr=!1,this.Vc()),i===c.A.tA){this.Bt.jc(O.A.iA),this.Bt.p1(this.Gr?0:1);for(let t=0;t<7;t++)this.Bt.p1(this.Wr[t]);for(let t=0;t<5;t++)this.Bt.p1(this.Yr[t]);return!0}return i===c.A.Fa&&(this.ke=!this.ke),i>=c.A.sA&&i<=c.A.hA&&(this.Uw(),this.Me.length>0&&(this.Bt.jc(O.A.eA),this.Bt.nA(M.A.ld(this.Me)),this.Bt.p1(i-601),this.Bt.p1(this.ke?1:0))),!1};Vc=()=>{this.Hr=!0;for(let t=0;t<7;t++){this.Wr[t]=-1;for(let i=0;i{if(!this.Sr||!this.He)return!1;const n=h>>14&32767,r=this.He.gd(this.Dn,i,s,h);if(-1===r)return!1;const o=31&r,l=r>>6&3;if(o===P.A.rA.id||o===P.A.oA.id||o===P.A.lA.id){const t=e.A.get(n);let h,r;l===F.A.bd||l===F.A.Ld?(h=t.width,r=t.length):(h=t.length,r=t.width);let o=t.aA;0!==l&&(o=(o<>4-l)),this.df(this.Sr.wf[0],this.Sr.Af[0],i,s,2,h,r,0,0,o,!1)}else this.df(this.Sr.wf[0],this.Sr.Af[0],i,s,2,0,0,l,o+1,0,!1);return this.qs=this.Rc,this.$s=this.Sc,this.js=2,this.Zs=0,this.Bt.jc(t),this.Bt.p2(i+this.Tn),this.Bt.p2(s+this.On),this.Bt.p2(n),!0};mf=()=>{1===this.Lc&&(this.Rc>=549&&this.Rc<=583&&this.Sc>=195&&this.Sc<231&&-1!==this.Mh[0]?(this.Ws=!0,this.Sh=0,this.Vs=!0):this.Rc>=579&&this.Rc<=609&&this.Sc>=194&&this.Sc<231&&-1!==this.Mh[1]?(this.Ws=!0,this.Sh=1,this.Vs=!0):this.Rc>=607&&this.Rc<=637&&this.Sc>=194&&this.Sc<231&&-1!==this.Mh[2]?(this.Ws=!0,this.Sh=2,this.Vs=!0):this.Rc>=635&&this.Rc<=679&&this.Sc>=194&&this.Sc<229&&-1!==this.Mh[3]?(this.Ws=!0,this.Sh=3,this.Vs=!0):this.Rc>=676&&this.Rc<=706&&this.Sc>=194&&this.Sc<231&&-1!==this.Mh[4]?(this.Ws=!0,this.Sh=4,this.Vs=!0):this.Rc>=704&&this.Rc<=734&&this.Sc>=194&&this.Sc<231&&-1!==this.Mh[5]?(this.Ws=!0,this.Sh=5,this.Vs=!0):this.Rc>=732&&this.Rc<=766&&this.Sc>=195&&this.Sc<231&&-1!==this.Mh[6]?(this.Ws=!0,this.Sh=6,this.Vs=!0):this.Rc>=550&&this.Rc<=584&&this.Sc>=492&&this.Sc<528&&-1!==this.Mh[7]?(this.Ws=!0,this.Sh=7,this.Vs=!0):this.Rc>=582&&this.Rc<=612&&this.Sc>=492&&this.Sc<529&&-1!==this.Mh[8]?(this.Ws=!0,this.Sh=8,this.Vs=!0):this.Rc>=609&&this.Rc<=639&&this.Sc>=492&&this.Sc<529&&-1!==this.Mh[9]?(this.Ws=!0,this.Sh=9,this.Vs=!0):this.Rc>=637&&this.Rc<=681&&this.Sc>=493&&this.Sc<528&&-1!==this.Mh[10]?(this.Ws=!0,this.Sh=10,this.Vs=!0):this.Rc>=679&&this.Rc<=709&&this.Sc>=492&&this.Sc<529&&-1!==this.Mh[11]?(this.Ws=!0,this.Sh=11,this.Vs=!0):this.Rc>=706&&this.Rc<=736&&this.Sc>=492&&this.Sc<529&&-1!==this.Mh[12]?(this.Ws=!0,this.Sh=12,this.Vs=!0):this.Rc>=734&&this.Rc<=768&&this.Sc>=492&&this.Sc<528&&-1!==this.Mh[13]&&(this.Ws=!0,this.Sh=13,this.Vs=!0),$.K.ft++,$.K.ft>150&&($.K.ft=0,this.Bt.jc(O.A.cA),this.Bt.p1(43)))};Cf=async()=>{for(;;){let t;do{for(;;){if(t=this.kc(),-1===t)return;if(-1!==this.Xs&&this.Xs===this.xe){8===t&&this.Me.length>0&&(this.Me=this.Me.substring(0,this.Me.length-1));break}if(this.Fh){if(t>=32&&t<=122&&this.Bh.length<80&&(this.Bh=this.Bh+String.fromCharCode(t),this.Ys=!0),8===t&&this.Bh.length>0&&(this.Bh=this.Bh.substring(0,this.Bh.length-1),this.Ys=!0),13===t||10===t){let t;if(this.Fh=!1,this.Ys=!0,1===this.Gh&&(t=M.A.ld(this.Bh),this.Gw(t)),2===this.Gh&&this.Vr>0&&(t=M.A.ld(this.Bh),this.Ww(t)),3===this.Gh&&this.Bh.length>0&&this.no){this.Bt.jc(O.A.fA),this.Bt.p1(0);const t=this.Bt.Fc;this.Bt.nA(this.no),v.A.uA(this.Bt,this.Bh),this.Bt.Hf(this.Bt.Fc-t),this.Bh=M.A.dA(this.Bh),this.Bh=b.A.filter(this.Bh),this.Ud(6,this.Bh,M.A.ga(M.A.Ca(this.no))),2===this.xh&&(this.xh=1,this.Ks=!0,this.Bt.jc(O.A.wA),this.Bt.p1(this.kh),this.Bt.p1(this.xh),this.Bt.p1(this.Dh))}4===this.Gh&&this.dh<100&&(t=M.A.ld(this.Bh),this.Hw(t)),5===this.Gh&&this.dh>0&&(t=M.A.ld(this.Bh),this.Yw(t))}}else if(this.Wh){if(t>=48&&t<=57&&this.Hh.length<10&&(this.Hh=this.Hh+String.fromCharCode(t),this.Ys=!0),8===t&&this.Hh.length>0&&(this.Hh=this.Hh.substring(0,this.Hh.length-1),this.Ys=!0),13===t||10===t){if(this.Hh.length>0){let t=0;try{t=parseInt(this.Hh,10)}catch(t){}this.Bt.jc(O.A.AA),this.Bt.p4(t)}this.Wh=!1,this.Ys=!0}}else if(-1===this.lh&&(t>=32&&t<=122&&this.qh.length<80&&(this.qh=this.qh+String.fromCharCode(t),this.Ys=!0),8===t&&this.qh.length>0&&(this.qh=this.qh.substring(0,this.qh.length-1),this.Ys=!0),(13===t||10===t)&&this.qh.length>0)){if('::clientdrop'===this.qh)await this.qc();else if(this.Br&&'::noclip'===this.qh)for(let t=0;t122)&&(t<65||t>90)&&(t<48||t>57)&&32!==t);this.Me.length<12&&(this.Me=this.Me+String.fromCharCode(t))}};If=()=>{if(1===this.Lc)if(this.Rc>=8&&this.Rc<=108&&this.Sc>=490&&this.Sc<=522)this.kh=(this.kh+1)%4,this.Ks=!0,this.Ys=!0,this.Bt.jc(O.A.wA),this.Bt.p1(this.kh),this.Bt.p1(this.xh),this.Bt.p1(this.Dh);else if(this.Rc>=137&&this.Rc<=237&&this.Sc>=490&&this.Sc<=522)this.xh=(this.xh+1)%3,this.Ks=!0,this.Ys=!0,this.Bt.jc(O.A.wA),this.Bt.p1(this.kh),this.Bt.p1(this.xh),this.Bt.p1(this.Dh);else if(this.Rc>=275&&this.Rc<=375&&this.Sc>=490&&this.Sc<=522)this.Dh=(this.Dh+1)%3,this.Ks=!0,this.Ys=!0,this.Bt.jc(O.A.wA),this.Bt.p1(this.kh),this.Bt.p1(this.xh),this.Bt.p1(this.Dh);else if(this.Rc>=416&&this.Rc<=516&&this.Sc>=490&&this.Sc<=522){this.Uw(),this.Me='',this.ke=!1;for(let t=0;t{if(this.Nh?this.Ph=32:this.Ph=0,this.Nh=!1,t>=n&&t=r&&i=n&&t=r+h-16&&i=n-this.Ph&&t=r+16&&i0){let t=(h-32)*h/s|0;t<8&&(t=8);const n=i-r-(t/2|0)-16,l=h-t-32;o.Tl=(s-h)*n/l|0,e&&(this.Ws=!0),this.Nh=!0}};Kc=()=>{this.Fi||(this.Lo(),this.Mo=null,this.ti=null,this.ii=null,this.si=null,this.hi=null,this.ei=null,this.ni=null,this.ri=null,this.oi=null,this.li=null,this.Fi=new f.A(479,96),this.Ni=new f.A(168,160),u.A.clear(),this.os?.draw(0,0),this.Di=new f.A(190,261),this.Pi=new f.A(512,334),u.A.clear(),this.Ui=new f.A(501,61),this.Bi=new f.A(288,40),this.Gi=new f.A(269,66),this.$t=!0)};lu=t=>{if(!t)return!1;for(let i=0;i{if(0n===t)return;if(this.Vr>=100)return void this.Ud(0,'Your friends list is full. Max of 100 hit','');const i=M.A.ga(M.A.Ca(t));for(let s=0;s{if(0n!==t)for(let i=0;i{if(0n===t)return;if(this.dh>=100)return void this.Ud(0,'Your ignore list is full. Max of 100 hit','');const i=M.A.ga(M.A.Ca(t));for(let s=0;s{if(0n!==t)for(let i=0;i{const s=this.gr[this.Dn][t][i];if(!s)return void this.He?.TA(this.Dn,t,i);let h=-99999999,e=null;for(let t=s.head();t;t=s.next()){const i=n.A.get(t.index);let s=i.OA;i.da&&(s*=t.count+1),s>h&&(h=s,e=t)}if(!e)return;s.bA(e);let r=-1,o=-1,l=0,a=0;for(let t=s.head();t;t=s.next())t.index!==e.index&&-1===r&&(r=t.index,l=t.count),t.index!==e.index&&t.index!==r&&-1===o&&(o=t.index,a=t.count);let c=null;-1!==r&&(c=n.A.get(r).vA(l));let f=null;-1!==o&&(f=n.A.get(o).vA(a));const u=t+(i<<7)+1610612736|0,d=n.A.get(e.index);this.He?.LA(t,i,this.Bf(this.Dn,128*t+64,128*i+64),this.Dn,u,d.vA(e.count),f,c)};RA=(t,i,s,h,n,r,o)=>{if(i<1||s<1||i>102||s>102)return;if($.K.st&&t!==this.Dn)return;if(!this.He)return;let l=0;if(o===N.A.SA&&(l=this.He.Ed(t,i,s)),o===N.A.MA&&(l=this.He.kA(t,s,i)),o===N.A.xA&&(l=this.He.Md(t,i,s)),o===N.A.lA&&(l=this.He.Ad(t,i,s)),0!==l){const h=this.He.gd(t,i,s,l),n=l>>14&32767,r=31&h,a=h>>6;if(o===N.A.SA){this.He?.DA(t,i,s,1);const h=e.A.get(n);h.NA&&this.kn[t]?.DA(i,s,r,a,h.PA)}if(o===N.A.MA&&this.He?.FA(t,i,s),o===N.A.xA){this.He.UA(t,i,s);const h=e.A.get(n);if(i+h.width>G.A.Xn-1||s+h.width>G.A.Xn-1||i+h.length>G.A.Xn-1||s+h.length>G.A.Xn-1)return;h.NA&&this.kn[t]?.UA(i,s,h.width,h.length,a,h.PA)}if(o===N.A.lA){this.He?.BA(t,i,s);const h=e.A.get(n);h.NA&&h.active&&this.kn[t]?.GA(i,s)}}if(h>=0){let e=t;this.Yn&&t<3&&!(2&~this.Yn[1][i][s])&&(e=t+1),this.Wn&&D.A.RA(t,i,s,this.He,this.Wn,this._r,this.kn[t],h,r,n,e)}};Uw=()=>{this.Bt.jc(O.A.HA),-1!==this.oh&&(this.oh=-1,this.Ws=!0,this.ye=!1,this.Vs=!0),-1!==this.lh&&(this.lh=-1,this.Ys=!0,this.ye=!1),this.Xs=-1};qc=async()=>{this.Yt>0?await this.WA():(this.Pi?.bind(),this.wi?.Ac(257,144,'Connection lost',m.A.Bl),this.wi?.Ac(256,143,'Connection lost',m.A._l),this.wi?.Ac(257,159,'Please wait - attempting to reestablish',m.A.Bl),this.wi?.Ac(256,158,'Please wait - attempting to reestablish',m.A._l),this.Pi?.draw(8,11),this.Ke=0,this.stream?.close(),this.ac=!1,await this.Mc(this.username,this.password,!0),this.ac||await this.WA())};WA=async()=>{this.stream&&this.stream.close(),this.stream=null,this.ac=!1,this.Jt=0,this.username='',this.password='',k.A.Wc(),this.Qf(),this.He?.reset();for(let t=0;t{if(!this.stream)return!1;try{let t=this.stream.available;if(0===t)return!1;if(-1===this.Xt&&(await this.stream.Pc(this.in.data,0,1),this.Xt=255&this.in.data[0],this.Kt&&(this.Xt=this.Xt-this.Kt.YA&255),this.packetSize=E.A.VA[this.Xt],t--),-1===this.packetSize){if(t<=0)return!1;await this.stream.Pc(this.in.data,0,1),this.packetSize=255&this.in.data[0],t--}if(-2===this.packetSize){if(t<=1)return!1;await this.stream.Pc(this.in.data,0,2),this.in.Fc=0,this.packetSize=this.in.KA,t-=2}if(t0&&this.Ud(5,s+' has logged in.',''),0===i&&this.Ud(5,s+' has logged out.','')),s=null;break}s&&this.Vr<100&&(this.ho[this.Vr]=t,this.so[this.Vr]=s,this.eo[this.Vr]=i,this.Vr++,this.Ws=!0);let h=!1;for(;!h;){h=!0;for(let t=0;t=0&&h>=0&&s=G.A.Xn||t.z>=G.A.Xn)&&t.sy();return 0!==this.Ke&&(this.Ke-=e,this.Xe-=n),this.ze=!1,this.Xt=-1,!0}if(this.Xt===T.A.hy)return c.A.Ro[this.in.KA].model=this.Sr?.ey()||null,this.Xt=-1,!0;if(this.Xt===T.A.ny)return this.Ah=this.in.ZA,1===this.Ah&&(this.yh=this.in.KA),this.Ah>=2&&this.Ah<=6&&(2===this.Ah&&(this.ph=64,this.mh=64),3===this.Ah&&(this.ph=0,this.mh=64),4===this.Ah&&(this.ph=128,this.mh=64),5===this.Ah&&(this.ph=64,this.mh=0),6===this.Ah&&(this.ph=64,this.mh=128),this.Ah=2,this._h=this.in.KA,this.Eh=this.in.KA,this.gh=this.in.ZA),10===this.Ah&&(this.Ih=this.in.KA),this.Xt=-1,!0;if(this.Xt===T.A.oy){const t=this.in.ly,i=this.in.Ko,s=this.in.Ko;return t!==this.mo&&this.po&&!$.K.st&&await this.Vo(t,i,s),this.mo=t,this.Io=i,this._o=s,this.yo=0,this.Xt=-1,!0}if(this.Xt===T.A.uy)return await this.WA(),this.Xt=-1,!1;if(this.Xt===T.A.wy){const t=this.in.ZA,i=this.in.ZA;let s=-1;if(this.Ln)for(let h=0;h=100&&(this.ln=128*this.tr+64,this.cn=128*this.ir+64,this.an=this.Bf(this.Dn,this.tr,this.ir)-this.sr),this.Xt=-1,!0;if(this.Xt===T.A.sp){this._n=this.in.ZA,this.En=this.in.ZA;for(let t=this._n;t=this._n&&t.x=this.En&&t.z1?this.Ud(7,e,M.A.ga(M.A.Ca(t))):this.Ud(3,e,M.A.ga(M.A.Ca(t)))}catch(t){}return this.Xt=-1,!0}if(this.Xt===T.A.lp){for(let t=0;t=100){const t=128*this.Zn+64,i=128*this.qn+64,s=this.Bf(this.Dn,this.Zn,this.qn)-this.$n,h=t-this.ln,e=s-this.an,n=i-this.cn,r=0|Math.sqrt(h*h+n*n);this.fn=325.949*Math.atan2(e,r)&2047,this.un=-325.949*Math.atan2(h,n)&2047,this.fn<128&&(this.fn=128),this.fn>383&&(this.fn=383)}return this.Xt=-1,!0}if(this.Xt===T.A.dp)return this.Sh=this.in.ZA,this.Ws=!0,this.Vs=!0,this.Xt=-1,!0;if(this.Xt===T.A.wp){const t=this.in.ly;let i;if(t.endsWith(':tradereq:')){const s=t.substring(0,t.indexOf(':'));i=M.A.ld(s);let h=!1;for(let t=0;t>10&31,h=i>>5&31,e=31&i;return c.A.Ro[t].Yl=(s<<19)+(h<<11)+(e<<3),this.Xt=-1,!0}if(this.Xt===T.A.Ep){for(let t=0;t=this.bh[s]&&(this.Oh[t]=s+2);return this.Xt=-1,!0}if(this.Xt===T.A.Lp){for(this._n=this.in.ZA,this.En=this.in.ZA;this.in.Fc=0&&t{try{this.In=-1,this.Er.clear(),this._r.clear(),this.Ir.clear(),this.mr.clear(),d.A.Pp(),this.Qf(),this.He?.reset();for(let t=0;t>8,s=255&this.Ln[t];if(33===i&&s>=71&&s<=73){D.A.st=!1;break}}if($.K.st?this.He?.Fp(this.Dn):this.He?.Fp(0),this.Ln&&this.bn){this.Bt.jc(O.A.bf);for(let s=0;s>8)-this.Tn,h=64*(255&this.Ln[s])-this.On,e=this.bn[s];if(e){const s=new I.A(new Uint8Array(e)).Ko,n=R.A.read(s,e,e.length-4,4);t.Up(8*(this.gn-6),8*(this.Cn-6),i,h,n)}else this.Cn<800&&t.Bp(h,i,64,64)}}if(this.Ln&&this.vn){this.Bt.jc(O.A.bf);for(let s=0;s>8)-this.Tn,r=64*(255&this.Ln[s])-this.On;t.Gp(this.He,this._r,this.kn,e,n,r)}}}this.Bt.jc(O.A.bf),t.Hp(this.He,this.kn),this.Pi?.bind(),this.Bt.jc(O.A.bf);for(let t=this._r.head();t;t=this._r.next())2===(this.Yn&&2&this.Yn[1][t.Wp][t.Yp])&&(t.Vp--,t.Vp<0&&t.sy());for(let t=0;t{const i=c.A.Ro[t];if(i.ll)for(let t=0;t{let t=0;for(let i=0;i<99;i++){const s=i+1;t+=s+300*Math.pow(2,s/7)|0,this.bh[i]=t/4|0}};Ud=(t,i,s)=>{0===t&&-1!==this.Yh&&(this.Lh=i,this.Lc=0),-1===this.lh&&(this.Ys=!0);for(let t=99;t>0;t--)this.messageType[t]=this.messageType[t-1],this.Kh[t]=this.Kh[t-1],this.Vh[t]=this.Vh[t-1];$.K.nt&&0===t&&(i='['+(this.Pt/30|0)+']: '+i),this.messageType[0]=t,this.Kh[0]=s,this.Vh[0]=i};Fw=async t=>{const i=a.A.Ro[t].Xp;if(0!==i){const s=this.pe[t];if(1===i&&(1===s&&d.A.sc(.9),2===s&&d.A.sc(.8),3===s&&d.A.sc(.7),4===s&&d.A.sc(.6),n.A.su?.clear(),this.$t=!0),3===i){const t=this.po;0===s&&(this.Eo=256,(0,j.zp)(256),this.po=!0),1===s&&(this.Eo=192,(0,j.zp)(192),this.po=!0),2===s&&(this.Eo=128,(0,j.zp)(128),this.po=!0),3===s&&(this.Eo=64,(0,j.zp)(64),this.po=!0),4===s&&(this.po=!1),this.po!==t&&(this.po&&this.mo?await this.Vo(this.mo,this.Io,this._o):(0,j.vo)(),this.yo=0)}4===i&&(0===s&&(this.fo=256,(0,j.jp)(256),this.oo=!0),1===s&&(this.fo=192,(0,j.jp)(192),this.oo=!0),2===s&&(this.fo=128,(0,j.jp)(128),this.oo=!0),3===s&&(this.fo=64,(0,j.jp)(64),this.oo=!0),4===s&&(this.oo=!1)),5===i&&(this.Ce=s),6===i&&(this.Zh=s),8===i&&(this.jh=s,this.Ys=!0)}};Zp=(t,i)=>{let s=0;for(let t=0;t<100;t++){if(!this.Vh[t])continue;const h=this.messageType[t],e=this.uh+70+4-14*s;if(e<-20)break;0===h&&s++,1!==h&&2!==h||!(1===h||0===this.kh||1===this.kh&&this.lu(this.Kh[t]))||(i>e-14&&i<=e&&this.Sr&&this.Kh[t]!==this.Sr.name&&(this.Br&&(this.rh[this.nh]='Report abuse @whi@'+this.Kh[t],this.Te[this.nh]=34,this.nh++),this.rh[this.nh]='Add ignore @whi@'+this.Kh[t],this.Te[this.nh]=436,this.nh++,this.rh[this.nh]='Add friend @whi@'+this.Kh[t],this.Te[this.nh]=406,this.nh++),s++),3!==h&&7!==h||0!==this.jh||!(7===h||0===this.xh||1===this.xh&&this.lu(this.Kh[t]))||(i>e-14&&i<=e&&(this.Br&&(this.rh[this.nh]='Report abuse @whi@'+this.Kh[t],this.Te[this.nh]=34,this.nh++),this.rh[this.nh]='Add ignore @whi@'+this.Kh[t],this.Te[this.nh]=436,this.nh++,this.rh[this.nh]='Add friend @whi@'+this.Kh[t],this.Te[this.nh]=406,this.nh++),s++),4===h&&(0===this.Dh||1===this.Dh&&this.lu(this.Kh[t]))&&(i>e-14&&i<=e&&(this.rh[this.nh]='Accept trade @whi@'+this.Kh[t],this.Te[this.nh]=903,this.nh++),s++),(5===h||6===h)&&0===this.jh&&this.xh<2&&s++,8===h&&(0===this.Dh||1===this.Dh&&this.lu(this.Kh[t]))&&(i>e-14&&i<=e&&(this.rh[this.nh]='Accept duel @whi@'+this.Kh[t],this.Te[this.nh]=363,this.nh++),s++)}};qp=t=>{if(0===this.jh)return;let i=0;0!==this.Vt&&(i=1);for(let s=0;s<100;s++)if(null!==this.Vh[s]){const h=this.messageType[s];if((3===h||7===h)&&(7===h||0===this.xh||1===this.xh&&this.lu(this.Kh[s]))){const h=329-13*i;if(this.xl>8&&this.xl<520&&t-11>h-10&&t-11<=h+3&&(this.Br&&(this.rh[this.nh]='Report abuse @whi@'+this.Kh[s],this.Te[this.nh]=2034,this.nh++),this.rh[this.nh]='Add ignore @whi@'+this.Kh[s],this.Te[this.nh]=2436,this.nh++,this.rh[this.nh]='Add friend @whi@'+this.Kh[s],this.Te[this.nh]=2406,this.nh++),i++,i>=5)return}if((5===h||6===h)&&this.xh<2&&(i++,i>=5))return}};$p=(t,i,s,h,e,r)=>{if(0!==t.type||!t.ll||t.hide||ih+t.width||s>e+t.height||!t.pl||!t.ml)return;const o=t.ll.length;for(let l=0;l=0||0!==f.Kl)&&i>=o&&s>=a&&i=0?this.Se=f.Jp:this.Se=f.id),0===f.type)this.$p(f,i,s,o,a,f.Tl),f.scroll>f.height&&this.Rf(i,s,f.scroll,f.height,!0,o+f.width,a,f);else if(2===f.type){let t=0;for(let h=0;h=r+32||s>=l+32){t++;continue}if(this.Re=t,this.Le=f.id,!f.Ll||f.Ll[t]<=0){t++;continue}const c=n.A.get(f.Ll[t]-1);if(1===this.oe&&f.Qp)f.id===this.ae&&t===this.le||(this.rh[this.nh]='Use '+this.fe+' with @lre@'+c.name,this.Te[this.nh]=881,this.Oe[this.nh]=c.id,this.be[this.nh]=t,this.ve[this.nh]=f.id,this.nh++);else if(1===this.Ie&&f.Qp)16&~this.Ee||(this.rh[this.nh]=this.ge+' @lre@'+c.name,this.Te[this.nh]=391,this.Oe[this.nh]=c.id,this.be[this.nh]=t,this.ve[this.nh]=f.id,this.nh++);else{if(f.Qp)for(let i=4;i>=3;i--)c.tm&&c.tm[i]?(this.rh[this.nh]=c.tm[i]+' @lre@'+c.name,3===i?this.Te[this.nh]=478:4===i&&(this.Te[this.nh]=347),this.Oe[this.nh]=c.id,this.be[this.nh]=t,this.ve[this.nh]=f.id,this.nh++):4===i&&(this.rh[this.nh]='Drop @lre@'+c.name,this.Te[this.nh]=347,this.Oe[this.nh]=c.id,this.be[this.nh]=t,this.ve[this.nh]=f.id,this.nh++);if(f.im&&(this.rh[this.nh]='Use @lre@'+c.name,this.Te[this.nh]=188,this.Oe[this.nh]=c.id,this.be[this.nh]=t,this.ve[this.nh]=f.id,this.nh++),f.Qp&&c.tm)for(let i=2;i>=0;i--)c.tm[i]&&(this.rh[this.nh]=c.tm[i]+' @lre@'+c.name,0===i?this.Te[this.nh]=405:1===i?this.Te[this.nh]=38:2===i&&(this.Te[this.nh]=422),this.Oe[this.nh]=c.id,this.be[this.nh]=t,this.ve[this.nh]=f.id,this.nh++);if(f.sm)for(let i=4;i>=0;i--)f.sm[i]&&(this.rh[this.nh]=f.sm[i]+' @lre@'+c.name,0===i?this.Te[this.nh]=602:1===i?this.Te[this.nh]=596:2===i?this.Te[this.nh]=22:3===i?this.Te[this.nh]=892:4===i&&(this.Te[this.nh]=415),this.Oe[this.nh]=c.id,this.be[this.nh]=t,this.ve[this.nh]=f.id,this.nh++);this.rh[this.nh]='Examine @lre@'+c.name,$.K.nt&&(this.rh[this.nh]+='@whi@ ('+c.id+')'),this.Te[this.nh]=1773,this.Oe[this.nh]=c.id,f.Rl&&(this.ve[this.nh]=f.Rl[t]),this.nh++}t++}}else if(i>=o&&s>=a&&i{let i=t.El;return i>=c.A.Aa&&i<=c.A.ma?(i>=c.A.pa?i-=c.A.pa:i--,this.rh[this.nh]='Remove @whi@'+this.so[i],this.Te[this.nh]=557,this.nh++,this.rh[this.nh]='Message @whi@'+this.so[i],this.Te[this.nh]=679,this.nh++,!0):i>=c.A._a&&i<=c.A.Ea&&(this.rh[this.nh]='Remove @whi@'+t.text,this.Te[this.nh]=556,this.nh++,!0)};um=()=>{0===this.oe&&0===this.Ie&&(this.rh[this.nh]='Walk here',this.Te[this.nh]=660,this.be[this.nh]=this.xl,this.ve[this.nh]=this.Dl,this.nh++);let t=-1;for(let i=0;i>7&127,o=s>>29&3,l=s>>14&32767;if(s!==t){if(t=s,2===o&&this.He&&this.He.gd(this.Dn,h,r,s)>=0){const t=e.A.get(l);if(1===this.oe)this.rh[this.nh]='Use '+this.fe+' with @cya@'+t.name,this.Te[this.nh]=450,this.Oe[this.nh]=s,this.be[this.nh]=h,this.ve[this.nh]=r,this.nh++;else if(1!==this.Ie){if(t.wm)for(let i=4;i>=0;i--)t.wm[i]&&(this.rh[this.nh]=t.wm[i]+' @cya@'+t.name,0===i&&(this.Te[this.nh]=285),1===i&&(this.Te[this.nh]=504),2===i&&(this.Te[this.nh]=364),3===i&&(this.Te[this.nh]=581),4===i&&(this.Te[this.nh]=1501),this.Oe[this.nh]=s,this.be[this.nh]=h,this.ve[this.nh]=r,this.nh++);this.rh[this.nh]='Examine @cya@'+t.name,$.K.nt&&(this.rh[this.nh]+='@whi@ ('+t.id+')'),this.Te[this.nh]=1175,this.Oe[this.nh]=s,this.be[this.nh]=h,this.ve[this.nh]=r,this.nh++}else 4&~this.Ee||(this.rh[this.nh]=this.ge+' @cya@'+t.name,this.Te[this.nh]=55,this.Oe[this.nh]=s,this.be[this.nh]=h,this.ve[this.nh]=r,this.nh++)}if(1===o){const t=this.Ar[l];if(t&&t.type&&1===t.type.size&&64==(127&t.x)&&64==(127&t.z))for(let i=0;i=0;s--)t.wm&&t.wm[s]?(this.rh[this.nh]=t.wm[s]+' @lre@'+t.name,0===s&&(this.Te[this.nh]=224),1===s&&(this.Te[this.nh]=993),2===s&&(this.Te[this.nh]=99),3===s&&(this.Te[this.nh]=746),4===s&&(this.Te[this.nh]=877),this.Oe[this.nh]=i.index,this.be[this.nh]=h,this.ve[this.nh]=r,this.nh++):2===s&&(this.rh[this.nh]='Take @lre@'+t.name,this.Te[this.nh]=99,this.Oe[this.nh]=i.index,this.be[this.nh]=h,this.ve[this.nh]=r,this.nh++);this.rh[this.nh]='Examine @lre@'+t.name,$.K.nt&&(this.rh[this.nh]+='@whi@ ('+i.index+')'),this.Te[this.nh]=1102,this.Oe[this.nh]=i.index,this.be[this.nh]=h,this.ve[this.nh]=r,this.nh++}else 1&~this.Ee||(this.rh[this.nh]=this.ge+' @lre@'+t.name,this.Te[this.nh]=965,this.Oe[this.nh]=i.index,this.be[this.nh]=h,this.ve[this.nh]=r,this.nh++)}}}}};Am=(t,i,s,h)=>{if(this.nh>=400)return;let e=t.name;if(0!==t._m&&this.Sr&&(e=e+this.Em(this.Sr.Ka,t._m)+' (level-'+t._m+')'),1===this.oe)this.rh[this.nh]='Use '+this.fe+' with @yel@'+e,this.Te[this.nh]=900,this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++;else if(1!==this.Ie){let n;if(t.wm)for(n=4;n>=0;n--)t.wm[n]&&'attack'!==t.wm[n]?.toLowerCase()&&(this.rh[this.nh]=t.wm[n]+' @yel@'+e,0===n?this.Te[this.nh]=728:1===n?this.Te[this.nh]=542:2===n?this.Te[this.nh]=6:3===n?this.Te[this.nh]=963:4===n&&(this.Te[this.nh]=245),this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++);if(t.wm)for(n=4;n>=0;n--)if(t.wm[n]&&'attack'===t.wm[n]?.toLowerCase()){let r=0;this.Sr&&t._m>this.Sr.Ka&&(r=2e3),this.rh[this.nh]=t.wm[n]+' @yel@'+e,0===n?this.Te[this.nh]=r+728:1===n?this.Te[this.nh]=r+542:2===n?this.Te[this.nh]=r+6:3===n?this.Te[this.nh]=r+963:4===n&&(this.Te[this.nh]=r+245),this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++}this.rh[this.nh]='Examine @yel@'+e,$.K.nt&&(this.rh[this.nh]+='@whi@ ('+t.id+')'),this.Te[this.nh]=1607,this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++}else 2&~this.Ee||(this.rh[this.nh]=this.ge+' @yel@'+e,this.Te[this.nh]=265,this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++)};ym=(t,i,s,h)=>{if(t===this.Sr||this.nh>=400)return;let e=null;this.Sr&&(e=t.name+this.Em(this.Sr.Ka,t.Ka)+' (level-'+t.Ka+')'),1===this.oe?(this.rh[this.nh]='Use '+this.fe+' with @whi@'+e,this.Te[this.nh]=367,this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++):1!==this.Ie?(this.rh[this.nh]='Follow @whi@'+e,this.Te[this.nh]=1544,this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++,0===this.Js&&(this.rh[this.nh]='Trade with @whi@'+e,this.Te[this.nh]=1373,this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++),this.Fr>0&&(this.rh[this.nh]='Attack @whi@'+e,this.Sr&&this.Sr.Ka>=t.Ka?this.Te[this.nh]=151:this.Te[this.nh]=2151,this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++),1===this.Ur&&(this.rh[this.nh]='Fight @whi@'+e,this.Te[this.nh]=151,this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++),2===this.Ur&&(this.rh[this.nh]='Duel-with @whi@'+e,this.Te[this.nh]=1101,this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++)):8&~this.Ee||(this.rh[this.nh]=this.ge+' @whi@'+e,this.Te[this.nh]=651,this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++);for(let t=0;t{const s=t-i;return s<-9?'@red@':s<-6?'@or3@':s<-3?'@or2@':s<0?'@or1@':s>9?'@gre@':s>6?'@gr3@':s>3?'@gr2@':s>0?'@gr1@':'@yel@'};ef=()=>{if(0===this.se){this.rh[0]='Cancel',this.Te[0]=1252,this.nh=1,this.qp(this.Dl),this.Se=0,this.xl>8&&this.Dl>11&&this.xl<520&&this.Dl<345&&(-1===this.Xs?this.um():this.$p(c.A.Ro[this.Xs],this.xl,this.Dl,8,11,0)),this.Se!==this.$h&&(this.$h=this.Se),this.Se=0,this.xl>562&&this.Dl>231&&this.xl<752&&this.Dl<492&&(-1!==this.oh?this.$p(c.A.Ro[this.oh],this.xl,this.Dl,562,231,0):-1!==this.Mh[this.Sh]&&this.$p(c.A.Ro[this.Mh[this.Sh]],this.xl,this.Dl,562,231,0)),this.Se!==this.Jh&&(this.Ws=!0,this.Jh=this.Se),this.Se=0,this.xl>22&&this.Dl>375&&this.xl<431&&this.Dl<471&&(-1===this.lh?this.Zp(this.xl-22,this.Dl-375):this.$p(c.A.Ro[this.lh],this.xl,this.Dl,22,375,0)),-1!==this.lh&&this.Se!==this.Qh&&(this.Ys=!0,this.Qh=this.Se);let t=!1;for(;!t;){t=!0;for(let i=0;i1e3){const s=this.rh[i];this.rh[i]=this.rh[i+1],this.rh[i+1]=s;const h=this.Te[i];this.Te[i]=this.Te[i+1],this.Te[i+1]=h;const e=this.be[i];this.be[i]=this.be[i+1],this.be[i+1]=e;const n=this.ve[i];this.ve[i]=this.ve[i+1],this.ve[i+1]=n;const r=this.Oe[i];this.Oe[i]=this.Oe[i+1],this.Oe[i+1]=r,t=!1}}}};lf=()=>{let t=0;if(this.Ai){let i;t=this.Ai.au('Choose Option');for(let s=0;st&&(t=i)}t+=8;const i=15*this.nh+21;let s,h;this.Rc>8&&this.Sc>11&&this.Rc<520&&this.Sc<345&&(s=this.Rc-(t/2|0)-8,s+t>512?s=512-t:s<0&&(s=0),h=this.Sc-11,h+i>334?h=334-i:h<0&&(h=0),this.Qs=!0,this.th=0,this.ih=s,this.sh=h,this.hh=t,this.eh=15*this.nh+22),this.Rc>562&&this.Sc>231&&this.Rc<752&&this.Sc<492&&(s=this.Rc-(t/2|0)-562,s<0?s=0:s+t>190&&(s=190-t),h=this.Sc-231,h<0?h=0:h+i>261&&(h=261-i),this.Qs=!0,this.th=1,this.ih=s,this.sh=h,this.hh=t,this.eh=15*this.nh+22),this.Rc>22&&this.Sc>375&&this.Rc<501&&this.Sc<471&&(s=this.Rc-(t/2|0)-22,s<0?s=0:s+t>479&&(s=479-t),h=this.Sc-375,h<0?h=0:h+i>96&&(h=96-i),this.Qs=!0,this.th=2,this.ih=s,this.sh=h,this.hh=t,this.eh=15*this.nh+22)};df=(t,i,s,h,e,n,r,o,l,a,c)=>{const f=this.kn[this.Dn];if(!f)return!1;const u=G.A.Xn,d=G.A.Xn;for(let t=0;t0&&0===this.vr[i]&&(E[i]&H.A.pd)===H.A.OPEN&&(this.Or[p]=w-1,this.br[p]=A,p=(p+1)%_,this.vr[i]=2,this.Lr[i]=t),i=G.A.index(w+1,A),w0&&0===this.vr[i]&&(E[i]&H.A.Id)===H.A.OPEN&&(this.Or[p]=w,this.br[p]=A-1,p=(p+1)%_,this.vr[i]=1,this.Lr[i]=t),i=G.A.index(w,A+1),A0&&A>0&&0===this.vr[i]&&!(E[i]&H.A.bm)&&(E[G.A.index(w-1,A)]&H.A.pd)===H.A.OPEN&&(E[G.A.index(w,A-1)]&H.A.Id)===H.A.OPEN&&(this.Or[p]=w-1,this.br[p]=A-1,p=(p+1)%_,this.vr[i]=3,this.Lr[i]=t),i=G.A.index(w+1,A-1),w0&&0===this.vr[i]&&!(E[i]&H.A.vm)&&(E[G.A.index(w+1,A)]&H.A.md)===H.A.OPEN&&(E[G.A.index(w,A-1)]&H.A.Id)===H.A.OPEN&&(this.Or[p]=w+1,this.br[p]=A-1,p=(p+1)%_,this.vr[i]=9,this.Lr[i]=t),i=G.A.index(w-1,A+1),w>0&&A=0&&s>=0&&e0){_=Math.min(m,25),m--;const t=this.Or[m],i=this.br[m];if($.K.nt&&1===this.if[6]&&1===this.if[7]){for(let t=0;t{this.cr=0,this.ar=0,this.xm(t),this.Dm(t),this.Nm(t,i),this.Pm(t);for(let t=0;t{t.Fm();if(0!==t.Um(1)){const i=t.Um(2);if(0===i)this.ur[this.ar++]=this.Mt;else if(1===i){const i=t.Um(3);this.Sr?.step(!1,i);1===t.Um(1)&&(this.ur[this.ar++]=this.Mt)}else if(2===i){const i=t.Um(3);this.Sr?.step(!0,i);const s=t.Um(3);this.Sr?.step(!0,s);1===t.Um(1)&&(this.ur[this.ar++]=this.Mt)}else if(3===i){this.Dn=t.Um(2);const i=t.Um(7),s=t.Um(7),h=t.Um(1);this.Sr?.move(1===h,i,s);1===t.Um(1)&&(this.ur[this.ar++]=this.Mt)}}};Dm=t=>{const i=t.Um(8);if(ithis.rr)throw new Error(`eek! ${this.username} Too many players`);this.rr=0;for(let s=0;s{let s;for(;t.Bm+10<8*i&&(s=t.Um(11),2047!==s);){if(!this.nr[s]){this.nr[s]=new W.A;const t=this.wr[s];t&&this.nr[s]?.read(t)}this.lr[this.rr++]=s;const i=this.nr[s];i&&(i.Vf=this.Pt);let h=t.Um(5);h>15&&(h-=32);let e=t.Um(5);e>15&&(e-=32);const n=t.Um(1);this.Sr&&i?.move(1===n,this.Sr.wf[0]+h,this.Sr.Af[0]+e);1===t.Um(1)&&(this.ur[this.ar++]=s)}t.Gm()};Pm=t=>{for(let i=0;i{if(t.Eu=s,t.gu=this.Pt,(s&W.A.Cu)===W.A.Cu){const s=e.ZA,h=new Uint8Array(s),n=new I.A(h);e.xy(s,0,h),this.wr[i]=n,t.read(n)}if((s&W.A.Tu)===W.A.Tu){let i=e.KA;65535===i&&(i=-1),i===t.Ou&&(t.Ym=0);const s=e.ZA;(-1===i||-1===t.Ou||h.A.Ro[i].priority>h.A.Ro[t.Ou].priority||0===h.A.Ro[t.Ou].priority)&&(t.Ou=i,t.Vm=0,t.Km=0,t.Xm=s,t.Ym=0)}if((s&W.A.bu)===W.A.bu&&(t.vu=e.KA,65535===t.vu&&(t.vu=-1)),(s&W.A.Lu)===W.A.Lu&&(t.ou=e.ly,t.cu=0,t.fu=0,t.uu=150,t.name&&this.Ud(2,t.ou,t.name)),(s&W.A.Ru)===W.A.Ru&&(t.pu=e.ZA,t.yu=e.ZA,t.du=this.Pt+400,t.wu=e.ZA,t.Au=e.ZA),(s&W.A.Su)===W.A.Su&&(t.zm=e.KA,t.jm=e.KA,t.Mu=t.zm,t.ku=t.jm),(s&W.A.xu)===W.A.xu){const i=e.KA,s=e.ZA,h=e.ZA,n=e.Fc;if(t.name){const n=M.A.ld(t.name);let r=!1;if(s<=1)for(let t=0;t>8,t.fu=255&i,t.uu=150,s>1?this.Ud(1,r,t.name):this.Ud(2,r,t.name)}catch(t){}}e.Fc=n+h}if((s&W.A.Du)===W.A.Du){t.Nu=e.KA;const i=e.Ko;t.Zm=i>>16,t.qm=this.Pt+(65535&i),t.$m=0,t.Jm=0,t.qm>this.Pt&&(t.$m=-1),65535===t.Nu&&(t.Nu=-1)}(s&W.A.Pu)===W.A.Pu&&(t.Qm=e.ZA,t.tI=e.ZA,t.iI=e.ZA,t.sI=e.ZA,t.mu=e.KA+this.Pt,t.Iu=e.KA+this.Pt,t.hI=e.ZA,t.pathLength=0,t.wf[0]=t.iI,t.Af[0]=t.sI)};QA=(t,i)=>{this.cr=0,this.ar=0,this.eI(t),this.nI(t,i),this.rI(t);for(let t=0;t{t.Fm();const i=t.Um(8);if(ithis.yr)throw new Error(`eek! ${this.username} Too many npc!`);this.yr=0;for(let s=0;s{for(;t.Bm+21<8*i;){const i=t.Um(13);if(8191===i)break;this.Ar[i]||(this.Ar[i]=new Y.A);const s=this.Ar[i];this.pr[this.yr++]=i,s?(s.Vf=this.Pt,s.type=r.A.get(t.Um(11)),s.size=s.type.size,s.oI=s.type.lI,s.aI=s.type.cI,s.fI=s.type.uI,s.dI=s.type.wI,s.Sa=s.type.AI):t.Um(11);let h=t.Um(5);h>15&&(h-=32);let e=t.Um(5);e>15&&(e-=32),this.Sr&&s?.move(!1,this.Sr.wf[0]+h,this.Sr.Af[0]+e);1===t.Um(1)&&(this.ur[this.ar++]=i)}t.Gm()};rI=t=>{for(let i=0;ih.A.Ro[e.Ou].priority||0===h.A.Ro[e.Ou].priority)&&(e.Ou=i,e.Vm=0,e.Km=0,e.Xm=s,e.Ym=0)}if((n&Y.A.bu)===Y.A.bu&&(e.vu=t.KA,65535===e.vu&&(e.vu=-1)),(n&Y.A.Lu)===Y.A.Lu&&(e.ou=t.ly,e.uu=100),(n&Y.A.Ru)===Y.A.Ru&&(e.pu=t.ZA,e.yu=t.ZA,e.du=this.Pt+400,e.wu=t.ZA,e.Au=t.ZA),(n&Y.A.Fu)===Y.A.Fu&&(e.type=r.A.get(t.KA),e.oI=e.type.lI,e.aI=e.type.cI,e.fI=e.type.uI,e.dI=e.type.wI,e.Sa=e.type.AI),(n&Y.A.Du)===Y.A.Du){e.Nu=t.KA;const i=t.Ko;e.Zm=i>>16,e.qm=this.Pt+(65535&i),e.$m=0,e.Jm=0,e.qm>this.Pt&&(e.$m=-1),65535===e.Nu&&(e.Nu=-1)}(n&Y.A.Su)===Y.A.Su&&(e.zm=t.KA,e.jm=t.KA,e.Mu=e.zm,e.ku=e.jm)}};$c=()=>{for(let t=-1;t1406){$.K.yt=0,this.Bt.jc(O.A.pI),this.Bt.p1(0);const t=this.Bt.Fc;this.Bt.p1(162),this.Bt.p1(22),2*Math.random()|0||this.Bt.p1(84),this.Bt.p2(31824),this.Bt.p2(13490),2*Math.random()|0||this.Bt.p1(123),2*Math.random()|0||this.Bt.p1(134),this.Bt.p1(100),this.Bt.p1(94),this.Bt.p2(35521),this.Bt.Hf(this.Bt.Fc-t)}};yI=t=>{(t.x<128||t.z<128||t.x>=13184||t.z>=13184)&&(t.Ou=-1,t.Nu=-1,t.mu=0,t.Iu=0,t.x=128*t.wf[0]+64*t.size,t.z=128*t.Af[0]+64*t.size,t.pathLength=0),t===this.Sr&&(t.x<1536||t.z<1536||t.x>=11776||t.z>=11776)&&(t.Ou=-1,t.Nu=-1,t.mu=0,t.Iu=0,t.x=128*t.wf[0]+64*t.size,t.z=128*t.Af[0]+64*t.size,t.pathLength=0),t.mu>this.Pt?this.mI(t):t.Iu>=this.Pt?this.II(t):this._I(t),this.EI(t),this.gI(t)};xf=()=>{if(this.Sr){this.Sr.x>>7===this.Ke&&this.Sr.z>>7===this.Xe&&(this.Ke=0);for(let t=-1;t50||this.rr>200)&&-1!==t&&i.CI===i.Sa;const h=i.x>>7,e=i.z>>7;if(!(h<0||h>=G.A.Xn||e<0||e>=G.A.Xn))if(!i.TI||this.Pt=i.bI){if(64==(127&i.x)&&64==(127&i.z)){if(this.Vn[h][e]===this.Ve)continue;this.Vn[h][e]=this.Ve}i.y=this.Bf(this.Dn,i.x,i.z),this.He?.vI(this.Dn,i.x,i.y,i.z,null,i,s,i.LI,60,i.RI)}else i.st=!1,i.y=this.Bf(this.Dn,i.x,i.z),this.He?.SI(this.Dn,i.x,i.y,i.z,i.MI,i.kI,i.xI,i.DI,null,i,s,i.LI)}}};Jc=()=>{for(let t=0;t{for(let t=0;t>7,e=i.z>>7;if(!(h<0||h>=G.A.Xn||e<0||e>=G.A.Xn)){if(1===i.size&&64==(127&i.x)&&64==(127&i.z)){if(this.Vn[h][e]===this.Ve)continue;this.Vn[h][e]=this.Ve}this.He?.vI(this.Dn,i.x,this.Bf(this.Dn,i.x,i.z),i.z,null,i,s,i.LI,64*(i.size-1)+60,i.RI)}}};Nf=()=>{for(let t=this.mr.head();t;t=this.mr.next())if(t.level!==this.Dn||this.Pt>t.NI)t.sy();else if(this.Pt>=t.FI){if(t.target>0){const i=this.Ar[t.target-1];i&&t.UI(i.x,this.Bf(t.level,i.x,i.z)-t.offsetY,i.z,this.Pt)}if(t.target<0){const i=-t.target-1;let s;s=i===this.Dr?this.Sr:this.nr[i],s&&t.UI(s.x,this.Bf(t.level,s.x,s.z)-t.offsetY,s.z,this.Pt)}t.update(this.Ye),this.He?.vI(this.Dn,0|t.x,0|t.y,0|t.z,null,t,-1,t.LI,60,!1)}};Pf=()=>{for(let t=this.Ir.head();t;t=this.Ir.next())t.level!==this.Dn||t.BI?t.sy():this.Pt>=t.FI&&(t.update(this.Ye),t.BI?t.sy():this.He?.vI(t.level,t.x,t.y,t.z,null,t,-1,0,60,!1))};Ff=()=>{for(let t=this._r.head();t;t=this._r.next()){let i=!1;if(t.fl+=this.Ye,-1===t.ul&&(t.ul=0,i=!0),t.GI.delay)for(;t.fl>t.GI.delay[t.ul];)if(t.fl-=t.GI.delay[t.ul]+1,t.ul++,i=!0,t.ul>=t.GI.dl&&(t.ul-=t.GI.wl,t.ul<0||t.ul>=t.GI.dl)){t.sy(),i=!1;break}if(i&&this.He){const i=t.Vp,s=t.Wp,h=t.Yp;let n=0;if(0===t.HI?n=this.He.Ed(i,s,h):1===t.HI?n=this.He.kA(i,h,s):2===t.HI?n=this.He.Md(i,s,h):3===t.HI&&(n=this.He.Ad(i,s,h)),this.Wn&&0!==n&&(n>>14&32767)===t.index){const r=this.Wn[i][s][h],o=this.Wn[i][s+1][h],l=this.Wn[i][s+1][h+1],a=this.Wn[i][s][h+1],c=e.A.get(t.index);let f=-1;if(-1!==t.ul&&t.GI.frames&&(f=t.GI.frames[t.ul]),2===t.HI){const t=this.He.gd(i,s,h,n);let e=31&t;const u=t>>6;e===P.A.oA.id&&(e=P.A.rA.id),this.He?.WI(i,s,h,c.la(e,u,r,o,l,a,f))}else if(1===t.HI)this.He?.YI(i,s,h,c.la(P.A.VI.id,0,r,o,l,a,f));else if(0===t.HI){const t=this.He.gd(i,s,h,n),e=31&t,u=t>>6;if(e===P.A.Od.id){const t=u+1&3;this.He?.KI(s,h,i,c.la(P.A.Od.id,u+4,r,o,l,a,f),c.la(P.A.Od.id,t,r,o,l,a,f))}else this.He?.XI(i,s,h,c.la(e,u,r,o,l,a,f))}else if(3===t.HI){const t=this.He.gd(i,s,h,n)>>6;this.He?.zI(i,s,h,c.la(P.A.lA.id,t,r,o,l,a,f))}}else t.sy()}}};Qc=()=>{for(let t=-1;t0&&(s.uu--,0===s.uu&&(s.ou=null))}for(let t=0;t0&&(s.uu--,0===s.uu&&(s.ou=null))}};tf=()=>{if(2===this.We){for(let t=this.Er.head();t;t=this.Er.next())this.Pt>=t.NI&&(this.RA(t.hp,t.x,t.z,t.Kp,t.angle,t.shape,t.Nd),t.sy());$.K.At++,$.K.At>85&&($.K.At=0,this.Bt.jc(O.A.jI))}};mI=t=>{const i=t.mu-this.Pt,s=128*t.Qm+64*t.size,h=128*t.tI+64*t.size;t.x+=(s-t.x)/i|0,t.z+=(h-t.z)/i|0,t.ZI=0,0===t.hI&&(t.qI=1024),1===t.hI&&(t.qI=1536),2===t.hI&&(t.qI=0),3===t.hI&&(t.qI=512)};II=t=>{if(t.Iu===this.Pt||-1===t.Ou||0!==t.Xm||t.Km+1>h.A.Ro[t.Ou].delay[t.Vm]){const i=t.Iu-t.mu,s=this.Pt-t.mu,h=128*t.Qm+64*t.size,e=128*t.tI+64*t.size,n=128*t.iI+64*t.size,r=128*t.sI+64*t.size;t.x=(h*(i-s)+n*s)/i|0,t.z=(e*(i-s)+r*s)/i|0}t.ZI=0,0===t.hI&&(t.qI=1024),1===t.hI&&(t.qI=1536),2===t.hI&&(t.qI=0),3===t.hI&&(t.qI=512),t.LI=t.qI};EI=t=>{if(-1!==t.vu&&t.vu<32768){const i=this.Ar[t.vu];if(i){const s=t.x-i.x,h=t.z-i.z;0===s&&0===h||(t.qI=325.949*Math.atan2(s,h)&2047)}}if(t.vu>=32768){let i=t.vu-32768;i===this.Dr&&(i=this.Mt);const s=this.nr[i];if(s){const i=t.x-s.x,h=t.z-s.z;0===i&&0===h||(t.qI=325.949*Math.atan2(i,h)&2047)}}if((0!==t.zm||0!==t.jm)&&(0===t.pathLength||t.ZI>0)){const i=t.x-64*(t.zm-this.Tn-this.Tn),s=t.z-64*(t.jm-this.On-this.On);0===i&&0===s||(t.qI=325.949*Math.atan2(i,s)&2047),t.zm=0,t.jm=0}const i=t.qI-t.LI&2047;if(0!==i&&(i<32||i>2016?t.LI=t.qI:i>1024?t.LI-=32:t.LI+=32,t.LI&=2047,t.CI===t.Sa&&t.LI!==t.qI)){if(-1!==t.$I)return void(t.CI=t.$I);t.CI=t.oI}};gI=t=>{let i;if(t.RI=!1,-1!==t.CI&&(i=h.A.Ro[t.CI],t.JI++,i.delay&&t.QIi.delay[t.QI]&&(t.JI=0,t.QI++),t.QI>=i.dl&&(t.JI=0,t.QI=0)),-1!==t.Ou&&0===t.Xm){for(i=h.A.Ro[t.Ou],t.Km++;i.delay&&t.Vmi.delay[t.Vm];)t.Km-=i.delay[t.Vm],t.Vm++;t.Vm>=i.dl&&(t.Vm-=i.wl,t.Ym++,t.Ym>=i.t_&&(t.Ou=-1),(t.Vm<0||t.Vm>=i.dl)&&(t.Ou=-1)),t.RI=i.i_}if(t.Xm>0&&t.Xm--,-1!==t.Nu&&this.Pt>=t.qm){for(t.$m<0&&(t.$m=0),i=l.A.Ro[t.Nu].GI,t.Jm++;i&&i.delay&&t.$mi.delay[t.$m];)t.Jm-=i.delay[t.$m],t.$m++;i&&t.$m>=i.dl&&(t.$m<0||t.$m>=i.dl)&&(t.Nu=-1)}};_I=t=>{if(t.CI=t.Sa,0===t.pathLength)return void(t.ZI=0);if(-1!==t.Ou&&0===t.Xm){if(!h.A.Ro[t.Ou].s_)return void t.ZI++}const i=t.x,s=t.z,e=128*t.wf[t.pathLength-1]+64*t.size,n=128*t.Af[t.pathLength-1]+64*t.size;if(e-i<=256&&e-i>=-256&&n-s<=256&&n-s>=-256){t.qI=in?1792:1536:i>e?sn?256:512:s1024&&(h-=2048);let r=t.aI;h>=-256&&h<=256?r=t.oI:h>=256&&h<768?r=t.dI:h>=-768&&h<=-256&&(r=t.fI),-1===r&&(r=t.oI),t.CI=r;let o=4;t.LI!==t.qI&&-1===t.vu&&(o=2),t.pathLength>2&&(o=6),t.pathLength>3&&(o=8),t.ZI>0&&t.pathLength>1&&(o=8,t.ZI--),t.h_[t.pathLength-1]&&(o<<=1),o>=8&&t.CI===t.oI&&-1!==t.e_&&(t.CI=t.e_),ie&&(t.x=e)):i>e&&(t.x-=o,t.xn&&(t.z=n)):s>n&&(t.z-=o,t.z{let t=3;if(this.fn<310&&this.Sr){let i=this.ln>>7,s=this.cn>>7;const h=this.Sr.x>>7,e=this.Sr.z>>7;let n,r,o,l;if(this.Yn&&4&this.Yn[this.Dn][i][s]&&(t=this.Dn),n=h>i?h-i:i-h,r=e>s?e-s:s-e,n>r)for(o=65536*r/n|0,l=32768;i!==h;)ih&&i--,this.Yn&&4&this.Yn[this.Dn][i][s]&&(t=this.Dn),l+=o,l>=65536&&(l-=65536,se&&s--,this.Yn&&4&this.Yn[this.Dn][i][s]&&(t=this.Dn));else for(o=65536*n/r|0,l=32768;s!==e;)se&&s--,this.Yn&&4&this.Yn[this.Dn][i][s]&&(t=this.Dn),l+=o,l>=65536&&(l-=65536,ih&&i--,this.Yn&&4&this.Yn[this.Dn][i][s]&&(t=this.Dn))}return this.Sr&&this.Yn&&4&this.Yn[this.Dn][this.Sr.x>>7][this.Sr.z>>7]&&(t=this.Dn),t};Wf=()=>{if(!this.Yn)return 0;return this.Bf(this.Dn,this.ln,this.cn)-this.an>=800||!(4&this.Yn[this.Dn][this.ln>>7][this.cn>>7])?3:this.Dn};Bf=(t,i,s)=>{if(!this.Wn)return 0;const h=Math.min(i>>7,G.A.Xn-1),e=Math.min(s>>7,G.A.Xn-1);let n=t;t<3&&this.Yn&&!(2&~this.Yn[1][h][e])&&(n=t+1);const r=127&i,o=127&s;return(this.Wn[n][h][e]*(128-r)+this.Wn[n][h+1][e]*r>>7)*(128-o)+(this.Wn[n][h][e+1]*(128-r)+this.Wn[n][h+1][e+1]*r>>7)*o>>7};Uf=(t,i,s,h,e,n)=>{const r=2048-e&2047,o=2048-h&2047;let l,a,c,f=0,u=0,w=n;0!==r&&(l=d.A.sin[r],a=d.A.cos[r],c=u*a-n*l>>16,w=u*l+n*a>>16,u=c),0!==o&&(l=d.A.sin[o],a=d.A.cos[o],c=w*l+f*a>>16,w=w*a-f*l>>16,f=c),this.ln=t-f,this.an=i-u,this.cn=s-w,this.fn=e,this.un=h};Ef=()=>{if(!this.Sr)return;const t=this.Sr.x+this.Ze,i=this.Sr.z+this.qe;(this.Gn-t<-500||this.Gn-t>500||this.Hn-i<-500||this.Hn-i>500)&&(this.Gn=t,this.Hn=i),this.Gn!==t&&(this.Gn+=(t-this.Gn)/16|0),this.Hn!==i&&(this.Hn+=(i-this.Hn)/16|0),1===this.if[1]?this.Un+=(-this.Un-24)/2|0:1===this.if[2]?this.Un+=(24-this.Un)/2|0:this.Un=this.Un/2|0,1===this.if[3]?this.Bn+=(12-this.Bn)/2|0:1===this.if[4]?this.Bn+=(-this.Bn-12)/2|0:this.Bn=this.Bn/2|0,this.Fn=this.Fn+this.Un/2&2047,this.Pn+=this.Bn/2|0,this.Pn<128&&(this.Pn=128),this.Pn>383&&(this.Pn=383);const s=this.Gn>>7,h=this.Hn>>7,e=this.Bf(this.Dn,this.Gn,this.Hn);let n=0;if(this.Wn&&s>3&&h>3&&s<100&&h<100)for(let t=s-4;t<=s+4;t++)for(let i=h-4;i<=h+4;i++){let s=this.Dn;s<3&&this.Yn&&!(2&~this.Yn[1][t][i])&&s++;const h=e-this.Wn[s][t][i];h>n&&(n=h)}let r=192*n;r>98048&&(r=98048),r<32768&&(r=32768),r>this.dn?this.dn+=(r-this.dn)/24|0:r{let t=128*this.tr+64,i=128*this.ir+64,s=this.Bf(this.Dn,this.tr,this.ir)-this.sr;this.lnt&&(this.ln=t)),this.ln>t&&(this.ln-=this.hr+((this.ln-t)*this.er/1e3|0),this.lns&&(this.an=s)),this.an>s&&(this.an-=this.hr+((this.an-s)*this.er/1e3|0),this.ani&&(this.cn=i)),this.cn>i&&(this.cn-=this.hr+((this.cn-i)*this.er/1e3|0),this.cn383&&(o=383),this.fno&&(this.fn=o)),this.fn>o&&(this.fn-=this.Jn+((this.fn-o)*this.Qn/1e3|0),this.fn1024&&(a-=2048),a<-1024&&(a+=2048),a>0&&(this.un+=this.Jn+(a*this.Qn/1e3|0),this.un&=2047),a<0&&(this.un-=this.Jn+(-a*this.Qn/1e3|0),this.un&=2047);let c=l-this.un;c>1024&&(c-=2048),c<-1024&&(c+=2048),(c<0&&a>0||c>0&&a<0)&&(this.un=l)};vy=(t,i)=>{const s=t.ZA;let n=this._n+(s>>4&7),r=this.En+(7&s);if(i===T.A.by||i===T.A.Oy){const s=t.ZA,h=s>>2,e=3&s,o=P.A.of(h).Nd;let l;if(l=i===T.A.Oy?-1:t.KA,n>=0&&r>=0&&n>14&32767,h=31&t,e=t>>6}t=new U.A(this.Dn,o,n,r,0,F.A.bd,P.A.Td.id,s,e,h),this.Tr.n_(t)}t&&(t.Kp=l,t.shape=h,t.angle=e),this.RA(this.Dn,n,r,l,e,h,o)}}else if(i===T.A.Ty){const i=t.ZA>>2,s=P.A.of(i).Nd,e=t.KA;if(n>=0&&r>=0&&n>14&32767,this.Dn,s,n,r,h.A.Ro[e],!1);this._r.n_(i)}}}else if(i===T.A.Cy){const i=t.KA,s=t.KA;if(n>=0&&r>=0&&n=0&&r>=0&&n=0&&r>=0&&n=0&&s>=0&&i=0&&r>=0&&n=0&&r>=0&&n>2,h=3&i,o=P.A.of(s).Nd,l=t.KA,a=t.KA,c=t.KA,f=t.KA;let u,d=t.zA,w=t.zA,A=t.zA,y=t.zA;if(u=f===this.Dr?this.Sr:this.nr[f],u&&this.Wn){const t=new B.A(this.Dn,o,n,r,-1,h,s,a+this.Pt);this.Er.n_(t);const i=new B.A(this.Dn,o,n,r,l,h,s,c+this.Pt);this.Er.n_(i);const f=this.Wn[this.Dn][n][r],p=this.Wn[this.Dn][n+1][r],m=this.Wn[this.Dn][n+1][r+1],I=this.Wn[this.Dn][n][r+1],_=e.A.get(l);u.OI=a+this.Pt,u.bI=c+this.Pt,u.TI=_.la(s,h,f,p,m,I,-1);let E,g=_.width,C=_.length;h!==F.A.vd&&h!==F.A.Rd||(g=_.length,C=_.width),u.r_=128*n+64*g,u.o_=128*r+64*C,u.l_=this.Bf(this.Dn,u.r_,u.o_),d>A&&(E=d,d=A,A=E),w>y&&(E=w,w=y,y=E),u.MI=n+d,u.xI=n+A,u.kI=r+w,u.DI=r+y}}else if(i===T.A.py){const i=t.KA,s=t.KA,h=t.KA;if(n>=0&&r>=0&&n{if(!$.K.st){if(d.A.a_[17]>=t){const t=d.A.c_[17];if(!t)return;const i=t.width*t.height-1,s=t.width*this.Ye*2,h=t.nc,e=this.Mn;for(let t=0;t<=i;t++)e[t]=h[t-s&i];t.nc=e,this.Mn=h,d.A.f_(17)}if(d.A.a_[24]>=t){const t=d.A.c_[24];if(!t)return;const i=t.width*t.height-1,s=t.width*this.Ye*2,h=t.nc,e=this.Mn;for(let t=0;t<=i;t++)e[t]=h[t-s&i];t.nc=e,this.Mn=h,d.A.f_(24)}}};Ic=()=>{if(!(this.Ci&&this.Ti&&this.gi&&this.Ri))return;for(let t=10;t<117;t++){(100*Math.random()|0)<50&&(this.Ci[t+32512]=255)}for(let t=0;t<100;t++){const t=2+(124*Math.random()|0)+(128+(128*Math.random()|0)<<7);this.Ci[t]=192}for(let t=1;t<255;t++)for(let i=1;i<127;i++){const s=i+(t<<7);this.Ti[s]=(this.Ci[s-1]+this.Ci[s+1]+this.Ci[s-128]+this.Ci[s+128])/4|0}this.Si+=128,this.Si>this.gi.length&&(this.Si-=this.gi.length,this.gc(this.pi[12*Math.random()|0]));for(let t=1;t<255;t++)for(let i=1;i<127;i++){const s=i+(t<<7);let h=this.Ti[s+128]-(this.gi[s+this.Si&this.gi.length-1]/5|0);h<0&&(h=0),this.Ci[s]=h}for(let t=0;t<255;t++)this.Ri[t]=this.Ri[t+1];if(this.Ri[255]=16*Math.sin(this.Pt/14)+14*Math.sin(this.Pt/15)+12*Math.sin(this.Pt/16)|0,this.Mi>0&&(this.Mi-=4),this.ki>0&&(this.ki-=4),0===this.Mi&&0===this.ki){const t=2e3*Math.random()|0;0===t?this.Mi=1024:1===t&&(this.ki=1024)}};u_=(t,i,s)=>{const h=256-i;return((16711935&t)*h+(16711935&s)*i&4278255360)+((65280&t)*h+(65280&s)*i&16711680)>>8};_c=()=>{if(!(this.Oi&&this.bi&&this.vi&&this.Li&&this.Ri&&this.Ci))return;const t=256;if(this.Mi>0)for(let t=0;t<256;t++)this.Mi>768?this.Oi[t]=this.u_(this.bi[t],1024-this.Mi,this.vi[t]):this.Mi>256?this.Oi[t]=this.vi[t]:this.Oi[t]=this.u_(this.vi[t],256-this.Mi,this.bi[t]);else if(this.ki>0)for(let t=0;t<256;t++)this.ki>768?this.Oi[t]=this.u_(this.bi[t],1024-this.ki,this.Li[t]):this.ki>256?this.Oi[t]=this.Li[t]:this.Oi[t]=this.u_(this.Li[t],256-this.ki,this.bi[t]);else for(let t=0;t<256;t++)this.Oi[t]=this.bi[t];for(let t=0;t<33920;t++)this.hi&&this.Ii&&(this.hi.nc[t]=this.Ii.nc[t]);let i=0,s=1152;for(let h=1;h<255;h++){let e=(this.Ri[h]*(t-h)/t|0)+22;e<0&&(e=0),i+=e;for(let t=e;t<128;t++){let t=this.Ci[i++];if(0===t)s++;else{const i=t,h=256-t;if(t=this.Oi[t],this.hi){const e=this.hi.nc[s];this.hi.nc[s++]=((16711935&t)*i+(16711935&e)*h&4278255360)+((65280&t)*i+(65280&e)*h&16711680)>>8}}}s+=e}this.hi?.draw(0,0);for(let t=0;t<33920;t++)this.ei&&this._i&&(this.ei.nc[t]=this._i.nc[t]);i=0,s=1176;for(let h=1;h<255;h++){const e=this.Ri[h]*(t-h)/t|0,n=103-e;s+=e;for(let t=0;t>8}}}i+=128-n,s+=128-n-e}this.ei?.draw(661,0)}}console.log(`RS2 user client - release #${$.K.tt}`),await(0,it.w)(),(new t).d_().then((()=>{})),i()}catch(t){i(t)}}),1)},7046:(t,i,s)=>{s.d(i,{A:()=>a});var h=s(1183),e=s(4583),n=s(9234),r=s(9091),o=s(2595),l=s(7854);class a{static getParameter(t){return new URLSearchParams(window.location.search).get(t)??''}static setParameter(t,i){const s=new URL(window.location.toString());s.searchParams.set(t,i),window.history.pushState(null,'',s.toString())}Ku=0;w_=[];A_=0;Mo=null;state=0;Yu=20;y_=1;p_=[];Wu=0;m_=0;I_=[];__=!0;E_=!1;g_=50;hasFocus=!0;ac=!1;Yc=0;hf=0;xl=0;Dl=0;Lc=0;Rc=0;Sc=0;if=[];C_=[];T_=0;O_=0;input=null;b_=!1;v_=!1;L_=!1;time=-1;R_=0;S_=0;M_=0;k_=0;x_=0;D_=0;constructor(t=!1){l.N_.tabIndex=-1,l.jo.fillStyle='black',l.jo.fillRect(0,0,l.N_.width,l.N_.height),this.E_=t,this.E_?this.resize(window.innerWidth,window.innerHeight):this.resize(l.N_.width,l.N_.height)}get width(){return l.N_.width}get height(){return l.N_.height}resize=(t,i)=>{l.N_.width=t,l.N_.height=i,this.Mo=new h.A(t,i),e.A.P_()};d_=async()=>{l.N_.addEventListener('resize',(()=>{this.E_&&this.resize(window.innerWidth,window.innerHeight)}),!1),l.N_.onmousedown=this.onmousedown,l.N_.onmouseup=this.onmouseup,l.N_.onmouseenter=this.onmouseenter,l.N_.onmouseleave=this.onmouseleave,l.N_.onmousemove=this.onmousemove,window.onbeforeunload=this.bo,l.N_.onfocus=this.onfocus,l.N_.onblur=this.onblur,this.F_?(l.N_.ontouchstart=this.ontouchstart,l.N_.ontouchend=this.ontouchend,l.N_.ontouchmove=this.ontouchmove):(l.N_.onkeydown=this.onkeydown,l.N_.onkeyup=this.onkeyup),l.N_.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.F_&&'low'===a.getParameter('detail')&&(this.g_=30),await this.Go(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.p_[t]=performance.now();let t,i=0,s=256,h=1,e=0;for(;this.state>=0;){if(this.state>0&&(this.state--,0===this.state))return void this.U_();const r=s,o=h;s=300,h=1,t=performance.now();const l=this.p_[i];if(0===l?(s=r,h=o):t>l&&(s=2560*this.Yu/(t-l)|0),s<25?s=25:s>256&&(s=256,h=this.Yu-(t-l)/10|0),this.p_[i]=t,i=(i+1)%10,h>1)for(let t=0;t<10;t++)0!==this.p_[t]&&(this.p_[t]+=h);for(h0&&(this.Wu=1e3*s/(256*this.Yu)|0);const a=performance.now();if(this.__&&this.refresh(),await this.draw(),this.I_[this.m_]=(performance.now()-a)/1e3,this.m_=(this.m_+1)%this.I_.length,this.g_<50){const i=1e3/this.g_-(performance.now()-t);i>0&&await(0,n.Wo)(i)}}-1===this.state&&this.U_()};U_=()=>{this.state=-2,this.bo()};Zo=t=>{this.Yu=1e3/t|0};yA=t=>{this.g_=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.Yu|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};bo=()=>{};draw=async()=>{};refresh=()=>{};async Go(t,i){const s=this.width,h=this.height;this.__&&(l.jo.fillStyle='black',l.jo.fillRect(0,0,s,h),this.__=!1);const e=h/2-18;l.jo.fillStyle='rgb(140, 17, 17)',l.jo.rect((s/2|0)-152,e,304,34),l.jo.fillRect((s/2|0)-150,e+2,3*t,30),l.jo.fillStyle='black',l.jo.fillRect((s/2|0)-150+3*t,e+2,300-3*t,30),l.jo.font='bold 13px helvetica, sans-serif',l.jo.textAlign='center',l.jo.fillStyle='white',l.jo.fillText(i,s/2|0,e+22),await(0,n.Wo)(5)}kc=()=>{let t=-1;return this.O_!==this.T_&&(t=this.C_[this.T_],this.T_=this.T_+1&127),t};get ms(){const t=this.I_.length;let i=0;for(let s=0;sthis.Ku&&(this.Ku=s),this.w_[this.A_]=s,this.A_=(this.A_+1)%250,s}get Vu(){return this.w_.reduce(((t,i)=>t+i),0)/250}onkeydown=t=>{const i=t.key;this.Yc=0;const s=r.c[i];if(!s||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const h=s.code;let e=s.ch;t.ctrlKey&&(e>='A'.charCodeAt(0)&&e<=']'.charCodeAt(0)||e=='_'.charCodeAt(0)?e-='A'.charCodeAt(0)-1:e>='a'.charCodeAt(0)&&e<='z'.charCodeAt(0)&&(e-='a'.charCodeAt(0)-1)),e<30&&(e=0),h===r.c.ArrowLeft.code?e=1:h===r.c.ArrowRight.code?e=2:h===r.c.ArrowUp.code?e=3:h===r.c.ArrowDown.code?e=4:h===r.c.Control.code?e=5:h===r.c.Shift.code?e=6:h===r.c.Alt.code?e=7:h===r.c.Backspace.code||h===r.c.Delete.code?e=8:h===r.c.Tab.code?e=9:h===r.c.Enter.code?e=10:h>=r.c.F1.code&&h<=r.c.F12.code?e=h+1008-r.c.F1.code:h===r.c.Home.code?e=1e3:h===r.c.End.code?e=1001:h===r.c.PageUp.code?e=1002:h===r.c.PageDown.code&&(e=1003),e>0&&e<128&&(this.if[e]=1),e>4&&(this.C_[this.O_]=e,this.O_=this.O_+1&127),o.A.enabled&&o.A.B_(e),r.g.includes(i)||t.preventDefault()};onkeyup=t=>{const i=t.key;this.Yc=0;const s=r.c[i];if(!s||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const h=s.code;let e=s.ch;e<30&&(e=0),h===r.c.ArrowLeft.code?e=1:h===r.c.ArrowRight.code?e=2:h===r.c.ArrowUp.code?e=3:h===r.c.ArrowDown.code?e=4:h===r.c.Control.code?e=5:h===r.c.Shift.code?e=6:h===r.c.Alt.code?e=7:h===r.c.Backspace.code||h===r.c.Delete.code?e=8:h===r.c.Tab.code?e=9:h===r.c.Enter.code?e=10:h>=r.c.F1.code&&h<=r.c.F12.code?e=h+1008-r.c.F1.code:h===r.c.Home.code?e=1e3:h===r.c.End.code?e=1001:h===r.c.PageUp.code?e=1002:h===r.c.PageDown.code&&(e=1003),e>0&&e<128&&(this.if[e]=0),o.A.enabled&&o.A.G_(e),r.g.includes(i)||t.preventDefault()};onmousedown=t=>{if(this.b_=!1,(t.clientX>0||t.clientY>0)&&this.H_(t),this.Yc=0,this.Rc=this.xl,this.Sc=this.Dl,this.F_&&!this.W_){if(this.Y_()||this.V_()||this.K_())return this.Lc=1,void(this.hf=1);t.timeStamp>=this.time+500?(this.Lc=2,this.hf=2):(this.Lc=1,this.hf=1)}else 2===t.button?(this.Lc=2,this.hf=2):(this.Lc=1,this.hf=1);o.A.enabled&&o.A.X_(this.Rc,this.Sc,t.buttons)};onmouseup=t=>{this.H_(t),this.Yc=0,this.hf=0,o.A.enabled&&o.A.z_(t.buttons)};onmouseenter=t=>{this.H_(t),o.A.enabled&&o.A.j_()};onmouseleave=t=>{this.H_(t),this.Yc=0,this.xl=-1,this.Dl=-1,this.hf=0,this.Rc=-1,this.Sc=-1,o.A.enabled&&o.A.Z_()};onmousemove=t=>{this.H_(t),this.Yc=0,o.A.enabled&&o.A.q_(this.xl,this.Dl)};onfocus=t=>{this.hasFocus=!0,this.__=!0,this.refresh(),o.A.enabled&&o.A.J_()};onblur=t=>{this.hasFocus=!1,o.A.enabled&&o.A.Q_()};ontouchstart=t=>{if(!this.F_)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.b_=!0;const i=t.changedTouches[0],s=0|i.clientX,h=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:s,clientY:h})),this.R_=this.x_=this.M_=0|i.screenX,this.S_=this.D_=this.k_=0|i.screenY,this.time=t.timeStamp,this.v_=this.tE(),this.L_=this.iE()};ontouchend=t=>{if(!this.F_||!this.b_)return;const i=t.changedTouches[0],s=0|i.clientX,h=0|i.clientY;if(this.onmousemove(new MouseEvent('mousemove',{clientX:s,clientY:h})),this.x_=0|i.screenX,this.D_=0|i.screenY,this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.v_&&!this.tE())return void(this.b_=!1);if(this.L_&&!this.iE())return void(this.b_=!1);if(this.Y_()||this.sE()||this.V_()||this.K_()){null!==this.input&&(this.input.parentNode?.contains(this.input)&&this.input.parentNode?.removeChild(this.input),this.input=null);const t=document.createElement('input');return this.V_()?(t.setAttribute('id','username'),t.setAttribute('placeholder','Username')):this.K_()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.Y_()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.sE()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this.hE?t.setAttribute('type','password'):t.setAttribute('type',this.K_()?'password':'text'),t.setAttribute('autofocus','autofocus'),t.setAttribute('spellcheck','false'),t.setAttribute('autocomplete','off'),t.setAttribute('style',`position: fixed; left: ${s}px; top: ${h}px; width: 1px; height: 1px; opacity: 0;`),document.body.appendChild(t),t.focus(),t.click(),this.hE&&(t.oninput=t=>{if(!(t instanceof InputEvent))return;const i=t,s=i.data;null!==s&&'insertText'===i.inputType&&this.onkeydown(new KeyboardEvent('keydown',{key:s,code:s}))}),t.onkeydown=t=>{this.hE&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this.hE&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeyup(new KeyboardEvent('keyup',{key:t.key,code:t.key}))},t.onfocus=t=>{this.input?.parentNode?.removeChild(this.input),this.input=null,this.onfocus(t)},this.input=t,void(this.b_=!1)}const e=t.timeStamp>=this.time+500,n=Math.abs(this.R_-this.x_)>16||Math.abs(this.S_-this.D_)>16;e&&!n?(this.b_=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.hf=0,this.b_=!1)};ontouchmove=t=>{if(!this.F_||!this.b_)return;const i=t.changedTouches[0],s=0|i.clientX,h=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:s,clientY:h})),this.x_=0|i.screenX,this.D_=0|i.screenY,this.v_&&-1===this.Po()?(this.M_-this.x_>0?this.rotate(2):this.M_-this.x_<0&&this.rotate(0),this.k_-this.D_>0?this.rotate(3):this.k_-this.D_<0&&this.rotate(1)):(this.L_||-1!==this.Po())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this.M_=this.x_,this.k_=this.D_};get F_(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get hE(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get W_(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}tE=()=>this.ac&&this.xl>=8&&this.xl<=520&&this.Dl>=11&&this.Dl<=345;Y_=()=>this.ac&&-1===this.No()&&!this.xo()&&!this.Do()&&this.xl>=11&&this.xl<=506&&this.Dl>=449&&this.Dl<=482;sE=()=>this.ac&&(this.xo()||this.Do())&&this.xl>=11&&this.xl<=506&&this.Dl>=383&&this.Dl<=482;iE=()=>this.ac&&this.xl>=562&&this.xl<=752&&this.Dl>=231&&this.Dl<=492;V_=()=>!this.ac&&2===this.ko()&&this.xl>=301&&this.xl<=562&&this.Dl>=262&&this.Dl<=279;K_=()=>!this.ac&&2===this.ko()&&this.xl>=301&&this.xl<=562&&this.Dl>=279&&this.Dl<=296;rotate=t=>{0===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowLeft',code:'ArrowLeft'}))):1===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowUp',code:'ArrowUp'}))):2===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowRight',code:'ArrowRight'}))):3===t&&(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowDown',code:'ArrowDown'})))};eE=()=>null!==document.fullscreenElement;H_=t=>{if(this.eE()){const i=t.target.getBoundingClientRect(),s=window.innerHeight/l.N_.height,h=(window.innerWidth-l.N_.width*s)/2;this.xl=0|this.nE(t.clientX-i.left-h,0,l.N_.width*s,0,789),this.Dl=0|this.nE(t.clientY-i.top,0,l.N_.height*s,0,532)}else{const i=l.N_.getBoundingClientRect(),s=l.N_.width/i.width,h=l.N_.height/i.height;this.xl=(t.clientX-i.left)*s|0,this.Dl=(t.clientY-i.top)*h|0}this.xl<0&&(this.xl=0),this.Dl<0&&(this.Dl=0),this.xl>789&&(this.xl=789),this.Dl>532&&(this.Dl=532)};nE=(t,i,s,h,e)=>(t-i)*(e-h)/(s-i)+h}},2595:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1069);class e{static enabled=!1;static rE=null;static oE=null;static lE=0;static aE=0;static cE=0;static fE=0;static uE=0;static Fy=()=>{this.rE=h.A.Ut(1),this.oE=null,this.lE=performance.now(),this.enabled=!0};static Wc=()=>{this.enabled=!1,this.rE=null};static flush=()=>{let t=null;return this.oE&&this.enabled&&(t=this.oE),this.oE=null,t};static stop=()=>{let t=null;return this.rE&&this.rE.Fc>0&&this.enabled&&(t=this.rE),this.Wc(),t};static X_=(t,i,s)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;this.aE++;const h=performance.now();let e=(h-this.lE)/10|0;e>250&&(e=250),this.lE=h,this.dE(5),1===s?this.rE?.p1(1):this.rE?.p1(2),this.rE?.p1(e),this.rE?.p3(t+(i<<10))};static z_=t=>{if(!this.enabled)return;this.aE++;const i=performance.now();let s=(i-this.lE)/10|0;s>250&&(s=250),this.lE=i,this.dE(2),1===t?this.rE?.p1(3):this.rE?.p1(4),this.rE?.p1(s)};static q_=(t,i)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;const s=performance.now();if(s-this.cE>=50){this.cE=s,this.aE++;let h=(s-this.lE)/10|0;h>250&&(h=250),this.lE=s,t-this.fE<8&&t-this.fE>=-8&&i-this.uE<8&&i-this.uE>=-8?(this.dE(3),this.rE?.p1(5),this.rE?.p1(h),this.rE?.p1(t+(i-this.uE+8<<4)+8-this.fE)):t-this.fE<128&&t-this.fE>=-128&&i-this.uE<128&&i-this.uE>=-128?(this.dE(4),this.rE?.p1(6),this.rE?.p1(h),this.rE?.p1(t+128-this.fE),this.rE?.p1(i+128-this.uE)):(this.dE(5),this.rE?.p1(7),this.rE?.p1(h),this.rE?.p3(t+(i<<10))),this.fE=t,this.uE=i}};static B_=t=>{if(!this.enabled)return;this.aE++;const i=performance.now();let s=(i-this.lE)/10|0;s>250&&(s=250),this.lE=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.dE(3),this.rE?.p1(8),this.rE?.p1(s),this.rE?.p1(t)};static G_=t=>{if(!this.enabled)return;this.aE++;const i=performance.now();let s=(i-this.lE)/10|0;s>250&&(s=250),this.lE=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.dE(3),this.rE?.p1(9),this.rE?.p1(s),this.rE?.p1(t)};static J_=()=>{if(!this.enabled)return;this.aE++;const t=performance.now();let i=(t-this.lE)/10|0;i>250&&(i=250),this.lE=t,this.dE(2),this.rE?.p1(10),this.rE?.p1(i)};static Q_=()=>{if(!this.enabled)return;this.aE++;const t=performance.now();let i=(t-this.lE)/10|0;i>250&&(i=250),this.lE=t,this.dE(2),this.rE?.p1(11),this.rE?.p1(i)};static j_=()=>{if(!this.enabled)return;this.aE++;const t=performance.now();let i=(t-this.lE)/10|0;i>250&&(i=250),this.lE=t,this.dE(2),this.rE?.p1(12),this.rE?.p1(i)};static Z_=()=>{if(!this.enabled)return;this.aE++;const t=performance.now();let i=(t-this.lE)/10|0;i>250&&(i=250),this.lE=t,this.dE(2),this.rE?.p1(13),this.rE?.p1(i)};static dE=t=>{if(this.rE&&this.rE.Fc+t>=500){const t=this.rE;this.rE=h.A.Ut(1),this.oE=t}}}},9091:(t,i,s)=>{s.d(i,{c:()=>e,g:()=>h});const h=['F11','F12'],e={'Backspace':{code:8,ch:8},'Enter':{code:10,ch:10},'Shift':{code:16,ch:65535},'Escape':{code:27,ch:27},'Tab':{code:9,ch:9},'CapsLock':{code:20,ch:65535},' ':{code:32,ch:32},'Control':{code:17,ch:65535},'Alt':{code:18,ch:65535},'Meta':{code:524,ch:65535},'ArrowLeft':{code:37,ch:65535},'ArrowRight':{code:39,ch:65535},'ArrowUp':{code:38,ch:65535},'ArrowDown':{code:40,ch:65535},'Insert':{code:155,ch:65535},'Home':{code:36,ch:65535},'PageUp':{code:33,ch:65535},'Delete':{code:127,ch:127},'End':{code:35,ch:65535},'PageDown':{code:34,ch:65535},'`':{code:192,ch:96},'~':{code:192,ch:126},'!':{code:49,ch:33},'@':{code:50,ch:64},'#':{code:51,ch:35},'$':{code:52,ch:36},'%':{code:53,ch:37},'^':{code:54,ch:94},'&':{code:55,ch:38},'*':{code:56,ch:42},'(':{code:57,ch:40},')':{code:48,ch:41},'-':{code:45,ch:45},'_':{code:45,ch:95},'=':{code:61,ch:61},'+':{code:61,ch:43},'[':{code:91,ch:91},'{':{code:91,ch:123},']':{code:93,ch:93},'}':{code:93,ch:125},'\\':{code:92,ch:92},'|':{code:92,ch:124},';':{code:59,ch:59},':':{code:59,ch:58},"'":{code:222,ch:39},'"':{code:222,ch:34},',':{code:44,ch:44},'<':{code:44,ch:60},'.':{code:46,ch:46},'>':{code:46,ch:62},'/':{code:47,ch:47},'?':{code:47,ch:63},'F1':{code:112,ch:65535},'F2':{code:113,ch:65535},'F3':{code:114,ch:65535},'F4':{code:115,ch:65535},'F5':{code:116,ch:65535},'F6':{code:117,ch:65535},'F7':{code:118,ch:65535},'F8':{code:119,ch:65535},'F9':{code:120,ch:65535},'F10':{code:121,ch:65535},'F11':{code:122,ch:65535},'F12':{code:123,ch:65535},0:{code:48,ch:48},1:{code:49,ch:49},2:{code:50,ch:50},3:{code:51,ch:51},4:{code:52,ch:52},5:{code:53,ch:53},6:{code:54,ch:54},7:{code:55,ch:55},8:{code:56,ch:56},9:{code:57,ch:57},'a':{code:65,ch:97},'b':{code:66,ch:98},'c':{code:67,ch:99},'d':{code:68,ch:100},'e':{code:69,ch:101},'f':{code:70,ch:102},'g':{code:71,ch:103},'h':{code:72,ch:104},'i':{code:73,ch:105},'j':{code:74,ch:106},'k':{code:75,ch:107},'l':{code:76,ch:108},'m':{code:77,ch:109},'n':{code:78,ch:110},'o':{code:79,ch:111},'p':{code:80,ch:112},'q':{code:81,ch:113},'r':{code:82,ch:114},'s':{code:83,ch:115},'t':{code:84,ch:116},'u':{code:85,ch:117},'v':{code:86,ch:118},'w':{code:87,ch:119},'x':{code:88,ch:120},'y':{code:89,ch:121},'z':{code:90,ch:122},'A':{code:65,ch:65},'B':{code:66,ch:66},'C':{code:67,ch:67},'D':{code:68,ch:68},'E':{code:69,ch:69},'F':{code:70,ch:70},'G':{code:71,ch:71},'H':{code:72,ch:72},'I':{code:73,ch:73},'J':{code:74,ch:74},'K':{code:75,ch:75},'L':{code:76,ch:76},'M':{code:77,ch:77},'N':{code:78,ch:78},'O':{code:79,ch:79},'P':{code:80,ch:80},'Q':{code:81,ch:81},'R':{code:82,ch:82},'S':{code:83,ch:83},'T':{code:84,ch:84},'U':{code:85,ch:85},'V':{code:86,ch:86},'W':{code:87,ch:87},'X':{code:88,ch:88},'Y':{code:89,ch:89},'Z':{code:90,ch:90}}},1120:(t,i,s)=>{s.d(i,{A:()=>c});var h=s(1069),e=s(8665),n=s(2679),r=s(2511),o=s(3819),l=s(3867),a=s(8950);class c{static Ro=[];static wE=null;static So=null;static Cl=0;static AE=1;static Ol=2;static Wl=3;static Vl=4;static ia=5;static ea=6;static ua=7;static hm=1;static om=2;static lm=3;static am=4;static fm=5;static Zl=6;static Aa=1;static ya=100;static pa=101;static ma=200;static Kw=201;static Xw=202;static Ia=203;static zw=205;static qw=300;static yE=301;static pE=302;static mE=303;static IE=304;static _E=305;static EE=306;static gE=307;static CE=308;static TE=309;static OE=310;static bE=311;static vE=312;static $w=313;static Jw=314;static LE=315;static RE=316;static SE=317;static ME=318;static kE=319;static xE=320;static DE=321;static NE=322;static Qw=323;static Da=324;static Na=325;static tA=326;static Oa=327;static _a=401;static Ea=500;static jw=501;static Zw=502;static Ta=503;static Pa=600;static sA=601;static PE=602;static FE=603;static UE=604;static BE=605;static GE=606;static HE=607;static WE=608;static YE=609;static VE=610;static KE=611;static hA=612;static Fa=613;static Ua=650;static Ha=651;static Wa=652;static Ya=653;static Va=654;static Ba=655;static ec=(t,i,s)=>{this.wE=new n.A(5e4),this.So=new n.A(5e4);const e=new h.A(t.read('data'));let r=-1;for(e.Fc+=2;e.Fc0){h.$o=new Uint8Array(n),h.Qo=new Uint16Array(n);for(let t=0;t0){h.scripts=new l.ds(o,null);for(let t=0;t0){const e=s.lastIndexOf(',');h.Hl[t]=this.XE(i,s.substring(0,e),parseInt(s.substring(e+1),10))}}h.sm=new l.ds(5,null);for(let t=0;t<5;t++){const i=e.ly;h.sm[t]=i,0===i.length&&(h.sm[t]=null)}}if(h.type===c.Wl&&(h.fill=1===e.ZA),h.type===c.Vl||h.type===c.AE){h.$l=1===e.ZA;const t=e.ZA;s&&(h.font=s[t]),h.Ql=1===e.ZA}if(h.type===c.Vl&&(h.text=e.ly,h.zl=e.ly),h.type!==c.AE&&h.type!==c.Wl&&h.type!==c.Vl||(h.Yl=e.Ko),h.type!==c.Wl&&h.type!==c.Vl||(h.Xl=e.Ko,h.Kl=e.Ko),h.type===c.ia){const t=e.ly;if(t.length>0){const s=t.lastIndexOf(',');h.ha=this.XE(i,t.substring(0,s),parseInt(t.substring(s+1),10))}const s=e.ly;if(s.length>0){const t=s.lastIndexOf(',');h.sa=this.XE(i,s.substring(0,t),parseInt(s.substring(t+1),10))}}if(h.type===c.ea){const t=e.ZA;0!==t&&(h.model=this.la((t-1<<8)+e.ZA));const i=e.ZA;0!==i&&(h.zE=this.la((i-1<<8)+e.ZA)),h.al=e.ZA,0===h.al?h.al=-1:h.al=(h.al-1<<8)+e.ZA,h.cl=e.ZA,0===h.cl?h.cl=-1:h.cl=(h.cl-1<<8)+e.ZA,h.zoom=e.KA,h.oa=e.KA,h.fa=e.KA}if(h.type===c.ua){h.Ll=new Int32Array(h.width*h.height),h.Rl=new Int32Array(h.width*h.height),h.$l=1===e.ZA;const t=e.ZA;s&&(h.font=s[t]),h.Ql=1===e.ZA,h.Yl=e.Ko,h.Sl=e.tp,h.Ml=e.tp,h.Qp=1===e.ZA,h.sm=new l.ds(5,null);for(let t=0;t<5;t++){const i=e.ly;h.sm[t]=i,0===i.length&&(h.sm[t]=null)}}h.jl!==c.om&&h.type!==c.Ol||(h._w=e.ly,h.action=e.ly,h.Iw=e.KA),h.jl!==c.hm&&h.jl!==c.am&&h.jl!==c.fm&&h.jl!==c.Zl||(h.rm=e.ly,0===h.rm.length&&(h.jl===c.hm?h.rm='Ok':h.jl===c.am||h.jl===c.fm?h.rm='Select':h.jl===c.Zl&&(h.rm='Continue')))}this.wE=null,this.So=null};static XE=(t,i,s)=>{const h=o.A.jE(i)<<8n|BigInt(s);if(this.wE){const t=this.wE.get(h);if(t)return t}let e;try{e=r.A.za(t,i,s),this.wE?.put(h,e)}catch(t){return null}return e};static la=t=>{if(this.So){const i=this.So.get(BigInt(t));if(i)return i}const i=e.A.model(t);return this.So?.put(BigInt(t),i),i};id=-1;Nd=-1;type=-1;jl=-1;El=0;width=0;height=0;Jp=-1;$o=null;Qo=null;scripts=null;scroll=0;hide=!1;draggable=!1;Qp=!1;im=!1;Sl=0;Ml=0;bl=null;vl=null;Hl=null;sm=null;fill=!1;$l=!1;font=null;Ql=!1;text=null;zl=null;Yl=0;Xl=0;Kl=0;ha=null;sa=null;model=null;zE=null;al=-1;cl=-1;zoom=0;oa=0;fa=0;_w=null;action=null;Iw=-1;rm=null;ll=null;pl=null;ml=null;x=0;y=0;Tl=0;Ll=null;Rl=null;ul=0;fl=0;la(t,i,s){let h=this.model;if(s&&(h=this.zE),!h)return null;if(-1===t&&-1===i&&!h.ZE)return h;const n=e.A.qE(h,!0,!0,!1);return-1===t&&-1===i||n.Ma(),-1!==t&&n.ka(t),-1!==i&&n.ka(i),n.xa(64,768,-50,-10,-50,!0),n}$E(){if(this.Nd===this.id)return this.x;let t=c.Ro[this.Nd];if(!t.ll||!t.pl||!t.ml)return this.x;let i=t.ll.indexOf(this.id);if(-1===i)return this.x;let s=t.pl[i];for(;t.Nd!==t.id;){const h=c.Ro[t.Nd];h.ll&&h.pl&&h.ml&&(i=h.ll.indexOf(t.id),-1!==i&&(s+=h.pl[i])),t=h}return s}JE(){if(this.Nd===this.id)return this.y;let t=c.Ro[this.Nd];if(!t.ll||!t.pl||!t.ml)return this.y;let i=t.ll.indexOf(this.id);if(-1===i)return this.y;let s=t.ml[i];for(;t.Nd!==t.id;){const h=c.Ro[t.Nd];h.ll&&h.pl&&h.ml&&(i=h.ll.indexOf(t.id),-1!==i&&(s+=h.ml[i])),t=h}return s}outline(t){const i=this.$E(),s=this.JE();a.A.Il(i,s,this.width,this.height,t)}move(t,i){if(this.Nd===this.id)return;this.x=0,this.y=0;const s=c.Ro[this.Nd];if(s.ll&&s.pl&&s.ml){const h=s.ll.indexOf(this.id);-1!==h&&(s.pl[h]=t,s.ml[h]=i)}}delete(){if(this.Nd===this.id)return;const t=c.Ro[this.Nd];if(t.ll&&t.pl&&t.ml){const i=t.ll.indexOf(this.id);-1!==i&&(t.ll.splice(i,1),t.pl.splice(i,1),t.ml.splice(i,1))}}}},6333:(t,i,s)=>{s.d(i,{$:()=>h});class h{id;QE=null;constructor(t){this.id=t}tg(t){for(;;){const i=t.ZA;if(0===i)break;this.decode(i,t)}return this}}},2164:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(1069),e=s(6333);class n extends e.${static count=0;static Ro=[];static ec=t=>{const i=new h.A(t.read('flo.dat'));this.count=i.KA;for(let t=0;t(s>179&&(i=i/2|0),s>192&&(i=i/2|0),s>217&&(i=i/2|0),s>243&&(i=i/2|0),(t/4<<10)+(i/32<<7)+(s/2|0));static sg=(t,i)=>-1===t?12345678:((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);static hg=(t,i)=>-2===t?12345678:-1===t?(i<0?i=0:i>127&&(i=127),127-i):((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);eg=0;texture=-1;ng=!1;rg=!0;og=0;lg=0;ag=0;cg=0;fg=0;ug=0;decode(t,i){1===t?(this.eg=i.dg,this.setColor(this.eg)):2===t?this.texture=i.ZA:3===t?this.ng=!0:5===t?this.rg=!1:6===t?this.QE=i.ly:console.log('Error unrecognised config code: ',t)}setColor(t){const i=(t>>16&255)/256,s=(t>>8&255)/256,h=(255&t)/256;let e=i;si&&(r=s),h>r&&(r=h);let o=0,l=0;const a=(e+r)/2;e!==r&&(a<.5&&(l=(r-e)/(r+e)),a>=.5&&(l=(r-e)/(2-r-e)),i===r?o=(s-h)/(r-e):s===r?o=(h-i)/(r-e)+2:h===r&&(o=(i-s)/(r-e)+4)),o/=6,this.og=256*o|0,this.lg=256*l|0,this.ag=256*a|0,this.lg<0?this.lg=0:this.lg>255&&(this.lg=255),this.ag<0?this.ag=0:this.ag>255&&(this.ag=255),this.cg=a>.5?(1-a)*l*512|0:a*l*512|0,this.cg<1&&(this.cg=1),this.fg=o*this.cg|0;let c=this.og+(16*Math.random()|0)-8;c<0?c=0:c>255&&(c=255);let f=this.lg+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255);let u=this.ag+(48*Math.random()|0)-24;u<0?u=0:u>255&&(u=255),this.ug=n.ig(c,f,u)}}},8317:(t,i,s)=>{s.d(i,{A:()=>o});var h=s(1069),e=s(6333),n=s(8665),r=s(3867);class o extends e.${static count=0;static Ro=[];static ec=t=>{const i=new h.A(t.read('idk.dat'));this.count=i.KA;for(let t=0;t=40&&t<50)this.yg[t-40]=i.KA;else if(t>=50&&t<60)this.pg[t-50]=i.KA;else{if(!(t>=60&&t<70))throw new Error(`Unrecognized idk config code: ${t}`);this.Ag[t-60]=i.KA}}la(){if(!this.wg)return null;const t=new r.ds(this.wg.length,null);for(let i=0;i{s.d(i,{A:()=>c});var h=s(6333),e=s(1069),n=s(2679),r=s(8665),o=s(1023),l=s(6169),a=s(3867);class c extends h.${static count=0;static cache=null;static mg=null;static Ig=null;static _g=0;static tu=new n.A(500);static iu=new n.A(30);static ec=t=>{this.mg=new e.A(t.read('loc.dat'));const i=new e.A(t.read('loc.idx'));this.count=i.KA,this.Ig=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.Ig||!this.mg)throw new Error('LocType not loaded!!!');for(let i=0;i<10;i++){const s=this.cache[i];if(s&&s.id===t)return s}this._g=(this._g+1)%10;const i=this.cache[this._g];return this.mg.Fc=this.Ig[t],i.id=t,i.reset(),i.tg(this.mg),i.Eg||(i.Eg=new Int32Array(1)),-1===i.gg&&i.Eg&&(i.active=i.Eg.length>0&&i.Eg[0]===o.A.rA.id,i.wm&&(i.active=!0)),i};static bo=()=>{this.tu=null,this.iu=null,this.Ig=null,this.cache=null,this.mg=null};wg=null;Eg=null;name=null;sw=null;yg=null;pg=null;width=1;length=1;NA=!0;PA=!0;active=!1;gg=-1;Cg=!1;Tg=!1;rg=!1;al=-1;Og=!1;bg=16;vg=0;Lg=0;wm=null;yd=-1;Cd=-1;Rg=!1;Sg=!0;Mg=128;kg=128;xg=128;aA=0;Dg=0;Ng=0;Pg=0;Fg=!1;decode(t,i){if(1===t){const t=i.ZA;this.wg=new Int32Array(t),this.Eg=new Int32Array(t);for(let s=0;s=30&&t<39)this.wm||(this.wm=new a.ds(5,null)),this.wm[t-30]=i.ly,'hidden'===this.wm[t-30]?.toLowerCase()&&(this.wm[t-30]=null);else if(40===t){const t=i.ZA;this.yg=new Uint16Array(t),this.pg=new Uint16Array(t);for(let s=0;s=this.wg.length)return null;let d=this.wg[a];if(-1===d)return null;const w=this.Rg!==i>3;w&&(d+=65536);let A=c.tu?.get(BigInt(d));A||(A=r.A.model(65535&d),w&&A.Vg(),c.tu?.put(BigInt(d),A));const y=128!==this.Mg||128!==this.kg||128!==this.xg,p=0!==this.Dg||0!==this.Ng||0!==this.Pg;let m=r.A.qE(A,!this.yg,!this.Og,i===l.A.bd&&-1===o&&!y&&!p);for(-1!==o&&(m.Ma(),m.ka(o),m.Kg=null,m.Xg=null);i-- >0;)m.zg();if(this.yg&&this.pg)for(let t=0;t{s.d(i,{A:()=>l});var h=s(6333),e=s(1069),n=s(2679),r=s(8665),o=s(3867);class l extends h.${static count=0;static cache=null;static mg=null;static Ig=null;static _g=0;static So=new n.A(30);static ec=t=>{this.mg=new e.A(t.read('npc.dat'));const i=new e.A(t.read('npc.idx'));this.count=i.KA,this.Ig=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.Ig||!this.mg)throw new Error('NpcType not loaded!!!');for(let i=0;i<20;i++){const s=this.cache[i];if(s&&s.id===t)return s}this._g=(this._g+1)%20;const i=this.cache[this._g]=new l(t);return this.mg.Fc=this.Ig[t],i.tg(this.mg),i};static bo=()=>{this.So=null,this.Ig=null,this.cache=null,this.mg=null};name=null;sw=null;size=1;wg=null;Ag=null;Og=!1;AI=-1;lI=-1;cI=-1;uI=-1;wI=-1;yg=null;pg=null;wm=null;Mg=-1;kg=-1;xg=-1;od=!0;_m=-1;qg=128;$g=128;decode(t,i){if(1===t){const t=i.ZA;this.wg=new Uint16Array(t);for(let s=0;s=30&&t<40)this.wm||(this.wm=new o.ds(5,null)),this.wm[t-30]=i.ly,'hidden'===this.wm[t-30]?.toLowerCase()&&(this.wm[t-30]=null);else if(40===t){const t=i.ZA;this.yg=new Uint16Array(t),this.pg=new Uint16Array(t);for(let s=0;s{s.d(i,{A:()=>u});var h=s(6333),e=s(1069),n=s(2511),r=s(2679),o=s(8665),l=s(4583),a=s(8950),c=s(9298),f=s(3867);class u extends h.${static count=0;static cache=null;static mg=null;static Ig=null;static _g=0;static hC=!0;static So=new r.A(50);static su=new r.A(200);static ec=(t,i)=>{this.hC=i,this.mg=new e.A(t.read('obj.dat'));const s=new e.A(t.read('obj.idx'));this.count=s.KA,this.Ig=new Int32Array(this.count);let h=2;for(let t=0;t{if(!this.cache||!this.Ig||!this.mg)throw new Error('ObjType not loaded!!!');for(let i=0;i<10;i++){const s=this.cache[i];if(s&&s.id===t)return s}this._g=(this._g+1)%10;const i=this.cache[this._g];return this.mg.Fc=this.Ig[t],i.id=t,i.reset(),i.tg(this.mg),-1!==i.eC&&i.nC(),!this.hC&&i.members&&(i.name='Members Object',i.sw="Login to a members' server to use this object.",i.wm=null,i.tm=null),i};static bo=()=>{this.So=null,this.su=null,this.Ig=null,this.cache=null,this.mg=null};static kl=(t,i)=>{if(u.su){let s=u.su.get(BigInt(t));if(s&&s.fd!==i&&-1!==s.fd&&(s.sy(),s=null),s)return s}let s=u.get(t);if(s.rC||(i=-1),s.rC&&s.oC&&i>1){let t=-1;for(let h=0;h<10;h++)i>=s.oC[h]&&0!==s.oC[h]&&(t=s.rC[h]);-1!==t&&(s=u.get(t))}const h=new n.A(32,32),e=l.A.na,r=l.A.ra,o=l.A.oc,f=a.A.nc,d=a.A.lC,w=a.A.aC,A=a.A.left,y=a.A.right,p=a.A.top,m=a.A.bottom;l.A.cC=!1,a.A.bind(h.nc,32,32),a.A.fillRect(0,0,32,32,c.A.Bl),l.A.P_();const I=s.vA(1),_=l.A.sin[s.yp]*s.mp>>16,E=l.A.cos[s.yp]*s.mp>>16;I.ca(0,s.pp,s.fC,s.yp,s.uC,_+(I.Zg/2|0)+s.dC,E+s.dC);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===h.nc[t+32*i]&&(t>0&&h.nc[t+32*i-1]>1||i>0&&h.nc[t+32*(i-1)]>1||t<31&&h.nc[t+32*i+1]>1||i<31&&h.nc[t+32*(i+1)]>1)&&(h.nc[t+32*i]=1);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===h.nc[t+32*i]&&t>0&&i>0&&h.nc[t+32*(i-1)-1]>0&&(h.nc[t+32*i]=3153952);if(-1!==s.eC){const t=this.kl(s.wC,10),i=t.Pl,h=t.fd;t.Pl=32,t.fd=32,t.AC(5,5,22,22),t.Pl=i,t.fd=h}return u.su?.put(BigInt(t),h),a.A.bind(f,d,w),a.A.yl(A,p,y,m),l.A.na=e,l.A.ra=r,l.A.oc=o,l.A.cC=!0,s.da?h.Pl=33:h.Pl=32,h.fd=i,h};model=0;name=null;sw=null;yg=null;pg=null;mp=2e3;yp=0;pp=0;fC=0;uC=0;dC=0;yC=!1;pC=-1;da=!1;OA=1;members=!1;wm=null;tm=null;mC=-1;IC=-1;_C=0;EC=-1;gC=-1;CC=0;TC=-1;OC=-1;bC=-1;vC=-1;LC=-1;RC=-1;rC=null;oC=null;wC=-1;eC=-1;decode(t,i){if(1===t)this.model=i.KA;else if(2===t)this.name=i.ly;else if(3===t)this.sw=i.ly;else if(4===t)this.mp=i.KA;else if(5===t)this.yp=i.KA;else if(6===t)this.pp=i.KA;else if(7===t)this.uC=i.tp,this.uC>32767&&(this.uC-=65536);else if(8===t)this.dC=i.tp,this.dC>32767&&(this.dC-=65536);else if(9===t)this.yC=!0;else if(10===t)this.pC=i.KA;else if(11===t)this.da=!0;else if(12===t)this.OA=i.Ko;else if(16===t)this.members=!0;else if(23===t)this.mC=i.KA,this._C=i.zA;else if(24===t)this.IC=i.KA;else if(25===t)this.EC=i.KA,this.CC=i.zA;else if(26===t)this.gC=i.KA;else if(t>=30&&t<35)this.wm||(this.wm=new f.ds(5,null)),this.wm[t-30]=i.ly,'hidden'===this.wm[t-30]?.toLowerCase()&&(this.wm[t-30]=null);else if(t>=35&&t<40)this.tm||(this.tm=new f.ds(5,null)),this.tm[t-35]=i.ly;else if(40===t){const t=i.ZA;this.yg=new Uint16Array(t),this.pg=new Uint16Array(t);for(let s=0;s=100&&t<110&&(this.rC&&this.oC||(this.rC=new Uint16Array(10),this.oC=new Uint16Array(10)),this.rC[t-100]=i.KA,this.oC[t-100]=i.KA)}SC(t){let i=this.mC;if(1===t&&(i=this.EC),-1===i)return null;let s=this.IC,h=this.TC;1===t&&(s=this.gC,h=this.OC);let e=o.A.model(i);if(-1!==s){const t=o.A.model(s);if(-1===h){const i=[e,t];e=o.A.ba(i,2)}else{const i=[e,t,o.A.model(h)];e=o.A.ba(i,3)}}if(0===t&&0!==this._C&&e.translate(this._C,0,0),1===t&&0!==this.CC&&e.translate(this.CC,0,0),this.yg&&this.pg)for(let t=0;t1){let i=-1;for(let s=0;s<10;s++)t>=this.oC[s]&&0!==this.oC[s]&&(i=this.rC[s]);if(-1!==i)return u.get(i).vA(1)}if(u.So){const t=u.So.get(BigInt(this.id));if(t)return t}const i=o.A.model(this.model);if(this.yg&&this.pg)for(let t=0;t{s.d(i,{A:()=>r});var h=s(6333),e=s(1069),n=s(6730);class r extends h.${static count=0;static Ro=[];static ec=t=>{const i=new e.A(t.read('seq.dat'));this.count=i.KA;for(let t=0;t{s.d(i,{A:()=>l});var h=s(6333),e=s(1069),n=s(1312),r=s(8665),o=s(2679);class l extends h.${static count=0;static Ro=[];static So=new o.A(30);static ec=t=>{const i=new e.A(t.read('spotanim.dat'));this.count=i.KA;for(let t=0;t=40&&t<50)this.yg[t-40]=i.KA;else{if(!(t>=50&&t<60))throw new Error(`Unrecognized spotanim config code: ${t}`);this.pg[t-50]=i.KA}}la(){let t=l.So?.get(BigInt(this.id));if(t)return t;t=r.A.model(this.model);for(let i=0;i<6;i++)0!==this.yg[0]&&t.va(this.yg[i],this.pg[i]);return l.So?.put(BigInt(this.id),t),t}}},3764:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(6333),e=s(1069);class n extends h.${static count=0;static Ro=[];static xC=[];static DC=0;static ec=t=>{const i=new e.A(t.read('varp.dat'));this.count=i.KA;for(let t=0;t{s.d(i,{A:()=>h});class h{static OPEN=0;static BC=1;static GC=2;static HC=4;static WC=8;static YC=h.BC<<4;static VC=h.GC<<4;static KC=h.HC<<4;static XC=h.WC<<4;static zC=256;static jC=512;static ZC=1024;static qC=2048;static $C=4096;static JC=h.jC<<4;static QC=h.ZC<<4;static tT=h.qC<<4;static iT=h.$C<<4;static sT=h.zC<<9;static hT=524288;static eT=2097152;static nT=h.eT|h.hT;static rT=h.zC|h.nT;static Id=h.GC|h.rT;static pd=h.WC|h.rT;static bm=h.GC|h.HC|h.pd;static _d=h.VC|h.rT;static Lm=h.WC|h.YC|h._d;static md=h.XC|h.rT;static vm=h.BC|h.GC|h.md;static Rm=h.VC|h.KC|h.md;static oT=16777215}},670:(t,i,s)=>{s.d(i,{A:()=>o});var h=s(9456),e=s(6169),n=s(1023),r=s(4909);class o{static xn=4;static Xn=104;static index=(t,i)=>t*o.Xn+i;offsetX;lT;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.lT=0,this.sizeX=o.Xn,this.sizeZ=o.Xn,this.flags=new Int32Array(this.sizeX*this.sizeZ),this.reset()}reset=()=>{for(let t=0;t{this.flags[o.index(t-this.offsetX,i-this.lT)]|=h.A.eT};GA=(t,i)=>{this.flags[o.index(t-this.offsetX,i-this.lT)]&=~h.A.eT};RA=(t,i,s,n,r,o)=>{let l=h.A.zC;o&&(l|=h.A.sT);const a=t-this.offsetX,c=i-this.lT;if(r===e.A.vd||r===e.A.Rd){const t=s;s=n,n=t}for(let t=a;t=0&&t=0&&i{let l=h.A.zC;o&&(l|=h.A.sT);const a=t-this.offsetX,c=i-this.lT;if(r===e.A.vd||r===e.A.Rd){const t=s;s=n,n=t}for(let t=a;t=0&&t=0&&i{const l=t-this.offsetX,a=i-this.lT,c=o?h.A.iT:h.A.XC,f=o?h.A.$C:h.A.WC,u=o?h.A.ZC:h.A.GC,d=o?h.A.QC:h.A.VC,w=o?h.A.jC:h.A.BC,A=o?h.A.JC:h.A.YC,y=o?h.A.qC:h.A.HC,p=o?h.A.tT:h.A.KC;s===n.A.Td.id?r===e.A.bd?(this.add(l,a,c),this.add(l-1,a,f)):r===e.A.vd?(this.add(l,a,u),this.add(l,a+1,d)):r===e.A.Ld?(this.add(l,a,f),this.add(l+1,a,c)):r===e.A.Rd&&(this.add(l,a,d),this.add(l,a-1,u)):s===n.A.fT.id||s===n.A.Sd.id?r===e.A.bd?(this.add(l,a,w),this.add(l-1,a+1,A)):r===e.A.vd?(this.add(l,a,y),this.add(l+1,a+1,p)):r===e.A.Ld?(this.add(l,a,A),this.add(l+1,a-1,w)):r===e.A.Rd&&(this.add(l,a,p),this.add(l-1,a-1,y)):s===n.A.Od.id&&(r===e.A.bd?(this.add(l,a,u|c),this.add(l-1,a,f),this.add(l,a+1,d)):r===e.A.vd?(this.add(l,a,u|f),this.add(l,a+1,d),this.add(l+1,a,c)):r===e.A.Ld?(this.add(l,a,d|f),this.add(l+1,a,c),this.add(l,a-1,u)):r===e.A.Rd&&(this.add(l,a,d|c),this.add(l,a-1,u),this.add(l-1,a,f))),o&&this.cT(t,i,s,r,!1)};DA=(t,i,s,r,o)=>{const l=t-this.offsetX,a=i-this.lT,c=o?h.A.iT:h.A.XC,f=o?h.A.$C:h.A.WC,u=o?h.A.ZC:h.A.GC,d=o?h.A.QC:h.A.VC,w=o?h.A.jC:h.A.BC,A=o?h.A.JC:h.A.YC,y=o?h.A.qC:h.A.HC,p=o?h.A.tT:h.A.KC;s===n.A.Td.id?r===e.A.bd?(this.remove(l,a,c),this.remove(l-1,a,f)):r===e.A.vd?(this.remove(l,a,u),this.remove(l,a+1,d)):r===e.A.Ld?(this.remove(l,a,f),this.remove(l+1,a,c)):r===e.A.Rd&&(this.remove(l,a,d),this.remove(l,a-1,u)):s===n.A.fT.id||s===n.A.Sd.id?r===e.A.bd?(this.remove(l,a,w),this.remove(l-1,a+1,A)):r===e.A.vd?(this.remove(l,a,y),this.remove(l+1,a+1,p)):r===e.A.Ld?(this.remove(l,a,A),this.remove(l+1,a-1,w)):r===e.A.Rd&&(this.remove(l,a,p),this.remove(l-1,a-1,y)):s===n.A.Od.id&&(r===e.A.bd?(this.remove(l,a,u|c),this.remove(l-1,a,f),this.remove(l,a+1,d)):r===e.A.vd?(this.remove(l,a,u|f),this.remove(l,a+1,d),this.remove(l+1,a,c)):r===e.A.Ld?(this.remove(l,a,d|f),this.remove(l+1,a,c),this.remove(l,a-1,u)):r===e.A.Rd&&(this.remove(l,a,d|c),this.remove(l,a-1,u),this.remove(l-1,a,f))),o&&this.DA(t,i,s,r,!1)};Cm=(t,i,s,r,l,a)=>{if(t===s&&i===r)return!0;const c=t-this.offsetX,f=i-this.lT,u=s-this.offsetX,d=r-this.lT,w=o.index(c,f);if(l===n.A.Td.id){if(a===e.A.bd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A._d)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.Id)===h.A.OPEN)return!0}else if(a===e.A.vd){if(c===u&&f===d+1)return!0;if(c===u-1&&f===d&&(this.flags[w]&h.A.pd)===h.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.md)===h.A.OPEN)return!0}else if(a===e.A.Ld){if(c===u+1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A._d)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.Id)===h.A.OPEN)return!0}else if(a===e.A.Rd){if(c===u&&f===d-1)return!0;if(c===u-1&&f===d&&(this.flags[w]&h.A.pd)===h.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.md)===h.A.OPEN)return!0}}else if(l===n.A.Od.id){if(a===e.A.bd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.md)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.Id)===h.A.OPEN)return!0}else if(a===e.A.vd){if(c===u-1&&f===d&&(this.flags[w]&h.A.pd)===h.A.OPEN)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.Id)===h.A.OPEN)return!0}else if(a===e.A.Ld){if(c===u-1&&f===d&&(this.flags[w]&h.A.pd)===h.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A._d)===h.A.OPEN)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1)return!0}else if(a===e.A.Rd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A._d)===h.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.md)===h.A.OPEN)return!0;if(c===u&&f===d-1)return!0}}else if(l===n.A.kd.id){if(c===u&&f===d+1&&(this.flags[w]&h.A.VC)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.GC)===h.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&h.A.WC)===h.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.XC)===h.A.OPEN)return!0}return!1};Tm=(t,i,s,r,l,a)=>{if(t===s&&i===r)return!0;const c=t-this.offsetX,f=i-this.lT,u=s-this.offsetX,d=r-this.lT,w=o.index(c,f);if(l===n.A.uT.id||l===n.A.dT.id){if(l===n.A.dT.id&&(a=a+2&3),a===e.A.bd){if(c===u+1&&f===d&&(this.flags[w]&h.A.XC)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.GC)===h.A.OPEN)return!0}else if(a===e.A.vd){if(c===u-1&&f===d&&(this.flags[w]&h.A.WC)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.GC)===h.A.OPEN)return!0}else if(a===e.A.Ld){if(c===u-1&&f===d&&(this.flags[w]&h.A.WC)===h.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A.VC)===h.A.OPEN)return!0}else if(a===e.A.Rd){if(c===u+1&&f===d&&(this.flags[w]&h.A.XC)===h.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A.VC)===h.A.OPEN)return!0}}else if(l===n.A.wT.id){if(c===u&&f===d+1&&(this.flags[w]&h.A.VC)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.GC)===h.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&h.A.WC)===h.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.XC)===h.A.OPEN)return!0}return!1};Om=(t,i,s,e,n,l,a)=>{const c=s+n-1,f=e+l-1,u=o.index(t-this.offsetX,i-this.lT);return t>=s&&t<=c&&i>=e&&i<=f||(t===s-1&&i>=e&&i<=f&&(this.flags[u]&h.A.WC)===h.A.OPEN&&(a&r.A.bd)===h.A.OPEN||(t===c+1&&i>=e&&i<=f&&(this.flags[u]&h.A.XC)===h.A.OPEN&&(a&r.A.Ld)===h.A.OPEN||(i===e-1&&t>=s&&t<=c&&(this.flags[u]&h.A.GC)===h.A.OPEN&&(a&r.A.Rd)===h.A.OPEN||i===f+1&&t>=s&&t<=c&&(this.flags[u]&h.A.VC)===h.A.OPEN&&(a&r.A.vd)===h.A.OPEN)))};add=(t,i,s)=>{this.flags[o.index(t,i)]|=s};remove=(t,i,s)=>{this.flags[o.index(t,i)]&=h.A.oT-s}}},4909:(t,i,s)=>{s.d(i,{A:()=>h});class h{static vd=1;static Ld=2;static Rd=4;static bd=8}},6169:(t,i,s)=>{s.d(i,{A:()=>h});class h{static bd=0;static vd=1;static Ld=2;static Rd=3}},5599:(t,i,s)=>{s.d(i,{A:()=>h});class h{static SA=0;static MA=1;static xA=2;static lA=3}},1023:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(5599);class e{static Td=new e(0,h.A.SA);static fT=new e(1,h.A.SA);static Od=new e(2,h.A.SA);static Sd=new e(3,h.A.SA);static VI=new e(4,h.A.MA);static gm=new e(5,h.A.MA);static uT=new e(6,h.A.MA);static dT=new e(7,h.A.MA);static wT=new e(8,h.A.MA);static kd=new e(9,h.A.xA);static rA=new e(10,h.A.xA);static oA=new e(11,h.A.xA);static AT=new e(12,h.A.xA);static yT=new e(13,h.A.xA);static pT=new e(14,h.A.xA);static mT=new e(15,h.A.xA);static IT=new e(16,h.A.xA);static _T=new e(17,h.A.xA);static ET=new e(18,h.A.xA);static gT=new e(19,h.A.xA);static CT=new e(20,h.A.xA);static TT=new e(21,h.A.xA);static lA=new e(22,h.A.lA);static values(){return[this.Td,this.fT,this._T,this.mT,this.Od,this.pT,this.kd,this.Sd,this.lA,this.AT,this.oA,this.uT,this.CT,this.rA,this.gm,this.yT,this.dT,this.VI,this.IT,this.wT,this.gT,this.TT,this.ET]}static of(t){const i=this.values();for(let s=0;s{s.d(i,{A:()=>y});var h=s(670),e=s(2164),n=s(1069),r=s(4583),o=s(3045),l=s(5637),a=s(4197),c=s(1312),f=s(1023),u=s(6169),d=s(9298),w=s(5518),A=s(3867);class y{static OT=Int8Array.of(1,2,4,8);static bT=Uint8Array.of(16,32,64,128);static vT=Int8Array.of(1,0,-1,0);static LT=Int8Array.of(0,-1,0,1);static RT=(17*Math.random()|0)-8;static ST=(33*Math.random()|0)-16;static st=!0;static Dp=0;static MT=!1;static kT=(t,i)=>{let s=this.xT(t+45365,i+91923,4)+(this.xT(t+10294,i+37821,2)-128>>1)+(this.xT(t,i,1)-128>>2)-128;return s=35+(.3*s|0),s<10?s=10:s>60&&(s=60),s};static xT=(t,i,s)=>{const h=t/s|0,e=t&s-1,n=i/s|0,r=i&s-1,o=this.DT(h,n),l=this.DT(h+1,n),a=this.DT(h,n+1),c=this.DT(h+1,n+1),f=this.NT(o,l,e,s),u=this.NT(a,c,e,s);return this.NT(f,u,r,s)};static NT=(t,i,s,h)=>{const e=65536-r.A.cos[1024*s/h|0]>>1;return(t*(65536-e)>>16)+(i*e>>16)};static DT=(t,i)=>((this.PT(t-1,i-1)+this.PT(t+1,i-1)+this.PT(t-1,i+1)+this.PT(t+1,i+1))/16|0)+((this.PT(t-1,i)+this.PT(t+1,i)+this.PT(t,i-1)+this.PT(t,i+1))/8|0)+(this.PT(t,i)/4|0);static PT=(t,i)=>{const s=t+57*i,h=BigInt(s<<13^s);return 255&Number((h*(h*h*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static RA=(t,i,s,h,e,n,r,o,d,w,A)=>{const p=e[A][i][s],m=e[A][i+1][s],I=e[A][i+1][s+1],_=e[A][i][s+1],E=p+m+I+_>>2,g=l.A.get(o);let C=i+(s<<7)+(o<<14)+1073741824|0;g.active||(C+=-2147483648),C|=0;const T=(w<<6)+d<<24>>24;if(d===f.A.lA.id)h?.FT(g.la(f.A.lA.id,w,p,m,I,_,-1),t,i,s,E,C,T),g.NA&&g.active&&r?.aT(i,s),-1!==g.al&&n.n_(new a.A(o,t,3,i,s,c.A.Ro[g.al],!0));else if(d===f.A.rA.id||d===f.A.oA.id){const e=g.la(f.A.rA.id,w,p,m,I,_,-1);if(e){let n,r,o=0;d===f.A.oA.id&&(o+=256),w===u.A.vd||w===u.A.Rd?(n=g.length,r=g.width):(n=g.width,r=g.length),h?.RA(t,i,s,E,e,null,C,T,n,r,o)}g.NA&&r?.RA(i,s,g.width,g.length,w,g.PA),-1!==g.al&&n.n_(new a.A(o,t,2,i,s,c.A.Ro[g.al],!0))}else if(d>=f.A.AT.id)h?.RA(t,i,s,E,g.la(d,w,p,m,I,_,-1),null,C,T,1,1,0),g.NA&&r?.RA(i,s,g.width,g.length,w,g.PA),-1!==g.al&&n.n_(new a.A(o,t,2,i,s,c.A.Ro[g.al],!0));else if(d===f.A.Td.id)h?.cT(t,i,s,E,y.OT[w],0,g.la(f.A.Td.id,w,p,m,I,_,-1),null,C,T),g.NA&&r?.cT(i,s,d,w,g.PA),-1!==g.al&&n.n_(new a.A(o,t,0,i,s,c.A.Ro[g.al],!0));else if(d===f.A.fT.id)h?.cT(t,i,s,E,y.bT[w],0,g.la(f.A.fT.id,w,p,m,I,_,-1),null,C,T),g.NA&&r?.cT(i,s,d,w,g.PA),-1!==g.al&&n.n_(new a.A(o,t,0,i,s,c.A.Ro[g.al],!0));else if(d===f.A.Od.id){const e=w+1&3;h?.cT(t,i,s,E,y.OT[w],y.OT[e],g.la(f.A.Od.id,w+4,p,m,I,_,-1),g.la(f.A.Od.id,e,p,m,I,_,-1),C,T),g.NA&&r?.cT(i,s,d,w,g.PA),-1!==g.al&&n.n_(new a.A(o,t,0,i,s,c.A.Ro[g.al],!0))}else if(d===f.A.Sd.id)h?.cT(t,i,s,E,y.bT[w],0,g.la(f.A.Sd.id,w,p,m,I,_,-1),null,C,T),g.NA&&r?.cT(i,s,d,w,g.PA),-1!==g.al&&n.n_(new a.A(o,t,0,i,s,c.A.Ro[g.al],!0));else if(d===f.A.kd.id)h?.RA(t,i,s,E,g.la(d,w,p,m,I,_,-1),null,C,T,1,1,0),g.NA&&r?.RA(i,s,g.width,g.length,w,g.PA),-1!==g.al&&n.n_(new a.A(o,t,2,i,s,c.A.Ro[g.al],!0));else if(d===f.A.VI.id)h?.UT(t,i,s,E,0,0,C,g.la(f.A.VI.id,u.A.bd,p,m,I,_,-1),T,512*w,y.OT[w]),-1!==g.al&&n.n_(new a.A(o,t,1,i,s,c.A.Ro[g.al],!0));else if(d===f.A.gm.id){let e=16;if(h){const n=h.Ed(t,i,s);n>0&&(e=l.A.get(n>>14&32767).bg)}h?.UT(t,i,s,E,y.vT[w]*e,y.LT[w]*e,C,g.la(f.A.VI.id,u.A.bd,p,m,I,_,-1),T,512*w,y.OT[w]),-1!==g.al&&n.n_(new a.A(o,t,1,i,s,c.A.Ro[g.al],!0))}else d===f.A.uT.id?(h?.UT(t,i,s,E,0,0,C,g.la(f.A.VI.id,u.A.bd,p,m,I,_,-1),T,w,256),-1!==g.al&&n.n_(new a.A(o,t,1,i,s,c.A.Ro[g.al],!0))):d===f.A.dT.id?(h?.UT(t,i,s,E,0,0,C,g.la(f.A.VI.id,u.A.bd,p,m,I,_,-1),T,w,512),-1!==g.al&&n.n_(new a.A(o,t,1,i,s,c.A.Ro[g.al],!0))):d===f.A.wT.id&&(h?.UT(t,i,s,E,0,0,C,g.la(f.A.VI.id,u.A.bd,p,m,I,_,-1),T,w,768),-1!==g.al&&n.n_(new a.A(o,t,1,i,s,c.A.Ro[g.al],!0)))};xI;DI;Wn;Yn;BT;GT;HT;WT;YT;VT;KT;XT;zT;jT;ZT;qT;constructor(t,i,s,e){this.xI=t,this.DI=i,this.Wn=s,this.Yn=e,this.BT=new A.qa(h.A.xn,t,i),this.GT=new A.qa(h.A.xn,t,i),this.HT=new A.qa(h.A.xn,t,i),this.WT=new A.qa(h.A.xn,t,i),this.qT=new A.$a(h.A.xn,t+1,i+1),this.YT=new A.qa(h.A.xn,t+1,i+1),this.VT=new A.Kn(t+1,i+1),this.KT=new Int32Array(i),this.XT=new Int32Array(i),this.zT=new Int32Array(i),this.jT=new Int32Array(i),this.ZT=new Int32Array(i)}Hp=(t,i)=>{for(let t=0;t=0&&i[h]?.aT(s,e)}y.RT+=(5*Math.random()|0)-2,y.RT<-8?y.RT=-8:y.RT>8&&(y.RT=8),y.ST+=(5*Math.random()|0)-2,y.ST<-16?y.ST=-16:y.ST>16&&(y.ST=16);for(let i=0;i>8;for(let t=1;t>2)+(s[e+1][t]>>3)+(s[e][t-1]>>2)+(s[e][t+1]>>3)+(s[e][t]>>1);this.VT[e][t]=u-d}for(let t=0;t=0&&h0){const i=e.A.Ro[s-1];this.KT[t]+=i.fg,this.XT[t]+=i.lg,this.zT[t]+=i.ag,this.jT[t]+=i.cg,n=this.ZT[t]++}}const r=s-5;if(r>=0&&r0){const i=e.A.Ro[s-1];this.KT[t]-=i.fg,this.XT[t]-=i.lg,this.zT[t]-=i.ag,this.jT[t]-=i.cg,n=this.ZT[t]--}}}if(s>=1&&s=0&&f=0&&A=1&&c0||A>0){const p=this.Wn[i][s][c],m=this.Wn[i][s+1][c],I=this.Wn[i][s+1][c+1],_=this.Wn[i][s][c+1],E=this.VT[s][c],g=this.VT[s+1][c],C=this.VT[s+1][c+1],T=this.VT[s][c+1];let O=-1,b=-1;if(f>0){const t=256*h/l|0,i=n/a|0;let s=o/a|0;O=e.A.ig(t,i,s);const r=t+y.RT&255;s+=y.ST,s<0?s=0:s>255&&(s=255),b=e.A.ig(r,i,s)}if(i>0){let t=0!==f||this.HT[i][s][c]===w.A.JT;A>0&&!e.A.Ro[A-1].rg&&(t=!1),t&&p===m&&p===I&&p===_&&(this.qT[i][s][c]|=2340)}let v=0;if(-1!==O&&(v=r.A.palette[e.A.sg(b,96)]),0===A)t?.QT(i,s,c,w.A.JT,u.A.bd,-1,p,m,I,_,e.A.sg(O,E),e.A.sg(O,g),e.A.sg(O,C),e.A.sg(O,T),d.A.Bl,d.A.Bl,d.A.Bl,d.A.Bl,v,d.A.Bl);else{const h=this.HT[i][s][c]+1,n=this.WT[i][s][c],o=e.A.Ro[A-1];let l,a,f=o.texture;f>=0?(a=r.A.tO(f),l=-1):o.eg===d.A.vc?(a=0,l=-2,f=-1):(l=e.A.ig(o.og,o.lg,o.ag),a=r.A.palette[e.A.hg(o.ug,96)]),t?.QT(i,s,c,h,n,f,p,m,I,_,e.A.sg(O,E),e.A.sg(O,g),e.A.sg(O,C),e.A.sg(O,T),e.A.hg(l,E),e.A.hg(l,g),e.A.hg(l,C),e.A.hg(l,T),v,a)}}}}}}for(let s=1;s0&&(t<<=3,i<<=3,s<<=3);for(let h=0;h<=e;h++)for(let n=0;n<=this.DI;n++)for(let r=0;r<=this.xI;r++){if(this.qT[h][r][n]&t){let i=n,s=n,l=h,a=h;for(;i>0&&this.qT[h][r][i-1]&t;)i--;for(;s0;){for(let h=i;h<=s;h++)if(!(this.qT[l-1][r][h]&t))break t;l--}t:for(;a=8){const h=this.Wn[a][r][i]-240,n=this.Wn[l][r][i];o.A.eO(e,1,128*r,h,128*i,128*r,n,128*s+128);for(let h=l;h<=a;h++)for(let e=i;e<=s;e++)this.qT[h][r][e]&=~t}}if(this.qT[h][r][n]&i){let t=r,s=r,l=h,a=h;for(;t>0&&this.qT[h][t-1][n]&i;)t--;for(;s0;){for(let h=t;h<=s;h++)if(!(this.qT[l-1][h][n]&i))break t;l--}t:for(;a=8){const h=this.Wn[a][t][n]-240,r=this.Wn[l][t][n];o.A.eO(e,2,128*t,h,128*n,128*s+128,r,128*n);for(let h=l;h<=a;h++)for(let e=t;e<=s;e++)this.qT[h][e][n]&=~i}}if(this.qT[h][r][n]&s){let t=r,i=r,l=n,a=n;for(;l>0&&this.qT[h][r][l-1]&s;)l--;for(;a0;){for(let i=l;i<=a;i++)if(!(this.qT[h][t-1][i]&s))break t;t--}t:for(;i=4){const n=this.Wn[h][t][l];o.A.eO(e,4,128*t,n,128*l,128*i+128,n,128*a+128);for(let e=t;e<=i;e++)for(let t=l;t<=a;t++)this.qT[h][e][t]&=~s}}}}}};Bp=(t,i,s,n)=>{let r=0;for(let t=0;t>24;break}for(let e=t;e=0&&t=0&&e{const o=new n.A(new Uint8Array(r));for(let n=0;n=0&&a=0&&c>24,this.WT[n][a][c]=(f-2&3)<<24>>24):f<=81?this.Yn[n][a][c]=f-49<<24>>24:this.BT[n][a][c]=f-81<<24>>24}else for(;f=o.ZA,0!==f;){if(1===f){o.ZA;break}f<=49&&o.ZA}}};Gp=(t,i,s,e,r,o)=>{const l=new n.A(new Uint8Array(e));let a=-1;for(;;){const e=l.nO;if(0===e)return;a+=e;let n=0;for(;;){const e=l.nO;if(0===e)break;n+=e-1;const c=63&n,f=n>>6&63,u=n>>12,d=l.ZA,w=d>>2,A=3&d,y=f+r,p=c+o;if(y>0&&p>0&&y=0&&(e=s[h]),this.RA(u,y,p,t,i,e,a,w,A)}}}};RA=(t,i,s,h,e,n,r,o,d)=>{if(y.st){if(16&this.Yn[t][i][s])return;if(this.$T(t,i,s)!==y.Dp)return}const w=this.Wn[t][i][s],A=this.Wn[t][i+1][s],p=this.Wn[t][i+1][s+1],m=this.Wn[t][i][s+1],I=w+A+p+m>>2,_=l.A.get(r);let E=i+(s<<7)+(r<<14)+1073741824|0;_.active||(E+=-2147483648),E|=0;const g=(d<<6)+o<<24>>24;if(o===f.A.lA.id)(!y.st||_.active||_.Fg)&&(h?.FT(_.la(f.A.lA.id,d,w,A,p,m,-1),t,i,s,I,E,g),_.NA&&_.active&&n?.aT(i,s),-1!==_.al&&e.n_(new a.A(r,t,3,i,s,c.A.Ro[_.al],!0)));else if(o===f.A.rA.id||o===f.A.oA.id){const l=_.la(f.A.rA.id,d,w,A,p,m,-1);if(l){let e,n,r=0;if(o===f.A.oA.id&&(r+=256),d===u.A.vd||d===u.A.Rd?(e=_.length,n=_.width):(e=_.width,n=_.length),h?.RA(t,i,s,I,l,null,E,g,e,n,r)&&_.Sg)for(let h=0;h<=e;h++)for(let e=0;e<=n;e++){let n=l.rO/4|0;n>30&&(n=30),n>this.YT[t][i+h][s+e]&&(this.YT[t][i+h][s+e]=n<<24>>24)}}_.NA&&n?.RA(i,s,_.width,_.length,d,_.PA),-1!==_.al&&e.n_(new a.A(r,t,2,i,s,c.A.Ro[_.al],!0))}else if(o>=f.A.AT.id)h?.RA(t,i,s,I,_.la(o,d,w,A,p,m,-1),null,E,g,1,1,0),o>=f.A.AT.id&&o<=f.A._T.id&&o!==f.A.yT.id&&t>0&&(this.qT[t][i][s]|=2340),_.NA&&n?.RA(i,s,_.width,_.length,d,_.PA),-1!==_.al&&e.n_(new a.A(r,t,2,i,s,c.A.Ro[_.al],!0));else if(o===f.A.Td.id)h?.cT(t,i,s,I,y.OT[d],0,_.la(f.A.Td.id,d,w,A,p,m,-1),null,E,g),d===u.A.bd?(_.Sg&&(this.YT[t][i][s]=50,this.YT[t][i][s+1]=50),_.rg&&(this.qT[t][i][s]|=585)):d===u.A.vd?(_.Sg&&(this.YT[t][i][s+1]=50,this.YT[t][i+1][s+1]=50),_.rg&&(this.qT[t][i][s+1]|=1170)):d===u.A.Ld?(_.Sg&&(this.YT[t][i+1][s]=50,this.YT[t][i+1][s+1]=50),_.rg&&(this.qT[t][i+1][s]|=585)):d===u.A.Rd&&(_.Sg&&(this.YT[t][i][s]=50,this.YT[t][i+1][s]=50),_.rg&&(this.qT[t][i][s]|=1170)),_.NA&&n?.cT(i,s,o,d,_.PA),-1!==_.al&&e.n_(new a.A(r,t,0,i,s,c.A.Ro[_.al],!0)),16!==_.bg&&h?.oO(t,i,s,_.bg);else if(o===f.A.fT.id)h?.cT(t,i,s,I,y.bT[d],0,_.la(f.A.fT.id,d,w,A,p,m,-1),null,E,g),_.Sg&&(d===u.A.bd?this.YT[t][i][s+1]=50:d===u.A.vd?this.YT[t][i+1][s+1]=50:d===u.A.Ld?this.YT[t][i+1][s]=50:d===u.A.Rd&&(this.YT[t][i][s]=50)),_.NA&&n?.cT(i,s,o,d,_.PA),-1!==_.al&&e.n_(new a.A(r,t,0,i,s,c.A.Ro[_.al],!0));else if(o===f.A.Od.id){const l=d+1&3;h?.cT(t,i,s,I,y.OT[d],y.OT[l],_.la(f.A.Od.id,d+4,w,A,p,m,-1),_.la(f.A.Od.id,l,w,A,p,m,-1),E,g),_.rg&&(d===u.A.bd?(this.qT[t][i][s]|=265,this.qT[t][i][s+1]|=1170):d===u.A.vd?(this.qT[t][i][s+1]|=1170,this.qT[t][i+1][s]|=585):d===u.A.Ld?(this.qT[t][i+1][s]|=585,this.qT[t][i][s]|=1170):d===u.A.Rd&&(this.qT[t][i][s]|=1170,this.qT[t][i][s]|=585)),_.NA&&n?.cT(i,s,o,d,_.PA),-1!==_.al&&e.n_(new a.A(r,t,0,i,s,c.A.Ro[_.al],!0)),16!==_.bg&&h?.oO(t,i,s,_.bg)}else if(o===f.A.Sd.id)h?.cT(t,i,s,I,y.bT[d],0,_.la(f.A.Sd.id,d,w,A,p,m,-1),null,E,g),_.Sg&&(d===u.A.bd?this.YT[t][i][s+1]=50:d===u.A.vd?this.YT[t][i+1][s+1]=50:d===u.A.Ld?this.YT[t][i+1][s]=50:d===u.A.Rd&&(this.YT[t][i][s]=50)),_.NA&&n?.cT(i,s,o,d,_.PA),-1!==_.al&&e.n_(new a.A(r,t,0,i,s,c.A.Ro[_.al],!0));else if(o===f.A.kd.id)h?.RA(t,i,s,I,_.la(o,d,w,A,p,m,-1),null,E,g,1,1,0),_.NA&&n?.RA(i,s,_.width,_.length,d,_.PA),-1!==_.al&&e.n_(new a.A(r,t,2,i,s,c.A.Ro[_.al],!0));else if(o===f.A.VI.id)h?.UT(t,i,s,I,0,0,E,_.la(f.A.VI.id,u.A.bd,w,A,p,m,-1),g,512*d,y.OT[d]),-1!==_.al&&e.n_(new a.A(r,t,1,i,s,c.A.Ro[_.al],!0));else if(o===f.A.gm.id){let n=16;if(h){const e=h.Ed(t,i,s);e>0&&(n=l.A.get(e>>14&32767).bg)}h?.UT(t,i,s,I,y.vT[d]*n,y.LT[d]*n,E,_.la(f.A.VI.id,u.A.bd,w,A,p,m,-1),g,512*d,y.OT[d]),-1!==_.al&&e.n_(new a.A(r,t,1,i,s,c.A.Ro[_.al],!0))}else o===f.A.uT.id?(h?.UT(t,i,s,I,0,0,E,_.la(f.A.VI.id,u.A.bd,w,A,p,m,-1),g,d,256),-1!==_.al&&e.n_(new a.A(r,t,1,i,s,c.A.Ro[_.al],!0))):o===f.A.dT.id?(h?.UT(t,i,s,I,0,0,E,_.la(f.A.VI.id,u.A.bd,w,A,p,m,-1),g,d,512),-1!==_.al&&e.n_(new a.A(r,t,1,i,s,c.A.Ro[_.al],!0))):o===f.A.wT.id&&(h?.UT(t,i,s,I,0,0,E,_.la(f.A.VI.id,u.A.bd,w,A,p,m,-1),g,d,768),-1!==_.al&&e.n_(new a.A(r,t,1,i,s,c.A.Ro[_.al],!0)))};$T=(t,i,s)=>8&this.Yn[t][i][s]?0:t<=0||!(2&this.Yn[1][i][s])?t:t-1}},3045:(t,i,s)=>{s.d(i,{A:()=>I});var h=s(4583),e=s(1161),n=s(3795),r=s(8256),o=s(670),l=s(9222),a=s(6855),c=s(7441),f=s(6666),u=s(5748),d=s(3479),w=s(8950),A=s(2771),y=s(5518),p=s(6169),m=s(3867);class I{static lO=new m.aO(8,32,51,51,!1);static cO=new m.ds(100,null);static Xu=new Int32Array(o.A.xn);static fO=new m.uO(o.A.xn,500,null);static dO=new m.ds(500,null);static wO=new f.A;static Vf=0;static AO=0;static yO=0;static pO=0;static mO=0;static IO=0;static _O=0;static EO=0;static gO=0;static CO=0;static TO=0;static OO=0;static bO=0;static vO=0;static LO=0;static RO=0;static SO=0;static MO=0;static kO=0;static xO=0;static zu=0;static DO=0;static NO=!1;static PO=null;static FO=Uint8Array.of(19,55,38,155,255,110,137,205,76);static UO=Uint8Array.of(160,192,80,96,0,144,80,48,160);static BO=Uint8Array.of(76,8,137,4,0,1,38,2,19);static GO=Int8Array.of(0,0,2,0,0,2,1,1,0);static HO=Int8Array.of(2,0,0,2,0,0,0,4,4);static WO=Int8Array.of(0,4,4,8,0,0,8,0,0);static YO=Int8Array.of(1,1,0,0,0,8,0,0,8);static VO=Int8Array.of(53,-53,-53,53);static KO=Int8Array.of(-53,-53,53,53);static XO=Int8Array.of(-45,45,45,-45);static zO=Int8Array.of(45,45,-45,-45);static jO=[new Int8Array(16),Int8Array.of(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,0,0,0,1,1,0,0,1,1,1,0,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1),Int8Array.of(0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0),Int8Array.of(0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0),Int8Array.of(1,1,1,1,1,1,1,1,0,1,1,1,0,0,1,1),Int8Array.of(1,1,1,1,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,0,0,0,0,1,1,0,1,1,1,0,1,1,1),Int8Array.of(0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1)];static ZO=[Int8Array.of(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),Int8Array.of(12,8,4,0,13,9,5,1,14,10,6,2,15,11,7,3),Int8Array.of(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0),Int8Array.of(3,7,11,15,2,6,10,14,1,5,9,13,0,4,8,12)];static qO=Int32Array.of(41,39248,41,4643,41,41,41,41,41,41,41,41,41,41,41,43086,41,41,41,41,41,41,41,8602,41,28992,41,41,41,41,41,5056,41,41,41,41,41,41,41,41,41,41,41,41,41,41,3131,41,41,41);static ju=0;static xl=0;static Dl=0;static ff=-1;static uf=-1;static st=!0;static init=(t,i,s,e,n)=>{this.AO=0,this.yO=0,this.pO=t,this.mO=i,this.IO=t/2|0,this._O=i/2|0;const r=new m.aO(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let i=0;i<2048;i+=64){this.EO=h.A.sin[t],this.gO=h.A.cos[t],this.CO=h.A.sin[i],this.TO=h.A.cos[i];const o=(t-128)/32|0,l=i/64|0;for(let t=-26;t<=26;t++)for(let i=-26;i<=26;i++){const h=128*t,a=128*i;let c=!1;for(let t=-s;t<=e;t+=128)if(this.$O(h,a,n[o]+t)){c=!0;break}r[o][l][t+25+1][i+25+1]=c}}for(let t=0;t<8;t++)for(let i=0;i<32;i++)for(let s=-25;s<25;s++)for(let h=-25;h<25;h++){let e=!1;t:for(let n=-1;n<=1;n++)for(let o=-1;o<=1;o++){if(r[t][i][s+n+25+1][h+o+25+1]){e=!0;break t}if(r[t][(i+1)%31][s+n+25+1][h+o+25+1]){e=!0;break t}if(r[t+1][i][s+n+25+1][h+o+25+1]){e=!0;break t}if(r[t+1][(i+1)%31][s+n+25+1][h+o+25+1]){e=!0;break t}}this.lO[t][i][s+25][h+25]=e}};static bo=()=>{this.cO=null,this.Xu=null,this.fO=null,this.wO=null,this.lO=null,this.dO=null,this.PO=null,console.log('World3D unloaded!')};static eO=(t,i,s,h,e,n,o,l)=>{I.fO[t][I.Xu[t]++]=new r.A(s/128|0,n/128|0,e/128|0,l/128|0,i,s,n,e,l,h,o)};static $O=(t,i,s)=>{const h=i*this.CO+t*this.TO>>16,e=i*this.TO-t*this.CO>>16,n=s*this.EO+e*this.gO>>16,r=s*this.gO-e*this.EO>>16;if(n<50||n>3500)return!1;const o=this.IO+((h<<9)/n|0),l=this._O+((r<<9)/n|0);return o>=this.AO&&o<=this.pO&&l>=this.yO&&l<=this.mO};JO;xI;DI;QO;tb;Er;ib;sb;hb;eb=0;nb=0;rb=0;constructor(t,i,s,h){this.JO=s,this.xI=h,this.DI=i,this.tb=new m.Cr(s,h,i,null),this.ib=new m.$a(s,h+1,i+1),this.QO=t,this.Er=new m.ds(5e3,null),this.sb=new Int32Array(1e4),this.hb=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this.nb=t;for(let i=0;i{const s=this.tb[0][t][i];for(let s=0;s<3;s++){this.tb[s][t][i]=this.tb[s+1][t][i];const h=this.tb[s][t][i];h&&h.level--}this.tb[0][t][i]||(this.tb[0][t][i]=new n.A(0,t,i));const h=this.tb[0][t][i];h&&(h.ob=s),this.tb[3][t][i]=null};iO=(t,i,s,h)=>{const e=this.tb[t][i][s];e&&(e.lb=h)};QT=(t,i,s,h,e,r,o,l,a,c,f,u,w,p,m,I,_,E,g,C)=>{if(h===y.A.JT){for(let h=t;h>=0;h--)this.tb[h][i][s]||(this.tb[h][i][s]=new n.A(h,i,s));const h=this.tb[t][i][s];h&&(h.ab=new d.A(f,u,w,p,-1,g,!1))}else if(h===y.A.cb){for(let h=t;h>=0;h--)this.tb[h][i][s]||(this.tb[h][i][s]=new n.A(h,i,s));const h=this.tb[t][i][s];h&&(h.ab=new d.A(m,I,_,E,r,C,o===l&&o===a&&o===c))}else{for(let h=t;h>=0;h--)this.tb[h][i][s]||(this.tb[h][i][s]=new n.A(h,i,s));const d=this.tb[t][i][s];d&&(d.fb=new A.A(i,h,I,l,w,e,f,c,C,m,r,E,g,a,_,p,o,s,u))}};FT=(t,i,s,h,e,r,o)=>{this.tb[i][s][h]||(this.tb[i][s][h]=new n.A(i,s,h));const a=this.tb[i][s][h];a&&(a.ub=new l.A(e,128*s+64,128*h+64,t,r,o))};BA=(t,i,s)=>{const h=this.tb[t][i][s];h&&(h.ub=null)};LA=(t,i,s,h,e,r,o,l)=>{let a=0;const c=this.tb[h][t][i];if(c)for(let t=0;ta&&(a=s)}else this.tb[h][t][i]=new n.A(h,t,i);const f=this.tb[h][t][i];f&&(f.yb=new u.A(s,128*t+64,128*i+64,r,o,l,e,a))};TA=(t,i,s)=>{const h=this.tb[t][i][s];h&&(h.yb=null)};cT=(t,i,s,h,e,r,o,l,c,f)=>{if(!o&&!l)return;for(let h=t;h>=0;h--)this.tb[h][i][s]||(this.tb[h][i][s]=new n.A(h,i,s));const u=this.tb[t][i][s];u&&(u.pb=new a.A(h,128*i+64,128*s+64,e,r,o,l,c,f))};DA=(t,i,s,h)=>{const e=this.tb[t][i][s];1===h&&e&&(e.pb=null)};UT=(t,i,s,h,e,r,o,l,a,f,u)=>{if(!l)return;for(let h=t;h>=0;h--)this.tb[h][i][s]||(this.tb[h][i][s]=new n.A(h,i,s));const d=this.tb[t][i][s];d&&(d.mb=new c.A(h,128*i+e+64,128*s+r+64,u,f,l,o,a))};FA=(t,i,s)=>{const h=this.tb[t][i][s];h&&(h.mb=null)};oO=(t,i,s,h)=>{const e=this.tb[t][i][s];if(!e)return;const n=e.mb;if(!n)return;const r=128*i+64,o=128*s+64;n.x=r+((n.x-r)*h/16|0),n.z=o+((n.z-o)*h/16|0)};YI=(t,i,s,h)=>{if(!h)return;const e=this.tb[t][i][s];if(!e)return;const n=e.mb;n&&(n.model=h)};zI=(t,i,s,h)=>{if(!h)return;const e=this.tb[t][i][s];if(!e)return;const n=e.ub;n&&(n.model=h)};XI=(t,i,s,h)=>{if(!h)return;const e=this.tb[t][i][s];if(!e)return;const n=e.pb;n&&(n.Ib=h)};KI=(t,i,s,h,e)=>{if(!h)return;const n=this.tb[s][t][i];if(!n)return;const r=n.pb;r&&(r.Ib=h,r._b=e)};RA=(t,i,s,h,e,n,r,o,l,a,c)=>{if(!e&&!n)return!0;const f=128*i+64*l,u=128*s+64*a;return this.Eb(f,u,h,t,i,s,l,a,e,n,r,o,c,!1)};vI=(t,i,s,h,e,n,r,o,l,a)=>{if(!e&&!n)return!0;let c=i-l,f=h-l,u=i+l,d=h+l;return a&&(o>640&&o<1408&&(d+=128),o>1152&&o<1920&&(u+=128),(o>1664||o<384)&&(f-=128),o>128&&o<896&&(c-=128)),c=c/128|0,f=f/128|0,u=u/128|0,d=d/128|0,this.Eb(i,h,s,t,c,f,u+1-c,d-f+1,e,n,r,0,o,!0)};SI=(t,i,s,h,e,n,r,o,l,a,c,f)=>!l&&!a||this.Eb(i,h,s,t,e,n,r+1-e,o-n+1,l,a,c,0,f,!0);UA=(t,i,s)=>{const h=this.tb[t][i][s];if(h)for(let t=0;t>29&3)&&e.Cb===i&&e.Tb===s)return void this.Ob(e)}};WI=(t,i,s,h)=>{if(!h)return;const e=this.tb[t][i][s];if(e)for(let t=0;t>29&3))return void(i.model=h)}};zf=()=>{for(let t=0;t{const h=this.tb[t][i][s];return h&&h.pb?h.pb.gb:0};kA=(t,i,s)=>{const h=this.tb[t][s][i];return h&&h.mb?h.mb.gb:0};Md=(t,i,s)=>{const h=this.tb[t][i][s];if(!h)return 0;for(let t=0;t>29&3)&&e.Cb===i&&e.Tb===s)return e.gb}return 0};Ad=(t,i,s)=>{const h=this.tb[t][i][s];return h&&h.ub?h.ub.gb:0};gd=(t,i,s,h)=>{const e=this.tb[t][i][s];if(e){if(e.pb&&e.pb.gb===h)return 255&e.pb.info;if(e.mb&&e.mb.gb===h)return 255&e.mb.info;if(e.ub&&e.ub.gb===h)return 255&e.ub.info;for(let t=0;t{const n=i*(0|Math.sqrt(s*s+h*h+e*e))>>8;for(let i=0;i{if(i0){const e=this.tb[t][i+1][s-1];e&&e.ub&&e.ub.model&&e.ub.model.bb&&this.Lb(h,e.ub.model,128,0,-128,!0)}};vb=(t,i,s,h,e,n)=>{let r=!0,o=i;const l=i+h,a=s-1,c=s+e;for(let f=t;f<=t+1;f++)if(f!==this.JO){for(let u=o;u<=l;u++)if(!(u<0||u>=this.xI))for(let o=a;o<=c;o++){if(o<0||o>=this.DI||r&&u=s||u===i))continue;const a=this.tb[f][u][o];if(!a)continue;const d=128*(u-i)+64*(1-h),w=128*(o-s)+64*(1-e),A=((this.QO[f][u][o]+this.QO[f][u+1][o]+this.QO[f][u][o+1]+this.QO[f][u+1][o+1])/4|0)-((this.QO[t][i][s]+this.QO[t][i+1][s]+this.QO[t][i][s+1]+this.QO[t][i+1][s+1])/4|0),y=a.pb;y&&y.Ib&&y.Ib.bb&&this.Lb(n,y.Ib,d,A,w,r),y&&y._b&&y._b.bb&&this.Lb(n,y._b,d,A,w,r);for(let t=0;t{this.rb++;let r=0;const o=i.Gg,l=i.Bg;if(t.bb&&t.xb)for(let n=0;ni.Db)continue;const u=t.Gg[n]-s;if(ui.Pb)continue;const d=t.Hg[n]-e;if(di.Ub)continue;if(i.bb&&i.xb)for(let t=0;t{const r=this.tb[t][i][s];if(!r)return;const o=r.ab;if(o){const t=o.color;if(0!==t)for(let i=0;i<4;i++)h[e]=t,h[e+1]=t,h[e+2]=t,h[e+3]=t,e+=n;return}const l=r.fb;if(!l)return;const a=l.shape,c=l.angle,f=l.Vb,u=l.Kb,d=I.jO[a],w=I.ZO[c];let A=0;if(0===f)for(let t=0;t<4;t++)0!==d[w[A++]]&&(h[e]=u),0!==d[w[A++]]&&(h[e+1]=u),0!==d[w[A++]]&&(h[e+2]=u),0!==d[w[A++]]&&(h[e+3]=u),e+=n;else for(let t=0;t<4;t++)h[e]=0===d[w[A++]]?f:u,h[e+1]=0===d[w[A++]]?f:u,h[e+2]=0===d[w[A++]]?f:u,h[e+3]=0===d[w[A++]]?f:u,e+=n};click=(t,i)=>{I.NO=!0,I.xl=t,I.Dl=i,I.ff=-1,I.uf=-1};draw=(t,i,s,e,n,r,o)=>{t<0?t=0:t>=128*this.xI&&(t=128*this.xI-1),s<0?s=0:s>=128*this.DI&&(s=128*this.DI-1),I.Vf++,I.EO=h.A.sin[r],I.gO=h.A.cos[r],I.CO=h.A.sin[n],I.TO=h.A.cos[n],I.PO=I.lO[(r-128)/32|0][n/64|0],I.OO=t,I.bO=i,I.vO=s,I.LO=t/128|0,I.RO=s/128|0,I.zu=e,I.SO=I.LO-25,I.SO<0&&(I.SO=0),I.kO=I.RO-25,I.kO<0&&(I.kO=0),I.MO=I.LO+25,I.MO>this.xI&&(I.MO=this.xI),I.xO=I.RO+25,I.xO>this.DI&&(I.xO=this.DI),this.Xb(),I.DO=0;for(let t=this.nb;t=2e3)?(r.visible=!0,r.update=!0,r.zb=r.wb>0,I.DO++):(r.visible=!1,r.update=!1,r.jb=0))}}for(let t=this.nb;t=I.MO))for(let t=-25;t<=0;t++){const e=I.RO+t,n=I.RO-t;let r;if(s>=I.SO&&(e>=I.kO&&(r=i[s][e],r&&r.visible&&this.Zb(r,!0,o)),n=I.kO&&(r=i[h][e],r&&r.visible&&this.Zb(r,!0,o)),n=I.MO))for(let t=-25;t<=0;t++){const e=I.RO+t,n=I.RO-t;let r;if(s>=I.SO&&(e>=I.kO&&(r=i[s][e],r&&r.visible&&this.Zb(r,!1,o)),n=I.kO&&(r=i[h][e],r&&r.visible&&this.Zb(r,!1,o)),n{if(!c&&!f)return!1;for(let t=r;t=this.xI||i>=this.DI)return!1;const s=this.tb[h][t][i];if(s&&s.wb>=5)return!1}const y=new e.A(h,s,t,i,c,f,w,r,r+l-1,o,o+a-1,u,d);for(let t=r;tr&&(s|=1),to&&(s+=8),i=0;s--)this.tb[s][t][i]||(this.tb[s][t][i]=new n.A(s,t,i));const e=this.tb[h][t][i];e&&(e.Ab[e.wb]=y,e.qb[e.wb]=s,e.$b|=s,e.wb++)}return A&&(this.Er[this.eb++]=y),!0};Ob=t=>{for(let i=t.Cb;i<=t.Sb;i++)for(let s=t.Tb;s<=t.Mb;s++){const h=this.tb[t.level][i][s];if(h){for(let i=0;i{const t=I.Xu[I.zu],i=I.fO[I.zu];I.ju=0;for(let s=0;s=0&&h<=50){e=t.kI+25-I.RO,e<0&&(e=0),n=t.DI+25-I.RO,n>50&&(n=50);let i=!1;for(;e<=n;)if(I.PO&&I.PO[h][e++]){i=!0;break}if(i){if(r=I.OO-t.Nb,r>32)t.mode=1;else{if(r>=-32)continue;t.mode=2,r=-r}t.Jb=(t.Fb-I.vO<<8)/r|0,t.Qb=(t.Ub-I.vO<<8)/r|0,t.tv=(t.Db-I.bO<<8)/r|0,t.iv=(t.Zg-I.bO<<8)/r|0,I.dO[I.ju++]=t}}}else if(2===t.type){if(h=t.kI+25-I.RO,h>=0&&h<=50){e=t.MI+25-I.LO,e<0&&(e=0),n=t.xI+25-I.LO,n>50&&(n=50);let i=!1;for(;e<=n;)if(I.PO&&I.PO[e++][h]){i=!0;break}if(i){if(r=I.vO-t.Fb,r>32)t.mode=3;else{if(r>=-32)continue;t.mode=4,r=-r}t.sv=(t.Nb-I.OO<<8)/r|0,t.hv=(t.Pb-I.OO<<8)/r|0,t.tv=(t.Db-I.bO<<8)/r|0,t.iv=(t.Zg-I.bO<<8)/r|0,I.dO[I.ju++]=t}}}else if(4===t.type&&(h=t.Db-I.bO,h>128&&(e=t.kI+25-I.RO,e<0&&(e=0),n=t.DI+25-I.RO,n>50&&(n=50),e<=n))){let i=t.MI+25-I.LO;i<0&&(i=0),r=t.xI+25-I.LO,r>50&&(r=50);let s=!1;t:for(let t=i;t<=r;t++)for(let i=e;i<=n;i++)if(I.PO&&I.PO[t][i]){s=!0;break t}s&&(t.mode=5,t.sv=(t.Nb-I.OO<<8)/h|0,t.hv=(t.Pb-I.OO<<8)/h|0,t.Jb=(t.Fb-I.vO<<8)/h|0,t.Qb=(t.Ub-I.vO<<8)/h|0,I.dO[I.ju++]=t)}}};Zb=(t,i,s)=>{for(I.wO.n_(t);;){let t;do{if(t=I.wO.ev(),!t)return}while(!t.update);const h=t.x,e=t.z,n=t.level,r=t.nv,o=this.tb[n];if(t.visible){if(i){if(n>0){const t=this.tb[n-1][h][e];if(t&&t.update)continue}if(h<=I.LO&&h>I.SO){const i=o[h-1][e];if(i&&i.update&&(i.visible||!(1&t.$b)))continue}if(h>=I.LO&&hI.kO){const i=o[h][e-1];if(i&&i.update&&(i.visible||!(8&t.$b)))continue}if(e>=I.RO&&ee&&(a+=6),c=I.FO[a],t.cv=I.BO[a]),f&&(f.fv&I.UO[a]?16===f.fv?(t.jb=3,t.uv=I.GO[a],t.dv=3-t.uv):32===f.fv?(t.jb=6,t.uv=I.HO[a],t.dv=6-t.uv):64===f.fv?(t.jb=12,t.uv=I.WO[a],t.dv=12-t.uv):(t.jb=9,t.uv=I.YO[a],t.dv=9-t.uv):t.jb=0,f.fv&c&&!this.wv(r,h,e,f.fv)&&f.Ib?.draw(0,I.EO,I.gO,I.CO,I.TO,f.x-I.OO,f.y-I.bO,f.z-I.vO,f.gb),f.Av&c&&!this.wv(r,h,e,f.Av)&&f._b?.draw(0,I.EO,I.gO,I.CO,I.TO,f.x-I.OO,f.y-I.bO,f.z-I.vO,f.gb)),u&&!this.visible(r,h,e,u.model.Zg))if(u.type&c)u.model.draw(u.angle,I.EO,I.gO,I.CO,I.TO,u.x-I.OO,u.y-I.bO,u.z-I.vO,u.gb);else if(768&u.type){const t=u.x-I.OO,i=u.y-I.bO,s=u.z-I.vO,h=u.angle;let e,n;if(e=h===p.A.vd||h===p.A.Ld?-t:t,n=h===p.A.Ld||h===p.A.Rd?-s:s,256&u.type&&ne){const e=t+I.XO[h],n=s+I.zO[h];u.model.draw(512*h+1280&2047,I.EO,I.gO,I.CO,I.TO,e,i,n,u.gb)}}if(l){const i=t.ub;i&&i.model?.draw(0,I.EO,I.gO,I.CO,I.TO,i.x-I.OO,i.y-I.bO,i.z-I.vO,i.gb);const s=t.yb;s&&0===s.offset&&(s.yv&&s.yv.draw(0,I.EO,I.gO,I.CO,I.TO,s.x-I.OO,s.y-I.bO,s.z-I.vO,s.gb),s.pv&&s.pv.draw(0,I.EO,I.gO,I.CO,I.TO,s.x-I.OO,s.y-I.bO,s.z-I.vO,s.gb),s.mv&&s.mv.draw(0,I.EO,I.gO,I.CO,I.TO,s.x-I.OO,s.y-I.bO,s.z-I.vO,s.gb))}const d=t.$b;if(0!==d){if(hI.LO&&1&d){const t=o[h-1][e];t&&t.update&&I.wO.n_(t)}if(e>I.RO&&8&d){const t=o[h][e-1];t&&t.update&&I.wO.n_(t)}}}if(0!==t.jb){let i=!0;for(let s=0;si.Cb&&(n+=1),si.Tb&&(n+=8),hh&&(h=e);const r=I.RO-i.Tb,l=i.Mb-I.RO;i.Iv=l>r?h+l:h+r}for(;;){let t=-50,i=-1;for(let s=0;st&&(t=h.Iv,i=s))}if(-1===i)break;const l=I.cO[i];if(l){l.Vf=I.Vf;let t=l.model;t||(t=l.av?.draw(s)??null),t&&!this._v(r,l.Cb,l.Sb,l.Tb,l.Mb,t.Zg)&&t.draw(l.LI,I.EO,I.gO,I.CO,I.TO,l.x-I.OO,l.y-I.bO,l.z-I.vO,l.gb);for(let t=l.Cb;t<=l.Sb;t++)for(let i=l.Tb;i<=l.Mb;i++){const s=o[t][i];s&&(0!==s.jb?I.wO.n_(s):t===h&&i===e||!s.update||I.wO.n_(s))}}}if(t.zb)continue}if(!t.update||0!==t.jb)continue;if(h<=I.LO&&h>I.SO){const t=o[h-1][e];if(t&&t.update)continue}if(h>=I.LO&&hI.kO){const t=o[h][e-1];if(t&&t.update)continue}if(e>=I.RO&&e=n){const n=t+I.VO[e],r=h+I.KO[e];i.model.draw(512*e+256,I.EO,I.gO,I.CO,I.TO,n,s,r,i.gb)}if(512&i.type&&r<=n){const n=t+I.XO[e],r=h+I.zO[e];i.model.draw(512*e+1280&2047,I.EO,I.gO,I.CO,I.TO,n,s,r,i.gb)}}const s=t.pb;s&&(s.Av&t.cv&&!this.wv(r,h,e,s.Av)&&s._b?.draw(0,I.EO,I.gO,I.CO,I.TO,s.x-I.OO,s.y-I.bO,s.z-I.vO,s.gb),s.fv&t.cv&&!this.wv(r,h,e,s.fv)&&s.Ib?.draw(0,I.EO,I.gO,I.CO,I.TO,s.x-I.OO,s.y-I.bO,s.z-I.vO,s.gb))}if(nI.LO){const t=o[h-1][e];t&&t.update&&I.wO.n_(t)}if(e>I.RO){const t=o[h][e-1];t&&t.update&&I.wO.n_(t)}}};ov=(t,i,s,e,n,r,o,l)=>{let a,c,f,u,d=a=(s<<7)-I.OO,A=c=(e<<7)-I.vO,y=f=d+128,p=u=A+128,m=this.QO[i][s][e]-I.bO,_=this.QO[i][s+1][e]-I.bO,E=this.QO[i][s+1][e+1]-I.bO,g=this.QO[i][s][e+1]-I.bO,C=A*o+d*l>>16;if(A=A*l-d*o>>16,d=C,C=m*r-A*n>>16,A=m*n+A*r>>16,m=C,A<50)return;if(C=c*o+y*l>>16,c=c*l-y*o>>16,y=C,C=_*r-c*n>>16,c=_*n+c*r>>16,_=C,c<50)return;if(C=p*o+f*l>>16,p=p*l-f*o>>16,f=C,C=E*r-p*n>>16,p=E*n+p*r>>16,E=C,p<50)return;if(C=u*o+a*l>>16,u=u*l-a*o>>16,a=C,C=g*r-u*n>>16,u=g*n+u*r>>16,g=C,u<50)return;const T=h.A.na+((d<<9)/A|0),O=h.A.ra+((m<<9)/A|0),b=h.A.na+((y<<9)/c|0),v=h.A.ra+((_<<9)/c|0),L=h.A.na+((f<<9)/p|0),R=h.A.ra+((E<<9)/p|0),S=h.A.na+((a<<9)/u|0),M=h.A.ra+((g<<9)/u|0);if(h.A.alpha=0,(L-S)*(v-M)-(R-M)*(b-S)>0)if(h.A.Ev=L<0||S<0||b<0||L>w.A.gv||S>w.A.gv||b>w.A.gv,I.NO&&this.Cv(I.xl,I.Dl,R,M,v,L,S,b)&&(I.ff=s,I.uf=e),-1===t.Tv)12345678!==t.Ov&&h.A.bv(L,S,b,R,M,v,t.Ov,t.vv,t.Lv);else if(I.st){const i=I.qO[t.Tv];h.A.bv(L,S,b,R,M,v,this.Rv(i,t.Ov),this.Rv(i,t.vv),this.Rv(i,t.Lv))}else t.flat?h.A.Sv(L,S,b,R,M,v,t.Ov,t.vv,t.Lv,d,m,A,y,a,_,g,c,u,t.Tv):h.A.Sv(L,S,b,R,M,v,t.Ov,t.vv,t.Lv,f,E,p,a,y,g,_,u,c,t.Tv);if(!((T-b)*(M-v)-(O-v)*(S-b)<=0))if(h.A.Ev=T<0||b<0||S<0||T>w.A.gv||b>w.A.gv||S>w.A.gv,I.NO&&this.Cv(I.xl,I.Dl,O,v,M,T,b,S)&&(I.ff=s,I.uf=e),-1!==t.Tv){if(!I.st)return void h.A.Sv(T,b,S,O,v,M,t.Mv,t.Lv,t.vv,d,m,A,y,a,_,g,c,u,t.Tv);const i=I.qO[t.Tv];h.A.bv(T,b,S,O,v,M,this.Rv(i,t.Mv),this.Rv(i,t.Lv),this.Rv(i,t.vv))}else 12345678!==t.Mv&&h.A.bv(T,b,S,O,v,M,t.Mv,t.Lv,t.vv)};lv=(t,i,s,e,n,r,o)=>{let l=s.Gg.length;for(let t=0;t>16;if(a=a*o-i*r>>16,i=c,c=l*n-a*e>>16,a=l*e+a*n>>16,l=c,a<50)return;s.kv&&(A.A.xv[t]=i,A.A.Dv[t]=l,A.A.Nv[t]=a),A.A.Pv[t]=h.A.na+((i<<9)/a|0),A.A.Fv[t]=h.A.ra+((l<<9)/a|0)}h.A.alpha=0,l=s.Uv.length;for(let e=0;e0)if(h.A.Ev=l<0||a<0||c<0||l>w.A.gv||a>w.A.gv||c>w.A.gv,I.NO&&this.Cv(I.xl,I.Dl,f,u,d,l,a,c)&&(I.ff=t,I.uf=i),s.kv&&-1!==s.kv[e])if(I.st){const t=I.qO[s.kv[e]];h.A.bv(l,a,c,f,u,d,this.Rv(t,s.Hv[e]),this.Rv(t,s.Wv[e]),this.Rv(t,s.Yv[e]))}else s.flat?h.A.Sv(l,a,c,f,u,d,s.Hv[e],s.Wv[e],s.Yv[e],A.A.xv[0],A.A.Dv[0],A.A.Nv[0],A.A.xv[1],A.A.xv[3],A.A.Dv[1],A.A.Dv[3],A.A.Nv[1],A.A.Nv[3],s.kv[e]):h.A.Sv(l,a,c,f,u,d,s.Hv[e],s.Wv[e],s.Yv[e],A.A.xv[n],A.A.Dv[n],A.A.Nv[n],A.A.xv[r],A.A.xv[o],A.A.Dv[r],A.A.Dv[o],A.A.Nv[r],A.A.Nv[o],s.kv[e]);else 12345678!==s.Hv[e]&&h.A.bv(l,a,c,f,u,d,s.Hv[e],s.Wv[e],s.Yv[e])}};rv=(t,i,s)=>{const h=this.ib[t][i][s];if(h===-I.Vf)return!1;if(h===I.Vf)return!0;{const h=i<<7,e=s<<7;return this.Vv(h+1,this.QO[t][i][s],e+1)&&this.Vv(h+128-1,this.QO[t][i+1][s],e+1)&&this.Vv(h+128-1,this.QO[t][i+1][s+1],e+128-1)&&this.Vv(h+1,this.QO[t][i][s+1],e+128-1)?(this.ib[t][i][s]=I.Vf,!0):(this.ib[t][i][s]=-I.Vf,!1)}};wv=(t,i,s,h)=>{if(!this.rv(t,i,s))return!1;const e=i<<7,n=s<<7,r=this.QO[t][i][s]-1,o=r-120,l=r-230,a=r-238;if(h<16){if(1===h){if(e>I.OO){if(!this.Vv(e,r,n))return!1;if(!this.Vv(e,r,n+128))return!1}if(t>0){if(!this.Vv(e,o,n))return!1;if(!this.Vv(e,o,n+128))return!1}return!!this.Vv(e,l,n)&&this.Vv(e,l,n+128)}if(2===h){if(n0){if(!this.Vv(e,o,n+128))return!1;if(!this.Vv(e+128,o,n+128))return!1}return!!this.Vv(e,l,n+128)&&this.Vv(e+128,l,n+128)}if(4===h){if(e0){if(!this.Vv(e+128,o,n))return!1;if(!this.Vv(e+128,o,n+128))return!1}return!!this.Vv(e+128,l,n)&&this.Vv(e+128,l,n+128)}if(8===h){if(n>I.vO){if(!this.Vv(e,r,n))return!1;if(!this.Vv(e+128,r,n))return!1}if(t>0){if(!this.Vv(e,o,n))return!1;if(!this.Vv(e+128,o,n))return!1}return!!this.Vv(e,l,n)&&this.Vv(e+128,l,n)}}return!!this.Vv(e+64,a,n+64)&&(16===h?this.Vv(e,l,n+128):32===h?this.Vv(e+128,l,n+128):64===h?this.Vv(e+128,l,n):128===h?this.Vv(e,l,n):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,i,s,h)=>{if(this.rv(t,i,s)){const e=i<<7,n=s<<7;return this.Vv(e+1,this.QO[t][i][s]-h,n+1)&&this.Vv(e+128-1,this.QO[t][i+1][s]-h,n+1)&&this.Vv(e+128-1,this.QO[t][i+1][s+1]-h,n+128-1)&&this.Vv(e+1,this.QO[t][i][s+1]-h,n+128-1)}return!1};_v=(t,i,s,h,e,n)=>{let r,o;if(i!==s||h!==e){for(r=i;r<=s;r++)for(o=h;o<=e;o++)if(this.ib[t][r][o]===-I.Vf)return!1;o=1+(i<<7);const l=2+(h<<7),a=this.QO[t][i][h]-n;if(!this.Vv(o,a,l))return!1;const c=(s<<7)-1;if(!this.Vv(c,a,l))return!1;const f=(e<<7)-1;return!!this.Vv(o,a,f)&&this.Vv(c,a,f)}return!!this.rv(t,i,h)&&(r=i<<7,o=h<<7,this.Vv(r+1,this.QO[t][i][h]-n,o+1)&&this.Vv(r+128-1,this.QO[t][i+1][h]-n,o+1)&&this.Vv(r+128-1,this.QO[t][i+1][h+1]-n,o+128-1)&&this.Vv(r+1,this.QO[t][i][h+1]-n,o+128-1))};Vv=(t,i,s)=>{for(let h=0;h0){const t=e.Fb+(e.Jb*h>>8),n=e.Ub+(e.Qb*h>>8),r=e.Db+(e.tv*h>>8),o=e.Zg+(e.iv*h>>8);if(s>=t&&s<=n&&i>=r&&i<=o)return!0}}else if(2===e.mode){const h=t-e.Nb;if(h>0){const t=e.Fb+(e.Jb*h>>8),n=e.Ub+(e.Qb*h>>8),r=e.Db+(e.tv*h>>8),o=e.Zg+(e.iv*h>>8);if(s>=t&&s<=n&&i>=r&&i<=o)return!0}}else if(3===e.mode){const h=e.Fb-s;if(h>0){const s=e.Nb+(e.sv*h>>8),n=e.Pb+(e.hv*h>>8),r=e.Db+(e.tv*h>>8),o=e.Zg+(e.iv*h>>8);if(t>=s&&t<=n&&i>=r&&i<=o)return!0}}else if(4===e.mode){const h=s-e.Fb;if(h>0){const s=e.Nb+(e.sv*h>>8),n=e.Pb+(e.hv*h>>8),r=e.Db+(e.tv*h>>8),o=e.Zg+(e.iv*h>>8);if(t>=s&&t<=n&&i>=r&&i<=o)return!0}}else if(5===e.mode){const h=i-e.Db;if(h>0){const i=e.Nb+(e.sv*h>>8),n=e.Pb+(e.hv*h>>8),r=e.Fb+(e.Jb*h>>8),o=e.Ub+(e.Qb*h>>8);if(t>=i&&t<=n&&s>=r&&s<=o)return!0}}}return!1};Cv=(t,i,s,h,e,n,r,o)=>{if(is&&i>h&&i>e)return!1;if(tn&&t>r&&t>o)return!1;const l=(i-h)*(o-r)-(t-r)*(e-h);return((i-s)*(r-n)-(t-n)*(h-s))*l>0&&l*((i-e)*(n-o)-(t-o)*(s-e))>0};Rv=(t,i)=>((i=(127-i)*(127&t)/160|0)<2?i=2:i>126&&(i=126),(65408&t)+i)}},7121:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{}},4197:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{Vp;HI;Wp;Yp;index;GI;ul;fl;constructor(t,i,s,h,e,n,r){super(),this.Vp=i,this.HI=s,this.Wp=h,this.Yp=e,this.index=t,this.GI=n,r&&-1!==n.wl&&this.GI.delay?(this.ul=Math.random()*this.GI.dl|0,this.fl=Math.random()*this.GI.delay[this.ul]|0):(this.ul=-1,this.fl=0)}}},8412:(t,i,s)=>{s.d(i,{A:()=>o});var h=s(9418),e=s(8665),n=s(8738),r=s(1312);class o extends h.A{static Tu=2;static bu=4;static Lu=8;static Ru=16;static Fu=32;static Du=64;static Su=128;type=null;draw(t){if(!this.type)return null;if(-1===this.Nu||-1===this.$m)return this.Jg();const i=this.Jg();if(!i)return null;const s=n.A.Ro[this.Nu],h=e.A.qE(s.la(),!0,!s.Og,!1);h.translate(-this.Zm,0,0),h.Ma(),s.GI&&s.GI.frames&&h.ka(s.GI.frames[this.$m]),h.Kg=null,h.Xg=null,128===s.qg&&128===s.$g||h.scale(s.qg,s.$g,s.qg),h.xa(64+s.vg,850+s.Lg,-30,-50,-30,!0);const r=[i,h],o=e.A.Kv(r,2);return 1===this.type.size&&(o.sC=!0),o}isVisible(){return null!==this.type}Jg(){if(!this.type)return null;if(this.Ou>=0&&0===this.Xm){const t=r.A.Ro[this.Ou].frames;if(t){const i=t[this.Vm];let s=-1;if(this.CI>=0&&this.CI!==this.Sa){const t=r.A.Ro[this.CI].frames;t&&(s=t[this.QI])}return this.type.Jg(i,s,r.A.Ro[this.Ou].s_)}}let t=-1;if(this.CI>=0){const i=r.A.Ro[this.CI].frames;i&&(t=i[this.QI])}const i=this.type.Jg(t,-1,null);return i?(this.height=i.Zg,i):null}}},3606:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{index;count;constructor(t,i){super(),this.index=t,this.count=i}}},9418:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(7121),e=s(1312),n=s(3867);class r extends h.A{x=0;z=0;LI=0;RI=!1;size=1;Sa=-1;$I=-1;oI=-1;aI=-1;fI=-1;dI=-1;e_=-1;ou=null;uu=100;cu=0;fu=0;pu=0;yu=0;du=-1e3;wu=0;Au=0;vu=-1;zm=0;jm=0;CI=-1;QI=0;JI=0;Ou=-1;Vm=0;Km=0;Xm=0;Ym=0;Nu=-1;$m=0;Jm=0;qm=0;Zm=0;Qm=0;iI=0;tI=0;sI=0;mu=0;Iu=0;hI=0;Vf=0;height=0;qI=0;pathLength=0;wf=new Int32Array(10);Af=new Int32Array(10);h_=new n.ds(10,!1);ZI=0;Eu=-1;gu=-1;Mu=-1;ku=-1;move(t,i,s){if(-1!==this.Ou&&e.A.Ro[this.Ou].priority<=1&&(this.Ou=-1),!t){const t=i-this.wf[0],h=s-this.Af[0];if(t>=-8&&t<=8&&h>=-8&&h<=8){this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.wf[t]=this.wf[t-1],this.Af[t]=this.Af[t-1],this.h_[t]=this.h_[t-1];return this.wf[0]=i,this.Af[0]=s,void(this.h_[0]=!1)}}this.pathLength=0,this.ZI=0,this.wf[0]=i,this.Af[0]=s,this.x=128*this.wf[0]+64*this.size,this.z=128*this.Af[0]+64*this.size}step(t,i){let s=this.wf[0],h=this.Af[0];0===i?(s--,h++):1===i?h++:2===i?(s++,h++):3===i?s--:4===i?s++:5===i?(s--,h--):6===i?h--:7===i&&(s++,h--),-1!==this.Ou&&e.A.Ro[this.Ou].priority<=1&&(this.Ou=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.wf[t]=this.wf[t-1],this.Af[t]=this.Af[t-1],this.h_[t]=this.h_[t-1];this.wf[0]=s,this.Af[0]=h,this.h_[0]=t}}},8268:(t,i,s)=>{s.d(i,{A:()=>d});var h=s(9418),e=s(8665),n=s(2679),r=s(8738),o=s(1312),l=s(8317),a=s(1302),c=s(3819),f=s(3867),u=s(9298);class d extends h.A{static Cu=1;static Tu=2;static bu=4;static Lu=8;static Ru=16;static Su=32;static xu=64;static Hm=128;static Du=256;static Pu=512;static Ra=[u.A.Xv,u.A.zv,u.A.jv,u.A.Zv,u.A.qv,u.A.$v,u.A.Jv,u.A.Qv,u.A.tL,u.A.iL,u.A.sL,u.A.hL,u.A.eL,u.A.nL,u.A.rL,u.A.oL];static La=[[u.A.lL,u.A.aL,u.A.cL,u.A.fL,u.A.uL,u.A.dL,u.A.wL,u.A.AL,u.A.yL,u.A.pL,u.A.mL,u.A.IL],[u.A._L,u.A.EL,u.A.gL,u.A.CL,u.A.TL,u.A.OL,u.A.bL,u.A.vL,u.A.LL,u.A.RL,u.A.SL,u.A.ML,u.A.kL,u.A.xL,u.A.DL,u.A.NL],[u.A.NL-1,u.A._L+1,u.A.EL,u.A.gL,u.A.CL,u.A.TL,u.A.OL,u.A.bL,u.A.vL,u.A.LL,u.A.RL,u.A.SL,u.A.ML,u.A.kL,u.A.xL,u.A.DL],[u.A.PL,u.A.FL,u.A.UL,u.A.BL,u.A.GL,u.A.HL],[u.A.WL,u.A.YL,u.A.VL,u.A.KL,u.A.XL,u.A.zL,u.A.jL,u.A.ZL]];static So=new n.A(200);name=null;visible=!1;qL=0;ru=0;$L=new Uint16Array(12);JL=new Uint16Array(5);Ka=0;QL=0n;y=0;OI=0;bI=0;r_=0;l_=0;o_=0;TI=null;MI=0;kI=0;xI=0;DI=0;st=!1;draw(t){if(!this.visible)return null;let i=this.Jg();if(this.height=i.Zg,i.sC=!0,this.st)return i;if(-1!==this.Nu&&-1!==this.$m){const t=r.A.Ro[this.Nu],s=e.A.qE(t.la(),!0,!t.Og,!1);s.translate(-this.Zm,0,0),s.Ma(),t.GI&&t.GI.frames&&s.ka(t.GI.frames[this.$m]),s.Kg=null,s.Xg=null,128===t.qg&&128===t.$g||s.scale(t.qg,t.$g,t.qg),s.xa(t.vg+64,t.Lg+850,-30,-50,-30,!0);const h=[i,s];i=e.A.Kv(h,2)}if(this.TI&&(t>=this.bI&&(this.TI=null),t>=this.OI&&t=d.La[i].length)&&(s=0),this.JL[i]=s}this.Sa=t.KA,65535===this.Sa&&(this.Sa=-1),this.$I=t.KA,65535===this.$I&&(this.$I=-1),this.oI=t.KA,65535===this.oI&&(this.oI=-1),this.aI=t.KA,65535===this.aI&&(this.aI=-1),this.fI=t.KA,65535===this.fI&&(this.fI=-1),this.dI=t.KA,65535===this.dI&&(this.dI=-1),this.e_=t.KA,65535===this.e_&&(this.e_=-1),this.name=c.A.ga(c.A.Ca(t.Uc)),this.Ka=t.ZA,this.visible=!0,this.QL=0n;for(let t=0;t<12;t++)this.QL<<=0x4n,this.$L[t]>=256&&(this.QL+=BigInt(this.$L[t])-256n);this.$L[0]>=256&&(this.QL+=BigInt(this.$L[0])-256n>>4n),this.$L[1]>=256&&(this.QL+=BigInt(this.$L[1])-256n>>8n);for(let t=0;t<5;t++)this.QL<<=0x3n,this.QL+=BigInt(this.JL[t]);this.QL<<=0x1n,this.QL+=BigInt(this.qL)}ey(){if(!this.visible)return null;const t=new f.ds(12,null);let i=0;for(let s=0;s<12;s++){const h=this.$L[s];if(h>=256&&h<512&&(t[i++]=l.A.Ro[h-256].ey()),h>=512){const s=a.A.get(h-512).ey(this.qL);s&&(t[i++]=s)}}const s=e.A.ba(t,i);for(let t=0;t<5;t++)0!==this.JL[t]&&(s.va(d.La[t][0],d.La[t][this.JL[t]]),1===t&&s.va(d.Ra[0],d.Ra[this.JL[t]]));return s}Jg(){let t=this.QL,i=-1,s=-1,h=-1,n=-1;if(this.Ou>=0&&0===this.Xm){const e=o.A.Ro[this.Ou];if(e.frames&&(i=e.frames[this.Vm]),this.CI>=0&&this.CI!==this.Sa){const t=o.A.Ro[this.CI].frames;t&&(s=t[this.QI])}e.MC>=0&&(h=e.MC,t+=BigInt(h-this.$L[5])<<8n),e.kC>=0&&(n=e.kC,t+=BigInt(n-this.$L[3])<<16n)}else if(this.CI>=0){const t=o.A.Ro[this.CI].frames;t&&(i=t[this.QI])}let r=d.So?.get(t);if(!r){const i=new f.ds(12,null);let s=0;for(let t=0;t<12;t++){let e=this.$L[t];if(n>=0&&3===t&&(e=n),h>=0&&5===t&&(e=h),e>=256&&e<512){const t=l.A.Ro[e-256].la();t&&(i[s++]=t)}if(e>=512){const t=a.A.get(e-512).SC(this.qL);t&&(i[s++]=t)}}r=e.A.ba(i,s);for(let t=0;t<5;t++)0!==this.JL[t]&&(r.va(d.La[t][0],d.La[t][this.JL[t]]),1===t&&r.va(d.Ra[0],d.Ra[this.JL[t]]));r.Ma(),r.xa(64,850,-30,-50,-30,!0),d.So?.put(t,r)}if(this.st)return r;const c=e.A.Qg(r,!0);return-1!==i&&-1!==s?c.tC(i,s,o.A.Ro[this.Ou].s_):-1!==i&&c.ka(i),c.iC(),c.Kg=null,c.Xg=null,c}}},254:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(8738),e=s(7121),n=s(8665);class r extends e.A{tR;level;iR;sR;hR;offsetY;FI;NI;eR;arc;target;mobile=!1;x=0;z=0;y=0;velocityX=0;nR=0;rR=0;velocityY=0;oR=0;LI=0;pitch=0;ul=0;fl=0;constructor(t,i,s,e,n,r,o,l,a,c,f){super(),this.tR=h.A.Ro[t],this.level=i,this.iR=s,this.sR=n,this.hR=e,this.FI=r,this.NI=o,this.eR=l,this.arc=a,this.target=c,this.offsetY=f}UI(t,i,s,h){if(!this.mobile){const i=t-this.iR,h=s-this.sR,e=Math.sqrt(i*i+h*h);this.x=this.iR+i*this.arc/e,this.z=this.sR+h*this.arc/e,this.y=this.hR}const e=this.NI+1-h;this.velocityX=(t-this.x)/e,this.nR=(s-this.z)/e,this.rR=Math.sqrt(this.velocityX*this.velocityX+this.nR*this.nR),this.mobile||(this.velocityY=-this.rR*Math.tan(.02454369*this.eR)),this.oR=2*(i-this.y-this.velocityY*e)/(e*e)}update(t){if(this.mobile=!0,this.x+=this.velocityX*t,this.z+=this.nR*t,this.y+=this.velocityY*t+.5*this.oR*t*t,this.velocityY+=this.oR*t,this.LI=325.949*Math.atan2(this.velocityX,this.nR)+1024&2047,this.pitch=325.949*Math.atan2(this.velocityY,this.rR)&2047,this.tR.GI&&this.tR.GI.delay)for(this.fl+=t;this.fl>this.tR.GI.delay[this.ul];)this.fl-=this.tR.GI.delay[this.ul]+1,this.ul++,this.ul>=this.tR.GI.dl&&(this.ul=0)}draw(){const t=this.tR.la(),i=n.A.qE(t,!0,!this.tR.Og,!1);return this.tR.GI&&this.tR.GI.frames&&(i.Ma(),i.ka(this.tR.GI.frames[this.ul]),i.Kg=null,i.Xg=null),128===this.tR.qg&&128===this.tR.$g||i.scale(this.tR.qg,this.tR.$g,this.tR.qg),i.lR(this.pitch),i.xa(64+this.tR.vg,850+this.tR.Lg,-30,-50,-30,!0),i}}},7628:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(7121),e=s(8738),n=s(8665);class r extends h.A{type;level;x;z;y;FI;BI=!1;ul=0;fl=0;constructor(t,i,s,h,n,r,o){super(),this.type=e.A.Ro[t],this.level=i,this.x=s,this.z=h,this.y=n,this.FI=r+o}update(t){if(this.type.GI&&this.type.GI.delay)for(this.fl+=t;this.fl>this.type.GI.delay[this.ul];)this.fl-=this.type.GI.delay[this.ul]+1,this.ul++,this.ul>=this.type.GI.dl&&(this.ul=0,this.BI=!0)}draw(){const t=this.type.la(),i=n.A.qE(t,!0,!this.type.Og,!1);return!this.BI&&this.type.GI&&this.type.GI.frames&&(i.Ma(),i.ka(this.type.GI.frames[this.ul]),i.Kg=null,i.Xg=null),128===this.type.qg&&128===this.type.$g||i.scale(this.type.qg,this.type.$g,this.type.qg),0!==this.type.orientation&&(90===this.type.orientation?i.zg():180===this.type.orientation?(i.zg(),i.zg()):270===this.type.orientation&&(i.zg(),i.zg(),i.zg())),i.xa(64+this.type.vg,850+this.type.Lg,-30,-50,-30,!0),i}}},9222:(t,i,s)=>{s.d(i,{A:()=>h});class h{y;x;z;model;gb;info;constructor(t,i,s,h,e,n){this.y=t,this.x=i,this.z=s,this.model=h,this.gb=e,this.info=n}}},1161:(t,i,s)=>{s.d(i,{A:()=>h});class h{level;y;x;z;model;av;LI;Cb;Sb;Tb;Mb;gb;info;Iv=0;Vf=0;constructor(t,i,s,h,e,n,r,o,l,a,c,f,u){this.level=t,this.y=i,this.x=s,this.z=h,this.model=e,this.av=n,this.LI=r,this.Cb=o,this.Sb=l,this.Tb=a,this.Mb=c,this.gb=f,this.info=u}}},5327:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{hp;Nd;x;z;Kp;angle;shape;NI;constructor(t,i,s,h,e,n,r,o){super(),this.hp=t,this.Nd=i,this.x=s,this.z=h,this.Kp=e,this.angle=n,this.shape=r,this.NI=o}}},2630:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{hp;Nd;x;z;Kp;angle;shape;ep;np;rp;constructor(t,i,s,h,e,n,r,o,l,a){super(),this.hp=t,this.Nd=i,this.x=s,this.z=h,this.Kp=e,this.angle=n,this.shape=r,this.ep=o,this.np=l,this.rp=a}}},5748:(t,i,s)=>{s.d(i,{A:()=>h});class h{y;x;z;mv;pv;yv;gb;offset;constructor(t,i,s,h,e,n,r,o){this.y=t,this.x=i,this.z=s,this.mv=h,this.pv=e,this.yv=n,this.gb=r,this.offset=o}}},8256:(t,i,s)=>{s.d(i,{A:()=>h});class h{MI;xI;kI;DI;type;Nb;Pb;Fb;Ub;Db;Zg;mode=0;sv=0;hv=0;Jb=0;Qb=0;tv=0;iv=0;constructor(t,i,s,h,e,n,r,o,l,a,c){this.MI=t,this.xI=i,this.kI=s,this.DI=h,this.type=e,this.Nb=n,this.Pb=r,this.Fb=o,this.Ub=l,this.Db=a,this.Zg=c}}},3795:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(1982),e=s(3867);class n extends h.A{level;x;z;nv;Ab;qb;ab=null;fb=null;pb=null;mb=null;ub=null;yb=null;ob=null;wb=0;$b=0;lb=0;visible=!1;update=!1;zb=!1;jb=0;uv=0;dv=0;cv=0;constructor(t,i,s){super(),this.nv=this.level=t,this.x=i,this.z=s,this.Ab=new e.ds(5,null),this.qb=new Int32Array(5)}}},2771:(t,i,s)=>{s.d(i,{A:()=>h});class h{static Pv=new Int32Array(6);static Fv=new Int32Array(6);static xv=new Int32Array(6);static Dv=new Int32Array(6);static Nv=new Int32Array(6);static aR=[Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,2,6),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,13,14)];static cR=[Int8Array.of(0,1,2,3,0,0,1,3),Int8Array.of(1,1,2,3,1,0,1,3),Int8Array.of(0,1,2,3,1,0,1,3),Int8Array.of(0,0,1,2,0,0,2,4,1,0,4,3),Int8Array.of(0,0,1,4,0,0,4,3,1,1,2,4),Int8Array.of(0,0,4,3,1,0,1,2,1,0,2,4),Int8Array.of(0,1,2,4,1,0,1,4,1,0,4,3),Int8Array.of(0,4,1,2,0,4,2,5,1,0,4,5,1,0,5,3),Int8Array.of(0,4,1,2,0,4,2,3,0,4,3,5,1,0,4,5),Int8Array.of(0,0,4,5,1,4,1,2,1,4,2,3,1,4,3,5),Int8Array.of(0,0,1,5,0,1,4,5,0,1,2,4,1,0,5,3,1,5,4,3,1,4,2,3),Int8Array.of(1,0,1,5,1,1,4,5,1,1,2,4,0,0,5,3,0,5,4,3,0,4,2,3),Int8Array.of(1,0,5,4,1,0,1,5,0,0,4,3,0,4,5,3,0,5,2,3,0,1,2,5)];static fR=128;static uR=this.fR/2|0;static dR=this.fR/4|0;static wR=3*this.fR/4|0;Gg;Wg;Hg;Hv;Wv;Yv;Uv;Bv;Gv;kv;flat;shape;angle;Vb;Kb;constructor(t,i,s,e,n,r,o,l,a,c,f,u,d,w,A,y,p,m,I){this.flat=!(p!==e||p!==w||p!==l),this.shape=i,this.angle=r,this.Vb=d,this.Kb=a;const _=h.aR[i],E=_.length;this.Gg=new Int32Array(E),this.Wg=new Int32Array(E),this.Hg=new Int32Array(E);const g=new Int32Array(E),C=new Int32Array(E),T=t*h.fR,O=m*h.fR;for(let t=0;t8&&E<=12&&(E=9+(E-r-9&3)),E>12&&E<=16&&(E=13+(E-r-13&3)),1===E?(i=T,a=O,f=p,d=o,m=c):2===E?(i=T+h.uR,a=O,f=p+e>>1,d=o+I>>1,m=c+s>>1):3===E?(i=T+h.fR,a=O,f=e,d=I,m=s):4===E?(i=T+h.fR,a=O+h.uR,f=e+w>>1,d=I+n>>1,m=s+A>>1):5===E?(i=T+h.fR,a=O+h.fR,f=w,d=n,m=A):6===E?(i=T+h.uR,a=O+h.fR,f=w+l>>1,d=n+y>>1,m=A+u>>1):7===E?(i=T,a=O+h.fR,f=l,d=y,m=u):8===E?(i=T,a=O+h.uR,f=l+p>>1,d=y+o>>1,m=u+c>>1):9===E?(i=T+h.uR,a=O+h.dR,f=p+e>>1,d=o+I>>1,m=c+s>>1):10===E?(i=T+h.wR,a=O+h.uR,f=e+w>>1,d=I+n>>1,m=s+A>>1):11===E?(i=T+h.uR,a=O+h.wR,f=w+l>>1,d=n+y>>1,m=A+u>>1):12===E?(i=T+h.dR,a=O+h.uR,f=l+p>>1,d=y+o>>1,m=u+c>>1):13===E?(i=T+h.dR,a=O+h.dR,f=p,d=o,m=c):14===E?(i=T+h.wR,a=O+h.dR,f=e,d=I,m=s):15===E?(i=T+h.wR,a=O+h.wR,f=w,d=n,m=A):(i=T+h.dR,a=O+h.wR,f=l,d=y,m=u),this.Gg[t]=i,this.Wg[t]=f,this.Hg[t]=a,g[t]=d,C[t]=m}const b=h.cR[i],v=b.length/4|0;this.Uv=new Int32Array(v),this.Bv=new Int32Array(v),this.Gv=new Int32Array(v),this.Hv=new Int32Array(v),this.Wv=new Int32Array(v),this.Yv=new Int32Array(v),this.kv=-1!==f?new Int32Array(v):null;let L=0;for(let t=0;t{s.d(i,{A:()=>h});class h{static JT=0;static cb=1;static AR=2;static yR=3;static pR=4;static mR=5;static uR=6;static dR=7;static wR=8;static IR=9;static _R=10;static ER=11}},3479:(t,i,s)=>{s.d(i,{A:()=>h});class h{Mv;Lv;Ov;vv;Tv;color;flat;constructor(t,i,s,h,e,n,r){this.Mv=t,this.Lv=i,this.Ov=s,this.vv=h,this.Tv=e,this.color=n,this.flat=r}}},6855:(t,i,s)=>{s.d(i,{A:()=>h});class h{y;x;z;fv;Av;Ib;_b;gb;info;constructor(t,i,s,h,e,n,r,o,l){this.y=t,this.x=i,this.z=s,this.fv=h,this.Av=e,this.Ib=n,this._b=r,this.gb=o,this.info=l}}},7441:(t,i,s)=>{s.d(i,{A:()=>h});class h{y;x;z;type;angle;model;gb;info;constructor(t,i,s,h,e,n,r,o){this.y=t,this.x=i,this.z=s,this.type=h,this.angle=e,this.model=n,this.gb=r,this.info=o}}},7536:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e{gR;CR;constructor(t){this.CR=[],this.gR=t;for(let i=0;i{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{TR;OR;constructor(){super(),this.TR=this,this.OR=this}bR(){this.OR&&this.TR&&(this.OR.TR=this.TR,this.TR.OR=this.OR,this.TR=null,this.OR=null)}}},3819:(t,i,s)=>{s.d(i,{A:()=>h});class h{static vR=['_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9'];static ld=t=>{t=t.trim();let i=0n;for(let s=0;s=65&&h<=90?i+=BigInt(h+1-65):h>=97&&h<=122?i+=BigInt(h+1-97):h>=48&&h<=57&&(i+=BigInt(h+27-48))}return i};static Ca=t=>{if(t<0n||t>=6582952005840035281n)return'invalid_name';if(t%37n===0n)return'invalid_name';let i=0;const s=Array(12);for(;0n!==t;){const h=t;t/=37n,s[11-i++]=this.vR[Number(h-37n*t)]}return s.slice(12-i).join('')};static dA=t=>{const i=[...t.toLowerCase()];let s=!0;for(let t=0;t='a'&&h<='z'&&(i[t]=h.toUpperCase(),s=!1),'.'!==h&&'!'!==h||(s=!0)}return i.join('')};static Dc=t=>{let i='';for(let s=0;s(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static ga=t=>{if(0===t.length)return t;const i=[...t];for(let t=0;t='a'&&i[t+1]<='z'&&(i[t+1]=String.fromCharCode(i[t+1].charCodeAt(0)+'A'.charCodeAt(0)-97)));return i[0]>='a'&&i[0]<='z'&&(i[0]=String.fromCharCode(i[0].charCodeAt(0)+'A'.charCodeAt(0)-97)),i.join('')};static jE=t=>{const i=t.toUpperCase();let s=0n;for(let t=0;t>56n)&0xffffffffffffffn;return s}}},6666:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e{LR;cursor=null;constructor(){const t=new h.A;t.next=t,t.Im=t,this.LR=t}n_(t){t.Im&&t.sy(),t.Im=this.LR.Im,t.next=this.LR,t.Im&&(t.Im.next=t),t.next.Im=t}bA(t){t.Im&&t.sy(),t.Im=this.LR,t.next=this.LR.next,t.Im.next=t,t.next&&(t.next.Im=t)}ev(){const t=this.LR.next;return t===this.LR?null:(t?.sy(),t)}head(){const t=this.LR.next;return t===this.LR?(this.cursor=null,null):(this.cursor=t?.next||null,t)}pm(){const t=this.LR.Im;return t===this.LR?(this.cursor=null,null):(this.cursor=t?.Im||null,t)}next(){const t=this.cursor;return t===this.LR?(this.cursor=null,null):(this.cursor=t?.next||null,t)}Im(){const t=this.cursor;return t===this.LR?(this.cursor=null,null):(this.cursor=t?.Im||null,t)}clear(){for(;;){const t=this.LR.next;if(t===this.LR)return;t?.sy()}}}},1982:(t,i,s)=>{s.d(i,{A:()=>h});class h{key;next;Im;constructor(){this.key=0n,this.next=this,this.Im=this}sy(){this.Im&&this.next&&(this.Im.next=this.next,this.next.Im=this.Im,this.next=null,this.Im=null)}}},2679:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(2512),e=s(7536);class n{RR;SR;history;available;constructor(t){this.RR=t,this.available=t,this.SR=new e.A(1024),this.history=new h.A}get(t){const i=this.SR.get(t);return i&&this.history.push(i),i}put(t,i){if(0===this.available){const t=this.history.pop();t?.sy(),t?.bR()}else this.available--;this.SR.put(t,i),this.history.push(i)}clear(){const t=this.history.pop();t?(t.sy(),t.bR()):this.available=this.RR}}},2512:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(4474);class e{head;constructor(){this.head=new h.A}push(t){t.OR&&t.bR(),t.OR=this.head.OR,t.TR=this.head,t.OR&&(t.OR.TR=t),t.TR.OR=t}pop(){const t=this.head.TR;return t===this.head?null:(t?.bR(),t)}}},8534:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(1069),e=s(3867);class n{static Ro=[];static ec=t=>{const i=new h.A(t.read('base_head.dat')),s=new h.A(t.read('base_type.dat')),r=new h.A(t.read('base_label.dat')),o=i.KA;i.Fc+=2;for(let t=0;t{s.d(i,{A:()=>n});var h=s(8534),e=s(1069);class n{static Ro=[];static ec=t=>{const i=new e.A(t.read('frame_head.dat')),s=new e.A(t.read('frame_tran1.dat')),r=new e.A(t.read('frame_tran2.dat')),o=new e.A(t.read('frame_del.dat')),l=i.KA;i.Fc+=2;const a=new Int32Array(500),c=new Int32Array(500),f=new Int32Array(500),u=new Int32Array(500);for(let t=0;t0){if(0!==d.types[t])for(let i=t-1;i>A;i--)if(0===d.types[i]){a[y]=i,c[y]=0,f[y]=0,u[y]=0,y++;break}a[y]=t;let s=0;3===d.types[a[y]]&&(s=128),c[y]=1&i?r.kR:s,f[y]=2&i?r.kR:s,u[y]=4&i?r.kR:s,A=t,y++}}e.length=y,e.xR=new Int32Array(y),e.x=new Int32Array(y),e.y=new Int32Array(y),e.z=new Int32Array(y);for(let t=0;t{s.d(i,{N_:()=>h,jo:()=>e,DR:()=>o,NR:()=>r,PR:()=>n});const h=document.getElementById('canvas'),e=h.getContext('2d',{willReadFrequently:!0}),n=document.createElement('canvas'),r=document.createElement('img'),o=n.getContext('2d',{willReadFrequently:!0})},9298:(t,i,s)=>{s.d(i,{A:()=>h});class h{static RED=16711680;static GREEN=65280;static BLUE=255;static Gl=16776960;static bc=65535;static vc=16711935;static _l=16777215;static Bl=0;static FR=16748608;static sd=8388608;static td=128;static UR=16756736;static BR=16740352;static GR=16723968;static HR=12648192;static WR=8453888;static YR=4259584;static yc=9179409;static Dd=6116423;static il=2301979;static sl=5063219;static el=7759444;static rl=3353893;static hd=8388736;static ed=13350793;static Uu=Int32Array.of(h.Gl,h.RED,h.GREEN,h.bc,h.vc,h._l);static lL=6798;static aL=107;static cL=10283;static fL=16;static uL=4797;static dL=7744;static wL=5799;static AL=4634;static yL=33697;static pL=22433;static mL=2983;static IL=54193;static _L=8741;static EL=12;static gL=64030;static CL=43162;static TL=7735;static OL=8404;static bL=1701;static vL=38430;static LL=24094;static RL=10153;static SL=56621;static ML=4783;static kL=1341;static xL=16578;static DL=35003;static NL=25239;static Xv=9104;static zv=10275;static jv=7595;static Zv=3610;static qv=7975;static $v=8526;static Jv=918;static Qv=38802;static tL=24466;static iL=10145;static sL=58654;static hL=5027;static eL=1457;static nL=16565;static rL=34991;static oL=25486;static PL=4626;static FL=11146;static UL=6439;static BL=12;static GL=4758;static HL=10270;static ZL=4574;static WL=4550;static YL=4537;static VL=5681;static KL=5673;static XL=5790;static zL=6806;static jL=8076}},8950:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(4474);class e extends h.A{static nc=new Int32Array;static lC=0;static aC=0;static top=0;static bottom=0;static left=0;static right=0;static gv=0;static VR=0;static KR=0;static bind=(t,i,s)=>{this.nc=t,this.lC=i,this.aC=s,this.yl(0,0,i,s)};static Gu=()=>{this.left=0,this.top=0,this.right=this.lC,this.bottom=this.aC,this.gv=this.right-1,this.VR=this.right/2|0};static yl=(t,i,s,h)=>{t<0&&(t=0),i<0&&(i=0),s>this.lC&&(s=this.lC),h>this.aC&&(h=this.aC),this.top=i,this.bottom=h,this.left=t,this.right=s,this.gv=this.right-1,this.VR=this.right/2|0,this.KR=this.bottom/2|0};static clear=()=>{const t=this.lC*this.aC;for(let i=0;i{this.nl(t,i,e,s),this.nl(t,i+h-1,e,s),this.hl(t,i,e,h),this.hl(t+s-1,i,e,h)};static nl=(t,i,s,h)=>{if(i=this.bottom)return;tthis.right&&(h=this.right-t);const e=t+i*this.lC;for(let t=0;t{if(t=this.right)return;ithis.bottom&&(h=this.bottom-i);const e=t+i*this.lC;for(let t=0;t{const n=Math.abs(s-t),r=Math.abs(h-i),o=t=this.left&&t=this.top&&i-r&&(a-=r,t+=o),s{tthis.right&&(s=this.right-t),i+h>this.bottom&&(h=this.bottom-i);const n=this.lC-s;let r=t+i*this.lC;for(let t=-h;t<0;t++){for(let t=-s;t<0;t++)this.nc[r++]=e;r+=n}};static XR(t,i,s,h,e,n){tthis.right&&(s=this.right-t),i+h>this.bottom&&(h=this.bottom-i);const r=256-n,o=(e>>16&255)*n,l=(e>>8&255)*n,a=(255&e)*n,c=this.lC-s;let f=t+i*this.lC;for(let t=0;t>16&255)*r>>8<<16)+(l+(this.nc[f]>>8&255)*r>>8<<8)+(a+(255&this.nc[f])*r>>8);this.nc[f++]=t}f+=c}}static zR(t,i,s,h,e){const n=256-e,r=(h>>16&255)*e,o=(h>>8&255)*e,l=(255&h)*e;let a=i-s;a<0&&(a=0);let c=i+s;c>=this.aC&&(c=this.aC-1);for(let h=a;h<=c;h++){const e=h-i,a=0|Math.sqrt(s*s-e*e);let c=t-a;c<0&&(c=0);let f=t+a;f>=this.lC&&(f=this.lC-1);let u=c+h*this.lC;for(let t=c;t<=f;t++){const t=(r+(this.nc[u]>>16&255)*n>>8<<16)+(o+(this.nc[u]>>8&255)*n>>8<<8)+(l+(255&this.nc[u])*n>>8);this.nc[u++]=t}}}static jR=(t,i,s)=>{t=this.right||i=this.bottom||(this.nc[t+i*this.lC]=s)}}},4583:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(8950),e=s(1673),n=s(3867);class r extends h.A{static st=!1;static ZR=new Int32Array(512);static qR=new Int32Array(2048);static sin=new Int32Array(2048);static cos=new Int32Array(2048);static palette=new Int32Array(65536);static c_=new n.ds(50,null);static $R=0;static oc=new Int32Array;static na=0;static ra=0;static cC=!0;static Ev=!1;static alpha=0;static JR=null;static QR=new n.ds(50,null);static tS=0;static Vf=0;static a_=new Int32Array(50);static iS=new n.ds(50,null);static sS=!1;static hS=new n.ds(50,!1);static eS=new Int32Array(50);static{for(let t=1;t<512;t++)this.ZR[t]=32768/t|0;for(let t=1;t<2048;t++)this.qR[t]=65536/t|0;for(let t=0;t<2048;t++)this.sin[t]=65536*Math.sin(.0030679615757712823*t)|0,this.cos[t]=65536*Math.cos(.0030679615757712823*t)|0}static bo=()=>{this.ZR=null,this.ZR=null,this.sin=null,this.cos=null,this.oc=null,this.c_=null,this.hS=null,this.eS=null,this.JR=null,this.QR=null,this.a_=null,this.palette=null,this.iS=null,console.log('Draw3D unloaded!')};static P_=()=>{this.oc=new Int32Array(this.aC);for(let t=0;t{this.oc=new Int32Array(i);for(let s=0;s{this.JR=null,this.QR.fill(null)};static ic=t=>{this.$R=0;for(let i=0;i<50;i++)try{this.c_[i]=e.A.za(t,i.toString()),this.st&&128===this.c_[i]?.Pl?this.c_[i]?.nS():this.c_[i]?.AC(),this.$R++}catch(t){}};static tO=t=>{if(0!==this.eS[t])return this.eS[t];const i=this.iS[t];if(!i)return 0;let s=0,h=0,e=0;const n=i.length;for(let t=0;t>16&255,h+=i[t]>>8&255,e+=255&i[t];let r=(s/n<<16)+(h/n<<8)+(e/n|0);return r=this.rS(r,1.4),0===r&&(r=1),this.eS[t]=r,r};static sc=t=>{const i=t+.03*Math.random()-.015;let s=0;for(let t=0;t<512;t++){const h=(t/8|0)/64+.0078125,e=(7&t)/8+.0625;for(let t=0;t<128;t++){const n=t/128;let r=n,o=n,l=n;if(0!==e){let t;t=n<.5?n*(e+1):n+e-n*e;const i=2*n-t;let s=h+.3333333333333333;s>1&&s--;let a=h-.3333333333333333;a<0&&a++,r=6*s<1?i+6*(t-i)*s:2*s<1?t:3*s<2?i+(t-i)*(.6666666666666666-s)*6:i,o=6*h<1?i+6*(t-i)*h:2*h<1?t:3*h<2?i+(t-i)*(.6666666666666666-h)*6:i,l=6*a<1?i+6*(t-i)*a:2*a<1?t:3*a<2?i+(t-i)*(.6666666666666666-a)*6:i}const a=((256*r|0)<<16)+((256*o|0)<<8)+(256*l|0);this.palette[s++]=this.rS(a,i)}}for(let t=0;t<50;t++){const s=this.c_[t];if(!s)continue;const h=s.palette;this.iS[t]=new Int32Array(h.length);for(let s=0;s{const s=(t>>16)/256,h=(t>>8&255)/256,e=(255&t)/256;return((256*Math.pow(s,i)|0)<<16)+((256*Math.pow(h,i)|0)<<8)+(256*Math.pow(e,i)|0)};static hc=t=>{this.JR||(this.tS=t,this.st?this.JR=new n.Kn(t,16384):this.JR=new n.Kn(t,65536),this.QR.fill(null))};static bv=(t,i,s,h,e,n,r,o,l)=>{let a=0,c=0;e!==h&&(a=(i-t<<16)/(e-h)|0,c=(o-r<<15)/(e-h)|0);let f=0,u=0;n!==e&&(f=(s-i<<16)/(n-e)|0,u=(l-o<<15)/(n-e)|0);let d=0,w=0;if(n!==h&&(d=(t-s<<16)/(h-n)|0,w=(r-l<<15)/(h-n)|0),h<=e&&h<=n){if(hthis.bottom&&(e=this.bottom),n>this.bottom&&(n=this.bottom),ef)for(n-=e,e-=h,h=this.oc[h];;){if(--e<0)for(;;){if(--n<0)return;this.oS(s>>16,i>>16,l>>7,o>>7,this.nc,h,0),s+=d,i+=f,l+=w,o+=u,h+=this.lC}this.oS(s>>16,t>>16,l>>7,r>>7,this.nc,h,0),s+=d,t+=a,l+=w,r+=c,h+=this.lC}else for(n-=e,e-=h,h=this.oc[h];;){if(--e<0)for(;;){if(--n<0)return;this.oS(i>>16,s>>16,o>>7,l>>7,this.nc,h,0),s+=d,i+=f,l+=w,o+=u,h+=this.lC}this.oS(t>>16,s>>16,r>>7,l>>7,this.nc,h,0),s+=d,t+=a,l+=w,r+=c,h+=this.lC}else if(i=t<<=16,o=r<<=15,h<0&&(i-=d*h,t-=a*h,o-=w*h,r-=c*h,h=0),s<<=16,l<<=15,n<0&&(s-=f*n,l-=u*n,n=0),h!==n&&da)for(e-=n,n-=h,h=this.oc[h];;){if(--n<0)for(;;){if(--e<0)return;this.oS(s>>16,t>>16,l>>7,r>>7,this.nc,h,0),s+=f,t+=a,l+=u,r+=c,h+=this.lC}this.oS(i>>16,t>>16,o>>7,r>>7,this.nc,h,0),i+=d,t+=a,o+=w,r+=c,h+=this.lC}else for(e-=n,n-=h,h=this.oc[h];;){if(--n<0)for(;;){if(--e<0)return;this.oS(t>>16,s>>16,r>>7,l>>7,this.nc,h,0),s+=f,t+=a,l+=u,r+=c,h+=this.lC}this.oS(t>>16,i>>16,r>>7,o>>7,this.nc,h,0),i+=d,t+=a,o+=w,r+=c,h+=this.lC}}else if(e<=n){if(ethis.bottom&&(n=this.bottom),h>this.bottom&&(h=this.bottom),nd)for(h-=n,n-=e,e=this.oc[e];;){if(--n<0)for(;;){if(--h<0)return;this.oS(t>>16,s>>16,r>>7,l>>7,this.nc,e,0),t+=a,s+=d,r+=c,l+=w,e+=this.lC}this.oS(t>>16,i>>16,r>>7,o>>7,this.nc,e,0),t+=a,i+=f,r+=c,o+=u,e+=this.lC}else for(h-=n,n-=e,e=this.oc[e];;){if(--n<0)for(;;){if(--h<0)return;this.oS(s>>16,t>>16,l>>7,r>>7,this.nc,e,0),t+=a,s+=d,r+=c,l+=w,e+=this.lC}this.oS(i>>16,t>>16,o>>7,r>>7,this.nc,e,0),t+=a,i+=f,r+=c,o+=u,e+=this.lC}else if(s=i<<=16,l=o<<=15,e<0&&(s-=a*e,i-=f*e,l-=c*e,o-=u*e,e=0),t<<=16,r<<=15,h<0&&(t-=d*h,r-=w*h,h=0),n-=h,h-=e,e=this.oc[e],a>16,i>>16,r>>7,o>>7,this.nc,e,0),t+=d,i+=f,r+=w,o+=u,e+=this.lC}this.oS(s>>16,i>>16,l>>7,o>>7,this.nc,e,0),s+=a,i+=f,l+=c,o+=u,e+=this.lC}else for(;;){if(--h<0)for(;;){if(--n<0)return;this.oS(i>>16,t>>16,o>>7,r>>7,this.nc,e,0),t+=d,i+=f,r+=w,o+=u,e+=this.lC}this.oS(i>>16,s>>16,o>>7,l>>7,this.nc,e,0),s+=a,i+=f,l+=c,o+=u,e+=this.lC}}else if(nthis.bottom&&(h=this.bottom),e>this.bottom&&(e=this.bottom),h>16,t>>16,o>>7,r>>7,this.nc,n,0),i+=f,t+=a,o+=u,r+=c,n+=this.lC}this.oS(i>>16,s>>16,o>>7,l>>7,this.nc,n,0),i+=f,s+=d,o+=u,l+=w,n+=this.lC}else for(;;){if(--h<0)for(;;){if(--e<0)return;this.oS(t>>16,i>>16,r>>7,o>>7,this.nc,n,0),i+=f,t+=a,o+=u,r+=c,n+=this.lC}this.oS(s>>16,i>>16,l>>7,o>>7,this.nc,n,0),i+=f,s+=d,o+=u,l+=w,n+=this.lC}else if(t=s<<=16,r=l<<=15,n<0&&(t-=f*n,s-=d*n,r-=u*n,l-=w*n,n=0),i<<=16,o<<=15,e<0&&(i-=a*e,o-=c*e,e=0),h-=e,e-=n,n=this.oc[n],f>16,s>>16,o>>7,l>>7,this.nc,n,0),i+=a,s+=d,o+=c,l+=w,n+=this.lC}this.oS(t>>16,s>>16,r>>7,l>>7,this.nc,n,0),t+=f,s+=d,r+=u,l+=w,n+=this.lC}else for(;;){if(--e<0)for(;;){if(--h<0)return;this.oS(s>>16,i>>16,l>>7,o>>7,this.nc,n,0),i+=a,s+=d,o+=c,l+=w,n+=this.lC}this.oS(s>>16,t>>16,l>>7,r>>7,this.nc,n,0),t+=f,s+=d,r+=u,l+=w,n+=this.lC}};static oS=(t,i,s,h,e,n,r)=>{let o;if(this.cC){let l;if(this.Ev){if(l=i-t>3?(h-s)/(i-t)|0:0,i>this.gv&&(i=this.gv),t<0&&(s-=t*l,t=0),t>=i)return;n+=t,r=i-t>>2,l<<=2}else{if(!(t>2)>0?(h-s)*this.ZR[r]>>15:0}if(0===this.alpha)for(;;){if(--r<0){if((r=i-t&3)>0){o=this.palette[s>>8];do{e[n++]=o,r--}while(r>0);return}break}o=this.palette[s>>8],s+=l,e[n++]=o,e[n++]=o,e[n++]=o,e[n++]=o}else{const h=this.alpha,a=256-this.alpha;for(;;){if(--r<0){if((r=i-t&3)>0){o=this.palette[s>>8],o=((16711935&o)*a>>8&16711935)+((65280&o)*a>>8&65280);do{e[n++]=o+((16711935&e[n])*h>>8&16711935)+((65280&e[n])*h>>8&65280),r--}while(r>0)}break}o=this.palette[s>>8],s+=l,o=((16711935&o)*a>>8&16711935)+((65280&o)*a>>8&65280),e[n++]=o+((16711935&e[n])*h>>8&16711935)+((65280&e[n])*h>>8&65280),e[n++]=o+((16711935&e[n])*h>>8&16711935)+((65280&e[n])*h>>8&65280),e[n++]=o+((16711935&e[n])*h>>8&16711935)+((65280&e[n])*h>>8&65280),e[n++]=o+((16711935&e[n])*h>>8&16711935)+((65280&e[n])*h>>8&65280)}}}else if(tthis.gv&&(i=this.gv),t<0&&(s-=t*l,t=0),t>=i))return;if(n+=t,r=i-t,0===this.alpha)do{e[n++]=this.palette[s>>8],s+=l,r--}while(r>0);else{const t=this.alpha,i=256-this.alpha;do{o=this.palette[s>>8],s+=l,o=((16711935&o)*i>>8&16711935)+((65280&o)*i>>8&65280),e[n++]=o+((16711935&e[n])*t>>8&16711935)+((65280&e[n])*t>>8&65280),r--}while(r>0)}}};static lS=(t,i,s,h,e,n,r)=>{let o=0;e!==h&&(o=(i-t<<16)/(e-h)|0);let l=0;n!==e&&(l=(s-i<<16)/(n-e)|0);let a=0;if(n!==h&&(a=(t-s<<16)/(h-n)|0),h<=e&&h<=n){if(hthis.bottom&&(e=this.bottom),n>this.bottom&&(n=this.bottom),el)for(n-=e,e-=h,h=this.oc[h];;){if(--e<0)for(;;){if(--n<0)return;this.aS(s>>16,i>>16,this.nc,h,r),s+=a,i+=l,h+=this.lC}this.aS(s>>16,t>>16,this.nc,h,r),s+=a,t+=o,h+=this.lC}else for(n-=e,e-=h,h=this.oc[h];;){if(--e<0)for(;;){if(--n<0)return;this.aS(i>>16,s>>16,this.nc,h,r),s+=a,i+=l,h+=this.lC}this.aS(t>>16,s>>16,this.nc,h,r),s+=a,t+=o,h+=this.lC}else if(i=t<<=16,h<0&&(i-=a*h,t-=o*h,h=0),s<<=16,n<0&&(s-=l*n,n=0),h!==n&&ao)for(e-=n,n-=h,h=this.oc[h];;){if(--n<0)for(;;){if(--e<0)return;this.aS(s>>16,t>>16,this.nc,h,r),s+=l,t+=o,h+=this.lC}this.aS(i>>16,t>>16,this.nc,h,r),i+=a,t+=o,h+=this.lC}else for(e-=n,n-=h,h=this.oc[h];;){if(--n<0)for(;;){if(--e<0)return;this.aS(t>>16,s>>16,this.nc,h,r),s+=l,t+=o,h+=this.lC}this.aS(t>>16,i>>16,this.nc,h,r),i+=a,t+=o,h+=this.lC}}else if(e<=n){if(ethis.bottom&&(n=this.bottom),h>this.bottom&&(h=this.bottom),na)for(h-=n,n-=e,e=this.oc[e];;){if(--n<0)for(;;){if(--h<0)return;this.aS(t>>16,s>>16,this.nc,e,r),t+=o,s+=a,e+=this.lC}this.aS(t>>16,i>>16,this.nc,e,r),t+=o,i+=l,e+=this.lC}else for(h-=n,n-=e,e=this.oc[e];;){if(--n<0)for(;;){if(--h<0)return;this.aS(s>>16,t>>16,this.nc,e,r),t+=o,s+=a,e+=this.lC}this.aS(i>>16,t>>16,this.nc,e,r),t+=o,i+=l,e+=this.lC}else if(s=i<<=16,e<0&&(s-=o*e,i-=l*e,e=0),t<<=16,h<0&&(t-=a*h,h=0),o>16,i>>16,this.nc,e,r),t+=a,i+=l,e+=this.lC}this.aS(s>>16,i>>16,this.nc,e,r),s+=o,i+=l,e+=this.lC}else for(n-=h,h-=e,e=this.oc[e];;){if(--h<0)for(;;){if(--n<0)return;this.aS(i>>16,t>>16,this.nc,e,r),t+=a,i+=l,e+=this.lC}this.aS(i>>16,s>>16,this.nc,e,r),s+=o,i+=l,e+=this.lC}}else if(nthis.bottom&&(h=this.bottom),e>this.bottom&&(e=this.bottom),h>16,t>>16,this.nc,n,r),i+=l,t+=o,n+=this.lC}this.aS(i>>16,s>>16,this.nc,n,r),i+=l,s+=a,n+=this.lC}else for(e-=h,h-=n,n=this.oc[n];;){if(--h<0)for(;;){if(--e<0)return;this.aS(t>>16,i>>16,this.nc,n,r),i+=l,t+=o,n+=this.lC}this.aS(s>>16,i>>16,this.nc,n,r),i+=l,s+=a,n+=this.lC}else if(t=s<<=16,n<0&&(t-=l*n,s-=a*n,n=0),i<<=16,e<0&&(i-=o*e,e=0),l>16,s>>16,this.nc,n,r),i+=o,s+=a,n+=this.lC}this.aS(t>>16,s>>16,this.nc,n,r),t+=l,s+=a,n+=this.lC}else for(h-=e,e-=n,n=this.oc[n];;){if(--e<0)for(;;){if(--h<0)return;this.aS(s>>16,i>>16,this.nc,n,r),i+=o,s+=a,n+=this.lC}this.aS(s>>16,t>>16,this.nc,n,r),t+=l,s+=a,n+=this.lC}};static Sv=(t,i,s,h,e,n,r,o,l,a,c,f,u,d,w,A,y,p,m)=>{const I=this.cS(m);this.sS=!this.hS[m];const _=a-u,E=c-w,g=f-y,C=d-a,T=A-c,O=p-f;let b=C*c-T*a<<14;const v=T*f-O*c<<8,L=O*a-C*f<<5;let R=_*c-E*a<<14;const S=E*f-g*c<<8,M=g*a-_*f<<5;let k=E*C-_*T<<14;const x=g*T-E*O<<8,D=_*O-g*C<<5;let N=0,P=0;e!==h&&(N=(i-t<<16)/(e-h)|0,P=(o-r<<16)/(e-h)|0);let F=0,U=0;n!==e&&(F=(s-i<<16)/(n-e)|0,U=(l-o<<16)/(n-e)|0);let B=0,G=0;if(n!==h&&(B=(t-s<<16)/(h-n)|0,G=(r-l<<16)/(h-n)|0),h<=e&&h<=n){if(hthis.bottom&&(e=this.bottom),n>this.bottom&&(n=this.bottom),eF)for(n-=e,e-=h,h=this.oc[h];;){if(--e<0)for(;;){if(--n<0)return;this.fS(s>>16,i>>16,this.nc,h,I,0,0,b,R,k,v,S,x,l>>8,o>>8),s+=B,i+=F,l+=G,o+=U,h+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(s>>16,t>>16,this.nc,h,I,0,0,b,R,k,v,S,x,l>>8,r>>8),s+=B,t+=N,l+=G,r+=P,h+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}else for(n-=e,e-=h,h=this.oc[h];;){if(--e<0)for(;;){if(--n<0)return;this.fS(i>>16,s>>16,this.nc,h,I,0,0,b,R,k,v,S,x,o>>8,l>>8),s+=B,i+=F,l+=G,o+=U,h+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(t>>16,s>>16,this.nc,h,I,0,0,b,R,k,v,S,x,r>>8,l>>8),s+=B,t+=N,l+=G,r+=P,h+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}}else{i=t<<=16,o=r<<=16,h<0&&(i-=B*h,t-=N*h,o-=G*h,r-=P*h,h=0),s<<=16,l<<=16,n<0&&(s-=F*n,l-=U*n,n=0);const a=h-this.ra;if(b+=L*a,R+=M*a,k+=D*a,b|=0,R|=0,k|=0,(h===n||B>=N)&&(h!==n||F<=N))for(e-=n,n-=h,h=this.oc[h];;){if(--n<0)for(;;){if(--e<0)return;this.fS(t>>16,s>>16,this.nc,h,I,0,0,b,R,k,v,S,x,r>>8,l>>8),s+=F,t+=N,l+=U,r+=P,h+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(t>>16,i>>16,this.nc,h,I,0,0,b,R,k,v,S,x,r>>8,o>>8),i+=B,t+=N,o+=G,r+=P,h+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}else for(e-=n,n-=h,h=this.oc[h];;){if(--n<0)for(;;){if(--e<0)return;this.fS(s>>16,t>>16,this.nc,h,I,0,0,b,R,k,v,S,x,l>>8,r>>8),s+=F,t+=N,l+=U,r+=P,h+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(i>>16,t>>16,this.nc,h,I,0,0,b,R,k,v,S,x,o>>8,r>>8),i+=B,t+=N,o+=G,r+=P,h+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}}}else if(e<=n){if(ethis.bottom&&(n=this.bottom),h>this.bottom&&(h=this.bottom),nB)for(h-=n,n-=e,e=this.oc[e];;){if(--n<0)for(;;){if(--h<0)return;this.fS(t>>16,s>>16,this.nc,e,I,0,0,b,R,k,v,S,x,r>>8,l>>8),t+=N,s+=B,r+=P,l+=G,e+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(t>>16,i>>16,this.nc,e,I,0,0,b,R,k,v,S,x,r>>8,o>>8),t+=N,i+=F,r+=P,o+=U,e+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}else for(h-=n,n-=e,e=this.oc[e];;){if(--n<0)for(;;){if(--h<0)return;this.fS(s>>16,t>>16,this.nc,e,I,0,0,b,R,k,v,S,x,l>>8,r>>8),t+=N,s+=B,r+=P,l+=G,e+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(i>>16,t>>16,this.nc,e,I,0,0,b,R,k,v,S,x,o>>8,r>>8),t+=N,i+=F,r+=P,o+=U,e+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}}else{s=i<<=16,l=o<<=16,e<0&&(s-=N*e,i-=F*e,l-=P*e,o-=U*e,e=0),t<<=16,r<<=16,h<0&&(t-=B*h,r-=G*h,h=0);const a=e-this.ra;if(b+=L*a,R+=M*a,k+=D*a,b|=0,R|=0,k|=0,n-=h,h-=e,e=this.oc[e],N>16,i>>16,this.nc,e,I,0,0,b,R,k,v,S,x,r>>8,o>>8),t+=B,i+=F,r+=G,o+=U,e+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(s>>16,i>>16,this.nc,e,I,0,0,b,R,k,v,S,x,l>>8,o>>8),s+=N,i+=F,l+=P,o+=U,e+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}else for(;;){if(--h<0)for(;;){if(--n<0)return;this.fS(i>>16,t>>16,this.nc,e,I,0,0,b,R,k,v,S,x,o>>8,r>>8),t+=B,i+=F,r+=G,o+=U,e+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(i>>16,s>>16,this.nc,e,I,0,0,b,R,k,v,S,x,o>>8,l>>8),s+=N,i+=F,l+=P,o+=U,e+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}}}else if(nthis.bottom&&(h=this.bottom),e>this.bottom&&(e=this.bottom),h>16,t>>16,this.nc,n,I,0,0,b,R,k,v,S,x,o>>8,r>>8),i+=F,t+=N,o+=U,r+=P,n+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(i>>16,s>>16,this.nc,n,I,0,0,b,R,k,v,S,x,o>>8,l>>8),i+=F,s+=B,o+=U,l+=G,n+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}else for(;;){if(--h<0)for(;;){if(--e<0)return;this.fS(t>>16,i>>16,this.nc,n,I,0,0,b,R,k,v,S,x,r>>8,o>>8),i+=F,t+=N,o+=U,r+=P,n+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(s>>16,i>>16,this.nc,n,I,0,0,b,R,k,v,S,x,l>>8,o>>8),i+=F,s+=B,o+=U,l+=G,n+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}}else{t=s<<=16,r=l<<=16,n<0&&(t-=F*n,s-=B*n,r-=U*n,l-=G*n,n=0),i<<=16,o<<=16,e<0&&(i-=N*e,o-=P*e,e=0);const a=n-this.ra;if(b+=L*a,R+=M*a,k+=D*a,b|=0,R|=0,k|=0,h-=e,e-=n,n=this.oc[n],F>16,s>>16,this.nc,n,I,0,0,b,R,k,v,S,x,o>>8,l>>8),i+=N,s+=B,o+=P,l+=G,n+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(t>>16,s>>16,this.nc,n,I,0,0,b,R,k,v,S,x,r>>8,l>>8),t+=F,s+=B,r+=U,l+=G,n+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}else for(;;){if(--e<0)for(;;){if(--h<0)return;this.fS(s>>16,i>>16,this.nc,n,I,0,0,b,R,k,v,S,x,l>>8,o>>8),i+=N,s+=B,o+=P,l+=G,n+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(s>>16,t>>16,this.nc,n,I,0,0,b,R,k,v,S,x,l>>8,r>>8),t+=F,s+=B,r+=U,l+=G,n+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}}};static fS=(t,i,s,h,e,n,r,o,l,a,c,f,u,d,w)=>{if(t>=i)return;let A,y,p,m,I,_,E,g,C;if(this.Ev){if(A=(w-d)/(i-t)|0,i>this.gv&&(i=this.gv),t<0&&(d-=t*A,t=0),t>=i)return;y=i-t>>3,A<<=12}else i-t>7?(y=i-t>>3,A=(w-d)*this.ZR[y]>>6):(y=0,A=0);if(d<<=9,h+=t,this.st&&e)if(p=0,m=0,_=t-this.na,o+=(c>>3)*_,l+=(f>>3)*_,a+=(u>>3)*_,o|=0,l|=0,I=(a|=0)>>12,0!==I&&(r=l/I|0,(n=o/I|0)<0?n=0:n>4032&&(n=4032)),o+=c,l+=f,a+=u,o|=0,l|=0,I=(a|=0)>>12,0!==I&&(p=o/I|0,m=l/I|0,p<7?p=7:p>4032&&(p=4032)),E=p-n>>3,g=m-r>>3,n+=d>>3&786432,C=d>>23,this.sS){for(;y-- >0;)s[h++]=e[(4032&r)+(n>>6)]>>>C,n+=E,r+=g,s[h++]=e[(4032&r)+(n>>6)]>>>C,n+=E,r+=g,s[h++]=e[(4032&r)+(n>>6)]>>>C,n+=E,r+=g,s[h++]=e[(4032&r)+(n>>6)]>>>C,n+=E,r+=g,s[h++]=e[(4032&r)+(n>>6)]>>>C,n+=E,r+=g,s[h++]=e[(4032&r)+(n>>6)]>>>C,n+=E,r+=g,s[h++]=e[(4032&r)+(n>>6)]>>>C,n+=E,r+=g,s[h++]=e[(4032&r)+(n>>6)]>>>C,n=p,r=m,o+=c,l+=f,I=(a+=u)>>12,0!==I&&(p=o/I|0,m=l/I|0,p<7?p=7:p>4032&&(p=4032)),E=p-n>>3,g=m-r>>3,n+=(d+=A)>>3&786432,C=d>>23;for(y=i-t&7;y-- >0;)s[h++]=e[(4032&r)+(n>>6)]>>>C,n+=E,r+=g}else{for(;y-- >0;){let t;0!=(t=e[(4032&r)+(n>>6)]>>>C)&&(s[h]=t),h+=1,0!=(t=e[(4032&(r+=g))+((n+=E)>>6)]>>>C)&&(s[h]=t),h++,0!=(t=e[(4032&(r+=g))+((n+=E)>>6)]>>>C)&&(s[h]=t),h++,0!=(t=e[(4032&(r+=g))+((n+=E)>>6)]>>>C)&&(s[h]=t),h++,0!=(t=e[(4032&(r+=g))+((n+=E)>>6)]>>>C)&&(s[h]=t),h++,0!=(t=e[(4032&(r+=g))+((n+=E)>>6)]>>>C)&&(s[h]=t),h++,0!=(t=e[(4032&(r+=g))+((n+=E)>>6)]>>>C)&&(s[h]=t),h++,0!=(t=e[(4032&(r+=g))+((n+=E)>>6)]>>>C)&&(s[h]=t),h+=1,n=p,r=m,o+=c,l+=f,a+=u,o|=0,l|=0,I=(a|=0)>>12,0!==I&&(p=o/I|0,m=l/I|0,p<7?p=7:p>4032&&(p=4032)),E=p-n>>3,g=m-r>>3,n+=(d+=A)>>3&786432,C=d>>23}for(y=i-t&7;y-- >0;){let t;0!=(t=e[(4032&r)+(n>>6)]>>>C)&&(s[h]=t),h++,n+=E,r+=g}}else if(p=0,m=0,_=t-this.na,o+=(c>>3)*_,l+=(f>>3)*_,a+=(u>>3)*_,o|=0,l|=0,I=(a|=0)>>14,0!==I&&(r=l/I|0,(n=o/I|0)<0?n=0:n>16256&&(n=16256)),o+=c,l+=f,a+=u,o|=0,l|=0,I=(a|=0)>>14,0!==I&&(p=o/I|0,m=l/I|0,p<7?p=7:p>16256&&(p=16256)),E=p-n>>3,g=m-r>>3,n+=6291456&d,C=d>>23,this.sS&&e){for(;y-- >0;)s[h++]=e[(16256&r)+(n>>7)]>>>C,n+=E,r+=g,s[h++]=e[(16256&r)+(n>>7)]>>>C,n+=E,r+=g,s[h++]=e[(16256&r)+(n>>7)]>>>C,n+=E,r+=g,s[h++]=e[(16256&r)+(n>>7)]>>>C,n+=E,r+=g,s[h++]=e[(16256&r)+(n>>7)]>>>C,n+=E,r+=g,s[h++]=e[(16256&r)+(n>>7)]>>>C,n+=E,r+=g,s[h++]=e[(16256&r)+(n>>7)]>>>C,n+=E,r+=g,s[h++]=e[(16256&r)+(n>>7)]>>>C,n=p,r=m,o+=c,l+=f,a+=u,o|=0,l|=0,I=(a|=0)>>14,0!==I&&(p=o/I|0,m=l/I|0,p<7?p=7:p>16256&&(p=16256)),E=p-n>>3,g=m-r>>3,n+=6291456&(d+=A),C=d>>23;for(y=i-t&7;y-- >0;)s[h++]=e[(16256&r)+(n>>7)]>>>C,n+=E,r+=g}else{for(;y-- >0&&e;){let t;0!=(t=e[(16256&r)+(n>>7)]>>>C)&&(s[h]=t),h+=1,0!=(t=e[(16256&(r+=g))+((n+=E)>>7)]>>>C)&&(s[h]=t),h++,0!=(t=e[(16256&(r+=g))+((n+=E)>>7)]>>>C)&&(s[h]=t),h++,0!=(t=e[(16256&(r+=g))+((n+=E)>>7)]>>>C)&&(s[h]=t),h++,0!=(t=e[(16256&(r+=g))+((n+=E)>>7)]>>>C)&&(s[h]=t),h++,0!=(t=e[(16256&(r+=g))+((n+=E)>>7)]>>>C)&&(s[h]=t),h++,0!=(t=e[(16256&(r+=g))+((n+=E)>>7)]>>>C)&&(s[h]=t),h++,0!=(t=e[(16256&(r+=g))+((n+=E)>>7)]>>>C)&&(s[h]=t),h++,n=p,r=m,o+=c,l+=f,a+=u,o|=0,l|=0,I=(a|=0)>>14,0!==I&&(p=o/I|0,m=l/I|0,p<7?p=7:p>16256&&(p=16256)),E=p-n>>3,g=m-r>>3,n+=6291456&(d+=A),C=d>>23}for(y=i-t&7;y-- >0&&e;){let t;0!=(t=e[(16256&r)+(n>>7)]>>>C)&&(s[h]=t),h++,n+=E,r+=g}}};static aS=(t,i,s,h,e)=>{if(this.Ev&&(i>this.gv&&(i=this.gv),t<0&&(t=0)),t>=i)return;h+=t;let n=i-t>>2;if(0===this.alpha)for(;;){if(n--,n<0)for(n=i-t&3;;){if(n--,n<0)return;s[h++]=e}s[h++]=e,s[h++]=e,s[h++]=e,s[h++]=e}const r=this.alpha,o=256-this.alpha;for(e=((16711935&e)*o>>8&16711935)+((65280&e)*o>>8&65280);;){if(n--,n<0)for(n=i-t&3;;){if(n--,n<0)return;s[h++]=e+((16711935&s[h])*r>>8&16711935)+((65280&s[h])*r>>8&65280)}s[h++]=e+((16711935&s[h])*r>>8&16711935)+((65280&s[h])*r>>8&65280),s[h++]=e+((16711935&s[h])*r>>8&16711935)+((65280&s[h])*r>>8&65280),s[h++]=e+((16711935&s[h])*r>>8&16711935)+((65280&s[h])*r>>8&65280),s[h++]=e+((16711935&s[h])*r>>8&16711935)+((65280&s[h])*r>>8&65280)}};static f_=t=>{this.QR[t]&&this.JR&&(this.JR[this.tS++]=this.QR[t],this.QR[t]=null)};static cS=t=>{if(this.a_[t]=this.Vf++,this.QR[t])return this.QR[t];let i;if(this.tS>0&&this.JR)i=this.JR[--this.tS],this.JR[this.tS]=null;else{let t=0,s=-1;for(let i=0;i>>3)&16316671,i[e+8192]=n-(n>>>2)&16316671,i[e+12288]=n-(n>>>2)-(n>>>3)&16316671}}else{if(64===s.width)for(let t=0;t<128;t++)for(let e=0;e<128;e++)i[e+(t<<7)]=h[s.nc[(e>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)i[t]=h[s.nc[t]];this.hS[t]=!1;for(let s=0;s<16384;s++){i[s]&=16316671;const h=i[s];0===h&&(this.hS[t]=!0),i[s+16384]=h-(h>>>3)&16316671,i[s+32768]=h-(h>>>2)&16316671,i[s+49152]=h-(h>>>2)-(h>>>3)&16316671}}return i}}},880:(t,i,s)=>{s.d(i,{r:()=>e});var h=s(7854);const e=async t=>{255!==t[0]&&(t[0]=255),URL.revokeObjectURL(h.NR.src),h.NR.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>h.NR.onload=()=>t())),h.DR.clearRect(0,0,h.PR.width,h.PR.height);const i=h.NR.naturalWidth,s=h.NR.naturalHeight;return h.PR.width=i,h.PR.height=s,h.DR.drawImage(h.NR,0,0),h.DR.getImageData(0,0,i,s)}},8665:(t,i,s)=>{s.d(i,{A:()=>f});var h=s(1069),e=s(8950),n=s(4583),r=s(6730),o=s(4474),l=s(3867);class a{Bg=0;Gb=0;uS=0;dS=-1;wS=-1;AS=-1;yS=-1;pS=-1;mS=-1;IS=-1;_S=-1;ES=-1;gS=0;CS=-1;TS=-1;OS=-1;data=null}class c{x=0;y=0;z=0;w=0}class f extends o.A{static metadata=null;static head=null;static bS=null;static vS=null;static LS=null;static RS=null;static SS=null;static MS=null;static kS=null;static xS=null;static DS=null;static NS=null;static PS=null;static FS=null;static axis=null;static US=new l.ds(4096,!1);static BS=new l.ds(4096,!1);static GS=new Int32Array(4096);static HS=new Int32Array(4096);static WS=new Int32Array(4096);static YS=new Int32Array(4096);static VS=new Int32Array(4096);static KS=new Int32Array(4096);static XS=new Int32Array(1500);static zS=new l.Kn(1500,512);static jS=new Int32Array(12);static ZS=new l.Kn(12,2e3);static qS=new Int32Array(2e3);static $S=new Int32Array(2e3);static JS=new Int32Array(12);static QS=new Int32Array(10);static tM=new Int32Array(10);static iM=new Int32Array(10);static _n=0;static sM=0;static En=0;static Kf=!1;static xl=0;static Dl=0;static Xf=0;static dm=new Int32Array(1e3);static hM=!1;static ec(t){try{f.head=new h.A(t.read('ob_head.dat')),f.bS=new h.A(t.read('ob_face1.dat')),f.vS=new h.A(t.read('ob_face2.dat')),f.LS=new h.A(t.read('ob_face3.dat')),f.RS=new h.A(t.read('ob_face4.dat')),f.SS=new h.A(t.read('ob_face5.dat')),f.MS=new h.A(t.read('ob_point1.dat')),f.kS=new h.A(t.read('ob_point2.dat')),f.xS=new h.A(t.read('ob_point3.dat')),f.DS=new h.A(t.read('ob_point4.dat')),f.NS=new h.A(t.read('ob_point5.dat')),f.PS=new h.A(t.read('ob_vertex1.dat')),f.FS=new h.A(t.read('ob_vertex2.dat')),f.axis=new h.A(t.read('ob_axis.dat')),f.head.Fc=0,f.MS.Fc=0,f.kS.Fc=0,f.xS.Fc=0,f.DS.Fc=0,f.PS.Fc=0,f.FS.Fc=0;const i=f.head.KA;f.metadata=new l.ds(i+100,null);let s=0,e=0,n=0,r=0,o=0,c=0,u=0;for(let t=0;t>7)<2?i=2:i>126&&(i=126),(65408&t)+i):(i<0?i=0:i>127&&(i=127),127-i)}static Ug=(t,i,s)=>{const h=t.Bg,e=t.Gb,n=t.uS;let r,o,a,u,d;if(i){r=new Int32Array(h);for(let i=0;i{const e=t.Bg,n=t.Gb,r=t.uS;let o,l,a,c,u;if(h)o=t.Gg,l=t.Wg,a=t.Hg;else{o=new Int32Array(e),l=new Int32Array(e),a=new Int32Array(e);for(let i=0;i{const s=t.Bg,h=t.Gb,e=t.uS,n=new Int32Array(s),r=new Int32Array(s),o=new Int32Array(s);for(let i=0;i{let s=!1,h=!1,e=!1,n=!1,r=0,o=0,l=0,a=-1;for(let c=0;c{let s=!1,h=!1,e=!1,n=!1,r=0,o=0,l=0,a=-1;for(let c=0;c{let o=-1;const l=t.Gg[i],a=t.Wg[i],c=t.Hg[i];for(let t=0;t{if(!f.metadata)throw new Error('cant loading model metadata!!!!!');const i=f.metadata[t];if(!i)throw console.log(`Error model:${t} not found!`),new Error('cant loading model metadata!!!!!');if(!(f.head&&f.bS&&f.vS&&f.LS&&f.RS&&f.SS&&f.MS&&f.kS&&f.xS&&f.DS&&f.NS&&f.PS&&f.FS&&f.axis))throw new Error('cant loading model!!!!!');const s=i.Bg,h=i.Gb,e=i.uS,n=new Int32Array(s),r=new Int32Array(s),o=new Int32Array(s),l=new Int32Array(h),a=new Int32Array(h),c=new Int32Array(h),u=new Int32Array(e),d=new Int32Array(e),w=new Int32Array(e);let A=null;i.pS>=0&&(A=new Int32Array(s));let y=null;i.ES>=0&&(y=new Int32Array(h));let p=null,m=0;i.gS>=0?p=new Int32Array(h):m=-i.gS-1;let I=null;i.CS>=0&&(I=new Int32Array(h));let _=null;i.TS>=0&&(_=new Int32Array(h));const E=new Int32Array(h);f.MS.Fc=i.dS,f.kS.Fc=i.wS,f.xS.Fc=i.AS,f.DS.Fc=i.yS,f.NS.Fc=i.pS;let g,C,T,O=0,b=0,v=0;for(let t=0;t{if(!f.metadata||!f.metadata[i])throw new Error('No model metadata');const s=f.metadata[i];if(s.data=t,!s.data.length)throw new Error('No model data');const e=s.Bg,n=s.Gb,r=s.uS,o=new Int32Array(e),l=new Int32Array(e),a=new Int32Array(e),c=new Int32Array(n),u=new Int32Array(n),d=new Int32Array(n),w=new Int32Array(r),A=new Int32Array(r),y=new Int32Array(r);let p=null;s.pS>=0&&(p=new Int32Array(e));let m=null;s.ES>=0&&(m=new Int32Array(n));let I=null,_=0;s.gS>=0?I=new Int32Array(n):_=-s.gS-1;let E=null;s.CS>=0&&(E=new Int32Array(n));let g=null;s.TS>=0&&(g=new Int32Array(n));const C=new Int32Array(n),T=new h.A(s.data);T.Fc=s.dS;const O=new h.A(s.data);O.Fc=s.wS;const b=new h.A(s.data);b.Fc=s.AS;const v=new h.A(s.data);v.Fc=s.yS;const L=new h.A(s.data);L.Fc=s.pS;let R,S,M,k=0,x=0,D=0;for(let t=0;tthis.Zg&&(this.Zg=-s),s>this.Db&&(this.Db=s);const e=i*i+h*h;e>this.rO&&(this.rO=e)}this.rO=Math.sqrt(this.rO)+.99|0,this.AM=Math.sqrt(this.rO*this.rO+this.Zg*this.Zg)+.99|0,this.wM=this.AM+(Math.sqrt(this.rO*this.rO+this.Db*this.Db)+.99|0)}Yg(){this.Zg=0,this.Db=0;for(let t=0;tthis.Zg&&(this.Zg=-i),i>this.Db&&(this.Db=i)}this.AM=Math.sqrt(this.rO*this.rO+this.Zg*this.Zg)+.99|0,this.wM=this.AM+(Math.sqrt(this.rO*this.rO+this.Db*this.Db)+.99|0)}Ma(){if(this.yM){const t=new Int32Array(256);let i=0;for(let s=0;si&&(i=h)}this.Xg=new l.ds(i+1,null);for(let s=0;s<=i;s++)this.Xg[s]=new Int32Array(t[s]),t[s]=0;let s=0;for(;si&&(i=h)}this.Kg=new l.ds(i+1,null);for(let s=0;s<=i;s++)this.Kg[s]=new Int32Array(t[s]),t[s]=0;let s=0;for(;sl;)l=s[o++];n&&n.types&&h.x&&h.y&&h.z&&n.labels&&(i!==l||0===n.types[i])&&this.EM(h.x[t],h.y[t],h.z[t],n.labels[i],n.types[i])}f._n=0,f.sM=0,f.En=0,o=0,l=s[o++];for(let t=0;tl;)l=s[o++];n&&n.types&&e.x&&e.y&&e.z&&n.labels&&(i===l||0===n.types[i])&&this.EM(e.x[t],e.y[t],e.z[t],n.labels[i],n.types[i])}}else this.ka(t)}ka(t){if(!this.Xg||-1===t||!r.A.Ro[t])return;const i=r.A.Ro[t],s=i.MR;f._n=0,f.sM=0,f.En=0;for(let t=0;t>16;this.Hg[t]=this.Wg[t]*i+this.Hg[t]*s>>16,this.Wg[t]=h}}translate(t,i,s){for(let h=0;h>8;if(this.rM&&this.oM&&this.lM||(this.rM=new Int32Array(this.Gb),this.oM=new Int32Array(this.Gb),this.lM=new Int32Array(this.Gb)),!this.bb){this.bb=new l.ds(this.Bg,null);for(let t=0;t8192||p>8192||m>8192||y<-8192||p<-8192||m<-8192;)y>>=1,p>>=1,m>>=1;let I=0|Math.sqrt(y*y+p*p+m*m);if(I<=0&&(I=1),y=256*y/I|0,p=256*p/I|0,m=256*m/I|0,this.Bb&&1&this.Bb[i]){const n=t+((s*y+h*p+e*m)/(r+(r/2|0))|0);this.ZE&&(this.rM[i]=f.nM(this.ZE[i],n,this.Bb[i]))}else{let t=this.bb[n];t&&(t.x+=y,t.y+=p,t.z+=m,t.w++),t=this.bb[o],t&&(t.x+=y,t.y+=p,t.z+=m,t.w++),t=this.bb[l],t&&(t.x+=y,t.y+=p,t.z+=m,t.w++)}}if(n)this.Rb(t,r,s,h,e);else{this.xb=new l.ds(this.Bg,null);for(let t=0;t>16;for(let h=0;h>16,_=_*w-I*d>>16,I=m),0!==t&&(m=_*a-E*l>>16,E=_*l+E*a>>16,_=m),0!==i&&(m=E*c+I*u>>16,E=E*u-I*c>>16,I=m),I+=e,_+=r,E+=o,m=_*y-E*A>>16,E=_*A+E*y>>16,_=m,f.GS&&f.HS&&f.WS&&(f.WS[h]=E-p,f.GS[h]=n.A.na+((I<<9)/E|0),f.HS[h]=n.A.ra+((_<<9)/E|0)),this.uS>0&&f.YS&&f.VS&&f.KS&&(f.YS[h]=I,f.VS[h]=_,f.KS[h]=E)}try{this.CM(!1,!1,0)}catch(t){}}draw(t,i,s,h,r,o,l,a,c){const u=a*r-o*h>>16,d=l*i+u*s>>16,w=this.rO*s>>16,A=d+w;if(A<=50||d>=3500)return;const y=a*h+o*r>>16;let p=y-this.rO<<9;if((p/A|0)>=e.A.VR)return;let m=y+this.rO<<9;if((m/A|0)<=-e.A.VR)return;const I=l*s-u*i>>16,_=this.rO*i>>16;let E=I+_<<9;if((E/A|0)<=-e.A.KR)return;let g=I-(_+(this.Zg*s>>16))<<9;if((g/A|0)>=e.A.KR)return;let C=d-(w+(this.Zg*i>>16))<=50,T=!1;if(c>0&&f.Kf){let t=d-w;t<=50&&(t=50),y>0?(p=p/A|0,m=m/t|0):(m=m/A|0,p=p/t|0),I>0?(g=g/A|0,E=E/t|0):(E=E/A|0,g=g/t|0);const i=f.xl-n.A.na,s=f.Dl-n.A.ra;i>p&&ig&&s>16,w=w*L-c*v>>16,c=n),c+=o,u+=l,w+=a,n=w*h+c*r>>16,w=w*r-c*h>>16,c=n,n=u*s-w*i>>16,w=u*i+w*s>>16,u=n,f.WS&&(f.WS[e]=w-d),w>=50&&f.GS&&f.HS?(f.GS[e]=O+((c<<9)/w|0),f.HS[e]=b+((u<<9)/w|0)):f.GS&&(f.GS[e]=-5e3,C=!0),(C||this.uS>0)&&f.YS&&f.VS&&f.KS&&(f.YS[e]=c,f.VS[e]=u,f.KS[e]=w)}try{this.CM(C,T,c)}catch(t){}}CM(t,i,s,h=!1){f.hM&&(this.IM=-1,this._M=-1);for(let t=0;te.A.gv||a>e.A.gv||c>e.A.gv),f.zS&&f.XS){const t=((A+y+p)/3|0)+this.AM;f.zS[t][f.XS[t]++]=h,f.hM&&this.TM(f.xl,f.Dl,u,d,w,l,a,c)&&this._M=0;t--){const i=f.XS[t];if(!(i<=0)&&f.zS){const s=f.zS[t];for(let t=0;t=0;t--){const i=f.XS[t];if(i>0&&f.zS){const s=f.zS[t];for(let h=0;h0||f.jS[2]>0)&&(n=(f.JS[1]+f.JS[2])/(f.jS[1]+f.jS[2])|0);let r=0;f.jS&&f.JS&&(f.jS[3]>0||f.jS[4]>0)&&(r=(f.JS[3]+f.JS[4])/(f.jS[3]+f.jS[4])|0);let o=0;if(f.jS&&f.JS&&(f.jS[6]>0||f.jS[8]>0)&&(o=(f.JS[6]+f.JS[8])/(f.jS[6]+f.jS[8])|0),f.jS&&f.ZS){let t,i=0,s=f.jS[10],e=f.ZS[10],l=f.qS;i===s&&(i=0,s=f.jS[11],e=f.ZS[11],l=f.$S),t=in;)this.OM(e[i++],h),i===s&&e!==f.ZS[11]&&(i=0,s=f.jS[11],e=f.ZS[11],l=f.$S),t=ir;)this.OM(e[i++],h),i===s&&e!==f.ZS[11]&&(i=0,s=f.jS[11],e=f.ZS[11],l=f.$S),t=io;)this.OM(e[i++],h),i===s&&e!==f.ZS[11]&&(i=0,s=f.jS[11],e=f.ZS[11],l=f.$S),t=i>2,r=this.fM[i],o=this.uM[i],l=this.dM[i];n.A.Sv(f.GS[s],f.GS[h],f.GS[e],f.HS[s],f.HS[h],f.HS[e],this.rM[t],this.oM[t],this.lM[t],f.YS[r],f.VS[r],f.KS[r],f.YS[o],f.YS[l],f.VS[o],f.VS[l],f.KS[o],f.KS[l],this.ZE[t])}else if(3===r&&this.Bb&&this.ZE&&this.rM&&f.GS&&f.HS&&f.YS&&f.VS&&f.KS){const i=this.Bb[t]>>2,r=this.fM[i],o=this.uM[i],l=this.dM[i];n.A.Sv(f.GS[s],f.GS[h],f.GS[e],f.HS[s],f.HS[h],f.HS[e],this.rM[t],this.rM[t],this.rM[t],f.YS[r],f.VS[r],f.KS[r],f.YS[o],f.YS[l],f.VS[o],f.VS[l],f.KS[o],f.KS[l],this.ZE[t])}}bM(t,i=!1){let s=0;if(f.KS){const i=n.A.na,h=n.A.ra,e=this.Hb[t],r=this.Wb[t],o=this.Yb[t],l=f.KS[e],a=f.KS[r],c=f.KS[o];if(l>=50&&f.GS&&f.HS&&this.rM)f.QS[s]=f.GS[e],f.tM[s]=f.HS[e],f.iM[s++]=this.rM[t];else if(f.YS&&f.VS&&this.rM){const u=f.YS[e],d=f.VS[e],w=this.rM[t];if(c>=50&&this.lM){const e=(50-l)*n.A.qR[c-l];f.QS[s]=i+((u+((f.YS[o]-u)*e>>16)<<9)/50|0),f.tM[s]=h+((d+((f.VS[o]-d)*e>>16)<<9)/50|0),f.iM[s++]=w+((this.lM[t]-w)*e>>16)}if(a>=50&&this.oM){const e=(50-l)*n.A.qR[a-l];f.QS[s]=i+((u+((f.YS[r]-u)*e>>16)<<9)/50|0),f.tM[s]=h+((d+((f.VS[r]-d)*e>>16)<<9)/50|0),f.iM[s++]=w+((this.oM[t]-w)*e>>16)}}if(a>=50&&f.GS&&f.HS&&this.oM)f.QS[s]=f.GS[r],f.tM[s]=f.HS[r],f.iM[s++]=this.oM[t];else if(f.YS&&f.VS&&this.oM){const u=f.YS[r],d=f.VS[r],w=this.oM[t];if(l>=50&&this.rM){const r=(50-a)*n.A.qR[l-a];f.QS[s]=i+((u+((f.YS[e]-u)*r>>16)<<9)/50|0),f.tM[s]=h+((d+((f.VS[e]-d)*r>>16)<<9)/50|0),f.iM[s++]=w+((this.rM[t]-w)*r>>16)}if(c>=50&&this.lM){const e=(50-a)*n.A.qR[c-a];f.QS[s]=i+((u+((f.YS[o]-u)*e>>16)<<9)/50|0),f.tM[s]=h+((d+((f.VS[o]-d)*e>>16)<<9)/50|0),f.iM[s++]=w+((this.lM[t]-w)*e>>16)}}if(c>=50&&f.GS&&f.HS&&this.lM)f.QS[s]=f.GS[o],f.tM[s]=f.HS[o],f.iM[s++]=this.lM[t];else if(f.YS&&f.VS&&this.lM){const u=f.YS[o],d=f.VS[o],w=this.lM[t];if(a>=50&&this.oM){const e=(50-c)*n.A.qR[a-c];f.QS[s]=i+((u+((f.YS[r]-u)*e>>16)<<9)/50|0),f.tM[s]=h+((d+((f.VS[r]-d)*e>>16)<<9)/50|0),f.iM[s++]=w+((this.oM[t]-w)*e>>16)}if(l>=50&&this.rM){const r=(50-c)*n.A.qR[l-c];f.QS[s]=i+((u+((f.YS[e]-u)*r>>16)<<9)/50|0),f.tM[s]=h+((d+((f.VS[e]-d)*r>>16)<<9)/50|0),f.iM[s++]=w+((this.rM[t]-w)*r>>16)}}}const h=f.QS[0],r=f.QS[1],o=f.QS[2],l=f.tM[0],a=f.tM[1],c=f.tM[2];if(!((h-r)*(c-a)-(l-a)*(o-r)<=0))if(n.A.Ev=!1,3===s){let s;if((h<0||r<0||o<0||h>e.A.gv||r>e.A.gv||o>e.A.gv)&&(n.A.Ev=!0),s=this.Bb?3&this.Bb[t]:0,i)n.A.Zu(h,r,l,a,f.iM[0]),n.A.Zu(r,o,a,c,f.iM[1]),n.A.Zu(o,h,c,l,f.iM[2]);else if(0===s)n.A.bv(h,r,o,l,a,c,f.iM[0],f.iM[1],f.iM[2]);else if(1===s&&this.rM)n.A.lS(h,r,o,l,a,c,n.A.palette[this.rM[t]]);else if(2===s&&this.Bb&&this.ZE&&f.YS&&f.VS&&f.KS){const i=this.Bb[t]>>2,s=this.fM[i],e=this.uM[i],u=this.dM[i];n.A.Sv(h,r,o,l,a,c,f.iM[0],f.iM[1],f.iM[2],f.YS[s],f.VS[s],f.KS[s],f.YS[e],f.YS[u],f.VS[e],f.VS[u],f.KS[e],f.KS[u],this.ZE[t])}else if(3===s&&this.Bb&&this.ZE&&this.rM&&f.YS&&f.VS&&f.KS){const i=this.Bb[t]>>2,s=this.fM[i],e=this.uM[i],u=this.dM[i];n.A.Sv(h,r,o,l,a,c,this.rM[t],this.rM[t],this.rM[t],f.YS[s],f.VS[s],f.KS[s],f.YS[e],f.YS[u],f.VS[e],f.VS[u],f.KS[e],f.KS[u],this.ZE[t])}}else if(4===s){let s;if((h<0||r<0||o<0||h>e.A.gv||r>e.A.gv||o>e.A.gv||f.QS[3]<0||f.QS[3]>e.A.gv)&&(n.A.Ev=!0),s=this.Bb?3&this.Bb[t]:0,i)n.A.Zu(h,r,l,a,f.iM[0]),n.A.Zu(r,o,a,c,f.iM[1]),n.A.Zu(o,f.QS[3],c,f.tM[3],f.iM[2]),n.A.Zu(f.QS[3],h,f.tM[3],l,f.iM[3]);else if(0===s)n.A.bv(h,r,o,l,a,c,f.iM[0],f.iM[1],f.iM[2]),n.A.bv(h,o,f.QS[3],l,c,f.tM[3],f.iM[0],f.iM[2],f.iM[3]);else if(1===s){if(this.rM){const i=n.A.palette[this.rM[t]];n.A.lS(h,r,o,l,a,c,i),n.A.lS(h,o,f.QS[3],l,c,f.tM[3],i)}}else if(2===s&&this.Bb&&this.ZE&&f.YS&&f.VS&&f.KS){const i=this.Bb[t]>>2,s=this.fM[i],e=this.uM[i],u=this.dM[i];n.A.Sv(h,r,o,l,a,c,f.iM[0],f.iM[1],f.iM[2],f.YS[s],f.VS[s],f.KS[s],f.YS[e],f.YS[u],f.VS[e],f.VS[u],f.KS[e],f.KS[u],this.ZE[t]),n.A.Sv(h,o,f.QS[3],l,c,f.tM[3],f.iM[0],f.iM[2],f.iM[3],f.YS[s],f.VS[s],f.KS[s],f.YS[e],f.YS[u],f.VS[e],f.VS[u],f.KS[e],f.KS[u],this.ZE[t])}else if(3===s&&this.Bb&&this.ZE&&this.rM&&f.YS&&f.VS&&f.KS){const i=this.Bb[t]>>2,s=this.fM[i],e=this.uM[i],u=this.dM[i];n.A.Sv(h,r,o,l,a,c,this.rM[t],this.rM[t],this.rM[t],f.YS[s],f.VS[s],f.KS[s],f.YS[e],f.YS[u],f.VS[e],f.VS[u],f.KS[e],f.KS[u],this.ZE[t]),n.A.Sv(h,o,f.QS[3],l,c,f.tM[3],this.rM[t],this.rM[t],this.rM[t],f.YS[s],f.VS[s],f.KS[s],f.YS[e],f.YS[u],f.VS[e],f.VS[u],f.KS[e],f.KS[u],this.ZE[t])}}}EM(t,i,s,h,e){if(!h)return;const r=h.length;if(0===e){let e=0;f._n=0,f.sM=0,f.En=0;for(let t=0;t0?(f._n=(f._n/e|0)+t,f.sM=(f.sM/e|0)+i,f.En=(f.En/e|0)+s):(f._n=t,f.sM=i,f.En=s)}else if(1===e)for(let e=0;e=this.Xg.length)continue;const r=this.Xg[n];if(r)for(let h=0;h=this.Xg.length)continue;const o=this.Xg[r];if(o)for(let h=0;h>16;this.Wg[e]=this.Wg[e]*u-this.Gg[e]*c>>16,this.Gg[e]=t}if(0!==r){c=n.A.sin[r],u=n.A.cos[r];const t=this.Wg[e]*u-this.Hg[e]*c>>16;this.Hg[e]=this.Wg[e]*c+this.Hg[e]*u>>16,this.Wg[e]=t}if(0!==l){c=n.A.sin[l],u=n.A.cos[l];const t=this.Hg[e]*c+this.Gg[e]*u>>16;this.Hg[e]=this.Hg[e]*u-this.Gg[e]*c>>16,this.Gg[e]=t}this.Gg[e]+=f._n,this.Wg[e]+=f.sM,this.Hg[e]+=f.En}}else if(3===e)for(let e=0;e=this.Xg.length)continue;const r=this.Xg[n];if(r)for(let h=0;h=this.Kg.length)continue;const e=this.Kg[s];if(e)for(let i=0;i255&&(this.cM[s]=255)}}}gM(){this.Zg=0,this.rO=0,this.Db=0,this.Nb=999999,this.Pb=-999999,this.Ub=-99999,this.Fb=99999;for(let t=0;tthis.Pb&&(this.Pb=i),hthis.Ub&&(this.Ub=h),-s>this.Zg&&(this.Zg=-s),s>this.Db&&(this.Db=s);const e=i*i+h*h;e>this.rO&&(this.rO=e)}this.rO=0|Math.sqrt(this.rO),this.AM=0|Math.sqrt(this.rO*this.rO+this.Zg*this.Zg),this.wM=this.AM+(0|Math.sqrt(this.rO*this.rO+this.Db*this.Db))}TM(t,i,s,h,e,n,r,o){return!(is&&i>h&&i>e)&&(!(t{s.d(i,{A:()=>o});var h=s(8950),e=s(1069),n=s(4474),r=s(880);class o extends n.A{nc;width;height;Cc;Tc;Pl;fd;constructor(t,i){super(),this.nc=new Int32Array(t*i),this.width=this.Pl=t,this.height=this.fd=i,this.Cc=this.Tc=0}static Ec=async(t,i)=>{const s=t.read(i+'.dat');if(!s)throw new Error(`${i} jpeg not found!`);const h=await(0,r.r)(s),e=new o(h.width,h.height),n=new Uint32Array(h.data.buffer),l=e.nc;for(let t=0;t>24&255)<<24|(255&i)<<16|(i>>8&255)<<8|i>>16&255}return e};static za=(t,i,s=0)=>{const h=new e.A(t.read(i+'.dat')),n=new e.A(t.read('index.dat'));n.Fc=h.KA;const r=n.KA,l=n.KA,a=[],c=n.ZA-1;for(let t=0;th.length||n.Fc>n.length)throw new Error;const f=n.ZA,u=n.ZA,d=n.KA,w=n.KA,A=new o(d,w);A.Cc=f,A.Tc=u,A.Pl=r,A.fd=l;const y=n.ZA;if(0===y){const t=A.width*A.height;for(let i=0;ih.A.bottom&&(n-=i+n-h.A.bottom),th.A.right){const i=t+r-h.A.right;r-=i,l+=i,o+=i}r>0&&n>0&&this.LM(r,n,this.nc,e,l,h.A.nc,s,o)}Nl(t,i,s){i|=0,s|=0;let e=(i+=this.Cc)+(s+=this.Tc)*h.A.lC,n=0,r=this.height,o=this.width,l=h.A.lC-o,a=0;if(sh.A.bottom&&(r-=s+r-h.A.bottom),ih.A.right){const t=i+o-h.A.right;o-=t,a+=t,l+=t}o>0&&r>0&&this.RM(o,r,this.nc,n,a,h.A.nc,e,l,t)}tc(t,i){t|=0,i|=0;let s=(t+=this.Cc)+(i+=this.Tc)*h.A.lC,e=0,n=this.height,r=this.width,o=h.A.lC-r,l=0;if(ih.A.bottom&&(n-=i+n-h.A.bottom),th.A.right){const i=t+r-h.A.right;r-=i,l+=i,o+=i}r>0&&n>0&&this.SM(r,n,this.nc,e,l,h.A.nc,s,o)}Ja(){const t=this.nc,i=this.width,s=this.height;for(let h=0;h>16&255;n+=t,n<1?n=1:n>255&&(n=255);let r=e>>8&255;r+=i,r<1?r=1:r>255&&(r=255);let o=255&e;o+=s,o<1?o=1:o>255&&(o=255),this.nc[h]=(n<<16)+(r<<8)+o}}}AC(t,i,s,e){t|=0,i|=0,s|=0,e|=0;try{const n=this.width;let r=0,o=0;const l=this.Pl,a=this.fd,c=(l<<16)/s|0,f=(a<<16)/e|0;t+=(this.Cc*s+l-1)/l|0,i+=(this.Tc*e+a-1)/a|0,this.Cc*s%l!=0&&(r=(l-this.Cc*s%l<<16)/s|0),this.Tc*e%a!=0&&(o=(a-this.Tc*e%a<<16)/e|0),s=s*(this.width-(r>>16))/l|0,e=e*(this.height-(o>>16))/a|0;let u=t+i*h.A.lC,d=h.A.lC-s;if(ih.A.bottom&&(e-=i+e-h.A.bottom),th.A.right){const i=t+s-h.A.right;s-=i,d+=i}this.scale(s,e,this.nc,r,o,h.A.nc,d,u,n,c,f)}catch(t){console.error('error in sprite clipping routine')}}nd(t,i,s,e,n,r,o,l,a,c){t|=0,i|=0,s|=0,e|=0;try{const f=-s/2|0,u=-e/2|0,d=65536*Math.sin(a/326.11)|0,w=65536*Math.cos(a/326.11)|0,A=d*c>>8,y=w*c>>8;let p=(o<<16)+u*A+f*y,m=u*y-f*A+(l<<16),I=t+i*h.A.lC;for(let t=0;t>16)+(o>>16)*this.width],e+=y,o-=A;p+=A,m+=y,I+=h.A.lC}}catch(t){}}ad(t,i,s){t|=0,i|=0;let e=(t+=this.Cc)+(i+=this.Tc)*h.A.lC,n=0,r=this.height,o=this.width,l=h.A.lC-o,a=0;if(ih.A.bottom&&(r-=i+r-h.A.bottom),th.A.right){const i=t+o-h.A.right;o-=i,a+=i,l+=i}o>0&&r>0&&this.MM(o,r,this.nc,a,n,h.A.nc,e,l,s.nc)}scale(t,i,s,h,e,n,r,o,l,a,c){try{const f=h;for(let u=-i;u<0;u++){const i=(e>>16)*l;for(let e=-t;e<0;e++){const t=s[(h>>16)+i];0===t?o++:n[o++]=t,h+=a}e+=c,h=f,o+=r}}catch(t){console.error('error in plot_scale')}}SM(t,i,s,h,e,n,r,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++)n[r++]=s[h++],n[r++]=s[h++],n[r++]=s[h++],n[r++]=s[h++];for(let i=t;i<0;i++)n[r++]=s[h++];r+=o,h+=e}}RM(t,i,s,h,e,n,r,o,l){const a=256-l;for(let c=-i;c<0;c++){for(let i=-t;i<0;i++){const t=s[h++];if(0===t)r++;else{const i=n[r];n[r++]=((16711935&t)*l+(16711935&i)*a&4278255360)+((65280&t)*l+(65280&i)*a&16711680)>>8}}r+=o,h+=e}}LM(t,i,s,h,e,n,r,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=s[h++];0===t?r++:n[r++]=t,t=s[h++],0===t?r++:n[r++]=t,t=s[h++],0===t?r++:n[r++]=t,t=s[h++],0===t?r++:n[r++]=t}for(let i=t;i<0;i++){const t=s[h++];0===t?r++:n[r++]=t}r+=o,h+=e}}MM(t,i,s,h,e,n,r,o,l){const a=-(t>>2);t=-(3&t);for(let c=-i;c<0;c++){for(let t=a;t<0;t++){let t=s[e++];0!==t&&0===l[r]?n[r++]=t:r++,t=s[e++],0!==t&&0===l[r]?n[r++]=t:r++,t=s[e++],0!==t&&0===l[r]?n[r++]=t:r++,t=s[e++],0!==t&&0===l[r]?n[r++]=t:r++}for(let i=t;i<0;i++){const t=s[e++];0!==t&&0===l[r]?n[r++]=t:r++}r+=o,e+=h}}}},1673:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(8950),e=s(1069),n=s(4474);class r extends n.A{nc;width;height;Cc;Tc;Pl;fd;palette;constructor(t,i,s){super(),this.nc=new Int8Array(t*i),this.width=this.Pl=t,this.height=this.fd=i,this.Cc=this.Tc=0,this.palette=s}static za=(t,i,s=0)=>{const h=new e.A(t.read(i+'.dat')),n=new e.A(t.read('index.dat'));n.Fc=h.KA;const o=n.KA,l=n.KA,a=n.ZA,c=new Int32Array(a);for(let t=1;th.length||n.Fc>n.length)throw new Error;const f=n.ZA,u=n.ZA,d=n.KA,w=n.KA,A=new r(d,w,c);A.Cc=f,A.Tc=u,A.Pl=o,A.fd=l;const y=A.nc,p=n.ZA;if(0===p){const t=A.width*A.height;for(let i=0;ih.A.bottom&&(n-=i+n-h.A.bottom),th.A.right){const i=t+r-h.A.right;r-=i,l+=i,o+=i}r>0&&n>0&&this.kM(r,n,this.nc,e,l,h.A.nc,s,o)}Ja(){const t=this.nc,i=this.width,s=this.height;for(let h=0;h>16&255;e+=t,e<0?e=0:e>255&&(e=255);let n=this.palette[h]>>8&255;n+=i,n<0?n=0:n>255&&(n=255);let r=255&this.palette[h];r+=s,r<0?r=0:r>255&&(r=255),this.palette[h]=(e<<16)+(n<<8)+r}}nS(){this.Pl|=0,this.fd|=0,this.Pl/=2,this.fd/=2,this.Pl|=0,this.fd|=0;const t=new Int8Array(this.Pl*this.fd);let i=0;for(let s=0;s>1)+(s+this.Tc>>1)*this.Pl]=this.nc[i++];this.nc=t,this.width=this.Pl,this.height=this.fd,this.Cc=0,this.Tc=0}AC(){if(this.width===this.Pl&&this.height===this.fd)return;const t=new Int8Array(this.Pl*this.fd);let i=0;for(let s=0;s>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=s[h++];0===t?r++:n[r++]=this.palette[255&t],t=s[h++],0===t?r++:n[r++]=this.palette[255&t],t=s[h++],0===t?r++:n[r++]=this.palette[255&t],t=s[h++],0===t?r++:n[r++]=this.palette[255&t]}for(let i=t;i<0;i++){const t=s[h++];0===t?r++:n[r++]=this.palette[255&t]}r+=o,h+=e}}clip(t,i,s,e){try{const n=this.width;this.height;let r=0,o=0;const l=this.Pl,a=this.fd,c=(l<<16)/s|0,f=(a<<16)/e|0;t=t+(this.Cc*s+l-1)/l|0,i=i+(this.Tc*e+a-1)/a|0,this.Cc*s%l!=0&&(r=(l-this.Cc*s%l<<16)/s|0),this.Tc*e%a!=0&&(o=(a-this.Tc*e%a<<16)/e|0),s=s*(this.width-(r>>16))/l|0,e=e*(this.height-(o>>16))/a|0;let u,d=t+i*h.A.lC,w=h.A.lC-s;ih.A.bottom&&(e-=i+e-h.A.bottom),th.A.right&&(u=t+s-h.A.right,s-=u,w+=u),this.xM(h.A.nc,this.nc,this.palette,r,o,d,w,s,e,c,f,n)}catch(t){console.log('error in sprite clipping routine')}}xM(t,i,s,h,e,n,r,o,l,a,c,f){try{const u=h;for(let d=-l;d<0;d++){const l=(e>>16)*f;for(let e=-o;e<0;e++){const e=i[(h>>16)+l];0==e?n++:t[n++]=s[255&e],h+=a}e+=c,h=u,n+=r}}catch(t){console.log('error in plot_scale')}}}},2682:(t,i,s)=>{s.d(i,{A:()=>l});var h=s(8950),e=s(1069),n=s(4474);class r{seed;constructor(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}DM(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}YA(){return this.next(32)}next(t){return this.seed=0x5deece66dn*this.seed+0xbn&(1n<<48n)-1n,Number(this.seed)>>>48-t}}var o=s(9298);class l extends n.A{static xc='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!"£$%^&*()-_=+[{]};:\'@#~,<.>/?\\| ';static NM=[];static{const t=navigator.userAgent.includes('Capacitor');for(let i=0;i<256;i++){let s=l.xc.indexOf(String.fromCharCode(i));t&&s>=63&&s--,-1===s&&(s=74),l.NM[i]=s}}PM=[];FM=new Int32Array(94);UM=new Int32Array(94);BM=new Int32Array(94);GM=new Int32Array(94);HM=new Int32Array(95);WM=new Int32Array(256);random=new r(BigInt(Date.now()));height=0;static za=(t,i)=>{const s=new e.A(t.read(i+'.dat')),h=new e.A(t.read('index.dat'));h.Fc=s.KA+4;const n=h.ZA;n>0&&(h.Fc+=3*(n-1));const r=new l;for(let t=0;t<94;t++){r.BM[t]=h.ZA,r.GM[t]=h.ZA;const i=r.FM[t]=h.KA,e=r.UM[t]=h.KA,n=h.ZA,o=i*e;if(r.PM[t]=new Int8Array(o),0===n)for(let h=0;hr.height&&(r.height=e),r.BM[t]=1,r.HM[t]=i+2;{let s=0;for(let h=e/7|0;h=h.A.bottom&&(n-=s+n+1-h.A.bottom),i=h.A.right){const t=i+e+1-h.A.right;e-=t,a+=t,l+=t}e>0&&n>0&&this.XM(e,n,t,c,a,h.A.nc,o,l,r)}KM(t,i,s,e,n,r,o){s|=0,e|=0;let l=(t|=0)+(i|=0)*h.A.lC,a=h.A.lC-s,c=0,f=0;if(i=h.A.bottom&&(e-=i+e+1-h.A.bottom),t=h.A.right){const i=t+s+1-h.A.right;s-=i,c+=i,a+=i}s>0&&e>0&&this.zM(s,e,h.A.nc,l,a,o,f,c,n,r)}XM(t,i,s,h,e,n,r,o,l){const a=-((t|=0)>>2);t=-(3&t);for(let c=-(i|=0);c<0;c++){for(let t=a;t<0;t++)0===s[h++]?r++:n[r++]=l,0===s[h++]?r++:n[r++]=l,0===s[h++]?r++:n[r++]=l,0===s[h++]?r++:n[r++]=l;for(let i=t;i<0;i++)0===s[h++]?r++:n[r++]=l;r+=o,h+=e}}zM(t,i,s,h,e,n,r,o,l,a){t|=0;const c=((16711935&l)*a&4278255360)+((65280&l)*a&16711680)>>8,f=256-a;for(let l=-(i|=0);l<0;l++){for(let i=-t;i<0;i++)if(0===n[r++])h++;else{const t=s[h];s[h++]=(((16711935&t)*f&4278255360)+((65280&t)*f&16711680)>>8)+c}h+=e,r+=o}}VM(t){return'red'===t?o.A.RED:'gre'===t?o.A.GREEN:'blu'===t?o.A.BLUE:'yel'===t?o.A.Gl:'cya'===t?o.A.bc:'mag'===t?o.A.vc:'whi'===t?o.A._l:'bla'===t?o.A.Bl:'lre'===t?o.A.FR:'dre'===t?o.A.sd:'dbl'===t?o.A.td:'or1'===t?o.A.UR:'or2'===t?o.A.BR:'or3'===t?o.A.GR:'gr1'===t?o.A.HR:'gr2'===t?o.A.WR:'gr3'===t?o.A.YR:o.A.Bl}split(t,i){if(0===t.length)return[t];const s=[];for(;t.length>0;){if(this.au(t)<=i&&-1===t.indexOf('|')){s.push(t);break}let h=t.length;for(let s=0;si)break;h=s}else if('|'===t[s]){h=s;break}s.push(t.substring(0,h)),t=t.substring(h+1)}return s}}},1183:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(8950),e=s(7854);class n{jM;width;height;ZM;qM;nc;constructor(t,i,s=e.jo){this.ZM=s,this.jM=this.ZM.getImageData(0,0,t,i),this.qM=new Uint32Array(this.jM.data.buffer),this.nc=new Int32Array(t*i),this.width=t,this.height=i,this.bind()}clear(){this.nc.fill(0)}bind(){h.A.bind(this.nc,this.width,this.height)}draw(t,i){this.#t(),this.ZM.putImageData(this.jM,t,i)}#t(){const t=this.nc.length,i=this.nc,s=this.qM;for(let h=0;h>16&255|(t>>8&255)<<8|(255&t)<<16|4278190080}}}},3955:(t,i,s)=>{s.d(i,{A:()=>h});class h{static iy=150;static Tf=70;static bf=108;static Zc=81;static sf=189;static Mw=7;static Zd=88;static Kd=30;static Qd=176;static Hd=220;static Dw=66;static Tw=17;static lw=2;static Lw=238;static cA=233;static Gf=146;static cf=215;static Of=236;static jI=85;static pI=219;static dw=140;static pw=40;static yw=200;static ww=178;static Aw=247;static xw=138;static iw=239;static Jd=194;static jd=8;static qd=27;static $d=113;static tw=100;static fw=134;static ow=202;static hw=245;static mw=172;static Pw=96;static kw=97;static Nw=116;static uw=9;static Gd=75;static Fd=164;static aw=53;static cw=185;static Pd=206;static Vw=177;static Bw=248;static Xd=195;static zd=71;static Vd=133;static Wd=157;static Yd=211;static nw=48;static ew=130;static bw=31;static Sw=59;static Cw=212;static Rw=38;static Ow=6;static gw=155;static rw=235;static HA=231;static AA=237;static kf=175;static km=93;static eA=190;static Mm=165;static nf=159;static gA=171;static EA=79;static iA=52;static wA=244;static fA=148;static _A=11;static IA=118;static pA=4;static mA=158;static Sm=181}},3554:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(6666),e=s(1982);class n{$M;JM;QM;closed=!1;tk=!1;static Nc=async t=>await new Promise(((i,s)=>{const h=t.host.startsWith('https'),e=h?'wss':'ws',n=t.host.substring(t.host.indexOf('//')+2),r=h?t.port+2:t.port+1,o=new WebSocket(`${e}://${n}:${r}`,'binary');o.addEventListener('open',(()=>{console.log('connection open!'),i(o)})),o.addEventListener('error',(()=>{console.log('connection error!'),s(o)}))}));constructor(t){t.onclose=this.onclose,t.onerror=this.onerror,this.JM=new l(t,5e3),this.QM=new r(t,5e3),this.$M=t}get host(){return this.$M.url.split('/')[2]}get port(){return parseInt(this.$M.url.split(':')[2],10)}get available(){return this.closed?0:this.JM.available}write(t,i){this.QM.write(t,i)}async read(){return this.closed?0:this.JM.ik()??await this.JM.sk()}async Pc(t,i,s){if(!this.closed)for(;s>0;){const h=this.JM.hk(t,i,s)??await this.JM.ek(t,i,s);if(h.length<=0)throw new Error('EOF');i+=h.length,s-=h.length}}close(){this.closed=!0,this.$M.close(),this.JM.close(),this.QM.close(),console.log('connection close!'),this.tk&&console.log('connection error!')}onclose=t=>{this.closed||this.close()};onerror=t=>{this.closed||(this.tk=!0,this.close())}}class r{$M;nk;closed=!1;tk=!1;constructor(t,i){this.$M=t,this.nk=i}write(t,i){if(!this.closed){if(this.tk)throw this.tk=!1,new Error('Error in writer thread');if(i>this.nk||t.length>this.nk)throw new Error('buffer overflow');try{this.$M.send(t.subarray(0,i))}catch(t){this.tk=!0}}}close(){this.closed=!0}}class o extends e.A{Gm;position;constructor(t){super(),this.Gm=t,this.position=0}get available(){return this.Gm.length-this.position}get read(){return this.Gm[this.position++]}get rk(){return this.Gm.length}}class l{nk;queue=new h.A;event=null;lk=null;total=0;closed=!1;constructor(t,i){this.nk=i,t.binaryType='arraybuffer',t.onmessage=this.onmessage}get available(){return this.total}onmessage=t=>{if(this.closed)throw new Error('WebSocketReader is closed!');const i=new o(new Uint8Array(t.data));if(this.event?this.queue.n_(i):this.event=i,this.total+=i.rk,this.lk&&(this.lk(this.event),this.lk=null,this.total>this.nk))throw new Error('buffer overflow')};ak(){return this.event&&this.event.available>0?this.event.read:null}async ck(t){for(this.event=this.queue.ev();this.totalthis.lk=t));return this.event?this.event.read:this.ck(t)}hk(t,i,s){if(this.closed)throw new Error('WebSocketReader is closed!');if(!(this.event&&this.event.available>=s))return null;for(;s>0;){const h=this.ak();if(null===h)throw new Error('EOF - tried to read a fast byte when there was not enough immediate bytes.');t[i++]=h,this.total--,s--}return t}async ek(t,i,s){if(this.closed)throw new Error('WebSocketReader is closed!');for(;s>0;)t[i++]=this.ak()??await this.ck(s),this.total--,s--;return t}ik(){if(this.closed)throw new Error('WebSocketReader is closed!');const t=this.ak();return null===t?null:(this.total--,t)}async sk(){if(this.closed)throw new Error('WebSocketReader is closed!');const t=await this.ck(1);return this.total--,t}close(){this.closed=!0,this.lk=null,this.total=0,this.event=null,this.queue.clear()}}},4544:(t,i,s)=>{s.d(i,{A:()=>h});class h{db;constructor(t){t.onerror=this.onerror,t.onclose=this.onclose,this.db=t}static openDatabase=async()=>await new Promise(((t,i)=>{const s=indexedDB.open('lostcity',1);s.onsuccess=i=>{const s=i.target;console.log('database success!'),t(s.result)},s.onupgradeneeded=t=>{t.target.result.createObjectStore('cache')},s.onerror=t=>{const s=t.target;console.error('database error!: ',s.error),i(s.result)}}));Uo=async t=>await new Promise((i=>{const s=this.db.transaction('cache','readonly').objectStore('cache').get(t);s.onsuccess=()=>{i(s.result)},s.onerror=t=>{i(void 0)}}));Yo=async(t,i)=>await new Promise(((s,h)=>{const e=this.db.transaction('cache','readwrite').objectStore('cache').put(i,t);e.onsuccess=()=>{s()},e.onerror=t=>{h()}}));onclose=t=>{console.log('database close!')};onerror=t=>{console.log('database error!')};fk=t=>{const i=t.trim();let s=0;for(let t=0;t='A'&&h<='Z'?s+=h.charCodeAt(0)+1-65:h>='a'&&h<='z'?s+=h.charCodeAt(0)+1-97:h>='0'&&h<='9'&&(s+=h.charCodeAt(0)+27-48)}return s}}},2634:(t,i,s)=>{s.d(i,{A:()=>h});class h{count=0;uk=new Int32Array(256);dk=new Int32Array(256);a=0;b=0;c=0;constructor(t){for(let i=0;i>>2,e+=i,s+=h,s^=h<<8,n+=s,h+=e,h^=e>>>16,r+=h,e+=n,e^=n<<10,o+=e,n+=r,n^=r>>>4,t+=n,r+=o,r^=o<<8,i+=r,o+=t,o^=t>>>9,s+=o,t+=i;for(let l=0;l<256;l+=8)t+=this.uk[l],i+=this.uk[l+1],s+=this.uk[l+2],h+=this.uk[l+3],e+=this.uk[l+4],n+=this.uk[l+5],r+=this.uk[l+6],o+=this.uk[l+7],t^=i<<11,h+=t,i+=s,i^=s>>>2,e+=i,s+=h,s^=h<<8,n+=s,h+=e,h^=e>>>16,r+=h,e+=n,e^=n<<10,o+=e,n+=r,n^=r>>>4,t+=n,r+=o,r^=o<<8,i+=r,o+=t,o^=t>>>9,s+=o,t+=i,this.dk[l]=t,this.dk[l+1]=i,this.dk[l+2]=s,this.dk[l+3]=h,this.dk[l+4]=e,this.dk[l+5]=n,this.dk[l+6]=r,this.dk[l+7]=o;for(let l=0;l<256;l+=8)t+=this.dk[l],i+=this.dk[l+1],s+=this.dk[l+2],h+=this.dk[l+3],e+=this.dk[l+4],n+=this.dk[l+5],r+=this.dk[l+6],o+=this.dk[l+7],t^=i<<11,h+=t,i+=s,i^=s>>>2,e+=i,s+=h,s^=h<<8,n+=s,h+=e,h^=e>>>16,r+=h,e+=n,e^=n<<10,o+=e,n+=r,n^=r>>>4,t+=n,r+=o,r^=o<<8,i+=r,o+=t,o^=t>>>9,s+=o,t+=i,this.dk[l]=t,this.dk[l+1]=i,this.dk[l+2]=s,this.dk[l+3]=h,this.dk[l+4]=e,this.dk[l+5]=n,this.dk[l+6]=r,this.dk[l+7]=o;this.wk(),this.count=256}wk(){this.c++,this.b+=this.c;for(let t=0;t<256;t++){const i=this.dk[t],s=3&t;let h;0===s?this.a^=this.a<<13:1===s?this.a^=this.a>>>6:2===s?this.a^=this.a<<2:3===s&&(this.a^=this.a>>>16),this.a+=this.dk[t+128&255],this.dk[t]=h=this.dk[i>>>2&255]+this.a+this.b,this.uk[t]=this.b=this.dk[h>>>8>>>2&255]+i}}}},2901:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(1069),e=s(1908);class n{static fk=t=>{let i=0;t=t.toUpperCase();for(let s=0;s=this.yk)return null;if(this.Ek[t])return this.Ek[t];const i=this._k[t],s=i+this.Ik[t];if(this.Ak){const h=Uint8Array.from(this.buffer.subarray(i,i+s));return this.Ek[t]=h,h}{const i=Uint8Array.from(e.A.read(this.mk[t],this.buffer,this.Ik[t],this._k[t]));return this.Ek[t]=i,i}}}},1069:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(9234),e=s(6666),n=s(4474);class r extends n.A{static Ck=3988292384;static Tk=new Int32Array(256);static Ok=new Uint32Array(33);static bk=new e.A;static vk=new e.A;static Lk=new e.A;static Rk=0;static Sk=0;static Mk=0;static{for(let t=0;t<32;t++)r.Ok[t]=(1<>>=1:i=i>>>1^r.Ck;r.Tk[t]=i}}static Bo=t=>{let i=4294967295;for(let s=0;s>>8^r.Tk[255&(i^t[s])];return~i};view;data;Fc=0;Bm=0;random=null;constructor(t){if(!t)throw new Error('Input src packet array was null!');super(),t instanceof Int8Array?this.data=new Uint8Array(t):this.data=t,this.view=new DataView(this.data.buffer,this.data.byteOffset,this.data.byteLength)}get length(){return this.view.byteLength}get available(){return this.length-this.Fc}static Ut=t=>{let i=null;return 0===t&&r.Rk>0?(r.Rk--,i=r.bk.ev()):1===t&&r.Sk>0?(r.Sk--,i=r.vk.ev()):2===t&&r.Mk>0&&(r.Mk--,i=r.Lk.ev()),i?(i.Fc=0,i):new r(0===t?new Uint8Array(100):1===t?new Uint8Array(5e3):new Uint8Array(3e4))};release(){this.Fc=0,100===this.view.byteLength&&r.Rk<1e3?(r.bk.n_(this),r.Rk++):5e3===this.view.byteLength&&r.Sk<250?(r.vk.n_(this),r.Sk++):3e4===this.view.byteLength&&r.Mk<50&&(r.Lk.n_(this),r.Mk++)}get ZA(){return this.view.getUint8(this.Fc++)}get zA(){return this.view.getInt8(this.Fc++)}get KA(){const t=this.view.getUint16(this.Fc);return this.Fc+=2,t}get tp(){const t=this.view.getInt16(this.Fc);return this.Fc+=2,t}get dg(){const t=this.view.getUint8(this.Fc++)<<16|this.view.getUint16(this.Fc);return this.Fc+=2,t}get Ko(){const t=this.view.getInt32(this.Fc);return this.Fc+=4,t}get Uc(){const t=this.view.getBigInt64(this.Fc);return this.Fc+=8,t}get kR(){return this.view.getUint8(this.Fc)<128?this.ZA-64:this.KA-49152}get nO(){return this.view.getUint8(this.Fc)<128?this.ZA:this.KA-32768}get ly(){const t=this.view,i=t.byteLength;let s,h='';for(;10!==(s=t.getUint8(this.Fc++))&&this.Fc>16),this.view.setUint16(this.Fc,t),this.Fc+=2}p4(t){this.view.setInt32(this.Fc,t),this.Fc+=4}xk(t){this.view.setInt32(this.Fc,t,!0),this.Fc+=4}nA(t){this.view.setBigInt64(this.Fc,t),this.Fc+=8}Bc(t){const i=this.view,s=t.length;for(let h=0;h>>3,s=8-(7&this.Bm),h=0;for(this.Bm+=t;t>s;s=8)h+=(this.view.getUint8(i++)&r.Ok[s])<>>s-t&r.Ok[t],h}Gc(t,i){const s=this.Fc;this.Fc=0;const e=new Uint8Array(s);this.xy(s,0,e);const n=(0,h.Dk)(e),r=(0,h.Nk)(n,i,t),o=(0,h.Pk)(r);this.Fc=0,this.p1(o.length),this.Hc(o,o.length,0)}}},353:(t,i,s)=>{s.d(i,{A:()=>h});class h{static Fk=[95,218,67,50,253,222,194,60,101,128,8,251,92,111,24,33,223,66,232,59,227,113,153,105,126,98,167,102,177,238,62,190,147,23,150,151,156,144,193,155,81,0,198,22,137,210,179,16,168,170,32,181,248,141,58,87,208,106,180,191,221,241,40,176,196,154,65,145,230,78,30,161,188,41,14,129,18,199,47,247,225,34,51,10,159,75,12,56,61,31,39,91,46,242,134,5,122,123,209,228,104,195,21,3,11,44,107,172,6,186,110,215,205,103,27,185,124,77,252,117,86,115,127,207,52,79,43,97,219,116,169,7,118,162,108,36,20,233,88,135,80,19,42,237,57,152,71,9,250,17,4,119,234,130,26,200,189,163,254,245,197,171,220,235,140,244,184,94,211,231,99,246,121,212,112,204,63,148,83,178,1,255,131,13,183,142,236,45,55,35,243,136,37,85,100,160,38,224,146,174,82,48,109,132,125,90,143,138,240,173,165,164,192,175,29,74,28,114,213,73,64,206,76,139,96,2,229,15,93,25,239,202,49,70,214,201,72,203,68,89,69,157,216,217,249,120,226,84,149,187,54,53,158,166,182,133,0];static VA=[0,-2,4,6,-1,0,0,2,0,0,0,0,5,4,2,2,0,0,0,0,2,-2,2,14,0,6,3,0,4,0,0,0,3,0,0,0,0,0,0,0,0,-1,4,2,6,0,6,0,0,3,7,0,0,0,-1,0,0,0,0,4,0,0,0,0,0,0,0,0,1,15,0,0,0,0,6,0,2,0,0,0,2,0,0,0,1,0,0,4,0,0,0,0,0,0,0,0,0,0,-2,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,-2,0,0,2,0,0,0,2,9,0,0,0,0,0,4,0,0,0,3,7,9,0,0,0,0,0,0,0,0,0,-2,0,0,0,0,3,2,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,-2,2,0,0,0,0,0,6,0,0,0,2,0,2,0,0,0,-2,0,0,4,0,0,0,0,6,0,0,-2,-2,0,0,0,0,0,0,-2,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,-2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0]}},2215:(t,i,s)=>{s.d(i,{A:()=>h});class h{static Jy=14;static Ly=28;static Op=129;static My=167;static Ip=168;static qy=195;static _p=2;static gp=26;static Ap=46;static dp=84;static ap=87;static jy=103;static Sy=146;static hy=197;static bp=201;static Xy=204;static Qy=209;static Hy=126;static cp=185;static By=15;static Ny=98;static Mp=213;static up=74;static Sp=13;static ip=3;static Tp=239;static JA=1;static kp=184;static Dy=133;static Py=226;static wp=4;static Cp=21;static Zy=32;static fA=41;static jA=152;static Ay=19;static Rp=22;static ny=25;static qA=43;static vp=44;static fp=68;static Ep=136;static yy=139;static Gy=140;static uy=142;static Uy=243;static Yy=254;static wy=20;static $A=80;static op=132;static ky=220;static ty=237;static XA=150;static Ry=175;static lp=193;static Vy=12;static oy=54;static Wy=212;static zy=7;static sp=135;static Lp=162;static my=23;static Ty=42;static gy=49;static Iy=50;static by=59;static Ey=69;static Oy=76;static py=151;static _y=191;static Cy=223}},3937:(t,i,s)=>{s.d(i,{A:()=>o});class h{start=0;end=0;form=0;length=0;Uk=null;Bk=null;threshold=0;position=0;delta=0;amplitude=0;Gk=0;read(t){this.form=t.ZA,this.start=t.Ko,this.end=t.Ko,this.length=t.ZA,this.Uk=new Int32Array(this.length),this.Bk=new Int32Array(this.length);for(let i=0;i=this.threshold&&this.Bk&&this.Uk&&(this.amplitude=this.Bk[this.position++]<<15,this.position>=this.length&&(this.position=this.length-1),this.threshold=this.Uk[this.position]/65536*t|0,this.threshold>this.Gk&&(this.delta=((this.Bk[this.position]<<15)-this.amplitude)/(this.threshold-this.Gk)|0)),this.amplitude+=this.delta,this.Gk++,this.amplitude-this.delta>>15}}class e{static buffer=null;static PT=null;static sin=null;static Hk=new Int32Array(5);static Wk=new Int32Array(5);static Yk=new Int32Array(5);static Vk=new Int32Array(5);static Kk=new Int32Array(5);Xk=null;zk=null;jk=null;Zk=null;qk=null;$k=null;release=null;attack=null;Jk=new Int32Array(5);Qk=new Int32Array(5);tx=new Int32Array(5);start=0;length=500;ix=100;sx=0;static init=()=>{this.PT=new Int32Array(32768);for(let t=0;t<32768;t++)Math.random()>.5?this.PT[t]=1:this.PT[t]=-1;this.sin=new Int32Array(32768);for(let t=0;t<32768;t++)this.sin[t]=16384*Math.sin(t/5215.1903)|0;this.buffer=new Int32Array(220500)};Xc(t,i){for(let i=0;i>1,r+=(i*h>>16)+n}if(this.qk&&this.$k){const i=this.qk.evaluate(t),s=this.$k.evaluate(t);c=c*(32768+(this.hx(s,a,this.qk.form)>>1))>>15,a+=(i*o>>16)+l}for(let h=0;h<5;h++)if(0!==this.Jk[h]){const n=i+e.Wk[h];n>15,e.Hk[h],this.Xk.form),e.Hk[h]+=(s*e.Vk[h]>>16)+e.Kk[h])}}if(this.release&&this.attack){this.release.reset(),this.attack.reset();let i=0,s=!0;for(let h=0;h>8):this.release.start+((this.release.end-this.release.start)*r>>8),i+=256,i>=o&&(i=0,s=!s),s&&(e.buffer[h]=0)}}if(this.sx>0&&this.ix>0){const i=this.sx*s;for(let s=i;s32767&&(e.buffer[i]=32767);return e.buffer}hx(t,i,s){return 1===s?(32767&i)<16384?t:-t:2===s?e.sin[32767&i]*t>>14:3===s?((32767&i)*t>>14)-t:4===s?e.PT[i/2607&32767]*t:0}read(t){this.Xk=new h,this.Xk.read(t),this.zk=new h,this.zk.read(t),0!==t.ZA&&(t.Fc--,this.jk=new h,this.jk.read(t),this.Zk=new h,this.Zk.read(t)),0!==t.ZA&&(t.Fc--,this.qk=new h,this.qk.read(t),this.$k=new h,this.$k.read(t)),0!==t.ZA&&(t.Fc--,this.release=new h,this.release.read(t),this.attack=new h,this.attack.read(t));for(let i=0;i<10;i++){const s=t.nO;if(0===s)break;this.Jk[i]=s,this.Qk[i]=t.kR,this.tx[i]=t.nO}this.sx=t.nO,this.ix=t.nO,this.length=t.KA,this.start=t.KA}}var n=s(1069),r=s(3867);class o{static Ky=new Int32Array(1e3);static nx=null;static ox=null;static lx=new r.ds(1e3,null);ux=new r.ds(10,null);wx=0;loopEnd=0;static ec=t=>{const i=new n.A(t.read('sounds.dat'));for(this.nx=new Uint8Array(441e3),this.ox=new n.A(this.nx),e.init();;){const t=i.KA;if(65535===t)break;const s=new o;s.read(i),this.lx[t]=s,this.Ky[t]=s.trim()}};static Xc=(t,i)=>{if(!this.lx[t])return null;const s=this.lx[t];return s?.Ax(i)??null};read(t){for(let i=0;i<10;i++)0!==t.ZA&&(t.Fc--,this.ux[i]=new e,this.ux[i]?.read(t));this.wx=t.KA,this.loopEnd=t.KA}trim(){let t=9999999;for(let i=0;i<10;i++)this.ux[i]&&(this.ux[i].start/20|0)i&&(i=this.ux[t].length+this.ux[t].start);if(0===i)return 0;let s=22050*i/1e3|0,h=22050*this.wx/1e3|0,e=22050*this.loopEnd/1e3|0;(h<0||e<0||e>s||h>=e)&&(t=0);let n=s+(e-h)*(t-1);for(let t=44;t>8<<24>>24)}if(t>1){h+=44,e+=44,s+=44,n+=44;const i=n-s;for(let t=s-1;t>=e;t--)o.nx&&(o.nx[t+i]=o.nx[t]);for(let i=1;i{s.d(i,{$a:()=>a,qa:()=>o,ds:()=>h,uO:()=>e,Cr:()=>n,aO:()=>r,Kn:()=>l});class h extends Array{constructor(t,i){super(t);for(let s=0;s{s.d(i,{Pk:()=>l,Ho:()=>e,Dk:()=>o,Wo:()=>h,Xa:()=>n,Oc:()=>r,Nk:()=>a});const h=async t=>new Promise((i=>setTimeout(i,t))),e=async t=>new Int8Array(await(await fetch(t)).arrayBuffer()),n=async t=>(await fetch(t)).text();function r(t,i,s,h,e){for(;e--;)s[h++]=t[i++]}function o(t){let i=0n;for(let s=0;s0n;)i.unshift(Number(0xffn&t)),t>>=8n;return 128&i[0]&&i.unshift(0),new Uint8Array(i)}function a(t,i,s){let h=1n;for(;i>0n;)i%2n===1n&&(h=h*t%s),t=t*t%s,i>>=1n;return h}},7953:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1069);class e{static yx=new Uint16Array(['d','o','t'].join('').split('').map((t=>t.charCodeAt(0))));static mx=new Uint16Array(['(','a',')'].join('').split('').map((t=>t.charCodeAt(0))));static Ix=new Uint16Array(['s','l','a','s','h'].join('').split('').map((t=>t.charCodeAt(0))));static _x=['cook',"cook's",'cooks','seeks','sheet'];static Ex=[];static gx=[];static Cx=[];static Tx=[];static Ox=[];static bx=[];static ec=t=>{const i=new h.A(t.read('fragmentsenc.txt')),s=new h.A(t.read('badenc.txt')),e=new h.A(t.read('domainenc.txt')),n=new h.A(t.read('tldlist.txt'));this.read(s,e,i,n)};static filter=t=>{const i=[...t];this.format(i);const s=i.join('').trim(),h=s.toLowerCase(),e=[...h];this.vx(e),this.Lx(e),this.Rx(e),this.Sx(e);for(let t=0;t{this.xx(t),this.Dx(i),this.Nx(s),this.Px(h)};static Px=t=>{const i=t.Ko;for(let s=0;st.ZA))};static xx=t=>{const i=t.Ko;for(let s=0;st.ZA));const i=new Array(t.ZA).fill([]).map((()=>[t.zA,t.zA]));i.length>0&&(this.Tx[s]=i)}};static Dx=t=>{const i=t.Ko;for(let s=0;st.ZA))};static Nx=t=>{const i=t.Ko;for(let s=0;s{const i=[...t],s=[...t];this.Fx(null,i,this.yx),this.Fx(null,s,this.Ix);for(let h=0;h{for(let i=0;i<2;i++)for(let i=this.Cx.length-1;i>=0;i--)this.Fx(this.Tx[i],t,this.Cx[i])};static Rx=t=>{const i=[...t],s=[...t];this.Fx(null,i,this.mx),this.Fx(null,s,this.yx);for(let h=this.Ox.length-1;h>=0;h--)this.Bx(s,i,this.Ox[h],t)};static Sx=t=>{for(let i=0;i=0&&e{if(this.Xx(t))return!0;const i=this.zx(t),s=this.bx,h=s.length;if(i===s[0]||i===s[h-1])return!0;let e=0,n=h-1;for(;e<=n;){const t=(e+n)/2|0;if(i===s[t])return!0;i{if(t.length>6)return 0;let i=0;for(let s=0;s{for(let s=i;s=0;s++)if(this.Zx(t[s]))return s;return-1};static Vx=(t,i)=>{for(let s=t;s=0;s++)if(!this.Zx(i[s]))return s;return i.length};static qx=(t,i,s)=>i===s||'o'===i&&'0'===s?1:'o'===i&&'('===s&&')'===t?2:'c'!==i||'('!==s&&'<'!==s&&'['!==s?'e'===i&&'€'===s||'s'===i&&'$'===s||'l'===i&&'i'===s?1:0:1;static Bx=(t,i,s,h)=>{const e=s.length,n=h.length;for(let r=0;r<=n-e;r++){const{$x:e,Jx:n}=this.Qx(r,s,h);if(!e)continue;const o=this.tD(r,h,3,i,['@']),l=this.iD(n-1,h,3,t,['.',',']);(o>2||l>2)&&this.Yx(r,n,h)}};static Qx=(t,i,s)=>{const h=i.length;let e=t,n=0;for(;e0)e+=l,n++;else{if(0===n)break;const s=this.qx(o,String.fromCharCode(i[n-1]),r);if(s>0)e+=s,1===n&&t++;else{if(n>=h||!this.Hx(r))break;e++}}}return{$x:n>=h,Jx:e}};static Fx=(t,i,s)=>{if(!(s.length>i.length))for(let h=0;h<=i.length-s.length;h++){let e=h;const{Jx:n,sD:r,hD:o,eD:l,nD:a}=this.rD(i,s,e);e=n;let c=i[e],f=e+1=s.length)||l&&a)continue;let u,d=!0;if(o){let t=!1,s=!1;if((h-1<0||this.Hx(i[h-1])&&"'"!==i[h-1])&&(t=!0),(e>=i.length||this.Hx(i[e])&&"'"!==i[e])&&(s=!0),!t||!s){let s=!1;for(u=h-2,t&&(u=h);!s&&u=0&&(!this.Hx(i[u])||"'"===i[u])){const t=[];let h;for(h=0;h<3&&u+h=0&&(!this.Hx(i[u-1])||"'"===i[u-1])&&(e=!1),e&&!this.Kx(t)&&(s=!0)}u++}s||(d=!1)}}else{c=' ',h-1>=0&&(c=i[h-1]),f=' ',e{let h=s,e=0,n=0,r=!1,o=!1,l=!1;for(;h=t.length||o&&l);){const a=t[h],c=h+10)1===f&&this.Zx(a)&&(o=!0),2===f&&(this.Zx(a)||this.Zx(c))&&(o=!0),h+=f,e++;else{if(0===e)break;let t;if((t=this.cD(c,String.fromCharCode(i[e-1]),a))>0)h+=t;else{if(e>=i.length||!this.Wx(a))break;if(this.Hx(a)&&"'"!==a&&(r=!0),this.Zx(a)&&(l=!0),h++,n++,(100*n/(h-s)|0)>90)break}}}return{Jx:h,sD:e,hD:r,eD:o,nD:l}};static cD=(t,i,s)=>{if(i===s)return 1;if(i>='a'&&i<='m'){if('a'===i)return'4'!==s&&'@'!==s&&'^'!==s?'/'===s&&'\\'===t?2:0:1;if('b'===i)return'6'!==s&&'8'!==s?'1'===s&&'3'===t?2:0:1;if('c'===i)return'('!==s&&'<'!==s&&'{'!==s&&'['!==s?0:1;if('d'===i)return'['===s&&')'===t?2:0;if('e'===i)return'3'!==s&&'€'!==s?0:1;if('f'===i)return'p'===s&&'h'===t?2:'£'===s?1:0;if('g'===i)return'9'!==s&&'6'!==s?0:1;if('h'===i)return'#'===s?1:0;if('i'===i)return'y'!==s&&'l'!==s&&'j'!==s&&'1'!==s&&'!'!==s&&':'!==s&&';'!==s&&'|'!==s?0:1;if('j'===i)return 0;if('k'===i)return 0;if('l'===i)return'1'!==s&&'|'!==s&&'i'!==s?0:1;if('m'===i)return 0}if(i>='n'&&i<='z'){if('n'===i)return 0;if('o'===i)return'0'!==s&&'*'!==s?'('===s&&')'===t||'['===s&&']'===t||'{'===s&&'}'===t||'<'===s&&'>'===t?2:0:1;if('p'===i)return 0;if('q'===i)return 0;if('r'===i)return 0;if('s'===i)return'5'!==s&&'z'!==s&&'$'!==s&&'2'!==s?0:1;if('t'===i)return'7'!==s&&'+'!==s?0:1;if('u'===i)return'v'===s?1:'\\'===s&&'/'===t||'\\'===s&&'|'===t||'|'===s&&'/'===t?2:0;if('v'===i)return'\\'===s&&'/'===t||'\\'===s&&'|'===t||'|'===s&&'/'===t?2:0;if('w'===i)return'v'===s&&'v'===t?2:0;if('x'===i)return')'===s&&'('===t||'}'===s&&'{'===t||']'===s&&'['===t||'>'===s&&'<'===t?2:0;if('y'===i)return 0;if('z'===i)return 0}return i>='0'&&i<='9'?'0'===i?'o'===s||'O'===s?1:'('===s&&')'===t||'{'===s&&'}'===t||'['===s&&']'===t?2:0:'1'===i&&'l'===s?1:0:','===i?'.'===s?1:0:'.'===i?','===s?1:0:'!'===i&&'i'===s?1:0};static lD=(t,i,s)=>{let h=0,e=i.length-1;for(;h<=e;){const n=(h+e)/2|0;if(i[n][0]===t&&i[n][1]===s)return!0;tthis.jx(t)?t.charCodeAt(0)+1-'a'.charCodeAt(0):"'"===t?28:this.Zx(t)?t.charCodeAt(0)+29-'0'.charCodeAt(0):27;static Ux=(t,i,s,h,e)=>{if(!(h.length>s.length))for(let n=0;n<=s.length-h.length;n++){const{Jx:r,fD:o}=this.uD(s,h,n);if(o0&&c>0&&(l=!0),2===i&&(a>2&&c>0||a>0&&c>2)&&(l=!0),3===i&&a>0&&c>2&&(l=!0),!l)continue;let f,u=n,d=r-1,w=!1;if(a>2){if(4===a)for(w=!1,f=n-1;f>=0;f--)if(w){if('*'!==e[f])break;u=f}else'*'===e[f]&&(u=f,w=!0);for(w=!1,f=u-1;f>=0;f--)if(w){if(this.Hx(s[f]))break;u=f}else this.Hx(s[f])||(w=!0,u=f)}if(c>2){if(4===c)for(w=!1,f=d+1;f{let h=0;for(;s0)s+=r,h++;else{if(0===h)break;let t;if((t=this.qx(n,String.fromCharCode(i[h-1]),e))>0)s+=t;else{if(!this.Hx(e))break;s++}}}return{Jx:s,fD:h}};static Hx=t=>!this.aD(t)&&!this.Zx(t);static Wx=t=>!this.jx(t)||('v'===t||'x'===t||'j'===t||'q'===t||'z'===t);static aD=t=>this.jx(t)||this.dD(t);static Zx=t=>t>='0'&&t<='9';static jx=t=>t>='a'&&t<='z';static dD=t=>t>='A'&&t<='Z';static Xx=t=>{for(let i=0;i{for(let h=t;h{let s=0;for(let h=i-1;h>=0&&this.Hx(t[h]);h--)'*'===t[h]&&s++;return s};static AD=(t,i)=>{let s=0;for(let h=i+1;h(e?this.wD(i,s):this.AD(i,s))>=h?4:this.Hx(e?t[s-1]:t[s+1])?1:0;static tD=(t,i,s,h,e)=>{if(0===t)return 2;for(let s=t-1;s>=0&&this.Hx(i[s]);s--)if(e.includes(i[s]))return 3;return this.yD(i,h,t,s,!0)};static iD=(t,i,s,h,e)=>{if(t+1===i.length)return 2;for(let s=t+1;s{let i=0;for(let s=0;st>=' '&&t<=''||' '===t||'\n'===t||'\t'===t||'£'===t||'€'===t;static Mx=(t,i)=>{for(let s=0;s{let i=!0;for(let s=0;s{s.d(i,{A:()=>h});class h{static mD=[' ','e','t','a','o','i','h','n','s','r','d','l','u','m','w','c','y','f','g','p','b','v','k','x','j','q','z','0','1','2','3','4','5','6','7','8','9',' ','!','?','.',',',':',';','(',')','-','&','*','\\','\'','@','#','+','=','£','$','%','"','[',']'];static ID=[];static ec=(t,i)=>{let s,h=0,e=-1;for(let n=0;n>4&15,-1!==e?(this.ID[h++]=this.mD[(e<<4)+s-195],e=-1):s<13?this.ID[h++]=this.mD[s]:e=s,s=15&i,-1!==e?(this.ID[h++]=this.mD[(e<<4)+s-195],e=-1):s<13?this.ID[h++]=this.mD[s]:e=s}let n=!0;for(let t=0;t='a'&&i<='z'&&(this.ID[t]=i.toUpperCase(),n=!1),'.'!==i&&'!'!==i||(n=!0)}return this.ID.slice(0,h).join('')};static uA=(t,i)=>{i.length>80&&(i=i.substring(0,80)),i=i.toLowerCase();let s=-1;for(let h=0;h12&&(n+=195),-1===s?n<13?s=n:t.p1(n):n<13?(t.p1((s<<4)+n),s=-1):(t.p1((s<<4)+(n>>4)),s=15&n)}-1!==s&&t.p1(s<<4)}}},1908:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(9763);class e{static _D=null;static load=async t=>{this._D=await(0,h.F)(new WebAssembly.Module(t),{env:void 0})};static read=(t,i,s,h)=>{if(!this._D)throw new Error('bz2 not found!!');return Int8Array.from(this._D.read(t,i,s,h))}}},123:(t,i,s)=>{let h;async function e(t,i){n(i);try{const i=await window.audioContext.decodeAudioData(Uint8Array.from(t).buffer);let s=window.audioContext.createBufferSource();s.buffer=i,s.connect(h),s.start()}catch(t){console.log(t)}}function n(t){h||(h=window.audioContext.createGain(),h.connect(window.audioContext.destination)),h.gain.value=t/256}function r(t,i){window._tinyMidiPlay&&window._tinyMidiPlay(t,i/256)}function o(t){window._tinyMidiVolume&&window._tinyMidiVolume(t/256)}function l(){window._tinyMidiStop&&window._tinyMidiStop()}s.d(i,{zc:()=>e,Xo:()=>r,jp:()=>n,vo:()=>l,zp:()=>o})},9763:(t,i,s)=>{async function h(t,i={}){const s={env:Object.assign(Object.create(globalThis),i.env||{},{abort(t,i,s,h){t=r(t>>>0),i=r(i>>>0),s>>>=0,h>>>=0,(()=>{throw Error(`${t} in ${i}:${s}:${h}`)})()}})},{exports:h}=await WebAssembly.instantiate(t,s),e=h.memory||i.env.memory,n=Object.setPrototypeOf({read:(t,i,s,n)=>(i=function(t,i,s,n,r){if(null==n)return 0;const o=n.length,l=h.__pin(h.__new(o<>>0;if(r)new r(e.buffer,l,o).set(n);else for(let i=0;i>>0),n[i]);return h.__unpin(l),l}(l,6,0,i,Int8Array)||function(){throw TypeError("value must not be null")}(),function(t,i,s){if(!s)return null;const h=function(t){try{return o.getUint32(t,!0)}catch{return o=new DataView(e.buffer),o.getUint32(t,!0)}}(s-4)>>>i,n=new Array(h);for(let e=0;e>>0));return n}(a,0,h.read(t,i,s,n)>>>0))},h);function r(t){if(!t)return null;const i=t+new Uint32Array(e.buffer)[t-4>>>2]>>>1,s=new Uint16Array(e.buffer);let h=t>>>1,n="";for(;i-h>1024;)n+=String.fromCharCode(...s.subarray(h,h+=1024));return n+String.fromCharCode(...s.subarray(h,i))}let o=new DataView(e.buffer);function l(t,i){try{o.setUint8(t,i,!0)}catch{o=new DataView(e.buffer),o.setUint8(t,i,!0)}}function a(t){try{return o.getInt8(t,!0)}catch{return o=new DataView(e.buffer),o.getInt8(t,!0)}}return n}s.d(i,{F:()=>h})},9896:(t,i,s)=>{var h=s(8151);!function(){window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioContext&&(window.audioContext=new window.AudioContext);var t=function(i){if(window.audioContext){var s=window.audioContext.createBuffer(1,1,22050),h=window.audioContext.createBufferSource();h.buffer=s,h.connect(window.audioContext.destination),h.start?h.start(0):h.play?h.play(0):h.noteOn&&h.noteOn(0)}document.removeEventListener('touchstart',t),document.removeEventListener('touchend',t),document.removeEventListener('click',t)};document.addEventListener('touchstart',t),document.addEventListener('touchend',t),document.addEventListener('click',t)}(),(async()=>{let t=new Float32Array,i=window.audioContext.createGain();i.gain.value=.1,i.connect(window.audioContext.destination);let s=window.audioContext.currentTime,e=[];const n=new h.A({ED:30,gD:i=>{let s=new Float32Array(i.buffer),h=new Float32Array(t.length+s.length);h.set(t,0),h.set(s,t.length),t=h},CD:t=>{},bufferSize:102400});await n.init();const r=await fetch('./SCC1_Florestan.sf2'),o=new Uint8Array(await r.arrayBuffer());function l(){if(!window.audioContext||!t.length)return;let h=window.audioContext.createBufferSource();const n=t.length/2,r=window.audioContext.createBuffer(2,n,44100);for(let i=0;i<2;i++){const s=r.getChannelData(i);let h=i;for(let i=0;i{if(a&&clearInterval(a),t=new Float32Array,e.length){let t=i.gain.value;i.gain.value=0,e.forEach((t=>{t.stop(window.audioContext.currentTime)})),e=[],i.gain.value=t}},window._tinyMidiVolume=(t=1)=>{i.gain.value=t},window._tinyMidiPlay=async(t,i=1)=>{t&&(await window._tinyMidiStop(),-1!=i&&window._tinyMidiVolume(i),s=window.audioContext.currentTime,a=setInterval(l,250),n.OD(t))}})()},8151:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(5473);const e=class{constructor(t={}){this.bD=void 0,this.vD=0,this.LD=0,this.RD=0,this.ED=t.ED||100,this.sampleRate=t.sampleRate||44100,this.SD=t.SD||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.MD(1),this.gD=t.gD||(()=>{}),this.CD=t.CD||(()=>{}),this.kD=void 0,this.test=0}async init(){if(!this.bD){if('undefined'!=typeof process){const{xD:t}=await import('path'),{DD:i}=await import('module');globalThis.__dirname=t("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js"),globalThis.require=i("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js")}this.bD=await(0,h.A)(),this.ND=this.bD._malloc(this.bufferSize),this.PD=this.bD._malloc(8)}}MD(t){this.bufferSize=4*this.sampleRate*this.SD*t}FD(){if(!this.bD)throw new Error(`${this.constructor.name} not initalized. call .init()`)}TD(t){this.FD();const{_malloc:i,_free:s,_tsf_load_memory:h,_tsf_set_output:e,_tsf_channel_set_bank_preset:n,_tsf_set_max_voices:r,_tsf_channel_set_presetnumber:o}=this.bD;s(this.vD),this.vD=i(t.length),this.bD.HEAPU8.set(t,this.vD),this.LD=h(this.vD,t.length),e(this.LD,2===this.SD?0:2,this.sampleRate,this.gain)}UD(){this.FD();const t=new Uint8Array(this.bufferSize);return t.set(this.bD.HEAPU8.subarray(this.ND,this.ND+this.bufferSize)),t}BD(t){const{_malloc:i,_free:s,_tml_load_memory:h}=this.bD;return s(this.RD),this.RD=i(t.length),this.bD.HEAPU8.set(t,this.RD),h(this.RD,t.length)}GD(t){const{_midi_render:i}=this.bD;return i(this.LD,t,this.SD,this.sampleRate,this.ND,this.bufferSize,this.PD)}OD(t){if(this.FD(),!this.LD)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.kD);const{setValue:i,getValue:s}=this.bD;i(this.PD,0,'double'),this.bD._tsf_reset(this.LD),this.bD._tsf_channel_set_bank_preset(this.LD,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let h=this.BD(t);const e=()=>{h=this.GD(h);const t=this.UD();this.gD(t),h?this.kD=setTimeout(e,this.ED):this.CD(s(this.PD,'double'))};this.kD=setTimeout(e,16)}}},8227:(t,i,s)=>{t.exports=s.p+"9f86b5397894e28b5ae2.wasm"},5473:(t,i,s)=>{var h;s.d(i,{A:()=>e});const e=(h="file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/tinymidipcm.mjs",function(t){var i,e,n=void 0!==(t=t||{})?t:{};n.ready=new Promise((function(t,s){i=t,e=s})),["_tsf_load_memory","_tsf_set_output","_tsf_channel_set_bank_preset","_tsf_set_max_voices","_tsf_channel_set_presetnumber","_tsf_reset","_tsf_close","_tml_load_memory","_midi_render","_malloc","_realloc","_free","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(n.ready,t)||Object.defineProperty(n.ready,t,{get:()=>z('You are getting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),set:()=>z('You are setting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js')})}));var r=Object.assign({},n),o=[],l='object'==typeof window,a='function'==typeof importScripts,c='object'==typeof process&&'object'==typeof process.versions&&'string'==typeof process.versions.node,f=!l&&!c&&!a;if(n.ENVIRONMENT)throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');var u,d,w,A='';if(c){if('undefined'==typeof process||!process.release||'node'!==process.release.name)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');var y,p;A=a?require('path').xD(A)+'/':__dirname+'/';var m=()=>{p||(y=require('fs'),p=require('path'))};u=(t,i)=>(m(),t=p.normalize(t),y.HD(t,i?void 0:'utf8')),w=t=>{var i=u(t,!0);return i.buffer||(i=new Uint8Array(i)),D(i.buffer),i},d=(t,i,s)=>{m(),t=p.normalize(t),y.WD(t,(function(t,h){t?s(t):i(h.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,'/'),o=process.argv.slice(2),process.on('uncaughtException',(function(t){if(!(t instanceof et))throw t})),process.on('unhandledRejection',(function(t){throw t})),n.inspect=function(){return'[Emscripten Module object]'}}else if(f){if('object'==typeof process&&'function'==typeof require||'object'==typeof window||'function'==typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');'undefined'!=typeof read&&(u=function(t){return read(t)}),w=function(t){let i;return'function'==typeof readbuffer?new Uint8Array(readbuffer(t)):(i=read(t,'binary'),D('object'==typeof i),i)},d=function(t,i,s){setTimeout((()=>i(w(t))),0)},'undefined'!=typeof scriptArgs?o=scriptArgs:void 0!==arguments&&(o=arguments),'undefined'!=typeof print&&('undefined'==typeof console&&(console={}),console.log=print,console.warn=console.error='undefined'!=typeof printErr?printErr:print)}else{if(!l&&!a)throw new Error('environment detection error');if(a?A=self.location.href:'undefined'!=typeof document&&document.currentScript&&(A=document.currentScript.src),h&&(A=h),A=0!==A.indexOf('blob:')?A.substr(0,A.replace(/[?#].*/,"").lastIndexOf('/')+1):'','object'!=typeof window&&'function'!=typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');u=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.send(null),i.responseText},a&&(w=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.responseType='arraybuffer',i.send(null),new Uint8Array(i.response)}),d=(t,i,s)=>{var h=new XMLHttpRequest;h.open('GET',t,!0),h.responseType='arraybuffer',h.onload=()=>{200==h.status||0==h.status&&h.response?i(h.response):s()},h.onerror=s,h.send(null)}}n.print||console.log.bind(console);var I,_,E=n.printErr||console.warn.bind(console);function g(t,i){Object.getOwnPropertyDescriptor(n,t)||Object.defineProperty(n,t,{configurable:!0,get:function(){z('Module.'+t+' has been replaced with plain '+i+' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')}})}function C(t){return'FS_createPath'===t||'FS_createDataFile'===t||'FS_createPreloadedFile'===t||'FS_unlink'===t||'addRunDependency'===t||'FS_createLazyFile'===t||'FS_createDevice'===t||'removeRunDependency'===t}Object.assign(n,r),r=null,I='fetchSettings',Object.getOwnPropertyDescriptor(n,I)&&z('`Module.'+I+'` was supplied but `'+I+'` not included in INCOMING_MODULE_JS_API'),n.arguments&&(o=n.arguments),g('arguments','arguments_'),n.thisProgram&&n.thisProgram,g('thisProgram','thisProgram'),n.quit&&n.quit,g('quit','quit_'),D(void 0===n.memoryInitializerPrefixURL,'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===n.pthreadMainPrefixURL,'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'),D(void 0===n.cdInitializerPrefixURL,'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===n.filePackagePrefixURL,'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'),D(void 0===n.read,'Module.read option was removed (modify read_ in JS)'),D(void 0===n.readAsync,'Module.readAsync option was removed (modify readAsync in JS)'),D(void 0===n.readBinary,'Module.readBinary option was removed (modify readBinary in JS)'),D(void 0===n.setWindowTitle,'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'),D(void 0===n.TOTAL_MEMORY,'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'),g('read','read_'),g('readAsync','readAsync'),g('readBinary','readBinary'),g('setWindowTitle','setWindowTitle'),D(!f,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),n.wasmBinary&&(_=n.wasmBinary),g('wasmBinary','wasmBinary');var T;n.noExitRuntime;g('noExitRuntime','noExitRuntime'),'object'!=typeof WebAssembly&&z('no native wasm support detected');var O,b,v,L,R,S,M,k,x=!1;function D(t,i){t||z('Assertion failed'+(i?': '+i:''))}function N(t){O=t,n.HEAP8=b=new Int8Array(t),n.HEAP16=L=new Int16Array(t),n.HEAP32=R=new Int32Array(t),n.HEAPU8=v=new Uint8Array(t),n.HEAPU16=new Uint16Array(t),n.HEAPU32=S=new Uint32Array(t),n.HEAPF32=M=new Float32Array(t),n.HEAPF64=k=new Float64Array(t)}'undefined'!=typeof TextDecoder&&new TextDecoder('utf8');var P=5242880;n.TOTAL_STACK&&D(P===n.TOTAL_STACK,'the stack size can no longer be determined at runtime');var F=n.INITIAL_MEMORY||16777216;function U(){if(!x){var t=ft(),i=S[t>>2],s=S[t+4>>2];34821223==i&&2310721022==s||z('Stack overflow! Stack cookie has been overwritten at 0x'+t.toString(16)+', expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+s.toString(16)+' 0x'+i.toString(16)),1668509029!==S[0]&&z('Runtime error: The application has corrupted its heap memory area (address zero)!')}}g('INITIAL_MEMORY','INITIAL_MEMORY'),D(F>=P,'INITIAL_MEMORY should be larger than TOTAL_STACK, was '+F+'! (TOTAL_STACK='+P+')'),D('undefined'!=typeof Int32Array&&'undefined'!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,'JS engine does not provide full typed array support'),D(!n.wasmMemory,'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'),D(16777216==F,'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'),function(){var t=new Int16Array(1),i=new Int8Array(t.buffer);if(t[0]=25459,115!==i[0]||99!==i[1])throw'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'}();var B=[],G=[],H=[],W=!1;D(Math.imul,'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.fround,'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.clz32,'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.trunc,'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');var Y=0,V=null,K=null,X={};function z(t){n.onAbort&&n.onAbort(t),E(t='Aborted('+t+')'),x=!0;var i=new WebAssembly.RuntimeError(t);throw e(i),i}var j={error:function(){z('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM')},init:function(){j.error()},YD:function(){j.error()},VD:function(){j.error()},KD:function(){j.error()},open:function(){j.error()},XD:function(){j.error()},zD:function(){j.error()},jD:function(){j.error()},ZD:function(){j.error()},qD:function(){j.error()}};n.FS_createDataFile=j.YD,n.FS_createPreloadedFile=j.VD;var Z,q,$,J,Q='data:application/octet-stream;base64,';function tt(t){return t.startsWith(Q)}function it(t){return t.startsWith('file://')}function st(t,i){return function(){var s=t,h=i;return i||(h=n.asm),D(W,'native function `'+s+'` called before runtime initialization'),h[t]||D(h[t],'exported native function `'+s+'` not found'),h[t].apply(null,arguments)}}function ht(t){try{if(t==Z&&_)return new Uint8Array(_);if(w)return w(t);throw"both async and sync fetching of the wasm failed"}catch(t){z(t)}}function et(t){this.name='ExitStatus',this.message='Program terminated with exit('+t+')',this.status=t}function nt(t){for(;t.length>0;)t.shift()(n)}function rt(t){rt.$D||(rt.$D={}),rt.$D[t]||(rt.$D[t]=1,c&&(t='warning: '+t),E(t))}function ot(t){try{return T.JD(t-O.byteLength+65535>>>16),N(T.buffer),1}catch(i){E('emscripten_realloc_buffer: Attempted to grow heap from '+O.byteLength+' bytes to '+t+' bytes, but got error: '+i)}}n.locateFile?tt(Z='tinymidipcm.wasm')||(q=Z,Z=n.locateFile?n.locateFile(q,A):A+q):Z=new URL(s(8227),s.b).toString();var lt,at={"emscripten_memcpy_big":function(t,i,s){v.copyWithin(t,i,i+s)},"emscripten_resize_heap":function(t){var i=v.length;D((t>>>=0)>i);var s,h,e=2147483648;if(t>e)return E('Cannot enlarge memory, asked to go up to '+t+' bytes, but the limit is '+e+' bytes!'),!1;for(var n=1;n<=4;n*=2){var r=i*(1+.2/n);r=Math.min(r,t+100663296);var o=Math.min(e,(s=Math.max(t,r))+((h=65536)-s%h)%h);if(ot(o))return!0}return E('Failed to grow the heap from '+i+' bytes to '+o+' bytes, not enough memory!'),!1}},ct=(function(){var t,i={'env':at,'wasi_snapshot_preview1':at};function s(t,i){var s,h=t.exports;n.asm=h,D(T=n.asm.memory,"memory not found in wasm exports"),N(T.buffer),D(n.asm.__indirect_function_table,"table not found in wasm exports"),s=n.asm.__wasm_call_ctors,G.unshift(s),function(t){if(Y--,n.monitorRunDependencies&&n.monitorRunDependencies(Y),t?(D(X[t]),delete X[t]):E('warning: run dependency removed without ID'),0==Y&&(null!==V&&(clearInterval(V),V=null),K)){var i=K;K=null,i()}}('wasm-instantiate')}t='wasm-instantiate',Y++,n.monitorRunDependencies&&n.monitorRunDependencies(Y),t?(D(!X[t]),X[t]=1,null===V&&'undefined'!=typeof setInterval&&(V=setInterval((function(){if(x)return clearInterval(V),void(V=null);var t=!1;for(var i in X)t||(t=!0,E('still waiting on run dependencies:')),E('dependency: '+i);t&&E('(end of list)')}),1e4))):E('warning: run dependency added without ID');var h=n;function r(t){D(n===h,'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'),h=null,s(t.instance)}function o(t){return function(){if(!_&&(l||a)){if('function'==typeof fetch&&!it(Z))return fetch(Z,{credentials:'same-origin'}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+Z+"'";return t.arrayBuffer()})).catch((function(){return ht(Z)}));if(d)return new Promise((function(t,i){d(Z,(function(i){t(new Uint8Array(i))}),i)}))}return Promise.resolve().then((function(){return ht(Z)}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){E('failed to asynchronously prepare wasm: '+t),it(Z)&&E('warning: Loading from a file URI ('+Z+') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing'),z(t)}))}if(n.instantiateWasm)try{return n.instantiateWasm(i,s)}catch(t){E('Module.instantiateWasm callback failed with error: '+t),e(t)}(_||'function'!=typeof WebAssembly.instantiateStreaming||tt(Z)||it(Z)||c||'function'!=typeof fetch?o(r):fetch(Z,{credentials:'same-origin'}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(r,(function(t){return E('wasm streaming compile failed: '+t),E('falling back to ArrayBuffer instantiation'),o(r)}))}))).catch(e)}(),n.___wasm_call_ctors=st("__wasm_call_ctors"),n._malloc=st("malloc"),n._free=st("free"),n._tsf_load_memory=st("tsf_load_memory"),n._tsf_close=st("tsf_close"),n._tsf_reset=st("tsf_reset"),n._tsf_set_output=st("tsf_set_output"),n._tsf_set_max_voices=st("tsf_set_max_voices"),n._realloc=st("realloc"),n._tsf_channel_set_presetnumber=st("tsf_channel_set_presetnumber"),n._tsf_channel_set_bank_preset=st("tsf_channel_set_bank_preset"),n._tml_load_memory=st("tml_load_memory"),n._midi_render=st("midi_render"),n.___errno_location=st("__errno_location"),n._fflush=st("fflush"),n._emscripten_stack_init=function(){return(ct=n._emscripten_stack_init=n.asm.emscripten_stack_init).apply(null,arguments)}),ft=(n._emscripten_stack_get_free=function(){return(n._emscripten_stack_get_free=n.asm.emscripten_stack_get_free).apply(null,arguments)},n._emscripten_stack_get_base=function(){return(n._emscripten_stack_get_base=n.asm.emscripten_stack_get_base).apply(null,arguments)},n._emscripten_stack_get_end=function(){return(ft=n._emscripten_stack_get_end=n.asm.emscripten_stack_get_end).apply(null,arguments)});function ut(){var t;ct(),D(!(3&(t=ft()))),S[t>>2]=34821223,S[t+4>>2]=2310721022,S[0]=1668509029}function dt(t){function s(){lt||(lt=!0,n.calledRun=!0,x||(D(!W),W=!0,U(),nt(G),i(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),D(!n._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(U(),n.postRun)for('function'==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)t=n.postRun.shift(),H.unshift(t);var t;nt(H)}()))}t=t||o,Y>0||(ut(),function(){if(n.preRun)for('function'==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)t=n.preRun.shift(),B.unshift(t);var t;nt(B)}(),Y>0||(n.setStatus?(n.setStatus('Running...'),setTimeout((function(){setTimeout((function(){n.setStatus('')}),1),s()}),1)):s(),U()))}if(n.stackSave=st("stackSave"),n.stackRestore=st("stackRestore"),n.stackAlloc=st("stackAlloc"),n.setValue=function(t,i,s="i8"){switch(s.endsWith('*')&&(s='*'),s){case'i1':case'i8':b[0|t]=i;break;case'i16':L[t>>1]=i;break;case'i32':R[t>>2]=i;break;case'i64':J=[i>>>0,($=i,+Math.abs($)>=1?$>0?(0|Math.min(+Math.floor($/4294967296),4294967295))>>>0:~~+Math.ceil(($-+(~~$>>>0))/4294967296)>>>0:0)],R[t>>2]=J[0],R[t+4>>2]=J[1];break;case'float':M[t>>2]=i;break;case'double':k[t>>3]=i;break;case'*':S[t>>2]=i;break;default:z('invalid type for setValue: '+s)}},n.getValue=function(t,i="i8"){switch(i.endsWith('*')&&(i='*'),i){case'i1':case'i8':return b[0|t];case'i16':return L[t>>1];case'i32':case'i64':return R[t>>2];case'float':return M[t>>2];case'double':return k[t>>3];case'*':return S[t>>2];default:z('invalid type for getValue: '+i)}return null},['run','UTF8ArrayToString','UTF8ToString','stringToUTF8Array','stringToUTF8','lengthBytesUTF8','addOnPreRun','addOnInit','addOnPreMain','addOnExit','addOnPostRun','addRunDependency','removeRunDependency','FS_createFolder','FS_createPath','FS_createDataFile','FS_createPreloadedFile','FS_createLazyFile','FS_createLink','FS_createDevice','FS_unlink','getLEB','getFunctionTables','alignFunctionTables','registerFunctions','prettyPrint','getCompilerSetting','print','printErr','callMain','abort','keepRuntimeAlive','wasmMemory','stackAlloc','stackSave','stackRestore','getTempRet0','setTempRet0','writeStackCookie','checkStackCookie','ptrToString','zeroMemory','stringToNewUTF8','exitJS','getHeapMax','emscripten_realloc_buffer','ENV','ERRNO_CODES','ERRNO_MESSAGES','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','DNS','getHostByName','Protocols','Sockets','getRandomDevice','warnOnce','traverseStack','UNWIND_CACHE','convertPCtoSourceLocation','readAsmConstArgsArray','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','handleException','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','freeTableIndexes','functionsInTableMap','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','PATH','PATH_FS','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16Decoder','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeArrayToMemory','writeAsciiToMemory','SYSCALLS','getSocketFromFD','getSocketAddress','JSEvents','registerKeyEventCallback','specialHTMLTargets','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','currentFullscreenStrategy','restoreOldWindowedStyle','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','demangle','demangleAll','jsStackTrace','stackTrace','ExitStatus','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','dlopenMissingError','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','uncaughtExceptionCount','exceptionLast','exceptionCaught','ExceptionInfo','exception_addRef','exception_decRef','Browser','setMainLoop','wget','FS','MEMFS','TTY','PIPEFS','SOCKFS','_setNetworkCallback','tempFixedLengthArray','miniTempWebGLFloatBuffers','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','GL','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','AL','SDL_unicode','SDL_ttfContext','SDL_audio','SDL','SDL_gfx','GLUT','EGL','GLFW_Window','GLFW','GLEW','IDBStore','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){Object.getOwnPropertyDescriptor(n,t)||Object.defineProperty(n,t,{configurable:!0,get:function(){var i="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";C(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),z(i)}})})),['ptrToString','zeroMemory','stringToNewUTF8','exitJS','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','getHostByName','getRandomDevice','traverseStack','convertPCtoSourceLocation','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeAsciiToMemory','getSocketFromFD','getSocketAddress','registerKeyEventCallback','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','ExceptionInfo','exception_addRef','exception_decRef','setMainLoop','_setNetworkCallback','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','SDL_unicode','SDL_ttfContext','SDL_audio','GLFW_Window','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){'undefined'==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var i='`'+t+'` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line';C(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),rt(i)}})})),K=function t(){lt||dt(),lt||(K=t)},n.preInit)for('function'==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return dt(),t.ready})}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var s=n[t]={exports:{}};return e[t](s,s.exports,r),s.exports}r.m=e,t="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",i="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",s="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",h=t=>{t&&t.d<1&&(t.d=1,t.forEach((t=>t.r--)),t.forEach((t=>t.r--?t.r++:t())))},r.a=(e,n,r)=>{var o;r&&((o=[]).d=-1);var l,a,c,f=new Set,u=e.exports,d=new Promise(((t,i)=>{c=i,a=t}));d[i]=u,d[t]=t=>(o&&t(o),f.forEach(t),d.catch((t=>{}))),e.exports=d,n((e=>{var n;l=(e=>e.map((e=>{if(null!==e&&"object"==typeof e){if(e[t])return e;if(e.then){var n=[];n.d=0,e.then((t=>{r[i]=t,h(n)}),(t=>{r[s]=t,h(n)}));var r={};return r[t]=t=>t(n),r}}var o={};return o[t]=t=>{},o[i]=e,o})))(e);var r=()=>l.map((t=>{if(t[s])throw t[s];return t[i]})),a=new Promise((i=>{(n=()=>i(r)).r=0;var s=t=>t!==o&&!f.has(t)&&(f.add(t),t&&!t.d&&(n.r++,t.push(n)));l.map((i=>i[t](s)))}));return n.r?a:r()}),(t=>(t?c(d[s]=t):a(u),h(o)))),o&&o.d<0&&(o.d=0)},r.d=(t,i)=>{for(var s in i)r.o(i,s)&&!r.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:i[s]})},r.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),r.p="/Client2/",r.b=document.baseURI||self.location.href;r(7906)})(); \ No newline at end of file +(()=>{"use strict";var t,i,s,h,e={1651:(t,i,s)=>{s.d(i,{K:()=>k});var h=s(1120),e=s(4583),n=s(2901),r=s(1069),o=s(7046),l=(s(9896),s(6666)),a=s(3045),c=s(818),f=s(670),u=s(8268),d=s(3867),w=s(7854),A=s(8950),y=s(1302),p=s(9298),m=s(8665),I=s(1312),_=s(3819),E=s(8317),g=s(9234),C=s(1908),T=s(123),O=s(5637),b=s(6948),v=s(2164),L=s(8738),R=s(3764),S=s(8534),M=s(6730);class k extends o.A{static tt=225;static it=10;static portOffset=0;static members=!0;static st=!1;static ht='';static et='';static nt=!1;static rt=2;static ot=!1;static lt='https://raw.githubusercontent.com/2004scape/Server/main';static exponent=58778699976184461502525193738213253649000149147835990136706041084440742975821n;static ct=7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789n;static ft=0;static ut=0;static dt=0;static wt=0;static At=0;static yt=0;static It=0;static _t=0;static Et=0;static gt=0;static Ct=0;static Tt=0;static Ot=0;static bt=0;static vt=0;static Lt=()=>{a.A.st=!1,e.A.st=!1,k.st=!1,c.A.st=!1};static Rt=()=>{a.A.st=!0,e.A.st=!0,k.st=!0,c.A.st=!0};St=2048;Mt=2047;kt=!1;xt=!1;Dt=!1;Nt=!1;db=null;Pt=0;Ft=[];stream=null;in=r.A.Ut(1);Bt=r.A.Ut(1);Gt=r.A.Ut(1);Ht=0n;Wt=0;Yt=0;Vt=0;Kt=null;Xt=0;packetSize=0;zt=0;jt=0;Zt=0;qt=null;$t=!0;Jt=0;Qt=0;ti=null;ii=null;si=null;hi=null;ei=null;ni=null;ri=null;oi=null;li=null;ai=null;ci=null;fi='';ui='';username='';password='';di=null;wi=null;Ai=null;yi=null;pi=[];mi=!1;Ii=null;_i=null;Ei=null;gi=null;Ci=null;Ti=null;Oi=null;bi=null;vi=null;Li=null;Ri=new Int32Array(256);Si=0;Mi=0;ki=0;xi=null;Di=null;Ni=null;Pi=null;Fi=null;Ui=null;Bi=null;Gi=null;Hi=null;Wi=null;Yi=null;Vi=null;Ki=null;Xi=null;zi=null;ji=null;Zi=null;qi=null;$i=null;Ji=null;Qi=null;ts=new Int32Array(33);ss=new Int32Array(33);hs=new Int32Array(151);es=new Int32Array(151);ns=null;rs=null;os=null;ls=null;cs=null;fs=null;us=new d.ds(13,null);ws=null;As=null;ys=new d.ds(50,null);ps=new d.ds(50,null);Is=new d.ds(20,null);_s=new d.ds(20,null);Es=null;gs=new d.ds(8,null);Cs=null;Ts=null;Os=null;bs=null;vs=null;Ls=null;Rs=null;Ss=null;Ms=null;ks=null;xs=null;Ds=null;Ns=null;Ps=null;Fs=null;Us=null;Bs=null;Gs=null;Hs=new d.ds(1e3,null);Ws=!1;Ys=!1;Vs=!1;Ks=!1;Xs=-1;zs=0;js=0;Zs=0;qs=0;$s=0;Js=0;Qs=!1;th=0;ih=0;sh=0;hh=0;eh=0;nh=0;rh=[];oh=-1;lh=-1;ah=new h.A;fh=78;uh=0;dh=0;wh=[];Ah=0;yh=0;ph=0;mh=0;Ih=0;_h=0;Eh=0;gh=0;Ch=[];Th=[];Oh=[];bh=[];Lh=null;Rh=-1;Sh=3;Mh=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];kh=0;xh=0;Dh=0;Nh=!1;Ph=0;Fh=!1;Uh='';Bh='';Gh=0;Hh='';Wh=!1;Yh=-1;Vh=new d.ds(100,null);Kh=new d.ds(100,null);messageType=new Int32Array(100);Xh=new Int32Array(100);zh=0;jh=0;Zh=0;qh='';$h=0;Jh=0;Qh=0;te=0;ie=0;se=0;he=0;ee=0;ne=0;re=!1;oe=0;le=0;ae=0;ce=0;fe=null;ue=0;de=0;we=0;Ae=0;ye=!1;pe=[];me=[];Ie=0;_e=0;Ee=0;ge=null;Ce=0;Te=new Int32Array(500);Oe=new Int32Array(500);be=new Int32Array(500);ve=new Int32Array(500);Le=0;Re=0;Se=0;Me='';ke=!1;xe=-1;De=0;Ne=0;Pe=0;Fe=0;Ue=0;Be=new Int32Array(1e3);Ge=new Int32Array(1e3);He=null;We=0;Ye=0;Ve=0;Ke=0;Xe=0;ze=!1;je=0;Ze=0;qe=0;$e=0;Je=2;Qe=2;tn=1;sn=new Int32Array(5);hn=new d.ds(5,!1);en=new Int32Array(5);nn=new Int32Array(5);rn=new Int32Array(5);ln=0;an=0;cn=0;fn=0;un=0;dn=0;wn=0;An=0;yn=0;pn=1;mn=2;In=-1;_n=0;En=0;gn=0;Cn=0;Tn=0;On=0;bn=null;vn=null;Ln=null;Rn=0;Sn=0;Mn=new Int8Array(16384);kn=new d.ds(f.A.xn,null);Dn=0;Nn=0;Pn=128;Fn=0;Un=0;Bn=0;Gn=0;Hn=0;Wn=null;Yn=null;Vn=new d.Kn(f.A.Xn,f.A.Xn);zn=0;jn=0;Zn=0;qn=0;$n=0;Jn=0;Qn=0;tr=0;ir=0;sr=0;hr=0;er=0;nr=new d.ds(this.St,null);rr=0;lr=new Int32Array(this.St);ar=0;cr=0;ur=new Int32Array(this.St);dr=new Int32Array(1e3);wr=new d.ds(this.St,null);Ar=new d.ds(8192,null);yr=0;pr=new Int32Array(8192);mr=new l.A;Ir=new l.A;_r=new l.A;Er=new l.A;gr=new d.Cr(f.A.xn,f.A.Xn,f.A.Xn,null);Tr=new l.A;Or=new Int32Array(4e3);br=new Int32Array(4e3);vr=new Int32Array(f.A.Xn*f.A.Xn);Lr=new Int32Array(f.A.Xn*f.A.Xn);Rr=0;Sr=null;Mr=0;kr=0;Dr=-1;Nr=0;Pr=0;Fr=0;Ur=0;Br=!1;Gr=!0;Hr=!1;Wr=new Int32Array(7);Yr=new Int32Array(5);Vr=0;Kr=0;static Xr=50;zr=new Int32Array(k.Xr);jr=new Int32Array(k.Xr);Zr=new Int32Array(k.Xr);qr=new Int32Array(k.Xr);$r=new Int32Array(k.Xr);Jr=new Int32Array(k.Xr);Qr=new Int32Array(k.Xr);io=new d.ds(k.Xr,null);so=new d.ds(100,null);ho=new BigInt64Array(100);eo=new Int32Array(100);no=null;ro=0;oo=!0;lo=new Int32Array(50);ao=new Int32Array(50);co=new Int32Array(50);fo=192;uo=-1;do=-1;wo=0;Ao=0;yo=0;po=!0;mo=null;Io=0;_o=0;Eo=192;Co=new d.ds(16,null);To=0;Oo=!1;bo=()=>{try{this.stream&&this.stream.close()}catch(t){}this.stream=null,(0,T.vo)(),this.Bt=null,this.Gt=null,this.in=null,this.Ln=null,this.bn=null,this.vn=null,this.Wn=null,this.Yn=null,this.He=null,this.kn=null,this.vr=null,this.Lr=null,this.Or=null,this.br=null,this.Mn=null,this.Di=null,this.Ni=null,this.Pi=null,this.Fi=null,this.Ui=null,this.Bi=null,this.Gi=null,this.Hi=null,this.Wi=null,this.Yi=null,this.Vi=null,this.Ki=null,this.Xi=null,this.zi=null,this.ji=null,this.Zi=null,this.qi=null,this.ns=null,this.os=null,this.rs=null,this.ls=null,this.cs=null,this.fs=null,this.us=null,this.Rs=null,this.Ss=null,this.Ms=null,this.ks=null,this.xs=null,this.Ds=null,this.Ns=null,this.Ps=null,this.Fs=null,this.Us=null,this.As=null,this.Is=null,this._s=null,this.gs=null,this.Cs=null,this.Ts=null,this.Os=null,this.bs=null,this.ys=null,this.ps=null,this.Vn=null,this.nr=null,this.lr=null,this.ur=null,this.wr=null,this.dr=null,this.Ar=null,this.pr=null,this.gr=null,this.Tr=null,this.Er=null,this.mr=null,this.Ir=null,this._r=null,this.be=null,this.ve=null,this.Te=null,this.Oe=null,this.rh=null,this.pe=null,this.Be=null,this.Ge=null,this.Hs=null,this.ws=null,this.so=null,this.ho=null,this.eo=null,this.hi=null,this.ei=null,this.ti=null,this.ii=null,this.si=null,this.ni=null,this.ri=null,this.oi=null,this.li=null,this.Lo(),O.A.bo(),b.A.bo(),y.A.bo(),v.A.Ro=null,E.A.Ro=null,h.A.Ro=null,I.A.Ro=null,L.A.Ro=null,L.A.So=null,R.A.Ro=null,this.Mo=null,u.A.So=null,e.A.bo(),a.A.bo(),m.A.bo(),S.A.Ro=[],M.A.Ro=[]};ko(){return this.Jt}xo(){return this.Wh}Do(){return this.Fh}No(){return this.lh}Po(){return this.Xs}Lo=()=>{this.mi=!1,this.xi&&(clearInterval(this.xi),this.xi=null),this.ai=null,this.ci=null,this.pi=[],this.Oi=null,this.bi=null,this.vi=null,this.Li=null,this.gi=null,this.Ei=null,this.Ci=null,this.Ti=null,this.Ii=null,this._i=null};Fo=async(t,i,s,h)=>{let e=5,o=await(this.db?.Uo(t));if(o&&r.A.Bo(o)!==s&&(o=void 0),o)return new n.A(o);for(;!o;){await this.Go(h,`Requesting ${i}`);try{o=await(0,g.Ho)(`${k.et}/${t}${s}`)}catch(t){o=void 0;for(let t=e;t>0;t--)await this.Go(h,`Error loading - Will retry in ${t} secs.`),await(0,g.Wo)(1e3);e*=2,e>60&&(e=60)}}return await(this.db?.Yo(t,o)),new n.A(o)};Vo=async(t,i,s)=>{let h=await(this.db?.Uo(t+'.mid'));if(h&&12345678!==i&&r.A.Bo(h)!==i&&(h=void 0),!h)try{h=await(0,g.Ho)(`${k.et}/${t}_${i}.mid`),s!==h.length&&(h=h.slice(0,s))}catch(t){}if(!h)return;await(this.db?.Yo(t+'.mid',h));const e=new r.A(Uint8Array.from(h)).Ko,n=C.A.read(e,h,s,4);(0,T.Xo)(n,this.Eo)};zo=()=>{if(w.jo.fillStyle='black',w.jo.fillRect(0,0,this.width,this.height),this.Zo(1),this.Dt){this.mi=!1,w.jo.font='bold 16px helvetica, sans-serif',w.jo.textAlign='left',w.jo.fillStyle='yellow';let t=35;w.jo.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,w.jo.fillStyle='white',w.jo.fillText('To fix this try the following (in order):',30,t),t+=50,w.jo.font='bold 12px helvetica, sans-serif',w.jo.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.jo.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,w.jo.fillText('3: Try using a different game-world',30,t),t+=30,w.jo.fillText('4: Try rebooting your computer',30,t),t+=30,w.jo.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.Nt&&(this.mi=!1,w.jo.font='bold 20px helvetica, sans-serif',w.jo.textAlign='left',w.jo.fillStyle='white',w.jo.fillText('Error - unable to load game!',50,50),w.jo.fillText('To play RuneScape make sure you play from',50,100),w.jo.fillText('https://2004scape.org',50,150)),this.xt){this.mi=!1,w.jo.font='bold 13px helvetica, sans-serif',w.jo.textAlign='left',w.jo.fillStyle='yellow';let t=35;w.jo.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,w.jo.fillStyle='white',w.jo.fillText('To fix this try the following (in order):',30,t),t+=50,w.jo.font='bold 12px helvetica, sans-serif',w.jo.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.jo.fillText('2: Try rebooting your computer, and reloading',30,t)}};qo=t=>{if(!t.$o)return!1;for(let i=0;i=h)return!1}else if(3===t.$o[i]){if(s<=h)return!1}else if(4===t.$o[i]){if(s===h)return!1}else if(s!==h)return!1}return!0};tl=(t,i,s,h,e)=>{this.vs?.draw(t,i),this.Ls?.draw(t,i+e-16),A.A.fillRect(t,i+16,16,e-32,p.A.il);let n=(e-32)*e/h|0;n<8&&(n=8);const r=(e-n-32)*s/(h-e)|0;A.A.fillRect(t,i+r+16,16,n,p.A.sl),A.A.hl(t,i+r+16,p.A.el,n),A.A.hl(t+1,i+r+16,p.A.el,n),A.A.nl(t,i+r+16,p.A.el,16),A.A.nl(t,i+r+17,p.A.el,16),A.A.hl(t+15,i+r+16,p.A.rl,n),A.A.hl(t+14,i+r+17,p.A.rl,n-1),A.A.nl(t,i+r+n+15,p.A.rl,16),A.A.nl(t+1,i+r+n+14,p.A.rl,15)};ol=(t,i)=>{let s=!1;const e=h.A.Ro[t];if(!e.ll)return!1;for(let t=0;th.delay[n.ul];)n.fl-=h.delay[n.ul]+1,n.ul++,n.ul>=h.dl&&(n.ul-=h.wl,(n.ul<0||n.ul>=h.dl)&&(n.ul=0)),s=!0}}}return s};Al=(t,i,s,n,r=!1)=>{if(0!==t.type||!t.ll||t.hide&&this.$h!==t.id&&this.Jh!==t.id&&this.Qh!==t.id)return;const o=A.A.left,l=A.A.top,a=A.A.right,c=A.A.bottom;A.A.yl(i,s,i+t.width,s+t.height);const f=t.ll.length;for(let o=0;o0&&this.gl(c),c.type===h.A.Cl)c.Tl>c.scroll-c.height&&(c.Tl=c.scroll-c.height),c.Tl<0&&(c.Tl=0),this.Al(c,l,a,c.Tl,r),c.scroll>c.height&&this.tl(l+c.width,a,c.Tl,c.scroll,c.height);else if(c.type===h.A.Ol){let t=0;for(let i=0;i0){let i=0,s=0;const n=c.Ll[t]-1;if(h>=-32&&h<=512&&e>=-32&&e<=334||0!==this.se&&this.ie===t){const r=y.A.kl(n,c.Rl[t]);if(0!==this.se&&this.ie===t&&this.te===c.id?(i=this.xl-this.he,s=this.Dl-this.ee,i<5&&i>-5&&(i=0),s<5&&s>-5&&(s=0),this.ne<5&&(i=0,s=0),r.Nl(128,h+i,e+s)):0!==this.ue&&this.de===t&&this.we===c.id?r.Nl(128,h,e):r.draw(h,e),33===r.Pl||1!==c.Rl[t]){const n=c.Rl[t];this.di?.Fl(h+i+1,e+10+s,this.Ul(n),p.A.Bl),this.di?.Fl(h+i,e+9+s,this.Ul(n),p.A.Gl)}}}else if(c.Hl&&t<20){const i=c.Hl[t];i?.draw(h,e)}t++}}else if(c.type===h.A.Wl)c.fill?A.A.fillRect(l,a,c.width,c.height,c.Yl):A.A.Il(l,a,c.width,c.height,c.Yl);else if(c.type===h.A.Vl){const t=c.font;let i=c.Yl,s=c.text;if(this.Qh!==c.id&&this.Jh!==c.id&&this.$h!==c.id||0===c.Kl||(i=c.Kl),this.qo(c)&&(i=c.Xl,c.zl&&c.zl.length>0&&(s=c.zl)),c.jl===h.A.Zl&&this.ye&&(s='Please wait...',i=c.Yl),!t||!s)continue;for(let h=a+t.height;s.length>0;h+=t.height){if(-1!==s.indexOf('%')){for(;;){const t=s.indexOf('%1');if(-1===t)break;s=s.substring(0,t)+this.ql(this.Jo(c,0))+s.substring(t+2)}for(;;){const t=s.indexOf('%2');if(-1===t)break;s=s.substring(0,t)+this.ql(this.Jo(c,1))+s.substring(t+2)}for(;;){const t=s.indexOf('%3');if(-1===t)break;s=s.substring(0,t)+this.ql(this.Jo(c,2))+s.substring(t+2)}for(;;){const t=s.indexOf('%4');if(-1===t)break;s=s.substring(0,t)+this.ql(this.Jo(c,3))+s.substring(t+2)}for(;;){const t=s.indexOf('%5');if(-1===t)break;s=s.substring(0,t)+this.ql(this.Jo(c,4))+s.substring(t+2)}}const e=s.indexOf('\\n');let n;-1!==e?(n=s.substring(0,e),s=s.substring(e+2)):(n=s,s=''),c.$l?t.Jl(l+(c.width/2|0),h,n,i,c.Ql):t.ta(l,h,n,i,c.Ql)}}else if(c.type===h.A.ia){let t;t=this.qo(c)?c.sa:c.ha,t?.draw(l,a)}else if(c.type===h.A.ea){const t=e.A.na,i=e.A.ra;e.A.na=l+(c.width/2|0),e.A.ra=a+(c.height/2|0);const s=e.A.sin[c.oa]*c.zoom>>16,h=e.A.cos[c.oa]*c.zoom>>16,n=this.qo(c);let r;r=n?c.cl:c.al;let o=null;if(-1===r)o=c.la(-1,-1,n);else{const t=I.A.Ro[r];t.frames&&t.aa&&(o=c.la(t.frames[c.ul],t.aa[c.ul],n))}o&&o.ca(0,c.fa,0,c.oa,0,s,h),e.A.na=t,e.A.ra=i}else if(c.type===h.A.ua){const t=c.font;if(!t||!c.Ll||!c.Rl)continue;let i=0;for(let s=0;s0){const e=y.A.get(c.Ll[i]-1);let n=e.name;if((e.da||1!==c.Rl[i])&&(n=n+' x'+this.wa(c.Rl[i])),!n)continue;const r=l+h*(c.Sl+115),o=a+s*(c.Ml+12);c.$l?t.Jl(r+(c.width/2|0),o,n,c.Yl,c.Ql):t.ta(r,o,n,c.Yl,c.Ql)}i++}}}A.A.yl(o,l,a,c)};gl=t=>{let i=t.El;if(i>=h.A.Aa&&i<=h.A.ya)i--,i>=this.Vr?(t.text='',t.jl=0):(t.text=this.so[i],t.jl=1);else if(i>=h.A.pa&&i<=h.A.ma)i-=h.A.pa,i>=this.Vr?(t.text='',t.jl=0):(0===this.eo[i]?t.text='@red@Offline':this.eo[i]===k.it?t.text='@gre@World-'+(this.eo[i]-9):t.text='@yel@World-'+(this.eo[i]-9),t.jl=1);else if(i===h.A.Ia)t.scroll=15*this.Vr+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i>=h.A._a&&i<=h.A.Ea)i-=h.A._a,i>=this.dh?(t.text='',t.jl=0):(t.text=_.A.ga(_.A.Ca(this.wh[i])),t.jl=1);else if(i===h.A.Ta)t.scroll=15*this.dh+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i===h.A.Oa){if(t.oa=150,t.fa=256*Math.sin(this.Pt/40)&2047,this.Hr){this.Hr=!1;const i=new d.ds(7,null);let s=0;for(let t=0;t<7;t++){const h=this.Wr[t];h>=0&&(i[s++]=E.A.Ro[h].la())}const h=m.A.ba(i,s);for(let t=0;t<5;t++)0!==this.Yr[t]&&(h.va(u.A.La[t][0],u.A.La[t][this.Yr[t]]),1===t&&h.va(u.A.Ra[0],u.A.Ra[this.Yr[t]]));if(this.Sr){const i=I.A.Ro[this.Sr.Sa].frames;i&&(h.Ma(),h.ka(i[0]),h.xa(64,850,-30,-50,-30,!0),t.model=h)}}}else if(i===h.A.Da)this.Bs||(this.Bs=t.ha,this.Gs=t.sa),this.Gr?t.ha=this.Gs:t.ha=this.Bs;else if(i===h.A.Na)this.Bs||(this.Bs=t.ha,this.Gs=t.sa),this.Gr?t.ha=this.Bs:t.ha=this.Gs;else if(i===h.A.Pa)t.text=this.Me,this.Pt%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(i===h.A.Fa)this.Br?this.ke?(t.Yl=p.A.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.Yl=p.A._l,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(i===h.A.Ua||i===h.A.Ba)if(0===this.De)t.text='';else{let i;i=0===this.Ne?'earlier today':1===this.Ne?'yesterday':this.Ne+' days ago',t.text='You last logged in '+i+' from: '+_.A.Ga(this.De)}else if(i===h.A.Ha)0===this.Fe&&(t.text='0 unread messages',t.Yl=p.A.Gl),1===this.Fe&&(t.text='1 unread message',t.Yl=p.A.GREEN),this.Fe>1&&(t.text=this.Fe+' unread messages',t.Yl=p.A.GREEN);else if(i===h.A.Wa)if(201===this.Pe)t.text='';else if(200===this.Pe)t.text='You have not yet set any password recovery questions.';else{let i;i=0===this.Pe?'Earlier today':1===this.Pe?'Yesterday':this.Pe+' days ago',t.text=i+' you changed your recovery questions'}else i===h.A.Ya?201===this.Pe?t.text='':200===this.Pe?t.text='We strongly recommend you do so now to secure your account.':t.text='If you do not remember making this change then cancel it immediately':i===h.A.Va&&(201===this.Pe?t.text='':(this.Pe,t.text="Do this from the 'account management' area on our front webpage"))};Jo=(t,i)=>{if(!t.scripts||i>=t.scripts.length)return-2;try{const s=t.scripts[i];if(!s)return-1;let e=0,n=0;for(;;){const t=s[n++];if(0===t)return e;if(1===t)e+=this.Th[s[n++]];else if(2===t)e+=this.Oh[s[n++]];else if(3===t)e+=this.Ch[s[n++]];else if(4===t){const t=h.A.Ro[s[n++]],i=s[n++]+1;if(t.Ll&&t.Rl)for(let s=0;st<999999999?String(t):'*';wa=t=>{let i=String(t);for(let t=i.length-3;t>0;t-=3)i=i.substring(0,t)+','+i.substring(t);return i.length>8?i='@gre@'+i.substring(0,i.length-8)+' million @whi@('+i+')':i.length>4&&(i='@cya@'+i.substring(0,i.length-4)+'K @whi@('+i+')'),' '+i};Ul=t=>t<1e5?String(t):t<1e7?(t/1e3|0)+'K':(t/1e6|0)+'M'}},7604:(t,i,s)=>{s.d(i,{w:()=>r});var h=s(7046),e=s(1651),n=s(9234);async function r(){await async function(){0===h.A.getParameter('world').length&&h.A.setParameter('world','1');'localhost'===window.location.hostname&&'0'===h.A.getParameter('world')?(e.K.ht='http://localhost',e.K.et='http://localhost',e.K.portOffset=0):await async function(t){const i=await o(t,parseInt(h.A.getParameter('world'),10)),s=new URL(i.address);e.K.it=10+i.id-1,e.K.ht=`${s.protocol}//${s.hostname}`,e.K.et=`${s.protocol}//${s.hostname}:${s.port}`,t||(e.K.ht=e.K.ht.replace('https:','http:'));e.K.portOffset=i.portOffset,e.K.members=!0===i?.members,h.A.setParameter('world',i.id.toString(10))}(window.location.protocol.startsWith('https'))}(),function(){0===h.A.getParameter('detail').length&&h.A.setParameter('detail','high');'low'===h.A.getParameter('detail')?e.K.Rt():e.K.Lt()}(),0===h.A.getParameter('method').length&&h.A.setParameter('method','0')}async function o(t,i,s=0){if(s>=10)throw new Error('could not find world to connect!');const h=t?'https:':'http:';let e;try{e=JSON.parse(await(0,n.Xa)(`${h}//2004scape.org/api/v1/worldlist`))}catch(h){return await(0,n.Wo)(1e3),o(t,i,++s)}e.push({id:0,region:'Local Development',address:'http://localhost',portOffset:0,members:!0,nr:0});const r=e.find((t=>t.id===i));return r||o(t,i,10)}},7906:(t,i,s)=>{s.a(t,(async(t,i)=>{try{var h=s(1312),e=s(5637),n=s(1302),r=s(6948),o=s(8317),l=s(8738),a=s(3764),c=s(1120),f=s(1183),u=s(8950),d=s(4583),w=s(1673),A=s(2511),y=s(2682),p=s(8665),m=s(9298),I=s(1069),_=s(3554),E=s(353),g=s(2634),C=s(4544),T=s(2215),O=s(3955),b=s(7953),v=s(2646),L=s(3937),R=(s(9896),s(1908)),S=s(6666),M=s(3819),k=s(2595),x=s(3045),D=s(818),N=s(5599),P=s(1023),F=s(6169),U=s(2630),B=s(5327),G=s(670),H=s(9456),W=s(8268),Y=s(8412),V=s(3606),K=s(4197),X=s(254),z=s(7628),j=s(123),Z=s(9234),q=s(3867),$=s(1651),J=s(8534),Q=s(6730),tt=s(2164),it=s(7604),st=s(3795),ht=s(4909);class t extends $.K{load=async()=>{if(this.kt)this.xt=!0;else{this.kt=!0;try{await this.Go(10,'Connecting to fileserver'),await R.A.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new C.A(await C.A.openDatabase());const t=new I.A(new Uint8Array(await(0,Z.Ho)(`${$.K.et}/crc`)));for(let i=0;i<9;i++)this.Ft[i]=t.Ko;$.K.st||await this.Vo('scape_main',12345678,4e4);const i=await this.Fo('title','title screen',this.Ft[1],10);this.qt=i,this.di=y.A.za(i,'p11'),this.wi=y.A.za(i,'p12'),this.Ai=y.A.za(i,'b12'),this.yi=y.A.za(i,'q8'),await this.ja(),this.Za();const s=await this.Fo('config','config',this.Ft[2],15),u=await this.Fo('interface','interface',this.Ft[3],20),m=await this.Fo('media','2d graphics',this.Ft[4],30),_=await this.Fo('models','3d graphics',this.Ft[5],40),E=await this.Fo('textures','textures',this.Ft[6],60),g=await this.Fo('wordenc','chat system',this.Ft[7],65),T=await this.Fo('sounds','sound effects',this.Ft[8],70);this.Yn=new q.qa(G.A.xn,G.A.Xn,G.A.Xn),this.Wn=new q.$a(G.A.xn,G.A.Xn+1,G.A.Xn+1),this.Wn&&(this.He=new x.A(this.Wn,G.A.Xn,G.A.xn,G.A.Xn));for(let t=0;t34||t>34))999===i&&(i=h);else if(999!==i){s=h;break}this.hs[t-9]=i-21,this.es[t-9]=s-i}d.A.rc(479,96),this.$i=d.A.oc,d.A.rc(190,261),this.Ji=d.A.oc,d.A.rc(512,334),this.Qi=d.A.oc;const V=new Int32Array(9);for(let t=0;t<9;t++){const i=32*t+128+15,s=3*i+600,h=d.A.sin[i];V[t]=s*h>>16}x.A.init(512,334,500,800,V),b.A.ec(g),this.lc()}catch(t){console.error(t),this.Dt=!0}}};update=async()=>{this.xt||this.Dt||this.Nt||(this.Pt++,this.ac?await this.cc():await this.fc())};draw=async()=>{this.xt||this.Dt||this.Nt?this.zo():(this.ac?this.uc():await this.dc(),this.zs=0)};refresh=()=>{this.$t=!0};Go=async(t,i)=>{if(console.log(`${t}%: ${i}`),await this.wc(),!this.qt)return void await super.Go(t,i);this.si?.bind();this.Ai?.Ac(180,54,'RuneScape is loading - please wait...',m.A._l);u.A.Il(28,62,304,34,m.A.yc),u.A.Il(29,63,302,32,m.A.Bl),u.A.fillRect(30,64,3*t,30,m.A.yc),u.A.fillRect(30+3*t,64,300-3*t,30,m.A.Bl),this.Ai?.Ac(180,85,i,m.A._l),this.si?.draw(214,186),this.$t&&(this.$t=!1,this.mi||(this.hi?.draw(0,0),this.ei?.draw(661,0)),this.ti?.draw(128,0),this.ii?.draw(214,386),this.ni?.draw(0,265),this.ri?.draw(574,265),this.oi?.draw(128,186),this.li?.draw(574,186)),await(0,Z.Wo)(5)};mc=()=>{this.mi&&(this.Ic(),this.Ic(),this._c())};wc=async()=>{this.ti||(this.Mo=null,this.Fi=null,this.Ni=null,this.Di=null,this.Pi=null,this.Ui=null,this.Bi=null,this.Gi=null,this.hi=new f.A(128,265),u.A.clear(),this.ei=new f.A(128,265),u.A.clear(),this.ti=new f.A(533,186),u.A.clear(),this.ii=new f.A(360,146),u.A.clear(),this.si=new f.A(360,200),u.A.clear(),this.ni=new f.A(214,267),u.A.clear(),this.ri=new f.A(215,267),u.A.clear(),this.oi=new f.A(86,79),u.A.clear(),this.li=new f.A(87,79),u.A.clear(),this.qt&&(await this.ja(),this.Za()),this.$t=!0)};ja=async()=>{if(!this.qt)return;const t=await A.A.Ec(this.qt,'title');this.hi?.bind(),t.tc(0,0),this.ei?.bind(),t.tc(-661,0),this.ti?.bind(),t.tc(-128,0),this.ii?.bind(),t.tc(-214,-386),this.si?.bind(),t.tc(-214,-186),this.ni?.bind(),t.tc(0,-265),this.ri?.bind(),t.tc(-128,-186),this.oi?.bind(),t.tc(-128,-186),this.li?.bind(),t.tc(-574,-186),t.Ja(),this.hi?.bind(),t.tc(394,0),this.ei?.bind(),t.tc(-267,0),this.ti?.bind(),t.tc(266,0),this.ii?.bind(),t.tc(180,-386),this.si?.bind(),t.tc(180,-186),this.ni?.bind(),t.tc(394,-265),this.ri?.bind(),t.tc(-180,-265),this.oi?.bind(),t.tc(212,-186),this.li?.bind(),t.tc(-180,-186);const i=A.A.za(this.qt,'logo');this.ti?.bind(),i.draw((this.width/2|0)-(i.width/2|0)-128,18)};gc=t=>{if(!this.gi||!this.Ei)return;this.gi.fill(0);for(let t=0;t<5e3;t++){const t=128*Math.random()*256|0;this.gi[t]=256*Math.random()|0}for(let t=0;t<20;t++){for(let t=1;t<255;t++)for(let i=1;i<127;i++){const s=i+(t<<7);this.Ei[s]=(this.gi[s-1]+this.gi[s+1]+this.gi[s-128]+this.gi[s+128])/4|0}const t=this.gi;this.gi=this.Ei,this.Ei=t}if(t){let i=0;for(let s=0;s{if(this.qt){this.ai=w.A.za(this.qt,'titlebox'),this.ci=w.A.za(this.qt,'titlebutton');for(let t=0;t<12;t++)this.pi[t]=w.A.za(this.qt,'runes',t);this.Ii=new A.A(128,265),this._i=new A.A(128,265),this.hi&&(0,Z.Oc)(this.hi.nc,0,this.Ii.nc,0,33920),this.ei&&(0,Z.Oc)(this.ei.nc,0,this._i.nc,0,33920),this.bi=new Int32Array(256);for(let t=0;t<64;t++)this.bi[t]=262144*t;for(let t=0;t<64;t++)this.bi[t+64]=1024*t+m.A.RED;for(let t=0;t<64;t++)this.bi[t+128]=4*t+m.A.Gl;for(let t=0;t<64;t++)this.bi[t+192]=m.A._l;this.vi=new Int32Array(256);for(let t=0;t<64;t++)this.vi[t]=1024*t;for(let t=0;t<64;t++)this.vi[t+64]=4*t+m.A.GREEN;for(let t=0;t<64;t++)this.vi[t+128]=262144*t+m.A.bc;for(let t=0;t<64;t++)this.vi[t+192]=m.A._l;this.Li=new Int32Array(256);for(let t=0;t<64;t++)this.Li[t]=4*t;for(let t=0;t<64;t++)this.Li[t+64]=262144*t+m.A.BLUE;for(let t=0;t<64;t++)this.Li[t+128]=1024*t+m.A.vc;for(let t=0;t<64;t++)this.Li[t+192]=m.A._l;this.Oi=new Int32Array(256),this.gi=new Int32Array(32768),this.Ei=new Int32Array(32768),this.gc(null),this.Ci=new Int32Array(32768),this.Ti=new Int32Array(32768),this.Go(10,'Connecting to fileserver').then((()=>{this.mi||(this.mi=!0,this.xi=setInterval(this.mc,35))}))}};fc=async()=>{if(0===this.Jt){let t=(this.width/2|0)-80,i=20+(this.height/2|0);i+=20,1===this.Lc&&this.Rc>=t-75&&this.Rc<=t+75&&this.Sc>=i-20&&this.Sc<=i+20&&(this.Jt=3,this.Qt=0),t=80+(this.width/2|0),1===this.Lc&&this.Rc>=t-75&&this.Rc<=t+75&&this.Sc>=i-20&&this.Sc<=i+20&&(this.fi='',this.ui='Enter your username & password.',this.Jt=2,this.Qt=0)}else if(2===this.Jt){let t=(this.height/2|0)-40;t+=30,t+=25,1===this.Lc&&this.Sc>=t-15&&this.Sc=t-15&&this.Sc=i-75&&this.Rc<=i+75&&this.Sc>=s-20&&this.Sc<=s+20&&await this.Mc(this.username,this.password,!1),i=80+(this.width/2|0),1===this.Lc&&this.Rc>=i-75&&this.Rc<=i+75&&this.Sc>=s-20&&this.Sc<=s+20&&(this.Jt=0,this.username='',this.password='');;){const t=this.kc();if(-1===t)return;let i=!1;for(let s=0;s0&&(this.username=this.username.substring(0,this.username.length-1)),9!==t&&10!==t&&13!==t||(this.Qt=1),i&&(this.username=this.username+String.fromCharCode(t)),this.username.length>12&&(this.username=this.username.substring(0,12))):1===this.Qt&&(8===t&&this.password.length>0&&(this.password=this.password.substring(0,this.password.length-1)),9!==t&&10!==t&&13!==t||(this.Qt=0),i&&(this.password=this.password+String.fromCharCode(t)),this.password.length>20&&(this.password=this.password.substring(0,20)))}}else if(3===this.Jt){const t=this.width/2|0;let i=50+(this.height/2|0);i+=20,1===this.Lc&&this.Rc>=t-75&&this.Rc<=t+75&&this.Sc>=i-20&&this.Sc<=i+20&&(this.Jt=0)}};dc=async()=>{await this.wc(),this.si?.bind(),this.ai?.draw(0,0);if(0===this.Jt){let t=180,i=80;this.Ai?.Jl(t,i,'Welcome to RuneScape',m.A.Gl,!0),t=100,i=120,this.ci?.draw(t-73,i-20),this.Ai?.Jl(t,i+5,'New user',m.A._l,!0),t=260,this.ci?.draw(t-73,i-20),this.Ai?.Jl(t,i+5,'Existing User',m.A._l,!0)}else if(2===this.Jt){let t=100,i=60;this.fi.length>0?(this.Ai?.Jl(180,i-15,this.fi,m.A.Gl,!0),this.Ai?.Jl(180,i,this.ui,m.A.Gl,!0),i+=30):(this.Ai?.Jl(180,i-7,this.ui,m.A.Gl,!0),i+=30),this.Ai?.ta(90,i,`Username: ${this.username}${0===this.Qt&&this.Pt%40<20?'@yel@|':''}`,m.A._l,!0),i+=15,this.Ai?.ta(92,i,`Password: ${M.A.Dc(this.password)}${1===this.Qt&&this.Pt%40<20?'@yel@|':''}`,m.A._l,!0),i=150,this.ci?.draw(t-73,i-20),this.Ai?.Jl(t,i+5,'Login',m.A._l,!0),t=260,this.ci?.draw(t-73,i-20),this.Ai?.Jl(t,i+5,'Cancel',m.A._l,!0)}else if(3===this.Jt){this.Ai?.Jl(180,40,'Create a free account',m.A.Gl,!0);const t=180;let i=65;this.Ai?.Jl(180,i,'To create a new account you need to',m.A._l,!0),i+=15,this.Ai?.Jl(180,i,'go back to the main RuneScape webpage',m.A._l,!0),i+=15,this.Ai?.Jl(180,i,"and choose the red 'create account'",m.A._l,!0),i+=15,this.Ai?.Jl(180,i,'button at the top right of that page.',m.A._l,!0),i=150,this.ci?.draw(t-73,i-20),this.Ai?.Jl(t,i+5,'Cancel',m.A._l,!0)}this.si?.draw(214,186),this.$t&&(this.$t=!1,this.ti?.draw(128,0),this.ii?.draw(214,386),this.ni?.draw(0,265),this.ri?.draw(574,265),this.oi?.draw(128,186),this.li?.draw(574,186))};Mc=async(t,i,s)=>{try{s||(this.fi='',this.ui='Connecting to server...',await this.dc()),this.stream=new _.A(await _.A.Nc({host:$.K.ht,port:43594+$.K.portOffset})),await(this.stream?.Pc(this.in.data,0,8)),this.in.Fc=0,this.Ht=this.in.Uc;const h=new Int32Array([Math.floor(99999999*Math.random()),Math.floor(99999999*Math.random()),Number(this.Ht>>32n),Number(this.Ht&BigInt(4294967295))]);this.Bt.Fc=0,this.Bt.p1(10),this.Bt.p4(h[0]),this.Bt.p4(h[1]),this.Bt.p4(h[2]),this.Bt.p4(h[3]),this.Bt.p4(0),this.Bt.Bc(t),this.Bt.Bc(i),this.Bt.Gc($.K.ct,$.K.exponent),this.Gt.Fc=0,s?this.Gt.p1(18):this.Gt.p1(16),this.Gt.p1(this.Bt.Fc+36+1+1),this.Gt.p1($.K.tt),this.Gt.p1($.K.st?1:0);for(let t=0;t<9;t++)this.Gt.p4(this.Ft[t]);this.Gt.Hc(this.Bt.data,this.Bt.Fc,0),this.Bt.random=new g.A(h);for(let t=0;t<4;t++)h[t]+=50;this.Kt=new g.A(h),this.stream?.write(this.Gt.data,this.Gt.Fc);const e=await this.stream.read();if(1===e)return await(0,Z.Wo)(2e3),void await this.Mc(t,i,s);if(2===e||18===e){this.Br=18===e,k.A.Wc(),this.ac=!0,this.Bt.Fc=0,this.in.Fc=0,this.Xt=-1,this.zt=-1,this.jt=-1,this.Zt=-1,this.packetSize=0,this.Wt=0,this.Vt=0,this.Yt=0,this.Ah=0,this.nh=0,this.Qs=!1,this.Yc=0;for(let t=0;t<100;t++)this.Vh[t]=null;this.oe=0,this.Ie=0,this.We=0,this.ro=0,this.Ze=(100*Math.random()|0)-50,this.qe=(110*Math.random()|0)-55,this.$e=(80*Math.random()|0)-40,this.An=(120*Math.random()|0)-60,this.yn=(30*Math.random()|0)-20,this.Fn=(20*Math.random()|0)-10&2047,this.In=-1,this.Ke=0,this.Xe=0,this.rr=0,this.yr=0;for(let t=0;t{if(null!==this.nr){this.Vt>1&&this.Vt--,this.Yt>0&&this.Yt--;for(let t=0;t<5&&await this.read();t++);if(this.ac){for(let t=0;tthis.Ao+(this.wo/22|0)&&(this.wo=i.Fc,this.Ao=Date.now(),this.uo=this.lo[t],this.do=this.ao[t],await(0,j.zc)(i.data.slice(0,i.Fc),this.fo))}catch(t){console.error(t)}this.ro--;for(let i=t;i0&&(this.yo-=20,this.yo<0&&(this.yo=0),0===this.yo&&this.po&&!$.K.st&&this.mo&&await this.Vo(this.mo,this.Io,this._o));const t=k.A.flush();if(t&&(this.Bt.jc(O.A.Zc),this.Bt.p2(t.Fc),this.Bt.Hc(t.data,t.Fc,0),t.release()),this.Wt++,this.Wt>750&&await this.qc(),this.$c(),this.Jc(),this.Qc(),this.tf(),(1===this.if[1]||1===this.if[2]||1===this.if[3]||1===this.if[4])&&this.Nn++>5&&(this.Nn=0,this.Bt.jc(O.A.sf),this.Bt.p2(this.Pn),this.Bt.p2(this.Fn),this.Bt.p1(this.An),this.Bt.p1(this.yn)),this.Ye++,0!==this.js&&(this.Zs+=20,this.Zs>=400&&(this.js=0)),0!==this.ue&&(this.Ae++,this.Ae>=15&&(2===this.ue&&(this.Ws=!0),3===this.ue&&(this.Ys=!0),this.ue=0)),0!==this.se&&(this.ne++,(this.xl>this.he+5||this.xlthis.ee+5||this.Dl=5){if(this.Le=-1,this.ef(),this.Le===this.te&&this.Re!==this.ie){const t=c.A.Ro[this.te];if(t.Ll){const i=t.Ll[this.Re];t.Ll[this.Re]=t.Ll[this.ie],t.Ll[this.ie]=i}if(t.Rl){const i=t.Rl[this.Re];t.Rl[this.Re]=t.Rl[this.ie],t.Rl[this.ie]=i}this.Bt.jc(O.A.nf),this.Bt.p2(this.te),this.Bt.p2(this.ie),this.Bt.p2(this.Re)}}else(1===this.Ce||this.rf(this.nh-1))&&this.nh>2?this.lf():this.nh>0&&await this.af(this.nh-1);this.Ae=10,this.Lc=0}if($.K.dt++,$.K.dt>127&&($.K.dt=0,this.Bt.jc(O.A.cf),this.Bt.p3(4991788)),-1!==x.A.ff&&this.Sr){const t=x.A.ff,i=x.A.uf,s=this.df(this.Sr.wf[0],this.Sr.Af[0],t,i,0,0,0,0,0,0,!0);x.A.ff=-1,s&&(this.qs=this.Rc,this.$s=this.Sc,this.js=1,this.Zs=0)}1===this.Lc&&this.Lh&&(this.Lh=null,this.Ys=!0,this.Lc=0),await this.yf(),this.pf(),this.mf(),this.If(),1!==this.hf&&1!==this.Lc||this.zs++,2===this.We&&($.K.ot?this._f():this.Ef()),2===this.We&&this.ze&&this.gf();for(let t=0;t<5;t++)this.sn[t]++;if(await this.Cf(),this.Yc++,this.Yc>4500&&(this.Yt=250,this.Yc-=500,this.Bt.jc(O.A.Tf)),this.je++,this.je>500){this.je=0;const t=8*Math.random()|0;1&~t||(this.Ze+=this.Je),2&~t||(this.qe+=this.Qe),4&~t||(this.$e+=this.tn)}if(this.Ze<-50&&(this.Je=2),this.Ze>50&&(this.Je=-2),this.qe<-55&&(this.Qe=2),this.qe>55&&(this.Qe=-2),this.$e<-40&&(this.tn=1),this.$e>40&&(this.tn=-1),this.wn++,this.wn>500){this.wn=0;const t=8*Math.random()|0;1&~t||(this.An+=this.mn),2&~t||(this.yn+=this.pn)}this.An<-60&&(this.mn=2),this.An>60&&(this.mn=-2),this.yn<-20&&(this.pn=1),this.yn>10&&(this.pn=-1),$.K.wt++,$.K.wt>110&&($.K.wt=0,this.Bt.jc(O.A.Of),this.Bt.p4(0)),this.Pr++,this.Pr>50&&this.Bt.jc(O.A.bf);try{this.stream&&this.Bt.Fc>0&&(this.stream.write(this.Bt.data,this.Bt.Fc),this.Bt.Fc=0,this.Pr=0)}catch(t){console.log(t),await this.qc()}}}};uc=()=>{if(null===this.nr)return;this.$t&&(this.$t=!1,this.Hi?.draw(0,11),this.Wi?.draw(0,375),this.Yi?.draw(729,5),this.Vi?.draw(752,231),this.Ki?.draw(0,0),this.Xi?.draw(561,0),this.zi?.draw(520,11),this.ji?.draw(520,231),this.Zi?.draw(501,375),this.qi?.draw(0,345),this.Ws=!0,this.Ys=!0,this.Vs=!0,this.Ks=!0,2!==this.We&&(this.Pi?.draw(8,11),this.Ni?.draw(561,5))),2===this.We&&this.vf(),this.Qs&&1===this.th&&(this.Ws=!0);let t=!1;if(-1!==this.oh&&(t=this.ol(this.oh,this.Ye),t&&(this.Ws=!0)),2===this.ue&&(this.Ws=!0),2===this.se&&(this.Ws=!0),this.Ws&&(this.Lf(),this.Ws=!1),-1===this.lh){this.ah.Tl=this.fh-this.uh-77,this.xl>453&&this.xl<565&&this.Dl>350&&this.Rf(this.xl-22,this.Dl-375,this.fh,77,!1,463,0,this.ah);let t=this.fh-this.ah.Tl-77;t<0&&(t=0),t>this.fh-77&&(t=this.fh-77),this.uh!==t&&(this.uh=t,this.Ys=!0)}-1!==this.lh&&(t=this.ol(this.lh,this.Ye),t&&(this.Ys=!0)),3===this.ue&&(this.Ys=!0),3===this.se&&(this.Ys=!0),this.Lh&&(this.Ys=!0),this.Qs&&2===this.th&&(this.Ys=!0),this.Ys&&(this.Sf(),this.Ys=!1),2===this.We&&(this.Mf(),this.Ni?.draw(561,5)),-1!==this.Rh&&(this.Vs=!0),this.Vs&&(-1!==this.Rh&&this.Rh===this.Sh&&(this.Rh=-1,this.Bt.jc(O.A.kf),this.Bt.p1(this.Sh)),this.Vs=!1,this.Gi?.bind(),this.fs?.draw(0,0),-1===this.oh&&(-1!==this.Mh[this.Sh]&&(0===this.Sh?this.Rs?.draw(29,30):1===this.Sh?this.Ss?.draw(59,29):2===this.Sh?this.Ss?.draw(87,29):3===this.Sh?this.Ms?.draw(115,29):4===this.Sh?this.xs?.draw(156,29):5===this.Sh?this.xs?.draw(184,29):6===this.Sh&&this.ks?.draw(212,30)),-1!==this.Mh[0]&&(0!==this.Rh||this.Pt%20<10)&&this.us[0]?.draw(35,34),-1!==this.Mh[1]&&(1!==this.Rh||this.Pt%20<10)&&this.us[1]?.draw(59,32),-1!==this.Mh[2]&&(2!==this.Rh||this.Pt%20<10)&&this.us[2]?.draw(86,32),-1!==this.Mh[3]&&(3!==this.Rh||this.Pt%20<10)&&this.us[3]?.draw(121,33),-1!==this.Mh[4]&&(4!==this.Rh||this.Pt%20<10)&&this.us[4]?.draw(157,34),-1!==this.Mh[5]&&(5!==this.Rh||this.Pt%20<10)&&this.us[5]?.draw(185,32),-1!==this.Mh[6]&&(6!==this.Rh||this.Pt%20<10)&&this.us[6]?.draw(212,34)),this.Gi?.draw(520,165),this.Bi?.bind(),this.cs?.draw(0,0),-1===this.oh&&(-1!==this.Mh[this.Sh]&&(7===this.Sh?this.Ds?.draw(49,0):8===this.Sh?this.Ns?.draw(81,0):9===this.Sh?this.Ns?.draw(108,0):10===this.Sh?this.Ps?.draw(136,1):11===this.Sh?this.Us?.draw(178,0):12===this.Sh?this.Us?.draw(205,0):13===this.Sh&&this.Fs?.draw(233,0)),-1!==this.Mh[8]&&(8!==this.Rh||this.Pt%20<10)&&this.us[7]?.draw(80,2),-1!==this.Mh[9]&&(9!==this.Rh||this.Pt%20<10)&&this.us[8]?.draw(107,3),-1!==this.Mh[10]&&(10!==this.Rh||this.Pt%20<10)&&this.us[9]?.draw(142,4),-1!==this.Mh[11]&&(11!==this.Rh||this.Pt%20<10)&&this.us[10]?.draw(179,2),-1!==this.Mh[12]&&(12!==this.Rh||this.Pt%20<10)&&this.us[11]?.draw(206,2),-1!==this.Mh[13]&&(13!==this.Rh||this.Pt%20<10)&&this.us[12]?.draw(230,2)),this.Bi?.draw(501,492),this.Pi?.bind()),this.Ks&&(this.Ks=!1,this.Ui?.bind(),this.ls?.draw(0,0),this.wi?.Jl(57,33,'Public chat',m.A._l,!0),0===this.kh&&this.wi?.Jl(57,46,'On',m.A.GREEN,!0),1===this.kh&&this.wi?.Jl(57,46,'Friends',m.A.Gl,!0),2===this.kh&&this.wi?.Jl(57,46,'Off',m.A.RED,!0),3===this.kh&&this.wi?.Jl(57,46,'Hide',m.A.bc,!0),this.wi?.Jl(186,33,'Private chat',m.A._l,!0),0===this.xh&&this.wi?.Jl(186,46,'On',m.A.GREEN,!0),1===this.xh&&this.wi?.Jl(186,46,'Friends',m.A.Gl,!0),2===this.xh&&this.wi?.Jl(186,46,'Off',m.A.RED,!0),this.wi?.Jl(326,33,'Trade/duel',m.A._l,!0),0===this.Dh&&this.wi?.Jl(326,46,'On',m.A.GREEN,!0),1===this.Dh&&this.wi?.Jl(326,46,'Friends',m.A.Gl,!0),2===this.Dh&&this.wi?.Jl(326,46,'Off',m.A.RED,!0),this.wi?.Jl(462,38,'Report abuse',m.A._l,!0),this.Ui?.draw(0,471),this.Pi?.bind()),this.Ye=0};vf=()=>{if(this.Ve++,this.xf(),this.Df(),this.Nf(),this.Pf(),this.Ff(),!this.ze){let t=this.Pn;(this.dn/256|0)>t&&(t=this.dn/256|0),this.hn[4]&&this.nn[4]+128>t&&(t=this.nn[4]+128);const i=this.Fn+this.$e&2047;if(this.Sr&&this.Uf(this.Gn,this.Bf(this.Dn,this.Sr.x,this.Sr.z)-50,this.Hn,i,t,3*t+600),$.K.ut++,$.K.ut>1802){$.K.ut=0,this.Bt.jc(O.A.Gf),this.Bt.p1(0);const t=this.Bt.Fc;this.Bt.p2(29711),this.Bt.p1(70),this.Bt.p1(256*Math.random()|0),this.Bt.p1(242),this.Bt.p1(186),this.Bt.p1(39),this.Bt.p1(61),2*Math.random()|0||this.Bt.p1(13),2*Math.random()|0||this.Bt.p2(57856),this.Bt.p2(65536*Math.random()|0),this.Bt.Hf(this.Bt.Fc-t)}}let t;t=this.ze?this.Wf():this.Yf();const i=this.ln,s=this.an,h=this.cn,e=this.fn,n=this.un;let r;for(let t=0;t<5;t++)this.hn[t]&&(r=Math.random()*(2*this.en[t]+1)-this.en[t]+Math.sin(this.sn[t]*(this.rn[t]/100))*this.nn[t]|0,0===t&&(this.ln+=r),1===t&&(this.an+=r),2===t&&(this.cn+=r),3===t&&(this.un=this.un+r&2047),4===t&&(this.fn+=r,this.fn<128&&(this.fn=128),this.fn>383&&(this.fn=383)));r=d.A.Vf,p.A.Kf=!0,p.A.Xf=0,p.A.xl=this.xl-8,p.A.Dl=this.Dl-11,u.A.clear(),this.He?.draw(this.ln,this.an,this.cn,t,this.un,this.fn,this.Pt),this.He?.zf(),this.jf(),this.Zf(),$.K.nt&&this.qf(),this.$f(r),this.Jf(),this.Pi?.draw(8,11),this.ln=i,this.an=s,this.cn=h,this.fn=e,this.un=n};Qf=()=>{e.A.tu?.clear(),e.A.iu?.clear(),r.A.So?.clear(),n.A.So?.clear(),n.A.su?.clear(),W.A.So?.clear(),l.A.So?.clear()};hu=(t,i)=>{this.eu(t.x,i,t.z)};eu=(t,i,s)=>{if(t<128||s<128||t>13056||s>13056)return this.zn=-1,void(this.jn=-1);const h=this.Bf(this.Dn,t,s)-i;this.nu(t,h,s)};nu=(t,i,s)=>{let h=t-this.ln,e=i-this.an,n=s-this.cn;const r=d.A.sin[this.fn],o=d.A.cos[this.fn],l=d.A.sin[this.un],a=d.A.cos[this.un];let c=n*l+h*a>>16;n=n*a-h*l>>16,h=c,c=e*o-n*r>>16,n=e*r+n*o>>16,e=c,n>=50?(this.zn=d.A.na+((h<<9)/n|0),this.jn=d.A.ra+((e<<9)/n|0)):(this.zn=-1,this.jn=-1)};jf=()=>{this.Kr=0;for(let t=-1;t-1))for(let t=0;t<8;t++)h.ru&1<=0&&10===this.Ah&&this.Ih===this.lr[t]&&(this.hu(i,i.height+15),this.zn>-1&&this._s[7]?.draw(this.zn-12,this.jn-s))}else 1===this.Ah&&this.yh===this.pr[t-this.rr]&&this.Pt%20<10&&(this.hu(i,i.height+15),this.zn>-1&&this._s[2]?.draw(this.zn-12,this.jn-28));if(i.ou&&(t>=this.rr||0===this.kh||3===this.kh||1===this.kh&&this.lu(i.name))&&(this.hu(i,i.height),this.zn>-1&&this.Kr<$.K.Xr&&this.Ai&&(this.qr[this.Kr]=this.Ai.au(i.ou)/2|0,this.Zr[this.Kr]=this.Ai.height,this.zr[this.Kr]=this.zn,this.jr[this.Kr]=this.jn,this.$r[this.Kr]=i.cu,this.Jr[this.Kr]=i.fu,this.Qr[this.Kr]=i.uu,this.io[this.Kr++]=i.ou,0===this.Zh&&1===i.fu&&(this.Zr[this.Kr]+=10,this.jr[this.Kr]+=5),0===this.Zh&&2===i.fu&&(this.qr[this.Kr]=60))),i.du>this.Pt+100&&(this.hu(i,i.height+15),this.zn>-1)){let t=30*i.wu/i.Au|0;t>30&&(t=30),u.A.fillRect(this.zn-15,this.jn-3,t,5,m.A.GREEN),u.A.fillRect(this.zn-15+t,this.jn-3,30-t,5,m.A.RED)}if(i.du>this.Pt+330&&(this.hu(i,i.height/2|0),this.zn>-1&&(this.Is[i.yu]?.draw(this.zn-12,this.jn-12),this.di?.Ac(this.zn,this.jn+4,i.pu.toString(),m.A.Bl),this.di?.Ac(this.zn-1,this.jn+3,i.pu.toString(),m.A._l))),$.K.nt){if(i.pathLength>0||i.mu>=this.Pt||i.Iu>this.Pt){const t=64*i.size;this._u(128*i.wf[0]+t,128*i.Af[0]+t,this.Dn,i.size,65535,!1)}this._u(i.x,i.z,this.Dn,i.size,6710886,!1);let s=0;if(this.hu(i,i.height+30),t32767&&(i-=32768),this.di?.Ac(this.zn,this.jn+s,'Face Entity: '+i,m.A._l),s-=15}(t.Eu&W.A.Lu)===W.A.Lu&&(this.di?.Ac(this.zn,this.jn+s,'Say',m.A._l),s-=15),(t.Eu&W.A.Ru)===W.A.Ru&&(this.di?.Ac(this.zn,this.jn+s,'Hit: Type '+t.yu+' Amount '+t.pu+' HP '+t.wu+'/'+t.Au,m.A._l),s-=15),(t.Eu&W.A.Su)===W.A.Su&&(this.di?.Ac(this.zn,this.jn+s,'Face Coord: '+t.Mu/2+' '+t.ku/2,m.A._l),s-=15),(t.Eu&W.A.xu)===W.A.xu&&(this.di?.Ac(this.zn,this.jn+s,'Chat',m.A._l),s-=15),(t.Eu&W.A.Du)===W.A.Du&&(this.di?.Ac(this.zn,this.jn+s,'Play Spotanim: '+t.Nu,m.A._l),s-=15),(t.Eu&W.A.Pu)===W.A.Pu&&(this.di?.Ac(this.zn,this.jn+s,'Exact Move',m.A._l),s-=15)}}else{const t=i;let s=0;if(this.hu(i,i.height+30),this.di?.Ac(this.zn,this.jn+s,t.type?.name??null,m.A._l),s-=15,-1!==t.Eu&&this.Pt-t.gu<30){if((t.Eu&Y.A.Tu)===Y.A.Tu&&(this.di?.Ac(this.zn,this.jn+s,'Play Seq: '+t.Ou,m.A._l),s-=15),(t.Eu&Y.A.bu)===Y.A.bu){let i=t.vu;i>32767&&(i-=32768),this.di?.Ac(this.zn,this.jn+s,'Face Entity: '+i,m.A._l),s-=15}(t.Eu&Y.A.Lu)===Y.A.Lu&&(this.di?.Ac(this.zn,this.jn+s,'Say',m.A._l),s-=15),(t.Eu&Y.A.Ru)===Y.A.Ru&&(this.di?.Ac(this.zn,this.jn+s,'Hit: Type '+t.yu+' Amount '+t.pu+' HP '+t.wu+'/'+t.Au,m.A._l),s-=15),(t.Eu&Y.A.Fu)===Y.A.Fu&&(this.di?.Ac(this.zn,this.jn+s,'Change Type: '+t.type?.id??null,m.A._l),s-=15),(t.Eu&Y.A.Du)===Y.A.Du&&(this.di?.Ac(this.zn,this.jn+s,'Play Spotanim: '+t.Nu,m.A._l),s-=15),(t.Eu&Y.A.Su)===Y.A.Su&&(this.di?.Ac(this.zn,this.jn+s,'Face Coord: '+t.Mu/2+' '+t.ku/2,m.A._l),s-=15)}}}}}if($.K.nt)for(let t=0;t=104||i.z>=104||this._u(128*i.x+64,128*i.z+64,i.level,1,16776960,!1)}for(let t=0;tthis.jr[r]-this.Zr[r]&&s-ethis.zr[r]-this.qr[r]&&this.jr[r]-this.Zr[r]{2===this.Ah&&this._s[2]&&(this.eu((this._h-this.Tn<<7)+this.ph,2*this.gh,(this.Eh-this.On<<7)+this.mh),this.zn>-1&&this.Pt%20<10&&this._s[2].draw(this.zn-12,this.jn-28))};qf=()=>{const t=507;let i=13;this.Oo?this.di?.Hu(t,i,'tock',m.A.Gl,!0):this.Ai?.Hu(t,i,'tick',m.A.Gl,!0),i+=13,this.di?.Hu(t,i,`Fps: ${this.Wu}, ${this.Yu} ms`,m.A.Gl,!0),i+=13,this.di?.Hu(t,i,`Draw: ${this.ms.toFixed(1)}, Avg: ${this.Vu.toFixed(1)}, Slow: ${this.Ku.toFixed(1)} ms`,m.A.Gl,!0),i+=13,this.di?.Hu(t,i,`Occluders: ${x.A.Xu[x.A.zu]} Active: ${x.A.ju}`,m.A.Gl,!0),i+=13,this.di?.Hu(t,i,'Local Pos: '+(this.Sr?.x??-1)+', '+(this.Sr?.z??-1)+', '+(this.Sr?.y??-1),m.A.Gl,!0),i+=13,this.di?.Hu(t,i,'Camera Pos: '+this.ln+', '+this.cn+', '+this.an,m.A.Gl,!0),i+=13,this.di?.Hu(t,i,'Camera Angle: '+this.un+', '+this.fn,m.A.Gl,!0),i+=13,this.di?.Hu(t,i,'Cutscene Source: '+this.tr+', '+this.ir+' '+this.sr+'; '+this.hr+', '+this.er,m.A.Gl,!0),i+=13,this.di?.Hu(t,i,'Cutscene Destination: '+this.Zn+', '+this.qn+' '+this.$n+'; '+this.Jn+', '+this.Qn,m.A.Gl,!0),$.K.ot&&(i+=13,this.di?.Hu(t,i,'Instructions:',m.A.Gl,!0),i+=13,this.di?.Hu(t,i,'- Arrows to move Camera',m.A.Gl,!0),i+=13,this.di?.Hu(t,i,'- Shift to control Source or Dest',m.A.Gl,!0),i+=13,this.di?.Hu(t,i,'- Alt to control Height',m.A.Gl,!0),i+=13,this.di?.Hu(t,i,'- Ctrl to control Modifier',m.A.Gl,!0))};_u=(t,i,s,h,e,n)=>{const r=this.Bf(s,t,i),o=64*h;this.nu(t-o,r,i-o);const l=this.zn,a=this.jn;this.nu(t+o,r,i-o);const c=this.zn,f=this.jn;this.nu(t-o,r,i+o);const d=this.zn,w=this.jn;this.nu(t+o,r,i+o);const A=this.zn,y=this.jn;-1!==l&&-1!==c&&-1!==d&&-1!==A&&(n&&(u.A.Zu(l,a,A,y,(16711422&e)>>1),u.A.Zu(c,f,d,w,(16711422&e)>>1)),u.A.Zu(l,a,c,f,e),u.A.Zu(l,a,d,w,e),u.A.Zu(c,f,A,y,e),u.A.Zu(d,w,A,y,e))};_f(){const t=1==this.if[5]?2:1;1==this.if[6]?(1==this.if[1]?(this.Zn-=t,this.Zn<1&&(this.Zn=1)):1==this.if[2]&&(this.Zn+=t,this.Zn>102&&(this.Zn=102)),1==this.if[3]?1==this.if[7]?this.$n+=2*t:(this.qn+=1,this.qn>102&&(this.qn=102)):1==this.if[4]&&(1==this.if[7]?this.$n-=2*t:(this.qn-=1,this.qn<1&&(this.qn=1)))):(1==this.if[1]?(this.tr-=t,this.tr<1&&(this.tr=1)):1==this.if[2]&&(this.tr+=t,this.tr>102&&(this.tr=102)),1==this.if[3]?1==this.if[7]?this.sr+=2*t:(this.ir+=t,this.ir>102&&(this.ir=102)):1==this.if[4]&&(1==this.if[7]?this.sr-=2*t:(this.ir-=t,this.ir<1&&(this.ir=1)))),this.ln=128*this.tr+64,this.cn=128*this.ir+64,this.an=this.Bf(this.Dn,this.tr,this.ir)-this.sr;const i=128*this.Zn+64,s=128*this.qn+64,h=this.Bf(this.Dn,this.Zn,this.qn)-this.$n,e=i-this.ln,n=h-this.an,r=s-this.cn,o=0|Math.sqrt(e*e+r*r);this.fn=325.949*Math.atan2(n,o)&2047,this.un=-325.949*Math.atan2(e,r)&2047,this.fn<128&&(this.fn=128),this.fn>383&&(this.fn=383)}Jf=()=>{if(this.qu(),1===this.js&&this.gs[this.Zs/100|0]?.draw(this.qs-8-8,this.$s-8-11),2===this.js&&this.gs[4+(this.Zs/100|0)]?.draw(this.qs-8-8,this.$s-8-11),-1!==this.Xs&&(this.ol(this.Xs,this.Ye),this.Al(c.A.Ro[this.Xs],0,0,0)),this.$u(),this.Qs?0===this.th&&this.Ju():(this.ef(),this.Qu()),1===this.kr&&(this.Fr>0||1===this.Ur?this._s[1]?.draw(472,258):this._s[1]?.draw(472,296)),this.Fr>0&&(this._s[0]?.draw(472,296),this.wi?.Ac(484,329,'Level: '+this.Fr,m.A.Gl)),1===this.Ur&&(this._s[6]?.draw(472,296),this.wi?.Ac(484,329,'Arena',m.A.Gl)),0!==this.Vt){let t=this.Vt/50|0;const i=t/60|0;t%=60,t<10?this.wi?.Fl(4,329,'System update in: '+i+':0'+t,m.A.Gl):this.wi?.Fl(4,329,'System update in: '+i+':'+t,m.A.Gl)}};qu=()=>{if(0===this.jh)return;const t=this.wi;let i=0;0!==this.Vt&&(i=1);for(let s=0;s<100;s++){if(!this.Vh[s])continue;const h=this.messageType[s];let e;if((3===h||7===h)&&(7===h||0===this.xh||1===this.xh&&this.lu(this.Kh[s]))&&(e=329-13*i,t?.Fl(4,e,'From '+this.Kh[s]+': '+this.Vh[s],m.A.Bl),t?.Fl(4,e-1,'From '+this.Kh[s]+': '+this.Vh[s],m.A.bc),i++,i>=5))return;if(5===h&&this.xh<2&&(e=329-13*i,t?.Fl(4,e,this.Vh[s],m.A.Bl),t?.Fl(4,e-1,this.Vh[s],m.A.bc),i++,i>=5))return;if(6===h&&this.xh<2&&(e=329-13*i,t?.Fl(4,e,'To '+this.Kh[s]+': '+this.Vh[s],m.A.Bl),t?.Fl(4,e-1,'To '+this.Kh[s]+': '+this.Vh[s],m.A.bc),i++,i>=5))return}};$u=()=>{if(!this.Sr)return;const t=(this.Sr.x>>7)+this.Tn,i=(this.Sr.z>>7)+this.On;if(this.Fr=t>=2944&&t<3392&&i>=3520&&i<6400?1+((i-3520)/8|0):t>=2944&&t<3392&&i>=9920&&i<12800?1+((i-9920)/8|0):0,this.Ur=0,t>=3328&&t<3392&&i>=3200&&i<3264){const s=63&t,h=63&i;(s>=4&&s<=29&&h>=44&&h<=58||s>=36&&s<=61&&h>=44&&h<=58||s>=4&&s<=29&&h>=25&&h<=39||s>=36&&s<=61&&h>=25&&h<=39||s>=4&&s<=29&&h>=6&&h<=20||s>=36&&s<=61&&h>=6&&h<=20)&&(this.Ur=1)}0===this.Ur&&t>=3328&&t<=3393&&i>=3203&&i<=3325&&(this.Ur=2),this.Js=0,(t>=3053&&t<=3156&&i>=3056&&i<=3136||t>=3072&&t<=3118&&i>=9492&&i<=9535)&&(this.Js=1),1===this.Js&&t>=3139&&t<=3199&&i>=3008&&i<=3062&&(this.Js=0)};Lf=()=>{this.Di?.bind(),this.Ji&&(d.A.oc=this.Ji),this.ns?.draw(0,0),-1!==this.oh?this.Al(c.A.Ro[this.oh],0,0,0):-1!==this.Mh[this.Sh]&&this.Al(c.A.Ro[this.Mh[this.Sh]],0,0,0),this.Qs&&1===this.th&&this.Ju(),this.Di?.draw(562,231),this.Pi?.bind(),this.Qi&&(d.A.oc=this.Qi)};Sf=()=>{if(this.Fi?.bind(),this.$i&&(d.A.oc=this.$i),this.rs?.draw(0,0),this.Fh)this.Ai?.Ac(239,40,this.Uh,m.A.Bl),this.Ai?.Ac(239,60,this.Bh+'*',m.A.td);else if(this.Wh)this.Ai?.Ac(239,40,'Enter amount:',m.A.Bl),this.Ai?.Ac(239,60,this.Hh+'*',m.A.td);else if(this.Lh)this.Ai?.Ac(239,40,this.Lh,m.A.Bl),this.Ai?.Ac(239,60,'Click to continue',m.A.td);else if(-1!==this.lh)this.Al(c.A.Ro[this.lh],0,0,0);else if(-1===this.Yh){let t=this.wi;0===$.K.rt&&(t=this.yi);let i=0;u.A.yl(0,0,463,77);for(let s=0;s<100;s++){const h=this.Vh[s];if(!h)continue;const e=this.messageType[s],n=this.uh+70-14*i;0===e&&(n>0&&n<110&&t?.Fl(4,n,h,m.A.Bl),i++),1===e&&(n>0&&n<110&&(t?.Fl(4,n,this.Kh[s]+':',m.A._l),t?.Fl(t.au(this.Kh[s])+12,n,h,m.A.BLUE)),i++),2===e&&(0===this.kh||1===this.kh&&this.lu(this.Kh[s]))&&(n>0&&n<110&&(t?.Fl(4,n,this.Kh[s]+':',m.A.Bl),t?.Fl(t.au(this.Kh[s])+12,n,h,m.A.BLUE)),i++),3!==e&&7!==e||0!==this.jh||!(7===e||0===this.xh||1===this.xh&&this.lu(this.Kh[s]))||(n>0&&n<110&&(t?.Fl(4,n,'From '+this.Kh[s]+':',m.A.Bl),t?.Fl(t.au('From '+this.Kh[s])+12,n,h,m.A.sd)),i++),4===e&&(0===this.Dh||1===this.Dh&&this.lu(this.Kh[s]))&&(n>0&&n<110&&t?.Fl(4,n,this.Kh[s]+' '+this.Vh[s],m.A.hd),i++),5===e&&0===this.jh&&this.xh<2&&(n>0&&n<110&&t?.Fl(4,n,h,m.A.sd),i++),6===e&&0===this.jh&&this.xh<2&&(n>0&&n<110&&(t?.Fl(4,n,'To '+this.Kh[s]+':',m.A.Bl),t?.Fl(t.au('To '+this.Kh[s])+12,n,h,m.A.sd)),i++),8===e&&(0===this.Dh||1===this.Dh&&this.lu(this.Kh[s]))&&(n>0&&n<110&&t?.Fl(4,n,this.Kh[s]+' '+this.Vh[s],m.A.ed),i++)}u.A.Gu(),this.fh=14*i+7,this.fh<78&&(this.fh=78),this.tl(463,0,this.fh-this.uh-77,this.fh,77),0==$.K.rt?t?.Fl(3,90,this.qh+'*',m.A.Bl):1==$.K.rt?t?.Fl(3,90,this.qh+'*',m.A.BLUE):(t?.Fl(4,90,M.A.ga(this.username)+':',m.A.Bl),t?.Fl(t.au(this.username+': ')+6,90,this.qh+'*',m.A.BLUE)),u.A.nl(0,77,m.A.Bl,479)}else this.Al(c.A.Ro[this.Yh],0,0,0);this.Qs&&2===this.th&&this.Ju(),this.Fi?.draw(22,375),this.Pi?.bind(),this.Qi&&(d.A.oc=this.Qi)};Mf=()=>{if(this.Ni?.bind(),!this.Sr)return;const t=this.Fn+this.An&2047;let i=48+(this.Sr.x/32|0),s=464-(this.Sr.z/32|0);this.ws?.nd(21,9,146,151,this.hs,this.es,i,s,t,this.yn+256),this.As?.nd(0,0,33,33,this.ts,this.ss,25,25,this.Fn,256);for(let t=0;t{if(!i)return;const h=this.Fn+this.An&2047,e=s*s+t*t;if(e>6400)return;let n=d.A.sin[h],r=d.A.cos[h];n=256*n/(this.yn+256)|0,r=256*r/(this.yn+256)|0;const o=t*n+s*r>>16,l=t*r-s*n>>16;e>2500&&this.os?i.ad(o+94-(i.Pl/2|0),83-l-(i.fd/2|0),this.os):i.draw(o+94-(i.Pl/2|0),83-l-(i.fd/2|0))};ud=t=>{if(!this.ws)return;const i=this.ws.nc,s=i.length;for(let t=0;t>14&32767;const h=e.A.get(s).yd;if(h<0)continue;let n=t,r=i;if(22!==h&&29!==h&&34!==h&&36!==h&&46!==h&&47!==h&&48!==h){const s=G.A.Xn,h=G.A.Xn,e=this.kn[this.Dn];if(e){const o=e.flags;for(let e=0;e<10;e++){const e=4*Math.random()|0;0===e&&n>0&&n>t-3&&(o[G.A.index(n-1,r)]&H.A.pd)===H.A.OPEN&&n--,1===e&&n0&&r>i-3&&(o[G.A.index(n,r-1)]&H.A.Id)===H.A.OPEN&&r--,3===e&&r{if(!this.He||!this.ws)return;let r=this.He.Ed(s,t,i);if(0!==r){const o=this.He.gd(s,t,i,r),l=o>>6&3,a=31&o;let c=h;r>0&&(c=n);const f=this.ws.nc,u=4*t+512*(103-i)*4+24624,d=r>>14&32767,w=e.A.get(d);if(-1===w.Cd)a!==P.A.Td.id&&a!==P.A.Od.id||(l===F.A.bd?(f[u]=c,f[u+512]=c,f[u+1024]=c,f[u+1536]=c):l===F.A.vd?(f[u]=c,f[u+1]=c,f[u+2]=c,f[u+3]=c):l===F.A.Ld?(f[u+3]=c,f[u+3+512]=c,f[u+3+1024]=c,f[u+3+1536]=c):l===F.A.Rd&&(f[u+1536]=c,f[u+1536+1]=c,f[u+1536+2]=c,f[u+1536+3]=c)),a===P.A.Sd.id&&(l===F.A.bd?f[u]=c:l===F.A.vd?f[u+3]=c:l===F.A.Ld?f[u+3+1536]=c:l===F.A.Rd&&(f[u+1536]=c)),a===P.A.Od.id&&(l===F.A.Rd?(f[u]=c,f[u+512]=c,f[u+1024]=c,f[u+1536]=c):l===F.A.bd?(f[u]=c,f[u+1]=c,f[u+2]=c,f[u+3]=c):l===F.A.vd?(f[u+3]=c,f[u+3+512]=c,f[u+3+1024]=c,f[u+3+1536]=c):l===F.A.Ld&&(f[u+1536]=c,f[u+1536+1]=c,f[u+1536+2]=c,f[u+1536+3]=c));else{const s=this.ys[w.Cd];if(s){const h=(4*w.width-s.width)/2|0,e=(4*w.length-s.height)/2|0;s.draw(4*t+48+h,4*(G.A.Xn-i-w.length)+e+48)}}}if(r=this.He.Md(s,t,i),0!==r){const h=this.He.gd(s,t,i,r),n=h>>6&3,o=31&h,l=r>>14&32767,a=e.A.get(l);if(-1!==a.Cd){const s=this.ys[a.Cd];if(s){const h=(4*a.width-s.width)/2|0,e=(4*a.length-s.height)/2|0;s.draw(4*t+48+h,4*(G.A.Xn-i-a.length)+e+48)}}else if(o===P.A.kd.id){let s=15658734;r>0&&(s=15597568);const h=this.ws.nc,e=4*t+512*(G.A.Xn-1-i)*4+24624;n===F.A.bd||n===F.A.Ld?(h[e+1536]=s,h[e+1024+1]=s,h[e+512+2]=s,h[e+3]=s):(h[e]=s,h[e+512+1]=s,h[e+1024+2]=s,h[e+1536+3]=s)}}if(r=this.He.Ad(s,t,i),0!==r){const s=e.A.get(r>>14&32767);if(-1!==s.Cd){const h=this.ys[s.Cd];if(h){const e=(4*s.width-h.width)/2|0,n=(4*s.length-h.height)/2|0;h.draw(4*t+48+e,4*(G.A.Xn-i-s.length)+n+48)}}}};Qu=()=>{if(this.nh<2&&0===this.oe&&0===this.Ie)return;let t;t=1===this.oe&&this.nh<2?'Use '+this.fe+' with...':1===this.Ie&&this.nh<2?this.ge+'...':this.rh[this.nh-1],this.nh>2&&(t=t+'@whi@ / '+(this.nh-2)+' more options'),this.Ai?.xd(4,15,t,m.A._l,!0,this.Pt/1e3|0)};Ju=()=>{const t=this.ih,i=this.sh,s=this.hh,h=this.eh,e=m.A.Dd;u.A.fillRect(t,i,s,h,e),u.A.fillRect(t+1,i+1,s-2,16,m.A.Bl),u.A.Il(t+1,i+18,s-2,h-19,m.A.Bl),this.Ai?.Fl(t+3,i+14,'Choose Option',e);let n=this.xl,r=this.Dl;0===this.th&&(n-=8,r-=11),1===this.th&&(n-=562,r-=231),2===this.th&&(n-=22,r-=375);for(let h=0;ht&&ne-13&&r{if(0!==this.se)return;let t=this.Lc;if(1===this.Ie&&this.Rc>=520&&this.Sc>=165&&this.Rc<=788&&this.Sc<=230&&(t=0),this.Qs){if(1!==t){let t=this.xl,i=this.Dl;0===this.th?(t-=8,i-=11):1===this.th?(t-=562,i-=231):2===this.th&&(t-=22,i-=375),(tthis.ih+this.hh+10||ithis.sh+this.eh+10)&&(this.Qs=!1,1===this.th&&(this.Ws=!0),2===this.th&&(this.Ys=!0))}if(1===t){const t=this.ih,i=this.sh,s=this.hh;let h=this.Rc,e=this.Sc;0===this.th?(h-=8,e-=11):1===this.th?(h-=562,e-=231):2===this.th&&(h-=22,e-=375);let n=-1;for(let r=0;rt&&ho-13&&e0){const t=this.Te[this.nh-1];if(602===t||596===t||22===t||892===t||415===t||405===t||38===t||422===t||478===t||347===t||188===t){const t=this.be[this.nh-1],i=this.ve[this.nh-1];if(c.A.Ro[i].draggable)return this.re=!1,this.ne=0,this.te=i,this.ie=t,this.se=2,this.he=this.Rc,this.ee=this.Sc,c.A.Ro[i].Nd===this.Xs&&(this.se=1),void(c.A.Ro[i].Nd===this.lh&&(this.se=3))}}if(1===t&&(1===this.Ce||this.rf(this.nh-1))&&this.nh>2&&(t=2),1===t&&this.nh>0&&await this.af(this.nh-1),2!==t||this.nh<=0)return;this.lf()}};pf=()=>{if(1===this.Lc&&this.Sr){let t=this.Rc-21-561,i=this.Sc-9-5;if(t>=0&&i>=0&&t<146&&i<151){t-=73,i-=75;const s=this.Fn+this.An&2047;let h=d.A.sin[s],e=d.A.cos[s];h=h*(this.yn+256)>>8,e=e*(this.yn+256)>>8;const n=i*h+t*e>>11,r=i*e-t*h>>11,o=this.Sr.x+n>>7,l=this.Sr.z-r>>7;this.df(this.Sr.wf[0],this.Sr.Af[0],o,l,1,0,0,0,0,0,!0)&&(this.Bt.p1(t),this.Bt.p1(i),this.Bt.p2(this.Fn),this.Bt.p1(57),this.Bt.p1(this.An),this.Bt.p1(this.yn),this.Bt.p1(89),this.Bt.p2(this.Sr.x),this.Bt.p2(this.Sr.z),this.Bt.p1(this.Rr),this.Bt.p1(63))}}};rf=t=>{if(t<0)return!1;let i=this.Te[t];return i>=2e3&&(i-=2e3),406===i};af=async t=>{if(t<0)return;this.Wh&&(this.Wh=!1,this.Ys=!0);let i=this.Te[t];const s=this.Oe[t],h=this.be[t],r=this.ve[t];if(i>=2e3&&(i-=2e3),903===i||363===i){let s=this.rh[t];const h=s.indexOf('@whi@');if(-1!==h){s=s.substring(h+5).trim();const t=M.A.ga(M.A.Ca(M.A.ld(s)));let e=!1;for(let s=0;s=90&&this.Bt.jc(O.A.Hd),this.Bt.jc(O.A.Wd)):347===i?this.Bt.jc(O.A.Yd):422===i?this.Bt.jc(O.A.Vd):405===i?($.K.Et+=s,$.K.Et>=97&&(this.Bt.jc(O.A.Kd),this.Bt.p3(14953816)),this.Bt.jc(O.A.Xd)):38===i&&this.Bt.jc(O.A.zd),this.Bt.p2(s),this.Bt.p2(h),this.Bt.p2(r),this.Ae=0,this.we=r,this.de=h,this.ue=2,c.A.Ro[r].Nd===this.Xs&&(this.ue=1),c.A.Ro[r].Nd===this.lh&&(this.ue=3);else if(728===i||542===i||6===i||963===i||245===i){const t=this.Ar[s];t&&this.Sr&&(this.df(this.Sr.wf[0],this.Sr.Af[0],t.wf[0],t.Af[0],2,1,1,0,0,0,!1),this.qs=this.Rc,this.$s=this.Sc,this.js=2,this.Zs=0,542===i?this.Bt.jc(O.A.jd):6===i?(3&s||$.K._t++,$.K._t>=124&&(this.Bt.jc(O.A.Zd),this.Bt.p4(0)),this.Bt.jc(O.A.qd)):963===i?this.Bt.jc(O.A.$d):728===i?this.Bt.jc(O.A.Jd):245===i&&(3&s||$.K.gt++,$.K.gt>=85&&(this.Bt.jc(O.A.Qd),this.Bt.p2(39596)),this.Bt.jc(O.A.tw)),this.Bt.p2(s))}else if(217===i){if(this.Sr){this.df(this.Sr.wf[0],this.Sr.Af[0],h,r,2,0,0,0,0,0,!1)||this.df(this.Sr.wf[0],this.Sr.Af[0],h,r,2,1,1,0,0,0,!1),this.qs=this.Rc,this.$s=this.Sc,this.js=2,this.Zs=0,this.Bt.jc(O.A.iw),this.Bt.p2(h+this.Tn),this.Bt.p2(r+this.On),this.Bt.p2(s),this.Bt.p2(this.ce),this.Bt.p2(this.le),this.Bt.p2(this.ae)}}else if(1175===i){const t=s>>14&32767,i=e.A.get(t);let h;h=i.sw?i.sw:"It's a "+i.name+'.',this.Ud(0,h,'')}else if(285===i)this.Bd(O.A.hw,h,r,s);else if(881===i)this.Bt.jc(O.A.ew),this.Bt.p2(s),this.Bt.p2(h),this.Bt.p2(r),this.Bt.p2(this.ce),this.Bt.p2(this.le),this.Bt.p2(this.ae),this.Ae=0,this.we=r,this.de=h,this.ue=2,c.A.Ro[r].Nd===this.Xs&&(this.ue=1),c.A.Ro[r].Nd===this.lh&&(this.ue=3);else if(391===i)this.Bt.jc(O.A.nw),this.Bt.p2(s),this.Bt.p2(h),this.Bt.p2(r),this.Bt.p2(this._e),this.Ae=0,this.we=r,this.de=h,this.ue=2,c.A.Ro[r].Nd===this.Xs&&(this.ue=1),c.A.Ro[r].Nd===this.lh&&(this.ue=3);else if(660===i)this.Qs?this.He?.click(h-8,r-11):this.He?.click(this.Rc-8,this.Sc-11);else{if(188===i)return this.oe=1,this.le=h,this.ae=r,this.ce=s,this.fe=n.A.get(s).name,void(this.Ie=0);if(44===i)this.ye||(this.Bt.jc(O.A.rw),this.Bt.p2(r),this.ye=!0);else if(1773===i){const t=n.A.get(s);let i;i=r>=1e5?r+' x '+t.name:t.sw?t.sw:"It's a "+t.name+'.',this.Ud(0,i,'')}else if(900===i){const t=this.Ar[s];t&&this.Sr&&(this.df(this.Sr.wf[0],this.Sr.Af[0],t.wf[0],t.Af[0],2,1,1,0,0,0,!1),this.qs=this.Rc,this.$s=this.Sc,this.js=2,this.Zs=0,this.Bt.jc(O.A.ow),this.Bt.p2(s),this.Bt.p2(this.ce),this.Bt.p2(this.le),this.Bt.p2(this.ae))}else if(1373===i||1544===i||151===i||1101===i){const t=this.nr[s];t&&this.Sr&&(this.df(this.Sr.wf[0],this.Sr.Af[0],t.wf[0],t.Af[0],2,1,1,0,0,0,!1),this.qs=this.Rc,this.$s=this.Sc,this.js=2,this.Zs=0,1101===i?this.Bt.jc(O.A.Fd):151===i?($.K.bt++,$.K.bt>=90&&(this.Bt.jc(O.A.lw),this.Bt.p2(31114)),this.Bt.jc(O.A.aw)):1373===i?this.Bt.jc(O.A.Pd):1544===i&&this.Bt.jc(O.A.cw),this.Bt.p2(s))}else if(265===i){const t=this.Ar[s];t&&this.Sr&&(this.df(this.Sr.wf[0],this.Sr.Af[0],t.wf[0],t.Af[0],2,1,1,0,0,0,!1),this.qs=this.Rc,this.$s=this.Sc,this.js=2,this.Zs=0,this.Bt.jc(O.A.fw),this.Bt.p2(s),this.Bt.p2(this._e))}else if(679===i){const i=this.rh[t],s=i.indexOf('@whi@');if(-1!==s){const t=M.A.ld(i.substring(s+5).trim());let h=-1;for(let i=0;i0&&(this.Ys=!0,this.Wh=!1,this.Fh=!0,this.Bh='',this.Gh=3,this.no=this.ho[h],this.Uh='Enter message to send to '+this.so[h])}}else if(55===i)this.Bd(O.A.uw,h,r,s)&&this.Bt.p2(this._e);else if(224===i||993===i||99===i||746===i||877===i){if(this.Sr){this.df(this.Sr.wf[0],this.Sr.Af[0],h,r,2,0,0,0,0,0,!1)||this.df(this.Sr.wf[0],this.Sr.Af[0],h,r,2,1,1,0,0,0,!1),this.qs=this.Rc,this.$s=this.Sc,this.js=2,this.Zs=0,224===i?this.Bt.jc(O.A.dw):746===i?this.Bt.jc(O.A.ww):877===i?this.Bt.jc(O.A.Aw):99===i?this.Bt.jc(O.A.yw):993===i&&this.Bt.jc(O.A.pw),this.Bt.p2(h+this.Tn),this.Bt.p2(r+this.On),this.Bt.p2(s)}}else if(1607===i){const t=this.Ar[s];if(t&&t.type){let i;i=t.type.sw?t.type.sw:"It's a "+t.type.name+'.',this.Ud(0,i,'')}}else if(504===i)this.Bd(O.A.mw,h,r,s);else{if(930===i){const t=c.A.Ro[r];this.Ie=1,this._e=r,this.Ee=t.Iw,this.oe=0;let i=t._w;i&&-1!==i.indexOf(' ')&&(i=i.substring(0,i.indexOf(' ')));let s=t._w;return s&&-1!==s.indexOf(' ')&&(s=s.substring(s.indexOf(' ')+1)),this.ge=i+' '+t.action+' '+s,void(16===this.Ee&&(this.Ws=!0,this.Sh=3,this.Vs=!0))}if(951===i){const t=c.A.Ro[r];let i=!0;t.El>0&&(i=this.Ew(t)),i&&(this.Bt.jc(O.A.gw),this.Bt.p2(r))}else if(602===i||596===i||22===i||892===i||415===i)22===i?this.Bt.jc(O.A.Cw):415===i?(3&r||$.K.Ot++,$.K.Ot>=55&&(this.Bt.jc(O.A.Tw),this.Bt.p4(0)),this.Bt.jc(O.A.Ow)):602===i?this.Bt.jc(O.A.bw):892===i?(3&h||$.K.vt++,$.K.vt>=130&&(this.Bt.jc(O.A.Lw),this.Bt.p1(177)),this.Bt.jc(O.A.Rw)):596===i&&this.Bt.jc(O.A.Sw),this.Bt.p2(s),this.Bt.p2(h),this.Bt.p2(r),this.Ae=0,this.we=r,this.de=h,this.ue=2,c.A.Ro[r].Nd===this.Xs&&(this.ue=1),c.A.Ro[r].Nd===this.lh&&(this.ue=3);else if(581===i)3&s||$.K.It++,$.K.It>=99&&(this.Bt.jc(O.A.Mw),this.Bt.p4(0)),this.Bd(O.A.kw,h,r,s);else if(965===i){if(this.Sr){this.df(this.Sr.wf[0],this.Sr.Af[0],h,r,2,0,0,0,0,0,!1)||this.df(this.Sr.wf[0],this.Sr.Af[0],h,r,2,1,1,0,0,0,!1),this.qs=this.Rc,this.$s=this.Sc,this.js=2,this.Zs=0,this.Bt.jc(O.A.xw),this.Bt.p2(h+this.Tn),this.Bt.p2(r+this.On),this.Bt.p2(s),this.Bt.p2(this._e)}}else if(1501===i)$.K.Tt+=this.On,$.K.Tt>=92&&(this.Bt.jc(O.A.Dw),this.Bt.p4(0)),this.Bd(O.A.Nw,h,r,s);else if(364===i)this.Bd(O.A.Pw,h,r,s);else if(1102===i){const t=n.A.get(s);let i;i=t.sw?t.sw:"It's a "+t.name+'.',this.Ud(0,i,'')}else if(960===i){this.Bt.jc(O.A.gw),this.Bt.p2(r);const t=c.A.Ro[r];if(t.scripts&&t.scripts[0]&&5===t.scripts[0][0]){const i=t.scripts[0][1];t.Qo&&this.pe[i]!==t.Qo[0]&&(this.pe[i]=t.Qo[0],await this.Fw(i),this.Ws=!0)}}else if(34===i){const i=this.rh[t],s=i.indexOf('@whi@');if(-1!==s){this.Uw(),this.Me=i.substring(s+5).trim(),this.ke=!1;for(let t=0;t{const i=t.El;if(i===c.A.Kw&&(this.Ys=!0,this.Wh=!1,this.Fh=!0,this.Bh='',this.Gh=1,this.Uh='Enter name of friend to add to list'),i===c.A.Xw&&(this.Ys=!0,this.Wh=!1,this.Fh=!0,this.Bh='',this.Gh=2,this.Uh='Enter name of friend to delete from list'),i===c.A.zw)return this.Yt=250,!0;if(i===c.A.jw&&(this.Ys=!0,this.Wh=!1,this.Fh=!0,this.Bh='',this.Gh=4,this.Uh='Enter name of player to add to list'),i===c.A.Zw&&(this.Ys=!0,this.Wh=!1,this.Fh=!0,this.Bh='',this.Gh=5,this.Uh='Enter name of player to delete from list'),i>=c.A.qw&&i<=c.A.$w){const t=(i-300)/2|0,s=1&i;let h=this.Wr[t];if(-1!==h)for(;;)if(0===s&&(h--,h<0&&(h=o.A.count-1)),1===s&&(h++,h>=o.A.count&&(h=0)),!o.A.Ro[h].disable&&o.A.Ro[h].type===t+(this.Gr?0:7)){this.Wr[t]=h,this.Hr=!0;break}}if(i>=c.A.Jw&&i<=c.A.Qw){const t=(i-314)/2|0,s=1&i;let h=this.Yr[t];0===s&&(h--,h<0&&(h=W.A.La[t].length-1)),1===s&&(h++,h>=W.A.La[t].length&&(h=0)),this.Yr[t]=h,this.Hr=!0}if(i!==c.A.Da||this.Gr||(this.Gr=!0,this.Vc()),i===c.A.Na&&this.Gr&&(this.Gr=!1,this.Vc()),i===c.A.tA){this.Bt.jc(O.A.iA),this.Bt.p1(this.Gr?0:1);for(let t=0;t<7;t++)this.Bt.p1(this.Wr[t]);for(let t=0;t<5;t++)this.Bt.p1(this.Yr[t]);return!0}return i===c.A.Fa&&(this.ke=!this.ke),i>=c.A.sA&&i<=c.A.hA&&(this.Uw(),this.Me.length>0&&(this.Bt.jc(O.A.eA),this.Bt.nA(M.A.ld(this.Me)),this.Bt.p1(i-601),this.Bt.p1(this.ke?1:0))),!1};Vc=()=>{this.Hr=!0;for(let t=0;t<7;t++){this.Wr[t]=-1;for(let i=0;i{if(!this.Sr||!this.He)return!1;const n=h>>14&32767,r=this.He.gd(this.Dn,i,s,h);if(-1===r)return!1;const o=31&r,l=r>>6&3;if(o===P.A.rA.id||o===P.A.oA.id||o===P.A.lA.id){const t=e.A.get(n);let h,r;l===F.A.bd||l===F.A.Ld?(h=t.width,r=t.length):(h=t.length,r=t.width);let o=t.aA;0!==l&&(o=(o<>4-l)),this.df(this.Sr.wf[0],this.Sr.Af[0],i,s,2,h,r,0,0,o,!1)}else this.df(this.Sr.wf[0],this.Sr.Af[0],i,s,2,0,0,l,o+1,0,!1);return this.qs=this.Rc,this.$s=this.Sc,this.js=2,this.Zs=0,this.Bt.jc(t),this.Bt.p2(i+this.Tn),this.Bt.p2(s+this.On),this.Bt.p2(n),!0};mf=()=>{1===this.Lc&&(this.Rc>=549&&this.Rc<=583&&this.Sc>=195&&this.Sc<231&&-1!==this.Mh[0]?(this.Ws=!0,this.Sh=0,this.Vs=!0):this.Rc>=579&&this.Rc<=609&&this.Sc>=194&&this.Sc<231&&-1!==this.Mh[1]?(this.Ws=!0,this.Sh=1,this.Vs=!0):this.Rc>=607&&this.Rc<=637&&this.Sc>=194&&this.Sc<231&&-1!==this.Mh[2]?(this.Ws=!0,this.Sh=2,this.Vs=!0):this.Rc>=635&&this.Rc<=679&&this.Sc>=194&&this.Sc<229&&-1!==this.Mh[3]?(this.Ws=!0,this.Sh=3,this.Vs=!0):this.Rc>=676&&this.Rc<=706&&this.Sc>=194&&this.Sc<231&&-1!==this.Mh[4]?(this.Ws=!0,this.Sh=4,this.Vs=!0):this.Rc>=704&&this.Rc<=734&&this.Sc>=194&&this.Sc<231&&-1!==this.Mh[5]?(this.Ws=!0,this.Sh=5,this.Vs=!0):this.Rc>=732&&this.Rc<=766&&this.Sc>=195&&this.Sc<231&&-1!==this.Mh[6]?(this.Ws=!0,this.Sh=6,this.Vs=!0):this.Rc>=550&&this.Rc<=584&&this.Sc>=492&&this.Sc<528&&-1!==this.Mh[7]?(this.Ws=!0,this.Sh=7,this.Vs=!0):this.Rc>=582&&this.Rc<=612&&this.Sc>=492&&this.Sc<529&&-1!==this.Mh[8]?(this.Ws=!0,this.Sh=8,this.Vs=!0):this.Rc>=609&&this.Rc<=639&&this.Sc>=492&&this.Sc<529&&-1!==this.Mh[9]?(this.Ws=!0,this.Sh=9,this.Vs=!0):this.Rc>=637&&this.Rc<=681&&this.Sc>=493&&this.Sc<528&&-1!==this.Mh[10]?(this.Ws=!0,this.Sh=10,this.Vs=!0):this.Rc>=679&&this.Rc<=709&&this.Sc>=492&&this.Sc<529&&-1!==this.Mh[11]?(this.Ws=!0,this.Sh=11,this.Vs=!0):this.Rc>=706&&this.Rc<=736&&this.Sc>=492&&this.Sc<529&&-1!==this.Mh[12]?(this.Ws=!0,this.Sh=12,this.Vs=!0):this.Rc>=734&&this.Rc<=768&&this.Sc>=492&&this.Sc<528&&-1!==this.Mh[13]&&(this.Ws=!0,this.Sh=13,this.Vs=!0),$.K.ft++,$.K.ft>150&&($.K.ft=0,this.Bt.jc(O.A.cA),this.Bt.p1(43)))};Cf=async()=>{for(;;){let t;do{for(;;){if(t=this.kc(),-1===t)return;if(-1!==this.Xs&&this.Xs===this.xe){8===t&&this.Me.length>0&&(this.Me=this.Me.substring(0,this.Me.length-1));break}if(this.Fh){if(t>=32&&t<=122&&this.Bh.length<80&&(this.Bh=this.Bh+String.fromCharCode(t),this.Ys=!0),8===t&&this.Bh.length>0&&(this.Bh=this.Bh.substring(0,this.Bh.length-1),this.Ys=!0),13===t||10===t){let t;if(this.Fh=!1,this.Ys=!0,1===this.Gh&&(t=M.A.ld(this.Bh),this.Gw(t)),2===this.Gh&&this.Vr>0&&(t=M.A.ld(this.Bh),this.Ww(t)),3===this.Gh&&this.Bh.length>0&&this.no){this.Bt.jc(O.A.fA),this.Bt.p1(0);const t=this.Bt.Fc;this.Bt.nA(this.no),v.A.uA(this.Bt,this.Bh),this.Bt.Hf(this.Bt.Fc-t),this.Bh=M.A.dA(this.Bh),this.Bh=b.A.filter(this.Bh),this.Ud(6,this.Bh,M.A.ga(M.A.Ca(this.no))),2===this.xh&&(this.xh=1,this.Ks=!0,this.Bt.jc(O.A.wA),this.Bt.p1(this.kh),this.Bt.p1(this.xh),this.Bt.p1(this.Dh))}4===this.Gh&&this.dh<100&&(t=M.A.ld(this.Bh),this.Hw(t)),5===this.Gh&&this.dh>0&&(t=M.A.ld(this.Bh),this.Yw(t))}}else if(this.Wh){if(t>=48&&t<=57&&this.Hh.length<10&&(this.Hh=this.Hh+String.fromCharCode(t),this.Ys=!0),8===t&&this.Hh.length>0&&(this.Hh=this.Hh.substring(0,this.Hh.length-1),this.Ys=!0),13===t||10===t){if(this.Hh.length>0){let t=0;try{t=parseInt(this.Hh,10)}catch(t){}this.Bt.jc(O.A.AA),this.Bt.p4(t)}this.Wh=!1,this.Ys=!0}}else if(-1===this.lh&&(t>=32&&t<=122&&this.qh.length<80&&(this.qh=this.qh+String.fromCharCode(t),this.Ys=!0),8===t&&this.qh.length>0&&(this.qh=this.qh.substring(0,this.qh.length-1),this.Ys=!0),(13===t||10===t)&&this.qh.length>0)){if('::clientdrop'===this.qh)await this.qc();else if(this.Br&&'::noclip'===this.qh)for(let t=0;t122)&&(t<65||t>90)&&(t<48||t>57)&&32!==t);this.Me.length<12&&(this.Me=this.Me+String.fromCharCode(t))}};If=()=>{if(1===this.Lc)if(this.Rc>=8&&this.Rc<=108&&this.Sc>=490&&this.Sc<=522)this.kh=(this.kh+1)%4,this.Ks=!0,this.Ys=!0,this.Bt.jc(O.A.wA),this.Bt.p1(this.kh),this.Bt.p1(this.xh),this.Bt.p1(this.Dh);else if(this.Rc>=137&&this.Rc<=237&&this.Sc>=490&&this.Sc<=522)this.xh=(this.xh+1)%3,this.Ks=!0,this.Ys=!0,this.Bt.jc(O.A.wA),this.Bt.p1(this.kh),this.Bt.p1(this.xh),this.Bt.p1(this.Dh);else if(this.Rc>=275&&this.Rc<=375&&this.Sc>=490&&this.Sc<=522)this.Dh=(this.Dh+1)%3,this.Ks=!0,this.Ys=!0,this.Bt.jc(O.A.wA),this.Bt.p1(this.kh),this.Bt.p1(this.xh),this.Bt.p1(this.Dh);else if(this.Rc>=416&&this.Rc<=516&&this.Sc>=490&&this.Sc<=522){this.Uw(),this.Me='',this.ke=!1;for(let t=0;t{if(this.Nh?this.Ph=32:this.Ph=0,this.Nh=!1,t>=n&&t=r&&i=n&&t=r+h-16&&i=n-this.Ph&&t=r+16&&i0){let t=(h-32)*h/s|0;t<8&&(t=8);const n=i-r-(t/2|0)-16,l=h-t-32;o.Tl=(s-h)*n/l|0,e&&(this.Ws=!0),this.Nh=!0}};Kc=()=>{this.Fi||(this.Lo(),this.Mo=null,this.ti=null,this.ii=null,this.si=null,this.hi=null,this.ei=null,this.ni=null,this.ri=null,this.oi=null,this.li=null,this.Fi=new f.A(479,96),this.Ni=new f.A(168,160),u.A.clear(),this.os?.draw(0,0),this.Di=new f.A(190,261),this.Pi=new f.A(512,334),u.A.clear(),this.Ui=new f.A(501,61),this.Bi=new f.A(288,40),this.Gi=new f.A(269,66),this.$t=!0)};lu=t=>{if(!t)return!1;for(let i=0;i{if(0n===t)return;if(this.Vr>=100)return void this.Ud(0,'Your friends list is full. Max of 100 hit','');const i=M.A.ga(M.A.Ca(t));for(let s=0;s{if(0n!==t)for(let i=0;i{if(0n===t)return;if(this.dh>=100)return void this.Ud(0,'Your ignore list is full. Max of 100 hit','');const i=M.A.ga(M.A.Ca(t));for(let s=0;s{if(0n!==t)for(let i=0;i{const s=this.gr[this.Dn][t][i];if(!s)return void this.He?.TA(this.Dn,t,i);let h=-99999999,e=null;for(let t=s.head();t;t=s.next()){const i=n.A.get(t.index);let s=i.OA;i.da&&(s*=t.count+1),s>h&&(h=s,e=t)}if(!e)return;s.bA(e);let r=-1,o=-1,l=0,a=0;for(let t=s.head();t;t=s.next())t.index!==e.index&&-1===r&&(r=t.index,l=t.count),t.index!==e.index&&t.index!==r&&-1===o&&(o=t.index,a=t.count);let c=null;-1!==r&&(c=n.A.get(r).vA(l));let f=null;-1!==o&&(f=n.A.get(o).vA(a));const u=t+(i<<7)+1610612736|0,d=n.A.get(e.index);this.He?.LA(t,i,this.Bf(this.Dn,128*t+64,128*i+64),this.Dn,u,d.vA(e.count),f,c)};RA=(t,i,s,h,n,r,o)=>{if(i<1||s<1||i>102||s>102)return;if($.K.st&&t!==this.Dn)return;if(!this.He)return;let l=0;if(o===N.A.SA&&(l=this.He.Ed(t,i,s)),o===N.A.MA&&(l=this.He.kA(t,s,i)),o===N.A.xA&&(l=this.He.Md(t,i,s)),o===N.A.lA&&(l=this.He.Ad(t,i,s)),0!==l){const h=this.He.gd(t,i,s,l),n=l>>14&32767,r=31&h,a=h>>6;if(o===N.A.SA){this.He?.DA(t,i,s,1);const h=e.A.get(n);h.NA&&this.kn[t]?.DA(i,s,r,a,h.PA)}if(o===N.A.MA&&this.He?.FA(t,i,s),o===N.A.xA){this.He.UA(t,i,s);const h=e.A.get(n);if(i+h.width>G.A.Xn-1||s+h.width>G.A.Xn-1||i+h.length>G.A.Xn-1||s+h.length>G.A.Xn-1)return;h.NA&&this.kn[t]?.UA(i,s,h.width,h.length,a,h.PA)}if(o===N.A.lA){this.He?.BA(t,i,s);const h=e.A.get(n);h.NA&&h.active&&this.kn[t]?.GA(i,s)}}if(h>=0){let e=t;this.Yn&&t<3&&!(2&~this.Yn[1][i][s])&&(e=t+1),this.Wn&&D.A.RA(t,i,s,this.He,this.Wn,this._r,this.kn[t],h,r,n,e)}};Uw=()=>{this.Bt.jc(O.A.HA),-1!==this.oh&&(this.oh=-1,this.Ws=!0,this.ye=!1,this.Vs=!0),-1!==this.lh&&(this.lh=-1,this.Ys=!0,this.ye=!1),this.Xs=-1};qc=async()=>{this.Yt>0?await this.WA():(this.Pi?.bind(),this.wi?.Ac(257,144,'Connection lost',m.A.Bl),this.wi?.Ac(256,143,'Connection lost',m.A._l),this.wi?.Ac(257,159,'Please wait - attempting to reestablish',m.A.Bl),this.wi?.Ac(256,158,'Please wait - attempting to reestablish',m.A._l),this.Pi?.draw(8,11),this.Ke=0,this.stream?.close(),this.ac=!1,await this.Mc(this.username,this.password,!0),this.ac||await this.WA())};WA=async()=>{this.stream&&this.stream.close(),this.stream=null,this.ac=!1,this.Jt=0,this.username='',this.password='',k.A.Wc(),this.Qf(),this.He?.reset();for(let t=0;t{if(!this.stream)return!1;try{let t=this.stream.available;if(0===t)return!1;if(-1===this.Xt&&(await this.stream.Pc(this.in.data,0,1),this.Xt=255&this.in.data[0],this.Kt&&(this.Xt=this.Xt-this.Kt.YA&255),this.packetSize=E.A.VA[this.Xt],t--),-1===this.packetSize){if(t<=0)return!1;await this.stream.Pc(this.in.data,0,1),this.packetSize=255&this.in.data[0],t--}if(-2===this.packetSize){if(t<=1)return!1;await this.stream.Pc(this.in.data,0,2),this.in.Fc=0,this.packetSize=this.in.KA,t-=2}if(t0&&this.Ud(5,s+' has logged in.',''),0===i&&this.Ud(5,s+' has logged out.','')),s=null;break}s&&this.Vr<100&&(this.ho[this.Vr]=t,this.so[this.Vr]=s,this.eo[this.Vr]=i,this.Vr++,this.Ws=!0);let h=!1;for(;!h;){h=!0;for(let t=0;t=0&&h>=0&&s=G.A.Xn||t.z>=G.A.Xn)&&t.sy();return 0!==this.Ke&&(this.Ke-=e,this.Xe-=n),this.ze=!1,this.Xt=-1,!0}if(this.Xt===T.A.hy)return c.A.Ro[this.in.KA].model=this.Sr?.ey()||null,this.Xt=-1,!0;if(this.Xt===T.A.ny)return this.Ah=this.in.ZA,1===this.Ah&&(this.yh=this.in.KA),this.Ah>=2&&this.Ah<=6&&(2===this.Ah&&(this.ph=64,this.mh=64),3===this.Ah&&(this.ph=0,this.mh=64),4===this.Ah&&(this.ph=128,this.mh=64),5===this.Ah&&(this.ph=64,this.mh=0),6===this.Ah&&(this.ph=64,this.mh=128),this.Ah=2,this._h=this.in.KA,this.Eh=this.in.KA,this.gh=this.in.ZA),10===this.Ah&&(this.Ih=this.in.KA),this.Xt=-1,!0;if(this.Xt===T.A.oy){const t=this.in.ly,i=this.in.Ko,s=this.in.Ko;return t!==this.mo&&this.po&&!$.K.st&&await this.Vo(t,i,s),this.mo=t,this.Io=i,this._o=s,this.yo=0,this.Xt=-1,!0}if(this.Xt===T.A.uy)return await this.WA(),this.Xt=-1,!1;if(this.Xt===T.A.wy){const t=this.in.ZA,i=this.in.ZA;let s=-1;if(this.Ln)for(let h=0;h=100&&(this.ln=128*this.tr+64,this.cn=128*this.ir+64,this.an=this.Bf(this.Dn,this.tr,this.ir)-this.sr),this.Xt=-1,!0;if(this.Xt===T.A.sp){this._n=this.in.ZA,this.En=this.in.ZA;for(let t=this._n;t=this._n&&t.x=this.En&&t.z1?this.Ud(7,e,M.A.ga(M.A.Ca(t))):this.Ud(3,e,M.A.ga(M.A.Ca(t)))}catch(t){}return this.Xt=-1,!0}if(this.Xt===T.A.lp){for(let t=0;t=100){const t=128*this.Zn+64,i=128*this.qn+64,s=this.Bf(this.Dn,this.Zn,this.qn)-this.$n,h=t-this.ln,e=s-this.an,n=i-this.cn,r=0|Math.sqrt(h*h+n*n);this.fn=325.949*Math.atan2(e,r)&2047,this.un=-325.949*Math.atan2(h,n)&2047,this.fn<128&&(this.fn=128),this.fn>383&&(this.fn=383)}return this.Xt=-1,!0}if(this.Xt===T.A.dp)return this.Sh=this.in.ZA,this.Ws=!0,this.Vs=!0,this.Xt=-1,!0;if(this.Xt===T.A.wp){const t=this.in.ly;let i;if(t.endsWith(':tradereq:')){const s=t.substring(0,t.indexOf(':'));i=M.A.ld(s);let h=!1;for(let t=0;t>10&31,h=i>>5&31,e=31&i;return c.A.Ro[t].Yl=(s<<19)+(h<<11)+(e<<3),this.Xt=-1,!0}if(this.Xt===T.A.Ep){for(let t=0;t=this.bh[s]&&(this.Oh[t]=s+2);return this.Xt=-1,!0}if(this.Xt===T.A.Lp){for(this._n=this.in.ZA,this.En=this.in.ZA;this.in.Fc=0&&t{try{this.In=-1,this.Er.clear(),this._r.clear(),this.Ir.clear(),this.mr.clear(),d.A.Pp(),this.Qf(),this.He?.reset();for(let t=0;t>8,s=255&this.Ln[t];if(33===i&&s>=71&&s<=73){D.A.st=!1;break}}if($.K.st?this.He?.Fp(this.Dn):this.He?.Fp(0),this.Ln&&this.bn){this.Bt.jc(O.A.bf);for(let s=0;s>8)-this.Tn,h=64*(255&this.Ln[s])-this.On,e=this.bn[s];if(e){const s=new I.A(new Uint8Array(e)).Ko,n=R.A.read(s,e,e.length-4,4);t.Up(8*(this.gn-6),8*(this.Cn-6),i,h,n)}else this.Cn<800&&t.Bp(h,i,64,64)}}if(this.Ln&&this.vn){this.Bt.jc(O.A.bf);for(let s=0;s>8)-this.Tn,r=64*(255&this.Ln[s])-this.On;t.Gp(this.He,this._r,this.kn,e,n,r)}}}this.Bt.jc(O.A.bf),t.Hp(this.He,this.kn),this.Pi?.bind(),this.Bt.jc(O.A.bf);for(let t=this._r.head();t;t=this._r.next())2===(this.Yn&&2&this.Yn[1][t.Wp][t.Yp])&&(t.Vp--,t.Vp<0&&t.sy());for(let t=0;t{const i=c.A.Ro[t];if(i.ll)for(let t=0;t{let t=0;for(let i=0;i<99;i++){const s=i+1;t+=s+300*Math.pow(2,s/7)|0,this.bh[i]=t/4|0}};Ud=(t,i,s)=>{0===t&&-1!==this.Yh&&(this.Lh=i,this.Lc=0),-1===this.lh&&(this.Ys=!0);for(let t=99;t>0;t--)this.messageType[t]=this.messageType[t-1],this.Kh[t]=this.Kh[t-1],this.Vh[t]=this.Vh[t-1];$.K.nt&&0===t&&(i='['+(this.Pt/30|0)+']: '+i),this.messageType[0]=t,this.Kh[0]=s,this.Vh[0]=i};Fw=async t=>{const i=a.A.Ro[t].Xp;if(0!==i){const s=this.pe[t];if(1===i&&(1===s&&d.A.sc(.9),2===s&&d.A.sc(.8),3===s&&d.A.sc(.7),4===s&&d.A.sc(.6),n.A.su?.clear(),this.$t=!0),3===i){const t=this.po;0===s&&(this.Eo=256,(0,j.zp)(256),this.po=!0),1===s&&(this.Eo=192,(0,j.zp)(192),this.po=!0),2===s&&(this.Eo=128,(0,j.zp)(128),this.po=!0),3===s&&(this.Eo=64,(0,j.zp)(64),this.po=!0),4===s&&(this.po=!1),this.po!==t&&(this.po&&this.mo?await this.Vo(this.mo,this.Io,this._o):(0,j.vo)(),this.yo=0)}4===i&&(0===s&&(this.fo=256,(0,j.jp)(256),this.oo=!0),1===s&&(this.fo=192,(0,j.jp)(192),this.oo=!0),2===s&&(this.fo=128,(0,j.jp)(128),this.oo=!0),3===s&&(this.fo=64,(0,j.jp)(64),this.oo=!0),4===s&&(this.oo=!1)),5===i&&(this.Ce=s),6===i&&(this.Zh=s),8===i&&(this.jh=s,this.Ys=!0)}};Zp=(t,i)=>{let s=0;for(let t=0;t<100;t++){if(!this.Vh[t])continue;const h=this.messageType[t],e=this.uh+70+4-14*s;if(e<-20)break;0===h&&s++,1!==h&&2!==h||!(1===h||0===this.kh||1===this.kh&&this.lu(this.Kh[t]))||(i>e-14&&i<=e&&this.Sr&&this.Kh[t]!==this.Sr.name&&(this.Br&&(this.rh[this.nh]='Report abuse @whi@'+this.Kh[t],this.Te[this.nh]=34,this.nh++),this.rh[this.nh]='Add ignore @whi@'+this.Kh[t],this.Te[this.nh]=436,this.nh++,this.rh[this.nh]='Add friend @whi@'+this.Kh[t],this.Te[this.nh]=406,this.nh++),s++),3!==h&&7!==h||0!==this.jh||!(7===h||0===this.xh||1===this.xh&&this.lu(this.Kh[t]))||(i>e-14&&i<=e&&(this.Br&&(this.rh[this.nh]='Report abuse @whi@'+this.Kh[t],this.Te[this.nh]=34,this.nh++),this.rh[this.nh]='Add ignore @whi@'+this.Kh[t],this.Te[this.nh]=436,this.nh++,this.rh[this.nh]='Add friend @whi@'+this.Kh[t],this.Te[this.nh]=406,this.nh++),s++),4===h&&(0===this.Dh||1===this.Dh&&this.lu(this.Kh[t]))&&(i>e-14&&i<=e&&(this.rh[this.nh]='Accept trade @whi@'+this.Kh[t],this.Te[this.nh]=903,this.nh++),s++),(5===h||6===h)&&0===this.jh&&this.xh<2&&s++,8===h&&(0===this.Dh||1===this.Dh&&this.lu(this.Kh[t]))&&(i>e-14&&i<=e&&(this.rh[this.nh]='Accept duel @whi@'+this.Kh[t],this.Te[this.nh]=363,this.nh++),s++)}};qp=t=>{if(0===this.jh)return;let i=0;0!==this.Vt&&(i=1);for(let s=0;s<100;s++)if(null!==this.Vh[s]){const h=this.messageType[s];if((3===h||7===h)&&(7===h||0===this.xh||1===this.xh&&this.lu(this.Kh[s]))){const h=329-13*i;if(this.xl>8&&this.xl<520&&t-11>h-10&&t-11<=h+3&&(this.Br&&(this.rh[this.nh]='Report abuse @whi@'+this.Kh[s],this.Te[this.nh]=2034,this.nh++),this.rh[this.nh]='Add ignore @whi@'+this.Kh[s],this.Te[this.nh]=2436,this.nh++,this.rh[this.nh]='Add friend @whi@'+this.Kh[s],this.Te[this.nh]=2406,this.nh++),i++,i>=5)return}if((5===h||6===h)&&this.xh<2&&(i++,i>=5))return}};$p=(t,i,s,h,e,r)=>{if(0!==t.type||!t.ll||t.hide||ih+t.width||s>e+t.height||!t.pl||!t.ml)return;const o=t.ll.length;for(let l=0;l=0||0!==f.Kl)&&i>=o&&s>=a&&i=0?this.Se=f.Jp:this.Se=f.id),0===f.type)this.$p(f,i,s,o,a,f.Tl),f.scroll>f.height&&this.Rf(i,s,f.scroll,f.height,!0,o+f.width,a,f);else if(2===f.type){let t=0;for(let h=0;h=r+32||s>=l+32){t++;continue}if(this.Re=t,this.Le=f.id,!f.Ll||f.Ll[t]<=0){t++;continue}const c=n.A.get(f.Ll[t]-1);if(1===this.oe&&f.Qp)f.id===this.ae&&t===this.le||(this.rh[this.nh]='Use '+this.fe+' with @lre@'+c.name,this.Te[this.nh]=881,this.Oe[this.nh]=c.id,this.be[this.nh]=t,this.ve[this.nh]=f.id,this.nh++);else if(1===this.Ie&&f.Qp)16&~this.Ee||(this.rh[this.nh]=this.ge+' @lre@'+c.name,this.Te[this.nh]=391,this.Oe[this.nh]=c.id,this.be[this.nh]=t,this.ve[this.nh]=f.id,this.nh++);else{if(f.Qp)for(let i=4;i>=3;i--)c.tm&&c.tm[i]?(this.rh[this.nh]=c.tm[i]+' @lre@'+c.name,3===i?this.Te[this.nh]=478:4===i&&(this.Te[this.nh]=347),this.Oe[this.nh]=c.id,this.be[this.nh]=t,this.ve[this.nh]=f.id,this.nh++):4===i&&(this.rh[this.nh]='Drop @lre@'+c.name,this.Te[this.nh]=347,this.Oe[this.nh]=c.id,this.be[this.nh]=t,this.ve[this.nh]=f.id,this.nh++);if(f.im&&(this.rh[this.nh]='Use @lre@'+c.name,this.Te[this.nh]=188,this.Oe[this.nh]=c.id,this.be[this.nh]=t,this.ve[this.nh]=f.id,this.nh++),f.Qp&&c.tm)for(let i=2;i>=0;i--)c.tm[i]&&(this.rh[this.nh]=c.tm[i]+' @lre@'+c.name,0===i?this.Te[this.nh]=405:1===i?this.Te[this.nh]=38:2===i&&(this.Te[this.nh]=422),this.Oe[this.nh]=c.id,this.be[this.nh]=t,this.ve[this.nh]=f.id,this.nh++);if(f.sm)for(let i=4;i>=0;i--)f.sm[i]&&(this.rh[this.nh]=f.sm[i]+' @lre@'+c.name,0===i?this.Te[this.nh]=602:1===i?this.Te[this.nh]=596:2===i?this.Te[this.nh]=22:3===i?this.Te[this.nh]=892:4===i&&(this.Te[this.nh]=415),this.Oe[this.nh]=c.id,this.be[this.nh]=t,this.ve[this.nh]=f.id,this.nh++);this.rh[this.nh]='Examine @lre@'+c.name,$.K.nt&&(this.rh[this.nh]+='@whi@ ('+c.id+')'),this.Te[this.nh]=1773,this.Oe[this.nh]=c.id,f.Rl&&(this.ve[this.nh]=f.Rl[t]),this.nh++}t++}}else if(i>=o&&s>=a&&i{let i=t.El;return i>=c.A.Aa&&i<=c.A.ma?(i>=c.A.pa?i-=c.A.pa:i--,this.rh[this.nh]='Remove @whi@'+this.so[i],this.Te[this.nh]=557,this.nh++,this.rh[this.nh]='Message @whi@'+this.so[i],this.Te[this.nh]=679,this.nh++,!0):i>=c.A._a&&i<=c.A.Ea&&(this.rh[this.nh]='Remove @whi@'+t.text,this.Te[this.nh]=556,this.nh++,!0)};um=()=>{0===this.oe&&0===this.Ie&&(this.rh[this.nh]='Walk here',this.Te[this.nh]=660,this.be[this.nh]=this.xl,this.ve[this.nh]=this.Dl,this.nh++);let t=-1;for(let i=0;i>7&127,o=s>>29&3,l=s>>14&32767;if(s!==t){if(t=s,2===o&&this.He&&this.He.gd(this.Dn,h,r,s)>=0){const t=e.A.get(l);if(1===this.oe)this.rh[this.nh]='Use '+this.fe+' with @cya@'+t.name,this.Te[this.nh]=450,this.Oe[this.nh]=s,this.be[this.nh]=h,this.ve[this.nh]=r,this.nh++;else if(1!==this.Ie){if(t.wm)for(let i=4;i>=0;i--)t.wm[i]&&(this.rh[this.nh]=t.wm[i]+' @cya@'+t.name,0===i&&(this.Te[this.nh]=285),1===i&&(this.Te[this.nh]=504),2===i&&(this.Te[this.nh]=364),3===i&&(this.Te[this.nh]=581),4===i&&(this.Te[this.nh]=1501),this.Oe[this.nh]=s,this.be[this.nh]=h,this.ve[this.nh]=r,this.nh++);this.rh[this.nh]='Examine @cya@'+t.name,$.K.nt&&(this.rh[this.nh]+='@whi@ ('+t.id+')'),this.Te[this.nh]=1175,this.Oe[this.nh]=s,this.be[this.nh]=h,this.ve[this.nh]=r,this.nh++}else 4&~this.Ee||(this.rh[this.nh]=this.ge+' @cya@'+t.name,this.Te[this.nh]=55,this.Oe[this.nh]=s,this.be[this.nh]=h,this.ve[this.nh]=r,this.nh++)}if(1===o){const t=this.Ar[l];if(t&&t.type&&1===t.type.size&&64==(127&t.x)&&64==(127&t.z))for(let i=0;i=0;s--)t.wm&&t.wm[s]?(this.rh[this.nh]=t.wm[s]+' @lre@'+t.name,0===s&&(this.Te[this.nh]=224),1===s&&(this.Te[this.nh]=993),2===s&&(this.Te[this.nh]=99),3===s&&(this.Te[this.nh]=746),4===s&&(this.Te[this.nh]=877),this.Oe[this.nh]=i.index,this.be[this.nh]=h,this.ve[this.nh]=r,this.nh++):2===s&&(this.rh[this.nh]='Take @lre@'+t.name,this.Te[this.nh]=99,this.Oe[this.nh]=i.index,this.be[this.nh]=h,this.ve[this.nh]=r,this.nh++);this.rh[this.nh]='Examine @lre@'+t.name,$.K.nt&&(this.rh[this.nh]+='@whi@ ('+i.index+')'),this.Te[this.nh]=1102,this.Oe[this.nh]=i.index,this.be[this.nh]=h,this.ve[this.nh]=r,this.nh++}else 1&~this.Ee||(this.rh[this.nh]=this.ge+' @lre@'+t.name,this.Te[this.nh]=965,this.Oe[this.nh]=i.index,this.be[this.nh]=h,this.ve[this.nh]=r,this.nh++)}}}}};Am=(t,i,s,h)=>{if(this.nh>=400)return;let e=t.name;if(0!==t._m&&this.Sr&&(e=e+this.Em(this.Sr.Ka,t._m)+' (level-'+t._m+')'),1===this.oe)this.rh[this.nh]='Use '+this.fe+' with @yel@'+e,this.Te[this.nh]=900,this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++;else if(1!==this.Ie){let n;if(t.wm)for(n=4;n>=0;n--)t.wm[n]&&'attack'!==t.wm[n]?.toLowerCase()&&(this.rh[this.nh]=t.wm[n]+' @yel@'+e,0===n?this.Te[this.nh]=728:1===n?this.Te[this.nh]=542:2===n?this.Te[this.nh]=6:3===n?this.Te[this.nh]=963:4===n&&(this.Te[this.nh]=245),this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++);if(t.wm)for(n=4;n>=0;n--)if(t.wm[n]&&'attack'===t.wm[n]?.toLowerCase()){let r=0;this.Sr&&t._m>this.Sr.Ka&&(r=2e3),this.rh[this.nh]=t.wm[n]+' @yel@'+e,0===n?this.Te[this.nh]=r+728:1===n?this.Te[this.nh]=r+542:2===n?this.Te[this.nh]=r+6:3===n?this.Te[this.nh]=r+963:4===n&&(this.Te[this.nh]=r+245),this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++}this.rh[this.nh]='Examine @yel@'+e,$.K.nt&&(this.rh[this.nh]+='@whi@ ('+t.id+')'),this.Te[this.nh]=1607,this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++}else 2&~this.Ee||(this.rh[this.nh]=this.ge+' @yel@'+e,this.Te[this.nh]=265,this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++)};ym=(t,i,s,h)=>{if(t===this.Sr||this.nh>=400)return;let e=null;this.Sr&&(e=t.name+this.Em(this.Sr.Ka,t.Ka)+' (level-'+t.Ka+')'),1===this.oe?(this.rh[this.nh]='Use '+this.fe+' with @whi@'+e,this.Te[this.nh]=367,this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++):1!==this.Ie?(this.rh[this.nh]='Follow @whi@'+e,this.Te[this.nh]=1544,this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++,0===this.Js&&(this.rh[this.nh]='Trade with @whi@'+e,this.Te[this.nh]=1373,this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++),this.Fr>0&&(this.rh[this.nh]='Attack @whi@'+e,this.Sr&&this.Sr.Ka>=t.Ka?this.Te[this.nh]=151:this.Te[this.nh]=2151,this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++),1===this.Ur&&(this.rh[this.nh]='Fight @whi@'+e,this.Te[this.nh]=151,this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++),2===this.Ur&&(this.rh[this.nh]='Duel-with @whi@'+e,this.Te[this.nh]=1101,this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++)):8&~this.Ee||(this.rh[this.nh]=this.ge+' @whi@'+e,this.Te[this.nh]=651,this.Oe[this.nh]=i,this.be[this.nh]=s,this.ve[this.nh]=h,this.nh++);for(let t=0;t{const s=t-i;return s<-9?'@red@':s<-6?'@or3@':s<-3?'@or2@':s<0?'@or1@':s>9?'@gre@':s>6?'@gr3@':s>3?'@gr2@':s>0?'@gr1@':'@yel@'};ef=()=>{if(0===this.se){this.rh[0]='Cancel',this.Te[0]=1252,this.nh=1,this.qp(this.Dl),this.Se=0,this.xl>8&&this.Dl>11&&this.xl<520&&this.Dl<345&&(-1===this.Xs?this.um():this.$p(c.A.Ro[this.Xs],this.xl,this.Dl,8,11,0)),this.Se!==this.$h&&(this.$h=this.Se),this.Se=0,this.xl>562&&this.Dl>231&&this.xl<752&&this.Dl<492&&(-1!==this.oh?this.$p(c.A.Ro[this.oh],this.xl,this.Dl,562,231,0):-1!==this.Mh[this.Sh]&&this.$p(c.A.Ro[this.Mh[this.Sh]],this.xl,this.Dl,562,231,0)),this.Se!==this.Jh&&(this.Ws=!0,this.Jh=this.Se),this.Se=0,this.xl>22&&this.Dl>375&&this.xl<431&&this.Dl<471&&(-1===this.lh?this.Zp(this.xl-22,this.Dl-375):this.$p(c.A.Ro[this.lh],this.xl,this.Dl,22,375,0)),-1!==this.lh&&this.Se!==this.Qh&&(this.Ys=!0,this.Qh=this.Se);let t=!1;for(;!t;){t=!0;for(let i=0;i1e3){const s=this.rh[i];this.rh[i]=this.rh[i+1],this.rh[i+1]=s;const h=this.Te[i];this.Te[i]=this.Te[i+1],this.Te[i+1]=h;const e=this.be[i];this.be[i]=this.be[i+1],this.be[i+1]=e;const n=this.ve[i];this.ve[i]=this.ve[i+1],this.ve[i+1]=n;const r=this.Oe[i];this.Oe[i]=this.Oe[i+1],this.Oe[i+1]=r,t=!1}}}};lf=()=>{let t=0;if(this.Ai){let i;t=this.Ai.au('Choose Option');for(let s=0;st&&(t=i)}t+=8;const i=15*this.nh+21;let s,h;this.Rc>8&&this.Sc>11&&this.Rc<520&&this.Sc<345&&(s=this.Rc-(t/2|0)-8,s+t>512?s=512-t:s<0&&(s=0),h=this.Sc-11,h+i>334?h=334-i:h<0&&(h=0),this.Qs=!0,this.th=0,this.ih=s,this.sh=h,this.hh=t,this.eh=15*this.nh+22),this.Rc>562&&this.Sc>231&&this.Rc<752&&this.Sc<492&&(s=this.Rc-(t/2|0)-562,s<0?s=0:s+t>190&&(s=190-t),h=this.Sc-231,h<0?h=0:h+i>261&&(h=261-i),this.Qs=!0,this.th=1,this.ih=s,this.sh=h,this.hh=t,this.eh=15*this.nh+22),this.Rc>22&&this.Sc>375&&this.Rc<501&&this.Sc<471&&(s=this.Rc-(t/2|0)-22,s<0?s=0:s+t>479&&(s=479-t),h=this.Sc-375,h<0?h=0:h+i>96&&(h=96-i),this.Qs=!0,this.th=2,this.ih=s,this.sh=h,this.hh=t,this.eh=15*this.nh+22)};df=(t,i,s,h,e,n,r,o,l,a,c)=>{const f=this.kn[this.Dn];if(!f)return!1;const u=G.A.Xn,d=G.A.Xn;for(let t=0;t0&&0===this.vr[i]&&(E[i]&H.A.pd)===H.A.OPEN&&(this.Or[p]=w-1,this.br[p]=A,p=(p+1)%_,this.vr[i]=2,this.Lr[i]=t),i=G.A.index(w+1,A),w0&&0===this.vr[i]&&(E[i]&H.A.Id)===H.A.OPEN&&(this.Or[p]=w,this.br[p]=A-1,p=(p+1)%_,this.vr[i]=1,this.Lr[i]=t),i=G.A.index(w,A+1),A0&&A>0&&0===this.vr[i]&&!(E[i]&H.A.bm)&&(E[G.A.index(w-1,A)]&H.A.pd)===H.A.OPEN&&(E[G.A.index(w,A-1)]&H.A.Id)===H.A.OPEN&&(this.Or[p]=w-1,this.br[p]=A-1,p=(p+1)%_,this.vr[i]=3,this.Lr[i]=t),i=G.A.index(w+1,A-1),w0&&0===this.vr[i]&&!(E[i]&H.A.vm)&&(E[G.A.index(w+1,A)]&H.A.md)===H.A.OPEN&&(E[G.A.index(w,A-1)]&H.A.Id)===H.A.OPEN&&(this.Or[p]=w+1,this.br[p]=A-1,p=(p+1)%_,this.vr[i]=9,this.Lr[i]=t),i=G.A.index(w-1,A+1),w>0&&A=0&&s>=0&&e0){_=Math.min(m,25),m--;const t=this.Or[m],i=this.br[m];if($.K.nt&&1===this.if[6]&&1===this.if[7]){for(let t=0;t{this.cr=0,this.ar=0,this.xm(t),this.Dm(t),this.Nm(t,i),this.Pm(t);for(let t=0;t{t.Fm();if(0!==t.Um(1)){const i=t.Um(2);if(0===i)this.ur[this.ar++]=this.Mt;else if(1===i){const i=t.Um(3);this.Sr?.step(!1,i);1===t.Um(1)&&(this.ur[this.ar++]=this.Mt)}else if(2===i){const i=t.Um(3);this.Sr?.step(!0,i);const s=t.Um(3);this.Sr?.step(!0,s);1===t.Um(1)&&(this.ur[this.ar++]=this.Mt)}else if(3===i){this.Dn=t.Um(2);const i=t.Um(7),s=t.Um(7),h=t.Um(1);this.Sr?.move(1===h,i,s);1===t.Um(1)&&(this.ur[this.ar++]=this.Mt)}}};Dm=t=>{const i=t.Um(8);if(ithis.rr)throw new Error(`eek! ${this.username} Too many players`);this.rr=0;for(let s=0;s{let s;for(;t.Bm+10<8*i&&(s=t.Um(11),2047!==s);){if(!this.nr[s]){this.nr[s]=new W.A;const t=this.wr[s];t&&this.nr[s]?.read(t)}this.lr[this.rr++]=s;const i=this.nr[s];i&&(i.Vf=this.Pt);let h=t.Um(5);h>15&&(h-=32);let e=t.Um(5);e>15&&(e-=32);const n=t.Um(1);this.Sr&&i?.move(1===n,this.Sr.wf[0]+h,this.Sr.Af[0]+e);1===t.Um(1)&&(this.ur[this.ar++]=s)}t.Gm()};Pm=t=>{for(let i=0;i{if(t.Eu=s,t.gu=this.Pt,(s&W.A.Cu)===W.A.Cu){const s=e.ZA,h=new Uint8Array(s),n=new I.A(h);e.xy(s,0,h),this.wr[i]=n,t.read(n)}if((s&W.A.Tu)===W.A.Tu){let i=e.KA;65535===i&&(i=-1),i===t.Ou&&(t.Ym=0);const s=e.ZA;(-1===i||-1===t.Ou||h.A.Ro[i].priority>h.A.Ro[t.Ou].priority||0===h.A.Ro[t.Ou].priority)&&(t.Ou=i,t.Vm=0,t.Km=0,t.Xm=s,t.Ym=0)}if((s&W.A.bu)===W.A.bu&&(t.vu=e.KA,65535===t.vu&&(t.vu=-1)),(s&W.A.Lu)===W.A.Lu&&(t.ou=e.ly,t.cu=0,t.fu=0,t.uu=150,t.name&&this.Ud(2,t.ou,t.name)),(s&W.A.Ru)===W.A.Ru&&(t.pu=e.ZA,t.yu=e.ZA,t.du=this.Pt+400,t.wu=e.ZA,t.Au=e.ZA),(s&W.A.Su)===W.A.Su&&(t.zm=e.KA,t.jm=e.KA,t.Mu=t.zm,t.ku=t.jm),(s&W.A.xu)===W.A.xu){const i=e.KA,s=e.ZA,h=e.ZA,n=e.Fc;if(t.name){const n=M.A.ld(t.name);let r=!1;if(s<=1)for(let t=0;t>8,t.fu=255&i,t.uu=150,s>1?this.Ud(1,r,t.name):this.Ud(2,r,t.name)}catch(t){}}e.Fc=n+h}if((s&W.A.Du)===W.A.Du){t.Nu=e.KA;const i=e.Ko;t.Zm=i>>16,t.qm=this.Pt+(65535&i),t.$m=0,t.Jm=0,t.qm>this.Pt&&(t.$m=-1),65535===t.Nu&&(t.Nu=-1)}(s&W.A.Pu)===W.A.Pu&&(t.Qm=e.ZA,t.tI=e.ZA,t.iI=e.ZA,t.sI=e.ZA,t.mu=e.KA+this.Pt,t.Iu=e.KA+this.Pt,t.hI=e.ZA,t.pathLength=0,t.wf[0]=t.iI,t.Af[0]=t.sI)};QA=(t,i)=>{this.cr=0,this.ar=0,this.eI(t),this.nI(t,i),this.rI(t);for(let t=0;t{t.Fm();const i=t.Um(8);if(ithis.yr)throw new Error(`eek! ${this.username} Too many npc!`);this.yr=0;for(let s=0;s{for(;t.Bm+21<8*i;){const i=t.Um(13);if(8191===i)break;this.Ar[i]||(this.Ar[i]=new Y.A);const s=this.Ar[i];this.pr[this.yr++]=i,s?(s.Vf=this.Pt,s.type=r.A.get(t.Um(11)),s.size=s.type.size,s.oI=s.type.lI,s.aI=s.type.cI,s.fI=s.type.uI,s.dI=s.type.wI,s.Sa=s.type.AI):t.Um(11);let h=t.Um(5);h>15&&(h-=32);let e=t.Um(5);e>15&&(e-=32),this.Sr&&s?.move(!1,this.Sr.wf[0]+h,this.Sr.Af[0]+e);1===t.Um(1)&&(this.ur[this.ar++]=i)}t.Gm()};rI=t=>{for(let i=0;ih.A.Ro[e.Ou].priority||0===h.A.Ro[e.Ou].priority)&&(e.Ou=i,e.Vm=0,e.Km=0,e.Xm=s,e.Ym=0)}if((n&Y.A.bu)===Y.A.bu&&(e.vu=t.KA,65535===e.vu&&(e.vu=-1)),(n&Y.A.Lu)===Y.A.Lu&&(e.ou=t.ly,e.uu=100),(n&Y.A.Ru)===Y.A.Ru&&(e.pu=t.ZA,e.yu=t.ZA,e.du=this.Pt+400,e.wu=t.ZA,e.Au=t.ZA),(n&Y.A.Fu)===Y.A.Fu&&(e.type=r.A.get(t.KA),e.oI=e.type.lI,e.aI=e.type.cI,e.fI=e.type.uI,e.dI=e.type.wI,e.Sa=e.type.AI),(n&Y.A.Du)===Y.A.Du){e.Nu=t.KA;const i=t.Ko;e.Zm=i>>16,e.qm=this.Pt+(65535&i),e.$m=0,e.Jm=0,e.qm>this.Pt&&(e.$m=-1),65535===e.Nu&&(e.Nu=-1)}(n&Y.A.Su)===Y.A.Su&&(e.zm=t.KA,e.jm=t.KA,e.Mu=e.zm,e.ku=e.jm)}};$c=()=>{for(let t=-1;t1406){$.K.yt=0,this.Bt.jc(O.A.pI),this.Bt.p1(0);const t=this.Bt.Fc;this.Bt.p1(162),this.Bt.p1(22),2*Math.random()|0||this.Bt.p1(84),this.Bt.p2(31824),this.Bt.p2(13490),2*Math.random()|0||this.Bt.p1(123),2*Math.random()|0||this.Bt.p1(134),this.Bt.p1(100),this.Bt.p1(94),this.Bt.p2(35521),this.Bt.Hf(this.Bt.Fc-t)}};yI=t=>{(t.x<128||t.z<128||t.x>=13184||t.z>=13184)&&(t.Ou=-1,t.Nu=-1,t.mu=0,t.Iu=0,t.x=128*t.wf[0]+64*t.size,t.z=128*t.Af[0]+64*t.size,t.pathLength=0),t===this.Sr&&(t.x<1536||t.z<1536||t.x>=11776||t.z>=11776)&&(t.Ou=-1,t.Nu=-1,t.mu=0,t.Iu=0,t.x=128*t.wf[0]+64*t.size,t.z=128*t.Af[0]+64*t.size,t.pathLength=0),t.mu>this.Pt?this.mI(t):t.Iu>=this.Pt?this.II(t):this._I(t),this.EI(t),this.gI(t)};xf=()=>{if(this.Sr){this.Sr.x>>7===this.Ke&&this.Sr.z>>7===this.Xe&&(this.Ke=0);for(let t=-1;t50||this.rr>200)&&-1!==t&&i.CI===i.Sa;const h=i.x>>7,e=i.z>>7;if(!(h<0||h>=G.A.Xn||e<0||e>=G.A.Xn))if(!i.TI||this.Pt=i.bI){if(64==(127&i.x)&&64==(127&i.z)){if(this.Vn[h][e]===this.Ve)continue;this.Vn[h][e]=this.Ve}i.y=this.Bf(this.Dn,i.x,i.z),this.He?.vI(this.Dn,i.x,i.y,i.z,null,i,s,i.LI,60,i.RI)}else i.st=!1,i.y=this.Bf(this.Dn,i.x,i.z),this.He?.SI(this.Dn,i.x,i.y,i.z,i.MI,i.kI,i.xI,i.DI,null,i,s,i.LI)}}};Jc=()=>{for(let t=0;t{for(let t=0;t>7,e=i.z>>7;if(!(h<0||h>=G.A.Xn||e<0||e>=G.A.Xn)){if(1===i.size&&64==(127&i.x)&&64==(127&i.z)){if(this.Vn[h][e]===this.Ve)continue;this.Vn[h][e]=this.Ve}this.He?.vI(this.Dn,i.x,this.Bf(this.Dn,i.x,i.z),i.z,null,i,s,i.LI,64*(i.size-1)+60,i.RI)}}};Nf=()=>{for(let t=this.mr.head();t;t=this.mr.next())if(t.level!==this.Dn||this.Pt>t.NI)t.sy();else if(this.Pt>=t.FI){if(t.target>0){const i=this.Ar[t.target-1];i&&t.UI(i.x,this.Bf(t.level,i.x,i.z)-t.offsetY,i.z,this.Pt)}if(t.target<0){const i=-t.target-1;let s;s=i===this.Dr?this.Sr:this.nr[i],s&&t.UI(s.x,this.Bf(t.level,s.x,s.z)-t.offsetY,s.z,this.Pt)}t.update(this.Ye),this.He?.vI(this.Dn,0|t.x,0|t.y,0|t.z,null,t,-1,t.LI,60,!1)}};Pf=()=>{for(let t=this.Ir.head();t;t=this.Ir.next())t.level!==this.Dn||t.BI?t.sy():this.Pt>=t.FI&&(t.update(this.Ye),t.BI?t.sy():this.He?.vI(t.level,t.x,t.y,t.z,null,t,-1,0,60,!1))};Ff=()=>{for(let t=this._r.head();t;t=this._r.next()){let i=!1;if(t.fl+=this.Ye,-1===t.ul&&(t.ul=0,i=!0),t.GI.delay)for(;t.fl>t.GI.delay[t.ul];)if(t.fl-=t.GI.delay[t.ul]+1,t.ul++,i=!0,t.ul>=t.GI.dl&&(t.ul-=t.GI.wl,t.ul<0||t.ul>=t.GI.dl)){t.sy(),i=!1;break}if(i&&this.He){const i=t.Vp,s=t.Wp,h=t.Yp;let n=0;if(0===t.HI?n=this.He.Ed(i,s,h):1===t.HI?n=this.He.kA(i,h,s):2===t.HI?n=this.He.Md(i,s,h):3===t.HI&&(n=this.He.Ad(i,s,h)),this.Wn&&0!==n&&(n>>14&32767)===t.index){const r=this.Wn[i][s][h],o=this.Wn[i][s+1][h],l=this.Wn[i][s+1][h+1],a=this.Wn[i][s][h+1],c=e.A.get(t.index);let f=-1;if(-1!==t.ul&&t.GI.frames&&(f=t.GI.frames[t.ul]),2===t.HI){const t=this.He.gd(i,s,h,n);let e=31&t;const u=t>>6;e===P.A.oA.id&&(e=P.A.rA.id),this.He?.WI(i,s,h,c.la(e,u,r,o,l,a,f))}else if(1===t.HI)this.He?.YI(i,s,h,c.la(P.A.VI.id,0,r,o,l,a,f));else if(0===t.HI){const t=this.He.gd(i,s,h,n),e=31&t,u=t>>6;if(e===P.A.Od.id){const t=u+1&3;this.He?.KI(s,h,i,c.la(P.A.Od.id,u+4,r,o,l,a,f),c.la(P.A.Od.id,t,r,o,l,a,f))}else this.He?.XI(i,s,h,c.la(e,u,r,o,l,a,f))}else if(3===t.HI){const t=this.He.gd(i,s,h,n)>>6;this.He?.zI(i,s,h,c.la(P.A.lA.id,t,r,o,l,a,f))}}else t.sy()}}};Qc=()=>{for(let t=-1;t0&&(s.uu--,0===s.uu&&(s.ou=null))}for(let t=0;t0&&(s.uu--,0===s.uu&&(s.ou=null))}};tf=()=>{if(2===this.We){for(let t=this.Er.head();t;t=this.Er.next())this.Pt>=t.NI&&(this.RA(t.hp,t.x,t.z,t.Kp,t.angle,t.shape,t.Nd),t.sy());$.K.At++,$.K.At>85&&($.K.At=0,this.Bt.jc(O.A.jI))}};mI=t=>{const i=t.mu-this.Pt,s=128*t.Qm+64*t.size,h=128*t.tI+64*t.size;t.x+=(s-t.x)/i|0,t.z+=(h-t.z)/i|0,t.ZI=0,0===t.hI&&(t.qI=1024),1===t.hI&&(t.qI=1536),2===t.hI&&(t.qI=0),3===t.hI&&(t.qI=512)};II=t=>{if(t.Iu===this.Pt||-1===t.Ou||0!==t.Xm||t.Km+1>h.A.Ro[t.Ou].delay[t.Vm]){const i=t.Iu-t.mu,s=this.Pt-t.mu,h=128*t.Qm+64*t.size,e=128*t.tI+64*t.size,n=128*t.iI+64*t.size,r=128*t.sI+64*t.size;t.x=(h*(i-s)+n*s)/i|0,t.z=(e*(i-s)+r*s)/i|0}t.ZI=0,0===t.hI&&(t.qI=1024),1===t.hI&&(t.qI=1536),2===t.hI&&(t.qI=0),3===t.hI&&(t.qI=512),t.LI=t.qI};EI=t=>{if(-1!==t.vu&&t.vu<32768){const i=this.Ar[t.vu];if(i){const s=t.x-i.x,h=t.z-i.z;0===s&&0===h||(t.qI=325.949*Math.atan2(s,h)&2047)}}if(t.vu>=32768){let i=t.vu-32768;i===this.Dr&&(i=this.Mt);const s=this.nr[i];if(s){const i=t.x-s.x,h=t.z-s.z;0===i&&0===h||(t.qI=325.949*Math.atan2(i,h)&2047)}}if((0!==t.zm||0!==t.jm)&&(0===t.pathLength||t.ZI>0)){const i=t.x-64*(t.zm-this.Tn-this.Tn),s=t.z-64*(t.jm-this.On-this.On);0===i&&0===s||(t.qI=325.949*Math.atan2(i,s)&2047),t.zm=0,t.jm=0}const i=t.qI-t.LI&2047;if(0!==i&&(i<32||i>2016?t.LI=t.qI:i>1024?t.LI-=32:t.LI+=32,t.LI&=2047,t.CI===t.Sa&&t.LI!==t.qI)){if(-1!==t.$I)return void(t.CI=t.$I);t.CI=t.oI}};gI=t=>{let i;if(t.RI=!1,-1!==t.CI&&(i=h.A.Ro[t.CI],t.JI++,i.delay&&t.QIi.delay[t.QI]&&(t.JI=0,t.QI++),t.QI>=i.dl&&(t.JI=0,t.QI=0)),-1!==t.Ou&&0===t.Xm){for(i=h.A.Ro[t.Ou],t.Km++;i.delay&&t.Vmi.delay[t.Vm];)t.Km-=i.delay[t.Vm],t.Vm++;t.Vm>=i.dl&&(t.Vm-=i.wl,t.Ym++,t.Ym>=i.t_&&(t.Ou=-1),(t.Vm<0||t.Vm>=i.dl)&&(t.Ou=-1)),t.RI=i.i_}if(t.Xm>0&&t.Xm--,-1!==t.Nu&&this.Pt>=t.qm){for(t.$m<0&&(t.$m=0),i=l.A.Ro[t.Nu].GI,t.Jm++;i&&i.delay&&t.$mi.delay[t.$m];)t.Jm-=i.delay[t.$m],t.$m++;i&&t.$m>=i.dl&&(t.$m<0||t.$m>=i.dl)&&(t.Nu=-1)}};_I=t=>{if(t.CI=t.Sa,0===t.pathLength)return void(t.ZI=0);if(-1!==t.Ou&&0===t.Xm){if(!h.A.Ro[t.Ou].s_)return void t.ZI++}const i=t.x,s=t.z,e=128*t.wf[t.pathLength-1]+64*t.size,n=128*t.Af[t.pathLength-1]+64*t.size;if(e-i<=256&&e-i>=-256&&n-s<=256&&n-s>=-256){t.qI=in?1792:1536:i>e?sn?256:512:s1024&&(h-=2048);let r=t.aI;h>=-256&&h<=256?r=t.oI:h>=256&&h<768?r=t.dI:h>=-768&&h<=-256&&(r=t.fI),-1===r&&(r=t.oI),t.CI=r;let o=4;t.LI!==t.qI&&-1===t.vu&&(o=2),t.pathLength>2&&(o=6),t.pathLength>3&&(o=8),t.ZI>0&&t.pathLength>1&&(o=8,t.ZI--),t.h_[t.pathLength-1]&&(o<<=1),o>=8&&t.CI===t.oI&&-1!==t.e_&&(t.CI=t.e_),ie&&(t.x=e)):i>e&&(t.x-=o,t.xn&&(t.z=n)):s>n&&(t.z-=o,t.z{let t=3;if(this.fn<310&&this.Sr){let i=this.ln>>7,s=this.cn>>7;const h=this.Sr.x>>7,e=this.Sr.z>>7;let n,r,o,l;if(this.Yn&&4&this.Yn[this.Dn][i][s]&&(t=this.Dn),n=h>i?h-i:i-h,r=e>s?e-s:s-e,n>r)for(o=65536*r/n|0,l=32768;i!==h;)ih&&i--,this.Yn&&4&this.Yn[this.Dn][i][s]&&(t=this.Dn),l+=o,l>=65536&&(l-=65536,se&&s--,this.Yn&&4&this.Yn[this.Dn][i][s]&&(t=this.Dn));else for(o=65536*n/r|0,l=32768;s!==e;)se&&s--,this.Yn&&4&this.Yn[this.Dn][i][s]&&(t=this.Dn),l+=o,l>=65536&&(l-=65536,ih&&i--,this.Yn&&4&this.Yn[this.Dn][i][s]&&(t=this.Dn))}return this.Sr&&this.Yn&&4&this.Yn[this.Dn][this.Sr.x>>7][this.Sr.z>>7]&&(t=this.Dn),t};Wf=()=>{if(!this.Yn)return 0;return this.Bf(this.Dn,this.ln,this.cn)-this.an>=800||!(4&this.Yn[this.Dn][this.ln>>7][this.cn>>7])?3:this.Dn};Bf=(t,i,s)=>{if(!this.Wn)return 0;const h=Math.min(i>>7,G.A.Xn-1),e=Math.min(s>>7,G.A.Xn-1);let n=t;t<3&&this.Yn&&!(2&~this.Yn[1][h][e])&&(n=t+1);const r=127&i,o=127&s;return(this.Wn[n][h][e]*(128-r)+this.Wn[n][h+1][e]*r>>7)*(128-o)+(this.Wn[n][h][e+1]*(128-r)+this.Wn[n][h+1][e+1]*r>>7)*o>>7};Uf=(t,i,s,h,e,n)=>{const r=2048-e&2047,o=2048-h&2047;let l,a,c,f=0,u=0,w=n;0!==r&&(l=d.A.sin[r],a=d.A.cos[r],c=u*a-n*l>>16,w=u*l+n*a>>16,u=c),0!==o&&(l=d.A.sin[o],a=d.A.cos[o],c=w*l+f*a>>16,w=w*a-f*l>>16,f=c),this.ln=t-f,this.an=i-u,this.cn=s-w,this.fn=e,this.un=h};Ef=()=>{if(!this.Sr)return;const t=this.Sr.x+this.Ze,i=this.Sr.z+this.qe;(this.Gn-t<-500||this.Gn-t>500||this.Hn-i<-500||this.Hn-i>500)&&(this.Gn=t,this.Hn=i),this.Gn!==t&&(this.Gn+=(t-this.Gn)/16|0),this.Hn!==i&&(this.Hn+=(i-this.Hn)/16|0),1===this.if[1]?this.Un+=(-this.Un-24)/2|0:1===this.if[2]?this.Un+=(24-this.Un)/2|0:this.Un=this.Un/2|0,1===this.if[3]?this.Bn+=(12-this.Bn)/2|0:1===this.if[4]?this.Bn+=(-this.Bn-12)/2|0:this.Bn=this.Bn/2|0,this.Fn=this.Fn+this.Un/2&2047,this.Pn+=this.Bn/2|0,this.Pn<128&&(this.Pn=128),this.Pn>383&&(this.Pn=383);const s=this.Gn>>7,h=this.Hn>>7,e=this.Bf(this.Dn,this.Gn,this.Hn);let n=0;if(this.Wn&&s>3&&h>3&&s<100&&h<100)for(let t=s-4;t<=s+4;t++)for(let i=h-4;i<=h+4;i++){let s=this.Dn;s<3&&this.Yn&&!(2&~this.Yn[1][t][i])&&s++;const h=e-this.Wn[s][t][i];h>n&&(n=h)}let r=192*n;r>98048&&(r=98048),r<32768&&(r=32768),r>this.dn?this.dn+=(r-this.dn)/24|0:r{let t=128*this.tr+64,i=128*this.ir+64,s=this.Bf(this.Dn,this.tr,this.ir)-this.sr;this.lnt&&(this.ln=t)),this.ln>t&&(this.ln-=this.hr+((this.ln-t)*this.er/1e3|0),this.lns&&(this.an=s)),this.an>s&&(this.an-=this.hr+((this.an-s)*this.er/1e3|0),this.ani&&(this.cn=i)),this.cn>i&&(this.cn-=this.hr+((this.cn-i)*this.er/1e3|0),this.cn383&&(o=383),this.fno&&(this.fn=o)),this.fn>o&&(this.fn-=this.Jn+((this.fn-o)*this.Qn/1e3|0),this.fn1024&&(a-=2048),a<-1024&&(a+=2048),a>0&&(this.un+=this.Jn+(a*this.Qn/1e3|0),this.un&=2047),a<0&&(this.un-=this.Jn+(-a*this.Qn/1e3|0),this.un&=2047);let c=l-this.un;c>1024&&(c-=2048),c<-1024&&(c+=2048),(c<0&&a>0||c>0&&a<0)&&(this.un=l)};vy=(t,i)=>{const s=t.ZA;let n=this._n+(s>>4&7),r=this.En+(7&s);if(i===T.A.by||i===T.A.Oy){const s=t.ZA,h=s>>2,e=3&s,o=P.A.of(h).Nd;let l;if(l=i===T.A.Oy?-1:t.KA,n>=0&&r>=0&&n>14&32767,h=31&t,e=t>>6}t=new U.A(this.Dn,o,n,r,0,F.A.bd,P.A.Td.id,s,e,h),this.Tr.n_(t)}t&&(t.Kp=l,t.shape=h,t.angle=e),this.RA(this.Dn,n,r,l,e,h,o)}}else if(i===T.A.Ty){const i=t.ZA>>2,s=P.A.of(i).Nd,e=t.KA;if(n>=0&&r>=0&&n>14&32767,this.Dn,s,n,r,h.A.Ro[e],!1);this._r.n_(i)}}}else if(i===T.A.Cy){const i=t.KA,s=t.KA;if(n>=0&&r>=0&&n=0&&r>=0&&n=0&&r>=0&&n=0&&s>=0&&i=0&&r>=0&&n=0&&r>=0&&n>2,h=3&i,o=P.A.of(s).Nd,l=t.KA,a=t.KA,c=t.KA,f=t.KA;let u,d=t.zA,w=t.zA,A=t.zA,y=t.zA;if(u=f===this.Dr?this.Sr:this.nr[f],u&&this.Wn){const t=new B.A(this.Dn,o,n,r,-1,h,s,a+this.Pt);this.Er.n_(t);const i=new B.A(this.Dn,o,n,r,l,h,s,c+this.Pt);this.Er.n_(i);const f=this.Wn[this.Dn][n][r],p=this.Wn[this.Dn][n+1][r],m=this.Wn[this.Dn][n+1][r+1],I=this.Wn[this.Dn][n][r+1],_=e.A.get(l);u.OI=a+this.Pt,u.bI=c+this.Pt,u.TI=_.la(s,h,f,p,m,I,-1);let E,g=_.width,C=_.length;h!==F.A.vd&&h!==F.A.Rd||(g=_.length,C=_.width),u.r_=128*n+64*g,u.o_=128*r+64*C,u.l_=this.Bf(this.Dn,u.r_,u.o_),d>A&&(E=d,d=A,A=E),w>y&&(E=w,w=y,y=E),u.MI=n+d,u.xI=n+A,u.kI=r+w,u.DI=r+y}}else if(i===T.A.py){const i=t.KA,s=t.KA,h=t.KA;if(n>=0&&r>=0&&n{if(!$.K.st){if(d.A.a_[17]>=t){const t=d.A.c_[17];if(!t)return;const i=t.width*t.height-1,s=t.width*this.Ye*2,h=t.nc,e=this.Mn;for(let t=0;t<=i;t++)e[t]=h[t-s&i];t.nc=e,this.Mn=h,d.A.f_(17)}if(d.A.a_[24]>=t){const t=d.A.c_[24];if(!t)return;const i=t.width*t.height-1,s=t.width*this.Ye*2,h=t.nc,e=this.Mn;for(let t=0;t<=i;t++)e[t]=h[t-s&i];t.nc=e,this.Mn=h,d.A.f_(24)}}};Ic=()=>{if(!(this.Ci&&this.Ti&&this.gi&&this.Ri))return;for(let t=10;t<117;t++){(100*Math.random()|0)<50&&(this.Ci[t+32512]=255)}for(let t=0;t<100;t++){const t=2+(124*Math.random()|0)+(128+(128*Math.random()|0)<<7);this.Ci[t]=192}for(let t=1;t<255;t++)for(let i=1;i<127;i++){const s=i+(t<<7);this.Ti[s]=(this.Ci[s-1]+this.Ci[s+1]+this.Ci[s-128]+this.Ci[s+128])/4|0}this.Si+=128,this.Si>this.gi.length&&(this.Si-=this.gi.length,this.gc(this.pi[12*Math.random()|0]));for(let t=1;t<255;t++)for(let i=1;i<127;i++){const s=i+(t<<7);let h=this.Ti[s+128]-(this.gi[s+this.Si&this.gi.length-1]/5|0);h<0&&(h=0),this.Ci[s]=h}for(let t=0;t<255;t++)this.Ri[t]=this.Ri[t+1];if(this.Ri[255]=16*Math.sin(this.Pt/14)+14*Math.sin(this.Pt/15)+12*Math.sin(this.Pt/16)|0,this.Mi>0&&(this.Mi-=4),this.ki>0&&(this.ki-=4),0===this.Mi&&0===this.ki){const t=2e3*Math.random()|0;0===t?this.Mi=1024:1===t&&(this.ki=1024)}};u_=(t,i,s)=>{const h=256-i;return((16711935&t)*h+(16711935&s)*i&4278255360)+((65280&t)*h+(65280&s)*i&16711680)>>8};_c=()=>{if(!(this.Oi&&this.bi&&this.vi&&this.Li&&this.Ri&&this.Ci))return;const t=256;if(this.Mi>0)for(let t=0;t<256;t++)this.Mi>768?this.Oi[t]=this.u_(this.bi[t],1024-this.Mi,this.vi[t]):this.Mi>256?this.Oi[t]=this.vi[t]:this.Oi[t]=this.u_(this.vi[t],256-this.Mi,this.bi[t]);else if(this.ki>0)for(let t=0;t<256;t++)this.ki>768?this.Oi[t]=this.u_(this.bi[t],1024-this.ki,this.Li[t]):this.ki>256?this.Oi[t]=this.Li[t]:this.Oi[t]=this.u_(this.Li[t],256-this.ki,this.bi[t]);else for(let t=0;t<256;t++)this.Oi[t]=this.bi[t];for(let t=0;t<33920;t++)this.hi&&this.Ii&&(this.hi.nc[t]=this.Ii.nc[t]);let i=0,s=1152;for(let h=1;h<255;h++){let e=(this.Ri[h]*(t-h)/t|0)+22;e<0&&(e=0),i+=e;for(let t=e;t<128;t++){let t=this.Ci[i++];if(0===t)s++;else{const i=t,h=256-t;if(t=this.Oi[t],this.hi){const e=this.hi.nc[s];this.hi.nc[s++]=((16711935&t)*i+(16711935&e)*h&4278255360)+((65280&t)*i+(65280&e)*h&16711680)>>8}}}s+=e}this.hi?.draw(0,0);for(let t=0;t<33920;t++)this.ei&&this._i&&(this.ei.nc[t]=this._i.nc[t]);i=0,s=1176;for(let h=1;h<255;h++){const e=this.Ri[h]*(t-h)/t|0,n=103-e;s+=e;for(let t=0;t>8}}}i+=128-n,s+=128-n-e}this.ei?.draw(661,0)}}console.log(`RS2 user client - release #${$.K.tt}`),await(0,it.w)(),(new t).d_().then((()=>{})),i()}catch(t){i(t)}}),1)},7046:(t,i,s)=>{s.d(i,{A:()=>a});var h=s(1183),e=s(4583),n=s(9234),r=s(9091),o=s(2595),l=s(7854);class a{static getParameter(t){return new URLSearchParams(window.location.search).get(t)??''}static setParameter(t,i){const s=new URL(window.location.toString());s.searchParams.set(t,i),window.history.pushState(null,'',s.toString())}Ku=0;w_=[];A_=0;Mo=null;state=0;Yu=20;y_=1;p_=[];Wu=0;m_=0;I_=[];__=!0;E_=!1;g_=50;hasFocus=!0;ac=!1;Yc=0;hf=0;xl=0;Dl=0;Lc=0;Rc=0;Sc=0;if=[];C_=[];T_=0;O_=0;input=null;b_=!1;v_=!1;L_=!1;time=-1;R_=0;S_=0;M_=0;k_=0;x_=0;D_=0;constructor(t=!1){l.N_.tabIndex=-1,l.jo.fillStyle='black',l.jo.fillRect(0,0,l.N_.width,l.N_.height),this.E_=t,this.E_?this.resize(window.innerWidth,window.innerHeight):this.resize(l.N_.width,l.N_.height)}get width(){return l.N_.width}get height(){return l.N_.height}resize=(t,i)=>{l.N_.width=t,l.N_.height=i,this.Mo=new h.A(t,i),e.A.P_()};d_=async()=>{l.N_.addEventListener('resize',(()=>{this.E_&&this.resize(window.innerWidth,window.innerHeight)}),!1),l.N_.onmousedown=this.onmousedown,l.N_.onmouseup=this.onmouseup,l.N_.onmouseenter=this.onmouseenter,l.N_.onmouseleave=this.onmouseleave,l.N_.onmousemove=this.onmousemove,window.onbeforeunload=this.bo,l.N_.onfocus=this.onfocus,l.N_.onblur=this.onblur,this.F_?(l.N_.ontouchstart=this.ontouchstart,l.N_.ontouchend=this.ontouchend,l.N_.ontouchmove=this.ontouchmove):(l.N_.onkeydown=this.onkeydown,l.N_.onkeyup=this.onkeyup),l.N_.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.F_&&'low'===a.getParameter('detail')&&(this.g_=30),await this.Go(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.p_[t]=performance.now();let t,i=0,s=256,h=1,e=0;for(;this.state>=0;){if(this.state>0&&(this.state--,0===this.state))return void this.U_();const r=s,o=h;s=300,h=1,t=performance.now();const l=this.p_[i];if(0===l?(s=r,h=o):t>l&&(s=2560*this.Yu/(t-l)|0),s<25?s=25:s>256&&(s=256,h=this.Yu-(t-l)/10|0),this.p_[i]=t,i=(i+1)%10,h>1)for(let t=0;t<10;t++)0!==this.p_[t]&&(this.p_[t]+=h);for(h0&&(this.Wu=1e3*s/(256*this.Yu)|0);const a=performance.now();if(this.__&&this.refresh(),await this.draw(),this.I_[this.m_]=(performance.now()-a)/1e3,this.m_=(this.m_+1)%this.I_.length,this.g_<50){const i=1e3/this.g_-(performance.now()-t);i>0&&await(0,n.Wo)(i)}}-1===this.state&&this.U_()};U_=()=>{this.state=-2,this.bo()};Zo=t=>{this.Yu=1e3/t|0};yA=t=>{this.g_=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.Yu|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};bo=()=>{};draw=async()=>{};refresh=()=>{};async Go(t,i){const s=this.width,h=this.height;this.__&&(l.jo.fillStyle='black',l.jo.fillRect(0,0,s,h),this.__=!1);const e=h/2-18;l.jo.fillStyle='rgb(140, 17, 17)',l.jo.rect((s/2|0)-152,e,304,34),l.jo.fillRect((s/2|0)-150,e+2,3*t,30),l.jo.fillStyle='black',l.jo.fillRect((s/2|0)-150+3*t,e+2,300-3*t,30),l.jo.font='bold 13px helvetica, sans-serif',l.jo.textAlign='center',l.jo.fillStyle='white',l.jo.fillText(i,s/2|0,e+22),await(0,n.Wo)(5)}kc=()=>{let t=-1;return this.O_!==this.T_&&(t=this.C_[this.T_],this.T_=this.T_+1&127),t};get ms(){const t=this.I_.length;let i=0;for(let s=0;sthis.Ku&&(this.Ku=s),this.w_[this.A_]=s,this.A_=(this.A_+1)%250,s}get Vu(){return this.w_.reduce(((t,i)=>t+i),0)/250}onkeydown=t=>{const i=t.key;this.Yc=0;const s=r.c[i];if(!s||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const h=s.code;let e=s.ch;t.ctrlKey&&(e>='A'.charCodeAt(0)&&e<=']'.charCodeAt(0)||e=='_'.charCodeAt(0)?e-='A'.charCodeAt(0)-1:e>='a'.charCodeAt(0)&&e<='z'.charCodeAt(0)&&(e-='a'.charCodeAt(0)-1)),e<30&&(e=0),h===r.c.ArrowLeft.code?e=1:h===r.c.ArrowRight.code?e=2:h===r.c.ArrowUp.code?e=3:h===r.c.ArrowDown.code?e=4:h===r.c.Control.code?e=5:h===r.c.Shift.code?e=6:h===r.c.Alt.code?e=7:h===r.c.Backspace.code||h===r.c.Delete.code?e=8:h===r.c.Tab.code?e=9:h===r.c.Enter.code?e=10:h>=r.c.F1.code&&h<=r.c.F12.code?e=h+1008-r.c.F1.code:h===r.c.Home.code?e=1e3:h===r.c.End.code?e=1001:h===r.c.PageUp.code?e=1002:h===r.c.PageDown.code&&(e=1003),e>0&&e<128&&(this.if[e]=1),e>4&&(this.C_[this.O_]=e,this.O_=this.O_+1&127),o.A.enabled&&o.A.B_(e),r.g.includes(i)||t.preventDefault()};onkeyup=t=>{const i=t.key;this.Yc=0;const s=r.c[i];if(!s||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const h=s.code;let e=s.ch;e<30&&(e=0),h===r.c.ArrowLeft.code?e=1:h===r.c.ArrowRight.code?e=2:h===r.c.ArrowUp.code?e=3:h===r.c.ArrowDown.code?e=4:h===r.c.Control.code?e=5:h===r.c.Shift.code?e=6:h===r.c.Alt.code?e=7:h===r.c.Backspace.code||h===r.c.Delete.code?e=8:h===r.c.Tab.code?e=9:h===r.c.Enter.code?e=10:h>=r.c.F1.code&&h<=r.c.F12.code?e=h+1008-r.c.F1.code:h===r.c.Home.code?e=1e3:h===r.c.End.code?e=1001:h===r.c.PageUp.code?e=1002:h===r.c.PageDown.code&&(e=1003),e>0&&e<128&&(this.if[e]=0),o.A.enabled&&o.A.G_(e),r.g.includes(i)||t.preventDefault()};onmousedown=t=>{if(this.b_=!1,(t.clientX>0||t.clientY>0)&&this.H_(t),this.Yc=0,this.Rc=this.xl,this.Sc=this.Dl,this.F_&&!this.W_){if(this.Y_()||this.V_()||this.K_())return this.Lc=1,void(this.hf=1);t.timeStamp>=this.time+500?(this.Lc=2,this.hf=2):(this.Lc=1,this.hf=1)}else 2===t.button?(this.Lc=2,this.hf=2):(this.Lc=1,this.hf=1);o.A.enabled&&o.A.X_(this.Rc,this.Sc,t.buttons)};onmouseup=t=>{this.H_(t),this.Yc=0,this.hf=0,o.A.enabled&&o.A.z_(t.buttons)};onmouseenter=t=>{this.H_(t),o.A.enabled&&o.A.j_()};onmouseleave=t=>{this.H_(t),this.Yc=0,this.xl=-1,this.Dl=-1,this.hf=0,this.Rc=-1,this.Sc=-1,o.A.enabled&&o.A.Z_()};onmousemove=t=>{this.H_(t),this.Yc=0,o.A.enabled&&o.A.q_(this.xl,this.Dl)};onfocus=t=>{this.hasFocus=!0,this.__=!0,this.refresh(),o.A.enabled&&o.A.J_()};onblur=t=>{this.hasFocus=!1,o.A.enabled&&o.A.Q_()};ontouchstart=t=>{if(!this.F_)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.b_=!0;const i=t.changedTouches[0],s=0|i.clientX,h=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:s,clientY:h})),this.R_=this.x_=this.M_=0|i.screenX,this.S_=this.D_=this.k_=0|i.screenY,this.time=t.timeStamp,this.v_=this.tE(),this.L_=this.iE()};ontouchend=t=>{if(!this.F_||!this.b_)return;const i=t.changedTouches[0],s=0|i.clientX,h=0|i.clientY;if(this.onmousemove(new MouseEvent('mousemove',{clientX:s,clientY:h})),this.x_=0|i.screenX,this.D_=0|i.screenY,this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.v_&&!this.tE())return void(this.b_=!1);if(this.L_&&!this.iE())return void(this.b_=!1);if(this.Y_()||this.sE()||this.V_()||this.K_()){null!==this.input&&(this.input.parentNode?.contains(this.input)&&this.input.parentNode?.removeChild(this.input),this.input=null);const t=document.createElement('input');return this.V_()?(t.setAttribute('id','username'),t.setAttribute('placeholder','Username')):this.K_()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.Y_()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.sE()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this.hE?t.setAttribute('type','password'):t.setAttribute('type',this.K_()?'password':'text'),t.setAttribute('autofocus','autofocus'),t.setAttribute('spellcheck','false'),t.setAttribute('autocomplete','off'),t.setAttribute('style',`position: fixed; left: ${s}px; top: ${h}px; width: 1px; height: 1px; opacity: 0;`),document.body.appendChild(t),t.focus(),t.click(),this.hE&&(t.oninput=t=>{if(!(t instanceof InputEvent))return;const i=t,s=i.data;null!==s&&'insertText'===i.inputType&&this.onkeydown(new KeyboardEvent('keydown',{key:s,code:s}))}),t.onkeydown=t=>{this.hE&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this.hE&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeyup(new KeyboardEvent('keyup',{key:t.key,code:t.key}))},t.onfocus=t=>{this.input?.parentNode?.removeChild(this.input),this.input=null,this.onfocus(t)},this.input=t,void(this.b_=!1)}const e=t.timeStamp>=this.time+500,n=Math.abs(this.R_-this.x_)>16||Math.abs(this.S_-this.D_)>16;e&&!n?(this.b_=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.hf=0,this.b_=!1)};ontouchmove=t=>{if(!this.F_||!this.b_)return;const i=t.changedTouches[0],s=0|i.clientX,h=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:s,clientY:h})),this.x_=0|i.screenX,this.D_=0|i.screenY,this.v_&&-1===this.Po()?(this.M_-this.x_>0?this.rotate(2):this.M_-this.x_<0&&this.rotate(0),this.k_-this.D_>0?this.rotate(3):this.k_-this.D_<0&&this.rotate(1)):(this.L_||-1!==this.Po())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this.M_=this.x_,this.k_=this.D_};get F_(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get hE(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get W_(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}tE=()=>this.ac&&this.xl>=8&&this.xl<=520&&this.Dl>=11&&this.Dl<=345;Y_=()=>this.ac&&-1===this.No()&&!this.xo()&&!this.Do()&&this.xl>=11&&this.xl<=506&&this.Dl>=449&&this.Dl<=482;sE=()=>this.ac&&(this.xo()||this.Do())&&this.xl>=11&&this.xl<=506&&this.Dl>=383&&this.Dl<=482;iE=()=>this.ac&&this.xl>=562&&this.xl<=752&&this.Dl>=231&&this.Dl<=492;V_=()=>!this.ac&&2===this.ko()&&this.xl>=301&&this.xl<=562&&this.Dl>=262&&this.Dl<=279;K_=()=>!this.ac&&2===this.ko()&&this.xl>=301&&this.xl<=562&&this.Dl>=279&&this.Dl<=296;rotate=t=>{0===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowLeft',code:'ArrowLeft'}))):1===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowUp',code:'ArrowUp'}))):2===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowRight',code:'ArrowRight'}))):3===t&&(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowDown',code:'ArrowDown'})))};eE=()=>null!==document.fullscreenElement;H_=t=>{if(this.eE()){const i=t.target.getBoundingClientRect(),s=window.innerHeight/l.N_.height,h=(window.innerWidth-l.N_.width*s)/2;this.xl=0|this.nE(t.clientX-i.left-h,0,l.N_.width*s,0,789),this.Dl=0|this.nE(t.clientY-i.top,0,l.N_.height*s,0,532)}else{const i=l.N_.getBoundingClientRect(),s=l.N_.width/i.width,h=l.N_.height/i.height;this.xl=(t.clientX-i.left)*s|0,this.Dl=(t.clientY-i.top)*h|0}this.xl<0&&(this.xl=0),this.Dl<0&&(this.Dl=0),this.xl>789&&(this.xl=789),this.Dl>532&&(this.Dl=532)};nE=(t,i,s,h,e)=>(t-i)*(e-h)/(s-i)+h}},2595:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1069);class e{static enabled=!1;static rE=null;static oE=null;static lE=0;static aE=0;static cE=0;static fE=0;static uE=0;static Fy=()=>{this.rE=h.A.Ut(1),this.oE=null,this.lE=performance.now(),this.enabled=!0};static Wc=()=>{this.enabled=!1,this.rE=null};static flush=()=>{let t=null;return this.oE&&this.enabled&&(t=this.oE),this.oE=null,t};static stop=()=>{let t=null;return this.rE&&this.rE.Fc>0&&this.enabled&&(t=this.rE),this.Wc(),t};static X_=(t,i,s)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;this.aE++;const h=performance.now();let e=(h-this.lE)/10|0;e>250&&(e=250),this.lE=h,this.dE(5),1===s?this.rE?.p1(1):this.rE?.p1(2),this.rE?.p1(e),this.rE?.p3(t+(i<<10))};static z_=t=>{if(!this.enabled)return;this.aE++;const i=performance.now();let s=(i-this.lE)/10|0;s>250&&(s=250),this.lE=i,this.dE(2),1===t?this.rE?.p1(3):this.rE?.p1(4),this.rE?.p1(s)};static q_=(t,i)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;const s=performance.now();if(s-this.cE>=50){this.cE=s,this.aE++;let h=(s-this.lE)/10|0;h>250&&(h=250),this.lE=s,t-this.fE<8&&t-this.fE>=-8&&i-this.uE<8&&i-this.uE>=-8?(this.dE(3),this.rE?.p1(5),this.rE?.p1(h),this.rE?.p1(t+(i-this.uE+8<<4)+8-this.fE)):t-this.fE<128&&t-this.fE>=-128&&i-this.uE<128&&i-this.uE>=-128?(this.dE(4),this.rE?.p1(6),this.rE?.p1(h),this.rE?.p1(t+128-this.fE),this.rE?.p1(i+128-this.uE)):(this.dE(5),this.rE?.p1(7),this.rE?.p1(h),this.rE?.p3(t+(i<<10))),this.fE=t,this.uE=i}};static B_=t=>{if(!this.enabled)return;this.aE++;const i=performance.now();let s=(i-this.lE)/10|0;s>250&&(s=250),this.lE=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.dE(3),this.rE?.p1(8),this.rE?.p1(s),this.rE?.p1(t)};static G_=t=>{if(!this.enabled)return;this.aE++;const i=performance.now();let s=(i-this.lE)/10|0;s>250&&(s=250),this.lE=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.dE(3),this.rE?.p1(9),this.rE?.p1(s),this.rE?.p1(t)};static J_=()=>{if(!this.enabled)return;this.aE++;const t=performance.now();let i=(t-this.lE)/10|0;i>250&&(i=250),this.lE=t,this.dE(2),this.rE?.p1(10),this.rE?.p1(i)};static Q_=()=>{if(!this.enabled)return;this.aE++;const t=performance.now();let i=(t-this.lE)/10|0;i>250&&(i=250),this.lE=t,this.dE(2),this.rE?.p1(11),this.rE?.p1(i)};static j_=()=>{if(!this.enabled)return;this.aE++;const t=performance.now();let i=(t-this.lE)/10|0;i>250&&(i=250),this.lE=t,this.dE(2),this.rE?.p1(12),this.rE?.p1(i)};static Z_=()=>{if(!this.enabled)return;this.aE++;const t=performance.now();let i=(t-this.lE)/10|0;i>250&&(i=250),this.lE=t,this.dE(2),this.rE?.p1(13),this.rE?.p1(i)};static dE=t=>{if(this.rE&&this.rE.Fc+t>=500){const t=this.rE;this.rE=h.A.Ut(1),this.oE=t}}}},9091:(t,i,s)=>{s.d(i,{c:()=>e,g:()=>h});const h=['F11','F12'],e={'Backspace':{code:8,ch:8},'Enter':{code:10,ch:10},'Shift':{code:16,ch:65535},'Escape':{code:27,ch:27},'Tab':{code:9,ch:9},'CapsLock':{code:20,ch:65535},' ':{code:32,ch:32},'Control':{code:17,ch:65535},'Alt':{code:18,ch:65535},'Meta':{code:524,ch:65535},'ArrowLeft':{code:37,ch:65535},'ArrowRight':{code:39,ch:65535},'ArrowUp':{code:38,ch:65535},'ArrowDown':{code:40,ch:65535},'Insert':{code:155,ch:65535},'Home':{code:36,ch:65535},'PageUp':{code:33,ch:65535},'Delete':{code:127,ch:127},'End':{code:35,ch:65535},'PageDown':{code:34,ch:65535},'`':{code:192,ch:96},'~':{code:192,ch:126},'!':{code:49,ch:33},'@':{code:50,ch:64},'#':{code:51,ch:35},'$':{code:52,ch:36},'%':{code:53,ch:37},'^':{code:54,ch:94},'&':{code:55,ch:38},'*':{code:56,ch:42},'(':{code:57,ch:40},')':{code:48,ch:41},'-':{code:45,ch:45},'_':{code:45,ch:95},'=':{code:61,ch:61},'+':{code:61,ch:43},'[':{code:91,ch:91},'{':{code:91,ch:123},']':{code:93,ch:93},'}':{code:93,ch:125},'\\':{code:92,ch:92},'|':{code:92,ch:124},';':{code:59,ch:59},':':{code:59,ch:58},"'":{code:222,ch:39},'"':{code:222,ch:34},',':{code:44,ch:44},'<':{code:44,ch:60},'.':{code:46,ch:46},'>':{code:46,ch:62},'/':{code:47,ch:47},'?':{code:47,ch:63},'F1':{code:112,ch:65535},'F2':{code:113,ch:65535},'F3':{code:114,ch:65535},'F4':{code:115,ch:65535},'F5':{code:116,ch:65535},'F6':{code:117,ch:65535},'F7':{code:118,ch:65535},'F8':{code:119,ch:65535},'F9':{code:120,ch:65535},'F10':{code:121,ch:65535},'F11':{code:122,ch:65535},'F12':{code:123,ch:65535},0:{code:48,ch:48},1:{code:49,ch:49},2:{code:50,ch:50},3:{code:51,ch:51},4:{code:52,ch:52},5:{code:53,ch:53},6:{code:54,ch:54},7:{code:55,ch:55},8:{code:56,ch:56},9:{code:57,ch:57},'a':{code:65,ch:97},'b':{code:66,ch:98},'c':{code:67,ch:99},'d':{code:68,ch:100},'e':{code:69,ch:101},'f':{code:70,ch:102},'g':{code:71,ch:103},'h':{code:72,ch:104},'i':{code:73,ch:105},'j':{code:74,ch:106},'k':{code:75,ch:107},'l':{code:76,ch:108},'m':{code:77,ch:109},'n':{code:78,ch:110},'o':{code:79,ch:111},'p':{code:80,ch:112},'q':{code:81,ch:113},'r':{code:82,ch:114},'s':{code:83,ch:115},'t':{code:84,ch:116},'u':{code:85,ch:117},'v':{code:86,ch:118},'w':{code:87,ch:119},'x':{code:88,ch:120},'y':{code:89,ch:121},'z':{code:90,ch:122},'A':{code:65,ch:65},'B':{code:66,ch:66},'C':{code:67,ch:67},'D':{code:68,ch:68},'E':{code:69,ch:69},'F':{code:70,ch:70},'G':{code:71,ch:71},'H':{code:72,ch:72},'I':{code:73,ch:73},'J':{code:74,ch:74},'K':{code:75,ch:75},'L':{code:76,ch:76},'M':{code:77,ch:77},'N':{code:78,ch:78},'O':{code:79,ch:79},'P':{code:80,ch:80},'Q':{code:81,ch:81},'R':{code:82,ch:82},'S':{code:83,ch:83},'T':{code:84,ch:84},'U':{code:85,ch:85},'V':{code:86,ch:86},'W':{code:87,ch:87},'X':{code:88,ch:88},'Y':{code:89,ch:89},'Z':{code:90,ch:90}}},1120:(t,i,s)=>{s.d(i,{A:()=>c});var h=s(1069),e=s(8665),n=s(2679),r=s(2511),o=s(3819),l=s(3867),a=s(8950);class c{static Ro=[];static wE=null;static So=null;static Cl=0;static AE=1;static Ol=2;static Wl=3;static Vl=4;static ia=5;static ea=6;static ua=7;static hm=1;static om=2;static lm=3;static am=4;static fm=5;static Zl=6;static Aa=1;static ya=100;static pa=101;static ma=200;static Kw=201;static Xw=202;static Ia=203;static zw=205;static qw=300;static yE=301;static pE=302;static mE=303;static IE=304;static _E=305;static EE=306;static gE=307;static CE=308;static TE=309;static OE=310;static bE=311;static vE=312;static $w=313;static Jw=314;static LE=315;static RE=316;static SE=317;static ME=318;static kE=319;static xE=320;static DE=321;static NE=322;static Qw=323;static Da=324;static Na=325;static tA=326;static Oa=327;static _a=401;static Ea=500;static jw=501;static Zw=502;static Ta=503;static Pa=600;static sA=601;static PE=602;static FE=603;static UE=604;static BE=605;static GE=606;static HE=607;static WE=608;static YE=609;static VE=610;static KE=611;static hA=612;static Fa=613;static Ua=650;static Ha=651;static Wa=652;static Ya=653;static Va=654;static Ba=655;static ec=(t,i,s)=>{this.wE=new n.A(5e4),this.So=new n.A(5e4);const e=new h.A(t.read('data'));let r=-1;for(e.Fc+=2;e.Fc0){h.$o=new Uint8Array(n),h.Qo=new Uint16Array(n);for(let t=0;t0){h.scripts=new l.ds(o,null);for(let t=0;t0){const e=s.lastIndexOf(',');h.Hl[t]=this.XE(i,s.substring(0,e),parseInt(s.substring(e+1),10))}}h.sm=new l.ds(5,null);for(let t=0;t<5;t++){const i=e.ly;h.sm[t]=i,0===i.length&&(h.sm[t]=null)}}if(h.type===c.Wl&&(h.fill=1===e.ZA),h.type===c.Vl||h.type===c.AE){h.$l=1===e.ZA;const t=e.ZA;s&&(h.font=s[t]),h.Ql=1===e.ZA}if(h.type===c.Vl&&(h.text=e.ly,h.zl=e.ly),h.type!==c.AE&&h.type!==c.Wl&&h.type!==c.Vl||(h.Yl=e.Ko),h.type!==c.Wl&&h.type!==c.Vl||(h.Xl=e.Ko,h.Kl=e.Ko),h.type===c.ia){const t=e.ly;if(t.length>0){const s=t.lastIndexOf(',');h.ha=this.XE(i,t.substring(0,s),parseInt(t.substring(s+1),10))}const s=e.ly;if(s.length>0){const t=s.lastIndexOf(',');h.sa=this.XE(i,s.substring(0,t),parseInt(s.substring(t+1),10))}}if(h.type===c.ea){const t=e.ZA;0!==t&&(h.model=this.la((t-1<<8)+e.ZA));const i=e.ZA;0!==i&&(h.zE=this.la((i-1<<8)+e.ZA)),h.al=e.ZA,0===h.al?h.al=-1:h.al=(h.al-1<<8)+e.ZA,h.cl=e.ZA,0===h.cl?h.cl=-1:h.cl=(h.cl-1<<8)+e.ZA,h.zoom=e.KA,h.oa=e.KA,h.fa=e.KA}if(h.type===c.ua){h.Ll=new Int32Array(h.width*h.height),h.Rl=new Int32Array(h.width*h.height),h.$l=1===e.ZA;const t=e.ZA;s&&(h.font=s[t]),h.Ql=1===e.ZA,h.Yl=e.Ko,h.Sl=e.tp,h.Ml=e.tp,h.Qp=1===e.ZA,h.sm=new l.ds(5,null);for(let t=0;t<5;t++){const i=e.ly;h.sm[t]=i,0===i.length&&(h.sm[t]=null)}}h.jl!==c.om&&h.type!==c.Ol||(h._w=e.ly,h.action=e.ly,h.Iw=e.KA),h.jl!==c.hm&&h.jl!==c.am&&h.jl!==c.fm&&h.jl!==c.Zl||(h.rm=e.ly,0===h.rm.length&&(h.jl===c.hm?h.rm='Ok':h.jl===c.am||h.jl===c.fm?h.rm='Select':h.jl===c.Zl&&(h.rm='Continue')))}this.wE=null,this.So=null};static XE=(t,i,s)=>{const h=o.A.jE(i)<<8n|BigInt(s);if(this.wE){const t=this.wE.get(h);if(t)return t}let e;try{e=r.A.za(t,i,s),this.wE?.put(h,e)}catch(t){return null}return e};static la=t=>{if(this.So){const i=this.So.get(BigInt(t));if(i)return i}const i=e.A.model(t);return this.So?.put(BigInt(t),i),i};id=-1;Nd=-1;type=-1;jl=-1;El=0;width=0;height=0;Jp=-1;$o=null;Qo=null;scripts=null;scroll=0;hide=!1;draggable=!1;Qp=!1;im=!1;Sl=0;Ml=0;bl=null;vl=null;Hl=null;sm=null;fill=!1;$l=!1;font=null;Ql=!1;text=null;zl=null;Yl=0;Xl=0;Kl=0;ha=null;sa=null;model=null;zE=null;al=-1;cl=-1;zoom=0;oa=0;fa=0;_w=null;action=null;Iw=-1;rm=null;ll=null;pl=null;ml=null;x=0;y=0;Tl=0;Ll=null;Rl=null;ul=0;fl=0;la(t,i,s){let h=this.model;if(s&&(h=this.zE),!h)return null;if(-1===t&&-1===i&&!h.ZE)return h;const n=e.A.qE(h,!0,!0,!1);return-1===t&&-1===i||n.Ma(),-1!==t&&n.ka(t),-1!==i&&n.ka(i),n.xa(64,768,-50,-10,-50,!0),n}$E(){if(this.Nd===this.id)return this.x;let t=c.Ro[this.Nd];if(!t.ll||!t.pl||!t.ml)return this.x;let i=t.ll.indexOf(this.id);if(-1===i)return this.x;let s=t.pl[i];for(;t.Nd!==t.id;){const h=c.Ro[t.Nd];h.ll&&h.pl&&h.ml&&(i=h.ll.indexOf(t.id),-1!==i&&(s+=h.pl[i])),t=h}return s}JE(){if(this.Nd===this.id)return this.y;let t=c.Ro[this.Nd];if(!t.ll||!t.pl||!t.ml)return this.y;let i=t.ll.indexOf(this.id);if(-1===i)return this.y;let s=t.ml[i];for(;t.Nd!==t.id;){const h=c.Ro[t.Nd];h.ll&&h.pl&&h.ml&&(i=h.ll.indexOf(t.id),-1!==i&&(s+=h.ml[i])),t=h}return s}outline(t){const i=this.$E(),s=this.JE();a.A.Il(i,s,this.width,this.height,t)}move(t,i){if(this.Nd===this.id)return;this.x=0,this.y=0;const s=c.Ro[this.Nd];if(s.ll&&s.pl&&s.ml){const h=s.ll.indexOf(this.id);-1!==h&&(s.pl[h]=t,s.ml[h]=i)}}delete(){if(this.Nd===this.id)return;const t=c.Ro[this.Nd];if(t.ll&&t.pl&&t.ml){const i=t.ll.indexOf(this.id);-1!==i&&(t.ll.splice(i,1),t.pl.splice(i,1),t.ml.splice(i,1))}}}},6333:(t,i,s)=>{s.d(i,{$:()=>h});class h{id;QE=null;constructor(t){this.id=t}tg(t){for(;;){const i=t.ZA;if(0===i)break;this.decode(i,t)}return this}}},2164:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(1069),e=s(6333);class n extends e.${static count=0;static Ro=[];static ec=t=>{const i=new h.A(t.read('flo.dat'));this.count=i.KA;for(let t=0;t(s>179&&(i=i/2|0),s>192&&(i=i/2|0),s>217&&(i=i/2|0),s>243&&(i=i/2|0),(t/4<<10)+(i/32<<7)+(s/2|0));static sg=(t,i)=>-1===t?12345678:((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);static hg=(t,i)=>-2===t?12345678:-1===t?(i<0?i=0:i>127&&(i=127),127-i):((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);eg=0;texture=-1;ng=!1;rg=!0;og=0;lg=0;ag=0;cg=0;fg=0;ug=0;decode(t,i){1===t?(this.eg=i.dg,this.setColor(this.eg)):2===t?this.texture=i.ZA:3===t?this.ng=!0:5===t?this.rg=!1:6===t?this.QE=i.ly:console.log('Error unrecognised config code: ',t)}setColor(t){const i=(t>>16&255)/256,s=(t>>8&255)/256,h=(255&t)/256;let e=i;si&&(r=s),h>r&&(r=h);let o=0,l=0;const a=(e+r)/2;e!==r&&(a<.5&&(l=(r-e)/(r+e)),a>=.5&&(l=(r-e)/(2-r-e)),i===r?o=(s-h)/(r-e):s===r?o=(h-i)/(r-e)+2:h===r&&(o=(i-s)/(r-e)+4)),o/=6,this.og=256*o|0,this.lg=256*l|0,this.ag=256*a|0,this.lg<0?this.lg=0:this.lg>255&&(this.lg=255),this.ag<0?this.ag=0:this.ag>255&&(this.ag=255),this.cg=a>.5?(1-a)*l*512|0:a*l*512|0,this.cg<1&&(this.cg=1),this.fg=o*this.cg|0;let c=this.og+(16*Math.random()|0)-8;c<0?c=0:c>255&&(c=255);let f=this.lg+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255);let u=this.ag+(48*Math.random()|0)-24;u<0?u=0:u>255&&(u=255),this.ug=n.ig(c,f,u)}}},8317:(t,i,s)=>{s.d(i,{A:()=>o});var h=s(1069),e=s(6333),n=s(8665),r=s(3867);class o extends e.${static count=0;static Ro=[];static ec=t=>{const i=new h.A(t.read('idk.dat'));this.count=i.KA;for(let t=0;t=40&&t<50)this.yg[t-40]=i.KA;else if(t>=50&&t<60)this.pg[t-50]=i.KA;else{if(!(t>=60&&t<70))throw new Error(`Unrecognized idk config code: ${t}`);this.Ag[t-60]=i.KA}}la(){if(!this.wg)return null;const t=new r.ds(this.wg.length,null);for(let i=0;i{s.d(i,{A:()=>c});var h=s(6333),e=s(1069),n=s(2679),r=s(8665),o=s(1023),l=s(6169),a=s(3867);class c extends h.${static count=0;static cache=null;static mg=null;static Ig=null;static _g=0;static tu=new n.A(500);static iu=new n.A(30);static ec=t=>{this.mg=new e.A(t.read('loc.dat'));const i=new e.A(t.read('loc.idx'));this.count=i.KA,this.Ig=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.Ig||!this.mg)throw new Error('LocType not loaded!!!');for(let i=0;i<10;i++){const s=this.cache[i];if(s&&s.id===t)return s}this._g=(this._g+1)%10;const i=this.cache[this._g];return this.mg.Fc=this.Ig[t],i.id=t,i.reset(),i.tg(this.mg),i.Eg||(i.Eg=new Int32Array(1)),-1===i.gg&&i.Eg&&(i.active=i.Eg.length>0&&i.Eg[0]===o.A.rA.id,i.wm&&(i.active=!0)),i};static bo=()=>{this.tu=null,this.iu=null,this.Ig=null,this.cache=null,this.mg=null};wg=null;Eg=null;name=null;sw=null;yg=null;pg=null;width=1;length=1;NA=!0;PA=!0;active=!1;gg=-1;Cg=!1;Tg=!1;rg=!1;al=-1;Og=!1;bg=16;vg=0;Lg=0;wm=null;yd=-1;Cd=-1;Rg=!1;Sg=!0;Mg=128;kg=128;xg=128;aA=0;Dg=0;Ng=0;Pg=0;Fg=!1;decode(t,i){if(1===t){const t=i.ZA;this.wg=new Int32Array(t),this.Eg=new Int32Array(t);for(let s=0;s=30&&t<39)this.wm||(this.wm=new a.ds(5,null)),this.wm[t-30]=i.ly,'hidden'===this.wm[t-30]?.toLowerCase()&&(this.wm[t-30]=null);else if(40===t){const t=i.ZA;this.yg=new Uint16Array(t),this.pg=new Uint16Array(t);for(let s=0;s=this.wg.length)return null;let d=this.wg[a];if(-1===d)return null;const w=this.Rg!==i>3;w&&(d+=65536);let A=c.tu?.get(BigInt(d));A||(A=r.A.model(65535&d),w&&A.Vg(),c.tu?.put(BigInt(d),A));const y=128!==this.Mg||128!==this.kg||128!==this.xg,p=0!==this.Dg||0!==this.Ng||0!==this.Pg;let m=r.A.qE(A,!this.yg,!this.Og,i===l.A.bd&&-1===o&&!y&&!p);for(-1!==o&&(m.Ma(),m.ka(o),m.Kg=null,m.Xg=null);i-- >0;)m.zg();if(this.yg&&this.pg)for(let t=0;t{s.d(i,{A:()=>l});var h=s(6333),e=s(1069),n=s(2679),r=s(8665),o=s(3867);class l extends h.${static count=0;static cache=null;static mg=null;static Ig=null;static _g=0;static So=new n.A(30);static ec=t=>{this.mg=new e.A(t.read('npc.dat'));const i=new e.A(t.read('npc.idx'));this.count=i.KA,this.Ig=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.Ig||!this.mg)throw new Error('NpcType not loaded!!!');for(let i=0;i<20;i++){const s=this.cache[i];if(s&&s.id===t)return s}this._g=(this._g+1)%20;const i=this.cache[this._g]=new l(t);return this.mg.Fc=this.Ig[t],i.tg(this.mg),i};static bo=()=>{this.So=null,this.Ig=null,this.cache=null,this.mg=null};name=null;sw=null;size=1;wg=null;Ag=null;Og=!1;AI=-1;lI=-1;cI=-1;uI=-1;wI=-1;yg=null;pg=null;wm=null;Mg=-1;kg=-1;xg=-1;od=!0;_m=-1;qg=128;$g=128;decode(t,i){if(1===t){const t=i.ZA;this.wg=new Uint16Array(t);for(let s=0;s=30&&t<40)this.wm||(this.wm=new o.ds(5,null)),this.wm[t-30]=i.ly,'hidden'===this.wm[t-30]?.toLowerCase()&&(this.wm[t-30]=null);else if(40===t){const t=i.ZA;this.yg=new Uint16Array(t),this.pg=new Uint16Array(t);for(let s=0;s{s.d(i,{A:()=>u});var h=s(6333),e=s(1069),n=s(2511),r=s(2679),o=s(8665),l=s(4583),a=s(8950),c=s(9298),f=s(3867);class u extends h.${static count=0;static cache=null;static mg=null;static Ig=null;static _g=0;static hC=!0;static So=new r.A(50);static su=new r.A(200);static ec=(t,i)=>{this.hC=i,this.mg=new e.A(t.read('obj.dat'));const s=new e.A(t.read('obj.idx'));this.count=s.KA,this.Ig=new Int32Array(this.count);let h=2;for(let t=0;t{if(!this.cache||!this.Ig||!this.mg)throw new Error('ObjType not loaded!!!');for(let i=0;i<10;i++){const s=this.cache[i];if(s&&s.id===t)return s}this._g=(this._g+1)%10;const i=this.cache[this._g];return this.mg.Fc=this.Ig[t],i.id=t,i.reset(),i.tg(this.mg),-1!==i.eC&&i.nC(),!this.hC&&i.members&&(i.name='Members Object',i.sw="Login to a members' server to use this object.",i.wm=null,i.tm=null),i};static bo=()=>{this.So=null,this.su=null,this.Ig=null,this.cache=null,this.mg=null};static kl=(t,i)=>{if(u.su){let s=u.su.get(BigInt(t));if(s&&s.fd!==i&&-1!==s.fd&&(s.sy(),s=null),s)return s}let s=u.get(t);if(s.rC||(i=-1),s.rC&&s.oC&&i>1){let t=-1;for(let h=0;h<10;h++)i>=s.oC[h]&&0!==s.oC[h]&&(t=s.rC[h]);-1!==t&&(s=u.get(t))}const h=new n.A(32,32),e=l.A.na,r=l.A.ra,o=l.A.oc,f=a.A.nc,d=a.A.lC,w=a.A.aC,A=a.A.left,y=a.A.right,p=a.A.top,m=a.A.bottom;l.A.cC=!1,a.A.bind(h.nc,32,32),a.A.fillRect(0,0,32,32,c.A.Bl),l.A.P_();const I=s.vA(1),_=l.A.sin[s.yp]*s.mp>>16,E=l.A.cos[s.yp]*s.mp>>16;I.ca(0,s.pp,s.fC,s.yp,s.uC,_+(I.Zg/2|0)+s.dC,E+s.dC);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===h.nc[t+32*i]&&(t>0&&h.nc[t+32*i-1]>1||i>0&&h.nc[t+32*(i-1)]>1||t<31&&h.nc[t+32*i+1]>1||i<31&&h.nc[t+32*(i+1)]>1)&&(h.nc[t+32*i]=1);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===h.nc[t+32*i]&&t>0&&i>0&&h.nc[t+32*(i-1)-1]>0&&(h.nc[t+32*i]=3153952);if(-1!==s.eC){const t=this.kl(s.wC,10),i=t.Pl,h=t.fd;t.Pl=32,t.fd=32,t.AC(5,5,22,22),t.Pl=i,t.fd=h}return u.su?.put(BigInt(t),h),a.A.bind(f,d,w),a.A.yl(A,p,y,m),l.A.na=e,l.A.ra=r,l.A.oc=o,l.A.cC=!0,s.da?h.Pl=33:h.Pl=32,h.fd=i,h};model=0;name=null;sw=null;yg=null;pg=null;mp=2e3;yp=0;pp=0;fC=0;uC=0;dC=0;yC=!1;pC=-1;da=!1;OA=1;members=!1;wm=null;tm=null;mC=-1;IC=-1;_C=0;EC=-1;gC=-1;CC=0;TC=-1;OC=-1;bC=-1;vC=-1;LC=-1;RC=-1;rC=null;oC=null;wC=-1;eC=-1;decode(t,i){if(1===t)this.model=i.KA;else if(2===t)this.name=i.ly;else if(3===t)this.sw=i.ly;else if(4===t)this.mp=i.KA;else if(5===t)this.yp=i.KA;else if(6===t)this.pp=i.KA;else if(7===t)this.uC=i.tp,this.uC>32767&&(this.uC-=65536);else if(8===t)this.dC=i.tp,this.dC>32767&&(this.dC-=65536);else if(9===t)this.yC=!0;else if(10===t)this.pC=i.KA;else if(11===t)this.da=!0;else if(12===t)this.OA=i.Ko;else if(16===t)this.members=!0;else if(23===t)this.mC=i.KA,this._C=i.zA;else if(24===t)this.IC=i.KA;else if(25===t)this.EC=i.KA,this.CC=i.zA;else if(26===t)this.gC=i.KA;else if(t>=30&&t<35)this.wm||(this.wm=new f.ds(5,null)),this.wm[t-30]=i.ly,'hidden'===this.wm[t-30]?.toLowerCase()&&(this.wm[t-30]=null);else if(t>=35&&t<40)this.tm||(this.tm=new f.ds(5,null)),this.tm[t-35]=i.ly;else if(40===t){const t=i.ZA;this.yg=new Uint16Array(t),this.pg=new Uint16Array(t);for(let s=0;s=100&&t<110&&(this.rC&&this.oC||(this.rC=new Uint16Array(10),this.oC=new Uint16Array(10)),this.rC[t-100]=i.KA,this.oC[t-100]=i.KA)}SC(t){let i=this.mC;if(1===t&&(i=this.EC),-1===i)return null;let s=this.IC,h=this.TC;1===t&&(s=this.gC,h=this.OC);let e=o.A.model(i);if(-1!==s){const t=o.A.model(s);if(-1===h){const i=[e,t];e=o.A.ba(i,2)}else{const i=[e,t,o.A.model(h)];e=o.A.ba(i,3)}}if(0===t&&0!==this._C&&e.translate(this._C,0,0),1===t&&0!==this.CC&&e.translate(this.CC,0,0),this.yg&&this.pg)for(let t=0;t1){let i=-1;for(let s=0;s<10;s++)t>=this.oC[s]&&0!==this.oC[s]&&(i=this.rC[s]);if(-1!==i)return u.get(i).vA(1)}if(u.So){const t=u.So.get(BigInt(this.id));if(t)return t}const i=o.A.model(this.model);if(this.yg&&this.pg)for(let t=0;t{s.d(i,{A:()=>r});var h=s(6333),e=s(1069),n=s(6730);class r extends h.${static count=0;static Ro=[];static ec=t=>{const i=new e.A(t.read('seq.dat'));this.count=i.KA;for(let t=0;t{s.d(i,{A:()=>l});var h=s(6333),e=s(1069),n=s(1312),r=s(8665),o=s(2679);class l extends h.${static count=0;static Ro=[];static So=new o.A(30);static ec=t=>{const i=new e.A(t.read('spotanim.dat'));this.count=i.KA;for(let t=0;t=40&&t<50)this.yg[t-40]=i.KA;else{if(!(t>=50&&t<60))throw new Error(`Unrecognized spotanim config code: ${t}`);this.pg[t-50]=i.KA}}la(){let t=l.So?.get(BigInt(this.id));if(t)return t;t=r.A.model(this.model);for(let i=0;i<6;i++)0!==this.yg[0]&&t.va(this.yg[i],this.pg[i]);return l.So?.put(BigInt(this.id),t),t}}},3764:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(6333),e=s(1069);class n extends h.${static count=0;static Ro=[];static xC=[];static DC=0;static ec=t=>{const i=new e.A(t.read('varp.dat'));this.count=i.KA;for(let t=0;t{s.d(i,{A:()=>h});class h{static OPEN=0;static BC=1;static GC=2;static HC=4;static WC=8;static YC=h.BC<<4;static VC=h.GC<<4;static KC=h.HC<<4;static XC=h.WC<<4;static zC=256;static jC=512;static ZC=1024;static qC=2048;static $C=4096;static JC=h.jC<<4;static QC=h.ZC<<4;static tT=h.qC<<4;static iT=h.$C<<4;static sT=h.zC<<9;static hT=524288;static eT=2097152;static nT=h.eT|h.hT;static rT=h.zC|h.nT;static Id=h.GC|h.rT;static pd=h.WC|h.rT;static bm=h.GC|h.HC|h.pd;static _d=h.VC|h.rT;static Lm=h.WC|h.YC|h._d;static md=h.XC|h.rT;static vm=h.BC|h.GC|h.md;static Rm=h.VC|h.KC|h.md;static oT=16777215}},670:(t,i,s)=>{s.d(i,{A:()=>o});var h=s(9456),e=s(6169),n=s(1023),r=s(4909);class o{static xn=4;static Xn=104;static index=(t,i)=>t*o.Xn+i;offsetX;lT;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.lT=0,this.sizeX=o.Xn,this.sizeZ=o.Xn,this.flags=new Int32Array(this.sizeX*this.sizeZ),this.reset()}reset=()=>{for(let t=0;t{this.flags[o.index(t-this.offsetX,i-this.lT)]|=h.A.eT};GA=(t,i)=>{this.flags[o.index(t-this.offsetX,i-this.lT)]&=~h.A.eT};RA=(t,i,s,n,r,o)=>{let l=h.A.zC;o&&(l|=h.A.sT);const a=t-this.offsetX,c=i-this.lT;if(r===e.A.vd||r===e.A.Rd){const t=s;s=n,n=t}for(let t=a;t=0&&t=0&&i{let l=h.A.zC;o&&(l|=h.A.sT);const a=t-this.offsetX,c=i-this.lT;if(r===e.A.vd||r===e.A.Rd){const t=s;s=n,n=t}for(let t=a;t=0&&t=0&&i{const l=t-this.offsetX,a=i-this.lT,c=o?h.A.iT:h.A.XC,f=o?h.A.$C:h.A.WC,u=o?h.A.ZC:h.A.GC,d=o?h.A.QC:h.A.VC,w=o?h.A.jC:h.A.BC,A=o?h.A.JC:h.A.YC,y=o?h.A.qC:h.A.HC,p=o?h.A.tT:h.A.KC;s===n.A.Td.id?r===e.A.bd?(this.add(l,a,c),this.add(l-1,a,f)):r===e.A.vd?(this.add(l,a,u),this.add(l,a+1,d)):r===e.A.Ld?(this.add(l,a,f),this.add(l+1,a,c)):r===e.A.Rd&&(this.add(l,a,d),this.add(l,a-1,u)):s===n.A.fT.id||s===n.A.Sd.id?r===e.A.bd?(this.add(l,a,w),this.add(l-1,a+1,A)):r===e.A.vd?(this.add(l,a,y),this.add(l+1,a+1,p)):r===e.A.Ld?(this.add(l,a,A),this.add(l+1,a-1,w)):r===e.A.Rd&&(this.add(l,a,p),this.add(l-1,a-1,y)):s===n.A.Od.id&&(r===e.A.bd?(this.add(l,a,u|c),this.add(l-1,a,f),this.add(l,a+1,d)):r===e.A.vd?(this.add(l,a,u|f),this.add(l,a+1,d),this.add(l+1,a,c)):r===e.A.Ld?(this.add(l,a,d|f),this.add(l+1,a,c),this.add(l,a-1,u)):r===e.A.Rd&&(this.add(l,a,d|c),this.add(l,a-1,u),this.add(l-1,a,f))),o&&this.cT(t,i,s,r,!1)};DA=(t,i,s,r,o)=>{const l=t-this.offsetX,a=i-this.lT,c=o?h.A.iT:h.A.XC,f=o?h.A.$C:h.A.WC,u=o?h.A.ZC:h.A.GC,d=o?h.A.QC:h.A.VC,w=o?h.A.jC:h.A.BC,A=o?h.A.JC:h.A.YC,y=o?h.A.qC:h.A.HC,p=o?h.A.tT:h.A.KC;s===n.A.Td.id?r===e.A.bd?(this.remove(l,a,c),this.remove(l-1,a,f)):r===e.A.vd?(this.remove(l,a,u),this.remove(l,a+1,d)):r===e.A.Ld?(this.remove(l,a,f),this.remove(l+1,a,c)):r===e.A.Rd&&(this.remove(l,a,d),this.remove(l,a-1,u)):s===n.A.fT.id||s===n.A.Sd.id?r===e.A.bd?(this.remove(l,a,w),this.remove(l-1,a+1,A)):r===e.A.vd?(this.remove(l,a,y),this.remove(l+1,a+1,p)):r===e.A.Ld?(this.remove(l,a,A),this.remove(l+1,a-1,w)):r===e.A.Rd&&(this.remove(l,a,p),this.remove(l-1,a-1,y)):s===n.A.Od.id&&(r===e.A.bd?(this.remove(l,a,u|c),this.remove(l-1,a,f),this.remove(l,a+1,d)):r===e.A.vd?(this.remove(l,a,u|f),this.remove(l,a+1,d),this.remove(l+1,a,c)):r===e.A.Ld?(this.remove(l,a,d|f),this.remove(l+1,a,c),this.remove(l,a-1,u)):r===e.A.Rd&&(this.remove(l,a,d|c),this.remove(l,a-1,u),this.remove(l-1,a,f))),o&&this.DA(t,i,s,r,!1)};Cm=(t,i,s,r,l,a)=>{if(t===s&&i===r)return!0;const c=t-this.offsetX,f=i-this.lT,u=s-this.offsetX,d=r-this.lT,w=o.index(c,f);if(l===n.A.Td.id){if(a===e.A.bd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A._d)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.Id)===h.A.OPEN)return!0}else if(a===e.A.vd){if(c===u&&f===d+1)return!0;if(c===u-1&&f===d&&(this.flags[w]&h.A.pd)===h.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.md)===h.A.OPEN)return!0}else if(a===e.A.Ld){if(c===u+1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A._d)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.Id)===h.A.OPEN)return!0}else if(a===e.A.Rd){if(c===u&&f===d-1)return!0;if(c===u-1&&f===d&&(this.flags[w]&h.A.pd)===h.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.md)===h.A.OPEN)return!0}}else if(l===n.A.Od.id){if(a===e.A.bd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.md)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.Id)===h.A.OPEN)return!0}else if(a===e.A.vd){if(c===u-1&&f===d&&(this.flags[w]&h.A.pd)===h.A.OPEN)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.Id)===h.A.OPEN)return!0}else if(a===e.A.Ld){if(c===u-1&&f===d&&(this.flags[w]&h.A.pd)===h.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A._d)===h.A.OPEN)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1)return!0}else if(a===e.A.Rd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A._d)===h.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.md)===h.A.OPEN)return!0;if(c===u&&f===d-1)return!0}}else if(l===n.A.kd.id){if(c===u&&f===d+1&&(this.flags[w]&h.A.VC)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.GC)===h.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&h.A.WC)===h.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.XC)===h.A.OPEN)return!0}return!1};Tm=(t,i,s,r,l,a)=>{if(t===s&&i===r)return!0;const c=t-this.offsetX,f=i-this.lT,u=s-this.offsetX,d=r-this.lT,w=o.index(c,f);if(l===n.A.uT.id||l===n.A.dT.id){if(l===n.A.dT.id&&(a=a+2&3),a===e.A.bd){if(c===u+1&&f===d&&(this.flags[w]&h.A.XC)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.GC)===h.A.OPEN)return!0}else if(a===e.A.vd){if(c===u-1&&f===d&&(this.flags[w]&h.A.WC)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.GC)===h.A.OPEN)return!0}else if(a===e.A.Ld){if(c===u-1&&f===d&&(this.flags[w]&h.A.WC)===h.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A.VC)===h.A.OPEN)return!0}else if(a===e.A.Rd){if(c===u+1&&f===d&&(this.flags[w]&h.A.XC)===h.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A.VC)===h.A.OPEN)return!0}}else if(l===n.A.wT.id){if(c===u&&f===d+1&&(this.flags[w]&h.A.VC)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.GC)===h.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&h.A.WC)===h.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.XC)===h.A.OPEN)return!0}return!1};Om=(t,i,s,e,n,l,a)=>{const c=s+n-1,f=e+l-1,u=o.index(t-this.offsetX,i-this.lT);return t>=s&&t<=c&&i>=e&&i<=f||(t===s-1&&i>=e&&i<=f&&(this.flags[u]&h.A.WC)===h.A.OPEN&&(a&r.A.bd)===h.A.OPEN||(t===c+1&&i>=e&&i<=f&&(this.flags[u]&h.A.XC)===h.A.OPEN&&(a&r.A.Ld)===h.A.OPEN||(i===e-1&&t>=s&&t<=c&&(this.flags[u]&h.A.GC)===h.A.OPEN&&(a&r.A.Rd)===h.A.OPEN||i===f+1&&t>=s&&t<=c&&(this.flags[u]&h.A.VC)===h.A.OPEN&&(a&r.A.vd)===h.A.OPEN)))};add=(t,i,s)=>{this.flags[o.index(t,i)]|=s};remove=(t,i,s)=>{this.flags[o.index(t,i)]&=h.A.oT-s}}},4909:(t,i,s)=>{s.d(i,{A:()=>h});class h{static vd=1;static Ld=2;static Rd=4;static bd=8}},6169:(t,i,s)=>{s.d(i,{A:()=>h});class h{static bd=0;static vd=1;static Ld=2;static Rd=3}},5599:(t,i,s)=>{s.d(i,{A:()=>h});class h{static SA=0;static MA=1;static xA=2;static lA=3}},1023:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(5599);class e{static Td=new e(0,h.A.SA);static fT=new e(1,h.A.SA);static Od=new e(2,h.A.SA);static Sd=new e(3,h.A.SA);static VI=new e(4,h.A.MA);static gm=new e(5,h.A.MA);static uT=new e(6,h.A.MA);static dT=new e(7,h.A.MA);static wT=new e(8,h.A.MA);static kd=new e(9,h.A.xA);static rA=new e(10,h.A.xA);static oA=new e(11,h.A.xA);static AT=new e(12,h.A.xA);static yT=new e(13,h.A.xA);static pT=new e(14,h.A.xA);static mT=new e(15,h.A.xA);static IT=new e(16,h.A.xA);static _T=new e(17,h.A.xA);static ET=new e(18,h.A.xA);static gT=new e(19,h.A.xA);static CT=new e(20,h.A.xA);static TT=new e(21,h.A.xA);static lA=new e(22,h.A.lA);static values(){return[this.Td,this.fT,this._T,this.mT,this.Od,this.pT,this.kd,this.Sd,this.lA,this.AT,this.oA,this.uT,this.CT,this.rA,this.gm,this.yT,this.dT,this.VI,this.IT,this.wT,this.gT,this.TT,this.ET]}static of(t){const i=this.values();for(let s=0;s{s.d(i,{A:()=>y});var h=s(670),e=s(2164),n=s(1069),r=s(4583),o=s(3045),l=s(5637),a=s(4197),c=s(1312),f=s(1023),u=s(6169),d=s(9298),w=s(5518),A=s(3867);class y{static OT=Int8Array.of(1,2,4,8);static bT=Uint8Array.of(16,32,64,128);static vT=Int8Array.of(1,0,-1,0);static LT=Int8Array.of(0,-1,0,1);static RT=(17*Math.random()|0)-8;static ST=(33*Math.random()|0)-16;static st=!0;static Dp=0;static MT=!1;static kT=(t,i)=>{let s=this.xT(t+45365,i+91923,4)+(this.xT(t+10294,i+37821,2)-128>>1)+(this.xT(t,i,1)-128>>2)-128;return s=35+(.3*s|0),s<10?s=10:s>60&&(s=60),s};static xT=(t,i,s)=>{const h=t/s|0,e=t&s-1,n=i/s|0,r=i&s-1,o=this.DT(h,n),l=this.DT(h+1,n),a=this.DT(h,n+1),c=this.DT(h+1,n+1),f=this.NT(o,l,e,s),u=this.NT(a,c,e,s);return this.NT(f,u,r,s)};static NT=(t,i,s,h)=>{const e=65536-r.A.cos[1024*s/h|0]>>1;return(t*(65536-e)>>16)+(i*e>>16)};static DT=(t,i)=>((this.PT(t-1,i-1)+this.PT(t+1,i-1)+this.PT(t-1,i+1)+this.PT(t+1,i+1))/16|0)+((this.PT(t-1,i)+this.PT(t+1,i)+this.PT(t,i-1)+this.PT(t,i+1))/8|0)+(this.PT(t,i)/4|0);static PT=(t,i)=>{const s=t+57*i,h=BigInt(s<<13^s);return 255&Number((h*(h*h*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static RA=(t,i,s,h,e,n,r,o,d,w,A)=>{const p=e[A][i][s],m=e[A][i+1][s],I=e[A][i+1][s+1],_=e[A][i][s+1],E=p+m+I+_>>2,g=l.A.get(o);let C=i+(s<<7)+(o<<14)+1073741824|0;g.active||(C+=-2147483648),C|=0;const T=(w<<6)+d<<24>>24;if(d===f.A.lA.id)h?.FT(g.la(f.A.lA.id,w,p,m,I,_,-1),t,i,s,E,C,T),g.NA&&g.active&&r?.aT(i,s),-1!==g.al&&n.n_(new a.A(o,t,3,i,s,c.A.Ro[g.al],!0));else if(d===f.A.rA.id||d===f.A.oA.id){const e=g.la(f.A.rA.id,w,p,m,I,_,-1);if(e){let n,r,o=0;d===f.A.oA.id&&(o+=256),w===u.A.vd||w===u.A.Rd?(n=g.length,r=g.width):(n=g.width,r=g.length),h?.RA(t,i,s,E,e,null,C,T,n,r,o)}g.NA&&r?.RA(i,s,g.width,g.length,w,g.PA),-1!==g.al&&n.n_(new a.A(o,t,2,i,s,c.A.Ro[g.al],!0))}else if(d>=f.A.AT.id)h?.RA(t,i,s,E,g.la(d,w,p,m,I,_,-1),null,C,T,1,1,0),g.NA&&r?.RA(i,s,g.width,g.length,w,g.PA),-1!==g.al&&n.n_(new a.A(o,t,2,i,s,c.A.Ro[g.al],!0));else if(d===f.A.Td.id)h?.cT(t,i,s,E,y.OT[w],0,g.la(f.A.Td.id,w,p,m,I,_,-1),null,C,T),g.NA&&r?.cT(i,s,d,w,g.PA),-1!==g.al&&n.n_(new a.A(o,t,0,i,s,c.A.Ro[g.al],!0));else if(d===f.A.fT.id)h?.cT(t,i,s,E,y.bT[w],0,g.la(f.A.fT.id,w,p,m,I,_,-1),null,C,T),g.NA&&r?.cT(i,s,d,w,g.PA),-1!==g.al&&n.n_(new a.A(o,t,0,i,s,c.A.Ro[g.al],!0));else if(d===f.A.Od.id){const e=w+1&3;h?.cT(t,i,s,E,y.OT[w],y.OT[e],g.la(f.A.Od.id,w+4,p,m,I,_,-1),g.la(f.A.Od.id,e,p,m,I,_,-1),C,T),g.NA&&r?.cT(i,s,d,w,g.PA),-1!==g.al&&n.n_(new a.A(o,t,0,i,s,c.A.Ro[g.al],!0))}else if(d===f.A.Sd.id)h?.cT(t,i,s,E,y.bT[w],0,g.la(f.A.Sd.id,w,p,m,I,_,-1),null,C,T),g.NA&&r?.cT(i,s,d,w,g.PA),-1!==g.al&&n.n_(new a.A(o,t,0,i,s,c.A.Ro[g.al],!0));else if(d===f.A.kd.id)h?.RA(t,i,s,E,g.la(d,w,p,m,I,_,-1),null,C,T,1,1,0),g.NA&&r?.RA(i,s,g.width,g.length,w,g.PA),-1!==g.al&&n.n_(new a.A(o,t,2,i,s,c.A.Ro[g.al],!0));else if(d===f.A.VI.id)h?.UT(t,i,s,E,0,0,C,g.la(f.A.VI.id,u.A.bd,p,m,I,_,-1),T,512*w,y.OT[w]),-1!==g.al&&n.n_(new a.A(o,t,1,i,s,c.A.Ro[g.al],!0));else if(d===f.A.gm.id){let e=16;if(h){const n=h.Ed(t,i,s);n>0&&(e=l.A.get(n>>14&32767).bg)}h?.UT(t,i,s,E,y.vT[w]*e,y.LT[w]*e,C,g.la(f.A.VI.id,u.A.bd,p,m,I,_,-1),T,512*w,y.OT[w]),-1!==g.al&&n.n_(new a.A(o,t,1,i,s,c.A.Ro[g.al],!0))}else d===f.A.uT.id?(h?.UT(t,i,s,E,0,0,C,g.la(f.A.VI.id,u.A.bd,p,m,I,_,-1),T,w,256),-1!==g.al&&n.n_(new a.A(o,t,1,i,s,c.A.Ro[g.al],!0))):d===f.A.dT.id?(h?.UT(t,i,s,E,0,0,C,g.la(f.A.VI.id,u.A.bd,p,m,I,_,-1),T,w,512),-1!==g.al&&n.n_(new a.A(o,t,1,i,s,c.A.Ro[g.al],!0))):d===f.A.wT.id&&(h?.UT(t,i,s,E,0,0,C,g.la(f.A.VI.id,u.A.bd,p,m,I,_,-1),T,w,768),-1!==g.al&&n.n_(new a.A(o,t,1,i,s,c.A.Ro[g.al],!0)))};xI;DI;Wn;Yn;BT;GT;HT;WT;YT;VT;KT;XT;zT;jT;ZT;qT;constructor(t,i,s,e){this.xI=t,this.DI=i,this.Wn=s,this.Yn=e,this.BT=new A.qa(h.A.xn,t,i),this.GT=new A.qa(h.A.xn,t,i),this.HT=new A.qa(h.A.xn,t,i),this.WT=new A.qa(h.A.xn,t,i),this.qT=new A.$a(h.A.xn,t+1,i+1),this.YT=new A.qa(h.A.xn,t+1,i+1),this.VT=new A.Kn(t+1,i+1),this.KT=new Int32Array(i),this.XT=new Int32Array(i),this.zT=new Int32Array(i),this.jT=new Int32Array(i),this.ZT=new Int32Array(i)}Hp=(t,i)=>{for(let t=0;t=0&&i[h]?.aT(s,e)}y.RT+=(5*Math.random()|0)-2,y.RT<-8?y.RT=-8:y.RT>8&&(y.RT=8),y.ST+=(5*Math.random()|0)-2,y.ST<-16?y.ST=-16:y.ST>16&&(y.ST=16);for(let i=0;i>8;for(let t=1;t>2)+(s[e+1][t]>>3)+(s[e][t-1]>>2)+(s[e][t+1]>>3)+(s[e][t]>>1);this.VT[e][t]=u-d}for(let t=0;t=0&&h0){const i=e.A.Ro[s-1];this.KT[t]+=i.fg,this.XT[t]+=i.lg,this.zT[t]+=i.ag,this.jT[t]+=i.cg,n=this.ZT[t]++}}const r=s-5;if(r>=0&&r0){const i=e.A.Ro[s-1];this.KT[t]-=i.fg,this.XT[t]-=i.lg,this.zT[t]-=i.ag,this.jT[t]-=i.cg,n=this.ZT[t]--}}}if(s>=1&&s=0&&f=0&&A=1&&c0||A>0){const p=this.Wn[i][s][c],m=this.Wn[i][s+1][c],I=this.Wn[i][s+1][c+1],_=this.Wn[i][s][c+1],E=this.VT[s][c],g=this.VT[s+1][c],C=this.VT[s+1][c+1],T=this.VT[s][c+1];let O=-1,b=-1;if(f>0){const t=256*h/l|0,i=n/a|0;let s=o/a|0;O=e.A.ig(t,i,s);const r=t+y.RT&255;s+=y.ST,s<0?s=0:s>255&&(s=255),b=e.A.ig(r,i,s)}if(i>0){let t=0!==f||this.HT[i][s][c]===w.A.JT;A>0&&!e.A.Ro[A-1].rg&&(t=!1),t&&p===m&&p===I&&p===_&&(this.qT[i][s][c]|=2340)}let v=0;if(-1!==O&&(v=r.A.palette[e.A.sg(b,96)]),0===A)t?.QT(i,s,c,w.A.JT,u.A.bd,-1,p,m,I,_,e.A.sg(O,E),e.A.sg(O,g),e.A.sg(O,C),e.A.sg(O,T),d.A.Bl,d.A.Bl,d.A.Bl,d.A.Bl,v,d.A.Bl);else{const h=this.HT[i][s][c]+1,n=this.WT[i][s][c],o=e.A.Ro[A-1];let l,a,f=o.texture;f>=0?(a=r.A.tO(f),l=-1):o.eg===d.A.vc?(a=0,l=-2,f=-1):(l=e.A.ig(o.og,o.lg,o.ag),a=r.A.palette[e.A.hg(o.ug,96)]),t?.QT(i,s,c,h,n,f,p,m,I,_,e.A.sg(O,E),e.A.sg(O,g),e.A.sg(O,C),e.A.sg(O,T),e.A.hg(l,E),e.A.hg(l,g),e.A.hg(l,C),e.A.hg(l,T),v,a)}}}}}}for(let s=1;s0&&(t<<=3,i<<=3,s<<=3);for(let h=0;h<=e;h++)for(let n=0;n<=this.DI;n++)for(let r=0;r<=this.xI;r++){if(this.qT[h][r][n]&t){let i=n,s=n,l=h,a=h;for(;i>0&&this.qT[h][r][i-1]&t;)i--;for(;s0;){for(let h=i;h<=s;h++)if(!(this.qT[l-1][r][h]&t))break t;l--}t:for(;a=8){const h=this.Wn[a][r][i]-240,n=this.Wn[l][r][i];o.A.eO(e,1,128*r,h,128*i,128*r,n,128*s+128);for(let h=l;h<=a;h++)for(let e=i;e<=s;e++)this.qT[h][r][e]&=~t}}if(this.qT[h][r][n]&i){let t=r,s=r,l=h,a=h;for(;t>0&&this.qT[h][t-1][n]&i;)t--;for(;s0;){for(let h=t;h<=s;h++)if(!(this.qT[l-1][h][n]&i))break t;l--}t:for(;a=8){const h=this.Wn[a][t][n]-240,r=this.Wn[l][t][n];o.A.eO(e,2,128*t,h,128*n,128*s+128,r,128*n);for(let h=l;h<=a;h++)for(let e=t;e<=s;e++)this.qT[h][e][n]&=~i}}if(this.qT[h][r][n]&s){let t=r,i=r,l=n,a=n;for(;l>0&&this.qT[h][r][l-1]&s;)l--;for(;a0;){for(let i=l;i<=a;i++)if(!(this.qT[h][t-1][i]&s))break t;t--}t:for(;i=4){const n=this.Wn[h][t][l];o.A.eO(e,4,128*t,n,128*l,128*i+128,n,128*a+128);for(let e=t;e<=i;e++)for(let t=l;t<=a;t++)this.qT[h][e][t]&=~s}}}}}};Bp=(t,i,s,n)=>{let r=0;for(let t=0;t>24;break}for(let e=t;e=0&&t=0&&e{const o=new n.A(new Uint8Array(r));for(let n=0;n=0&&a=0&&c>24,this.WT[n][a][c]=(f-2&3)<<24>>24):f<=81?this.Yn[n][a][c]=f-49<<24>>24:this.BT[n][a][c]=f-81<<24>>24}else for(;f=o.ZA,0!==f;){if(1===f){o.ZA;break}f<=49&&o.ZA}}};Gp=(t,i,s,e,r,o)=>{const l=new n.A(new Uint8Array(e));let a=-1;for(;;){const e=l.nO;if(0===e)return;a+=e;let n=0;for(;;){const e=l.nO;if(0===e)break;n+=e-1;const c=63&n,f=n>>6&63,u=n>>12,d=l.ZA,w=d>>2,A=3&d,y=f+r,p=c+o;if(y>0&&p>0&&y=0&&(e=s[h]),this.RA(u,y,p,t,i,e,a,w,A)}}}};RA=(t,i,s,h,e,n,r,o,d)=>{if(y.st){if(16&this.Yn[t][i][s])return;if(this.$T(t,i,s)!==y.Dp)return}const w=this.Wn[t][i][s],A=this.Wn[t][i+1][s],p=this.Wn[t][i+1][s+1],m=this.Wn[t][i][s+1],I=w+A+p+m>>2,_=l.A.get(r);let E=i+(s<<7)+(r<<14)+1073741824|0;_.active||(E+=-2147483648),E|=0;const g=(d<<6)+o<<24>>24;if(o===f.A.lA.id)(!y.st||_.active||_.Fg)&&(h?.FT(_.la(f.A.lA.id,d,w,A,p,m,-1),t,i,s,I,E,g),_.NA&&_.active&&n?.aT(i,s),-1!==_.al&&e.n_(new a.A(r,t,3,i,s,c.A.Ro[_.al],!0)));else if(o===f.A.rA.id||o===f.A.oA.id){const l=_.la(f.A.rA.id,d,w,A,p,m,-1);if(l){let e,n,r=0;if(o===f.A.oA.id&&(r+=256),d===u.A.vd||d===u.A.Rd?(e=_.length,n=_.width):(e=_.width,n=_.length),h?.RA(t,i,s,I,l,null,E,g,e,n,r)&&_.Sg)for(let h=0;h<=e;h++)for(let e=0;e<=n;e++){let n=l.rO/4|0;n>30&&(n=30),n>this.YT[t][i+h][s+e]&&(this.YT[t][i+h][s+e]=n<<24>>24)}}_.NA&&n?.RA(i,s,_.width,_.length,d,_.PA),-1!==_.al&&e.n_(new a.A(r,t,2,i,s,c.A.Ro[_.al],!0))}else if(o>=f.A.AT.id)h?.RA(t,i,s,I,_.la(o,d,w,A,p,m,-1),null,E,g,1,1,0),o>=f.A.AT.id&&o<=f.A._T.id&&o!==f.A.yT.id&&t>0&&(this.qT[t][i][s]|=2340),_.NA&&n?.RA(i,s,_.width,_.length,d,_.PA),-1!==_.al&&e.n_(new a.A(r,t,2,i,s,c.A.Ro[_.al],!0));else if(o===f.A.Td.id)h?.cT(t,i,s,I,y.OT[d],0,_.la(f.A.Td.id,d,w,A,p,m,-1),null,E,g),d===u.A.bd?(_.Sg&&(this.YT[t][i][s]=50,this.YT[t][i][s+1]=50),_.rg&&(this.qT[t][i][s]|=585)):d===u.A.vd?(_.Sg&&(this.YT[t][i][s+1]=50,this.YT[t][i+1][s+1]=50),_.rg&&(this.qT[t][i][s+1]|=1170)):d===u.A.Ld?(_.Sg&&(this.YT[t][i+1][s]=50,this.YT[t][i+1][s+1]=50),_.rg&&(this.qT[t][i+1][s]|=585)):d===u.A.Rd&&(_.Sg&&(this.YT[t][i][s]=50,this.YT[t][i+1][s]=50),_.rg&&(this.qT[t][i][s]|=1170)),_.NA&&n?.cT(i,s,o,d,_.PA),-1!==_.al&&e.n_(new a.A(r,t,0,i,s,c.A.Ro[_.al],!0)),16!==_.bg&&h?.oO(t,i,s,_.bg);else if(o===f.A.fT.id)h?.cT(t,i,s,I,y.bT[d],0,_.la(f.A.fT.id,d,w,A,p,m,-1),null,E,g),_.Sg&&(d===u.A.bd?this.YT[t][i][s+1]=50:d===u.A.vd?this.YT[t][i+1][s+1]=50:d===u.A.Ld?this.YT[t][i+1][s]=50:d===u.A.Rd&&(this.YT[t][i][s]=50)),_.NA&&n?.cT(i,s,o,d,_.PA),-1!==_.al&&e.n_(new a.A(r,t,0,i,s,c.A.Ro[_.al],!0));else if(o===f.A.Od.id){const l=d+1&3;h?.cT(t,i,s,I,y.OT[d],y.OT[l],_.la(f.A.Od.id,d+4,w,A,p,m,-1),_.la(f.A.Od.id,l,w,A,p,m,-1),E,g),_.rg&&(d===u.A.bd?(this.qT[t][i][s]|=265,this.qT[t][i][s+1]|=1170):d===u.A.vd?(this.qT[t][i][s+1]|=1170,this.qT[t][i+1][s]|=585):d===u.A.Ld?(this.qT[t][i+1][s]|=585,this.qT[t][i][s]|=1170):d===u.A.Rd&&(this.qT[t][i][s]|=1170,this.qT[t][i][s]|=585)),_.NA&&n?.cT(i,s,o,d,_.PA),-1!==_.al&&e.n_(new a.A(r,t,0,i,s,c.A.Ro[_.al],!0)),16!==_.bg&&h?.oO(t,i,s,_.bg)}else if(o===f.A.Sd.id)h?.cT(t,i,s,I,y.bT[d],0,_.la(f.A.Sd.id,d,w,A,p,m,-1),null,E,g),_.Sg&&(d===u.A.bd?this.YT[t][i][s+1]=50:d===u.A.vd?this.YT[t][i+1][s+1]=50:d===u.A.Ld?this.YT[t][i+1][s]=50:d===u.A.Rd&&(this.YT[t][i][s]=50)),_.NA&&n?.cT(i,s,o,d,_.PA),-1!==_.al&&e.n_(new a.A(r,t,0,i,s,c.A.Ro[_.al],!0));else if(o===f.A.kd.id)h?.RA(t,i,s,I,_.la(o,d,w,A,p,m,-1),null,E,g,1,1,0),_.NA&&n?.RA(i,s,_.width,_.length,d,_.PA),-1!==_.al&&e.n_(new a.A(r,t,2,i,s,c.A.Ro[_.al],!0));else if(o===f.A.VI.id)h?.UT(t,i,s,I,0,0,E,_.la(f.A.VI.id,u.A.bd,w,A,p,m,-1),g,512*d,y.OT[d]),-1!==_.al&&e.n_(new a.A(r,t,1,i,s,c.A.Ro[_.al],!0));else if(o===f.A.gm.id){let n=16;if(h){const e=h.Ed(t,i,s);e>0&&(n=l.A.get(e>>14&32767).bg)}h?.UT(t,i,s,I,y.vT[d]*n,y.LT[d]*n,E,_.la(f.A.VI.id,u.A.bd,w,A,p,m,-1),g,512*d,y.OT[d]),-1!==_.al&&e.n_(new a.A(r,t,1,i,s,c.A.Ro[_.al],!0))}else o===f.A.uT.id?(h?.UT(t,i,s,I,0,0,E,_.la(f.A.VI.id,u.A.bd,w,A,p,m,-1),g,d,256),-1!==_.al&&e.n_(new a.A(r,t,1,i,s,c.A.Ro[_.al],!0))):o===f.A.dT.id?(h?.UT(t,i,s,I,0,0,E,_.la(f.A.VI.id,u.A.bd,w,A,p,m,-1),g,d,512),-1!==_.al&&e.n_(new a.A(r,t,1,i,s,c.A.Ro[_.al],!0))):o===f.A.wT.id&&(h?.UT(t,i,s,I,0,0,E,_.la(f.A.VI.id,u.A.bd,w,A,p,m,-1),g,d,768),-1!==_.al&&e.n_(new a.A(r,t,1,i,s,c.A.Ro[_.al],!0)))};$T=(t,i,s)=>8&this.Yn[t][i][s]?0:t<=0||!(2&this.Yn[1][i][s])?t:t-1}},3045:(t,i,s)=>{s.d(i,{A:()=>I});var h=s(4583),e=s(1161),n=s(3795),r=s(8256),o=s(670),l=s(9222),a=s(6855),c=s(7441),f=s(6666),u=s(5748),d=s(3479),w=s(8950),A=s(2771),y=s(5518),p=s(6169),m=s(3867);class I{static lO=new m.aO(8,32,51,51,!1);static cO=new m.ds(100,null);static Xu=new Int32Array(o.A.xn);static fO=new m.uO(o.A.xn,500,null);static dO=new m.ds(500,null);static wO=new f.A;static Vf=0;static AO=0;static yO=0;static pO=0;static mO=0;static IO=0;static _O=0;static EO=0;static gO=0;static CO=0;static TO=0;static OO=0;static bO=0;static vO=0;static LO=0;static RO=0;static SO=0;static MO=0;static kO=0;static xO=0;static zu=0;static DO=0;static NO=!1;static PO=null;static FO=Uint8Array.of(19,55,38,155,255,110,137,205,76);static UO=Uint8Array.of(160,192,80,96,0,144,80,48,160);static BO=Uint8Array.of(76,8,137,4,0,1,38,2,19);static GO=Int8Array.of(0,0,2,0,0,2,1,1,0);static HO=Int8Array.of(2,0,0,2,0,0,0,4,4);static WO=Int8Array.of(0,4,4,8,0,0,8,0,0);static YO=Int8Array.of(1,1,0,0,0,8,0,0,8);static VO=Int8Array.of(53,-53,-53,53);static KO=Int8Array.of(-53,-53,53,53);static XO=Int8Array.of(-45,45,45,-45);static zO=Int8Array.of(45,45,-45,-45);static jO=[new Int8Array(16),Int8Array.of(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,0,0,0,1,1,0,0,1,1,1,0,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1),Int8Array.of(0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0),Int8Array.of(0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0),Int8Array.of(1,1,1,1,1,1,1,1,0,1,1,1,0,0,1,1),Int8Array.of(1,1,1,1,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,0,0,0,0,1,1,0,1,1,1,0,1,1,1),Int8Array.of(0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1)];static ZO=[Int8Array.of(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),Int8Array.of(12,8,4,0,13,9,5,1,14,10,6,2,15,11,7,3),Int8Array.of(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0),Int8Array.of(3,7,11,15,2,6,10,14,1,5,9,13,0,4,8,12)];static qO=Int32Array.of(41,39248,41,4643,41,41,41,41,41,41,41,41,41,41,41,43086,41,41,41,41,41,41,41,8602,41,28992,41,41,41,41,41,5056,41,41,41,41,41,41,41,41,41,41,41,41,41,41,3131,41,41,41);static ju=0;static xl=0;static Dl=0;static ff=-1;static uf=-1;static st=!0;static init=(t,i,s,e,n)=>{this.AO=0,this.yO=0,this.pO=t,this.mO=i,this.IO=t/2|0,this._O=i/2|0;const r=new m.aO(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let i=0;i<2048;i+=64){this.EO=h.A.sin[t],this.gO=h.A.cos[t],this.CO=h.A.sin[i],this.TO=h.A.cos[i];const o=(t-128)/32|0,l=i/64|0;for(let t=-26;t<=26;t++)for(let i=-26;i<=26;i++){const h=128*t,a=128*i;let c=!1;for(let t=-s;t<=e;t+=128)if(this.$O(h,a,n[o]+t)){c=!0;break}r[o][l][t+25+1][i+25+1]=c}}for(let t=0;t<8;t++)for(let i=0;i<32;i++)for(let s=-25;s<25;s++)for(let h=-25;h<25;h++){let e=!1;t:for(let n=-1;n<=1;n++)for(let o=-1;o<=1;o++){if(r[t][i][s+n+25+1][h+o+25+1]){e=!0;break t}if(r[t][(i+1)%31][s+n+25+1][h+o+25+1]){e=!0;break t}if(r[t+1][i][s+n+25+1][h+o+25+1]){e=!0;break t}if(r[t+1][(i+1)%31][s+n+25+1][h+o+25+1]){e=!0;break t}}this.lO[t][i][s+25][h+25]=e}};static bo=()=>{this.cO=null,this.Xu=null,this.fO=null,this.wO=null,this.lO=null,this.dO=null,this.PO=null,console.log('World3D unloaded!')};static eO=(t,i,s,h,e,n,o,l)=>{I.fO[t][I.Xu[t]++]=new r.A(s/128|0,n/128|0,e/128|0,l/128|0,i,s,n,e,l,h,o)};static $O=(t,i,s)=>{const h=i*this.CO+t*this.TO>>16,e=i*this.TO-t*this.CO>>16,n=s*this.EO+e*this.gO>>16,r=s*this.gO-e*this.EO>>16;if(n<50||n>3500)return!1;const o=this.IO+((h<<9)/n|0),l=this._O+((r<<9)/n|0);return o>=this.AO&&o<=this.pO&&l>=this.yO&&l<=this.mO};JO;xI;DI;QO;tb;Er;ib;sb;hb;eb=0;nb=0;rb=0;constructor(t,i,s,h){this.JO=s,this.xI=h,this.DI=i,this.tb=new m.Cr(s,h,i,null),this.ib=new m.$a(s,h+1,i+1),this.QO=t,this.Er=new m.ds(5e3,null),this.sb=new Int32Array(1e4),this.hb=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this.nb=t;for(let i=0;i{const s=this.tb[0][t][i];for(let s=0;s<3;s++){this.tb[s][t][i]=this.tb[s+1][t][i];const h=this.tb[s][t][i];h&&h.level--}this.tb[0][t][i]||(this.tb[0][t][i]=new n.A(0,t,i));const h=this.tb[0][t][i];h&&(h.ob=s),this.tb[3][t][i]=null};iO=(t,i,s,h)=>{const e=this.tb[t][i][s];e&&(e.lb=h)};QT=(t,i,s,h,e,r,o,l,a,c,f,u,w,p,m,I,_,E,g,C)=>{if(h===y.A.JT){for(let h=t;h>=0;h--)this.tb[h][i][s]||(this.tb[h][i][s]=new n.A(h,i,s));const h=this.tb[t][i][s];h&&(h.ab=new d.A(f,u,w,p,-1,g,!1))}else if(h===y.A.cb){for(let h=t;h>=0;h--)this.tb[h][i][s]||(this.tb[h][i][s]=new n.A(h,i,s));const h=this.tb[t][i][s];h&&(h.ab=new d.A(m,I,_,E,r,C,o===l&&o===a&&o===c))}else{for(let h=t;h>=0;h--)this.tb[h][i][s]||(this.tb[h][i][s]=new n.A(h,i,s));const d=this.tb[t][i][s];d&&(d.fb=new A.A(i,h,I,l,w,e,f,c,C,m,r,E,g,a,_,p,o,s,u))}};FT=(t,i,s,h,e,r,o)=>{this.tb[i][s][h]||(this.tb[i][s][h]=new n.A(i,s,h));const a=this.tb[i][s][h];a&&(a.ub=new l.A(e,128*s+64,128*h+64,t,r,o))};BA=(t,i,s)=>{const h=this.tb[t][i][s];h&&(h.ub=null)};LA=(t,i,s,h,e,r,o,l)=>{let a=0;const c=this.tb[h][t][i];if(c)for(let t=0;ta&&(a=s)}else this.tb[h][t][i]=new n.A(h,t,i);const f=this.tb[h][t][i];f&&(f.yb=new u.A(s,128*t+64,128*i+64,r,o,l,e,a))};TA=(t,i,s)=>{const h=this.tb[t][i][s];h&&(h.yb=null)};cT=(t,i,s,h,e,r,o,l,c,f)=>{if(!o&&!l)return;for(let h=t;h>=0;h--)this.tb[h][i][s]||(this.tb[h][i][s]=new n.A(h,i,s));const u=this.tb[t][i][s];u&&(u.pb=new a.A(h,128*i+64,128*s+64,e,r,o,l,c,f))};DA=(t,i,s,h)=>{const e=this.tb[t][i][s];1===h&&e&&(e.pb=null)};UT=(t,i,s,h,e,r,o,l,a,f,u)=>{if(!l)return;for(let h=t;h>=0;h--)this.tb[h][i][s]||(this.tb[h][i][s]=new n.A(h,i,s));const d=this.tb[t][i][s];d&&(d.mb=new c.A(h,128*i+e+64,128*s+r+64,u,f,l,o,a))};FA=(t,i,s)=>{const h=this.tb[t][i][s];h&&(h.mb=null)};oO=(t,i,s,h)=>{const e=this.tb[t][i][s];if(!e)return;const n=e.mb;if(!n)return;const r=128*i+64,o=128*s+64;n.x=r+((n.x-r)*h/16|0),n.z=o+((n.z-o)*h/16|0)};YI=(t,i,s,h)=>{if(!h)return;const e=this.tb[t][i][s];if(!e)return;const n=e.mb;n&&(n.model=h)};zI=(t,i,s,h)=>{if(!h)return;const e=this.tb[t][i][s];if(!e)return;const n=e.ub;n&&(n.model=h)};XI=(t,i,s,h)=>{if(!h)return;const e=this.tb[t][i][s];if(!e)return;const n=e.pb;n&&(n.Ib=h)};KI=(t,i,s,h,e)=>{if(!h)return;const n=this.tb[s][t][i];if(!n)return;const r=n.pb;r&&(r.Ib=h,r._b=e)};RA=(t,i,s,h,e,n,r,o,l,a,c)=>{if(!e&&!n)return!0;const f=128*i+64*l,u=128*s+64*a;return this.Eb(f,u,h,t,i,s,l,a,e,n,r,o,c,!1)};vI=(t,i,s,h,e,n,r,o,l,a)=>{if(!e&&!n)return!0;let c=i-l,f=h-l,u=i+l,d=h+l;return a&&(o>640&&o<1408&&(d+=128),o>1152&&o<1920&&(u+=128),(o>1664||o<384)&&(f-=128),o>128&&o<896&&(c-=128)),c=c/128|0,f=f/128|0,u=u/128|0,d=d/128|0,this.Eb(i,h,s,t,c,f,u+1-c,d-f+1,e,n,r,0,o,!0)};SI=(t,i,s,h,e,n,r,o,l,a,c,f)=>!l&&!a||this.Eb(i,h,s,t,e,n,r+1-e,o-n+1,l,a,c,0,f,!0);UA=(t,i,s)=>{const h=this.tb[t][i][s];if(h)for(let t=0;t>29&3)&&e.Cb===i&&e.Tb===s)return void this.Ob(e)}};WI=(t,i,s,h)=>{if(!h)return;const e=this.tb[t][i][s];if(e)for(let t=0;t>29&3))return void(i.model=h)}};zf=()=>{for(let t=0;t{const h=this.tb[t][i][s];return h&&h.pb?h.pb.gb:0};kA=(t,i,s)=>{const h=this.tb[t][s][i];return h&&h.mb?h.mb.gb:0};Md=(t,i,s)=>{const h=this.tb[t][i][s];if(!h)return 0;for(let t=0;t>29&3)&&e.Cb===i&&e.Tb===s)return e.gb}return 0};Ad=(t,i,s)=>{const h=this.tb[t][i][s];return h&&h.ub?h.ub.gb:0};gd=(t,i,s,h)=>{const e=this.tb[t][i][s];if(e){if(e.pb&&e.pb.gb===h)return 255&e.pb.info;if(e.mb&&e.mb.gb===h)return 255&e.mb.info;if(e.ub&&e.ub.gb===h)return 255&e.ub.info;for(let t=0;t{const n=i*(0|Math.sqrt(s*s+h*h+e*e))>>8;for(let i=0;i{if(i0){const e=this.tb[t][i+1][s-1];e&&e.ub&&e.ub.model&&e.ub.model.bb&&this.Lb(h,e.ub.model,128,0,-128,!0)}};vb=(t,i,s,h,e,n)=>{let r=!0,o=i;const l=i+h,a=s-1,c=s+e;for(let f=t;f<=t+1;f++)if(f!==this.JO){for(let u=o;u<=l;u++)if(!(u<0||u>=this.xI))for(let o=a;o<=c;o++){if(o<0||o>=this.DI||r&&u=s||u===i))continue;const a=this.tb[f][u][o];if(!a)continue;const d=128*(u-i)+64*(1-h),w=128*(o-s)+64*(1-e),A=((this.QO[f][u][o]+this.QO[f][u+1][o]+this.QO[f][u][o+1]+this.QO[f][u+1][o+1])/4|0)-((this.QO[t][i][s]+this.QO[t][i+1][s]+this.QO[t][i][s+1]+this.QO[t][i+1][s+1])/4|0),y=a.pb;y&&y.Ib&&y.Ib.bb&&this.Lb(n,y.Ib,d,A,w,r),y&&y._b&&y._b.bb&&this.Lb(n,y._b,d,A,w,r);for(let t=0;t{this.rb++;let r=0;const o=i.Gg,l=i.Bg;if(t.bb&&t.xb)for(let n=0;ni.Db)continue;const u=t.Gg[n]-s;if(ui.Pb)continue;const d=t.Hg[n]-e;if(di.Ub)continue;if(i.bb&&i.xb)for(let t=0;t{const r=this.tb[t][i][s];if(!r)return;const o=r.ab;if(o){const t=o.color;if(0!==t)for(let i=0;i<4;i++)h[e]=t,h[e+1]=t,h[e+2]=t,h[e+3]=t,e+=n;return}const l=r.fb;if(!l)return;const a=l.shape,c=l.angle,f=l.Vb,u=l.Kb,d=I.jO[a],w=I.ZO[c];let A=0;if(0===f)for(let t=0;t<4;t++)0!==d[w[A++]]&&(h[e]=u),0!==d[w[A++]]&&(h[e+1]=u),0!==d[w[A++]]&&(h[e+2]=u),0!==d[w[A++]]&&(h[e+3]=u),e+=n;else for(let t=0;t<4;t++)h[e]=0===d[w[A++]]?f:u,h[e+1]=0===d[w[A++]]?f:u,h[e+2]=0===d[w[A++]]?f:u,h[e+3]=0===d[w[A++]]?f:u,e+=n};click=(t,i)=>{I.NO=!0,I.xl=t,I.Dl=i,I.ff=-1,I.uf=-1};draw=(t,i,s,e,n,r,o)=>{t<0?t=0:t>=128*this.xI&&(t=128*this.xI-1),s<0?s=0:s>=128*this.DI&&(s=128*this.DI-1),I.Vf++,I.EO=h.A.sin[r],I.gO=h.A.cos[r],I.CO=h.A.sin[n],I.TO=h.A.cos[n],I.PO=I.lO[(r-128)/32|0][n/64|0],I.OO=t,I.bO=i,I.vO=s,I.LO=t/128|0,I.RO=s/128|0,I.zu=e,I.SO=I.LO-25,I.SO<0&&(I.SO=0),I.kO=I.RO-25,I.kO<0&&(I.kO=0),I.MO=I.LO+25,I.MO>this.xI&&(I.MO=this.xI),I.xO=I.RO+25,I.xO>this.DI&&(I.xO=this.DI),this.Xb(),I.DO=0;for(let t=this.nb;t=2e3)?(r.visible=!0,r.update=!0,r.zb=r.wb>0,I.DO++):(r.visible=!1,r.update=!1,r.jb=0))}}for(let t=this.nb;t=I.MO))for(let t=-25;t<=0;t++){const e=I.RO+t,n=I.RO-t;let r;if(s>=I.SO&&(e>=I.kO&&(r=i[s][e],r&&r.visible&&this.Zb(r,!0,o)),n=I.kO&&(r=i[h][e],r&&r.visible&&this.Zb(r,!0,o)),n=I.MO))for(let t=-25;t<=0;t++){const e=I.RO+t,n=I.RO-t;let r;if(s>=I.SO&&(e>=I.kO&&(r=i[s][e],r&&r.visible&&this.Zb(r,!1,o)),n=I.kO&&(r=i[h][e],r&&r.visible&&this.Zb(r,!1,o)),n{if(!c&&!f)return!1;for(let t=r;t=this.xI||i>=this.DI)return!1;const s=this.tb[h][t][i];if(s&&s.wb>=5)return!1}const y=new e.A(h,s,t,i,c,f,w,r,r+l-1,o,o+a-1,u,d);for(let t=r;tr&&(s|=1),to&&(s+=8),i=0;s--)this.tb[s][t][i]||(this.tb[s][t][i]=new n.A(s,t,i));const e=this.tb[h][t][i];e&&(e.Ab[e.wb]=y,e.qb[e.wb]=s,e.$b|=s,e.wb++)}return A&&(this.Er[this.eb++]=y),!0};Ob=t=>{for(let i=t.Cb;i<=t.Sb;i++)for(let s=t.Tb;s<=t.Mb;s++){const h=this.tb[t.level][i][s];if(h){for(let i=0;i{const t=I.Xu[I.zu],i=I.fO[I.zu];I.ju=0;for(let s=0;s=0&&h<=50){e=t.kI+25-I.RO,e<0&&(e=0),n=t.DI+25-I.RO,n>50&&(n=50);let i=!1;for(;e<=n;)if(I.PO&&I.PO[h][e++]){i=!0;break}if(i){if(r=I.OO-t.Nb,r>32)t.mode=1;else{if(r>=-32)continue;t.mode=2,r=-r}t.Jb=(t.Fb-I.vO<<8)/r|0,t.Qb=(t.Ub-I.vO<<8)/r|0,t.tv=(t.Db-I.bO<<8)/r|0,t.iv=(t.Zg-I.bO<<8)/r|0,I.dO[I.ju++]=t}}}else if(2===t.type){if(h=t.kI+25-I.RO,h>=0&&h<=50){e=t.MI+25-I.LO,e<0&&(e=0),n=t.xI+25-I.LO,n>50&&(n=50);let i=!1;for(;e<=n;)if(I.PO&&I.PO[e++][h]){i=!0;break}if(i){if(r=I.vO-t.Fb,r>32)t.mode=3;else{if(r>=-32)continue;t.mode=4,r=-r}t.sv=(t.Nb-I.OO<<8)/r|0,t.hv=(t.Pb-I.OO<<8)/r|0,t.tv=(t.Db-I.bO<<8)/r|0,t.iv=(t.Zg-I.bO<<8)/r|0,I.dO[I.ju++]=t}}}else if(4===t.type&&(h=t.Db-I.bO,h>128&&(e=t.kI+25-I.RO,e<0&&(e=0),n=t.DI+25-I.RO,n>50&&(n=50),e<=n))){let i=t.MI+25-I.LO;i<0&&(i=0),r=t.xI+25-I.LO,r>50&&(r=50);let s=!1;t:for(let t=i;t<=r;t++)for(let i=e;i<=n;i++)if(I.PO&&I.PO[t][i]){s=!0;break t}s&&(t.mode=5,t.sv=(t.Nb-I.OO<<8)/h|0,t.hv=(t.Pb-I.OO<<8)/h|0,t.Jb=(t.Fb-I.vO<<8)/h|0,t.Qb=(t.Ub-I.vO<<8)/h|0,I.dO[I.ju++]=t)}}};Zb=(t,i,s)=>{for(I.wO.n_(t);;){let t;do{if(t=I.wO.ev(),!t)return}while(!t.update);const h=t.x,e=t.z,n=t.level,r=t.nv,o=this.tb[n];if(t.visible){if(i){if(n>0){const t=this.tb[n-1][h][e];if(t&&t.update)continue}if(h<=I.LO&&h>I.SO){const i=o[h-1][e];if(i&&i.update&&(i.visible||!(1&t.$b)))continue}if(h>=I.LO&&hI.kO){const i=o[h][e-1];if(i&&i.update&&(i.visible||!(8&t.$b)))continue}if(e>=I.RO&&ee&&(a+=6),c=I.FO[a],t.cv=I.BO[a]),f&&(f.fv&I.UO[a]?16===f.fv?(t.jb=3,t.uv=I.GO[a],t.dv=3-t.uv):32===f.fv?(t.jb=6,t.uv=I.HO[a],t.dv=6-t.uv):64===f.fv?(t.jb=12,t.uv=I.WO[a],t.dv=12-t.uv):(t.jb=9,t.uv=I.YO[a],t.dv=9-t.uv):t.jb=0,f.fv&c&&!this.wv(r,h,e,f.fv)&&f.Ib?.draw(0,I.EO,I.gO,I.CO,I.TO,f.x-I.OO,f.y-I.bO,f.z-I.vO,f.gb),f.Av&c&&!this.wv(r,h,e,f.Av)&&f._b?.draw(0,I.EO,I.gO,I.CO,I.TO,f.x-I.OO,f.y-I.bO,f.z-I.vO,f.gb)),u&&!this.visible(r,h,e,u.model.Zg))if(u.type&c)u.model.draw(u.angle,I.EO,I.gO,I.CO,I.TO,u.x-I.OO,u.y-I.bO,u.z-I.vO,u.gb);else if(768&u.type){const t=u.x-I.OO,i=u.y-I.bO,s=u.z-I.vO,h=u.angle;let e,n;if(e=h===p.A.vd||h===p.A.Ld?-t:t,n=h===p.A.Ld||h===p.A.Rd?-s:s,256&u.type&&ne){const e=t+I.XO[h],n=s+I.zO[h];u.model.draw(512*h+1280&2047,I.EO,I.gO,I.CO,I.TO,e,i,n,u.gb)}}if(l){const i=t.ub;i&&i.model?.draw(0,I.EO,I.gO,I.CO,I.TO,i.x-I.OO,i.y-I.bO,i.z-I.vO,i.gb);const s=t.yb;s&&0===s.offset&&(s.yv&&s.yv.draw(0,I.EO,I.gO,I.CO,I.TO,s.x-I.OO,s.y-I.bO,s.z-I.vO,s.gb),s.pv&&s.pv.draw(0,I.EO,I.gO,I.CO,I.TO,s.x-I.OO,s.y-I.bO,s.z-I.vO,s.gb),s.mv&&s.mv.draw(0,I.EO,I.gO,I.CO,I.TO,s.x-I.OO,s.y-I.bO,s.z-I.vO,s.gb))}const d=t.$b;if(0!==d){if(hI.LO&&1&d){const t=o[h-1][e];t&&t.update&&I.wO.n_(t)}if(e>I.RO&&8&d){const t=o[h][e-1];t&&t.update&&I.wO.n_(t)}}}if(0!==t.jb){let i=!0;for(let s=0;si.Cb&&(n+=1),si.Tb&&(n+=8),hh&&(h=e);const r=I.RO-i.Tb,l=i.Mb-I.RO;i.Iv=l>r?h+l:h+r}for(;;){let t=-50,i=-1;for(let s=0;st&&(t=h.Iv,i=s))}if(-1===i)break;const l=I.cO[i];if(l){l.Vf=I.Vf;let t=l.model;t||(t=l.av?.draw(s)??null),t&&!this._v(r,l.Cb,l.Sb,l.Tb,l.Mb,t.Zg)&&t.draw(l.LI,I.EO,I.gO,I.CO,I.TO,l.x-I.OO,l.y-I.bO,l.z-I.vO,l.gb);for(let t=l.Cb;t<=l.Sb;t++)for(let i=l.Tb;i<=l.Mb;i++){const s=o[t][i];s&&(0!==s.jb?I.wO.n_(s):t===h&&i===e||!s.update||I.wO.n_(s))}}}if(t.zb)continue}if(!t.update||0!==t.jb)continue;if(h<=I.LO&&h>I.SO){const t=o[h-1][e];if(t&&t.update)continue}if(h>=I.LO&&hI.kO){const t=o[h][e-1];if(t&&t.update)continue}if(e>=I.RO&&e=n){const n=t+I.VO[e],r=h+I.KO[e];i.model.draw(512*e+256,I.EO,I.gO,I.CO,I.TO,n,s,r,i.gb)}if(512&i.type&&r<=n){const n=t+I.XO[e],r=h+I.zO[e];i.model.draw(512*e+1280&2047,I.EO,I.gO,I.CO,I.TO,n,s,r,i.gb)}}const s=t.pb;s&&(s.Av&t.cv&&!this.wv(r,h,e,s.Av)&&s._b?.draw(0,I.EO,I.gO,I.CO,I.TO,s.x-I.OO,s.y-I.bO,s.z-I.vO,s.gb),s.fv&t.cv&&!this.wv(r,h,e,s.fv)&&s.Ib?.draw(0,I.EO,I.gO,I.CO,I.TO,s.x-I.OO,s.y-I.bO,s.z-I.vO,s.gb))}if(nI.LO){const t=o[h-1][e];t&&t.update&&I.wO.n_(t)}if(e>I.RO){const t=o[h][e-1];t&&t.update&&I.wO.n_(t)}}};ov=(t,i,s,e,n,r,o,l)=>{let a,c,f,u,d=a=(s<<7)-I.OO,A=c=(e<<7)-I.vO,y=f=d+128,p=u=A+128,m=this.QO[i][s][e]-I.bO,_=this.QO[i][s+1][e]-I.bO,E=this.QO[i][s+1][e+1]-I.bO,g=this.QO[i][s][e+1]-I.bO,C=A*o+d*l>>16;if(A=A*l-d*o>>16,d=C,C=m*r-A*n>>16,A=m*n+A*r>>16,m=C,A<50)return;if(C=c*o+y*l>>16,c=c*l-y*o>>16,y=C,C=_*r-c*n>>16,c=_*n+c*r>>16,_=C,c<50)return;if(C=p*o+f*l>>16,p=p*l-f*o>>16,f=C,C=E*r-p*n>>16,p=E*n+p*r>>16,E=C,p<50)return;if(C=u*o+a*l>>16,u=u*l-a*o>>16,a=C,C=g*r-u*n>>16,u=g*n+u*r>>16,g=C,u<50)return;const T=h.A.na+((d<<9)/A|0),O=h.A.ra+((m<<9)/A|0),b=h.A.na+((y<<9)/c|0),v=h.A.ra+((_<<9)/c|0),L=h.A.na+((f<<9)/p|0),R=h.A.ra+((E<<9)/p|0),S=h.A.na+((a<<9)/u|0),M=h.A.ra+((g<<9)/u|0);if(h.A.alpha=0,(L-S)*(v-M)-(R-M)*(b-S)>0)if(h.A.Ev=L<0||S<0||b<0||L>w.A.gv||S>w.A.gv||b>w.A.gv,I.NO&&this.Cv(I.xl,I.Dl,R,M,v,L,S,b)&&(I.ff=s,I.uf=e),-1===t.Tv)12345678!==t.Ov&&h.A.bv(L,S,b,R,M,v,t.Ov,t.vv,t.Lv);else if(I.st){const i=I.qO[t.Tv];h.A.bv(L,S,b,R,M,v,this.Rv(i,t.Ov),this.Rv(i,t.vv),this.Rv(i,t.Lv))}else t.flat?h.A.Sv(L,S,b,R,M,v,t.Ov,t.vv,t.Lv,d,m,A,y,a,_,g,c,u,t.Tv):h.A.Sv(L,S,b,R,M,v,t.Ov,t.vv,t.Lv,f,E,p,a,y,g,_,u,c,t.Tv);if(!((T-b)*(M-v)-(O-v)*(S-b)<=0))if(h.A.Ev=T<0||b<0||S<0||T>w.A.gv||b>w.A.gv||S>w.A.gv,I.NO&&this.Cv(I.xl,I.Dl,O,v,M,T,b,S)&&(I.ff=s,I.uf=e),-1!==t.Tv){if(!I.st)return void h.A.Sv(T,b,S,O,v,M,t.Mv,t.Lv,t.vv,d,m,A,y,a,_,g,c,u,t.Tv);const i=I.qO[t.Tv];h.A.bv(T,b,S,O,v,M,this.Rv(i,t.Mv),this.Rv(i,t.Lv),this.Rv(i,t.vv))}else 12345678!==t.Mv&&h.A.bv(T,b,S,O,v,M,t.Mv,t.Lv,t.vv)};lv=(t,i,s,e,n,r,o)=>{let l=s.Gg.length;for(let t=0;t>16;if(a=a*o-i*r>>16,i=c,c=l*n-a*e>>16,a=l*e+a*n>>16,l=c,a<50)return;s.kv&&(A.A.xv[t]=i,A.A.Dv[t]=l,A.A.Nv[t]=a),A.A.Pv[t]=h.A.na+((i<<9)/a|0),A.A.Fv[t]=h.A.ra+((l<<9)/a|0)}h.A.alpha=0,l=s.Uv.length;for(let e=0;e0)if(h.A.Ev=l<0||a<0||c<0||l>w.A.gv||a>w.A.gv||c>w.A.gv,I.NO&&this.Cv(I.xl,I.Dl,f,u,d,l,a,c)&&(I.ff=t,I.uf=i),s.kv&&-1!==s.kv[e])if(I.st){const t=I.qO[s.kv[e]];h.A.bv(l,a,c,f,u,d,this.Rv(t,s.Hv[e]),this.Rv(t,s.Wv[e]),this.Rv(t,s.Yv[e]))}else s.flat?h.A.Sv(l,a,c,f,u,d,s.Hv[e],s.Wv[e],s.Yv[e],A.A.xv[0],A.A.Dv[0],A.A.Nv[0],A.A.xv[1],A.A.xv[3],A.A.Dv[1],A.A.Dv[3],A.A.Nv[1],A.A.Nv[3],s.kv[e]):h.A.Sv(l,a,c,f,u,d,s.Hv[e],s.Wv[e],s.Yv[e],A.A.xv[n],A.A.Dv[n],A.A.Nv[n],A.A.xv[r],A.A.xv[o],A.A.Dv[r],A.A.Dv[o],A.A.Nv[r],A.A.Nv[o],s.kv[e]);else 12345678!==s.Hv[e]&&h.A.bv(l,a,c,f,u,d,s.Hv[e],s.Wv[e],s.Yv[e])}};rv=(t,i,s)=>{const h=this.ib[t][i][s];if(h===-I.Vf)return!1;if(h===I.Vf)return!0;{const h=i<<7,e=s<<7;return this.Vv(h+1,this.QO[t][i][s],e+1)&&this.Vv(h+128-1,this.QO[t][i+1][s],e+1)&&this.Vv(h+128-1,this.QO[t][i+1][s+1],e+128-1)&&this.Vv(h+1,this.QO[t][i][s+1],e+128-1)?(this.ib[t][i][s]=I.Vf,!0):(this.ib[t][i][s]=-I.Vf,!1)}};wv=(t,i,s,h)=>{if(!this.rv(t,i,s))return!1;const e=i<<7,n=s<<7,r=this.QO[t][i][s]-1,o=r-120,l=r-230,a=r-238;if(h<16){if(1===h){if(e>I.OO){if(!this.Vv(e,r,n))return!1;if(!this.Vv(e,r,n+128))return!1}if(t>0){if(!this.Vv(e,o,n))return!1;if(!this.Vv(e,o,n+128))return!1}return!!this.Vv(e,l,n)&&this.Vv(e,l,n+128)}if(2===h){if(n0){if(!this.Vv(e,o,n+128))return!1;if(!this.Vv(e+128,o,n+128))return!1}return!!this.Vv(e,l,n+128)&&this.Vv(e+128,l,n+128)}if(4===h){if(e0){if(!this.Vv(e+128,o,n))return!1;if(!this.Vv(e+128,o,n+128))return!1}return!!this.Vv(e+128,l,n)&&this.Vv(e+128,l,n+128)}if(8===h){if(n>I.vO){if(!this.Vv(e,r,n))return!1;if(!this.Vv(e+128,r,n))return!1}if(t>0){if(!this.Vv(e,o,n))return!1;if(!this.Vv(e+128,o,n))return!1}return!!this.Vv(e,l,n)&&this.Vv(e+128,l,n)}}return!!this.Vv(e+64,a,n+64)&&(16===h?this.Vv(e,l,n+128):32===h?this.Vv(e+128,l,n+128):64===h?this.Vv(e+128,l,n):128===h?this.Vv(e,l,n):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,i,s,h)=>{if(this.rv(t,i,s)){const e=i<<7,n=s<<7;return this.Vv(e+1,this.QO[t][i][s]-h,n+1)&&this.Vv(e+128-1,this.QO[t][i+1][s]-h,n+1)&&this.Vv(e+128-1,this.QO[t][i+1][s+1]-h,n+128-1)&&this.Vv(e+1,this.QO[t][i][s+1]-h,n+128-1)}return!1};_v=(t,i,s,h,e,n)=>{let r,o;if(i!==s||h!==e){for(r=i;r<=s;r++)for(o=h;o<=e;o++)if(this.ib[t][r][o]===-I.Vf)return!1;o=1+(i<<7);const l=2+(h<<7),a=this.QO[t][i][h]-n;if(!this.Vv(o,a,l))return!1;const c=(s<<7)-1;if(!this.Vv(c,a,l))return!1;const f=(e<<7)-1;return!!this.Vv(o,a,f)&&this.Vv(c,a,f)}return!!this.rv(t,i,h)&&(r=i<<7,o=h<<7,this.Vv(r+1,this.QO[t][i][h]-n,o+1)&&this.Vv(r+128-1,this.QO[t][i+1][h]-n,o+1)&&this.Vv(r+128-1,this.QO[t][i+1][h+1]-n,o+128-1)&&this.Vv(r+1,this.QO[t][i][h+1]-n,o+128-1))};Vv=(t,i,s)=>{for(let h=0;h0){const t=e.Fb+(e.Jb*h>>8),n=e.Ub+(e.Qb*h>>8),r=e.Db+(e.tv*h>>8),o=e.Zg+(e.iv*h>>8);if(s>=t&&s<=n&&i>=r&&i<=o)return!0}}else if(2===e.mode){const h=t-e.Nb;if(h>0){const t=e.Fb+(e.Jb*h>>8),n=e.Ub+(e.Qb*h>>8),r=e.Db+(e.tv*h>>8),o=e.Zg+(e.iv*h>>8);if(s>=t&&s<=n&&i>=r&&i<=o)return!0}}else if(3===e.mode){const h=e.Fb-s;if(h>0){const s=e.Nb+(e.sv*h>>8),n=e.Pb+(e.hv*h>>8),r=e.Db+(e.tv*h>>8),o=e.Zg+(e.iv*h>>8);if(t>=s&&t<=n&&i>=r&&i<=o)return!0}}else if(4===e.mode){const h=s-e.Fb;if(h>0){const s=e.Nb+(e.sv*h>>8),n=e.Pb+(e.hv*h>>8),r=e.Db+(e.tv*h>>8),o=e.Zg+(e.iv*h>>8);if(t>=s&&t<=n&&i>=r&&i<=o)return!0}}else if(5===e.mode){const h=i-e.Db;if(h>0){const i=e.Nb+(e.sv*h>>8),n=e.Pb+(e.hv*h>>8),r=e.Fb+(e.Jb*h>>8),o=e.Ub+(e.Qb*h>>8);if(t>=i&&t<=n&&s>=r&&s<=o)return!0}}}return!1};Cv=(t,i,s,h,e,n,r,o)=>{if(is&&i>h&&i>e)return!1;if(tn&&t>r&&t>o)return!1;const l=(i-h)*(o-r)-(t-r)*(e-h);return((i-s)*(r-n)-(t-n)*(h-s))*l>0&&l*((i-e)*(n-o)-(t-o)*(s-e))>0};Rv=(t,i)=>((i=(127-i)*(127&t)/160|0)<2?i=2:i>126&&(i=126),(65408&t)+i)}},7121:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{}},4197:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{Vp;HI;Wp;Yp;index;GI;ul;fl;constructor(t,i,s,h,e,n,r){super(),this.Vp=i,this.HI=s,this.Wp=h,this.Yp=e,this.index=t,this.GI=n,r&&-1!==n.wl&&this.GI.delay?(this.ul=Math.random()*this.GI.dl|0,this.fl=Math.random()*this.GI.delay[this.ul]|0):(this.ul=-1,this.fl=0)}}},8412:(t,i,s)=>{s.d(i,{A:()=>o});var h=s(9418),e=s(8665),n=s(8738),r=s(1312);class o extends h.A{static Tu=2;static bu=4;static Lu=8;static Ru=16;static Fu=32;static Du=64;static Su=128;type=null;draw(t){if(!this.type)return null;if(-1===this.Nu||-1===this.$m)return this.Jg();const i=this.Jg();if(!i)return null;const s=n.A.Ro[this.Nu],h=e.A.qE(s.la(),!0,!s.Og,!1);h.translate(-this.Zm,0,0),h.Ma(),s.GI&&s.GI.frames&&h.ka(s.GI.frames[this.$m]),h.Kg=null,h.Xg=null,128===s.qg&&128===s.$g||h.scale(s.qg,s.$g,s.qg),h.xa(64+s.vg,850+s.Lg,-30,-50,-30,!0);const r=[i,h],o=e.A.Kv(r,2);return 1===this.type.size&&(o.sC=!0),o}isVisible(){return null!==this.type}Jg(){if(!this.type)return null;if(this.Ou>=0&&0===this.Xm){const t=r.A.Ro[this.Ou].frames;if(t){const i=t[this.Vm];let s=-1;if(this.CI>=0&&this.CI!==this.Sa){const t=r.A.Ro[this.CI].frames;t&&(s=t[this.QI])}return this.type.Jg(i,s,r.A.Ro[this.Ou].s_)}}let t=-1;if(this.CI>=0){const i=r.A.Ro[this.CI].frames;i&&(t=i[this.QI])}const i=this.type.Jg(t,-1,null);return i?(this.height=i.Zg,i):null}}},3606:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{index;count;constructor(t,i){super(),this.index=t,this.count=i}}},9418:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(7121),e=s(1312),n=s(3867);class r extends h.A{x=0;z=0;LI=0;RI=!1;size=1;Sa=-1;$I=-1;oI=-1;aI=-1;fI=-1;dI=-1;e_=-1;ou=null;uu=100;cu=0;fu=0;pu=0;yu=0;du=-1e3;wu=0;Au=0;vu=-1;zm=0;jm=0;CI=-1;QI=0;JI=0;Ou=-1;Vm=0;Km=0;Xm=0;Ym=0;Nu=-1;$m=0;Jm=0;qm=0;Zm=0;Qm=0;iI=0;tI=0;sI=0;mu=0;Iu=0;hI=0;Vf=0;height=0;qI=0;pathLength=0;wf=new Int32Array(10);Af=new Int32Array(10);h_=new n.ds(10,!1);ZI=0;Eu=-1;gu=-1;Mu=-1;ku=-1;move(t,i,s){if(-1!==this.Ou&&e.A.Ro[this.Ou].priority<=1&&(this.Ou=-1),!t){const t=i-this.wf[0],h=s-this.Af[0];if(t>=-8&&t<=8&&h>=-8&&h<=8){this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.wf[t]=this.wf[t-1],this.Af[t]=this.Af[t-1],this.h_[t]=this.h_[t-1];return this.wf[0]=i,this.Af[0]=s,void(this.h_[0]=!1)}}this.pathLength=0,this.ZI=0,this.wf[0]=i,this.Af[0]=s,this.x=128*this.wf[0]+64*this.size,this.z=128*this.Af[0]+64*this.size}step(t,i){let s=this.wf[0],h=this.Af[0];0===i?(s--,h++):1===i?h++:2===i?(s++,h++):3===i?s--:4===i?s++:5===i?(s--,h--):6===i?h--:7===i&&(s++,h--),-1!==this.Ou&&e.A.Ro[this.Ou].priority<=1&&(this.Ou=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.wf[t]=this.wf[t-1],this.Af[t]=this.Af[t-1],this.h_[t]=this.h_[t-1];this.wf[0]=s,this.Af[0]=h,this.h_[0]=t}}},8268:(t,i,s)=>{s.d(i,{A:()=>d});var h=s(9418),e=s(8665),n=s(2679),r=s(8738),o=s(1312),l=s(8317),a=s(1302),c=s(3819),f=s(3867),u=s(9298);class d extends h.A{static Cu=1;static Tu=2;static bu=4;static Lu=8;static Ru=16;static Su=32;static xu=64;static Hm=128;static Du=256;static Pu=512;static Ra=[u.A.Xv,u.A.zv,u.A.jv,u.A.Zv,u.A.qv,u.A.$v,u.A.Jv,u.A.Qv,u.A.tL,u.A.iL,u.A.sL,u.A.hL,u.A.eL,u.A.nL,u.A.rL,u.A.oL];static La=[[u.A.lL,u.A.aL,u.A.cL,u.A.fL,u.A.uL,u.A.dL,u.A.wL,u.A.AL,u.A.yL,u.A.pL,u.A.mL,u.A.IL],[u.A._L,u.A.EL,u.A.gL,u.A.CL,u.A.TL,u.A.OL,u.A.bL,u.A.vL,u.A.LL,u.A.RL,u.A.SL,u.A.ML,u.A.kL,u.A.xL,u.A.DL,u.A.NL],[u.A.NL-1,u.A._L+1,u.A.EL,u.A.gL,u.A.CL,u.A.TL,u.A.OL,u.A.bL,u.A.vL,u.A.LL,u.A.RL,u.A.SL,u.A.ML,u.A.kL,u.A.xL,u.A.DL],[u.A.PL,u.A.FL,u.A.UL,u.A.BL,u.A.GL,u.A.HL],[u.A.WL,u.A.YL,u.A.VL,u.A.KL,u.A.XL,u.A.zL,u.A.jL,u.A.ZL]];static So=new n.A(200);name=null;visible=!1;qL=0;ru=0;$L=new Uint16Array(12);JL=new Uint16Array(5);Ka=0;QL=0n;y=0;OI=0;bI=0;r_=0;l_=0;o_=0;TI=null;MI=0;kI=0;xI=0;DI=0;st=!1;draw(t){if(!this.visible)return null;let i=this.Jg();if(this.height=i.Zg,i.sC=!0,this.st)return i;if(-1!==this.Nu&&-1!==this.$m){const t=r.A.Ro[this.Nu],s=e.A.qE(t.la(),!0,!t.Og,!1);s.translate(-this.Zm,0,0),s.Ma(),t.GI&&t.GI.frames&&s.ka(t.GI.frames[this.$m]),s.Kg=null,s.Xg=null,128===t.qg&&128===t.$g||s.scale(t.qg,t.$g,t.qg),s.xa(t.vg+64,t.Lg+850,-30,-50,-30,!0);const h=[i,s];i=e.A.Kv(h,2)}if(this.TI&&(t>=this.bI&&(this.TI=null),t>=this.OI&&t=d.La[i].length)&&(s=0),this.JL[i]=s}this.Sa=t.KA,65535===this.Sa&&(this.Sa=-1),this.$I=t.KA,65535===this.$I&&(this.$I=-1),this.oI=t.KA,65535===this.oI&&(this.oI=-1),this.aI=t.KA,65535===this.aI&&(this.aI=-1),this.fI=t.KA,65535===this.fI&&(this.fI=-1),this.dI=t.KA,65535===this.dI&&(this.dI=-1),this.e_=t.KA,65535===this.e_&&(this.e_=-1),this.name=c.A.ga(c.A.Ca(t.Uc)),this.Ka=t.ZA,this.visible=!0,this.QL=0n;for(let t=0;t<12;t++)this.QL<<=0x4n,this.$L[t]>=256&&(this.QL+=BigInt(this.$L[t])-256n);this.$L[0]>=256&&(this.QL+=BigInt(this.$L[0])-256n>>4n),this.$L[1]>=256&&(this.QL+=BigInt(this.$L[1])-256n>>8n);for(let t=0;t<5;t++)this.QL<<=0x3n,this.QL+=BigInt(this.JL[t]);this.QL<<=0x1n,this.QL+=BigInt(this.qL)}ey(){if(!this.visible)return null;const t=new f.ds(12,null);let i=0;for(let s=0;s<12;s++){const h=this.$L[s];if(h>=256&&h<512&&(t[i++]=l.A.Ro[h-256].ey()),h>=512){const s=a.A.get(h-512).ey(this.qL);s&&(t[i++]=s)}}const s=e.A.ba(t,i);for(let t=0;t<5;t++)0!==this.JL[t]&&(s.va(d.La[t][0],d.La[t][this.JL[t]]),1===t&&s.va(d.Ra[0],d.Ra[this.JL[t]]));return s}Jg(){let t=this.QL,i=-1,s=-1,h=-1,n=-1;if(this.Ou>=0&&0===this.Xm){const e=o.A.Ro[this.Ou];if(e.frames&&(i=e.frames[this.Vm]),this.CI>=0&&this.CI!==this.Sa){const t=o.A.Ro[this.CI].frames;t&&(s=t[this.QI])}e.MC>=0&&(h=e.MC,t+=BigInt(h-this.$L[5])<<8n),e.kC>=0&&(n=e.kC,t+=BigInt(n-this.$L[3])<<16n)}else if(this.CI>=0){const t=o.A.Ro[this.CI].frames;t&&(i=t[this.QI])}let r=d.So?.get(t);if(!r){const i=new f.ds(12,null);let s=0;for(let t=0;t<12;t++){let e=this.$L[t];if(n>=0&&3===t&&(e=n),h>=0&&5===t&&(e=h),e>=256&&e<512){const t=l.A.Ro[e-256].la();t&&(i[s++]=t)}if(e>=512){const t=a.A.get(e-512).SC(this.qL);t&&(i[s++]=t)}}r=e.A.ba(i,s);for(let t=0;t<5;t++)0!==this.JL[t]&&(r.va(d.La[t][0],d.La[t][this.JL[t]]),1===t&&r.va(d.Ra[0],d.Ra[this.JL[t]]));r.Ma(),r.xa(64,850,-30,-50,-30,!0),d.So?.put(t,r)}if(this.st)return r;const c=e.A.Qg(r,!0);return-1!==i&&-1!==s?c.tC(i,s,o.A.Ro[this.Ou].s_):-1!==i&&c.ka(i),c.iC(),c.Kg=null,c.Xg=null,c}}},254:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(8738),e=s(7121),n=s(8665);class r extends e.A{tR;level;iR;sR;hR;offsetY;FI;NI;eR;arc;target;mobile=!1;x=0;z=0;y=0;velocityX=0;nR=0;rR=0;velocityY=0;oR=0;LI=0;pitch=0;ul=0;fl=0;constructor(t,i,s,e,n,r,o,l,a,c,f){super(),this.tR=h.A.Ro[t],this.level=i,this.iR=s,this.sR=n,this.hR=e,this.FI=r,this.NI=o,this.eR=l,this.arc=a,this.target=c,this.offsetY=f}UI(t,i,s,h){if(!this.mobile){const i=t-this.iR,h=s-this.sR,e=Math.sqrt(i*i+h*h);this.x=this.iR+i*this.arc/e,this.z=this.sR+h*this.arc/e,this.y=this.hR}const e=this.NI+1-h;this.velocityX=(t-this.x)/e,this.nR=(s-this.z)/e,this.rR=Math.sqrt(this.velocityX*this.velocityX+this.nR*this.nR),this.mobile||(this.velocityY=-this.rR*Math.tan(.02454369*this.eR)),this.oR=2*(i-this.y-this.velocityY*e)/(e*e)}update(t){if(this.mobile=!0,this.x+=this.velocityX*t,this.z+=this.nR*t,this.y+=this.velocityY*t+.5*this.oR*t*t,this.velocityY+=this.oR*t,this.LI=325.949*Math.atan2(this.velocityX,this.nR)+1024&2047,this.pitch=325.949*Math.atan2(this.velocityY,this.rR)&2047,this.tR.GI&&this.tR.GI.delay)for(this.fl+=t;this.fl>this.tR.GI.delay[this.ul];)this.fl-=this.tR.GI.delay[this.ul]+1,this.ul++,this.ul>=this.tR.GI.dl&&(this.ul=0)}draw(){const t=this.tR.la(),i=n.A.qE(t,!0,!this.tR.Og,!1);return this.tR.GI&&this.tR.GI.frames&&(i.Ma(),i.ka(this.tR.GI.frames[this.ul]),i.Kg=null,i.Xg=null),128===this.tR.qg&&128===this.tR.$g||i.scale(this.tR.qg,this.tR.$g,this.tR.qg),i.lR(this.pitch),i.xa(64+this.tR.vg,850+this.tR.Lg,-30,-50,-30,!0),i}}},7628:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(7121),e=s(8738),n=s(8665);class r extends h.A{type;level;x;z;y;FI;BI=!1;ul=0;fl=0;constructor(t,i,s,h,n,r,o){super(),this.type=e.A.Ro[t],this.level=i,this.x=s,this.z=h,this.y=n,this.FI=r+o}update(t){if(this.type.GI&&this.type.GI.delay)for(this.fl+=t;this.fl>this.type.GI.delay[this.ul];)this.fl-=this.type.GI.delay[this.ul]+1,this.ul++,this.ul>=this.type.GI.dl&&(this.ul=0,this.BI=!0)}draw(){const t=this.type.la(),i=n.A.qE(t,!0,!this.type.Og,!1);return!this.BI&&this.type.GI&&this.type.GI.frames&&(i.Ma(),i.ka(this.type.GI.frames[this.ul]),i.Kg=null,i.Xg=null),128===this.type.qg&&128===this.type.$g||i.scale(this.type.qg,this.type.$g,this.type.qg),0!==this.type.orientation&&(90===this.type.orientation?i.zg():180===this.type.orientation?(i.zg(),i.zg()):270===this.type.orientation&&(i.zg(),i.zg(),i.zg())),i.xa(64+this.type.vg,850+this.type.Lg,-30,-50,-30,!0),i}}},9222:(t,i,s)=>{s.d(i,{A:()=>h});class h{y;x;z;model;gb;info;constructor(t,i,s,h,e,n){this.y=t,this.x=i,this.z=s,this.model=h,this.gb=e,this.info=n}}},1161:(t,i,s)=>{s.d(i,{A:()=>h});class h{level;y;x;z;model;av;LI;Cb;Sb;Tb;Mb;gb;info;Iv=0;Vf=0;constructor(t,i,s,h,e,n,r,o,l,a,c,f,u){this.level=t,this.y=i,this.x=s,this.z=h,this.model=e,this.av=n,this.LI=r,this.Cb=o,this.Sb=l,this.Tb=a,this.Mb=c,this.gb=f,this.info=u}}},5327:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{hp;Nd;x;z;Kp;angle;shape;NI;constructor(t,i,s,h,e,n,r,o){super(),this.hp=t,this.Nd=i,this.x=s,this.z=h,this.Kp=e,this.angle=n,this.shape=r,this.NI=o}}},2630:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{hp;Nd;x;z;Kp;angle;shape;ep;np;rp;constructor(t,i,s,h,e,n,r,o,l,a){super(),this.hp=t,this.Nd=i,this.x=s,this.z=h,this.Kp=e,this.angle=n,this.shape=r,this.ep=o,this.np=l,this.rp=a}}},5748:(t,i,s)=>{s.d(i,{A:()=>h});class h{y;x;z;mv;pv;yv;gb;offset;constructor(t,i,s,h,e,n,r,o){this.y=t,this.x=i,this.z=s,this.mv=h,this.pv=e,this.yv=n,this.gb=r,this.offset=o}}},8256:(t,i,s)=>{s.d(i,{A:()=>h});class h{MI;xI;kI;DI;type;Nb;Pb;Fb;Ub;Db;Zg;mode=0;sv=0;hv=0;Jb=0;Qb=0;tv=0;iv=0;constructor(t,i,s,h,e,n,r,o,l,a,c){this.MI=t,this.xI=i,this.kI=s,this.DI=h,this.type=e,this.Nb=n,this.Pb=r,this.Fb=o,this.Ub=l,this.Db=a,this.Zg=c}}},3795:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(1982),e=s(3867);class n extends h.A{level;x;z;nv;Ab;qb;ab=null;fb=null;pb=null;mb=null;ub=null;yb=null;ob=null;wb=0;$b=0;lb=0;visible=!1;update=!1;zb=!1;jb=0;uv=0;dv=0;cv=0;constructor(t,i,s){super(),this.nv=this.level=t,this.x=i,this.z=s,this.Ab=new e.ds(5,null),this.qb=new Int32Array(5)}}},2771:(t,i,s)=>{s.d(i,{A:()=>h});class h{static Pv=new Int32Array(6);static Fv=new Int32Array(6);static xv=new Int32Array(6);static Dv=new Int32Array(6);static Nv=new Int32Array(6);static aR=[Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,2,6),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,13,14)];static cR=[Int8Array.of(0,1,2,3,0,0,1,3),Int8Array.of(1,1,2,3,1,0,1,3),Int8Array.of(0,1,2,3,1,0,1,3),Int8Array.of(0,0,1,2,0,0,2,4,1,0,4,3),Int8Array.of(0,0,1,4,0,0,4,3,1,1,2,4),Int8Array.of(0,0,4,3,1,0,1,2,1,0,2,4),Int8Array.of(0,1,2,4,1,0,1,4,1,0,4,3),Int8Array.of(0,4,1,2,0,4,2,5,1,0,4,5,1,0,5,3),Int8Array.of(0,4,1,2,0,4,2,3,0,4,3,5,1,0,4,5),Int8Array.of(0,0,4,5,1,4,1,2,1,4,2,3,1,4,3,5),Int8Array.of(0,0,1,5,0,1,4,5,0,1,2,4,1,0,5,3,1,5,4,3,1,4,2,3),Int8Array.of(1,0,1,5,1,1,4,5,1,1,2,4,0,0,5,3,0,5,4,3,0,4,2,3),Int8Array.of(1,0,5,4,1,0,1,5,0,0,4,3,0,4,5,3,0,5,2,3,0,1,2,5)];static fR=128;static uR=this.fR/2|0;static dR=this.fR/4|0;static wR=3*this.fR/4|0;Gg;Wg;Hg;Hv;Wv;Yv;Uv;Bv;Gv;kv;flat;shape;angle;Vb;Kb;constructor(t,i,s,e,n,r,o,l,a,c,f,u,d,w,A,y,p,m,I){this.flat=!(p!==e||p!==w||p!==l),this.shape=i,this.angle=r,this.Vb=d,this.Kb=a;const _=h.aR[i],E=_.length;this.Gg=new Int32Array(E),this.Wg=new Int32Array(E),this.Hg=new Int32Array(E);const g=new Int32Array(E),C=new Int32Array(E),T=t*h.fR,O=m*h.fR;for(let t=0;t8&&E<=12&&(E=9+(E-r-9&3)),E>12&&E<=16&&(E=13+(E-r-13&3)),1===E?(i=T,a=O,f=p,d=o,m=c):2===E?(i=T+h.uR,a=O,f=p+e>>1,d=o+I>>1,m=c+s>>1):3===E?(i=T+h.fR,a=O,f=e,d=I,m=s):4===E?(i=T+h.fR,a=O+h.uR,f=e+w>>1,d=I+n>>1,m=s+A>>1):5===E?(i=T+h.fR,a=O+h.fR,f=w,d=n,m=A):6===E?(i=T+h.uR,a=O+h.fR,f=w+l>>1,d=n+y>>1,m=A+u>>1):7===E?(i=T,a=O+h.fR,f=l,d=y,m=u):8===E?(i=T,a=O+h.uR,f=l+p>>1,d=y+o>>1,m=u+c>>1):9===E?(i=T+h.uR,a=O+h.dR,f=p+e>>1,d=o+I>>1,m=c+s>>1):10===E?(i=T+h.wR,a=O+h.uR,f=e+w>>1,d=I+n>>1,m=s+A>>1):11===E?(i=T+h.uR,a=O+h.wR,f=w+l>>1,d=n+y>>1,m=A+u>>1):12===E?(i=T+h.dR,a=O+h.uR,f=l+p>>1,d=y+o>>1,m=u+c>>1):13===E?(i=T+h.dR,a=O+h.dR,f=p,d=o,m=c):14===E?(i=T+h.wR,a=O+h.dR,f=e,d=I,m=s):15===E?(i=T+h.wR,a=O+h.wR,f=w,d=n,m=A):(i=T+h.dR,a=O+h.wR,f=l,d=y,m=u),this.Gg[t]=i,this.Wg[t]=f,this.Hg[t]=a,g[t]=d,C[t]=m}const b=h.cR[i],v=b.length/4|0;this.Uv=new Int32Array(v),this.Bv=new Int32Array(v),this.Gv=new Int32Array(v),this.Hv=new Int32Array(v),this.Wv=new Int32Array(v),this.Yv=new Int32Array(v),this.kv=-1!==f?new Int32Array(v):null;let L=0;for(let t=0;t{s.d(i,{A:()=>h});class h{static JT=0;static cb=1;static AR=2;static yR=3;static pR=4;static mR=5;static uR=6;static dR=7;static wR=8;static IR=9;static _R=10;static ER=11}},3479:(t,i,s)=>{s.d(i,{A:()=>h});class h{Mv;Lv;Ov;vv;Tv;color;flat;constructor(t,i,s,h,e,n,r){this.Mv=t,this.Lv=i,this.Ov=s,this.vv=h,this.Tv=e,this.color=n,this.flat=r}}},6855:(t,i,s)=>{s.d(i,{A:()=>h});class h{y;x;z;fv;Av;Ib;_b;gb;info;constructor(t,i,s,h,e,n,r,o,l){this.y=t,this.x=i,this.z=s,this.fv=h,this.Av=e,this.Ib=n,this._b=r,this.gb=o,this.info=l}}},7441:(t,i,s)=>{s.d(i,{A:()=>h});class h{y;x;z;type;angle;model;gb;info;constructor(t,i,s,h,e,n,r,o){this.y=t,this.x=i,this.z=s,this.type=h,this.angle=e,this.model=n,this.gb=r,this.info=o}}},7536:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e{gR;CR;constructor(t){this.CR=[],this.gR=t;for(let i=0;i{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{TR;OR;constructor(){super(),this.TR=this,this.OR=this}bR(){this.OR&&this.TR&&(this.OR.TR=this.TR,this.TR.OR=this.OR,this.TR=null,this.OR=null)}}},3819:(t,i,s)=>{s.d(i,{A:()=>h});class h{static vR=['_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9'];static ld=t=>{t=t.trim();let i=0n;for(let s=0;s=65&&h<=90?i+=BigInt(h+1-65):h>=97&&h<=122?i+=BigInt(h+1-97):h>=48&&h<=57&&(i+=BigInt(h+27-48))}return i};static Ca=t=>{if(t<0n||t>=6582952005840035281n)return'invalid_name';if(t%37n===0n)return'invalid_name';let i=0;const s=Array(12);for(;0n!==t;){const h=t;t/=37n,s[11-i++]=this.vR[Number(h-37n*t)]}return s.slice(12-i).join('')};static dA=t=>{const i=[...t.toLowerCase()];let s=!0;for(let t=0;t='a'&&h<='z'&&(i[t]=h.toUpperCase(),s=!1),'.'!==h&&'!'!==h||(s=!0)}return i.join('')};static Dc=t=>{let i='';for(let s=0;s(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static ga=t=>{if(0===t.length)return t;const i=[...t];for(let t=0;t='a'&&i[t+1]<='z'&&(i[t+1]=String.fromCharCode(i[t+1].charCodeAt(0)+'A'.charCodeAt(0)-97)));return i[0]>='a'&&i[0]<='z'&&(i[0]=String.fromCharCode(i[0].charCodeAt(0)+'A'.charCodeAt(0)-97)),i.join('')};static jE=t=>{const i=t.toUpperCase();let s=0n;for(let t=0;t>56n)&0xffffffffffffffn;return s}}},6666:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e{LR;cursor=null;constructor(){const t=new h.A;t.next=t,t.Im=t,this.LR=t}n_(t){t.Im&&t.sy(),t.Im=this.LR.Im,t.next=this.LR,t.Im&&(t.Im.next=t),t.next.Im=t}bA(t){t.Im&&t.sy(),t.Im=this.LR,t.next=this.LR.next,t.Im.next=t,t.next&&(t.next.Im=t)}ev(){const t=this.LR.next;return t===this.LR?null:(t?.sy(),t)}head(){const t=this.LR.next;return t===this.LR?(this.cursor=null,null):(this.cursor=t?.next||null,t)}pm(){const t=this.LR.Im;return t===this.LR?(this.cursor=null,null):(this.cursor=t?.Im||null,t)}next(){const t=this.cursor;return t===this.LR?(this.cursor=null,null):(this.cursor=t?.next||null,t)}Im(){const t=this.cursor;return t===this.LR?(this.cursor=null,null):(this.cursor=t?.Im||null,t)}clear(){for(;;){const t=this.LR.next;if(t===this.LR)return;t?.sy()}}}},1982:(t,i,s)=>{s.d(i,{A:()=>h});class h{key;next;Im;constructor(){this.key=0n,this.next=this,this.Im=this}sy(){this.Im&&this.next&&(this.Im.next=this.next,this.next.Im=this.Im,this.next=null,this.Im=null)}}},2679:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(2512),e=s(7536);class n{RR;SR;history;available;constructor(t){this.RR=t,this.available=t,this.SR=new e.A(1024),this.history=new h.A}get(t){const i=this.SR.get(t);return i&&this.history.push(i),i}put(t,i){if(0===this.available){const t=this.history.pop();t?.sy(),t?.bR()}else this.available--;this.SR.put(t,i),this.history.push(i)}clear(){const t=this.history.pop();t?(t.sy(),t.bR()):this.available=this.RR}}},2512:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(4474);class e{head;constructor(){this.head=new h.A}push(t){t.OR&&t.bR(),t.OR=this.head.OR,t.TR=this.head,t.OR&&(t.OR.TR=t),t.TR.OR=t}pop(){const t=this.head.TR;return t===this.head?null:(t?.bR(),t)}}},8534:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(1069),e=s(3867);class n{static Ro=[];static ec=t=>{const i=new h.A(t.read('base_head.dat')),s=new h.A(t.read('base_type.dat')),r=new h.A(t.read('base_label.dat')),o=i.KA;i.Fc+=2;for(let t=0;t{s.d(i,{A:()=>n});var h=s(8534),e=s(1069);class n{static Ro=[];static ec=t=>{const i=new e.A(t.read('frame_head.dat')),s=new e.A(t.read('frame_tran1.dat')),r=new e.A(t.read('frame_tran2.dat')),o=new e.A(t.read('frame_del.dat')),l=i.KA;i.Fc+=2;const a=new Int32Array(500),c=new Int32Array(500),f=new Int32Array(500),u=new Int32Array(500);for(let t=0;t0){if(0!==d.types[t])for(let i=t-1;i>A;i--)if(0===d.types[i]){a[y]=i,c[y]=0,f[y]=0,u[y]=0,y++;break}a[y]=t;let s=0;3===d.types[a[y]]&&(s=128),c[y]=1&i?r.kR:s,f[y]=2&i?r.kR:s,u[y]=4&i?r.kR:s,A=t,y++}}e.length=y,e.xR=new Int32Array(y),e.x=new Int32Array(y),e.y=new Int32Array(y),e.z=new Int32Array(y);for(let t=0;t{s.d(i,{N_:()=>h,jo:()=>e,DR:()=>o,NR:()=>r,PR:()=>n});const h=document.getElementById('canvas'),e=h.getContext('2d',{willReadFrequently:!0}),n=document.createElement('canvas'),r=document.createElement('img'),o=n.getContext('2d',{willReadFrequently:!0})},9298:(t,i,s)=>{s.d(i,{A:()=>h});class h{static RED=16711680;static GREEN=65280;static BLUE=255;static Gl=16776960;static bc=65535;static vc=16711935;static _l=16777215;static Bl=0;static FR=16748608;static sd=8388608;static td=128;static UR=16756736;static BR=16740352;static GR=16723968;static HR=12648192;static WR=8453888;static YR=4259584;static yc=9179409;static Dd=6116423;static il=2301979;static sl=5063219;static el=7759444;static rl=3353893;static hd=8388736;static ed=13350793;static Uu=Int32Array.of(h.Gl,h.RED,h.GREEN,h.bc,h.vc,h._l);static lL=6798;static aL=107;static cL=10283;static fL=16;static uL=4797;static dL=7744;static wL=5799;static AL=4634;static yL=33697;static pL=22433;static mL=2983;static IL=54193;static _L=8741;static EL=12;static gL=64030;static CL=43162;static TL=7735;static OL=8404;static bL=1701;static vL=38430;static LL=24094;static RL=10153;static SL=56621;static ML=4783;static kL=1341;static xL=16578;static DL=35003;static NL=25239;static Xv=9104;static zv=10275;static jv=7595;static Zv=3610;static qv=7975;static $v=8526;static Jv=918;static Qv=38802;static tL=24466;static iL=10145;static sL=58654;static hL=5027;static eL=1457;static nL=16565;static rL=34991;static oL=25486;static PL=4626;static FL=11146;static UL=6439;static BL=12;static GL=4758;static HL=10270;static ZL=4574;static WL=4550;static YL=4537;static VL=5681;static KL=5673;static XL=5790;static zL=6806;static jL=8076}},8950:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(4474);class e extends h.A{static nc=new Int32Array;static lC=0;static aC=0;static top=0;static bottom=0;static left=0;static right=0;static gv=0;static VR=0;static KR=0;static bind=(t,i,s)=>{this.nc=t,this.lC=i,this.aC=s,this.yl(0,0,i,s)};static Gu=()=>{this.left=0,this.top=0,this.right=this.lC,this.bottom=this.aC,this.gv=this.right-1,this.VR=this.right/2|0};static yl=(t,i,s,h)=>{t<0&&(t=0),i<0&&(i=0),s>this.lC&&(s=this.lC),h>this.aC&&(h=this.aC),this.top=i,this.bottom=h,this.left=t,this.right=s,this.gv=this.right-1,this.VR=this.right/2|0,this.KR=this.bottom/2|0};static clear=()=>{const t=this.lC*this.aC;for(let i=0;i{this.nl(t,i,e,s),this.nl(t,i+h-1,e,s),this.hl(t,i,e,h),this.hl(t+s-1,i,e,h)};static nl=(t,i,s,h)=>{if(i=this.bottom)return;tthis.right&&(h=this.right-t);const e=t+i*this.lC;for(let t=0;t{if(t=this.right)return;ithis.bottom&&(h=this.bottom-i);const e=t+i*this.lC;for(let t=0;t{const n=Math.abs(s-t),r=Math.abs(h-i),o=t=this.left&&t=this.top&&i-r&&(a-=r,t+=o),s{tthis.right&&(s=this.right-t),i+h>this.bottom&&(h=this.bottom-i);const n=this.lC-s;let r=t+i*this.lC;for(let t=-h;t<0;t++){for(let t=-s;t<0;t++)this.nc[r++]=e;r+=n}};static XR(t,i,s,h,e,n){tthis.right&&(s=this.right-t),i+h>this.bottom&&(h=this.bottom-i);const r=256-n,o=(e>>16&255)*n,l=(e>>8&255)*n,a=(255&e)*n,c=this.lC-s;let f=t+i*this.lC;for(let t=0;t>16&255)*r>>8<<16)+(l+(this.nc[f]>>8&255)*r>>8<<8)+(a+(255&this.nc[f])*r>>8);this.nc[f++]=t}f+=c}}static zR(t,i,s,h,e){const n=256-e,r=(h>>16&255)*e,o=(h>>8&255)*e,l=(255&h)*e;let a=i-s;a<0&&(a=0);let c=i+s;c>=this.aC&&(c=this.aC-1);for(let h=a;h<=c;h++){const e=h-i,a=0|Math.sqrt(s*s-e*e);let c=t-a;c<0&&(c=0);let f=t+a;f>=this.lC&&(f=this.lC-1);let u=c+h*this.lC;for(let t=c;t<=f;t++){const t=(r+(this.nc[u]>>16&255)*n>>8<<16)+(o+(this.nc[u]>>8&255)*n>>8<<8)+(l+(255&this.nc[u])*n>>8);this.nc[u++]=t}}}static jR=(t,i,s)=>{t=this.right||i=this.bottom||(this.nc[t+i*this.lC]=s)}}},4583:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(8950),e=s(1673),n=s(3867);class r extends h.A{static st=!1;static ZR=new Int32Array(512);static qR=new Int32Array(2048);static sin=new Int32Array(2048);static cos=new Int32Array(2048);static palette=new Int32Array(65536);static c_=new n.ds(50,null);static $R=0;static oc=new Int32Array;static na=0;static ra=0;static cC=!0;static Ev=!1;static alpha=0;static JR=null;static QR=new n.ds(50,null);static tS=0;static Vf=0;static a_=new Int32Array(50);static iS=new n.ds(50,null);static sS=!1;static hS=new n.ds(50,!1);static eS=new Int32Array(50);static{for(let t=1;t<512;t++)this.ZR[t]=32768/t|0;for(let t=1;t<2048;t++)this.qR[t]=65536/t|0;for(let t=0;t<2048;t++)this.sin[t]=65536*Math.sin(.0030679615757712823*t)|0,this.cos[t]=65536*Math.cos(.0030679615757712823*t)|0}static bo=()=>{this.ZR=null,this.ZR=null,this.sin=null,this.cos=null,this.oc=null,this.c_=null,this.hS=null,this.eS=null,this.JR=null,this.QR=null,this.a_=null,this.palette=null,this.iS=null,console.log('Draw3D unloaded!')};static P_=()=>{this.oc=new Int32Array(this.aC);for(let t=0;t{this.oc=new Int32Array(i);for(let s=0;s{this.JR=null,this.QR.fill(null)};static ic=t=>{this.$R=0;for(let i=0;i<50;i++)try{this.c_[i]=e.A.za(t,i.toString()),this.st&&128===this.c_[i]?.Pl?this.c_[i]?.nS():this.c_[i]?.AC(),this.$R++}catch(t){}};static tO=t=>{if(0!==this.eS[t])return this.eS[t];const i=this.iS[t];if(!i)return 0;let s=0,h=0,e=0;const n=i.length;for(let t=0;t>16&255,h+=i[t]>>8&255,e+=255&i[t];let r=(s/n<<16)+(h/n<<8)+(e/n|0);return r=this.rS(r,1.4),0===r&&(r=1),this.eS[t]=r,r};static sc=t=>{const i=t+.03*Math.random()-.015;let s=0;for(let t=0;t<512;t++){const h=(t/8|0)/64+.0078125,e=(7&t)/8+.0625;for(let t=0;t<128;t++){const n=t/128;let r=n,o=n,l=n;if(0!==e){let t;t=n<.5?n*(e+1):n+e-n*e;const i=2*n-t;let s=h+.3333333333333333;s>1&&s--;let a=h-.3333333333333333;a<0&&a++,r=6*s<1?i+6*(t-i)*s:2*s<1?t:3*s<2?i+(t-i)*(.6666666666666666-s)*6:i,o=6*h<1?i+6*(t-i)*h:2*h<1?t:3*h<2?i+(t-i)*(.6666666666666666-h)*6:i,l=6*a<1?i+6*(t-i)*a:2*a<1?t:3*a<2?i+(t-i)*(.6666666666666666-a)*6:i}const a=((256*r|0)<<16)+((256*o|0)<<8)+(256*l|0);this.palette[s++]=this.rS(a,i)}}for(let t=0;t<50;t++){const s=this.c_[t];if(!s)continue;const h=s.palette;this.iS[t]=new Int32Array(h.length);for(let s=0;s{const s=(t>>16)/256,h=(t>>8&255)/256,e=(255&t)/256;return((256*Math.pow(s,i)|0)<<16)+((256*Math.pow(h,i)|0)<<8)+(256*Math.pow(e,i)|0)};static hc=t=>{this.JR||(this.tS=t,this.st?this.JR=new n.Kn(t,16384):this.JR=new n.Kn(t,65536),this.QR.fill(null))};static bv=(t,i,s,h,e,n,r,o,l)=>{let a=0,c=0;e!==h&&(a=(i-t<<16)/(e-h)|0,c=(o-r<<15)/(e-h)|0);let f=0,u=0;n!==e&&(f=(s-i<<16)/(n-e)|0,u=(l-o<<15)/(n-e)|0);let d=0,w=0;if(n!==h&&(d=(t-s<<16)/(h-n)|0,w=(r-l<<15)/(h-n)|0),h<=e&&h<=n){if(hthis.bottom&&(e=this.bottom),n>this.bottom&&(n=this.bottom),ef)for(n-=e,e-=h,h=this.oc[h];;){if(--e<0)for(;;){if(--n<0)return;this.oS(s>>16,i>>16,l>>7,o>>7,this.nc,h,0),s+=d,i+=f,l+=w,o+=u,h+=this.lC}this.oS(s>>16,t>>16,l>>7,r>>7,this.nc,h,0),s+=d,t+=a,l+=w,r+=c,h+=this.lC}else for(n-=e,e-=h,h=this.oc[h];;){if(--e<0)for(;;){if(--n<0)return;this.oS(i>>16,s>>16,o>>7,l>>7,this.nc,h,0),s+=d,i+=f,l+=w,o+=u,h+=this.lC}this.oS(t>>16,s>>16,r>>7,l>>7,this.nc,h,0),s+=d,t+=a,l+=w,r+=c,h+=this.lC}else if(i=t<<=16,o=r<<=15,h<0&&(i-=d*h,t-=a*h,o-=w*h,r-=c*h,h=0),s<<=16,l<<=15,n<0&&(s-=f*n,l-=u*n,n=0),h!==n&&da)for(e-=n,n-=h,h=this.oc[h];;){if(--n<0)for(;;){if(--e<0)return;this.oS(s>>16,t>>16,l>>7,r>>7,this.nc,h,0),s+=f,t+=a,l+=u,r+=c,h+=this.lC}this.oS(i>>16,t>>16,o>>7,r>>7,this.nc,h,0),i+=d,t+=a,o+=w,r+=c,h+=this.lC}else for(e-=n,n-=h,h=this.oc[h];;){if(--n<0)for(;;){if(--e<0)return;this.oS(t>>16,s>>16,r>>7,l>>7,this.nc,h,0),s+=f,t+=a,l+=u,r+=c,h+=this.lC}this.oS(t>>16,i>>16,r>>7,o>>7,this.nc,h,0),i+=d,t+=a,o+=w,r+=c,h+=this.lC}}else if(e<=n){if(ethis.bottom&&(n=this.bottom),h>this.bottom&&(h=this.bottom),nd)for(h-=n,n-=e,e=this.oc[e];;){if(--n<0)for(;;){if(--h<0)return;this.oS(t>>16,s>>16,r>>7,l>>7,this.nc,e,0),t+=a,s+=d,r+=c,l+=w,e+=this.lC}this.oS(t>>16,i>>16,r>>7,o>>7,this.nc,e,0),t+=a,i+=f,r+=c,o+=u,e+=this.lC}else for(h-=n,n-=e,e=this.oc[e];;){if(--n<0)for(;;){if(--h<0)return;this.oS(s>>16,t>>16,l>>7,r>>7,this.nc,e,0),t+=a,s+=d,r+=c,l+=w,e+=this.lC}this.oS(i>>16,t>>16,o>>7,r>>7,this.nc,e,0),t+=a,i+=f,r+=c,o+=u,e+=this.lC}else if(s=i<<=16,l=o<<=15,e<0&&(s-=a*e,i-=f*e,l-=c*e,o-=u*e,e=0),t<<=16,r<<=15,h<0&&(t-=d*h,r-=w*h,h=0),n-=h,h-=e,e=this.oc[e],a>16,i>>16,r>>7,o>>7,this.nc,e,0),t+=d,i+=f,r+=w,o+=u,e+=this.lC}this.oS(s>>16,i>>16,l>>7,o>>7,this.nc,e,0),s+=a,i+=f,l+=c,o+=u,e+=this.lC}else for(;;){if(--h<0)for(;;){if(--n<0)return;this.oS(i>>16,t>>16,o>>7,r>>7,this.nc,e,0),t+=d,i+=f,r+=w,o+=u,e+=this.lC}this.oS(i>>16,s>>16,o>>7,l>>7,this.nc,e,0),s+=a,i+=f,l+=c,o+=u,e+=this.lC}}else if(nthis.bottom&&(h=this.bottom),e>this.bottom&&(e=this.bottom),h>16,t>>16,o>>7,r>>7,this.nc,n,0),i+=f,t+=a,o+=u,r+=c,n+=this.lC}this.oS(i>>16,s>>16,o>>7,l>>7,this.nc,n,0),i+=f,s+=d,o+=u,l+=w,n+=this.lC}else for(;;){if(--h<0)for(;;){if(--e<0)return;this.oS(t>>16,i>>16,r>>7,o>>7,this.nc,n,0),i+=f,t+=a,o+=u,r+=c,n+=this.lC}this.oS(s>>16,i>>16,l>>7,o>>7,this.nc,n,0),i+=f,s+=d,o+=u,l+=w,n+=this.lC}else if(t=s<<=16,r=l<<=15,n<0&&(t-=f*n,s-=d*n,r-=u*n,l-=w*n,n=0),i<<=16,o<<=15,e<0&&(i-=a*e,o-=c*e,e=0),h-=e,e-=n,n=this.oc[n],f>16,s>>16,o>>7,l>>7,this.nc,n,0),i+=a,s+=d,o+=c,l+=w,n+=this.lC}this.oS(t>>16,s>>16,r>>7,l>>7,this.nc,n,0),t+=f,s+=d,r+=u,l+=w,n+=this.lC}else for(;;){if(--e<0)for(;;){if(--h<0)return;this.oS(s>>16,i>>16,l>>7,o>>7,this.nc,n,0),i+=a,s+=d,o+=c,l+=w,n+=this.lC}this.oS(s>>16,t>>16,l>>7,r>>7,this.nc,n,0),t+=f,s+=d,r+=u,l+=w,n+=this.lC}};static oS=(t,i,s,h,e,n,r)=>{let o;if(this.cC){let l;if(this.Ev){if(l=i-t>3?(h-s)/(i-t)|0:0,i>this.gv&&(i=this.gv),t<0&&(s-=t*l,t=0),t>=i)return;n+=t,r=i-t>>2,l<<=2}else{if(!(t>2)>0?(h-s)*this.ZR[r]>>15:0}if(0===this.alpha)for(;;){if(--r<0){if((r=i-t&3)>0){o=this.palette[s>>8];do{e[n++]=o,r--}while(r>0);return}break}o=this.palette[s>>8],s+=l,e[n++]=o,e[n++]=o,e[n++]=o,e[n++]=o}else{const h=this.alpha,a=256-this.alpha;for(;;){if(--r<0){if((r=i-t&3)>0){o=this.palette[s>>8],o=((16711935&o)*a>>8&16711935)+((65280&o)*a>>8&65280);do{e[n++]=o+((16711935&e[n])*h>>8&16711935)+((65280&e[n])*h>>8&65280),r--}while(r>0)}break}o=this.palette[s>>8],s+=l,o=((16711935&o)*a>>8&16711935)+((65280&o)*a>>8&65280),e[n++]=o+((16711935&e[n])*h>>8&16711935)+((65280&e[n])*h>>8&65280),e[n++]=o+((16711935&e[n])*h>>8&16711935)+((65280&e[n])*h>>8&65280),e[n++]=o+((16711935&e[n])*h>>8&16711935)+((65280&e[n])*h>>8&65280),e[n++]=o+((16711935&e[n])*h>>8&16711935)+((65280&e[n])*h>>8&65280)}}}else if(tthis.gv&&(i=this.gv),t<0&&(s-=t*l,t=0),t>=i))return;if(n+=t,r=i-t,0===this.alpha)do{e[n++]=this.palette[s>>8],s+=l,r--}while(r>0);else{const t=this.alpha,i=256-this.alpha;do{o=this.palette[s>>8],s+=l,o=((16711935&o)*i>>8&16711935)+((65280&o)*i>>8&65280),e[n++]=o+((16711935&e[n])*t>>8&16711935)+((65280&e[n])*t>>8&65280),r--}while(r>0)}}};static lS=(t,i,s,h,e,n,r)=>{let o=0;e!==h&&(o=(i-t<<16)/(e-h)|0);let l=0;n!==e&&(l=(s-i<<16)/(n-e)|0);let a=0;if(n!==h&&(a=(t-s<<16)/(h-n)|0),h<=e&&h<=n){if(hthis.bottom&&(e=this.bottom),n>this.bottom&&(n=this.bottom),el)for(n-=e,e-=h,h=this.oc[h];;){if(--e<0)for(;;){if(--n<0)return;this.aS(s>>16,i>>16,this.nc,h,r),s+=a,i+=l,h+=this.lC}this.aS(s>>16,t>>16,this.nc,h,r),s+=a,t+=o,h+=this.lC}else for(n-=e,e-=h,h=this.oc[h];;){if(--e<0)for(;;){if(--n<0)return;this.aS(i>>16,s>>16,this.nc,h,r),s+=a,i+=l,h+=this.lC}this.aS(t>>16,s>>16,this.nc,h,r),s+=a,t+=o,h+=this.lC}else if(i=t<<=16,h<0&&(i-=a*h,t-=o*h,h=0),s<<=16,n<0&&(s-=l*n,n=0),h!==n&&ao)for(e-=n,n-=h,h=this.oc[h];;){if(--n<0)for(;;){if(--e<0)return;this.aS(s>>16,t>>16,this.nc,h,r),s+=l,t+=o,h+=this.lC}this.aS(i>>16,t>>16,this.nc,h,r),i+=a,t+=o,h+=this.lC}else for(e-=n,n-=h,h=this.oc[h];;){if(--n<0)for(;;){if(--e<0)return;this.aS(t>>16,s>>16,this.nc,h,r),s+=l,t+=o,h+=this.lC}this.aS(t>>16,i>>16,this.nc,h,r),i+=a,t+=o,h+=this.lC}}else if(e<=n){if(ethis.bottom&&(n=this.bottom),h>this.bottom&&(h=this.bottom),na)for(h-=n,n-=e,e=this.oc[e];;){if(--n<0)for(;;){if(--h<0)return;this.aS(t>>16,s>>16,this.nc,e,r),t+=o,s+=a,e+=this.lC}this.aS(t>>16,i>>16,this.nc,e,r),t+=o,i+=l,e+=this.lC}else for(h-=n,n-=e,e=this.oc[e];;){if(--n<0)for(;;){if(--h<0)return;this.aS(s>>16,t>>16,this.nc,e,r),t+=o,s+=a,e+=this.lC}this.aS(i>>16,t>>16,this.nc,e,r),t+=o,i+=l,e+=this.lC}else if(s=i<<=16,e<0&&(s-=o*e,i-=l*e,e=0),t<<=16,h<0&&(t-=a*h,h=0),o>16,i>>16,this.nc,e,r),t+=a,i+=l,e+=this.lC}this.aS(s>>16,i>>16,this.nc,e,r),s+=o,i+=l,e+=this.lC}else for(n-=h,h-=e,e=this.oc[e];;){if(--h<0)for(;;){if(--n<0)return;this.aS(i>>16,t>>16,this.nc,e,r),t+=a,i+=l,e+=this.lC}this.aS(i>>16,s>>16,this.nc,e,r),s+=o,i+=l,e+=this.lC}}else if(nthis.bottom&&(h=this.bottom),e>this.bottom&&(e=this.bottom),h>16,t>>16,this.nc,n,r),i+=l,t+=o,n+=this.lC}this.aS(i>>16,s>>16,this.nc,n,r),i+=l,s+=a,n+=this.lC}else for(e-=h,h-=n,n=this.oc[n];;){if(--h<0)for(;;){if(--e<0)return;this.aS(t>>16,i>>16,this.nc,n,r),i+=l,t+=o,n+=this.lC}this.aS(s>>16,i>>16,this.nc,n,r),i+=l,s+=a,n+=this.lC}else if(t=s<<=16,n<0&&(t-=l*n,s-=a*n,n=0),i<<=16,e<0&&(i-=o*e,e=0),l>16,s>>16,this.nc,n,r),i+=o,s+=a,n+=this.lC}this.aS(t>>16,s>>16,this.nc,n,r),t+=l,s+=a,n+=this.lC}else for(h-=e,e-=n,n=this.oc[n];;){if(--e<0)for(;;){if(--h<0)return;this.aS(s>>16,i>>16,this.nc,n,r),i+=o,s+=a,n+=this.lC}this.aS(s>>16,t>>16,this.nc,n,r),t+=l,s+=a,n+=this.lC}};static Sv=(t,i,s,h,e,n,r,o,l,a,c,f,u,d,w,A,y,p,m)=>{const I=this.cS(m);this.sS=!this.hS[m];const _=a-u,E=c-w,g=f-y,C=d-a,T=A-c,O=p-f;let b=C*c-T*a<<14;const v=T*f-O*c<<8,L=O*a-C*f<<5;let R=_*c-E*a<<14;const S=E*f-g*c<<8,M=g*a-_*f<<5;let k=E*C-_*T<<14;const x=g*T-E*O<<8,D=_*O-g*C<<5;let N=0,P=0;e!==h&&(N=(i-t<<16)/(e-h)|0,P=(o-r<<16)/(e-h)|0);let F=0,U=0;n!==e&&(F=(s-i<<16)/(n-e)|0,U=(l-o<<16)/(n-e)|0);let B=0,G=0;if(n!==h&&(B=(t-s<<16)/(h-n)|0,G=(r-l<<16)/(h-n)|0),h<=e&&h<=n){if(hthis.bottom&&(e=this.bottom),n>this.bottom&&(n=this.bottom),eF)for(n-=e,e-=h,h=this.oc[h];;){if(--e<0)for(;;){if(--n<0)return;this.fS(s>>16,i>>16,this.nc,h,I,0,0,b,R,k,v,S,x,l>>8,o>>8),s+=B,i+=F,l+=G,o+=U,h+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(s>>16,t>>16,this.nc,h,I,0,0,b,R,k,v,S,x,l>>8,r>>8),s+=B,t+=N,l+=G,r+=P,h+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}else for(n-=e,e-=h,h=this.oc[h];;){if(--e<0)for(;;){if(--n<0)return;this.fS(i>>16,s>>16,this.nc,h,I,0,0,b,R,k,v,S,x,o>>8,l>>8),s+=B,i+=F,l+=G,o+=U,h+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(t>>16,s>>16,this.nc,h,I,0,0,b,R,k,v,S,x,r>>8,l>>8),s+=B,t+=N,l+=G,r+=P,h+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}}else{i=t<<=16,o=r<<=16,h<0&&(i-=B*h,t-=N*h,o-=G*h,r-=P*h,h=0),s<<=16,l<<=16,n<0&&(s-=F*n,l-=U*n,n=0);const a=h-this.ra;if(b+=L*a,R+=M*a,k+=D*a,b|=0,R|=0,k|=0,(h===n||B>=N)&&(h!==n||F<=N))for(e-=n,n-=h,h=this.oc[h];;){if(--n<0)for(;;){if(--e<0)return;this.fS(t>>16,s>>16,this.nc,h,I,0,0,b,R,k,v,S,x,r>>8,l>>8),s+=F,t+=N,l+=U,r+=P,h+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(t>>16,i>>16,this.nc,h,I,0,0,b,R,k,v,S,x,r>>8,o>>8),i+=B,t+=N,o+=G,r+=P,h+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}else for(e-=n,n-=h,h=this.oc[h];;){if(--n<0)for(;;){if(--e<0)return;this.fS(s>>16,t>>16,this.nc,h,I,0,0,b,R,k,v,S,x,l>>8,r>>8),s+=F,t+=N,l+=U,r+=P,h+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(i>>16,t>>16,this.nc,h,I,0,0,b,R,k,v,S,x,o>>8,r>>8),i+=B,t+=N,o+=G,r+=P,h+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}}}else if(e<=n){if(ethis.bottom&&(n=this.bottom),h>this.bottom&&(h=this.bottom),nB)for(h-=n,n-=e,e=this.oc[e];;){if(--n<0)for(;;){if(--h<0)return;this.fS(t>>16,s>>16,this.nc,e,I,0,0,b,R,k,v,S,x,r>>8,l>>8),t+=N,s+=B,r+=P,l+=G,e+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(t>>16,i>>16,this.nc,e,I,0,0,b,R,k,v,S,x,r>>8,o>>8),t+=N,i+=F,r+=P,o+=U,e+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}else for(h-=n,n-=e,e=this.oc[e];;){if(--n<0)for(;;){if(--h<0)return;this.fS(s>>16,t>>16,this.nc,e,I,0,0,b,R,k,v,S,x,l>>8,r>>8),t+=N,s+=B,r+=P,l+=G,e+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(i>>16,t>>16,this.nc,e,I,0,0,b,R,k,v,S,x,o>>8,r>>8),t+=N,i+=F,r+=P,o+=U,e+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}}else{s=i<<=16,l=o<<=16,e<0&&(s-=N*e,i-=F*e,l-=P*e,o-=U*e,e=0),t<<=16,r<<=16,h<0&&(t-=B*h,r-=G*h,h=0);const a=e-this.ra;if(b+=L*a,R+=M*a,k+=D*a,b|=0,R|=0,k|=0,n-=h,h-=e,e=this.oc[e],N>16,i>>16,this.nc,e,I,0,0,b,R,k,v,S,x,r>>8,o>>8),t+=B,i+=F,r+=G,o+=U,e+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(s>>16,i>>16,this.nc,e,I,0,0,b,R,k,v,S,x,l>>8,o>>8),s+=N,i+=F,l+=P,o+=U,e+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}else for(;;){if(--h<0)for(;;){if(--n<0)return;this.fS(i>>16,t>>16,this.nc,e,I,0,0,b,R,k,v,S,x,o>>8,r>>8),t+=B,i+=F,r+=G,o+=U,e+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(i>>16,s>>16,this.nc,e,I,0,0,b,R,k,v,S,x,o>>8,l>>8),s+=N,i+=F,l+=P,o+=U,e+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}}}else if(nthis.bottom&&(h=this.bottom),e>this.bottom&&(e=this.bottom),h>16,t>>16,this.nc,n,I,0,0,b,R,k,v,S,x,o>>8,r>>8),i+=F,t+=N,o+=U,r+=P,n+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(i>>16,s>>16,this.nc,n,I,0,0,b,R,k,v,S,x,o>>8,l>>8),i+=F,s+=B,o+=U,l+=G,n+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}else for(;;){if(--h<0)for(;;){if(--e<0)return;this.fS(t>>16,i>>16,this.nc,n,I,0,0,b,R,k,v,S,x,r>>8,o>>8),i+=F,t+=N,o+=U,r+=P,n+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(s>>16,i>>16,this.nc,n,I,0,0,b,R,k,v,S,x,l>>8,o>>8),i+=F,s+=B,o+=U,l+=G,n+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}}else{t=s<<=16,r=l<<=16,n<0&&(t-=F*n,s-=B*n,r-=U*n,l-=G*n,n=0),i<<=16,o<<=16,e<0&&(i-=N*e,o-=P*e,e=0);const a=n-this.ra;if(b+=L*a,R+=M*a,k+=D*a,b|=0,R|=0,k|=0,h-=e,e-=n,n=this.oc[n],F>16,s>>16,this.nc,n,I,0,0,b,R,k,v,S,x,o>>8,l>>8),i+=N,s+=B,o+=P,l+=G,n+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(t>>16,s>>16,this.nc,n,I,0,0,b,R,k,v,S,x,r>>8,l>>8),t+=F,s+=B,r+=U,l+=G,n+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}else for(;;){if(--e<0)for(;;){if(--h<0)return;this.fS(s>>16,i>>16,this.nc,n,I,0,0,b,R,k,v,S,x,l>>8,o>>8),i+=N,s+=B,o+=P,l+=G,n+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}this.fS(s>>16,t>>16,this.nc,n,I,0,0,b,R,k,v,S,x,l>>8,r>>8),t+=F,s+=B,r+=U,l+=G,n+=this.lC,b+=L,R+=M,k+=D,b|=0,R|=0,k|=0}}};static fS=(t,i,s,h,e,n,r,o,l,a,c,f,u,d,w)=>{if(t>=i)return;let A,y,p,m,I,_,E,g,C;if(this.Ev){if(A=(w-d)/(i-t)|0,i>this.gv&&(i=this.gv),t<0&&(d-=t*A,t=0),t>=i)return;y=i-t>>3,A<<=12}else i-t>7?(y=i-t>>3,A=(w-d)*this.ZR[y]>>6):(y=0,A=0);if(d<<=9,h+=t,this.st&&e)if(p=0,m=0,_=t-this.na,o+=(c>>3)*_,l+=(f>>3)*_,a+=(u>>3)*_,o|=0,l|=0,I=(a|=0)>>12,0!==I&&(r=l/I|0,(n=o/I|0)<0?n=0:n>4032&&(n=4032)),o+=c,l+=f,a+=u,o|=0,l|=0,I=(a|=0)>>12,0!==I&&(p=o/I|0,m=l/I|0,p<7?p=7:p>4032&&(p=4032)),E=p-n>>3,g=m-r>>3,n+=d>>3&786432,C=d>>23,this.sS){for(;y-- >0;)s[h++]=e[(4032&r)+(n>>6)]>>>C,n+=E,r+=g,s[h++]=e[(4032&r)+(n>>6)]>>>C,n+=E,r+=g,s[h++]=e[(4032&r)+(n>>6)]>>>C,n+=E,r+=g,s[h++]=e[(4032&r)+(n>>6)]>>>C,n+=E,r+=g,s[h++]=e[(4032&r)+(n>>6)]>>>C,n+=E,r+=g,s[h++]=e[(4032&r)+(n>>6)]>>>C,n+=E,r+=g,s[h++]=e[(4032&r)+(n>>6)]>>>C,n+=E,r+=g,s[h++]=e[(4032&r)+(n>>6)]>>>C,n=p,r=m,o+=c,l+=f,I=(a+=u)>>12,0!==I&&(p=o/I|0,m=l/I|0,p<7?p=7:p>4032&&(p=4032)),E=p-n>>3,g=m-r>>3,n+=(d+=A)>>3&786432,C=d>>23;for(y=i-t&7;y-- >0;)s[h++]=e[(4032&r)+(n>>6)]>>>C,n+=E,r+=g}else{for(;y-- >0;){let t;0!=(t=e[(4032&r)+(n>>6)]>>>C)&&(s[h]=t),h+=1,0!=(t=e[(4032&(r+=g))+((n+=E)>>6)]>>>C)&&(s[h]=t),h++,0!=(t=e[(4032&(r+=g))+((n+=E)>>6)]>>>C)&&(s[h]=t),h++,0!=(t=e[(4032&(r+=g))+((n+=E)>>6)]>>>C)&&(s[h]=t),h++,0!=(t=e[(4032&(r+=g))+((n+=E)>>6)]>>>C)&&(s[h]=t),h++,0!=(t=e[(4032&(r+=g))+((n+=E)>>6)]>>>C)&&(s[h]=t),h++,0!=(t=e[(4032&(r+=g))+((n+=E)>>6)]>>>C)&&(s[h]=t),h++,0!=(t=e[(4032&(r+=g))+((n+=E)>>6)]>>>C)&&(s[h]=t),h+=1,n=p,r=m,o+=c,l+=f,a+=u,o|=0,l|=0,I=(a|=0)>>12,0!==I&&(p=o/I|0,m=l/I|0,p<7?p=7:p>4032&&(p=4032)),E=p-n>>3,g=m-r>>3,n+=(d+=A)>>3&786432,C=d>>23}for(y=i-t&7;y-- >0;){let t;0!=(t=e[(4032&r)+(n>>6)]>>>C)&&(s[h]=t),h++,n+=E,r+=g}}else if(p=0,m=0,_=t-this.na,o+=(c>>3)*_,l+=(f>>3)*_,a+=(u>>3)*_,o|=0,l|=0,I=(a|=0)>>14,0!==I&&(r=l/I|0,(n=o/I|0)<0?n=0:n>16256&&(n=16256)),o+=c,l+=f,a+=u,o|=0,l|=0,I=(a|=0)>>14,0!==I&&(p=o/I|0,m=l/I|0,p<7?p=7:p>16256&&(p=16256)),E=p-n>>3,g=m-r>>3,n+=6291456&d,C=d>>23,this.sS&&e){for(;y-- >0;)s[h++]=e[(16256&r)+(n>>7)]>>>C,n+=E,r+=g,s[h++]=e[(16256&r)+(n>>7)]>>>C,n+=E,r+=g,s[h++]=e[(16256&r)+(n>>7)]>>>C,n+=E,r+=g,s[h++]=e[(16256&r)+(n>>7)]>>>C,n+=E,r+=g,s[h++]=e[(16256&r)+(n>>7)]>>>C,n+=E,r+=g,s[h++]=e[(16256&r)+(n>>7)]>>>C,n+=E,r+=g,s[h++]=e[(16256&r)+(n>>7)]>>>C,n+=E,r+=g,s[h++]=e[(16256&r)+(n>>7)]>>>C,n=p,r=m,o+=c,l+=f,a+=u,o|=0,l|=0,I=(a|=0)>>14,0!==I&&(p=o/I|0,m=l/I|0,p<7?p=7:p>16256&&(p=16256)),E=p-n>>3,g=m-r>>3,n+=6291456&(d+=A),C=d>>23;for(y=i-t&7;y-- >0;)s[h++]=e[(16256&r)+(n>>7)]>>>C,n+=E,r+=g}else{for(;y-- >0&&e;){let t;0!=(t=e[(16256&r)+(n>>7)]>>>C)&&(s[h]=t),h+=1,0!=(t=e[(16256&(r+=g))+((n+=E)>>7)]>>>C)&&(s[h]=t),h++,0!=(t=e[(16256&(r+=g))+((n+=E)>>7)]>>>C)&&(s[h]=t),h++,0!=(t=e[(16256&(r+=g))+((n+=E)>>7)]>>>C)&&(s[h]=t),h++,0!=(t=e[(16256&(r+=g))+((n+=E)>>7)]>>>C)&&(s[h]=t),h++,0!=(t=e[(16256&(r+=g))+((n+=E)>>7)]>>>C)&&(s[h]=t),h++,0!=(t=e[(16256&(r+=g))+((n+=E)>>7)]>>>C)&&(s[h]=t),h++,0!=(t=e[(16256&(r+=g))+((n+=E)>>7)]>>>C)&&(s[h]=t),h++,n=p,r=m,o+=c,l+=f,a+=u,o|=0,l|=0,I=(a|=0)>>14,0!==I&&(p=o/I|0,m=l/I|0,p<7?p=7:p>16256&&(p=16256)),E=p-n>>3,g=m-r>>3,n+=6291456&(d+=A),C=d>>23}for(y=i-t&7;y-- >0&&e;){let t;0!=(t=e[(16256&r)+(n>>7)]>>>C)&&(s[h]=t),h++,n+=E,r+=g}}};static aS=(t,i,s,h,e)=>{if(this.Ev&&(i>this.gv&&(i=this.gv),t<0&&(t=0)),t>=i)return;h+=t;let n=i-t>>2;if(0===this.alpha)for(;;){if(n--,n<0)for(n=i-t&3;;){if(n--,n<0)return;s[h++]=e}s[h++]=e,s[h++]=e,s[h++]=e,s[h++]=e}const r=this.alpha,o=256-this.alpha;for(e=((16711935&e)*o>>8&16711935)+((65280&e)*o>>8&65280);;){if(n--,n<0)for(n=i-t&3;;){if(n--,n<0)return;s[h++]=e+((16711935&s[h])*r>>8&16711935)+((65280&s[h])*r>>8&65280)}s[h++]=e+((16711935&s[h])*r>>8&16711935)+((65280&s[h])*r>>8&65280),s[h++]=e+((16711935&s[h])*r>>8&16711935)+((65280&s[h])*r>>8&65280),s[h++]=e+((16711935&s[h])*r>>8&16711935)+((65280&s[h])*r>>8&65280),s[h++]=e+((16711935&s[h])*r>>8&16711935)+((65280&s[h])*r>>8&65280)}};static f_=t=>{this.QR[t]&&this.JR&&(this.JR[this.tS++]=this.QR[t],this.QR[t]=null)};static cS=t=>{if(this.a_[t]=this.Vf++,this.QR[t])return this.QR[t];let i;if(this.tS>0&&this.JR)i=this.JR[--this.tS],this.JR[this.tS]=null;else{let t=0,s=-1;for(let i=0;i>>3)&16316671,i[e+8192]=n-(n>>>2)&16316671,i[e+12288]=n-(n>>>2)-(n>>>3)&16316671}}else{if(64===s.width)for(let t=0;t<128;t++)for(let e=0;e<128;e++)i[e+(t<<7)]=h[s.nc[(e>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)i[t]=h[s.nc[t]];this.hS[t]=!1;for(let s=0;s<16384;s++){i[s]&=16316671;const h=i[s];0===h&&(this.hS[t]=!0),i[s+16384]=h-(h>>>3)&16316671,i[s+32768]=h-(h>>>2)&16316671,i[s+49152]=h-(h>>>2)-(h>>>3)&16316671}}return i}}},880:(t,i,s)=>{s.d(i,{r:()=>e});var h=s(7854);const e=async t=>{255!==t[0]&&(t[0]=255),URL.revokeObjectURL(h.NR.src),h.NR.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>h.NR.onload=()=>t())),h.DR.clearRect(0,0,h.PR.width,h.PR.height);const i=h.NR.naturalWidth,s=h.NR.naturalHeight;return h.PR.width=i,h.PR.height=s,h.DR.drawImage(h.NR,0,0),h.DR.getImageData(0,0,i,s)}},8665:(t,i,s)=>{s.d(i,{A:()=>f});var h=s(1069),e=s(8950),n=s(4583),r=s(6730),o=s(4474),l=s(3867);class a{Bg=0;Gb=0;uS=0;dS=-1;wS=-1;AS=-1;yS=-1;pS=-1;mS=-1;IS=-1;_S=-1;ES=-1;gS=0;CS=-1;TS=-1;OS=-1;data=null}class c{x=0;y=0;z=0;w=0}class f extends o.A{static metadata=null;static head=null;static bS=null;static vS=null;static LS=null;static RS=null;static SS=null;static MS=null;static kS=null;static xS=null;static DS=null;static NS=null;static PS=null;static FS=null;static axis=null;static US=new l.ds(4096,!1);static BS=new l.ds(4096,!1);static GS=new Int32Array(4096);static HS=new Int32Array(4096);static WS=new Int32Array(4096);static YS=new Int32Array(4096);static VS=new Int32Array(4096);static KS=new Int32Array(4096);static XS=new Int32Array(1500);static zS=new l.Kn(1500,512);static jS=new Int32Array(12);static ZS=new l.Kn(12,2e3);static qS=new Int32Array(2e3);static $S=new Int32Array(2e3);static JS=new Int32Array(12);static QS=new Int32Array(10);static tM=new Int32Array(10);static iM=new Int32Array(10);static _n=0;static sM=0;static En=0;static Kf=!1;static xl=0;static Dl=0;static Xf=0;static dm=new Int32Array(1e3);static hM=!1;static ec(t){try{f.head=new h.A(t.read('ob_head.dat')),f.bS=new h.A(t.read('ob_face1.dat')),f.vS=new h.A(t.read('ob_face2.dat')),f.LS=new h.A(t.read('ob_face3.dat')),f.RS=new h.A(t.read('ob_face4.dat')),f.SS=new h.A(t.read('ob_face5.dat')),f.MS=new h.A(t.read('ob_point1.dat')),f.kS=new h.A(t.read('ob_point2.dat')),f.xS=new h.A(t.read('ob_point3.dat')),f.DS=new h.A(t.read('ob_point4.dat')),f.NS=new h.A(t.read('ob_point5.dat')),f.PS=new h.A(t.read('ob_vertex1.dat')),f.FS=new h.A(t.read('ob_vertex2.dat')),f.axis=new h.A(t.read('ob_axis.dat')),f.head.Fc=0,f.MS.Fc=0,f.kS.Fc=0,f.xS.Fc=0,f.DS.Fc=0,f.PS.Fc=0,f.FS.Fc=0;const i=f.head.KA;f.metadata=new l.ds(i+100,null);let s=0,e=0,n=0,r=0,o=0,c=0,u=0;for(let t=0;t>7)<2?i=2:i>126&&(i=126),(65408&t)+i):(i<0?i=0:i>127&&(i=127),127-i)}static Ug=(t,i,s)=>{const h=t.Bg,e=t.Gb,n=t.uS;let r,o,a,u,d;if(i){r=new Int32Array(h);for(let i=0;i{const e=t.Bg,n=t.Gb,r=t.uS;let o,l,a,c,u;if(h)o=t.Gg,l=t.Wg,a=t.Hg;else{o=new Int32Array(e),l=new Int32Array(e),a=new Int32Array(e);for(let i=0;i{const s=t.Bg,h=t.Gb,e=t.uS,n=new Int32Array(s),r=new Int32Array(s),o=new Int32Array(s);for(let i=0;i{let s=!1,h=!1,e=!1,n=!1,r=0,o=0,l=0,a=-1;for(let c=0;c{let s=!1,h=!1,e=!1,n=!1,r=0,o=0,l=0,a=-1;for(let c=0;c{let o=-1;const l=t.Gg[i],a=t.Wg[i],c=t.Hg[i];for(let t=0;t{if(!f.metadata)throw new Error('cant loading model metadata!!!!!');const i=f.metadata[t];if(!i)throw console.log(`Error model:${t} not found!`),new Error('cant loading model metadata!!!!!');if(!(f.head&&f.bS&&f.vS&&f.LS&&f.RS&&f.SS&&f.MS&&f.kS&&f.xS&&f.DS&&f.NS&&f.PS&&f.FS&&f.axis))throw new Error('cant loading model!!!!!');const s=i.Bg,h=i.Gb,e=i.uS,n=new Int32Array(s),r=new Int32Array(s),o=new Int32Array(s),l=new Int32Array(h),a=new Int32Array(h),c=new Int32Array(h),u=new Int32Array(e),d=new Int32Array(e),w=new Int32Array(e);let A=null;i.pS>=0&&(A=new Int32Array(s));let y=null;i.ES>=0&&(y=new Int32Array(h));let p=null,m=0;i.gS>=0?p=new Int32Array(h):m=-i.gS-1;let I=null;i.CS>=0&&(I=new Int32Array(h));let _=null;i.TS>=0&&(_=new Int32Array(h));const E=new Int32Array(h);f.MS.Fc=i.dS,f.kS.Fc=i.wS,f.xS.Fc=i.AS,f.DS.Fc=i.yS,f.NS.Fc=i.pS;let g,C,T,O=0,b=0,v=0;for(let t=0;t{if(!f.metadata||!f.metadata[i])throw new Error('No model metadata');const s=f.metadata[i];if(s.data=t,!s.data.length)throw new Error('No model data');const e=s.Bg,n=s.Gb,r=s.uS,o=new Int32Array(e),l=new Int32Array(e),a=new Int32Array(e),c=new Int32Array(n),u=new Int32Array(n),d=new Int32Array(n),w=new Int32Array(r),A=new Int32Array(r),y=new Int32Array(r);let p=null;s.pS>=0&&(p=new Int32Array(e));let m=null;s.ES>=0&&(m=new Int32Array(n));let I=null,_=0;s.gS>=0?I=new Int32Array(n):_=-s.gS-1;let E=null;s.CS>=0&&(E=new Int32Array(n));let g=null;s.TS>=0&&(g=new Int32Array(n));const C=new Int32Array(n),T=new h.A(s.data);T.Fc=s.dS;const O=new h.A(s.data);O.Fc=s.wS;const b=new h.A(s.data);b.Fc=s.AS;const v=new h.A(s.data);v.Fc=s.yS;const L=new h.A(s.data);L.Fc=s.pS;let R,S,M,k=0,x=0,D=0;for(let t=0;tthis.Zg&&(this.Zg=-s),s>this.Db&&(this.Db=s);const e=i*i+h*h;e>this.rO&&(this.rO=e)}this.rO=Math.sqrt(this.rO)+.99|0,this.AM=Math.sqrt(this.rO*this.rO+this.Zg*this.Zg)+.99|0,this.wM=this.AM+(Math.sqrt(this.rO*this.rO+this.Db*this.Db)+.99|0)}Yg(){this.Zg=0,this.Db=0;for(let t=0;tthis.Zg&&(this.Zg=-i),i>this.Db&&(this.Db=i)}this.AM=Math.sqrt(this.rO*this.rO+this.Zg*this.Zg)+.99|0,this.wM=this.AM+(Math.sqrt(this.rO*this.rO+this.Db*this.Db)+.99|0)}Ma(){if(this.yM){const t=new Int32Array(256);let i=0;for(let s=0;si&&(i=h)}this.Xg=new l.ds(i+1,null);for(let s=0;s<=i;s++)this.Xg[s]=new Int32Array(t[s]),t[s]=0;let s=0;for(;si&&(i=h)}this.Kg=new l.ds(i+1,null);for(let s=0;s<=i;s++)this.Kg[s]=new Int32Array(t[s]),t[s]=0;let s=0;for(;sl;)l=s[o++];n&&n.types&&h.x&&h.y&&h.z&&n.labels&&(i!==l||0===n.types[i])&&this.EM(h.x[t],h.y[t],h.z[t],n.labels[i],n.types[i])}f._n=0,f.sM=0,f.En=0,o=0,l=s[o++];for(let t=0;tl;)l=s[o++];n&&n.types&&e.x&&e.y&&e.z&&n.labels&&(i===l||0===n.types[i])&&this.EM(e.x[t],e.y[t],e.z[t],n.labels[i],n.types[i])}}else this.ka(t)}ka(t){if(!this.Xg||-1===t||!r.A.Ro[t])return;const i=r.A.Ro[t],s=i.MR;f._n=0,f.sM=0,f.En=0;for(let t=0;t>16;this.Hg[t]=this.Wg[t]*i+this.Hg[t]*s>>16,this.Wg[t]=h}}translate(t,i,s){for(let h=0;h>8;if(this.rM&&this.oM&&this.lM||(this.rM=new Int32Array(this.Gb),this.oM=new Int32Array(this.Gb),this.lM=new Int32Array(this.Gb)),!this.bb){this.bb=new l.ds(this.Bg,null);for(let t=0;t8192||p>8192||m>8192||y<-8192||p<-8192||m<-8192;)y>>=1,p>>=1,m>>=1;let I=0|Math.sqrt(y*y+p*p+m*m);if(I<=0&&(I=1),y=256*y/I|0,p=256*p/I|0,m=256*m/I|0,this.Bb&&1&this.Bb[i]){const n=t+((s*y+h*p+e*m)/(r+(r/2|0))|0);this.ZE&&(this.rM[i]=f.nM(this.ZE[i],n,this.Bb[i]))}else{let t=this.bb[n];t&&(t.x+=y,t.y+=p,t.z+=m,t.w++),t=this.bb[o],t&&(t.x+=y,t.y+=p,t.z+=m,t.w++),t=this.bb[l],t&&(t.x+=y,t.y+=p,t.z+=m,t.w++)}}if(n)this.Rb(t,r,s,h,e);else{this.xb=new l.ds(this.Bg,null);for(let t=0;t>16;for(let h=0;h>16,_=_*w-I*d>>16,I=m),0!==t&&(m=_*a-E*l>>16,E=_*l+E*a>>16,_=m),0!==i&&(m=E*c+I*u>>16,E=E*u-I*c>>16,I=m),I+=e,_+=r,E+=o,m=_*y-E*A>>16,E=_*A+E*y>>16,_=m,f.GS&&f.HS&&f.WS&&(f.WS[h]=E-p,f.GS[h]=n.A.na+((I<<9)/E|0),f.HS[h]=n.A.ra+((_<<9)/E|0)),this.uS>0&&f.YS&&f.VS&&f.KS&&(f.YS[h]=I,f.VS[h]=_,f.KS[h]=E)}try{this.CM(!1,!1,0)}catch(t){}}draw(t,i,s,h,r,o,l,a,c){const u=a*r-o*h>>16,d=l*i+u*s>>16,w=this.rO*s>>16,A=d+w;if(A<=50||d>=3500)return;const y=a*h+o*r>>16;let p=y-this.rO<<9;if((p/A|0)>=e.A.VR)return;let m=y+this.rO<<9;if((m/A|0)<=-e.A.VR)return;const I=l*s-u*i>>16,_=this.rO*i>>16;let E=I+_<<9;if((E/A|0)<=-e.A.KR)return;let g=I-(_+(this.Zg*s>>16))<<9;if((g/A|0)>=e.A.KR)return;let C=d-(w+(this.Zg*i>>16))<=50,T=!1;if(c>0&&f.Kf){let t=d-w;t<=50&&(t=50),y>0?(p=p/A|0,m=m/t|0):(m=m/A|0,p=p/t|0),I>0?(g=g/A|0,E=E/t|0):(E=E/A|0,g=g/t|0);const i=f.xl-n.A.na,s=f.Dl-n.A.ra;i>p&&ig&&s>16,w=w*L-c*v>>16,c=n),c+=o,u+=l,w+=a,n=w*h+c*r>>16,w=w*r-c*h>>16,c=n,n=u*s-w*i>>16,w=u*i+w*s>>16,u=n,f.WS&&(f.WS[e]=w-d),w>=50&&f.GS&&f.HS?(f.GS[e]=O+((c<<9)/w|0),f.HS[e]=b+((u<<9)/w|0)):f.GS&&(f.GS[e]=-5e3,C=!0),(C||this.uS>0)&&f.YS&&f.VS&&f.KS&&(f.YS[e]=c,f.VS[e]=u,f.KS[e]=w)}try{this.CM(C,T,c)}catch(t){}}CM(t,i,s,h=!1){f.hM&&(this.IM=-1,this._M=-1);for(let t=0;te.A.gv||a>e.A.gv||c>e.A.gv),f.zS&&f.XS){const t=((A+y+p)/3|0)+this.AM;f.zS[t][f.XS[t]++]=h,f.hM&&this.TM(f.xl,f.Dl,u,d,w,l,a,c)&&this._M=0;t--){const i=f.XS[t];if(!(i<=0)&&f.zS){const s=f.zS[t];for(let t=0;t=0;t--){const i=f.XS[t];if(i>0&&f.zS){const s=f.zS[t];for(let h=0;h0||f.jS[2]>0)&&(n=(f.JS[1]+f.JS[2])/(f.jS[1]+f.jS[2])|0);let r=0;f.jS&&f.JS&&(f.jS[3]>0||f.jS[4]>0)&&(r=(f.JS[3]+f.JS[4])/(f.jS[3]+f.jS[4])|0);let o=0;if(f.jS&&f.JS&&(f.jS[6]>0||f.jS[8]>0)&&(o=(f.JS[6]+f.JS[8])/(f.jS[6]+f.jS[8])|0),f.jS&&f.ZS){let t,i=0,s=f.jS[10],e=f.ZS[10],l=f.qS;i===s&&(i=0,s=f.jS[11],e=f.ZS[11],l=f.$S),t=in;)this.OM(e[i++],h),i===s&&e!==f.ZS[11]&&(i=0,s=f.jS[11],e=f.ZS[11],l=f.$S),t=ir;)this.OM(e[i++],h),i===s&&e!==f.ZS[11]&&(i=0,s=f.jS[11],e=f.ZS[11],l=f.$S),t=io;)this.OM(e[i++],h),i===s&&e!==f.ZS[11]&&(i=0,s=f.jS[11],e=f.ZS[11],l=f.$S),t=i>2,r=this.fM[i],o=this.uM[i],l=this.dM[i];n.A.Sv(f.GS[s],f.GS[h],f.GS[e],f.HS[s],f.HS[h],f.HS[e],this.rM[t],this.oM[t],this.lM[t],f.YS[r],f.VS[r],f.KS[r],f.YS[o],f.YS[l],f.VS[o],f.VS[l],f.KS[o],f.KS[l],this.ZE[t])}else if(3===r&&this.Bb&&this.ZE&&this.rM&&f.GS&&f.HS&&f.YS&&f.VS&&f.KS){const i=this.Bb[t]>>2,r=this.fM[i],o=this.uM[i],l=this.dM[i];n.A.Sv(f.GS[s],f.GS[h],f.GS[e],f.HS[s],f.HS[h],f.HS[e],this.rM[t],this.rM[t],this.rM[t],f.YS[r],f.VS[r],f.KS[r],f.YS[o],f.YS[l],f.VS[o],f.VS[l],f.KS[o],f.KS[l],this.ZE[t])}}bM(t,i=!1){let s=0;if(f.KS){const i=n.A.na,h=n.A.ra,e=this.Hb[t],r=this.Wb[t],o=this.Yb[t],l=f.KS[e],a=f.KS[r],c=f.KS[o];if(l>=50&&f.GS&&f.HS&&this.rM)f.QS[s]=f.GS[e],f.tM[s]=f.HS[e],f.iM[s++]=this.rM[t];else if(f.YS&&f.VS&&this.rM){const u=f.YS[e],d=f.VS[e],w=this.rM[t];if(c>=50&&this.lM){const e=(50-l)*n.A.qR[c-l];f.QS[s]=i+((u+((f.YS[o]-u)*e>>16)<<9)/50|0),f.tM[s]=h+((d+((f.VS[o]-d)*e>>16)<<9)/50|0),f.iM[s++]=w+((this.lM[t]-w)*e>>16)}if(a>=50&&this.oM){const e=(50-l)*n.A.qR[a-l];f.QS[s]=i+((u+((f.YS[r]-u)*e>>16)<<9)/50|0),f.tM[s]=h+((d+((f.VS[r]-d)*e>>16)<<9)/50|0),f.iM[s++]=w+((this.oM[t]-w)*e>>16)}}if(a>=50&&f.GS&&f.HS&&this.oM)f.QS[s]=f.GS[r],f.tM[s]=f.HS[r],f.iM[s++]=this.oM[t];else if(f.YS&&f.VS&&this.oM){const u=f.YS[r],d=f.VS[r],w=this.oM[t];if(l>=50&&this.rM){const r=(50-a)*n.A.qR[l-a];f.QS[s]=i+((u+((f.YS[e]-u)*r>>16)<<9)/50|0),f.tM[s]=h+((d+((f.VS[e]-d)*r>>16)<<9)/50|0),f.iM[s++]=w+((this.rM[t]-w)*r>>16)}if(c>=50&&this.lM){const e=(50-a)*n.A.qR[c-a];f.QS[s]=i+((u+((f.YS[o]-u)*e>>16)<<9)/50|0),f.tM[s]=h+((d+((f.VS[o]-d)*e>>16)<<9)/50|0),f.iM[s++]=w+((this.lM[t]-w)*e>>16)}}if(c>=50&&f.GS&&f.HS&&this.lM)f.QS[s]=f.GS[o],f.tM[s]=f.HS[o],f.iM[s++]=this.lM[t];else if(f.YS&&f.VS&&this.lM){const u=f.YS[o],d=f.VS[o],w=this.lM[t];if(a>=50&&this.oM){const e=(50-c)*n.A.qR[a-c];f.QS[s]=i+((u+((f.YS[r]-u)*e>>16)<<9)/50|0),f.tM[s]=h+((d+((f.VS[r]-d)*e>>16)<<9)/50|0),f.iM[s++]=w+((this.oM[t]-w)*e>>16)}if(l>=50&&this.rM){const r=(50-c)*n.A.qR[l-c];f.QS[s]=i+((u+((f.YS[e]-u)*r>>16)<<9)/50|0),f.tM[s]=h+((d+((f.VS[e]-d)*r>>16)<<9)/50|0),f.iM[s++]=w+((this.rM[t]-w)*r>>16)}}}const h=f.QS[0],r=f.QS[1],o=f.QS[2],l=f.tM[0],a=f.tM[1],c=f.tM[2];if(!((h-r)*(c-a)-(l-a)*(o-r)<=0))if(n.A.Ev=!1,3===s){let s;if((h<0||r<0||o<0||h>e.A.gv||r>e.A.gv||o>e.A.gv)&&(n.A.Ev=!0),s=this.Bb?3&this.Bb[t]:0,i)n.A.Zu(h,r,l,a,f.iM[0]),n.A.Zu(r,o,a,c,f.iM[1]),n.A.Zu(o,h,c,l,f.iM[2]);else if(0===s)n.A.bv(h,r,o,l,a,c,f.iM[0],f.iM[1],f.iM[2]);else if(1===s&&this.rM)n.A.lS(h,r,o,l,a,c,n.A.palette[this.rM[t]]);else if(2===s&&this.Bb&&this.ZE&&f.YS&&f.VS&&f.KS){const i=this.Bb[t]>>2,s=this.fM[i],e=this.uM[i],u=this.dM[i];n.A.Sv(h,r,o,l,a,c,f.iM[0],f.iM[1],f.iM[2],f.YS[s],f.VS[s],f.KS[s],f.YS[e],f.YS[u],f.VS[e],f.VS[u],f.KS[e],f.KS[u],this.ZE[t])}else if(3===s&&this.Bb&&this.ZE&&this.rM&&f.YS&&f.VS&&f.KS){const i=this.Bb[t]>>2,s=this.fM[i],e=this.uM[i],u=this.dM[i];n.A.Sv(h,r,o,l,a,c,this.rM[t],this.rM[t],this.rM[t],f.YS[s],f.VS[s],f.KS[s],f.YS[e],f.YS[u],f.VS[e],f.VS[u],f.KS[e],f.KS[u],this.ZE[t])}}else if(4===s){let s;if((h<0||r<0||o<0||h>e.A.gv||r>e.A.gv||o>e.A.gv||f.QS[3]<0||f.QS[3]>e.A.gv)&&(n.A.Ev=!0),s=this.Bb?3&this.Bb[t]:0,i)n.A.Zu(h,r,l,a,f.iM[0]),n.A.Zu(r,o,a,c,f.iM[1]),n.A.Zu(o,f.QS[3],c,f.tM[3],f.iM[2]),n.A.Zu(f.QS[3],h,f.tM[3],l,f.iM[3]);else if(0===s)n.A.bv(h,r,o,l,a,c,f.iM[0],f.iM[1],f.iM[2]),n.A.bv(h,o,f.QS[3],l,c,f.tM[3],f.iM[0],f.iM[2],f.iM[3]);else if(1===s){if(this.rM){const i=n.A.palette[this.rM[t]];n.A.lS(h,r,o,l,a,c,i),n.A.lS(h,o,f.QS[3],l,c,f.tM[3],i)}}else if(2===s&&this.Bb&&this.ZE&&f.YS&&f.VS&&f.KS){const i=this.Bb[t]>>2,s=this.fM[i],e=this.uM[i],u=this.dM[i];n.A.Sv(h,r,o,l,a,c,f.iM[0],f.iM[1],f.iM[2],f.YS[s],f.VS[s],f.KS[s],f.YS[e],f.YS[u],f.VS[e],f.VS[u],f.KS[e],f.KS[u],this.ZE[t]),n.A.Sv(h,o,f.QS[3],l,c,f.tM[3],f.iM[0],f.iM[2],f.iM[3],f.YS[s],f.VS[s],f.KS[s],f.YS[e],f.YS[u],f.VS[e],f.VS[u],f.KS[e],f.KS[u],this.ZE[t])}else if(3===s&&this.Bb&&this.ZE&&this.rM&&f.YS&&f.VS&&f.KS){const i=this.Bb[t]>>2,s=this.fM[i],e=this.uM[i],u=this.dM[i];n.A.Sv(h,r,o,l,a,c,this.rM[t],this.rM[t],this.rM[t],f.YS[s],f.VS[s],f.KS[s],f.YS[e],f.YS[u],f.VS[e],f.VS[u],f.KS[e],f.KS[u],this.ZE[t]),n.A.Sv(h,o,f.QS[3],l,c,f.tM[3],this.rM[t],this.rM[t],this.rM[t],f.YS[s],f.VS[s],f.KS[s],f.YS[e],f.YS[u],f.VS[e],f.VS[u],f.KS[e],f.KS[u],this.ZE[t])}}}EM(t,i,s,h,e){if(!h)return;const r=h.length;if(0===e){let e=0;f._n=0,f.sM=0,f.En=0;for(let t=0;t0?(f._n=(f._n/e|0)+t,f.sM=(f.sM/e|0)+i,f.En=(f.En/e|0)+s):(f._n=t,f.sM=i,f.En=s)}else if(1===e)for(let e=0;e=this.Xg.length)continue;const r=this.Xg[n];if(r)for(let h=0;h=this.Xg.length)continue;const o=this.Xg[r];if(o)for(let h=0;h>16;this.Wg[e]=this.Wg[e]*u-this.Gg[e]*c>>16,this.Gg[e]=t}if(0!==r){c=n.A.sin[r],u=n.A.cos[r];const t=this.Wg[e]*u-this.Hg[e]*c>>16;this.Hg[e]=this.Wg[e]*c+this.Hg[e]*u>>16,this.Wg[e]=t}if(0!==l){c=n.A.sin[l],u=n.A.cos[l];const t=this.Hg[e]*c+this.Gg[e]*u>>16;this.Hg[e]=this.Hg[e]*u-this.Gg[e]*c>>16,this.Gg[e]=t}this.Gg[e]+=f._n,this.Wg[e]+=f.sM,this.Hg[e]+=f.En}}else if(3===e)for(let e=0;e=this.Xg.length)continue;const r=this.Xg[n];if(r)for(let h=0;h=this.Kg.length)continue;const e=this.Kg[s];if(e)for(let i=0;i255&&(this.cM[s]=255)}}}gM(){this.Zg=0,this.rO=0,this.Db=0,this.Nb=999999,this.Pb=-999999,this.Ub=-99999,this.Fb=99999;for(let t=0;tthis.Pb&&(this.Pb=i),hthis.Ub&&(this.Ub=h),-s>this.Zg&&(this.Zg=-s),s>this.Db&&(this.Db=s);const e=i*i+h*h;e>this.rO&&(this.rO=e)}this.rO=0|Math.sqrt(this.rO),this.AM=0|Math.sqrt(this.rO*this.rO+this.Zg*this.Zg),this.wM=this.AM+(0|Math.sqrt(this.rO*this.rO+this.Db*this.Db))}TM(t,i,s,h,e,n,r,o){return!(is&&i>h&&i>e)&&(!(t{s.d(i,{A:()=>o});var h=s(8950),e=s(1069),n=s(4474),r=s(880);class o extends n.A{nc;width;height;Cc;Tc;Pl;fd;constructor(t,i){super(),this.nc=new Int32Array(t*i),this.width=this.Pl=t,this.height=this.fd=i,this.Cc=this.Tc=0}static Ec=async(t,i)=>{const s=t.read(i+'.dat');if(!s)throw new Error(`${i} jpeg not found!`);const h=await(0,r.r)(s),e=new o(h.width,h.height),n=new Uint32Array(h.data.buffer),l=e.nc;for(let t=0;t>24&255)<<24|(255&i)<<16|(i>>8&255)<<8|i>>16&255}return e};static za=(t,i,s=0)=>{const h=new e.A(t.read(i+'.dat')),n=new e.A(t.read('index.dat'));n.Fc=h.KA;const r=n.KA,l=n.KA,a=[],c=n.ZA-1;for(let t=0;th.length||n.Fc>n.length)throw new Error;const f=n.ZA,u=n.ZA,d=n.KA,w=n.KA,A=new o(d,w);A.Cc=f,A.Tc=u,A.Pl=r,A.fd=l;const y=n.ZA;if(0===y){const t=A.width*A.height;for(let i=0;ih.A.bottom&&(n-=i+n-h.A.bottom),th.A.right){const i=t+r-h.A.right;r-=i,l+=i,o+=i}r>0&&n>0&&this.LM(r,n,this.nc,e,l,h.A.nc,s,o)}Nl(t,i,s){i|=0,s|=0;let e=(i+=this.Cc)+(s+=this.Tc)*h.A.lC,n=0,r=this.height,o=this.width,l=h.A.lC-o,a=0;if(sh.A.bottom&&(r-=s+r-h.A.bottom),ih.A.right){const t=i+o-h.A.right;o-=t,a+=t,l+=t}o>0&&r>0&&this.RM(o,r,this.nc,n,a,h.A.nc,e,l,t)}tc(t,i){t|=0,i|=0;let s=(t+=this.Cc)+(i+=this.Tc)*h.A.lC,e=0,n=this.height,r=this.width,o=h.A.lC-r,l=0;if(ih.A.bottom&&(n-=i+n-h.A.bottom),th.A.right){const i=t+r-h.A.right;r-=i,l+=i,o+=i}r>0&&n>0&&this.SM(r,n,this.nc,e,l,h.A.nc,s,o)}Ja(){const t=this.nc,i=this.width,s=this.height;for(let h=0;h>16&255;n+=t,n<1?n=1:n>255&&(n=255);let r=e>>8&255;r+=i,r<1?r=1:r>255&&(r=255);let o=255&e;o+=s,o<1?o=1:o>255&&(o=255),this.nc[h]=(n<<16)+(r<<8)+o}}}AC(t,i,s,e){t|=0,i|=0,s|=0,e|=0;try{const n=this.width;let r=0,o=0;const l=this.Pl,a=this.fd,c=(l<<16)/s|0,f=(a<<16)/e|0;t+=(this.Cc*s+l-1)/l|0,i+=(this.Tc*e+a-1)/a|0,this.Cc*s%l!=0&&(r=(l-this.Cc*s%l<<16)/s|0),this.Tc*e%a!=0&&(o=(a-this.Tc*e%a<<16)/e|0),s=s*(this.width-(r>>16))/l|0,e=e*(this.height-(o>>16))/a|0;let u=t+i*h.A.lC,d=h.A.lC-s;if(ih.A.bottom&&(e-=i+e-h.A.bottom),th.A.right){const i=t+s-h.A.right;s-=i,d+=i}this.scale(s,e,this.nc,r,o,h.A.nc,d,u,n,c,f)}catch(t){console.error('error in sprite clipping routine')}}nd(t,i,s,e,n,r,o,l,a,c){t|=0,i|=0,s|=0,e|=0;try{const f=-s/2|0,u=-e/2|0,d=65536*Math.sin(a/326.11)|0,w=65536*Math.cos(a/326.11)|0,A=d*c>>8,y=w*c>>8;let p=(o<<16)+u*A+f*y,m=u*y-f*A+(l<<16),I=t+i*h.A.lC;for(let t=0;t>16)+(o>>16)*this.width],e+=y,o-=A;p+=A,m+=y,I+=h.A.lC}}catch(t){}}ad(t,i,s){t|=0,i|=0;let e=(t+=this.Cc)+(i+=this.Tc)*h.A.lC,n=0,r=this.height,o=this.width,l=h.A.lC-o,a=0;if(ih.A.bottom&&(r-=i+r-h.A.bottom),th.A.right){const i=t+o-h.A.right;o-=i,a+=i,l+=i}o>0&&r>0&&this.MM(o,r,this.nc,a,n,h.A.nc,e,l,s.nc)}scale(t,i,s,h,e,n,r,o,l,a,c){try{const f=h;for(let u=-i;u<0;u++){const i=(e>>16)*l;for(let e=-t;e<0;e++){const t=s[(h>>16)+i];0===t?o++:n[o++]=t,h+=a}e+=c,h=f,o+=r}}catch(t){console.error('error in plot_scale')}}SM(t,i,s,h,e,n,r,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++)n[r++]=s[h++],n[r++]=s[h++],n[r++]=s[h++],n[r++]=s[h++];for(let i=t;i<0;i++)n[r++]=s[h++];r+=o,h+=e}}RM(t,i,s,h,e,n,r,o,l){const a=256-l;for(let c=-i;c<0;c++){for(let i=-t;i<0;i++){const t=s[h++];if(0===t)r++;else{const i=n[r];n[r++]=((16711935&t)*l+(16711935&i)*a&4278255360)+((65280&t)*l+(65280&i)*a&16711680)>>8}}r+=o,h+=e}}LM(t,i,s,h,e,n,r,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=s[h++];0===t?r++:n[r++]=t,t=s[h++],0===t?r++:n[r++]=t,t=s[h++],0===t?r++:n[r++]=t,t=s[h++],0===t?r++:n[r++]=t}for(let i=t;i<0;i++){const t=s[h++];0===t?r++:n[r++]=t}r+=o,h+=e}}MM(t,i,s,h,e,n,r,o,l){const a=-(t>>2);t=-(3&t);for(let c=-i;c<0;c++){for(let t=a;t<0;t++){let t=s[e++];0!==t&&0===l[r]?n[r++]=t:r++,t=s[e++],0!==t&&0===l[r]?n[r++]=t:r++,t=s[e++],0!==t&&0===l[r]?n[r++]=t:r++,t=s[e++],0!==t&&0===l[r]?n[r++]=t:r++}for(let i=t;i<0;i++){const t=s[e++];0!==t&&0===l[r]?n[r++]=t:r++}r+=o,e+=h}}}},1673:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(8950),e=s(1069),n=s(4474);class r extends n.A{nc;width;height;Cc;Tc;Pl;fd;palette;constructor(t,i,s){super(),this.nc=new Int8Array(t*i),this.width=this.Pl=t,this.height=this.fd=i,this.Cc=this.Tc=0,this.palette=s}static za=(t,i,s=0)=>{const h=new e.A(t.read(i+'.dat')),n=new e.A(t.read('index.dat'));n.Fc=h.KA;const o=n.KA,l=n.KA,a=n.ZA,c=new Int32Array(a);for(let t=1;th.length||n.Fc>n.length)throw new Error;const f=n.ZA,u=n.ZA,d=n.KA,w=n.KA,A=new r(d,w,c);A.Cc=f,A.Tc=u,A.Pl=o,A.fd=l;const y=A.nc,p=n.ZA;if(0===p){const t=A.width*A.height;for(let i=0;ih.A.bottom&&(n-=i+n-h.A.bottom),th.A.right){const i=t+r-h.A.right;r-=i,l+=i,o+=i}r>0&&n>0&&this.kM(r,n,this.nc,e,l,h.A.nc,s,o)}Ja(){const t=this.nc,i=this.width,s=this.height;for(let h=0;h>16&255;e+=t,e<0?e=0:e>255&&(e=255);let n=this.palette[h]>>8&255;n+=i,n<0?n=0:n>255&&(n=255);let r=255&this.palette[h];r+=s,r<0?r=0:r>255&&(r=255),this.palette[h]=(e<<16)+(n<<8)+r}}nS(){this.Pl|=0,this.fd|=0,this.Pl/=2,this.fd/=2,this.Pl|=0,this.fd|=0;const t=new Int8Array(this.Pl*this.fd);let i=0;for(let s=0;s>1)+(s+this.Tc>>1)*this.Pl]=this.nc[i++];this.nc=t,this.width=this.Pl,this.height=this.fd,this.Cc=0,this.Tc=0}AC(){if(this.width===this.Pl&&this.height===this.fd)return;const t=new Int8Array(this.Pl*this.fd);let i=0;for(let s=0;s>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=s[h++];0===t?r++:n[r++]=this.palette[255&t],t=s[h++],0===t?r++:n[r++]=this.palette[255&t],t=s[h++],0===t?r++:n[r++]=this.palette[255&t],t=s[h++],0===t?r++:n[r++]=this.palette[255&t]}for(let i=t;i<0;i++){const t=s[h++];0===t?r++:n[r++]=this.palette[255&t]}r+=o,h+=e}}clip(t,i,s,e){try{const n=this.width;this.height;let r=0,o=0;const l=this.Pl,a=this.fd,c=(l<<16)/s|0,f=(a<<16)/e|0;t=t+(this.Cc*s+l-1)/l|0,i=i+(this.Tc*e+a-1)/a|0,this.Cc*s%l!=0&&(r=(l-this.Cc*s%l<<16)/s|0),this.Tc*e%a!=0&&(o=(a-this.Tc*e%a<<16)/e|0),s=s*(this.width-(r>>16))/l|0,e=e*(this.height-(o>>16))/a|0;let u,d=t+i*h.A.lC,w=h.A.lC-s;ih.A.bottom&&(e-=i+e-h.A.bottom),th.A.right&&(u=t+s-h.A.right,s-=u,w+=u),this.xM(h.A.nc,this.nc,this.palette,r,o,d,w,s,e,c,f,n)}catch(t){console.log('error in sprite clipping routine')}}xM(t,i,s,h,e,n,r,o,l,a,c,f){try{const u=h;for(let d=-l;d<0;d++){const l=(e>>16)*f;for(let e=-o;e<0;e++){const e=i[(h>>16)+l];0==e?n++:t[n++]=s[255&e],h+=a}e+=c,h=u,n+=r}}catch(t){console.log('error in plot_scale')}}}},2682:(t,i,s)=>{s.d(i,{A:()=>l});var h=s(8950),e=s(1069),n=s(4474);class r{seed;constructor(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}DM(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}YA(){return this.next(32)}next(t){return this.seed=0x5deece66dn*this.seed+0xbn&(1n<<48n)-1n,Number(this.seed)>>>48-t}}var o=s(9298);class l extends n.A{static xc='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!"£$%^&*()-_=+[{]};:\'@#~,<.>/?\\| ';static NM=[];static{const t=navigator.userAgent.includes('Capacitor');for(let i=0;i<256;i++){let s=l.xc.indexOf(String.fromCharCode(i));t&&s>=63&&s--,-1===s&&(s=74),l.NM[i]=s}}PM=[];FM=new Int32Array(94);UM=new Int32Array(94);BM=new Int32Array(94);GM=new Int32Array(94);HM=new Int32Array(95);WM=new Int32Array(256);random=new r(BigInt(Date.now()));height=0;static za=(t,i)=>{const s=new e.A(t.read(i+'.dat')),h=new e.A(t.read('index.dat'));h.Fc=s.KA+4;const n=h.ZA;n>0&&(h.Fc+=3*(n-1));const r=new l;for(let t=0;t<94;t++){r.BM[t]=h.ZA,r.GM[t]=h.ZA;const i=r.FM[t]=h.KA,e=r.UM[t]=h.KA,n=h.ZA,o=i*e;if(r.PM[t]=new Int8Array(o),0===n)for(let h=0;hr.height&&(r.height=e),r.BM[t]=1,r.HM[t]=i+2;{let s=0;for(let h=e/7|0;h=h.A.bottom&&(n-=s+n+1-h.A.bottom),i=h.A.right){const t=i+e+1-h.A.right;e-=t,a+=t,l+=t}e>0&&n>0&&this.XM(e,n,t,c,a,h.A.nc,o,l,r)}KM(t,i,s,e,n,r,o){s|=0,e|=0;let l=(t|=0)+(i|=0)*h.A.lC,a=h.A.lC-s,c=0,f=0;if(i=h.A.bottom&&(e-=i+e+1-h.A.bottom),t=h.A.right){const i=t+s+1-h.A.right;s-=i,c+=i,a+=i}s>0&&e>0&&this.zM(s,e,h.A.nc,l,a,o,f,c,n,r)}XM(t,i,s,h,e,n,r,o,l){const a=-((t|=0)>>2);t=-(3&t);for(let c=-(i|=0);c<0;c++){for(let t=a;t<0;t++)0===s[h++]?r++:n[r++]=l,0===s[h++]?r++:n[r++]=l,0===s[h++]?r++:n[r++]=l,0===s[h++]?r++:n[r++]=l;for(let i=t;i<0;i++)0===s[h++]?r++:n[r++]=l;r+=o,h+=e}}zM(t,i,s,h,e,n,r,o,l,a){t|=0;const c=((16711935&l)*a&4278255360)+((65280&l)*a&16711680)>>8,f=256-a;for(let l=-(i|=0);l<0;l++){for(let i=-t;i<0;i++)if(0===n[r++])h++;else{const t=s[h];s[h++]=(((16711935&t)*f&4278255360)+((65280&t)*f&16711680)>>8)+c}h+=e,r+=o}}VM(t){return'red'===t?o.A.RED:'gre'===t?o.A.GREEN:'blu'===t?o.A.BLUE:'yel'===t?o.A.Gl:'cya'===t?o.A.bc:'mag'===t?o.A.vc:'whi'===t?o.A._l:'bla'===t?o.A.Bl:'lre'===t?o.A.FR:'dre'===t?o.A.sd:'dbl'===t?o.A.td:'or1'===t?o.A.UR:'or2'===t?o.A.BR:'or3'===t?o.A.GR:'gr1'===t?o.A.HR:'gr2'===t?o.A.WR:'gr3'===t?o.A.YR:o.A.Bl}split(t,i){if(0===t.length)return[t];const s=[];for(;t.length>0;){if(this.au(t)<=i&&-1===t.indexOf('|')){s.push(t);break}let h=t.length;for(let s=0;si)break;h=s}else if('|'===t[s]){h=s;break}s.push(t.substring(0,h)),t=t.substring(h+1)}return s}}},1183:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(8950),e=s(7854);class n{jM;width;height;ZM;qM;nc;constructor(t,i,s=e.jo){this.ZM=s,this.jM=this.ZM.getImageData(0,0,t,i),this.qM=new Uint32Array(this.jM.data.buffer),this.nc=new Int32Array(t*i),this.width=t,this.height=i,this.bind()}clear(){this.nc.fill(0)}bind(){h.A.bind(this.nc,this.width,this.height)}draw(t,i){this.#t(),this.ZM.putImageData(this.jM,t,i)}#t(){const t=this.nc.length,i=this.nc,s=this.qM;for(let h=0;h>16&255|(t>>8&255)<<8|(255&t)<<16|4278190080}}}},3955:(t,i,s)=>{s.d(i,{A:()=>h});class h{static iy=150;static bf=108;static Tf=70;static Zc=81;static sf=189;static Mw=7;static Zd=88;static Kd=30;static Qd=176;static Hd=220;static Dw=66;static Tw=17;static lw=2;static Lw=238;static cA=233;static Gf=146;static cf=215;static Of=236;static jI=85;static pI=219;static dw=140;static pw=40;static yw=200;static ww=178;static Aw=247;static xw=138;static iw=239;static Jd=194;static jd=8;static qd=27;static $d=113;static tw=100;static fw=134;static ow=202;static hw=245;static mw=172;static Pw=96;static kw=97;static Nw=116;static uw=9;static Gd=75;static Fd=164;static aw=53;static cw=185;static Pd=206;static Vw=177;static Bw=248;static Xd=195;static zd=71;static Vd=133;static Wd=157;static Yd=211;static nw=48;static ew=130;static bw=31;static Sw=59;static Cw=212;static Rw=38;static Ow=6;static gw=155;static rw=235;static HA=231;static AA=237;static kf=175;static km=93;static eA=190;static Mm=165;static nf=159;static gA=171;static EA=79;static iA=52;static wA=244;static fA=148;static _A=11;static IA=118;static pA=4;static mA=158;static Sm=181}},3554:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(6666),e=s(1982);class n{$M;JM;QM;closed=!1;tk=!1;static Nc=async t=>await new Promise(((i,s)=>{const h=t.host.startsWith('https'),e=h?'wss':'ws',n=t.host.substring(t.host.indexOf('//')+2),r=h?t.port+2:t.port+1,o=new WebSocket(`${e}://${n}:${r}`,'binary');o.addEventListener('open',(()=>{console.log('connection open!'),i(o)})),o.addEventListener('error',(()=>{console.log('connection error!'),s(o)}))}));constructor(t){t.onclose=this.onclose,t.onerror=this.onerror,this.JM=new l(t,5e3),this.QM=new r(t,5e3),this.$M=t}get host(){return this.$M.url.split('/')[2]}get port(){return parseInt(this.$M.url.split(':')[2],10)}get available(){return this.closed?0:this.JM.available}write(t,i){this.QM.write(t,i)}async read(){return this.closed?0:this.JM.ik()??await this.JM.sk()}async Pc(t,i,s){if(!this.closed)for(;s>0;){const h=this.JM.hk(t,i,s)??await this.JM.ek(t,i,s);if(h.length<=0)throw new Error('EOF');i+=h.length,s-=h.length}}close(){this.closed=!0,this.$M.close(),this.JM.close(),this.QM.close(),console.log('connection close!'),this.tk&&console.log('connection error!')}onclose=t=>{this.closed||this.close()};onerror=t=>{this.closed||(this.tk=!0,this.close())}}class r{$M;nk;closed=!1;tk=!1;constructor(t,i){this.$M=t,this.nk=i}write(t,i){if(!this.closed){if(this.tk)throw this.tk=!1,new Error('Error in writer thread');if(i>this.nk||t.length>this.nk)throw new Error('buffer overflow');try{this.$M.send(t.subarray(0,i))}catch(t){this.tk=!0}}}close(){this.closed=!0}}class o extends e.A{Gm;position;constructor(t){super(),this.Gm=t,this.position=0}get available(){return this.Gm.length-this.position}get read(){return this.Gm[this.position++]}get rk(){return this.Gm.length}}class l{nk;queue=new h.A;event=null;lk=null;total=0;closed=!1;constructor(t,i){this.nk=i,t.binaryType='arraybuffer',t.onmessage=this.onmessage}get available(){return this.total}onmessage=t=>{if(this.closed)throw new Error('WebSocketReader is closed!');const i=new o(new Uint8Array(t.data));if(this.event?this.queue.n_(i):this.event=i,this.total+=i.rk,this.lk&&(this.lk(this.event),this.lk=null,this.total>this.nk))throw new Error('buffer overflow')};ak(){return this.event&&this.event.available>0?this.event.read:null}async ck(t){for(this.event=this.queue.ev();this.totalthis.lk=t));return this.event?this.event.read:this.ck(t)}hk(t,i,s){if(this.closed)throw new Error('WebSocketReader is closed!');if(!(this.event&&this.event.available>=s))return null;for(;s>0;){const h=this.ak();if(null===h)throw new Error('EOF - tried to read a fast byte when there was not enough immediate bytes.');t[i++]=h,this.total--,s--}return t}async ek(t,i,s){if(this.closed)throw new Error('WebSocketReader is closed!');for(;s>0;)t[i++]=this.ak()??await this.ck(s),this.total--,s--;return t}ik(){if(this.closed)throw new Error('WebSocketReader is closed!');const t=this.ak();return null===t?null:(this.total--,t)}async sk(){if(this.closed)throw new Error('WebSocketReader is closed!');const t=await this.ck(1);return this.total--,t}close(){this.closed=!0,this.lk=null,this.total=0,this.event=null,this.queue.clear()}}},4544:(t,i,s)=>{s.d(i,{A:()=>h});class h{db;constructor(t){t.onerror=this.onerror,t.onclose=this.onclose,this.db=t}static openDatabase=async()=>await new Promise(((t,i)=>{const s=indexedDB.open('lostcity',1);s.onsuccess=i=>{const s=i.target;console.log('database success!'),t(s.result)},s.onupgradeneeded=t=>{t.target.result.createObjectStore('cache')},s.onerror=t=>{const s=t.target;console.error('database error!: ',s.error),i(s.result)}}));Uo=async t=>await new Promise((i=>{const s=this.db.transaction('cache','readonly').objectStore('cache').get(t);s.onsuccess=()=>{i(s.result)},s.onerror=t=>{i(void 0)}}));Yo=async(t,i)=>await new Promise(((s,h)=>{const e=this.db.transaction('cache','readwrite').objectStore('cache').put(i,t);e.onsuccess=()=>{s()},e.onerror=t=>{h()}}));onclose=t=>{console.log('database close!')};onerror=t=>{console.log('database error!')};fk=t=>{const i=t.trim();let s=0;for(let t=0;t='A'&&h<='Z'?s+=h.charCodeAt(0)+1-65:h>='a'&&h<='z'?s+=h.charCodeAt(0)+1-97:h>='0'&&h<='9'&&(s+=h.charCodeAt(0)+27-48)}return s}}},2634:(t,i,s)=>{s.d(i,{A:()=>h});class h{count=0;uk=new Int32Array(256);dk=new Int32Array(256);a=0;b=0;c=0;constructor(t){for(let i=0;i>>2,e+=i,s+=h,s^=h<<8,n+=s,h+=e,h^=e>>>16,r+=h,e+=n,e^=n<<10,o+=e,n+=r,n^=r>>>4,t+=n,r+=o,r^=o<<8,i+=r,o+=t,o^=t>>>9,s+=o,t+=i;for(let l=0;l<256;l+=8)t+=this.uk[l],i+=this.uk[l+1],s+=this.uk[l+2],h+=this.uk[l+3],e+=this.uk[l+4],n+=this.uk[l+5],r+=this.uk[l+6],o+=this.uk[l+7],t^=i<<11,h+=t,i+=s,i^=s>>>2,e+=i,s+=h,s^=h<<8,n+=s,h+=e,h^=e>>>16,r+=h,e+=n,e^=n<<10,o+=e,n+=r,n^=r>>>4,t+=n,r+=o,r^=o<<8,i+=r,o+=t,o^=t>>>9,s+=o,t+=i,this.dk[l]=t,this.dk[l+1]=i,this.dk[l+2]=s,this.dk[l+3]=h,this.dk[l+4]=e,this.dk[l+5]=n,this.dk[l+6]=r,this.dk[l+7]=o;for(let l=0;l<256;l+=8)t+=this.dk[l],i+=this.dk[l+1],s+=this.dk[l+2],h+=this.dk[l+3],e+=this.dk[l+4],n+=this.dk[l+5],r+=this.dk[l+6],o+=this.dk[l+7],t^=i<<11,h+=t,i+=s,i^=s>>>2,e+=i,s+=h,s^=h<<8,n+=s,h+=e,h^=e>>>16,r+=h,e+=n,e^=n<<10,o+=e,n+=r,n^=r>>>4,t+=n,r+=o,r^=o<<8,i+=r,o+=t,o^=t>>>9,s+=o,t+=i,this.dk[l]=t,this.dk[l+1]=i,this.dk[l+2]=s,this.dk[l+3]=h,this.dk[l+4]=e,this.dk[l+5]=n,this.dk[l+6]=r,this.dk[l+7]=o;this.wk(),this.count=256}wk(){this.c++,this.b+=this.c;for(let t=0;t<256;t++){const i=this.dk[t],s=3&t;let h;0===s?this.a^=this.a<<13:1===s?this.a^=this.a>>>6:2===s?this.a^=this.a<<2:3===s&&(this.a^=this.a>>>16),this.a+=this.dk[t+128&255],this.dk[t]=h=this.dk[i>>>2&255]+this.a+this.b,this.uk[t]=this.b=this.dk[h>>>8>>>2&255]+i}}}},2901:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(1069),e=s(1908);class n{static fk=t=>{let i=0;t=t.toUpperCase();for(let s=0;s=this.yk)return null;if(this.Ek[t])return this.Ek[t];const i=this._k[t],s=i+this.Ik[t];if(this.Ak){const h=Uint8Array.from(this.buffer.subarray(i,i+s));return this.Ek[t]=h,h}{const i=Uint8Array.from(e.A.read(this.mk[t],this.buffer,this.Ik[t],this._k[t]));return this.Ek[t]=i,i}}}},1069:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(9234),e=s(6666),n=s(4474);class r extends n.A{static Ck=3988292384;static Tk=new Int32Array(256);static Ok=new Uint32Array(33);static bk=new e.A;static vk=new e.A;static Lk=new e.A;static Rk=0;static Sk=0;static Mk=0;static{for(let t=0;t<32;t++)r.Ok[t]=(1<>>=1:i=i>>>1^r.Ck;r.Tk[t]=i}}static Bo=t=>{let i=4294967295;for(let s=0;s>>8^r.Tk[255&(i^t[s])];return~i};view;data;Fc=0;Bm=0;random=null;constructor(t){if(!t)throw new Error('Input src packet array was null!');super(),t instanceof Int8Array?this.data=new Uint8Array(t):this.data=t,this.view=new DataView(this.data.buffer,this.data.byteOffset,this.data.byteLength)}get length(){return this.view.byteLength}get available(){return this.length-this.Fc}static Ut=t=>{let i=null;return 0===t&&r.Rk>0?(r.Rk--,i=r.bk.ev()):1===t&&r.Sk>0?(r.Sk--,i=r.vk.ev()):2===t&&r.Mk>0&&(r.Mk--,i=r.Lk.ev()),i?(i.Fc=0,i):new r(0===t?new Uint8Array(100):1===t?new Uint8Array(5e3):new Uint8Array(3e4))};release(){this.Fc=0,100===this.view.byteLength&&r.Rk<1e3?(r.bk.n_(this),r.Rk++):5e3===this.view.byteLength&&r.Sk<250?(r.vk.n_(this),r.Sk++):3e4===this.view.byteLength&&r.Mk<50&&(r.Lk.n_(this),r.Mk++)}get ZA(){return this.view.getUint8(this.Fc++)}get zA(){return this.view.getInt8(this.Fc++)}get KA(){const t=this.view.getUint16(this.Fc);return this.Fc+=2,t}get tp(){const t=this.view.getInt16(this.Fc);return this.Fc+=2,t}get dg(){const t=this.view.getUint8(this.Fc++)<<16|this.view.getUint16(this.Fc);return this.Fc+=2,t}get Ko(){const t=this.view.getInt32(this.Fc);return this.Fc+=4,t}get Uc(){const t=this.view.getBigInt64(this.Fc);return this.Fc+=8,t}get kR(){return this.view.getUint8(this.Fc)<128?this.ZA-64:this.KA-49152}get nO(){return this.view.getUint8(this.Fc)<128?this.ZA:this.KA-32768}get ly(){const t=this.view,i=t.byteLength;let s,h='';for(;10!==(s=t.getUint8(this.Fc++))&&this.Fc>16),this.view.setUint16(this.Fc,t),this.Fc+=2}p4(t){this.view.setInt32(this.Fc,t),this.Fc+=4}xk(t){this.view.setInt32(this.Fc,t,!0),this.Fc+=4}nA(t){this.view.setBigInt64(this.Fc,t),this.Fc+=8}Bc(t){const i=this.view,s=t.length;for(let h=0;h>>3,s=8-(7&this.Bm),h=0;for(this.Bm+=t;t>s;s=8)h+=(this.view.getUint8(i++)&r.Ok[s])<>>s-t&r.Ok[t],h}Gc(t,i){const s=this.Fc;this.Fc=0;const e=new Uint8Array(s);this.xy(s,0,e);const n=(0,h.Dk)(e),r=(0,h.Nk)(n,i,t),o=(0,h.Pk)(r);this.Fc=0,this.p1(o.length),this.Hc(o,o.length,0)}}},353:(t,i,s)=>{s.d(i,{A:()=>h});class h{static Fk=[95,218,67,50,253,222,194,60,101,128,8,251,92,111,24,33,223,66,232,59,227,113,153,105,126,98,167,102,177,238,62,190,147,23,150,151,156,144,193,155,81,0,198,22,137,210,179,16,168,170,32,181,248,141,58,87,208,106,180,191,221,241,40,176,196,154,65,145,230,78,30,161,188,41,14,129,18,199,47,247,225,34,51,10,159,75,12,56,61,31,39,91,46,242,134,5,122,123,209,228,104,195,21,3,11,44,107,172,6,186,110,215,205,103,27,185,124,77,252,117,86,115,127,207,52,79,43,97,219,116,169,7,118,162,108,36,20,233,88,135,80,19,42,237,57,152,71,9,250,17,4,119,234,130,26,200,189,163,254,245,197,171,220,235,140,244,184,94,211,231,99,246,121,212,112,204,63,148,83,178,1,255,131,13,183,142,236,45,55,35,243,136,37,85,100,160,38,224,146,174,82,48,109,132,125,90,143,138,240,173,165,164,192,175,29,74,28,114,213,73,64,206,76,139,96,2,229,15,93,25,239,202,49,70,214,201,72,203,68,89,69,157,216,217,249,120,226,84,149,187,54,53,158,166,182,133,0];static VA=[0,-2,4,6,-1,0,0,2,0,0,0,0,5,4,2,2,0,0,0,0,2,-2,2,14,0,6,3,0,4,0,0,0,3,0,0,0,0,0,0,0,0,-1,4,2,6,0,6,0,0,3,7,0,0,0,-1,0,0,0,0,4,0,0,0,0,0,0,0,0,1,15,0,0,0,0,6,0,2,0,0,0,2,0,0,0,1,0,0,4,0,0,0,0,0,0,0,0,0,0,-2,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,-2,0,0,2,0,0,0,2,9,0,0,0,0,0,4,0,0,0,3,7,9,0,0,0,0,0,0,0,0,0,-2,0,0,0,0,3,2,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,-2,2,0,0,0,0,0,6,0,0,0,2,0,2,0,0,0,-2,0,0,4,0,0,0,0,6,0,0,-2,-2,0,0,0,0,0,0,-2,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,-2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0]}},2215:(t,i,s)=>{s.d(i,{A:()=>h});class h{static Jy=14;static Ly=28;static Op=129;static My=167;static Ip=168;static qy=195;static _p=2;static gp=26;static Ap=46;static dp=84;static ap=87;static jy=103;static Sy=146;static hy=197;static bp=201;static Xy=204;static Qy=209;static Hy=126;static cp=185;static By=15;static Ny=98;static Mp=213;static up=74;static Sp=13;static ip=3;static Tp=239;static JA=1;static kp=184;static Dy=133;static Py=226;static wp=4;static Cp=21;static Zy=32;static fA=41;static jA=152;static Ay=19;static Rp=22;static ny=25;static qA=43;static vp=44;static fp=68;static Ep=136;static yy=139;static Gy=140;static uy=142;static Uy=243;static Yy=254;static wy=20;static $A=80;static op=132;static ky=220;static ty=237;static XA=150;static Ry=175;static lp=193;static Vy=12;static oy=54;static Wy=212;static zy=7;static sp=135;static Lp=162;static my=23;static Ty=42;static gy=49;static Iy=50;static by=59;static Ey=69;static Oy=76;static py=151;static _y=191;static Cy=223}},3937:(t,i,s)=>{s.d(i,{A:()=>o});class h{start=0;end=0;form=0;length=0;Uk=null;Bk=null;threshold=0;position=0;delta=0;amplitude=0;Gk=0;read(t){this.form=t.ZA,this.start=t.Ko,this.end=t.Ko,this.length=t.ZA,this.Uk=new Int32Array(this.length),this.Bk=new Int32Array(this.length);for(let i=0;i=this.threshold&&this.Bk&&this.Uk&&(this.amplitude=this.Bk[this.position++]<<15,this.position>=this.length&&(this.position=this.length-1),this.threshold=this.Uk[this.position]/65536*t|0,this.threshold>this.Gk&&(this.delta=((this.Bk[this.position]<<15)-this.amplitude)/(this.threshold-this.Gk)|0)),this.amplitude+=this.delta,this.Gk++,this.amplitude-this.delta>>15}}class e{static buffer=null;static PT=null;static sin=null;static Hk=new Int32Array(5);static Wk=new Int32Array(5);static Yk=new Int32Array(5);static Vk=new Int32Array(5);static Kk=new Int32Array(5);Xk=null;zk=null;jk=null;Zk=null;qk=null;$k=null;release=null;attack=null;Jk=new Int32Array(5);Qk=new Int32Array(5);tx=new Int32Array(5);start=0;length=500;ix=100;sx=0;static init=()=>{this.PT=new Int32Array(32768);for(let t=0;t<32768;t++)Math.random()>.5?this.PT[t]=1:this.PT[t]=-1;this.sin=new Int32Array(32768);for(let t=0;t<32768;t++)this.sin[t]=16384*Math.sin(t/5215.1903)|0;this.buffer=new Int32Array(220500)};Xc(t,i){for(let i=0;i>1,r+=(i*h>>16)+n}if(this.qk&&this.$k){const i=this.qk.evaluate(t),s=this.$k.evaluate(t);c=c*(32768+(this.hx(s,a,this.qk.form)>>1))>>15,a+=(i*o>>16)+l}for(let h=0;h<5;h++)if(0!==this.Jk[h]){const n=i+e.Wk[h];n>15,e.Hk[h],this.Xk.form),e.Hk[h]+=(s*e.Vk[h]>>16)+e.Kk[h])}}if(this.release&&this.attack){this.release.reset(),this.attack.reset();let i=0,s=!0;for(let h=0;h>8):this.release.start+((this.release.end-this.release.start)*r>>8),i+=256,i>=o&&(i=0,s=!s),s&&(e.buffer[h]=0)}}if(this.sx>0&&this.ix>0){const i=this.sx*s;for(let s=i;s32767&&(e.buffer[i]=32767);return e.buffer}hx(t,i,s){return 1===s?(32767&i)<16384?t:-t:2===s?e.sin[32767&i]*t>>14:3===s?((32767&i)*t>>14)-t:4===s?e.PT[i/2607&32767]*t:0}read(t){this.Xk=new h,this.Xk.read(t),this.zk=new h,this.zk.read(t),0!==t.ZA&&(t.Fc--,this.jk=new h,this.jk.read(t),this.Zk=new h,this.Zk.read(t)),0!==t.ZA&&(t.Fc--,this.qk=new h,this.qk.read(t),this.$k=new h,this.$k.read(t)),0!==t.ZA&&(t.Fc--,this.release=new h,this.release.read(t),this.attack=new h,this.attack.read(t));for(let i=0;i<10;i++){const s=t.nO;if(0===s)break;this.Jk[i]=s,this.Qk[i]=t.kR,this.tx[i]=t.nO}this.sx=t.nO,this.ix=t.nO,this.length=t.KA,this.start=t.KA}}var n=s(1069),r=s(3867);class o{static Ky=new Int32Array(1e3);static nx=null;static ox=null;static lx=new r.ds(1e3,null);ux=new r.ds(10,null);wx=0;loopEnd=0;static ec=t=>{const i=new n.A(t.read('sounds.dat'));for(this.nx=new Uint8Array(441e3),this.ox=new n.A(this.nx),e.init();;){const t=i.KA;if(65535===t)break;const s=new o;s.read(i),this.lx[t]=s,this.Ky[t]=s.trim()}};static Xc=(t,i)=>{if(!this.lx[t])return null;const s=this.lx[t];return s?.Ax(i)??null};read(t){for(let i=0;i<10;i++)0!==t.ZA&&(t.Fc--,this.ux[i]=new e,this.ux[i]?.read(t));this.wx=t.KA,this.loopEnd=t.KA}trim(){let t=9999999;for(let i=0;i<10;i++)this.ux[i]&&(this.ux[i].start/20|0)i&&(i=this.ux[t].length+this.ux[t].start);if(0===i)return 0;let s=22050*i/1e3|0,h=22050*this.wx/1e3|0,e=22050*this.loopEnd/1e3|0;(h<0||e<0||e>s||h>=e)&&(t=0);let n=s+(e-h)*(t-1);for(let t=44;t>8<<24>>24)}if(t>1){h+=44,e+=44,s+=44,n+=44;const i=n-s;for(let t=s-1;t>=e;t--)o.nx&&(o.nx[t+i]=o.nx[t]);for(let i=1;i{s.d(i,{$a:()=>a,qa:()=>o,ds:()=>h,uO:()=>e,Cr:()=>n,aO:()=>r,Kn:()=>l});class h extends Array{constructor(t,i){super(t);for(let s=0;s{s.d(i,{Pk:()=>l,Ho:()=>e,Dk:()=>o,Wo:()=>h,Xa:()=>n,Oc:()=>r,Nk:()=>a});const h=async t=>new Promise((i=>setTimeout(i,t))),e=async t=>new Int8Array(await(await fetch(t)).arrayBuffer()),n=async t=>(await fetch(t)).text();function r(t,i,s,h,e){for(;e--;)s[h++]=t[i++]}function o(t){let i=0n;for(let s=0;s0n;)i.unshift(Number(0xffn&t)),t>>=8n;return 128&i[0]&&i.unshift(0),new Uint8Array(i)}function a(t,i,s){let h=1n;for(;i>0n;)i%2n===1n&&(h=h*t%s),t=t*t%s,i>>=1n;return h}},7953:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1069);class e{static yx=new Uint16Array(['d','o','t'].join('').split('').map((t=>t.charCodeAt(0))));static mx=new Uint16Array(['(','a',')'].join('').split('').map((t=>t.charCodeAt(0))));static Ix=new Uint16Array(['s','l','a','s','h'].join('').split('').map((t=>t.charCodeAt(0))));static _x=['cook',"cook's",'cooks','seeks','sheet'];static Ex=[];static gx=[];static Cx=[];static Tx=[];static Ox=[];static bx=[];static ec=t=>{const i=new h.A(t.read('fragmentsenc.txt')),s=new h.A(t.read('badenc.txt')),e=new h.A(t.read('domainenc.txt')),n=new h.A(t.read('tldlist.txt'));this.read(s,e,i,n)};static filter=t=>{const i=[...t];this.format(i);const s=i.join('').trim(),h=s.toLowerCase(),e=[...h];this.vx(e),this.Lx(e),this.Rx(e),this.Sx(e);for(let t=0;t{this.xx(t),this.Dx(i),this.Nx(s),this.Px(h)};static Px=t=>{const i=t.Ko;for(let s=0;st.ZA))};static xx=t=>{const i=t.Ko;for(let s=0;st.ZA));const i=new Array(t.ZA).fill([]).map((()=>[t.zA,t.zA]));i.length>0&&(this.Tx[s]=i)}};static Dx=t=>{const i=t.Ko;for(let s=0;st.ZA))};static Nx=t=>{const i=t.Ko;for(let s=0;s{const i=[...t],s=[...t];this.Fx(null,i,this.yx),this.Fx(null,s,this.Ix);for(let h=0;h{for(let i=0;i<2;i++)for(let i=this.Cx.length-1;i>=0;i--)this.Fx(this.Tx[i],t,this.Cx[i])};static Rx=t=>{const i=[...t],s=[...t];this.Fx(null,i,this.mx),this.Fx(null,s,this.yx);for(let h=this.Ox.length-1;h>=0;h--)this.Bx(s,i,this.Ox[h],t)};static Sx=t=>{for(let i=0;i=0&&e{if(this.Xx(t))return!0;const i=this.zx(t),s=this.bx,h=s.length;if(i===s[0]||i===s[h-1])return!0;let e=0,n=h-1;for(;e<=n;){const t=(e+n)/2|0;if(i===s[t])return!0;i{if(t.length>6)return 0;let i=0;for(let s=0;s{for(let s=i;s=0;s++)if(this.Zx(t[s]))return s;return-1};static Vx=(t,i)=>{for(let s=t;s=0;s++)if(!this.Zx(i[s]))return s;return i.length};static qx=(t,i,s)=>i===s||'o'===i&&'0'===s?1:'o'===i&&'('===s&&')'===t?2:'c'!==i||'('!==s&&'<'!==s&&'['!==s?'e'===i&&'€'===s||'s'===i&&'$'===s||'l'===i&&'i'===s?1:0:1;static Bx=(t,i,s,h)=>{const e=s.length,n=h.length;for(let r=0;r<=n-e;r++){const{$x:e,Jx:n}=this.Qx(r,s,h);if(!e)continue;const o=this.tD(r,h,3,i,['@']),l=this.iD(n-1,h,3,t,['.',',']);(o>2||l>2)&&this.Yx(r,n,h)}};static Qx=(t,i,s)=>{const h=i.length;let e=t,n=0;for(;e0)e+=l,n++;else{if(0===n)break;const s=this.qx(o,String.fromCharCode(i[n-1]),r);if(s>0)e+=s,1===n&&t++;else{if(n>=h||!this.Hx(r))break;e++}}}return{$x:n>=h,Jx:e}};static Fx=(t,i,s)=>{if(!(s.length>i.length))for(let h=0;h<=i.length-s.length;h++){let e=h;const{Jx:n,sD:r,hD:o,eD:l,nD:a}=this.rD(i,s,e);e=n;let c=i[e],f=e+1=s.length)||l&&a)continue;let u,d=!0;if(o){let t=!1,s=!1;if((h-1<0||this.Hx(i[h-1])&&"'"!==i[h-1])&&(t=!0),(e>=i.length||this.Hx(i[e])&&"'"!==i[e])&&(s=!0),!t||!s){let s=!1;for(u=h-2,t&&(u=h);!s&&u=0&&(!this.Hx(i[u])||"'"===i[u])){const t=[];let h;for(h=0;h<3&&u+h=0&&(!this.Hx(i[u-1])||"'"===i[u-1])&&(e=!1),e&&!this.Kx(t)&&(s=!0)}u++}s||(d=!1)}}else{c=' ',h-1>=0&&(c=i[h-1]),f=' ',e{let h=s,e=0,n=0,r=!1,o=!1,l=!1;for(;h=t.length||o&&l);){const a=t[h],c=h+10)1===f&&this.Zx(a)&&(o=!0),2===f&&(this.Zx(a)||this.Zx(c))&&(o=!0),h+=f,e++;else{if(0===e)break;let t;if((t=this.cD(c,String.fromCharCode(i[e-1]),a))>0)h+=t;else{if(e>=i.length||!this.Wx(a))break;if(this.Hx(a)&&"'"!==a&&(r=!0),this.Zx(a)&&(l=!0),h++,n++,(100*n/(h-s)|0)>90)break}}}return{Jx:h,sD:e,hD:r,eD:o,nD:l}};static cD=(t,i,s)=>{if(i===s)return 1;if(i>='a'&&i<='m'){if('a'===i)return'4'!==s&&'@'!==s&&'^'!==s?'/'===s&&'\\'===t?2:0:1;if('b'===i)return'6'!==s&&'8'!==s?'1'===s&&'3'===t?2:0:1;if('c'===i)return'('!==s&&'<'!==s&&'{'!==s&&'['!==s?0:1;if('d'===i)return'['===s&&')'===t?2:0;if('e'===i)return'3'!==s&&'€'!==s?0:1;if('f'===i)return'p'===s&&'h'===t?2:'£'===s?1:0;if('g'===i)return'9'!==s&&'6'!==s?0:1;if('h'===i)return'#'===s?1:0;if('i'===i)return'y'!==s&&'l'!==s&&'j'!==s&&'1'!==s&&'!'!==s&&':'!==s&&';'!==s&&'|'!==s?0:1;if('j'===i)return 0;if('k'===i)return 0;if('l'===i)return'1'!==s&&'|'!==s&&'i'!==s?0:1;if('m'===i)return 0}if(i>='n'&&i<='z'){if('n'===i)return 0;if('o'===i)return'0'!==s&&'*'!==s?'('===s&&')'===t||'['===s&&']'===t||'{'===s&&'}'===t||'<'===s&&'>'===t?2:0:1;if('p'===i)return 0;if('q'===i)return 0;if('r'===i)return 0;if('s'===i)return'5'!==s&&'z'!==s&&'$'!==s&&'2'!==s?0:1;if('t'===i)return'7'!==s&&'+'!==s?0:1;if('u'===i)return'v'===s?1:'\\'===s&&'/'===t||'\\'===s&&'|'===t||'|'===s&&'/'===t?2:0;if('v'===i)return'\\'===s&&'/'===t||'\\'===s&&'|'===t||'|'===s&&'/'===t?2:0;if('w'===i)return'v'===s&&'v'===t?2:0;if('x'===i)return')'===s&&'('===t||'}'===s&&'{'===t||']'===s&&'['===t||'>'===s&&'<'===t?2:0;if('y'===i)return 0;if('z'===i)return 0}return i>='0'&&i<='9'?'0'===i?'o'===s||'O'===s?1:'('===s&&')'===t||'{'===s&&'}'===t||'['===s&&']'===t?2:0:'1'===i&&'l'===s?1:0:','===i?'.'===s?1:0:'.'===i?','===s?1:0:'!'===i&&'i'===s?1:0};static lD=(t,i,s)=>{let h=0,e=i.length-1;for(;h<=e;){const n=(h+e)/2|0;if(i[n][0]===t&&i[n][1]===s)return!0;tthis.jx(t)?t.charCodeAt(0)+1-'a'.charCodeAt(0):"'"===t?28:this.Zx(t)?t.charCodeAt(0)+29-'0'.charCodeAt(0):27;static Ux=(t,i,s,h,e)=>{if(!(h.length>s.length))for(let n=0;n<=s.length-h.length;n++){const{Jx:r,fD:o}=this.uD(s,h,n);if(o0&&c>0&&(l=!0),2===i&&(a>2&&c>0||a>0&&c>2)&&(l=!0),3===i&&a>0&&c>2&&(l=!0),!l)continue;let f,u=n,d=r-1,w=!1;if(a>2){if(4===a)for(w=!1,f=n-1;f>=0;f--)if(w){if('*'!==e[f])break;u=f}else'*'===e[f]&&(u=f,w=!0);for(w=!1,f=u-1;f>=0;f--)if(w){if(this.Hx(s[f]))break;u=f}else this.Hx(s[f])||(w=!0,u=f)}if(c>2){if(4===c)for(w=!1,f=d+1;f{let h=0;for(;s0)s+=r,h++;else{if(0===h)break;let t;if((t=this.qx(n,String.fromCharCode(i[h-1]),e))>0)s+=t;else{if(!this.Hx(e))break;s++}}}return{Jx:s,fD:h}};static Hx=t=>!this.aD(t)&&!this.Zx(t);static Wx=t=>!this.jx(t)||('v'===t||'x'===t||'j'===t||'q'===t||'z'===t);static aD=t=>this.jx(t)||this.dD(t);static Zx=t=>t>='0'&&t<='9';static jx=t=>t>='a'&&t<='z';static dD=t=>t>='A'&&t<='Z';static Xx=t=>{for(let i=0;i{for(let h=t;h{let s=0;for(let h=i-1;h>=0&&this.Hx(t[h]);h--)'*'===t[h]&&s++;return s};static AD=(t,i)=>{let s=0;for(let h=i+1;h(e?this.wD(i,s):this.AD(i,s))>=h?4:this.Hx(e?t[s-1]:t[s+1])?1:0;static tD=(t,i,s,h,e)=>{if(0===t)return 2;for(let s=t-1;s>=0&&this.Hx(i[s]);s--)if(e.includes(i[s]))return 3;return this.yD(i,h,t,s,!0)};static iD=(t,i,s,h,e)=>{if(t+1===i.length)return 2;for(let s=t+1;s{let i=0;for(let s=0;st>=' '&&t<=''||' '===t||'\n'===t||'\t'===t||'£'===t||'€'===t;static Mx=(t,i)=>{for(let s=0;s{let i=!0;for(let s=0;s{s.d(i,{A:()=>h});class h{static mD=[' ','e','t','a','o','i','h','n','s','r','d','l','u','m','w','c','y','f','g','p','b','v','k','x','j','q','z','0','1','2','3','4','5','6','7','8','9',' ','!','?','.',',',':',';','(',')','-','&','*','\\','\'','@','#','+','=','£','$','%','"','[',']'];static ID=[];static ec=(t,i)=>{let s,h=0,e=-1;for(let n=0;n>4&15,-1!==e?(this.ID[h++]=this.mD[(e<<4)+s-195],e=-1):s<13?this.ID[h++]=this.mD[s]:e=s,s=15&i,-1!==e?(this.ID[h++]=this.mD[(e<<4)+s-195],e=-1):s<13?this.ID[h++]=this.mD[s]:e=s}let n=!0;for(let t=0;t='a'&&i<='z'&&(this.ID[t]=i.toUpperCase(),n=!1),'.'!==i&&'!'!==i||(n=!0)}return this.ID.slice(0,h).join('')};static uA=(t,i)=>{i.length>80&&(i=i.substring(0,80)),i=i.toLowerCase();let s=-1;for(let h=0;h12&&(n+=195),-1===s?n<13?s=n:t.p1(n):n<13?(t.p1((s<<4)+n),s=-1):(t.p1((s<<4)+(n>>4)),s=15&n)}-1!==s&&t.p1(s<<4)}}},1908:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(9763);class e{static _D=null;static load=async t=>{this._D=await(0,h.F)(new WebAssembly.Module(t),{env:void 0})};static read=(t,i,s,h)=>{if(!this._D)throw new Error('bz2 not found!!');return Int8Array.from(this._D.read(t,i,s,h))}}},123:(t,i,s)=>{let h;async function e(t,i){n(i);try{const i=await window.audioContext.decodeAudioData(Uint8Array.from(t).buffer);let s=window.audioContext.createBufferSource();s.buffer=i,s.connect(h),s.start()}catch(t){console.log(t)}}function n(t){h||(h=window.audioContext.createGain(),h.connect(window.audioContext.destination)),h.gain.value=t/256}function r(t,i){window._tinyMidiPlay&&window._tinyMidiPlay(t,i/256)}function o(t){window._tinyMidiVolume&&window._tinyMidiVolume(t/256)}function l(){window._tinyMidiStop&&window._tinyMidiStop()}s.d(i,{zc:()=>e,Xo:()=>r,jp:()=>n,vo:()=>l,zp:()=>o})},9763:(t,i,s)=>{async function h(t,i={}){const s={env:Object.assign(Object.create(globalThis),i.env||{},{abort(t,i,s,h){t=r(t>>>0),i=r(i>>>0),s>>>=0,h>>>=0,(()=>{throw Error(`${t} in ${i}:${s}:${h}`)})()}})},{exports:h}=await WebAssembly.instantiate(t,s),e=h.memory||i.env.memory,n=Object.setPrototypeOf({read:(t,i,s,n)=>(i=function(t,i,s,n,r){if(null==n)return 0;const o=n.length,l=h.__pin(h.__new(o<>>0;if(r)new r(e.buffer,l,o).set(n);else for(let i=0;i>>0),n[i]);return h.__unpin(l),l}(l,6,0,i,Int8Array)||function(){throw TypeError("value must not be null")}(),function(t,i,s){if(!s)return null;const h=function(t){try{return o.getUint32(t,!0)}catch{return o=new DataView(e.buffer),o.getUint32(t,!0)}}(s-4)>>>i,n=new Array(h);for(let e=0;e>>0));return n}(a,0,h.read(t,i,s,n)>>>0))},h);function r(t){if(!t)return null;const i=t+new Uint32Array(e.buffer)[t-4>>>2]>>>1,s=new Uint16Array(e.buffer);let h=t>>>1,n="";for(;i-h>1024;)n+=String.fromCharCode(...s.subarray(h,h+=1024));return n+String.fromCharCode(...s.subarray(h,i))}let o=new DataView(e.buffer);function l(t,i){try{o.setUint8(t,i,!0)}catch{o=new DataView(e.buffer),o.setUint8(t,i,!0)}}function a(t){try{return o.getInt8(t,!0)}catch{return o=new DataView(e.buffer),o.getInt8(t,!0)}}return n}s.d(i,{F:()=>h})},9896:(t,i,s)=>{var h=s(8151);!function(){window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioContext&&(window.audioContext=new window.AudioContext);var t=function(i){if(window.audioContext){var s=window.audioContext.createBuffer(1,1,22050),h=window.audioContext.createBufferSource();h.buffer=s,h.connect(window.audioContext.destination),h.start?h.start(0):h.play?h.play(0):h.noteOn&&h.noteOn(0)}document.removeEventListener('touchstart',t),document.removeEventListener('touchend',t),document.removeEventListener('click',t)};document.addEventListener('touchstart',t),document.addEventListener('touchend',t),document.addEventListener('click',t)}(),(async()=>{let t=new Float32Array,i=window.audioContext.createGain();i.gain.value=.1,i.connect(window.audioContext.destination);let s=window.audioContext.currentTime,e=[];const n=new h.A({ED:30,gD:i=>{let s=new Float32Array(i.buffer),h=new Float32Array(t.length+s.length);h.set(t,0),h.set(s,t.length),t=h},CD:t=>{},bufferSize:102400});await n.init();const r=await fetch('./SCC1_Florestan.sf2'),o=new Uint8Array(await r.arrayBuffer());function l(){if(!window.audioContext||!t.length)return;let h=window.audioContext.createBufferSource();const n=t.length/2,r=window.audioContext.createBuffer(2,n,44100);for(let i=0;i<2;i++){const s=r.getChannelData(i);let h=i;for(let i=0;i{if(a&&clearInterval(a),t=new Float32Array,e.length){let t=i.gain.value;i.gain.value=0,e.forEach((t=>{t.stop(window.audioContext.currentTime)})),e=[],i.gain.value=t}},window._tinyMidiVolume=(t=1)=>{i.gain.value=t},window._tinyMidiPlay=async(t,i=1)=>{t&&(await window._tinyMidiStop(),-1!=i&&window._tinyMidiVolume(i),s=window.audioContext.currentTime,a=setInterval(l,250),n.OD(t))}})()},8151:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(5473);const e=class{constructor(t={}){this.bD=void 0,this.vD=0,this.LD=0,this.RD=0,this.ED=t.ED||100,this.sampleRate=t.sampleRate||44100,this.SD=t.SD||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.MD(1),this.gD=t.gD||(()=>{}),this.CD=t.CD||(()=>{}),this.kD=void 0,this.test=0}async init(){if(!this.bD){if('undefined'!=typeof process){const{xD:t}=await import('path'),{DD:i}=await import('module');globalThis.__dirname=t("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js"),globalThis.require=i("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js")}this.bD=await(0,h.A)(),this.ND=this.bD._malloc(this.bufferSize),this.PD=this.bD._malloc(8)}}MD(t){this.bufferSize=4*this.sampleRate*this.SD*t}FD(){if(!this.bD)throw new Error(`${this.constructor.name} not initalized. call .init()`)}TD(t){this.FD();const{_malloc:i,_free:s,_tsf_load_memory:h,_tsf_set_output:e,_tsf_channel_set_bank_preset:n,_tsf_set_max_voices:r,_tsf_channel_set_presetnumber:o}=this.bD;s(this.vD),this.vD=i(t.length),this.bD.HEAPU8.set(t,this.vD),this.LD=h(this.vD,t.length),e(this.LD,2===this.SD?0:2,this.sampleRate,this.gain)}UD(){this.FD();const t=new Uint8Array(this.bufferSize);return t.set(this.bD.HEAPU8.subarray(this.ND,this.ND+this.bufferSize)),t}BD(t){const{_malloc:i,_free:s,_tml_load_memory:h}=this.bD;return s(this.RD),this.RD=i(t.length),this.bD.HEAPU8.set(t,this.RD),h(this.RD,t.length)}GD(t){const{_midi_render:i}=this.bD;return i(this.LD,t,this.SD,this.sampleRate,this.ND,this.bufferSize,this.PD)}OD(t){if(this.FD(),!this.LD)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.kD);const{setValue:i,getValue:s}=this.bD;i(this.PD,0,'double'),this.bD._tsf_reset(this.LD),this.bD._tsf_channel_set_bank_preset(this.LD,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let h=this.BD(t);const e=()=>{h=this.GD(h);const t=this.UD();this.gD(t),h?this.kD=setTimeout(e,this.ED):this.CD(s(this.PD,'double'))};this.kD=setTimeout(e,16)}}},8227:(t,i,s)=>{t.exports=s.p+"9f86b5397894e28b5ae2.wasm"},5473:(t,i,s)=>{var h;s.d(i,{A:()=>e});const e=(h="file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/tinymidipcm.mjs",function(t){var i,e,n=void 0!==(t=t||{})?t:{};n.ready=new Promise((function(t,s){i=t,e=s})),["_tsf_load_memory","_tsf_set_output","_tsf_channel_set_bank_preset","_tsf_set_max_voices","_tsf_channel_set_presetnumber","_tsf_reset","_tsf_close","_tml_load_memory","_midi_render","_malloc","_realloc","_free","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(n.ready,t)||Object.defineProperty(n.ready,t,{get:()=>z('You are getting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),set:()=>z('You are setting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js')})}));var r=Object.assign({},n),o=[],l='object'==typeof window,a='function'==typeof importScripts,c='object'==typeof process&&'object'==typeof process.versions&&'string'==typeof process.versions.node,f=!l&&!c&&!a;if(n.ENVIRONMENT)throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');var u,d,w,A='';if(c){if('undefined'==typeof process||!process.release||'node'!==process.release.name)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');var y,p;A=a?require('path').xD(A)+'/':__dirname+'/';var m=()=>{p||(y=require('fs'),p=require('path'))};u=(t,i)=>(m(),t=p.normalize(t),y.HD(t,i?void 0:'utf8')),w=t=>{var i=u(t,!0);return i.buffer||(i=new Uint8Array(i)),D(i.buffer),i},d=(t,i,s)=>{m(),t=p.normalize(t),y.WD(t,(function(t,h){t?s(t):i(h.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,'/'),o=process.argv.slice(2),process.on('uncaughtException',(function(t){if(!(t instanceof et))throw t})),process.on('unhandledRejection',(function(t){throw t})),n.inspect=function(){return'[Emscripten Module object]'}}else if(f){if('object'==typeof process&&'function'==typeof require||'object'==typeof window||'function'==typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');'undefined'!=typeof read&&(u=function(t){return read(t)}),w=function(t){let i;return'function'==typeof readbuffer?new Uint8Array(readbuffer(t)):(i=read(t,'binary'),D('object'==typeof i),i)},d=function(t,i,s){setTimeout((()=>i(w(t))),0)},'undefined'!=typeof scriptArgs?o=scriptArgs:void 0!==arguments&&(o=arguments),'undefined'!=typeof print&&('undefined'==typeof console&&(console={}),console.log=print,console.warn=console.error='undefined'!=typeof printErr?printErr:print)}else{if(!l&&!a)throw new Error('environment detection error');if(a?A=self.location.href:'undefined'!=typeof document&&document.currentScript&&(A=document.currentScript.src),h&&(A=h),A=0!==A.indexOf('blob:')?A.substr(0,A.replace(/[?#].*/,"").lastIndexOf('/')+1):'','object'!=typeof window&&'function'!=typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');u=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.send(null),i.responseText},a&&(w=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.responseType='arraybuffer',i.send(null),new Uint8Array(i.response)}),d=(t,i,s)=>{var h=new XMLHttpRequest;h.open('GET',t,!0),h.responseType='arraybuffer',h.onload=()=>{200==h.status||0==h.status&&h.response?i(h.response):s()},h.onerror=s,h.send(null)}}n.print||console.log.bind(console);var I,_,E=n.printErr||console.warn.bind(console);function g(t,i){Object.getOwnPropertyDescriptor(n,t)||Object.defineProperty(n,t,{configurable:!0,get:function(){z('Module.'+t+' has been replaced with plain '+i+' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')}})}function C(t){return'FS_createPath'===t||'FS_createDataFile'===t||'FS_createPreloadedFile'===t||'FS_unlink'===t||'addRunDependency'===t||'FS_createLazyFile'===t||'FS_createDevice'===t||'removeRunDependency'===t}Object.assign(n,r),r=null,I='fetchSettings',Object.getOwnPropertyDescriptor(n,I)&&z('`Module.'+I+'` was supplied but `'+I+'` not included in INCOMING_MODULE_JS_API'),n.arguments&&(o=n.arguments),g('arguments','arguments_'),n.thisProgram&&n.thisProgram,g('thisProgram','thisProgram'),n.quit&&n.quit,g('quit','quit_'),D(void 0===n.memoryInitializerPrefixURL,'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===n.pthreadMainPrefixURL,'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'),D(void 0===n.cdInitializerPrefixURL,'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===n.filePackagePrefixURL,'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'),D(void 0===n.read,'Module.read option was removed (modify read_ in JS)'),D(void 0===n.readAsync,'Module.readAsync option was removed (modify readAsync in JS)'),D(void 0===n.readBinary,'Module.readBinary option was removed (modify readBinary in JS)'),D(void 0===n.setWindowTitle,'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'),D(void 0===n.TOTAL_MEMORY,'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'),g('read','read_'),g('readAsync','readAsync'),g('readBinary','readBinary'),g('setWindowTitle','setWindowTitle'),D(!f,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),n.wasmBinary&&(_=n.wasmBinary),g('wasmBinary','wasmBinary');var T;n.noExitRuntime;g('noExitRuntime','noExitRuntime'),'object'!=typeof WebAssembly&&z('no native wasm support detected');var O,b,v,L,R,S,M,k,x=!1;function D(t,i){t||z('Assertion failed'+(i?': '+i:''))}function N(t){O=t,n.HEAP8=b=new Int8Array(t),n.HEAP16=L=new Int16Array(t),n.HEAP32=R=new Int32Array(t),n.HEAPU8=v=new Uint8Array(t),n.HEAPU16=new Uint16Array(t),n.HEAPU32=S=new Uint32Array(t),n.HEAPF32=M=new Float32Array(t),n.HEAPF64=k=new Float64Array(t)}'undefined'!=typeof TextDecoder&&new TextDecoder('utf8');var P=5242880;n.TOTAL_STACK&&D(P===n.TOTAL_STACK,'the stack size can no longer be determined at runtime');var F=n.INITIAL_MEMORY||16777216;function U(){if(!x){var t=ft(),i=S[t>>2],s=S[t+4>>2];34821223==i&&2310721022==s||z('Stack overflow! Stack cookie has been overwritten at 0x'+t.toString(16)+', expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+s.toString(16)+' 0x'+i.toString(16)),1668509029!==S[0]&&z('Runtime error: The application has corrupted its heap memory area (address zero)!')}}g('INITIAL_MEMORY','INITIAL_MEMORY'),D(F>=P,'INITIAL_MEMORY should be larger than TOTAL_STACK, was '+F+'! (TOTAL_STACK='+P+')'),D('undefined'!=typeof Int32Array&&'undefined'!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,'JS engine does not provide full typed array support'),D(!n.wasmMemory,'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'),D(16777216==F,'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'),function(){var t=new Int16Array(1),i=new Int8Array(t.buffer);if(t[0]=25459,115!==i[0]||99!==i[1])throw'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'}();var B=[],G=[],H=[],W=!1;D(Math.imul,'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.fround,'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.clz32,'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.trunc,'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');var Y=0,V=null,K=null,X={};function z(t){n.onAbort&&n.onAbort(t),E(t='Aborted('+t+')'),x=!0;var i=new WebAssembly.RuntimeError(t);throw e(i),i}var j={error:function(){z('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM')},init:function(){j.error()},YD:function(){j.error()},VD:function(){j.error()},KD:function(){j.error()},open:function(){j.error()},XD:function(){j.error()},zD:function(){j.error()},jD:function(){j.error()},ZD:function(){j.error()},qD:function(){j.error()}};n.FS_createDataFile=j.YD,n.FS_createPreloadedFile=j.VD;var Z,q,$,J,Q='data:application/octet-stream;base64,';function tt(t){return t.startsWith(Q)}function it(t){return t.startsWith('file://')}function st(t,i){return function(){var s=t,h=i;return i||(h=n.asm),D(W,'native function `'+s+'` called before runtime initialization'),h[t]||D(h[t],'exported native function `'+s+'` not found'),h[t].apply(null,arguments)}}function ht(t){try{if(t==Z&&_)return new Uint8Array(_);if(w)return w(t);throw"both async and sync fetching of the wasm failed"}catch(t){z(t)}}function et(t){this.name='ExitStatus',this.message='Program terminated with exit('+t+')',this.status=t}function nt(t){for(;t.length>0;)t.shift()(n)}function rt(t){rt.$D||(rt.$D={}),rt.$D[t]||(rt.$D[t]=1,c&&(t='warning: '+t),E(t))}function ot(t){try{return T.JD(t-O.byteLength+65535>>>16),N(T.buffer),1}catch(i){E('emscripten_realloc_buffer: Attempted to grow heap from '+O.byteLength+' bytes to '+t+' bytes, but got error: '+i)}}n.locateFile?tt(Z='tinymidipcm.wasm')||(q=Z,Z=n.locateFile?n.locateFile(q,A):A+q):Z=new URL(s(8227),s.b).toString();var lt,at={"emscripten_memcpy_big":function(t,i,s){v.copyWithin(t,i,i+s)},"emscripten_resize_heap":function(t){var i=v.length;D((t>>>=0)>i);var s,h,e=2147483648;if(t>e)return E('Cannot enlarge memory, asked to go up to '+t+' bytes, but the limit is '+e+' bytes!'),!1;for(var n=1;n<=4;n*=2){var r=i*(1+.2/n);r=Math.min(r,t+100663296);var o=Math.min(e,(s=Math.max(t,r))+((h=65536)-s%h)%h);if(ot(o))return!0}return E('Failed to grow the heap from '+i+' bytes to '+o+' bytes, not enough memory!'),!1}},ct=(function(){var t,i={'env':at,'wasi_snapshot_preview1':at};function s(t,i){var s,h=t.exports;n.asm=h,D(T=n.asm.memory,"memory not found in wasm exports"),N(T.buffer),D(n.asm.__indirect_function_table,"table not found in wasm exports"),s=n.asm.__wasm_call_ctors,G.unshift(s),function(t){if(Y--,n.monitorRunDependencies&&n.monitorRunDependencies(Y),t?(D(X[t]),delete X[t]):E('warning: run dependency removed without ID'),0==Y&&(null!==V&&(clearInterval(V),V=null),K)){var i=K;K=null,i()}}('wasm-instantiate')}t='wasm-instantiate',Y++,n.monitorRunDependencies&&n.monitorRunDependencies(Y),t?(D(!X[t]),X[t]=1,null===V&&'undefined'!=typeof setInterval&&(V=setInterval((function(){if(x)return clearInterval(V),void(V=null);var t=!1;for(var i in X)t||(t=!0,E('still waiting on run dependencies:')),E('dependency: '+i);t&&E('(end of list)')}),1e4))):E('warning: run dependency added without ID');var h=n;function r(t){D(n===h,'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'),h=null,s(t.instance)}function o(t){return function(){if(!_&&(l||a)){if('function'==typeof fetch&&!it(Z))return fetch(Z,{credentials:'same-origin'}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+Z+"'";return t.arrayBuffer()})).catch((function(){return ht(Z)}));if(d)return new Promise((function(t,i){d(Z,(function(i){t(new Uint8Array(i))}),i)}))}return Promise.resolve().then((function(){return ht(Z)}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){E('failed to asynchronously prepare wasm: '+t),it(Z)&&E('warning: Loading from a file URI ('+Z+') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing'),z(t)}))}if(n.instantiateWasm)try{return n.instantiateWasm(i,s)}catch(t){E('Module.instantiateWasm callback failed with error: '+t),e(t)}(_||'function'!=typeof WebAssembly.instantiateStreaming||tt(Z)||it(Z)||c||'function'!=typeof fetch?o(r):fetch(Z,{credentials:'same-origin'}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(r,(function(t){return E('wasm streaming compile failed: '+t),E('falling back to ArrayBuffer instantiation'),o(r)}))}))).catch(e)}(),n.___wasm_call_ctors=st("__wasm_call_ctors"),n._malloc=st("malloc"),n._free=st("free"),n._tsf_load_memory=st("tsf_load_memory"),n._tsf_close=st("tsf_close"),n._tsf_reset=st("tsf_reset"),n._tsf_set_output=st("tsf_set_output"),n._tsf_set_max_voices=st("tsf_set_max_voices"),n._realloc=st("realloc"),n._tsf_channel_set_presetnumber=st("tsf_channel_set_presetnumber"),n._tsf_channel_set_bank_preset=st("tsf_channel_set_bank_preset"),n._tml_load_memory=st("tml_load_memory"),n._midi_render=st("midi_render"),n.___errno_location=st("__errno_location"),n._fflush=st("fflush"),n._emscripten_stack_init=function(){return(ct=n._emscripten_stack_init=n.asm.emscripten_stack_init).apply(null,arguments)}),ft=(n._emscripten_stack_get_free=function(){return(n._emscripten_stack_get_free=n.asm.emscripten_stack_get_free).apply(null,arguments)},n._emscripten_stack_get_base=function(){return(n._emscripten_stack_get_base=n.asm.emscripten_stack_get_base).apply(null,arguments)},n._emscripten_stack_get_end=function(){return(ft=n._emscripten_stack_get_end=n.asm.emscripten_stack_get_end).apply(null,arguments)});function ut(){var t;ct(),D(!(3&(t=ft()))),S[t>>2]=34821223,S[t+4>>2]=2310721022,S[0]=1668509029}function dt(t){function s(){lt||(lt=!0,n.calledRun=!0,x||(D(!W),W=!0,U(),nt(G),i(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),D(!n._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(U(),n.postRun)for('function'==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)t=n.postRun.shift(),H.unshift(t);var t;nt(H)}()))}t=t||o,Y>0||(ut(),function(){if(n.preRun)for('function'==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)t=n.preRun.shift(),B.unshift(t);var t;nt(B)}(),Y>0||(n.setStatus?(n.setStatus('Running...'),setTimeout((function(){setTimeout((function(){n.setStatus('')}),1),s()}),1)):s(),U()))}if(n.stackSave=st("stackSave"),n.stackRestore=st("stackRestore"),n.stackAlloc=st("stackAlloc"),n.setValue=function(t,i,s="i8"){switch(s.endsWith('*')&&(s='*'),s){case'i1':case'i8':b[0|t]=i;break;case'i16':L[t>>1]=i;break;case'i32':R[t>>2]=i;break;case'i64':J=[i>>>0,($=i,+Math.abs($)>=1?$>0?(0|Math.min(+Math.floor($/4294967296),4294967295))>>>0:~~+Math.ceil(($-+(~~$>>>0))/4294967296)>>>0:0)],R[t>>2]=J[0],R[t+4>>2]=J[1];break;case'float':M[t>>2]=i;break;case'double':k[t>>3]=i;break;case'*':S[t>>2]=i;break;default:z('invalid type for setValue: '+s)}},n.getValue=function(t,i="i8"){switch(i.endsWith('*')&&(i='*'),i){case'i1':case'i8':return b[0|t];case'i16':return L[t>>1];case'i32':case'i64':return R[t>>2];case'float':return M[t>>2];case'double':return k[t>>3];case'*':return S[t>>2];default:z('invalid type for getValue: '+i)}return null},['run','UTF8ArrayToString','UTF8ToString','stringToUTF8Array','stringToUTF8','lengthBytesUTF8','addOnPreRun','addOnInit','addOnPreMain','addOnExit','addOnPostRun','addRunDependency','removeRunDependency','FS_createFolder','FS_createPath','FS_createDataFile','FS_createPreloadedFile','FS_createLazyFile','FS_createLink','FS_createDevice','FS_unlink','getLEB','getFunctionTables','alignFunctionTables','registerFunctions','prettyPrint','getCompilerSetting','print','printErr','callMain','abort','keepRuntimeAlive','wasmMemory','stackAlloc','stackSave','stackRestore','getTempRet0','setTempRet0','writeStackCookie','checkStackCookie','ptrToString','zeroMemory','stringToNewUTF8','exitJS','getHeapMax','emscripten_realloc_buffer','ENV','ERRNO_CODES','ERRNO_MESSAGES','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','DNS','getHostByName','Protocols','Sockets','getRandomDevice','warnOnce','traverseStack','UNWIND_CACHE','convertPCtoSourceLocation','readAsmConstArgsArray','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','handleException','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','freeTableIndexes','functionsInTableMap','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','PATH','PATH_FS','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16Decoder','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeArrayToMemory','writeAsciiToMemory','SYSCALLS','getSocketFromFD','getSocketAddress','JSEvents','registerKeyEventCallback','specialHTMLTargets','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','currentFullscreenStrategy','restoreOldWindowedStyle','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','demangle','demangleAll','jsStackTrace','stackTrace','ExitStatus','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','dlopenMissingError','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','uncaughtExceptionCount','exceptionLast','exceptionCaught','ExceptionInfo','exception_addRef','exception_decRef','Browser','setMainLoop','wget','FS','MEMFS','TTY','PIPEFS','SOCKFS','_setNetworkCallback','tempFixedLengthArray','miniTempWebGLFloatBuffers','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','GL','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','AL','SDL_unicode','SDL_ttfContext','SDL_audio','SDL','SDL_gfx','GLUT','EGL','GLFW_Window','GLFW','GLEW','IDBStore','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){Object.getOwnPropertyDescriptor(n,t)||Object.defineProperty(n,t,{configurable:!0,get:function(){var i="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";C(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),z(i)}})})),['ptrToString','zeroMemory','stringToNewUTF8','exitJS','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','getHostByName','getRandomDevice','traverseStack','convertPCtoSourceLocation','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeAsciiToMemory','getSocketFromFD','getSocketAddress','registerKeyEventCallback','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','ExceptionInfo','exception_addRef','exception_decRef','setMainLoop','_setNetworkCallback','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','SDL_unicode','SDL_ttfContext','SDL_audio','GLFW_Window','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){'undefined'==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var i='`'+t+'` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line';C(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),rt(i)}})})),K=function t(){lt||dt(),lt||(K=t)},n.preInit)for('function'==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return dt(),t.ready})}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var s=n[t]={exports:{}};return e[t](s,s.exports,r),s.exports}r.m=e,t="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",i="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",s="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",h=t=>{t&&t.d<1&&(t.d=1,t.forEach((t=>t.r--)),t.forEach((t=>t.r--?t.r++:t())))},r.a=(e,n,r)=>{var o;r&&((o=[]).d=-1);var l,a,c,f=new Set,u=e.exports,d=new Promise(((t,i)=>{c=i,a=t}));d[i]=u,d[t]=t=>(o&&t(o),f.forEach(t),d.catch((t=>{}))),e.exports=d,n((e=>{var n;l=(e=>e.map((e=>{if(null!==e&&"object"==typeof e){if(e[t])return e;if(e.then){var n=[];n.d=0,e.then((t=>{r[i]=t,h(n)}),(t=>{r[s]=t,h(n)}));var r={};return r[t]=t=>t(n),r}}var o={};return o[t]=t=>{},o[i]=e,o})))(e);var r=()=>l.map((t=>{if(t[s])throw t[s];return t[i]})),a=new Promise((i=>{(n=()=>i(r)).r=0;var s=t=>t!==o&&!f.has(t)&&(f.add(t),t&&!t.d&&(n.r++,t.push(n)));l.map((i=>i[t](s)))}));return n.r?a:r()}),(t=>(t?c(d[s]=t):a(u),h(o)))),o&&o.d<0&&(o.d=0)},r.d=(t,i)=>{for(var s in i)r.o(i,s)&&!r.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:i[s]})},r.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),r.p="/Client2/",r.b=document.baseURI||self.location.href;r(7906)})(); \ No newline at end of file